claude // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. var T5B=Object.create;var{getPrototypeOf:z5B,defineProperty:BHH,getOwnPropertyNames:icH,getOwnPropertyDescriptor:N5B}=Object,ncH=Object.prototype.hasOwnProperty,dA=(H,$,A)=>{for(let L of icH($))if(!ncH.call(H,L)&&L!=="default")BHH(H,L,{get:()=>$[L],enumerable:!0});if(A){for(let L of icH($))if(!ncH.call(A,L)&&L!=="default")BHH(A,L,{get:()=>$[L],enumerable:!0});return A}},b=(H,$,A)=>{A=H!=null?T5B(z5B(H)):{};let L=$||!H||!H.__esModule?BHH(A,"default",{value:H,enumerable:!0}):A;for(let I of icH(H))if(!ncH.call(L,I))BHH(L,I,{get:()=>H[I],enumerable:!0});return L},umA=new WeakMap,WN=(H)=>{var $=umA.get(H),A;if($)return $;if($=BHH({},"__esModule",{value:!0}),H&&typeof H==="object"||typeof H==="function")icH(H).map((L)=>!ncH.call($,L)&&BHH($,L,{get:()=>H[L],enumerable:!(A=N5B(H,L))||A.enumerable}));return umA.set(H,$),$},z=(H,$)=>()=>($||H(($={exports:{}}).exports,$),$.exports);var XA=(H,$)=>{for(var A in $)BHH(H,A,{get:$[A],enumerable:!0,configurable:!0,set:(L)=>$[A]=()=>L})};var K=(H,$)=>()=>(H&&($=H(H=0)),$);var gmA=z((FR1,O5B)=>{O5B.exports=require("/$bunfs/root/image-processor.node")});var mmA=z((KR1,x5B)=>{x5B.exports=require("/$bunfs/root/color-diff.node")});var pmA=z((QR1,S5B)=>{S5B.exports=require("/$bunfs/root/file-index.node")});var dmA=z((WR1,j5B)=>{j5B.exports=require("/$bunfs/root/ripgrep.node")});var R5B,rcH;var LS$=K(()=>{R5B=typeof global=="object"&&global&&global.Object===Object&&global,rcH=R5B});var y5B,v5B,aJ;var VN=K(()=>{LS$();y5B=typeof self=="object"&&self&&self.Object===Object&&self,v5B=rcH||y5B||Function("return this")(),aJ=v5B});var h5B,DQ;var fHH=K(()=>{VN();h5B=aJ.Symbol,DQ=h5B});function u5B(H){var $=b5B.call(H,XYH),A=H[XYH];try{H[XYH]=void 0;var L=!0}catch(D){}var I=k5B.call(H);if(L)if($)H[XYH]=A;else delete H[XYH];return I}var cmA,b5B,k5B,XYH,lmA;var imA=K(()=>{fHH();cmA=Object.prototype,b5B=cmA.hasOwnProperty,k5B=cmA.toString,XYH=DQ?DQ.toStringTag:void 0;lmA=u5B});function p5B(H){return m5B.call(H)}var g5B,m5B,nmA;var rmA=K(()=>{g5B=Object.prototype,m5B=g5B.toString;nmA=p5B});function l5B(H){if(H==null)return H===void 0?c5B:d5B;return amA&&amA in Object(H)?lmA(H):nmA(H)}var d5B="[object Null]",c5B="[object Undefined]",amA,iC;var EHH=K(()=>{fHH();imA();rmA();amA=DQ?DQ.toStringTag:void 0;iC=l5B});function i5B(H){var $=typeof H;return H!=null&&($=="object"||$=="function")}var f5;var hZ=K(()=>{f5=i5B});function t5B(H){if(!f5(H))return!1;var $=iC(H);return $==r5B||$==a5B||$==n5B||$==o5B}var n5B="[object AsyncFunction]",r5B="[object Function]",a5B="[object GeneratorFunction]",o5B="[object Proxy]",hfH;var acH=K(()=>{EHH();hZ();hfH=t5B});var s5B,ocH;var omA=K(()=>{VN();s5B=aJ["__core-js_shared__"],ocH=s5B});function e5B(H){return!!tmA&&tmA in H}var tmA,smA;var emA=K(()=>{omA();tmA=function(){var H=/[^.]+$/.exec(ocH&&ocH.keys&&ocH.keys.IE_PROTO||"");return H?"Symbol(src)_1."+H:""}();smA=e5B});function AXB(H){if(H!=null){try{return $XB.call(H)}catch($){}try{return H+""}catch($){}}return""}var HXB,$XB,Dk;var IS$=K(()=>{HXB=Function.prototype,$XB=HXB.toString;Dk=AXB});function GXB(H){if(!f5(H)||smA(H))return!1;var $=hfH(H)?MXB:IXB;return $.test(Dk(H))}var LXB,IXB,DXB,BXB,fXB,EXB,MXB,HpA;var $pA=K(()=>{acH();emA();hZ();IS$();LXB=/[\\^$.*+?()[\]{}|]/g,IXB=/^\[object .+?Constructor\]$/,DXB=Function.prototype,BXB=Object.prototype,fXB=DXB.toString,EXB=BXB.hasOwnProperty,MXB=RegExp("^"+fXB.call(EXB).replace(LXB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");HpA=GXB});function UXB(H,$){return H==null?void 0:H[$]}var ApA;var LpA=K(()=>{ApA=UXB});function XXB(H,$){var A=ApA(H,$);return HpA(A)?A:void 0}var Y_;var Yc=K(()=>{$pA();LpA();Y_=XXB});var JXB,Bk;var JYH=K(()=>{Yc();JXB=Y_(Object,"create"),Bk=JXB});function FXB(){this.__data__=Bk?Bk(null):{},this.size=0}var IpA;var DpA=K(()=>{JYH();IpA=FXB});function KXB(H){var $=this.has(H)&&delete this.__data__[H];return this.size-=$?1:0,$}var BpA;var fpA=K(()=>{BpA=KXB});function PXB(H){var $=this.__data__;if(Bk){var A=$[H];return A===QXB?void 0:A}return VXB.call($,H)?$[H]:void 0}var QXB="__lodash_hash_undefined__",WXB,VXB,EpA;var MpA=K(()=>{JYH();WXB=Object.prototype,VXB=WXB.hasOwnProperty;EpA=PXB});function CXB(H){var $=this.__data__;return Bk?$[H]!==void 0:YXB.call($,H)}var _XB,YXB,GpA;var UpA=K(()=>{JYH();_XB=Object.prototype,YXB=_XB.hasOwnProperty;GpA=CXB});function ZXB(H,$){var A=this.__data__;return this.size+=this.has(H)?0:1,A[H]=Bk&&$===void 0?wXB:$,this}var wXB="__lodash_hash_undefined__",XpA;var JpA=K(()=>{JYH();XpA=ZXB});function bfH(H){var $=-1,A=H==null?0:H.length;this.clear();while(++${DpA();fpA();MpA();UpA();JpA();bfH.prototype.clear=IpA;bfH.prototype.delete=BpA;bfH.prototype.get=EpA;bfH.prototype.has=GpA;bfH.prototype.set=XpA;DS$=bfH});function qXB(){this.__data__=[],this.size=0}var KpA;var QpA=K(()=>{KpA=qXB});function TXB(H,$){return H===$||H!==H&&$!==$}var ij;var kfH=K(()=>{ij=TXB});function zXB(H,$){var A=H.length;while(A--)if(ij(H[A][0],$))return A;return-1}var Cc;var FYH=K(()=>{kfH();Cc=zXB});function xXB(H){var $=this.__data__,A=Cc($,H);if(A<0)return!1;var L=$.length-1;if(A==L)$.pop();else OXB.call($,A,1);return--this.size,!0}var NXB,OXB,WpA;var VpA=K(()=>{FYH();NXB=Array.prototype,OXB=NXB.splice;WpA=xXB});function SXB(H){var $=this.__data__,A=Cc($,H);return A<0?void 0:$[A][1]}var PpA;var _pA=K(()=>{FYH();PpA=SXB});function jXB(H){return Cc(this.__data__,H)>-1}var YpA;var CpA=K(()=>{FYH();YpA=jXB});function RXB(H,$){var A=this.__data__,L=Cc(A,H);if(L<0)++this.size,A.push([H,$]);else A[L][1]=$;return this}var wpA;var ZpA=K(()=>{FYH();wpA=RXB});function ufH(H){var $=-1,A=H==null?0:H.length;this.clear();while(++${QpA();VpA();_pA();CpA();ZpA();ufH.prototype.clear=KpA;ufH.prototype.delete=WpA;ufH.prototype.get=PpA;ufH.prototype.has=YpA;ufH.prototype.set=wpA;wc=ufH});var yXB,Zc;var tcH=K(()=>{Yc();VN();yXB=Y_(aJ,"Map"),Zc=yXB});function vXB(){this.size=0,this.__data__={hash:new DS$,map:new(Zc||wc),string:new DS$}}var qpA;var TpA=K(()=>{FpA();KYH();tcH();qpA=vXB});function hXB(H){var $=typeof H;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?H!=="__proto__":H===null}var zpA;var NpA=K(()=>{zpA=hXB});function bXB(H,$){var A=H.__data__;return zpA($)?A[typeof $=="string"?"string":"hash"]:A.map}var qc;var QYH=K(()=>{NpA();qc=bXB});function kXB(H){var $=qc(this,H).delete(H);return this.size-=$?1:0,$}var OpA;var xpA=K(()=>{QYH();OpA=kXB});function uXB(H){return qc(this,H).get(H)}var SpA;var jpA=K(()=>{QYH();SpA=uXB});function gXB(H){return qc(this,H).has(H)}var RpA;var ypA=K(()=>{QYH();RpA=gXB});function mXB(H,$){var A=qc(this,H),L=A.size;return A.set(H,$),this.size+=A.size==L?0:1,this}var vpA;var hpA=K(()=>{QYH();vpA=mXB});function gfH(H){var $=-1,A=H==null?0:H.length;this.clear();while(++${TpA();xpA();jpA();ypA();hpA();gfH.prototype.clear=qpA;gfH.prototype.delete=OpA;gfH.prototype.get=SpA;gfH.prototype.has=RpA;gfH.prototype.set=vpA;MHH=gfH});function BS$(H,$){if(typeof H!="function"||$!=null&&typeof $!="function")throw TypeError(pXB);var A=function(){var L=arguments,I=$?$.apply(this,L):L[0],D=A.cache;if(D.has(I))return D.get(I);var B=H.apply(this,L);return A.cache=D.set(I,B)||D,B};return A.cache=new(BS$.Cache||MHH),A}var pXB="Expected a function",o$;var tD=K(()=>{scH();BS$.Cache=MHH;o$=BS$});function bpA(H){return($)=>{if($.code==="EPIPE")H.destroy()}}function kpA(){process.stdout.on("error",bpA(process.stdout)),process.stderr.on("error",bpA(process.stderr))}function upA(H,$){if(H.destroyed)return;H.write($)}function OD(H){upA(process.stdout,H)}function Tc(H){upA(process.stderr,H)}function dXB(H){let $=[],A=H.match(/^MCP server ["']([^"']+)["']/);if(A&&A[1])$.push("mcp"),$.push(A[1].toLowerCase());else{let D=H.match(/^([^:[]+):/);if(D&&D[1])$.push(D[1].trim().toLowerCase())}let L=H.match(/^\[([^\]]+)]/);if(L&&L[1])$.push(L[1].trim().toLowerCase());if(H.toLowerCase().includes("1p event:"))$.push("1p");let I=H.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(I&&I[1]){let D=I[1].trim().toLowerCase();if(D.length<30&&!D.includes(" "))$.push(D)}return Array.from(new Set($))}function cXB(H,$){if(!$)return!0;if(H.length===0)return!1;if($.isExclusive)return!H.some((A)=>$.exclude.includes(A));else return H.some((A)=>$.include.includes(A))}function mpA(H,$){if(!$)return!0;let A=dXB(H);return cXB(A,$)}var gpA;var ppA=K(()=>{tD();gpA=o$((H)=>{if(!H||H.trim()==="")return null;let $=H.split(",").map((D)=>D.trim()).filter(Boolean);if($.length===0)return null;let A=$.some((D)=>D.startsWith("!")),L=$.some((D)=>!D.startsWith("!"));if(A&&L)return null;let I=$.map((D)=>D.replace(/^!/,"").toLowerCase());return{include:A?[]:I,exclude:A?I:[],isExclusive:A}})});function lXB(){this.__data__=new wc,this.size=0}var dpA;var cpA=K(()=>{KYH();dpA=lXB});function iXB(H){var $=this.__data__,A=$.delete(H);return this.size=$.size,A}var lpA;var ipA=K(()=>{lpA=iXB});function nXB(H){return this.__data__.get(H)}var npA;var rpA=K(()=>{npA=nXB});function rXB(H){return this.__data__.has(H)}var apA;var opA=K(()=>{apA=rXB});function oXB(H,$){var A=this.__data__;if(A instanceof wc){var L=A.__data__;if(!Zc||L.length{KYH();tcH();scH();tpA=oXB});function mfH(H){var $=this.__data__=new wc(H);this.size=$.size}var nj;var WYH=K(()=>{KYH();cpA();ipA();rpA();opA();spA();mfH.prototype.clear=dpA;mfH.prototype.delete=lpA;mfH.prototype.get=npA;mfH.prototype.has=apA;mfH.prototype.set=tpA;nj=mfH});function sXB(H){return this.__data__.set(H,tXB),this}var tXB="__lodash_hash_undefined__",epA;var HdA=K(()=>{epA=sXB});function eXB(H){return this.__data__.has(H)}var $dA;var AdA=K(()=>{$dA=eXB});function ecH(H){var $=-1,A=H==null?0:H.length;this.__data__=new MHH;while(++${scH();HdA();AdA();ecH.prototype.add=ecH.prototype.push=epA;ecH.prototype.has=$dA;HlH=ecH});function HJB(H,$){var A=-1,L=H==null?0:H.length;while(++A{LdA=HJB});function $JB(H,$){return H.has($)}var $lH;var ES$=K(()=>{$lH=$JB});function IJB(H,$,A,L,I,D){var B=A&AJB,f=H.length,E=$.length;if(f!=E&&!(B&&E>f))return!1;var M=D.get(H),G=D.get($);if(M&&G)return M==$&&G==H;var U=-1,X=!0,J=A&LJB?new HlH:void 0;D.set(H,$),D.set($,H);while(++U{fS$();IdA();ES$();AlH=IJB});var DJB,pfH;var GS$=K(()=>{VN();DJB=aJ.Uint8Array,pfH=DJB});function BJB(H){var $=-1,A=Array(H.size);return H.forEach(function(L,I){A[++$]=[I,L]}),A}var DdA;var BdA=K(()=>{DdA=BJB});function fJB(H){var $=-1,A=Array(H.size);return H.forEach(function(L){A[++$]=L}),A}var dfH;var LlH=K(()=>{dfH=fJB});function YJB(H,$,A,L,I,D,B){switch(A){case _JB:if(H.byteLength!=$.byteLength||H.byteOffset!=$.byteOffset)return!1;H=H.buffer,$=$.buffer;case PJB:if(H.byteLength!=$.byteLength||!D(new pfH(H),new pfH($)))return!1;return!0;case GJB:case UJB:case FJB:return ij(+H,+$);case XJB:return H.name==$.name&&H.message==$.message;case KJB:case WJB:return H==$+"";case JJB:var f=DdA;case QJB:var E=L&EJB;if(f||(f=dfH),H.size!=$.size&&!E)return!1;var M=B.get(H);if(M)return M==$;L|=MJB,B.set(H,$);var G=AlH(f(H),f($),L,I,D,B);return B.delete(H),G;case VJB:if(US$)return US$.call(H)==US$.call($)}return!1}var EJB=1,MJB=2,GJB="[object Boolean]",UJB="[object Date]",XJB="[object Error]",JJB="[object Map]",FJB="[object Number]",KJB="[object RegExp]",QJB="[object Set]",WJB="[object String]",VJB="[object Symbol]",PJB="[object ArrayBuffer]",_JB="[object DataView]",fdA,US$,EdA;var MdA=K(()=>{fHH();GS$();kfH();MS$();BdA();LlH();fdA=DQ?DQ.prototype:void 0,US$=fdA?fdA.valueOf:void 0;EdA=YJB});function CJB(H,$){var A=-1,L=$.length,I=H.length;while(++A{cfH=CJB});var wJB,wE;var XV=K(()=>{wJB=Array.isArray,wE=wJB});function ZJB(H,$,A){var L=$(H);return wE(H)?L:cfH(L,A(H))}var DlH;var XS$=K(()=>{IlH();XV();DlH=ZJB});function qJB(H,$){var A=-1,L=H==null?0:H.length,I=0,D=[];while(++A{BlH=qJB});function TJB(){return[]}var flH;var FS$=K(()=>{flH=TJB});var zJB,NJB,GdA,OJB,lfH;var ElH=K(()=>{JS$();FS$();zJB=Object.prototype,NJB=zJB.propertyIsEnumerable,GdA=Object.getOwnPropertySymbols,OJB=!GdA?flH:function(H){if(H==null)return[];return H=Object(H),BlH(GdA(H),function($){return NJB.call(H,$)})},lfH=OJB});function xJB(H,$){var A=-1,L=Array(H);while(++A{UdA=xJB});function SJB(H){return H!=null&&typeof H=="object"}var sF;var rj=K(()=>{sF=SJB});function RJB(H){return sF(H)&&iC(H)==jJB}var jJB="[object Arguments]",KS$;var JdA=K(()=>{EHH();rj();KS$=RJB});var FdA,yJB,vJB,hJB,fk;var VYH=K(()=>{JdA();rj();FdA=Object.prototype,yJB=FdA.hasOwnProperty,vJB=FdA.propertyIsEnumerable,hJB=KS$(function(){return arguments}())?KS$:function(H){return sF(H)&&yJB.call(H,"callee")&&!vJB.call(H,"callee")},fk=hJB});function bJB(){return!1}var KdA;var QdA=K(()=>{KdA=bJB});var PYH={};XA(PYH,{default:()=>aj});var PdA,WdA,kJB,VdA,uJB,gJB,aj;var _YH=K(()=>{VN();QdA();PdA=typeof PYH=="object"&&PYH&&!PYH.nodeType&&PYH,WdA=PdA&&typeof MlH=="object"&&MlH&&!MlH.nodeType&&MlH,kJB=WdA&&WdA.exports===PdA,VdA=kJB?aJ.Buffer:void 0,uJB=VdA?VdA.isBuffer:void 0,gJB=uJB||KdA,aj=gJB});function dJB(H,$){var A=typeof H;return $=$==null?mJB:$,!!$&&(A=="number"||A!="symbol"&&pJB.test(H))&&(H>-1&&H%1==0&&H<$)}var mJB=9007199254740991,pJB,zc;var YYH=K(()=>{pJB=/^(?:0|[1-9]\d*)$/;zc=dJB});function lJB(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=cJB}var cJB=9007199254740991,ifH;var GlH=K(()=>{ifH=lJB});function QFB(H){return sF(H)&&ifH(H.length)&&!!NU[iC(H)]}var iJB="[object Arguments]",nJB="[object Array]",rJB="[object Boolean]",aJB="[object Date]",oJB="[object Error]",tJB="[object Function]",sJB="[object Map]",eJB="[object Number]",HFB="[object Object]",$FB="[object RegExp]",AFB="[object Set]",LFB="[object String]",IFB="[object WeakMap]",DFB="[object ArrayBuffer]",BFB="[object DataView]",fFB="[object Float32Array]",EFB="[object Float64Array]",MFB="[object Int8Array]",GFB="[object Int16Array]",UFB="[object Int32Array]",XFB="[object Uint8Array]",JFB="[object Uint8ClampedArray]",FFB="[object Uint16Array]",KFB="[object Uint32Array]",NU,_dA;var YdA=K(()=>{EHH();GlH();rj();NU={};NU[fFB]=NU[EFB]=NU[MFB]=NU[GFB]=NU[UFB]=NU[XFB]=NU[JFB]=NU[FFB]=NU[KFB]=!0;NU[iJB]=NU[nJB]=NU[DFB]=NU[rJB]=NU[BFB]=NU[aJB]=NU[oJB]=NU[tJB]=NU[sJB]=NU[eJB]=NU[HFB]=NU[$FB]=NU[AFB]=NU[LFB]=NU[IFB]=!1;_dA=QFB});function WFB(H){return function($){return H($)}}var nfH;var UlH=K(()=>{nfH=WFB});var CYH={};XA(CYH,{default:()=>oj});var CdA,wYH,VFB,QS$,PFB,oj;var JlH=K(()=>{LS$();CdA=typeof CYH=="object"&&CYH&&!CYH.nodeType&&CYH,wYH=CdA&&typeof XlH=="object"&&XlH&&!XlH.nodeType&&XlH,VFB=wYH&&wYH.exports===CdA,QS$=VFB&&rcH.process,PFB=function(){try{var H=wYH&&wYH.require&&wYH.require("util").types;if(H)return H;return QS$&&QS$.binding&&QS$.binding("util")}catch($){}}(),oj=PFB});var wdA,_FB,rfH;var FlH=K(()=>{YdA();UlH();JlH();wdA=oj&&oj.isTypedArray,_FB=wdA?nfH(wdA):_dA,rfH=_FB});function wFB(H,$){var A=wE(H),L=!A&&fk(H),I=!A&&!L&&aj(H),D=!A&&!L&&!I&&rfH(H),B=A||L||I||D,f=B?UdA(H.length,String):[],E=f.length;for(var M in H)if(($||CFB.call(H,M))&&!(B&&(M=="length"||I&&(M=="offset"||M=="parent")||D&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||zc(M,E))))f.push(M);return f}var YFB,CFB,KlH;var WS$=K(()=>{XdA();VYH();XV();_YH();YYH();FlH();YFB=Object.prototype,CFB=YFB.hasOwnProperty;KlH=wFB});function qFB(H){var $=H&&H.constructor,A=typeof $=="function"&&$.prototype||ZFB;return H===A}var ZFB,afH;var QlH=K(()=>{ZFB=Object.prototype;afH=qFB});function TFB(H,$){return function(A){return H($(A))}}var WlH;var VS$=K(()=>{WlH=TFB});var zFB,ZdA;var qdA=K(()=>{VS$();zFB=WlH(Object.keys,Object),ZdA=zFB});function xFB(H){if(!afH(H))return ZdA(H);var $=[];for(var A in Object(H))if(OFB.call(H,A)&&A!="constructor")$.push(A);return $}var NFB,OFB,TdA;var zdA=K(()=>{QlH();qdA();NFB=Object.prototype,OFB=NFB.hasOwnProperty;TdA=xFB});function SFB(H){return H!=null&&ifH(H.length)&&!hfH(H)}var tj;var ofH=K(()=>{acH();GlH();tj=SFB});function jFB(H){return tj(H)?KlH(H):TdA(H)}var bZ;var GHH=K(()=>{WS$();zdA();ofH();bZ=jFB});function RFB(H){return DlH(H,bZ,lfH)}var ZYH;var PS$=K(()=>{XS$();ElH();GHH();ZYH=RFB});function bFB(H,$,A,L,I,D){var B=A&yFB,f=ZYH(H),E=f.length,M=ZYH($),G=M.length;if(E!=G&&!B)return!1;var U=E;while(U--){var X=f[U];if(!(B?X in $:hFB.call($,X)))return!1}var J=D.get(H),F=D.get($);if(J&&F)return J==$&&F==H;var Q=!0;D.set(H,$),D.set($,H);var W=B;while(++U{PS$();vFB=Object.prototype,hFB=vFB.hasOwnProperty;NdA=bFB});var kFB,VlH;var xdA=K(()=>{Yc();VN();kFB=Y_(aJ,"DataView"),VlH=kFB});var uFB,PlH;var SdA=K(()=>{Yc();VN();uFB=Y_(aJ,"Promise"),PlH=uFB});var gFB,Nc;var _S$=K(()=>{Yc();VN();gFB=Y_(aJ,"Set"),Nc=gFB});var mFB,_lH;var jdA=K(()=>{Yc();VN();mFB=Y_(aJ,"WeakMap"),_lH=mFB});var RdA="[object Map]",pFB="[object Object]",ydA="[object Promise]",vdA="[object Set]",hdA="[object WeakMap]",bdA="[object DataView]",dFB,cFB,lFB,iFB,nFB,UHH,Ek;var qYH=K(()=>{xdA();tcH();SdA();_S$();jdA();EHH();IS$();dFB=Dk(VlH),cFB=Dk(Zc),lFB=Dk(PlH),iFB=Dk(Nc),nFB=Dk(_lH),UHH=iC;if(VlH&&UHH(new VlH(new ArrayBuffer(1)))!=bdA||Zc&&UHH(new Zc)!=RdA||PlH&&UHH(PlH.resolve())!=ydA||Nc&&UHH(new Nc)!=vdA||_lH&&UHH(new _lH)!=hdA)UHH=function(H){var $=iC(H),A=$==pFB?H.constructor:void 0,L=A?Dk(A):"";if(L)switch(L){case dFB:return bdA;case cFB:return RdA;case lFB:return ydA;case iFB:return vdA;case nFB:return hdA}return $};Ek=UHH});function oFB(H,$,A,L,I,D){var B=wE(H),f=wE($),E=B?udA:Ek(H),M=f?udA:Ek($);E=E==kdA?YlH:E,M=M==kdA?YlH:M;var G=E==YlH,U=M==YlH,X=E==M;if(X&&aj(H)){if(!aj($))return!1;B=!0,G=!1}if(X&&!G)return D||(D=new nj),B||rfH(H)?AlH(H,$,A,L,I,D):EdA(H,$,E,A,L,I,D);if(!(A&rFB)){var J=G&&gdA.call(H,"__wrapped__"),F=U&&gdA.call($,"__wrapped__");if(J||F){var Q=J?H.value():H,W=F?$.value():$;return D||(D=new nj),I(Q,W,A,L,D)}}if(!X)return!1;return D||(D=new nj),NdA(H,$,A,L,I,D)}var rFB=1,kdA="[object Arguments]",udA="[object Array]",YlH="[object Object]",aFB,gdA,mdA;var pdA=K(()=>{WYH();MS$();MdA();OdA();qYH();XV();_YH();FlH();aFB=Object.prototype,gdA=aFB.hasOwnProperty;mdA=oFB});function ddA(H,$,A,L,I){if(H===$)return!0;if(H==null||$==null||!sF(H)&&!sF($))return H!==H&&$!==$;return mdA(H,$,A,L,ddA,I)}var tfH;var ClH=K(()=>{pdA();rj();tfH=ddA});function eFB(H,$,A,L){var I=A.length,D=I,B=!L;if(H==null)return!D;H=Object(H);while(I--){var f=A[I];if(B&&f[2]?f[1]!==H[f[0]]:!(f[0]in H))return!1}while(++I{WYH();ClH();cdA=eFB});function HKB(H){return H===H&&!f5(H)}var wlH;var YS$=K(()=>{hZ();wlH=HKB});function $KB(H){var $=bZ(H),A=$.length;while(A--){var L=$[A],I=H[L];$[A]=[L,I,wlH(I)]}return $}var idA;var ndA=K(()=>{YS$();GHH();idA=$KB});function AKB(H,$){return function(A){if(A==null)return!1;return A[H]===$&&($!==void 0||(H in Object(A)))}}var ZlH;var CS$=K(()=>{ZlH=AKB});function LKB(H){var $=idA(H);if($.length==1&&$[0][2])return ZlH($[0][0],$[0][1]);return function(A){return A===H||cdA(A,H,$)}}var rdA;var adA=K(()=>{ldA();ndA();CS$();rdA=LKB});function DKB(H){return typeof H=="symbol"||sF(H)&&iC(H)==IKB}var IKB="[object Symbol]",sfH;var qlH=K(()=>{EHH();rj();sfH=DKB});function EKB(H,$){if(wE(H))return!1;var A=typeof H;if(A=="number"||A=="symbol"||A=="boolean"||H==null||sfH(H))return!0;return fKB.test(H)||!BKB.test(H)||$!=null&&H in Object($)}var BKB,fKB,efH;var TlH=K(()=>{XV();qlH();BKB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fKB=/^\w*$/;efH=EKB});function GKB(H){var $=o$(H,function(L){if(A.size===MKB)A.clear();return L}),A=$.cache;return $}var MKB=500,odA;var tdA=K(()=>{tD();odA=GKB});var UKB,XKB,JKB,sdA;var edA=K(()=>{tdA();UKB=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XKB=/\\(\\)?/g,JKB=odA(function(H){var $=[];if(H.charCodeAt(0)===46)$.push("");return H.replace(UKB,function(A,L,I,D){$.push(I?D.replace(XKB,"$1"):L||A)}),$}),sdA=JKB});function FKB(H,$){var A=-1,L=H==null?0:H.length,I=Array(L);while(++A{HEH=FKB});function AcA(H){if(typeof H=="string")return H;if(wE(H))return HEH(H,AcA)+"";if(sfH(H))return $cA?$cA.call(H):"";var $=H+"";return $=="0"&&1/H==-KKB?"-0":$}var KKB=1/0,HcA,$cA,LcA;var IcA=K(()=>{fHH();zlH();XV();qlH();HcA=DQ?DQ.prototype:void 0,$cA=HcA?HcA.toString:void 0;LcA=AcA});function QKB(H){return H==null?"":LcA(H)}var $EH;var NlH=K(()=>{IcA();$EH=QKB});function WKB(H,$){if(wE(H))return H;return efH(H,$)?[H]:sdA($EH(H))}var sj;var AEH=K(()=>{XV();TlH();edA();NlH();sj=WKB});function PKB(H){if(typeof H=="string"||sfH(H))return H;var $=H+"";return $=="0"&&1/H==-VKB?"-0":$}var VKB=1/0,kZ;var XHH=K(()=>{qlH();kZ=PKB});function _KB(H,$){$=sj($,H);var A=0,L=$.length;while(H!=null&&A{AEH();XHH();LEH=_KB});function YKB(H,$,A){var L=H==null?void 0:LEH(H,$);return L===void 0?A:L}var DcA;var BcA=K(()=>{OlH();DcA=YKB});function CKB(H,$){return H!=null&&$ in Object(H)}var fcA;var EcA=K(()=>{fcA=CKB});function wKB(H,$,A){$=sj($,H);var L=-1,I=$.length,D=!1;while(++L{AEH();VYH();XV();YYH();GlH();XHH();McA=wKB});function ZKB(H,$){return H!=null&&McA(H,$,fcA)}var UcA;var XcA=K(()=>{EcA();GcA();UcA=ZKB});function zKB(H,$){if(efH(H)&&wlH($))return ZlH(kZ(H),$);return function(A){var L=DcA(A,H);return L===void 0&&L===$?UcA(A,H):tfH($,L,qKB|TKB)}}var qKB=1,TKB=2,JcA;var FcA=K(()=>{ClH();BcA();XcA();TlH();YS$();CS$();XHH();JcA=zKB});function NKB(H){return H}var IEH;var xlH=K(()=>{IEH=NKB});function OKB(H){return function($){return $==null?void 0:$[H]}}var KcA;var QcA=K(()=>{KcA=OKB});function xKB(H){return function($){return LEH($,H)}}var WcA;var VcA=K(()=>{OlH();WcA=xKB});function SKB(H){return efH(H)?KcA(kZ(H)):WcA(H)}var PcA;var _cA=K(()=>{QcA();VcA();TlH();XHH();PcA=SKB});function jKB(H){if(typeof H=="function")return H;if(H==null)return IEH;if(typeof H=="object")return wE(H)?JcA(H[0],H[1]):rdA(H);return PcA(H)}var ej;var DEH=K(()=>{adA();FcA();xlH();XV();_cA();ej=jKB});function RKB(H,$){var A,L=-1,I=H.length;while(++L{YcA=RKB});function yKB(H,$){return H&&H.length?YcA(H,ej($,2)):0}var BEH;var wcA=K(()=>{DEH();CcA();BEH=yKB});function ZcA(H){return{name:H,default:30000,validate:($)=>{if(!$)return{effective:30000,status:"valid"};let A=parseInt($,10);if(isNaN(A)||A<=0)return{effective:30000,status:"invalid",message:`Invalid value "${$}" (using default: 30000)`};if(A>150000)return{effective:150000,status:"capped",message:`Capped from ${A} to 150000`};return{effective:A,status:"valid"}}}}var SlH,qcA,jlH;var TYH=K(()=>{SlH=ZcA("BASH_MAX_OUTPUT_LENGTH"),qcA=ZcA("TASK_MAX_OUTPUT_LENGTH"),jlH={name:"CLAUDE_CODE_MAX_OUTPUT_TOKENS",default:32000,validate:(H)=>{if(!H)return{effective:32000,status:"valid"};let L=parseInt(H,10);if(isNaN(L)||L<=0)return{effective:32000,status:"invalid",message:`Invalid value "${H}" (using default: 32000)`};if(L>64000)return{effective:64000,status:"capped",message:`Capped from ${L} to 64000`};return{effective:L,status:"valid"}}}});var TcA="claude-code-20250219",RlH="interleaved-thinking-2025-05-14",zYH="context-1m-2025-08-07",ylH="context-management-2025-06-27",Oc="structured-outputs-2025-12-15",wS$="web-search-2025-03-05",vlH="tool-examples-2025-10-29",zcA="advanced-tool-use-2025-11-20",NcA="tool-search-tool-2025-10-19",ZS$="effort-2025-11-24",qS$="adaptive-thinking-2026-01-28",NYH="prompt-caching-scope-2026-01-05",OcA="research-preview-2026-02-01",TS$,zS$;var JHH=K(()=>{TS$=new Set(["interleaved-thinking-2025-05-14","context-1m-2025-08-07","tool-search-tool-2025-10-19","tool-examples-2025-10-29"]),zS$=new Set(["claude-code-20250219","interleaved-thinking-2025-05-14","fine-grained-tool-streaming-2025-05-14","context-management-2025-06-27"])});function kKB(H){let $=H.toLowerCase();return $.includes("claude-sonnet-4")||$.includes("opus-4-6")}function JV(H,$){if(H.includes("[1m]")||$?.includes(zYH)&&kKB(H))return 1e6;return vKB}function xcA(H,$){if(!H)return{used:null,remaining:null};let A=H.input_tokens+H.cache_creation_input_tokens+H.cache_read_input_tokens,L=Math.round(A/$*100),I=Math.min(100,Math.max(0,L));return{used:I,remaining:100-I}}function fEH(H){let $=H.toLowerCase(),A;if($.includes("3-5"))A=8192;else if($.includes("claude-3-opus"))A=4096;else if($.includes("claude-3-sonnet"))A=8192;else if($.includes("claude-3-haiku"))A=4096;else if($.includes("opus-4-5"))A=64000;else if($.includes("opus-4"))A=32000;else if($.includes("sonnet-4")||$.includes("haiku-4"))A=64000;else A=hKB;return A}function hlH(H){return bKB}var vKB=200000,NS$=20000,hKB=32000,bKB=31999;var nC=K(()=>{JHH()});function ScA(){return OS$}function jcA(H){OS$=H}function E5(){OS$=null}var OS$=null;var dcA={};XA(dcA,{updateLastInteractionTime:()=>FHH,setUseCoworkPlugins:()=>aC,setTracerProvider:()=>llH,setTeleportedSessionInfo:()=>dYH,setSystemPromptSectionCacheEntry:()=>xj$,setSessionTrustAccepted:()=>Fj$,setSessionPersistenceDisabled:()=>Qj$,setSessionIngressToken:()=>VHH,setSessionId:()=>FV,setSessionBypassPermissionsMode:()=>Jj$,setSdkBetas:()=>nS$,setResumedTranscriptPath:()=>OYH,setQueuedCommandsSnapshot:()=>jj$,setOriginalCwd:()=>yS$,setOauthTokenFromFd:()=>PHH,setNeedsPlanModeExitAttachment:()=>$R,setNeedsDelegateModeExitAttachment:()=>mYH,setModelStrings:()=>vYH,setMeterProvider:()=>clH,setMeter:()=>rS$,setMainThreadAgentType:()=>YN,setMainLoopModelOverride:()=>KV,setLspRecommendationShownThisSession:()=>Cj$,setLoggerProvider:()=>plH,setLastAPIRequest:()=>Ej$,setIsRemoteMode:()=>Nj$,setIsInteractive:()=>$j$,setInlinePlugins:()=>Xj$,setInitialMainLoopModel:()=>iS$,setInitJsonSchema:()=>wj$,setHasUnknownModelCost:()=>ulH,setHasExitedPlanMode:()=>oC,setHasExitedDelegateMode:()=>Pj$,setFlagSettingsPath:()=>Lj$,setEventLogger:()=>dlH,setDirectConnectServerUrl:()=>uKB,setCwdState:()=>hS$,setCostStateForRestore:()=>yYH,setClientType:()=>Aj$,setApiKeyFromFd:()=>_HH,setAllowedSettingSources:()=>Uj$,setAdditionalDirectoriesForClaudeMd:()=>iYH,resetTotalDurationStateAndCost_FOR_TESTS_ONLY:()=>gKB,resetStateForTests:()=>bcA,resetSdkInitState:()=>kcA,resetModelStringsForTestingOnly:()=>mKB,resetCostState:()=>MEH,registerHookCallbacks:()=>CHH,regenerateSessionId:()=>jS$,preferThirdPartyAuthentication:()=>uYH,needsPlanModeExitAttachment:()=>Vj$,needsDelegateModeExitAttachment:()=>_j$,markFirstTeleportMessageLogged:()=>alH,isSessionPersistenceDisabled:()=>uZ,hasUnknownModelCost:()=>lS$,hasShownLspRecommendationThisSession:()=>Yj$,hasExitedPlanModeInSession:()=>Wj$,hasExitedDelegateModeInSession:()=>lKB,handlePlanModeTransition:()=>_N,getUseCoworkPlugins:()=>gYH,getUsageForModel:()=>hcA,getTracerProvider:()=>WHH,getTotalWebSearchRequests:()=>cS$,getTotalToolDuration:()=>mS$,getTotalOutputTokens:()=>SYH,getTotalLinesRemoved:()=>QHH,getTotalLinesAdded:()=>KHH,getTotalInputTokens:()=>xYH,getTotalDuration:()=>EEH,getTotalCostUSD:()=>BQ,getTotalCacheReadInputTokens:()=>pS$,getTotalCacheCreationInputTokens:()=>dS$,getTotalAPIDurationWithoutRetries:()=>gS$,getTotalAPIDuration:()=>rC,getTokenCounter:()=>UEH,getTeleportedSessionInfo:()=>rlH,getSystemPromptSectionCache:()=>Oj$,getSlowOperations:()=>gcA,getSessionTrustAccepted:()=>Kj$,getSessionIngressToken:()=>Ij$,getSessionId:()=>j$,getSessionCounter:()=>aS$,getSessionBypassPermissionsMode:()=>Gk,getSdkBetas:()=>V6,getResumedTranscriptPath:()=>vS$,getRegisteredHooks:()=>pYH,getQueuedCommandsSnapshot:()=>tKB,getPromptCacheBreaks:()=>mcA,getProjectRoot:()=>oJ,getPrCounter:()=>hYH,getPlanSlugCache:()=>wHH,getParentSessionId:()=>RS$,getOriginalCwd:()=>zL,getOauthTokenFromFd:()=>Dj$,getModelUsage:()=>PN,getModelStrings:()=>GEH,getMeterProvider:()=>Hj$,getMeter:()=>pKB,getMainThreadAgentType:()=>lYH,getMainLoopModelOverride:()=>C_,getLoggerProvider:()=>bYH,getLocCounter:()=>glH,getLastInteractionTime:()=>jYH,getLastAPIRequest:()=>Mj$,getIsRemoteMode:()=>ZHH,getIsNonInteractiveSession:()=>tI,getIsInteractive:()=>Mk,getInvokedSkills:()=>qj$,getInlinePlugins:()=>YHH,getInitialMainLoopModel:()=>RYH,getInitJsonSchema:()=>nlH,getInMemoryErrorLog:()=>dKB,getFlagSettingsPath:()=>xc,getEventLogger:()=>eS$,getEnvVarValidators:()=>fj$,getDirectConnectServerUrl:()=>bS$,getCwdState:()=>HR,getCostCounter:()=>tS$,getCommitCounter:()=>oS$,getCodeEditToolDecisionCounter:()=>sS$,getClientType:()=>kYH,getApiKeyFromFd:()=>Bj$,getAllowedSettingSources:()=>Gj$,getAgentColorMap:()=>ilH,getAdditionalDirectoriesForClaudeMd:()=>CN,getActiveTimeCounter:()=>mlH,clearSystemPromptSectionState:()=>Sj$,clearSlowOperations:()=>aKB,clearRegisteredPluginHooks:()=>Zj$,clearRegisteredHooks:()=>iKB,clearPromptCacheBreaks:()=>zj$,clearInvokedSkills:()=>nKB,addToTotalLinesChanged:()=>klH,addToTotalDurationState:()=>kS$,addToTotalCostState:()=>uS$,addToToolDuration:()=>blH,addToInMemoryErrorLog:()=>cKB,addSlowOperation:()=>rKB,addPromptCacheBreak:()=>Tj$,addInvokedSkill:()=>cYH});function vcA(){let H="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof xS$.realpathSync==="function")H=xS$.realpathSync(ycA.cwd());return{originalCwd:H,projectRoot:H,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:H,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,clientType:"cli",sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,sessionId:SS$.randomUUID(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,envVarValidators:[SlH,jlH],lastAPIRequest:null,inMemoryErrorLog:[],inlinePlugins:[],useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,hasExitedDelegateMode:!1,needsDelegateModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],promptCacheBreaks:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,directConnectServerUrl:void 0,systemPromptSectionCache:new Map,additionalDirectoriesForClaudeMd:[],resumedTranscriptPath:null}}function j$(){return k$.sessionId}function jS$(H={}){if(H.setCurrentAsParent)k$.parentSessionId=k$.sessionId;return k$.sessionId=SS$.randomUUID(),k$.resumedTranscriptPath=null,k$.sessionId}function RS$(){return k$.parentSessionId}function FV(H){if(k$.sessionId=H,process.env.CLAUDE_CODE_SESSION_ID!==void 0)process.env.CLAUDE_CODE_SESSION_ID=H}function zL(){return k$.originalCwd}function oJ(){return k$.projectRoot}function yS$(H){k$.originalCwd=H}function vS$(){return k$.resumedTranscriptPath}function OYH(H){k$.resumedTranscriptPath=H}function HR(){return k$.cwd}function hS$(H){k$.cwd=H}function bS$(){return k$.directConnectServerUrl}function uKB(H){k$.directConnectServerUrl=H}function kS$(H,$){k$.totalAPIDuration+=H,k$.totalAPIDurationWithoutRetries+=$}function gKB(){k$.totalAPIDuration=0,k$.totalAPIDurationWithoutRetries=0,k$.totalCostUSD=0}function uS$(H,$,A){k$.totalCostUSD+=H;let L=k$.modelUsage[A]??{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,webSearchRequests:0,costUSD:0,contextWindow:0,maxOutputTokens:0};L.inputTokens+=$.input_tokens,L.outputTokens+=$.output_tokens,L.cacheReadInputTokens+=$.cache_read_input_tokens??0,L.cacheCreationInputTokens+=$.cache_creation_input_tokens??0,L.webSearchRequests+=$.server_tool_use?.web_search_requests??0,L.costUSD+=H,L.contextWindow=JV(A,k$.sdkBetas),L.maxOutputTokens=fEH(A),k$.modelUsage[A]=L}function BQ(){return k$.totalCostUSD}function rC(){return k$.totalAPIDuration}function EEH(){return Date.now()-k$.startTime}function gS$(){return k$.totalAPIDurationWithoutRetries}function mS$(){return k$.totalToolDuration}function blH(H){k$.totalToolDuration+=H}function FHH(){k$.lastInteractionTime=Date.now()}function klH(H,$){k$.totalLinesAdded+=H,k$.totalLinesRemoved+=$}function KHH(){return k$.totalLinesAdded}function QHH(){return k$.totalLinesRemoved}function xYH(){return BEH(Object.values(k$.modelUsage),"inputTokens")}function SYH(){return BEH(Object.values(k$.modelUsage),"outputTokens")}function pS$(){return BEH(Object.values(k$.modelUsage),"cacheReadInputTokens")}function dS$(){return BEH(Object.values(k$.modelUsage),"cacheCreationInputTokens")}function cS$(){return BEH(Object.values(k$.modelUsage),"webSearchRequests")}function ulH(){k$.hasUnknownModelCost=!0}function lS$(){return k$.hasUnknownModelCost}function jYH(){return k$.lastInteractionTime}function PN(){return k$.modelUsage}function hcA(H){return k$.modelUsage[H]}function C_(){return k$.mainLoopModelOverride}function RYH(){return k$.initialMainLoopModel}function KV(H){k$.mainLoopModelOverride=H}function iS$(H){k$.initialMainLoopModel=H}function V6(){return k$.sdkBetas}function nS$(H){k$.sdkBetas=H}function MEH(){k$.totalCostUSD=0,k$.totalAPIDuration=0,k$.totalAPIDurationWithoutRetries=0,k$.totalToolDuration=0,k$.startTime=Date.now(),k$.totalLinesAdded=0,k$.totalLinesRemoved=0,k$.hasUnknownModelCost=!1,k$.modelUsage={}}function yYH({totalCostUSD:H,totalAPIDuration:$,totalAPIDurationWithoutRetries:A,totalToolDuration:L,totalLinesAdded:I,totalLinesRemoved:D,lastDuration:B,modelUsage:f}){if(k$.totalCostUSD=H,k$.totalAPIDuration=$,k$.totalAPIDurationWithoutRetries=A,k$.totalToolDuration=L,k$.totalLinesAdded=I,k$.totalLinesRemoved=D,f)k$.modelUsage=f;if(B)k$.startTime=Date.now()-B}function bcA(){throw Error("resetStateForTests can only be called in tests")}function GEH(){return k$.modelStrings}function vYH(H){k$.modelStrings=H}function mKB(){k$.modelStrings=null}function rS$(H,$){k$.meter=H,k$.sessionCounter=$("claude_code.session.count",{description:"Count of CLI sessions started"}),k$.locCounter=$("claude_code.lines_of_code.count",{description:"Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed"}),k$.prCounter=$("claude_code.pull_request.count",{description:"Number of pull requests created"}),k$.commitCounter=$("claude_code.commit.count",{description:"Number of git commits created"}),k$.costCounter=$("claude_code.cost.usage",{description:"Cost of the Claude Code session",unit:"USD"}),k$.tokenCounter=$("claude_code.token.usage",{description:"Number of tokens used",unit:"tokens"}),k$.codeEditToolDecisionCounter=$("claude_code.code_edit_tool.decision",{description:"Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools"}),k$.activeTimeCounter=$("claude_code.active_time.total",{description:"Total active time in seconds",unit:"s"})}function pKB(){return k$.meter}function aS$(){return k$.sessionCounter}function glH(){return k$.locCounter}function hYH(){return k$.prCounter}function oS$(){return k$.commitCounter}function tS$(){return k$.costCounter}function UEH(){return k$.tokenCounter}function sS$(){return k$.codeEditToolDecisionCounter}function mlH(){return k$.activeTimeCounter}function bYH(){return k$.loggerProvider}function plH(H){k$.loggerProvider=H}function eS$(){return k$.eventLogger}function dlH(H){k$.eventLogger=H}function Hj$(){return k$.meterProvider}function clH(H){k$.meterProvider=H}function WHH(){return k$.tracerProvider}function llH(H){k$.tracerProvider=H}function tI(){return!k$.isInteractive}function Mk(){return k$.isInteractive}function $j$(H){k$.isInteractive=H}function kYH(){return k$.clientType}function Aj$(H){k$.clientType=H}function ilH(){return k$.agentColorMap}function xc(){return k$.flagSettingsPath}function Lj$(H){k$.flagSettingsPath=H}function Ij$(){return k$.sessionIngressToken}function VHH(H){k$.sessionIngressToken=H}function Dj$(){return k$.oauthTokenFromFd}function PHH(H){k$.oauthTokenFromFd=H}function Bj$(){return k$.apiKeyFromFd}function _HH(H){k$.apiKeyFromFd=H}function fj$(){return k$.envVarValidators}function Ej$(H){k$.lastAPIRequest=H}function Mj$(){return k$.lastAPIRequest}function dKB(){return[...k$.inMemoryErrorLog]}function cKB(H){if(k$.inMemoryErrorLog.length>=100)k$.inMemoryErrorLog.shift();k$.inMemoryErrorLog.push(H)}function Gj$(){return k$.allowedSettingSources}function Uj$(H){k$.allowedSettingSources=H}function uYH(){return tI()&&k$.clientType!=="claude-vscode"}function Xj$(H){k$.inlinePlugins=H}function YHH(){return k$.inlinePlugins}function aC(H){k$.useCoworkPlugins=H,E5()}function gYH(){return k$.useCoworkPlugins}function Jj$(H){k$.sessionBypassPermissionsMode=H}function Gk(){return k$.sessionBypassPermissionsMode}function Fj$(H){k$.sessionTrustAccepted=H}function Kj$(){return k$.sessionTrustAccepted}function Qj$(H){k$.sessionPersistenceDisabled=H}function uZ(){return k$.sessionPersistenceDisabled}function Wj$(){return k$.hasExitedPlanMode}function oC(H){k$.hasExitedPlanMode=H}function Vj$(){return k$.needsPlanModeExitAttachment}function $R(H){k$.needsPlanModeExitAttachment=H}function _N(H,$){if($==="plan"&&H!=="plan")k$.needsPlanModeExitAttachment=!1;if(H==="plan"&&$!=="plan")k$.needsPlanModeExitAttachment=!0}function lKB(){return k$.hasExitedDelegateMode}function Pj$(H){k$.hasExitedDelegateMode=H}function _j$(){return k$.needsDelegateModeExitAttachment}function mYH(H){k$.needsDelegateModeExitAttachment=H}function Yj$(){return k$.lspRecommendationShownThisSession}function Cj$(H){k$.lspRecommendationShownThisSession=H}function wj$(H){k$.initJsonSchema=H}function nlH(){return k$.initJsonSchema}function CHH(H){if(!k$.registeredHooks)k$.registeredHooks={};for(let[$,A]of Object.entries(H)){let L=$;if(!k$.registeredHooks[L])k$.registeredHooks[L]=[];k$.registeredHooks[L].push(...A)}}function pYH(){return k$.registeredHooks}function iKB(){k$.registeredHooks=null}function Zj$(){if(!k$.registeredHooks)return;let H={};for(let[$,A]of Object.entries(k$.registeredHooks)){let L=A.filter((I)=>!("pluginRoot"in I));if(L.length>0)H[$]=L}k$.registeredHooks=Object.keys(H).length>0?H:null}function kcA(){k$.initJsonSchema=null,k$.registeredHooks=null}function wHH(){return k$.planSlugCache}function dYH(H){k$.teleportedSessionInfo={isTeleported:!0,hasLoggedFirstMessage:!1,sessionId:H.sessionId}}function rlH(){return k$.teleportedSessionInfo}function alH(){if(k$.teleportedSessionInfo)k$.teleportedSessionInfo.hasLoggedFirstMessage=!0}function cYH(H,$,A){k$.invokedSkills.set(H,{skillName:H,skillPath:$,content:A,invokedAt:Date.now()})}function qj$(){return k$.invokedSkills}function nKB(){k$.invokedSkills.clear()}function rKB(H,$){return}function gcA(){let H=Date.now();return k$.slowOperations=k$.slowOperations.filter(($)=>H-$.timestampH-$.timestamp{wcA();TYH();nC();ycA=require("process"),xS$=require("fs"),SS$=require("crypto");k$=vcA();pcA={length:0}});function sKB(H,$){var A=-1,L=H==null?0:H.length;while(++A{ccA=sKB});var eKB,XEH;var Rj$=K(()=>{Yc();eKB=function(){try{var H=Y_(Object,"defineProperty");return H({},"",{}),H}catch($){}}(),XEH=eKB});function HQB(H,$,A){if($=="__proto__"&&XEH)XEH(H,$,{configurable:!0,enumerable:!0,value:A,writable:!0});else H[$]=A}var Sc;var nYH=K(()=>{Rj$();Sc=HQB});function LQB(H,$,A){var L=H[$];if(!(AQB.call(H,$)&&ij(L,A))||A===void 0&&!($ in H))Sc(H,$,A)}var $QB,AQB,jc;var rYH=K(()=>{nYH();kfH();$QB=Object.prototype,AQB=$QB.hasOwnProperty;jc=LQB});function IQB(H,$,A,L){var I=!A;A||(A={});var D=-1,B=$.length;while(++D{rYH();nYH();gZ=IQB});function DQB(H,$){return H&&gZ($,bZ($),H)}var icA;var ncA=K(()=>{qHH();GHH();icA=DQB});function BQB(H){var $=[];if(H!=null)for(var A in Object(H))$.push(A);return $}var rcA;var acA=K(()=>{rcA=BQB});function MQB(H){if(!f5(H))return rcA(H);var $=afH(H),A=[];for(var L in H)if(!(L=="constructor"&&($||!EQB.call(H,L))))A.push(L);return A}var fQB,EQB,ocA;var tcA=K(()=>{hZ();QlH();acA();fQB=Object.prototype,EQB=fQB.hasOwnProperty;ocA=MQB});function GQB(H){return tj(H)?KlH(H,!0):ocA(H)}var AR;var JEH=K(()=>{WS$();tcA();ofH();AR=GQB});function UQB(H,$){return H&&gZ($,AR($),H)}var scA;var ecA=K(()=>{qHH();JEH();scA=UQB});var aYH={};XA(aYH,{default:()=>oYH});function JQB(H,$){if($)return H.slice();var A=H.length,L=AlA?AlA(A):new H.constructor(A);return H.copy(L),L}var LlA,HlA,XQB,$lA,AlA,oYH;var yj$=K(()=>{VN();LlA=typeof aYH=="object"&&aYH&&!aYH.nodeType&&aYH,HlA=LlA&&typeof olH=="object"&&olH&&!olH.nodeType&&olH,XQB=HlA&&HlA.exports===LlA,$lA=XQB?aJ.Buffer:void 0,AlA=$lA?$lA.allocUnsafe:void 0;oYH=JQB});function FQB(H,$){var A=-1,L=H.length;$||($=Array(L));while(++A{tlH=FQB});function KQB(H,$){return gZ(H,lfH(H),$)}var IlA;var DlA=K(()=>{qHH();ElH();IlA=KQB});var QQB,FEH;var slH=K(()=>{VS$();QQB=WlH(Object.getPrototypeOf,Object),FEH=QQB});var WQB,VQB,elH;var hj$=K(()=>{IlH();slH();ElH();FS$();WQB=Object.getOwnPropertySymbols,VQB=!WQB?flH:function(H){var $=[];while(H)cfH($,lfH(H)),H=FEH(H);return $},elH=VQB});function PQB(H,$){return gZ(H,elH(H),$)}var BlA;var flA=K(()=>{qHH();hj$();BlA=PQB});function _QB(H){return DlH(H,AR,elH)}var HiH;var bj$=K(()=>{XS$();hj$();JEH();HiH=_QB});function wQB(H){var $=H.length,A=new H.constructor($);if($&&typeof H[0]=="string"&&CQB.call(H,"index"))A.index=H.index,A.input=H.input;return A}var YQB,CQB,ElA;var MlA=K(()=>{YQB=Object.prototype,CQB=YQB.hasOwnProperty;ElA=wQB});function ZQB(H){var $=new H.constructor(H.byteLength);return new pfH($).set(new pfH(H)),$}var KEH;var $iH=K(()=>{GS$();KEH=ZQB});function qQB(H,$){var A=$?KEH(H.buffer):H.buffer;return new H.constructor(A,H.byteOffset,H.byteLength)}var GlA;var UlA=K(()=>{$iH();GlA=qQB});function zQB(H){var $=new H.constructor(H.source,TQB.exec(H));return $.lastIndex=H.lastIndex,$}var TQB,XlA;var JlA=K(()=>{TQB=/\w*$/;XlA=zQB});function NQB(H){return KlA?Object(KlA.call(H)):{}}var FlA,KlA,QlA;var WlA=K(()=>{fHH();FlA=DQ?DQ.prototype:void 0,KlA=FlA?FlA.valueOf:void 0;QlA=NQB});function OQB(H,$){var A=$?KEH(H.buffer):H.buffer;return new H.constructor(A,H.byteOffset,H.length)}var AiH;var kj$=K(()=>{$iH();AiH=OQB});function aQB(H,$,A){var L=H.constructor;switch($){case kQB:return KEH(H);case xQB:case SQB:return new L(+H);case uQB:return GlA(H,A);case gQB:case mQB:case pQB:case dQB:case cQB:case lQB:case iQB:case nQB:case rQB:return AiH(H,A);case jQB:return new L;case RQB:case hQB:return new L(H);case yQB:return XlA(H);case vQB:return new L;case bQB:return QlA(H)}}var xQB="[object Boolean]",SQB="[object Date]",jQB="[object Map]",RQB="[object Number]",yQB="[object RegExp]",vQB="[object Set]",hQB="[object String]",bQB="[object Symbol]",kQB="[object ArrayBuffer]",uQB="[object DataView]",gQB="[object Float32Array]",mQB="[object Float64Array]",pQB="[object Int8Array]",dQB="[object Int16Array]",cQB="[object Int32Array]",lQB="[object Uint8Array]",iQB="[object Uint8ClampedArray]",nQB="[object Uint16Array]",rQB="[object Uint32Array]",VlA;var PlA=K(()=>{$iH();UlA();JlA();WlA();kj$();VlA=aQB});var _lA,oQB,YlA;var ClA=K(()=>{hZ();_lA=Object.create,oQB=function(){function H(){}return function($){if(!f5($))return{};if(_lA)return _lA($);H.prototype=$;var A=new H;return H.prototype=void 0,A}}(),YlA=oQB});function tQB(H){return typeof H.constructor=="function"&&!afH(H)?YlA(FEH(H)):{}}var LiH;var uj$=K(()=>{ClA();slH();QlH();LiH=tQB});function eQB(H){return sF(H)&&Ek(H)==sQB}var sQB="[object Map]",wlA;var ZlA=K(()=>{qYH();rj();wlA=eQB});var qlA,HWB,TlA;var zlA=K(()=>{ZlA();UlH();JlH();qlA=oj&&oj.isMap,HWB=qlA?nfH(qlA):wlA,TlA=HWB});function AWB(H){return sF(H)&&Ek(H)==$WB}var $WB="[object Set]",NlA;var OlA=K(()=>{qYH();rj();NlA=AWB});var xlA,LWB,SlA;var jlA=K(()=>{OlA();UlH();JlH();xlA=oj&&oj.isSet,LWB=xlA?nfH(xlA):NlA,SlA=LWB});function IiH(H,$,A,L,I,D){var B,f=$&IWB,E=$&DWB,M=$&BWB;if(A)B=I?A(H,L,I,D):A(H);if(B!==void 0)return B;if(!f5(H))return H;var G=wE(H);if(G){if(B=ElA(H),!f)return tlH(H,B)}else{var U=Ek(H),X=U==ylA||U==UWB;if(aj(H))return oYH(H,f);if(U==vlA||U==RlA||X&&!I){if(B=E||X?{}:LiH(H),!f)return E?BlA(H,scA(B,H)):IlA(H,icA(B,H))}else{if(!cG[U])return I?H:{};B=VlA(H,U,f)}}D||(D=new nj);var J=D.get(H);if(J)return J;if(D.set(H,B),SlA(H))H.forEach(function(W){B.add(IiH(W,$,A,W,H,D))});else if(TlA(H))H.forEach(function(W,P){B.set(P,IiH(W,$,A,P,H,D))});var F=M?E?HiH:ZYH:E?AR:bZ,Q=G?void 0:F(H);return ccA(Q||H,function(W,P){if(Q)P=W,W=H[P];jc(B,P,IiH(W,$,A,P,H,D))}),B}var IWB=1,DWB=2,BWB=4,RlA="[object Arguments]",fWB="[object Array]",EWB="[object Boolean]",MWB="[object Date]",GWB="[object Error]",ylA="[object Function]",UWB="[object GeneratorFunction]",XWB="[object Map]",JWB="[object Number]",vlA="[object Object]",FWB="[object RegExp]",KWB="[object Set]",QWB="[object String]",WWB="[object Symbol]",VWB="[object WeakMap]",PWB="[object ArrayBuffer]",_WB="[object DataView]",YWB="[object Float32Array]",CWB="[object Float64Array]",wWB="[object Int8Array]",ZWB="[object Int16Array]",qWB="[object Int32Array]",TWB="[object Uint8Array]",zWB="[object Uint8ClampedArray]",NWB="[object Uint16Array]",OWB="[object Uint32Array]",cG,DiH;var gj$=K(()=>{WYH();lcA();rYH();ncA();ecA();yj$();vj$();DlA();flA();PS$();bj$();qYH();MlA();PlA();uj$();XV();_YH();zlA();hZ();jlA();GHH();JEH();cG={};cG[RlA]=cG[fWB]=cG[PWB]=cG[_WB]=cG[EWB]=cG[MWB]=cG[YWB]=cG[CWB]=cG[wWB]=cG[ZWB]=cG[qWB]=cG[XWB]=cG[JWB]=cG[vlA]=cG[FWB]=cG[KWB]=cG[QWB]=cG[WWB]=cG[TWB]=cG[zWB]=cG[NWB]=cG[OWB]=!0;cG[GWB]=cG[ylA]=cG[VWB]=!1;DiH=IiH});function jWB(H){return DiH(H,xWB|SWB)}var xWB=1,SWB=4,hlA;var blA=K(()=>{gj$();hlA=jWB});function mj$(H){if(H===null)return"null";if(H===void 0)return"undefined";if(Array.isArray(H))return`Array[${H.length}]`;if(typeof H==="object")return`Object{${Object.keys(H).length} keys}`;if(typeof H==="string")return`string(${H.length} chars)`;return typeof H}function BiH(H,$){let A=performance.now();try{return $()}finally{performance.now()-A>Xk}}function yH(H,$,A){let L=mj$(H);return BiH(`JSON.stringify(${L})`,()=>JSON.stringify(H,$,A))}function klA(H,$){let A=mj$(H);return BiH(`structuredClone(${A})`,()=>structuredClone(H,$))}function THH(H){let $=mj$(H);return BiH(`cloneDeep(${$})`,()=>hlA(H))}function iL(H,$,A){let L=performance.now();try{if(A!==null&&typeof A==="object"&&"flush"in A&&A.flush===!0){let D=typeof A==="object"&&"encoding"in A?A.encoding:void 0,B=typeof A==="object"&&"mode"in A?A.mode:void 0,f;try{f=Uk.openSync(H,"w",B),Uk.writeFileSync(f,$,{encoding:D??void 0}),Uk.fsyncSync(f)}finally{if(f!==void 0)Uk.closeSync(f)}}else Uk.writeFileSync(H,$,A)}finally{performance.now()-L>Xk}}var Uk,Xk=1/0,DA=(H,$)=>{let A=typeof H==="string"?H.length:0;return BiH(`JSON.parse(${A} chars)`,()=>JSON.parse(H,$))};var Z$=K(()=>{E$();g$();blA();Uk=require("fs")});function tJ(H,$){let A=performance.now();try{return $()}finally{performance.now()-A>Xk}}function OU(H,$){if(!H.existsSync($))return{resolvedPath:$,isSymlink:!1};try{let A=H.lstatSync($);if(A.isFIFO()||A.isSocket()||A.isCharacterDevice()||A.isBlockDevice())return{resolvedPath:$,isSymlink:!1};let L=H.realpathSync($);return{resolvedPath:L,isSymlink:L!==$}}catch(A){return{resolvedPath:$,isSymlink:!1}}}function LR(H,$,A){let{resolvedPath:L}=OU(H,$);if(A.has(L))return!0;return A.add(L),!1}function zHH(H){let $=H;if($==="~")$=pj$.homedir();else if($.startsWith("~/"))$=Rc.join(pj$.homedir(),$.slice(2));let A=new Set,L=zH();A.add($);try{let B=$,f=new Set,E=40;for(let M=0;M0){let f=Math.min(4096,I);I-=f,await A.read(B,0,f,I);let M=(B.toString("utf8",0,f)+D).split(` `);D=M[0]||"";for(let G=M.length-1;G>=1;G--){let U=M[G];if(U)yield U}}if(D)yield D}finally{await A.close()}}var H9,pj$,Rc,mZ,RWB=!1,yWB,vWB;var DL=K(()=>{E$();Z$();g$();H9=b(require("fs")),pj$=require("os"),Rc=b(require("path")),mZ=require("fs/promises");yWB={cwd(){return process.cwd()},existsSync(H){return tJ(`existsSync(${H})`,()=>H9.existsSync(H))},async stat(H){return mZ.stat(H)},async readdir(H){return mZ.readdir(H,{withFileTypes:!0})},async unlink(H){return mZ.unlink(H)},async rmdir(H){return mZ.rmdir(H)},async rm(H,$){return mZ.rm(H,$)},statSync(H){return tJ(`statSync(${H})`,()=>H9.statSync(H))},lstatSync(H){return tJ(`lstatSync(${H})`,()=>H9.lstatSync(H))},readFileSync(H,$){return tJ(`readFileSync(${H})`,()=>H9.readFileSync(H,{encoding:$.encoding}))},readFileBytesSync(H){return tJ(`readFileBytesSync(${H})`,()=>H9.readFileSync(H))},readSync(H,$){return tJ(`readSync(${H}, ${$.length} bytes)`,()=>{let A=void 0;try{A=H9.openSync(H,"r");let L=Buffer.alloc($.length),I=H9.readSync(A,L,0,$.length,0);return{buffer:L,bytesRead:I}}finally{if(A)H9.closeSync(A)}})},appendFileSync(H,$,A){return tJ(`appendFileSync(${H}, ${$.length} chars)`,()=>{if(!H9.existsSync(H)&&A?.mode!==void 0){let L=H9.openSync(H,"a",A.mode);try{H9.appendFileSync(L,$)}finally{H9.closeSync(L)}}else H9.appendFileSync(H,$)})},copyFileSync(H,$){return tJ(`copyFileSync(${H} \u2192 ${$})`,()=>H9.copyFileSync(H,$))},unlinkSync(H){return tJ(`unlinkSync(${H})`,()=>H9.unlinkSync(H))},renameSync(H,$){return tJ(`renameSync(${H} \u2192 ${$})`,()=>H9.renameSync(H,$))},linkSync(H,$){return tJ(`linkSync(${H} \u2192 ${$})`,()=>H9.linkSync(H,$))},symlinkSync(H,$){return tJ(`symlinkSync(${H} \u2192 ${$})`,()=>H9.symlinkSync(H,$))},readlinkSync(H){return tJ(`readlinkSync(${H})`,()=>H9.readlinkSync(H))},realpathSync(H){return tJ(`realpathSync(${H})`,()=>H9.realpathSync(H))},mkdirSync(H,$){return tJ(`mkdirSync(${H})`,()=>{if(!H9.existsSync(H)){let A={recursive:!0};if($?.mode!==void 0)A.mode=$.mode;H9.mkdirSync(H,A)}})},readdirSync(H){return tJ(`readdirSync(${H})`,()=>H9.readdirSync(H,{withFileTypes:!0}))},readdirStringSync(H){return tJ(`readdirStringSync(${H})`,()=>H9.readdirSync(H))},isDirEmptySync(H){return tJ(`isDirEmptySync(${H})`,()=>{return this.readdirSync(H).length===0})},rmdirSync(H){return tJ(`rmdirSync(${H})`,()=>H9.rmdirSync(H))},rmSync(H,$){return tJ(`rmSync(${H})`,()=>H9.rmSync(H,$))},createWriteStream(H){return H9.createWriteStream(H)}},vWB=yWB});function UL(){return process.env.CLAUDE_CONFIG_DIR??dj$.join(glA.homedir(),".claude")}function P6(){return dj$.join(UL(),"teams")}function cj$(H){let $=process.env.NODE_OPTIONS;if(!$)return!1;return $.split(/\s+/).includes(H)}function A$(H){if(!H)return!1;if(typeof H==="boolean")return H;let $=H.toLowerCase().trim();return["1","true","yes","on"].includes($)}function BE(H){if(H===void 0)return!1;if(typeof H==="boolean")return!H;if(!H)return!1;let $=H.toLowerCase().trim();return["0","false","no","off"].includes($)}function mlA(H){let $={};if(H)for(let A of H){let[L,...I]=A.split("=");if(!L||I.length===0)throw Error(`Invalid environment variable format: ${A}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);$[L]=I.join("=")}return $}function NHH(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||"us-east-1"}function wN(){return process.env.CLOUD_ML_REGION||"us-east5"}function lj$(){return A$(process.env.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR)}function plA(){return!1}function fiH(H){if(H?.startsWith("claude-haiku-4-5"))return process.env.VERTEX_REGION_CLAUDE_HAIKU_4_5||wN();if(H?.startsWith("claude-3-5-haiku"))return process.env.VERTEX_REGION_CLAUDE_3_5_HAIKU||wN();if(H?.startsWith("claude-3-5-sonnet"))return process.env.VERTEX_REGION_CLAUDE_3_5_SONNET||wN();if(H?.startsWith("claude-3-7-sonnet"))return process.env.VERTEX_REGION_CLAUDE_3_7_SONNET||wN();if(H?.startsWith("claude-opus-4-1"))return process.env.VERTEX_REGION_CLAUDE_4_1_OPUS||wN();if(H?.startsWith("claude-opus-4"))return process.env.VERTEX_REGION_CLAUDE_4_0_OPUS||wN();if(H?.startsWith("claude-sonnet-4-5"))return process.env.VERTEX_REGION_CLAUDE_4_5_SONNET||wN();if(H?.startsWith("claude-sonnet-4"))return process.env.VERTEX_REGION_CLAUDE_4_0_SONNET||wN();return wN()}var dj$,glA;var NA=K(()=>{dj$=require("path"),glA=require("os")});function EiH({writeFn:H,flushIntervalMs:$=1000,maxBufferSize:A=100,immediateMode:L=!1}){let I=[],D=null;function B(){if(D)clearTimeout(D),D=null}function f(){if(I.length===0)return;H(I.join("")),I=[],B()}function E(){if(!D)D=setTimeout(f,$)}return{write(M){if(L){H(M);return}if(I.push(M),E(),I.length>=A)f()},flush:f,dispose(){f()}}}function PB(H){return ij$.add(H),()=>ij$.delete(H)}async function dlA(){await Promise.all(Array.from(ij$).map((H)=>H()))}var ij$;var ZE=K(()=>{ij$=new Set});function bWB(H){if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let $=hWB();return mpA(H,$)}function ilA(H){llA=H}function kWB(){if(!MiH)MiH=EiH({writeFn:(H)=>{let $=xHH();if(!zH().existsSync(OHH.dirname($)))zH().mkdirSync(OHH.dirname($));zH().appendFileSync($,H),uWB()},flushIntervalMs:1000,maxBufferSize:100,immediateMode:QEH()}),PB(async()=>MiH?.dispose());return MiH}function N(H,{level:$}={level:"debug"}){if(!bWB(H))return;if(llA&&H.includes(` `)}function tj$(){if(elA(),sYH){let H=slA(),$=GiH.dirname(H),A=zH();if(!A.existsSync($))A.mkdirSync($);iL(H,alA(),{encoding:"utf8",flush:!0}),N("Startup profiling report:"),N(alA())}}function pWB(){return aj$}function dWB(){return sYH}function slA(){return GiH.join(UL(),"startup-perf",`${j$()}.txt`)}function elA(){if(!olA)return;let $=oj$().getEntriesByType("mark");if($.length===0)return;let A=new Map;for(let I of $)A.set(I.name,I.startTime);let L={};for(let[I,[D,B]]of Object.entries(mWB)){let f=A.get(D),E=A.get(B);if(f!==void 0&&E!==void 0)L[`${I}_ms`]=Math.round(E-f)}L.checkpoint_count=$.length,c("tengu_startup_perf",L)}var GiH,sYH,gWB=0.005,olA,aj$,tlA,nj$=null,mWB;var hc=K(()=>{E$();z$();NA();g$();DL();Z$();GiH=require("path"),sYH=process.env.CLAUDE_CODE_PROFILE_STARTUP==="1",olA=Math.random()0?I.join("__"):void 0;return{serverName:L,toolName:D}}function bc(H){return`mcp__${E1(H)}__`}function UiH(H,$){let A=`mcp__${E1($)}__`;return H.replace(A,"")}function XiH(H){let $=H.replace(/\s*\(MCP\)\s*$/,"");$=$.trim();let A=$.indexOf(" - ");if(A!==-1)return $.substring(A+3).trim();return $}var tC=()=>{};function cWB(H,$,A){switch(A.length){case 0:return H.call($);case 1:return H.call($,A[0]);case 2:return H.call($,A[0],A[1]);case 3:return H.call($,A[0],A[1],A[2])}return H.apply($,A)}var $iA;var AiA=K(()=>{$iA=cWB});function lWB(){}var Jk;var sj$=K(()=>{Jk=lWB});function aWB(H){var $=0,A=0;return function(){var L=rWB(),I=nWB-(L-A);if(A=L,I>0){if(++$>=iWB)return arguments[0]}else $=0;return H.apply(void 0,arguments)}}var iWB=800,nWB=16,rWB,LiA;var IiA=K(()=>{rWB=Date.now;LiA=aWB});function oWB(H){return function(){return H}}var DiA;var BiA=K(()=>{DiA=oWB});var tWB,fiA;var EiA=K(()=>{BiA();Rj$();xlH();tWB=!XEH?IEH:function(H,$){return XEH(H,"toString",{configurable:!0,enumerable:!1,value:DiA($),writable:!0})},fiA=tWB});var sWB,JiH;var ej$=K(()=>{EiA();IiA();sWB=LiA(fiA),JiH=sWB});function eWB(H,$,A,L){var I=H.length,D=A+(L?1:-1);while(L?D--:++D{MiA=eWB});function H7B(H){return H!==H}var UiA;var XiA=K(()=>{UiA=H7B});function $7B(H,$,A){var L=A-1,I=H.length;while(++L{JiA=$7B});function A7B(H,$,A){return $===$?JiA(H,$,A):MiA(H,UiA,A)}var KiA;var QiA=K(()=>{GiA();XiA();FiA();KiA=A7B});function L7B(H,$){var A=H==null?0:H.length;return!!A&&KiA(H,$,0)>-1}var WiA;var ViA=K(()=>{QiA();WiA=L7B});function I7B(H,$,A){return $=PiA($===void 0?H.length-1:$,0),function(){var L=arguments,I=-1,D=PiA(L.length-$,0),B=Array(D);while(++I{AiA();PiA=Math.max;FiH=I7B});function D7B(H,$){return JiH(FiH(H,$,IEH),H+"")}var _iA;var YiA=K(()=>{xlH();HR$();ej$();_iA=D7B});function B7B(H,$,A){if(!f5(A))return!1;var L=typeof $;if(L=="number"?tj(A)&&zc($,A.length):L=="string"&&($ in A))return ij(A[$],H);return!1}var CiA;var wiA=K(()=>{kfH();ofH();YYH();hZ();CiA=B7B});function f7B(H){return _iA(function($,A){var L=-1,I=A.length,D=I>1?A[I-1]:void 0,B=I>2?A[2]:void 0;if(D=H.length>3&&typeof D=="function"?(I--,D):void 0,B&&CiA(A[0],A[1],B))D=I<3?void 0:D,I=1;$=Object($);while(++L{YiA();wiA();ZiA=f7B});function E7B(H){return wE(H)||fk(H)||!!(TiA&&H&&H[TiA])}var TiA,ziA;var NiA=K(()=>{fHH();VYH();XV();TiA=DQ?DQ.isConcatSpreadable:void 0;ziA=E7B});function OiA(H,$,A,L,I){var D=-1,B=H.length;A||(A=ziA),I||(I=[]);while(++D0&&A(f))if($>1)OiA(f,$-1,A,L,I);else cfH(I,f);else if(!L)I[I.length]=f}return I}var xiA;var SiA=K(()=>{IlH();NiA();xiA=OiA});function M7B(H){var $=H==null?0:H.length;return $?xiA(H,1):[]}var jiA;var RiA=K(()=>{SiA();jiA=M7B});function G7B(H){return JiH(FiH(H,void 0,jiA),H+"")}var yiA;var viA=K(()=>{RiA();HR$();ej$();yiA=G7B});function Q7B(H){if(!sF(H)||iC(H)!=U7B)return!1;var $=FEH(H);if($===null)return!0;var A=F7B.call($,"constructor")&&$.constructor;return typeof A=="function"&&A instanceof A&&hiA.call(A)==K7B}var U7B="[object Object]",X7B,J7B,hiA,F7B,K7B,WEH;var KiH=K(()=>{EHH();slH();rj();X7B=Function.prototype,J7B=Object.prototype,hiA=X7B.toString,F7B=J7B.hasOwnProperty,K7B=hiA.call(Object);WEH=Q7B});function W7B(H,$,A){var L=-1,I=H.length;if($<0)$=-$>I?0:I+$;if(A=A>I?I:A,A<0)A+=I;I=$>A?0:A-$>>>0,$>>>=0;var D=Array(I);while(++L{QiH=W7B});function V7B(H,$,A){var L=H.length;return A=A===void 0?L:A,!$&&A>=L?H:QiH(H,$,A)}var biA;var kiA=K(()=>{$R$();biA=V7B});function z7B(H){return T7B.test(H)}var P7B="\\ud800-\\udfff",_7B="\\u0300-\\u036f",Y7B="\\ufe20-\\ufe2f",C7B="\\u20d0-\\u20ff",w7B,Z7B="\\ufe0e\\ufe0f",q7B="\\u200d",T7B,WiH;var AR$=K(()=>{w7B=_7B+Y7B+C7B,T7B=RegExp("["+q7B+P7B+w7B+Z7B+"]");WiH=z7B});function N7B(H){return H.split("")}var uiA;var giA=K(()=>{uiA=N7B});function m7B(H){return H.match(g7B)||[]}var miA="\\ud800-\\udfff",O7B="\\u0300-\\u036f",x7B="\\ufe20-\\ufe2f",S7B="\\u20d0-\\u20ff",j7B,R7B="\\ufe0e\\ufe0f",y7B,LR$,IR$="\\ud83c[\\udffb-\\udfff]",v7B,piA,diA="(?:\\ud83c[\\udde6-\\uddff]){2}",ciA="[\\ud800-\\udbff][\\udc00-\\udfff]",h7B="\\u200d",liA,iiA,b7B,k7B,u7B,g7B,niA;var riA=K(()=>{j7B=O7B+x7B+S7B,y7B="["+miA+"]",LR$="["+j7B+"]",v7B="(?:"+LR$+"|"+IR$+")",piA="[^"+miA+"]",liA=v7B+"?",iiA="["+R7B+"]?",b7B="(?:"+h7B+"(?:"+[piA,diA,ciA].join("|")+")"+iiA+liA+")*",k7B=iiA+liA+b7B,u7B="(?:"+[piA+LR$+"?",LR$,diA,ciA,y7B].join("|")+")",g7B=RegExp(IR$+"(?="+IR$+")|"+u7B+k7B,"g");niA=m7B});function p7B(H){return WiH(H)?niA(H):uiA(H)}var aiA;var oiA=K(()=>{giA();AR$();riA();aiA=p7B});function d7B(H){return function($){$=$EH($);var A=WiH($)?aiA($):void 0,L=A?A[0]:$.charAt(0),I=A?biA(A,1).join(""):$.slice(1);return L[H]()+I}}var tiA;var siA=K(()=>{kiA();AR$();oiA();NlH();tiA=d7B});var c7B,eiA;var HnA=K(()=>{siA();c7B=tiA("toUpperCase"),eiA=c7B});function l7B(H){return eiA($EH(H).toLowerCase())}var Fk;var eYH=K(()=>{NlH();HnA();Fk=l7B});function i7B(H,$,A,L){var I=-1,D=H==null?0:H.length;while(++I{$nA=i7B});function n7B(H){return function($,A,L){var I=-1,D=Object($),B=L($),f=B.length;while(f--){var E=B[H?f:++I];if(A(D[E],E,D)===!1)break}return $}}var LnA;var InA=K(()=>{LnA=n7B});var r7B,ViH;var DR$=K(()=>{InA();r7B=LnA(),ViH=r7B});function a7B(H,$){return H&&ViH(H,$,bZ)}var PiH;var BR$=K(()=>{DR$();GHH();PiH=a7B});function o7B(H,$){return function(A,L){if(A==null)return A;if(!tj(A))return H(A,L);var I=A.length,D=$?I:-1,B=Object(A);while($?D--:++D{ofH();DnA=o7B});var t7B,_iH;var fR$=K(()=>{BR$();BnA();t7B=DnA(PiH),_iH=t7B});function s7B(H,$,A,L){return _iH(H,function(I,D,B){$(L,I,A(I),B)}),L}var fnA;var EnA=K(()=>{fR$();fnA=s7B});function e7B(H,$){return function(A,L){var I=wE(A)?$nA:fnA,D=$?$():{};return I(A,H,ej(L,2),D)}}var MnA;var GnA=K(()=>{AnA();EnA();DEH();XV();MnA=e7B});function H6B(H,$,A){if(A!==void 0&&!ij(H[$],A)||A===void 0&&!($ in H))Sc(H,$,A)}var HCH;var ER$=K(()=>{nYH();kfH();HCH=H6B});function $6B(H){return sF(H)&&tj(H)}var UnA;var XnA=K(()=>{ofH();rj();UnA=$6B});function A6B(H,$){if($==="constructor"&&typeof H[$]==="function")return;if($=="__proto__")return;return H[$]}var $CH;var MR$=K(()=>{$CH=A6B});function L6B(H){return gZ(H,AR(H))}var JnA;var FnA=K(()=>{qHH();JEH();JnA=L6B});function I6B(H,$,A,L,I,D,B){var f=$CH(H,A),E=$CH($,A),M=B.get(E);if(M){HCH(H,A,M);return}var G=D?D(f,E,A+"",H,$,B):void 0,U=G===void 0;if(U){var X=wE(E),J=!X&&aj(E),F=!X&&!J&&rfH(E);if(G=E,X||J||F)if(wE(f))G=f;else if(UnA(f))G=tlH(f);else if(J)U=!1,G=oYH(E,!0);else if(F)U=!1,G=AiH(E,!0);else G=[];else if(WEH(E)||fk(E)){if(G=f,fk(f))G=JnA(f);else if(!f5(f)||hfH(f))G=LiH(E)}else U=!1}if(U)B.set(E,G),I(G,E,L,D,B),B.delete(E);HCH(H,A,G)}var KnA;var QnA=K(()=>{ER$();yj$();kj$();vj$();uj$();VYH();XV();XnA();_YH();acH();hZ();KiH();FlH();MR$();FnA();KnA=I6B});function WnA(H,$,A,L,I){if(H===$)return;ViH($,function(D,B){if(I||(I=new nj),f5(D))KnA(H,$,B,A,WnA,L,I);else{var f=L?L($CH(H,B),D,B+"",H,$,I):void 0;if(f===void 0)f=D;HCH(H,B,f)}},AR)}var VnA;var PnA=K(()=>{WYH();ER$();DR$();QnA();hZ();JEH();MR$();VnA=WnA});var D6B,ACH;var _nA=K(()=>{PnA();qiA();D6B=ZiA(function(H,$,A,L){VnA(H,$,A,L)}),ACH=D6B});function B6B(H,$,A){var L=-1,I=H==null?0:H.length;while(++L{YnA=B6B});function f6B(H){var $=H==null?0:H.length;return $?H[$-1]:void 0}var _6;var SHH=K(()=>{_6=f6B});function E6B(H,$){var A=[];return _iH(H,function(L,I,D){if($(L,I,D))A.push(L)}),A}var wnA;var ZnA=K(()=>{fR$();wnA=E6B});function M6B(H,$){return HEH($,function(A){return H[A]})}var qnA;var TnA=K(()=>{zlH();qnA=M6B});function G6B(H){return H==null?[]:qnA(H,bZ(H))}var znA;var NnA=K(()=>{TnA();GHH();znA=G6B});function U6B(H,$){return $.length<2?H:LEH(H,QiH($,0,-1))}var OnA;var xnA=K(()=>{OlH();$R$();OnA=U6B});function X6B(H,$){return tfH(H,$)}var jHH;var GR$=K(()=>{ClH();jHH=X6B});function J6B(H,$){var A={};return $=ej($,3),PiH(H,function(L,I,D){Sc(A,I,$(L,I,D))}),A}var RHH;var YiH=K(()=>{nYH();BR$();DEH();RHH=J6B});function K6B(H){if(typeof H!="function")throw TypeError(F6B);return function(){var $=arguments;switch($.length){case 0:return!H.call(this);case 1:return!H.call(this,$[0]);case 2:return!H.call(this,$[0],$[1]);case 3:return!H.call(this,$[0],$[1],$[2])}return!H.apply(this,$)}}var F6B="Expected a function",SnA;var jnA=K(()=>{SnA=K6B});function Q6B(H,$){return $=sj($,H),H=OnA(H,$),H==null||delete H[kZ(_6($))]}var RnA;var ynA=K(()=>{AEH();SHH();xnA();XHH();RnA=Q6B});function W6B(H){return WEH(H)?void 0:H}var vnA;var hnA=K(()=>{KiH();vnA=W6B});var V6B=1,P6B=2,_6B=4,Y6B,VEH;var UR$=K(()=>{zlH();gj$();ynA();AEH();qHH();hnA();viA();bj$();Y6B=yiA(function(H,$){var A={};if(H==null)return A;var L=!1;if($=HEH($,function(D){return D=sj(D,H),L||(L=D.length>1),D}),gZ(H,HiH(H),A),L)A=DiH(A,V6B|P6B|_6B,vnA);var I=$.length;while(I--)RnA(A,$[I]);return A}),VEH=Y6B});function C6B(H,$,A,L){if(!f5(H))return H;$=sj($,H);var I=-1,D=$.length,B=D-1,f=H;while(f!=null&&++I{rYH();AEH();YYH();hZ();XHH();bnA=C6B});var w6B,unA;var gnA=K(()=>{GnA();w6B=MnA(function(H,$,A){H[A?0:1].push($)},function(){return[[],[]]}),unA=w6B});function T6B(H,$){return H+Z6B(q6B()*($-H+1))}var Z6B,q6B,mnA;var pnA=K(()=>{Z6B=Math.floor,q6B=Math.random;mnA=T6B});function z6B(H,$){var A=wE(H)?BlH:wnA;return A(H,SnA(ej($,3)))}var DR;var XR$=K(()=>{JS$();ZnA();DEH();XV();jnA();DR=z6B});function N6B(H){var $=H.length;return $?H[mnA(0,$-1)]:void 0}var CiH;var JR$=K(()=>{pnA();CiH=N6B});function O6B(H){return CiH(znA(H))}var dnA;var cnA=K(()=>{JR$();NnA();dnA=O6B});function x6B(H){var $=wE(H)?CiH:dnA;return $(H)}var QV;var yHH=K(()=>{JR$();cnA();XV();QV=x6B});function S6B(H,$,A,L){return L=typeof L=="function"?L:void 0,H==null?H:bnA(H,$,A,L)}var lnA;var inA=K(()=>{knA();lnA=S6B});var j6B=1/0,R6B,nnA;var rnA=K(()=>{_S$();sj$();LlH();R6B=!(Nc&&1/dfH(new Nc([,-0]))[1]==j6B)?Jk:function(H){return new Nc(H)},nnA=R6B});function v6B(H,$,A){var L=-1,I=WiA,D=H.length,B=!0,f=[],E=f;if(A)B=!1,I=YnA;else if(D>=y6B){var M=$?null:nnA(H);if(M)return dfH(M);B=!1,I=$lH,E=new HlH}else E=$?[]:f;H:while(++L{fS$();ViA();CnA();ES$();rnA();LlH();anA=v6B});function h6B(H,$){return H&&H.length?anA(H,ej($,2)):[]}var BR;var PEH=K(()=>{DEH();onA();BR=h6B});function b6B(H,$,A){var L=-1,I=H.length,D=$.length,B={};while(++L{tnA=b6B});function k6B(H,$){return tnA(H||[],$||[],jc)}var enA;var HrA=K(()=>{rYH();snA();enA=k6B});var wiH=K(()=>{GR$();tD()});function LrA(){return ArA}function FR$(H){let $=2166136261,A=H.length;for(let L=0;L>>0}function LCH(H,$,A){if(A===2)return FR$(FR$(H+$)+"")%1e4/1e4;if(A===1)return FR$($+H)%1000/1000;return null}function u6B(H){if(H<=0)return[];return Array(H).fill(1/H)}function ZiH(H,$){return H>=$[0]&&H<$[1]}function IrA(H,$){let A=LCH("__"+$[0],H,1);if(A===null)return!1;return A>=$[1]&&A<$[2]}function DrA(H,$){for(let A=0;A<$.length;A++)if(ZiH(H,$[A]))return A;return-1}function QR$(H){try{let $=H.replace(/([^\\])\//g,"$1\\/");return new RegExp($)}catch($){console.error($);return}}function qiH(H,$){if(!$.length)return!1;let A=!1,L=!1;for(let I=0;I<$.length;I++){let D=p6B(H,$[I].type,$[I].pattern);if($[I].include===!1){if(D)return!1}else if(A=!0,D)L=!0}return L||!A}function g6B(H,$,A){try{let L=$.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");if(A)L="\\/?"+L.replace(/(^\/|\/$)/g,"")+"\\/?";return new RegExp("^"+L+"$","i").test(H)}catch(L){return!1}}function m6B(H,$){try{let A=new URL($.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),L=[[H.host,A.host,!1],[H.pathname,A.pathname,!0]];if(A.hash)L.push([H.hash,A.hash,!1]);return A.searchParams.forEach((I,D)=>{L.push([H.searchParams.get(D)||"",I,!1])}),!L.some((I)=>!g6B(I[0],I[1],I[2]))}catch(A){return!1}}function p6B(H,$,A){try{let L=new URL(H,"https://_");if($==="regex"){let I=QR$(A);if(!I)return!1;return I.test(L.href)||I.test(L.href.substring(L.origin.length))}else if($==="simple")return m6B(L,A);return!1}catch(L){return!1}}function BrA(H,$,A){if($=$===void 0?1:$,$<0)$=0;else if($>1)$=1;let L=u6B(H);if(A=A||L,A.length!==H)A=L;let I=A.reduce((B,f)=>f+B,0);if(I<0.99||I>1.01)A=L;let D=0;return A.map((B)=>{let f=D;return D+=B,[f,f+$*B]})}function frA(H,$,A){if(!$)return null;let L=$.split("?")[1];if(!L)return null;let I=L.replace(/#.*/,"").split("&").map((D)=>D.split("=",2)).filter((D)=>{let[B]=D;return B===H}).map((D)=>{let[,B]=D;return parseInt(B)});if(I.length>0&&I[0]>=0&&I[0]A.match(/^[0-9]+$/)?A.padStart(5," "):A).join("-")}function MrA(){let H;try{H="1.6.1"}catch($){H=""}return H}function GrA(H,$){let A,L;try{A=new URL(H),L=new URL($)}catch(I){return console.error(`Unable to merge query strings: ${I}`),$}return A.searchParams.forEach((I,D)=>{if(L.searchParams.has(D))return;L.searchParams.set(D,I)}),L.toString()}function $rA(H){return typeof H==="object"&&H!==null}function TiH(H){if(H.urlPatterns&&H.variations.some(($)=>$rA($)&&("urlRedirect"in $)))return"redirect";else if(H.variations.some(($)=>$rA($)&&($.domMutations||("js"in $)||("css"in $))))return"visual";return"unknown"}async function ziH(H,$){return new Promise((A)=>{let L=!1,I,D=(B)=>{if(L)return;L=!0,I&&clearTimeout(I),A(B||null)};if($)I=setTimeout(()=>D(),$);H.then((B)=>D(B)).catch(()=>D())})}var ArA,KR$=(H)=>Uint8Array.from(atob(H),($)=>$.charCodeAt(0));var DCH=K(()=>{ArA={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource}});function JrA(H){if(Object.assign(Y6,H),!Y6.backgroundSync)o6B()}async function FrA(H){let{instance:$,timeout:A,skipCache:L,allowStale:I,backgroundSync:D}=H;if(!D)Y6.backgroundSync=!1;return i6B({instance:$,allowStale:I,timeout:A,skipCache:L})}function d6B(H){let $=BCH(H),A=YEH.get($)||new Set;A.add(H),YEH.set($,A)}function KrA(H){YEH.forEach(($)=>$.delete(H))}function c6B(){CEH.forEach((H)=>{if(!H)return;H.state="idle",_R$(H)})}function l6B(){CEH.forEach((H)=>{if(!H)return;if(H.state!=="idle")return;YR$(H)})}async function XrA(){try{if(!fR.localStorage)return;await fR.localStorage.setItem(Y6.cacheKey,JSON.stringify(Array.from(Kk.entries())))}catch(H){}}async function i6B(H){let{instance:$,allowStale:A,timeout:L,skipCache:I}=H,D=BCH($),B=VR$($),f=new Date,E=new Date(f.getTime()-Y6.maxAge+Y6.staleTTL);await n6B();let M=!Y6.disableCache&&!I?Kk.get(B):void 0;if(M&&(A||M.staleAt>f)&&M.staleAt>E){if(M.sse)wEH.add(D);if(M.staleAt{I[f]=A[f]});let D=H.getForcedVariations(),B=H.getUrl();return`${$}||${JSON.stringify({ca:I,fv:D,url:B})}`}async function n6B(){if(UrA)return;UrA=!0;try{if(fR.localStorage){let H=await fR.localStorage.getItem(Y6.cacheKey);if(!Y6.disableCache&&H){let $=JSON.parse(H);if($&&Array.isArray($))$.forEach((A)=>{let[L,I]=A;Kk.set(L,{...I,staleAt:new Date(I.staleAt)})});QrA()}}}catch(H){}if(!Y6.disableIdleStreams){let H=_EH.startIdleListener();if(H)_EH.stopIdleListener=H}}function QrA(){let H=Array.from(Kk.entries()).map((A)=>{let[L,I]=A;return{key:L,staleAt:I.staleAt.getTime()}}).sort((A,L)=>A.staleAt-L.staleAt),$=Math.min(Math.max(0,Kk.size-Y6.maxEntries),Kk.size);for(let A=0;A<$;A++)Kk.delete(H[A].key)}function WrA(H,$,A){let L=A.dateUpdated||"",I=new Date(Date.now()+Y6.staleTTL),D=!Y6.disableCache?Kk.get($):void 0;if(D&&L&&D.version===L){D.staleAt=I,XrA();return}if(!Y6.disableCache)Kk.set($,{data:A,version:L,staleAt:I,sse:wEH.has(H)}),QrA();XrA();let B=YEH.get(H);B&&B.forEach((f)=>r6B(f,A))}async function r6B(H,$){await H.setPayload($||H.getPayload())}async function WR$(H){let{apiHost:$,apiRequestHeaders:A}=H.getApiHosts(),L=H.getClientKey(),I="isRemoteEval"in H&&H.isRemoteEval(),D=BCH(H),B=VR$(H),f=NiH.get(B);if(!f)f=(I?_EH.fetchRemoteEvalCall({host:$,clientKey:L,payload:{attributes:H.getAttributes(),forcedVariations:H.getForcedVariations(),forcedFeatures:Array.from(H.getForcedFeatures().entries()),url:H.getUrl()},headers:A}):_EH.fetchFeaturesCall({host:$,clientKey:L,headers:A})).then((M)=>{if(!M.ok)throw Error(`HTTP error: ${M.status}`);if(M.headers.get("x-sse-support")==="enabled")wEH.add(D);return M.json()}).then((M)=>{return WrA(D,B,M),PR$(H),NiH.delete(B),{data:M,success:!0,source:"network"}}).catch((M)=>{return NiH.delete(B),{data:null,source:"error",success:!1,error:M}}),NiH.set(B,f);return f}function PR$(H){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=BCH(H),L=VR$(H),{streamingHost:I,streamingHostRequestHeaders:D}=H.getApiHosts(),B=H.getClientKey();if($)wEH.add(A);if(Y6.backgroundSync&&wEH.has(A)&&fR.EventSource){if(CEH.has(A))return;let f={src:null,host:I,clientKey:B,headers:D,cb:(E)=>{try{if(E.type==="features-updated"){let M=YEH.get(A);M&&M.forEach((G)=>{WR$(G)})}else if(E.type==="features"){let M=JSON.parse(E.data);WrA(A,L,M)}f.errors=0}catch(M){VrA(f)}},errors:0,state:"active"};CEH.set(A,f),YR$(f)}}function VrA(H){if(H.state==="idle")return;if(H.errors++,H.errors>3||H.src&&H.src.readyState===2){let $=Math.pow(3,H.errors-3)*(1000+Math.random()*1000);_R$(H),setTimeout(()=>{if(["idle","active"].includes(H.state))return;YR$(H)},Math.min($,300000))}}function _R$(H){if(!H.src)return;if(H.src.onopen=null,H.src.onerror=null,H.src.close(),H.src=null,H.state==="active")H.state="disabled"}function YR$(H){H.src=_EH.eventSourceCall({host:H.host,clientKey:H.clientKey,headers:H.headers}),H.state="active",H.src.addEventListener("features",H.cb),H.src.addEventListener("features-updated",H.cb),H.src.onerror=()=>VrA(H),H.src.onopen=()=>{H.errors=0}}function a6B(H,$){_R$(H),CEH.delete($)}function o6B(){wEH.clear(),CEH.forEach(a6B),YEH.clear(),_EH.stopIdleListener()}function OiH(H,$){if($.streaming){if(!H.getClientKey())throw Error("Must specify clientKey to enable streaming");if($.payload)PR$(H,!0);d6B(H)}}var Y6,fR,_EH,YEH,UrA=!1,Kk,NiH,CEH,wEH;var PrA=K(()=>{DCH();Y6={staleTTL:60000,maxAge:14400000,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:20000,disableCache:!1},fR=LrA(),_EH={fetchFeaturesCall:(H)=>{let{host:$,clientKey:A,headers:L}=H;return fR.fetch(`${$}/api/features/${A}`,{headers:L})},fetchRemoteEvalCall:(H)=>{let{host:$,clientKey:A,payload:L,headers:I}=H,D={method:"POST",headers:{"Content-Type":"application/json",...I},body:JSON.stringify(L)};return fR.fetch(`${$}/api/eval/${A}`,D)},eventSourceCall:(H)=>{let{host:$,clientKey:A,headers:L}=H;if(L)return new fR.EventSource(`${$}/sub/${A}`,{headers:L});return new fR.EventSource(`${$}/sub/${A}`)},startIdleListener:()=>{let H;if(!(typeof window<"u"&&typeof document<"u"))return;let A=()=>{if(document.visibilityState==="visible")window.clearTimeout(H),l6B();else if(document.visibilityState==="hidden")H=window.setTimeout(c6B,Y6.idleStreamInterval)};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},stopIdleListener:()=>{}};try{if(globalThis.localStorage)fR.localStorage=globalThis.localStorage}catch(H){}YEH=new Map,Kk=new Map,NiH=new Map,CEH=new Map,wEH=new Set});function s6B(H){return H==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[H]}}function yiH(H){var $=RiH.get(H);if(!$)$={element:H,attributes:{}},RiH.set(H,$);return $}function viH(H,$,A,L,I){var D=A(H),B={isDirty:!1,originalValue:D,virtualValue:D,mutations:[],el:H,_positionTimeout:null,observer:new MutationObserver(function(){if($==="position"&&B._positionTimeout)return;else if($==="position")B._positionTimeout=setTimeout(function(){B._positionTimeout=null},1000);var f=A(H);if($==="position"&&f.parentNode===B.virtualValue.parentNode&&f.insertBeforeNode===B.virtualValue.insertBeforeNode)return;if(f===B.virtualValue)return;B.originalValue=f,I(B)}),mutationRunner:I,setValue:L,getCurrentValue:A};if($==="position"&&H.parentNode)B.observer.observe(H.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1});else B.observer.observe(H,s6B($));return B}function hiH(H,$){var A=$.getCurrentValue($.el);if($.virtualValue=H,H&&typeof H!=="string"){if(!A||H.parentNode!==A.parentNode||H.insertBeforeNode!==A.insertBeforeNode)$.isDirty=!0,_rA()}else if(H!==A)$.isDirty=!0,_rA()}function e6B(H){var $=H.originalValue;H.mutations.forEach(function(A){return $=A.mutate($)}),hiH(J3B($),H)}function H3B(H){var $=new Set(H.originalValue.split(/\s+/).filter(Boolean));H.mutations.forEach(function(A){return A.mutate($)}),hiH(Array.from($).filter(Boolean).join(" "),H)}function $3B(H){var $=H.originalValue;H.mutations.forEach(function(A){return $=A.mutate($)}),hiH($,H)}function A3B(H){var{parentSelector:$,insertBeforeSelector:A}=H,L=document.querySelector($);if(!L)return null;var I=A?document.querySelector(A):null;if(A&&!I)return null;return{parentNode:L,insertBeforeNode:I}}function L3B(H){var $=H.originalValue;H.mutations.forEach(function(A){var L=A.mutate(),I=A3B(L);$=I||$}),hiH($,H)}function CrA(H){var $=yiH(H);if(!$.html)$.html=viH(H,"html",I3B,D3B,e6B);return $.html}function wrA(H){var $=yiH(H);if(!$.position)$.position=viH(H,"position",B3B,f3B,L3B);return $.position}function ZrA(H){var $=yiH(H);if(!$.classes)$.classes=viH(H,"class",M3B,E3B,H3B);return $.classes}function qrA(H,$){var A=yiH(H);if(!A.attributes[$])A.attributes[$]=viH(H,$,G3B($),U3B($),$3B);return A.attributes[$]}function X3B(H,$){var A=RiH.get(H);if(!A)return;if($==="html"){var L,I;(L=A.html)==null||(I=L.observer)==null||I.disconnect(),delete A.html}else if($==="class"){var D,B;(D=A.classes)==null||(B=D.observer)==null||B.disconnect(),delete A.classes}else if($==="position"){var f,E;(f=A.position)==null||(E=f.observer)==null||E.disconnect(),delete A.position}else{var M,G,U;(M=A.attributes)==null||(G=M[$])==null||(U=G.observer)==null||U.disconnect(),delete A.attributes[$]}}function J3B(H){if(!xiH)xiH=document.createElement("div");return xiH.innerHTML=H,xiH.innerHTML}function SiH(H,$,A){if(!A.isDirty)return;A.isDirty=!1;var L=A.virtualValue;if(!A.mutations.length)X3B(H,$);A.setValue(H,L)}function F3B(H,$){H.html&&SiH($,"html",H.html),H.classes&&SiH($,"class",H.classes),H.position&&SiH($,"position",H.position),Object.keys(H.attributes).forEach(function(A){SiH($,A,H.attributes[A])})}function _rA(){RiH.forEach(F3B)}function K3B(H,$){var A=null;if(H.kind==="html")A=CrA($);else if(H.kind==="class")A=ZrA($);else if(H.kind==="attribute")A=qrA($,H.attribute);else if(H.kind==="position")A=wrA($);if(!A)return;A.mutations.push(H),A.mutationRunner(A)}function Q3B(H,$){var A=null;if(H.kind==="html")A=CrA($);else if(H.kind==="class")A=ZrA($);else if(H.kind==="attribute")A=qrA($,H.attribute);else if(H.kind==="position")A=wrA($);if(!A)return;var L=A.mutations.indexOf(H);if(L!==-1)A.mutations.splice(L,1);A.mutationRunner(A)}function TrA(H){if(H.kind==="position"&&H.elements.size===1)return;var $=new Set(H.elements),A=document.querySelectorAll(H.selector);A.forEach(function(L){if(!$.has(L))H.elements.add(L),K3B(H,L)})}function W3B(H){H.elements.forEach(function($){return Q3B(H,$)}),H.elements.clear(),qR$.delete(H)}function YrA(){qR$.forEach(TrA)}function V3B(){if(typeof document>"u")return;if(!CR$)CR$=new MutationObserver(function(){YrA()});YrA(),CR$.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1})}function biH(H){if(typeof document>"u")return ZR$;return qR$.add(H),TrA(H),{revert:function(){W3B(H)}}}function wR$(H,$){return biH({kind:"html",elements:new Set,mutate:$,selector:H})}function zrA(H,$){return biH({kind:"position",elements:new Set,mutate:$,selector:H})}function fCH(H,$){return biH({kind:"class",elements:new Set,mutate:$,selector:H})}function jiH(H,$,A){if(!t6B.test($))return ZR$;if($==="class"||$==="className")return fCH(H,function(L){var I=A(Array.from(L).join(" "));if(L.clear(),!I)return;I.split(/\s+/g).filter(Boolean).forEach(function(D){return L.add(D)})});return biH({kind:"attribute",attribute:$,elements:new Set,mutate:A,selector:H})}function P3B(H){var{selector:$,action:A,value:L,attribute:I,parentSelector:D,insertBeforeSelector:B}=H;if(I==="html"){if(A==="append")return wR$($,function(f){return f+(L!=null?L:"")});else if(A==="set")return wR$($,function(){return L!=null?L:""})}else if(I==="class"){if(A==="append")return fCH($,function(f){if(L)f.add(L)});else if(A==="remove")return fCH($,function(f){if(L)f.delete(L)});else if(A==="set")return fCH($,function(f){if(f.clear(),L)f.add(L)})}else if(I==="position"){if(A==="set"&&D)return zrA($,function(){return{insertBeforeSelector:B,parentSelector:D}})}else if(A==="append")return jiH($,I,function(f){return f!==null?f+(L!=null?L:""):L!=null?L:""});else if(A==="set")return jiH($,I,function(){return L!=null?L:""});else if(A==="remove")return jiH($,I,function(){return null});return ZR$}var t6B,ZR$,RiH,qR$,I3B=function($){return $.innerHTML},D3B=function($,A){return $.innerHTML=A},B3B=function($){return{parentNode:$.parentElement,insertBeforeNode:$.nextElementSibling}},f3B=function($,A){if(A.insertBeforeNode&&!A.parentNode.contains(A.insertBeforeNode))return;A.parentNode.insertBefore($,A.insertBeforeNode)},E3B=function($,A){return A?$.className=A:$.removeAttribute("class")},M3B=function($){return $.className},G3B=function($){return function(A){var L;return(L=A.getAttribute($))!=null?L:null}},U3B=function($){return function(A,L){return L!==null?A.setAttribute($,L):A.removeAttribute($)}},xiH,CR$,_3B,NrA;var OrA=K(()=>{t6B=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,ZR$={revert:function(){}},RiH=new Map,qR$=new Set;V3B();_3B={html:wR$,classes:fCH,attribute:jiH,position:zrA,declarative:P3B},NrA=_3B});function kc(H,$,A){A=A||{};for(let[L,I]of Object.entries($))switch(L){case"$or":if(!xrA(H,I,A))return!1;break;case"$nor":if(xrA(H,I,A))return!1;break;case"$and":if(!T3B(H,I,A))return!1;break;case"$not":if(kc(H,I,A))return!1;break;default:if(!ECH(I,Y3B(H,L),A))return!1}return!0}function Y3B(H,$){let A=$.split("."),L=H;for(let I=0;I0&&$.filter((A)=>A[0]==="$").length===$.length}function w3B(H){if(H===null)return"null";if(Array.isArray(H))return"array";let $=typeof H;if(["string","number","boolean","object","undefined"].includes($))return $;return"unknown"}function Z3B(H,$,A){if(!Array.isArray(H))return!1;let L=SrA($)?(I)=>ECH($,I,A):(I)=>kc(I,$,A);for(let I=0;I$.includes(A));return $.includes(H)}function q3B(H,$,A,L){switch(H){case"$veq":return sC($)===sC(A);case"$vne":return sC($)!==sC(A);case"$vgt":return sC($)>sC(A);case"$vgte":return sC($)>=sC(A);case"$vlt":return sC($)A;case"$gte":return $>=A;case"$exists":return A?$!=null:$==null;case"$in":if(!Array.isArray(A))return!1;return kiH($,A);case"$inGroup":return kiH($,L[A]||[]);case"$notInGroup":return!kiH($,L[A]||[]);case"$nin":if(!Array.isArray(A))return!1;return!kiH($,A);case"$not":return!ECH(A,$,L);case"$size":if(!Array.isArray($))return!1;return ECH(A,$.length,L);case"$elemMatch":return Z3B($,A,L);case"$all":if(!Array.isArray($))return!1;for(let I=0;I{DCH();TR$={}});function O3B(H){let $=new Map;if(H.global.forcedFeatureValues)H.global.forcedFeatureValues.forEach((A,L)=>$.set(L,A));if(H.user.forcedFeatureValues)H.user.forcedFeatureValues.forEach((A,L)=>$.set(L,A));return $}function x3B(H){if(H.global.forcedVariations&&H.user.forcedVariations)return{...H.global.forcedVariations,...H.user.forcedVariations};else if(H.global.forcedVariations)return H.global.forcedVariations;else if(H.user.forcedVariations)return H.user.forcedVariations;else return{}}async function ZEH(H){try{await H()}catch($){}}function RrA(H,$,A){if(H.user.trackedExperiments){let I=miH($,A);if(H.user.trackedExperiments.has(I))return[];H.user.trackedExperiments.add(I)}if(H.user.enableDevMode&&H.user.devLogs)H.user.devLogs.push({experiment:$,result:A,timestamp:Date.now().toString(),logType:"experiment"});let L=[];if(H.global.trackingCallback){let I=H.global.trackingCallback;L.push(ZEH(()=>I($,A,H.user)))}if(H.user.trackingCallback){let I=H.user.trackingCallback;L.push(ZEH(()=>I($,A)))}if(H.global.eventLogger){let I=H.global.eventLogger;L.push(ZEH(()=>I(N3B,{experimentId:$.key,variationId:A.key,hashAttribute:A.hashAttribute,hashValue:A.hashValue},H.user)))}return L}function S3B(H,$,A){if(H.user.trackedFeatureUsage){let L=JSON.stringify(A.value);if(H.user.trackedFeatureUsage[$]===L)return;if(H.user.trackedFeatureUsage[$]=L,H.user.enableDevMode&&H.user.devLogs)H.user.devLogs.push({featureKey:$,result:A,timestamp:Date.now().toString(),logType:"feature"})}if(H.global.onFeatureUsage){let L=H.global.onFeatureUsage;ZEH(()=>L($,A,H.user))}if(H.user.onFeatureUsage){let L=H.user.onFeatureUsage;ZEH(()=>L($,A))}if(H.global.eventLogger){let L=H.global.eventLogger;ZEH(()=>L(z3B,{feature:$,source:A.source,value:A.value,ruleId:A.source==="defaultValue"?"$default":A.ruleId||"",variationId:A.experimentResult?A.experimentResult.key:""},H.user))}}function uiH(H,$){if($.stack.evaluatedFeatures.has(H))return uc($,H,null,"cyclicPrerequisite");$.stack.evaluatedFeatures.add(H),$.stack.id=H;let A=O3B($);if(A.has(H))return uc($,H,A.get(H),"override");if(!$.global.features||!$.global.features[H])return uc($,H,null,"unknownFeature");let L=$.global.features[H];if(L.rules){let I=new Set($.stack.evaluatedFeatures);H:for(let D of L.rules){if(D.parentConditions)for(let E of D.parentConditions){$.stack.evaluatedFeatures=new Set(I);let M=uiH(E.id,$);if(M.source==="cyclicPrerequisite")return uc($,H,null,"cyclicPrerequisite");let G={value:M.value};if(!kc(G,E.condition||{})){if(E.gate)return uc($,H,null,"prerequisite");continue H}}if(D.filters&&hrA(D.filters,$))continue;if("force"in D){if(D.condition&&!vrA(D.condition,$))continue;if(!j3B($,D.seed||H,D.hashAttribute,$.user.saveStickyBucketAssignmentDoc&&!D.disableStickyBucketing?D.fallbackAttribute:void 0,D.range,D.coverage,D.hashVersion))continue;if(D.tracks)D.tracks.forEach((E)=>{if(!RrA($,E.experiment,E.result).length&&$.global.saveDeferredTrack)$.global.saveDeferredTrack({experiment:E.experiment,result:E.result})});return uc($,H,D.force,"force",D.id)}if(!D.variations)continue;let B={variations:D.variations,key:D.key||H};if("coverage"in D)B.coverage=D.coverage;if(D.weights)B.weights=D.weights;if(D.hashAttribute)B.hashAttribute=D.hashAttribute;if(D.fallbackAttribute)B.fallbackAttribute=D.fallbackAttribute;if(D.disableStickyBucketing)B.disableStickyBucketing=D.disableStickyBucketing;if(D.bucketVersion!==void 0)B.bucketVersion=D.bucketVersion;if(D.minBucketVersion!==void 0)B.minBucketVersion=D.minBucketVersion;if(D.namespace)B.namespace=D.namespace;if(D.meta)B.meta=D.meta;if(D.ranges)B.ranges=D.ranges;if(D.name)B.name=D.name;if(D.phase)B.phase=D.phase;if(D.seed)B.seed=D.seed;if(D.hashVersion)B.hashVersion=D.hashVersion;if(D.filters)B.filters=D.filters;if(D.condition)B.condition=D.condition;let{result:f}=giH(B,H,$);if($.global.onExperimentEval&&$.global.onExperimentEval(B,f),f.inExperiment&&!f.passthrough)return uc($,H,f.value,"experiment",D.id,B,f)}}return uc($,H,L.defaultValue===void 0?null:L.defaultValue,"defaultValue")}function giH(H,$,A){let L=H.key,I=H.variations.length;if(I<2)return{result:J4(A,H,-1,!1,$)};if(A.global.enabled===!1||A.user.enabled===!1)return{result:J4(A,H,-1,!1,$)};if(H=R3B(H,A),H.urlPatterns&&!qiH(A.user.url||"",H.urlPatterns))return{result:J4(A,H,-1,!1,$)};let D=frA(L,A.user.url||"",I);if(D!==null)return{result:J4(A,H,D,!1,$)};let B=x3B(A);if(L in B){let W=B[L];return{result:J4(A,H,W,!1,$)}}if(H.status==="draft"||H.active===!1)return{result:J4(A,H,-1,!1,$)};let{hashAttribute:f,hashValue:E}=hHH(A,H.hashAttribute,A.user.saveStickyBucketAssignmentDoc&&!H.disableStickyBucketing?H.fallbackAttribute:void 0);if(!E)return{result:J4(A,H,-1,!1,$)};let M=-1,G=!1,U=!1;if(A.user.saveStickyBucketAssignmentDoc&&!H.disableStickyBucketing){let{variation:W,versionIsBlocked:P}=h3B({ctx:A,expKey:H.key,expBucketVersion:H.bucketVersion,expHashAttribute:H.hashAttribute,expFallbackAttribute:H.fallbackAttribute,expMinBucketVersion:H.minBucketVersion,expMeta:H.meta});G=W>=0,M=W,U=!!P}if(!G){if(H.filters){if(hrA(H.filters,A))return{result:J4(A,H,-1,!1,$)}}else if(H.namespace&&!IrA(E,H.namespace))return{result:J4(A,H,-1,!1,$)};if(H.include&&!ErA(H.include))return{result:J4(A,H,-1,!1,$)};if(H.condition&&!vrA(H.condition,A))return{result:J4(A,H,-1,!1,$)};if(H.parentConditions){let W=new Set(A.stack.evaluatedFeatures);for(let P of H.parentConditions){A.stack.evaluatedFeatures=new Set(W);let C=uiH(P.id,A);if(C.source==="cyclicPrerequisite")return{result:J4(A,H,-1,!1,$)};let Y={value:C.value};if(!kc(Y,P.condition||{}))return{result:J4(A,H,-1,!1,$)}}}if(H.groups&&!v3B(H.groups,A))return{result:J4(A,H,-1,!1,$)}}if(H.url&&!y3B(H.url,A))return{result:J4(A,H,-1,!1,$)};let X=LCH(H.seed||L,E,H.hashVersion||1);if(X===null)return{result:J4(A,H,-1,!1,$)};if(!G){let W=H.ranges||BrA(I,H.coverage===void 0?1:H.coverage,H.weights);M=DrA(X,W)}if(U)return{result:J4(A,H,-1,!1,$,void 0,!0)};if(M<0)return{result:J4(A,H,-1,!1,$)};if("force"in H)return{result:J4(A,H,H.force===void 0?-1:H.force,!1,$)};if(A.global.qaMode||A.user.qaMode)return{result:J4(A,H,-1,!1,$)};if(H.status==="stopped")return{result:J4(A,H,-1,!1,$)};let J=J4(A,H,M,!0,$,X,G);if(A.user.saveStickyBucketAssignmentDoc&&!H.disableStickyBucketing){let{changed:W,key:P,doc:C}=k3B(A,f,ICH(E),{[zR$(H.key,H.bucketVersion)]:J.key});if(W)A.user.stickyBucketAssignmentDocs=A.user.stickyBucketAssignmentDocs||{},A.user.stickyBucketAssignmentDocs[P]=C,A.user.saveStickyBucketAssignmentDoc(C)}let F=RrA(A,H,J);if(F.length===0&&A.global.saveDeferredTrack)A.global.saveDeferredTrack({experiment:H,result:J});let Q=!F.length?void 0:F.length===1?F[0]:Promise.all(F).then(()=>{});return"changeId"in H&&H.changeId&&A.global.recordChangeId&&A.global.recordChangeId(H.changeId),{result:J,trackingCall:Q}}function uc(H,$,A,L,I,D,B){let f={value:A,on:!!A,off:!A,source:L,ruleId:I||""};if(D)f.experiment=D;if(B)f.experimentResult=B;if(L!=="override")S3B(H,$,f);return f}function yrA(H){return{...H.user.attributes,...H.user.attributeOverrides}}function vrA(H,$){return kc(yrA($),H,$.global.savedGroups||{})}function hrA(H,$){return H.some((A)=>{let{hashValue:L}=hHH($,A.attribute);if(!L)return!0;let I=LCH(A.seed,L,A.hashVersion||2);if(I===null)return!0;return!A.ranges.some((D)=>ZiH(I,D))})}function j3B(H,$,A,L,I,D,B){if(!I&&D===void 0)return!0;if(!I&&D===0)return!1;let{hashValue:f}=hHH(H,A,L);if(!f)return!1;let E=LCH($,f,B||1);if(E===null)return!1;return I?ZiH(E,I):D!==void 0?E<=D:!0}function J4(H,$,A,L,I,D,B){let f=!0;if(A<0||A>=$.variations.length)A=0,f=!1;let{hashAttribute:E,hashValue:M}=hHH(H,$.hashAttribute,H.user.saveStickyBucketAssignmentDoc&&!$.disableStickyBucketing?$.fallbackAttribute:void 0),G=$.meta?$.meta[A]:{},U={key:G.key||""+A,featureId:I,inExperiment:f,hashUsed:L,variationId:A,value:$.variations[A],hashAttribute:E,hashValue:M,stickyBucketUsed:!!B};if(G.name)U.name=G.name;if(D!==void 0)U.bucket=D;if(G.passthrough)U.passthrough=G.passthrough;return U}function R3B(H,$){let A=H.key,L=$.global.overrides;if(L&&L[A]){if(H=Object.assign({},H,L[A]),typeof H.url==="string")H.url=QR$(H.url)}return H}function hHH(H,$,A){let L=$||"id",I="",D=yrA(H);if(D[L])I=D[L];if(!I&&A){if(D[A])I=D[A];if(I)L=A}return{hashAttribute:L,hashValue:I}}function y3B(H,$){let A=$.user.url;if(!A)return!1;let L=A.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");if(H.test(A))return!0;if(H.test(L))return!0;return!1}function v3B(H,$){let A=$.global.groups||{};for(let L=0;L0)for(let X=0;X<=B;X++){let J=zR$(A,X);if(M[J]!==void 0)return{variation:-1,versionIsBlocked:!0}}let G=M[E];if(G===void 0)return{variation:-1};let U=f.findIndex((X)=>X.key===G);if(U<0)return{variation:-1};return{variation:U}}function zR$(H,$){return $=$||0,`${H}__${$}`}function NR$(H,$){return`${H}||${$}`}function b3B(H,$,A){if(!H.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:L,hashValue:I}=hHH(H,$),D=NR$(L,ICH(I)),{hashAttribute:B,hashValue:f}=hHH(H,A),E=f?NR$(B,ICH(f)):null,M={};if(E&&H.user.stickyBucketAssignmentDocs[E])Object.assign(M,H.user.stickyBucketAssignmentDocs[E].assignments||{});if(H.user.stickyBucketAssignmentDocs[D])Object.assign(M,H.user.stickyBucketAssignmentDocs[D].assignments||{});return M}function k3B(H,$,A,L){let I=NR$($,A),D=H.user.stickyBucketAssignmentDocs&&H.user.stickyBucketAssignmentDocs[I]?H.user.stickyBucketAssignmentDocs[I].assignments||{}:{},B={...D,...L},f=JSON.stringify(D)!==JSON.stringify(B);return{key:I,doc:{attributeName:$,attributeValue:A,assignments:B},changed:f}}function u3B(H,$){let A=new Set,L=$&&$.features?$.features:H.global.features||{},I=$&&$.experiments?$.experiments:H.global.experiments||[];return Object.keys(L).forEach((D)=>{let B=L[D];if(B.rules){for(let f of B.rules)if(f.variations){if(A.add(f.hashAttribute||"id"),f.fallbackAttribute)A.add(f.fallbackAttribute)}}}),I.map((D)=>{if(A.add(D.hashAttribute||"id"),D.fallbackAttribute)A.add(D.fallbackAttribute)}),Array.from(A)}async function brA(H,$,A){let L=OR$(H,A);return $.getAllAssignments(L)}function OR$(H,$){let A={};return u3B(H,$).forEach((I)=>{let{hashValue:D}=hHH(H,I);A[I]=ICH(D)}),A}async function krA(H,$,A){if(H={...H},H.encryptedFeatures){try{H.features=JSON.parse(await vHH(H.encryptedFeatures,$,A))}catch(L){console.error(L)}delete H.encryptedFeatures}if(H.encryptedExperiments){try{H.experiments=JSON.parse(await vHH(H.encryptedExperiments,$,A))}catch(L){console.error(L)}delete H.encryptedExperiments}if(H.encryptedSavedGroups){try{H.savedGroups=JSON.parse(await vHH(H.encryptedSavedGroups,$,A))}catch(L){console.error(L)}delete H.encryptedSavedGroups}return H}function urA(H){let $=H.apiHost||"https://cdn.growthbook.io";return{apiHost:$.replace(/\/*$/,""),streamingHost:(H.streamingHost||$).replace(/\/*$/,""),apiRequestHeaders:H.apiHostRequestHeaders,streamingHostRequestHeaders:H.streamingHostRequestHeaders}}function miH(H,$){return $.hashAttribute+$.hashValue+H.key+$.variationId}var z3B="Feature Evaluated",N3B="Experiment Viewed";var grA=K(()=>{jrA();DCH()});class piH{constructor(H){if(H=H||{},this.version=g3B,this._options=this.context=H,this._renderer=H.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!H.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!H.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),H.remoteEval){if(H.decryptionKey)throw Error("Encryption is not available for remoteEval");if(!H.clientKey)throw Error("Missing clientKey");let $=!1;try{$=!!new URL(H.apiHost||"").hostname.match(/growthbook\.io$/i)}catch(A){}if($)throw Error("Cannot use remoteEval on GrowthBook Cloud")}else if(H.cacheKeyAttributes)throw Error("cacheKeyAttributes are only used for remoteEval");if(H.stickyBucketService){let $=H.stickyBucketService;this._saveStickyBucketAssignmentDoc=(A)=>{return $.saveAssignments(A)}}if(H.plugins)for(let $ of H.plugins)$(this);if(H.features)this.ready=!0;if(qEH&&H.enableDevMode)window._growthbook=this,document.dispatchEvent(new Event("gbloaded"));if(H.experiments)this.ready=!0,this._updateAllAutoExperiments();if(this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let $ in this._options.stickyBucketAssignmentDocs){let A=this._options.stickyBucketAssignmentDocs[$];if(A)this._options.stickyBucketService.saveAssignments(A).catch(()=>{})}if(this.ready)this.refreshStickyBuckets(this.getPayload())}async setPayload(H){this._payload=H;let $=await krA(H,this._options.decryptionKey);if(this._decryptedPayload=$,await this.refreshStickyBuckets($),$.features)this._options.features=$.features;if($.savedGroups)this._options.savedGroups=$.savedGroups;if($.experiments)this._options.experiments=$.experiments,this._updateAllAutoExperiments();this.ready=!0,this._render()}initSync(H){this._initialized=!0;let $=H.payload;if($.encryptedExperiments||$.encryptedFeatures)throw Error("initSync does not support encrypted payloads");if(this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs)this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,$);if(this._payload=$,this._decryptedPayload=$,$.features)this._options.features=$.features;if($.experiments)this._options.experiments=$.experiments,this._updateAllAutoExperiments();return this.ready=!0,OiH(this,H),this}async init(H){if(this._initialized=!0,H=H||{},H.cacheSettings)JrA(H.cacheSettings);if(H.payload)return await this.setPayload(H.payload),OiH(this,H),{success:!0,source:"init"};else{let{data:$,...A}=await this._refresh({...H,allowStale:!0});return OiH(this,H),await this.setPayload($||{}),A}}async loadFeatures(H){H=H||{},await this.init({skipCache:H.skipCache,timeout:H.timeout,streaming:(this._options.backgroundSync??!0)&&(H.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(H){let $=await this._refresh({...H||{},allowStale:!1});if($.data)await this.setPayload($.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return urA(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh(H){let{timeout:$,skipCache:A,allowStale:L,streaming:I}=H;if(!this._options.clientKey)throw Error("Missing clientKey");return FrA({instance:this,timeout:$,skipCache:A||this._options.disableCache,allowStale:L,backgroundSync:I??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(H){console.error("Failed to render",H)}}setFeatures(H){this._options.features=H,this.ready=!0,this._render()}async setEncryptedFeatures(H,$,A){let L=await vHH(H,$||this._options.decryptionKey,A);this.setFeatures(JSON.parse(L))}setExperiments(H){this._options.experiments=H,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(H,$,A){let L=await vHH(H,$||this._options.decryptionKey,A);this.setExperiments(JSON.parse(L))}async setAttributes(H){if(this._options.attributes=H,this._options.stickyBucketService)await this.refreshStickyBuckets();if(this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(H){return this.setAttributes({...this._options.attributes,...H})}async setAttributeOverrides(H){if(this._options.attributeOverrides=H,this._options.stickyBucketService)await this.refreshStickyBuckets();if(this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(H){if(this._options.forcedVariations=H||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(H){this._options.forcedFeatureValues=H,this._render()}async setURL(H){if(H===this._options.url)return;if(this._options.url=H,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(H){return this._subscriptions.add(H),()=>{this._subscriptions.delete(H)}}async _refreshForRemoteEval(){if(!this._options.remoteEval)return;if(!this._initialized)return;let H=await this._refresh({allowStale:!1});if(H.data)await this.setPayload(H.data)}getAllResults(){return new Map(this._assigned)}onDestroy(H){this._destroyCallbacks.push(H)}isDestroyed(){return!!this._destroyed}destroy(){if(this._destroyed=!0,this._destroyCallbacks.forEach((H)=>{try{H()}catch($){console.error($)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,KrA(this),this.logs=[],qEH&&window._growthbook===this)delete window._growthbook;this._activeAutoExperiments.forEach((H)=>{H.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(H){this._renderer=H}forceVariation(H,$){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[H]=$,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(H){let{result:$}=giH(H,null,this._getEvalContext());return this._fireSubscriptions(H,$),$}triggerExperiment(H){if(this._triggeredExpKeys.add(H),!this._options.experiments)return null;return this._options.experiments.filter((A)=>A.key===H).map((A)=>{return this._runAutoExperiment(A)}).filter((A)=>A!==null)}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._subscriptions.size>0?this._fireSubscriptions:void 0,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(H,$){let A=this._activeAutoExperiments.get(H);if(H.manual&&!this._triggeredExpKeys.has(H.key)&&!A)return null;let L=this._isAutoExperimentBlockedByContext(H),I,D;if(L)I=J4(this._getEvalContext(),H,-1,!1,"");else({result:I,trackingCall:D}=giH(H,null,this._getEvalContext())),this._fireSubscriptions(H,I);let B=JSON.stringify(I.value);if(!$&&I.inExperiment&&A&&A.valueHash===B)return I;if(A)this._undoActiveAutoExperiment(H);if(I.inExperiment){let f=TiH(H);if(f==="redirect"&&I.value.urlRedirect&&H.urlPatterns){let E=H.persistQueryString?GrA(this._getContextUrl(),I.value.urlRedirect):I.value.urlRedirect;if(qiH(E,H.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:H.key}),I;this._redirectedUrl=E;let{navigate:M,delay:G}=this._getNavigateFunction();if(M)if(qEH)Promise.all([...D?[ziH(D,this._options.maxNavigateDelay??1000)]:[],new Promise((U)=>window.setTimeout(U,this._options.navigateDelay??G))]).then(()=>{try{M(E)}catch(U){console.error(U)}});else try{M(E)}catch(U){console.error(U)}}else if(f==="visual"){let E=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(I.value):this._applyDOMChanges(I.value);if(E)this._activeAutoExperiments.set(H,{undo:E,valueHash:B})}}return I}_undoActiveAutoExperiment(H){let $=this._activeAutoExperiments.get(H);if($)$.undo(),this._activeAutoExperiments.delete(H)}_updateAllAutoExperiments(H){if(!this._autoExperimentsAllowed)return;let $=this._options.experiments||[],A=new Set($);this._activeAutoExperiments.forEach((L,I)=>{if(!A.has(I))L.undo(),this._activeAutoExperiments.delete(I)});for(let L of $){let I=this._runAutoExperiment(L,H);if(I!==null&&I!==void 0&&I.inExperiment&&TiH(L)==="redirect")break}}_fireSubscriptions(H,$){let A=H.key,L=this._assigned.get(A);if(!L||L.result.inExperiment!==$.inExperiment||L.result.variationId!==$.variationId)this._assigned.set(A,{experiment:H,result:$}),this._subscriptions.forEach((I)=>{try{I(H,$)}catch(D){console.error(D)}})}_recordChangedId(H){this._completedChangeIds.add(H)}isOn(H){return this.evalFeature(H).on}isOff(H){return this.evalFeature(H).off}getFeatureValue(H,$){let A=this.evalFeature(H).value;return A===null?$:A}feature(H){return this.evalFeature(H)}evalFeature(H){return uiH(H,this._getEvalContext())}log(H,$){if(!this.debug)return;if(this._options.log)this._options.log(H,$);else console.log(H,$)}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(H){this._deferredTrackingCalls=new Map(H.filter(($)=>$&&$.experiment&&$.result).map(($)=>{return[miH($.experiment,$.result),$]}))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let H=[];this._deferredTrackingCalls.forEach(($)=>{if(!$||!$.experiment||!$.result)console.error("Invalid deferred tracking call",{call:$});else H.push(this._options.trackingCallback($.experiment,$.result))}),this._deferredTrackingCalls.clear(),await Promise.all(H)}setTrackingCallback(H){this._options.trackingCallback=H,this.fireDeferredTrackingCalls()}setEventLogger(H){this._options.eventLogger=H}async logEvent(H,$){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode)this.logs.push({eventName:H,properties:$,timestamp:Date.now().toString(),logType:"event"});if(this._options.eventLogger)try{await this._options.eventLogger(H,$||{},this._getUserContext())}catch(A){console.error(A)}else console.error("No event logger configured")}_saveDeferredTrack(H){this._deferredTrackingCalls.set(miH(H.experiment,H.result),H)}_getContextUrl(){return this._options.url||(qEH?window.location.href:"")}_isAutoExperimentBlockedByContext(H){let $=TiH(H);if($==="visual"){if(this._options.disableVisualExperiments)return!0;if(this._options.disableJsInjection){if(H.variations.some((A)=>A.js))return!0}}else if($==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let A=new URL(this._getContextUrl());for(let L of H.variations){if(!L||!L.urlRedirect)continue;let I=new URL(L.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments){if(I.protocol!==A.protocol)return!0;if(I.host!==A.host)return!0}}}catch(A){return this.log("Error parsing current or redirect URL",{id:H.key,error:A}),!0}}else return!0;if(H.changeId&&(this._options.blockedChangeIds||[]).includes(H.changeId))return!0;return!1}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){if(this._options.navigate)return{navigate:this._options.navigate,delay:0};else if(qEH)return{navigate:(H)=>{window.location.replace(H)},delay:100};return{navigate:null,delay:0}}_applyDOMChanges(H){if(!qEH)return;let $=[];if(H.css){let A=document.createElement("style");A.innerHTML=H.css,document.head.appendChild(A),$.push(()=>A.remove())}if(H.js){let A=document.createElement("script");if(A.innerHTML=H.js,this._options.jsInjectionNonce)A.nonce=this._options.jsInjectionNonce;document.head.appendChild(A),$.push(()=>A.remove())}if(H.domMutations)H.domMutations.forEach((A)=>{$.push(NrA.declarative(A).revert)});return()=>{$.forEach((A)=>A())}}async refreshStickyBuckets(H){if(this._options.stickyBucketService){let $=this._getEvalContext(),A=await brA($,this._options.stickyBucketService,H);this._options.stickyBucketAssignmentDocs=A}}generateStickyBucketAssignmentDocsSync(H,$){if(!("getAllAssignmentsSync"in H)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let A=this._getEvalContext(),L=OR$(A,$);return H.getAllAssignmentsSync(L)}inDevMode(){return!!this._options.enableDevMode}}var qEH,g3B;var mrA=K(()=>{OrA();DCH();PrA();grA();qEH=typeof window<"u"&&typeof document<"u",g3B=MrA()});var prA=K(()=>{mrA()});var drA="sdk-zAZezfDKGoZuXXKe";var crA=K(()=>{NA()});function MCH(H,$){return function(){return H.apply($,arguments)}}function p3B(H){return H!==null&&!GCH(H)&&H.constructor!==null&&!GCH(H.constructor)&&eC(H.constructor.isBuffer)&&H.constructor.isBuffer(H)}function d3B(H){let $;if(typeof ArrayBuffer<"u"&&ArrayBuffer.isView)$=ArrayBuffer.isView(H);else $=H&&H.buffer&&irA(H.buffer);return $}function UCH(H,$,{allOwnKeys:A=!1}={}){if(H===null||typeof H>"u")return;let L,I;if(typeof H!=="object")H=[H];if(TEH(H))for(L=0,I=H.length;L0)if(I=A[L],$===I.toLowerCase())return I;return null}function xR$(){let{caseless:H}=arA(this)&&this||{},$={},A=(L,I)=>{let D=H&&rrA($,I)||I;if(diH($[D])&&diH(L))$[D]=xR$($[D],L);else if(diH(L))$[D]=xR$({},L);else if(TEH(L))$[D]=L.slice();else $[D]=L};for(let L=0,I=arguments.length;L{return H=H.toLowerCase(),($)=>ciH($)===H},liH=(H)=>($)=>typeof $===H,TEH,GCH,irA,c3B,eC,nrA,iiH=(H)=>H!==null&&typeof H==="object",l3B=(H)=>H===!0||H===!1,diH=(H)=>{if(ciH(H)!=="object")return!1;let $=SR$(H);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in H)&&!(Symbol.iterator in H)},i3B,n3B,r3B,a3B,o3B=(H)=>iiH(H)&&eC(H.pipe),t3B=(H)=>{let $;return H&&(typeof FormData==="function"&&H instanceof FormData||eC(H.append)&&(($=ciH(H))==="formdata"||$==="object"&&eC(H.toString)&&H.toString()==="[object FormData]"))},s3B,e3B,HVB,$VB,AVB,LVB=(H)=>H.trim?H.trim():H.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),bHH,arA=(H)=>!GCH(H)&&H!==bHH,IVB=(H,$,A,{allOwnKeys:L}={})=>{return UCH($,(I,D)=>{if(A&&eC(I))H[D]=MCH(I,A);else H[D]=I},{allOwnKeys:L}),H},DVB=(H)=>{if(H.charCodeAt(0)===65279)H=H.slice(1);return H},BVB=(H,$,A,L)=>{H.prototype=Object.create($.prototype,L),H.prototype.constructor=H,Object.defineProperty(H,"super",{value:$.prototype}),A&&Object.assign(H.prototype,A)},fVB=(H,$,A,L)=>{let I,D,B,f={};if($=$||{},H==null)return $;do{I=Object.getOwnPropertyNames(H),D=I.length;while(D-- >0)if(B=I[D],(!L||L(B,H,$))&&!f[B])$[B]=H[B],f[B]=!0;H=A!==!1&&SR$(H)}while(H&&(!A||A(H,$))&&H!==Object.prototype);return $},EVB=(H,$,A)=>{if(H=String(H),A===void 0||A>H.length)A=H.length;A-=$.length;let L=H.indexOf($,A);return L!==-1&&L===A},MVB=(H)=>{if(!H)return null;if(TEH(H))return H;let $=H.length;if(!nrA($))return null;let A=Array($);while($-- >0)A[$]=H[$];return A},GVB,UVB=(H,$)=>{let L=(H&&H[Symbol.iterator]).call(H),I;while((I=L.next())&&!I.done){let D=I.value;$.call(H,D[0],D[1])}},XVB=(H,$)=>{let A,L=[];while((A=H.exec($))!==null)L.push(A);return L},JVB,FVB=(H)=>{return H.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(A,L,I){return L.toUpperCase()+I})},lrA,KVB,orA=(H,$)=>{let A=Object.getOwnPropertyDescriptors(H),L={};UCH(A,(I,D)=>{let B;if((B=$(I,D,H))!==!1)L[D]=B||I}),Object.defineProperties(H,L)},QVB=(H)=>{orA(H,($,A)=>{if(eC(H)&&["arguments","caller","callee"].indexOf(A)!==-1)return!1;let L=H[A];if(!eC(L))return;if($.enumerable=!1,"writable"in $){$.writable=!1;return}if(!$.set)$.set=()=>{throw Error("Can not rewrite read-only method '"+A+"'")}})},WVB=(H,$)=>{let A={},L=(I)=>{I.forEach((D)=>{A[D]=!0})};return TEH(H)?L(H):L(String(H).split($)),A},VVB=()=>{},PVB=(H,$)=>{return H!=null&&Number.isFinite(H=+H)?H:$},YVB=(H)=>{let $=[,,,,,,,,,,],A=(L,I)=>{if(iiH(L)){if($.indexOf(L)>=0)return;if(!("toJSON"in L)){$[I]=L;let D=TEH(L)?[]:{};return UCH(L,(B,f)=>{let E=A(B,I+1);!GCH(E)&&(D[f]=E)}),$[I]=void 0,D}}return L};return A(H,0)},CVB,wVB=(H)=>H&&(iiH(H)||eC(H))&&eC(H.then)&&eC(H.catch),trA,ZVB,v$;var iM=K(()=>{({toString:m3B}=Object.prototype),{getPrototypeOf:SR$}=Object,ciH=((H)=>($)=>{let A=m3B.call($);return H[A]||(H[A]=A.slice(8,-1).toLowerCase())})(Object.create(null)),{isArray:TEH}=Array,GCH=liH("undefined");irA=ZN("ArrayBuffer");c3B=liH("string"),eC=liH("function"),nrA=liH("number"),i3B=ZN("Date"),n3B=ZN("File"),r3B=ZN("Blob"),a3B=ZN("FileList"),s3B=ZN("URLSearchParams"),[e3B,HVB,$VB,AVB]=["ReadableStream","Request","Response","Headers"].map(ZN);bHH=(()=>{if(typeof globalThis<"u")return globalThis;return typeof self<"u"?self:typeof window<"u"?window:global})();GVB=((H)=>{return($)=>{return H&&$ instanceof H}})(typeof Uint8Array<"u"&&SR$(Uint8Array)),JVB=ZN("HTMLFormElement"),lrA=(({hasOwnProperty:H})=>($,A)=>H.call($,A))(Object.prototype),KVB=ZN("RegExp");CVB=ZN("AsyncFunction"),trA=((H,$)=>{if(H)return setImmediate;return $?((A,L)=>{return bHH.addEventListener("message",({source:I,data:D})=>{if(I===bHH&&D===A)L.length&&L.shift()()},!1),(I)=>{L.push(I),bHH.postMessage(A,"*")}})(`axios@${Math.random()}`,[]):(A)=>setTimeout(A)})(typeof setImmediate==="function",eC(bHH.postMessage)),ZVB=typeof queueMicrotask<"u"?queueMicrotask.bind(bHH):typeof process<"u"&&process.nextTick||trA,v$={isArray:TEH,isArrayBuffer:irA,isBuffer:p3B,isFormData:t3B,isArrayBufferView:d3B,isString:c3B,isNumber:nrA,isBoolean:l3B,isObject:iiH,isPlainObject:diH,isReadableStream:e3B,isRequest:HVB,isResponse:$VB,isHeaders:AVB,isUndefined:GCH,isDate:i3B,isFile:n3B,isBlob:r3B,isRegExp:KVB,isFunction:eC,isStream:o3B,isURLSearchParams:s3B,isTypedArray:GVB,isFileList:a3B,forEach:UCH,merge:xR$,extend:IVB,trim:LVB,stripBOM:DVB,inherits:BVB,toFlatObject:fVB,kindOf:ciH,kindOfTest:ZN,endsWith:EVB,toArray:MVB,forEachEntry:UVB,matchAll:XVB,isHTMLForm:JVB,hasOwnProperty:lrA,hasOwnProp:lrA,reduceDescriptors:orA,freezeMethods:QVB,toObjectSet:WVB,toCamelCase:FVB,noop:VVB,toFiniteNumber:PVB,findKey:rrA,global:bHH,isContextDefined:arA,isSpecCompliantForm:_VB,toJSONObject:YVB,isAsyncFn:CVB,isThenable:wVB,setImmediate:trA,asap:ZVB}});function zEH(H,$,A,L,I){if(Error.call(this),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack;if(this.message=H,this.name="AxiosError",$&&(this.code=$),A&&(this.config=A),L&&(this.request=L),I)this.response=I,this.status=I.status?I.status:null}var srA,erA,rI;var H2=K(()=>{iM();v$.inherits(zEH,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v$.toJSONObject(this.config),code:this.code,status:this.status}}});srA=zEH.prototype,erA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((H)=>{erA[H]={value:H}});Object.defineProperties(zEH,erA);Object.defineProperty(srA,"isAxiosError",{value:!0});zEH.from=(H,$,A,L,I,D)=>{let B=Object.create(srA);return v$.toFlatObject(H,B,function(E){return E!==Error.prototype},(f)=>{return f!=="isAxiosError"}),zEH.call(B,H.message,$,A,L,I),B.cause=H,B.name=H.name,D&&Object.assign(B,D),B};rI=zEH});var AaA=z((Bi1,$aA)=>{var HaA=require("stream").Stream,qVB=require("util");$aA.exports=qN;function qN(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}qVB.inherits(qN,HaA);qN.create=function(H,$){var A=new this;$=$||{};for(var L in $)A[L]=$[L];A.source=H;var I=H.emit;if(H.emit=function(){return A._handleEmit(arguments),I.apply(H,arguments)},H.on("error",function(){}),A.pauseStream)H.pause();return A};Object.defineProperty(qN.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});qN.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};qN.prototype.resume=function(){if(!this._released)this.release();this.source.resume()};qN.prototype.pause=function(){this.source.pause()};qN.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(H){this.emit.apply(this,H)}.bind(this)),this._bufferedEvents=[]};qN.prototype.pipe=function(){var H=HaA.prototype.pipe.apply(this,arguments);return this.resume(),H};qN.prototype._handleEmit=function(H){if(this._released){this.emit.apply(this,H);return}if(H[0]==="data")this.dataSize+=H[1].length,this._checkIfMaxDataSizeExceeded();this._bufferedEvents.push(H)};qN.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded)return;if(this.dataSize<=this.maxDataSize)return;this._maxDataSizeExceeded=!0;var H="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",Error(H))}});var BaA=z((fi1,DaA)=>{var TVB=require("util"),IaA=require("stream").Stream,LaA=AaA();DaA.exports=fX;function fX(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}TVB.inherits(fX,IaA);fX.create=function(H){var $=new this;H=H||{};for(var A in H)$[A]=H[A];return $};fX.isStreamLike=function(H){return typeof H!=="function"&&typeof H!=="string"&&typeof H!=="boolean"&&typeof H!=="number"&&!Buffer.isBuffer(H)};fX.prototype.append=function(H){var $=fX.isStreamLike(H);if($){if(!(H instanceof LaA)){var A=LaA.create(H,{maxDataSize:1/0,pauseStream:this.pauseStreams});H.on("data",this._checkDataSize.bind(this)),H=A}if(this._handleErrors(H),this.pauseStreams)H.pause()}return this._streams.push(H),this};fX.prototype.pipe=function(H,$){return IaA.prototype.pipe.call(this,H,$),this.resume(),H};fX.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};fX.prototype._realGetNext=function(){var H=this._streams.shift();if(typeof H>"u"){this.end();return}if(typeof H!=="function"){this._pipeNext(H);return}var $=H;$(function(A){var L=fX.isStreamLike(A);if(L)A.on("data",this._checkDataSize.bind(this)),this._handleErrors(A);this._pipeNext(A)}.bind(this))};fX.prototype._pipeNext=function(H){this._currentStream=H;var $=fX.isStreamLike(H);if($){H.on("end",this._getNext.bind(this)),H.pipe(this,{end:!1});return}var A=H;this.write(A),this._getNext()};fX.prototype._handleErrors=function(H){var $=this;H.on("error",function(A){$._emitError(A)})};fX.prototype.write=function(H){this.emit("data",H)};fX.prototype.pause=function(){if(!this.pauseStreams)return;if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};fX.prototype.resume=function(){if(!this._released)this._released=!0,this.writable=!0,this._getNext();if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};fX.prototype.end=function(){this._reset(),this.emit("end")};fX.prototype.destroy=function(){this._reset(),this.emit("close")};fX.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};fX.prototype._checkDataSize=function(){if(this._updateDataSize(),this.dataSize<=this.maxDataSize)return;var H="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(Error(H))};fX.prototype._updateDataSize=function(){this.dataSize=0;var H=this;if(this._streams.forEach(function($){if(!$.dataSize)return;H.dataSize+=$.dataSize}),this._currentStream&&this._currentStream.dataSize)this.dataSize+=this._currentStream.dataSize};fX.prototype._emitError=function(H){this._reset(),this.emit("error",H)}});var faA=z((Ei1,zVB)=>{zVB.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var MaA=z((Mi1,EaA)=>{/*! `):"",this.name="UnsubscriptionError",this.errors=A}})});var Vk=z((znH)=>{Object.defineProperty(znH,"__esModule",{value:!0});znH.arrRemove=void 0;function mYB(H,$){if(H){var A=H.indexOf($);0<=A&&H.splice(A,1)}}znH.arrRemove=mYB});var L2=z((q_)=>{var ssA=q_&&q_.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")},esA=q_&&q_.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},HeA=q_&&q_.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(NnH,"__esModule",{value:!0});NnH.config=void 0;NnH.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var ly$=z((UR)=>{var LeA=UR&&UR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},IeA=UR&&UR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(OnH,"__esModule",{value:!0});OnH.reportUnhandledError=void 0;var dYB=gEH(),cYB=ly$();function lYB(H){cYB.timeoutProvider.setTimeout(function(){var $=dYB.config.onUnhandledError;if($)$(H);else throw H})}OnH.reportUnhandledError=lYB});var NW=z((xnH)=>{Object.defineProperty(xnH,"__esModule",{value:!0});xnH.noop=void 0;function iYB(){}xnH.noop=iYB});var DeA=z((XR)=>{Object.defineProperty(XR,"__esModule",{value:!0});XR.createNotification=XR.nextNotification=XR.errorNotification=XR.COMPLETE_NOTIFICATION=void 0;XR.COMPLETE_NOTIFICATION=function(){return SnH("C",void 0,void 0)}();function nYB(H){return SnH("E",void 0,H)}XR.errorNotification=nYB;function rYB(H){return SnH("N",H,void 0)}XR.nextNotification=rYB;function SnH(H,$,A){return{kind:H,value:$,error:A}}XR.createNotification=SnH});var jnH=z((mEH)=>{Object.defineProperty(mEH,"__esModule",{value:!0});mEH.captureError=mEH.errorContext=void 0;var BeA=gEH(),rHH=null;function aYB(H){if(BeA.config.useDeprecatedSynchronousErrorHandling){var $=!rHH;if($)rHH={errorThrown:!1,error:null};if(H(),$){var A=rHH,L=A.errorThrown,I=A.error;if(rHH=null,L)throw I}}else H()}mEH.errorContext=aYB;function oYB(H){if(BeA.config.useDeprecatedSynchronousErrorHandling&&rHH)rHH.errorThrown=!0,rHH.error=H}mEH.captureError=oYB});var pEH=z((NN)=>{var MeA=NN&&NN.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(NN,"__esModule",{value:!0});NN.EMPTY_OBSERVER=NN.SafeSubscriber=NN.Subscriber=void 0;var tYB=sE(),feA=L2(),oy$=gEH(),sYB=iy$(),EeA=NW(),ny$=DeA(),eYB=ly$(),HCB=jnH(),GeA=function(H){MeA($,H);function $(A){var L=H.call(this)||this;if(L.isStopped=!1,A){if(L.destination=A,feA.isSubscription(A))A.add(L)}else L.destination=NN.EMPTY_OBSERVER;return L}return $.create=function(A,L,I){return new UeA(A,L,I)},$.prototype.next=function(A){if(this.isStopped)ay$(ny$.nextNotification(A),this);else this._next(A)},$.prototype.error=function(A){if(this.isStopped)ay$(ny$.errorNotification(A),this);else this.isStopped=!0,this._error(A)},$.prototype.complete=function(){if(this.isStopped)ay$(ny$.COMPLETE_NOTIFICATION,this);else this.isStopped=!0,this._complete()},$.prototype.unsubscribe=function(){if(!this.closed)this.isStopped=!0,H.prototype.unsubscribe.call(this),this.destination=null},$.prototype._next=function(A){this.destination.next(A)},$.prototype._error=function(A){try{this.destination.error(A)}finally{this.unsubscribe()}},$.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},$}(feA.Subscription);NN.Subscriber=GeA;var $CB=Function.prototype.bind;function ry$(H,$){return $CB.call(H,$)}var ACB=function(){function H($){this.partialObserver=$}return H.prototype.next=function($){var A=this.partialObserver;if(A.next)try{A.next($)}catch(L){RnH(L)}},H.prototype.error=function($){var A=this.partialObserver;if(A.error)try{A.error($)}catch(L){RnH(L)}else RnH($)},H.prototype.complete=function(){var $=this.partialObserver;if($.complete)try{$.complete()}catch(A){RnH(A)}},H}(),UeA=function(H){MeA($,H);function $(A,L,I){var D=H.call(this)||this,B;if(tYB.isFunction(A)||!A)B={next:A!==null&&A!==void 0?A:void 0,error:L!==null&&L!==void 0?L:void 0,complete:I!==null&&I!==void 0?I:void 0};else{var f;if(D&&oy$.config.useDeprecatedNextContext)f=Object.create(A),f.unsubscribe=function(){return D.unsubscribe()},B={next:A.next&&ry$(A.next,f),error:A.error&&ry$(A.error,f),complete:A.complete&&ry$(A.complete,f)};else B=A}return D.destination=new ACB(B),D}return $}(GeA);NN.SafeSubscriber=UeA;function RnH(H){if(oy$.config.useDeprecatedSynchronousErrorHandling)HCB.captureError(H);else sYB.reportUnhandledError(H)}function LCB(H){throw H}function ay$(H,$){var A=oy$.config.onStoppedNotification;A&&eYB.timeoutProvider.setTimeout(function(){return A(H,$)})}NN.EMPTY_OBSERVER={closed:!0,next:EeA.noop,error:LCB,complete:EeA.noop}});var jCH=z((ynH)=>{Object.defineProperty(ynH,"__esModule",{value:!0});ynH.observable=void 0;ynH.observable=function(){return typeof Symbol==="function"&&Symbol.observable||"@@observable"}()});var OW=z((vnH)=>{Object.defineProperty(vnH,"__esModule",{value:!0});vnH.identity=void 0;function ICB(H){return H}vnH.identity=ICB});var RCH=z((dEH)=>{Object.defineProperty(dEH,"__esModule",{value:!0});dEH.pipeFromArray=dEH.pipe=void 0;var DCB=OW();function BCB(){var H=[];for(var $=0;${Object.defineProperty(hnH,"__esModule",{value:!0});hnH.Observable=void 0;var sy$=pEH(),fCB=L2(),ECB=jCH(),MCB=RCH(),GCB=gEH(),ty$=sE(),UCB=jnH(),XCB=function(){function H($){if($)this._subscribe=$}return H.prototype.lift=function($){var A=new H;return A.source=this,A.operator=$,A},H.prototype.subscribe=function($,A,L){var I=this,D=FCB($)?$:new sy$.SafeSubscriber($,A,L);return UCB.errorContext(function(){var B=I,f=B.operator,E=B.source;D.add(f?f.call(D,E):E?I._subscribe(D):I._trySubscribe(D))}),D},H.prototype._trySubscribe=function($){try{return this._subscribe($)}catch(A){$.error(A)}},H.prototype.forEach=function($,A){var L=this;return A=JeA(A),new A(function(I,D){var B=new sy$.SafeSubscriber({next:function(f){try{$(f)}catch(E){D(E),B.unsubscribe()}},error:D,complete:I});L.subscribe(B)})},H.prototype._subscribe=function($){var A;return(A=this.source)===null||A===void 0?void 0:A.subscribe($)},H.prototype[ECB.observable]=function(){return this},H.prototype.pipe=function(){var $=[];for(var A=0;A{Object.defineProperty(cEH,"__esModule",{value:!0});cEH.operate=cEH.hasLift=void 0;var KCB=sE();function FeA(H){return KCB.isFunction(H===null||H===void 0?void 0:H.lift)}cEH.hasLift=FeA;function QCB(H){return function($){if(FeA($))return $.lift(function(A){try{return H(A,this)}catch(L){this.error(L)}});throw TypeError("Unable to lift unknown Observable type")}}cEH.operate=QCB});var EB=z((dc)=>{var WCB=dc&&dc.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(dc,"__esModule",{value:!0});dc.OperatorSubscriber=dc.createOperatorSubscriber=void 0;var VCB=pEH();function PCB(H,$,A,L,I){return new KeA(H,$,A,L,I)}dc.createOperatorSubscriber=PCB;var KeA=function(H){WCB($,H);function $(A,L,I,D,B,f){var E=H.call(this,A)||this;return E.onFinalize=B,E.shouldUnsubscribe=f,E._next=L?function(M){try{L(M)}catch(G){A.error(G)}}:H.prototype._next,E._error=D?function(M){try{D(M)}catch(G){A.error(G)}finally{this.unsubscribe()}}:H.prototype._error,E._complete=I?function(){try{I()}catch(M){A.error(M)}finally{this.unsubscribe()}}:H.prototype._complete,E}return $.prototype.unsubscribe=function(){var A;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var L=this.closed;H.prototype.unsubscribe.call(this),!L&&((A=this.onFinalize)===null||A===void 0||A.call(this))}},$}(VCB.Subscriber);dc.OperatorSubscriber=KeA});var knH=z((bnH)=>{Object.defineProperty(bnH,"__esModule",{value:!0});bnH.refCount=void 0;var _CB=ED(),YCB=EB();function CCB(){return _CB.operate(function(H,$){var A=null;H._refCount++;var L=YCB.createOperatorSubscriber($,void 0,void 0,void 0,function(){if(!H||H._refCount<=0||0<--H._refCount){A=null;return}var I=H._connection,D=A;if(A=null,I&&(!D||I===D))I.unsubscribe();$.unsubscribe()});if(H.subscribe(L),!L.closed)A=H.connect()})}bnH.refCount=CCB});var yCH=z((lEH)=>{var wCB=lEH&&lEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(lEH,"__esModule",{value:!0});lEH.ConnectableObservable=void 0;var ZCB=wM(),QeA=L2(),qCB=knH(),TCB=EB(),zCB=ED(),NCB=function(H){wCB($,H);function $(A,L){var I=H.call(this)||this;if(I.source=A,I.subjectFactory=L,I._subject=null,I._refCount=0,I._connection=null,zCB.hasLift(A))I.lift=A.lift;return I}return $.prototype._subscribe=function(A){return this.getSubject().subscribe(A)},$.prototype.getSubject=function(){var A=this._subject;if(!A||A.isStopped)this._subject=this.subjectFactory();return this._subject},$.prototype._teardown=function(){this._refCount=0;var A=this._connection;this._subject=this._connection=null,A===null||A===void 0||A.unsubscribe()},$.prototype.connect=function(){var A=this,L=this._connection;if(!L){L=this._connection=new QeA.Subscription;var I=this.getSubject();if(L.add(this.source.subscribe(TCB.createOperatorSubscriber(I,void 0,function(){A._teardown(),I.complete()},function(D){A._teardown(),I.error(D)},function(){return A._teardown()}))),L.closed)this._connection=null,L=QeA.Subscription.EMPTY}return L},$.prototype.refCount=function(){return qCB.refCount()(this)},$}(ZCB.Observable);lEH.ConnectableObservable=NCB});var WeA=z((vCH)=>{Object.defineProperty(vCH,"__esModule",{value:!0});vCH.performanceTimestampProvider=void 0;vCH.performanceTimestampProvider={now:function(){return(vCH.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var ey$=z((ON)=>{var VeA=ON&&ON.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},PeA=ON&&ON.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(unH,"__esModule",{value:!0});unH.animationFrames=void 0;var xCB=wM(),SCB=WeA(),_eA=ey$();function jCB(H){return H?YeA(H):RCB}unH.animationFrames=jCB;function YeA(H){return new xCB.Observable(function($){var A=H||SCB.performanceTimestampProvider,L=A.now(),I=0,D=function(){if(!$.closed)I=_eA.animationFrameProvider.requestAnimationFrame(function(B){I=0;var f=A.now();$.next({timestamp:H?f:B,elapsed:f-L}),D()})};return D(),function(){if(I)_eA.animationFrameProvider.cancelAnimationFrame(I)}})}var RCB=YeA()});var Hv$=z((gnH)=>{Object.defineProperty(gnH,"__esModule",{value:!0});gnH.ObjectUnsubscribedError=void 0;var yCB=pc();gnH.ObjectUnsubscribedError=yCB.createErrorClass(function(H){return function(){H(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var xW=z((JR)=>{var ZeA=JR&&JR.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}(),vCB=JR&&JR.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(JR,"__esModule",{value:!0});JR.AnonymousSubject=JR.Subject=void 0;var weA=wM(),Av$=L2(),hCB=Hv$(),bCB=Vk(),$v$=jnH(),qeA=function(H){ZeA($,H);function $(){var A=H.call(this)||this;return A.closed=!1,A.currentObservers=null,A.observers=[],A.isStopped=!1,A.hasError=!1,A.thrownError=null,A}return $.prototype.lift=function(A){var L=new Lv$(this,this);return L.operator=A,L},$.prototype._throwIfClosed=function(){if(this.closed)throw new hCB.ObjectUnsubscribedError},$.prototype.next=function(A){var L=this;$v$.errorContext(function(){var I,D;if(L._throwIfClosed(),!L.isStopped){if(!L.currentObservers)L.currentObservers=Array.from(L.observers);try{for(var B=vCB(L.currentObservers),f=B.next();!f.done;f=B.next()){var E=f.value;E.next(A)}}catch(M){I={error:M}}finally{try{if(f&&!f.done&&(D=B.return))D.call(B)}finally{if(I)throw I.error}}}})},$.prototype.error=function(A){var L=this;$v$.errorContext(function(){if(L._throwIfClosed(),!L.isStopped){L.hasError=L.isStopped=!0,L.thrownError=A;var I=L.observers;while(I.length)I.shift().error(A)}})},$.prototype.complete=function(){var A=this;$v$.errorContext(function(){if(A._throwIfClosed(),!A.isStopped){A.isStopped=!0;var L=A.observers;while(L.length)L.shift().complete()}})},$.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty($.prototype,"observed",{get:function(){var A;return((A=this.observers)===null||A===void 0?void 0:A.length)>0},enumerable:!1,configurable:!0}),$.prototype._trySubscribe=function(A){return this._throwIfClosed(),H.prototype._trySubscribe.call(this,A)},$.prototype._subscribe=function(A){return this._throwIfClosed(),this._checkFinalizedStatuses(A),this._innerSubscribe(A)},$.prototype._innerSubscribe=function(A){var L=this,I=this,D=I.hasError,B=I.isStopped,f=I.observers;if(D||B)return Av$.EMPTY_SUBSCRIPTION;return this.currentObservers=null,f.push(A),new Av$.Subscription(function(){L.currentObservers=null,bCB.arrRemove(f,A)})},$.prototype._checkFinalizedStatuses=function(A){var L=this,I=L.hasError,D=L.thrownError,B=L.isStopped;if(I)A.error(D);else if(B)A.complete()},$.prototype.asObservable=function(){var A=new weA.Observable;return A.source=this,A},$.create=function(A,L){return new Lv$(A,L)},$}(weA.Observable);JR.Subject=qeA;var Lv$=function(H){ZeA($,H);function $(A,L){var I=H.call(this)||this;return I.destination=A,I.source=L,I}return $.prototype.next=function(A){var L,I;(I=(L=this.destination)===null||L===void 0?void 0:L.next)===null||I===void 0||I.call(L,A)},$.prototype.error=function(A){var L,I;(I=(L=this.destination)===null||L===void 0?void 0:L.error)===null||I===void 0||I.call(L,A)},$.prototype.complete=function(){var A,L;(L=(A=this.destination)===null||A===void 0?void 0:A.complete)===null||L===void 0||L.call(A)},$.prototype._subscribe=function(A){var L,I;return(I=(L=this.source)===null||L===void 0?void 0:L.subscribe(A))!==null&&I!==void 0?I:Av$.EMPTY_SUBSCRIPTION},$}(qeA);JR.AnonymousSubject=Lv$});var Iv$=z((iEH)=>{var kCB=iEH&&iEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(iEH,"__esModule",{value:!0});iEH.BehaviorSubject=void 0;var uCB=xW(),gCB=function(H){kCB($,H);function $(A){var L=H.call(this)||this;return L._value=A,L}return Object.defineProperty($.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),$.prototype._subscribe=function(A){var L=H.prototype._subscribe.call(this,A);return!L.closed&&A.next(this._value),L},$.prototype.getValue=function(){var A=this,L=A.hasError,I=A.thrownError,D=A._value;if(L)throw I;return this._throwIfClosed(),D},$.prototype.next=function(A){H.prototype.next.call(this,this._value=A)},$}(uCB.Subject);iEH.BehaviorSubject=gCB});var mnH=z((hCH)=>{Object.defineProperty(hCH,"__esModule",{value:!0});hCH.dateTimestampProvider=void 0;hCH.dateTimestampProvider={now:function(){return(hCH.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var pnH=z((nEH)=>{var mCB=nEH&&nEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(nEH,"__esModule",{value:!0});nEH.ReplaySubject=void 0;var pCB=xW(),dCB=mnH(),cCB=function(H){mCB($,H);function $(A,L,I){if(A===void 0)A=1/0;if(L===void 0)L=1/0;if(I===void 0)I=dCB.dateTimestampProvider;var D=H.call(this)||this;return D._bufferSize=A,D._windowTime=L,D._timestampProvider=I,D._buffer=[],D._infiniteTimeWindow=!0,D._infiniteTimeWindow=L===1/0,D._bufferSize=Math.max(1,A),D._windowTime=Math.max(1,L),D}return $.prototype.next=function(A){var L=this,I=L.isStopped,D=L._buffer,B=L._infiniteTimeWindow,f=L._timestampProvider,E=L._windowTime;if(!I)D.push(A),!B&&D.push(f.now()+E);this._trimBuffer(),H.prototype.next.call(this,A)},$.prototype._subscribe=function(A){this._throwIfClosed(),this._trimBuffer();var L=this._innerSubscribe(A),I=this,D=I._infiniteTimeWindow,B=I._buffer,f=B.slice();for(var E=0;E{var lCB=rEH&&rEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(rEH,"__esModule",{value:!0});rEH.AsyncSubject=void 0;var iCB=xW(),nCB=function(H){lCB($,H);function $(){var A=H!==null&&H.apply(this,arguments)||this;return A._value=null,A._hasValue=!1,A._isComplete=!1,A}return $.prototype._checkFinalizedStatuses=function(A){var L=this,I=L.hasError,D=L._hasValue,B=L._value,f=L.thrownError,E=L.isStopped,M=L._isComplete;if(I)A.error(f);else if(E||M)D&&A.next(B),A.complete()},$.prototype.next=function(A){if(!this.isStopped)this._value=A,this._hasValue=!0},$.prototype.complete=function(){var A=this,L=A._hasValue,I=A._value,D=A._isComplete;if(!D)this._isComplete=!0,L&&H.prototype.next.call(this,I),H.prototype.complete.call(this)},$}(iCB.Subject);rEH.AsyncSubject=nCB});var TeA=z((aEH)=>{var rCB=aEH&&aEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(aEH,"__esModule",{value:!0});aEH.Action=void 0;var aCB=L2(),oCB=function(H){rCB($,H);function $(A,L){return H.call(this)||this}return $.prototype.schedule=function(A,L){if(L===void 0)L=0;return this},$}(aCB.Subscription);aEH.Action=oCB});var OeA=z((FR)=>{var zeA=FR&&FR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},NeA=FR&&FR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var tCB=oEH&&oEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(oEH,"__esModule",{value:!0});oEH.AsyncAction=void 0;var sCB=TeA(),xeA=OeA(),eCB=Vk(),H2B=function(H){tCB($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I.pending=!1,I}return $.prototype.schedule=function(A,L){var I;if(L===void 0)L=0;if(this.closed)return this;this.state=A;var D=this.id,B=this.scheduler;if(D!=null)this.id=this.recycleAsyncId(B,D,L);return this.pending=!0,this.delay=L,this.id=(I=this.id)!==null&&I!==void 0?I:this.requestAsyncId(B,this.id,L),this},$.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;return xeA.intervalProvider.setInterval(A.flush.bind(A,this),I)},$.prototype.recycleAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!=null&&this.delay===I&&this.pending===!1)return L;if(L!=null)xeA.intervalProvider.clearInterval(L);return},$.prototype.execute=function(A,L){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var I=this._execute(A,L);if(I)return I;else if(this.pending===!1&&this.id!=null)this.id=this.recycleAsyncId(this.scheduler,this.id,null)},$.prototype._execute=function(A,L){var I=!1,D;try{this.work(A)}catch(B){I=!0,D=B?B:Error("Scheduled action threw falsy error")}if(I)return this.unsubscribe(),D},$.prototype.unsubscribe=function(){if(!this.closed){var A=this,L=A.id,I=A.scheduler,D=I.actions;if(this.work=this.state=this.scheduler=null,this.pending=!1,eCB.arrRemove(D,this),L!=null)this.id=this.recycleAsyncId(I,L,null);this.delay=null,H.prototype.unsubscribe.call(this)}},$}(sCB.Action);oEH.AsyncAction=H2B});var jeA=z((sEH)=>{Object.defineProperty(sEH,"__esModule",{value:!0});sEH.TestTools=sEH.Immediate=void 0;var $2B=1,Dv$,cnH={};function SeA(H){if(H in cnH)return delete cnH[H],!0;return!1}sEH.Immediate={setImmediate:function(H){var $=$2B++;if(cnH[$]=!0,!Dv$)Dv$=Promise.resolve();return Dv$.then(function(){return SeA($)&&H()}),$},clearImmediate:function(H){SeA(H)}};sEH.TestTools={pending:function(){return Object.keys(cnH).length}}});var yeA=z((KR)=>{var A2B=KR&&KR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},L2B=KR&&KR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var B2B=eEH&&eEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(eEH,"__esModule",{value:!0});eEH.AsapAction=void 0;var f2B=tEH(),veA=yeA(),E2B=function(H){B2B($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I}return $.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!==null&&I>0)return H.prototype.requestAsyncId.call(this,A,L,I);return A.actions.push(this),A._scheduled||(A._scheduled=veA.immediateProvider.setImmediate(A.flush.bind(A,void 0)))},$.prototype.recycleAsyncId=function(A,L,I){var D;if(I===void 0)I=0;if(I!=null?I>0:this.delay>0)return H.prototype.recycleAsyncId.call(this,A,L,I);var B=A.actions;if(L!=null&&((D=B[B.length-1])===null||D===void 0?void 0:D.id)!==L){if(veA.immediateProvider.clearImmediate(L),A._scheduled===L)A._scheduled=void 0}return},$}(f2B.AsyncAction);eEH.AsapAction=E2B});var Bv$=z((lnH)=>{Object.defineProperty(lnH,"__esModule",{value:!0});lnH.Scheduler=void 0;var M2B=mnH(),G2B=function(){function H($,A){if(A===void 0)A=H.now;this.schedulerActionCtor=$,this.now=A}return H.prototype.schedule=function($,A,L){if(A===void 0)A=0;return new this.schedulerActionCtor(this,$).schedule(L,A)},H.now=M2B.dateTimestampProvider.now,H}();lnH.Scheduler=G2B});var $MH=z((HMH)=>{var U2B=HMH&&HMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(HMH,"__esModule",{value:!0});HMH.AsyncScheduler=void 0;var beA=Bv$(),X2B=function(H){U2B($,H);function $(A,L){if(L===void 0)L=beA.Scheduler.now;var I=H.call(this,A,L)||this;return I.actions=[],I._active=!1,I}return $.prototype.flush=function(A){var L=this.actions;if(this._active){L.push(A);return}var I;this._active=!0;do if(I=A.execute(A.state,A.delay))break;while(A=L.shift());if(this._active=!1,I){while(A=L.shift())A.unsubscribe();throw I}},$}(beA.Scheduler);HMH.AsyncScheduler=X2B});var keA=z((AMH)=>{var J2B=AMH&&AMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(AMH,"__esModule",{value:!0});AMH.AsapScheduler=void 0;var F2B=$MH(),K2B=function(H){J2B($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $.prototype.flush=function(A){this._active=!0;var L=this._scheduled;this._scheduled=void 0;var I=this.actions,D;A=A||I.shift();do if(D=A.execute(A.state,A.delay))break;while((A=I[0])&&A.id===L&&I.shift());if(this._active=!1,D){while((A=I[0])&&A.id===L&&I.shift())A.unsubscribe();throw D}},$}(F2B.AsyncScheduler);AMH.AsapScheduler=K2B});var ueA=z((aHH)=>{Object.defineProperty(aHH,"__esModule",{value:!0});aHH.asap=aHH.asapScheduler=void 0;var Q2B=heA(),W2B=keA();aHH.asapScheduler=new W2B.AsapScheduler(Q2B.AsapAction);aHH.asap=aHH.asapScheduler});var T_=z((oHH)=>{Object.defineProperty(oHH,"__esModule",{value:!0});oHH.async=oHH.asyncScheduler=void 0;var V2B=tEH(),P2B=$MH();oHH.asyncScheduler=new P2B.AsyncScheduler(V2B.AsyncAction);oHH.async=oHH.asyncScheduler});var geA=z((LMH)=>{var _2B=LMH&&LMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(LMH,"__esModule",{value:!0});LMH.QueueAction=void 0;var Y2B=tEH(),C2B=function(H){_2B($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I}return $.prototype.schedule=function(A,L){if(L===void 0)L=0;if(L>0)return H.prototype.schedule.call(this,A,L);return this.delay=L,this.state=A,this.scheduler.flush(this),this},$.prototype.execute=function(A,L){return L>0||this.closed?H.prototype.execute.call(this,A,L):this._execute(A,L)},$.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!=null&&I>0||I==null&&this.delay>0)return H.prototype.requestAsyncId.call(this,A,L,I);return A.flush(this),0},$}(Y2B.AsyncAction);LMH.QueueAction=C2B});var meA=z((IMH)=>{var w2B=IMH&&IMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(IMH,"__esModule",{value:!0});IMH.QueueScheduler=void 0;var Z2B=$MH(),q2B=function(H){w2B($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $}(Z2B.AsyncScheduler);IMH.QueueScheduler=q2B});var peA=z((tHH)=>{Object.defineProperty(tHH,"__esModule",{value:!0});tHH.queue=tHH.queueScheduler=void 0;var T2B=geA(),z2B=meA();tHH.queueScheduler=new z2B.QueueScheduler(T2B.QueueAction);tHH.queue=tHH.queueScheduler});var ceA=z((DMH)=>{var N2B=DMH&&DMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(DMH,"__esModule",{value:!0});DMH.AnimationFrameAction=void 0;var O2B=tEH(),deA=ey$(),x2B=function(H){N2B($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I}return $.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!==null&&I>0)return H.prototype.requestAsyncId.call(this,A,L,I);return A.actions.push(this),A._scheduled||(A._scheduled=deA.animationFrameProvider.requestAnimationFrame(function(){return A.flush(void 0)}))},$.prototype.recycleAsyncId=function(A,L,I){var D;if(I===void 0)I=0;if(I!=null?I>0:this.delay>0)return H.prototype.recycleAsyncId.call(this,A,L,I);var B=A.actions;if(L!=null&&L===A._scheduled&&((D=B[B.length-1])===null||D===void 0?void 0:D.id)!==L)deA.animationFrameProvider.cancelAnimationFrame(L),A._scheduled=void 0;return},$}(O2B.AsyncAction);DMH.AnimationFrameAction=x2B});var leA=z((BMH)=>{var S2B=BMH&&BMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(BMH,"__esModule",{value:!0});BMH.AnimationFrameScheduler=void 0;var j2B=$MH(),R2B=function(H){S2B($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $.prototype.flush=function(A){this._active=!0;var L;if(A)L=A.id;else L=this._scheduled,this._scheduled=void 0;var I=this.actions,D;A=A||I.shift();do if(D=A.execute(A.state,A.delay))break;while((A=I[0])&&A.id===L&&I.shift());if(this._active=!1,D){while((A=I[0])&&A.id===L&&I.shift())A.unsubscribe();throw D}},$}(j2B.AsyncScheduler);BMH.AnimationFrameScheduler=R2B});var ieA=z((sHH)=>{Object.defineProperty(sHH,"__esModule",{value:!0});sHH.animationFrame=sHH.animationFrameScheduler=void 0;var y2B=ceA(),v2B=leA();sHH.animationFrameScheduler=new v2B.AnimationFrameScheduler(y2B.AnimationFrameAction);sHH.animationFrame=sHH.animationFrameScheduler});var aeA=z((cc)=>{var neA=cc&&cc.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(cc,"__esModule",{value:!0});cc.VirtualAction=cc.VirtualTimeScheduler=void 0;var h2B=tEH(),b2B=L2(),k2B=$MH(),u2B=function(H){neA($,H);function $(A,L){if(A===void 0)A=reA;if(L===void 0)L=1/0;var I=H.call(this,A,function(){return I.frame})||this;return I.maxFrames=L,I.frame=0,I.index=-1,I}return $.prototype.flush=function(){var A=this,L=A.actions,I=A.maxFrames,D,B;while((B=L[0])&&B.delay<=I)if(L.shift(),this.frame=B.delay,D=B.execute(B.state,B.delay))break;if(D){while(B=L.shift())B.unsubscribe();throw D}},$.frameTimeFactor=10,$}(k2B.AsyncScheduler);cc.VirtualTimeScheduler=u2B;var reA=function(H){neA($,H);function $(A,L,I){if(I===void 0)I=A.index+=1;var D=H.call(this,A,L)||this;return D.scheduler=A,D.work=L,D.index=I,D.active=!0,D.index=A.index=I,D}return $.prototype.schedule=function(A,L){if(L===void 0)L=0;if(Number.isFinite(L)){if(!this.id)return H.prototype.schedule.call(this,A,L);this.active=!1;var I=new $(this.scheduler,this.work);return this.add(I),I.schedule(A,L)}else return b2B.Subscription.EMPTY},$.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;this.delay=A.frame+I;var D=A.actions;return D.push(this),D.sort($.sortActions),1},$.prototype.recycleAsyncId=function(A,L,I){if(I===void 0)I=0;return},$.prototype._execute=function(A,L){if(this.active===!0)return H.prototype._execute.call(this,A,L)},$.sortActions=function(A,L){if(A.delay===L.delay)if(A.index===L.index)return 0;else if(A.index>L.index)return 1;else return-1;else if(A.delay>L.delay)return 1;else return-1},$}(h2B.AsyncAction);cc.VirtualAction=reA});var xN=z((eHH)=>{Object.defineProperty(eHH,"__esModule",{value:!0});eHH.empty=eHH.EMPTY=void 0;var oeA=wM();eHH.EMPTY=new oeA.Observable(function(H){return H.complete()});function g2B(H){return H?m2B(H):eHH.EMPTY}eHH.empty=g2B;function m2B(H){return new oeA.Observable(function($){return H.schedule(function(){return $.complete()})})}});var bCH=z((inH)=>{Object.defineProperty(inH,"__esModule",{value:!0});inH.isScheduler=void 0;var p2B=sE();function d2B(H){return H&&p2B.isFunction(H.schedule)}inH.isScheduler=d2B});var z_=z((lc)=>{Object.defineProperty(lc,"__esModule",{value:!0});lc.popNumber=lc.popScheduler=lc.popResultSelector=void 0;var c2B=sE(),l2B=bCH();function fv$(H){return H[H.length-1]}function i2B(H){return c2B.isFunction(fv$(H))?H.pop():void 0}lc.popResultSelector=i2B;function n2B(H){return l2B.isScheduler(fv$(H))?H.pop():void 0}lc.popScheduler=n2B;function r2B(H,$){return typeof fv$(H)==="number"?H.pop():$}lc.popNumber=r2B});var rnH=z((nnH)=>{Object.defineProperty(nnH,"__esModule",{value:!0});nnH.isArrayLike=void 0;nnH.isArrayLike=function(H){return H&&typeof H.length==="number"&&typeof H!=="function"}});var Ev$=z((anH)=>{Object.defineProperty(anH,"__esModule",{value:!0});anH.isPromise=void 0;var a2B=sE();function o2B(H){return a2B.isFunction(H===null||H===void 0?void 0:H.then)}anH.isPromise=o2B});var Mv$=z((onH)=>{Object.defineProperty(onH,"__esModule",{value:!0});onH.isInteropObservable=void 0;var t2B=jCH(),s2B=sE();function e2B(H){return s2B.isFunction(H[t2B.observable])}onH.isInteropObservable=e2B});var Gv$=z((tnH)=>{Object.defineProperty(tnH,"__esModule",{value:!0});tnH.isAsyncIterable=void 0;var HwB=sE();function $wB(H){return Symbol.asyncIterator&&HwB.isFunction(H===null||H===void 0?void 0:H[Symbol.asyncIterator])}tnH.isAsyncIterable=$wB});var Uv$=z((snH)=>{Object.defineProperty(snH,"__esModule",{value:!0});snH.createInvalidObservableTypeError=void 0;function AwB(H){return TypeError("You provided "+(H!==null&&typeof H==="object"?"an invalid object":"'"+H+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}snH.createInvalidObservableTypeError=AwB});var Xv$=z((fMH)=>{Object.defineProperty(fMH,"__esModule",{value:!0});fMH.iterator=fMH.getSymbolIterator=void 0;function teA(){if(typeof Symbol!=="function"||!Symbol.iterator)return"@@iterator";return Symbol.iterator}fMH.getSymbolIterator=teA;fMH.iterator=teA()});var Jv$=z((enH)=>{Object.defineProperty(enH,"__esModule",{value:!0});enH.isIterable=void 0;var LwB=Xv$(),IwB=sE();function DwB(H){return IwB.isFunction(H===null||H===void 0?void 0:H[LwB.iterator])}enH.isIterable=DwB});var HrH=z((cZ)=>{var BwB=cZ&&cZ.__generator||function(H,$){var A={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},L,I,D,B;return B={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function f(M){return function(G){return E([M,G])}}function E(M){if(L)throw TypeError("Generator is already executing.");while(A)try{if(L=1,I&&(D=M[0]&2?I.return:M[0]?I.throw||((D=I.return)&&D.call(I),0):I.next)&&!(D=D.call(I,M[1])).done)return D;if(I=0,D)M=[M[0]&2,D.value];switch(M[0]){case 0:case 1:D=M;break;case 4:return A.label++,{value:M[1],done:!1};case 5:A.label++,I=M[1],M=[0];continue;case 7:M=A.ops.pop(),A.trys.pop();continue;default:if((D=A.trys,!(D=D.length>0&&D[D.length-1]))&&(M[0]===6||M[0]===2)){A=0;continue}if(M[0]===3&&(!D||M[1]>D[0]&&M[1]1||f(X,J)})}}function f(X,J){try{E(L[X](J))}catch(F){U(D[0][3],F)}}function E(X){X.value instanceof EMH?Promise.resolve(X.value.v).then(M,G):U(D[0][2],X)}function M(X){f("next",X)}function G(X){f("throw",X)}function U(X,J){if(X(J),D.shift(),D.length)f(D[0][0],D[0][1])}};Object.defineProperty(cZ,"__esModule",{value:!0});cZ.isReadableStreamLike=cZ.readableStreamLikeToAsyncGenerator=void 0;var EwB=sE();function MwB(H){return fwB(this,arguments,function(){var A,L,I,D;return BwB(this,function(B){switch(B.label){case 0:A=H.getReader(),B.label=1;case 1:B.trys.push([1,,9,10]),B.label=2;case 2:return[4,EMH(A.read())];case 3:if(L=B.sent(),I=L.value,D=L.done,!D)return[3,5];return[4,EMH(void 0)];case 4:return[2,B.sent()];case 5:return[4,EMH(I)];case 6:return[4,B.sent()];case 7:return B.sent(),[3,2];case 8:return[3,10];case 9:return A.releaseLock(),[7];case 10:return[2]}})})}cZ.readableStreamLikeToAsyncGenerator=MwB;function GwB(H){return EwB.isFunction(H===null||H===void 0?void 0:H.getReader)}cZ.isReadableStreamLike=GwB});var M1=z((F4)=>{var UwB=F4&&F4.__awaiter||function(H,$,A,L){function I(D){return D instanceof A?D:new A(function(B){B(D)})}return new(A||(A=Promise))(function(D,B){function f(G){try{M(L.next(G))}catch(U){B(U)}}function E(G){try{M(L.throw(G))}catch(U){B(U)}}function M(G){G.done?D(G.value):I(G.value).then(f,E)}M((L=L.apply(H,$||[])).next())})},XwB=F4&&F4.__generator||function(H,$){var A={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},L,I,D,B;return B={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function f(M){return function(G){return E([M,G])}}function E(M){if(L)throw TypeError("Generator is already executing.");while(A)try{if(L=1,I&&(D=M[0]&2?I.return:M[0]?I.throw||((D=I.return)&&D.call(I),0):I.next)&&!(D=D.call(I,M[1])).done)return D;if(I=0,D)M=[M[0]&2,D.value];switch(M[0]){case 0:case 1:D=M;break;case 4:return A.label++,{value:M[1],done:!1};case 5:A.label++,I=M[1],M=[0];continue;case 7:M=A.ops.pop(),A.trys.pop();continue;default:if((D=A.trys,!(D=D.length>0&&D[D.length-1]))&&(M[0]===6||M[0]===2)){A=0;continue}if(M[0]===3&&(!D||M[1]>D[0]&&M[1]=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(F4,"__esModule",{value:!0});F4.fromReadableStreamLike=F4.fromAsyncIterable=F4.fromIterable=F4.fromPromise=F4.fromArrayLike=F4.fromInteropObservable=F4.innerFrom=void 0;var FwB=rnH(),KwB=Ev$(),MMH=wM(),QwB=Mv$(),WwB=Gv$(),VwB=Uv$(),PwB=Jv$(),seA=HrH(),_wB=sE(),YwB=iy$(),CwB=jCH();function wwB(H){if(H instanceof MMH.Observable)return H;if(H!=null){if(QwB.isInteropObservable(H))return eeA(H);if(FwB.isArrayLike(H))return HHL(H);if(KwB.isPromise(H))return $HL(H);if(WwB.isAsyncIterable(H))return Kv$(H);if(PwB.isIterable(H))return AHL(H);if(seA.isReadableStreamLike(H))return LHL(H)}throw VwB.createInvalidObservableTypeError(H)}F4.innerFrom=wwB;function eeA(H){return new MMH.Observable(function($){var A=H[CwB.observable]();if(_wB.isFunction(A.subscribe))return A.subscribe($);throw TypeError("Provided object does not correctly implement Symbol.observable")})}F4.fromInteropObservable=eeA;function HHL(H){return new MMH.Observable(function($){for(var A=0;A{Object.defineProperty($rH,"__esModule",{value:!0});$rH.executeSchedule=void 0;function qwB(H,$,A,L,I){if(L===void 0)L=0;if(I===void 0)I=!1;var D=$.schedule(function(){if(A(),I)H.add(this.schedule(null,L));else this.unsubscribe()},L);if(H.add(D),!I)return D}$rH.executeSchedule=qwB});var GMH=z((ArH)=>{Object.defineProperty(ArH,"__esModule",{value:!0});ArH.observeOn=void 0;var Qv$=Pk(),TwB=ED(),zwB=EB();function NwB(H,$){if($===void 0)$=0;return TwB.operate(function(A,L){A.subscribe(zwB.createOperatorSubscriber(L,function(I){return Qv$.executeSchedule(L,H,function(){return L.next(I)},$)},function(){return Qv$.executeSchedule(L,H,function(){return L.complete()},$)},function(I){return Qv$.executeSchedule(L,H,function(){return L.error(I)},$)}))})}ArH.observeOn=NwB});var UMH=z((LrH)=>{Object.defineProperty(LrH,"__esModule",{value:!0});LrH.subscribeOn=void 0;var OwB=ED();function xwB(H,$){if($===void 0)$=0;return OwB.operate(function(A,L){L.add(H.schedule(function(){return A.subscribe(L)},$))})}LrH.subscribeOn=xwB});var IHL=z((IrH)=>{Object.defineProperty(IrH,"__esModule",{value:!0});IrH.scheduleObservable=void 0;var SwB=M1(),jwB=GMH(),RwB=UMH();function ywB(H,$){return SwB.innerFrom(H).pipe(RwB.subscribeOn($),jwB.observeOn($))}IrH.scheduleObservable=ywB});var DHL=z((DrH)=>{Object.defineProperty(DrH,"__esModule",{value:!0});DrH.schedulePromise=void 0;var vwB=M1(),hwB=GMH(),bwB=UMH();function kwB(H,$){return vwB.innerFrom(H).pipe(bwB.subscribeOn($),hwB.observeOn($))}DrH.schedulePromise=kwB});var BHL=z((BrH)=>{Object.defineProperty(BrH,"__esModule",{value:!0});BrH.scheduleArray=void 0;var uwB=wM();function gwB(H,$){return new uwB.Observable(function(A){var L=0;return $.schedule(function(){if(L===H.length)A.complete();else if(A.next(H[L++]),!A.closed)this.schedule()})})}BrH.scheduleArray=gwB});var Wv$=z((frH)=>{Object.defineProperty(frH,"__esModule",{value:!0});frH.scheduleIterable=void 0;var mwB=wM(),pwB=Xv$(),dwB=sE(),fHL=Pk();function cwB(H,$){return new mwB.Observable(function(A){var L;return fHL.executeSchedule(A,$,function(){L=H[pwB.iterator](),fHL.executeSchedule(A,$,function(){var I,D,B;try{I=L.next(),D=I.value,B=I.done}catch(f){A.error(f);return}if(B)A.complete();else A.next(D)},0,!0)}),function(){return dwB.isFunction(L===null||L===void 0?void 0:L.return)&&L.return()}})}frH.scheduleIterable=cwB});var Vv$=z((ErH)=>{Object.defineProperty(ErH,"__esModule",{value:!0});ErH.scheduleAsyncIterable=void 0;var lwB=wM(),EHL=Pk();function iwB(H,$){if(!H)throw Error("Iterable cannot be null");return new lwB.Observable(function(A){EHL.executeSchedule(A,$,function(){var L=H[Symbol.asyncIterator]();EHL.executeSchedule(A,$,function(){L.next().then(function(I){if(I.done)A.complete();else A.next(I.value)})},0,!0)})})}ErH.scheduleAsyncIterable=iwB});var MHL=z((MrH)=>{Object.defineProperty(MrH,"__esModule",{value:!0});MrH.scheduleReadableStreamLike=void 0;var nwB=Vv$(),rwB=HrH();function awB(H,$){return nwB.scheduleAsyncIterable(rwB.readableStreamLikeToAsyncGenerator(H),$)}MrH.scheduleReadableStreamLike=awB});var Pv$=z((GrH)=>{Object.defineProperty(GrH,"__esModule",{value:!0});GrH.scheduled=void 0;var owB=IHL(),twB=DHL(),swB=BHL(),ewB=Wv$(),HZB=Vv$(),$ZB=Mv$(),AZB=Ev$(),LZB=rnH(),IZB=Jv$(),DZB=Gv$(),BZB=Uv$(),fZB=HrH(),EZB=MHL();function MZB(H,$){if(H!=null){if($ZB.isInteropObservable(H))return owB.scheduleObservable(H,$);if(LZB.isArrayLike(H))return swB.scheduleArray(H,$);if(AZB.isPromise(H))return twB.schedulePromise(H,$);if(DZB.isAsyncIterable(H))return HZB.scheduleAsyncIterable(H,$);if(IZB.isIterable(H))return ewB.scheduleIterable(H,$);if(fZB.isReadableStreamLike(H))return EZB.scheduleReadableStreamLike(H,$)}throw BZB.createInvalidObservableTypeError(H)}GrH.scheduled=MZB});var _k=z((UrH)=>{Object.defineProperty(UrH,"__esModule",{value:!0});UrH.from=void 0;var GZB=Pv$(),UZB=M1();function XZB(H,$){return $?GZB.scheduled(H,$):UZB.innerFrom(H)}UrH.from=XZB});var JrH=z((XrH)=>{Object.defineProperty(XrH,"__esModule",{value:!0});XrH.of=void 0;var JZB=z_(),FZB=_k();function KZB(){var H=[];for(var $=0;${Object.defineProperty(FrH,"__esModule",{value:!0});FrH.throwError=void 0;var QZB=wM(),WZB=sE();function VZB(H,$){var A=WZB.isFunction(H)?H:function(){return H},L=function(I){return I.error(A())};return new QZB.Observable($?function(I){return $.schedule(L,0,I)}:L)}FrH.throwError=VZB});var KrH=z((Yk)=>{Object.defineProperty(Yk,"__esModule",{value:!0});Yk.observeNotification=Yk.Notification=Yk.NotificationKind=void 0;var PZB=xN(),_ZB=JrH(),YZB=_v$(),CZB=sE(),wZB;(function(H){H.NEXT="N",H.ERROR="E",H.COMPLETE="C"})(wZB=Yk.NotificationKind||(Yk.NotificationKind={}));var ZZB=function(){function H($,A,L){this.kind=$,this.value=A,this.error=L,this.hasValue=$==="N"}return H.prototype.observe=function($){return GHL(this,$)},H.prototype.do=function($,A,L){var I=this,D=I.kind,B=I.value,f=I.error;return D==="N"?$===null||$===void 0?void 0:$(B):D==="E"?A===null||A===void 0?void 0:A(f):L===null||L===void 0?void 0:L()},H.prototype.accept=function($,A,L){var I;return CZB.isFunction((I=$)===null||I===void 0?void 0:I.next)?this.observe($):this.do($,A,L)},H.prototype.toObservable=function(){var $=this,A=$.kind,L=$.value,I=$.error,D=A==="N"?_ZB.of(L):A==="E"?YZB.throwError(function(){return I}):A==="C"?PZB.EMPTY:0;if(!D)throw TypeError("Unexpected notification kind "+A);return D},H.createNext=function($){return new H("N",$)},H.createError=function($){return new H("E",void 0,$)},H.createComplete=function(){return H.completeNotification},H.completeNotification=new H("C"),H}();Yk.Notification=ZZB;function GHL(H,$){var A,L,I,D=H,B=D.kind,f=D.value,E=D.error;if(typeof B!=="string")throw TypeError('Invalid notification, missing "kind"');B==="N"?(A=$.next)===null||A===void 0||A.call($,f):B==="E"?(L=$.error)===null||L===void 0||L.call($,E):(I=$.complete)===null||I===void 0||I.call($)}Yk.observeNotification=GHL});var XHL=z((QrH)=>{Object.defineProperty(QrH,"__esModule",{value:!0});QrH.isObservable=void 0;var qZB=wM(),UHL=sE();function TZB(H){return!!H&&(H instanceof qZB.Observable||UHL.isFunction(H.lift)&&UHL.isFunction(H.subscribe))}QrH.isObservable=TZB});var ic=z((WrH)=>{Object.defineProperty(WrH,"__esModule",{value:!0});WrH.EmptyError=void 0;var zZB=pc();WrH.EmptyError=zZB.createErrorClass(function(H){return function(){H(this),this.name="EmptyError",this.message="no elements in sequence"}})});var JHL=z((VrH)=>{Object.defineProperty(VrH,"__esModule",{value:!0});VrH.lastValueFrom=void 0;var NZB=ic();function OZB(H,$){var A=typeof $==="object";return new Promise(function(L,I){var D=!1,B;H.subscribe({next:function(f){B=f,D=!0},error:I,complete:function(){if(D)L(B);else if(A)L($.defaultValue);else I(new NZB.EmptyError)}})})}VrH.lastValueFrom=OZB});var FHL=z((PrH)=>{Object.defineProperty(PrH,"__esModule",{value:!0});PrH.firstValueFrom=void 0;var xZB=ic(),SZB=pEH();function jZB(H,$){var A=typeof $==="object";return new Promise(function(L,I){var D=new SZB.SafeSubscriber({next:function(B){L(B),D.unsubscribe()},error:I,complete:function(){if(A)L($.defaultValue);else I(new xZB.EmptyError)}});H.subscribe(D)})}PrH.firstValueFrom=jZB});var Yv$=z((_rH)=>{Object.defineProperty(_rH,"__esModule",{value:!0});_rH.ArgumentOutOfRangeError=void 0;var RZB=pc();_rH.ArgumentOutOfRangeError=RZB.createErrorClass(function(H){return function(){H(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var Cv$=z((YrH)=>{Object.defineProperty(YrH,"__esModule",{value:!0});YrH.NotFoundError=void 0;var yZB=pc();YrH.NotFoundError=yZB.createErrorClass(function(H){return function(A){H(this),this.name="NotFoundError",this.message=A}})});var wv$=z((CrH)=>{Object.defineProperty(CrH,"__esModule",{value:!0});CrH.SequenceError=void 0;var vZB=pc();CrH.SequenceError=vZB.createErrorClass(function(H){return function(A){H(this),this.name="SequenceError",this.message=A}})});var ZrH=z((wrH)=>{Object.defineProperty(wrH,"__esModule",{value:!0});wrH.isValidDate=void 0;function hZB(H){return H instanceof Date&&!isNaN(H)}wrH.isValidDate=hZB});var kCH=z((H$H)=>{Object.defineProperty(H$H,"__esModule",{value:!0});H$H.timeout=H$H.TimeoutError=void 0;var bZB=T_(),kZB=ZrH(),uZB=ED(),gZB=M1(),mZB=pc(),pZB=EB(),dZB=Pk();H$H.TimeoutError=mZB.createErrorClass(function(H){return function(A){if(A===void 0)A=null;H(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=A}});function cZB(H,$){var A=kZB.isValidDate(H)?{first:H}:typeof H==="number"?{each:H}:H,L=A.first,I=A.each,D=A.with,B=D===void 0?lZB:D,f=A.scheduler,E=f===void 0?$!==null&&$!==void 0?$:bZB.asyncScheduler:f,M=A.meta,G=M===void 0?null:M;if(L==null&&I==null)throw TypeError("No timeout provided.");return uZB.operate(function(U,X){var J,F,Q=null,W=0,P=function(C){F=dZB.executeSchedule(X,E,function(){try{J.unsubscribe(),gZB.innerFrom(B({meta:G,lastValue:Q,seen:W})).subscribe(X)}catch(Y){X.error(Y)}},C)};J=U.subscribe(pZB.createOperatorSubscriber(X,function(C){F===null||F===void 0||F.unsubscribe(),W++,X.next(Q=C),I>0&&P(I)},void 0,void 0,function(){if(!(F===null||F===void 0?void 0:F.closed))F===null||F===void 0||F.unsubscribe();Q=null})),!W&&P(L!=null?typeof L==="number"?L:+L-E.now():I)})}H$H.timeout=cZB;function lZB(H){throw new H$H.TimeoutError(H)}});var Ck=z((qrH)=>{Object.defineProperty(qrH,"__esModule",{value:!0});qrH.map=void 0;var iZB=ED(),nZB=EB();function rZB(H,$){return iZB.operate(function(A,L){var I=0;A.subscribe(nZB.createOperatorSubscriber(L,function(D){L.next(H.call($,D,I++))}))})}qrH.map=rZB});var rc=z((nc)=>{var aZB=nc&&nc.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},oZB=nc&&nc.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var $qB=ac&&ac.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},KHL=ac&&ac.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(TrH,"__esModule",{value:!0});TrH.bindCallback=void 0;var EqB=qv$();function MqB(H,$,A){return EqB.bindCallbackInternals(!1,H,$,A)}TrH.bindCallback=MqB});var WHL=z((zrH)=>{Object.defineProperty(zrH,"__esModule",{value:!0});zrH.bindNodeCallback=void 0;var GqB=qv$();function UqB(H,$,A){return GqB.bindCallbackInternals(!0,H,$,A)}zrH.bindNodeCallback=UqB});var Tv$=z((NrH)=>{Object.defineProperty(NrH,"__esModule",{value:!0});NrH.argsArgArrayOrObject=void 0;var XqB=Array.isArray,JqB=Object.getPrototypeOf,FqB=Object.prototype,KqB=Object.keys;function QqB(H){if(H.length===1){var $=H[0];if(XqB($))return{args:$,keys:null};if(WqB($)){var A=KqB($);return{args:A.map(function(L){return $[L]}),keys:A}}}return{args:H,keys:null}}NrH.argsArgArrayOrObject=QqB;function WqB(H){return H&&typeof H==="object"&&JqB(H)===FqB}});var zv$=z((OrH)=>{Object.defineProperty(OrH,"__esModule",{value:!0});OrH.createObject=void 0;function VqB(H,$){return H.reduce(function(A,L,I){return A[L]=$[I],A},{})}OrH.createObject=VqB});var xrH=z((XMH)=>{Object.defineProperty(XMH,"__esModule",{value:!0});XMH.combineLatestInit=XMH.combineLatest=void 0;var PqB=wM(),_qB=Tv$(),_HL=_k(),YHL=OW(),YqB=rc(),VHL=z_(),CqB=zv$(),wqB=EB(),ZqB=Pk();function qqB(){var H=[];for(var $=0;${Object.defineProperty(SrH,"__esModule",{value:!0});SrH.mergeInternals=void 0;var TqB=M1(),zqB=Pk(),wHL=EB();function NqB(H,$,A,L,I,D,B,f){var E=[],M=0,G=0,U=!1,X=function(){if(U&&!E.length&&!M)$.complete()},J=function(Q){return M{Object.defineProperty(RrH,"__esModule",{value:!0});RrH.mergeMap=void 0;var OqB=Ck(),xqB=M1(),SqB=ED(),jqB=jrH(),RqB=sE();function ZHL(H,$,A){if(A===void 0)A=1/0;if(RqB.isFunction($))return ZHL(function(L,I){return OqB.map(function(D,B){return $(L,D,I,B)})(xqB.innerFrom(H(L,I)))},A);else if(typeof $==="number")A=$;return SqB.operate(function(L,I){return jqB.mergeInternals(L,I,H,A)})}RrH.mergeMap=ZHL});var JMH=z((yrH)=>{Object.defineProperty(yrH,"__esModule",{value:!0});yrH.mergeAll=void 0;var yqB=QR(),vqB=OW();function hqB(H){if(H===void 0)H=1/0;return yqB.mergeMap(vqB.identity,H)}yrH.mergeAll=hqB});var uCH=z((vrH)=>{Object.defineProperty(vrH,"__esModule",{value:!0});vrH.concatAll=void 0;var bqB=JMH();function kqB(){return bqB.mergeAll(1)}vrH.concatAll=kqB});var gCH=z((hrH)=>{Object.defineProperty(hrH,"__esModule",{value:!0});hrH.concat=void 0;var uqB=uCH(),gqB=z_(),mqB=_k();function pqB(){var H=[];for(var $=0;${Object.defineProperty(brH,"__esModule",{value:!0});brH.defer=void 0;var dqB=wM(),cqB=M1();function lqB(H){return new dqB.Observable(function($){cqB.innerFrom(H()).subscribe($)})}brH.defer=lqB});var qHL=z((krH)=>{Object.defineProperty(krH,"__esModule",{value:!0});krH.connectable=void 0;var iqB=xW(),nqB=wM(),rqB=mCH(),aqB={connector:function(){return new iqB.Subject},resetOnDisconnect:!0};function oqB(H,$){if($===void 0)$=aqB;var A=null,L=$.connector,I=$.resetOnDisconnect,D=I===void 0?!0:I,B=L(),f=new nqB.Observable(function(E){return B.subscribe(E)});return f.connect=function(){if(!A||A.closed){if(A=rqB.defer(function(){return H}).subscribe(B),D)A.add(function(){return B=L()})}return A},f}krH.connectable=oqB});var THL=z((urH)=>{Object.defineProperty(urH,"__esModule",{value:!0});urH.forkJoin=void 0;var tqB=wM(),sqB=Tv$(),eqB=M1(),HTB=z_(),$TB=EB(),ATB=rc(),LTB=zv$();function ITB(){var H=[];for(var $=0;${var DTB=FMH&&FMH.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D};Object.defineProperty(FMH,"__esModule",{value:!0});FMH.fromEvent=void 0;var BTB=M1(),fTB=wM(),ETB=QR(),MTB=rnH(),$$H=sE(),GTB=rc(),UTB=["addListener","removeListener"],XTB=["addEventListener","removeEventListener"],JTB=["on","off"];function Nv$(H,$,A,L){if($$H.isFunction(A))L=A,A=void 0;if(L)return Nv$(H,$,A).pipe(GTB.mapOneOrManyArgs(L));var I=DTB(QTB(H)?XTB.map(function(f){return function(E){return H[f]($,E,A)}}):FTB(H)?UTB.map(zHL(H,$)):KTB(H)?JTB.map(zHL(H,$)):[],2),D=I[0],B=I[1];if(!D){if(MTB.isArrayLike(H))return ETB.mergeMap(function(f){return Nv$(f,$,A)})(BTB.innerFrom(H))}if(!D)throw TypeError("Invalid event target");return new fTB.Observable(function(f){var E=function(){var M=[];for(var G=0;G{Object.defineProperty(grH,"__esModule",{value:!0});grH.fromEventPattern=void 0;var WTB=wM(),VTB=sE(),PTB=rc();function OHL(H,$,A){if(A)return OHL(H,$).pipe(PTB.mapOneOrManyArgs(A));return new WTB.Observable(function(L){var I=function(){var B=[];for(var f=0;f{var _TB=KMH&&KMH.__generator||function(H,$){var A={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},L,I,D,B;return B={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function f(M){return function(G){return E([M,G])}}function E(M){if(L)throw TypeError("Generator is already executing.");while(A)try{if(L=1,I&&(D=M[0]&2?I.return:M[0]?I.throw||((D=I.return)&&D.call(I),0):I.next)&&!(D=D.call(I,M[1])).done)return D;if(I=0,D)M=[M[0]&2,D.value];switch(M[0]){case 0:case 1:D=M;break;case 4:return A.label++,{value:M[1],done:!1};case 5:A.label++,I=M[1],M=[0];continue;case 7:M=A.ops.pop(),A.trys.pop();continue;default:if((D=A.trys,!(D=D.length>0&&D[D.length-1]))&&(M[0]===6||M[0]===2)){A=0;continue}if(M[0]===3&&(!D||M[1]>D[0]&&M[1]{Object.defineProperty(mrH,"__esModule",{value:!0});mrH.iif=void 0;var qTB=mCH();function TTB(H,$,A){return qTB.defer(function(){return H()?$:A})}mrH.iif=TTB});var oc=z((prH)=>{Object.defineProperty(prH,"__esModule",{value:!0});prH.timer=void 0;var zTB=wM(),NTB=T_(),OTB=bCH(),xTB=ZrH();function STB(H,$,A){if(H===void 0)H=0;if(A===void 0)A=NTB.async;var L=-1;if($!=null)if(OTB.isScheduler($))A=$;else L=$;return new zTB.Observable(function(I){var D=xTB.isValidDate(H)?+H-A.now():H;if(D<0)D=0;var B=0;return A.schedule(function(){if(!I.closed)if(I.next(B++),0<=L)this.schedule(void 0,L);else I.complete()},D)})}prH.timer=STB});var Ov$=z((drH)=>{Object.defineProperty(drH,"__esModule",{value:!0});drH.interval=void 0;var jTB=T_(),RTB=oc();function yTB(H,$){if(H===void 0)H=0;if($===void 0)$=jTB.asyncScheduler;if(H<0)H=0;return RTB.timer(H,H,$)}drH.interval=yTB});var vHL=z((crH)=>{Object.defineProperty(crH,"__esModule",{value:!0});crH.merge=void 0;var vTB=JMH(),hTB=M1(),bTB=xN(),yHL=z_(),kTB=_k();function uTB(){var H=[];for(var $=0;${Object.defineProperty(A$H,"__esModule",{value:!0});A$H.never=A$H.NEVER=void 0;var gTB=wM(),mTB=NW();A$H.NEVER=new gTB.Observable(mTB.noop);function pTB(){return A$H.NEVER}A$H.never=pTB});var L$H=z((lrH)=>{Object.defineProperty(lrH,"__esModule",{value:!0});lrH.argsOrArgArray=void 0;var dTB=Array.isArray;function cTB(H){return H.length===1&&dTB(H[0])?H[0]:H}lrH.argsOrArgArray=cTB});var Sv$=z((irH)=>{Object.defineProperty(irH,"__esModule",{value:!0});irH.onErrorResumeNext=void 0;var lTB=wM(),iTB=L$H(),nTB=EB(),hHL=NW(),rTB=M1();function aTB(){var H=[];for(var $=0;${Object.defineProperty(nrH,"__esModule",{value:!0});nrH.pairs=void 0;var oTB=_k();function tTB(H,$){return oTB.from(Object.entries(H),$)}nrH.pairs=tTB});var jv$=z((rrH)=>{Object.defineProperty(rrH,"__esModule",{value:!0});rrH.not=void 0;function sTB(H,$){return function(A,L){return!H.call($,A,L)}}rrH.not=sTB});var wk=z((arH)=>{Object.defineProperty(arH,"__esModule",{value:!0});arH.filter=void 0;var eTB=ED(),HzB=EB();function $zB(H,$){return eTB.operate(function(A,L){var I=0;A.subscribe(HzB.createOperatorSubscriber(L,function(D){return H.call($,D,I++)&&L.next(D)}))})}arH.filter=$zB});var gHL=z((orH)=>{Object.defineProperty(orH,"__esModule",{value:!0});orH.partition=void 0;var AzB=jv$(),kHL=wk(),uHL=M1();function LzB(H,$,A){return[kHL.filter($,A)(uHL.innerFrom(H)),kHL.filter(AzB.not($,A))(uHL.innerFrom(H))]}orH.partition=LzB});var Rv$=z((QMH)=>{Object.defineProperty(QMH,"__esModule",{value:!0});QMH.raceInit=QMH.race=void 0;var IzB=wM(),mHL=M1(),DzB=L$H(),BzB=EB();function fzB(){var H=[];for(var $=0;${Object.defineProperty(trH,"__esModule",{value:!0});trH.range=void 0;var EzB=wM(),MzB=xN();function GzB(H,$,A){if($==null)$=H,H=0;if($<=0)return MzB.EMPTY;var L=$+H;return new EzB.Observable(A?function(I){var D=H;return A.schedule(function(){if(D{Object.defineProperty(srH,"__esModule",{value:!0});srH.using=void 0;var UzB=wM(),XzB=M1(),JzB=xN();function FzB(H,$){return new UzB.Observable(function(A){var L=H(),I=$(L),D=I?XzB.innerFrom(I):JzB.EMPTY;return D.subscribe(A),function(){if(L)L.unsubscribe()}})}srH.using=FzB});var erH=z((tc)=>{var KzB=tc&&tc.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},QzB=tc&&tc.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(lHL,"__esModule",{value:!0})});var $aH=z((HaH)=>{Object.defineProperty(HaH,"__esModule",{value:!0});HaH.audit=void 0;var ZzB=ED(),qzB=M1(),nHL=EB();function TzB(H){return ZzB.operate(function($,A){var L=!1,I=null,D=null,B=!1,f=function(){if(D===null||D===void 0||D.unsubscribe(),D=null,L){L=!1;var M=I;I=null,A.next(M)}B&&A.complete()},E=function(){D=null,B&&A.complete()};$.subscribe(nHL.createOperatorSubscriber(A,function(M){if(L=!0,I=M,!D)qzB.innerFrom(H(M)).subscribe(D=nHL.createOperatorSubscriber(A,f,E))},function(){B=!0,(!L||!D||D.closed)&&A.complete()}))})}HaH.audit=TzB});var yv$=z((AaH)=>{Object.defineProperty(AaH,"__esModule",{value:!0});AaH.auditTime=void 0;var zzB=T_(),NzB=$aH(),OzB=oc();function xzB(H,$){if($===void 0)$=zzB.asyncScheduler;return NzB.audit(function(){return OzB.timer(H,$)})}AaH.auditTime=xzB});var vv$=z((LaH)=>{Object.defineProperty(LaH,"__esModule",{value:!0});LaH.buffer=void 0;var SzB=ED(),jzB=NW(),rHL=EB(),RzB=M1();function yzB(H){return SzB.operate(function($,A){var L=[];return $.subscribe(rHL.createOperatorSubscriber(A,function(I){return L.push(I)},function(){A.next(L),A.complete()})),RzB.innerFrom(H).subscribe(rHL.createOperatorSubscriber(A,function(){var I=L;L=[],A.next(I)},jzB.noop)),function(){L=null}})}LaH.buffer=yzB});var bv$=z((WMH)=>{var hv$=WMH&&WMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(WMH,"__esModule",{value:!0});WMH.bufferCount=void 0;var vzB=ED(),hzB=EB(),bzB=Vk();function kzB(H,$){if($===void 0)$=null;return $=$!==null&&$!==void 0?$:H,vzB.operate(function(A,L){var I=[],D=0;A.subscribe(hzB.createOperatorSubscriber(L,function(B){var f,E,M,G,U=null;if(D++%$===0)I.push([]);try{for(var X=hv$(I),J=X.next();!J.done;J=X.next()){var F=J.value;if(F.push(B),H<=F.length)U=U!==null&&U!==void 0?U:[],U.push(F)}}catch(P){f={error:P}}finally{try{if(J&&!J.done&&(E=X.return))E.call(X)}finally{if(f)throw f.error}}if(U)try{for(var Q=hv$(U),W=Q.next();!W.done;W=Q.next()){var F=W.value;bzB.arrRemove(I,F),L.next(F)}}catch(P){M={error:P}}finally{try{if(W&&!W.done&&(G=Q.return))G.call(Q)}finally{if(M)throw M.error}}},function(){var B,f;try{for(var E=hv$(I),M=E.next();!M.done;M=E.next()){var G=M.value;L.next(G)}}catch(U){B={error:U}}finally{try{if(M&&!M.done&&(f=E.return))f.call(E)}finally{if(B)throw B.error}}L.complete()},void 0,function(){I=null}))})}WMH.bufferCount=kzB});var kv$=z((VMH)=>{var uzB=VMH&&VMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(VMH,"__esModule",{value:!0});VMH.bufferTime=void 0;var gzB=L2(),mzB=ED(),pzB=EB(),dzB=Vk(),czB=T_(),lzB=z_(),aHL=Pk();function izB(H){var $,A,L=[];for(var I=1;I=0)aHL.executeSchedule(M,D,J,B,!0);else U=!0;J();var F=pzB.createOperatorSubscriber(M,function(Q){var W,P,C=G.slice();try{for(var Y=uzB(C),Z=Y.next();!Z.done;Z=Y.next()){var q=Z.value,O=q.buffer;O.push(Q),f<=O.length&&X(q)}}catch(j){W={error:j}}finally{try{if(Z&&!Z.done&&(P=Y.return))P.call(Y)}finally{if(W)throw W.error}}},function(){while(G===null||G===void 0?void 0:G.length)M.next(G.shift().buffer);F===null||F===void 0||F.unsubscribe(),M.complete(),M.unsubscribe()},void 0,function(){return G=null});E.subscribe(F)})}VMH.bufferTime=izB});var gv$=z((PMH)=>{var nzB=PMH&&PMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(PMH,"__esModule",{value:!0});PMH.bufferToggle=void 0;var rzB=L2(),azB=ED(),oHL=M1(),uv$=EB(),tHL=NW(),ozB=Vk();function tzB(H,$){return azB.operate(function(A,L){var I=[];oHL.innerFrom(H).subscribe(uv$.createOperatorSubscriber(L,function(D){var B=[];I.push(B);var f=new rzB.Subscription,E=function(){ozB.arrRemove(I,B),L.next(B),f.unsubscribe()};f.add(oHL.innerFrom($(D)).subscribe(uv$.createOperatorSubscriber(L,E,tHL.noop)))},tHL.noop)),A.subscribe(uv$.createOperatorSubscriber(L,function(D){var B,f;try{for(var E=nzB(I),M=E.next();!M.done;M=E.next()){var G=M.value;G.push(D)}}catch(U){B={error:U}}finally{try{if(M&&!M.done&&(f=E.return))f.call(E)}finally{if(B)throw B.error}}},function(){while(I.length>0)L.next(I.shift());L.complete()}))})}PMH.bufferToggle=tzB});var mv$=z((IaH)=>{Object.defineProperty(IaH,"__esModule",{value:!0});IaH.bufferWhen=void 0;var szB=ED(),ezB=NW(),sHL=EB(),HNB=M1();function $NB(H){return szB.operate(function($,A){var L=null,I=null,D=function(){I===null||I===void 0||I.unsubscribe();var B=L;L=[],B&&A.next(B),HNB.innerFrom(H()).subscribe(I=sHL.createOperatorSubscriber(A,D,ezB.noop))};D(),$.subscribe(sHL.createOperatorSubscriber(A,function(B){return L===null||L===void 0?void 0:L.push(B)},function(){L&&A.next(L),A.complete()},void 0,function(){return L=I=null}))})}IaH.bufferWhen=$NB});var pv$=z((DaH)=>{Object.defineProperty(DaH,"__esModule",{value:!0});DaH.catchError=void 0;var ANB=M1(),LNB=EB(),INB=ED();function eHL(H){return INB.operate(function($,A){var L=null,I=!1,D;if(L=$.subscribe(LNB.createOperatorSubscriber(A,void 0,void 0,function(B){if(D=ANB.innerFrom(H(B,eHL(H)($))),L)L.unsubscribe(),L=null,D.subscribe(A);else I=!0})),I)L.unsubscribe(),L=null,D.subscribe(A)})}DaH.catchError=eHL});var dv$=z((BaH)=>{Object.defineProperty(BaH,"__esModule",{value:!0});BaH.scanInternals=void 0;var DNB=EB();function BNB(H,$,A,L,I){return function(D,B){var f=A,E=$,M=0;D.subscribe(DNB.createOperatorSubscriber(B,function(G){var U=M++;E=f?H(E,G,U):(f=!0,G),L&&B.next(E)},I&&function(){f&&B.next(E),B.complete()}))}}BaH.scanInternals=BNB});var I$H=z((faH)=>{Object.defineProperty(faH,"__esModule",{value:!0});faH.reduce=void 0;var fNB=dv$(),ENB=ED();function MNB(H,$){return ENB.operate(fNB.scanInternals(H,$,arguments.length>=2,!1,!0))}faH.reduce=MNB});var MaH=z((EaH)=>{Object.defineProperty(EaH,"__esModule",{value:!0});EaH.toArray=void 0;var GNB=I$H(),UNB=ED(),XNB=function(H,$){return H.push($),H};function JNB(){return UNB.operate(function(H,$){GNB.reduce(XNB,[])(H).subscribe($)})}EaH.toArray=JNB});var cv$=z((GaH)=>{Object.defineProperty(GaH,"__esModule",{value:!0});GaH.joinAllInternals=void 0;var FNB=OW(),KNB=rc(),QNB=RCH(),WNB=QR(),VNB=MaH();function PNB(H,$){return QNB.pipe(VNB.toArray(),WNB.mergeMap(function(A){return H(A)}),$?KNB.mapOneOrManyArgs($):FNB.identity)}GaH.joinAllInternals=PNB});var XaH=z((UaH)=>{Object.defineProperty(UaH,"__esModule",{value:!0});UaH.combineLatestAll=void 0;var _NB=xrH(),YNB=cv$();function CNB(H){return YNB.joinAllInternals(_NB.combineLatest,H)}UaH.combineLatestAll=CNB});var lv$=z((JaH)=>{Object.defineProperty(JaH,"__esModule",{value:!0});JaH.combineAll=void 0;var wNB=XaH();JaH.combineAll=wNB.combineLatestAll});var iv$=z((sc)=>{var H$L=sc&&sc.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},$$L=sc&&sc.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var xNB=ec&&ec.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},SNB=ec&&ec.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(FaH,"__esModule",{value:!0});FaH.concatMap=void 0;var L$L=QR(),yNB=sE();function vNB(H,$){return yNB.isFunction($)?L$L.mergeMap(H,$,1):L$L.mergeMap(H,1)}FaH.concatMap=vNB});var rv$=z((QaH)=>{Object.defineProperty(QaH,"__esModule",{value:!0});QaH.concatMapTo=void 0;var I$L=KaH(),hNB=sE();function bNB(H,$){return hNB.isFunction($)?I$L.concatMap(function(){return H},$):I$L.concatMap(function(){return H})}QaH.concatMapTo=bNB});var av$=z((Hl)=>{var kNB=Hl&&Hl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},uNB=Hl&&Hl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var lNB=$l&&$l.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},iNB=$l&&$l.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(WaH,"__esModule",{value:!0});WaH.fromSubscribable=void 0;var aNB=wM();function oNB(H){return new aNB.Observable(function($){return H.subscribe($)})}WaH.fromSubscribable=oNB});var pCH=z((VaH)=>{Object.defineProperty(VaH,"__esModule",{value:!0});VaH.connect=void 0;var tNB=xW(),sNB=M1(),eNB=ED(),HOB=D$L(),$OB={connector:function(){return new tNB.Subject}};function AOB(H,$){if($===void 0)$=$OB;var A=$.connector;return eNB.operate(function(L,I){var D=A();sNB.innerFrom(H(HOB.fromSubscribable(D))).subscribe(I),I.add(L.subscribe(D))})}VaH.connect=AOB});var tv$=z((PaH)=>{Object.defineProperty(PaH,"__esModule",{value:!0});PaH.count=void 0;var LOB=I$H();function IOB(H){return LOB.reduce(function($,A,L){return!H||H(A,L)?$+1:$},0)}PaH.count=IOB});var sv$=z((_aH)=>{Object.defineProperty(_aH,"__esModule",{value:!0});_aH.debounce=void 0;var DOB=ED(),BOB=NW(),B$L=EB(),fOB=M1();function EOB(H){return DOB.operate(function($,A){var L=!1,I=null,D=null,B=function(){if(D===null||D===void 0||D.unsubscribe(),D=null,L){L=!1;var f=I;I=null,A.next(f)}};$.subscribe(B$L.createOperatorSubscriber(A,function(f){D===null||D===void 0||D.unsubscribe(),L=!0,I=f,D=B$L.createOperatorSubscriber(A,B,BOB.noop),fOB.innerFrom(H(f)).subscribe(D)},function(){B(),A.complete()},void 0,function(){I=D=null}))})}_aH.debounce=EOB});var ev$=z((YaH)=>{Object.defineProperty(YaH,"__esModule",{value:!0});YaH.debounceTime=void 0;var MOB=T_(),GOB=ED(),UOB=EB();function XOB(H,$){if($===void 0)$=MOB.asyncScheduler;return GOB.operate(function(A,L){var I=null,D=null,B=null,f=function(){if(I){I.unsubscribe(),I=null;var M=D;D=null,L.next(M)}};function E(){var M=B+H,G=$.now();if(G{Object.defineProperty(CaH,"__esModule",{value:!0});CaH.defaultIfEmpty=void 0;var JOB=ED(),FOB=EB();function KOB(H){return JOB.operate(function($,A){var L=!1;$.subscribe(FOB.createOperatorSubscriber(A,function(I){L=!0,A.next(I)},function(){if(!L)A.next(H);A.complete()}))})}CaH.defaultIfEmpty=KOB});var YMH=z((waH)=>{Object.defineProperty(waH,"__esModule",{value:!0});waH.take=void 0;var QOB=xN(),WOB=ED(),VOB=EB();function POB(H){return H<=0?function(){return QOB.EMPTY}:WOB.operate(function($,A){var L=0;$.subscribe(VOB.createOperatorSubscriber(A,function(I){if(++L<=H){if(A.next(I),H<=L)A.complete()}}))})}waH.take=POB});var qaH=z((ZaH)=>{Object.defineProperty(ZaH,"__esModule",{value:!0});ZaH.ignoreElements=void 0;var _OB=ED(),YOB=EB(),COB=NW();function wOB(){return _OB.operate(function(H,$){H.subscribe(YOB.createOperatorSubscriber($,COB.noop))})}ZaH.ignoreElements=wOB});var zaH=z((TaH)=>{Object.defineProperty(TaH,"__esModule",{value:!0});TaH.mapTo=void 0;var ZOB=Ck();function qOB(H){return ZOB.map(function(){return H})}TaH.mapTo=qOB});var OaH=z((NaH)=>{Object.defineProperty(NaH,"__esModule",{value:!0});NaH.delayWhen=void 0;var TOB=gCH(),f$L=YMH(),zOB=qaH(),NOB=zaH(),OOB=QR(),xOB=M1();function E$L(H,$){if($)return function(A){return TOB.concat($.pipe(f$L.take(1),zOB.ignoreElements()),A.pipe(E$L(H)))};return OOB.mergeMap(function(A,L){return xOB.innerFrom(H(A,L)).pipe(f$L.take(1),NOB.mapTo(A))})}NaH.delayWhen=E$L});var Hh$=z((xaH)=>{Object.defineProperty(xaH,"__esModule",{value:!0});xaH.delay=void 0;var SOB=T_(),jOB=OaH(),ROB=oc();function yOB(H,$){if($===void 0)$=SOB.asyncScheduler;var A=ROB.timer(H,$);return jOB.delayWhen(function(){return A})}xaH.delay=yOB});var $h$=z((SaH)=>{Object.defineProperty(SaH,"__esModule",{value:!0});SaH.dematerialize=void 0;var vOB=KrH(),hOB=ED(),bOB=EB();function kOB(){return hOB.operate(function(H,$){H.subscribe(bOB.createOperatorSubscriber($,function(A){return vOB.observeNotification(A,$)}))})}SaH.dematerialize=kOB});var Ah$=z((jaH)=>{Object.defineProperty(jaH,"__esModule",{value:!0});jaH.distinct=void 0;var uOB=ED(),M$L=EB(),gOB=NW(),mOB=M1();function pOB(H,$){return uOB.operate(function(A,L){var I=new Set;A.subscribe(M$L.createOperatorSubscriber(L,function(D){var B=H?H(D):D;if(!I.has(B))I.add(B),L.next(D)})),$&&mOB.innerFrom($).subscribe(M$L.createOperatorSubscriber(L,function(){return I.clear()},gOB.noop))})}jaH.distinct=pOB});var yaH=z((RaH)=>{Object.defineProperty(RaH,"__esModule",{value:!0});RaH.distinctUntilChanged=void 0;var dOB=OW(),cOB=ED(),lOB=EB();function iOB(H,$){if($===void 0)$=dOB.identity;return H=H!==null&&H!==void 0?H:nOB,cOB.operate(function(A,L){var I,D=!0;A.subscribe(lOB.createOperatorSubscriber(L,function(B){var f=$(B);if(D||!H(I,f))D=!1,I=f,L.next(B)}))})}RaH.distinctUntilChanged=iOB;function nOB(H,$){return H===$}});var Lh$=z((vaH)=>{Object.defineProperty(vaH,"__esModule",{value:!0});vaH.distinctUntilKeyChanged=void 0;var rOB=yaH();function aOB(H,$){return rOB.distinctUntilChanged(function(A,L){return $?$(A[H],L[H]):A[H]===L[H]})}vaH.distinctUntilKeyChanged=aOB});var CMH=z((haH)=>{Object.defineProperty(haH,"__esModule",{value:!0});haH.throwIfEmpty=void 0;var oOB=ic(),tOB=ED(),sOB=EB();function eOB(H){if(H===void 0)H=HxB;return tOB.operate(function($,A){var L=!1;$.subscribe(sOB.createOperatorSubscriber(A,function(I){L=!0,A.next(I)},function(){return L?A.complete():A.error(H())}))})}haH.throwIfEmpty=eOB;function HxB(){return new oOB.EmptyError}});var Ih$=z((baH)=>{Object.defineProperty(baH,"__esModule",{value:!0});baH.elementAt=void 0;var G$L=Yv$(),$xB=wk(),AxB=CMH(),LxB=_MH(),IxB=YMH();function DxB(H,$){if(H<0)throw new G$L.ArgumentOutOfRangeError;var A=arguments.length>=2;return function(L){return L.pipe($xB.filter(function(I,D){return D===H}),IxB.take(1),A?LxB.defaultIfEmpty($):AxB.throwIfEmpty(function(){return new G$L.ArgumentOutOfRangeError}))}}baH.elementAt=DxB});var Dh$=z((Al)=>{var BxB=Al&&Al.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},fxB=Al&&Al.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(kaH,"__esModule",{value:!0});kaH.every=void 0;var UxB=ED(),XxB=EB();function JxB(H,$){return UxB.operate(function(A,L){var I=0;A.subscribe(XxB.createOperatorSubscriber(L,function(D){if(!H.call($,D,I++,A))L.next(!1),L.complete()},function(){L.next(!0),L.complete()}))})}kaH.every=JxB});var gaH=z((uaH)=>{Object.defineProperty(uaH,"__esModule",{value:!0});uaH.exhaustMap=void 0;var FxB=Ck(),U$L=M1(),KxB=ED(),X$L=EB();function J$L(H,$){if($)return function(A){return A.pipe(J$L(function(L,I){return U$L.innerFrom(H(L,I)).pipe(FxB.map(function(D,B){return $(L,D,I,B)}))}))};return KxB.operate(function(A,L){var I=0,D=null,B=!1;A.subscribe(X$L.createOperatorSubscriber(L,function(f){if(!D)D=X$L.createOperatorSubscriber(L,void 0,function(){D=null,B&&L.complete()}),U$L.innerFrom(H(f,I++)).subscribe(D)},function(){B=!0,!D&&L.complete()}))})}uaH.exhaustMap=J$L});var paH=z((maH)=>{Object.defineProperty(maH,"__esModule",{value:!0});maH.exhaustAll=void 0;var QxB=gaH(),WxB=OW();function VxB(){return QxB.exhaustMap(WxB.identity)}maH.exhaustAll=VxB});var fh$=z((daH)=>{Object.defineProperty(daH,"__esModule",{value:!0});daH.exhaust=void 0;var PxB=paH();daH.exhaust=PxB.exhaustAll});var Eh$=z((caH)=>{Object.defineProperty(caH,"__esModule",{value:!0});caH.expand=void 0;var _xB=ED(),YxB=jrH();function CxB(H,$,A){if($===void 0)$=1/0;return $=($||0)<1?1/0:$,_xB.operate(function(L,I){return YxB.mergeInternals(L,I,H,$,void 0,!0,A)})}caH.expand=CxB});var Mh$=z((laH)=>{Object.defineProperty(laH,"__esModule",{value:!0});laH.finalize=void 0;var wxB=ED();function ZxB(H){return wxB.operate(function($,A){try{$.subscribe(A)}finally{A.add(H)}})}laH.finalize=ZxB});var iaH=z((wMH)=>{Object.defineProperty(wMH,"__esModule",{value:!0});wMH.createFind=wMH.find=void 0;var qxB=ED(),TxB=EB();function zxB(H,$){return qxB.operate(F$L(H,$,"value"))}wMH.find=zxB;function F$L(H,$,A){var L=A==="index";return function(I,D){var B=0;I.subscribe(TxB.createOperatorSubscriber(D,function(f){var E=B++;if(H.call($,f,E,I))D.next(L?E:f),D.complete()},function(){D.next(L?-1:void 0),D.complete()}))}}wMH.createFind=F$L});var Gh$=z((naH)=>{Object.defineProperty(naH,"__esModule",{value:!0});naH.findIndex=void 0;var NxB=ED(),OxB=iaH();function xxB(H,$){return NxB.operate(OxB.createFind(H,$,"index"))}naH.findIndex=xxB});var Uh$=z((raH)=>{Object.defineProperty(raH,"__esModule",{value:!0});raH.first=void 0;var SxB=ic(),jxB=wk(),RxB=YMH(),yxB=_MH(),vxB=CMH(),hxB=OW();function bxB(H,$){var A=arguments.length>=2;return function(L){return L.pipe(H?jxB.filter(function(I,D){return H(I,D,L)}):hxB.identity,RxB.take(1),A?yxB.defaultIfEmpty($):vxB.throwIfEmpty(function(){return new SxB.EmptyError}))}}raH.first=bxB});var Xh$=z((aaH)=>{Object.defineProperty(aaH,"__esModule",{value:!0});aaH.groupBy=void 0;var kxB=wM(),uxB=M1(),gxB=xW(),mxB=ED(),K$L=EB();function pxB(H,$,A,L){return mxB.operate(function(I,D){var B;if(!$||typeof $==="function")B=$;else A=$.duration,B=$.element,L=$.connector;var f=new Map,E=function(F){f.forEach(F),F(D)},M=function(F){return E(function(Q){return Q.error(F)})},G=0,U=!1,X=new K$L.OperatorSubscriber(D,function(F){try{var Q=H(F),W=f.get(Q);if(!W){f.set(Q,W=L?L():new gxB.Subject);var P=J(Q,W);if(D.next(P),A){var C=K$L.createOperatorSubscriber(W,function(){W.complete(),C===null||C===void 0||C.unsubscribe()},void 0,void 0,function(){return f.delete(Q)});X.add(uxB.innerFrom(A(P)).subscribe(C))}}W.next(B?B(F):F)}catch(Y){M(Y)}},function(){return E(function(F){return F.complete()})},M,function(){return f.clear()},function(){return U=!0,G===0});I.subscribe(X);function J(F,Q){var W=new kxB.Observable(function(P){G++;var C=Q.subscribe(P);return function(){C.unsubscribe(),--G===0&&U&&X.unsubscribe()}});return W.key=F,W}})}aaH.groupBy=pxB});var Jh$=z((oaH)=>{Object.defineProperty(oaH,"__esModule",{value:!0});oaH.isEmpty=void 0;var dxB=ED(),cxB=EB();function lxB(){return dxB.operate(function(H,$){H.subscribe(cxB.createOperatorSubscriber($,function(){$.next(!1),$.complete()},function(){$.next(!0),$.complete()}))})}oaH.isEmpty=lxB});var taH=z((ZMH)=>{var ixB=ZMH&&ZMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ZMH,"__esModule",{value:!0});ZMH.takeLast=void 0;var nxB=xN(),rxB=ED(),axB=EB();function oxB(H){return H<=0?function(){return nxB.EMPTY}:rxB.operate(function($,A){var L=[];$.subscribe(axB.createOperatorSubscriber(A,function(I){L.push(I),H{Object.defineProperty(saH,"__esModule",{value:!0});saH.last=void 0;var txB=ic(),sxB=wk(),exB=taH(),HSB=CMH(),$SB=_MH(),ASB=OW();function LSB(H,$){var A=arguments.length>=2;return function(L){return L.pipe(H?sxB.filter(function(I,D){return H(I,D,L)}):ASB.identity,exB.takeLast(1),A?$SB.defaultIfEmpty($):HSB.throwIfEmpty(function(){return new txB.EmptyError}))}}saH.last=LSB});var Qh$=z((eaH)=>{Object.defineProperty(eaH,"__esModule",{value:!0});eaH.materialize=void 0;var Kh$=KrH(),ISB=ED(),DSB=EB();function BSB(){return ISB.operate(function(H,$){H.subscribe(DSB.createOperatorSubscriber($,function(A){$.next(Kh$.Notification.createNext(A))},function(){$.next(Kh$.Notification.createComplete()),$.complete()},function(A){$.next(Kh$.Notification.createError(A)),$.complete()}))})}eaH.materialize=BSB});var Wh$=z((HoH)=>{Object.defineProperty(HoH,"__esModule",{value:!0});HoH.max=void 0;var fSB=I$H(),ESB=sE();function MSB(H){return fSB.reduce(ESB.isFunction(H)?function($,A){return H($,A)>0?$:A}:function($,A){return $>A?$:A})}HoH.max=MSB});var Vh$=z(($oH)=>{Object.defineProperty($oH,"__esModule",{value:!0});$oH.flatMap=void 0;var GSB=QR();$oH.flatMap=GSB.mergeMap});var Ph$=z((AoH)=>{Object.defineProperty(AoH,"__esModule",{value:!0});AoH.mergeMapTo=void 0;var Q$L=QR(),USB=sE();function XSB(H,$,A){if(A===void 0)A=1/0;if(USB.isFunction($))return Q$L.mergeMap(function(){return H},$,A);if(typeof $==="number")A=$;return Q$L.mergeMap(function(){return H},A)}AoH.mergeMapTo=XSB});var _h$=z((LoH)=>{Object.defineProperty(LoH,"__esModule",{value:!0});LoH.mergeScan=void 0;var JSB=ED(),FSB=jrH();function KSB(H,$,A){if(A===void 0)A=1/0;return JSB.operate(function(L,I){var D=$;return FSB.mergeInternals(L,I,function(B,f){return H(D,B,f)},A,function(B){D=B},!1,void 0,function(){return D=null})})}LoH.mergeScan=KSB});var Yh$=z((Ll)=>{var QSB=Ll&&Ll.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},WSB=Ll&&Ll.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var CSB=Il&&Il.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},wSB=Il&&Il.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(IoH,"__esModule",{value:!0});IoH.min=void 0;var TSB=I$H(),zSB=sE();function NSB(H){return TSB.reduce(zSB.isFunction(H)?function($,A){return H($,A)<0?$:A}:function($,A){return ${Object.defineProperty(DoH,"__esModule",{value:!0});DoH.multicast=void 0;var OSB=yCH(),V$L=sE(),xSB=pCH();function SSB(H,$){var A=V$L.isFunction(H)?H:function(){return H};if(V$L.isFunction($))return xSB.connect($,{connector:A});return function(L){return new OSB.ConnectableObservable(L,A)}}DoH.multicast=SSB});var Zh$=z((WR)=>{var jSB=WR&&WR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},RSB=WR&&WR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(BoH,"__esModule",{value:!0});BoH.pairwise=void 0;var hSB=ED(),bSB=EB();function kSB(){return hSB.operate(function(H,$){var A,L=!1;H.subscribe(bSB.createOperatorSubscriber($,function(I){var D=A;A=I,L&&$.next([D,I]),L=!0}))})}BoH.pairwise=kSB});var Th$=z((foH)=>{Object.defineProperty(foH,"__esModule",{value:!0});foH.pluck=void 0;var uSB=Ck();function gSB(){var H=[];for(var $=0;${Object.defineProperty(EoH,"__esModule",{value:!0});EoH.publish=void 0;var mSB=xW(),pSB=dCH(),dSB=pCH();function cSB(H){return H?function($){return dSB.connect(H)($)}:function($){return pSB.multicast(new mSB.Subject)($)}}EoH.publish=cSB});var Nh$=z((MoH)=>{Object.defineProperty(MoH,"__esModule",{value:!0});MoH.publishBehavior=void 0;var lSB=Iv$(),iSB=yCH();function nSB(H){return function($){var A=new lSB.BehaviorSubject(H);return new iSB.ConnectableObservable($,function(){return A})}}MoH.publishBehavior=nSB});var Oh$=z((GoH)=>{Object.defineProperty(GoH,"__esModule",{value:!0});GoH.publishLast=void 0;var rSB=dnH(),aSB=yCH();function oSB(){return function(H){var $=new rSB.AsyncSubject;return new aSB.ConnectableObservable(H,function(){return $})}}GoH.publishLast=oSB});var xh$=z((UoH)=>{Object.defineProperty(UoH,"__esModule",{value:!0});UoH.publishReplay=void 0;var tSB=pnH(),sSB=dCH(),_$L=sE();function eSB(H,$,A,L){if(A&&!_$L.isFunction(A))L=A;var I=_$L.isFunction(A)?A:void 0;return function(D){return sSB.multicast(new tSB.ReplaySubject(H,$,L),I)(D)}}UoH.publishReplay=eSB});var XoH=z((Dl)=>{var HjB=Dl&&Dl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},$jB=Dl&&Dl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(JoH,"__esModule",{value:!0});JoH.repeat=void 0;var BjB=xN(),fjB=ED(),Y$L=EB(),EjB=M1(),MjB=oc();function GjB(H){var $,A=1/0,L;if(H!=null)if(typeof H==="object")$=H.count,A=$===void 0?1/0:$,L=H.delay;else A=H;return A<=0?function(){return BjB.EMPTY}:fjB.operate(function(I,D){var B=0,f,E=function(){if(f===null||f===void 0||f.unsubscribe(),f=null,L!=null){var G=typeof L==="number"?MjB.timer(L):EjB.innerFrom(L(B)),U=Y$L.createOperatorSubscriber(D,function(){U.unsubscribe(),M()});G.subscribe(U)}else M()},M=function(){var G=!1;if(f=I.subscribe(Y$L.createOperatorSubscriber(D,void 0,function(){if(++B{Object.defineProperty(FoH,"__esModule",{value:!0});FoH.repeatWhen=void 0;var UjB=M1(),XjB=xW(),JjB=ED(),C$L=EB();function FjB(H){return JjB.operate(function($,A){var L,I=!1,D,B=!1,f=!1,E=function(){return f&&B&&(A.complete(),!0)},M=function(){if(!D)D=new XjB.Subject,UjB.innerFrom(H(D)).subscribe(C$L.createOperatorSubscriber(A,function(){if(L)G();else I=!0},function(){B=!0,E()}));return D},G=function(){if(f=!1,L=$.subscribe(C$L.createOperatorSubscriber(A,void 0,function(){f=!0,!E()&&M().next()})),I)L.unsubscribe(),L=null,I=!1,G()};G()})}FoH.repeatWhen=FjB});var Rh$=z((KoH)=>{Object.defineProperty(KoH,"__esModule",{value:!0});KoH.retry=void 0;var KjB=ED(),w$L=EB(),QjB=OW(),WjB=oc(),VjB=M1();function PjB(H){if(H===void 0)H=1/0;var $;if(H&&typeof H==="object")$=H;else $={count:H};var A=$.count,L=A===void 0?1/0:A,I=$.delay,D=$.resetOnSuccess,B=D===void 0?!1:D;return L<=0?QjB.identity:KjB.operate(function(f,E){var M=0,G,U=function(){var X=!1;if(G=f.subscribe(w$L.createOperatorSubscriber(E,function(J){if(B)M=0;E.next(J)},void 0,function(J){if(M++{Object.defineProperty(QoH,"__esModule",{value:!0});QoH.retryWhen=void 0;var _jB=M1(),YjB=xW(),CjB=ED(),Z$L=EB();function wjB(H){return CjB.operate(function($,A){var L,I=!1,D,B=function(){if(L=$.subscribe(Z$L.createOperatorSubscriber(A,void 0,void 0,function(f){if(!D)D=new YjB.Subject,_jB.innerFrom(H(D)).subscribe(Z$L.createOperatorSubscriber(A,function(){return L?B():I=!0}));if(D)D.next(f)})),I)L.unsubscribe(),L=null,I=!1,B()};B()})}QoH.retryWhen=wjB});var VoH=z((WoH)=>{Object.defineProperty(WoH,"__esModule",{value:!0});WoH.sample=void 0;var ZjB=M1(),qjB=ED(),TjB=NW(),q$L=EB();function zjB(H){return qjB.operate(function($,A){var L=!1,I=null;$.subscribe(q$L.createOperatorSubscriber(A,function(D){L=!0,I=D})),ZjB.innerFrom(H).subscribe(q$L.createOperatorSubscriber(A,function(){if(L){L=!1;var D=I;I=null,A.next(D)}},TjB.noop))})}WoH.sample=zjB});var vh$=z((PoH)=>{Object.defineProperty(PoH,"__esModule",{value:!0});PoH.sampleTime=void 0;var NjB=T_(),OjB=VoH(),xjB=Ov$();function SjB(H,$){if($===void 0)$=NjB.asyncScheduler;return OjB.sample(xjB.interval(H,$))}PoH.sampleTime=SjB});var hh$=z((_oH)=>{Object.defineProperty(_oH,"__esModule",{value:!0});_oH.scan=void 0;var jjB=ED(),RjB=dv$();function yjB(H,$){return jjB.operate(RjB.scanInternals(H,$,arguments.length>=2,!0))}_oH.scan=yjB});var bh$=z((YoH)=>{Object.defineProperty(YoH,"__esModule",{value:!0});YoH.sequenceEqual=void 0;var vjB=ED(),hjB=EB(),bjB=M1();function kjB(H,$){if($===void 0)$=function(A,L){return A===L};return vjB.operate(function(A,L){var I=T$L(),D=T$L(),B=function(E){L.next(E),L.complete()},f=function(E,M){var G=hjB.createOperatorSubscriber(L,function(U){var{buffer:X,complete:J}=M;if(X.length===0)J?B(!1):E.buffer.push(U);else!$(U,X.shift())&&B(!1)},function(){E.complete=!0;var{complete:U,buffer:X}=M;U&&B(X.length===0),G===null||G===void 0||G.unsubscribe()});return G};A.subscribe(f(I,D)),bjB.innerFrom(H).subscribe(f(D,I))})}YoH.sequenceEqual=kjB;function T$L(){return{buffer:[],complete:!1}}});var CoH=z((Bl)=>{var ujB=Bl&&Bl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},gjB=Bl&&Bl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A0)G=new N$L.SafeSubscriber({next:function(O){return q.next(O)},error:function(O){Q=!0,W(),U=kh$(P,I,O),q.error(O)},complete:function(){F=!0,W(),U=kh$(P,B),q.complete()}}),z$L.innerFrom(Y).subscribe(G)})(M)}}Bl.share=djB;function kh$(H,$){var A=[];for(var L=2;L{Object.defineProperty(woH,"__esModule",{value:!0});woH.shareReplay=void 0;var cjB=pnH(),ljB=CoH();function ijB(H,$,A){var L,I,D,B,f=!1;if(H&&typeof H==="object")L=H.bufferSize,B=L===void 0?1/0:L,I=H.windowTime,$=I===void 0?1/0:I,D=H.refCount,f=D===void 0?!1:D,A=H.scheduler;else B=H!==null&&H!==void 0?H:1/0;return ljB.share({connector:function(){return new cjB.ReplaySubject(B,$,A)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:f})}woH.shareReplay=ijB});var gh$=z((ZoH)=>{Object.defineProperty(ZoH,"__esModule",{value:!0});ZoH.single=void 0;var njB=ic(),rjB=wv$(),ajB=Cv$(),ojB=ED(),tjB=EB();function sjB(H){return ojB.operate(function($,A){var L=!1,I,D=!1,B=0;$.subscribe(tjB.createOperatorSubscriber(A,function(f){if(D=!0,!H||H(f,B++,$))L&&A.error(new rjB.SequenceError("Too many matching values")),L=!0,I=f},function(){if(L)A.next(I),A.complete();else A.error(D?new ajB.NotFoundError("No matching values"):new njB.EmptyError)}))})}ZoH.single=sjB});var mh$=z((qoH)=>{Object.defineProperty(qoH,"__esModule",{value:!0});qoH.skip=void 0;var ejB=wk();function HRB(H){return ejB.filter(function($,A){return H<=A})}qoH.skip=HRB});var ph$=z((ToH)=>{Object.defineProperty(ToH,"__esModule",{value:!0});ToH.skipLast=void 0;var $RB=OW(),ARB=ED(),LRB=EB();function IRB(H){return H<=0?$RB.identity:ARB.operate(function($,A){var L=Array(H),I=0;return $.subscribe(LRB.createOperatorSubscriber(A,function(D){var B=I++;if(B{Object.defineProperty(zoH,"__esModule",{value:!0});zoH.skipUntil=void 0;var DRB=ED(),O$L=EB(),BRB=M1(),fRB=NW();function ERB(H){return DRB.operate(function($,A){var L=!1,I=O$L.createOperatorSubscriber(A,function(){I===null||I===void 0||I.unsubscribe(),L=!0},fRB.noop);BRB.innerFrom(H).subscribe(I),$.subscribe(O$L.createOperatorSubscriber(A,function(D){return L&&A.next(D)}))})}zoH.skipUntil=ERB});var ch$=z((NoH)=>{Object.defineProperty(NoH,"__esModule",{value:!0});NoH.skipWhile=void 0;var MRB=ED(),GRB=EB();function URB(H){return MRB.operate(function($,A){var L=!1,I=0;$.subscribe(GRB.createOperatorSubscriber(A,function(D){return(L||(L=!H(D,I++)))&&A.next(D)}))})}NoH.skipWhile=URB});var lh$=z((OoH)=>{Object.defineProperty(OoH,"__esModule",{value:!0});OoH.startWith=void 0;var x$L=gCH(),XRB=z_(),JRB=ED();function FRB(){var H=[];for(var $=0;${Object.defineProperty(xoH,"__esModule",{value:!0});xoH.switchMap=void 0;var KRB=M1(),QRB=ED(),S$L=EB();function WRB(H,$){return QRB.operate(function(A,L){var I=null,D=0,B=!1,f=function(){return B&&!I&&L.complete()};A.subscribe(S$L.createOperatorSubscriber(L,function(E){I===null||I===void 0||I.unsubscribe();var M=0,G=D++;KRB.innerFrom(H(E,G)).subscribe(I=S$L.createOperatorSubscriber(L,function(U){return L.next($?$(E,U,G,M++):U)},function(){I=null,f()}))},function(){B=!0,f()}))})}xoH.switchMap=WRB});var ih$=z((SoH)=>{Object.defineProperty(SoH,"__esModule",{value:!0});SoH.switchAll=void 0;var VRB=qMH(),PRB=OW();function _RB(){return VRB.switchMap(PRB.identity)}SoH.switchAll=_RB});var nh$=z((joH)=>{Object.defineProperty(joH,"__esModule",{value:!0});joH.switchMapTo=void 0;var j$L=qMH(),YRB=sE();function CRB(H,$){return YRB.isFunction($)?j$L.switchMap(function(){return H},$):j$L.switchMap(function(){return H})}joH.switchMapTo=CRB});var rh$=z((RoH)=>{Object.defineProperty(RoH,"__esModule",{value:!0});RoH.switchScan=void 0;var wRB=qMH(),ZRB=ED();function qRB(H,$){return ZRB.operate(function(A,L){var I=$;return wRB.switchMap(function(D,B){return H(I,D,B)},function(D,B){return I=B,B})(A).subscribe(L),function(){I=null}})}RoH.switchScan=qRB});var ah$=z((yoH)=>{Object.defineProperty(yoH,"__esModule",{value:!0});yoH.takeUntil=void 0;var TRB=ED(),zRB=EB(),NRB=M1(),ORB=NW();function xRB(H){return TRB.operate(function($,A){NRB.innerFrom(H).subscribe(zRB.createOperatorSubscriber(A,function(){return A.complete()},ORB.noop)),!A.closed&&$.subscribe(A)})}yoH.takeUntil=xRB});var oh$=z((voH)=>{Object.defineProperty(voH,"__esModule",{value:!0});voH.takeWhile=void 0;var SRB=ED(),jRB=EB();function RRB(H,$){if($===void 0)$=!1;return SRB.operate(function(A,L){var I=0;A.subscribe(jRB.createOperatorSubscriber(L,function(D){var B=H(D,I++);(B||$)&&L.next(D),!B&&L.complete()}))})}voH.takeWhile=RRB});var th$=z((hoH)=>{Object.defineProperty(hoH,"__esModule",{value:!0});hoH.tap=void 0;var yRB=sE(),vRB=ED(),hRB=EB(),bRB=OW();function kRB(H,$,A){var L=yRB.isFunction(H)||$||A?{next:H,error:$,complete:A}:H;return L?vRB.operate(function(I,D){var B;(B=L.subscribe)===null||B===void 0||B.call(L);var f=!0;I.subscribe(hRB.createOperatorSubscriber(D,function(E){var M;(M=L.next)===null||M===void 0||M.call(L,E),D.next(E)},function(){var E;f=!1,(E=L.complete)===null||E===void 0||E.call(L),D.complete()},function(E){var M;f=!1,(M=L.error)===null||M===void 0||M.call(L,E),D.error(E)},function(){var E,M;if(f)(E=L.unsubscribe)===null||E===void 0||E.call(L);(M=L.finalize)===null||M===void 0||M.call(L)}))}):bRB.identity}hoH.tap=kRB});var koH=z((boH)=>{Object.defineProperty(boH,"__esModule",{value:!0});boH.throttle=void 0;var uRB=ED(),R$L=EB(),gRB=M1();function mRB(H,$){return uRB.operate(function(A,L){var I=$!==null&&$!==void 0?$:{},D=I.leading,B=D===void 0?!0:D,f=I.trailing,E=f===void 0?!1:f,M=!1,G=null,U=null,X=!1,J=function(){if(U===null||U===void 0||U.unsubscribe(),U=null,E)W(),X&&L.complete()},F=function(){U=null,X&&L.complete()},Q=function(P){return U=gRB.innerFrom(H(P)).subscribe(R$L.createOperatorSubscriber(L,J,F))},W=function(){if(M){M=!1;var P=G;G=null,L.next(P),!X&&Q(P)}};A.subscribe(R$L.createOperatorSubscriber(L,function(P){M=!0,G=P,!(U&&!U.closed)&&(B?W():Q(P))},function(){X=!0,!(E&&M&&U&&!U.closed)&&L.complete()}))})}boH.throttle=mRB});var sh$=z((uoH)=>{Object.defineProperty(uoH,"__esModule",{value:!0});uoH.throttleTime=void 0;var pRB=T_(),dRB=koH(),cRB=oc();function lRB(H,$,A){if($===void 0)$=pRB.asyncScheduler;var L=cRB.timer(H,$);return dRB.throttle(function(){return L},A)}uoH.throttleTime=lRB});var eh$=z((TMH)=>{Object.defineProperty(TMH,"__esModule",{value:!0});TMH.TimeInterval=TMH.timeInterval=void 0;var iRB=T_(),nRB=ED(),rRB=EB();function aRB(H){if(H===void 0)H=iRB.asyncScheduler;return nRB.operate(function($,A){var L=H.now();$.subscribe(rRB.createOperatorSubscriber(A,function(I){var D=H.now(),B=D-L;L=D,A.next(new y$L(I,B))}))})}TMH.timeInterval=aRB;var y$L=function(){function H($,A){this.value=$,this.interval=A}return H}();TMH.TimeInterval=y$L});var Hb$=z((goH)=>{Object.defineProperty(goH,"__esModule",{value:!0});goH.timeoutWith=void 0;var oRB=T_(),tRB=ZrH(),sRB=kCH();function eRB(H,$,A){var L,I,D;if(A=A!==null&&A!==void 0?A:oRB.async,tRB.isValidDate(H))L=H;else if(typeof H==="number")I=H;if($)D=function(){return $};else throw TypeError("No observable provided to switch to");if(L==null&&I==null)throw TypeError("No timeout provided.");return sRB.timeout({first:L,each:I,scheduler:A,with:D})}goH.timeoutWith=eRB});var $b$=z((moH)=>{Object.defineProperty(moH,"__esModule",{value:!0});moH.timestamp=void 0;var HyB=mnH(),$yB=Ck();function AyB(H){if(H===void 0)H=HyB.dateTimestampProvider;return $yB.map(function($){return{value:$,timestamp:H.now()}})}moH.timestamp=AyB});var Ab$=z((poH)=>{Object.defineProperty(poH,"__esModule",{value:!0});poH.window=void 0;var v$L=xW(),LyB=ED(),h$L=EB(),IyB=NW(),DyB=M1();function ByB(H){return LyB.operate(function($,A){var L=new v$L.Subject;A.next(L.asObservable());var I=function(D){L.error(D),A.error(D)};return $.subscribe(h$L.createOperatorSubscriber(A,function(D){return L===null||L===void 0?void 0:L.next(D)},function(){L.complete(),A.complete()},I)),DyB.innerFrom(H).subscribe(h$L.createOperatorSubscriber(A,function(){L.complete(),A.next(L=new v$L.Subject)},IyB.noop,I)),function(){L===null||L===void 0||L.unsubscribe(),L=null}})}poH.window=ByB});var Lb$=z((zMH)=>{var fyB=zMH&&zMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(zMH,"__esModule",{value:!0});zMH.windowCount=void 0;var b$L=xW(),EyB=ED(),MyB=EB();function GyB(H,$){if($===void 0)$=0;var A=$>0?$:H;return EyB.operate(function(L,I){var D=[new b$L.Subject],B=[],f=0;I.next(D[0].asObservable()),L.subscribe(MyB.createOperatorSubscriber(I,function(E){var M,G;try{for(var U=fyB(D),X=U.next();!X.done;X=U.next()){var J=X.value;J.next(E)}}catch(W){M={error:W}}finally{try{if(X&&!X.done&&(G=U.return))G.call(U)}finally{if(M)throw M.error}}var F=f-H+1;if(F>=0&&F%A===0)D.shift().complete();if(++f%A===0){var Q=new b$L.Subject;D.push(Q),I.next(Q.asObservable())}},function(){while(D.length>0)D.shift().complete();I.complete()},function(E){while(D.length>0)D.shift().error(E);I.error(E)},function(){B=null,D=null}))})}zMH.windowCount=GyB});var Ib$=z((doH)=>{Object.defineProperty(doH,"__esModule",{value:!0});doH.windowTime=void 0;var UyB=xW(),XyB=T_(),JyB=L2(),FyB=ED(),KyB=EB(),QyB=Vk(),WyB=z_(),k$L=Pk();function VyB(H){var $,A,L=[];for(var I=1;I=0)k$L.executeSchedule(M,D,J,B,!0);else U=!0;J();var F=function(W){return G.slice().forEach(W)},Q=function(W){F(function(P){var C=P.window;return W(C)}),W(M),M.unsubscribe()};return E.subscribe(KyB.createOperatorSubscriber(M,function(W){F(function(P){P.window.next(W),f<=++P.seen&&X(P)})},function(){return Q(function(W){return W.complete()})},function(W){return Q(function(P){return P.error(W)})})),function(){G=null}})}doH.windowTime=VyB});var Bb$=z((NMH)=>{var PyB=NMH&&NMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(NMH,"__esModule",{value:!0});NMH.windowToggle=void 0;var _yB=xW(),YyB=L2(),CyB=ED(),u$L=M1(),Db$=EB(),g$L=NW(),wyB=Vk();function ZyB(H,$){return CyB.operate(function(A,L){var I=[],D=function(B){while(0{Object.defineProperty(coH,"__esModule",{value:!0});coH.windowWhen=void 0;var qyB=xW(),TyB=ED(),m$L=EB(),zyB=M1();function NyB(H){return TyB.operate(function($,A){var L,I,D=function(f){L.error(f),A.error(f)},B=function(){I===null||I===void 0||I.unsubscribe(),L===null||L===void 0||L.complete(),L=new qyB.Subject,A.next(L.asObservable());var f;try{f=zyB.innerFrom(H())}catch(E){D(E);return}f.subscribe(I=m$L.createOperatorSubscriber(A,B,B,D))};B(),$.subscribe(m$L.createOperatorSubscriber(A,function(f){return L.next(f)},function(){L.complete(),A.complete()},D,function(){I===null||I===void 0||I.unsubscribe(),L=null}))})}coH.windowWhen=NyB});var Eb$=z((fl)=>{var p$L=fl&&fl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},d$L=fl&&fl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(loH,"__esModule",{value:!0});loH.zipAll=void 0;var vyB=erH(),hyB=cv$();function byB(H){return hyB.joinAllInternals(vyB.zip,H)}loH.zipAll=byB});var Gb$=z((El)=>{var kyB=El&&El.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},uyB=El&&El.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var dyB=Ml&&Ml.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},cyB=Ml&&Ml.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var nyB=lH&&lH.__createBinding||(Object.create?function(H,$,A,L){if(L===void 0)L=A;Object.defineProperty(H,L,{enumerable:!0,get:function(){return $[A]}})}:function(H,$,A,L){if(L===void 0)L=A;H[L]=$[A]}),ryB=lH&&lH.__exportStar||function(H,$){for(var A in H)if(A!=="default"&&!Object.prototype.hasOwnProperty.call($,A))nyB($,H,A)};Object.defineProperty(lH,"__esModule",{value:!0});lH.interval=lH.iif=lH.generate=lH.fromEventPattern=lH.fromEvent=lH.from=lH.forkJoin=lH.empty=lH.defer=lH.connectable=lH.concat=lH.combineLatest=lH.bindNodeCallback=lH.bindCallback=lH.UnsubscriptionError=lH.TimeoutError=lH.SequenceError=lH.ObjectUnsubscribedError=lH.NotFoundError=lH.EmptyError=lH.ArgumentOutOfRangeError=lH.firstValueFrom=lH.lastValueFrom=lH.isObservable=lH.identity=lH.noop=lH.pipe=lH.NotificationKind=lH.Notification=lH.Subscriber=lH.Subscription=lH.Scheduler=lH.VirtualAction=lH.VirtualTimeScheduler=lH.animationFrameScheduler=lH.animationFrame=lH.queueScheduler=lH.queue=lH.asyncScheduler=lH.async=lH.asapScheduler=lH.asap=lH.AsyncSubject=lH.ReplaySubject=lH.BehaviorSubject=lH.Subject=lH.animationFrames=lH.observable=lH.ConnectableObservable=lH.Observable=void 0;lH.filter=lH.expand=lH.exhaustMap=lH.exhaustAll=lH.exhaust=lH.every=lH.endWith=lH.elementAt=lH.distinctUntilKeyChanged=lH.distinctUntilChanged=lH.distinct=lH.dematerialize=lH.delayWhen=lH.delay=lH.defaultIfEmpty=lH.debounceTime=lH.debounce=lH.count=lH.connect=lH.concatWith=lH.concatMapTo=lH.concatMap=lH.concatAll=lH.combineLatestWith=lH.combineLatestAll=lH.combineAll=lH.catchError=lH.bufferWhen=lH.bufferToggle=lH.bufferTime=lH.bufferCount=lH.buffer=lH.auditTime=lH.audit=lH.config=lH.NEVER=lH.EMPTY=lH.scheduled=lH.zip=lH.using=lH.timer=lH.throwError=lH.range=lH.race=lH.partition=lH.pairs=lH.onErrorResumeNext=lH.of=lH.never=lH.merge=void 0;lH.switchMap=lH.switchAll=lH.subscribeOn=lH.startWith=lH.skipWhile=lH.skipUntil=lH.skipLast=lH.skip=lH.single=lH.shareReplay=lH.share=lH.sequenceEqual=lH.scan=lH.sampleTime=lH.sample=lH.refCount=lH.retryWhen=lH.retry=lH.repeatWhen=lH.repeat=lH.reduce=lH.raceWith=lH.publishReplay=lH.publishLast=lH.publishBehavior=lH.publish=lH.pluck=lH.pairwise=lH.onErrorResumeNextWith=lH.observeOn=lH.multicast=lH.min=lH.mergeWith=lH.mergeScan=lH.mergeMapTo=lH.mergeMap=lH.flatMap=lH.mergeAll=lH.max=lH.materialize=lH.mapTo=lH.map=lH.last=lH.isEmpty=lH.ignoreElements=lH.groupBy=lH.first=lH.findIndex=lH.find=lH.finalize=void 0;lH.zipWith=lH.zipAll=lH.withLatestFrom=lH.windowWhen=lH.windowToggle=lH.windowTime=lH.windowCount=lH.window=lH.toArray=lH.timestamp=lH.timeoutWith=lH.timeout=lH.timeInterval=lH.throwIfEmpty=lH.throttleTime=lH.throttle=lH.tap=lH.takeWhile=lH.takeUntil=lH.takeLast=lH.take=lH.switchScan=lH.switchMapTo=void 0;var ayB=wM();Object.defineProperty(lH,"Observable",{enumerable:!0,get:function(){return ayB.Observable}});var oyB=yCH();Object.defineProperty(lH,"ConnectableObservable",{enumerable:!0,get:function(){return oyB.ConnectableObservable}});var tyB=jCH();Object.defineProperty(lH,"observable",{enumerable:!0,get:function(){return tyB.observable}});var syB=CeA();Object.defineProperty(lH,"animationFrames",{enumerable:!0,get:function(){return syB.animationFrames}});var eyB=xW();Object.defineProperty(lH,"Subject",{enumerable:!0,get:function(){return eyB.Subject}});var HvB=Iv$();Object.defineProperty(lH,"BehaviorSubject",{enumerable:!0,get:function(){return HvB.BehaviorSubject}});var $vB=pnH();Object.defineProperty(lH,"ReplaySubject",{enumerable:!0,get:function(){return $vB.ReplaySubject}});var AvB=dnH();Object.defineProperty(lH,"AsyncSubject",{enumerable:!0,get:function(){return AvB.AsyncSubject}});var l$L=ueA();Object.defineProperty(lH,"asap",{enumerable:!0,get:function(){return l$L.asap}});Object.defineProperty(lH,"asapScheduler",{enumerable:!0,get:function(){return l$L.asapScheduler}});var i$L=T_();Object.defineProperty(lH,"async",{enumerable:!0,get:function(){return i$L.async}});Object.defineProperty(lH,"asyncScheduler",{enumerable:!0,get:function(){return i$L.asyncScheduler}});var n$L=peA();Object.defineProperty(lH,"queue",{enumerable:!0,get:function(){return n$L.queue}});Object.defineProperty(lH,"queueScheduler",{enumerable:!0,get:function(){return n$L.queueScheduler}});var r$L=ieA();Object.defineProperty(lH,"animationFrame",{enumerable:!0,get:function(){return r$L.animationFrame}});Object.defineProperty(lH,"animationFrameScheduler",{enumerable:!0,get:function(){return r$L.animationFrameScheduler}});var a$L=aeA();Object.defineProperty(lH,"VirtualTimeScheduler",{enumerable:!0,get:function(){return a$L.VirtualTimeScheduler}});Object.defineProperty(lH,"VirtualAction",{enumerable:!0,get:function(){return a$L.VirtualAction}});var LvB=Bv$();Object.defineProperty(lH,"Scheduler",{enumerable:!0,get:function(){return LvB.Scheduler}});var IvB=L2();Object.defineProperty(lH,"Subscription",{enumerable:!0,get:function(){return IvB.Subscription}});var DvB=pEH();Object.defineProperty(lH,"Subscriber",{enumerable:!0,get:function(){return DvB.Subscriber}});var o$L=KrH();Object.defineProperty(lH,"Notification",{enumerable:!0,get:function(){return o$L.Notification}});Object.defineProperty(lH,"NotificationKind",{enumerable:!0,get:function(){return o$L.NotificationKind}});var BvB=RCH();Object.defineProperty(lH,"pipe",{enumerable:!0,get:function(){return BvB.pipe}});var fvB=NW();Object.defineProperty(lH,"noop",{enumerable:!0,get:function(){return fvB.noop}});var EvB=OW();Object.defineProperty(lH,"identity",{enumerable:!0,get:function(){return EvB.identity}});var MvB=XHL();Object.defineProperty(lH,"isObservable",{enumerable:!0,get:function(){return MvB.isObservable}});var GvB=JHL();Object.defineProperty(lH,"lastValueFrom",{enumerable:!0,get:function(){return GvB.lastValueFrom}});var UvB=FHL();Object.defineProperty(lH,"firstValueFrom",{enumerable:!0,get:function(){return UvB.firstValueFrom}});var XvB=Yv$();Object.defineProperty(lH,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return XvB.ArgumentOutOfRangeError}});var JvB=ic();Object.defineProperty(lH,"EmptyError",{enumerable:!0,get:function(){return JvB.EmptyError}});var FvB=Cv$();Object.defineProperty(lH,"NotFoundError",{enumerable:!0,get:function(){return FvB.NotFoundError}});var KvB=Hv$();Object.defineProperty(lH,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return KvB.ObjectUnsubscribedError}});var QvB=wv$();Object.defineProperty(lH,"SequenceError",{enumerable:!0,get:function(){return QvB.SequenceError}});var WvB=kCH();Object.defineProperty(lH,"TimeoutError",{enumerable:!0,get:function(){return WvB.TimeoutError}});var VvB=py$();Object.defineProperty(lH,"UnsubscriptionError",{enumerable:!0,get:function(){return VvB.UnsubscriptionError}});var PvB=QHL();Object.defineProperty(lH,"bindCallback",{enumerable:!0,get:function(){return PvB.bindCallback}});var _vB=WHL();Object.defineProperty(lH,"bindNodeCallback",{enumerable:!0,get:function(){return _vB.bindNodeCallback}});var YvB=xrH();Object.defineProperty(lH,"combineLatest",{enumerable:!0,get:function(){return YvB.combineLatest}});var CvB=gCH();Object.defineProperty(lH,"concat",{enumerable:!0,get:function(){return CvB.concat}});var wvB=qHL();Object.defineProperty(lH,"connectable",{enumerable:!0,get:function(){return wvB.connectable}});var ZvB=mCH();Object.defineProperty(lH,"defer",{enumerable:!0,get:function(){return ZvB.defer}});var qvB=xN();Object.defineProperty(lH,"empty",{enumerable:!0,get:function(){return qvB.empty}});var TvB=THL();Object.defineProperty(lH,"forkJoin",{enumerable:!0,get:function(){return TvB.forkJoin}});var zvB=_k();Object.defineProperty(lH,"from",{enumerable:!0,get:function(){return zvB.from}});var NvB=NHL();Object.defineProperty(lH,"fromEvent",{enumerable:!0,get:function(){return NvB.fromEvent}});var OvB=xHL();Object.defineProperty(lH,"fromEventPattern",{enumerable:!0,get:function(){return OvB.fromEventPattern}});var xvB=jHL();Object.defineProperty(lH,"generate",{enumerable:!0,get:function(){return xvB.generate}});var SvB=RHL();Object.defineProperty(lH,"iif",{enumerable:!0,get:function(){return SvB.iif}});var jvB=Ov$();Object.defineProperty(lH,"interval",{enumerable:!0,get:function(){return jvB.interval}});var RvB=vHL();Object.defineProperty(lH,"merge",{enumerable:!0,get:function(){return RvB.merge}});var yvB=xv$();Object.defineProperty(lH,"never",{enumerable:!0,get:function(){return yvB.never}});var vvB=JrH();Object.defineProperty(lH,"of",{enumerable:!0,get:function(){return vvB.of}});var hvB=Sv$();Object.defineProperty(lH,"onErrorResumeNext",{enumerable:!0,get:function(){return hvB.onErrorResumeNext}});var bvB=bHL();Object.defineProperty(lH,"pairs",{enumerable:!0,get:function(){return bvB.pairs}});var kvB=gHL();Object.defineProperty(lH,"partition",{enumerable:!0,get:function(){return kvB.partition}});var uvB=Rv$();Object.defineProperty(lH,"race",{enumerable:!0,get:function(){return uvB.race}});var gvB=dHL();Object.defineProperty(lH,"range",{enumerable:!0,get:function(){return gvB.range}});var mvB=_v$();Object.defineProperty(lH,"throwError",{enumerable:!0,get:function(){return mvB.throwError}});var pvB=oc();Object.defineProperty(lH,"timer",{enumerable:!0,get:function(){return pvB.timer}});var dvB=cHL();Object.defineProperty(lH,"using",{enumerable:!0,get:function(){return dvB.using}});var cvB=erH();Object.defineProperty(lH,"zip",{enumerable:!0,get:function(){return cvB.zip}});var lvB=Pv$();Object.defineProperty(lH,"scheduled",{enumerable:!0,get:function(){return lvB.scheduled}});var ivB=xN();Object.defineProperty(lH,"EMPTY",{enumerable:!0,get:function(){return ivB.EMPTY}});var nvB=xv$();Object.defineProperty(lH,"NEVER",{enumerable:!0,get:function(){return nvB.NEVER}});ryB(iHL(),lH);var rvB=gEH();Object.defineProperty(lH,"config",{enumerable:!0,get:function(){return rvB.config}});var avB=$aH();Object.defineProperty(lH,"audit",{enumerable:!0,get:function(){return avB.audit}});var ovB=yv$();Object.defineProperty(lH,"auditTime",{enumerable:!0,get:function(){return ovB.auditTime}});var tvB=vv$();Object.defineProperty(lH,"buffer",{enumerable:!0,get:function(){return tvB.buffer}});var svB=bv$();Object.defineProperty(lH,"bufferCount",{enumerable:!0,get:function(){return svB.bufferCount}});var evB=kv$();Object.defineProperty(lH,"bufferTime",{enumerable:!0,get:function(){return evB.bufferTime}});var HhB=gv$();Object.defineProperty(lH,"bufferToggle",{enumerable:!0,get:function(){return HhB.bufferToggle}});var $hB=mv$();Object.defineProperty(lH,"bufferWhen",{enumerable:!0,get:function(){return $hB.bufferWhen}});var AhB=pv$();Object.defineProperty(lH,"catchError",{enumerable:!0,get:function(){return AhB.catchError}});var LhB=lv$();Object.defineProperty(lH,"combineAll",{enumerable:!0,get:function(){return LhB.combineAll}});var IhB=XaH();Object.defineProperty(lH,"combineLatestAll",{enumerable:!0,get:function(){return IhB.combineLatestAll}});var DhB=nv$();Object.defineProperty(lH,"combineLatestWith",{enumerable:!0,get:function(){return DhB.combineLatestWith}});var BhB=uCH();Object.defineProperty(lH,"concatAll",{enumerable:!0,get:function(){return BhB.concatAll}});var fhB=KaH();Object.defineProperty(lH,"concatMap",{enumerable:!0,get:function(){return fhB.concatMap}});var EhB=rv$();Object.defineProperty(lH,"concatMapTo",{enumerable:!0,get:function(){return EhB.concatMapTo}});var MhB=ov$();Object.defineProperty(lH,"concatWith",{enumerable:!0,get:function(){return MhB.concatWith}});var GhB=pCH();Object.defineProperty(lH,"connect",{enumerable:!0,get:function(){return GhB.connect}});var UhB=tv$();Object.defineProperty(lH,"count",{enumerable:!0,get:function(){return UhB.count}});var XhB=sv$();Object.defineProperty(lH,"debounce",{enumerable:!0,get:function(){return XhB.debounce}});var JhB=ev$();Object.defineProperty(lH,"debounceTime",{enumerable:!0,get:function(){return JhB.debounceTime}});var FhB=_MH();Object.defineProperty(lH,"defaultIfEmpty",{enumerable:!0,get:function(){return FhB.defaultIfEmpty}});var KhB=Hh$();Object.defineProperty(lH,"delay",{enumerable:!0,get:function(){return KhB.delay}});var QhB=OaH();Object.defineProperty(lH,"delayWhen",{enumerable:!0,get:function(){return QhB.delayWhen}});var WhB=$h$();Object.defineProperty(lH,"dematerialize",{enumerable:!0,get:function(){return WhB.dematerialize}});var VhB=Ah$();Object.defineProperty(lH,"distinct",{enumerable:!0,get:function(){return VhB.distinct}});var PhB=yaH();Object.defineProperty(lH,"distinctUntilChanged",{enumerable:!0,get:function(){return PhB.distinctUntilChanged}});var _hB=Lh$();Object.defineProperty(lH,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return _hB.distinctUntilKeyChanged}});var YhB=Ih$();Object.defineProperty(lH,"elementAt",{enumerable:!0,get:function(){return YhB.elementAt}});var ChB=Dh$();Object.defineProperty(lH,"endWith",{enumerable:!0,get:function(){return ChB.endWith}});var whB=Bh$();Object.defineProperty(lH,"every",{enumerable:!0,get:function(){return whB.every}});var ZhB=fh$();Object.defineProperty(lH,"exhaust",{enumerable:!0,get:function(){return ZhB.exhaust}});var qhB=paH();Object.defineProperty(lH,"exhaustAll",{enumerable:!0,get:function(){return qhB.exhaustAll}});var ThB=gaH();Object.defineProperty(lH,"exhaustMap",{enumerable:!0,get:function(){return ThB.exhaustMap}});var zhB=Eh$();Object.defineProperty(lH,"expand",{enumerable:!0,get:function(){return zhB.expand}});var NhB=wk();Object.defineProperty(lH,"filter",{enumerable:!0,get:function(){return NhB.filter}});var OhB=Mh$();Object.defineProperty(lH,"finalize",{enumerable:!0,get:function(){return OhB.finalize}});var xhB=iaH();Object.defineProperty(lH,"find",{enumerable:!0,get:function(){return xhB.find}});var ShB=Gh$();Object.defineProperty(lH,"findIndex",{enumerable:!0,get:function(){return ShB.findIndex}});var jhB=Uh$();Object.defineProperty(lH,"first",{enumerable:!0,get:function(){return jhB.first}});var RhB=Xh$();Object.defineProperty(lH,"groupBy",{enumerable:!0,get:function(){return RhB.groupBy}});var yhB=qaH();Object.defineProperty(lH,"ignoreElements",{enumerable:!0,get:function(){return yhB.ignoreElements}});var vhB=Jh$();Object.defineProperty(lH,"isEmpty",{enumerable:!0,get:function(){return vhB.isEmpty}});var hhB=Fh$();Object.defineProperty(lH,"last",{enumerable:!0,get:function(){return hhB.last}});var bhB=Ck();Object.defineProperty(lH,"map",{enumerable:!0,get:function(){return bhB.map}});var khB=zaH();Object.defineProperty(lH,"mapTo",{enumerable:!0,get:function(){return khB.mapTo}});var uhB=Qh$();Object.defineProperty(lH,"materialize",{enumerable:!0,get:function(){return uhB.materialize}});var ghB=Wh$();Object.defineProperty(lH,"max",{enumerable:!0,get:function(){return ghB.max}});var mhB=JMH();Object.defineProperty(lH,"mergeAll",{enumerable:!0,get:function(){return mhB.mergeAll}});var phB=Vh$();Object.defineProperty(lH,"flatMap",{enumerable:!0,get:function(){return phB.flatMap}});var dhB=QR();Object.defineProperty(lH,"mergeMap",{enumerable:!0,get:function(){return dhB.mergeMap}});var chB=Ph$();Object.defineProperty(lH,"mergeMapTo",{enumerable:!0,get:function(){return chB.mergeMapTo}});var lhB=_h$();Object.defineProperty(lH,"mergeScan",{enumerable:!0,get:function(){return lhB.mergeScan}});var ihB=Ch$();Object.defineProperty(lH,"mergeWith",{enumerable:!0,get:function(){return ihB.mergeWith}});var nhB=wh$();Object.defineProperty(lH,"min",{enumerable:!0,get:function(){return nhB.min}});var rhB=dCH();Object.defineProperty(lH,"multicast",{enumerable:!0,get:function(){return rhB.multicast}});var ahB=GMH();Object.defineProperty(lH,"observeOn",{enumerable:!0,get:function(){return ahB.observeOn}});var ohB=Zh$();Object.defineProperty(lH,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ohB.onErrorResumeNextWith}});var thB=qh$();Object.defineProperty(lH,"pairwise",{enumerable:!0,get:function(){return thB.pairwise}});var shB=Th$();Object.defineProperty(lH,"pluck",{enumerable:!0,get:function(){return shB.pluck}});var ehB=zh$();Object.defineProperty(lH,"publish",{enumerable:!0,get:function(){return ehB.publish}});var HbB=Nh$();Object.defineProperty(lH,"publishBehavior",{enumerable:!0,get:function(){return HbB.publishBehavior}});var $bB=Oh$();Object.defineProperty(lH,"publishLast",{enumerable:!0,get:function(){return $bB.publishLast}});var AbB=xh$();Object.defineProperty(lH,"publishReplay",{enumerable:!0,get:function(){return AbB.publishReplay}});var LbB=XoH();Object.defineProperty(lH,"raceWith",{enumerable:!0,get:function(){return LbB.raceWith}});var IbB=I$H();Object.defineProperty(lH,"reduce",{enumerable:!0,get:function(){return IbB.reduce}});var DbB=Sh$();Object.defineProperty(lH,"repeat",{enumerable:!0,get:function(){return DbB.repeat}});var BbB=jh$();Object.defineProperty(lH,"repeatWhen",{enumerable:!0,get:function(){return BbB.repeatWhen}});var fbB=Rh$();Object.defineProperty(lH,"retry",{enumerable:!0,get:function(){return fbB.retry}});var EbB=yh$();Object.defineProperty(lH,"retryWhen",{enumerable:!0,get:function(){return EbB.retryWhen}});var MbB=knH();Object.defineProperty(lH,"refCount",{enumerable:!0,get:function(){return MbB.refCount}});var GbB=VoH();Object.defineProperty(lH,"sample",{enumerable:!0,get:function(){return GbB.sample}});var UbB=vh$();Object.defineProperty(lH,"sampleTime",{enumerable:!0,get:function(){return UbB.sampleTime}});var XbB=hh$();Object.defineProperty(lH,"scan",{enumerable:!0,get:function(){return XbB.scan}});var JbB=bh$();Object.defineProperty(lH,"sequenceEqual",{enumerable:!0,get:function(){return JbB.sequenceEqual}});var FbB=CoH();Object.defineProperty(lH,"share",{enumerable:!0,get:function(){return FbB.share}});var KbB=uh$();Object.defineProperty(lH,"shareReplay",{enumerable:!0,get:function(){return KbB.shareReplay}});var QbB=gh$();Object.defineProperty(lH,"single",{enumerable:!0,get:function(){return QbB.single}});var WbB=mh$();Object.defineProperty(lH,"skip",{enumerable:!0,get:function(){return WbB.skip}});var VbB=ph$();Object.defineProperty(lH,"skipLast",{enumerable:!0,get:function(){return VbB.skipLast}});var PbB=dh$();Object.defineProperty(lH,"skipUntil",{enumerable:!0,get:function(){return PbB.skipUntil}});var _bB=ch$();Object.defineProperty(lH,"skipWhile",{enumerable:!0,get:function(){return _bB.skipWhile}});var YbB=lh$();Object.defineProperty(lH,"startWith",{enumerable:!0,get:function(){return YbB.startWith}});var CbB=UMH();Object.defineProperty(lH,"subscribeOn",{enumerable:!0,get:function(){return CbB.subscribeOn}});var wbB=ih$();Object.defineProperty(lH,"switchAll",{enumerable:!0,get:function(){return wbB.switchAll}});var ZbB=qMH();Object.defineProperty(lH,"switchMap",{enumerable:!0,get:function(){return ZbB.switchMap}});var qbB=nh$();Object.defineProperty(lH,"switchMapTo",{enumerable:!0,get:function(){return qbB.switchMapTo}});var TbB=rh$();Object.defineProperty(lH,"switchScan",{enumerable:!0,get:function(){return TbB.switchScan}});var zbB=YMH();Object.defineProperty(lH,"take",{enumerable:!0,get:function(){return zbB.take}});var NbB=taH();Object.defineProperty(lH,"takeLast",{enumerable:!0,get:function(){return NbB.takeLast}});var ObB=ah$();Object.defineProperty(lH,"takeUntil",{enumerable:!0,get:function(){return ObB.takeUntil}});var xbB=oh$();Object.defineProperty(lH,"takeWhile",{enumerable:!0,get:function(){return xbB.takeWhile}});var SbB=th$();Object.defineProperty(lH,"tap",{enumerable:!0,get:function(){return SbB.tap}});var jbB=koH();Object.defineProperty(lH,"throttle",{enumerable:!0,get:function(){return jbB.throttle}});var RbB=sh$();Object.defineProperty(lH,"throttleTime",{enumerable:!0,get:function(){return RbB.throttleTime}});var ybB=CMH();Object.defineProperty(lH,"throwIfEmpty",{enumerable:!0,get:function(){return ybB.throwIfEmpty}});var vbB=eh$();Object.defineProperty(lH,"timeInterval",{enumerable:!0,get:function(){return vbB.timeInterval}});var hbB=kCH();Object.defineProperty(lH,"timeout",{enumerable:!0,get:function(){return hbB.timeout}});var bbB=Hb$();Object.defineProperty(lH,"timeoutWith",{enumerable:!0,get:function(){return bbB.timeoutWith}});var kbB=$b$();Object.defineProperty(lH,"timestamp",{enumerable:!0,get:function(){return kbB.timestamp}});var ubB=MaH();Object.defineProperty(lH,"toArray",{enumerable:!0,get:function(){return ubB.toArray}});var gbB=Ab$();Object.defineProperty(lH,"window",{enumerable:!0,get:function(){return gbB.window}});var mbB=Lb$();Object.defineProperty(lH,"windowCount",{enumerable:!0,get:function(){return mbB.windowCount}});var pbB=Ib$();Object.defineProperty(lH,"windowTime",{enumerable:!0,get:function(){return pbB.windowTime}});var dbB=Bb$();Object.defineProperty(lH,"windowToggle",{enumerable:!0,get:function(){return dbB.windowToggle}});var cbB=fb$();Object.defineProperty(lH,"windowWhen",{enumerable:!0,get:function(){return cbB.windowWhen}});var lbB=Eb$();Object.defineProperty(lH,"withLatestFrom",{enumerable:!0,get:function(){return lbB.withLatestFrom}});var ibB=Mb$();Object.defineProperty(lH,"zipAll",{enumerable:!0,get:function(){return ibB.zipAll}});var nbB=Ub$();Object.defineProperty(lH,"zipWith",{enumerable:!0,get:function(){return nbB.zipWith}})});var e$L=z((ioH)=>{Object.defineProperty(ioH,"__esModule",{value:!0});ioH.partition=void 0;var rbB=jv$(),s$L=wk();function abB(H,$){return function(A){return[s$L.filter(H,$)(A),s$L.filter(rbB.not(H,$))(A)]}}ioH.partition=abB});var HAL=z((Gl)=>{var obB=Gl&&Gl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},tbB=Gl&&Gl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(V$,"__esModule",{value:!0});V$.mergeAll=V$.merge=V$.max=V$.materialize=V$.mapTo=V$.map=V$.last=V$.isEmpty=V$.ignoreElements=V$.groupBy=V$.first=V$.findIndex=V$.find=V$.finalize=V$.filter=V$.expand=V$.exhaustMap=V$.exhaustAll=V$.exhaust=V$.every=V$.endWith=V$.elementAt=V$.distinctUntilKeyChanged=V$.distinctUntilChanged=V$.distinct=V$.dematerialize=V$.delayWhen=V$.delay=V$.defaultIfEmpty=V$.debounceTime=V$.debounce=V$.count=V$.connect=V$.concatWith=V$.concatMapTo=V$.concatMap=V$.concatAll=V$.concat=V$.combineLatestWith=V$.combineLatest=V$.combineLatestAll=V$.combineAll=V$.catchError=V$.bufferWhen=V$.bufferToggle=V$.bufferTime=V$.bufferCount=V$.buffer=V$.auditTime=V$.audit=void 0;V$.timeInterval=V$.throwIfEmpty=V$.throttleTime=V$.throttle=V$.tap=V$.takeWhile=V$.takeUntil=V$.takeLast=V$.take=V$.switchScan=V$.switchMapTo=V$.switchMap=V$.switchAll=V$.subscribeOn=V$.startWith=V$.skipWhile=V$.skipUntil=V$.skipLast=V$.skip=V$.single=V$.shareReplay=V$.share=V$.sequenceEqual=V$.scan=V$.sampleTime=V$.sample=V$.refCount=V$.retryWhen=V$.retry=V$.repeatWhen=V$.repeat=V$.reduce=V$.raceWith=V$.race=V$.publishReplay=V$.publishLast=V$.publishBehavior=V$.publish=V$.pluck=V$.partition=V$.pairwise=V$.onErrorResumeNext=V$.observeOn=V$.multicast=V$.min=V$.mergeWith=V$.mergeScan=V$.mergeMapTo=V$.mergeMap=V$.flatMap=void 0;V$.zipWith=V$.zipAll=V$.zip=V$.withLatestFrom=V$.windowWhen=V$.windowToggle=V$.windowTime=V$.windowCount=V$.window=V$.toArray=V$.timestamp=V$.timeoutWith=V$.timeout=void 0;var $kB=$aH();Object.defineProperty(V$,"audit",{enumerable:!0,get:function(){return $kB.audit}});var AkB=yv$();Object.defineProperty(V$,"auditTime",{enumerable:!0,get:function(){return AkB.auditTime}});var LkB=vv$();Object.defineProperty(V$,"buffer",{enumerable:!0,get:function(){return LkB.buffer}});var IkB=bv$();Object.defineProperty(V$,"bufferCount",{enumerable:!0,get:function(){return IkB.bufferCount}});var DkB=kv$();Object.defineProperty(V$,"bufferTime",{enumerable:!0,get:function(){return DkB.bufferTime}});var BkB=gv$();Object.defineProperty(V$,"bufferToggle",{enumerable:!0,get:function(){return BkB.bufferToggle}});var fkB=mv$();Object.defineProperty(V$,"bufferWhen",{enumerable:!0,get:function(){return fkB.bufferWhen}});var EkB=pv$();Object.defineProperty(V$,"catchError",{enumerable:!0,get:function(){return EkB.catchError}});var MkB=lv$();Object.defineProperty(V$,"combineAll",{enumerable:!0,get:function(){return MkB.combineAll}});var GkB=XaH();Object.defineProperty(V$,"combineLatestAll",{enumerable:!0,get:function(){return GkB.combineLatestAll}});var UkB=iv$();Object.defineProperty(V$,"combineLatest",{enumerable:!0,get:function(){return UkB.combineLatest}});var XkB=nv$();Object.defineProperty(V$,"combineLatestWith",{enumerable:!0,get:function(){return XkB.combineLatestWith}});var JkB=av$();Object.defineProperty(V$,"concat",{enumerable:!0,get:function(){return JkB.concat}});var FkB=uCH();Object.defineProperty(V$,"concatAll",{enumerable:!0,get:function(){return FkB.concatAll}});var KkB=KaH();Object.defineProperty(V$,"concatMap",{enumerable:!0,get:function(){return KkB.concatMap}});var QkB=rv$();Object.defineProperty(V$,"concatMapTo",{enumerable:!0,get:function(){return QkB.concatMapTo}});var WkB=ov$();Object.defineProperty(V$,"concatWith",{enumerable:!0,get:function(){return WkB.concatWith}});var VkB=pCH();Object.defineProperty(V$,"connect",{enumerable:!0,get:function(){return VkB.connect}});var PkB=tv$();Object.defineProperty(V$,"count",{enumerable:!0,get:function(){return PkB.count}});var _kB=sv$();Object.defineProperty(V$,"debounce",{enumerable:!0,get:function(){return _kB.debounce}});var YkB=ev$();Object.defineProperty(V$,"debounceTime",{enumerable:!0,get:function(){return YkB.debounceTime}});var CkB=_MH();Object.defineProperty(V$,"defaultIfEmpty",{enumerable:!0,get:function(){return CkB.defaultIfEmpty}});var wkB=Hh$();Object.defineProperty(V$,"delay",{enumerable:!0,get:function(){return wkB.delay}});var ZkB=OaH();Object.defineProperty(V$,"delayWhen",{enumerable:!0,get:function(){return ZkB.delayWhen}});var qkB=$h$();Object.defineProperty(V$,"dematerialize",{enumerable:!0,get:function(){return qkB.dematerialize}});var TkB=Ah$();Object.defineProperty(V$,"distinct",{enumerable:!0,get:function(){return TkB.distinct}});var zkB=yaH();Object.defineProperty(V$,"distinctUntilChanged",{enumerable:!0,get:function(){return zkB.distinctUntilChanged}});var NkB=Lh$();Object.defineProperty(V$,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return NkB.distinctUntilKeyChanged}});var OkB=Ih$();Object.defineProperty(V$,"elementAt",{enumerable:!0,get:function(){return OkB.elementAt}});var xkB=Dh$();Object.defineProperty(V$,"endWith",{enumerable:!0,get:function(){return xkB.endWith}});var SkB=Bh$();Object.defineProperty(V$,"every",{enumerable:!0,get:function(){return SkB.every}});var jkB=fh$();Object.defineProperty(V$,"exhaust",{enumerable:!0,get:function(){return jkB.exhaust}});var RkB=paH();Object.defineProperty(V$,"exhaustAll",{enumerable:!0,get:function(){return RkB.exhaustAll}});var ykB=gaH();Object.defineProperty(V$,"exhaustMap",{enumerable:!0,get:function(){return ykB.exhaustMap}});var vkB=Eh$();Object.defineProperty(V$,"expand",{enumerable:!0,get:function(){return vkB.expand}});var hkB=wk();Object.defineProperty(V$,"filter",{enumerable:!0,get:function(){return hkB.filter}});var bkB=Mh$();Object.defineProperty(V$,"finalize",{enumerable:!0,get:function(){return bkB.finalize}});var kkB=iaH();Object.defineProperty(V$,"find",{enumerable:!0,get:function(){return kkB.find}});var ukB=Gh$();Object.defineProperty(V$,"findIndex",{enumerable:!0,get:function(){return ukB.findIndex}});var gkB=Uh$();Object.defineProperty(V$,"first",{enumerable:!0,get:function(){return gkB.first}});var mkB=Xh$();Object.defineProperty(V$,"groupBy",{enumerable:!0,get:function(){return mkB.groupBy}});var pkB=qaH();Object.defineProperty(V$,"ignoreElements",{enumerable:!0,get:function(){return pkB.ignoreElements}});var dkB=Jh$();Object.defineProperty(V$,"isEmpty",{enumerable:!0,get:function(){return dkB.isEmpty}});var ckB=Fh$();Object.defineProperty(V$,"last",{enumerable:!0,get:function(){return ckB.last}});var lkB=Ck();Object.defineProperty(V$,"map",{enumerable:!0,get:function(){return lkB.map}});var ikB=zaH();Object.defineProperty(V$,"mapTo",{enumerable:!0,get:function(){return ikB.mapTo}});var nkB=Qh$();Object.defineProperty(V$,"materialize",{enumerable:!0,get:function(){return nkB.materialize}});var rkB=Wh$();Object.defineProperty(V$,"max",{enumerable:!0,get:function(){return rkB.max}});var akB=Yh$();Object.defineProperty(V$,"merge",{enumerable:!0,get:function(){return akB.merge}});var okB=JMH();Object.defineProperty(V$,"mergeAll",{enumerable:!0,get:function(){return okB.mergeAll}});var tkB=Vh$();Object.defineProperty(V$,"flatMap",{enumerable:!0,get:function(){return tkB.flatMap}});var skB=QR();Object.defineProperty(V$,"mergeMap",{enumerable:!0,get:function(){return skB.mergeMap}});var ekB=Ph$();Object.defineProperty(V$,"mergeMapTo",{enumerable:!0,get:function(){return ekB.mergeMapTo}});var HuB=_h$();Object.defineProperty(V$,"mergeScan",{enumerable:!0,get:function(){return HuB.mergeScan}});var $uB=Ch$();Object.defineProperty(V$,"mergeWith",{enumerable:!0,get:function(){return $uB.mergeWith}});var AuB=wh$();Object.defineProperty(V$,"min",{enumerable:!0,get:function(){return AuB.min}});var LuB=dCH();Object.defineProperty(V$,"multicast",{enumerable:!0,get:function(){return LuB.multicast}});var IuB=GMH();Object.defineProperty(V$,"observeOn",{enumerable:!0,get:function(){return IuB.observeOn}});var DuB=Zh$();Object.defineProperty(V$,"onErrorResumeNext",{enumerable:!0,get:function(){return DuB.onErrorResumeNext}});var BuB=qh$();Object.defineProperty(V$,"pairwise",{enumerable:!0,get:function(){return BuB.pairwise}});var fuB=e$L();Object.defineProperty(V$,"partition",{enumerable:!0,get:function(){return fuB.partition}});var EuB=Th$();Object.defineProperty(V$,"pluck",{enumerable:!0,get:function(){return EuB.pluck}});var MuB=zh$();Object.defineProperty(V$,"publish",{enumerable:!0,get:function(){return MuB.publish}});var GuB=Nh$();Object.defineProperty(V$,"publishBehavior",{enumerable:!0,get:function(){return GuB.publishBehavior}});var UuB=Oh$();Object.defineProperty(V$,"publishLast",{enumerable:!0,get:function(){return UuB.publishLast}});var XuB=xh$();Object.defineProperty(V$,"publishReplay",{enumerable:!0,get:function(){return XuB.publishReplay}});var JuB=HAL();Object.defineProperty(V$,"race",{enumerable:!0,get:function(){return JuB.race}});var FuB=XoH();Object.defineProperty(V$,"raceWith",{enumerable:!0,get:function(){return FuB.raceWith}});var KuB=I$H();Object.defineProperty(V$,"reduce",{enumerable:!0,get:function(){return KuB.reduce}});var QuB=Sh$();Object.defineProperty(V$,"repeat",{enumerable:!0,get:function(){return QuB.repeat}});var WuB=jh$();Object.defineProperty(V$,"repeatWhen",{enumerable:!0,get:function(){return WuB.repeatWhen}});var VuB=Rh$();Object.defineProperty(V$,"retry",{enumerable:!0,get:function(){return VuB.retry}});var PuB=yh$();Object.defineProperty(V$,"retryWhen",{enumerable:!0,get:function(){return PuB.retryWhen}});var _uB=knH();Object.defineProperty(V$,"refCount",{enumerable:!0,get:function(){return _uB.refCount}});var YuB=VoH();Object.defineProperty(V$,"sample",{enumerable:!0,get:function(){return YuB.sample}});var CuB=vh$();Object.defineProperty(V$,"sampleTime",{enumerable:!0,get:function(){return CuB.sampleTime}});var wuB=hh$();Object.defineProperty(V$,"scan",{enumerable:!0,get:function(){return wuB.scan}});var ZuB=bh$();Object.defineProperty(V$,"sequenceEqual",{enumerable:!0,get:function(){return ZuB.sequenceEqual}});var quB=CoH();Object.defineProperty(V$,"share",{enumerable:!0,get:function(){return quB.share}});var TuB=uh$();Object.defineProperty(V$,"shareReplay",{enumerable:!0,get:function(){return TuB.shareReplay}});var zuB=gh$();Object.defineProperty(V$,"single",{enumerable:!0,get:function(){return zuB.single}});var NuB=mh$();Object.defineProperty(V$,"skip",{enumerable:!0,get:function(){return NuB.skip}});var OuB=ph$();Object.defineProperty(V$,"skipLast",{enumerable:!0,get:function(){return OuB.skipLast}});var xuB=dh$();Object.defineProperty(V$,"skipUntil",{enumerable:!0,get:function(){return xuB.skipUntil}});var SuB=ch$();Object.defineProperty(V$,"skipWhile",{enumerable:!0,get:function(){return SuB.skipWhile}});var juB=lh$();Object.defineProperty(V$,"startWith",{enumerable:!0,get:function(){return juB.startWith}});var RuB=UMH();Object.defineProperty(V$,"subscribeOn",{enumerable:!0,get:function(){return RuB.subscribeOn}});var yuB=ih$();Object.defineProperty(V$,"switchAll",{enumerable:!0,get:function(){return yuB.switchAll}});var vuB=qMH();Object.defineProperty(V$,"switchMap",{enumerable:!0,get:function(){return vuB.switchMap}});var huB=nh$();Object.defineProperty(V$,"switchMapTo",{enumerable:!0,get:function(){return huB.switchMapTo}});var buB=rh$();Object.defineProperty(V$,"switchScan",{enumerable:!0,get:function(){return buB.switchScan}});var kuB=YMH();Object.defineProperty(V$,"take",{enumerable:!0,get:function(){return kuB.take}});var uuB=taH();Object.defineProperty(V$,"takeLast",{enumerable:!0,get:function(){return uuB.takeLast}});var guB=ah$();Object.defineProperty(V$,"takeUntil",{enumerable:!0,get:function(){return guB.takeUntil}});var muB=oh$();Object.defineProperty(V$,"takeWhile",{enumerable:!0,get:function(){return muB.takeWhile}});var puB=th$();Object.defineProperty(V$,"tap",{enumerable:!0,get:function(){return puB.tap}});var duB=koH();Object.defineProperty(V$,"throttle",{enumerable:!0,get:function(){return duB.throttle}});var cuB=sh$();Object.defineProperty(V$,"throttleTime",{enumerable:!0,get:function(){return cuB.throttleTime}});var luB=CMH();Object.defineProperty(V$,"throwIfEmpty",{enumerable:!0,get:function(){return luB.throwIfEmpty}});var iuB=eh$();Object.defineProperty(V$,"timeInterval",{enumerable:!0,get:function(){return iuB.timeInterval}});var nuB=kCH();Object.defineProperty(V$,"timeout",{enumerable:!0,get:function(){return nuB.timeout}});var ruB=Hb$();Object.defineProperty(V$,"timeoutWith",{enumerable:!0,get:function(){return ruB.timeoutWith}});var auB=$b$();Object.defineProperty(V$,"timestamp",{enumerable:!0,get:function(){return auB.timestamp}});var ouB=MaH();Object.defineProperty(V$,"toArray",{enumerable:!0,get:function(){return ouB.toArray}});var tuB=Ab$();Object.defineProperty(V$,"window",{enumerable:!0,get:function(){return tuB.window}});var suB=Lb$();Object.defineProperty(V$,"windowCount",{enumerable:!0,get:function(){return suB.windowCount}});var euB=Ib$();Object.defineProperty(V$,"windowTime",{enumerable:!0,get:function(){return euB.windowTime}});var HgB=Bb$();Object.defineProperty(V$,"windowToggle",{enumerable:!0,get:function(){return HgB.windowToggle}});var $gB=fb$();Object.defineProperty(V$,"windowWhen",{enumerable:!0,get:function(){return $gB.windowWhen}});var AgB=Eb$();Object.defineProperty(V$,"withLatestFrom",{enumerable:!0,get:function(){return AgB.withLatestFrom}});var LgB=Gb$();Object.defineProperty(V$,"zip",{enumerable:!0,get:function(){return LgB.zip}});var IgB=Mb$();Object.defineProperty(V$,"zipAll",{enumerable:!0,get:function(){return IgB.zipAll}});var DgB=Ub$();Object.defineProperty(V$,"zipWith",{enumerable:!0,get:function(){return DgB.zipWith}})});var Jb$=z((I2)=>{var __dirname="/home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/spawn-rx/lib/src",lZ=I2&&I2.__assign||function(){return lZ=Object.assign||function(H){for(var $,A=1,L=arguments.length;A>")}I.next({source:Y,text:q})}},Q=new Ul.Subscription;if(A.stdin)if(J.stdin)Q.add(A.stdin.subscribe({next:function(Y){return J.stdin.write(Y)},error:I.error.bind(I),complete:function(){return J.stdin.end()}}));else I.error(Error("opts.stdio conflicts with provided spawn opts.stdin observable, 'pipe' is required"));var W=null,P=null,C=!1;if(J.stdout)P=new Ul.AsyncSubject,J.stdout.on("data",F("stdout")),J.stdout.on("close",function(){P.next(!0),P.complete()});else P=(0,Ul.of)(!0);if(J.stderr)W=new Ul.AsyncSubject,J.stderr.on("data",F("stderr")),J.stderr.on("close",function(){W.next(!0),W.complete()});else W=(0,Ul.of)(!0);return J.on("error",function(Y){C=!0,I.error(Y)}),J.on("close",function(Y){C=!0;var Z=(0,Ul.merge)(P,W).pipe((0,AAL.reduce)(function(q){return q},!0));if(Y===0)Z.subscribe(function(){return I.complete()});else Z.subscribe(function(){var q=Error("Failed with exit code: ".concat(Y));q.exitCode=Y,q.code=Y,I.error(q)})}),Q.add(new Ul.Subscription(function(){if(C)return;if(OMH("Killing process: ".concat(U," ").concat(X.join())),A.jobber)EgB.connect("\\\\.\\pipe\\jobber-".concat(J.pid)),setTimeout(function(){return J.kill()},5000);else J.kill()})),Q});return A.split?L:L.pipe((0,AAL.map)(function(I){return I===null||I===void 0?void 0:I.text}))}function BAL(H){return new Promise(function($,A){var L="";H.subscribe({next:function(I){return L+=I},error:function(I){var D=Error("".concat(L,` `).concat(D.message));if("exitCode"in D)B.exitCode=D.exitCode,B.code=D.exitCode,B.stdout=L,B.stderr=I;A(B)},complete:function(){return $([L,I])}})})}function UgB(H,$,A){if(A===null||A===void 0?void 0:A.split)return fAL(Xb$(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!0})));else return BAL(Xb$(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!1})))}function XgB(H,$,A){if(A===null||A===void 0?void 0:A.split)return fAL(iCH(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!0})));else return BAL(iCH(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!1})))}});function nD(H=JgB){let $=new AbortController;return EAL.setMaxListeners(H,$.signal),$}function FgB(H){let $=this.deref();H.deref()?.abort($?.signal.reason)}function KgB(H){let $=this.deref(),A=H.deref();if($&&A)$.signal.removeEventListener("abort",A)}function D$H(H,$){let A=nD($);if(H.signal.aborted)return A.abort(H.signal.reason),A;let L=new WeakRef(A),I=new WeakRef(H),D=FgB.bind(I,L);return H.signal.addEventListener("abort",D,{once:!0}),A.signal.addEventListener("abort",KgB.bind(I,new WeakRef(D)),{once:!0}),A}var EAL,JgB=50;var eE=K(()=>{EAL=require("events")});function xMH(){return!0}function U8(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}function GAL(){return"prod"}function UAL(){if(process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL)return"-custom-oauth";switch(GAL()){case"local":return"-local-oauth";case"staging":return"-staging-oauth";case"prod":return""}}function XD(){let H=(()=>{switch(GAL()){case"local":return PgB;case"staging":return VgB??MAL;case"prod":return MAL}})(),$=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if($){let L=$.replace(/\/$/,"");if(!_gB.includes(L))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");H={...H,BASE_API_URL:L,CONSOLE_AUTHORIZE_URL:`${L}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${L}/oauth/authorize`,TOKEN_URL:`${L}/v1/oauth/token`,API_KEY_URL:`${L}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${L}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${L}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${L}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${L}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let A=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;if(A)H={...H,CLIENT_ID:A};return H}var VR="user:inference",QgB="org:create_api_key",N_="oauth-2025-04-20",WgB,Fb$,XAL,MAL,VgB=void 0,PgB,_gB;var qE=K(()=>{NA();WgB=[QgB,"user:profile"],Fb$=["user:profile",VR,"user:sessions:claude_code","user:mcp_servers"],XAL=Array.from(new Set([...WgB,...Fb$])),MAL={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.ai/oauth/authorize",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},PgB={BASE_API_URL:"http://localhost:3000",CONSOLE_AUTHORIZE_URL:"http://localhost:3000/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"http://localhost:4000/oauth/authorize",TOKEN_URL:"http://localhost:3000/v1/oauth/token",API_KEY_URL:"http://localhost:3000/api/oauth/claude_cli/create_api_key",ROLES_URL:"http://localhost:3000/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"http://localhost:3000/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"http://localhost:3000/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://console.staging.ant.dev/oauth/code/callback",CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"},_gB=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"]});var WAL=z((Q$8,QAL)=>{QAL.exports=KAL;KAL.sync=CgB;var JAL=require("fs");function YgB(H,$){var A=$.pathExt!==void 0?$.pathExt:process.env.PATHEXT;if(!A)return!0;if(A=A.split(";"),A.indexOf("")!==-1)return!0;for(var L=0;L{YAL.exports=PAL;PAL.sync=wgB;var VAL=require("fs");function PAL(H,$,A){VAL.stat(H,function(L,I){A(L,L?!1:_AL(I,$))})}function wgB(H,$){return _AL(VAL.statSync(H),$)}function _AL(H,$){return H.isFile()&&ZgB(H,$)}function ZgB(H,$){var{mode:A,uid:L,gid:I}=H,D=$.uid!==void 0?$.uid:process.getuid&&process.getuid(),B=$.gid!==void 0?$.gid:process.getgid&&process.getgid(),f=parseInt("100",8),E=parseInt("010",8),M=parseInt("001",8),G=f|E,U=A&M||A&E&&I===B||A&f&&L===D||A&G&&D===0;return U}});var ZAL=z((P$8,wAL)=>{var V$8=require("fs"),roH;if(global.TESTING_WINDOWS)roH=WAL();else roH=CAL();wAL.exports=Kb$;Kb$.sync=qgB;function Kb$(H,$,A){if(typeof $==="function")A=$,$={};if(!A){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(L,I){Kb$(H,$||{},function(D,B){if(D)I(D);else L(B)})})}roH(H,$||{},function(L,I){if(L){if(L.code==="EACCES"||$&&$.ignoreErrors)L=null,I=!1}A(L,I)})}function qgB(H,$){try{return roH.sync(H,$||{})}catch(A){if($&&$.ignoreErrors||A.code==="EACCES")return!1;else throw A}}});var SAL=z((_$8,xAL)=>{var SMH=process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",qAL=require("path"),TgB=SMH?";":":",TAL=ZAL(),zAL=(H)=>Object.assign(Error(`not found: ${H}`),{code:"ENOENT"}),NAL=(H,$)=>{let A=$.colon||TgB,L=H.match(/\//)||SMH&&H.match(/\\/)?[""]:[...SMH?[process.cwd()]:[],...($.path||process.env.PATH||"").split(A)],I=SMH?$.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",D=SMH?I.split(A):[""];if(SMH){if(H.indexOf(".")!==-1&&D[0]!=="")D.unshift("")}return{pathEnv:L,pathExt:D,pathExtExe:I}},OAL=(H,$,A)=>{if(typeof $==="function")A=$,$={};if(!$)$={};let{pathEnv:L,pathExt:I,pathExtExe:D}=NAL(H,$),B=[],f=(M)=>new Promise((G,U)=>{if(M===L.length)return $.all&&B.length?G(B):U(zAL(H));let X=L[M],J=/^".*"$/.test(X)?X.slice(1,-1):X,F=qAL.join(J,H),Q=!J&&/^\.[\\\/]/.test(H)?H.slice(0,2)+F:F;G(E(Q,M,0))}),E=(M,G,U)=>new Promise((X,J)=>{if(U===I.length)return X(f(G+1));let F=I[U];TAL(M+F,{pathExt:D},(Q,W)=>{if(!Q&&W)if($.all)B.push(M+F);else return X(M+F);return X(E(M,G,U+1))})});return A?f(0).then((M)=>A(null,M),A):f(0)},zgB=(H,$)=>{$=$||{};let{pathEnv:A,pathExt:L,pathExtExe:I}=NAL(H,$),D=[];for(let B=0;B{var jAL=(H={})=>{let $=H.env||process.env;if((H.platform||"linux")!=="win32")return"PATH";return Object.keys($).reverse().find((L)=>L.toUpperCase()==="PATH")||"Path"};Qb$.exports=jAL;Qb$.exports.default=jAL});var bAL=z((C$8,hAL)=>{var yAL=require("path"),NgB=SAL(),OgB=RAL();function vAL(H,$){let A=H.options.env||process.env,L=process.cwd(),I=H.options.cwd!=null,D=I&&process.chdir!==void 0&&!process.chdir.disabled;if(D)try{process.chdir(H.options.cwd)}catch(f){}let B;try{B=NgB.sync(H.command,{path:A[OgB({env:A})],pathExt:$?yAL.delimiter:void 0})}catch(f){}finally{if(D)process.chdir(L)}if(B)B=yAL.resolve(I?H.options.cwd:"",B);return B}function xgB(H){return vAL(H)||vAL(H,!0)}hAL.exports=xgB});var kAL=z((w$8,Vb$)=>{var Wb$=/([()\][%!^"`<>&|;, *?])/g;function SgB(H){return H=H.replace(Wb$,"^$1"),H}function jgB(H,$){if(H=`${H}`,H=H.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),H=H.replace(/(?=(\\+?)?)\1$/,"$1$1"),H=`"${H}"`,H=H.replace(Wb$,"^$1"),$)H=H.replace(Wb$,"^$1");return H}Vb$.exports.command=SgB;Vb$.exports.argument=jgB});var gAL=z((Z$8,uAL)=>{uAL.exports=/^#!(.*)/});var pAL=z((q$8,mAL)=>{var RgB=gAL();mAL.exports=(H="")=>{let $=H.match(RgB);if(!$)return null;let[A,L]=$[0].replace(/#! ?/,"").split(" "),I=A.split("/").pop();if(I==="env")return L;return L?`${I} ${L}`:I}});var cAL=z((T$8,dAL)=>{var Pb$=require("fs"),ygB=pAL();function vgB(H){let A=Buffer.alloc(150),L;try{L=Pb$.openSync(H,"r"),Pb$.readSync(L,A,0,150,0),Pb$.closeSync(L)}catch(I){}return ygB(A.toString())}dAL.exports=vgB});var rAL=z((z$8,nAL)=>{var hgB=require("path"),lAL=bAL(),iAL=kAL(),bgB=cAL(),kgB=/\.(?:com|exe)$/i,ugB=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ggB(H){H.file=lAL(H);let $=H.file&&bgB(H.file);if($)return H.args.unshift(H.file),H.command=$,lAL(H);return H.file}function mgB(H){return H}function pgB(H,$,A){if($&&!Array.isArray($))A=$,$=null;$=$?$.slice(0):[],A=Object.assign({},A);let L={command:H,args:$,options:A,file:void 0,original:{command:H,args:$}};return A.shell?L:mgB(L)}nAL.exports=pgB});var tAL=z((N$8,oAL)=>{function dgB(H,$){return Object.assign(Error(`${$} ${H.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${$} ${H.command}`,path:H.command,spawnargs:H.args})}function cgB(H,$){return}function aAL(H,$){return null}function lgB(H,$){return null}oAL.exports={hookChildProcess:cgB,verifyENOENT:aAL,verifyENOENTSync:lgB,notFoundError:dgB}});var Cb$=z((O$8,jMH)=>{var sAL=require("child_process"),_b$=rAL(),Yb$=tAL();function eAL(H,$,A){let L=_b$(H,$,A),I=sAL.spawn(L.command,L.args,L.options);return Yb$.hookChildProcess(I,L),I}function igB(H,$,A){let L=_b$(H,$,A),I=sAL.spawnSync(L.command,L.args,L.options);return I.error=I.error||Yb$.verifyENOENTSync(I.status,L),I}jMH.exports=eAL;jMH.exports.spawn=eAL;jMH.exports.sync=igB;jMH.exports._parse=_b$;jMH.exports._enoent=Yb$});function wb$(H){let $=typeof H==="string"?` `)};var FIL=K(()=>{UIL=require("util"),XIL=b(require("process")),JIL=UIL.debuglog("execa").enabled});function fE(H,$,A){let L=PIL(H,$,A),I=lb$(H,$),D=ib$(H,$);rb$(D,L.options),zLL(L.options);let B;try{B=ftH.default.spawn(L.file,L.args,L.options)}catch(J){let F=new ftH.default.ChildProcess,Q=Promise.reject(rCH({error:J,stdout:"",stderr:"",all:"",command:I,escapedCommand:D,parsed:L,timedOut:!1,isCanceled:!1,killed:!1}));return cb$(F,Q),F}let f=LIL(B),E=TLL(B,L.options,f),M=NLL(B,L.options,E),G={isCanceled:!1};B.kill=ZLL.bind(null,B.kill.bind(B)),B.cancel=qLL.bind(null,B,G);let X=ILL(async()=>{let[{error:J,exitCode:F,signal:Q,timedOut:W},P,C,Y]=await $IL(B,L.options,M),Z=sCH(L.options,P),q=sCH(L.options,C),O=sCH(L.options,Y);if(J||F!==0||Q!==null){let j=rCH({error:J,exitCode:F,signal:Q,stdout:Z,stderr:q,all:O,command:I,escapedCommand:D,parsed:L,timedOut:W,isCanceled:G.isCanceled||(L.options.signal?L.options.signal.aborted:!1),killed:B.killed});if(!L.options.reject)return j;throw j}return{command:I,escapedCommand:D,exitCode:0,stdout:Z,stderr:q,all:O,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return eLL(B,L.options),B.all=HIL(B,L.options),jLL(B),cb$(B,X),B}function eCH(H,$,A){let L=PIL(H,$,A),I=lb$(H,$),D=ib$(H,$);rb$(D,L.options);let B=sLL(L.options),f;try{f=ftH.default.spawnSync(L.file,L.args,{...L.options,input:B})}catch(G){throw rCH({error:G,stdout:"",stderr:"",all:"",command:I,escapedCommand:D,parsed:L,timedOut:!1,isCanceled:!1,killed:!1})}let E=sCH(L.options,f.stdout,f.error),M=sCH(L.options,f.stderr,f.error);if(f.error||f.status!==0||f.signal!==null){let G=rCH({stdout:E,stderr:M,error:f.error,signal:f.signal,exitCode:f.status,command:I,escapedCommand:D,parsed:L,timedOut:f.error&&f.error.code==="ETIMEDOUT",isCanceled:!1,killed:f.signal!==null});if(!L.options.reject)return G;throw G}return{command:I,escapedCommand:D,exitCode:0,stdout:E,stderr:M,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function _IL(H){function $(A,...L){if(!Array.isArray(A))return _IL({...H,...A});let[I,...D]=nb$(A,L);return fE(I,D,KIL(H))}return $.sync=(A,...L)=>{if(!Array.isArray(A))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[I,...D]=nb$(A,L);return eCH(I,D,KIL(H))},$}var QIL,WIL,ftH,tCH,VIL,amB=1e8,omB=({env:H,extendEnv:$,preferLocal:A,localDir:L,execPath:I})=>{let D=$?{...tCH.default.env,...H}:H;if(A)return HLL({env:D,cwd:L,execPath:I});return D},PIL=(H,$,A={})=>{let L=VIL.default._parse(H,$,A);if(H=L.command,$=L.args,A=L.options,A={maxBuffer:amB,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:A.cwd||tCH.default.cwd(),execPath:tCH.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:JIL,...A},A.env=omB(A),A.stdio=WLL(A),tCH.default.platform==="win32"&&WIL.default.basename(H,".exe")==="cmd")$.unshift("/q");return{file:H,args:$,options:A,parsed:L}},sCH=(H,$,A)=>{if(typeof $!=="string"&&!QIL.Buffer.isBuffer($))return A===void 0?void 0:"";if(H.stripFinalNewline)return wb$($);return $},tmB=({input:H,inputFile:$,stdio:A})=>H===void 0&&$===void 0&&A===void 0?{stdin:"inherit"}:{},KIL=(H={})=>({preferLocal:!0,...tmB(H),...H}),lA8;var O_=K(()=>{$LL();DLL();QLL();VLL();OLL();RLL();AIL();IIL();GIL();FIL();QIL=require("buffer"),WIL=b(require("path")),ftH=b(require("child_process")),tCH=b(require("process")),VIL=b(Cb$(),1);lA8=_IL()});function smB(H,$){performance.now()-$>Xk}function SN(H,$){let A=`execSync: ${H.slice(0,100)}`,L=performance.now();try{return YIL.execSync(H,$)}finally{smB(A,L)}}var YIL;var H2H=K(()=>{E$();g$();Z$();YIL=require("child_process")});async function emB(H){let $=await fE(`which ${H}`,{shell:!0,stderr:"ignore",reject:!1});if($.exitCode!==0||!$.stdout)return null;return $.stdout.trim()}function HpB(H){try{return SN(`which ${H}`,{encoding:"utf-8"}).toString().trim()||null}catch{return null}}async function x_(H){if(typeof Bun<"u")return Bun.which(H);return emB(H)}function EtH(H){if(typeof Bun<"u")return Bun.which(H);return HpB(H)}var Zk=K(()=>{O_();H2H()});function SW(){if(zH().existsSync(MtH.join(UL(),".config.json")))return MtH.join(UL(),".config.json");let H=`.claude${UAL()}.json`;return MtH.join(process.env.CLAUDE_CONFIG_DIR||CIL.homedir(),H)}async function yMH(H){try{return!!await x_(H)}catch{return!1}}function BpB(){if(process.env.CURSOR_TRACE_ID)return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("/.cursor-server/"))return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("/.windsurf-server/"))return"windsurf";let H=process.env.__CFBundleIdentifier?.toLowerCase();if(H?.includes("vscodium"))return"codium";if(H?.includes("windsurf"))return"windsurf";if(H?.includes("com.google.android.studio"))return"androidstudio";if(H){for(let $ of ab$)if(H.includes($))return $}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")return"pycharm";if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(qIL())return"ssh-session";if(process.env.TERM){let $=process.env.TERM;if($.includes("alacritty"))return"alacritty";if($.includes("rxvt"))return"rxvt";if($.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}function qIL(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var MtH,CIL,wIL,$pB,ApB,LpB,ZIL,IpB,DpB=()=>{return process.env.__CFBundleIdentifier==="com.conductor.app"},ab$,fpB,OA;var Z1=K(()=>{tD();w1();DL();eE();NA();qE();Zk();MtH=require("path"),CIL=require("os"),wIL=b(Jb$(),1);$pB=o$(async()=>{try{let H=nD(),$=setTimeout(()=>H.abort(),1000);return await nA.head("http://1.1.1.1",{signal:H.signal}),clearTimeout($),!0}catch{return!1}});ApB=o$(async()=>{let H=[];if(await yMH("npm"))H.push("npm");if(await yMH("yarn"))H.push("yarn");if(await yMH("pnpm"))H.push("pnpm");return H}),LpB=o$(async()=>{let H=[];if(await yMH("bun"))H.push("bun");if(await yMH("deno"))H.push("deno");if(await yMH("node"))H.push("node");return H}),ZIL=o$(()=>{try{return zH().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(H){return!1}}),IpB=o$(()=>{try{if(!ZIL())return!1;let{cmd:H}=wIL.findActualExecutable("npm",[]);return H.startsWith("/mnt/c/")}catch(H){return!1}}),ab$=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];fpB=o$(()=>{if(A$(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(A$(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(A$(process.env.RENDER))return"render";if(A$(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(A$(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";try{if(zH().existsSync("/sys/hypervisor/uuid")){if(zH().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase().startsWith("ec2"))return"aws-ec2"}}catch{}if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(A$(process.env.GITHUB_ACTIONS))return"github-actions";if(A$(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(A$(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(zH().existsSync("/.dockerenv"))return"docker"}catch{}if(OA.platform==="darwin")return"unknown-darwin";if(OA.platform==="linux")return"unknown-linux";if(OA.platform==="win32")return"unknown-win32";return"unknown"});OA={hasInternetAccess:$pB,isCI:A$(!1),platform:["win32","darwin"].includes("linux")?"linux":"linux",arch:"x64",nodeVersion:process.version,terminal:BpB(),isSSH:qIL,getPackageManagers:ApB,getRuntimes:LpB,isRunningWithBun:o$(xMH),isWslEnvironment:ZIL,isNpmFromWindowsPath:IpB,isConductor:DpB,detectDeploymentEnvironment:fpB}});function GtH(){return HR()}function C$(){try{return GtH()}catch{return zL()}}var PI=K(()=>{g$()});function f$H(H){return H.sort(($,A)=>{let L=A.modified.getTime()-$.modified.getTime();if(L!==0)return L;return A.created.getTime()-$.created.getTime()})}function sb$(H,{suffix:$="nodejs"}={}){if(typeof H!=="string")throw TypeError(`Expected a string, got ${typeof H}`);if($)H+=`-${$}`;if(UtH.default.platform==="darwin")return EpB(H);if(UtH.default.platform==="win32")return MpB(H);return GpB(H)}var K4,ob$,UtH,Xl,tb$,vMH,EpB=(H)=>{let $=K4.default.join(Xl,"Library");return{data:K4.default.join($,"Application Support",H),config:K4.default.join($,"Preferences",H),cache:K4.default.join($,"Caches",H),log:K4.default.join($,"Logs",H),temp:K4.default.join(tb$,H)}},MpB=(H)=>{let $=vMH.APPDATA||K4.default.join(Xl,"AppData","Roaming"),A=vMH.LOCALAPPDATA||K4.default.join(Xl,"AppData","Local");return{data:K4.default.join(A,H,"Data"),config:K4.default.join($,H,"Config"),cache:K4.default.join(A,H,"Cache"),log:K4.default.join(A,H,"Log"),temp:K4.default.join(tb$,H)}},GpB=(H)=>{let $=K4.default.basename(Xl);return{data:K4.default.join(vMH.XDG_DATA_HOME||K4.default.join(Xl,".local","share"),H),config:K4.default.join(vMH.XDG_CONFIG_HOME||K4.default.join(Xl,".config"),H),cache:K4.default.join(vMH.XDG_CACHE_HOME||K4.default.join(Xl,".cache"),H),log:K4.default.join(vMH.XDG_STATE_HOME||K4.default.join(Xl,".local","state"),H),temp:K4.default.join(tb$,$,H)}};var TIL=K(()=>{K4=b(require("path")),ob$=b(require("os")),UtH=b(require("process")),Xl=ob$.default.homedir(),tb$=ob$.default.tmpdir(),{env:vMH}=UtH.default});function zIL(H){return H.replace(/[^a-zA-Z0-9]/g,"-")}function JtH(H){return zIL(H)}var $2H,XtH,Jl;var A2H=K(()=>{TIL();DL();$2H=require("path"),XtH=sb$("claude-cli");Jl={baseLogs:()=>$2H.join(XtH.cache,JtH(zH().cwd())),errors:()=>$2H.join(XtH.cache,JtH(zH().cwd()),"errors"),messages:()=>$2H.join(XtH.cache,JtH(zH().cwd()),"messages"),mcpLogs:(H)=>$2H.join(XtH.cache,JtH(zH().cwd()),`mcp-logs-${zIL(H)}`)}});var WV="command-name",C6="command-message",NIL="bash-stdout",OIL="bash-stderr",hMH="local-command-stdout",FtH="local-command-stderr",eb$="local-command-caveat",jN="tick",G5="task-notification",w6="task-id",KtH="task-type",D2="output-file",HK="status",$K="summary",sX="teammate-message",bMH,kMH;var EE=K(()=>{bMH=["help","-h","--help"],kMH=["list","show","display","current","view","get","check","describe","print","version","about","status","?"]});function QtH(H){return H.replace(XpB,"").trim()||H}var UpB,XpB;var Hk$=K(()=>{UpB=["ide_opened_file","ide_selection"],XpB=new RegExp(UpB.map((H)=>`<${H}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${H}>\\n?`).join("|"),"g")});function Fl(H,$){let A=H.firstPrompt?.startsWith(`<${jN}>`),L=H.firstPrompt&&H.firstPrompt!==""&&!A,I=H.agentName||H.customTitle||H.summary||(L?H.firstPrompt:void 0)||$||(A?"Autonomous session":void 0)||(H.sessionId?H.sessionId.slice(0,8):"")||"";return QtH(I).trim()}function xIL(H){return H.toISOString().replace(/[:.]/g,"-")}function FpB(H){if(WtH.length>=JpB)WtH.shift();WtH.push(H)}function SIL(H){if(RN!==null)throw Error("Error log sink already attached - cannot attach more than once");if(RN=H,uMH.length>0){let $=[...uMH];uMH.length=0;for(let A of $)switch(A.type){case"error":RN.logError(A.error);break;case"mcpError":RN.logMCPError(A.serverName,A.error);break;case"mcpDebug":RN.logMCPDebug(A.serverName,A.message);break}}}function r(H){try{if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.DISABLE_ERROR_REPORTING||process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return;let A={error:H.stack||H.message,timestamp:new Date().toISOString()};if(FpB(A),RN===null){uMH.push({type:"error",error:H});return}RN.logError(H)}catch{}}function gMH(){return[...WtH]}function ME(H,$){try{if(RN===null){uMH.push({type:"mcpError",serverName:H,error:$});return}RN.logMCPError(H,$)}catch{}}function TA(H,$){try{if(RN===null){uMH.push({type:"mcpDebug",serverName:H,message:$});return}RN.logMCPDebug(H,$)}catch{}}function VtH(H,$){if(!$||$!=="repl_main_thread")return;let A=klA(H);Ej$(A)}var JpB=100,WtH,uMH,RN=null,xL8;var _$=K(()=>{g$();A2H();DL();tD();NA();Z$();EE();Hk$();WtH=[];uMH=[];xL8=o$(()=>{return process.argv.includes("--hard-fail")})});function I2H(H,$=!1){let A=H.length,L=0,I="",D=0,B=16,f=0,E=0,M=0,G=0,U=0;function X(Y,Z){let q=0,O=0;while(q=48&&j<=57)O=O*16+j-48;else if(j>=65&&j<=70)O=O*16+j-65+10;else if(j>=97&&j<=102)O=O*16+j-97+10;else break;L++,q++}if(q=A){Y+=H.substring(Z,L),U=2;break}let q=H.charCodeAt(L);if(q===34){Y+=H.substring(Z,L),L++;break}if(q===92){if(Y+=H.substring(Z,L),L++,L>=A){U=2;break}switch(H.charCodeAt(L++)){case 34:Y+='"';break;case 92:Y+="\\";break;case 47:Y+="/";break;case 98:Y+="\b";break;case 102:Y+="\f";break;case 110:Y+=` `).filter(Boolean),F.length>0&&(X||J))F=F.slice(0,-1)}if(N(`rg error (signal=${B.signal}, code=${B.code}, stderr: ${E}), ${F.length} results`),B.code!==2)r(B);if(X&&F.length===0){I(new uDL(`Ripgrep search timed out after ${oA()==="wsl"?60:20} seconds. The search may have matched files but did not complete in time. Try searching a more specific path or pattern.`,F));return}L(F)};vDL(H,$,A,(B,f,E)=>{D(B,f,E,!1)})})}async function gDL(H,$,A){try{return(await YR(["-l","."],H,$)).slice(0,A)}catch{return[]}}function mDL(){let H=htH();return{mode:H.mode,path:H.command,working:vtH?.working??null}}async function WdB(){return}var hDL,bDL,V$H,kDL,sMH,XdB,JdB,htH,Q2H=20000000,uDL,btH,vtH=null,KdB,QdB=!1;var CR=K(()=>{tD();_$();B0();E$();NA();z$();Z9();Z$();hDL=b(Jb$(),1),bDL=require("url"),V$H=b(require("path")),kDL=require("os"),sMH=require("child_process"),XdB=bDL.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/ripgrep.ts"),JdB=V$H.join(XdB,"../"),htH=o$(()=>{if(BE(process.env.USE_BUILTIN_RIPGREP)){let{cmd:L}=hDL.findActualExecutable("rg",[]);if(L!=="rg")return{mode:"system",command:"rg",args:[]}}if(U8()){if(process.env.RIPGREP_EMBEDDED==="true")return{mode:"embedded",command:process.execPath,args:[],argv0:"rg"};return{mode:"builtin",command:process.execPath,args:["--ripgrep"]}}let $=V$H.resolve(JdB,"vendor","ripgrep");return{mode:"builtin",command:V$H.resolve($,"x64-linux","rg"),args:[]}});uDL=class uDL extends Error{partialResults;constructor(H,$){super(H);this.partialResults=$;this.name="RipgrepTimeoutError"}};btH=o$(async(H,$,A=[])=>{if(V$H.resolve(H)===V$H.resolve(kDL.homedir()))return;try{let L=["--files","--hidden"];A.forEach((E)=>{L.push("--glob",`!${E}`)});let D=(await YR(L,H,$)).length;if(D===0)return 0;let B=Math.floor(Math.log10(D)),f=Math.pow(10,B);return Math.round(D/f)*f}catch(L){r(L instanceof Error?L:Error(String(L)))}});KdB=o$(async()=>{if(vtH!==null)return;let H=htH();try{let $;if(H.argv0){let L=sMH.spawnSync(H.command,["--version"],{argv0:H.argv0,encoding:"utf8",timeout:5000});$={code:L.status??1,stdout:L.stdout||""}}else $=await jA(H.command,[...H.args,"--version"],{timeout:5000});let A=$.code===0&&!!$.stdout&&$.stdout.startsWith("ripgrep ");vtH={working:A,lastTested:Date.now(),config:H},N(`Ripgrep first use test: ${A?"PASSED":"FAILED"} (mode=${H.mode}, path=${H.command})`),c("tengu_ripgrep_availability",{working:A?1:0,using_system:H.mode==="system"?1:0})}catch($){vtH={working:!1,lastTested:Date.now(),config:H},r($ instanceof Error?$:Error(String($)))}})});class pDL{cache=new Map;maxCacheSize=1000;readFile(H){let $=zH(),A;try{A=$.statSync(H)}catch(f){throw this.cache.delete(H),f}let L=H,I=this.cache.get(L);if(I&&I.mtime===A.mtimeMs)return{content:I.content,encoding:I.encoding};let D=eJ(H),B=$.readFileSync(H,{encoding:D}).replaceAll(`\r `)}function wdB(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}var yk$;var Z6=K(()=>{DL();Z$();yk$=require("path")});function Vl(H){switch(H){case"userSettings":return"user";case"projectSettings":return"project";case"localSettings":return"project, gitignored";case"flagSettings":return"cli flag";case"policySettings":return"managed"}}function ktH(H){switch(H){case"userSettings":return"User";case"projectSettings":return"Project";case"localSettings":return"Local";case"flagSettings":return"Flag";case"policySettings":return"Managed";case"plugin":return"Plugin";case"built-in":return"Built-in"}}function utH(H){switch(H){case"userSettings":return"user settings";case"projectSettings":return"shared project settings";case"localSettings":return"project local settings";case"flagSettings":return"command line arguments";case"policySettings":return"enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"command configuration";case"session":return"current session"}}function rDL(H){switch(H){case"userSettings":return"User settings";case"projectSettings":return"Shared project settings";case"localSettings":return"Project local settings";case"flagSettings":return"Command line arguments";case"policySettings":return"Enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"Command configuration";case"session":return"Current session"}}function aDL(H){if(H==="")return[];let $=H.split(",").map((L)=>L.trim()),A=[];for(let L of $)switch(L){case"user":A.push("userSettings");break;case"project":A.push("projectSettings");break;case"local":A.push("localSettings");break;default:throw Error(`Invalid setting source: ${L}. Valid options are: user, project, local`)}return A}function Pl(){let H=Gj$(),$=new Set(H);return $.add("policySettings"),$.add("flagSettings"),Array.from($)}function HF(H){return Pl().includes(H)}var j_,oDL="https://json.schemastore.org/claude-code-settings.json";var W4=K(()=>{g$();j_=["userSettings","projectSettings","localSettings","flagSettings","policySettings"]});function LA(H,$,A){function L(f,E){var M;Object.defineProperty(f,"_zod",{value:f._zod??{},enumerable:!1}),(M=f._zod).traits??(M.traits=new Set),f._zod.traits.add(H),$(f,E);for(let G in B.prototype)if(!(G in f))Object.defineProperty(f,G,{value:B.prototype[G].bind(f)});f._zod.constr=B,f._zod.def=E}let I=A?.Parent??Object;class D extends I{}Object.defineProperty(D,"name",{value:H});function B(f){var E;let M=A?.Parent?new D:this;L(M,f),(E=M._zod).deferred??(E.deferred=[]);for(let G of M._zod.deferred)G();return M}return Object.defineProperty(B,"init",{value:L}),Object.defineProperty(B,Symbol.hasInstance,{value:(f)=>{if(A?.Parent&&f instanceof A.Parent)return!0;return f?._zod?.traits?.has(H)}}),Object.defineProperty(B,"name",{value:H}),B}function $F(H){if(H)Object.assign(W2H,H);return W2H}var V2H,vk$,Nk,W2H;var HGH=K(()=>{V2H=Object.freeze({status:"aborted"});vk$=Symbol("zod_brand");Nk=class Nk extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};W2H={}});var OI={};XA(OI,{unwrapMessage:()=>P2H,stringifyPrimitive:()=>RI,required:()=>gdB,randomString:()=>SdB,propertyKeyTypes:()=>w2H,promiseAllObject:()=>xdB,primitiveTypes:()=>mk$,prefixIssues:()=>R_,pick:()=>vdB,partial:()=>udB,optionalKeys:()=>pk$,omit:()=>hdB,numKeys:()=>jdB,nullish:()=>_l,normalizeParams:()=>FI,merge:()=>kdB,jsonStringifyReplacer:()=>bk$,joinValues:()=>fL,issue:()=>lk$,isPlainObject:()=>AGH,isObject:()=>$GH,getSizableOrigin:()=>Z2H,getParsedType:()=>RdB,getLengthableOrigin:()=>q2H,getEnumValues:()=>_2H,getElementAtPath:()=>OdB,floatSafeRemainder:()=>kk$,finalizeIssue:()=>E2,extend:()=>bdB,escapeRegex:()=>Ok,esc:()=>P$H,defineLazy:()=>GE,createTransparentProxy:()=>ydB,clone:()=>f2,cleanRegex:()=>C2H,cleanEnum:()=>mdB,captureStackTrace:()=>gtH,cached:()=>Y2H,assignProp:()=>uk$,assertNotEqual:()=>qdB,assertNever:()=>zdB,assertIs:()=>TdB,assertEqual:()=>ZdB,assert:()=>NdB,allowsEval:()=>gk$,aborted:()=>_$H,NUMBER_FORMAT_RANGES:()=>dk$,Class:()=>tDL,BIGINT_FORMAT_RANGES:()=>ck$});function ZdB(H){return H}function qdB(H){return H}function TdB(H){}function zdB(H){throw Error()}function NdB(H){}function _2H(H){let $=Object.values(H).filter((L)=>typeof L==="number");return Object.entries(H).filter(([L,I])=>$.indexOf(+L)===-1).map(([L,I])=>I)}function fL(H,$="|"){return H.map((A)=>RI(A)).join($)}function bk$(H,$){if(typeof $==="bigint")return $.toString();return $}function Y2H(H){return{get value(){{let A=H();return Object.defineProperty(this,"value",{value:A}),A}throw Error("cached value already set")}}}function _l(H){return H===null||H===void 0}function C2H(H){let $=H.startsWith("^")?1:0,A=H.endsWith("$")?H.length-1:H.length;return H.slice($,A)}function kk$(H,$){let A=(H.toString().split(".")[1]||"").length,L=($.toString().split(".")[1]||"").length,I=A>L?A:L,D=Number.parseInt(H.toFixed(I).replace(".","")),B=Number.parseInt($.toFixed(I).replace(".",""));return D%B/10**I}function GE(H,$,A){Object.defineProperty(H,$,{get(){{let I=A();return H[$]=I,I}throw Error("cached value already set")},set(I){Object.defineProperty(H,$,{value:I})},configurable:!0})}function uk$(H,$,A){Object.defineProperty(H,$,{value:A,writable:!0,enumerable:!0,configurable:!0})}function OdB(H,$){if(!$)return H;return $.reduce((A,L)=>A?.[L],H)}function xdB(H){let $=Object.keys(H),A=$.map((L)=>H[L]);return Promise.all(A).then((L)=>{let I={};for(let D=0;D<$.length;D++)I[$[D]]=L[D];return I})}function SdB(H=10){let A="";for(let L=0;L$};if($?.message!==void 0){if($?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");$.error=$.message}if(delete $.message,typeof $.error==="string")return{...$,error:()=>$.error};return $}function ydB(H){let $;return new Proxy({},{get(A,L,I){return $??($=H()),Reflect.get($,L,I)},set(A,L,I,D){return $??($=H()),Reflect.set($,L,I,D)},has(A,L){return $??($=H()),Reflect.has($,L)},deleteProperty(A,L){return $??($=H()),Reflect.deleteProperty($,L)},ownKeys(A){return $??($=H()),Reflect.ownKeys($)},getOwnPropertyDescriptor(A,L){return $??($=H()),Reflect.getOwnPropertyDescriptor($,L)},defineProperty(A,L,I){return $??($=H()),Reflect.defineProperty($,L,I)}})}function RI(H){if(typeof H==="bigint")return H.toString()+"n";if(typeof H==="string")return`"${H}"`;return`${H}`}function pk$(H){return Object.keys(H).filter(($)=>{return H[$]._zod.optin==="optional"&&H[$]._zod.optout==="optional"})}function vdB(H,$){let A={},L=H._zod.def;for(let I in $){if(!(I in L.shape))throw Error(`Unrecognized key: "${I}"`);if(!$[I])continue;A[I]=L.shape[I]}return f2(H,{...H._zod.def,shape:A,checks:[]})}function hdB(H,$){let A={...H._zod.def.shape},L=H._zod.def;for(let I in $){if(!(I in L.shape))throw Error(`Unrecognized key: "${I}"`);if(!$[I])continue;delete A[I]}return f2(H,{...H._zod.def,shape:A,checks:[]})}function bdB(H,$){if(!AGH($))throw Error("Invalid input to extend: expected a plain object");let A={...H._zod.def,get shape(){let L={...H._zod.def.shape,...$};return uk$(this,"shape",L),L},checks:[]};return f2(H,A)}function kdB(H,$){return f2(H,{...H._zod.def,get shape(){let A={...H._zod.def.shape,...$._zod.def.shape};return uk$(this,"shape",A),A},catchall:$._zod.def.catchall,checks:[]})}function udB(H,$,A){let L=$._zod.def.shape,I={...L};if(A)for(let D in A){if(!(D in L))throw Error(`Unrecognized key: "${D}"`);if(!A[D])continue;I[D]=H?new H({type:"optional",innerType:L[D]}):L[D]}else for(let D in L)I[D]=H?new H({type:"optional",innerType:L[D]}):L[D];return f2($,{...$._zod.def,shape:I,checks:[]})}function gdB(H,$,A){let L=$._zod.def.shape,I={...L};if(A)for(let D in A){if(!(D in I))throw Error(`Unrecognized key: "${D}"`);if(!A[D])continue;I[D]=new H({type:"nonoptional",innerType:L[D]})}else for(let D in L)I[D]=new H({type:"nonoptional",innerType:L[D]});return f2($,{...$._zod.def,shape:I,checks:[]})}function _$H(H,$=0){for(let A=$;A{var L;return(L=A).path??(L.path=[]),A.path.unshift(H),A})}function P2H(H){return typeof H==="string"?H:H?.message}function E2(H,$,A){let L={...H,path:H.path??[]};if(!H.message){let I=P2H(H.inst?._zod.def?.error?.(H))??P2H($?.error?.(H))??P2H(A.customError?.(H))??P2H(A.localeError?.(H))??"Invalid input";L.message=I}if(delete L.inst,delete L.continue,!$?.reportInput)delete L.input;return L}function Z2H(H){if(H instanceof Set)return"set";if(H instanceof Map)return"map";if(H instanceof File)return"file";return"unknown"}function q2H(H){if(Array.isArray(H))return"array";if(typeof H==="string")return"string";return"unknown"}function lk$(...H){let[$,A,L]=H;if(typeof $==="string")return{message:$,code:"custom",input:A,inst:L};return{...$}}function mdB(H){return Object.entries(H).filter(([$,A])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}class tDL{constructor(...H){}}var gtH,gk$,RdB=(H)=>{let $=typeof H;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(H)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(H))return"array";if(H===null)return"null";if(H.then&&typeof H.then==="function"&&H.catch&&typeof H.catch==="function")return"promise";if(typeof Map<"u"&&H instanceof Map)return"map";if(typeof Set<"u"&&H instanceof Set)return"set";if(typeof Date<"u"&&H instanceof Date)return"date";if(typeof File<"u"&&H instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},w2H,mk$,dk$,ck$;var n0=K(()=>{gtH=Error.captureStackTrace?Error.captureStackTrace:(...H)=>{};gk$=Y2H(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(H){return!1}});w2H=new Set(["string","number","symbol"]),mk$=new Set(["string","number","bigint","boolean","symbol","undefined"]);dk$={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ck$={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function z2H(H,$=(A)=>A.message){let A={},L=[];for(let I of H.issues)if(I.path.length>0)A[I.path[0]]=A[I.path[0]]||[],A[I.path[0]].push($(I));else L.push($(I));return{formErrors:L,fieldErrors:A}}function N2H(H,$){let A=$||function(D){return D.message},L={_errors:[]},I=(D)=>{for(let B of D.issues)if(B.code==="invalid_union"&&B.errors.length)B.errors.map((f)=>I({issues:f}));else if(B.code==="invalid_key")I({issues:B.issues});else if(B.code==="invalid_element")I({issues:B.issues});else if(B.path.length===0)L._errors.push(A(B));else{let f=L,E=0;while(E{var f,E;for(let M of D.issues)if(M.code==="invalid_union"&&M.errors.length)M.errors.map((G)=>I({issues:G},M.path));else if(M.code==="invalid_key")I({issues:M.issues},M.path);else if(M.code==="invalid_element")I({issues:M.issues},M.path);else{let G=[...B,...M.path];if(G.length===0){L.errors.push(A(M));continue}let U=L,X=0;while(XL.path.length-I.path.length);for(let L of A)if($.push(`\u2716 ${L.message}`),L.path?.length)$.push(` \u2192 at ${eDL(L.path)}`);return $.join(` Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(A.cycles==="ref")D(M);continue}if(G.count>1){if(A.reused==="ref"){D(M);continue}}}let B=(M,G)=>{let U=this.seen.get(M),X=U.def??U.schema,J={...X};if(U.ref===null)return;let F=U.ref;if(U.ref=null,F){B(F,G);let Q=this.seen.get(F).schema;if(Q.$ref&&G.target==="draft-7")X.allOf=X.allOf??[],X.allOf.push(Q);else Object.assign(X,Q),Object.assign(X,J)}if(!U.isParent)this.override({zodSchema:M,jsonSchema:X,path:U.path??[]})};for(let M of[...this.seen.entries()].reverse())B(M[0],{target:this.target});let f={};if(this.target==="draft-2020-12")f.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")f.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(f,L.def);let E=A.external?.defs??{};for(let M of this.seen.entries()){let G=M[1];if(G.def&&G.defId)E[G.defId]=G.def}if(!A.external&&Object.keys(E).length>0)if(this.target==="draft-2020-12")f.$defs=E;else f.definitions=E;try{return JSON.parse(JSON.stringify(f))}catch(M){throw Error("Error converting schema to JSON.")}}}function Rk(H,$){if(H instanceof k2H){let L=new TsH($),I={};for(let f of H._idmap.entries()){let[E,M]=f;L.process(M)}let D={},B={registry:H,uri:$?.uri||((f)=>f),defs:I};for(let f of H._idmap.entries()){let[E,M]=f;D[E]=L.emit(M,{...$,external:B})}if(Object.keys(I).length>0){let f=L.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[f]:I}}return{schemas:D}}let A=new TsH($);return A.process(H),A.emit(H,$)}function IK(H,$){let A=$??{seen:new Set};if(A.seen.has(H))return!1;A.seen.add(H);let I=H._zod.def;switch(I.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return IK(I.element,A);case"object":{for(let D in I.shape)if(IK(I.shape[D],A))return!0;return!1}case"union":{for(let D of I.options)if(IK(D,A))return!0;return!1}case"intersection":return IK(I.left,A)||IK(I.right,A);case"tuple":{for(let D of I.items)if(IK(D,A))return!0;if(I.rest&&IK(I.rest,A))return!0;return!1}case"record":return IK(I.keyType,A)||IK(I.valueType,A);case"map":return IK(I.keyType,A)||IK(I.valueType,A);case"set":return IK(I.valueType,A);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return IK(I.innerType,A);case"lazy":return IK(I.getter(),A);case"default":return IK(I.innerType,A);case"prefault":return IK(I.innerType,A);case"custom":return!1;case"transform":return!0;case"pipe":return IK(I.in,A)||IK(I.out,A);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${I.type}`)}var B0L=K(()=>{ym$();n0()});var f0L={};var E0L=()=>{};var ZR={};XA(ZR,{version:()=>pu$,util:()=>OI,treeifyError:()=>ik$,toJSONSchema:()=>Rk,toDotPath:()=>eDL,safeParseAsync:()=>S2H,safeParse:()=>IGH,registry:()=>IsH,regexes:()=>C$H,prettifyError:()=>nk$,parseAsync:()=>x2H,parse:()=>O2H,locales:()=>fGH,isValidJWT:()=>WBL,isValidBase64URL:()=>QBL,isValidBase64:()=>Gg$,globalRegistry:()=>wR,globalConfig:()=>W2H,function:()=>wp$,formatError:()=>N2H,flattenError:()=>z2H,config:()=>$F,clone:()=>f2,_xid:()=>QsH,_void:()=>Bp$,_uuidv7:()=>MsH,_uuidv6:()=>EsH,_uuidv4:()=>fsH,_uuid:()=>BsH,_url:()=>GsH,_uppercase:()=>d2H,_unknown:()=>EGH,_union:()=>mcB,_undefined:()=>Ap$,_ulid:()=>KsH,_uint64:()=>Hp$,_uint32:()=>rm$,_tuple:()=>Kp$,_trim:()=>a2H,_transform:()=>ocB,_toUpperCase:()=>t2H,_toLowerCase:()=>o2H,_templateLiteral:()=>DlB,_symbol:()=>$p$,_success:()=>$lB,_stringbool:()=>Pp$,_stringFormat:()=>_p$,_string:()=>vm$,_startsWith:()=>l2H,_size:()=>g2H,_set:()=>icB,_safeParseAsync:()=>ctH,_safeParse:()=>dtH,_regex:()=>m2H,_refine:()=>Vp$,_record:()=>ccB,_readonly:()=>IlB,_property:()=>Fp$,_promise:()=>flB,_positive:()=>Gp$,_pipe:()=>LlB,_parseAsync:()=>ptH,_parse:()=>mtH,_overwrite:()=>jk,_optional:()=>tcB,_number:()=>pm$,_nullable:()=>scB,_null:()=>Lp$,_normalize:()=>r2H,_nonpositive:()=>Xp$,_nonoptional:()=>HlB,_nonnegative:()=>Jp$,_never:()=>Dp$,_negative:()=>Up$,_nativeEnum:()=>rcB,_nanoid:()=>XsH,_nan:()=>Mp$,_multipleOf:()=>q$H,_minSize:()=>T$H,_minLength:()=>Yl,_min:()=>y_,_mime:()=>n2H,_maxSize:()=>MGH,_maxLength:()=>GGH,_max:()=>aZ,_map:()=>lcB,_lte:()=>aZ,_lt:()=>xk,_lowercase:()=>p2H,_literal:()=>acB,_length:()=>UGH,_lazy:()=>BlB,_ksuid:()=>WsH,_jwt:()=>qsH,_isoTime:()=>gm$,_isoDuration:()=>mm$,_isoDateTime:()=>km$,_isoDate:()=>um$,_ipv6:()=>PsH,_ipv4:()=>VsH,_intersection:()=>dcB,_int64:()=>em$,_int32:()=>nm$,_int:()=>cm$,_includes:()=>c2H,_guid:()=>u2H,_gte:()=>y_,_gt:()=>Sk,_float64:()=>im$,_float32:()=>lm$,_file:()=>Qp$,_enum:()=>ncB,_endsWith:()=>i2H,_emoji:()=>UsH,_email:()=>DsH,_e164:()=>ZsH,_discriminatedUnion:()=>pcB,_default:()=>ecB,_date:()=>fp$,_custom:()=>Wp$,_cuid2:()=>FsH,_cuid:()=>JsH,_coercedString:()=>hm$,_coercedNumber:()=>dm$,_coercedDate:()=>Ep$,_coercedBoolean:()=>om$,_coercedBigint:()=>sm$,_cidrv6:()=>YsH,_cidrv4:()=>_sH,_catch:()=>AlB,_boolean:()=>am$,_bigint:()=>tm$,_base64url:()=>wsH,_base64:()=>CsH,_array:()=>s2H,_any:()=>Ip$,TimePrecision:()=>bm$,NEVER:()=>V2H,JSONSchemaGenerator:()=>TsH,JSONSchema:()=>f0L,Doc:()=>ttH,$output:()=>jm$,$input:()=>Rm$,$constructor:()=>LA,$brand:()=>vk$,$ZodXID:()=>Hg$,$ZodVoid:()=>wg$,$ZodUnknown:()=>BGH,$ZodUnion:()=>AsH,$ZodUndefined:()=>Pg$,$ZodUUID:()=>iu$,$ZodURL:()=>ru$,$ZodULID:()=>eu$,$ZodType:()=>J9,$ZodTuple:()=>Z$H,$ZodTransform:()=>y2H,$ZodTemplateLiteral:()=>dg$,$ZodSymbol:()=>Vg$,$ZodSuccess:()=>ug$,$ZodStringFormat:()=>rM,$ZodString:()=>w$H,$ZodSet:()=>xg$,$ZodRegistry:()=>k2H,$ZodRecord:()=>Ng$,$ZodRealError:()=>LGH,$ZodReadonly:()=>pg$,$ZodPromise:()=>cg$,$ZodPrefault:()=>bg$,$ZodPipe:()=>v2H,$ZodOptional:()=>yg$,$ZodObject:()=>qg$,$ZodNumberFormat:()=>Qg$,$ZodNumber:()=>HsH,$ZodNullable:()=>vg$,$ZodNull:()=>_g$,$ZodNonOptional:()=>kg$,$ZodNever:()=>Cg$,$ZodNanoID:()=>ou$,$ZodNaN:()=>mg$,$ZodMap:()=>Og$,$ZodLiteral:()=>jg$,$ZodLazy:()=>lg$,$ZodKSUID:()=>$g$,$ZodJWT:()=>Fg$,$ZodIntersection:()=>zg$,$ZodISOTime:()=>Ig$,$ZodISODuration:()=>Dg$,$ZodISODateTime:()=>Ag$,$ZodISODate:()=>Lg$,$ZodIPv6:()=>fg$,$ZodIPv4:()=>Bg$,$ZodGUID:()=>lu$,$ZodFunction:()=>Cp$,$ZodFile:()=>Rg$,$ZodError:()=>T2H,$ZodEnum:()=>Sg$,$ZodEmoji:()=>au$,$ZodEmail:()=>nu$,$ZodE164:()=>Jg$,$ZodDiscriminatedUnion:()=>Tg$,$ZodDefault:()=>hg$,$ZodDate:()=>Zg$,$ZodCustomStringFormat:()=>Kg$,$ZodCustom:()=>ig$,$ZodCheckUpperCase:()=>vu$,$ZodCheckStringFormat:()=>DGH,$ZodCheckStartsWith:()=>bu$,$ZodCheckSizeEquals:()=>Ou$,$ZodCheckRegex:()=>Ru$,$ZodCheckProperty:()=>uu$,$ZodCheckOverwrite:()=>mu$,$ZodCheckNumberFormat:()=>qu$,$ZodCheckMultipleOf:()=>Zu$,$ZodCheckMinSize:()=>Nu$,$ZodCheckMinLength:()=>Su$,$ZodCheckMimeType:()=>gu$,$ZodCheckMaxSize:()=>zu$,$ZodCheckMaxLength:()=>xu$,$ZodCheckLowerCase:()=>yu$,$ZodCheckLessThan:()=>rtH,$ZodCheckLengthEquals:()=>ju$,$ZodCheckIncludes:()=>hu$,$ZodCheckGreaterThan:()=>atH,$ZodCheckEndsWith:()=>ku$,$ZodCheckBigIntFormat:()=>Tu$,$ZodCheck:()=>X5,$ZodCatch:()=>gg$,$ZodCUID2:()=>su$,$ZodCUID:()=>tu$,$ZodCIDRv6:()=>Mg$,$ZodCIDRv4:()=>Eg$,$ZodBoolean:()=>j2H,$ZodBigIntFormat:()=>Wg$,$ZodBigInt:()=>$sH,$ZodBase64URL:()=>Xg$,$ZodBase64:()=>Ug$,$ZodAsyncError:()=>Nk,$ZodArray:()=>R2H,$ZodAny:()=>Yg$});var VV=K(()=>{n0();ntH();LsH();E0L();HGH();ltH();rk$();h2H();otH();du$();ym$();D0L();Yp$();B0L()});var Zp$=K(()=>{VV()});var XGH={};XA(XGH,{time:()=>zp$,duration:()=>Np$,datetime:()=>qp$,date:()=>Tp$,ZodISOTime:()=>OsH,ZodISODuration:()=>xsH,ZodISODateTime:()=>zsH,ZodISODate:()=>NsH});function qp$(H){return km$(zsH,H)}function Tp$(H){return um$(NsH,H)}function zp$(H){return gm$(OsH,H)}function Np$(H){return mm$(xsH,H)}var zsH,NsH,OsH,xsH;var SsH=K(()=>{VV();jsH();zsH=LA("ZodISODateTime",(H,$)=>{Ag$.init(H,$),iG.init(H,$)});NsH=LA("ZodISODate",(H,$)=>{Lg$.init(H,$),iG.init(H,$)});OsH=LA("ZodISOTime",(H,$)=>{Ig$.init(H,$),iG.init(H,$)});xsH=LA("ZodISODuration",(H,$)=>{Dg$.init(H,$),iG.init(H,$)})});var G0L=(H,$)=>{T2H.init(H,$),H.name="ZodError",Object.defineProperties(H,{format:{value:(A)=>N2H(H,A)},flatten:{value:(A)=>z2H(H,A)},addIssue:{value:(A)=>H.issues.push(A)},addIssues:{value:(A)=>H.issues.push(...A)},isEmpty:{get(){return H.issues.length===0}}})},MlB,JGH;var Op$=K(()=>{VV();VV();MlB=LA("ZodError",G0L),JGH=LA("ZodError",G0L,{Parent:Error})});var xp$,Sp$,jp$,Rp$;var yp$=K(()=>{VV();Op$();xp$=mtH(JGH),Sp$=ptH(JGH),jp$=dtH(JGH),Rp$=ctH(JGH)});function N$(H){return vm$(HwH,H)}function UlB(H){return DsH(bp$,H)}function XlB(H){return u2H(RsH,H)}function JlB(H){return BsH(yk,H)}function FlB(H){return fsH(yk,H)}function KlB(H){return EsH(yk,H)}function QlB(H){return MsH(yk,H)}function up$(H){return GsH(kp$,H)}function WlB(H){return UsH(gp$,H)}function VlB(H){return XsH(mp$,H)}function PlB(H){return JsH(pp$,H)}function _lB(H){return FsH(dp$,H)}function YlB(H){return KsH(cp$,H)}function ClB(H){return QsH(lp$,H)}function wlB(H){return WsH(ip$,H)}function ZlB(H){return VsH(np$,H)}function qlB(H){return PsH(rp$,H)}function TlB(H){return _sH(ap$,H)}function zlB(H){return YsH(op$,H)}function NlB(H){return CsH(tp$,H)}function OlB(H){return wsH(sp$,H)}function xlB(H){return ZsH(ep$,H)}function SlB(H){return qsH(Hd$,H)}function jlB(H,$,A={}){return _p$(U0L,H,$,A)}function df(H){return pm$($wH,H)}function vp$(H){return cm$(FGH,H)}function RlB(H){return lm$(FGH,H)}function ylB(H){return im$(FGH,H)}function vlB(H){return nm$(FGH,H)}function hlB(H){return rm$(FGH,H)}function qM(H){return am$(AwH,H)}function blB(H){return tm$(LwH,H)}function klB(H){return em$($d$,H)}function ulB(H){return Hp$($d$,H)}function glB(H){return $p$(X0L,H)}function mlB(H){return Ap$(J0L,H)}function IwH(H){return Lp$(F0L,H)}function Ad$(){return Ip$(K0L)}function eX(){return EGH(Q0L)}function hsH(H){return Dp$(W0L,H)}function plB(H){return Bp$(V0L,H)}function dlB(H){return fp$(bsH,H)}function xI(H,$){return s2H(P0L,H,$)}function clB(H){let $=H._zod.def.shape;return sD(Object.keys($))}function LI(H,$){let A={type:"object",get shape(){return OI.assignProp(this,"shape",{...H}),this.shape},...OI.normalizeParams($)};return new ksH(A)}function llB(H,$){return new ksH({type:"object",get shape(){return OI.assignProp(this,"shape",{...H}),this.shape},catchall:hsH(),...OI.normalizeParams($)})}function RW(H,$){return new ksH({type:"object",get shape(){return OI.assignProp(this,"shape",{...H}),this.shape},catchall:eX(),...OI.normalizeParams($)})}function TM(H,$){return new Ld$({type:"union",options:H,...OI.normalizeParams($)})}function usH(H,$,A){return new _0L({type:"union",options:$,discriminator:H,...OI.normalizeParams(A)})}function DwH(H,$){return new Y0L({type:"intersection",left:H,right:$})}function ilB(H,$,A){let L=$ instanceof J9,I=L?A:$;return new C0L({type:"tuple",items:H,rest:L?$:null,...OI.normalizeParams(I)})}function MX(H,$,A){return new Id$({type:"record",keyType:H,valueType:$,...OI.normalizeParams(A)})}function nlB(H,$,A){return new Id$({type:"record",keyType:TM([H,hsH()]),valueType:$,...OI.normalizeParams(A)})}function rlB(H,$,A){return new w0L({type:"map",keyType:H,valueType:$,...OI.normalizeParams(A)})}function alB(H,$){return new Z0L({type:"set",valueType:H,...OI.normalizeParams($)})}function GQ(H,$){let A=Array.isArray(H)?Object.fromEntries(H.map((L)=>[L,L])):H;return new e2H({type:"enum",entries:A,...OI.normalizeParams($)})}function olB(H,$){return new e2H({type:"enum",entries:H,...OI.normalizeParams($)})}function sD(H,$){return new q0L({type:"literal",values:Array.isArray(H)?H:[H],...OI.normalizeParams($)})}function tlB(H){return Qp$(T0L,H)}function Bd$(H){return new Dd$({type:"transform",transform:H})}function MB(H){return new fd$({type:"optional",innerType:H})}function ysH(H){return new z0L({type:"nullable",innerType:H})}function slB(H){return MB(ysH(H))}function O0L(H,$){return new N0L({type:"default",innerType:H,get defaultValue(){return typeof $==="function"?$():$}})}function S0L(H,$){return new x0L({type:"prefault",innerType:H,get defaultValue(){return typeof $==="function"?$():$}})}function j0L(H,$){return new Ed$({type:"nonoptional",innerType:H,...OI.normalizeParams($)})}function elB(H){return new R0L({type:"success",innerType:H})}function v0L(H,$){return new y0L({type:"catch",innerType:H,catchValue:typeof $==="function"?$:()=>$})}function HiB(H){return Mp$(h0L,H)}function vsH(H,$){return new Md$({type:"pipe",in:H,out:$})}function k0L(H){return new b0L({type:"readonly",innerType:H})}function $iB(H,$){return new u0L({type:"template_literal",parts:H,...OI.normalizeParams($)})}function m0L(H){return new g0L({type:"lazy",getter:H})}function AiB(H){return new p0L({type:"promise",innerType:H})}function d0L(H,$){let A=new X5({check:"custom",...OI.normalizeParams($)});return A._zod.check=H,A}function Gd$(H,$){return Wp$(gsH,H??(()=>!0),$)}function c0L(H,$={}){return Vp$(gsH,H,$)}function l0L(H,$){let A=d0L((L)=>{return L.addIssue=(I)=>{if(typeof I==="string")L.issues.push(OI.issue(I,L.value,A._zod.def));else{let D=I;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=L.value),D.inst??(D.inst=A),D.continue??(D.continue=!A._zod.def.abort),L.issues.push(OI.issue(D))}},H(L.value,L)},$);return A}function LiB(H,$={error:`Input not instance of ${H.name}`}){let A=new gsH({type:"custom",check:"custom",fn:(L)=>L instanceof H,abort:!0,...OI.normalizeParams($)});return A._zod.bag.Class=H,A}function DiB(H){let $=m0L(()=>{return TM([N$(H),df(),qM(),IwH(),xI($),MX(N$(),$)])});return $}function msH(H,$){return vsH(Bd$(H),$)}var s1,hp$,HwH,iG,bp$,RsH,yk,kp$,gp$,mp$,pp$,dp$,cp$,lp$,ip$,np$,rp$,ap$,op$,tp$,sp$,ep$,Hd$,U0L,$wH,FGH,AwH,LwH,$d$,X0L,J0L,F0L,K0L,Q0L,W0L,V0L,bsH,P0L,ksH,Ld$,_0L,Y0L,C0L,Id$,w0L,Z0L,e2H,q0L,T0L,Dd$,fd$,z0L,N0L,x0L,Ed$,R0L,y0L,h0L,Md$,b0L,u0L,g0L,p0L,gsH,IiB=(...H)=>Pp$({Pipe:Md$,Boolean:AwH,String:HwH,Transform:Dd$},...H);var jsH=K(()=>{VV();VV();Zp$();SsH();yp$();s1=LA("ZodType",(H,$)=>{return J9.init(H,$),H.def=$,Object.defineProperty(H,"_def",{value:$}),H.check=(...A)=>{return H.clone({...$,checks:[...$.checks??[],...A.map((L)=>typeof L==="function"?{_zod:{check:L,def:{check:"custom"},onattach:[]}}:L)]})},H.clone=(A,L)=>f2(H,A,L),H.brand=()=>H,H.register=(A,L)=>{return A.add(H,L),H},H.parse=(A,L)=>xp$(H,A,L,{callee:H.parse}),H.safeParse=(A,L)=>jp$(H,A,L),H.parseAsync=async(A,L)=>Sp$(H,A,L,{callee:H.parseAsync}),H.safeParseAsync=async(A,L)=>Rp$(H,A,L),H.spa=H.safeParseAsync,H.refine=(A,L)=>H.check(c0L(A,L)),H.superRefine=(A)=>H.check(l0L(A)),H.overwrite=(A)=>H.check(jk(A)),H.optional=()=>MB(H),H.nullable=()=>ysH(H),H.nullish=()=>MB(ysH(H)),H.nonoptional=(A)=>j0L(H,A),H.array=()=>xI(H),H.or=(A)=>TM([H,A]),H.and=(A)=>DwH(H,A),H.transform=(A)=>vsH(H,Bd$(A)),H.default=(A)=>O0L(H,A),H.prefault=(A)=>S0L(H,A),H.catch=(A)=>v0L(H,A),H.pipe=(A)=>vsH(H,A),H.readonly=()=>k0L(H),H.describe=(A)=>{let L=H.clone();return wR.add(L,{description:A}),L},Object.defineProperty(H,"description",{get(){return wR.get(H)?.description},configurable:!0}),H.meta=(...A)=>{if(A.length===0)return wR.get(H);let L=H.clone();return wR.add(L,A[0]),L},H.isOptional=()=>H.safeParse(void 0).success,H.isNullable=()=>H.safeParse(null).success,H}),hp$=LA("_ZodString",(H,$)=>{w$H.init(H,$),s1.init(H,$);let A=H._zod.bag;H.format=A.format??null,H.minLength=A.minimum??null,H.maxLength=A.maximum??null,H.regex=(...L)=>H.check(m2H(...L)),H.includes=(...L)=>H.check(c2H(...L)),H.startsWith=(...L)=>H.check(l2H(...L)),H.endsWith=(...L)=>H.check(i2H(...L)),H.min=(...L)=>H.check(Yl(...L)),H.max=(...L)=>H.check(GGH(...L)),H.length=(...L)=>H.check(UGH(...L)),H.nonempty=(...L)=>H.check(Yl(1,...L)),H.lowercase=(L)=>H.check(p2H(L)),H.uppercase=(L)=>H.check(d2H(L)),H.trim=()=>H.check(a2H()),H.normalize=(...L)=>H.check(r2H(...L)),H.toLowerCase=()=>H.check(o2H()),H.toUpperCase=()=>H.check(t2H())}),HwH=LA("ZodString",(H,$)=>{w$H.init(H,$),hp$.init(H,$),H.email=(A)=>H.check(DsH(bp$,A)),H.url=(A)=>H.check(GsH(kp$,A)),H.jwt=(A)=>H.check(qsH(Hd$,A)),H.emoji=(A)=>H.check(UsH(gp$,A)),H.guid=(A)=>H.check(u2H(RsH,A)),H.uuid=(A)=>H.check(BsH(yk,A)),H.uuidv4=(A)=>H.check(fsH(yk,A)),H.uuidv6=(A)=>H.check(EsH(yk,A)),H.uuidv7=(A)=>H.check(MsH(yk,A)),H.nanoid=(A)=>H.check(XsH(mp$,A)),H.guid=(A)=>H.check(u2H(RsH,A)),H.cuid=(A)=>H.check(JsH(pp$,A)),H.cuid2=(A)=>H.check(FsH(dp$,A)),H.ulid=(A)=>H.check(KsH(cp$,A)),H.base64=(A)=>H.check(CsH(tp$,A)),H.base64url=(A)=>H.check(wsH(sp$,A)),H.xid=(A)=>H.check(QsH(lp$,A)),H.ksuid=(A)=>H.check(WsH(ip$,A)),H.ipv4=(A)=>H.check(VsH(np$,A)),H.ipv6=(A)=>H.check(PsH(rp$,A)),H.cidrv4=(A)=>H.check(_sH(ap$,A)),H.cidrv6=(A)=>H.check(YsH(op$,A)),H.e164=(A)=>H.check(ZsH(ep$,A)),H.datetime=(A)=>H.check(qp$(A)),H.date=(A)=>H.check(Tp$(A)),H.time=(A)=>H.check(zp$(A)),H.duration=(A)=>H.check(Np$(A))});iG=LA("ZodStringFormat",(H,$)=>{rM.init(H,$),hp$.init(H,$)}),bp$=LA("ZodEmail",(H,$)=>{nu$.init(H,$),iG.init(H,$)});RsH=LA("ZodGUID",(H,$)=>{lu$.init(H,$),iG.init(H,$)});yk=LA("ZodUUID",(H,$)=>{iu$.init(H,$),iG.init(H,$)});kp$=LA("ZodURL",(H,$)=>{ru$.init(H,$),iG.init(H,$)});gp$=LA("ZodEmoji",(H,$)=>{au$.init(H,$),iG.init(H,$)});mp$=LA("ZodNanoID",(H,$)=>{ou$.init(H,$),iG.init(H,$)});pp$=LA("ZodCUID",(H,$)=>{tu$.init(H,$),iG.init(H,$)});dp$=LA("ZodCUID2",(H,$)=>{su$.init(H,$),iG.init(H,$)});cp$=LA("ZodULID",(H,$)=>{eu$.init(H,$),iG.init(H,$)});lp$=LA("ZodXID",(H,$)=>{Hg$.init(H,$),iG.init(H,$)});ip$=LA("ZodKSUID",(H,$)=>{$g$.init(H,$),iG.init(H,$)});np$=LA("ZodIPv4",(H,$)=>{Bg$.init(H,$),iG.init(H,$)});rp$=LA("ZodIPv6",(H,$)=>{fg$.init(H,$),iG.init(H,$)});ap$=LA("ZodCIDRv4",(H,$)=>{Eg$.init(H,$),iG.init(H,$)});op$=LA("ZodCIDRv6",(H,$)=>{Mg$.init(H,$),iG.init(H,$)});tp$=LA("ZodBase64",(H,$)=>{Ug$.init(H,$),iG.init(H,$)});sp$=LA("ZodBase64URL",(H,$)=>{Xg$.init(H,$),iG.init(H,$)});ep$=LA("ZodE164",(H,$)=>{Jg$.init(H,$),iG.init(H,$)});Hd$=LA("ZodJWT",(H,$)=>{Fg$.init(H,$),iG.init(H,$)});U0L=LA("ZodCustomStringFormat",(H,$)=>{Kg$.init(H,$),iG.init(H,$)});$wH=LA("ZodNumber",(H,$)=>{HsH.init(H,$),s1.init(H,$),H.gt=(L,I)=>H.check(Sk(L,I)),H.gte=(L,I)=>H.check(y_(L,I)),H.min=(L,I)=>H.check(y_(L,I)),H.lt=(L,I)=>H.check(xk(L,I)),H.lte=(L,I)=>H.check(aZ(L,I)),H.max=(L,I)=>H.check(aZ(L,I)),H.int=(L)=>H.check(vp$(L)),H.safe=(L)=>H.check(vp$(L)),H.positive=(L)=>H.check(Sk(0,L)),H.nonnegative=(L)=>H.check(y_(0,L)),H.negative=(L)=>H.check(xk(0,L)),H.nonpositive=(L)=>H.check(aZ(0,L)),H.multipleOf=(L,I)=>H.check(q$H(L,I)),H.step=(L,I)=>H.check(q$H(L,I)),H.finite=()=>H;let A=H._zod.bag;H.minValue=Math.max(A.minimum??Number.NEGATIVE_INFINITY,A.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,H.maxValue=Math.min(A.maximum??Number.POSITIVE_INFINITY,A.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,H.isInt=(A.format??"").includes("int")||Number.isSafeInteger(A.multipleOf??0.5),H.isFinite=!0,H.format=A.format??null});FGH=LA("ZodNumberFormat",(H,$)=>{Qg$.init(H,$),$wH.init(H,$)});AwH=LA("ZodBoolean",(H,$)=>{j2H.init(H,$),s1.init(H,$)});LwH=LA("ZodBigInt",(H,$)=>{$sH.init(H,$),s1.init(H,$),H.gte=(L,I)=>H.check(y_(L,I)),H.min=(L,I)=>H.check(y_(L,I)),H.gt=(L,I)=>H.check(Sk(L,I)),H.gte=(L,I)=>H.check(y_(L,I)),H.min=(L,I)=>H.check(y_(L,I)),H.lt=(L,I)=>H.check(xk(L,I)),H.lte=(L,I)=>H.check(aZ(L,I)),H.max=(L,I)=>H.check(aZ(L,I)),H.positive=(L)=>H.check(Sk(BigInt(0),L)),H.negative=(L)=>H.check(xk(BigInt(0),L)),H.nonpositive=(L)=>H.check(aZ(BigInt(0),L)),H.nonnegative=(L)=>H.check(y_(BigInt(0),L)),H.multipleOf=(L,I)=>H.check(q$H(L,I));let A=H._zod.bag;H.minValue=A.minimum??null,H.maxValue=A.maximum??null,H.format=A.format??null});$d$=LA("ZodBigIntFormat",(H,$)=>{Wg$.init(H,$),LwH.init(H,$)});X0L=LA("ZodSymbol",(H,$)=>{Vg$.init(H,$),s1.init(H,$)});J0L=LA("ZodUndefined",(H,$)=>{Pg$.init(H,$),s1.init(H,$)});F0L=LA("ZodNull",(H,$)=>{_g$.init(H,$),s1.init(H,$)});K0L=LA("ZodAny",(H,$)=>{Yg$.init(H,$),s1.init(H,$)});Q0L=LA("ZodUnknown",(H,$)=>{BGH.init(H,$),s1.init(H,$)});W0L=LA("ZodNever",(H,$)=>{Cg$.init(H,$),s1.init(H,$)});V0L=LA("ZodVoid",(H,$)=>{wg$.init(H,$),s1.init(H,$)});bsH=LA("ZodDate",(H,$)=>{Zg$.init(H,$),s1.init(H,$),H.min=(L,I)=>H.check(y_(L,I)),H.max=(L,I)=>H.check(aZ(L,I));let A=H._zod.bag;H.minDate=A.minimum?new Date(A.minimum):null,H.maxDate=A.maximum?new Date(A.maximum):null});P0L=LA("ZodArray",(H,$)=>{R2H.init(H,$),s1.init(H,$),H.element=$.element,H.min=(A,L)=>H.check(Yl(A,L)),H.nonempty=(A)=>H.check(Yl(1,A)),H.max=(A,L)=>H.check(GGH(A,L)),H.length=(A,L)=>H.check(UGH(A,L)),H.unwrap=()=>H.element});ksH=LA("ZodObject",(H,$)=>{qg$.init(H,$),s1.init(H,$),OI.defineLazy(H,"shape",()=>$.shape),H.keyof=()=>GQ(Object.keys(H._zod.def.shape)),H.catchall=(A)=>H.clone({...H._zod.def,catchall:A}),H.passthrough=()=>H.clone({...H._zod.def,catchall:eX()}),H.loose=()=>H.clone({...H._zod.def,catchall:eX()}),H.strict=()=>H.clone({...H._zod.def,catchall:hsH()}),H.strip=()=>H.clone({...H._zod.def,catchall:void 0}),H.extend=(A)=>{return OI.extend(H,A)},H.merge=(A)=>OI.merge(H,A),H.pick=(A)=>OI.pick(H,A),H.omit=(A)=>OI.omit(H,A),H.partial=(...A)=>OI.partial(fd$,H,A[0]),H.required=(...A)=>OI.required(Ed$,H,A[0])});Ld$=LA("ZodUnion",(H,$)=>{AsH.init(H,$),s1.init(H,$),H.options=$.options});_0L=LA("ZodDiscriminatedUnion",(H,$)=>{Ld$.init(H,$),Tg$.init(H,$)});Y0L=LA("ZodIntersection",(H,$)=>{zg$.init(H,$),s1.init(H,$)});C0L=LA("ZodTuple",(H,$)=>{Z$H.init(H,$),s1.init(H,$),H.rest=(A)=>H.clone({...H._zod.def,rest:A})});Id$=LA("ZodRecord",(H,$)=>{Ng$.init(H,$),s1.init(H,$),H.keyType=$.keyType,H.valueType=$.valueType});w0L=LA("ZodMap",(H,$)=>{Og$.init(H,$),s1.init(H,$),H.keyType=$.keyType,H.valueType=$.valueType});Z0L=LA("ZodSet",(H,$)=>{xg$.init(H,$),s1.init(H,$),H.min=(...A)=>H.check(T$H(...A)),H.nonempty=(A)=>H.check(T$H(1,A)),H.max=(...A)=>H.check(MGH(...A)),H.size=(...A)=>H.check(g2H(...A))});e2H=LA("ZodEnum",(H,$)=>{Sg$.init(H,$),s1.init(H,$),H.enum=$.entries,H.options=Object.values($.entries);let A=new Set(Object.keys($.entries));H.extract=(L,I)=>{let D={};for(let B of L)if(A.has(B))D[B]=$.entries[B];else throw Error(`Key ${B} not found in enum`);return new e2H({...$,checks:[],...OI.normalizeParams(I),entries:D})},H.exclude=(L,I)=>{let D={...$.entries};for(let B of L)if(A.has(B))delete D[B];else throw Error(`Key ${B} not found in enum`);return new e2H({...$,checks:[],...OI.normalizeParams(I),entries:D})}});q0L=LA("ZodLiteral",(H,$)=>{jg$.init(H,$),s1.init(H,$),H.values=new Set($.values),Object.defineProperty(H,"value",{get(){if($.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return $.values[0]}})});T0L=LA("ZodFile",(H,$)=>{Rg$.init(H,$),s1.init(H,$),H.min=(A,L)=>H.check(T$H(A,L)),H.max=(A,L)=>H.check(MGH(A,L)),H.mime=(A,L)=>H.check(n2H(Array.isArray(A)?A:[A],L))});Dd$=LA("ZodTransform",(H,$)=>{y2H.init(H,$),s1.init(H,$),H._zod.parse=(A,L)=>{A.addIssue=(D)=>{if(typeof D==="string")A.issues.push(OI.issue(D,A.value,$));else{let B=D;if(B.fatal)B.continue=!1;B.code??(B.code="custom"),B.input??(B.input=A.value),B.inst??(B.inst=H),B.continue??(B.continue=!0),A.issues.push(OI.issue(B))}};let I=$.transform(A.value,A);if(I instanceof Promise)return I.then((D)=>{return A.value=D,A});return A.value=I,A}});fd$=LA("ZodOptional",(H,$)=>{yg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});z0L=LA("ZodNullable",(H,$)=>{vg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});N0L=LA("ZodDefault",(H,$)=>{hg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType,H.removeDefault=H.unwrap});x0L=LA("ZodPrefault",(H,$)=>{bg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});Ed$=LA("ZodNonOptional",(H,$)=>{kg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});R0L=LA("ZodSuccess",(H,$)=>{ug$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});y0L=LA("ZodCatch",(H,$)=>{gg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType,H.removeCatch=H.unwrap});h0L=LA("ZodNaN",(H,$)=>{mg$.init(H,$),s1.init(H,$)});Md$=LA("ZodPipe",(H,$)=>{v2H.init(H,$),s1.init(H,$),H.in=$.in,H.out=$.out});b0L=LA("ZodReadonly",(H,$)=>{pg$.init(H,$),s1.init(H,$)});u0L=LA("ZodTemplateLiteral",(H,$)=>{dg$.init(H,$),s1.init(H,$)});g0L=LA("ZodLazy",(H,$)=>{lg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.getter()});p0L=LA("ZodPromise",(H,$)=>{cg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});gsH=LA("ZodCustom",(H,$)=>{ig$.init(H,$),s1.init(H,$)})});function BiB(H){$F({customError:H})}function fiB(){return $F().customError}var Ud$;var i0L=K(()=>{VV();Ud$={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var BwH={};XA(BwH,{string:()=>EiB,number:()=>MiB,date:()=>XiB,boolean:()=>GiB,bigint:()=>UiB});function EiB(H){return hm$(HwH,H)}function MiB(H){return dm$($wH,H)}function GiB(H){return om$(AwH,H)}function UiB(H){return sm$(LwH,H)}function XiB(H){return Ep$(bsH,H)}var n0L=K(()=>{VV();jsH()});var S={};XA(S,{xid:()=>ClB,void:()=>plB,uuidv7:()=>QlB,uuidv6:()=>KlB,uuidv4:()=>FlB,uuid:()=>JlB,url:()=>up$,uppercase:()=>d2H,unknown:()=>eX,union:()=>TM,undefined:()=>mlB,ulid:()=>YlB,uint64:()=>ulB,uint32:()=>hlB,tuple:()=>ilB,trim:()=>a2H,treeifyError:()=>ik$,transform:()=>Bd$,toUpperCase:()=>t2H,toLowerCase:()=>o2H,toJSONSchema:()=>Rk,templateLiteral:()=>$iB,symbol:()=>glB,superRefine:()=>l0L,success:()=>elB,stringbool:()=>IiB,stringFormat:()=>jlB,string:()=>N$,strictObject:()=>llB,startsWith:()=>l2H,size:()=>g2H,setErrorMap:()=>BiB,set:()=>alB,safeParseAsync:()=>Rp$,safeParse:()=>jp$,registry:()=>IsH,regexes:()=>C$H,regex:()=>m2H,refine:()=>c0L,record:()=>MX,readonly:()=>k0L,property:()=>Fp$,promise:()=>AiB,prettifyError:()=>nk$,preprocess:()=>msH,prefault:()=>S0L,positive:()=>Gp$,pipe:()=>vsH,partialRecord:()=>nlB,parseAsync:()=>Sp$,parse:()=>xp$,overwrite:()=>jk,optional:()=>MB,object:()=>LI,number:()=>df,nullish:()=>slB,nullable:()=>ysH,null:()=>IwH,normalize:()=>r2H,nonpositive:()=>Xp$,nonoptional:()=>j0L,nonnegative:()=>Jp$,never:()=>hsH,negative:()=>Up$,nativeEnum:()=>olB,nanoid:()=>VlB,nan:()=>HiB,multipleOf:()=>q$H,minSize:()=>T$H,minLength:()=>Yl,mime:()=>n2H,maxSize:()=>MGH,maxLength:()=>GGH,map:()=>rlB,lte:()=>aZ,lt:()=>xk,lowercase:()=>p2H,looseObject:()=>RW,locales:()=>fGH,literal:()=>sD,length:()=>UGH,lazy:()=>m0L,ksuid:()=>wlB,keyof:()=>clB,jwt:()=>SlB,json:()=>DiB,iso:()=>XGH,ipv6:()=>qlB,ipv4:()=>ZlB,intersection:()=>DwH,int64:()=>klB,int32:()=>vlB,int:()=>vp$,instanceof:()=>LiB,includes:()=>c2H,guid:()=>XlB,gte:()=>y_,gt:()=>Sk,globalRegistry:()=>wR,getErrorMap:()=>fiB,function:()=>wp$,formatError:()=>N2H,float64:()=>ylB,float32:()=>RlB,flattenError:()=>z2H,file:()=>tlB,enum:()=>GQ,endsWith:()=>i2H,emoji:()=>WlB,email:()=>UlB,e164:()=>xlB,discriminatedUnion:()=>usH,date:()=>dlB,custom:()=>Gd$,cuid2:()=>_lB,cuid:()=>PlB,core:()=>ZR,config:()=>$F,coerce:()=>BwH,clone:()=>f2,cidrv6:()=>zlB,cidrv4:()=>TlB,check:()=>d0L,catch:()=>v0L,boolean:()=>qM,bigint:()=>blB,base64url:()=>OlB,base64:()=>NlB,array:()=>xI,any:()=>Ad$,_default:()=>O0L,_ZodString:()=>hp$,ZodXID:()=>lp$,ZodVoid:()=>V0L,ZodUnknown:()=>Q0L,ZodUnion:()=>Ld$,ZodUndefined:()=>J0L,ZodUUID:()=>yk,ZodURL:()=>kp$,ZodULID:()=>cp$,ZodType:()=>s1,ZodTuple:()=>C0L,ZodTransform:()=>Dd$,ZodTemplateLiteral:()=>u0L,ZodSymbol:()=>X0L,ZodSuccess:()=>R0L,ZodStringFormat:()=>iG,ZodString:()=>HwH,ZodSet:()=>Z0L,ZodRecord:()=>Id$,ZodRealError:()=>JGH,ZodReadonly:()=>b0L,ZodPromise:()=>p0L,ZodPrefault:()=>x0L,ZodPipe:()=>Md$,ZodOptional:()=>fd$,ZodObject:()=>ksH,ZodNumberFormat:()=>FGH,ZodNumber:()=>$wH,ZodNullable:()=>z0L,ZodNull:()=>F0L,ZodNonOptional:()=>Ed$,ZodNever:()=>W0L,ZodNanoID:()=>mp$,ZodNaN:()=>h0L,ZodMap:()=>w0L,ZodLiteral:()=>q0L,ZodLazy:()=>g0L,ZodKSUID:()=>ip$,ZodJWT:()=>Hd$,ZodIssueCode:()=>Ud$,ZodIntersection:()=>Y0L,ZodISOTime:()=>OsH,ZodISODuration:()=>xsH,ZodISODateTime:()=>zsH,ZodISODate:()=>NsH,ZodIPv6:()=>rp$,ZodIPv4:()=>np$,ZodGUID:()=>RsH,ZodFile:()=>T0L,ZodError:()=>MlB,ZodEnum:()=>e2H,ZodEmoji:()=>gp$,ZodEmail:()=>bp$,ZodE164:()=>ep$,ZodDiscriminatedUnion:()=>_0L,ZodDefault:()=>N0L,ZodDate:()=>bsH,ZodCustomStringFormat:()=>U0L,ZodCustom:()=>gsH,ZodCatch:()=>y0L,ZodCUID2:()=>dp$,ZodCUID:()=>pp$,ZodCIDRv6:()=>op$,ZodCIDRv4:()=>ap$,ZodBoolean:()=>AwH,ZodBigIntFormat:()=>$d$,ZodBigInt:()=>LwH,ZodBase64URL:()=>sp$,ZodBase64:()=>tp$,ZodArray:()=>P0L,ZodAny:()=>K0L,TimePrecision:()=>bm$,NEVER:()=>V2H,$output:()=>jm$,$input:()=>Rm$,$brand:()=>vk$});var Xd$=K(()=>{VV();VV();eg$();VV();LsH();SsH();SsH();n0L();jsH();Zp$();Op$();yp$();i0L();$F(b2H())});var r0L;var Jd$=K(()=>{Xd$();Xd$();r0L=S});var QD;var mI=K(()=>{Jd$();Jd$();QD=r0L});var z$H,JiB,qR;var Fd$=K(()=>{z$H=["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"],JiB=[...z$H],qR=JiB});function N$H(H){switch(H){case"acceptEdits":case"bypassPermissions":case"default":case"delegate":case"dontAsk":case"plan":return H}}function hN(H){switch(H){case"bypassPermissions":return"bypassPermissions";case"acceptEdits":return"acceptEdits";case"plan":return"plan";case"delegate":return"delegate";case"dontAsk":return"dontAsk";case"default":return"default";default:return"default"}}function vk(H){switch(H){case"default":return"Default";case"plan":return"Plan Mode";case"delegate":return"Delegate Mode";case"acceptEdits":return"Accept edits";case"bypassPermissions":return"Bypass Permissions";case"dontAsk":return"Don't Ask"}}function s0L(H){return H==="default"||H===void 0}function fwH(H){switch(H){case"default":return"";case"plan":return"\u23F8";case"delegate":return"\u21E2";case"acceptEdits":return"\u23F5\u23F5";case"bypassPermissions":return"\u23F5\u23F5";case"dontAsk":return"\u23F5\u23F5"}}function q6(H){switch(H){case"default":return"text";case"plan":return"planMode";case"delegate":return"delegateMode";case"acceptEdits":return"autoAccept";case"bypassPermissions":return"error";case"dontAsk":return"error"}}var o0L,t0L;var yW=K(()=>{mI();Fd$();o0L=QD.enum(qR),t0L=QD.enum(z$H)});function FiB(H){return H.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function KiB(H){return H.replace(/\\\(/g,"(").replace(/\\\)/g,")").replace(/\\\\/g,"\\")}function T6(H){let $=QiB(H,"(");if($===-1)return{toolName:H};let A=WiB(H,")");if(A===-1||A<=$)return{toolName:H};if(A!==H.length-1)return{toolName:H};let L=H.substring(0,$),I=H.substring($+1,A);if(!L)return{toolName:H};if(I===""||I==="*")return{toolName:L};let D=KiB(I);return{toolName:L,ruleContent:D}}function X8(H){if(!H.ruleContent)return H.toolName;let $=FiB(H.ruleContent);return`${H.toolName}(${$})`}function QiB(H,$){for(let A=0;A=0&&H[I]==="\\")L++,I--;if(L%2===0)return A}return-1}function WiB(H,$){for(let A=H.length-1;A>=0;A--)if(H[A]===$){let L=0,I=A-1;while(I>=0&&H[I]==="\\")L++,I--;if(L%2===0)return A}return-1}function e0L(H){return Kd$.filePatternTools.includes(H)}function H9L(H){return Kd$.bashPrefixTools.includes(H)}function $9L(H){return Kd$.customValidation[H]}var Kd$;var A9L=K(()=>{Kd$={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(H)=>{if(H.includes("*")||H.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(H)=>{if(H.includes("://")||H.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!H.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}}});function L9L(H,$){let A=0,L=$-1;while(L>=0&&H[L]==="\\")A++,L--;return A%2!==0}function Qd$(H,$){let A=0;for(let L=0;L0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${L.toolName}" without parentheses, or use "mcp__${I.serverName}__*" for all tools`,examples:[`mcp__${I.serverName}`,`mcp__${I.serverName}__*`,I.toolName&&I.toolName!=="*"?`mcp__${I.serverName}__${I.toolName}`:void 0].filter(Boolean)};return{valid:!0}}if(!L.toolName||L.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(L.toolName[0]!==L.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${String(L.toolName).charAt(0).toUpperCase()+String(L.toolName).slice(1)}"`};let D=$9L(L.toolName);if(D&&L.ruleContent!==void 0){let B=D(L.ruleContent);if(!B.valid)return B}if(H9L(L.toolName)&&L.ruleContent!==void 0){let B=L.ruleContent;if(B.includes(":*")&&!B.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(B===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm:*)","Bash(git:*)"]}}if(e0L(L.toolName)&&L.ruleContent!==void 0){let B=L.ruleContent;if(B.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${L.toolName}(*.ts) - matches .ts files`,`${L.toolName}(src/**) - matches all files in src`,`${L.toolName}(**/*.test.ts) - matches test files`]};if(B.includes("*")&&!B.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!B.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${L.toolName}(*.js) - all .js files`,`${L.toolName}(src/*) - all files directly in src`,`${L.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var psH;var I9L=K(()=>{mI();tC();A9L();psH=S.string().superRefine((H,$)=>{let A=PiB(H);if(!A.valid){let L=A.error;if(A.suggestion)L+=`. ${A.suggestion}`;if(A.examples&&A.examples.length>0)L+=`. Examples: ${A.examples.join(", ")}`;$.addIssue({code:S.ZodIssueCode.custom,message:L,params:{received:H}})}})});var TR;var D9L=K(()=>{TR=["PreToolUse","PostToolUse","PostToolUseFailure","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","SubagentStart","SubagentStop","PreCompact","PermissionRequest","Setup","TeammateIdle","TaskCompleted"]});var B9L=()=>{};var KGH=K(()=>{D9L();B9L()});var _iB,YiB,CiB,f9L,E9L,oZ;var dsH=K(()=>{mI();KGH();_iB=S.object({type:S.literal("command").describe("Bash command hook type"),command:S.string().describe("Shell command to execute"),timeout:S.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:S.string().optional().describe("Custom status message to display in spinner while hook runs"),once:S.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:S.boolean().optional().describe("If true, hook runs in background without blocking")}),YiB=S.object({type:S.literal("prompt").describe("LLM prompt hook type"),prompt:S.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),timeout:S.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:S.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-5-20250929"). If not specified, uses the default small fast model.'),statusMessage:S.string().optional().describe("Custom status message to display in spinner while hook runs"),once:S.boolean().optional().describe("If true, hook runs once and is removed after execution")}),CiB=S.object({type:S.literal("agent").describe("Agentic verifier hook type"),prompt:S.string().transform((H)=>($)=>H).describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),timeout:S.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:S.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-5-20250929"). If not specified, uses Haiku.'),statusMessage:S.string().optional().describe("Custom status message to display in spinner while hook runs"),once:S.boolean().optional().describe("If true, hook runs once and is removed after execution")}),f9L=S.discriminatedUnion("type",[_iB,YiB,CiB]),E9L=S.object({matcher:S.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:S.array(f9L).describe("List of hooks to execute when the matcher matches")}),oZ=S.partialRecord(S.enum(TR),S.array(E9L))});var Wd$,A98,Vd$,M9L,wiB,ZiB,qiB,TiB,ziB,NiB,OiB,zR,G9L;var O$H=K(()=>{mI();Wd$=S.enum(["local","user","project","dynamic","enterprise","claudeai","managed"]),A98=S.enum(["stdio","sse","sse-ide","http","ws","sdk"]),Vd$=S.object({type:S.literal("stdio").optional(),command:S.string().min(1,"Command cannot be empty"),args:S.array(S.string()).default([]),env:S.record(S.string(),S.string()).optional()}),M9L=S.object({clientId:S.string(),callbackPort:S.number().int().positive().optional()}),wiB=S.object({type:S.literal("sse"),url:S.string(),headers:S.record(S.string(),S.string()).optional(),headersHelper:S.string().optional(),oauth:M9L.optional()}),ZiB=S.object({type:S.literal("sse-ide"),url:S.string(),ideName:S.string(),ideRunningInWindows:S.boolean().optional()}),qiB=S.object({type:S.literal("ws-ide"),url:S.string(),ideName:S.string(),authToken:S.string().optional(),ideRunningInWindows:S.boolean().optional()}),TiB=S.object({type:S.literal("http"),url:S.string(),headers:S.record(S.string(),S.string()).optional(),headersHelper:S.string().optional(),oauth:M9L.optional()}),ziB=S.object({type:S.literal("ws"),url:S.string(),headers:S.record(S.string(),S.string()).optional(),headersHelper:S.string().optional()}),NiB=S.object({type:S.literal("sdk"),name:S.string()}),OiB=S.object({type:S.literal("claudeai-proxy"),url:S.string(),id:S.string()}),zR=S.union([Vd$,wiB,ZiB,qiB,TiB,ziB,NiB,OiB]),G9L=S.object({mcpServers:S.record(S.string(),zR)})});function EwH(H,$){let A=H.toLowerCase();return $.autoUpdate??(M2.has(A)&&!xiB.has(A))}function RiB(H){if(M2.has(H.toLowerCase()))return!1;if(jiB.test(H))return!0;return SiB.test(H)}function F9L(H,$){let A=H.toLowerCase();if(!M2.has(A))return null;if($.source==="github"){if(!($.repo||"").toLowerCase().startsWith(`${csH}/`))return`The name '${H}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${csH}/' can use this name.`;return null}if($.source==="git"&&$.url){let L=$.url.toLowerCase(),I=L.includes("github.com/anthropics/"),D=L.includes("git@github.com:anthropics/");if(I||D)return null;return`The name '${H}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${csH}/' can use this name.`}return`The name '${H}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${csH}' organization.`}function NR(H){return typeof H==="string"&&H.startsWith("./")}var M2,xiB,SiB,jiB,csH="anthropics",hk,QGH,U9L,Pd$,_d$,K9L,yiB,Q9L,viB,hiB,biB,kiB,uiB,giB,miB,X9L,piB,WGH,diB,S$H,W9L,MwH,J9L,ciB,liB,VGH,x$H,f98,iiB,GwH,niB,riB,UwH,E98,aiB,Yd$;var UQ=K(()=>{mI();dsH();O$H();M2=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),xiB=new Set(["knowledge-work-plugins"]);SiB=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,jiB=/[^\u0020-\u007E]/;hk=S.string().startsWith("./"),QGH=hk.endsWith(".json"),U9L=S.union([hk.refine((H)=>H.endsWith(".mcpb")||H.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),S.string().url().refine((H)=>H.endsWith(".mcpb")||H.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")]),Pd$=hk.endsWith(".md"),_d$=S.union([Pd$,hk]),K9L=S.object({name:S.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:S.string().optional().describe("Contact email for support or feedback"),url:S.string().optional().describe("Website, GitHub profile, or organization URL")}),yiB=S.object({name:S.string().min(1,"Plugin name cannot be empty").refine((H)=>!H.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),version:S.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:S.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:K9L.optional().describe("Information about the plugin creator or maintainer"),homepage:S.string().url().optional().describe("Plugin homepage or documentation URL"),repository:S.string().optional().describe("Source code repository URL"),license:S.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:S.array(S.string()).optional().describe("Tags for plugin discovery and categorization")}),Q9L=S.object({description:S.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:S.lazy(()=>oZ).describe("The hooks provided by the plugin, in the same format as the one used for settings")}),viB=S.object({hooks:S.union([QGH.describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),S.lazy(()=>oZ).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),S.array(S.union([QGH.describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),S.lazy(()=>oZ).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])}),hiB=S.object({source:_d$.optional().describe("Path to command markdown file, relative to plugin root"),content:S.string().optional().describe("Inline markdown content for the command"),description:S.string().optional().describe("Command description override"),argumentHint:S.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:S.string().optional().describe("Default model for this command"),allowedTools:S.array(S.string()).optional().describe("Tools allowed when command runs")}).refine((H)=>H.source&&!H.content||!H.source&&H.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'}),biB=S.object({commands:S.union([_d$.describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root"),S.array(_d$.describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional command files or skill directories"),S.record(S.string(),hiB).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])}),kiB=S.object({agents:S.union([Pd$.describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),S.array(Pd$.describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional agent files")])}),uiB=S.object({skills:S.union([hk.describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root"),S.array(hk.describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional skill directories")])}),giB=S.object({outputStyles:S.union([hk.describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root"),S.array(hk.describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional output styles directories or files")])}),miB=S.object({mcpServers:S.union([QGH.describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),U9L.describe("Path or URL to MCPB file containing MCP server configuration"),S.record(S.string(),zR).describe("MCP server configurations keyed by server name"),S.array(S.union([QGH.describe("Path to MCP servers configuration file"),U9L.describe("Path or URL to MCPB file"),S.record(S.string(),zR).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])}),X9L=S.string().min(1),piB=S.string().min(2).refine((H)=>H.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'}),WGH=S.strictObject({command:S.string().min(1).refine((H)=>{if(H.includes(" ")&&!H.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:S.array(X9L).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:S.record(piB,X9L).refine((H)=>Object.keys(H).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:S.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:S.record(S.string(),S.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:S.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:S.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:S.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:S.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:S.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:S.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:S.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")}),diB=S.object({lspServers:S.union([QGH.describe("Path to .lsp.json configuration file relative to plugin root"),S.record(S.string(),WGH).describe("LSP server configurations keyed by server name"),S.array(S.union([QGH.describe("Path to LSP configuration file"),S.record(S.string(),WGH).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])}),S$H=S.object({...yiB.shape,...viB.partial().shape,...biB.partial().shape,...kiB.partial().shape,...uiB.partial().shape,...giB.partial().shape,...miB.partial().shape,...diB.partial().shape}).strict(),W9L=S.string().refine((H)=>!H.includes("..")&&!H.includes("//"),"Package name cannot contain path traversal patterns").refine((H)=>{let $=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,A=/^[a-z0-9][a-z0-9-._]*$/;return $.test(H)||A.test(H)},"Invalid npm package name format"),MwH=S.discriminatedUnion("source",[S.object({source:S.literal("url"),url:S.string().url().describe("Direct URL to marketplace.json file"),headers:S.record(S.string(),S.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),S.object({source:S.literal("github"),repo:S.string().describe("GitHub repository in owner/repo format"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:S.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)")}),S.object({source:S.literal("git"),url:S.string().endsWith(".git").describe("Full git repository URL"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:S.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)")}),S.object({source:S.literal("npm"),package:W9L.describe("NPM package containing marketplace.json")}),S.object({source:S.literal("file"),path:S.string().describe("Local file path to marketplace.json")}),S.object({source:S.literal("directory"),path:S.string().describe("Local directory containing .claude-plugin/marketplace.json")}),S.object({source:S.literal("hostPattern"),hostPattern:S.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')})]),J9L=S.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA"),ciB=S.union([hk.describe("Path to the plugin root, relative to the marketplace directory"),S.object({source:S.literal("npm"),package:W9L.or(S.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:S.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:S.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),S.object({source:S.literal("pip"),package:S.string().describe("Python package name as it appears on PyPI"),version:S.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:S.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),S.object({source:S.literal("url"),url:S.string().endsWith(".git").describe("Full git repository URL (https:// or git@)"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:J9L.optional().describe("Specific commit SHA to use")}),S.object({source:S.literal("github"),repo:S.string().describe("GitHub repository in owner/repo format"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:J9L.optional().describe("Specific commit SHA to use")})]);liB=S$H.partial().extend({name:S.string().min(1,"Plugin name cannot be empty").refine((H)=>!H.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:ciB.describe("Where to fetch the plugin from"),category:S.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:S.array(S.string()).optional().describe("Tags for searchability and discovery"),strict:S.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.")}).strict(),VGH=S.object({name:S.string().min(1,"Marketplace must have a name").refine((H)=>!H.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((H)=>!RiB(H),{message:'Marketplace name cannot impersonate official Anthropic/Claude marketplaces. Names containing "official", "anthropic", or "claude" in official-sounding combinations are reserved.'}),owner:K9L.describe("Marketplace maintainer or curator information"),plugins:S.array(liB).describe("Collection of available plugins in this marketplace"),metadata:S.object({pluginRoot:S.string().optional().describe("Base path for relative plugin sources"),version:S.string().optional().describe("Marketplace version"),description:S.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata")}),x$H=S.string().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,"Plugin ID must be in format: plugin@marketplace"),f98=S.union([x$H,S.object({id:x$H.describe('Plugin identifier (e.g., "formatter@tools")'),version:S.string().optional().describe('Version constraint (e.g., "^2.0.0")'),required:S.boolean().optional().describe("If true, cannot be disabled"),config:S.record(S.string(),S.unknown()).optional().describe("Plugin-specific configuration")})]),iiB=S.object({version:S.string().describe("Currently installed version"),installedAt:S.string().describe("ISO 8601 timestamp of installation"),lastUpdated:S.string().optional().describe("ISO 8601 timestamp of last update"),installPath:S.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:S.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)")}),GwH=S.object({version:S.literal(1).describe("Schema version 1"),plugins:S.record(x$H,iiB).describe("Map of plugin IDs to their installation metadata")}),niB=S.enum(["managed","user","project","local"]),riB=S.object({scope:niB.describe("Installation scope"),projectPath:S.string().optional().describe("Project path (required for project/local scopes)"),installPath:S.string().describe("Absolute path to the versioned plugin directory"),version:S.string().optional().describe("Currently installed version"),installedAt:S.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:S.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:S.string().optional().describe("Git commit SHA for git-based plugins")}),UwH=S.object({version:S.literal(2).describe("Schema version 2"),plugins:S.record(x$H,S.array(riB)).describe("Map of plugin IDs to arrays of installation entries")}),E98=S.union([GwH,UwH]),aiB=S.object({source:MwH.describe("Where to fetch the marketplace from"),installLocation:S.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:S.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:S.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")}),Yd$=S.record(S.string(),aiB)});var oiB,V9L;var P9L=K(()=>{mI();oiB=S.object({allowedDomains:S.array(S.string()).optional(),allowManagedDomainsOnly:S.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:S.array(S.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:S.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:S.boolean().optional(),httpProxyPort:S.number().optional(),socksProxyPort:S.number().optional()}).optional(),V9L=S.object({enabled:S.boolean().optional(),autoAllowBashIfSandboxed:S.boolean().optional(),allowUnsandboxedCommands:S.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:oiB,ignoreViolations:S.record(S.string(),S.array(S.string())).optional(),enableWeakerNestedSandbox:S.boolean().optional(),excludedCommands:S.array(S.string()).optional(),ripgrep:S.object({command:S.string(),args:S.array(S.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support")}).passthrough()});function PGH(H){return"serverName"in H&&H.serverName!==void 0}function lsH(H){return"serverCommand"in H&&H.serverCommand!==void 0}function isH(H){return"serverUrl"in H&&H.serverUrl!==void 0}var tiB,siB,eiB,HnB,$nB,tZ;var bk=K(()=>{mI();yW();I9L();W4();UQ();P9L();dsH();dsH();tiB=S.record(S.string(),S.coerce.string()),siB=S.object({allow:S.array(psH).optional().describe("List of permission rules for allowed operations"),deny:S.array(psH).optional().describe("List of permission rules for denied operations"),ask:S.array(psH).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:S.enum(z$H).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:S.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),additionalDirectories:S.array(S.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough(),eiB=S.object({source:MwH.describe("Where to fetch the marketplace from"),installLocation:S.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)")}),HnB=S.object({serverName:S.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:S.array(S.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:S.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((H)=>{return[H.serverName!==void 0,H.serverCommand!==void 0,H.serverUrl!==void 0].filter(Boolean).length===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'}),$nB=S.object({serverName:S.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:S.array(S.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:S.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((H)=>{return[H.serverName!==void 0,H.serverCommand!==void 0,H.serverUrl!==void 0].filter(Boolean).length===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'}),tZ=S.object({$schema:S.literal(oDL).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:S.string().optional().describe("Path to a script that outputs authentication values"),awsCredentialExport:S.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:S.string().optional().describe("Path to a script that refreshes AWS authentication"),fileSuggestion:S.object({type:S.literal("command"),command:S.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:S.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),cleanupPeriodDays:S.number().nonnegative().int().optional().describe("Number of days to retain chat transcripts (0 to disable cleanup)"),env:tiB.optional().describe("Environment variables to set for Claude Code sessions"),attribution:S.object({commit:S.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:S.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:S.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),permissions:siB.optional().describe("Tool usage permissions configuration"),model:S.string().optional().describe("Override the default model used by Claude Code"),enableAllProjectMcpServers:S.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:S.array(S.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:S.array(S.string()).optional().describe("List of rejected MCP servers from .mcp.json"),allowedMcpServers:S.array(HnB).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:S.array($nB).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:oZ.optional().describe("Custom commands to run before/after tool executions"),disableAllHooks:S.boolean().optional().describe("Disable all hooks and statusLine execution"),allowManagedHooksOnly:S.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowManagedPermissionRulesOnly:S.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),statusLine:S.object({type:S.literal("command"),command:S.string(),padding:S.number().optional()}).optional().describe("Custom status line display configuration"),enabledPlugins:S.record(S.string(),S.union([S.array(S.string()),S.boolean(),S.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.'),extraKnownMarketplaces:S.record(S.string(),eiB).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),skippedMarketplaces:S.array(S.string()).optional().describe("List of marketplace names the user has chosen not to install when prompted"),skippedPlugins:S.array(S.string()).optional().describe("List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted"),strictKnownMarketplaces:S.array(MwH).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),blockedMarketplaces:S.array(MwH).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),forceLoginMethod:S.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),forceLoginOrgUUID:S.string().optional().describe("Organization UUID to use for OAuth login"),otelHeadersHelper:S.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:S.string().optional().describe("Controls the output style for assistant responses"),language:S.string().optional().describe('Preferred language for Claude responses (e.g., "japanese", "spanish")'),skipWebFetchPreflight:S.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:V9L.optional(),spinnerTipsEnabled:S.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:S.object({mode:S.enum(["append","replace"]),verbs:S.array(S.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),syntaxHighlightingDisabled:S.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:S.boolean().optional().describe("When true, terminal tab title is set from /rename and not auto-updated based on the conversation topic"),alwaysThinkingEnabled:S.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),fastMode:S.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),promptSuggestionEnabled:S.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),agent:S.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:S.array(S.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:S.record(S.string(),S.object({mcpServers:S.record(S.string(),S.record(S.string(),S.union([S.string(),S.number(),S.boolean(),S.array(S.string())]))).optional().describe("User configuration values for MCP servers keyed by server name")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:S.object({defaultEnvironmentId:S.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:S.enum(["latest","stable"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:S.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:S.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),...{},prefersReducedMotion:S.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)")}).passthrough()});async function Cd$(H,$,A,L){try{let I=await _9L.readFile(Y9L.join(H,"config"),"utf-8");return AnB(I,$,A,L)}catch{return null}}function AnB(H,$,A,L){let I=H.split(` `,"utf-8")}catch(A){r(A instanceof Error?A:Error(String(A)))}}var esH,b9L;var Td$=K(()=>{t8();DL();PI();_$();B0();Z$();esH=require("path"),b9L=require("os")});function k9L(H){let $=YnB.find((L)=>L.matches(H));if(!$)return null;let A={...$.tip};if(H.code==="invalid_value"&&H.enumValues&&!A.suggestion)A.suggestion=`Valid values: ${H.enumValues.map((L)=>`"${L}"`).join(", ")}`;if(!A.docLink&&H.path){let L=H.path.split(".")[0];if(L)A.docLink=CnB[L]}return A}var YnB,CnB;var u9L=K(()=>{YnB=[{matches:(H)=>H.path==="permissions.defaultMode"&&H.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:"https://code.claude.com/docs/en/iam#permission-modes"}},{matches:(H)=>H.path==="apiKeyHelper"&&H.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(H)=>H.path==="cleanupPeriodDays"&&H.code==="too_small"&&H.expected==="0",tip:{suggestion:"Must be 0 or greater. Use 0 to disable automatic cleanup and keep chat transcripts forever, or set a positive number for days to retain (default is 30 days)"}},{matches:(H)=>H.path.startsWith("env.")&&H.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:"https://code.claude.com/docs/en/settings#environment-variables"}},{matches:(H)=>(H.path==="permissions.allow"||H.path==="permissions.deny")&&H.code==="invalid_type"&&H.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(H)=>H.path.includes("hooks")&&H.code==="invalid_type",tip:{suggestion:'Hooks use a new format with matchers. Example: {"PostToolUse": [{"matcher": {"tools": ["BashTool"]}, "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(H)=>H.code==="invalid_type"&&H.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(H)=>H.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:"https://code.claude.com/docs/en/settings"}},{matches:(H)=>H.code==="invalid_value"&&H.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(H)=>H.code==="invalid_type"&&H.expected==="object"&&H.received===null&&H.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(H)=>H.path==="permissions.additionalDirectories"&&H.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:"https://code.claude.com/docs/en/iam#working-directories"}}],CnB={permissions:"https://code.claude.com/docs/en/iam#configuring-permissions",env:"https://code.claude.com/docs/en/settings#environment-variables",hooks:"https://code.claude.com/docs/en/hooks"}});function zd$(){let H=Rk(tZ,{unrepresentable:"any"});return yH(H,null,2)}var g9L=K(()=>{mI();bk();Z$()});function m9L(H){return H.code==="invalid_type"}function p9L(H){return H.code==="invalid_value"}function wnB(H){return H.code==="unrecognized_keys"}function d9L(H){return H.code==="too_small"}function Nd$(H){if(H===null)return"null";if(H===void 0)return"undefined";if(Array.isArray(H))return"array";return typeof H}function c9L(H){let $=H.match(/received (\w+)/);return $?$[1]:void 0}function HeH(H,$){return H.issues.map((A)=>{let L=A.path.map(String).join("."),I=A.message,D,B,f,E,M;if(p9L(A))B=A.values.map((U)=>String(U)),f=B.join(" | "),E=void 0,M=void 0;else if(m9L(A)){f=A.expected;let U=c9L(A.message);E=U??Nd$(A.input),M=U??Nd$(A.input)}else if(d9L(A))f=String(A.minimum);else if(A.code==="custom"&&"params"in A)E=A.params.received,M=E;let G=k9L({path:L,code:A.code,expected:f,received:E,enumValues:B,message:A.message,value:E});if(p9L(A))D=B?.map((U)=>`"${U}"`).join(", "),I=`Invalid value. Expected one of: ${D}`;else if(m9L(A)){let U=c9L(A.message)??Nd$(A.input);if(A.expected==="object"&&U==="null"&&L==="")I="Invalid or malformed JSON";else I=`Expected ${A.expected}, but received ${U}`}else if(wnB(A)){let U=A.keys.join(", ");I=`Unrecognized field${A.keys.length>1?"s":""}: ${U}`}else if(d9L(A))I=`Number must be greater than or equal to ${A.minimum}`,D=String(A.minimum);return{file:$,path:L,message:I,expected:D,invalidValue:M,suggestion:G?.suggestion,docLink:G?.docLink}})}function Od$(H){try{let $=DA(H),A=tZ.strict().safeParse($);if(A.success)return{isValid:!0};return{isValid:!1,error:`Settings validation failed: `),fullSchema:zd$()}}catch($){return{isValid:!1,error:`Invalid JSON: ${$ instanceof Error?$.message:"Unknown parsing error"}`,fullSchema:zd$()}}}var xd$=K(()=>{bk();u9L();g9L();Z$()});var l9L,v_;var y$H=K(()=>{tD();Z9();l9L=require("fs"),v_=o$(function(){switch(oA()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":if(l9L.existsSync("C:\\Program Files\\ClaudeCode"))return"C:\\Program Files\\ClaudeCode";return"C:\\ProgramData\\ClaudeCode";default:return"/etc/claude-code"}})});function s9L(H,$={}){let A=$.entryType||$.type;if(A==="both")A=G2.FILE_DIR_TYPE;if(A)$.type=A;if(!H)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof H!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(A&&!i9L.includes(A))throw Error(`readdirp: Invalid type passed. Use one of ${i9L.join(", ")}`);return $.root=H,new t9L($)}var kk,a9L,uk,G2,Sd$,o9L="READDIRP_RECURSIVE_ERROR",ZnB,i9L,qnB,TnB,znB=(H)=>ZnB.has(H.code),NnB=!1,n9L=(H)=>!0,r9L=(H)=>{if(H===void 0)return n9L;if(typeof H==="function")return H;if(typeof H==="string"){let $=H.trim();return(A)=>A.basename===$}if(Array.isArray(H)){let $=H.map((A)=>A.trim());return(A)=>$.some((L)=>A.basename===L)}return n9L},t9L;var e9L=K(()=>{kk=require("fs/promises"),a9L=require("stream"),uk=require("path"),G2={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Sd$={root:".",fileFilter:(H)=>!0,directoryFilter:(H)=>!0,type:G2.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Sd$);ZnB=new Set(["ENOENT","EPERM","EACCES","ELOOP",o9L]),i9L=[G2.DIR_TYPE,G2.EVERYTHING_TYPE,G2.FILE_DIR_TYPE,G2.FILE_TYPE],qnB=new Set([G2.DIR_TYPE,G2.EVERYTHING_TYPE,G2.FILE_DIR_TYPE]),TnB=new Set([G2.EVERYTHING_TYPE,G2.FILE_DIR_TYPE,G2.FILE_TYPE]);t9L=class t9L extends a9L.Readable{constructor(H={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:H.highWaterMark});let $={...Sd$,...H},{root:A,type:L}=$;this._fileFilter=r9L($.fileFilter),this._directoryFilter=r9L($.directoryFilter);let I=$.lstat?kk.lstat:kk.stat;if(NnB)this._stat=(D)=>I(D,{bigint:!0});else this._stat=I;this._maxDepth=$.depth??Sd$.depth,this._wantsDir=L?qnB.has(L):!1,this._wantsFile=L?TnB.has(L):!1,this._wantsEverything=L===G2.EVERYTHING_TYPE,this._root=uk.resolve(A),this._isDirent=!$.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(A,1)],this.reading=!1,this.parent=void 0}async _read(H){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&H>0){let $=this.parent,A=$&&$.files;if(A&&A.length>0){let{path:L,depth:I}=$,D=A.splice(0,H).map((f)=>this._formatEntry(f,L)),B=await Promise.all(D);for(let f of B){if(!f)continue;if(this.destroyed)return;let E=await this._getEntryType(f);if(E==="directory"&&this._directoryFilter(f)){if(I<=this._maxDepth)this.parents.push(this._exploreDir(f.fullPath,I+1));if(this._wantsDir)this.push(f),H--}else if((E==="file"||this._includeAsFile(f))&&this._fileFilter(f)){if(this._wantsFile)this.push(f),H--}}}else{let L=this.parents.pop();if(!L){this.push(null);break}if(this.parent=await L,this.destroyed)return}}}catch($){this.destroy($)}finally{this.reading=!1}}async _exploreDir(H,$){let A;try{A=await kk.readdir(H,this._rdOptions)}catch(L){this._onError(L)}return{files:A,depth:$,path:H}}async _formatEntry(H,$){let A,L=this._isDirent?H.name:H;try{let I=uk.resolve(uk.join($,L));A={path:uk.relative(this._root,I),fullPath:I,basename:L},A[this._statsProp]=this._isDirent?H:await this._stat(I)}catch(I){this._onError(I);return}return A}_onError(H){if(znB(H)&&!this.destroyed)this.emit("warn",H);else this.destroy(H)}async _getEntryType(H){if(!H&&this._statsProp in H)return"";let $=H[this._statsProp];if($.isFile())return"file";if($.isDirectory())return"directory";if($&&$.isSymbolicLink()){let A=H.fullPath;try{let L=await kk.realpath(A),I=await kk.lstat(L);if(I.isFile())return"file";if(I.isDirectory()){let D=L.length;if(A.startsWith(L)&&A.substr(D,1)===uk.sep){let B=Error(`Circular symlink detected: "${A}" points to "${L}"`);return B.code=o9L,this._onError(B)}return"directory"}}catch(L){return this._onError(L),""}}}_includeAsFile(H){let $=H&&H[this._statsProp];return $&&this._wantsEverything&&!$.isDirectory()}}});function H1L(H,$,A,L,I){let D=(B,f)=>{if(A(H),I(B,f,{watchedPath:H}),f&&H!==f)LeH(V4.resolve(H,f),v$H,V4.join(H,f))};try{return h$H.watch(H,{persistent:$.persistent},D)}catch(B){L(B);return}}class hd${constructor(H){this.fsw=H,this._boundHandleError=($)=>H._handleError($)}_watchWithNodeFs(H,$){let A=this.fsw.options,L=V4.dirname(H),I=V4.basename(H);this.fsw._getWatchedDir(L).add(I);let B=V4.resolve(H),f={persistent:A.persistent};if(!$)$=IeH;let E;if(A.usePolling){let M=A.interval!==A.binaryInterval;f.interval=M&&bnB(I)?A.binaryInterval:A.interval,E=gnB(H,B,f,{listener:$,rawEmitter:this.fsw._emitRaw})}else E=unB(H,B,f,{listener:$,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return E}_handleFile(H,$,A){if(this.fsw.closed)return;let L=V4.dirname(H),I=V4.basename(H),D=this.fsw._getWatchedDir(L),B=$;if(D.has(I))return;let f=async(M,G)=>{if(!this.fsw._throttle(RnB,H,5))return;if(!G||G.mtimeMs===0)try{let U=await uN.stat(H);if(this.fsw.closed)return;let{atimeMs:X,mtimeMs:J}=U;if(!X||X<=J||J!==B.mtimeMs)this.fsw._emit(kN.CHANGE,H,U);if((xnB||SnB||jnB)&&B.ino!==U.ino){this.fsw._closeFile(M),B=U;let F=this._watchWithNodeFs(H,f);if(F)this.fsw._addPathCloser(M,F)}else B=U}catch(U){this.fsw._remove(L,I)}else if(D.has(I)){let{atimeMs:U,mtimeMs:X}=G;if(!U||U<=X||X!==B.mtimeMs)this.fsw._emit(kN.CHANGE,H,G);B=G}},E=this._watchWithNodeFs(H,f);if(!(A&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(H)){if(!this.fsw._throttle(kN.ADD,H,0))return;this.fsw._emit(kN.ADD,H,$)}return E}async _handleSymlink(H,$,A,L){if(this.fsw.closed)return;let I=H.fullPath,D=this.fsw._getWatchedDir($);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let B;try{B=await uN.realpath(A)}catch(f){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(D.has(L)){if(this.fsw._symlinkPaths.get(I)!==B)this.fsw._symlinkPaths.set(I,B),this.fsw._emit(kN.CHANGE,A,H.stats)}else D.add(L),this.fsw._symlinkPaths.set(I,B),this.fsw._emit(kN.ADD,A,H.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(I))return!0;this.fsw._symlinkPaths.set(I,!0)}_handleRead(H,$,A,L,I,D,B){if(H=V4.join(H,""),B=this.fsw._throttle("readdir",H,1000),!B)return;let f=this.fsw._getWatchedDir(A.path),E=new Set,M=this.fsw._readdirp(H,{fileFilter:(G)=>A.filterPath(G),directoryFilter:(G)=>A.filterDir(G)});if(!M)return;return M.on(OnB,async(G)=>{if(this.fsw.closed){M=void 0;return}let U=G.path,X=V4.join(H,U);if(E.add(U),G.stats.isSymbolicLink()&&await this._handleSymlink(G,H,X,U))return;if(this.fsw.closed){M=void 0;return}if(U===L||!L&&!f.has(U))this.fsw._incrReadyCount(),X=V4.join(I,V4.relative(I,X)),this._addToNodeFs(X,$,A,D+1)}).on(kN.ERROR,this._boundHandleError),new Promise((G,U)=>{if(!M)return U();M.once(yd$,()=>{if(this.fsw.closed){M=void 0;return}let X=B?B.clear():!1;if(G(void 0),f.getChildren().filter((J)=>{return J!==H&&!E.has(J)}).forEach((J)=>{this.fsw._remove(H,J)}),M=void 0,X)this._handleRead(H,!1,A,L,I,D,B)})})}async _handleDir(H,$,A,L,I,D,B){let f=this.fsw._getWatchedDir(V4.dirname(H)),E=f.has(V4.basename(H));if(!(A&&this.fsw.options.ignoreInitial)&&!I&&!E)this.fsw._emit(kN.ADD_DIR,H,$);f.add(V4.basename(H)),this.fsw._getWatchedDir(H);let M,G,U=this.fsw.options.depth;if((U==null||L<=U)&&!this.fsw._symlinkPaths.has(B)){if(!I){if(await this._handleRead(H,A,D,I,H,L,M),this.fsw.closed)return}G=this._watchWithNodeFs(H,(X,J)=>{if(J&&J.mtimeMs===0)return;this._handleRead(X,!1,D,I,H,L,M)})}return G}async _addToNodeFs(H,$,A,L,I){let D=this.fsw._emitReady;if(this.fsw._isIgnored(H)||this.fsw.closed)return D(),!1;let B=this.fsw._getWatchHelpers(H);if(A)B.filterPath=(f)=>A.filterPath(f),B.filterDir=(f)=>A.filterDir(f);try{let f=await ynB[B.statMethod](B.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(B.watchPath,f))return D(),!1;let E=this.fsw.options.followSymlinks,M;if(f.isDirectory()){let G=V4.resolve(H),U=E?await uN.realpath(H):H;if(this.fsw.closed)return;if(M=await this._handleDir(B.watchPath,f,$,L,I,B,U),this.fsw.closed)return;if(G!==U&&U!==void 0)this.fsw._symlinkPaths.set(G,U)}else if(f.isSymbolicLink()){let G=E?await uN.realpath(H):H;if(this.fsw.closed)return;let U=V4.dirname(B.watchPath);if(this.fsw._getWatchedDir(U).add(B.watchPath),this.fsw._emit(kN.ADD,B.watchPath,f),M=await this._handleDir(U,f,$,L,H,B,G),this.fsw.closed)return;if(G!==void 0)this.fsw._symlinkPaths.set(V4.resolve(H),G)}else M=this._handleFile(B.watchPath,f,$);if(D(),M)this.fsw._addPathCloser(H,M);return!1}catch(f){if(this.fsw._handleError(f))return D(),H}}}var h$H,uN,V4,$1L,OnB="data",yd$="end",A1L="close",IeH=()=>{},DeH="linux",vd$,xnB,SnB,jnB,L1L,xU,kN,RnB="watch",ynB,v$H="listeners",$eH="errHandlers",_GH="rawEmitters",vnB,hnB,bnB=(H)=>hnB.has(V4.extname(H).slice(1).toLowerCase()),Rd$=(H,$)=>{if(H instanceof Set)H.forEach($);else $(H)},PwH=(H,$,A)=>{let L=H[$];if(!(L instanceof Set))H[$]=L=new Set([L]);L.add(A)},knB=(H)=>($)=>{let A=H[$];if(A instanceof Set)A.clear();else delete H[$]},_wH=(H,$,A)=>{let L=H[$];if(L instanceof Set)L.delete(A);else if(L===A)delete H[$]},I1L=(H)=>H instanceof Set?H.size===0:!H,AeH,LeH=(H,$,A,L,I)=>{let D=AeH.get(H);if(!D)return;Rd$(D[$],(B)=>{B(A,L,I)})},unB=(H,$,A,L)=>{let{listener:I,errHandler:D,rawEmitter:B}=L,f=AeH.get($),E;if(!A.persistent){if(E=H1L(H,A,I,D,B),!E)return;return E.close.bind(E)}if(f)PwH(f,v$H,I),PwH(f,$eH,D),PwH(f,_GH,B);else{if(E=H1L(H,A,LeH.bind(null,$,v$H),D,LeH.bind(null,$,_GH)),!E)return;E.on(kN.ERROR,async(M)=>{let G=LeH.bind(null,$,$eH);if(f)f.watcherUnusable=!0;if(vd$&&M.code==="EPERM")try{await(await uN.open(H,"r")).close(),G(M)}catch(U){}else G(M)}),f={listeners:I,errHandlers:D,rawEmitters:B,watcher:E},AeH.set($,f)}return()=>{if(_wH(f,v$H,I),_wH(f,$eH,D),_wH(f,_GH,B),I1L(f.listeners))f.watcher.close(),AeH.delete($),vnB.forEach(knB(f)),f.watcher=void 0,Object.freeze(f)}},jd$,gnB=(H,$,A,L)=>{let{listener:I,rawEmitter:D}=L,B=jd$.get($),f=B&&B.options;if(f&&(f.persistentA.interval))h$H.unwatchFile($),B=void 0;if(B)PwH(B,v$H,I),PwH(B,_GH,D);else B={listeners:I,rawEmitters:D,options:A,watcher:h$H.watchFile($,A,(E,M)=>{Rd$(B.rawEmitters,(U)=>{U(kN.CHANGE,$,{curr:E,prev:M})});let G=E.mtimeMs;if(E.size!==M.size||G>M.mtimeMs||G===0)Rd$(B.listeners,(U)=>U(H,E))})},jd$.set($,B);return()=>{if(_wH(B,v$H,I),_wH(B,_GH,D),I1L(B.listeners))jd$.delete($),h$H.unwatchFile($),B.options=B.watcher=void 0,Object.freeze(B)}};var D1L=K(()=>{h$H=require("fs"),uN=require("fs/promises"),V4=b(require("path")),$1L=require("os"),vd$=DeH==="win32",xnB=DeH==="darwin",SnB=DeH==="linux",jnB=DeH==="freebsd",L1L=$1L.type()==="OS400",xU={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},kN=xU,ynB={lstat:uN.lstat,stat:uN.stat},vnB=[v$H,$eH,_GH],hnB=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),AeH=new Map;jd$=new Map});function BeH(H){return Array.isArray(H)?H:[H]}function nnB(H){if(typeof H==="function")return H;if(typeof H==="string")return($)=>H===$;if(H instanceof RegExp)return($)=>H.test($);if(typeof H==="object"&&H!==null)return($)=>{if(H.path===$)return!0;if(H.recursive){let A=z8.relative(H.path,$);if(!A)return!1;return!A.startsWith("..")&&!z8.isAbsolute(A)}return!1};return()=>!1}function rnB(H){if(typeof H!=="string")throw Error("string expected");H=z8.normalize(H),H=H.replace(/\\/g,"/");let $=!1;if(H.startsWith("//"))$=!0;let A=/\/\//;while(H.match(A))H=H.replace(A,"/");if($)H="/"+H;return H}function f1L(H,$,A){let L=rnB($);for(let I=0;InnB(I));if($==null)return(I,D)=>{return f1L(L,I,D)};return f1L(L,$)}class K1L{constructor(H,$){this.path=H,this._removeWatcher=$,this.items=new Set}add(H){let{items:$}=this;if(!$)return;if(H!==J1L&&H!==pnB)$.add(H)}async remove(H){let{items:$}=this;if(!$)return;if($.delete(H),$.size>0)return;let A=this.path;try{await feH.readdir(A)}catch(L){if(this._removeWatcher)this._removeWatcher(z8.dirname(A),z8.basename(A))}}has(H){let{items:$}=this;if(!$)return;return $.has(H)}getChildren(){let{items:H}=this;if(!H)return[];return[...H.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=IeH,this.items=tnB,Object.freeze(this)}}class Q1L{constructor(H,$,A){this.fsw=A;let L=H;this.path=H=H.replace(inB,""),this.watchPath=L,this.fullWatchPath=z8.resolve(L),this.dirParts=[],this.dirParts.forEach((I)=>{if(I.length>1)I.pop()}),this.followSymlinks=$,this.statMethod=$?snB:enB}entryPath(H){return z8.join(this.watchPath,z8.relative(this.watchPath,H.fullPath))}filterPath(H){let{stats:$}=H;if($&&$.isSymbolicLink())return this.filterDir(H);let A=this.entryPath(H);return this.fsw._isntIgnored(A,$)&&this.fsw._hasReadPermissions($)}filterDir(H){return this.fsw._isntIgnored(this.entryPath(H),H.stats)}}function HrB(H,$={}){let A=new ud$($);return A.add(H),A}var U1L,feH,X1L,z8,bd$="/",mnB="//",J1L=".",pnB="..",dnB="string",cnB,B1L,lnB,inB,kd$=(H)=>typeof H==="object"&&H!==null&&!(H instanceof RegExp),E1L=(H)=>{let $=BeH(H).flat();if(!$.every((A)=>typeof A===dnB))throw TypeError(`Non-string provided as watch path: ${$}`);return $.map(F1L)},M1L=(H)=>{let $=H.replace(cnB,bd$),A=!1;if($.startsWith(mnB))A=!0;while($.match(B1L))$=$.replace(B1L,bd$);if(A)$=bd$+$;return $},F1L=(H)=>M1L(z8.normalize(M1L(H))),G1L=(H="")=>($)=>{if(typeof $==="string")return F1L(z8.isAbsolute($)?$:z8.join(H,$));else return $},onB=(H,$)=>{if(z8.isAbsolute(H))return H;return z8.join($,H)},tnB,snB="stat",enB="lstat",ud$,YGH;var EeH=K(()=>{e9L();D1L();U1L=require("fs"),feH=require("fs/promises"),X1L=require("events"),z8=b(require("path"));/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */cnB=/\\/g,B1L=/\/\//,lnB=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,inB=/^\.[/\\]/;tnB=Object.freeze(new Set);ud$=class ud$ extends X1L.EventEmitter{constructor(H={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let $=H.awaitWriteFinish,A={stabilityThreshold:2000,pollInterval:100},L={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...H,ignored:H.ignored?BeH(H.ignored):BeH([]),awaitWriteFinish:$===!0?A:typeof $==="object"?{...A,...$}:!1};if(L1L)L.usePolling=!0;if(L.atomic===void 0)L.atomic=!L.usePolling;let I=process.env.CHOKIDAR_USEPOLLING;if(I!==void 0){let f=I.toLowerCase();if(f==="false"||f==="0")L.usePolling=!1;else if(f==="true"||f==="1")L.usePolling=!0;else L.usePolling=!!f}let D=process.env.CHOKIDAR_INTERVAL;if(D)L.interval=Number.parseInt(D,10);let B=0;this._emitReady=()=>{if(B++,B>=this._readyCount)this._emitReady=IeH,this._readyEmitted=!0,process.nextTick(()=>this.emit(xU.READY))},this._emitRaw=(...f)=>this.emit(xU.RAW,...f),this._boundRemove=this._remove.bind(this),this.options=L,this._nodeFsHandler=new hd$(this),Object.freeze(L)}_addIgnoredPath(H){if(kd$(H)){for(let $ of this._ignoredPaths)if(kd$($)&&$.path===H.path&&$.recursive===H.recursive)return}this._ignoredPaths.add(H)}_removeIgnoredPath(H){if(this._ignoredPaths.delete(H),typeof H==="string"){for(let $ of this._ignoredPaths)if(kd$($)&&$.path===H)this._ignoredPaths.delete($)}}add(H,$,A){let{cwd:L}=this.options;this.closed=!1,this._closePromise=void 0;let I=E1L(H);if(L)I=I.map((D)=>{return onB(D,L)});if(I.forEach((D)=>{this._removeIgnoredPath(D)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=I.length,Promise.all(I.map(async(D)=>{let B=await this._nodeFsHandler._addToNodeFs(D,!A,void 0,0,$);if(B)this._emitReady();return B})).then((D)=>{if(this.closed)return;D.forEach((B)=>{if(B)this.add(z8.dirname(B),z8.basename($||B))})}),this}unwatch(H){if(this.closed)return this;let $=E1L(H),{cwd:A}=this.options;return $.forEach((L)=>{if(!z8.isAbsolute(L)&&!this._closers.has(L)){if(A)L=z8.join(A,L);L=z8.resolve(L)}if(this._closePath(L),this._addIgnoredPath(L),this._watched.has(L))this._addIgnoredPath({path:L,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let H=[];return this._closers.forEach(($)=>$.forEach((A)=>{let L=A();if(L instanceof Promise)H.push(L)})),this._streams.forEach(($)=>$.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(($)=>$.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=H.length?Promise.all(H).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let H={};return this._watched.forEach(($,A)=>{let I=(this.options.cwd?z8.relative(this.options.cwd,A):A)||J1L;H[I]=$.getChildren().sort()}),H}emitWithAll(H,$){if(this.emit(H,...$),H!==xU.ERROR)this.emit(xU.ALL,H,...$)}async _emit(H,$,A){if(this.closed)return;let L=this.options;if(vd$)$=z8.normalize($);if(L.cwd)$=z8.relative(L.cwd,$);let I=[$];if(A!=null)I.push(A);let D=L.awaitWriteFinish,B;if(D&&(B=this._pendingWrites.get($)))return B.lastChange=new Date,this;if(L.atomic){if(H===xU.UNLINK)return this._pendingUnlinks.set($,[H,...I]),setTimeout(()=>{this._pendingUnlinks.forEach((f,E)=>{this.emit(...f),this.emit(xU.ALL,...f),this._pendingUnlinks.delete(E)})},typeof L.atomic==="number"?L.atomic:100),this;if(H===xU.ADD&&this._pendingUnlinks.has($))H=xU.CHANGE,this._pendingUnlinks.delete($)}if(D&&(H===xU.ADD||H===xU.CHANGE)&&this._readyEmitted){let f=(E,M)=>{if(E)H=xU.ERROR,I[0]=E,this.emitWithAll(H,I);else if(M){if(I.length>1)I[1]=M;else I.push(M);this.emitWithAll(H,I)}};return this._awaitWriteFinish($,D.stabilityThreshold,H,f),this}if(H===xU.CHANGE){if(!this._throttle(xU.CHANGE,$,50))return this}if(L.alwaysStat&&A===void 0&&(H===xU.ADD||H===xU.ADD_DIR||H===xU.CHANGE)){let f=L.cwd?z8.join(L.cwd,$):$,E;try{E=await feH.stat(f)}catch(M){}if(!E||this.closed)return;I.push(E)}return this.emitWithAll(H,I),this}_handleError(H){let $=H&&H.code;if(H&&$!=="ENOENT"&&$!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||$!=="EPERM"&&$!=="EACCES"))this.emit(xU.ERROR,H);return H||this.closed}_throttle(H,$,A){if(!this._throttled.has(H))this._throttled.set(H,new Map);let L=this._throttled.get(H);if(!L)throw Error("invalid throttle");let I=L.get($);if(I)return I.count++,!1;let D,B=()=>{let E=L.get($),M=E?E.count:0;if(L.delete($),clearTimeout(D),E)clearTimeout(E.timeoutObject);return M};D=setTimeout(B,A);let f={timeoutObject:D,clear:B,count:0};return L.set($,f),f}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(H,$,A,L){let I=this.options.awaitWriteFinish;if(typeof I!=="object")return;let D=I.pollInterval,B,f=H;if(this.options.cwd&&!z8.isAbsolute(H))f=z8.join(this.options.cwd,H);let E=new Date,M=this._pendingWrites;function G(U){U1L.stat(f,(X,J)=>{if(X||!M.has(H)){if(X&&X.code!=="ENOENT")L(X);return}let F=Number(new Date);if(U&&J.size!==U.size)M.get(H).lastChange=F;let Q=M.get(H);if(F-Q.lastChange>=$)M.delete(H),L(void 0,J);else B=setTimeout(G,D,J)})}if(!M.has(H))M.set(H,{lastChange:E,cancelWait:()=>{return M.delete(H),clearTimeout(B),A}}),B=setTimeout(G,D)}_isIgnored(H,$){if(this.options.atomic&&lnB.test(H))return!0;if(!this._userIgnored){let{cwd:A}=this.options,I=(this.options.ignored||[]).map(G1L(A)),B=[...[...this._ignoredPaths].map(G1L(A)),...I];this._userIgnored=anB(B,void 0)}return this._userIgnored(H,$)}_isntIgnored(H,$){return!this._isIgnored(H,$)}_getWatchHelpers(H){return new Q1L(H,this.options.followSymlinks,this)}_getWatchedDir(H){let $=z8.resolve(H);if(!this._watched.has($))this._watched.set($,new K1L($,this._boundRemove));return this._watched.get($)}_hasReadPermissions(H){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number(H.mode)&256)}_remove(H,$,A){let L=z8.join(H,$),I=z8.resolve(L);if(A=A!=null?A:this._watched.has(L)||this._watched.has(I),!this._throttle("remove",L,100))return;if(!A&&this._watched.size===1)this.add(H,$,!0);this._getWatchedDir(L).getChildren().forEach((U)=>this._remove(L,U));let f=this._getWatchedDir(H),E=f.has($);if(f.remove($),this._symlinkPaths.has(I))this._symlinkPaths.delete(I);let M=L;if(this.options.cwd)M=z8.relative(this.options.cwd,L);if(this.options.awaitWriteFinish&&this._pendingWrites.has(M)){if(this._pendingWrites.get(M).cancelWait()===xU.ADD)return}this._watched.delete(L),this._watched.delete(I);let G=A?xU.UNLINK_DIR:xU.UNLINK;if(E&&!this._isIgnored(L))this._emit(G,L);this._closePath(L)}_closePath(H){this._closeFile(H);let $=z8.dirname(H);this._getWatchedDir($).remove(z8.basename(H))}_closeFile(H){let $=this._closers.get(H);if(!$)return;$.forEach((A)=>A()),this._closers.delete(H)}_addPathCloser(H,$){if(!$)return;let A=this._closers.get(H);if(!A)A=[],this._closers.set(H,A);A.push($)}_readdirp(H,$){if(this.closed)return;let A={type:xU.ALL,alwaysStat:!0,lstat:!0,...$,depth:0},L=s9L(H,A);return this._streams.add(L),L.once(A1L,()=>{L=void 0}),L.once(yd$,()=>{if(L)this._streams.delete(L),L=void 0}),L}};YGH={watch:HrB,FSWatcher:ud$}});function IrB(){if(gd$||pd$)return;gd$=!0;let{dirs:H,settingsFiles:$}=frB();if(H.length===0)return;N(`Watching for changes in setting files ${[...$].join(", ")}...`),CGH=YGH.watch(H,{persistent:!0,ignoreInitial:!0,depth:0,awaitWriteFinish:{stabilityThreshold:md$?.stabilityThreshold??$rB,pollInterval:md$?.pollInterval??ArB},ignored:(A,L)=>{if(L&&!L.isFile()&&!L.isDirectory())return!0;if(A.split(GeH.sep).some((I)=>I===".git"))return!0;if(!L||L.isDirectory())return!1;return!$.has(A)},ignorePermissionErrors:!0,usePolling:!1,atomic:!0}),CGH.on("change",ErB),CGH.on("unlink",MrB),PB(async()=>W1L())}function W1L(){if(pd$=!0,CGH)CGH.close(),CGH=null;MeH.clear(),wGH.clear()}function DrB(H){return wGH.add(H),()=>{wGH.delete(H)}}function BrB(H){let $=aM(H);if($)MeH.set($,Date.now())}function frB(){let H=zH(),$=new Map,A=new Set;for(let I of j_){if(I==="flagSettings")continue;let D=aM(I);if(!D)continue;let B=GeH.dirname(D);if(!$.has(B))$.set(B,new Set);$.get(B).add(D);try{if(H.statSync(D).isFile())A.add(B)}catch{}}let L=new Set;for(let I of A){let D=$.get(I);if(D)for(let B of D)L.add(B)}return{dirs:[...A],settingsFiles:L}}function ErB(H){let $=V1L(H);if(!$)return;let A=MeH.get(H);if(A&&Date.now()-AL($))}function MrB(H){let $=V1L(H);if(!$)return;N(`Detected deletion of ${H}`),wGH.forEach((A)=>A($))}function V1L(H){return j_.find(($)=>aM($)===H)}function GrB(H){N(`Programmatic settings change notification for ${H}`),wGH.forEach(($)=>$(H))}function UrB(H){gd$=!1,pd$=!1,md$=H??null}var GeH,$rB=1000,ArB=500,LrB=5000,CGH=null,gd$=!1,pd$=!1,MeH,wGH,md$=null,AF;var gk=K(()=>{EeH();E$();DL();mL();W4();ZE();GeH=b(require("path")),MeH=new Map,wGH=new Set;AF={initialize:IrB,dispose:W1L,subscribe:DrB,markInternalWrite:BrB,notifyChange:GrB,resetForTesting:UrB}});function sI(){return A$(process.env.CLAUDE_CODE_USE_BEDROCK)?"bedrock":A$(process.env.CLAUDE_CODE_USE_VERTEX)?"vertex":A$(process.env.CLAUDE_CODE_USE_FOUNDRY)?"foundry":"firstParty"}function SR(){return sI()}function ZGH(){let H=process.env.ANTHROPIC_BASE_URL;if(!H)return!0;try{let $=new URL(H).host;return["api.anthropic.com"].includes($)}catch{return!1}}var oM=K(()=>{NA()});class TGH{heap;length;static#L=!1;static create(H){let $=C1L(H);if(!$)return[];TGH.#L=!0;let A=new TGH(H,$);return TGH.#L=!1,A}constructor(H,$){if(!TGH.#L)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new $(H),this.length=0}push(H){this.heap[this.length++]=H}pop(){return this.heap[--this.length]}}var qGH,_1L,dd$,Y1L=(H,$,A,L)=>{typeof dd$.emitWarning==="function"?dd$.emitWarning(H,$,A,L):console.error(`[${A}] ${$}: ${H}`)},UeH,P1L,XrB=(H)=>!_1L.has(H),W18,Cl=(H)=>H&&H===Math.floor(H)&&H>0&&isFinite(H),C1L=(H)=>!Cl(H)?null:H<=Math.pow(2,8)?Uint8Array:H<=Math.pow(2,16)?Uint16Array:H<=Math.pow(2,32)?Uint32Array:H<=Number.MAX_SAFE_INTEGER?YwH:null,YwH,gN;var CwH=K(()=>{qGH=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,_1L=new Set,dd$=typeof process==="object"&&!!process?process:{},UeH=globalThis.AbortController,P1L=globalThis.AbortSignal;if(typeof UeH>"u"){P1L=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(L,I){this._onabort.push(I)}},UeH=class{constructor(){$()}signal=new P1L;abort(L){if(this.signal.aborted)return;this.signal.reason=L,this.signal.aborted=!0;for(let I of this.signal._onabort)I(L);this.signal.onabort?.(L)}};let H=dd$.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",$=()=>{if(!H)return;H=!1,Y1L("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",$)}}W18=Symbol("type");YwH=class YwH extends Array{constructor(H){super(H);this.fill(0)}};gN=class gN{#L;#A;#$;#f;#M;#J;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#I;#W;#E;#D;#H;#G;#F;#K;#U;#_;#X;#Y;#P;#V;#C;#Z;#Q;static unsafeExposeInternals(H){return{starts:H.#P,ttls:H.#V,sizes:H.#Y,keyMap:H.#E,keyList:H.#D,valList:H.#H,next:H.#G,prev:H.#F,get head(){return H.#K},get tail(){return H.#U},free:H.#_,isBackgroundFetch:($)=>H.#B($),backgroundFetch:($,A,L,I)=>H.#y($,A,L,I),moveToTail:($)=>H.#S($),indexes:($)=>H.#q($),rindexes:($)=>H.#T($),isStale:($)=>H.#w($)}}get max(){return this.#L}get maxSize(){return this.#A}get calculatedSize(){return this.#W}get size(){return this.#I}get fetchMethod(){return this.#M}get memoMethod(){return this.#J}get dispose(){return this.#$}get disposeAfter(){return this.#f}constructor(H){let{max:$=0,ttl:A,ttlResolution:L=1,ttlAutopurge:I,updateAgeOnGet:D,updateAgeOnHas:B,allowStale:f,dispose:E,disposeAfter:M,noDisposeOnSet:G,noUpdateTTL:U,maxSize:X=0,maxEntrySize:J=0,sizeCalculation:F,fetchMethod:Q,memoMethod:W,noDeleteOnFetchRejection:P,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:Y,allowStaleOnFetchAbort:Z,ignoreFetchAbort:q}=H;if($!==0&&!Cl($))throw TypeError("max option must be a nonnegative integer");let O=$?C1L($):Array;if(!O)throw Error("invalid max value: "+$);if(this.#L=$,this.#A=X,this.maxEntrySize=J||this.#A,this.sizeCalculation=F,this.sizeCalculation){if(!this.#A&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(W!==void 0&&typeof W!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#J=W,Q!==void 0&&typeof Q!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#M=Q,this.#Z=!!Q,this.#E=new Map,this.#D=Array($).fill(void 0),this.#H=Array($).fill(void 0),this.#G=new O($),this.#F=new O($),this.#K=0,this.#U=0,this.#_=TGH.create($),this.#I=0,this.#W=0,typeof E==="function")this.#$=E;if(typeof M==="function")this.#f=M,this.#X=[];else this.#f=void 0,this.#X=void 0;if(this.#C=!!this.#$,this.#Q=!!this.#f,this.noDisposeOnSet=!!G,this.noUpdateTTL=!!U,this.noDeleteOnFetchRejection=!!P,this.allowStaleOnFetchRejection=!!Y,this.allowStaleOnFetchAbort=!!Z,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#A!==0){if(!Cl(this.#A))throw TypeError("maxSize must be a positive integer if specified")}if(!Cl(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#m()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!D,this.updateAgeOnHas=!!B,this.ttlResolution=Cl(L)||L===0?L:1,this.ttlAutopurge=!!I,this.ttl=A||0,this.ttl){if(!Cl(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#v()}if(this.#L===0&&this.ttl===0&&this.#A===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#L&&!this.#A){if(XrB("LRU_CACHE_UNBOUNDED"))_1L.add("LRU_CACHE_UNBOUNDED"),Y1L("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",gN)}}getRemainingTTL(H){return this.#E.has(H)?1/0:0}#v(){let H=new YwH(this.#L),$=new YwH(this.#L);this.#V=H,this.#P=$,this.#h=(I,D,B=qGH.now())=>{if($[I]=D!==0?B:0,H[I]=D,D!==0&&this.ttlAutopurge){let f=setTimeout(()=>{if(this.#w(I))this.#z(this.#D[I],"expire")},D+1);if(f.unref)f.unref()}},this.#O=(I)=>{$[I]=H[I]!==0?qGH.now():0},this.#N=(I,D)=>{if(H[D]){let B=H[D],f=$[D];if(!B||!f)return;I.ttl=B,I.start=f,I.now=A||L();let E=I.now-f;I.remainingTTL=B-E}};let A=0,L=()=>{let I=qGH.now();if(this.ttlResolution>0){A=I;let D=setTimeout(()=>A=0,this.ttlResolution);if(D.unref)D.unref()}return I};this.getRemainingTTL=(I)=>{let D=this.#E.get(I);if(D===void 0)return 0;let B=H[D],f=$[D];if(!B||!f)return 1/0;let E=(A||L())-f;return B-E},this.#w=(I)=>{let D=$[I],B=H[I];return!!B&&!!D&&(A||L())-D>B}}#O=()=>{};#N=()=>{};#h=()=>{};#w=()=>!1;#m(){let H=new YwH(this.#L);this.#W=0,this.#Y=H,this.#x=($)=>{this.#W-=H[$],H[$]=0},this.#b=($,A,L,I)=>{if(this.#B(A))return 0;if(!Cl(L))if(I){if(typeof I!=="function")throw TypeError("sizeCalculation must be a function");if(L=I(A,$),!Cl(L))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return L},this.#j=($,A,L)=>{if(H[$]=A,this.#A){let I=this.#A-H[$];while(this.#W>I)this.#R(!0)}if(this.#W+=H[$],L)L.entrySize=A,L.totalCalculatedSize=this.#W}}#x=(H)=>{};#j=(H,$,A)=>{};#b=(H,$,A,L)=>{if(A||L)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#q({allowStale:H=this.allowStale}={}){if(this.#I)for(let $=this.#U;;){if(!this.#k($))break;if(H||!this.#w($))yield $;if($===this.#K)break;else $=this.#F[$]}}*#T({allowStale:H=this.allowStale}={}){if(this.#I)for(let $=this.#K;;){if(!this.#k($))break;if(H||!this.#w($))yield $;if($===this.#U)break;else $=this.#G[$]}}#k(H){return H!==void 0&&this.#E.get(this.#D[H])===H}*entries(){for(let H of this.#q())if(this.#H[H]!==void 0&&this.#D[H]!==void 0&&!this.#B(this.#H[H]))yield[this.#D[H],this.#H[H]]}*rentries(){for(let H of this.#T())if(this.#H[H]!==void 0&&this.#D[H]!==void 0&&!this.#B(this.#H[H]))yield[this.#D[H],this.#H[H]]}*keys(){for(let H of this.#q()){let $=this.#D[H];if($!==void 0&&!this.#B(this.#H[H]))yield $}}*rkeys(){for(let H of this.#T()){let $=this.#D[H];if($!==void 0&&!this.#B(this.#H[H]))yield $}}*values(){for(let H of this.#q())if(this.#H[H]!==void 0&&!this.#B(this.#H[H]))yield this.#H[H]}*rvalues(){for(let H of this.#T())if(this.#H[H]!==void 0&&!this.#B(this.#H[H]))yield this.#H[H]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(H,$={}){for(let A of this.#q()){let L=this.#H[A],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0)continue;if(H(I,this.#D[A],this))return this.get(this.#D[A],$)}}forEach(H,$=this){for(let A of this.#q()){let L=this.#H[A],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0)continue;H.call($,I,this.#D[A],this)}}rforEach(H,$=this){for(let A of this.#T()){let L=this.#H[A],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0)continue;H.call($,I,this.#D[A],this)}}purgeStale(){let H=!1;for(let $ of this.#T({allowStale:!0}))if(this.#w($))this.#z(this.#D[$],"expire"),H=!0;return H}info(H){let $=this.#E.get(H);if($===void 0)return;let A=this.#H[$],L=this.#B(A)?A.__staleWhileFetching:A;if(L===void 0)return;let I={value:L};if(this.#V&&this.#P){let D=this.#V[$],B=this.#P[$];if(D&&B){let f=D-(qGH.now()-B);I.ttl=f,I.start=Date.now()}}if(this.#Y)I.size=this.#Y[$];return I}dump(){let H=[];for(let $ of this.#q({allowStale:!0})){let A=this.#D[$],L=this.#H[$],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0||A===void 0)continue;let D={value:I};if(this.#V&&this.#P){D.ttl=this.#V[$];let B=qGH.now()-this.#P[$];D.start=Math.floor(Date.now()-B)}if(this.#Y)D.size=this.#Y[$];H.unshift([A,D])}return H}load(H){this.clear();for(let[$,A]of H){if(A.start){let L=Date.now()-A.start;A.start=qGH.now()-L}this.set($,A.value,A)}}set(H,$,A={}){if($===void 0)return this.delete(H),this;let{ttl:L=this.ttl,start:I,noDisposeOnSet:D=this.noDisposeOnSet,sizeCalculation:B=this.sizeCalculation,status:f}=A,{noUpdateTTL:E=this.noUpdateTTL}=A,M=this.#b(H,$,A.size||0,B);if(this.maxEntrySize&&M>this.maxEntrySize){if(f)f.set="miss",f.maxEntrySizeExceeded=!0;return this.#z(H,"set"),this}let G=this.#I===0?void 0:this.#E.get(H);if(G===void 0){if(G=this.#I===0?this.#U:this.#_.length!==0?this.#_.pop():this.#I===this.#L?this.#R(!1):this.#I,this.#D[G]=H,this.#H[G]=$,this.#E.set(H,G),this.#G[this.#U]=G,this.#F[G]=this.#U,this.#U=G,this.#I++,this.#j(G,M,f),f)f.set="add";E=!1}else{this.#S(G);let U=this.#H[G];if($!==U){if(this.#Z&&this.#B(U)){U.__abortController.abort(Error("replaced"));let{__staleWhileFetching:X}=U;if(X!==void 0&&!D){if(this.#C)this.#$?.(X,H,"set");if(this.#Q)this.#X?.push([X,H,"set"])}}else if(!D){if(this.#C)this.#$?.(U,H,"set");if(this.#Q)this.#X?.push([U,H,"set"])}if(this.#x(G),this.#j(G,M,f),this.#H[G]=$,f){f.set="replace";let X=U&&this.#B(U)?U.__staleWhileFetching:U;if(X!==void 0)f.oldValue=X}}else if(f)f.set="update"}if(L!==0&&!this.#V)this.#v();if(this.#V){if(!E)this.#h(G,L,I);if(f)this.#N(f,G)}if(!D&&this.#Q&&this.#X){let U=this.#X,X;while(X=U?.shift())this.#f?.(...X)}return this}pop(){try{while(this.#I){let H=this.#H[this.#K];if(this.#R(!0),this.#B(H)){if(H.__staleWhileFetching)return H.__staleWhileFetching}else if(H!==void 0)return H}}finally{if(this.#Q&&this.#X){let H=this.#X,$;while($=H?.shift())this.#f?.(...$)}}}#R(H){let $=this.#K,A=this.#D[$],L=this.#H[$];if(this.#Z&&this.#B(L))L.__abortController.abort(Error("evicted"));else if(this.#C||this.#Q){if(this.#C)this.#$?.(L,A,"evict");if(this.#Q)this.#X?.push([L,A,"evict"])}if(this.#x($),H)this.#D[$]=void 0,this.#H[$]=void 0,this.#_.push($);if(this.#I===1)this.#K=this.#U=0,this.#_.length=0;else this.#K=this.#G[$];return this.#E.delete(A),this.#I--,$}has(H,$={}){let{updateAgeOnHas:A=this.updateAgeOnHas,status:L}=$,I=this.#E.get(H);if(I!==void 0){let D=this.#H[I];if(this.#B(D)&&D.__staleWhileFetching===void 0)return!1;if(!this.#w(I)){if(A)this.#O(I);if(L)L.has="hit",this.#N(L,I);return!0}else if(L)L.has="stale",this.#N(L,I)}else if(L)L.has="miss";return!1}peek(H,$={}){let{allowStale:A=this.allowStale}=$,L=this.#E.get(H);if(L===void 0||!A&&this.#w(L))return;let I=this.#H[L];return this.#B(I)?I.__staleWhileFetching:I}#y(H,$,A,L){let I=$===void 0?void 0:this.#H[$];if(this.#B(I))return I;let D=new UeH,{signal:B}=A;B?.addEventListener("abort",()=>D.abort(B.reason),{signal:D.signal});let f={signal:D.signal,options:A,context:L},E=(F,Q=!1)=>{let{aborted:W}=D.signal,P=A.ignoreFetchAbort&&F!==void 0;if(A.status)if(W&&!Q){if(A.status.fetchAborted=!0,A.status.fetchError=D.signal.reason,P)A.status.fetchAbortIgnored=!0}else A.status.fetchResolved=!0;if(W&&!P&&!Q)return G(D.signal.reason);let C=X;if(this.#H[$]===X)if(F===void 0)if(C.__staleWhileFetching)this.#H[$]=C.__staleWhileFetching;else this.#z(H,"fetch");else{if(A.status)A.status.fetchUpdated=!0;this.set(H,F,f.options)}return F},M=(F)=>{if(A.status)A.status.fetchRejected=!0,A.status.fetchError=F;return G(F)},G=(F)=>{let{aborted:Q}=D.signal,W=Q&&A.allowStaleOnFetchAbort,P=W||A.allowStaleOnFetchRejection,C=P||A.noDeleteOnFetchRejection,Y=X;if(this.#H[$]===X){if(!C||Y.__staleWhileFetching===void 0)this.#z(H,"fetch");else if(!W)this.#H[$]=Y.__staleWhileFetching}if(P){if(A.status&&Y.__staleWhileFetching!==void 0)A.status.returnedStale=!0;return Y.__staleWhileFetching}else if(Y.__returned===Y)throw F},U=(F,Q)=>{let W=this.#M?.(H,I,f);if(W&&W instanceof Promise)W.then((P)=>F(P===void 0?void 0:P),Q);D.signal.addEventListener("abort",()=>{if(!A.ignoreFetchAbort||A.allowStaleOnFetchAbort){if(F(void 0),A.allowStaleOnFetchAbort)F=(P)=>E(P,!0)}})};if(A.status)A.status.fetchDispatched=!0;let X=new Promise(U).then(E,M),J=Object.assign(X,{__abortController:D,__staleWhileFetching:I,__returned:void 0});if($===void 0)this.set(H,J,{...f.options,status:void 0}),$=this.#E.get(H);else this.#H[$]=J;return J}#B(H){if(!this.#Z)return!1;let $=H;return!!$&&$ instanceof Promise&&$.hasOwnProperty("__staleWhileFetching")&&$.__abortController instanceof UeH}async fetch(H,$={}){let{allowStale:A=this.allowStale,updateAgeOnGet:L=this.updateAgeOnGet,noDeleteOnStaleGet:I=this.noDeleteOnStaleGet,ttl:D=this.ttl,noDisposeOnSet:B=this.noDisposeOnSet,size:f=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:M=this.noUpdateTTL,noDeleteOnFetchRejection:G=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:U=this.allowStaleOnFetchRejection,ignoreFetchAbort:X=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:F,forceRefresh:Q=!1,status:W,signal:P}=$;if(!this.#Z){if(W)W.fetch="get";return this.get(H,{allowStale:A,updateAgeOnGet:L,noDeleteOnStaleGet:I,status:W})}let C={allowStale:A,updateAgeOnGet:L,noDeleteOnStaleGet:I,ttl:D,noDisposeOnSet:B,size:f,sizeCalculation:E,noUpdateTTL:M,noDeleteOnFetchRejection:G,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:J,ignoreFetchAbort:X,status:W,signal:P},Y=this.#E.get(H);if(Y===void 0){if(W)W.fetch="miss";let Z=this.#y(H,Y,C,F);return Z.__returned=Z}else{let Z=this.#H[Y];if(this.#B(Z)){let y=A&&Z.__staleWhileFetching!==void 0;if(W){if(W.fetch="inflight",y)W.returnedStale=!0}return y?Z.__staleWhileFetching:Z.__returned=Z}let q=this.#w(Y);if(!Q&&!q){if(W)W.fetch="hit";if(this.#S(Y),L)this.#O(Y);if(W)this.#N(W,Y);return Z}let O=this.#y(H,Y,C,F),u=O.__staleWhileFetching!==void 0&&A;if(W){if(W.fetch=q?"stale":"refresh",u&&q)W.returnedStale=!0}return u?O.__staleWhileFetching:O.__returned=O}}async forceFetch(H,$={}){let A=await this.fetch(H,$);if(A===void 0)throw Error("fetch() returned undefined");return A}memo(H,$={}){let A=this.#J;if(!A)throw Error("no memoMethod provided to constructor");let{context:L,forceRefresh:I,...D}=$,B=this.get(H,D);if(!I&&B!==void 0)return B;let f=A(H,B,{options:D,context:L});return this.set(H,f,D),f}get(H,$={}){let{allowStale:A=this.allowStale,updateAgeOnGet:L=this.updateAgeOnGet,noDeleteOnStaleGet:I=this.noDeleteOnStaleGet,status:D}=$,B=this.#E.get(H);if(B!==void 0){let f=this.#H[B],E=this.#B(f);if(D)this.#N(D,B);if(this.#w(B)){if(D)D.get="stale";if(!E){if(!I)this.#z(H,"expire");if(D&&A)D.returnedStale=!0;return A?f:void 0}else{if(D&&A&&f.__staleWhileFetching!==void 0)D.returnedStale=!0;return A?f.__staleWhileFetching:void 0}}else{if(D)D.get="hit";if(E)return f.__staleWhileFetching;if(this.#S(B),L)this.#O(B);return f}}else if(D)D.get="miss"}#u(H,$){this.#F[$]=H,this.#G[H]=$}#S(H){if(H!==this.#U){if(H===this.#K)this.#K=this.#G[H];else this.#u(this.#F[H],this.#G[H]);this.#u(this.#U,H),this.#U=H}}delete(H){return this.#z(H,"delete")}#z(H,$){let A=!1;if(this.#I!==0){let L=this.#E.get(H);if(L!==void 0)if(A=!0,this.#I===1)this.#g($);else{this.#x(L);let I=this.#H[L];if(this.#B(I))I.__abortController.abort(Error("deleted"));else if(this.#C||this.#Q){if(this.#C)this.#$?.(I,H,$);if(this.#Q)this.#X?.push([I,H,$])}if(this.#E.delete(H),this.#D[L]=void 0,this.#H[L]=void 0,L===this.#U)this.#U=this.#F[L];else if(L===this.#K)this.#K=this.#G[L];else{let D=this.#F[L];this.#G[D]=this.#G[L];let B=this.#G[L];this.#F[B]=this.#F[L]}this.#I--,this.#_.push(L)}}if(this.#Q&&this.#X?.length){let L=this.#X,I;while(I=L?.shift())this.#f?.(...I)}return A}clear(){return this.#g("delete")}#g(H){for(let $ of this.#T({allowStale:!0})){let A=this.#H[$];if(this.#B(A))A.__abortController.abort(Error("deleted"));else{let L=this.#D[$];if(this.#C)this.#$?.(A,L,H);if(this.#Q)this.#X?.push([A,L,H])}}if(this.#E.clear(),this.#H.fill(void 0),this.#D.fill(void 0),this.#V&&this.#P)this.#V.fill(0),this.#P.fill(0);if(this.#Y)this.#Y.fill(0);if(this.#K=0,this.#U=0,this.#_.length=0,this.#W=0,this.#I=0,this.#Q&&this.#X){let $=this.#X,A;while(A=$?.shift())this.#f?.(...A)}}}});function cd$(H,$=300000){let A=new Map,L=(...I)=>{let D=yH(I),B=A.get(D),f=Date.now();if(!B){let E=H(...I);return A.set(D,{value:E,timestamp:f,refreshing:!1}),E}if(B&&f-B.timestamp>$&&!B.refreshing)return B.refreshing=!0,Promise.resolve().then(()=>{let E=H(...I);A.set(D,{value:E,timestamp:Date.now(),refreshing:!1})}).catch((E)=>{r(E instanceof Error?E:Error(String(E))),A.delete(D)}),B.value;return A.get(D).value};return L.cache={clear:()=>A.clear()},L}function zGH(H,$=300000){let A=new Map,L=async(...I)=>{let D=yH(I),B=A.get(D),f=Date.now();if(!B){let E=await H(...I);return A.set(D,{value:E,timestamp:f,refreshing:!1}),E}if(B&&f-B.timestamp>$&&!B.refreshing)return B.refreshing=!0,H(...I).then((E)=>{A.set(D,{value:E,timestamp:Date.now(),refreshing:!1})}).catch((E)=>{r(E instanceof Error?E:Error(String(E))),A.delete(D)}),B.value;return A.get(D).value};return L.cache={clear:()=>A.clear()},L}var wwH=K(()=>{_$();Z$()});function KrB(){let H=new Map;for(let[$,A]of Object.entries(P4)){for(let[L,I]of Object.entries(A))P4[L]={open:`\x1B[${I[0]}m`,close:`\x1B[${I[1]}m`},A[L]=P4[L],H.set(I[0],I[1]);Object.defineProperty(P4,$,{value:A,enumerable:!1})}return Object.defineProperty(P4,"codes",{value:H,enumerable:!1}),P4.color.close="\x1B[39m",P4.bgColor.close="\x1B[49m",P4.color.ansi=w1L(),P4.color.ansi256=Z1L(),P4.color.ansi16m=q1L(),P4.bgColor.ansi=w1L(10),P4.bgColor.ansi256=Z1L(10),P4.bgColor.ansi16m=q1L(10),Object.defineProperties(P4,{rgbToAnsi256:{value($,A,L){if($===A&&A===L){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(A/255*5)+Math.round(L/255*5)},enumerable:!1},hexToRgb:{value($){let A=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!A)return[0,0,0];let[L]=A;if(L.length===3)L=[...L].map((D)=>D+D).join("");let I=Number.parseInt(L,16);return[I>>16&255,I>>8&255,I&255]},enumerable:!1},hexToAnsi256:{value:($)=>P4.rgbToAnsi256(...P4.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value($){if($<8)return 30+$;if($<16)return 90+($-8);let A,L,I;if($>=232)A=(($-232)*10+8)/255,L=A,I=A;else{$-=16;let f=$%36;A=Math.floor($/36)/5,L=Math.floor(f/6)/5,I=f%6/5}let D=Math.max(A,L,I)*2;if(D===0)return 30;let B=30+(Math.round(I)<<2|Math.round(L)<<1|Math.round(A));if(D===2)B+=60;return B},enumerable:!1},rgbToAnsi:{value:($,A,L)=>P4.ansi256ToAnsi(P4.rgbToAnsi256($,A,L)),enumerable:!1},hexToAnsi:{value:($)=>P4.ansi256ToAnsi(P4.hexToAnsi256($)),enumerable:!1}}),P4}var w1L=(H=0)=>($)=>`\x1B[${$+H}m`,Z1L=(H=0)=>($)=>`\x1B[${38+H};5;${$}m`,q1L=(H=0)=>($,A,L)=>`\x1B[${38+H};2;${$};${A};${L}m`,P4,C18,JrB,FrB,w18,QrB,mN;var T1L=K(()=>{P4={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},C18=Object.keys(P4.modifier),JrB=Object.keys(P4.color),FrB=Object.keys(P4.bgColor),w18=[...JrB,...FrB];QrB=KrB(),mN=QrB});function sZ(H,$=globalThis.Deno?globalThis.Deno.args:JeH.default.argv){let A=H.startsWith("-")?"":H.length===1?"-":"--",L=$.indexOf(A+H),I=$.indexOf("--");return L!==-1&&(I===-1||L=2,has16m:H>=3}}function PrB(H,{streamIsTTY:$,sniffFlags:A=!0}={}){let L=WrB();if(L!==void 0)XeH=L;let I=A?XeH:L;if(I===0)return 0;if(A){if(sZ("color=16m")||sZ("color=full")||sZ("color=truecolor"))return 3;if(sZ("color=256"))return 2}if("TF_BUILD"in GX&&"AGENT_NAME"in GX)return 1;if(H&&!$&&I===void 0)return 0;let D=I||0;if(GX.TERM==="dumb")return D;if(JeH.default.platform==="win32"){let B=N1L.default.release().split(".");if(Number(B[0])>=10&&Number(B[2])>=10586)return Number(B[2])>=14931?3:2;return 1}if("CI"in GX){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((B)=>(B in GX)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((B)=>(B in GX))||GX.CI_NAME==="codeship")return 1;return D}if("TEAMCITY_VERSION"in GX)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(GX.TEAMCITY_VERSION)?1:0;if(GX.COLORTERM==="truecolor")return 3;if(GX.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in GX){let B=Number.parseInt((GX.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(GX.TERM_PROGRAM){case"iTerm.app":return B>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(GX.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(GX.TERM))return 1;if("COLORTERM"in GX)return 1;return D}function z1L(H,$={}){let A=PrB(H,{streamIsTTY:H&&H.isTTY,...$});return VrB(A)}var JeH,N1L,ld$,GX,XeH,_rB,O1L;var x1L=K(()=>{JeH=b(require("process")),N1L=b(require("os")),ld$=b(require("tty"));({env:GX}=JeH.default);if(sZ("no-color")||sZ("no-colors")||sZ("color=false")||sZ("color=never"))XeH=0;else if(sZ("color")||sZ("colors")||sZ("color=true")||sZ("color=always"))XeH=1;_rB={stdout:z1L({isTTY:ld$.default.isatty(1)}),stderr:z1L({isTTY:ld$.default.isatty(2)})},O1L=_rB});function S1L(H,$,A){let L=H.indexOf($);if(L===-1)return H;let I=$.length,D=0,B="";do B+=H.slice(D,L)+$+A,D=L+I,L=H.indexOf($,D);while(L!==-1);return B+=H.slice(D),B}function j1L(H,$,A,L){let I=0,D="";do{let B=H[L-1]==="\r";D+=H.slice(I,B?L-1:L)+$+(B?`\r `);if(D!==-1)$=j1L($,I,L,D);return L+$+I},qrB,x18,oH;var r0=K(()=>{T1L();x1L();({stdout:R1L,stderr:y1L}=O1L),id$=Symbol("GENERATOR"),NGH=Symbol("STYLER"),ZwH=Symbol("IS_EMPTY"),v1L=["ansi","ansi","ansi256","ansi16m"],OGH=Object.create(null);Object.setPrototypeOf(qwH.prototype,Function.prototype);for(let[H,$]of Object.entries(mN))OGH[H]={get(){let A=FeH(this,rd$($.open,$.close,this[NGH]),this[ZwH]);return Object.defineProperty(this,H,{value:A}),A}};OGH.visible={get(){let H=FeH(this,this[NGH],!0);return Object.defineProperty(this,"visible",{value:H}),H}};CrB=["rgb","hex","ansi256"];for(let H of CrB){OGH[H]={get(){let{level:A}=this;return function(...L){let I=rd$(nd$(H,v1L[A],"color",...L),mN.color.close,this[NGH]);return FeH(this,I,this[ZwH])}}};let $="bg"+H[0].toUpperCase()+H.slice(1);OGH[$]={get(){let{level:A}=this;return function(...L){let I=rd$(nd$(H,v1L[A],"bgColor",...L),mN.bgColor.close,this[NGH]);return FeH(this,I,this[ZwH])}}}}wrB=Object.defineProperties(()=>{},{...OGH,level:{enumerable:!0,get(){return this[id$].level},set(H){this[id$].level=H}}});Object.defineProperties(qwH.prototype,OGH);qrB=qwH(),x18=qwH({level:y1L?y1L.level:0}),oH=qrB});function xGH(){TrB={data:null,valid:!1}}function b1L(){return!1}var TrB;var TwH=K(()=>{Ok$();B0();NA();qE();O_();Z$();TrB={data:null,valid:!1}});function od$(){let H=UL(),$=".credentials.json";return{storageDir:H,storagePath:k1L.join(H,".credentials.json")}}var k1L,u1L,g1L;var m1L=K(()=>{DL();NA();Z$();Z$();k1L=require("path"),u1L=require("fs");g1L={name:"plaintext",read(){let{storagePath:H}=od$();if(zH().existsSync(H))try{let $=zH().readFileSync(H,{encoding:"utf8"});return DA($)}catch($){return null}return null},async readAsync(){return this.read()},update(H){try{let{storageDir:$,storagePath:A}=od$();if(!zH().existsSync($))zH().mkdirSync($);return iL(A,yH(H),{encoding:"utf8",flush:!1}),u1L.chmodSync(A,384),{success:!0,warning:"Warning: Storing credentials in plaintext."}}catch($){return{success:!1}}},delete(){let{storagePath:H}=od$();if(zH().existsSync(H))try{return zH().unlinkSync(H),!0}catch($){return!1}return!0}}});function hW(){return g1L}var KeH=K(()=>{TwH();m1L()});function QeH(){let H=Dj$();if(H!==void 0)return H;let $=process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR;if(!$)return PHH(null),null;let A=parseInt($,10);if(Number.isNaN(A))return N(`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${$}`,{level:"error"}),PHH(null),null;try{let L=zH(),I=`/proc/self/fd/${A}`,D=L.readFileSync(I,{encoding:"utf8"}).trim();if(!D)return N("File descriptor contained empty OAuth token",{level:"error"}),PHH(null),null;return N(`Successfully read OAuth token from file descriptor ${A}`),PHH(D),D}catch(L){return N(`Failed to read OAuth token from file descriptor ${A}: ${L instanceof Error?L.message:String(L)}`,{level:"error"}),PHH(null),null}}function td$(){let H=Bj$();if(H!==void 0)return H;let $=process.env.CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR;if(!$)return _HH(null),null;let A=parseInt($,10);if(Number.isNaN(A))return N(`CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${$}`,{level:"error"}),_HH(null),null;try{let L=zH(),I=`/proc/self/fd/${A}`,D=L.readFileSync(I,{encoding:"utf8"}).trim();if(!D)return N("File descriptor contained empty API key",{level:"error"}),_HH(null),null;return N(`Successfully read API key from file descriptor ${A}`),_HH(D),D}catch(L){return N(`Failed to read API key from file descriptor ${A}: ${L instanceof Error?L.message:String(L)}`,{level:"error"}),_HH(null),null}}var p1L=K(()=>{E$();DL();g$()});async function WeH(){let $=M$().oauthAccount?.accountUuid,A=eZ();if(!$||!A)return;let L=`${XD().BASE_API_URL}/api/claude_cli_profile`;try{return(await nA.get(L,{headers:{"x-api-key":A,"anthropic-beta":N_},params:{account_uuid:$}})).data}catch(I){r(I)}}async function SGH(H){let $=`${XD().BASE_API_URL}/api/oauth/profile`;try{return(await nA.get($,{headers:{Authorization:`Bearer ${H}`,"Content-Type":"application/json"}})).data}catch(A){r(A)}}var zwH=K(()=>{w1();qE();EI();vA();_$()});function mk(H){return Boolean(H?.includes(VR))}function VeH(H){return H?.split(" ").filter(Boolean)??[]}function sd$({codeChallenge:H,state:$,port:A,isManual:L,loginWithClaudeAi:I,inferenceOnly:D,orgUUID:B}){let f=I?XD().CLAUDE_AI_AUTHORIZE_URL:XD().CONSOLE_AUTHORIZE_URL,E=new URL(f);E.searchParams.append("code","true"),E.searchParams.append("client_id",XD().CLIENT_ID),E.searchParams.append("response_type","code"),E.searchParams.append("redirect_uri",L?XD().MANUAL_REDIRECT_URL:`http://localhost:${A}/callback`);let M=D?[VR]:XAL;if(E.searchParams.append("scope",M.join(" ")),E.searchParams.append("code_challenge",H),E.searchParams.append("code_challenge_method","S256"),E.searchParams.append("state",$),B)E.searchParams.append("orgUUID",B);return E.toString()}async function d1L(H,$,A,L,I=!1,D){let B={grant_type:"authorization_code",code:H,redirect_uri:I?XD().MANUAL_REDIRECT_URL:`http://localhost:${L}/callback`,client_id:XD().CLIENT_ID,code_verifier:A,state:$};if(D!==void 0)B.expires_in=D;let f=await nA.post(XD().TOKEN_URL,B,{headers:{"Content-Type":"application/json"}});if(f.status!==200)throw Error(f.status===401?"Authentication failed: Invalid authorization code":`Token exchange failed (${f.status}): ${f.statusText}`);return c("tengu_oauth_token_exchange_success",{}),f.data}async function c1L(H){let $={grant_type:"refresh_token",refresh_token:H,client_id:XD().CLIENT_ID,scope:Fb$.join(" ")};try{let A=await nA.post(XD().TOKEN_URL,$,{headers:{"Content-Type":"application/json"}});if(A.status!==200)throw Error(`Token refresh failed: ${A.statusText}`);let L=A.data,{access_token:I,refresh_token:D=H,expires_in:B}=L,f=Date.now()+B*1000,E=VeH(L.scope);c("tengu_oauth_token_refresh_success",{});let M=await ed$(I);if(M$().oauthAccount){let U={};if(M.displayName!==void 0)U.displayName=M.displayName;if(typeof M.hasExtraUsageEnabled==="boolean")U.hasExtraUsageEnabled=M.hasExtraUsageEnabled;if(M.billingType!==null)U.billingType=M.billingType;if(M.accountCreatedAt!==void 0)U.accountCreatedAt=M.accountCreatedAt;if(M.subscriptionCreatedAt!==void 0)U.subscriptionCreatedAt=M.subscriptionCreatedAt;if(Object.keys(U).length>0)AA((X)=>({...X,oauthAccount:X.oauthAccount?{...X.oauthAccount,...U}:X.oauthAccount}))}return{accessToken:I,refreshToken:D,expiresAt:f,scopes:E,subscriptionType:M.subscriptionType,rateLimitTier:M.rateLimitTier}}catch(A){throw c("tengu_oauth_token_refresh_failure",{error:A.message}),A}}async function l1L(H){let $=await nA.get(XD().ROLES_URL,{headers:{Authorization:`Bearer ${H}`}});if($.status!==200)throw Error(`Failed to fetch user roles: ${$.statusText}`);let A=$.data;if(!M$().oauthAccount)throw Error("OAuth account information not found in config");AA((I)=>({...I,oauthAccount:I.oauthAccount?{...I.oauthAccount,organizationRole:A.organization_role,workspaceRole:A.workspace_role,organizationName:A.organization_name}:I.oauthAccount})),c("tengu_oauth_roles_stored",{org_role:A.organization_role})}async function i1L(H){try{let $=await nA.post(XD().API_KEY_URL,null,{headers:{Authorization:`Bearer ${H}`}}),A=$.data?.raw_key;if(A)return await r1L(A),c("tengu_oauth_api_key",{status:"success",statusCode:$.status}),A;return null}catch($){throw c("tengu_oauth_api_key",{status:"failure",error:$ instanceof Error?$.message:String($)}),$}}function pk(H){if(H===null)return!1;let $=300000;return Date.now()+$>=H}async function ed$(H){let $=await SGH(H),A=$?.organization?.organization_type,L=null;switch(A){case"claude_max":L="max";break;case"claude_pro":L="pro";break;case"claude_enterprise":L="enterprise";break;case"claude_team":L="team";break;default:L=null;break}let I={subscriptionType:L,rateLimitTier:$?.organization?.rate_limit_tier??null,hasExtraUsageEnabled:$?.organization?.has_extra_usage_enabled??null,billingType:$?.organization?.billing_type??null};if($?.account?.display_name)I.displayName=$.account.display_name;if($?.account?.created_at)I.accountCreatedAt=$.account.created_at;if($?.organization?.subscription_created_at)I.subscriptionCreatedAt=$.organization.subscription_created_at;return c("tengu_oauth_profile_fetch_success",{}),I}async function jR(){let $=M$().oauthAccount?.organizationUuid;if($)return $;let A=dD()?.accessToken;if(A===void 0)return null;let I=(await SGH(A))?.organization?.uuid;if(!I)return null;return I}async function n1L(){let H=M$();if(H.oauthAccount&&H.oauthAccount.billingType!==void 0&&H.oauthAccount.accountCreatedAt!==void 0&&H.oauthAccount.subscriptionCreatedAt!==void 0||!nL())return!1;let $=dD();if($?.accessToken){let A=await SGH($.accessToken);if(A)return Hc$({accountUuid:A.account.uuid,emailAddress:A.account.email,organizationUuid:A.organization.uuid,displayName:A.account.display_name||void 0,hasExtraUsageEnabled:A.organization.has_extra_usage_enabled??!1,billingType:A.organization.billing_type??void 0,accountCreatedAt:A.account.created_at,subscriptionCreatedAt:A.organization.subscription_created_at??void 0}),!0}return!1}function Hc$({accountUuid:H,emailAddress:$,organizationUuid:A,displayName:L,hasExtraUsageEnabled:I,billingType:D,accountCreatedAt:B,subscriptionCreatedAt:f}){let E={accountUuid:H,emailAddress:$,organizationUuid:A,hasExtraUsageEnabled:I,billingType:D,accountCreatedAt:B,subscriptionCreatedAt:f};if(L)E.displayName=L;AA((M)=>{if(M.oauthAccount?.accountUuid===E.accountUuid&&M.oauthAccount?.emailAddress===E.emailAddress&&M.oauthAccount?.organizationUuid===E.organizationUuid&&M.oauthAccount?.displayName===E.displayName&&M.oauthAccount?.hasExtraUsageEnabled===E.hasExtraUsageEnabled&&M.oauthAccount?.billingType===E.billingType&&M.oauthAccount?.accountCreatedAt===E.accountCreatedAt&&M.oauthAccount?.subscriptionCreatedAt===E.subscriptionCreatedAt)return M;return{...M,oauthAccount:E}})}var Hq=K(()=>{w1();qE();z$();vA();EI();zwH()});function o1L(){return null}function t1L(H){let $=o1L();if(!$)return H;let A=new globalThis.Headers(H);return Object.entries($).forEach(([L,I])=>{if(I!==void 0)A.set(L,I)}),A}function jGH(){return PeH&&!1}function s1L(){return null}function e1L(){return PeH&&a1L!==null&&!1}var NrB,PeH=!1,a1L=null,OrB="max";var $c$=K(()=>{vA();NrB={}});function xrB(H){let $=[],A=[];for(let L of H)if(H8L.includes(L))$.push(L);else A.push(L);return{allowed:$,disallowed:A}}function $8L(H){if(!H||H.length===0)return;if(nL()){console.warn("Warning: Custom betas are only available for API key users. Ignoring provided betas.");return}let{allowed:$,disallowed:A}=xrB(H);for(let L of A)console.warn(`Warning: Beta header '${L}' is not allowed. Only the following betas are supported: ${H8L.join(", ")}`);return $.length>0?$:void 0}function SrB(H){let $=sI();if($==="foundry")return!0;if($==="firstParty")return!H.includes("claude-3-");return H.includes("claude-opus-4")||H.includes("claude-sonnet-4")}function jrB(H){let $=H.toLowerCase();return $.includes("claude-opus-4")||$.includes("claude-sonnet-4")||$.includes("claude-haiku-4")}function RrB(H){let $=sI();if($==="foundry")return!0;if($==="firstParty")return!H.includes("claude-3-");return H.includes("claude-opus-4")||H.includes("claude-sonnet-4")||H.includes("claude-haiku-4")}function Ac$(H){let $=sI();if($!=="firstParty"&&$!=="foundry")return!1;return H.includes("claude-sonnet-4-5")||H.includes("claude-opus-4-1")||H.includes("claude-opus-4-5")||H.includes("claude-opus-4-6")||H.includes("claude-haiku-4-5")}function A8L(){let H=sI();if(H==="vertex"||H==="bedrock")return NcA;return zcA}function _eH(){return(sI()==="firstParty"||sI()==="foundry")&&!A$(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function YeH(H){let $=U2(H),A=V6();if(!A||A.length===0)return $;return[...$,...A.filter((L)=>!$.includes(L))]}function CeH(){Lc$.cache?.clear?.(),U2.cache?.clear?.(),Ic$.cache?.clear?.()}var H8L,Lc$,U2,Ic$;var $q=K(()=>{tD();g$();JHH();SD();qE();EI();NA();oM();SD();H8L=[zYH];Lc$=o$((H)=>{let $=[],A=H.includes("haiku"),L=sI(),I=_eH();if(!A)$.push(TcA);if(nL())$.push(N_);if(H.includes("[1m]"))$.push(zYH);if(!A$(process.env.DISABLE_INTERLEAVED_THINKING)&&SrB(H))$.push(RlH);let D=A$(process.env.USE_API_CONTEXT_MANAGEMENT)&&!1,B=RrB(H)&&NL("tengu_marble_anvil",!1);if(_eH()&&(D||B))$.push(ylH);let f=cf("tengu_tool_pear");if(Ac$(H)&&f)$.push(Oc);if(I&&NL("tengu_scarf_coffee",!1))$.push(vlH);if(L==="vertex"&&jrB(H))$.push(wS$);if(L==="foundry")$.push(wS$);if(I)$.push(NYH);if(process.env.ANTHROPIC_BETAS&&!A)$.push(...process.env.ANTHROPIC_BETAS.split(",").map((E)=>E.trim()).filter(Boolean));return $}),U2=o$((H)=>{let $=Lc$(H);if(sI()==="bedrock")return $.filter((A)=>!TS$.has(A));return $}),Ic$=o$((H)=>{return Lc$(H).filter((A)=>TS$.has(A))})});var L8L=z((tM)=>{tM.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(tM.HttpAuthLocation||(tM.HttpAuthLocation={}));tM.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(tM.HttpApiKeyAuthLocation||(tM.HttpApiKeyAuthLocation={}));tM.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(tM.EndpointURLScheme||(tM.EndpointURLScheme={}));tM.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(tM.AlgorithmId||(tM.AlgorithmId={}));var yrB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>tM.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>tM.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},vrB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},hrB=(H)=>{return yrB(H)},brB=(H)=>{return vrB(H)};tM.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(tM.FieldPosition||(tM.FieldPosition={}));var krB="__smithy_context";tM.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(tM.IniSectionType||(tM.IniSectionType={}));tM.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(tM.RequestHandlerProtocol||(tM.RequestHandlerProtocol={}));tM.SMITHY_CONTEXT_KEY=krB;tM.getDefaultClientConfiguration=hrB;tM.resolveDefaultRuntimeConfig=brB});var f8L=z((wl)=>{var urB=L8L(),grB=(H)=>{return{setHttpHandler($){H.httpHandler=$},httpHandler(){return H.httpHandler},updateHttpClientConfig($,A){H.httpHandler?.updateHttpClientConfig($,A)},httpHandlerConfigs(){return H.httpHandler.httpHandlerConfigs()}}},mrB=(H)=>{return{httpHandler:H.httpHandler()}};class I8L{name;kind;values;constructor({name:H,kind:$=urB.FieldPosition.HEADER,values:A=[]}){this.name=H,this.kind=$,this.values=A}add(H){this.values.push(H)}set(H){this.values=H}remove(H){this.values=this.values.filter(($)=>$!==H)}toString(){return this.values.map((H)=>H.includes(",")||H.includes(" ")?`"${H}"`:H).join(", ")}get(){return this.values}}class D8L{entries={};encoding;constructor({fields:H=[],encoding:$="utf-8"}){H.forEach(this.setField.bind(this)),this.encoding=$}setField(H){this.entries[H.name.toLowerCase()]=H}getField(H){return this.entries[H.toLowerCase()]}removeField(H){delete this.entries[H.toLowerCase()]}getByType(H){return Object.values(this.entries).filter(($)=>$.kind===H)}}class weH{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(H){this.method=H.method||"GET",this.hostname=H.hostname||"localhost",this.port=H.port,this.query=H.query||{},this.headers=H.headers||{},this.body=H.body,this.protocol=H.protocol?H.protocol.slice(-1)!==":"?`${H.protocol}:`:H.protocol:"https:",this.path=H.path?H.path.charAt(0)!=="/"?`/${H.path}`:H.path:"/",this.username=H.username,this.password=H.password,this.fragment=H.fragment}static clone(H){let $=new weH({...H,headers:{...H.headers}});if($.query)$.query=prB($.query);return $}static isInstance(H){if(!H)return!1;let $=H;return"method"in $&&"protocol"in $&&"hostname"in $&&"path"in $&&typeof $.query==="object"&&typeof $.headers==="object"}clone(){return weH.clone(this)}}function prB(H){return Object.keys(H).reduce(($,A)=>{let L=H[A];return{...$,[A]:Array.isArray(L)?[...L]:L}},{})}class B8L{statusCode;reason;headers;body;constructor(H){this.statusCode=H.statusCode,this.reason=H.reason,this.headers=H.headers||{},this.body=H.body}static isInstance(H){if(!H)return!1;let $=H;return typeof $.statusCode==="number"&&typeof $.headers==="object"}}function drB(H){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(H)}wl.Field=I8L;wl.Fields=D8L;wl.HttpRequest=weH;wl.HttpResponse=B8L;wl.getHttpHandlerExtensionConfiguration=grB;wl.isValidHostname=drB;wl.resolveHttpHandlerRuntimeConfig=mrB});var dk=z((NwH)=>{var crB=f8L();function lrB(H){return H}var E8L=(H)=>($)=>async(A)=>{if(!crB.HttpRequest.isInstance(A.request))return $(A);let{request:L}=A,{handlerProtocol:I=""}=H.requestHandler.metadata||{};if(I.indexOf("h2")>=0&&!L.headers[":authority"])delete L.headers.host,L.headers[":authority"]=L.hostname+(L.port?":"+L.port:"");else if(!L.headers.host){let D=L.hostname;if(L.port!=null)D+=`:${L.port}`;L.headers.host=D}return $(A)},M8L={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},irB=(H)=>({applyToStack:($)=>{$.add(E8L(H),M8L)}});NwH.getHostHeaderPlugin=irB;NwH.hostHeaderMiddleware=E8L;NwH.hostHeaderMiddlewareOptions=M8L;NwH.resolveHostHeaderConfig=lrB});var ck=z((ZeH)=>{var G8L=()=>(H,$)=>async(A)=>{try{let L=await H(A),{clientName:I,commandName:D,logger:B,dynamoDbDocumentClientOptions:f={}}=$,{overrideInputFilterSensitiveLog:E,overrideOutputFilterSensitiveLog:M}=f,G=E??$.inputFilterSensitiveLog,U=M??$.outputFilterSensitiveLog,{$metadata:X,...J}=L.output;return B?.info?.({clientName:I,commandName:D,input:G(A.input),output:U(J),metadata:X}),L}catch(L){let{clientName:I,commandName:D,logger:B,dynamoDbDocumentClientOptions:f={}}=$,{overrideInputFilterSensitiveLog:E}=f,M=E??$.inputFilterSensitiveLog;throw B?.error?.({clientName:I,commandName:D,input:M(A.input),error:L,metadata:L.$metadata}),L}},U8L={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},nrB=(H)=>({applyToStack:($)=>{$.add(G8L(),U8L)}});ZeH.getLoggerPlugin=nrB;ZeH.loggerMiddleware=G8L;ZeH.loggerMiddlewareOptions=U8L});var J8L=z((xwH)=>{var OwH={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID")},Dc$=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");if(!Dc$)globalThis.awslambda=globalThis.awslambda||{};class qeH{static PROTECTED_KEYS=OwH;isProtectedKey(H){return Object.values(OwH).includes(H)}getRequestId(){return this.get(OwH.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(OwH.X_RAY_TRACE_ID)}getTenantId(){return this.get(OwH.TENANT_ID)}}class X8L extends qeH{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(H){return this.currentContext?.[H]}set(H,$){if(this.isProtectedKey(H))throw Error(`Cannot modify protected Lambda context field: ${String(H)}`);this.currentContext=this.currentContext||{},this.currentContext[H]=$}run(H,$){this.currentContext=H;try{return $()}finally{this.currentContext=void 0}}}class Bc$ extends qeH{als;static async create(){let H=new Bc$,$=await import("async_hooks");return H.als=new $.AsyncLocalStorage,H}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(H){return this.als.getStore()?.[H]}set(H,$){if(this.isProtectedKey(H))throw Error(`Cannot modify protected Lambda context field: ${String(H)}`);let A=this.als.getStore();if(!A)throw Error("No context available");A[H]=$}run(H,$){return this.als.run(H,$)}}xwH.InvokeStore=void 0;(function(H){let $=null;async function A(){if(!$)$=(async()=>{let I="AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await Bc$.create():new X8L;if(!Dc$&&globalThis.awslambda?.InvokeStore)return globalThis.awslambda.InvokeStore;else if(!Dc$&&globalThis.awslambda)return globalThis.awslambda.InvokeStore=I,I;else return I})();return $}H.getInstanceAsync=A,H._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{if($=null,globalThis.awslambda?.InvokeStore)delete globalThis.awslambda.InvokeStore;globalThis.awslambda={}}}:void 0})(xwH.InvokeStore||(xwH.InvokeStore={}));xwH.InvokeStoreBase=qeH});var F8L=z((sM)=>{sM.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(sM.HttpAuthLocation||(sM.HttpAuthLocation={}));sM.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(sM.HttpApiKeyAuthLocation||(sM.HttpApiKeyAuthLocation={}));sM.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(sM.EndpointURLScheme||(sM.EndpointURLScheme={}));sM.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(sM.AlgorithmId||(sM.AlgorithmId={}));var rrB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>sM.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>sM.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},arB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},orB=(H)=>{return rrB(H)},trB=(H)=>{return arB(H)};sM.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(sM.FieldPosition||(sM.FieldPosition={}));var srB="__smithy_context";sM.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(sM.IniSectionType||(sM.IniSectionType={}));sM.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(sM.RequestHandlerProtocol||(sM.RequestHandlerProtocol={}));sM.SMITHY_CONTEXT_KEY=srB;sM.getDefaultClientConfiguration=orB;sM.resolveDefaultRuntimeConfig=trB});var V8L=z((Zl)=>{var erB=F8L(),HaB=(H)=>{return{setHttpHandler($){H.httpHandler=$},httpHandler(){return H.httpHandler},updateHttpClientConfig($,A){H.httpHandler?.updateHttpClientConfig($,A)},httpHandlerConfigs(){return H.httpHandler.httpHandlerConfigs()}}},$aB=(H)=>{return{httpHandler:H.httpHandler()}};class K8L{name;kind;values;constructor({name:H,kind:$=erB.FieldPosition.HEADER,values:A=[]}){this.name=H,this.kind=$,this.values=A}add(H){this.values.push(H)}set(H){this.values=H}remove(H){this.values=this.values.filter(($)=>$!==H)}toString(){return this.values.map((H)=>H.includes(",")||H.includes(" ")?`"${H}"`:H).join(", ")}get(){return this.values}}class Q8L{entries={};encoding;constructor({fields:H=[],encoding:$="utf-8"}){H.forEach(this.setField.bind(this)),this.encoding=$}setField(H){this.entries[H.name.toLowerCase()]=H}getField(H){return this.entries[H.toLowerCase()]}removeField(H){delete this.entries[H.toLowerCase()]}getByType(H){return Object.values(this.entries).filter(($)=>$.kind===H)}}class TeH{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(H){this.method=H.method||"GET",this.hostname=H.hostname||"localhost",this.port=H.port,this.query=H.query||{},this.headers=H.headers||{},this.body=H.body,this.protocol=H.protocol?H.protocol.slice(-1)!==":"?`${H.protocol}:`:H.protocol:"https:",this.path=H.path?H.path.charAt(0)!=="/"?`/${H.path}`:H.path:"/",this.username=H.username,this.password=H.password,this.fragment=H.fragment}static clone(H){let $=new TeH({...H,headers:{...H.headers}});if($.query)$.query=AaB($.query);return $}static isInstance(H){if(!H)return!1;let $=H;return"method"in $&&"protocol"in $&&"hostname"in $&&"path"in $&&typeof $.query==="object"&&typeof $.headers==="object"}clone(){return TeH.clone(this)}}function AaB(H){return Object.keys(H).reduce(($,A)=>{let L=H[A];return{...$,[A]:Array.isArray(L)?[...L]:L}},{})}class W8L{statusCode;reason;headers;body;constructor(H){this.statusCode=H.statusCode,this.reason=H.reason,this.headers=H.headers||{},this.body=H.body}static isInstance(H){if(!H)return!1;let $=H;return typeof $.statusCode==="number"&&typeof $.headers==="object"}}function LaB(H){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(H)}Zl.Field=K8L;Zl.Fields=Q8L;Zl.HttpRequest=TeH;Zl.HttpResponse=W8L;Zl.getHttpHandlerExtensionConfiguration=HaB;Zl.isValidHostname=LaB;Zl.resolveHttpHandlerRuntimeConfig=$aB});var P8L=z((zeH)=>{Object.defineProperty(zeH,"__esModule",{value:!0});zeH.recursionDetectionMiddleware=void 0;var IaB=J8L(),DaB=V8L(),fc$="X-Amzn-Trace-Id",BaB="AWS_LAMBDA_FUNCTION_NAME",faB="_X_AMZN_TRACE_ID",EaB=()=>(H)=>async($)=>{let{request:A}=$;if(!DaB.HttpRequest.isInstance(A))return H($);let L=Object.keys(A.headers??{}).find((G)=>G.toLowerCase()===fc$.toLowerCase())??fc$;if(A.headers.hasOwnProperty(L))return H($);let I=process.env[BaB],D=process.env[faB],E=(await IaB.InvokeStore.getInstanceAsync())?.getXRayTraceId()??D,M=(G)=>typeof G==="string"&&G.length>0;if(M(I)&&M(E))A.headers[fc$]=E;return H({...$,request:A})};zeH.recursionDetectionMiddleware=EaB});var lk=z((NeH)=>{var Ec$=P8L(),MaB={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},GaB=(H)=>({applyToStack:($)=>{$.add(Ec$.recursionDetectionMiddleware(),MaB)}});NeH.getRecursionDetectionPlugin=GaB;Object.keys(Ec$).forEach(function(H){if(H!=="default"&&!Object.prototype.hasOwnProperty.call(NeH,H))Object.defineProperty(NeH,H,{enumerable:!0,get:function(){return Ec$[H]}})})});var Mc$=z((eM)=>{eM.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(eM.HttpAuthLocation||(eM.HttpAuthLocation={}));eM.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(eM.HttpApiKeyAuthLocation||(eM.HttpApiKeyAuthLocation={}));eM.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(eM.EndpointURLScheme||(eM.EndpointURLScheme={}));eM.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(eM.AlgorithmId||(eM.AlgorithmId={}));var UaB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>eM.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>eM.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},XaB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},JaB=(H)=>{return UaB(H)},FaB=(H)=>{return XaB(H)};eM.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(eM.FieldPosition||(eM.FieldPosition={}));var KaB="__smithy_context";eM.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(eM.IniSectionType||(eM.IniSectionType={}));eM.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(eM.RequestHandlerProtocol||(eM.RequestHandlerProtocol={}));eM.SMITHY_CONTEXT_KEY=KaB;eM.getDefaultClientConfiguration=JaB;eM.resolveDefaultRuntimeConfig=FaB});var _8L=z((HG)=>{HG.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(HG.HttpAuthLocation||(HG.HttpAuthLocation={}));HG.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(HG.HttpApiKeyAuthLocation||(HG.HttpApiKeyAuthLocation={}));HG.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(HG.EndpointURLScheme||(HG.EndpointURLScheme={}));HG.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(HG.AlgorithmId||(HG.AlgorithmId={}));var QaB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>HG.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>HG.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},WaB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},VaB=(H)=>{return QaB(H)},PaB=(H)=>{return WaB(H)};HG.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(HG.FieldPosition||(HG.FieldPosition={}));var _aB="__smithy_context";HG.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(HG.IniSectionType||(HG.IniSectionType={}));HG.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(HG.RequestHandlerProtocol||(HG.RequestHandlerProtocol={}));HG.SMITHY_CONTEXT_KEY=_aB;HG.getDefaultClientConfiguration=VaB;HG.resolveDefaultRuntimeConfig=PaB});var O6=z((Gc$)=>{var Y8L=_8L(),YaB=(H)=>H[Y8L.SMITHY_CONTEXT_KEY]||(H[Y8L.SMITHY_CONTEXT_KEY]={}),CaB=(H)=>{if(typeof H==="function")return H;let $=Promise.resolve(H);return()=>$};Gc$.getSmithyContext=YaB;Gc$.normalizeProvider=CaB});var C8L=z(($G)=>{$G.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})($G.HttpAuthLocation||($G.HttpAuthLocation={}));$G.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})($G.HttpApiKeyAuthLocation||($G.HttpApiKeyAuthLocation={}));$G.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})($G.EndpointURLScheme||($G.EndpointURLScheme={}));$G.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})($G.AlgorithmId||($G.AlgorithmId={}));var waB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>$G.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>$G.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},ZaB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},qaB=(H)=>{return waB(H)},TaB=(H)=>{return ZaB(H)};$G.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})($G.FieldPosition||($G.FieldPosition={}));var zaB="__smithy_context";$G.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})($G.IniSectionType||($G.IniSectionType={}));$G.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})($G.RequestHandlerProtocol||($G.RequestHandlerProtocol={}));$G.SMITHY_CONTEXT_KEY=zaB;$G.getDefaultClientConfiguration=qaB;$G.resolveDefaultRuntimeConfig=TaB});var T8L=z((ql)=>{var NaB=C8L(),OaB=(H)=>{return{setHttpHandler($){H.httpHandler=$},httpHandler(){return H.httpHandler},updateHttpClientConfig($,A){H.httpHandler?.updateHttpClientConfig($,A)},httpHandlerConfigs(){return H.httpHandler.httpHandlerConfigs()}}},xaB=(H)=>{return{httpHandler:H.httpHandler()}};class w8L{name;kind;values;constructor({name:H,kind:$=NaB.FieldPosition.HEADER,values:A=[]}){this.name=H,this.kind=$,this.values=A}add(H){this.values.push(H)}set(H){this.values=H}remove(H){this.values=this.values.filter(($)=>$!==H)}toString(){return this.values.map((H)=>H.includes(",")||H.includes(" ")?`"${H}"`:H).join(", ")}get(){return this.values}}class Z8L{entries={};encoding;constructor({fields:H=[],encoding:$="utf-8"}){H.forEach(this.setField.bind(this)),this.encoding=$}setField(H){this.entries[H.name.toLowerCase()]=H}getField(H){return this.entries[H.toLowerCase()]}removeField(H){delete this.entries[H.toLowerCase()]}getByType(H){return Object.values(this.entries).filter(($)=>$.kind===H)}}class OeH{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(H){this.method=H.method||"GET",this.hostname=H.hostname||"localhost",this.port=H.port,this.query=H.query||{},this.headers=H.headers||{},this.body=H.body,this.protocol=H.protocol?H.protocol.slice(-1)!==":"?`${H.protocol}:`:H.protocol:"https:",this.path=H.path?H.path.charAt(0)!=="/"?`/${H.path}`:H.path:"/",this.username=H.username,this.password=H.password,this.fragment=H.fragment}static clone(H){let $=new OeH({...H,headers:{...H.headers}});if($.query)$.query=SaB($.query);return $}static isInstance(H){if(!H)return!1;let $=H;return"method"in $&&"protocol"in $&&"hostname"in $&&"path"in $&&typeof $.query==="object"&&typeof $.headers==="object"}clone(){return OeH.clone(this)}}function SaB(H){return Object.keys(H).reduce(($,A)=>{let L=H[A];return{...$,[A]:Array.isArray(L)?[...L]:L}},{})}class q8L{statusCode;reason;headers;body;constructor(H){this.statusCode=H.statusCode,this.reason=H.reason,this.headers=H.headers||{},this.body=H.body}static isInstance(H){if(!H)return!1;let $=H;return typeof $.statusCode==="number"&&typeof $.headers==="object"}}function jaB(H){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(H)}ql.Field=w8L;ql.Fields=Z8L;ql.HttpRequest=OeH;ql.HttpResponse=q8L;ql.getHttpHandlerExtensionConfiguration=OaB;ql.isValidHostname=jaB;ql.resolveHttpHandlerRuntimeConfig=xaB});var Xc$=z((RGH)=>{var RaB=T8L(),z8L=(H,$)=>(A,L)=>async(I)=>{let{response:D}=await A(I);try{let B=await $(D,H);return{response:D,output:B}}catch(B){if(Object.defineProperty(B,"$response",{value:D,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in B)){try{B.message+=` `);let{connect:E,buffered:M}=await f;if(H.emit("proxyConnect",E),this.emit("proxyConnect",E,H),E.statusCode===200){if(H.once("socket",F_0),$.secureEndpoint)return GqH("Upgrading socket connection to TLS"),jgL.connect({...ygL(RgL($),"host","path","port"),socket:L});return L}L.destroy();let G=new ZD$.Socket({writable:!1});return G.readable=!0,H.once("socket",(U)=>{GqH("Replaying proxy buffer for failed request"),(0,M_0.default)(U.listenerCount("data")>0),U.push(M),U.push(null)}),G}}b$A.protocols=["http","https"];Qq.HttpsProxyAgent=b$A;function F_0(H){H.resume()}function ygL(H,...$){let A={},L;for(L in H)if(!$.includes(L))A[L]=H[L];return A}});function k$A(){let H=sN();if(!H)return;return{cert:H.cert,key:H.key,passphrase:H.passphrase}}function u$A(){let H=sN();if(!H)return{};if(typeof Bun<"u")return{tls:H};return N("mTLS: Created undici agent with custom certificates"),{dispatcher:new kgL.Agent({connect:{cert:H.cert,key:H.key,passphrase:H.passphrase},pipelining:1})}}function ggL(){if(!sN())return;if(process.env.NODE_EXTRA_CA_CERTS)N("NODE_EXTRA_CA_CERTS detected - Node.js will automatically append to built-in CAs")}var bgL,kgL,sN,ugL;var H4H=K(()=>{tD();E$();DL();bgL=require("https"),kgL=b(require("undici")),sN=o$(()=>{let H={};if(process.env.CLAUDE_CODE_CLIENT_CERT)try{H.cert=zH().readFileSync(process.env.CLAUDE_CODE_CLIENT_CERT,{encoding:"utf8"}),N("mTLS: Loaded client certificate from CLAUDE_CODE_CLIENT_CERT")}catch($){N(`mTLS: Failed to load client certificate: ${$}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY)try{H.key=zH().readFileSync(process.env.CLAUDE_CODE_CLIENT_KEY,{encoding:"utf8"}),N("mTLS: Loaded client key from CLAUDE_CODE_CLIENT_KEY")}catch($){N(`mTLS: Failed to load client key: ${$}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE)H.passphrase=process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE,N("mTLS: Using client key passphrase");if(Object.keys(H).length===0)return;return H}),ugL=o$(()=>{let H=sN();if(!H)return;let $={...H,keepAlive:!0};return N("mTLS: Creating HTTPS agent with custom certificates"),new bgL.Agent($)})});function K_0(H){switch(H.family){case 0:case 4:case 6:return H.family;case"IPv6":return 6;case"IPv4":case void 0:return 4;default:throw Error(`Unsupported address family: ${H.family}`)}}function Ku(H=process.env){return H.https_proxy||H.HTTPS_PROXY||H.http_proxy||H.HTTP_PROXY}function Q_0(H=process.env){return H.no_proxy||H.NO_PROXY}function JqH(H,$=Q_0()){if(!$)return!1;if($==="*")return!0;try{let A=new URL(H),L=A.hostname.toLowerCase(),I=A.port||(A.protocol==="https:"?"443":"80"),D=`${L}:${I}`;return $.split(/[,\s]+/).filter(Boolean).some((f)=>{if(f=f.toLowerCase().trim(),f.includes(":"))return D===f;if(f.startsWith(".")){let E=f;return L===f.substring(1)||L.endsWith(E)}return L===f})}catch{return!1}}function pgL(H){let $=sN(),A={...$&&{cert:$.cert,key:$.key,passphrase:$.passphrase}};if(A$(process.env.CLAUDE_CODE_PROXY_RESOLVES_HOSTS))A.lookup=(L,I,D)=>{D(null,L,K_0(I))};return new g$A.HttpsProxyAgent(H,A)}function VAH(H){let $=Ku();if(!$)return;if(JqH(H))return;return pgL($)}function PAH(H){let $=Ku();if(!$)return;if(JqH(H))return;return $}function _AH(){let H=Ku(),$=u$A();if(H){if(typeof Bun<"u")return{proxy:H,...$};return{dispatcher:dgL(H)}}return $}function TD$(){let H=Ku(),$=ugL();if(qD$!==void 0)nA.interceptors.request.eject(qD$),qD$=void 0;if(nA.defaults.proxy=void 0,nA.defaults.httpAgent=void 0,nA.defaults.httpsAgent=void 0,H){nA.defaults.proxy=!1;let A=pgL(H);qD$=nA.interceptors.request.use((L)=>{if(L.url&&JqH(L.url))if($)L.httpsAgent=$,L.httpAgent=$;else delete L.httpsAgent,delete L.httpAgent;else L.httpsAgent=A,L.httpAgent=A;return L}),XqH.setGlobalDispatcher(dgL(H))}else if($){nA.defaults.httpsAgent=$;let A=u$A();if(A.dispatcher)XqH.setGlobalDispatcher(A.dispatcher)}}function m$A(){let H=Ku();if(!H)return{};let $=new g$A.HttpsProxyAgent(H),A=new mgL.NodeHttpHandler({httpAgent:$,httpsAgent:$});return{requestHandler:A,credentials:P2({clientConfig:{requestHandler:A}})}}var mgL,g$A,XqH,dgL,qD$;var nR=K(()=>{BAH();w1();tD();H4H();NA();mgL=b(X2(),1),g$A=b(UqH(),1),XqH=b(require("undici"));dgL=o$((H)=>{let $=sN(),A={httpProxy:H,httpsProxy:H,noProxy:process.env.NO_PROXY||process.env.no_proxy};if($)A.connect={cert:$.cert,key:$.key,passphrase:$.passphrase};return new XqH.EnvHttpProxyAgent(A)})});function eN(H,$){return H.find((A)=>A.includes($))??null}async function lgL(){let H=NHH(),$=A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),A={region:H,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...m$A(),...$&&{requestHandler:new d$A.NodeHttpHandler,httpAuthSchemes:[{schemeId:"smithy.api#noAuth",identityProvider:()=>async()=>({}),signer:new p$A.NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:"smithy.api#noAuth"}]}};if(!$&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let L=await YAH();if(L)A.credentials={accessKeyId:L.accessKeyId,secretAccessKey:L.secretAccessKey,sessionToken:L.sessionToken}}return new e1(A)}async function igL(){let H=NHH(),$=A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),A={region:H,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...m$A(),...$&&{requestHandler:new d$A.NodeHttpHandler,httpAuthSchemes:[{schemeId:"smithy.api#noAuth",identityProvider:()=>async()=>({}),signer:new p$A.NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:"smithy.api#noAuth"}]}};if(!$&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let L=await YAH();if(L)A.credentials={accessKeyId:L.accessKeyId,secretAccessKey:L.secretAccessKey,sessionToken:L.sessionToken}}return new WAH(A)}function c$A(H){return H.startsWith("anthropic.")}function l$A(H){for(let $ of W_0)if(H.startsWith(`${$}.anthropic.`))return $;return}function ngL(H,$){let A=l$A(H);if(A)return H.replace(`${A}.`,`${$}.`);if(c$A(H))return`${$}.${H}`;return H}var p$A,d$A,cgL,zD$,W_0;var FqH=K(()=>{WvL();CD$();tD();EI();NA();_$();nR();p$A=b(S0(),1),d$A=b(X2(),1),cgL=o$(async function(){let H=await lgL(),$=[],A;try{do{let L=new GAH({...A&&{nextToken:A},typeEquals:"SYSTEM_DEFINED"}),I=await H.send(L);if(I.inferenceProfileSummaries)$.push(...I.inferenceProfileSummaries);A=I.nextToken}while(A);return $.filter((L)=>L.inferenceProfileId?.includes("anthropic")).map((L)=>L.inferenceProfileId).filter(Boolean)}catch(L){throw r(L),L}});zD$=o$(async function(H){try{let $=await lgL(),A=new mZH({inferenceProfileIdentifier:H}),L=await $.send(A);if(!L.models||L.models.length===0)return null;let I=L.models[0];if(!I?.modelArn)return null;let D=I.modelArn.lastIndexOf("/");return D>=0?I.modelArn.substring(D+1):I.modelArn}catch($){return r($),null}});W_0=["us","eu","apac","global"]});function i$A(H){if(sI()==="foundry")return;let $=H.toLowerCase();if($.includes("claude-opus-4-6[1m]"))return"Opus 4.6 (with 1M context)";if($.includes("claude-opus-4-6"))return"Opus 4.6";if($.includes("claude-opus-4-5"))return"Opus 4.5";if($.includes("claude-opus-4-1"))return"Opus 4.1";if($.includes("claude-opus-4"))return"Opus 4";if($.includes("claude-sonnet-4-5[1m]"))return"Sonnet 4.5 (with 1M context)";if($.includes("claude-sonnet-4-5"))return"Sonnet 4.5";if($.includes("claude-sonnet-4[1m]"))return"Sonnet 4 (with 1M context)";if($.includes("claude-sonnet-4"))return"Sonnet 4";if($.includes("claude-3-7-sonnet"))return"Claude 3.7 Sonnet";if($.includes("claude-3-5-sonnet"))return"Claude 3.5 Sonnet";if($.includes("claude-haiku-4-5"))return"Haiku 4.5";if($.includes("claude-3-5-haiku"))return"Claude 3.5 Haiku";return}var KqH,QqH,WqH,VqH,CAH,PqH,_qH,YqH,CqH,wAH;var $4H=K(()=>{oM();KqH={firstParty:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet"},QqH={firstParty:"claude-3-5-sonnet-20241022",bedrock:"anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet"},WqH={firstParty:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku"},VqH={firstParty:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5"},CAH={firstParty:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4"},PqH={firstParty:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5"},_qH={firstParty:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4"},YqH={firstParty:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1"},CqH={firstParty:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5"},wAH={firstParty:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6"}});function rR(H){let $=[],A=!1;async function L(){if(A)return;if($.length===0)return;A=!0;while($.length>0){let{args:I,resolve:D,reject:B,context:f}=$.shift();try{let E=await H.apply(f,I);D(E)}catch(E){B(E)}}if(A=!1,$.length>0)L()}return function(...I){return new Promise((D,B)=>{$.push({args:I,resolve:D,reject:B,context:this}),L()})}}function wqH(H){return{haiku35:WqH[H],haiku45:VqH[H],sonnet35:QqH[H],sonnet37:KqH[H],sonnet40:CAH[H],sonnet45:PqH[H],opus40:_qH[H],opus41:YqH[H],opus45:CqH[H],opus46:wAH[H]}}async function V_0(){let H;try{H=await cgL()}catch(U){return r(U),wqH("bedrock")}if(!H?.length)return wqH("bedrock");let $=eN(H,"claude-3-5-haiku-20241022"),A=eN(H,"claude-haiku-4-5-20251001"),L=eN(H,"claude-3-5-sonnet-20241022"),I=eN(H,"claude-3-7-sonnet-20250219"),D=eN(H,"claude-sonnet-4-20250514"),B=eN(H,"claude-sonnet-4-5-20250929"),f=eN(H,"claude-opus-4-20250514"),E=eN(H,"claude-opus-4-1-20250805"),M=eN(H,"claude-opus-4-5-20251101"),G=eN(H,"claude-opus-4-6");return{haiku35:$||WqH.bedrock,haiku45:A||VqH.bedrock,sonnet35:L||QqH.bedrock,sonnet37:I||KqH.bedrock,sonnet40:D||CAH.bedrock,sonnet45:B||PqH.bedrock,opus40:f||_qH.bedrock,opus41:E||YqH.bedrock,opus45:M||CqH.bedrock,opus46:G||wAH.bedrock}}function P_0(){if(GEH()!==null)return;if(sI()!=="bedrock"){vYH(wqH(sI()));return}rgL()}function aG(){let H=GEH();if(H===null)return P_0(),wqH(sI());return H}async function agL(){if(GEH()!==null)return;if(sI()!=="bedrock"){vYH(wqH(sI()));return}await rgL()}var rgL;var ND$=K(()=>{g$();_$();FqH();$4H();oM();rgL=rR(async()=>{if(GEH()!==null)return;try{let H=await V_0();vYH(H)}catch(H){r(H)}})});async function ogL(){}function Z2(H){return H.slice(-20)}var ZqH=K(()=>{TwH();O_()});class q2{static instance=null;status={isAuthenticating:!1,output:[]};listeners=new Set;static getInstance(){if(!q2.instance)q2.instance=new q2;return q2.instance}getStatus(){return{...this.status,output:[...this.status.output]}}startAuthentication(){this.status={isAuthenticating:!0,output:[]},this.notifyListeners()}addOutput(H){this.status.output.push(H),this.notifyListeners()}setError(H){this.status.error=H,this.notifyListeners()}endAuthentication(H){if(H)this.status={isAuthenticating:!1,output:[]};else this.status.isAuthenticating=!1;this.notifyListeners()}subscribe(H){return this.listeners.add(H),()=>{this.listeners.delete(H)}}notifyListeners(){this.listeners.forEach((H)=>H(this.getStatus()))}static reset(){if(q2.instance)q2.instance.listeners.clear(),q2.instance=null}}function p_(){let H=A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY),A=(VL()||{}).apiKeyHelper,L=process.env.ANTHROPIC_AUTH_TOKEN||A||process.env.CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR,{source:I}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return!(H||L||(I==="ANTHROPIC_API_KEY"||I==="apiKeyHelper")&&!A$(process.env.CLAUDE_CODE_REMOTE))}function ji(){if(process.env.ANTHROPIC_AUTH_TOKEN)return{source:"ANTHROPIC_AUTH_TOKEN",hasToken:!0};if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{source:"CLAUDE_CODE_OAUTH_TOKEN",hasToken:!0};if(QeH())return{source:"CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR",hasToken:!0};if(TqH())return{source:"apiKeyHelper",hasToken:!0};let A=dD();if(mk(A?.scopes)&&A?.accessToken)return{source:"claude.ai",hasToken:!0};return{source:"none",hasToken:!1}}function eZ(){let{key:H}=Y5();return H}function HmL(){let{key:H,source:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return H!==null&&$!=="none"}function Y5(H={}){if(uYH()&&process.env.ANTHROPIC_API_KEY)return{key:process.env.ANTHROPIC_API_KEY,source:"ANTHROPIC_API_KEY"};if(A$(!1)){let L=td$();if(L)return{key:L,source:"ANTHROPIC_API_KEY"};if(!process.env.ANTHROPIC_API_KEY&&!process.env.CLAUDE_CODE_OAUTH_TOKEN&&!process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR)throw Error("ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN env var is required");if(process.env.ANTHROPIC_API_KEY)return{key:process.env.ANTHROPIC_API_KEY,source:"ANTHROPIC_API_KEY"};return{key:null,source:"none"}}if(process.env.ANTHROPIC_API_KEY&&M$().customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY)))return{key:process.env.ANTHROPIC_API_KEY,source:"ANTHROPIC_API_KEY"};let $=td$();if($)return{key:$,source:"ANTHROPIC_API_KEY"};if(H.skipRetrievingKeyFromApiKeyHelper){if(TqH())return{key:null,source:"apiKeyHelper"}}else{let L=zqH(tI());if(L)return{key:L,source:"apiKeyHelper"}}let A=NqH();if(A)return A;return{key:null,source:"none"}}function TqH(){return(VL()||{}).apiKeyHelper}function $mL(){let H=TqH();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.apiKeyHelper===H||A?.apiKeyHelper===H}function a$A(){return(VL()||{}).awsAuthRefresh}function AmL(){let H=a$A();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.awsAuthRefresh===H||A?.awsAuthRefresh===H}function o$A(){return(VL()||{}).awsCredentialExport}function LmL(){let H=o$A();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.awsCredentialExport===H||A?.awsCredentialExport===H}function Y_0(){let H=process.env.CLAUDE_CODE_API_KEY_HELPER_TTL_MS;if(H){let $=parseInt(H,10);if(!Number.isNaN($)&&$>=0)return $;N(`Found CLAUDE_CODE_API_KEY_HELPER_TTL_MS env var, but it was not a valid number. Got ${H}`,{level:"error"})}return __0}function xD$(){zqH.cache.clear()}function ImL(H){if(TqH()){if($mL()){if(!XG(!0))return}}zqH(H)}async function w_0(){let H=a$A();if(!H)return!1;if(AmL()){if(!XG(!0)&&!tI()){let A=Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);return pZ("awsAuthRefresh invoked before trust check",A),c("tengu_awsAuthRefresh_missing_trust",{}),!1}}try{return N("Fetching AWS caller identity for AWS auth refresh command"),await ao$(),N("Fetched AWS caller identity, skipping AWS auth refresh command"),!1}catch{return Z_0(H)}}function Z_0(H){N("Running AWS auth refresh command");let $=q2.getInstance();return $.startAuthentication(),new Promise((A)=>{let L=egL.exec(H);L.stdout.on("data",(I)=>{let D=I.toString().trim();if(D)$.addOutput(D),N(D,{level:"debug"})}),L.stderr.on("data",(I)=>{let D=I.toString().trim();if(D)$.setError(D),N(D,{level:"error"})}),L.on("close",(I)=>{if(I===0)N("AWS auth refresh completed successfully"),$.endAuthentication(!0),A(!0);else{let D=oH.red("Error running awsAuthRefresh (in settings or ~/.claude.json):");console.error(D),$.endAuthentication(!1),A(!1)}})})}async function q_0(){let H=o$A();if(!H)return null;if(LmL()){if(!XG(!0)&&!tI()){let A=Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);return pZ("awsCredentialExport invoked before trust check",A),c("tengu_awsCredentialExport_missing_trust",{}),null}}try{return N("Fetching AWS caller identity for credential export command"),await ao$(),N("Fetched AWS caller identity, skipping AWS credential export command"),null}catch{try{N("Running AWS credential export command");let $=await fE(H,{shell:!0,reject:!1});if($.exitCode!==0||!$.stdout)throw Error("awsCredentialExport did not return a valid value");let A=DA($.stdout.trim());if(!KzL(A))throw Error("awsCredentialExport did not return valid AWS STS output structure");return N("AWS credentials retrieved from awsCredentialExport"),{accessKeyId:A.Credentials.AccessKeyId,secretAccessKey:A.Credentials.SecretAccessKey,sessionToken:A.Credentials.SessionToken}}catch($){let A=oH.red("Error getting AWS credentials from awsCredentialExport (in settings or ~/.claude.json):");if($ instanceof Error)console.error(A,$.message);else console.error(A,$);return null}}}function SD$(){YAH.cache.clear()}function DmL(){let H=a$A(),$=o$A();if(!H&&!$)return;if(AmL()||LmL()){if(!XG(!0)&&!tI())return}YAH(),aG()}function T_0(H){return/^[a-zA-Z0-9-_]+$/.test(H)}async function r1L(H){if(!T_0(H))throw Error("Invalid API key format. API key must contain only alphanumeric characters, dashes, and underscores.");await fmL();let $=!1;c("tengu_api_key_saved_to_config",{});let A=Z2(H);AA((L)=>{let I=L.customApiKeyResponses?.approved??[];return{...L,primaryApiKey:$?L.primaryApiKey:H,customApiKeyResponses:{...L.customApiKeyResponses,approved:I.includes(A)?I:[...I,A],rejected:L.customApiKeyResponses?.rejected??[]}}}),NqH.cache.clear?.()}async function BmL(){await fmL(),AA((H)=>({...H,primaryApiKey:void 0})),NqH.cache.clear?.()}async function fmL(){try{await ogL()}catch(H){r(H)}}function OqH(H){if(!mk(H.scopes))return c("tengu_oauth_tokens_not_claude_ai",{}),{success:!0};if(!H.refreshToken||!H.expiresAt)return c("tengu_oauth_tokens_inference_only",{}),{success:!0};let $=hW(),A=$.name;try{let L=$.read()||{};L.claudeAiOauth={accessToken:H.accessToken,refreshToken:H.refreshToken,expiresAt:H.expiresAt,scopes:H.scopes,subscriptionType:H.subscriptionType,rateLimitTier:H.rateLimitTier};let I=$.update(L);if(I.success)c("tengu_oauth_tokens_saved",{storageBackend:A});else c("tengu_oauth_tokens_save_failed",{storageBackend:A});return dD.cache?.clear?.(),CeH(),I}catch(L){return r(L),c("tengu_oauth_tokens_save_exception",{storageBackend:A,error:L.message}),{success:!1,warning:"Failed to save OAuth tokens"}}}function z_0(){dD.cache?.clear?.(),xGH()}async function A4H(H){z_0();let $=dD();if(!$?.refreshToken)return!1;if($.accessToken!==H)return c("tengu_oauth_401_recovered_from_keychain",{}),!0;return iW(0,!0)}async function n$A(){if(process.env.CLAUDE_CODE_OAUTH_TOKEN||QeH())return dD();try{let A=(await hW().readAsync())?.claudeAiOauth;if(!A?.accessToken)return null;return A}catch(H){return r(H),null}}function iW(H=0,$=!1){if(H===0&&!$){if(qqH)return qqH;return qqH=r$A(H,$).finally(()=>{qqH=null}),qqH}return r$A(H,$)}async function r$A(H,$){let L=dD();if(!$){if(!L?.refreshToken||!pk(L.expiresAt))return!1}if(!L?.refreshToken)return!1;if(!mk(L.scopes))return!1;dD.cache?.clear?.(),xGH();let I=await n$A();if(!I?.refreshToken||!pk(I.expiresAt))return!1;let D=UL();zH().mkdirSync(D);let f;try{c("tengu_oauth_token_refresh_lock_acquiring",{}),f=await sgL.lock(D),c("tengu_oauth_token_refresh_lock_acquired",{})}catch(E){if(E.code==="ELOCKED"){if(H<5)return c("tengu_oauth_token_refresh_lock_retry",{retryCount:H+1}),await new Promise((M)=>setTimeout(M,1000+Math.random()*1000)),r$A(H+1,$);return c("tengu_oauth_token_refresh_lock_retry_limit_reached",{maxRetries:5}),!1}return r(E),c("tengu_oauth_token_refresh_lock_error",{error:E.message}),!1}try{dD.cache?.clear?.(),xGH();let E=await n$A();if(!E?.refreshToken||!pk(E.expiresAt))return c("tengu_oauth_token_refresh_race_resolved",{}),!1;c("tengu_oauth_token_refresh_starting",{});let M=await c1L(E.refreshToken);return OqH(M),dD.cache?.clear?.(),xGH(),!0}catch(E){r(E instanceof Error?E:Error(String(E))),dD.cache?.clear?.(),xGH();let M=await n$A();if(M&&!pk(M.expiresAt))return c("tengu_oauth_token_refresh_race_recovered",{}),!0;return!1}finally{c("tengu_oauth_token_refresh_lock_releasing",{}),await f(),c("tengu_oauth_token_refresh_lock_released",{})}}function nL(){if(!p_())return!1;return mk(dD()?.scopes)}function EmL(){if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY))return!1;if(nL())return!1;return!0}function T9(){return p_()?M$().oauthAccount:void 0}function HO(){let $=T9()?.billingType;if(!nL()||!$)return!1;if($!=="stripe_subscription"&&$!=="stripe_subscription_contracted"&&$!=="apple_subscription"&&$!=="google_play_subscription")return!1;return!0}function Wq(){let H=f0();return H==="max"||H==="enterprise"||H==="team"||H==="pro"||H===null}function f0(){if(e1L())return s1L();if(!p_())return null;let H=dD();if(!H)return null;return H.subscriptionType??null}function Ri(){if(!p_())return null;let H=dD();if(!H)return null;return H.rateLimitTier??null}function t$A(){switch(f0()){case"enterprise":return"Claude Enterprise";case"team":return"Claude Team";case"max":return"Claude Max";case"pro":return"Claude Pro";default:return"Claude API"}}function $O(){return!!(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY))}function MmL(){return(VL()||{}).otelHeadersHelper}function N_0(){let H=MmL();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.otelHeadersHelper===H||A?.otelHeadersHelper===H}function GmL(){let H=MmL();if(!H)return{};let $=parseInt(process.env.CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS||O_0.toString());if(OD$&&Date.now()-tgL<$)return OD$;if(N_0()){if(!XG(!0))return{}}try{let A=vN(H,{timeout:30000})?.toString().trim();if(!A)throw Error("otelHeadersHelper did not return a valid value");let L=DA(A);if(typeof L!=="object"||L===null||Array.isArray(L))throw Error("otelHeadersHelper must return a JSON object with string key-value pairs");for(let[I,D]of Object.entries(L))if(typeof D!=="string")throw Error(`otelHeadersHelper returned non-string value for key "${I}": ${typeof D}`);return OD$=L,tgL=Date.now(),OD$}catch(A){throw r(Error(`Error getting OpenTelemetry headers from otelHeadersHelper (in settings): ${A instanceof Error?A.message:String(A)}`)),A}}function x_0(H){return H==="max"||H==="pro"}function jD$(){let H=f0();return nL()&&H!==null&&x_0(H)}function RD$(){if(sI()!=="firstParty")return;let{source:$}=ji(),A={};if(nL())A.subscription=t$A();else A.tokenSource=$;let{key:L,source:I}=Y5();if(L)A.apiKeySource=I;if($==="claude.ai"||I==="/login managed key"){let B=T9()?.organizationName;if(B)A.organization=B}let D=T9()?.emailAddress;if(($==="claude.ai"||I==="/login managed key")&&D)A.email=D;return A}var sgL,egL,__0=300000,zqH,C_0=3600000,YAH,NqH,dD,qqH=null,OD$=null,tgL=0,O_0=1740000;var EI=K(()=>{vA();mL();B0();O_();tD();wwH();_$();E$();r0();KeH();p1L();Hq();$c$();$q();DL();NA();TwH();g$();oo$();z$();oM();ND$();ZqH();Z$();sgL=b(zk(),1),egL=require("child_process");zqH=cd$((H)=>{let $=TqH();if(!$)return null;if($mL()){if(!XG(!0)&&!H){let L=Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);pZ("apiKeyHelper invoked before trust check",L),c("tengu_apiKeyHelper_missing_trust11",{})}}try{let A=vN($)?.toString().trim();if(!A)throw Error("apiKeyHelper did not return a valid value");return A}catch(A){let L=oH.red("Error getting API key from apiKeyHelper (in settings or ~/.claude.json):");if(A instanceof Error&&"stderr"in A)console.error(L,String(A.stderr));else if(A instanceof Error)console.error(L,A.message);else console.error(L,A);return" "}},Y_0());YAH=cd$(async()=>{let H=await w_0(),$=await q_0();if(H||$)await QzL();return $},C_0);NqH=o$(()=>{let H=M$();if(!H.primaryApiKey)return null;return{key:H.primaryApiKey,source:"/login managed key"}});dD=o$(()=>{if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{accessToken:process.env.CLAUDE_CODE_OAUTH_TOKEN,refreshToken:null,expiresAt:null,scopes:["user:inference"],subscriptionType:null,rateLimitTier:null};let H=QeH();if(H)return{accessToken:H,refreshToken:null,expiresAt:null,scopes:["user:inference"],subscriptionType:null,rateLimitTier:null};try{let L=hW().read()?.claudeAiOauth;if(!L?.accessToken)return null;return L}catch($){return r($),null}})});function s$A(){return L4H}function I4H(H){L4H=H}function xqH(){return UmL.join(UL(),S_0)}function aR(){if(sI()!=="firstParty")return!1;if(!ZGH())return!1;try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return!0}catch{}let H=dD();if(!H?.accessToken)return!1;if(!H.scopes?.includes(VR))return!1;if(H.subscriptionType!=="enterprise")return!1;return!0}function e$A(){try{let H=xqH(),$=$J(H),A=q1($,!1);if(!A||typeof A!=="object"||Array.isArray(A))return null;return A}catch{return null}}function yD$(){if(!aR())return null;if(L4H)return L4H;let H=e$A();if(H)return L4H=H,H;return null}function XmL(){L4H=null}var UmL,S_0="remote-settings.json",L4H=null;var HAA=K(()=>{NA();oM();EI();qE();rD();nM();UmL=require("path")});function JmL(){if(oA()!=="windows")return!1;if(LAA.existsSync("C:\\Program Files\\ClaudeCode"))return!1;return LAA.existsSync("C:\\ProgramData\\ClaudeCode\\managed-settings.json")}function FmL(){return SV.join(v_(),"managed-settings.json")}function KmL(H,$){if(typeof H==="object"&&H&&"code"in H&&H.code==="ENOENT")N(`Broken symlink or missing file encountered for settings.json at path: ${$}`);else r(H instanceof Error?H:Error(String(H)))}function vD$(H){let $=zH();if(!$.existsSync(H))return{settings:null,errors:[]};try{let{resolvedPath:A}=OU($,H),L=$J(A);if(L.trim()==="")return{settings:{},errors:[]};let I=q1(L,!1),D=tZ.safeParse(I);if(!D.success)return{settings:null,errors:HeH(D.error,H)};return{settings:D.data,errors:[]}}catch(A){return KmL(A,H),{settings:null,errors:[]}}}function D4H(H){switch(H){case"userSettings":return SV.resolve(UL());case"policySettings":case"projectSettings":case"localSettings":return SV.resolve(zL());case"flagSettings":{let $=xc();return $?SV.dirname(SV.resolve($)):SV.resolve(zL())}}}function j_0(){if(gYH()||A$(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return"cowork_settings.json";return"settings.json"}function aM(H){switch(H){case"userSettings":return SV.join(D4H(H),j_0());case"projectSettings":case"localSettings":return SV.join(D4H(H),B4H(H));case"policySettings":return FmL();case"flagSettings":return xc()}}function B4H(H){switch(H){case"projectSettings":return SV.join(".claude","settings.json");case"localSettings":return SV.join(".claude","settings.local.json")}}function ZI(H){if(H==="policySettings"){let L=yD$();if(L&&Object.keys(L).length>0)return L}let $=aM(H);if(!$)return null;let{settings:A}=vD$($);return A}function QmL(){let H=yD$();if(H&&Object.keys(H).length>0)return"remote";let $=FmL(),{settings:A}=vD$($);if(A&&Object.keys(A).length>0)return"local";return null}function II(H,$){if(H==="policySettings"||H==="flagSettings")return{error:null};let A=aM(H);if(!A)return{error:null};try{let L=SV.dirname(A);if(!zH().existsSync(L))zH().mkdirSync(L);let I=ZI(H);if(!I&&zH().existsSync(A)){let B=$J(A),f=q1(B);if(f===null)return{error:Error(`Invalid JSON syntax in settings file at ${A}`)};if(f&&typeof f==="object")I=f,N(`Using raw settings from ${A} due to validation failure`)}let D=ACH(I||{},$,(B,f,E,M)=>{if(f===void 0&&M&&typeof E==="string"){delete M[E];return}if(Array.isArray(f))return f;return});if(AF.markInternalWrite(H),d_(A,yH(D,null,2)+` ${U}`)}return B},C4;var li=K(()=>{jV();acL=Object.freeze(Object.create(null)),C4=hZ0(ocL)});var CTH;var lLA=K(()=>{$y();Yq();P4H();li();CTH=class CTH extends w5{list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/files",IO,{query:L,...$,headers:z9([{"anthropic-beta":[...A??[],"files-api-2025-04-14"].toString()},$?.headers])})}delete(H,$={},A){let{betas:L}=$??{};return this._client.delete(C4`/v1/files/${H}`,{...A,headers:z9([{"anthropic-beta":[...L??[],"files-api-2025-04-14"].toString()},A?.headers])})}download(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/files/${H}/content`,{...A,headers:z9([{"anthropic-beta":[...L??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},A?.headers]),__binaryResponse:!0})}retrieveMetadata(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/files/${H}`,{...A,headers:z9([{"anthropic-beta":[...L??[],"files-api-2025-04-14"].toString()},A?.headers])})}upload(H,$){let{betas:A,...L}=H;return this._client.post("/v1/files",V4H({body:L,...$,headers:z9([{"anthropic-beta":[...A??[],"files-api-2025-04-14"].toString()},$?.headers])},this._client))}}});var wTH;var iLA=K(()=>{$y();Yq();li();wTH=class wTH extends w5{retrieve(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/models/${H}?beta=true`,{...A,headers:z9([{...L?.toString()!=null?{"anthropic-beta":L?.toString()}:void 0},A?.headers])})}list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/models?beta=true",IO,{query:L,...$,headers:z9([{...A?.toString()!=null?{"anthropic-beta":A?.toString()}:void 0},$?.headers])})}}});var nB$;var nLA=K(()=>{nB$={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function rLA(H,$){if(!$||!("parse"in($.output_format??{})))return{...H,content:H.content.map((A)=>{if(A.type==="text")return{...A,parsed:null};return A}),parsed_output:null};return aLA(H,$)}function aLA(H,$){let A=null,L=H.content.map((I)=>{if(I.type==="text"){let D=uZ0($,I.text);if(A===null)A=D;return{...I,parsed:D}}return I});return{...H,content:L,parsed_output:A}}function uZ0(H,$){if(H.output_format?.type!=="json_schema")return null;try{if("parse"in H.output_format)return H.output_format.parse($);return JSON.parse($)}catch(A){throw new ID(`Failed to parse structured output: ${A}`)}}var oLA=K(()=>{jV()});var gZ0=(H)=>{let $=0,A=[];while(${if(H.length===0)return H;let $=H[H.length-1];switch($.type){case"separator":return H=H.slice(0,H.length-1),_4H(H);break;case"number":let A=$.value[$.value.length-1];if(A==="."||A==="-")return H=H.slice(0,H.length-1),_4H(H);case"string":let L=H[H.length-2];if(L?.type==="delimiter")return H=H.slice(0,H.length-1),_4H(H);else if(L?.type==="brace"&&L.value==="{")return H=H.slice(0,H.length-1),_4H(H);break;case"delimiter":return H=H.slice(0,H.length-1),_4H(H);break}return H},mZ0=(H)=>{let $=[];if(H.map((A)=>{if(A.type==="brace")if(A.value==="{")$.push("}");else $.splice($.lastIndexOf("}"),1);if(A.type==="paren")if(A.value==="[")$.push("]");else $.splice($.lastIndexOf("]"),1)}),$.length>0)$.reverse().map((A)=>{if(A==="}")H.push({type:"brace",value:"}"});else if(A==="]")H.push({type:"paren",value:"]"})});return H},pZ0=(H)=>{let $="";return H.map((A)=>{switch(A.type){case"string":$+='"'+A.value+'"';break;default:$+=A.value;break}}),$},rB$=(H)=>JSON.parse(pZ0(mZ0(_4H(gZ0(H)))));var tLA=()=>{};var kAH=K(()=>{jV()});var aB$=K(()=>{hLA()});function HlL(H){return H.type==="tool_use"||H.type==="server_tool_use"||H.type==="mcp_tool_use"}function $lL(H){}var Cq,ii,Y4H,ZTH,oB$,qTH,TTH,tB$,zTH,wu,NTH,sB$,eB$,C4H,H0$,$0$,sLA,tcL,A0$,eLA,HIA,$IA,scL,ecL="__json_buf",OTH;var AlL=K(()=>{_u();tLA();kAH();aB$();oLA();OTH=class OTH{constructor(H){Cq.add(this),this.messages=[],this.receivedMessages=[],ii.set(this,void 0),Y4H.set(this,null),this.controller=new AbortController,ZTH.set(this,void 0),oB$.set(this,()=>{}),qTH.set(this,()=>{}),TTH.set(this,void 0),tB$.set(this,()=>{}),zTH.set(this,()=>{}),wu.set(this,{}),NTH.set(this,!1),sB$.set(this,!1),eB$.set(this,!1),C4H.set(this,!1),H0$.set(this,void 0),$0$.set(this,void 0),A0$.set(this,($)=>{if(MD(this,sB$,!0,"f"),Yu($))$=new rf;if($ instanceof rf)return MD(this,eB$,!0,"f"),this._emit("abort",$);if($ instanceof ID)return this._emit("error",$);if($ instanceof Error){let A=new ID($.message);return A.cause=$,this._emit("error",A)}return this._emit("error",new ID(String($)))}),MD(this,ZTH,new Promise(($,A)=>{MD(this,oB$,$,"f"),MD(this,qTH,A,"f")}),"f"),MD(this,TTH,new Promise(($,A)=>{MD(this,tB$,$,"f"),MD(this,zTH,A,"f")}),"f"),xA(this,ZTH,"f").catch(()=>{}),xA(this,TTH,"f").catch(()=>{}),MD(this,Y4H,H,"f")}get response(){return xA(this,H0$,"f")}get request_id(){return xA(this,$0$,"f")}async withResponse(){let H=await xA(this,ZTH,"f");if(!H)throw Error("Could not resolve a `Response` object");return{data:this,response:H,request_id:H.headers.get("request-id")}}static fromReadableStream(H){let $=new OTH(null);return $._run(()=>$._fromReadableStream(H)),$}static createMessage(H,$,A){let L=new OTH($);for(let I of $.messages)L._addMessageParam(I);return MD(L,Y4H,{...$,stream:!0},"f"),L._run(()=>L._createMessage(H,{...$,stream:!0},{...A,headers:{...A?.headers,"X-Stainless-Helper-Method":"stream"}})),L}_run(H){H().then(()=>{this._emitFinal(),this._emit("end")},xA(this,A0$,"f"))}_addMessageParam(H){this.messages.push(H)}_addMessage(H,$=!0){if(this.receivedMessages.push(H),$)this._emit("message",H)}async _createMessage(H,$,A){let L=A?.signal,I;if(L){if(L.aborted)this.controller.abort();I=this.controller.abort.bind(this.controller),L.addEventListener("abort",I)}try{xA(this,Cq,"m",eLA).call(this);let{response:D,data:B}=await H.create({...$,stream:!0},{...A,signal:this.controller.signal}).withResponse();this._connected(D);for await(let f of B)xA(this,Cq,"m",HIA).call(this,f);if(B.controller.signal?.aborted)throw new rf;xA(this,Cq,"m",$IA).call(this)}finally{if(L&&I)L.removeEventListener("abort",I)}}_connected(H){if(this.ended)return;MD(this,H0$,H,"f"),MD(this,$0$,H?.headers.get("request-id"),"f"),xA(this,oB$,"f").call(this,H),this._emit("connect")}get ended(){return xA(this,NTH,"f")}get errored(){return xA(this,sB$,"f")}get aborted(){return xA(this,eB$,"f")}abort(){this.controller.abort()}on(H,$){return(xA(this,wu,"f")[H]||(xA(this,wu,"f")[H]=[])).push({listener:$}),this}off(H,$){let A=xA(this,wu,"f")[H];if(!A)return this;let L=A.findIndex((I)=>I.listener===$);if(L>=0)A.splice(L,1);return this}once(H,$){return(xA(this,wu,"f")[H]||(xA(this,wu,"f")[H]=[])).push({listener:$,once:!0}),this}emitted(H){return new Promise(($,A)=>{if(MD(this,C4H,!0,"f"),H!=="error")this.once("error",A);this.once(H,$)})}async done(){MD(this,C4H,!0,"f"),await xA(this,TTH,"f")}get currentMessage(){return xA(this,ii,"f")}async finalMessage(){return await this.done(),xA(this,Cq,"m",sLA).call(this)}async finalText(){return await this.done(),xA(this,Cq,"m",tcL).call(this)}_emit(H,...$){if(xA(this,NTH,"f"))return;if(H==="end")MD(this,NTH,!0,"f"),xA(this,tB$,"f").call(this);let A=xA(this,wu,"f")[H];if(A)xA(this,wu,"f")[H]=A.filter((L)=>!L.once),A.forEach(({listener:L})=>L(...$));if(H==="abort"){let L=$[0];if(!xA(this,C4H,"f")&&!A?.length)Promise.reject(L);xA(this,qTH,"f").call(this,L),xA(this,zTH,"f").call(this,L),this._emit("end");return}if(H==="error"){let L=$[0];if(!xA(this,C4H,"f")&&!A?.length)Promise.reject(L);xA(this,qTH,"f").call(this,L),xA(this,zTH,"f").call(this,L),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",xA(this,Cq,"m",sLA).call(this))}async _fromReadableStream(H,$){let A=$?.signal,L;if(A){if(A.aborted)this.controller.abort();L=this.controller.abort.bind(this.controller),A.addEventListener("abort",L)}try{xA(this,Cq,"m",eLA).call(this),this._connected(null);let I=RV.fromReadableStream(H,this.controller);for await(let D of I)xA(this,Cq,"m",HIA).call(this,D);if(I.controller.signal?.aborted)throw new rf;xA(this,Cq,"m",$IA).call(this)}finally{if(A&&L)A.removeEventListener("abort",L)}}[(ii=new WeakMap,Y4H=new WeakMap,ZTH=new WeakMap,oB$=new WeakMap,qTH=new WeakMap,TTH=new WeakMap,tB$=new WeakMap,zTH=new WeakMap,wu=new WeakMap,NTH=new WeakMap,sB$=new WeakMap,eB$=new WeakMap,C4H=new WeakMap,H0$=new WeakMap,$0$=new WeakMap,A0$=new WeakMap,Cq=new WeakSet,sLA=function(){if(this.receivedMessages.length===0)throw new ID("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},tcL=function(){if(this.receivedMessages.length===0)throw new ID("stream ended without producing a Message with role=assistant");let $=this.receivedMessages.at(-1).content.filter((A)=>A.type==="text").map((A)=>A.text);if($.length===0)throw new ID("stream ended without producing a content block with type=text");return $.join(" ")},eLA=function(){if(this.ended)return;MD(this,ii,void 0,"f")},HIA=function($){if(this.ended)return;let A=xA(this,Cq,"m",scL).call(this,$);switch(this._emit("streamEvent",$,A),$.type){case"content_block_delta":{let L=A.content.at(-1);switch($.delta.type){case"text_delta":{if(L.type==="text")this._emit("text",$.delta.text,L.text||"");break}case"citations_delta":{if(L.type==="text")this._emit("citation",$.delta.citation,L.citations??[]);break}case"input_json_delta":{if(HlL(L)&&L.input)this._emit("inputJson",$.delta.partial_json,L.input);break}case"thinking_delta":{if(L.type==="thinking")this._emit("thinking",$.delta.thinking,L.thinking);break}case"signature_delta":{if(L.type==="thinking")this._emit("signature",L.signature);break}default:$lL($.delta)}break}case"message_stop":{this._addMessageParam(A),this._addMessage(rLA(A,xA(this,Y4H,"f")),!0);break}case"content_block_stop":{this._emit("contentBlock",A.content.at(-1));break}case"message_start":{MD(this,ii,A,"f");break}case"content_block_start":case"message_delta":break}},$IA=function(){if(this.ended)throw new ID("stream has ended, this shouldn't happen");let $=xA(this,ii,"f");if(!$)throw new ID("request ended without sending any chunks");return MD(this,ii,void 0,"f"),rLA($,xA(this,Y4H,"f"))},scL=function($){let A=xA(this,ii,"f");if($.type==="message_start"){if(A)throw new ID(`Unexpected event order, got ${$.type} before receiving "message_stop"`);return $.message}if(!A)throw new ID(`Unexpected event order, got ${$.type} before "message_start"`);switch($.type){case"message_stop":return A;case"message_delta":if(A.container=$.delta.container,A.stop_reason=$.delta.stop_reason,A.stop_sequence=$.delta.stop_sequence,A.usage.output_tokens=$.usage.output_tokens,A.context_management=$.context_management,$.usage.input_tokens!=null)A.usage.input_tokens=$.usage.input_tokens;if($.usage.cache_creation_input_tokens!=null)A.usage.cache_creation_input_tokens=$.usage.cache_creation_input_tokens;if($.usage.cache_read_input_tokens!=null)A.usage.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.server_tool_use!=null)A.usage.server_tool_use=$.usage.server_tool_use;return A;case"content_block_start":return A.content.push($.content_block),A;case"content_block_delta":{let L=A.content.at($.index);switch($.delta.type){case"text_delta":{if(L?.type==="text")A.content[$.index]={...L,text:(L.text||"")+$.delta.text};break}case"citations_delta":{if(L?.type==="text")A.content[$.index]={...L,citations:[...L.citations??[],$.delta.citation]};break}case"input_json_delta":{if(L&&HlL(L)){let I=L[ecL]||"";I+=$.delta.partial_json;let D={...L};if(Object.defineProperty(D,ecL,{value:I,enumerable:!1,writable:!0}),I)try{D.input=rB$(I)}catch(B){let f=new ID(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${B}. JSON: ${I}`);xA(this,A0$,"f").call(this,f)}A.content[$.index]=D}break}case"thinking_delta":{if(L?.type==="thinking")A.content[$.index]={...L,thinking:L.thinking+$.delta.thinking};break}case"signature_delta":{if(L?.type==="thinking")A.content[$.index]={...L,signature:$.delta.signature};break}default:$lL($.delta)}return A}case"content_block_stop":return A}},Symbol.asyncIterator)](){let H=[],$=[],A=!1;return this.on("streamEvent",(L)=>{let I=$.shift();if(I)I.resolve(L);else H.push(L)}),this.on("end",()=>{A=!0;for(let L of $)L.resolve(void 0);$.length=0}),this.on("abort",(L)=>{A=!0;for(let I of $)I.reject(L);$.length=0}),this.on("error",(L)=>{A=!0;for(let I of $)I.reject(L);$.length=0}),{next:async()=>{if(!H.length){if(A)return{value:void 0,done:!0};return new Promise((I,D)=>$.push({resolve:I,reject:D})).then((I)=>I?{value:I,done:!1}:{value:void 0,done:!0})}return{value:H.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new RV(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});function LlL(){let H,$;return{promise:new Promise((L,I)=>{H=L,$=I}),resolve:H,reject:$}}async function dZ0(H,$=H.messages.at(-1)){if(!$||$.role!=="assistant"||!$.content||typeof $.content==="string")return null;let A=$.content.filter((I)=>I.type==="tool_use");if(A.length===0)return null;return{role:"user",content:await Promise.all(A.map(async(I)=>{let D=H.tools.find((B)=>B.name===I.name);if(!D||!("run"in D))return{type:"tool_result",tool_use_id:I.id,content:`Error: Tool '${I.name}' not found`,is_error:!0};try{let B=I.input;if("parse"in D&&D.parse)B=D.parse(B);let f=await D.run(B);return{type:"tool_result",tool_use_id:I.id,content:f}}catch(B){return{type:"tool_result",tool_use_id:I.id,content:`Error: ${B instanceof Error?B.message:String(B)}`,is_error:!0}}}))}}var L0$,w4H,uAH,i_,xTH,DO,Zu,ni,STH,AIA,jTH;var LIA=K(()=>{_u();jV();Yq();jTH=class jTH{constructor(H,$,A){L0$.add(this),this.client=H,w4H.set(this,!1),uAH.set(this,!1),i_.set(this,void 0),xTH.set(this,void 0),DO.set(this,void 0),Zu.set(this,void 0),ni.set(this,void 0),STH.set(this,0),MD(this,i_,{params:{...$,messages:structuredClone($.messages)}},"f"),MD(this,xTH,{...A,headers:z9([{"x-stainless-helper":"BetaToolRunner"},A?.headers])},"f"),MD(this,ni,LlL(),"f")}async*[(w4H=new WeakMap,uAH=new WeakMap,i_=new WeakMap,xTH=new WeakMap,DO=new WeakMap,Zu=new WeakMap,ni=new WeakMap,STH=new WeakMap,L0$=new WeakSet,Symbol.asyncIterator)](){var H;if(xA(this,w4H,"f"))throw new ID("Cannot iterate over a consumed stream");MD(this,w4H,!0,"f"),MD(this,uAH,!0,"f"),MD(this,Zu,void 0,"f");try{while(!0){let $;try{if(xA(this,i_,"f").params.max_iterations&&xA(this,STH,"f")>=xA(this,i_,"f").params.max_iterations)break;MD(this,uAH,!1,"f"),MD(this,DO,void 0,"f"),MD(this,Zu,void 0,"f"),MD(this,STH,(H=xA(this,STH,"f"),H++,H),"f");let{max_iterations:A,...L}=xA(this,i_,"f").params;if(L.stream)$=this.client.beta.messages.stream({...L},xA(this,xTH,"f")),MD(this,DO,$.finalMessage(),"f"),xA(this,DO,"f").catch(()=>{}),yield $;else MD(this,DO,this.client.beta.messages.create({...L,stream:!1},xA(this,xTH,"f")),"f"),yield xA(this,DO,"f");if(!xA(this,uAH,"f")){let{role:D,content:B}=await xA(this,DO,"f");xA(this,i_,"f").params.messages.push({role:D,content:B})}let I=await xA(this,L0$,"m",AIA).call(this,xA(this,i_,"f").params.messages.at(-1));if(I)xA(this,i_,"f").params.messages.push(I);if(!I&&!xA(this,uAH,"f"))break}finally{if($)$.abort()}}if(!xA(this,DO,"f"))throw new ID("ToolRunner concluded without a message from the server");xA(this,ni,"f").resolve(await xA(this,DO,"f"))}catch($){throw MD(this,w4H,!1,"f"),xA(this,ni,"f").promise.catch(()=>{}),xA(this,ni,"f").reject($),MD(this,ni,LlL(),"f"),$}}setMessagesParams(H){if(typeof H==="function")xA(this,i_,"f").params=H(xA(this,i_,"f").params);else xA(this,i_,"f").params=H;MD(this,uAH,!0,"f"),MD(this,Zu,void 0,"f")}async generateToolResponse(){let H=await xA(this,DO,"f")??this.params.messages.at(-1);if(!H)return null;return xA(this,L0$,"m",AIA).call(this,H)}done(){return xA(this,ni,"f").promise}async runUntilDone(){if(!xA(this,w4H,"f"))for await(let H of this);return this.done()}get params(){return xA(this,i_,"f").params}pushMessages(...H){this.setMessagesParams(($)=>({...$,messages:[...$.messages,...H]}))}then(H,$){return this.runUntilDone().then(H,$)}};AIA=async function($){if(xA(this,Zu,"f")!==void 0)return xA(this,Zu,"f");return MD(this,Zu,dZ0(xA(this,i_,"f").params,$),"f"),xA(this,Zu,"f")}});var Z4H;var IIA=K(()=>{jV();yLA();Z4H=class Z4H{constructor(H,$){this.iterator=H,this.controller=$}async*decoder(){let H=new ci;for await(let $ of this.iterator)for(let A of H.decode($))yield JSON.parse(A);for(let $ of H.flush())yield JSON.parse($)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(H,$){if(!H.body){if($.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new ID("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ID("Attempted to iterate over a response with no body")}return new Z4H(KTH(H.body),$)}}});var RTH;var DIA=K(()=>{$y();Yq();IIA();kAH();li();RTH=class RTH extends w5{create(H,$){let{betas:A,...L}=H;return this._client.post("/v1/messages/batches?beta=true",{body:L,...$,headers:z9([{"anthropic-beta":[...A??[],"message-batches-2024-09-24"].toString()},$?.headers])})}retrieve(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/messages/batches/${H}?beta=true`,{...A,headers:z9([{"anthropic-beta":[...L??[],"message-batches-2024-09-24"].toString()},A?.headers])})}list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/messages/batches?beta=true",IO,{query:L,...$,headers:z9([{"anthropic-beta":[...A??[],"message-batches-2024-09-24"].toString()},$?.headers])})}delete(H,$={},A){let{betas:L}=$??{};return this._client.delete(C4`/v1/messages/batches/${H}?beta=true`,{...A,headers:z9([{"anthropic-beta":[...L??[],"message-batches-2024-09-24"].toString()},A?.headers])})}cancel(H,$={},A){let{betas:L}=$??{};return this._client.post(C4`/v1/messages/batches/${H}/cancel?beta=true`,{...A,headers:z9([{"anthropic-beta":[...L??[],"message-batches-2024-09-24"].toString()},A?.headers])})}async results(H,$={},A){let L=await this.retrieve(H);if(!L.results_url)throw new ID(`No batch \`results_url\`; Has it finished processing? ${L.processing_status} - ${L.id}`);let{betas:I}=$??{};return this._client.get(L.results_url,{...A,headers:z9([{"anthropic-beta":[...I??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},A?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((D,B)=>Z4H.fromResponse(B.response,B.controller))}}});var IlL,gAH;var BIA=K(()=>{nLA();Yq();oLA();AlL();LIA();DIA();DIA();LIA();IlL={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};gAH=class gAH extends w5{constructor(){super(...arguments);this.batches=new RTH(this._client)}create(H,$){let{betas:A,...L}=H;if(L.model in IlL)console.warn(`The model '${L.model}' is deprecated and will reach end-of-life on ${IlL[L.model]} Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let A=this._client._options.timeout;if(!H.stream&&A==null){let L=nB$[H.model]??void 0;A=this._client.calculateNonstreamingTimeout(H.max_tokens,L)}return this._client.post("/v1/messages",{body:H,timeout:A??600000,...$,stream:H.stream??!1})}stream(H,$){return gTH.createMessage(this,H,$)}countTokens(H,$){return this._client.post("/v1/messages/count_tokens",{body:H,...$})}};UlL={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};O2.Batches=mTH});var z4H;var VIA=K(()=>{$y();Yq();li();z4H=class z4H extends w5{retrieve(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/models/${H}`,{...A,headers:z9([{...L?.toString()!=null?{"anthropic-beta":L?.toString()}:void 0},A?.headers])})}list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/models",IO,{query:L,...$,headers:z9([{...A?.toString()!=null?{"anthropic-beta":A?.toString()}:void 0},$?.headers])})}}});var pTH=K(()=>{MIA();GIA();WIA();VIA();ncL()});var dTH=(H)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[H]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(H)?.trim();return};class fM{constructor({baseURL:H=dTH("ANTHROPIC_BASE_URL"),apiKey:$=dTH("ANTHROPIC_API_KEY")??null,authToken:A=dTH("ANTHROPIC_AUTH_TOKEN")??null,...L}={}){PIA.add(this),U0$.set(this,void 0);let I={apiKey:$,authToken:A,...L,baseURL:H||"https://api.anthropic.com"};if(!I.dangerouslyAllowBrowser&&RcL())throw new ID(`It looks like you're running in a browser-like environment. `).filter(Boolean));return}if(E.code===1){B([]);return}f(Error(`ripgrep failed with exit code ${E.code}: ${G||E.message}`))})})}var qrL;var zrL=K(()=>{qrL=require("child_process")});function a0$(){return[...QO0.filter((H)=>H!==".git"),".claude/commands",".claude/agents"]}function aIA(H){return H.toLowerCase()}function EO(H){return H.includes("*")||H.includes("?")||H.includes("[")||H.includes("]")}function LzH(H){return H.replace(/\/\*\*$/,"")}function NrL(H,$){let A=x2.normalize(H),L=x2.normalize($);if(L===A)return!1;if(A.startsWith("/tmp/")&&L==="/private"+A)return!1;if(A.startsWith("/var/")&&L==="/private"+A)return!1;if(A.startsWith("/private/tmp/")&&L===A)return!1;if(A.startsWith("/private/var/")&&L===A)return!1;if(L==="/")return!0;if(L.split("/").filter(Boolean).length<=1)return!0;if(A.startsWith(L+"/"))return!0;let D=A;if(A.startsWith("/tmp/"))D="/private"+A;else if(A.startsWith("/var/"))D="/private"+A;if(D!==A&&D.startsWith(L+"/"))return!0;let B=L.startsWith(A+"/"),f=D!==A&&L.startsWith(D+"/");if(L!==A&&!(D!==A&&L===D)&&!B&&!f)return!0;return!1}function MO(H){let $=process.cwd(),A=H;if(H==="~")A=r0$.homedir();else if(H.startsWith("~/"))A=r0$.homedir()+H.slice(1);else if(H.startsWith("./")||H.startsWith("../"))A=x2.resolve($,H);else if(!x2.isAbsolute(H))A=x2.resolve($,H);if(EO(A)){let L=A.split(/[*?[\]]/)[0];if(L&&L!=="/"){let I=L.endsWith("/")?L.slice(0,-1):x2.dirname(L);try{let D=rIA.realpathSync(I);if(!NrL(I,D)){let B=A.slice(I.length);return D+B}}catch{}}return A}try{let L=rIA.realpathSync(A);if(NrL(A,L));else A=L}catch{}return A}function IzH(){let H=r0$.homedir();return["/dev/stdout","/dev/stderr","/dev/null","/dev/tty","/dev/dtracehelper","/dev/autofs_nowait","/tmp/claude","/private/tmp/claude",x2.join(H,".npm/_logs"),x2.join(H,".claude/debug")]}function o0$(H,$){let L=["SANDBOX_RUNTIME=1",`TMPDIR=${process.env.CLAUDE_TMPDIR||"/tmp/claude"}`];if(!H&&!$)return L;let I=["localhost","127.0.0.1","::1","*.local",".local","169.254.0.0/16","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"].join(",");if(L.push(`NO_PROXY=${I}`),L.push(`no_proxy=${I}`),H)L.push(`HTTP_PROXY=http://localhost:${H}`),L.push(`HTTPS_PROXY=http://localhost:${H}`),L.push(`http_proxy=http://localhost:${H}`),L.push(`https_proxy=http://localhost:${H}`);if($){if(L.push(`ALL_PROXY=socks5h://localhost:${$}`),L.push(`all_proxy=socks5h://localhost:${$}`),Zq()==="macos")L.push(`GIT_SSH_COMMAND=ssh -o ProxyCommand='nc -X 5 -x localhost:${$} %h %p'`);if(L.push(`FTP_PROXY=socks5h://localhost:${$}`),L.push(`ftp_proxy=socks5h://localhost:${$}`),L.push(`RSYNC_PROXY=localhost:${$}`),L.push(`DOCKER_HTTP_PROXY=http://localhost:${H||$}`),L.push(`DOCKER_HTTPS_PROXY=http://localhost:${H||$}`),H)L.push("CLOUDSDK_PROXY_TYPE=https"),L.push("CLOUDSDK_PROXY_ADDRESS=localhost"),L.push(`CLOUDSDK_PROXY_PORT=${H}`);L.push(`GRPC_PROXY=socks5h://localhost:${$}`),L.push(`grpc_proxy=socks5h://localhost:${$}`)}return L}function t0$(H){let $=H.slice(0,100);return Buffer.from($).toString("base64")}function OrL(H){return Buffer.from(H,"base64").toString("utf8")}var r0$,x2,rIA,AzH,QO0;var p4H=K(()=>{n0$();r0$=require("os"),x2=b(require("path")),rIA=b(require("fs")),AzH=[".gitconfig",".gitmodules",".bashrc",".bash_profile",".zshrc",".zprofile",".profile",".ripgreprc",".mcp.json"],QO0=[".git",".vscode",".idea"]});function RrL(){if(sIA)return sIA;let H=[];try{let A=SrL.execSync("npm root -g",{encoding:"utf8",timeout:5000,stdio:["pipe","pipe","ignore"]}).trim();if(A)H.push(yV.join(A,"@anthropic-ai","sandbox-runtime"))}catch{}let $=jrL.homedir();return H.push(yV.join("/usr","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join("/usr","local","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join("/opt","homebrew","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join($,".npm","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join($,".npm-global","lib","node_modules","@anthropic-ai","sandbox-runtime")),sIA=H,H}function eIA(){switch("x64"){case"x64":case"x86_64":return"x64";case"arm64":case"aarch64":return"arm64";case"ia32":case"x86":return wL("[SeccompFilter] 32-bit x86 (ia32) is not currently supported due to missing socketcall() syscall blocking. The current seccomp filter only blocks socket(AF_UNIX, ...), but on 32-bit x86, socketcall() can be used to bypass this.",{level:"error"}),null;default:return wL("[SeccompFilter] Unsupported architecture: x64. Only x64 and arm64 are supported."),null}}function yrL(H){let $=eIA();if(!$)return[];let A=yV.dirname(xrL.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js")),L=yV.join("vendor","seccomp",$,H);return[yV.join(A,L),yV.join(A,"..","..",L),yV.join(A,"..",L)]}function HDA(H){let $=H??"";if(oIA.has($))return oIA.get($);let A=WO0(H);return oIA.set($,A),A}function WO0(H){if(H){if(pAH.existsSync(H))return wL(`[SeccompFilter] Using BPF filter from explicit path: ${H}`),H;wL(`[SeccompFilter] Explicit path provided but file not found: ${H}`)}let $=eIA();if(!$)return wL("[SeccompFilter] Cannot find pre-generated BPF filter: unsupported architecture x64"),null;wL(`[SeccompFilter] Detected architecture: ${$}`);for(let A of yrL("unix-block.bpf"))if(pAH.existsSync(A))return wL(`[SeccompFilter] Found pre-generated BPF filter: ${A} (${$})`),A;for(let A of RrL()){let L=yV.join(A,"vendor","seccomp",$,"unix-block.bpf");if(pAH.existsSync(L))return wL(`[SeccompFilter] Found pre-generated BPF filter in global install: ${L} (${$})`),L}return wL(`[SeccompFilter] Pre-generated BPF filter not found in any expected location (${$})`),null}function DzH(H){let $=H??"";if(tIA.has($))return tIA.get($);let A=VO0(H);return tIA.set($,A),A}function VO0(H){if(H){if(pAH.existsSync(H))return wL(`[SeccompFilter] Using apply-seccomp binary from explicit path: ${H}`),H;wL(`[SeccompFilter] Explicit path provided but file not found: ${H}`)}let $=eIA();if(!$)return wL("[SeccompFilter] Cannot find apply-seccomp binary: unsupported architecture x64"),null;wL(`[SeccompFilter] Looking for apply-seccomp binary for architecture: ${$}`);for(let A of yrL("apply-seccomp"))if(pAH.existsSync(A))return wL(`[SeccompFilter] Found apply-seccomp binary: ${A} (${$})`),A;for(let A of RrL()){let L=yV.join(A,"vendor","seccomp",$,"apply-seccomp");if(pAH.existsSync(L))return wL(`[SeccompFilter] Found apply-seccomp binary in global install: ${L} (${$})`),L}return wL(`[SeccompFilter] apply-seccomp binary not found in any expected location (${$})`),null}function vrL(H){let $=HDA(H);if($)return wL("[SeccompFilter] Using pre-generated BPF filter"),$;return wL("[SeccompFilter] Pre-generated BPF filter not available for this architecture. Only x64 and arm64 are supported.",{level:"error"}),null}function $DA(H){}var yV,xrL,pAH,SrL,jrL,oIA,tIA,sIA=null;var hrL=K(()=>{yV=require("path"),xrL=require("url"),pAH=b(require("fs")),SrL=require("child_process"),jrL=require("os"),oIA=new Map,tIA=new Map});function PO0(H,$){let A=H.split(g6.default.sep),L="";for(let I of A){if(!I)continue;let D=L+g6.default.sep+I;try{if(S2.lstatSync(D).isSymbolicLink()){if($.some((E)=>D.startsWith(E+"/")||D===E))return D}}catch{break}L=D}return null}async function _O0(H={command:"rg"},$=IDA,A=!1,L){let I=process.cwd(),D=new AbortController,B=L??D.signal,f=a0$(),E=[...AzH.map((U)=>g6.default.resolve(I,U)),...f.map((U)=>g6.default.resolve(I,U)),g6.default.resolve(I,".git/hooks")];if(!A)E.push(g6.default.resolve(I,".git/config"));let M=[];for(let U of AzH)M.push("--iglob",U);for(let U of f)M.push("--iglob",`**/${U}/**`);if(M.push("--iglob","**/.git/hooks/**"),!A)M.push("--iglob","**/.git/config");let G=[];try{G=await TrL(["--files","--hidden","--max-depth",String($),...M,"-g","!**/node_modules/**"],I,B,H)}catch(U){wL(`[Sandbox] ripgrep scan failed: ${U}`)}for(let U of G){let X=g6.default.resolve(I,U),J=!1;for(let F of[...f,".git"]){let Q=aIA(F),W=X.split(g6.default.sep),P=W.findIndex((C)=>aIA(C)===Q);if(P!==-1){if(F===".git"){let C=W.slice(0,P+1).join(g6.default.sep);if(U.includes(".git/hooks"))E.push(g6.default.join(C,"hooks"));else if(U.includes(".git/config"))E.push(g6.default.join(C,"config"))}else E.push(W.slice(0,P+1).join(g6.default.sep));J=!0;break}}if(!J)E.push(X)}return[...new Set(E)]}function YO0(){if(brL)return;process.on("exit",()=>{for(let H of LDA)try{$DA(H)}catch{}}),brL=!0}function urL(H){let $=[],A=[],L=cAH.spawnSync("which",["bwrap"],{stdio:"ignore",timeout:1000}),I=cAH.spawnSync("which",["socat"],{stdio:"ignore",timeout:1000});if(L.status!==0)$.push("bubblewrap (bwrap) not installed");if(I.status!==0)$.push("socat not installed");let D=HDA(H?.bpfPath)!==null,B=DzH(H?.applyPath)!==null;if(!D||!B)A.push("seccomp not available - unix socket access not restricted");return{warnings:A,errors:$}}async function grL(H,$){let A=krL.randomBytes(8).toString("hex"),L=g6.join(ADA.tmpdir(),`claude-http-${A}.sock`),I=g6.join(ADA.tmpdir(),`claude-socks-${A}.sock`),D=[`UNIX-LISTEN:${L},fork,reuseaddr`,`TCP:localhost:${H},keepalive,keepidle=10,keepintvl=5,keepcnt=3`];wL(`Starting HTTP bridge: socat ${D.join(" ")}`);let B=cAH.spawn("socat",D,{stdio:"ignore"});if(!B.pid)throw Error("Failed to start HTTP bridge process");B.on("error",(G)=>{wL(`HTTP bridge process error: ${G}`,{level:"error"})}),B.on("exit",(G,U)=>{wL(`HTTP bridge process exited with code ${G}, signal ${U}`,{level:G===0?"info":"error"})});let f=[`UNIX-LISTEN:${I},fork,reuseaddr`,`TCP:localhost:${$},keepalive,keepidle=10,keepintvl=5,keepcnt=3`];wL(`Starting SOCKS bridge: socat ${f.join(" ")}`);let E=cAH.spawn("socat",f,{stdio:"ignore"});if(!E.pid){if(B.pid)try{process.kill(B.pid,"SIGTERM")}catch{}throw Error("Failed to start SOCKS bridge process")}E.on("error",(G)=>{wL(`SOCKS bridge process error: ${G}`,{level:"error"})}),E.on("exit",(G,U)=>{wL(`SOCKS bridge process exited with code ${G}, signal ${U}`,{level:G===0?"info":"error"})});let M=5;for(let G=0;GsetTimeout(U,G*100))}return{httpSocketPath:L,socksSocketPath:I,httpBridgeProcess:B,socksBridgeProcess:E,httpProxyPort:H,socksProxyPort:$}}function CO0(H,$,A,L,I,D){let B=I||"bash",f=[`socat TCP-LISTEN:3128,fork,reuseaddr UNIX-CONNECT:${H} >/dev/null 2>&1 &`,`socat TCP-LISTEN:1080,fork,reuseaddr UNIX-CONNECT:${$} >/dev/null 2>&1 &`,'trap "kill %1 %2 2>/dev/null; exit" EXIT'];if(L){let E=DzH(D);if(!E)throw Error("apply-seccomp binary not found. This should have been caught earlier. Ensure vendor/seccomp/{x64,arm64}/apply-seccomp binaries are included in the package.");let M=dAH.default.quote([E,L,B,"-c",A]),G=[...f,M].join(` `),M=E.find((Q)=>Q.includes("Sandbox:")&&Q.includes("deny")),G=E.find((Q)=>Q.startsWith("CMD64_"));if(!M)return;let U=M.match(L);if(!U?.[1])return;let X=U[1],J,F;if(G){if(F=G.match(A)?.[1],F)try{J=OrL(F)}catch{}}if(X.includes("mDNSResponder")||X.includes("mach-lookup com.apple.diagnosticd")||X.includes("mach-lookup com.apple.analyticsd"))return;if($&&J){if(I.length>0){if(I.some((W)=>X.includes(W)))return}for(let[Q,W]of D)if(J.includes(Q)){if(W.some((C)=>X.includes(C)))return}}H({line:X,command:J,encodedCommand:F,timestamp:new Date})}),B.stderr?.on("data",(f)=>{wL(`[Sandbox Monitor] Log stream stderr: ${f.toString()}`)}),B.on("error",(f)=>{wL(`[Sandbox Monitor] Failed to start log stream: ${f.message}`)}),B.on("exit",(f)=>{wL(`[Sandbox Monitor] Log stream exited with code: ${f}`)}),()=>{wL("[Sandbox Monitor] Stopping log monitor"),B.kill("SIGTERM")}}var crL,e0$,Su,lrL;var arL=K(()=>{p4H();crL=b(wtH(),1),e0$=require("child_process"),Su=b(require("path"));lrL=`_${Math.random().toString(36).slice(2,11)}_SBX`});class BzH{constructor(){this.violations=[],this.totalCount=0,this.maxSize=100,this.listeners=new Set}addViolation(H){if(this.violations.push(H),this.totalCount++,this.violations.length>this.maxSize)this.violations=this.violations.slice(-this.maxSize);this.notifyListeners()}getViolations(H){if(H===void 0)return[...this.violations];return this.violations.slice(-H)}getCount(){return this.violations.length}getTotalCount(){return this.totalCount}getViolationsForCommand(H){let $=t0$(H);return this.violations.filter((A)=>A.encodedCommand===$)}clear(){this.violations=[],this.notifyListeners()}subscribe(H){return this.listeners.add(H),H(this.getViolations()),()=>{this.listeners.delete(H)}}notifyListeners(){let H=this.getViolations();this.listeners.forEach(($)=>$(H))}}var DDA=K(()=>{p4H()});function xO0(){if(orL)return;let H=()=>EDA().catch(($)=>{wL(`Cleanup failed in registerCleanup ${$}`,{level:"error"})});process.once("exit",H),process.once("SIGINT",H),process.once("SIGTERM",H),orL=!0}function fDA(H,$){if($.startsWith("*.")){let A=$.substring(2);return H.toLowerCase().endsWith("."+A.toLowerCase())}return H.toLowerCase()===$.toLowerCase()}async function HaL(H,$,A){if(!u9)return wL("No config available, denying network request"),!1;for(let L of u9.network.deniedDomains)if(fDA($,L))return wL(`Denied by config rule: ${$}:${H}`),!1;for(let L of u9.network.allowedDomains)if(fDA($,L))return wL(`Allowed by config rule: ${$}:${H}`),!0;if(!A)return wL(`No matching config rule, denying: ${$}:${H}`),!1;wL(`No matching config rule, asking user: ${$}:${H}`);try{if(await A({host:$,port:H}))return wL(`User allowed: ${$}:${H}`),!0;else return wL(`User denied: ${$}:${H}`),!1}catch(L){return wL(`Error in permission callback: ${L}`,{level:"error"}),!1}}function SO0(H){if(!u9?.network.mitmProxy)return;let{socketPath:$,domains:A}=u9.network.mitmProxy;for(let L of A)if(fDA(H,L))return wL(`Host ${H} matches MITM pattern ${L}`),$;return}async function jO0(H){return d4H=WlL({filter:($,A)=>HaL($,A,H),getMitmSocketPath:SO0}),new Promise(($,A)=>{if(!d4H){A(Error("HTTP proxy server undefined before listen"));return}let L=d4H;L.once("error",A),L.once("listening",()=>{let I=L.address();if(I&&typeof I==="object")L.unref(),wL(`HTTP proxy listening on localhost:${I.port}`),$(I.port);else A(Error("Failed to get proxy server address"))}),L.listen(0,"127.0.0.1")})}async function RO0(H){return lAH=qlL({filter:($,A)=>HaL($,A,H)}),new Promise(($,A)=>{if(!lAH){A(Error("SOCKS proxy server undefined before listen"));return}lAH.listen(0,"127.0.0.1").then((L)=>{lAH?.unref(),$(L)}).catch(A)})}async function yO0(H,$,A=!1){if(An){await An;return}u9=H;let L=AaL();if(L.errors.length>0)throw Error(`Sandbox dependencies not available: ${L.errors.join(", ")}`);if(A&&Zq()==="macos")$9$=rrL(A9$.addViolation.bind(A9$),u9.ignoreViolations),wL("Started macOS sandbox log monitor");xO0(),An=(async()=>{try{let I;if(u9.network.httpProxyPort!==void 0)I=u9.network.httpProxyPort,wL(`Using external HTTP proxy on port ${I}`);else I=await jO0($);let D;if(u9.network.socksProxyPort!==void 0)D=u9.network.socksProxyPort,wL(`Using external SOCKS proxy on port ${D}`);else D=await RO0($);let B;if(Zq()==="linux")B=await grL(I,D);let f={httpProxyPort:I,socksProxyPort:D,linuxBridge:B};return qq=f,wL("Network infrastructure initialized"),f}catch(I){throw An=void 0,qq=void 0,EDA().catch((D)=>{wL(`Cleanup failed in initializationPromise ${D}`,{level:"error"})}),I}})(),await An}function $aL(){let H=Zq();if(H==="linux")return nIA()!=="1";return H==="macos"}function vO0(){return u9!==void 0}function AaL(H){if(!$aL())return{errors:["Unsupported platform"],warnings:[]};let $=[],A=[],L=H??u9?.ripgrep??{command:"rg"};if(erL.spawnSync("which",[L.command],{stdio:"ignore",timeout:1000}).status!==0)$.push(`ripgrep (${L.command}) not found`);if(Zq()==="linux"){let B=urL(u9?.seccomp);$.push(...B.errors),A.push(...B.warnings)}return{errors:$,warnings:A}}function hO0(){if(!u9)return{denyOnly:[]};return{denyOnly:u9.filesystem.denyRead.map(($)=>LzH($)).filter(($)=>{if(Zq()==="linux"&&EO($))return wL(`Skipping glob pattern on Linux/WSL: ${$}`),!1;return!0})}}function bO0(){if(!u9)return{allowOnly:IzH(),denyWithinAllow:[]};let H=u9.filesystem.allowWrite.map((L)=>LzH(L)).filter((L)=>{if(Zq()==="linux"&&EO(L))return wL(`Skipping glob pattern on Linux/WSL: ${L}`),!1;return!0}),$=u9.filesystem.denyWrite.map((L)=>LzH(L)).filter((L)=>{if(Zq()==="linux"&&EO(L))return wL(`Skipping glob pattern on Linux/WSL: ${L}`),!1;return!0});return{allowOnly:[...IzH(),...H],denyWithinAllow:$}}function kO0(){if(!u9)return{};let H=u9.network.allowedDomains,$=u9.network.deniedDomains;return{...H.length>0&&{allowedHosts:H},...$.length>0&&{deniedHosts:$}}}function LaL(){return u9?.network?.allowUnixSockets}function trL(){return u9?.network?.allowAllUnixSockets}function IaL(){return u9?.network?.allowLocalBinding}function DaL(){return u9?.ignoreViolations}function BaL(){return u9?.enableWeakerNestedSandbox}function uO0(){return u9?.ripgrep??{command:"rg"}}function gO0(){return u9?.mandatoryDenySearchDepth??3}function srL(){return u9?.filesystem?.allowGitConfig??!1}function mO0(){return u9?.seccomp}function faL(){return qq?.httpProxyPort}function EaL(){return qq?.socksProxyPort}function MaL(){return qq?.linuxBridge?.httpSocketPath}function GaL(){return qq?.linuxBridge?.socksSocketPath}async function UaL(){if(!u9)return!1;if(An)try{return await An,!0}catch{return!1}return qq!==void 0}async function pO0(H,$,A,L){let I=Zq(),D=A?.filesystem?.allowWrite??u9?.filesystem.allowWrite??[],B={allowOnly:[...IzH(),...D],denyWithinAllow:A?.filesystem?.denyWrite??u9?.filesystem.denyWrite??[]},f={denyOnly:A?.filesystem?.denyRead??u9?.filesystem.denyRead??[]},E=A?.network?.allowedDomains!==void 0||u9?.network?.allowedDomains!==void 0,M=E,G=E;if(G)await UaL();let U=A?.allowPty??u9?.allowPty;switch(I){case"macos":return nrL({command:H,needsNetworkRestriction:M,httpProxyPort:G?faL():void 0,socksProxyPort:G?EaL():void 0,readConfig:f,writeConfig:B,allowUnixSockets:LaL(),allowAllUnixSockets:trL(),allowLocalBinding:IaL(),ignoreViolations:DaL(),allowPty:U,allowGitConfig:srL(),binShell:$});case"linux":return mrL({command:H,needsNetworkRestriction:M,httpSocketPath:G?MaL():void 0,socksSocketPath:G?GaL():void 0,httpProxyPort:G?qq?.httpProxyPort:void 0,socksProxyPort:G?qq?.socksProxyPort:void 0,readConfig:f,writeConfig:B,enableWeakerNestedSandbox:BaL(),allowAllUnixSockets:trL(),binShell:$,ripgrepConfig:uO0(),mandatoryDenySearchDepth:gO0(),allowGitConfig:srL(),seccompConfig:mO0(),abortSignal:L});default:throw Error(`Sandbox configuration is not supported on platform: ${I}`)}}function dO0(){return u9}function cO0(H){u9=iIA(H),wL("Sandbox configuration updated")}async function EDA(){if($9$)$9$(),$9$=void 0;if(qq?.linuxBridge){let{httpSocketPath:$,socksSocketPath:A,httpBridgeProcess:L,socksBridgeProcess:I}=qq.linuxBridge,D=[];if(L.pid&&!L.killed)try{process.kill(L.pid,"SIGTERM"),wL("Sent SIGTERM to HTTP bridge process"),D.push(new Promise((B)=>{L.once("exit",()=>{wL("HTTP bridge process exited"),B()}),setTimeout(()=>{if(!L.killed){wL("HTTP bridge did not exit, forcing SIGKILL",{level:"warn"});try{if(L.pid)process.kill(L.pid,"SIGKILL")}catch{}}B()},5000)}))}catch(B){if(B.code!=="ESRCH")wL(`Error killing HTTP bridge: ${B}`,{level:"error"})}if(I.pid&&!I.killed)try{process.kill(I.pid,"SIGTERM"),wL("Sent SIGTERM to SOCKS bridge process"),D.push(new Promise((B)=>{I.once("exit",()=>{wL("SOCKS bridge process exited"),B()}),setTimeout(()=>{if(!I.killed){wL("SOCKS bridge did not exit, forcing SIGKILL",{level:"warn"});try{if(I.pid)process.kill(I.pid,"SIGKILL")}catch{}}B()},5000)}))}catch(B){if(B.code!=="ESRCH")wL(`Error killing SOCKS bridge: ${B}`,{level:"error"})}if(await Promise.all(D),$)try{BDA.rmSync($,{force:!0}),wL("Cleaned up HTTP socket")}catch(B){wL(`HTTP socket cleanup error: ${B}`,{level:"error"})}if(A)try{BDA.rmSync(A,{force:!0}),wL("Cleaned up SOCKS socket")}catch(B){wL(`SOCKS socket cleanup error: ${B}`,{level:"error"})}}let H=[];if(d4H){let $=d4H,A=new Promise((L)=>{$.close((I)=>{if(I&&I.message!=="Server is not running.")wL(`Error closing HTTP proxy server: ${I.message}`,{level:"error"});L()})});H.push(A)}if(lAH){let $=lAH.close().catch((A)=>{wL(`Error closing SOCKS proxy server: ${A.message}`,{level:"error"})});H.push($)}await Promise.all(H),d4H=void 0,lAH=void 0,qq=void 0,An=void 0}function lO0(){return A9$}function iO0(H,$){if(!u9)return $;let A=A9$.getViolationsForCommand(H);if(A.length===0)return $;let L=$;L+=H9$.EOL+""+H9$.EOL;for(let I of A)L+=I.line+H9$.EOL;return L+="",L}function nO0(){if(Zq()!=="linux"||!u9)return[];let H=[],$=[...u9.filesystem.denyRead,...u9.filesystem.allowWrite,...u9.filesystem.denyWrite];for(let A of $){let L=LzH(A);if(EO(L))H.push(A)}return H}var BDA,erL,H9$,u9,d4H,lAH,qq,An,orL=!1,$9$,A9$,Z5;var XaL=K(()=>{VlL();TlL();wrL();n0$();prL();arL();p4H();DDA();BDA=b(require("fs")),erL=require("child_process"),H9$=require("os"),A9$=new BzH;Z5={initialize:yO0,isSupportedPlatform:$aL,isSandboxingEnabled:vO0,checkDependencies:AaL,getFsReadConfig:hO0,getFsWriteConfig:bO0,getNetworkRestrictionConfig:kO0,getAllowUnixSockets:LaL,getAllowLocalBinding:IaL,getIgnoreViolations:DaL,getEnableWeakerNestedSandbox:BaL,getProxyPort:faL,getSocksProxyPort:EaL,getLinuxHttpSocketPath:MaL,getLinuxSocksSocketPath:GaL,waitForNetworkInitialization:UaL,wrapWithSandbox:pO0,reset:EDA,getSandboxViolationStore:lO0,annotateStderrWithSandboxFailures:iO0,getLinuxGlobPatternWarnings:nO0,getConfig:dO0,updateConfig:cO0}});var N8,MDA,qI,Dy=(H)=>{switch(typeof H){case"undefined":return qI.undefined;case"string":return qI.string;case"number":return Number.isNaN(H)?qI.nan:qI.number;case"boolean":return qI.boolean;case"function":return qI.function;case"bigint":return qI.bigint;case"symbol":return qI.symbol;case"object":if(Array.isArray(H))return qI.array;if(H===null)return qI.null;if(H.then&&typeof H.then==="function"&&H.catch&&typeof H.catch==="function")return qI.promise;if(typeof Map<"u"&&H instanceof Map)return qI.map;if(typeof Set<"u"&&H instanceof Set)return qI.set;if(typeof Date<"u"&&H instanceof Date)return qI.date;return qI.object;default:return qI.unknown}};var fzH=K(()=>{(function(H){H.assertEqual=(I)=>{};function $(I){}H.assertIs=$;function A(I){throw Error()}H.assertNever=A,H.arrayToEnum=(I)=>{let D={};for(let B of I)D[B]=B;return D},H.getValidEnumValues=(I)=>{let D=H.objectKeys(I).filter((f)=>typeof I[I[f]]!=="number"),B={};for(let f of D)B[f]=I[f];return H.objectValues(B)},H.objectValues=(I)=>{return H.objectKeys(I).map(function(D){return I[D]})},H.objectKeys=typeof Object.keys==="function"?(I)=>Object.keys(I):(I)=>{let D=[];for(let B in I)if(Object.prototype.hasOwnProperty.call(I,B))D.push(B);return D},H.find=(I,D)=>{for(let B of I)if(D(B))return B;return},H.isInteger=typeof Number.isInteger==="function"?(I)=>Number.isInteger(I):(I)=>typeof I==="number"&&Number.isFinite(I)&&Math.floor(I)===I;function L(I,D=" | "){return I.map((B)=>typeof B==="string"?`'${B}'`:B).join(D)}H.joinValues=L,H.jsonStringifyReplacer=(I,D)=>{if(typeof D==="bigint")return D.toString();return D}})(N8||(N8={}));(function(H){H.mergeShapes=($,A)=>{return{...$,...A}}})(MDA||(MDA={}));qI=N8.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var rL,rO0=(H)=>{return JSON.stringify(H,null,2).replace(/"([^"]+)":/g,"$1:")},a_;var L9$=K(()=>{fzH();rL=N8.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"]);a_=class a_ extends Error{get errors(){return this.issues}constructor(H){super();this.issues=[],this.addIssue=(A)=>{this.issues=[...this.issues,A]},this.addIssues=(A=[])=>{this.issues=[...this.issues,...A]};let $=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,$);else this.__proto__=$;this.name="ZodError",this.issues=H}format(H){let $=H||function(I){return I.message},A={_errors:[]},L=(I)=>{for(let D of I.issues)if(D.code==="invalid_union")D.unionErrors.map(L);else if(D.code==="invalid_return_type")L(D.returnTypeError);else if(D.code==="invalid_arguments")L(D.argumentsError);else if(D.path.length===0)A._errors.push($(D));else{let B=A,f=0;while(f$.message){let $={},A=[];for(let L of this.issues)if(L.path.length>0){let I=L.path[0];$[I]=$[I]||[],$[I].push(H(L))}else A.push(H(L));return{formErrors:A,fieldErrors:$}}get formErrors(){return this.flatten()}};a_.create=(H)=>{return new a_(H)}});var aO0=(H,$)=>{let A;switch(H.code){case rL.invalid_type:if(H.received===qI.undefined)A="Required";else A=`Expected ${H.expected}, received ${H.received}`;break;case rL.invalid_literal:A=`Invalid literal value, expected ${JSON.stringify(H.expected,N8.jsonStringifyReplacer)}`;break;case rL.unrecognized_keys:A=`Unrecognized key(s) in object: ${N8.joinValues(H.keys,", ")}`;break;case rL.invalid_union:A="Invalid input";break;case rL.invalid_union_discriminator:A=`Invalid discriminator value. Expected ${N8.joinValues(H.options)}`;break;case rL.invalid_enum_value:A=`Invalid enum value. Expected ${N8.joinValues(H.options)}, received '${H.received}'`;break;case rL.invalid_arguments:A="Invalid function arguments";break;case rL.invalid_return_type:A="Invalid function return type";break;case rL.invalid_date:A="Invalid date";break;case rL.invalid_string:if(typeof H.validation==="object")if("includes"in H.validation){if(A=`Invalid input: must include "${H.validation.includes}"`,typeof H.validation.position==="number")A=`${A} at one or more positions greater than or equal to ${H.validation.position}`}else if("startsWith"in H.validation)A=`Invalid input: must start with "${H.validation.startsWith}"`;else if("endsWith"in H.validation)A=`Invalid input: must end with "${H.validation.endsWith}"`;else N8.assertNever(H.validation);else if(H.validation!=="regex")A=`Invalid ${H.validation}`;else A="Invalid";break;case rL.too_small:if(H.type==="array")A=`Array must contain ${H.exact?"exactly":H.inclusive?"at least":"more than"} ${H.minimum} element(s)`;else if(H.type==="string")A=`String must contain ${H.exact?"exactly":H.inclusive?"at least":"over"} ${H.minimum} character(s)`;else if(H.type==="number")A=`Number must be ${H.exact?"exactly equal to ":H.inclusive?"greater than or equal to ":"greater than "}${H.minimum}`;else if(H.type==="bigint")A=`Number must be ${H.exact?"exactly equal to ":H.inclusive?"greater than or equal to ":"greater than "}${H.minimum}`;else if(H.type==="date")A=`Date must be ${H.exact?"exactly equal to ":H.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(H.minimum))}`;else A="Invalid input";break;case rL.too_big:if(H.type==="array")A=`Array must contain ${H.exact?"exactly":H.inclusive?"at most":"less than"} ${H.maximum} element(s)`;else if(H.type==="string")A=`String must contain ${H.exact?"exactly":H.inclusive?"at most":"under"} ${H.maximum} character(s)`;else if(H.type==="number")A=`Number must be ${H.exact?"exactly":H.inclusive?"less than or equal to":"less than"} ${H.maximum}`;else if(H.type==="bigint")A=`BigInt must be ${H.exact?"exactly":H.inclusive?"less than or equal to":"less than"} ${H.maximum}`;else if(H.type==="date")A=`Date must be ${H.exact?"exactly":H.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(H.maximum))}`;else A="Invalid input";break;case rL.custom:A="Invalid input";break;case rL.invalid_intersection_types:A="Intersection results could not be merged";break;case rL.not_multiple_of:A=`Number must be a multiple of ${H.multipleOf}`;break;case rL.not_finite:A="Number must be finite";break;default:A=$.defaultError,N8.assertNever(H)}return{message:A}},ju;var GDA=K(()=>{L9$();fzH();ju=aO0});function oO0(H){JaL=H}function c4H(){return JaL}var JaL;var I9$=K(()=>{GDA();JaL=ju});function pI(H,$){let A=c4H(),L=EzH({issueData:$,data:H.data,path:H.path,errorMaps:[H.common.contextualErrorMap,H.schemaErrorMap,A,A===ju?void 0:ju].filter((I)=>!!I)});H.common.issues.push(L)}class rW{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(H,$){let A=[];for(let L of $){if(L.status==="aborted")return Y0;if(L.status==="dirty")H.dirty();A.push(L.value)}return{status:H.value,value:A}}static async mergeObjectAsync(H,$){let A=[];for(let L of $){let I=await L.key,D=await L.value;A.push({key:I,value:D})}return rW.mergeObjectSync(H,A)}static mergeObjectSync(H,$){let A={};for(let L of $){let{key:I,value:D}=L;if(I.status==="aborted")return Y0;if(D.status==="aborted")return Y0;if(I.status==="dirty")H.dirty();if(D.status==="dirty")H.dirty();if(I.value!=="__proto__"&&(typeof D.value<"u"||L.alwaysSet))A[I.value]=D.value}return{status:H.value,value:A}}}var EzH=(H)=>{let{data:$,path:A,errorMaps:L,issueData:I}=H,D=[...A,...I.path||[]],B={...I,path:D};if(I.message!==void 0)return{...I,path:D,message:I.message};let f="",E=L.filter((M)=>!!M).slice().reverse();for(let M of E)f=M(B,{data:$,defaultError:f}).message;return{...I,path:D,message:f}},tO0,Y0,iAH=(H)=>({status:"dirty",value:H}),m6=(H)=>({status:"valid",value:H}),D9$=(H)=>H.status==="aborted",B9$=(H)=>H.status==="dirty",Ln=(H)=>H.status==="valid",l4H=(H)=>typeof Promise<"u"&&H instanceof Promise;var UDA=K(()=>{I9$();GDA();tO0=[];Y0=Object.freeze({status:"aborted"})});var FaL=()=>{};var HB;var KaL=K(()=>{(function(H){H.errToObj=($)=>typeof $==="string"?{message:$}:$||{},H.toString=($)=>typeof $==="string"?$:$?.message})(HB||(HB={}))});class JO{constructor(H,$,A,L){this._cachedPath=[],this.parent=H,this.data=$,this._path=A,this._key=L}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 G1(H){if(!H)return{};let{errorMap:$,invalid_type_error:A,required_error:L,description:I}=H;if($&&(A||L))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if($)return{errorMap:$,description:I};return{errorMap:(B,f)=>{let{message:E}=H;if(B.code==="invalid_enum_value")return{message:E??f.defaultError};if(typeof f.data>"u")return{message:E??L??f.defaultError};if(B.code!=="invalid_type")return{message:f.defaultError};return{message:E??A??f.defaultError}},description:I}}class H8{get description(){return this._def.description}_getType(H){return Dy(H.data)}_getOrReturnCtx(H,$){return $||{common:H.parent.common,data:H.data,parsedType:Dy(H.data),schemaErrorMap:this._def.errorMap,path:H.path,parent:H.parent}}_processInputParams(H){return{status:new rW,ctx:{common:H.parent.common,data:H.data,parsedType:Dy(H.data),schemaErrorMap:this._def.errorMap,path:H.path,parent:H.parent}}}_parseSync(H){let $=this._parse(H);if(l4H($))throw Error("Synchronous parse encountered promise.");return $}_parseAsync(H){let $=this._parse(H);return Promise.resolve($)}parse(H,$){let A=this.safeParse(H,$);if(A.success)return A.data;throw A.error}safeParse(H,$){let A={common:{issues:[],async:$?.async??!1,contextualErrorMap:$?.errorMap},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:H,parsedType:Dy(H)},L=this._parseSync({data:H,path:A.path,parent:A});return QaL(A,L)}"~validate"(H){let $={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:H,parsedType:Dy(H)};if(!this["~standard"].async)try{let A=this._parseSync({data:H,path:[],parent:$});return Ln(A)?{value:A.value}:{issues:$.common.issues}}catch(A){if(A?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;$.common={issues:[],async:!0}}return this._parseAsync({data:H,path:[],parent:$}).then((A)=>Ln(A)?{value:A.value}:{issues:$.common.issues})}async parseAsync(H,$){let A=await this.safeParseAsync(H,$);if(A.success)return A.data;throw A.error}async safeParseAsync(H,$){let A={common:{issues:[],contextualErrorMap:$?.errorMap,async:!0},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:H,parsedType:Dy(H)},L=this._parse({data:H,path:A.path,parent:A}),I=await(l4H(L)?L:Promise.resolve(L));return QaL(A,I)}refine(H,$){let A=(L)=>{if(typeof $==="string"||typeof $>"u")return{message:$};else if(typeof $==="function")return $(L);else return $};return this._refinement((L,I)=>{let D=H(L),B=()=>I.addIssue({code:rL.custom,...A(L)});if(typeof Promise<"u"&&D instanceof Promise)return D.then((f)=>{if(!f)return B(),!1;else return!0});if(!D)return B(),!1;else return!0})}refinement(H,$){return this._refinement((A,L)=>{if(!H(A))return L.addIssue(typeof $==="function"?$(A,L):$),!1;else return!0})}_refinement(H){return new FO({schema:this,typeName:m0.ZodEffects,effect:{type:"refinement",refinement:H}})}superRefine(H){return this._refinement(H)}constructor(H){this.spa=this.safeParseAsync,this._def=H,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:($)=>this["~validate"]($)}}optional(){return XO.create(this,this._def)}nullable(){return yu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return UO.create(this)}promise(){return oAH.create(this,this._def)}or(H){return t4H.create([this,H],this._def)}and(H){return s4H.create(this,H,this._def)}transform(H){return new FO({...G1(this._def),schema:this,typeName:m0.ZodEffects,effect:{type:"transform",transform:H}})}default(H){let $=typeof H==="function"?H:()=>H;return new A5H({...G1(this._def),innerType:this,defaultValue:$,typeName:m0.ZodDefault})}brand(){return new E9$({typeName:m0.ZodBranded,type:this,...G1(this._def)})}catch(H){let $=typeof H==="function"?H:()=>H;return new L5H({...G1(this._def),innerType:this,catchValue:$,typeName:m0.ZodCatch})}describe(H){return new this.constructor({...this._def,description:H})}pipe(H){return FzH.create(this,H)}readonly(){return I5H.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function PaL(H){let $="[0-5]\\d";if(H.precision)$=`${$}\\.\\d{${H.precision}}`;else if(H.precision==null)$=`${$}(\\.\\d+)?`;let A=H.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${$})${A}`}function Fx0(H){return new RegExp(`^${PaL(H)}$`)}function _aL(H){let $=`${VaL}T${PaL(H)}`,A=[];if(A.push(H.local?"Z?":"Z"),H.offset)A.push("([+-]\\d{2}:?\\d{2})");return $=`${$}(${A.join("|")})`,new RegExp(`^${$}$`)}function Kx0(H,$){if(($==="v4"||!$)&&fx0.test(H))return!0;if(($==="v6"||!$)&&Mx0.test(H))return!0;return!1}function Qx0(H,$){if(!Lx0.test(H))return!1;try{let[A]=H.split(".");if(!A)return!1;let L=A.replace(/-/g,"+").replace(/_/g,"/").padEnd(A.length+(4-A.length%4)%4,"="),I=JSON.parse(atob(L));if(typeof I!=="object"||I===null)return!1;if("typ"in I&&I?.typ!=="JWT")return!1;if(!I.alg)return!1;if($&&I.alg!==$)return!1;return!0}catch{return!1}}function Wx0(H,$){if(($==="v4"||!$)&&Ex0.test(H))return!0;if(($==="v6"||!$)&&Gx0.test(H))return!0;return!1}function Vx0(H,$){let A=(H.toString().split(".")[1]||"").length,L=($.toString().split(".")[1]||"").length,I=A>L?A:L,D=Number.parseInt(H.toFixed(I).replace(".","")),B=Number.parseInt($.toFixed(I).replace(".",""));return D%B/10**I}function i4H(H){if(H instanceof q5){let $={};for(let A in H.shape){let L=H.shape[A];$[A]=XO.create(i4H(L))}return new q5({...H._def,shape:()=>$})}else if(H instanceof UO)return new UO({...H._def,type:i4H(H.element)});else if(H instanceof XO)return XO.create(i4H(H.unwrap()));else if(H instanceof yu)return yu.create(i4H(H.unwrap()));else if(H instanceof fy)return fy.create(H.items.map(($)=>i4H($)));else return H}function JDA(H,$){let A=Dy(H),L=Dy($);if(H===$)return{valid:!0,data:H};else if(A===qI.object&&L===qI.object){let I=N8.objectKeys($),D=N8.objectKeys(H).filter((f)=>I.indexOf(f)!==-1),B={...H,...$};for(let f of D){let E=JDA(H[f],$[f]);if(!E.valid)return{valid:!1};B[f]=E.data}return{valid:!0,data:B}}else if(A===qI.array&&L===qI.array){if(H.length!==$.length)return{valid:!1};let I=[];for(let D=0;D{let D=H(L);if(D instanceof Promise)return D.then((B)=>{if(!B){let f=WaL($,L),E=f.fatal??A??!0;I.addIssue({code:"custom",...f,fatal:E})}});if(!D){let B=WaL($,L),f=B.fatal??A??!0;I.addIssue({code:"custom",...B,fatal:f})}return});return rAH.create()}var QaL=(H,$)=>{if(Ln($))return{success:!0,data:$.value};else{if(!H.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let A=new a_(H.common.issues);return this._error=A,this._error}}}},sO0,eO0,Hx0,$x0,Ax0,Lx0,Ix0,Dx0,Bx0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",XDA,fx0,Ex0,Mx0,Gx0,Ux0,Xx0,VaL="((\\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])))",Jx0,GO,Dn,Bn,r4H,nAH,MzH,a4H,o4H,rAH,In,By,GzH,UO,q5,t4H,Ru=(H)=>{if(H instanceof e4H)return Ru(H.schema);else if(H instanceof FO)return Ru(H.innerType());else if(H instanceof H5H)return[H.value];else if(H instanceof fn)return H.options;else if(H instanceof $5H)return N8.objectValues(H.enum);else if(H instanceof A5H)return Ru(H._def.innerType);else if(H instanceof a4H)return[void 0];else if(H instanceof o4H)return[null];else if(H instanceof XO)return[void 0,...Ru(H.unwrap())];else if(H instanceof yu)return[null,...Ru(H.unwrap())];else if(H instanceof E9$)return Ru(H.unwrap());else if(H instanceof I5H)return Ru(H.unwrap());else if(H instanceof L5H)return Ru(H._def.innerType);else return[]},f9$,s4H,fy,UzH,XzH,aAH,n4H,e4H,H5H,fn,$5H,oAH,FO,XO,yu,A5H,L5H,JzH,Px0,E9$,FzH,I5H,_x0,m0,Yx0=(H,$={message:`Input not instance of ${H.name}`})=>CaL((A)=>A instanceof H,$),uL,Tq,Cx0,wx0,PQ,Zx0,qx0,Tx0,zx0,Nx0,Ox0,xx0,Sx0,FX,R2,y2,tAH,jx0,Rx0,yx0,KO,vx0,hx0,bx0,kx0,ux0,QO,gx0,mx0,px0,dx0,cx0,lx0,ix0,nx0=()=>uL().optional(),rx0=()=>Tq().optional(),ax0=()=>PQ().optional(),ox0,tx0;var waL=K(()=>{L9$();I9$();KaL();UDA();fzH();sO0=/^c[^\s-]{8,}$/i,eO0=/^[0-9a-z]+$/,Hx0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$x0=/^[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,Ax0=/^[a-z0-9_-]{21}$/i,Lx0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ix0=/^[-+]?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)?)??$/,Dx0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fx0=/^(?:(?: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])$/,Ex0=/^(?:(?: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])$/,Mx0=/^(([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]))$/,Gx0=/^(([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])$/,Ux0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xx0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jx0=new RegExp(`^${VaL}$`);GO=class GO extends H8{_parse(H){if(this._def.coerce)H.data=String(H.data);if(this._getType(H)!==qI.string){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_type,expected:qI.string,received:I.parsedType}),Y0}let A=new rW,L=void 0;for(let I of this._def.checks)if(I.kind==="min"){if(H.data.lengthI.value)L=this._getOrReturnCtx(H,L),pI(L,{code:rL.too_big,maximum:I.value,type:"string",inclusive:!0,exact:!1,message:I.message}),A.dirty()}else if(I.kind==="length"){let D=H.data.length>I.value,B=H.data.lengthH.test(L),{validation:$,code:rL.invalid_string,...HB.errToObj(A)})}_addCheck(H){return new GO({...this._def,checks:[...this._def.checks,H]})}email(H){return this._addCheck({kind:"email",...HB.errToObj(H)})}url(H){return this._addCheck({kind:"url",...HB.errToObj(H)})}emoji(H){return this._addCheck({kind:"emoji",...HB.errToObj(H)})}uuid(H){return this._addCheck({kind:"uuid",...HB.errToObj(H)})}nanoid(H){return this._addCheck({kind:"nanoid",...HB.errToObj(H)})}cuid(H){return this._addCheck({kind:"cuid",...HB.errToObj(H)})}cuid2(H){return this._addCheck({kind:"cuid2",...HB.errToObj(H)})}ulid(H){return this._addCheck({kind:"ulid",...HB.errToObj(H)})}base64(H){return this._addCheck({kind:"base64",...HB.errToObj(H)})}base64url(H){return this._addCheck({kind:"base64url",...HB.errToObj(H)})}jwt(H){return this._addCheck({kind:"jwt",...HB.errToObj(H)})}ip(H){return this._addCheck({kind:"ip",...HB.errToObj(H)})}cidr(H){return this._addCheck({kind:"cidr",...HB.errToObj(H)})}datetime(H){if(typeof H==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:H});return this._addCheck({kind:"datetime",precision:typeof H?.precision>"u"?null:H?.precision,offset:H?.offset??!1,local:H?.local??!1,...HB.errToObj(H?.message)})}date(H){return this._addCheck({kind:"date",message:H})}time(H){if(typeof H==="string")return this._addCheck({kind:"time",precision:null,message:H});return this._addCheck({kind:"time",precision:typeof H?.precision>"u"?null:H?.precision,...HB.errToObj(H?.message)})}duration(H){return this._addCheck({kind:"duration",...HB.errToObj(H)})}regex(H,$){return this._addCheck({kind:"regex",regex:H,...HB.errToObj($)})}includes(H,$){return this._addCheck({kind:"includes",value:H,position:$?.position,...HB.errToObj($?.message)})}startsWith(H,$){return this._addCheck({kind:"startsWith",value:H,...HB.errToObj($)})}endsWith(H,$){return this._addCheck({kind:"endsWith",value:H,...HB.errToObj($)})}min(H,$){return this._addCheck({kind:"min",value:H,...HB.errToObj($)})}max(H,$){return this._addCheck({kind:"max",value:H,...HB.errToObj($)})}length(H,$){return this._addCheck({kind:"length",value:H,...HB.errToObj($)})}nonempty(H){return this.min(1,HB.errToObj(H))}trim(){return new GO({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new GO({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new GO({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((H)=>H.kind==="datetime")}get isDate(){return!!this._def.checks.find((H)=>H.kind==="date")}get isTime(){return!!this._def.checks.find((H)=>H.kind==="time")}get isDuration(){return!!this._def.checks.find((H)=>H.kind==="duration")}get isEmail(){return!!this._def.checks.find((H)=>H.kind==="email")}get isURL(){return!!this._def.checks.find((H)=>H.kind==="url")}get isEmoji(){return!!this._def.checks.find((H)=>H.kind==="emoji")}get isUUID(){return!!this._def.checks.find((H)=>H.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((H)=>H.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((H)=>H.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((H)=>H.kind==="cuid2")}get isULID(){return!!this._def.checks.find((H)=>H.kind==="ulid")}get isIP(){return!!this._def.checks.find((H)=>H.kind==="ip")}get isCIDR(){return!!this._def.checks.find((H)=>H.kind==="cidr")}get isBase64(){return!!this._def.checks.find((H)=>H.kind==="base64")}get isBase64url(){return!!this._def.checks.find((H)=>H.kind==="base64url")}get minLength(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H}get maxLength(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.value{return new GO({checks:[],typeName:m0.ZodString,coerce:H?.coerce??!1,...G1(H)})};Dn=class Dn extends H8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(H){if(this._def.coerce)H.data=Number(H.data);if(this._getType(H)!==qI.number){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_type,expected:qI.number,received:I.parsedType}),Y0}let A=void 0,L=new rW;for(let I of this._def.checks)if(I.kind==="int"){if(!N8.isInteger(H.data))A=this._getOrReturnCtx(H,A),pI(A,{code:rL.invalid_type,expected:"integer",received:"float",message:I.message}),L.dirty()}else if(I.kind==="min"){if(I.inclusive?H.dataI.value:H.data>=I.value)A=this._getOrReturnCtx(H,A),pI(A,{code:rL.too_big,maximum:I.value,type:"number",inclusive:I.inclusive,exact:!1,message:I.message}),L.dirty()}else if(I.kind==="multipleOf"){if(Vx0(H.data,I.value)!==0)A=this._getOrReturnCtx(H,A),pI(A,{code:rL.not_multiple_of,multipleOf:I.value,message:I.message}),L.dirty()}else if(I.kind==="finite"){if(!Number.isFinite(H.data))A=this._getOrReturnCtx(H,A),pI(A,{code:rL.not_finite,message:I.message}),L.dirty()}else N8.assertNever(I);return{status:L.value,value:H.data}}gte(H,$){return this.setLimit("min",H,!0,HB.toString($))}gt(H,$){return this.setLimit("min",H,!1,HB.toString($))}lte(H,$){return this.setLimit("max",H,!0,HB.toString($))}lt(H,$){return this.setLimit("max",H,!1,HB.toString($))}setLimit(H,$,A,L){return new Dn({...this._def,checks:[...this._def.checks,{kind:H,value:$,inclusive:A,message:HB.toString(L)}]})}_addCheck(H){return new Dn({...this._def,checks:[...this._def.checks,H]})}int(H){return this._addCheck({kind:"int",message:HB.toString(H)})}positive(H){return this._addCheck({kind:"min",value:0,inclusive:!1,message:HB.toString(H)})}negative(H){return this._addCheck({kind:"max",value:0,inclusive:!1,message:HB.toString(H)})}nonpositive(H){return this._addCheck({kind:"max",value:0,inclusive:!0,message:HB.toString(H)})}nonnegative(H){return this._addCheck({kind:"min",value:0,inclusive:!0,message:HB.toString(H)})}multipleOf(H,$){return this._addCheck({kind:"multipleOf",value:H,message:HB.toString($)})}finite(H){return this._addCheck({kind:"finite",message:HB.toString(H)})}safe(H){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:HB.toString(H)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:HB.toString(H)})}get minValue(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H}get maxValue(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.valueH.kind==="int"||H.kind==="multipleOf"&&N8.isInteger(H.value))}get isFinite(){let H=null,$=null;for(let A of this._def.checks)if(A.kind==="finite"||A.kind==="int"||A.kind==="multipleOf")return!0;else if(A.kind==="min"){if($===null||A.value>$)$=A.value}else if(A.kind==="max"){if(H===null||A.value{return new Dn({checks:[],typeName:m0.ZodNumber,coerce:H?.coerce||!1,...G1(H)})};Bn=class Bn extends H8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(H){if(this._def.coerce)try{H.data=BigInt(H.data)}catch{return this._getInvalidInput(H)}if(this._getType(H)!==qI.bigint)return this._getInvalidInput(H);let A=void 0,L=new rW;for(let I of this._def.checks)if(I.kind==="min"){if(I.inclusive?H.dataI.value:H.data>=I.value)A=this._getOrReturnCtx(H,A),pI(A,{code:rL.too_big,type:"bigint",maximum:I.value,inclusive:I.inclusive,message:I.message}),L.dirty()}else if(I.kind==="multipleOf"){if(H.data%I.value!==BigInt(0))A=this._getOrReturnCtx(H,A),pI(A,{code:rL.not_multiple_of,multipleOf:I.value,message:I.message}),L.dirty()}else N8.assertNever(I);return{status:L.value,value:H.data}}_getInvalidInput(H){let $=this._getOrReturnCtx(H);return pI($,{code:rL.invalid_type,expected:qI.bigint,received:$.parsedType}),Y0}gte(H,$){return this.setLimit("min",H,!0,HB.toString($))}gt(H,$){return this.setLimit("min",H,!1,HB.toString($))}lte(H,$){return this.setLimit("max",H,!0,HB.toString($))}lt(H,$){return this.setLimit("max",H,!1,HB.toString($))}setLimit(H,$,A,L){return new Bn({...this._def,checks:[...this._def.checks,{kind:H,value:$,inclusive:A,message:HB.toString(L)}]})}_addCheck(H){return new Bn({...this._def,checks:[...this._def.checks,H]})}positive(H){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:HB.toString(H)})}negative(H){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:HB.toString(H)})}nonpositive(H){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:HB.toString(H)})}nonnegative(H){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:HB.toString(H)})}multipleOf(H,$){return this._addCheck({kind:"multipleOf",value:H,message:HB.toString($)})}get minValue(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H}get maxValue(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.value{return new Bn({checks:[],typeName:m0.ZodBigInt,coerce:H?.coerce??!1,...G1(H)})};r4H=class r4H extends H8{_parse(H){if(this._def.coerce)H.data=Boolean(H.data);if(this._getType(H)!==qI.boolean){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.boolean,received:A.parsedType}),Y0}return m6(H.data)}};r4H.create=(H)=>{return new r4H({typeName:m0.ZodBoolean,coerce:H?.coerce||!1,...G1(H)})};nAH=class nAH extends H8{_parse(H){if(this._def.coerce)H.data=new Date(H.data);if(this._getType(H)!==qI.date){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_type,expected:qI.date,received:I.parsedType}),Y0}if(Number.isNaN(H.data.getTime())){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_date}),Y0}let A=new rW,L=void 0;for(let I of this._def.checks)if(I.kind==="min"){if(H.data.getTime()I.value)L=this._getOrReturnCtx(H,L),pI(L,{code:rL.too_big,message:I.message,inclusive:!0,exact:!1,maximum:I.value,type:"date"}),A.dirty()}else N8.assertNever(I);return{status:A.value,value:new Date(H.data.getTime())}}_addCheck(H){return new nAH({...this._def,checks:[...this._def.checks,H]})}min(H,$){return this._addCheck({kind:"min",value:H.getTime(),message:HB.toString($)})}max(H,$){return this._addCheck({kind:"max",value:H.getTime(),message:HB.toString($)})}get minDate(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H!=null?new Date(H):null}get maxDate(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.value{return new nAH({checks:[],coerce:H?.coerce||!1,typeName:m0.ZodDate,...G1(H)})};MzH=class MzH extends H8{_parse(H){if(this._getType(H)!==qI.symbol){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.symbol,received:A.parsedType}),Y0}return m6(H.data)}};MzH.create=(H)=>{return new MzH({typeName:m0.ZodSymbol,...G1(H)})};a4H=class a4H extends H8{_parse(H){if(this._getType(H)!==qI.undefined){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.undefined,received:A.parsedType}),Y0}return m6(H.data)}};a4H.create=(H)=>{return new a4H({typeName:m0.ZodUndefined,...G1(H)})};o4H=class o4H extends H8{_parse(H){if(this._getType(H)!==qI.null){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.null,received:A.parsedType}),Y0}return m6(H.data)}};o4H.create=(H)=>{return new o4H({typeName:m0.ZodNull,...G1(H)})};rAH=class rAH extends H8{constructor(){super(...arguments);this._any=!0}_parse(H){return m6(H.data)}};rAH.create=(H)=>{return new rAH({typeName:m0.ZodAny,...G1(H)})};In=class In extends H8{constructor(){super(...arguments);this._unknown=!0}_parse(H){return m6(H.data)}};In.create=(H)=>{return new In({typeName:m0.ZodUnknown,...G1(H)})};By=class By extends H8{_parse(H){let $=this._getOrReturnCtx(H);return pI($,{code:rL.invalid_type,expected:qI.never,received:$.parsedType}),Y0}};By.create=(H)=>{return new By({typeName:m0.ZodNever,...G1(H)})};GzH=class GzH extends H8{_parse(H){if(this._getType(H)!==qI.undefined){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.void,received:A.parsedType}),Y0}return m6(H.data)}};GzH.create=(H)=>{return new GzH({typeName:m0.ZodVoid,...G1(H)})};UO=class UO extends H8{_parse(H){let{ctx:$,status:A}=this._processInputParams(H),L=this._def;if($.parsedType!==qI.array)return pI($,{code:rL.invalid_type,expected:qI.array,received:$.parsedType}),Y0;if(L.exactLength!==null){let D=$.data.length>L.exactLength.value,B=$.data.lengthL.maxLength.value)pI($,{code:rL.too_big,maximum:L.maxLength.value,type:"array",inclusive:!0,exact:!1,message:L.maxLength.message}),A.dirty()}if($.common.async)return Promise.all([...$.data].map((D,B)=>{return L.type._parseAsync(new JO($,D,$.path,B))})).then((D)=>{return rW.mergeArray(A,D)});let I=[...$.data].map((D,B)=>{return L.type._parseSync(new JO($,D,$.path,B))});return rW.mergeArray(A,I)}get element(){return this._def.type}min(H,$){return new UO({...this._def,minLength:{value:H,message:HB.toString($)}})}max(H,$){return new UO({...this._def,maxLength:{value:H,message:HB.toString($)}})}length(H,$){return new UO({...this._def,exactLength:{value:H,message:HB.toString($)}})}nonempty(H){return this.min(1,H)}};UO.create=(H,$)=>{return new UO({type:H,minLength:null,maxLength:null,exactLength:null,typeName:m0.ZodArray,...G1($)})};q5=class q5 extends H8{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let H=this._def.shape(),$=N8.objectKeys(H);return this._cached={shape:H,keys:$},this._cached}_parse(H){if(this._getType(H)!==qI.object){let E=this._getOrReturnCtx(H);return pI(E,{code:rL.invalid_type,expected:qI.object,received:E.parsedType}),Y0}let{status:A,ctx:L}=this._processInputParams(H),{shape:I,keys:D}=this._getCached(),B=[];if(!(this._def.catchall instanceof By&&this._def.unknownKeys==="strip")){for(let E in L.data)if(!D.includes(E))B.push(E)}let f=[];for(let E of D){let M=I[E],G=L.data[E];f.push({key:{status:"valid",value:E},value:M._parse(new JO(L,G,L.path,E)),alwaysSet:E in L.data})}if(this._def.catchall instanceof By){let E=this._def.unknownKeys;if(E==="passthrough")for(let M of B)f.push({key:{status:"valid",value:M},value:{status:"valid",value:L.data[M]}});else if(E==="strict"){if(B.length>0)pI(L,{code:rL.unrecognized_keys,keys:B}),A.dirty()}else if(E==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let E=this._def.catchall;for(let M of B){let G=L.data[M];f.push({key:{status:"valid",value:M},value:E._parse(new JO(L,G,L.path,M)),alwaysSet:M in L.data})}}if(L.common.async)return Promise.resolve().then(async()=>{let E=[];for(let M of f){let G=await M.key,U=await M.value;E.push({key:G,value:U,alwaysSet:M.alwaysSet})}return E}).then((E)=>{return rW.mergeObjectSync(A,E)});else return rW.mergeObjectSync(A,f)}get shape(){return this._def.shape()}strict(H){return HB.errToObj,new q5({...this._def,unknownKeys:"strict",...H!==void 0?{errorMap:($,A)=>{let L=this._def.errorMap?.($,A).message??A.defaultError;if($.code==="unrecognized_keys")return{message:HB.errToObj(H).message??L};return{message:L}}}:{}})}strip(){return new q5({...this._def,unknownKeys:"strip"})}passthrough(){return new q5({...this._def,unknownKeys:"passthrough"})}extend(H){return new q5({...this._def,shape:()=>({...this._def.shape(),...H})})}merge(H){return new q5({unknownKeys:H._def.unknownKeys,catchall:H._def.catchall,shape:()=>({...this._def.shape(),...H._def.shape()}),typeName:m0.ZodObject})}setKey(H,$){return this.augment({[H]:$})}catchall(H){return new q5({...this._def,catchall:H})}pick(H){let $={};for(let A of N8.objectKeys(H))if(H[A]&&this.shape[A])$[A]=this.shape[A];return new q5({...this._def,shape:()=>$})}omit(H){let $={};for(let A of N8.objectKeys(this.shape))if(!H[A])$[A]=this.shape[A];return new q5({...this._def,shape:()=>$})}deepPartial(){return i4H(this)}partial(H){let $={};for(let A of N8.objectKeys(this.shape)){let L=this.shape[A];if(H&&!H[A])$[A]=L;else $[A]=L.optional()}return new q5({...this._def,shape:()=>$})}required(H){let $={};for(let A of N8.objectKeys(this.shape))if(H&&!H[A])$[A]=this.shape[A];else{let I=this.shape[A];while(I instanceof XO)I=I._def.innerType;$[A]=I}return new q5({...this._def,shape:()=>$})}keyof(){return YaL(N8.objectKeys(this.shape))}};q5.create=(H,$)=>{return new q5({shape:()=>H,unknownKeys:"strip",catchall:By.create(),typeName:m0.ZodObject,...G1($)})};q5.strictCreate=(H,$)=>{return new q5({shape:()=>H,unknownKeys:"strict",catchall:By.create(),typeName:m0.ZodObject,...G1($)})};q5.lazycreate=(H,$)=>{return new q5({shape:H,unknownKeys:"strip",catchall:By.create(),typeName:m0.ZodObject,...G1($)})};t4H=class t4H extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A=this._def.options;function L(I){for(let B of I)if(B.result.status==="valid")return B.result;for(let B of I)if(B.result.status==="dirty")return $.common.issues.push(...B.ctx.common.issues),B.result;let D=I.map((B)=>new a_(B.ctx.common.issues));return pI($,{code:rL.invalid_union,unionErrors:D}),Y0}if($.common.async)return Promise.all(A.map(async(I)=>{let D={...$,common:{...$.common,issues:[]},parent:null};return{result:await I._parseAsync({data:$.data,path:$.path,parent:D}),ctx:D}})).then(L);else{let I=void 0,D=[];for(let f of A){let E={...$,common:{...$.common,issues:[]},parent:null},M=f._parseSync({data:$.data,path:$.path,parent:E});if(M.status==="valid")return M;else if(M.status==="dirty"&&!I)I={result:M,ctx:E};if(E.common.issues.length)D.push(E.common.issues)}if(I)return $.common.issues.push(...I.ctx.common.issues),I.result;let B=D.map((f)=>new a_(f));return pI($,{code:rL.invalid_union,unionErrors:B}),Y0}}get options(){return this._def.options}};t4H.create=(H,$)=>{return new t4H({options:H,typeName:m0.ZodUnion,...G1($)})};f9$=class f9$ extends H8{_parse(H){let{ctx:$}=this._processInputParams(H);if($.parsedType!==qI.object)return pI($,{code:rL.invalid_type,expected:qI.object,received:$.parsedType}),Y0;let A=this.discriminator,L=$.data[A],I=this.optionsMap.get(L);if(!I)return pI($,{code:rL.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[A]}),Y0;if($.common.async)return I._parseAsync({data:$.data,path:$.path,parent:$});else return I._parseSync({data:$.data,path:$.path,parent:$})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(H,$,A){let L=new Map;for(let I of $){let D=Ru(I.shape[H]);if(!D.length)throw Error(`A discriminator value for key \`${H}\` could not be extracted from all schema options`);for(let B of D){if(L.has(B))throw Error(`Discriminator property ${String(H)} has duplicate value ${String(B)}`);L.set(B,I)}}return new f9$({typeName:m0.ZodDiscriminatedUnion,discriminator:H,options:$,optionsMap:L,...G1(A)})}};s4H=class s4H extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H),L=(I,D)=>{if(D9$(I)||D9$(D))return Y0;let B=JDA(I.value,D.value);if(!B.valid)return pI(A,{code:rL.invalid_intersection_types}),Y0;if(B9$(I)||B9$(D))$.dirty();return{status:$.value,value:B.data}};if(A.common.async)return Promise.all([this._def.left._parseAsync({data:A.data,path:A.path,parent:A}),this._def.right._parseAsync({data:A.data,path:A.path,parent:A})]).then(([I,D])=>L(I,D));else return L(this._def.left._parseSync({data:A.data,path:A.path,parent:A}),this._def.right._parseSync({data:A.data,path:A.path,parent:A}))}};s4H.create=(H,$,A)=>{return new s4H({left:H,right:$,typeName:m0.ZodIntersection,...G1(A)})};fy=class fy extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.array)return pI(A,{code:rL.invalid_type,expected:qI.array,received:A.parsedType}),Y0;if(A.data.lengththis._def.items.length)pI(A,{code:rL.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty();let I=[...A.data].map((D,B)=>{let f=this._def.items[B]||this._def.rest;if(!f)return null;return f._parse(new JO(A,D,A.path,B))}).filter((D)=>!!D);if(A.common.async)return Promise.all(I).then((D)=>{return rW.mergeArray($,D)});else return rW.mergeArray($,I)}get items(){return this._def.items}rest(H){return new fy({...this._def,rest:H})}};fy.create=(H,$)=>{if(!Array.isArray(H))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new fy({items:H,typeName:m0.ZodTuple,rest:null,...G1($)})};UzH=class UzH extends H8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.object)return pI(A,{code:rL.invalid_type,expected:qI.object,received:A.parsedType}),Y0;let L=[],I=this._def.keyType,D=this._def.valueType;for(let B in A.data)L.push({key:I._parse(new JO(A,B,A.path,B)),value:D._parse(new JO(A,A.data[B],A.path,B)),alwaysSet:B in A.data});if(A.common.async)return rW.mergeObjectAsync($,L);else return rW.mergeObjectSync($,L)}get element(){return this._def.valueType}static create(H,$,A){if($ instanceof H8)return new UzH({keyType:H,valueType:$,typeName:m0.ZodRecord,...G1(A)});return new UzH({keyType:GO.create(),valueType:H,typeName:m0.ZodRecord,...G1($)})}};XzH=class XzH extends H8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.map)return pI(A,{code:rL.invalid_type,expected:qI.map,received:A.parsedType}),Y0;let L=this._def.keyType,I=this._def.valueType,D=[...A.data.entries()].map(([B,f],E)=>{return{key:L._parse(new JO(A,B,A.path,[E,"key"])),value:I._parse(new JO(A,f,A.path,[E,"value"]))}});if(A.common.async){let B=new Map;return Promise.resolve().then(async()=>{for(let f of D){let E=await f.key,M=await f.value;if(E.status==="aborted"||M.status==="aborted")return Y0;if(E.status==="dirty"||M.status==="dirty")$.dirty();B.set(E.value,M.value)}return{status:$.value,value:B}})}else{let B=new Map;for(let f of D){let{key:E,value:M}=f;if(E.status==="aborted"||M.status==="aborted")return Y0;if(E.status==="dirty"||M.status==="dirty")$.dirty();B.set(E.value,M.value)}return{status:$.value,value:B}}}};XzH.create=(H,$,A)=>{return new XzH({valueType:$,keyType:H,typeName:m0.ZodMap,...G1(A)})};aAH=class aAH extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.set)return pI(A,{code:rL.invalid_type,expected:qI.set,received:A.parsedType}),Y0;let L=this._def;if(L.minSize!==null){if(A.data.sizeL.maxSize.value)pI(A,{code:rL.too_big,maximum:L.maxSize.value,type:"set",inclusive:!0,exact:!1,message:L.maxSize.message}),$.dirty()}let I=this._def.valueType;function D(f){let E=new Set;for(let M of f){if(M.status==="aborted")return Y0;if(M.status==="dirty")$.dirty();E.add(M.value)}return{status:$.value,value:E}}let B=[...A.data.values()].map((f,E)=>I._parse(new JO(A,f,A.path,E)));if(A.common.async)return Promise.all(B).then((f)=>D(f));else return D(B)}min(H,$){return new aAH({...this._def,minSize:{value:H,message:HB.toString($)}})}max(H,$){return new aAH({...this._def,maxSize:{value:H,message:HB.toString($)}})}size(H,$){return this.min(H,$).max(H,$)}nonempty(H){return this.min(1,H)}};aAH.create=(H,$)=>{return new aAH({valueType:H,minSize:null,maxSize:null,typeName:m0.ZodSet,...G1($)})};n4H=class n4H extends H8{constructor(){super(...arguments);this.validate=this.implement}_parse(H){let{ctx:$}=this._processInputParams(H);if($.parsedType!==qI.function)return pI($,{code:rL.invalid_type,expected:qI.function,received:$.parsedType}),Y0;function A(B,f){return EzH({data:B,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,c4H(),ju].filter((E)=>!!E),issueData:{code:rL.invalid_arguments,argumentsError:f}})}function L(B,f){return EzH({data:B,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,c4H(),ju].filter((E)=>!!E),issueData:{code:rL.invalid_return_type,returnTypeError:f}})}let I={errorMap:$.common.contextualErrorMap},D=$.data;if(this._def.returns instanceof oAH){let B=this;return m6(async function(...f){let E=new a_([]),M=await B._def.args.parseAsync(f,I).catch((X)=>{throw E.addIssue(A(f,X)),E}),G=await Reflect.apply(D,this,M);return await B._def.returns._def.type.parseAsync(G,I).catch((X)=>{throw E.addIssue(L(G,X)),E})})}else{let B=this;return m6(function(...f){let E=B._def.args.safeParse(f,I);if(!E.success)throw new a_([A(f,E.error)]);let M=Reflect.apply(D,this,E.data),G=B._def.returns.safeParse(M,I);if(!G.success)throw new a_([L(M,G.error)]);return G.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...H){return new n4H({...this._def,args:fy.create(H).rest(In.create())})}returns(H){return new n4H({...this._def,returns:H})}implement(H){return this.parse(H)}strictImplement(H){return this.parse(H)}static create(H,$,A){return new n4H({args:H?H:fy.create([]).rest(In.create()),returns:$||In.create(),typeName:m0.ZodFunction,...G1(A)})}};e4H=class e4H extends H8{get schema(){return this._def.getter()}_parse(H){let{ctx:$}=this._processInputParams(H);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}};e4H.create=(H,$)=>{return new e4H({getter:H,typeName:m0.ZodLazy,...G1($)})};H5H=class H5H extends H8{_parse(H){if(H.data!==this._def.value){let $=this._getOrReturnCtx(H);return pI($,{received:$.data,code:rL.invalid_literal,expected:this._def.value}),Y0}return{status:"valid",value:H.data}}get value(){return this._def.value}};H5H.create=(H,$)=>{return new H5H({value:H,typeName:m0.ZodLiteral,...G1($)})};fn=class fn extends H8{_parse(H){if(typeof H.data!=="string"){let $=this._getOrReturnCtx(H),A=this._def.values;return pI($,{expected:N8.joinValues(A),received:$.parsedType,code:rL.invalid_type}),Y0}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(H.data)){let $=this._getOrReturnCtx(H),A=this._def.values;return pI($,{received:$.data,code:rL.invalid_enum_value,options:A}),Y0}return m6(H.data)}get options(){return this._def.values}get enum(){let H={};for(let $ of this._def.values)H[$]=$;return H}get Values(){let H={};for(let $ of this._def.values)H[$]=$;return H}get Enum(){let H={};for(let $ of this._def.values)H[$]=$;return H}extract(H,$=this._def){return fn.create(H,{...this._def,...$})}exclude(H,$=this._def){return fn.create(this.options.filter((A)=>!H.includes(A)),{...this._def,...$})}};fn.create=YaL;$5H=class $5H extends H8{_parse(H){let $=N8.getValidEnumValues(this._def.values),A=this._getOrReturnCtx(H);if(A.parsedType!==qI.string&&A.parsedType!==qI.number){let L=N8.objectValues($);return pI(A,{expected:N8.joinValues(L),received:A.parsedType,code:rL.invalid_type}),Y0}if(!this._cache)this._cache=new Set(N8.getValidEnumValues(this._def.values));if(!this._cache.has(H.data)){let L=N8.objectValues($);return pI(A,{received:A.data,code:rL.invalid_enum_value,options:L}),Y0}return m6(H.data)}get enum(){return this._def.values}};$5H.create=(H,$)=>{return new $5H({values:H,typeName:m0.ZodNativeEnum,...G1($)})};oAH=class oAH extends H8{unwrap(){return this._def.type}_parse(H){let{ctx:$}=this._processInputParams(H);if($.parsedType!==qI.promise&&$.common.async===!1)return pI($,{code:rL.invalid_type,expected:qI.promise,received:$.parsedType}),Y0;let A=$.parsedType===qI.promise?$.data:Promise.resolve($.data);return m6(A.then((L)=>{return this._def.type.parseAsync(L,{path:$.path,errorMap:$.common.contextualErrorMap})}))}};oAH.create=(H,$)=>{return new oAH({type:H,typeName:m0.ZodPromise,...G1($)})};FO=class FO extends H8{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(H){let{status:$,ctx:A}=this._processInputParams(H),L=this._def.effect||null,I={addIssue:(D)=>{if(pI(A,D),D.fatal)$.abort();else $.dirty()},get path(){return A.path}};if(I.addIssue=I.addIssue.bind(I),L.type==="preprocess"){let D=L.transform(A.data,I);if(A.common.async)return Promise.resolve(D).then(async(B)=>{if($.value==="aborted")return Y0;let f=await this._def.schema._parseAsync({data:B,path:A.path,parent:A});if(f.status==="aborted")return Y0;if(f.status==="dirty")return iAH(f.value);if($.value==="dirty")return iAH(f.value);return f});else{if($.value==="aborted")return Y0;let B=this._def.schema._parseSync({data:D,path:A.path,parent:A});if(B.status==="aborted")return Y0;if(B.status==="dirty")return iAH(B.value);if($.value==="dirty")return iAH(B.value);return B}}if(L.type==="refinement"){let D=(B)=>{let f=L.refinement(B,I);if(A.common.async)return Promise.resolve(f);if(f instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return B};if(A.common.async===!1){let B=this._def.schema._parseSync({data:A.data,path:A.path,parent:A});if(B.status==="aborted")return Y0;if(B.status==="dirty")$.dirty();return D(B.value),{status:$.value,value:B.value}}else return this._def.schema._parseAsync({data:A.data,path:A.path,parent:A}).then((B)=>{if(B.status==="aborted")return Y0;if(B.status==="dirty")$.dirty();return D(B.value).then(()=>{return{status:$.value,value:B.value}})})}if(L.type==="transform")if(A.common.async===!1){let D=this._def.schema._parseSync({data:A.data,path:A.path,parent:A});if(!Ln(D))return Y0;let B=L.transform(D.value,I);if(B instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:B}}else return this._def.schema._parseAsync({data:A.data,path:A.path,parent:A}).then((D)=>{if(!Ln(D))return Y0;return Promise.resolve(L.transform(D.value,I)).then((B)=>({status:$.value,value:B}))});N8.assertNever(L)}};FO.create=(H,$,A)=>{return new FO({schema:H,typeName:m0.ZodEffects,effect:$,...G1(A)})};FO.createWithPreprocess=(H,$,A)=>{return new FO({schema:$,effect:{type:"preprocess",transform:H},typeName:m0.ZodEffects,...G1(A)})};XO=class XO extends H8{_parse(H){if(this._getType(H)===qI.undefined)return m6(void 0);return this._def.innerType._parse(H)}unwrap(){return this._def.innerType}};XO.create=(H,$)=>{return new XO({innerType:H,typeName:m0.ZodOptional,...G1($)})};yu=class yu extends H8{_parse(H){if(this._getType(H)===qI.null)return m6(null);return this._def.innerType._parse(H)}unwrap(){return this._def.innerType}};yu.create=(H,$)=>{return new yu({innerType:H,typeName:m0.ZodNullable,...G1($)})};A5H=class A5H extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A=$.data;if($.parsedType===qI.undefined)A=this._def.defaultValue();return this._def.innerType._parse({data:A,path:$.path,parent:$})}removeDefault(){return this._def.innerType}};A5H.create=(H,$)=>{return new A5H({innerType:H,typeName:m0.ZodDefault,defaultValue:typeof $.default==="function"?$.default:()=>$.default,...G1($)})};L5H=class L5H extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A={...$,common:{...$.common,issues:[]}},L=this._def.innerType._parse({data:A.data,path:A.path,parent:{...A}});if(l4H(L))return L.then((I)=>{return{status:"valid",value:I.status==="valid"?I.value:this._def.catchValue({get error(){return new a_(A.common.issues)},input:A.data})}});else return{status:"valid",value:L.status==="valid"?L.value:this._def.catchValue({get error(){return new a_(A.common.issues)},input:A.data})}}removeCatch(){return this._def.innerType}};L5H.create=(H,$)=>{return new L5H({innerType:H,typeName:m0.ZodCatch,catchValue:typeof $.catch==="function"?$.catch:()=>$.catch,...G1($)})};JzH=class JzH extends H8{_parse(H){if(this._getType(H)!==qI.nan){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.nan,received:A.parsedType}),Y0}return{status:"valid",value:H.data}}};JzH.create=(H)=>{return new JzH({typeName:m0.ZodNaN,...G1(H)})};Px0=Symbol("zod_brand");E9$=class E9$ extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A=$.data;return this._def.type._parse({data:A,path:$.path,parent:$})}unwrap(){return this._def.type}};FzH=class FzH extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.common.async)return(async()=>{let I=await this._def.in._parseAsync({data:A.data,path:A.path,parent:A});if(I.status==="aborted")return Y0;if(I.status==="dirty")return $.dirty(),iAH(I.value);else return this._def.out._parseAsync({data:I.value,path:A.path,parent:A})})();else{let L=this._def.in._parseSync({data:A.data,path:A.path,parent:A});if(L.status==="aborted")return Y0;if(L.status==="dirty")return $.dirty(),{status:"dirty",value:L.value};else return this._def.out._parseSync({data:L.value,path:A.path,parent:A})}}static create(H,$){return new FzH({in:H,out:$,typeName:m0.ZodPipeline})}};I5H=class I5H extends H8{_parse(H){let $=this._def.innerType._parse(H),A=(L)=>{if(Ln(L))L.value=Object.freeze(L.value);return L};return l4H($)?$.then((L)=>A(L)):A($)}unwrap(){return this._def.innerType}};I5H.create=(H,$)=>{return new I5H({innerType:H,typeName:m0.ZodReadonly,...G1($)})};_x0={object:q5.lazycreate};(function(H){H.ZodString="ZodString",H.ZodNumber="ZodNumber",H.ZodNaN="ZodNaN",H.ZodBigInt="ZodBigInt",H.ZodBoolean="ZodBoolean",H.ZodDate="ZodDate",H.ZodSymbol="ZodSymbol",H.ZodUndefined="ZodUndefined",H.ZodNull="ZodNull",H.ZodAny="ZodAny",H.ZodUnknown="ZodUnknown",H.ZodNever="ZodNever",H.ZodVoid="ZodVoid",H.ZodArray="ZodArray",H.ZodObject="ZodObject",H.ZodUnion="ZodUnion",H.ZodDiscriminatedUnion="ZodDiscriminatedUnion",H.ZodIntersection="ZodIntersection",H.ZodTuple="ZodTuple",H.ZodRecord="ZodRecord",H.ZodMap="ZodMap",H.ZodSet="ZodSet",H.ZodFunction="ZodFunction",H.ZodLazy="ZodLazy",H.ZodLiteral="ZodLiteral",H.ZodEnum="ZodEnum",H.ZodEffects="ZodEffects",H.ZodNativeEnum="ZodNativeEnum",H.ZodOptional="ZodOptional",H.ZodNullable="ZodNullable",H.ZodDefault="ZodDefault",H.ZodCatch="ZodCatch",H.ZodPromise="ZodPromise",H.ZodBranded="ZodBranded",H.ZodPipeline="ZodPipeline",H.ZodReadonly="ZodReadonly"})(m0||(m0={}));uL=GO.create,Tq=Dn.create,Cx0=JzH.create,wx0=Bn.create,PQ=r4H.create,Zx0=nAH.create,qx0=MzH.create,Tx0=a4H.create,zx0=o4H.create,Nx0=rAH.create,Ox0=In.create,xx0=By.create,Sx0=GzH.create,FX=UO.create,R2=q5.create,y2=q5.strictCreate,tAH=t4H.create,jx0=f9$.create,Rx0=s4H.create,yx0=fy.create,KO=UzH.create,vx0=XzH.create,hx0=aAH.create,bx0=n4H.create,kx0=e4H.create,ux0=H5H.create,QO=fn.create,gx0=$5H.create,mx0=oAH.create,px0=FO.create,dx0=XO.create,cx0=yu.create,lx0=FO.createWithPreprocess,ix0=FzH.create,ox0={string:(H)=>GO.create({...H,coerce:!0}),number:(H)=>Dn.create({...H,coerce:!0}),boolean:(H)=>r4H.create({...H,coerce:!0}),bigint:(H)=>Bn.create({...H,coerce:!0}),date:(H)=>nAH.create({...H,coerce:!0})},tx0=Y0});var $9={};XA($9,{void:()=>Sx0,util:()=>N8,unknown:()=>Ox0,union:()=>tAH,undefined:()=>Tx0,tuple:()=>yx0,transformer:()=>px0,symbol:()=>qx0,string:()=>uL,strictObject:()=>y2,setErrorMap:()=>oO0,set:()=>hx0,record:()=>KO,quotelessJson:()=>rO0,promise:()=>mx0,preprocess:()=>lx0,pipeline:()=>ix0,ostring:()=>nx0,optional:()=>dx0,onumber:()=>rx0,oboolean:()=>ax0,objectUtil:()=>MDA,object:()=>R2,number:()=>Tq,nullable:()=>cx0,null:()=>zx0,never:()=>xx0,nativeEnum:()=>gx0,nan:()=>Cx0,map:()=>vx0,makeIssue:()=>EzH,literal:()=>ux0,lazy:()=>kx0,late:()=>_x0,isValid:()=>Ln,isDirty:()=>B9$,isAsync:()=>l4H,isAborted:()=>D9$,intersection:()=>Rx0,instanceof:()=>Yx0,getParsedType:()=>Dy,getErrorMap:()=>c4H,function:()=>bx0,enum:()=>QO,effect:()=>px0,discriminatedUnion:()=>jx0,defaultErrorMap:()=>ju,datetimeRegex:()=>_aL,date:()=>Zx0,custom:()=>CaL,coerce:()=>ox0,boolean:()=>PQ,bigint:()=>wx0,array:()=>FX,any:()=>Nx0,addIssueToContext:()=>pI,ZodVoid:()=>GzH,ZodUnknown:()=>In,ZodUnion:()=>t4H,ZodUndefined:()=>a4H,ZodType:()=>H8,ZodTuple:()=>fy,ZodTransformer:()=>FO,ZodSymbol:()=>MzH,ZodString:()=>GO,ZodSet:()=>aAH,ZodSchema:()=>H8,ZodRecord:()=>UzH,ZodReadonly:()=>I5H,ZodPromise:()=>oAH,ZodPipeline:()=>FzH,ZodParsedType:()=>qI,ZodOptional:()=>XO,ZodObject:()=>q5,ZodNumber:()=>Dn,ZodNullable:()=>yu,ZodNull:()=>o4H,ZodNever:()=>By,ZodNativeEnum:()=>$5H,ZodNaN:()=>JzH,ZodMap:()=>XzH,ZodLiteral:()=>H5H,ZodLazy:()=>e4H,ZodIssueCode:()=>rL,ZodIntersection:()=>s4H,ZodFunction:()=>n4H,ZodFirstPartyTypeKind:()=>m0,ZodError:()=>a_,ZodEnum:()=>fn,ZodEffects:()=>FO,ZodDiscriminatedUnion:()=>f9$,ZodDefault:()=>A5H,ZodDate:()=>nAH,ZodCatch:()=>L5H,ZodBranded:()=>E9$,ZodBoolean:()=>r4H,ZodBigInt:()=>Bn,ZodArray:()=>UO,ZodAny:()=>rAH,Schema:()=>H8,ParseStatus:()=>rW,OK:()=>m6,NEVER:()=>tx0,INVALID:()=>Y0,EMPTY_PATH:()=>tO0,DIRTY:()=>iAH,BRAND:()=>Px0});var FDA=K(()=>{I9$();UDA();FaL();fzH();waL();L9$()});var KzH=K(()=>{FDA();FDA()});var QDA,KDA,sx0,qaL,TaL,zaL,NaL,ex0,OaL;var xaL=K(()=>{KzH();QDA=$9.string().refine((H)=>{if(H.includes("://")||H.includes("/")||H.includes(":"))return!1;if(H==="localhost")return!0;if(H.startsWith("*.")){let $=H.slice(2);if(!$.includes(".")||$.startsWith(".")||$.endsWith("."))return!1;let A=$.split(".");return A.length>=2&&A.every((L)=>L.length>0)}if(H.includes("*"))return!1;return H.includes(".")&&!H.startsWith(".")&&!H.endsWith(".")},{message:'Invalid domain pattern. Must be a valid domain (e.g., "example.com") or wildcard (e.g., "*.example.com"). Overly broad patterns like "*.com" or "*" are not allowed for security reasons.'}),KDA=$9.string().min(1,"Path cannot be empty"),sx0=$9.object({socketPath:$9.string().min(1).describe("Unix socket path to the MITM proxy"),domains:$9.array(QDA).min(1).describe('Domains to route through the MITM proxy (e.g., ["api.example.com", "*.internal.org"])')}),qaL=$9.object({allowedDomains:$9.array(QDA).describe('List of allowed domains (e.g., ["github.com", "*.npmjs.org"])'),deniedDomains:$9.array(QDA).describe("List of denied domains"),allowUnixSockets:$9.array($9.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:$9.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:$9.boolean().optional().describe("Whether to allow binding to local ports (default: false)"),httpProxyPort:$9.number().int().min(1).max(65535).optional().describe("Port of an external HTTP proxy to use instead of starting a local one. When provided, the library will skip starting its own HTTP proxy and use this port. The external proxy must handle domain filtering."),socksProxyPort:$9.number().int().min(1).max(65535).optional().describe("Port of an external SOCKS proxy to use instead of starting a local one. When provided, the library will skip starting its own SOCKS proxy and use this port. The external proxy must handle domain filtering."),mitmProxy:sx0.optional().describe("Optional MITM proxy configuration. Routes matching domains through an upstream proxy via Unix socket while SRT still handles allow/deny filtering.")}),TaL=$9.object({denyRead:$9.array(KDA).describe("Paths denied for reading"),allowWrite:$9.array(KDA).describe("Paths allowed for writing"),denyWrite:$9.array(KDA).describe("Paths denied for writing (takes precedence over allowWrite)"),allowGitConfig:$9.boolean().optional().describe("Allow writes to .git/config files (default: false). Enables git remote URL updates while keeping .git/hooks protected.")}),zaL=$9.record($9.string(),$9.array($9.string())).describe('Map of command patterns to filesystem paths to ignore violations for. Use "*" to match all commands'),NaL=$9.object({command:$9.string().describe('The ripgrep command to execute (e.g., "rg", "claude")'),args:$9.array($9.string()).optional().describe('Additional arguments to pass before ripgrep args (e.g., ["--ripgrep"])')}),ex0=$9.object({bpfPath:$9.string().optional().describe("Path to the unix-block.bpf filter file"),applyPath:$9.string().optional().describe("Path to the apply-seccomp binary")}),OaL=$9.object({network:qaL.describe("Network restrictions configuration"),filesystem:TaL.describe("Filesystem restrictions configuration"),ignoreViolations:zaL.optional().describe("Optional configuration for ignoring specific violations"),enableWeakerNestedSandbox:$9.boolean().optional().describe("Enable weaker nested sandbox mode (for Docker environments)"),ripgrep:NaL.optional().describe('Custom ripgrep configuration (default: { command: "rg" })'),mandatoryDenySearchDepth:$9.number().int().min(1).max(10).optional().describe("Maximum directory depth to search for dangerous files on Linux (default: 3). Higher values provide more protection but slower performance."),allowPty:$9.boolean().optional().describe("Allow pseudo-terminal (pty) operations (macOS only)"),seccomp:ex0.optional().describe("Custom seccomp binary paths (Linux only).")})});var SaL=K(()=>{XaL();DDA();xaL();p4H();n0$()});function jaL(H,$,A){return` `;var TB="Edit",M9$="/.claude/**",G9$="~/.claude/**",QzH="File has been unexpectedly modified. Read it again before attempting to write it.";function VDA(H){let $=H.trim();if(!$)return null;if($.endsWith("-")){let D=parseInt($.slice(0,-1),10);if(isNaN(D)||D<1)return null;return{firstPage:D,lastPage:1/0}}let A=$.indexOf("-");if(A===-1){let D=parseInt($,10);if(isNaN(D)||D<1)return null;return{firstPage:D,lastPage:D}}let L=parseInt($.slice(0,A),10),I=parseInt($.slice(A+1),10);if(isNaN(L)||isNaN(I)||L<1||I<1||I{oM();HS0=new Set(["pdf"])});var $B="Read",VzH=2000,$S0=2000,RaL="Read a file from the local filesystem.",yaL;var tG=K(()=>{U9$();yaL=`Reads a file from the local filesystem. You can access any file directly by using this tool. - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.`});function D5H(H){let $=H.match(/^([^(]+)\(([^)]+)\)$/);if(!$)return{toolName:H};let A=$[1],L=$[2];if(!A||!L)return{toolName:H};return{toolName:A,ruleContent:L}}function AS0(H){return H.match(/^(.+):\*$/)?.[1]??null}function PDA(H,$){if(H.startsWith("//"))return H.slice(1);if(H.startsWith("/")&&!H.startsWith("//")){let A=D4H($);return B5H.resolve(A,H.slice(1))}return H}function PzH(){return ZI("policySettings")?.sandbox?.network?.allowManagedDomainsOnly===!0}function _DA(H){let $=H.permissions||{},A=[],L=[];if(PzH()){let J=ZI("policySettings");for(let F of J?.sandbox?.network?.allowedDomains||[])A.push(F);for(let F of J?.permissions?.allow||[]){let Q=D5H(F);if(Q.toolName===w4&&Q.ruleContent?.startsWith("domain:"))A.push(Q.ruleContent.substring(7))}}else{for(let J of H.sandbox?.network?.allowedDomains||[])A.push(J);for(let J of $.allow||[]){let F=D5H(J);if(F.toolName===w4&&F.ruleContent?.startsWith("domain:"))A.push(F.ruleContent.substring(7))}}for(let J of $.deny||[]){let F=D5H(J);if(F.toolName===w4&&F.ruleContent?.startsWith("domain:"))L.push(F.ruleContent.substring(7))}let I=[".",_zH()],D=[],B=[],f=j_.map((J)=>aM(J)).filter((J)=>J!==void 0);D.push(...f);let E=HR(),M=zL();if(E!==M)D.push(B5H.resolve(E,".claude","settings.json")),D.push(B5H.resolve(E,".claude","settings.local.json"));let G=B5H.join(E,".git");try{if(X9$.statSync(G).isFile()){let Q=X9$.readFileSync(G,{encoding:"utf8"}).match(/^gitdir:\s*(.+)$/m);if(Q?.[1]){let W=Q[1].trim(),P=W.indexOf(".git");if(P>0){let C=W.substring(0,P-1);if(C!==E)I.push(C)}}}}catch{}let U=new Set([...H.permissions?.additionalDirectories||[],...CN()]);I.push(...U);for(let J of j_){let F=ZI(J);if(!F?.permissions)continue;for(let Q of F.permissions.allow||[]){let W=D5H(Q);if(W.toolName===TB&&W.ruleContent)I.push(PDA(W.ruleContent,J))}for(let Q of F.permissions.deny||[]){let W=D5H(Q);if(W.toolName===TB&&W.ruleContent)D.push(PDA(W.ruleContent,J));if(W.toolName===$B&&W.ruleContent)B.push(PDA(W.ruleContent,J))}}let X=H.sandbox?.ripgrep?H.sandbox.ripgrep:(()=>{let{rgPath:J,rgArgs:F}=eMH();return{command:J,args:F}})();return{network:{allowedDomains:A,deniedDomains:L,allowUnixSockets:H.sandbox?.network?.allowUnixSockets,allowAllUnixSockets:H.sandbox?.network?.allowAllUnixSockets,allowLocalBinding:H.sandbox?.network?.allowLocalBinding,httpProxyPort:H.sandbox?.network?.httpProxyPort,socksProxyPort:H.sandbox?.network?.socksProxyPort},filesystem:{denyRead:B,allowWrite:I,denyWrite:D},ignoreViolations:H.sandbox?.ignoreViolations,enableWeakerNestedSandbox:H.sandbox?.enableWeakerNestedSandbox,ripgrep:X}}function haL(){try{let H=VL();return vaL(H)}catch(H){return N(`Failed to get settings for sandbox check: ${H}`),!1}}function LS0(){let H=VL();return baL(H)}function IS0(){let H=VL();return kaL(H)}function gaL(){try{let H=GB();return uaL(H)}catch(H){return N(`Failed to check enabledPlatforms: ${H}`),!0}}function J9$(){if(!wDA())return!1;if(CDA().errors.length>0)return!1;if(!gaL())return!1;return haL()}function DS0(){let H=oA();if(H!=="linux"&&H!=="wsl")return[];try{let $=VL();if(!$?.sandbox?.enabled)return[];let A=$?.permissions||{},L=[],I=(D)=>{let B=D.replace(/\/\*\*$/,"");return/[*?[\]]/.test(B)};for(let D of[...A.allow||[],...A.deny||[]]){let B=D5H(D);if((B.toolName===TB||B.toolName===$B)&&B.ruleContent&&I(B.ruleContent))L.push(D)}return L}catch($){return N(`Failed to get Linux glob pattern warnings: ${$}`),[]}}function BS0(){let H=["flagSettings","policySettings"];for(let $ of H){let A=ZI($);if(A?.sandbox?.enabled!==void 0||A?.sandbox?.autoAllowBashIfSandboxed!==void 0||A?.sandbox?.allowUnsandboxedCommands!==void 0)return!0}return!1}async function fS0(H){let $=ZI("localSettings");II("localSettings",{sandbox:{...$?.sandbox,...H.enabled!==void 0&&{enabled:H.enabled},...H.autoAllowBashIfSandboxed!==void 0&&{autoAllowBashIfSandboxed:H.autoAllowBashIfSandboxed},...H.allowUnsandboxedCommands!==void 0&&{allowUnsandboxedCommands:H.allowUnsandboxedCommands}}})}function ES0(){return VL()?.sandbox?.excludedCommands??[]}async function MS0(H,$,A,L){if(J9$())if(En)await En;else throw Error("Sandbox failed to initialize. ");return Z5.wrapWithSandbox(H,$,A,L)}async function GS0(H){if(En)return En;if(!J9$())return;let $=VL(),A=_DA($);return En=(async()=>{try{await Z5.initialize(A,H),YDA=AF.subscribe(()=>{let L=VL(),I=_DA(L);Z5.updateConfig(I),N("Sandbox configuration updated from settings change")})}catch(L){En=void 0,N(`Failed to initialize sandbox: ${L instanceof Error?L.message:String(L)}`)}})(),En}function US0(){if(!J9$())return;let H=VL(),$=_DA(H);Z5.updateConfig($)}async function XS0(){return YDA?.(),YDA=void 0,vaL.cache.clear?.(),baL.cache.clear?.(),kaL.cache.clear?.(),uaL.cache.clear?.(),CDA.cache.clear?.(),wDA.cache.clear?.(),En=void 0,Z5.reset()}function maL(H,$){let A=ZI("localSettings"),L=A?.sandbox?.excludedCommands||[],I=H;if($){let D=$.filter((B)=>B.type==="addRules"&&B.rules.some((f)=>f.toolName===WD));if(D.length>0&&D[0].type==="addRules"){let B=D[0].rules.find((f)=>f.toolName===WD);if(B?.ruleContent)I=AS0(B.ruleContent)||B.ruleContent}}if(!L.includes(I))II("localSettings",{sandbox:{...A?.sandbox,excludedCommands:[...L,I]}});return I}var B5H,X9$,En,YDA,CDA,vaL,baL,kaL,wDA,uaL,vL;var EM=K(()=>{SaL();Z9();mL();W4();g$();E$();gk();wiH();tG();CR();BM();B5H=require("path"),X9$=require("fs");CDA=o$(()=>{let{rgPath:H,rgArgs:$}=eMH();return Z5.checkDependencies({command:H,args:$})}),vaL=o$((H)=>{return H?.sandbox?.enabled??!1});baL=o$((H)=>{return H?.sandbox?.autoAllowBashIfSandboxed??!0});kaL=o$((H)=>{return H?.sandbox?.allowUnsandboxedCommands??!0});wDA=o$(()=>{return Z5.isSupportedPlatform()}),uaL=o$((H)=>{let $=H?.sandbox?.enabledPlatforms;if($===void 0)return!0;if($.length===0)return!1;let A=oA();return $.includes(A)});vL={initialize:GS0,isSandboxingEnabled:J9$,isSandboxEnabledInSettings:haL,isPlatformInEnabledList:gaL,isAutoAllowBashIfSandboxedEnabled:LS0,areUnsandboxedCommandsAllowed:IS0,areSandboxSettingsLockedByPolicy:BS0,setSandboxSettings:fS0,getExcludedCommands:ES0,wrapWithSandbox:MS0,refreshConfig:US0,reset:XS0,checkDependencies:CDA,getFsReadConfig:Z5.getFsReadConfig,getFsWriteConfig:Z5.getFsWriteConfig,getNetworkRestrictionConfig:Z5.getNetworkRestrictionConfig,getIgnoreViolations:Z5.getIgnoreViolations,getLinuxGlobPatternWarnings:DS0,isSupportedPlatform:wDA,getAllowUnixSockets:Z5.getAllowUnixSockets,getAllowLocalBinding:Z5.getAllowLocalBinding,getEnableWeakerNestedSandbox:Z5.getEnableWeakerNestedSandbox,getProxyPort:Z5.getProxyPort,getSocksProxyPort:Z5.getSocksProxyPort,getLinuxHttpSocketPath:Z5.getLinuxHttpSocketPath,getLinuxSocksSocketPath:Z5.getLinuxSocksSocketPath,waitForNetworkInitialization:Z5.waitForNetworkInitialization,getSandboxViolationStore:Z5.getSandboxViolationStore,annotateStderrWithSandboxFailures:Z5.annotateStderrWithSandboxFailures}});var saL=z((n9)=>{var TDA=Symbol.for("react.transitional.element"),JS0=Symbol.for("react.portal"),FS0=Symbol.for("react.fragment"),KS0=Symbol.for("react.strict_mode"),QS0=Symbol.for("react.profiler"),WS0=Symbol.for("react.consumer"),VS0=Symbol.for("react.context"),PS0=Symbol.for("react.forward_ref"),_S0=Symbol.for("react.suspense"),YS0=Symbol.for("react.memo"),iaL=Symbol.for("react.lazy"),CS0=Symbol.for("react.activity"),paL=Symbol.iterator;function wS0(H){if(H===null||typeof H!=="object")return null;return H=paL&&H[paL]||H["@@iterator"],typeof H==="function"?H:null}var naL={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},raL=Object.assign,aaL={};function E5H(H,$,A){this.props=H,this.context=$,this.refs=aaL,this.updater=A||naL}E5H.prototype.isReactComponent={};E5H.prototype.setState=function(H,$){if(typeof H!=="object"&&typeof H!=="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,$,"setState")};E5H.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function oaL(){}oaL.prototype=E5H.prototype;function zDA(H,$,A){this.props=H,this.context=$,this.refs=aaL,this.updater=A||naL}var NDA=zDA.prototype=new oaL;NDA.constructor=zDA;raL(NDA,E5H.prototype);NDA.isPureReactComponent=!0;var daL=Array.isArray;function qDA(){}var bU={H:null,A:null,T:null,S:null},taL=Object.prototype.hasOwnProperty;function ODA(H,$,A){var L=A.ref;return{$$typeof:TDA,type:H,key:$,ref:L!==void 0?L:null,props:A}}function ZS0(H,$){return ODA(H.type,$,H.props)}function xDA(H){return typeof H==="object"&&H!==null&&H.$$typeof===TDA}function qS0(H){var $={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(A){return $[A]})}var caL=/\/+/g;function ZDA(H,$){return typeof H==="object"&&H!==null&&H.key!=null?qS0(""+H.key):$.toString(36)}function TS0(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status==="string"?H.then(qDA,qDA):(H.status="pending",H.then(function($){H.status==="pending"&&(H.status="fulfilled",H.value=$)},function($){H.status==="pending"&&(H.status="rejected",H.reason=$)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function f5H(H,$,A,L,I){var D=typeof H;if(D==="undefined"||D==="boolean")H=null;var B=!1;if(H===null)B=!0;else switch(D){case"bigint":case"string":case"number":B=!0;break;case"object":switch(H.$$typeof){case TDA:case JS0:B=!0;break;case iaL:return B=H._init,f5H(B(H._payload),$,A,L,I)}}if(B)return I=I(H),B=L===""?"."+ZDA(H,0):L,daL(I)?(A="",B!=null&&(A=B.replace(caL,"$&/")+"/"),f5H(I,$,A,"",function(M){return M})):I!=null&&(xDA(I)&&(I=ZS0(I,A+(I.key==null||H&&H.key===I.key?"":(""+I.key).replace(caL,"$&/")+"/")+B)),$.push(I)),1;B=0;var f=L===""?".":L+":";if(daL(H))for(var E=0;E{eaL.exports=saL()});var af="Glob",SDA=`- Fast file pattern matching tool that works with any codebase size `}var v2="WebSearch";var Mn=()=>{};function IoL(H){let{hasThinking:$=!1}=H??{},A=[];if($&&NL("tengu_marble_anvil",!1))A.push({type:"clear_thinking_20251015",keep:"all"});return A.length>0?{edits:A}:void 0}var AoL=180000,LoL=40000,xS0,SS0;var DoL=K(()=>{NA();SD();vV();tG();GK();Mn();xS0=[WD,af,s8,$B,w4,v2],SS0=[TB,U1,aW]});function cD(){return NL("tengu_penguins_enabled",!0)}function WO(){let H=NL("tengu_penguin_mode_promo",{discountPercent:50,endDate:"Feb 16"});if(!H||H.discountPercent===0)return null;return H}function Z4(){if(!cD())return!1;return W9$()===null}function jS0(H,$){switch(H){case"free":return $==="oauth"?"Fast mode requires a paid subscription":"Fast mode unavailable during evaluation. Please purchase credits.";case"preference":return"Fast mode has been disabled by your organization";case"extra_usage_disabled":return"Fast mode requires extra usage billing \xB7 /extra-usage to enable"}}function W9$(){if(!cD())return"Fast mode is not available";if(!U8())return"Fast mode requires the native binary \xB7 Install from: https://claude.com/product/claude-code";let H=NL("tengu_penguins_off",null);if(H!==null)return N(`Fast mode unavailable: ${H}`),H;if(tI()&&uYH())return N("Fast mode unavailable: Fast mode is not available in the Agent SDK"),"Fast mode is not available in the Agent SDK";if(sI()!=="firstParty")return N("Fast mode unavailable: Fast mode is not available on Bedrock, Vertex, or Foundry"),"Fast mode is not available on Bedrock, Vertex, or Foundry";if(X5H){let $=dD()!==null?"oauth":"api-key",A=jS0(X5H,$);return N(`Fast mode unavailable: ${A}`),A}return null}function foL(H){if(!cD())return!1;if(!Z4())return!1;if(!UK(H))return!1;return GB().fastMode===!0}function UK(H){if(!cD())return!1;let $=H??J5H();return m8($).toLowerCase().includes("opus-4-6")}function EoL(H){return K9$.add(H),()=>{K9$.delete(H)}}function hDA(){if(G5H.status==="cooldown"&&Date.now()>=G5H.resetAt){if(cD()&&!RDA){N("Fast mode cooldown expired, re-enabling fast mode"),RDA=!0;for(let H of K9$)H.onCooldownExpired()}G5H={status:"active"}}return G5H}function MoL(H){if(!cD())return;G5H={status:"cooldown",resetAt:H},RDA=!1;let $=H-Date.now();N(`Fast mode cooldown triggered, duration ${Math.round($/1000)}s`),c("tengu_fast_mode_fallback_triggered",{cooldown_duration_ms:$});for(let A of K9$)A.onCooldownTriggered(H)}function eAH(){G5H={status:"active"}}function GoL(){if(U5H===!1)return;U5H=!1,X5H="preference",II("userSettings",{fastMode:void 0}),AA((H)=>({...H,penguinModeOrgEnabled:!1}));for(let H of Q9$)H(!1)}function UoL(H){return yDA.add(H),()=>{yDA.delete(H)}}function RS0(H){switch(H){case"out_of_credits":return"Fast mode disabled \xB7 extra usage credits exhausted";case"org_level_disabled":case"org_service_level_disabled":return"Fast mode disabled \xB7 extra usage disabled by your organization";case"org_level_disabled_until":return"Fast mode disabled \xB7 extra usage temporarily unavailable";case"member_level_disabled":return"Fast mode disabled \xB7 extra usage disabled for your account";case"seat_tier_level_disabled":case"seat_tier_zero_credit_limit":case"member_zero_credit_limit":return"Fast mode disabled \xB7 extra usage not available for your plan";case"overage_not_provisioned":case"no_limits_configured":return"Fast mode requires extra usage billing \xB7 /extra-usage to enable";default:return"Fast mode disabled \xB7 extra usage not available"}}function XoL(H){let $=RS0(H);N(`Fast mode overage rejection: ${H??"unknown"} \u2014 ${$}`),c("tengu_fast_mode_overage_rejected",{overage_disabled_reason:H??"unknown"}),II("userSettings",{fastMode:void 0}),AA((A)=>({...A,penguinModeOrgEnabled:!1}));for(let A of yDA)A($)}function zq(){return hDA().status==="cooldown"}function JoL(H){return Q9$.add(H),()=>{Q9$.delete(H)}}async function yS0(H){let $=`${XD().BASE_API_URL}/api/claude_code_penguin_mode`,A="accessToken"in H?{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}:{"x-api-key":H.apiKey};return(await nA.get($,{headers:A})).data}async function V9$(){if(!cD())return;let H=Date.now();if(H-BoL({...B,penguinModeOrgEnabled:I.enabled}));for(let B of Q9$)B(I.enabled)}N(`Org penguin mode: ${I.enabled?"enabled":`disabled (${X5H??"unknown"})`}`)}catch{U5H=!1,X5H=null,N(`Failed to fetch org penguin mode status, defaulting to ${U5H?"enabled":"disabled"}`),c("tengu_org_penguin_mode_fetch_failed",{})}}var YzH="opus",VO="Opus 4.6",vDA="Billed at a premium rate",G5H,RDA=!1,K9$,yDA,U5H,X5H=null,Q9$,vS0=30000,BoL=0;var AJ=K(()=>{w1();mL();z$();E$();g$();EI();oM();aI();SD();qE();vA();G5H={status:"active"},K9$=new Set;yDA=new Set;Q9$=new Set});function PO(){if(!bDA)bDA=new Intl.Segmenter(void 0,{granularity:"grapheme"});return bDA}function KoL(){if(!kDA)kDA=new Intl.Segmenter(void 0,{granularity:"word"});return kDA}function gDA(H,$){let A=`${H}:${$}`,L=FoL.get(A);if(!L)L=new Intl.RelativeTimeFormat("en",{style:H,numeric:$}),FoL.set(A,L);return L}function mDA(){if(!uDA)uDA=Intl.DateTimeFormat().resolvedOptions().timeZone;return uDA}var bDA=null,kDA=null,FoL,uDA=null;var F5H=K(()=>{FoL=new Map});function QoL(H,$){if(H.length<=$)return H;if($<=0)return"\u2026";if($<5)return H.slice(0,$-1)+"\u2026";let A=H.lastIndexOf("/"),L=A>=0?H.slice(A):H,I=A>=0?H.slice(0,A):"";if(L.length>=$-1)return"\u2026"+H.slice(-($-1));let D=$-1-L.length;if(D<=0)return"\u2026"+L.slice(-($-1));return I.slice(0,D)+"\u2026"+L}function e8(H,$,A=!1){let L=H;if(A){let I=H.indexOf(` `);lDA(H?.())};return process.on("exit",$),()=>{process.off("exit",$)}},[])}function uS0(H,$){return Math.round(H*$)/$}function _9$(H,$,A){uS$(H,$,A);let L=cD()&&$.speed?{model:A,speed:$.speed}:{model:A};tS$()?.add(H,L),UEH()?.add($.input_tokens,{...L,type:"input"}),UEH()?.add($.output_tokens,{...L,type:"output"}),UEH()?.add($.cache_read_input_tokens??0,{...L,type:"cacheRead"}),UEH()?.add($.cache_creation_input_tokens??0,{...L,type:"cacheCreation"})}var VoL;var Nq=K(()=>{r0();AJ();Q9();aI();vA();g$();g$();g$();nC();g$();VoL=b(s(),1)});function ALH(H,$){if(cD()&&$){let A=H?rDA:nDA,L=WO();if(L)return cS0(A,L.discountPercent);return A}return H?gS0:Q5H}function mS0(H,$){return $.input_tokens/1e6*H.inputTokens+$.output_tokens/1e6*H.outputTokens+($.cache_read_input_tokens??0)/1e6*H.promptCacheReadTokens+($.cache_creation_input_tokens??0)/1e6*H.promptCacheWriteTokens+($.server_tool_use?.web_search_requests??0)*H.webSearchRequests}function pS0(H){return H.input_tokens+(H.cache_read_input_tokens??0)+(H.cache_creation_input_tokens??0)}function dS0(H,$){let A=JK(H),L=w9$[A];if(L===$LH&&pS0($)>200000)return aDA;if(!L)return c("tengu_unknown_model_cost",{model:H,shortName:A}),ulH(),w9$[JK(YoL)];return L}function Z9$(H,$){let A=dS0(H,$);return mS0(A,$)}function _oL(H){if(Number.isInteger(H))return`$${H}`;return`$${H.toFixed(2)}`}function o_(H){return`${_oL(H.inputTokens)}/${_oL(H.outputTokens)} per Mtok`}function cS0(H,$){let A=(100-$)/100;return{inputTokens:H.inputTokens*A,outputTokens:H.outputTokens*A,promptCacheWriteTokens:H.promptCacheWriteTokens*A,promptCacheReadTokens:H.promptCacheReadTokens*A,webSearchRequests:H.webSearchRequests}}var $LH,C9$,Q5H,gS0,nDA,rDA,aDA,oDA,tDA,w9$;var W5H=K(()=>{Nq();z$();AJ();$4H();aI();$LH={inputTokens:3,outputTokens:15,promptCacheWriteTokens:3.75,promptCacheReadTokens:0.3,webSearchRequests:0.01},C9$={inputTokens:15,outputTokens:75,promptCacheWriteTokens:18.75,promptCacheReadTokens:1.5,webSearchRequests:0.01},Q5H={inputTokens:5,outputTokens:25,promptCacheWriteTokens:6.25,promptCacheReadTokens:0.5,webSearchRequests:0.01},gS0={inputTokens:10,outputTokens:37.5,promptCacheWriteTokens:12.5,promptCacheReadTokens:1,webSearchRequests:0.01},nDA={inputTokens:30,outputTokens:150,promptCacheWriteTokens:37.5,promptCacheReadTokens:3,webSearchRequests:0.01},rDA={inputTokens:60,outputTokens:225,promptCacheWriteTokens:75,promptCacheReadTokens:6,webSearchRequests:0.01},aDA={inputTokens:6,outputTokens:22.5,promptCacheWriteTokens:7.5,promptCacheReadTokens:0.6,webSearchRequests:0.01},oDA={inputTokens:0.8,outputTokens:4,promptCacheWriteTokens:1,promptCacheReadTokens:0.08,webSearchRequests:0.01},tDA={inputTokens:1,outputTokens:5,promptCacheWriteTokens:1.25,promptCacheReadTokens:0.1,webSearchRequests:0.01};w9$={[JK(WqH.firstParty)]:oDA,[JK(VqH.firstParty)]:tDA,[JK(QqH.firstParty)]:$LH,[JK(KqH.firstParty)]:$LH,[JK(CAH.firstParty)]:$LH,[JK(PqH.firstParty)]:Q5H,[JK(_qH.firstParty)]:C9$,[JK(YqH.firstParty)]:C9$,[JK(CqH.firstParty)]:Q5H,[JK(wAH.firstParty)]:Q5H}});function Gn(){let H=process.env.CLAUDE_AGENT_SDK_VERSION?`, agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`:"";return`claude-cli/${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} (external, ${process.env.CLAUDE_CODE_ENTRYPOINT}${H})`}function Un(){return`claude-code/${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}`}function sG(){return`claude-code/${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}`}function eG(){if(nL()){let $=dD();if(!$?.accessToken)return{headers:{},error:"No OAuth token available"};return{headers:{Authorization:`Bearer ${$.accessToken}`,"anthropic-beta":N_}}}let H=eZ();if(!H)return{headers:{},error:"No API key available"};return{headers:{"x-api-key":H}}}var _Q=K(()=>{EI();qE()});async function iS0(){let H=T9()?.organizationUuid;if(!H)throw Error("No organization ID available");let $=eG();if($.error)throw Error(`Auth error: ${$.error}`);let A={"Content-Type":"application/json","User-Agent":sG(),...$.headers};try{let L=`https://api.anthropic.com/api/organization/${H}/claude_code_sonnet_1m_access`,I=await nA.get(L,{headers:A,timeout:5000});return{hasAccess:I.data.has_access,hasAccessNotAsDefault:I.data.has_access_not_as_default,hasError:!1}}catch(L){return r(L),{hasAccess:!1,hasError:!0}}}async function rS0(){try{return await nS0()}catch(H){return N("Sonnet-1M access check failed, defaulting to no access"),{hasAccess:!1,hasError:!0}}}function LLH(){let H=T9()?.organizationUuid;if(!H)return{hasAccess:!1,wasPartOfDefaultRollout:!1,needsRefresh:!1};let $=M$(),A=(nL()?$.s1mAccessCache:$.s1mNonSubscriberAccessCache)?.[H],L=Date.now();if(!A)return{hasAccess:!1,wasPartOfDefaultRollout:!1,needsRefresh:!0};let{hasAccess:I,hasAccessNotAsDefault:D,timestamp:B}=A,f=L-B>aS0;return{hasAccess:I||(D??!1),wasPartOfDefaultRollout:I,needsRefresh:f}}async function CoL(){let{needsRefresh:H}=LLH();if(H)oS0()}async function oS0(){let H=T9()?.organizationUuid;if(!H)return;if(!nL()){let $=await WeH();if(!$)return;let{uuid:A,rate_limit_tier:L}=$.organization,I={hasAccess:L==="auto_prepaid_tier_3"||L==="manual_tier_3",timestamp:Date.now()};AA((D)=>({...D,s1mNonSubscriberAccessCache:{...D.s1mNonSubscriberAccessCache,[A]:I}}));return}try{let{hasAccess:$,hasAccessNotAsDefault:A}=await rS0(),L={hasAccess:$,hasAccessNotAsDefault:A,timestamp:Date.now()};AA((I)=>({...I,s1mAccessCache:{...I.s1mAccessCache,[H]:L}}))}catch($){N("Failed to fetch and cache Sonnet-1M access"),r($)}}var lS0=3600000,nS0,aS0=3600000;var q9$=K(()=>{w1();wwH();_Q();E$();_$();vA();EI();zwH();nS0=zGH(iS0,lS0)});function T9$(){if(NL("tengu_marble_lantern_disabled",!1))return{hasAccess:!1};return{hasAccess:!nL()}}var woL=K(()=>{SD();EI()});var Zf,qzH="\u273B",Ey="\u21AF";var p6=K(()=>{Z1();Zf=OA.platform==="darwin"?"\u23FA":"\u25CF"});function z9$(){return"inherit"}function LJ(){return process.env.ANTHROPIC_SMALL_FAST_MODEL||eDA()}function _5H(H){return H===aG().opus40||H===aG().opus41||H===aG().opus45||H===aG().opus46}function N9$(H){return H.includes("opus")}function O9$(){let H,$=C_();if($!==void 0)H=$;else{let A=VL()||{};H=process.env.ANTHROPIC_MODEL||A.model||void 0}if(nL()&&!Wq()&&H&&N9$(H))return;return H}function DLH(H={}){let $=O9$();if($!==null&&$!==void 0)return $;let{forDisplay:A=!1}=H;return NoL(A)}function X1(){let H=DLH();if(H!==void 0&&H!==null)return m8(H);return xq()}function Oq(){if(process.env.ANTHROPIC_DEFAULT_SONNET_MODEL)return process.env.ANTHROPIC_DEFAULT_SONNET_MODEL;return aG().sonnet45}function TzH(){return f0()==="max"}function zzH(){return f0()==="team"}function NzH(){return f0()==="pro"}function My(){if(process.env.ANTHROPIC_DEFAULT_OPUS_MODEL)return process.env.ANTHROPIC_DEFAULT_OPUS_MODEL;if(sI()==="firstParty")return aG().opus46;return aG().opus41}function sS0(){return My()}function eDA(){if(process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL)return process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL;return aG().haiku45}function BLH(H){let{permissionMode:$,mainLoopModel:A,exceeds200kTokens:L=!1}=H;if(DLH()==="opusplan"&&$==="plan"&&!L)return My();if(DLH()==="haiku"&&$==="plan")return Oq();return A}function ToL(){return null}function zoL(H){return}function NoL(H){let $=eS0();if($!==null&&$.name)return H?$.displayName??$.name:$.name;return}function J5H(H={}){let{forDisplay:$=!1}=H,A=NoL($);if(A!==void 0)return A;if(TzH()||zzH()||NzH())return My();return Oq()}function xq(H={}){return m8(J5H(H))}function JK(H){if(H.includes("claude-opus-4-6"))return"claude-opus-4-6";if(H.includes("claude-opus-4-5"))return"claude-opus-4-5";if(H.includes("claude-opus-4-1"))return"claude-opus-4-1";if(H.includes("claude-opus-4"))return"claude-opus-4";if(H.includes("claude-sonnet-4-5"))return"claude-sonnet-4-5";if(H.includes("claude-sonnet-4"))return"claude-sonnet-4";if(H.includes("claude-haiku-4-5"))return"claude-haiku-4-5";let $=H.match(/(claude-(\d+-\d+-)?\w+)/);if($&&$[1])return $[1];return H}async function OoL(){try{if(M$().claudeCodeFirstTokenDate!==void 0)return;let $=eG();if($.error){r(Error(`Failed to get auth headers: ${$.error}`));return}let L=`${XD().BASE_API_URL}/api/organization/claude_code_first_token_date`,D=(await nA.get(L,{headers:{...$.headers,"User-Agent":sG()}})).data?.first_token_date??null;if(D!==null){let B=new Date(D).getTime();if(isNaN(B)){r(Error(`Received invalid first_token_date from API: ${D}`));return}}AA((B)=>({...B,claudeCodeFirstTokenDate:D}))}catch(H){r(H instanceof Error?H:Error(String(H)))}}function x9$(H=!1){if(TzH()||zzH()||NzH())return`Opus 4.6 \xB7 Most capable for complex work${$BA(!1,H)}`;return"Sonnet 4.5 \xB7 Best for everyday tasks"}function Hj0(H){if(H==="opusplan")return"Opus 4.6 in plan mode, else Sonnet 4.5";return hV(m8(H))}function xoL(H){if(H==="opusplan")return"Opus Plan";if(ABA(H))return H.charAt(0).toUpperCase()+H.slice(1);return hV(H)}function S9$(H){switch(H){case aG().opus46:return"Opus 4.6";case aG().opus46+"[1m]":return"Opus 4.6 (1M context)";case aG().opus45:return"Opus 4.5";case aG().opus41:return"Opus 4.1";case aG().opus40:return"Opus 4";case aG().sonnet45+"[1m]":return"Sonnet 4.5 (1M context)";case aG().sonnet45:return"Sonnet 4.5";case aG().sonnet40:return"Sonnet 4";case aG().sonnet40+"[1m]":return"Sonnet 4 (1M context)";case aG().sonnet37:return"Sonnet 3.7";case aG().sonnet35:return"Sonnet 3.5";case aG().haiku45:return"Haiku 4.5";case aG().haiku35:return"Haiku 3.5";default:return null}}function hV(H){let $=S9$(H);if($)return $;return H}function SoL(H){let $=S9$(H);if($)return`Claude ${$}`;return`Claude (${H})`}function ILH(H=!1){if(nL()){if(!Wq())return{value:null,label:"Sonnet",description:HBA().description};return{value:null,label:"Default (recommended)",description:x9$(H)}}let $=sI()!=="firstParty";return{value:null,label:"Default (recommended)",description:`Use the default model (currently ${Hj0(J5H({forDisplay:!0}))})${$?"":` \xB7 ${o_($LH)}`}`}}function HBA(){return{value:"sonnet",label:"Sonnet",description:`Sonnet 4.5 \xB7 Best for everyday tasks${sI()!=="firstParty"?"":` \xB7 ${o_($LH)}`}`,descriptionForModel:"Sonnet 4.5 - best for everyday tasks. Generally recommended for most coding tasks"}}function $BA(H,$){if(!$)return"";let A=o_(ALH(H,!0)),L=WO(),I=L?` (${L.discountPercent}% off)`:"";return` \xB7 (${Ey}) ${A}${I}`}function RoL(){return{value:"sonnet[1m]",label:"Sonnet (1M context)",description:`Sonnet 4.5 for long sessions${sI()!=="firstParty"?"":` \xB7 ${o_(aDA)}`}`,descriptionForModel:"Sonnet 4.5 with 1M context window - for long sessions with large codebases"}}function yoL(H=!1){let $=sI()!=="firstParty",A=H&&!$?` (${Ey})`:"",L=H&&!$?WO():null,I=L?` (${L.discountPercent}% off)`:"";return{value:$?"claude-opus-4-6[1m]":"opus[1m]",label:"Opus (1M context)",description:`Opus 4.6 for long sessions${$?"":` \xB7${A} ${o_(ALH(!0,H))}${I}`}`,descriptionForModel:"Opus 4.6 with 1M context window - for long sessions with large codebases"}}function voL(){return{value:"haiku",label:"Haiku",description:`Haiku 4.5 \xB7 Fastest for quick answers${sI()!=="firstParty"?"":` \xB7 ${o_(tDA)}`}`,descriptionForModel:"Haiku 4.5 - fastest for quick answers. Lower cost but less capable than Sonnet 4.5."}}function Aj0(){return{value:"haiku",label:"Haiku",description:`Haiku 3.5 for simple tasks${sI()!=="firstParty"?"":` \xB7 ${o_(oDA)}`}`,descriptionForModel:"Haiku 3.5 - faster and lower cost, but less capable than Sonnet. Use for simple tasks."}}function Lj0(){return eDA()===aG().haiku45?voL():Aj0()}function Ij0(H=!1){return{value:"opus",label:"Opus",description:`Opus 4.6 \xB7 Most capable for complex work${$BA(!1,H)}`}}function qoL(H=!1){return{value:"opus[1m]",label:"Opus (1M context)",description:`Opus 4.6 with 1M context \xB7 Uses rate limits faster${$BA(!0,H)}`}}function fj0(H=!1){if(nL()){if(!Wq())return[ILH(),sDA];if(TzH()||zzH()||NzH()){let L=[ILH(H)];if(T9$().hasAccess)L.push(qoL(H));if(L.push(Dj0),LLH().hasAccess)L.push(ZoL);return L.push(sDA),L}let A=[ILH(),Ij0(H)];if(T9$().hasAccess)A.push(qoL(H));if(LLH().hasAccess)A.push(ZoL);return A.push(sDA),A}let $=[ILH(),joL(H)];if(sI()!=="firstParty")$.push($j0());if(T9$().hasAccess)$.push(yoL(H));if(LLH().hasAccess)$.push(RoL());return $.push(voL()),$}function fLH(H=!1){let $=fj0(H),A=null,L=O9$(),I=RYH();if(L!==void 0&&L!==null)A=L;else if(I!==null)A=I;if(A===null||$.some((D)=>D.value===A))return $;if(A==="opusplan")return[...$,Bj0()];if(!nL()&&ABA(A))if(A==="sonnet")$.push(HBA());else if(A==="sonnet[1m]")$.push(RoL());else if(A==="opus[1m]")$.push(yoL(H));else if(A==="opus")$.push(joL(H));else if(A==="haiku")$.push(Lj0());else $.push({value:A,label:A,description:"Custom model"});else $.push({value:A,label:A,description:"Custom model"});return $}function ABA(H){return V5H.includes(H)}function m8(H){let $=H.trim(),A=$.toLowerCase(),L=A.endsWith("[1m]"),I=L?A.replace(/\[1m]$/i,"").trim():A;if(ABA(I))switch(I){case"opusplan":return Oq()+(L?"[1m]":"");case"sonnet":return Oq()+(L?"[1m]":"");case"haiku":return eDA()+(L?"[1m]":"");case"opus":return My()+(L?"[1m]":"");case"best":return sS0();default:}if(L)return $.replace(/\[1m\]$/i,"").trim()+"[1m]";return $}function _O(H){if(H===null){if(nL()&&!Wq())return`Sonnet (${HBA().description})`;else if(nL())return`Default (${x9$()})`;return`Default (${xq({forDisplay:!0})})`}let $=m8(H);return H===$?$:`${H} (${$})`}function j9$(H,$,A,L,I){if(process.env.CLAUDE_CODE_SUBAGENT_MODEL)return m8(process.env.CLAUDE_CODE_SUBAGENT_MODEL);let D=l$A($),B=(E)=>{if(D&&sI()==="bedrock")return ngL(E,D);return E};if(A)return B(m8(A));let f=H??z9$();if(!f)return B(m8(z9$()));if(f==="inherit")return BLH({permissionMode:L??"default",mainLoopModel:$,exceeds200kTokens:!1});return B(m8(f))}function R9$(H){if(!H)return"Inherit (default)";if(H==="inherit")return"Inherit from parent";return H.charAt(0).toUpperCase()+H.slice(1)}function hoL(){let H=[{value:"sonnet",label:"Sonnet",description:"Balanced performance - best for most agents"}];if(Wq())H.push({value:"opus",label:"Opus",description:"Most capable for complex reasoning tasks"});return H.push({value:"haiku",label:"Haiku",description:"Fast and efficient for simple tasks"},{value:"inherit",label:"Inherit from parent",description:"Use the same model as the main conversation"}),H}function vu(H){return H.replace(/\[(1|2)m\]/gi,"")}var V5H,tS0,YoL,P5H,eS0,joL=(H=!1)=>{let $=sI()!=="firstParty",A=$?"4.1":"4.6",L=$?C9$:ALH(!1,H),I=$?"Legacy":"Most capable for complex work",D=H&&!$?` (${Ey})`:"",B=H&&!$?WO():null,f=B?` (${B.discountPercent}% off)`:"";return{value:"opus",label:$?"Opus 4.1":"Opus",description:`Opus ${A} \xB7 ${I}${$?"":` \xB7${D} ${o_(L)}${f}`}`,descriptionForModel:$?"Opus 4.1 - legacy version":"Opus 4.6 - most capable for complex work"}},$j0=()=>{let H=sI()!=="firstParty";return{value:aG().opus46,label:"Opus 4.6",description:`Opus 4.6 \xB7 Most capable for complex work${H?"":` \xB7 ${o_(Q5H)}`}`,descriptionForModel:"Opus 4.6 - most capable for complex work"}},ZoL,Dj0,sDA,Bj0=()=>{return{value:"opusplan",label:"Opus Plan Mode",description:"Use Opus 4.6 in plan mode, Sonnet 4.5 otherwise"}};var aI=K(()=>{tD();vA();g$();EI();$4H();ND$();W5H();AJ();mL();ELH();w1();qE();_$();_Q();q9$();woL();oM();FqH();SD();p6();V5H=["sonnet","opus","haiku","best","sonnet[1m]","opus[1m]","opusplan"],tS0=CAH,YoL=tS0.firstParty,P5H=[...V5H,"inherit"];eS0=o$(()=>{return null});ZoL={value:"sonnet[1m]",label:"Sonnet (1M context)",description:"Sonnet 4.5 with 1M context \xB7 Uses rate limits faster"};Dj0={value:"sonnet",label:"Sonnet",description:"Sonnet 4.5 \xB7 Best for everyday tasks"},sDA={value:"haiku",label:"Haiku",description:"Haiku 4.5 \xB7 Fastest for quick answers"}});function v9$(H){if(sI()==="vertex")return LBA;if(H?.isNonInteractive){if(H.hasAppendSystemPrompt)return boL;return koL}return LBA}function Mj0(){if(BE(process.env.CLAUDE_CODE_ATTRIBUTION_HEADER))return!1;return NL("tengu_attribution_header",!0)}function h9$(H){if(!Mj0())return"";let $=`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}.${H}`,A=process.env.CLAUDE_CODE_ENTRYPOINT??"unknown",I=`x-anthropic-billing-header: cc_version=${$}; cc_entrypoint=${A};${" cch=00000;"}`;return N(`attribution header ${I}`),I}var LBA="You are Claude Code, Anthropic's official CLI for Claude.",boL="You are Claude Code, Anthropic's official CLI for Claude, running within the Claude Agent SDK.",koL="You are a Claude agent, built on Anthropic's Claude Agent SDK.",Ej0,y9$;var b9$=K(()=>{oM();E$();SD();NA();Ej0=[LBA,boL,koL],y9$=new Set(Ej0)});function Uj0(H){let $=H.find((L)=>L.type==="user");if(!$)return"";let A=$.message.content;if(typeof A==="string")return A;if(Array.isArray(A)){let L=A.find((I)=>I.type==="text");if(L&&L.type==="text")return L.text}return""}function IBA(H,$){let L=[4,7,20].map((B)=>H[B]||"0").join(""),I=`${Gj0}${L}${$}`;return uoL.createHash("sha256").update(I).digest("hex").slice(0,3)}function goL(H){let $=Uj0(H);return IBA($,{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)}var uoL,Gj0="59cf53e54c78";var DBA=K(()=>{uoL=require("crypto")});var moL,poL="Update the todo list for the current session. To be used proactively and often to track progress and pending tasks. Make sure that at least one task is in_progress at all times. Always provide both content (imperative) and activeForm (present continuous) for each task.";var doL=K(()=>{moL=`Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user. `)I+=E,D=0;else I+=E,D+=GI(E)}return I}var ej0=8;var FsL=K(()=>{DJ();f1$()});var Yn,j5H;var cBA=K(()=>{Yn=new WeakMap,j5H=new WeakMap});var HR0,KsL;var QsL=K(()=>{HR0=(()=>{var H="file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js";return function($){$=$||{};var A;A||(A=typeof $<"u"?$:{});var L,I;A.ready=new Promise(function(RH,kH){L=RH,I=kH});var D=Object.assign({},A),B="";typeof document<"u"&&document.currentScript&&(B=document.currentScript.src),H&&(B=H),B.indexOf("blob:")!==0?B=B.substr(0,B.replace(/[?#].*/,"").lastIndexOf("/")+1):B="";var f=A.print||console.log.bind(console),E=A.printErr||console.warn.bind(console);Object.assign(A,D),D=null;var M;A.wasmBinary&&(M=A.wasmBinary);var G=A.noExitRuntime||!0;typeof WebAssembly!="object"&&GH("no native wasm support detected");var U,X=!1;function J(RH,kH,eH){eH=kH+eH;for(var W$="";!(kH>=eH);){var O$=RH[kH++];if(!O$)break;if(O$&128){var YA=RH[kH++]&63;if((O$&224)==192)W$+=String.fromCharCode((O$&31)<<6|YA);else{var aA=RH[kH++]&63;O$=(O$&240)==224?(O$&15)<<12|YA<<6|aA:(O$&7)<<18|YA<<12|aA<<6|RH[kH++]&63,65536>O$?W$+=String.fromCharCode(O$):(O$-=65536,W$+=String.fromCharCode(55296|O$>>10,56320|O$&1023))}}else W$+=String.fromCharCode(O$)}return W$}var F,Q,W,P,C,Y,Z,q,O;function j(){var RH=U.buffer;F=RH,A.HEAP8=Q=new Int8Array(RH),A.HEAP16=P=new Int16Array(RH),A.HEAP32=Y=new Int32Array(RH),A.HEAPU8=W=new Uint8Array(RH),A.HEAPU16=C=new Uint16Array(RH),A.HEAPU32=Z=new Uint32Array(RH),A.HEAPF32=q=new Float32Array(RH),A.HEAPF64=O=new Float64Array(RH)}var u,y=[],g=[],h=[];function p(){var RH=A.preRun.shift();y.unshift(RH)}var d=0,k=null,n=null;function GH(RH){if(A.onAbort)A.onAbort(RH);throw RH="Aborted("+RH+")",E(RH),X=!0,RH=new WebAssembly.RuntimeError(RH+". Build with -sASSERTIONS for more info."),I(RH),RH}function HH(RH){return RH.startsWith("data:application/octet-stream;base64,")}var BH="data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f38AYAJ+fwF/YAN/fX0BfWABfAF8YAN/fHwAYAR/f319AGAHf39/fX19fQF9YA1/fX99f31/fX19fX1/AX9gC39/f39/f399fX19AX9gCH9/f39/f319AGAEf39+fgBgB39/f39/f38Bf2ACfH8BfGAFf398fH8AYAN/f38BfGAEf39/fABgA39/fQBgBn9/fX99fwF/ArUBHgFhAWEAHwFhAWIAAwFhAWMACQFhAWQAFgFhAWUAEQFhAWYAIAFhAWcAAAFhAWgAIQFhAWkAAwFhAWoAAAFhAWsAFwFhAWwACgFhAW0ABQFhAW4AAwFhAW8AAQFhAXAAFwFhAXEABgFhAXIAAAFhAXMAIgFhAXQACgFhAXUADQFhAXYAFgFhAXcAAgFhAXgAAwFhAXkAGAFhAXoAAgFhAUEAAQFhAUIAEQFhAUMAAQFhAUQAAAOiAqACAgMSBwcACRkDAAoRBgYKEwAPDxMBBiMTCgcHGgMUASQFJRQHAwMKCgMmAQYYDxobFAAKBw8KBwMDAgkCAAAFGwACBwIHBgIDAQMIDAABKAkHBQURACkZASoAAAIrLAIALQcHBy4HLwkFCgMCMA0xAgMJAgACAQYKAQIBBQEACQIFAQEABQAODQ0GFQIBHBUGAgkCEAAAAAUyDzMMBQYINAUCAwUODg41AgMCAgIDBgICNgIBDAwMAQsLCwsLCx0CAAIAAAABABABBQICAQMCEgMMCwEBAQEBAQsLAQICAwICAgICAgIDAgIICAEICAgEBAQEBAQEBAQABAQABAQEBAAEBAQBAQEICAEBAQEBAQEBCAgBAQEAAg4CAgUBAR4DBAcBcAHUAdQBBQcBAYACgIACBg0CfwFBkMQEC38BQQALByQIAUUCAAFGAG0BRwCwAQFIAK8BAUkAYQFKAQABSwAjAUwApgEJjQMBAEEBC9MBqwGqAaUB5QHiAZwB0AFazwHOAVlZWpsBmgGZAc0BzAHLAcoBWpgByQFZWVqbAZoBmQHIAccBxgGjAZcBpAGWAaMBvQKVAbwCxQG7Ajq6Ajq5ApQBuAI+twI+xAFqwwFqwgFqaWjBAcABvwGhAZcBtgK+AbUClgGhAbQCmAGzAjqxAjqwAr0BrwKuAq0CrAKrAqoCqAKnAqYCpQKkAqMCogKhArwBoAKfAp4CnQKcApsCmgKZApgClwKWApUClAKTApICkQKQAo8CjgKyAo0CjAKLAooCiAKHAqkChQI+hAK7AYMCggKBAoAC/gH9AfwB+QG6AfgBuQH3AfYB9QH0AfMB8gHxAYYC8AHvAbgB+wH6Ae4B7QG3AesBlQHqATrpAT7oAT7nAZQB0QE67AE+iQLmATrkAeMBOuEB4AHfAT7eAd0B3AG2AdsB2gHZAdgB1wHWAdUBtQHUAdMB0gH/AWloaWiPAZABsgGxAZEBhQGSAbQBswGRAa4BrQGsAakBqAGnAYUBCtj+A6ACMwEBfyAAQQEgABshAAJAA0AgABBhIgENAUGIxAAoAgAiAQRAIAERCQAMAQsLEAIACyABC+0BAgJ9A39DAADAfyEEAkACQAJAAkAgAkEHcSIGDgUCAQEBAAELQQMhBQwBCyAGQQFrQQJPDQEgAkHw/wNxQQR2IQcCfSACQQhxBEAgASAHEJ4BvgwBC0EAIAdB/w9xIgFrIAEgAsFBAEgbsgshAyAGQQFGBEAgAyADXA0BQwAAwH8gAyADQwAAgH9bIANDAACA/1tyIgEbIQQgAUUhBQwBCyADIANcDQBBAEECIANDAACAf1sgA0MAAID/W3IiARshBUMAAMB/IAMgARshBAsgACAFOgAEIAAgBDgCAA8LQfQNQakYQTpB+RYQCwALZwIBfQF/QwAAwH8hAgJAAkACQCABQQdxDgQCAAABAAtBxBJBqRhByQBBuhIQCwALIAFB8P8DcUEEdiEDIAFBCHEEQCAAIAMQngG+DwtBACADQf8PcSIAayAAIAHBQQBIG7IhAgsgAgt4AgF/AX0jAEEQayIEJAAgBEEIaiAAQQMgAkECR0EBdCABQf4BcUECRxsgAhAoQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAAAgBSAFWxsLeAIBfwF9IwBBEGsiBCQAIARBCGogAEEBIAJBAkZBAXQgAUH+AXFBAkcbIAIQKEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAIAUgBVsbC8wCAQV/IAAEQCAAQQRrIgEoAgAiBSEDIAEhAiAAQQhrKAIAIgAgAEF+cSIERwRAIAEgBGsiAigCBCIAIAIoAgg2AgggAigCCCAANgIEIAQgBWohAwsgASAFaiIEKAIAIgEgASAEakEEaygCAEcEQCAEKAIEIgAgBCgCCDYCCCAEKAIIIAA2AgQgASADaiEDCyACIAM2AgAgA0F8cSACakEEayADQQFyNgIAIAICfyACKAIAQQhrIgFB/wBNBEAgAUEDdkEBawwBCyABQR0gAWciAGt2QQRzIABBAnRrQe4AaiABQf8fTQ0AGkE/IAFBHiAAa3ZBAnMgAEEBdGtBxwBqIgAgAEE/TxsLIgFBBHQiAEHgMmo2AgQgAiAAQegyaiIAKAIANgIIIAAgAjYCACACKAIIIAI2AgRB6DpB6DopAwBCASABrYaENwMACwsOAEHYMigCABEJABBYAAunAQIBfQJ/IABBFGoiByACIAFBAkkiCCAEIAUQNSEGAkAgByACIAggBCAFEC0iBEMAAAAAYCADIARecQ0AIAZDAAAAAGBFBEAgAyEEDAELIAYgAyADIAZdGyEECyAAQRRqIgAgASACIAUQOCAAIAEgAhAwkiAAIAEgAiAFEDcgACABIAIQL5KSIgMgBCADIAReGyADIAQgBCAEXBsgBCAEWyADIANbcRsLvwEBA38gAC0AAEEgcUUEQAJAIAEhAwJAIAIgACIBKAIQIgAEfyAABSABEJ0BDQEgASgCEAsgASgCFCIFa0sEQCABIAMgAiABKAIkEQYAGgwCCwJAIAEoAlBBAEgNACACIQADQCAAIgRFDQEgAyAEQQFrIgBqLQAAQQpHDQALIAEgAyAEIAEoAiQRBgAgBEkNASADIARqIQMgAiAEayECIAEoAhQhBQsgBSADIAIQKxogASABKAIUIAJqNgIUCwsLCwYAIAAQIwtQAAJAAkACQAJAAkAgAg4EBAABAgMLIAAgASABQQxqEEMPCyAAIAEgAUEMaiADEEQPCyAAIAEgAUEMahBCDwsQJAALIAAgASABQQxqIAMQRQttAQF/IwBBgAJrIgUkACAEQYDABHEgAiADTHJFBEAgBSABQf8BcSACIANrIgNBgAIgA0GAAkkiARsQKhogAUUEQANAIAAgBUGAAhAmIANBgAJrIgNB/wFLDQALCyAAIAUgAxAmCyAFQYACaiQAC/ICAgJ/AX4CQCACRQ0AIAAgAToAACAAIAJqIgNBAWsgAToAACACQQNJDQAgACABOgACIAAgAToAASADQQNrIAE6AAAgA0ECayABOgAAIAJBB0kNACAAIAE6AAMgA0EEayABOgAAIAJBCUkNACAAQQAgAGtBA3EiBGoiAyABQf8BcUGBgoQIbCIBNgIAIAMgAiAEa0F8cSIEaiICQQRrIAE2AgAgBEEJSQ0AIAMgATYCCCADIAE2AgQgAkEIayABNgIAIAJBDGsgATYCACAEQRlJDQAgAyABNgIYIAMgATYCFCADIAE2AhAgAyABNgIMIAJBEGsgATYCACACQRRrIAE2AgAgAkEYayABNgIAIAJBHGsgATYCACAEIANBBHFBGHIiBGsiAkEgSQ0AIAGtQoGAgIAQfiEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkEgayICQR9LDQALCyAAC4AEAQN/IAJBgARPBEAgACABIAIQFyAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAtIAQF/IwBBEGsiBCQAIAQgAzYCDAJAIABFBEBBAEEAIAEgAiAEKAIMEHEMAQsgACgC9AMgACABIAIgBCgCDBBxCyAEQRBqJAALkwECAX0BfyMAQRBrIgYkACAGQQhqIABB6ABqIAAgAkEBdGovAWIQH0MAAMB/IQUCQAJAAkAgBi0ADEEBaw4CAAECCyAGKgIIIQUMAQsgBioCCCADlEMK1yM8lCEFCyAALQADQRB0QYCAwABxBEAgBSAAIAEgAiAEEFQiA0MAAAAAIAMgA1sbkiEFCyAGQRBqJAAgBQu1AQECfyAAKAIEQQFqIgEgACgCACICKALsAyACKALoAyICa0ECdU8EQANAIAAoAggiAUUEQCAAQQA2AgggAEIANwIADwsgACABKAIENgIAIAAgASgCCDYCBCAAIAEoAgA2AgggARAjIAAoAgRBAWoiASAAKAIAIgIoAuwDIAIoAugDIgJrQQJ1Tw0ACwsgACABNgIEIAIgAUECdGooAgAtABdBEHRBgIAwcUGAgCBGBEAgABB9CwuBAQIBfwF9IwBBEGsiAyQAIANBCGogAEEDIAJBAkdBAXQgAUH+AXFBAkcbIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC4EBAgF/AX0jAEEQayIDJAAgA0EIaiAAQQEgAkECRkEBdCABQf4BcUECRxsgAhBTQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIQwAAAACUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsLeAICfQF/IAAgAkEDdGoiByoC+AMhBkMAAMB/IQUCQAJAAkAgBy0A/ANBAWsOAgABAgsgBiEFDAELIAYgA5RDCtcjPJQhBQsgAC0AF0EQdEGAgMAAcQR9IAUgAEEUaiABIAIgBBBUIgNDAAAAACADIANbG5IFIAULC1EBAX8CQCABKALoAyICIAEoAuwDRwRAIABCADcCBCAAIAE2AgAgAigCAC0AF0EQdEGAgDBxQYCAIEcNASAAEH0PCyAAQgA3AgAgAEEANgIICwvoAgECfwJAIAAgAUYNACABIAAgAmoiBGtBACACQQF0a00EQCAAIAEgAhArDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkEBayECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkEBayICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQQRrIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkEBayICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AA0AgAyABKAIANgIAIAFBBGohASADQQRqIQMgAkEEayICQQNLDQALCyACRQ0AA0AgAyABLQAAOgAAIANBAWohAyABQQFqIQEgAkEBayICDQALCyAAC5QCAgF8AX8CQCAAIAGiIgAQbCIERAAAAAAAAPA/oCAEIAREAAAAAAAAAABjGyIEIARiIgUgBJlELUMc6+I2Gj9jRXJFBEAgACAEoSEADAELIAUgBEQAAAAAAADwv6CZRC1DHOviNho/Y0VyRQRAIAAgBKFEAAAAAAAA8D+gIQAMAQsgACAEoSEAIAIEQCAARAAAAAAAAPA/oCEADAELIAMNACAAAnxEAAAAAAAAAAAgBQ0AGkQAAAAAAADwPyAERAAAAAAAAOA/ZA0AGkQAAAAAAADwP0QAAAAAAAAAACAERAAAAAAAAOC/oJlELUMc6+I2Gj9jGwugIQALIAAgAGIgASABYnIEQEMAAMB/DwsgACABo7YLkwECAX0BfyMAQRBrIgYkACAGQQhqIABB6ABqIAAgAkEBdGovAV4QH0MAAMB/IQUCQAJAAkAgBi0ADEEBaw4CAAECCyAGKgIIIQUMAQsgBioCCCADlEMK1yM8lCEFCyAALQADQRB0QYCAwABxBEAgBSAAIAEgAiAEEFQiA0MAAAAAIAMgA1sbkiEFCyAGQRBqJAAgBQtQAAJAAkACQAJAAkAgAg4EBAABAgMLIAAgASABQR5qEEMPCyAAIAEgAUEeaiADEEQPCyAAIAEgAUEeahBCDwsQJAALIAAgASABQR5qIAMQRQt+AgF/AX0jAEEQayIEJAAgBEEIaiAAQQMgAkECR0EBdCABQf4BcUECRxsgAhBQQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAACXQwAAAAAgBSAFWxsLfgIBfwF9IwBBEGsiBCQAIARBCGogAEEBIAJBAkZBAXQgAUH+AXFBAkcbIAIQUEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAl0MAAAAAIAUgBVsbC08AAkACQAJAIANB/wFxIgMOBAACAgECCyABIAEvAABB+P8DcTsAAA8LIAEgAS8AAEH4/wNxQQRyOwAADwsgACABIAJBAUECIANBAUYbEEwLNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEBAAtiAgJ9An8CQCAAKALkA0UNACAAQfwAaiIDIABBGmoiBC8BABAgIgIgAlwEQCADIABBGGoiBC8BABAgIgIgAlwNASADIAAvARgQIEMAAAAAXkUNAQsgAyAELwEAECAhAQsgAQtfAQN/IAEEQEEMEB4iAyABKQIENwIEIAMhAiABKAIAIgEEQCADIQQDQEEMEB4iAiABKQIENwIEIAQgAjYCACACIQQgASgCACIBDQALCyACIAAoAgA2AgAgACADNgIACwvXawMtfxx9AX4CfwJAIAAtAABBBHEEQCAAKAKgASAMRw0BCyAAKAKkASAAKAL0AygCDEcNAEEAIAAtAKgBIANGDQEaCyAAQoCAgPyLgIDAv383AoADIABCgYCAgBA3AvgCIABCgICA/IuAgMC/fzcC8AIgAEEANgKsAUEBCyErAkACQAJAAkAgACgCCARAIABBFGoiDkECQQEgBhAiIT4gDkECQQEgBhAhITwgDkEAQQEgBhAiITsgDkEAQQEgBhAhIUAgBCABIAUgAiAAKAL4AiAAQfACaiIOKgIAIAAoAvwCIAAqAvQCIAAqAoADIAAqAoQDID4gPJIiPiA7IECSIjwgACgC9AMiEBB7DQEgACgCrAEiEUUNAyAAQbABaiETA0AgBCABIAUgAiATIB1BGGxqIg4oAgggDioCACAOKAIMIA4qAgQgDioCECAOKgIUID4gPCAQEHsNAiAdQQFqIh0gEUcNAAsMAgsgCEUEQCAAKAKsASITRQ0CIABBsAFqIRADQAJAAkAgECAdQRhsIhFqIg4qAgAiPiA+XCABIAFcckUEQCA+IAGTi0MXt9E4XQ0BDAILIAEgAVsgPiA+W3INAQsCQCAQIBFqIhEqAgQiPiA+XCACIAJcckUEQCA+IAKTi0MXt9E4XQ0BDAILIAIgAlsgPiA+W3INAQsgESgCCCAERw0AIBEoAgwgBUYNAwsgEyAdQQFqIh1HDQALDAILAkAgAEHwAmoiDioCACI+ID5cIAEgAVxyRQRAID4gAZOLQxe30ThdDQEMBAsgASABWyA+ID5bcg0DCyAOQQAgACgC/AIgBUYbQQAgACgC+AIgBEYbQQACfyACIAJcIg4gACoC9AIiPiA+XHJFBEAgPiACk4tDF7fROF0MAQtBACA+ID5bDQAaIA4LGyEOCyAORSArcgRAIA4hHQwCCyAAIA4qAhA4ApQDIAAgDioCFDgCmAMgCkEMQRAgCBtqIgMgAygCAEEBajYCACAOIR0MAgtBACEdCyAGIUAgByFHIAtBAWohIiMAQaABayINJAACQAJAIARBAUYgASABW3JFBEAgDUGqCzYCICAAQQVB2CUgDUEgahAsDAELIAVBAUYgAiACW3JFBEAgDUHZCjYCECAAQQVB2CUgDUEQahAsDAELIApBAEEEIAgbaiILIAsoAgBBAWo2AgAgACAALQCIA0H8AXEgAC0AFEEDcSILIANBASADGyIsIAsbIg9BA3FyOgCIAyAAQawDaiIQIA9BAUdBA3QiC2ogAEEUaiIUQQNBAiAPQQJGGyIRIA8gQBAiIgY4AgAgECAPQQFGQQN0Ig5qIBQgESAPIEAQISIHOAIAIAAgFEEAIA8gQBAiIjw4ArADIAAgFEEAIA8gQBAhIjs4ArgDIABBvANqIhAgC2ogFCARIA8QMDgCACAOIBBqIBQgESAPEC84AgAgACAUQQAgDxAwOALAAyAAIBRBACAPEC84AsgDIAsgAEHMA2oiC2ogFCARIA8gQBA4OAIAIAsgDmogFCARIA8gQBA3OAIAIAAgFEEAIA8gQBA4OALQAyAAIBRBACAPIEAQNyI6OALYAyAGIAeSIT4gPCA7kiE8AkACQCAAKAIIIgsEQEMAAMB/IAEgPpMgBEEBRhshBkMAAMB/IAIgPJMgBUEBRhshPiAAAn0gBCAFckUEQCAAIABBAiAPIAYgQCBAECU4ApQDIABBACAPID4gRyBAECUMAQsgBEEDTyAFQQNPcg0EIA1BiAFqIAAgBiAGIAAqAswDIAAqAtQDkiAAKgK8A5IgACoCxAOSIjyTIgdDAAAAACAHQwAAAABeGyAGIAZcG0GBgAggBEEDdEH4//8HcXZB/wFxID4gPiAAKgLQAyA6kiAAKgLAA5IgACoCyAOSIjuTIgdDAAAAACAHQwAAAABeGyA+ID5cG0GBgAggBUEDdEH4//8HcXZB/wFxIAsREAAgDSoCjAEiPUMAAAAAYCANKgKIASIHQwAAAABgcUUEQCANID27OQMIIA0gB7s5AwAgAEEBQdwdIA0QLCANKgKMASIHQwAAAAAgB0MAAAAAXhshPSANKgKIASIHQwAAAAAgB0MAAAAAXhshBwsgCiAKKAIUQQFqNgIUIAogCUECdGoiCSAJKAIYQQFqNgIYIAAgAEECIA8gPCAHkiAGIARBAWtBAkkbIEAgQBAlOAKUAyAAQQAgDyA7ID2SID4gBUEBa0ECSRsgRyBAECULOAKYAwwBCwJAIAAoAuADRQRAIAAoAuwDIAAoAugDa0ECdSELDAELIA1BiAFqIAAQMgJAIA0oAogBRQRAQQAhCyANKAKMAUUNAQsgDUGAAWohEEEAIQsDQCANQQA2AoABIA0gDSkDiAE3A3ggECANKAKQARA8IA1BiAFqEC4gDSgCgAEiCQRAA0AgCSgCACEOIAkQJyAOIgkNAAsLIAtBAWohCyANQQA2AoABIA0oAowBIA0oAogBcg0ACwsgDSgCkAEiCUUNAANAIAkoAgAhDiAJECcgDiIJDQALCyALRQRAIAAgAEECIA8gBEEBa0EBSwR9IAEgPpMFIAAqAswDIAAqAtQDkiAAKgK8A5IgACoCxAOSCyBAIEAQJTgClAMgACAAQQAgDyAFQQFrQQFLBH0gAiA8kwUgACoC0AMgACoC2AOSIAAqAsADkiAAKgLIA5ILIEcgQBAlOAKYAwwBCwJAIAgNACAFQQJGIAIgPJMiBiAGW3EgBkMAAAAAX3EgBCAFckUgBEECRiABID6TIgdDAAAAAF9xcnJFDQAgACAAQQIgD0MAAAAAQwAAAAAgByAHQwAAAABdGyAHIARBAkYbIAcgB1wbIEAgQBAlOAKUAyAAIABBACAPQwAAAABDAAAAACAGIAZDAAAAAF0bIAYgBUECRhsgBiAGXBsgRyBAECU4ApgDDAELIAAQTyAAIAAtAIgDQfsBcToAiAMgABBeQQMhEyAALQAUQQJ2QQNxIQkCQAJAIA9BAkcNAAJAIAlBAmsOAgIAAQtBAiETDAELIAkhEwsgAC8AFSEnIBQgEyAPIEAQOCEGIBQgEyAPEDAhByAUIBMgDyBAEDchOyAUIBMgDxAvITpBACEQIBQgEUEAIBNBAkkbIhYgDyBAEDghPyAUIBYgDxAwIT0gFCAWIA8gQBA3IUEgFCAWIA8QLyFEIBQgFiAPIEAQYCFCIBQgFiAPEEshQyAAIA9BACABID6TIlAgBiAHkiA7IDqSkiJKID8gPZIgQSBEkpIiRiATQQFLIhkbIEAgQBB6ITsgACAPQQEgAiA8kyJRIEYgSiAZGyBHIEAQeiFFAkACQCAEIAUgGRsiHA0AIA1BiAFqIAAQMgJAAkAgDSgCiAEiDiANKAKMASIJckUNAANAIA4oAuwDIA4oAugDIg5rQQJ1IAlNDQQCQCAOIAlBAnRqKAIAIgkQeUUNACAQDQIgCRA7IgYgBlsgBotDF7fROF1xDQIgCRBAIgYgBlwEQCAJIRAMAQsgCSEQIAaLQxe30ThdDQILIA1BiAFqEC4gDSgCjAEiCSANKAKIASIOcg0ACwwBC0EAIRALIA0oApABIglFDQADQCAJKAIAIQ4gCRAnIA4iCQ0ACwsgDUGIAWogABAyIA0oAowBIQkCQCANKAKIASIORQRAQwAAAAAhPSAJRQ0BCyBFIEVcIiMgBUEAR3IhKCA7IDtcIiQgBEEAR3IhKUMAAAAAIT0DQCAOKALsAyAOKALoAyIOa0ECdSAJTQ0CIA4gCUECdGooAgAiDhB4AkAgDi8AFSAOLQAXQRB0ciIJQYCAMHFBgIAQRgRAIA4QdyAOIA4tAAAiCUEBciIOQfsBcSAOIAlBBHEbOgAADAELIAgEfyAOIA4tABRBA3EiCSAPIAkbIDsgRRB2IA4vABUgDi0AF0EQdHIFIAkLQYDgAHFBgMAARg0AIA5BFGohEQJAIA4gEEYEQCAQQQA2ApwBIBAgDDYCmAFDAAAAACEHDAELIBQtAABBAnZBA3EhCQJAAkAgD0ECRw0AQQMhEgJAIAlBAmsOAgIAAQtBAiESDAELIAkhEgsgDUGAgID+BzYCaCANQYCAgP4HNgJQIA1B+ABqIA5B/ABqIhcgDi8BHhAfIDsgRSASQQFLIh4bIT4CQAJAAkACQCANLQB8IgkOBAABAQABCwJAIBcgDi8BGBAgIgYgBlwNACAXIA4vARgQIEMAAAAAXkUNACAOKAL0Ay0ACEEBcSIJDQBDAADAf0MAAAAAIAkbIQcMAgtDAADAfyEGDAILIA0qAnghB0MAAMB/IQYCQCAJQQFrDgIBAAILIAcgPpRDCtcjPJQhBgwBCyAHIQYLIA4tABdBEHRBgIDAAHEEQCAGIBEgD0GBAiASQQN0dkEBcSA7EFQiBkMAAAAAIAYgBlsbkiEGCyAOKgL4AyEHQQAhH0EAIRgCQAJAAkAgDi0A/ANBAWsOAgEAAgsgOyAHlEMK1yM8lCEHCyAHIAdcDQAgB0MAAAAAYCEYCyAOKgKABCEHAkACQAJAIA4tAIQEQQFrDgIBAAILIEUgB5RDCtcjPJQhBwsgByAHXA0AIAdDAAAAAGAhHwsCQCAOAn0gBiAGXCIJID4gPlxyRQRAIA4qApwBIgcgB1sEQCAOKAL0Ay0AEEEBcUUNAyAOKAKYASAMRg0DCyARIBIgDyA7EDggESASIA8QMJIgESASIA8gOxA3IBEgEiAPEC+SkiIHIAYgBiAHXRsgByAGIAkbIAYgBlsgByAHW3EbDAELIBggHnEEQCARQQIgDyA7EDggEUECIA8QMJIgEUECIA8gOxA3IBFBAiAPEC+SkiIHIA4gD0EAIDsgOxAxIgYgBiAHXRsgByAGIAYgBlwbIAYgBlsgByAHW3EbDAELIB4gH0VyRQRAIBFBACAPIDsQOCARQQAgDxAwkiARQQAgDyA7EDcgEUEAIA8QL5KSIgcgDiAPQQEgRSA7EDEiBiAGIAddGyAHIAYgBiAGXBsgBiAGWyAHIAdbcRsMAQtBASEaIA1BATYCZCANQQE2AnggEUECQQEgOxAiIBFBAkEBIDsQIZIhPiARQQBBASA7ECIhPCARQQBBASA7ECEhOkMAAMB/IQdBASEVQwAAwH8hBiAYBEAgDiAPQQAgOyA7EDEhBiANQQA2AnggDSA+IAaSIgY4AmhBACEVCyA8IDqSITwgHwRAIA4gD0EBIEUgOxAxIQcgDUEANgJkIA0gPCAHkiIHOAJQQQAhGgsCQAJAAkAgAC0AF0EQdEGAgAxxQYCACEYiCSASQQJJIiBxRQRAIAkgJHINAiAGIAZcDQEMAgsgJCAGIAZbcg0CC0ECIRUgDUECNgJ4IA0gOzgCaCA7IQYLAkAgIEEBIAkbBEAgCSAjcg0CIAcgB1wNAQwCCyAjIAcgB1tyDQELQQIhGiANQQI2AmQgDSBFOAJQIEUhBwsCQCAXIA4vAXoQICI6IDpcDQACfyAVIB5yRQRAIBcgDi8BehAgIQcgDUEANgJkIA0gPCAGID6TIAeVkjgCUEEADAELIBogIHINASAXIA4vAXoQICEGIA1BADYCeCANIAYgByA8k5QgPpI4AmhBAAshGkEAIRULIA4vABZBD3EiCUUEQCAALQAVQQR2IQkLAkAgFUUgCUEFRiAeciAYIClyIAlBBEdycnINACANQQA2AnggDSA7OAJoIBcgDi8BehAgIgYgBlwNAEEAIRogFyAOLwF6ECAhBiANQQA2AmQgDSA7ID6TIAaVOAJQCyAOLwAWQQ9xIhhFBEAgAC0AFUEEdiEYCwJAICAgKHIgH3IgGEEFRnIgGkUgGEEER3JyDQAgDUEANgJkIA0gRTgCUCAXIA4vAXoQICIGIAZcDQAgFyAOLwF6ECAhBiANQQA2AnggDSAGIEUgPJOUOAJoCyAOIA9BAiA7IDsgDUH4AGogDUHoAGoQPyAOIA9BACBFIDsgDUHkAGogDUHQAGoQPyAOIA0qAmggDSoCUCAPIA0oAnggDSgCZCA7IEVBAEEFIAogIiAMED0aIA4gEkECdEH8JWooAgBBAnRqKgKUAyEGIBEgEiAPIDsQOCARIBIgDxAwkiARIBIgDyA7EDcgESASIA8QL5KSIgcgBiAGIAddGyAHIAYgBiAGXBsgBiAGWyAHIAdbcRsLIgc4ApwBCyAOIAw2ApgBCyA9IAcgESATQQEgOxAiIBEgE0EBIDsQIZKSkiE9CyANQYgBahAuIA0oAowBIgkgDSgCiAEiDnINAAsLIA0oApABIgkEQANAIAkoAgAhDiAJECcgDiIJDQALCyA7IEUgGRshByA9QwAAAACSIQYgC0ECTwRAIBQgEyAHEE0gC0EBa7OUIAaSIQYLIEIgQ5IhPiAFIAQgGRshGiBHIEAgGRshTSBAIEcgGRshSSANQdAAaiAAEDJBACAcIAYgB14iCxsgHCAcQQJGGyAcICdBgIADcSIfGyEeIBQgFiBFIDsgGRsiRBBNIU8gDSgCVCIRIA0oAlAiCXIEQEEBQQIgRCBEXCIpGyEtIAtFIBxBAUZyIS4gE0ECSSEZIABB8gBqIS8gAEH8AGohMCATQQJ0IgtB7CVqITEgC0HcJWohMiAWQQJ0Ig5B7CVqIRwgDkHcJWohICALQfwlaiEkIA5B/CVqISMgGkEARyIzIAhyITQgGkUiNSAIQQFzcSE2IBogH3JFITcgDUHwAGohOCANQYABaiEnQYECIBNBA3R2Qf8BcSEoIBpBAWtBAkkhOQNAIA1BADYCgAEgDUIANwN4AkAgACgC7AMiCyAAKALoAyIORg0AIAsgDmsiC0EASA0DIA1BiAFqIAtBAnVBACAnEEohECANKAKMASANKAJ8IA0oAngiC2siDmsgCyAOEDMhDiANIA0oAngiCzYCjAEgDSAONgJ4IA0pA5ABIVYgDSANKAJ8Ig42ApABIA0oAoABIRIgDSBWNwJ8IA0gEjYClAEgECALNgIAIAsgDkcEQCANIA4gCyAOa0EDakF8cWo2ApABCyALRQ0AIAsQJwsgFC0AACIOQQJ2QQNxIQsCQAJAIA5BA3EiDiAsIA4bIhJBAkcNAEEDIRACQCALQQJrDgICAAELQQIhEAwBCyALIRALIAAvABUhCyAUIBAgBxBNIT8CQCAJIBFyRQRAQwAAAAAhQ0EAIRFDAAAAACFCQwAAAAAhQUEAIRUMAQsgC0GAgANxISUgEEECSSEYIBBBAnQiC0HsJWohISALQdwlaiEqQQAhFUMAAAAAIUEgESEOQwAAAAAhQkMAAAAAIUNBACEXQwAAAAAhPQNAIAkoAuwDIAkoAugDIglrQQJ1IA5NDQQCQCAJIA5BAnRqKAIAIgkvABUgCS0AF0EQdHIiC0GAgDBxQYCAEEYgC0GA4ABxQYDAAEZyDQAgDUGIAWoiESAJQRRqIgsgKigCACADECggDS0AjAEhJiARIAsgISgCACADECggDS0AjAEhESAJIBs2AtwDIBUgJkEDRmohFSARQQNGIREgCyAQQQEgOxAiIUsgCyAQQQEgOxAhIU4gCSAXIAkgFxsiF0YhJiAJKgKcASE8IAsgEiAYIEkgQBA1IToCQCALIBIgGCBJIEAQLSIGQwAAAABgIAYgPF1xDQAgOkMAAAAAYEUEQCA8IQYMAQsgOiA8IDogPF4bIQYLIBEgFWohFQJAICVFQwAAAAAgPyAmGyI8IEsgTpIiOiA9IAaSkpIgB15Fcg0AIA0oAnggDSgCfEYNACAOIREMAwsgCRB5BEAgQiAJEDuSIUIgQyAJEEAgCSoCnAGUkyFDCyBBIDwgOiAGkpIiBpIhQSA9IAaSIT0gDSgCfCILIA0oAoABRwRAIAsgCTYCACANIAtBBGo2AnwMAQsgCyANKAJ4ayILQQJ1IhFBAWoiDkGAgICABE8NBSANQYgBakH/////AyALQQF1IiYgDiAOICZJGyALQfz///8HTxsgESAnEEohDiANKAKQASAJNgIAIA0gDSgCkAFBBGo2ApABIA0oAowBIA0oAnwgDSgCeCIJayILayAJIAsQMyELIA0gDSgCeCIJNgKMASANIAs2AnggDSkDkAEhViANIA0oAnwiCzYCkAEgDSgCgAEhESANIFY3AnwgDSARNgKUASAOIAk2AgAgCSALRwRAIA0gCyAJIAtrQQNqQXxxajYCkAELIAlFDQAgCRAnCyANQQA2AnAgDSANKQNQNwNoIDggDSgCWBA8IA1B0ABqEC4gDSgCcCIJBEADQCAJKAIAIQsgCRAnIAsiCQ0ACwtBACERIA1BADYCcCANKAJUIg4gDSgCUCIJcg0ACwtDAACAPyBCIEJDAACAP10bIEIgQkMAAAAAXhshPCANKAJ8IRcgDSgCeCEJAn0CQAJ9AkACQAJAIB5FDQAgFCAPQQAgQCBAEDUhBiAUIA9BACBAIEAQLSE6IBQgD0EBIEcgQBA1IT8gFCAPQQEgRyBAEC0hPSAGID8gE0EBSyILGyBKkyIGIAZbIAYgQV5xDQEgOiA9IAsbIEqTIgYgBlsgBiBBXXENASAAKAL0Ay0AFEEBcQ0AIEEgPEMAAAAAWw0DGiAAEDsiBiAGXA0CIEEgABA7QwAAAABbDQMaDAILIAchBgsgBiAGWw0CIAYhBwsgBwshBiBBjEMAAAAAIEFDAAAAAF0bIT8gBgwBCyAGIEGTIT8gBgshByA2RQRAAkAgCSAXRgRAQwAAAAAhQQwBC0MAAIA/IEMgQ0MAAIA/XRsgQyBDQwAAAABeGyE9QwAAAAAhQSAJIQ4DQCAOKAIAIgsqApwBITogC0EUaiIQIA8gGSBJIEAQNSFCAkAgECAPIBkgSSBAEC0iBkMAAAAAYCAGIDpdcQ0AIEJDAAAAAGBFBEAgOiEGDAELIEIgOiA6IEJdGyEGCwJAID9DAAAAAF0EQCAGIAsQQIyUIjpDAAAAAF4gOkMAAAAAXXJFDQEgCyATIA8gPyA9lSA6lCAGkiJCIAcgOxAlITogQiBCXCA6IDpcciA6IEJbcg0BIEEgOiAGk5IhQSALEEAgCyoCnAGUID2SIT0MAQsgP0MAAAAAXkUNACALEDsiQkMAAAAAXiBCQwAAAABdckUNACALIBMgDyA/IDyVIEKUIAaSIkMgByA7ECUhOiBDIENcIDogOlxyIDogQ1tyDQAgPCBCkyE8IEEgOiAGk5IhQQsgDkEEaiIOIBdHDQALID8gQZMiQiA9lSFLIEIgPJUhTiAALwAVQYCAA3FFIC5yISVDAAAAACFBIAkhCwNAIAsoAgAiDioCnAEhPCAOQRRqIhggDyAZIEkgQBA1IToCQCAYIA8gGSBJIEAQLSIGQwAAAABgIAYgPF1xDQAgOkMAAAAAYEUEQCA8IQYMAQsgOiA8IDogPF4bIQYLAn0gDiATIA8CfSBCQwAAAABdBEAgBiAGIA4QQIyUIjxDAAAAAFsNAhogBiA8kiA9QwAAAABbDQEaIEsgPJQgBpIMAQsgBiBCQwAAAABeRQ0BGiAGIA4QOyI8QwAAAABeIDxDAAAAAF1yRQ0BGiBOIDyUIAaSCyAHIDsQJQshQyAYIBNBASA7ECIhPCAYIBNBASA7ECEhOiAYIBZBASA7ECIhUiAYIBZBASA7ECEhUyANIEMgPCA6kiJUkiJVOAJoIA1BADYCYCBSIFOSITwCQCAOQfwAaiIQIA4vAXoQICI6IDpbBEAgECAOLwF6ECAhOiANQQA2AmQgDSA8IFUgVJMiPCA6lCA8IDqVIBkbkjgCeAwBCyAjKAIAIRACQCApDQAgDiAQQQN0aiIhKgL4AyE6QQAhEgJAAkACQCAhLQD8A0EBaw4CAQACCyBEIDqUQwrXIzyUIToLIDogOlwNACA6QwAAAABgIRILICUgNSASQQFzcXFFDQAgDi8AFkEPcSISBH8gEgUgAC0AFUEEdgtBBEcNACANQYgBaiAYICAoAgAgDxAoIA0tAIwBQQNGDQAgDUGIAWogGCAcKAIAIA8QKCANLQCMAUEDRg0AIA1BADYCZCANIEQ4AngMAQsgDkH4A2oiEiAQQQN0aiIQKgIAIToCQAJAAkACQCAQLQAEQQFrDgIBAAILIEQgOpRDCtcjPJQhOgsgOkMAAAAAYA0BCyANIC02AmQgDSBEOAJ4DAELAkACfwJAAkACQCAWQQJrDgICAAELIDwgDiAPQQAgRCA7EDGSITpBAAwCC0EBIRAgDSA8IA4gD0EBIEQgOxAxkiI6OAJ4IBNBAU0NDAwCCyA8IA4gD0EAIEQgOxAxkiE6QQALIRAgDSA6OAJ4CyANIDMgEiAQQQN0ajEABEIghkKAgICAIFFxIDogOlxyNgJkCyAOIA8gEyAHIDsgDUHgAGogDUHoAGoQPyAOIA8gFiBEIDsgDUHkAGogDUH4AGoQPyAOICMoAgBBA3RqIhAqAvgDIToCQAJAAkACQCAQLQD8A0EBaw4CAQACCyBEIDqUQwrXIzyUIToLQQEhECA6QwAAAABgDQELQQEhECAOLwAWQQ9xIhIEfyASBSAALQAVQQR2C0EERw0AIA1BiAFqIBggICgCACAPECggDS0AjAFBA0YNACANQYgBaiAYIBwoAgAgDxAoIA0tAIwBQQNGIRALIA4gDSoCaCI8IA0qAngiOiATQQFLIhIbIDogPCASGyAALQCIA0EDcSANKAJgIhggDSgCZCIhIBIbICEgGCASGyA7IEUgCCAQcSIQQQRBByAQGyAKICIgDBA9GiBBIEMgBpOSIUEgAAJ/IAAtAIgDIhBBBHFFBEBBACAOLQCIA0EEcUUNARoLQQQLIBBB+wFxcjoAiAMgC0EEaiILIBdHDQALCyA/IEGTIT8LIAAgAC0AiAMiC0H7AXFBBCA/QwAAAABdQQJ0IAtBBHFBAnYbcjoAiAMgFCATIA8gQBBgIBQgEyAPEEuSITogFCATIA8gQBB/IBQgEyAPEFKSIUsgFCATIAcQTSFCAn8CQAJ9ID9DAAAAAF5FIB5BAkdyRQRAIA1BiAFqIDAgLyAkKAIAQQF0ai8BABAfAkAgDS0AjAEEQCAUIA8gKCBJIEAQNSIGIAZbDQELQwAAAAAMAgtDAAAAACAUIA8gKCBJIEAQNSA6kyBLkyAHID+TkyI/QwAAAABeRQ0BGgsgP0MAAAAAYEUNASA/CyE8IBQtAABBBHZBB3EMAQsgPyE8IBQtAABBBHZBB3EiC0EAIAtBA2tBA08bCyELQwAAAAAhBgJAAkAgFQ0AQwAAAAAhPQJAAkACQAJAAkAgC0EBaw4FAAECBAMGCyA8QwAAAD+UIT0MBQsgPCE9DAQLIBcgCWsiC0EFSQ0CIEIgPCALQQJ1QQFrs5WSIUIMAgsgQiA8IBcgCWtBAnVBAWqzlSI9kiFCDAILIDxDAAAAP5QgFyAJa0ECdbOVIj0gPZIgQpIhQgwBC0MAAAAAIT0LIDogPZIhPSAAEHwhEgJAIAkgF0YiGARAQwAAAAAhP0MAAAAAIToMAQsgF0EEayElIDwgFbOVIU4gMigCACEhQwAAAAAhOkMAAAAAIT8gCSELA0AgDUGIAWogCygCACIOQRRqIhAgISAPECggPUMAAACAIE5DAAAAgCA8QwAAAABeGyJBIA0tAIwBQQNHG5IhPSAIBEACfwJAAkACQAJAIBNBAWsOAwECAwALQQEhFSAOQaADagwDC0EDIRUgDkGoA2oMAgtBACEVIA5BnANqDAELQQIhFSAOQaQDagshKiAOIBVBAnRqICoqAgAgPZI4ApwDCyAlKAIAIRUgDUGIAWogECAxKAIAIA8QKCA9QwAAAIAgQiAOIBVGG5JDAAAAgCBBIA0tAIwBQQNHG5IhPQJAIDRFBEAgPSAQIBNBASA7ECIgECATQQEgOxAhkiAOKgKcAZKSIT0gRCEGDAELIA4gEyA7EF0gPZIhPSASBEAgDhBOIUEgEEEAIA8gOxBBIUMgDioCmAMgEEEAQQEgOxAiIBBBAEEBIDsQIZKSIEEgQ5IiQZMiQyA/ID8gQ10bIEMgPyA/ID9cGyA/ID9bIEMgQ1txGyE/IEEgOiA6IEFdGyBBIDogOiA6XBsgOiA6WyBBIEFbcRshOgwBCyAOIBYgOxBdIkEgBiAGIEFdGyBBIAYgBiAGXBsgBiAGWyBBIEFbcRshBgsgC0EEaiILIBdHDQALCyA/IDqSIAYgEhshQQJ9IDkEQCAAIBYgDyBGIEGSIE0gQBAlIEaTDAELIEQgQSA3GyFBIEQLIT8gH0UEQCAAIBYgDyBGIEGSIE0gQBAlIEaTIUELIEsgPZIhPAJAIAhFDQAgCSELIBgNAANAIAsoAgAiFS8AFkEPcSIORQRAIAAtABVBBHYhDgsCQAJAAkACQCAOQQRrDgIAAQILIA1BiAFqIBVBFGoiECAgKAIAIA8QKEEEIQ4gDS0AjAFBA0YNASANQYgBaiAQIBwoAgAgDxAoIA0tAIwBQQNGDQEgFSAjKAIAQQN0aiIOKgL4AyE9AkACQAJAIA4tAPwDQQFrDgIBAAILIEQgPZRDCtcjPJQhPQsgPiEGID1DAAAAAGANAwsgFSAkKAIAQQJ0aioClAMhBiANIBVB/ABqIg4gFS8BehAgIjogOlsEfSAQIBZBASA7ECIgECAWQQEgOxAhkiAGIA4gFS8BehAgIjqUIAYgOpUgGRuSBSBBCzgCeCANIAYgECATQQEgOxAiIBAgE0EBIDsQIZKSOAKIASANQQA2AmggDUEANgJkIBUgDyATIAcgOyANQegAaiANQYgBahA/IBUgDyAWIEQgOyANQeQAaiANQfgAahA/IA0qAngiOiANKgKIASI9IBNBAUsiGCIOGyEGIB9BAEcgAC8AFUEPcUEER3EiECAZcSA9IDogDhsiOiA6XHIhDiAVIDogBiAPIA4gECAYcSAGIAZcciA7IEVBAUECIAogIiAMED0aID4hBgwCC0EFQQEgFC0AAEEIcRshDgsgFSAWIDsQXSEGIA1BiAFqIBVBFGoiECAgKAIAIhggDxAoID8gBpMhOgJAIA0tAIwBQQNHBEAgHCgCACESDAELIA1BiAFqIBAgHCgCACISIA8QKCANLQCMAUEDRw0AID4gOkMAAAA/lCIGQwAAAAAgBkMAAAAAXhuSIQYMAQsgDUGIAWogECASIA8QKCA+IQYgDS0AjAFBA0YNACANQYgBaiAQIBggDxAoIA0tAIwBQQNGBEAgPiA6QwAAAAAgOkMAAAAAXhuSIQYMAQsCQAJAIA5BAWsOAgIAAQsgPiA6QwAAAD+UkiEGDAELID4gOpIhBgsCfwJAAkACQAJAIBZBAWsOAwECAwALQQEhECAVQaADagwDC0EDIRAgFUGoA2oMAgtBACEQIBVBnANqDAELQQIhECAVQaQDagshDiAVIBBBAnRqIAYgTCAOKgIAkpI4ApwDIAtBBGoiCyAXRw0ACwsgCQRAIAkQJwsgPCBIIDwgSF4bIDwgSCBIIEhcGyBIIEhbIDwgPFtxGyFIIEwgT0MAAAAAIBsbIEGSkiFMIBtBAWohGyANKAJQIgkgEXINAAsLAkAgCEUNACAfRQRAIAAQfEUNAQsgACAWIA8CfSBGIESSIBpFDQAaIAAgFkECdEH8JWooAgBBA3RqIgkqAvgDIQYCQAJAAkAgCS0A/ANBAWsOAgEAAgsgTSAGlEMK1yM8lCEGCyAGQwAAAABgRQ0AIAAgD0GBAiAWQQN0dkEBcSBNIEAQMQwBCyBGIEySCyBHIEAQJSEGQwAAAAAhPCAALwAVQQ9xIQkCQAJAAkACQAJAAkACQAJAAkAgBiBGkyBMkyIGQwAAAABgRQRAQwAAAAAhQyAJQQJrDgICAQcLQwAAAAAhQyAJQQJrDgcBAAUGBAIDBgsgPiAGkiE+DAULID4gBkMAAAA/lJIhPgwECyAGIBuzIjqVITwgPiAGIDogOpKVkiE+DAMLID4gBiAbQQFqs5UiPJIhPgwCCyAbQQJJBEAMAgsgDUGIAWogABAyIAYgG0EBa7OVITwMAgsgBiAbs5UhQwsgDUGIAWogABAyIBtFDQELIBZBAnQiCUHcJWohECAJQfwlaiERIA1BOGohGCANQcgAaiEZIA1B8ABqIRUgDUGQAWohHCANQYABaiEfQQAhEgNAIA1BADYCgAEgDSANKQOIATcDeCAfIA0oApABEDwgDUEANgJwIA0gDSkDeCJWNwNoIBUgDSgCgAEiCxA8IA0oAmwhCQJAAkAgDSgCaCIOBEBDAAAAACE6QwAAAAAhP0MAAAAAIQYMAQtDAAAAACE6QwAAAAAhP0MAAAAAIQYgCUUNAQsDQCAOKALsAyAOKALoAyIOa0ECdSAJTQ0FAkAgDiAJQQJ0aigCACIJLwAVIAktABdBEHRyIhdBgIAwcUGAgBBGIBdBgOAAcUGAwABGcg0AIAkoAtwDIBJHDQIgCUEUaiEOIAkgESgCAEECdGoqApQDIj1DAAAAAGAEfyA9IA4gFkEBIDsQIiAOIBZBASA7ECGSkiI9IAYgBiA9XRsgPSAGIAYgBlwbIAYgBlsgPSA9W3EbIQYgCS0AFgUgF0EIdgtBD3EiFwR/IBcFIAAtABVBBHYLQQVHDQAgFC0AAEEIcUUNACAJEE4gDkEAIA8gOxBBkiI9ID8gPSA/XhsgPSA/ID8gP1wbID8gP1sgPSA9W3EbIj8gCSoCmAMgDkEAQQEgOxAiIA5BAEEBIDsQIZKSID2TIj0gOiA6ID1dGyA9IDogOiA6XBsgOiA6WyA9ID1bcRsiOpIiPSAGIAYgPV0bID0gBiAGIAZcGyAGIAZbID0gPVtxGyEGCyANQQA2AkggDSANKQNoNwNAIBkgDSgCcBA8IA1B6ABqEC4gDSgCSCIJBEADQCAJKAIAIQ4gCRAnIA4iCQ0ACwsgDUEANgJIIA0oAmwiCSANKAJoIg5yDQALCyANIA0pA2g3A4gBIBwgDSgCcBB1IA0gVjcDaCAVIAsQdSA+IE9DAAAAACASG5IhPiBDIAaSIT0gDSgCbCEJAkAgDSgCaCIOIA0oAogBRgRAIAkgDSgCjAFGDQELID4gP5IhQiA+ID2SIUsgPCA9kiEGA0AgDigC7AMgDigC6AMiDmtBAnUgCU0NBQJAIA4gCUECdGooAgAiCS8AFSAJLQAXQRB0ciIXQYCAMHFBgIAQRiAXQYDgAHFBgMAARnINACAJQRRqIQ4CQAJAAkACQAJAAkAgF0EIdkEPcSIXBH8gFwUgAC0AFUEEdgtBAWsOBQEDAgQABgsgFC0AAEEIcQ0ECyAOIBYgDyA7EFEhOiAJIBAoAgBBAnRqID4gOpI4ApwDDAQLIA4gFiAPIDsQYiE/AkACQAJAAkAgFkECaw4CAgABCyAJKgKUAyE6QQIhDgwCC0EBIQ4gCSoCmAMhOgJAIBYOAgIADwtBAyEODAELIAkqApQDITpBACEOCyAJIA5BAnRqIEsgP5MgOpM4ApwDDAMLAkACQAJAAkAgFkECaw4CAgABCyAJKgKUAyE/QQIhDgwCC0EBIQ4gCSoCmAMhPwJAIBYOAgIADgtBAyEODAELIAkqApQDIT9BACEOCyAJIA5BAnRqID4gPSA/k0MAAAA/lJI4ApwDDAILIA4gFiAPIDsQQSE6IAkgECgCAEECdGogPiA6kjgCnAMgCSARKAIAQQN0aiIXKgL4AyE/AkACQAJAIBctAPwDQQFrDgIBAAILIEQgP5RDCtcjPJQhPwsgP0MAAAAAYA0CCwJAAkACfSATQQFNBEAgCSoCmAMgDiAWQQEgOxAiIA4gFkEBIDsQIZKSITogBgwBCyAGITogCSoClAMgDiATQQEgOxAiIA4gE0EBIDsQIZKSCyI/ID9cIAkqApQDIkEgQVxyRQRAID8gQZOLQxe30ThdDQEMAgsgPyA/WyBBIEFbcg0BCyAJKgKYAyJBIEFcIg4gOiA6XHJFBEAgOiBBk4tDF7fROF1FDQEMAwsgOiA6Ww0AIA4NAgsgCSA/IDogD0EAQQAgOyBFQQFBAyAKICIgDBA9GgwBCyAJIEIgCRBOkyAOQQAgDyBEEFGSOAKgAwsgDUEANgI4IA0gDSkDaDcDMCAYIA0oAnAQPCANQegAahAuIA0oAjgiCQRAA0AgCSgCACEOIAkQJyAOIgkNAAsLIA1BADYCOCANKAJsIQkgDSgCaCIOIA0oAogBRw0AIAkgDSgCjAFHDQALCyANKAJwIgkEQANAIAkoAgAhDiAJECcgDiIJDQALCyALBEADQCALKAIAIQkgCxAnIAkiCw0ACwsgPCA+kiA9kiE+IBJBAWoiEiAbRw0ACwsgDSgCkAEiCUUNAANAIAkoAgAhCyAJECcgCyIJDQALCyAAQZQDaiIQIABBAiAPIFAgQCBAECU4AgAgAEGYA2oiESAAQQAgDyBRIEcgQBAlOAIAAkAgEEGBAiATQQN0dkEBcUECdGoCfQJAIB5BAUcEQCAALQAXQQNxIglBAkYgHkECR3INAQsgACATIA8gSCBJIEAQJQwBCyAeQQJHIAlBAkdyDQEgSiAAIA8gEyBIIEkgQBB0Ij4gSiAHkiIGIAYgPl4bID4gBiAGIAZcGyAGIAZbID4gPltxGyIGIAYgSl0bIEogBiAGIAZcGyAGIAZbIEogSltxGws4AgALAkAgEEGBAiAWQQN0dkEBcUECdGoCfQJAIBpBAUcEQCAaQQJHIgkgAC0AF0EDcSILQQJGcg0BCyAAIBYgDyBGIEySIE0gQBAlDAELIAkgC0ECR3INASBGIAAgDyAWIEYgTJIgTSBAEHQiByBGIESSIgYgBiAHXhsgByAGIAYgBlwbIAYgBlsgByAHW3EbIgYgBiBGXRsgRiAGIAYgBlwbIAYgBlsgRiBGW3EbCzgCAAsCQCAIRQ0AAkAgAC8AFUGAgANxQYCAAkcNACANQYgBaiAAEDIDQCANKAKMASIJIA0oAogBIgtyRQRAIA0oApABIglFDQIDQCAJKAIAIQsgCRAnIAsiCQ0ACwwCCyALKALsAyALKALoAyILa0ECdSAJTQ0DIAsgCUECdGooAgAiCS8AFUGA4ABxQYDAAEcEQCAJAn8CQAJAAkAgFkECaw4CAAECCyAJQZQDaiEOIBAqAgAgCSoCnAOTIQZBAAwCCyAJQZQDaiEOIBAqAgAgCSoCpAOTIQZBAgwBCyARKgIAIQYCQAJAIBYOAgABCgsgCUGYA2ohDiAGIAkqAqADkyEGQQEMAQsgCUGYA2ohDiAGIAkqAqgDkyEGQQMLQQJ0aiAGIA4qAgCTOAKcAwsgDUGIAWoQLgwACwALAkAgEyAWckEBcUUNACAWQQFxIRQgE0EBcSEVIA1BiAFqIAAQMgNAIA0oAowBIgkgDSgCiAEiC3JFBEAgDSgCkAEiCUUNAgNAIAkoAgAhCyAJECcgCyIJDQALDAILIAsoAuwDIAsoAugDIgtrQQJ1IAlNDQMCQCALIAlBAnRqKAIAIgkvABUgCS0AF0EQdHIiC0GAgDBxQYCAEEYgC0GA4ABxQYDAAEZyDQAgFQRAAn8CfwJAAkACQCATQQFrDgMAAQINCyAJQZgDaiEOIAlBqANqIQtBASESIBEMAwsgCUGUA2ohDkECIRIgCUGcA2oMAQsgCUGUA2ohDkEAIRIgCUGkA2oLIQsgEAshGyAJIBJBAnRqIBsqAgAgDioCAJMgCyoCAJM4ApwDCyAURQ0AAn8CfwJAAkACQCAWQQFrDgMAAQIMCyAJQZgDaiELIAlBqANqIRJBASEXIBEMAwsgCUGUA2ohCyAJQZwDaiESQQIMAQsgCUGUA2ohCyAJQaQDaiESQQALIRcgEAshDiAJIBdBAnRqIA4qAgAgCyoCAJMgEioCAJM4ApwDCyANQYgBahAuDAALAAsgAC8AFUGA4ABxICJBAUZyRQRAIAAtAABBCHFFDQELIAAgACAeIAQgE0EBSxsgDyAKICIgDEMAAAAAQwAAAAAgOyBFEH4aCyANKAJYIglFDQIDQCAJKAIAIQsgCRAnIAsiCQ0ACwwCCxACAAsgABBeCyANQaABaiQADAELECQACyAAIAM6AKgBIAAgACgC9AMoAgw2AqQBIB0NACAKIAooAggiAyAAKAKsASIOQQFqIgkgAyAJSxs2AgggDkEIRgRAIABBADYCrAFBACEOCyAIBH8gAEHwAmoFIAAgDkEBajYCrAEgACAOQRhsakGwAWoLIgMgBTYCDCADIAQ2AgggAyACOAIEIAMgATgCACADIAAqApQDOAIQIAMgACoCmAM4AhRBACEdCyAIBEAgACAAKQKUAzcCjAMgACAALQAAIgNBAXIiBEH7AXEgBCADQQRxGzoAAAsgACAMNgKgASArIB1Fcgs1AQF/IAEgACgCBCICQQF1aiEBIAAoAgAhACABIAJBAXEEfyABKAIAIABqKAIABSAACxECAAt9ACAAQRRqIgAgAUGBAiACQQN0dkH/AXEgAyAEEC0gACACQQEgBBAiIAAgAkEBIAQQIZKSIQQCQAJAAkACQCAFKAIADgMAAQADCyAGKgIAIgMgAyAEIAMgBF0bIAQgBFwbIQQMAQsgBCAEXA0BIAVBAjYCAAsgBiAEOAIACwuMAQIBfwF9IAAoAuQDRQRAQwAAAAAPCyAAQfwAaiIBIAAvARwQICICIAJbBEAgASAALwEcECAPCwJAIAAoAvQDLQAIQQFxDQAgASAALwEYECAiAiACXA0AIAEgAC8BGBAgQwAAAABdRQ0AIAEgAC8BGBAgjA8LQwAAgD9DAAAAACAAKAL0Ay0ACEEBcRsLcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEChDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwtHAQF/IAIvAAYiA0EHcQRAIAAgAUHoAGogAxAfDwsgAUHoAGohASACLwAOIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHwtHAQF/IAIvAAIiA0EHcQRAIAAgAUHoAGogAxAfDwsgAUHoAGohASACLwAOIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHwt7AAJAAkACQAJAIANBAWsOAgABAgsgAi8ACiIDQQdxRQ0BDAILIAIvAAgiA0EHcUUNAAwBCyACLwAEIgNBB3EEQAwBCyABQegAaiEBIAIvAAwiA0EHcQRAIAAgASADEB8PCyAAIAEgAi8AEBAfDwsgACABQegAaiADEB8LewACQAJAAkACQCADQQFrDgIAAQILIAIvAAgiA0EHcUUNAQwCCyACLwAKIgNBB3FFDQAMAQsgAi8AACIDQQdxBEAMAQsgAUHoAGohASACLwAMIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHw8LIAAgAUHoAGogAxAfC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQe4AaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAuFAQIDfwF+AkAgAEKAgICAEFQEQCAAIQUMAQsDQCABQQFrIgEgAEIKgCIFQvYBfiAAfKdBMHI6AAAgAEL/////nwFWIQIgBSEAIAINAAsLIAWnIgIEQANAIAFBAWsiASACQQpuIgNB9gFsIAJqQTByOgAAIAJBCUshBCADIQIgBA0ACwsgAQs3AQJ/QQQQHiICIAE2AgBBBBAeIgMgATYCAEHBOyAAQeI7QfooQb8BIAJB4jtB/ihBwAEgAxAHCw8AIAAgASACQQFBAhCLAQteAQF/IABBADYCDCAAIAM2AhACQCABBEAgAUGAgICABE8NASABQQJ0EB4hBAsgACAENgIAIAAgBCACQQJ0aiICNgIIIAAgBCABQQJ0ajYCDCAAIAI2AgQgAA8LEFgAC3kCAX8BfSMAQRBrIgMkACADQQhqIAAgAUECdEHcJWooAgAgAhBTQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIQwAAAACUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsLnAoBC38jAEEQayIIJAAgASABLwAAQXhxIANyIgM7AAACQAJAAkACQAJAAkACQAJAAkACQCADQQhxBEAgA0H//wNxIgZBBHYhBCAGQT9NBH8gACAEQQJ0akEEagUgBEEEayIEIAAoAhgiACgCBCAAKAIAIgBrQQJ1Tw0CIAAgBEECdGoLIAI4AgAMCgsCfyACi0MAAABPXQRAIAKoDAELQYCAgIB4CyIEQf8PakH+H0sgBLIgAlxyRQRAIANBD3FBACAEa0GAEHIgBCACQwAAAABdG0EEdHIhAwwKCyAAIAAvAQAiC0EBajsBACALQYAgTw0DIAtBA00EQCAAIAtBAnRqIAI4AgQMCQsgACgCGCIDRQRAQRgQHiIDQgA3AgAgA0IANwIQIANCADcCCCAAIAM2AhgLAkAgAygCBCIEIAMoAghHBEAgBCACOAIAIAMgBEEEajYCBAwBCyAEIAMoAgAiB2siBEECdSIJQQFqIgZBgICAgARPDQECf0H/////AyAEQQF1IgUgBiAFIAZLGyAEQfz///8HTxsiBkUEQEEAIQUgCQwBCyAGQYCAgIAETw0GIAZBAnQQHiEFIAMoAgQgAygCACIHayIEQQJ1CyEKIAUgCUECdGoiCSACOAIAIAkgCkECdGsgByAEEDMhByADIAUgBkECdGo2AgggAyAJQQRqNgIEIAMoAgAhBCADIAc2AgAgBEUNACAEECMLIAAoAhgiBigCECIDIAYoAhQiAEEFdEcNByADQQFqQQBIDQAgA0H+////A0sNASADIABBBnQiACADQWBxQSBqIgQgACAESxsiAE8NByAAQQBODQILEAIAC0H/////ByEAIANB/////wdPDQULIAhBADYCCCAIQgA3AwAgCCAAEJ8BIAYoAgwhBCAIIAgoAgQiByAGKAIQIgBBH3FqIABBYHFqIgM2AgQgB0UEQCADQQFrIQUMAwsgA0EBayIFIAdBAWtzQR9LDQIgCCgCACEKDAMLQZUlQeEXQSJB3BcQCwALEFgACyAIKAIAIgogBUEFdkEAIANBIU8bQQJ0akEANgIACyAKIAdBA3ZB/P///wFxaiEDAkAgB0EfcSIHRQRAIABBAEwNASAAQSBtIQUgAEEfakE/TwRAIAMgBCAFQQJ0EDMaCyAAIAVBBXRrIgBBAEwNASADIAVBAnQiBWoiAyADKAIAQX9BICAAa3YiAEF/c3EgBCAFaigCACAAcXI2AgAMAQsgAEEATA0AQX8gB3QhDEEgIAdrIQkgAEEgTgRAIAxBf3MhDSADKAIAIQUDQCADIAUgDXEgBCgCACIFIAd0cjYCACADIAMoAgQgDHEgBSAJdnIiBTYCBCAEQQRqIQQgA0EEaiEDIABBP0shDiAAQSBrIQAgDg0ACyAAQQBMDQELIAMgAygCAEF/IAkgCSAAIAAgCUobIgVrdiAMcUF/c3EgBCgCAEF/QSAgAGt2cSIEIAd0cjYCACAAIAVrIgBBAEwNACADIAUgB2pBA3ZB/P///wFxaiIDIAMoAgBBf0EgIABrdkF/c3EgBCAFdnI2AgALIAYoAgwhACAGIAo2AgwgBiAIKAIEIgM2AhAgBiAIKAIINgIUIABFDQAgABAjIAYoAhAhAwsgBiADQQFqNgIQIAYoAgwgA0EDdkH8////AXFqIgAgACgCAEF+IAN3cTYCACABLwAAIQMLIANBB3EgC0EEdHJBCHIhAwsgASADOwAAIAhBEGokAAuPAQIBfwF9IwBBEGsiAyQAIANBCGogAEHoAGogAEHUAEHWACABQf4BcUECRhtqLwEAIgEgAC8BWCABQQdxGxAfQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIIAKUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsL2AICBH8BfSMAQSBrIgMkAAJAIAAoAgwiAQRAIAAgACoClAMgACoCmAMgAREnACIFIAVbDQEgA0GqHjYCACAAQQVB2CUgAxAsECQACyADQRBqIAAQMgJAIAMoAhAiAiADKAIUIgFyRQ0AAkADQCABIAIoAuwDIAIoAugDIgJrQQJ1SQRAIAIgAUECdGooAgAiASgC3AMNAyABLwAVIAEtABdBEHRyIgJBgOAAcUGAwABHBEAgAkEIdkEPcSICBH8gAgUgAC0AFUEEdgtBBUYEQCAALQAUQQhxDQQLIAEtAABBAnENAyAEIAEgBBshBAsgA0EQahAuIAMoAhQiASADKAIQIgJyDQEMAwsLEAIACyABIQQLIAMoAhgiAQRAA0AgASgCACECIAEQIyACIgENAAsLIARFBEAgACoCmAMhBQwBCyAEEE4gBCoCoAOSIQULIANBIGokACAFC6EDAQh/AkAgACgC6AMiBSAAKALsAyIHRwRAA0AgACAFKAIAIgIoAuQDRwRAAkAgACgC9AMoAgAiAQRAIAIgACAGIAERBgAiAQ0BC0GIBBAeIgEgAigCEDYCECABIAIpAgg3AgggASACKQIANwIAIAFBFGogAkEUakHoABArGiABQgA3AoABIAFB/ABqIgNBADsBACABQgA3AogBIAFCADcCkAEgAyACQfwAahCgASABQZgBaiACQZgBakHQAhArGiABQQA2AvADIAFCADcC6AMgAigC7AMiAyACKALoAyIERwRAIAMgBGsiBEEASA0FIAEgBBAeIgM2AuwDIAEgAzYC6AMgASADIARqNgLwAyACKALoAyIEIAIoAuwDIghHBEADQCADIAQoAgA2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASADNgLsAwsgASACKQL0AzcC9AMgASACKAKEBDYChAQgASACKQL8AzcC/AMgAUEANgLkAwsgBSABNgIAIAEgADYC5AMLIAZBAWohBiAFQQRqIgUgB0cNAAsLDwsQAgALUAACQAJAAkACQAJAIAIOBAQAAQIDCyAAIAEgAUEwahBDDwsgACABIAFBMGogAxBEDwsgACABIAFBMGoQQg8LECQACyAAIAEgAUEwaiADEEULcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt5AgF/AX0jAEEQayIDJAAgA0EIaiAAIAFBAnRB7CVqKAIAIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC1QAAkACQAJAAkACQCACDgQEAAECAwsgACABIAFBwgBqEEMPCyAAIAEgAUHCAGogAxBEDwsgACABIAFBwgBqEEIPCxAkAAsgACABIAFBwgBqIAMQRQsvACAAIAJFQQF0IgIgASADEGAgACACIAEQS5IgACACIAEgAxB/IAAgAiABEFKSkgvOAQIDfwJ9IwBBEGsiAyQAQQEhBCADQQhqIABB/ABqIgUgACABQQF0akH2AGoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALzgECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpB8gBqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQACwoAIABBMGtBCkkLBQAQAgALBAAgAAsUACAABEAgACAAKAIAKAIEEQAACwsrAQF/IAAoAgwiAQRAIAEQIwsgACgCACIBBEAgACABNgIEIAEQIwsgABAjC4EEAQN/IwBBEGsiAyQAIABCADcCBCAAQcEgOwAVIABCADcCDCAAQoCAgICAgIACNwIYIAAgAC0AF0HgAXE6ABcgACAALQAAQeABcUEFcjoAACAAIAAtABRBgAFxOgAUIABBIGpBAEHOABAqGiAAQgA3AXIgAEGEgBA2AW4gAEEANgF6IABCADcCgAEgAEIANwKIASAAQgA3ApABIABCADcCoAEgAEKAgICAgICA4P8ANwKYASAAQQA6AKgBIABBrAFqQQBBxAEQKhogAEHwAmohBCAAQbABaiECA0AgAkKAgID8i4CAwL9/NwIQIAJCgYCAgBA3AgggAkKAgID8i4CAwL9/NwIAIAJBGGoiAiAERw0ACyAAQoCAgPyLgIDAv383AvACIABCgICA/IuAgMC/fzcCgAMgAEKBgICAEDcC+AIgAEKAgID+h4CA4P8ANwKUAyAAQoCAgP6HgIDg/wA3AowDIABBiANqIgIgAi0AAEH4AXE6AAAgAEGcA2pBAEHYABAqGiAAQQA6AIQEIABBgICA/gc2AoAEIABBADoA/AMgAEGAgID+BzYC+AMgACABNgL0AyABBEAgAS0ACEEBcQRAIAAgAC0AFEHzAXFBCHI6ABQgACAALwAVQfD/A3FBBHI7ABULIANBEGokACAADwsgA0GiGjYCACADEHIQJAALMwAgACABQQJ0QfwlaigCAEECdGoqApQDIABBFGoiACABQQEgAhAiIAAgAUEBIAIQIZKSC44DAQp/IwBB0AJrIgEkACAAKALoAyIDIAAoAuwDIgVHBEAgAUGMAmohBiABQeABaiEHIAFBIGohCCABQRxqIQkgAUEQaiEEA0AgAygCACICLQAXQRB0QYCAMHFBgIAgRgRAIAFBCGpBAEHEAhAqGiABQYCAgP4HNgIMIARBADoACCAEQgA3AgAgCUEAQcQBECoaIAghAANAIABCgICA/IuAgMC/fzcCECAAQoGAgIAQNwIIIABCgICA/IuAgMC/fzcCACAAQRhqIgAgB0cNAAsgAUKAgID8i4CAwL9/NwPwASABQoGAgIAQNwPoASABQoCAgPyLgIDAv383A+ABIAFCgICA/oeAgOD/ADcChAIgAUKAgID+h4CA4P8ANwL8ASABIAEtAPgBQfgBcToA+AEgBkEAQcAAECoaIAJBmAFqIAFBCGpBxAIQKxogAkIANwKMAyACIAItAAAiAEEBciIKQfsBcSAKIABBBHEbOgAAIAIQTyACEF4LIANBBGoiAyAFRw0ACwsgAUHQAmokAAtMAQF/QQEhAQJAIAAtAB5BB3ENACAALQAiQQdxDQAgAC0ALkEHcQ0AIAAtACpBB3ENACAALQAmQQdxDQAgAC0AKEEHcUEARyEBCyABC3YCAX8BfSMAQRBrIgQkACAEQQhqIAAgAUECdEHcJWooAgAgAhBQQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAACXQwAAAAAgBSAFWxsLogQCBn8CfgJ/QQghBAJAAkAgAEFHSw0AA0BBCCAEIARBCE0bIQRB6DopAwAiBwJ/QQggAEEDakF8cSAAQQhNGyIAQf8ATQRAIABBA3ZBAWsMAQsgAEEdIABnIgFrdkEEcyABQQJ0a0HuAGogAEH/H00NABpBPyAAQR4gAWt2QQJzIAFBAXRrQccAaiIBIAFBP08bCyIDrYgiCFBFBEADQCAIIAh6IgiIIQcCfiADIAinaiIDQQR0IgJB6DJqKAIAIgEgAkHgMmoiBkcEQCABIAQgABBjIgUNBSABKAIEIgUgASgCCDYCCCABKAIIIAU2AgQgASAGNgIIIAEgAkHkMmoiAigCADYCBCACIAE2AgAgASgCBCABNgIIIANBAWohAyAHQgGIDAELQeg6Qeg6KQMAQn4gA62JgzcDACAHQgGFCyIIQgBSDQALQeg6KQMAIQcLAkAgB1BFBEBBPyAHeadrIgZBBHQiAkHoMmooAgAhAQJAIAdCgICAgARUDQBB4wAhAyABIAJB4DJqIgJGDQADQCADRQ0BIAEgBCAAEGMiBQ0FIANBAWshAyABKAIIIgEgAkcNAAsgAiEBCyAAQTBqEGQNASABRQ0EIAEgBkEEdEHgMmoiAkYNBANAIAEgBCAAEGMiBQ0EIAEoAggiASACRw0ACwwECyAAQTBqEGRFDQMLQQAhBSAEIARBAWtxDQEgAEFHTQ0ACwsgBQwBC0EACwtwAgF/AX0jAEEQayIEJAAgBEEIaiAAIAFBAnRB7CVqKAIAIAIQKEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAIAUgBVsbC6ADAQN/IAEgAEEEaiIEakEBa0EAIAFrcSIFIAJqIAAgACgCACIBakEEa00EfyAAKAIEIgMgACgCCDYCCCAAKAIIIAM2AgQgBCAFRwRAIAAgAEEEaygCAEF+cWsiAyAFIARrIgQgAygCAGoiBTYCACAFQXxxIANqQQRrIAU2AgAgACAEaiIAIAEgBGsiATYCAAsCQCABIAJBGGpPBEAgACACakEIaiIDIAEgAmtBCGsiATYCACABQXxxIANqQQRrIAFBAXI2AgAgAwJ/IAMoAgBBCGsiAUH/AE0EQCABQQN2QQFrDAELIAFnIQQgAUEdIARrdkEEcyAEQQJ0a0HuAGogAUH/H00NABpBPyABQR4gBGt2QQJzIARBAXRrQccAaiIBIAFBP08bCyIBQQR0IgRB4DJqNgIEIAMgBEHoMmoiBCgCADYCCCAEIAM2AgAgAygCCCADNgIEQeg6Qeg6KQMAQgEgAa2GhDcDACAAIAJBCGoiATYCACABQXxxIABqQQRrIAE2AgAMAQsgACABakEEayABNgIACyAAQQRqBSADCwvmAwEFfwJ/QbAwKAIAIgEgAEEHakF4cSIDaiECAkAgA0EAIAEgAk8bDQAgAj8AQRB0SwRAIAIQFkUNAQtBsDAgAjYCACABDAELQfw7QTA2AgBBfwsiAkF/RwRAIAAgAmoiA0EQayIBQRA2AgwgAUEQNgIAAkACf0HgOigCACIABH8gACgCCAVBAAsgAkYEQCACIAJBBGsoAgBBfnFrIgRBBGsoAgAhBSAAIAM2AghBcCAEIAVBfnFrIgAgACgCAGpBBGstAABBAXFFDQEaIAAoAgQiAyAAKAIINgIIIAAoAgggAzYCBCAAIAEgAGsiATYCAAwCCyACQRA2AgwgAkEQNgIAIAIgAzYCCCACIAA2AgRB4DogAjYCAEEQCyACaiIAIAEgAGsiATYCAAsgAUF8cSAAakEEayABQQFyNgIAIAACfyAAKAIAQQhrIgFB/wBNBEAgAUEDdkEBawwBCyABQR0gAWciA2t2QQRzIANBAnRrQe4AaiABQf8fTQ0AGkE/IAFBHiADa3ZBAnMgA0EBdGtBxwBqIgEgAUE/TxsLIgFBBHQiA0HgMmo2AgQgACADQegyaiIDKAIANgIIIAMgADYCACAAKAIIIAA2AgRB6DpB6DopAwBCASABrYaENwMACyACQX9HC80BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQSBqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQAC0ABAX8CQEGsOy0AAEEBcQRAQag7KAIAIQIMAQtBAUGAJxAMIQJBrDtBAToAAEGoOyACNgIACyACIAAgAUEAEBMLzQECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBMmoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALDwAgASAAKAIAaiACOQMACw0AIAEgACgCAGorAwALCwAgAARAIAAQIwsLxwECBH8CfSMAQRBrIgIkACACQQhqIABB/ABqIgQgAEEeaiIFLwEAEB9BASEDAkACQCACKgIIIgcgASoCACIGXARAIAcgB1sEQCABLQAEIQEMAgsgBiAGXCEDCyABLQAEIQEgA0UNACACLQAMIAFB/wFxRg0BCyAEIAUgBiABEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyACQRBqJAALlgMCA34CfyAAvSICQjSIp0H/D3EiBEH/D0YEQCAARAAAAAAAAPA/oiIAIACjDwsgAkIBhiIBQoCAgICAgIDw/wBYBEAgAEQAAAAAAAAAAKIgACABQoCAgICAgIDw/wBRGw8LAn4gBEUEQEEAIQQgAkIMhiIBQgBZBEADQCAEQQFrIQQgAUIBhiIBQgBZDQALCyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgAUIBhiEBIARBAWsiBEH/B0oNAAtB/wchBAsCQCABQoCAgICAgIAIfSIDQgBTDQAgAyIBQgBSDQAgAEQAAAAAAAAAAKIPCyABQv////////8HWARAA0AgBEEBayEEIAFCgICAgICAgARUIQUgAUIBhiEBIAUNAAsLIAJCgICAgICAgICAf4MgAUKAgICAgICACH0gBK1CNIaEIAFBASAEa62IIARBAEobhL8LiwEBA38DQCAAQQR0IgFB5DJqIAFB4DJqIgI2AgAgAUHoMmogAjYCACAAQQFqIgBBwABHDQALQTAQZBpBmDtBBjYCAEGcO0EANgIAEJwBQZw7Qcg7KAIANgIAQcg7QZg7NgIAQcw7QcMBNgIAQdA7QQA2AgAQjwFB0DtByDsoAgA2AgBByDtBzDs2AgALjwEBAn8jAEEQayIEJAACfUMAAAAAIAAvABVBgOAAcUUNABogBEEIaiAAQRRqIgBBASACQQJGQQF0IAFB/gFxQQJHGyIFIAIQNgJAIAQtAAxFDQAgBEEIaiAAIAUgAhA2IAQtAAxBA0YNACAAIAEgAiADEIEBDAELIAAgASACIAMQgAGMCyEDIARBEGokACADC4QBAQJ/AkACQCAAKALoAyICIAAoAuwDIgNGDQADQCACKAIAIAFGDQEgAkEEaiICIANHDQALDAELIAIgA0YNACABLQAXQRB0QYCAMHFBgIAgRgRAIAAgACgC4ANBAWs2AuADCyACIAJBBGoiASADIAFrEDMaIAAgA0EEazYC7ANBAQ8LQQALCwBByDEgACABEEkLPAAgAEUEQCACQQVHQQAgAhtFBEBBuDAgAyAEEEkaDwsgAyAEEHAaDwsgACABIAIgAyAEIAAoAgQRDQAaCyYBAX8jAEEQayIBJAAgASAANgIMQbgwQdglIAAQSRogAUEQaiQAC4cDAwN/BXwCfSAAKgKgA7siBiACoCECIAAqApwDuyIHIAGgIQggACgC9AMqAhgiC0MAAAAAXARAIAAqApADuyEJIAAqAowDIQwgACAHIAu7IgFBACAALQAAQRBxIgNBBHYiBBA0OAKcAyAAIAYgAUEAIAQQNDgCoAMgASAMuyIHohBsIgYgBmIiBEUgBplELUMc6+I2Gj9jcUUEQCAEIAZEAAAAAAAA8L+gmUQtQxzr4jYaP2NFciEFCyACIAmgIQogCCAHoCEHAn8gASAJohBsIgYgBmIiBEUEQEEAIAaZRC1DHOviNho/Yw0BGgsgBCAGRAAAAAAAAPC/oJlELUMc6+I2Gj9jRXILIQQgACAHIAEgA0EARyIDIAVxIAMgBUEBc3EQNCAIIAFBACADEDSTOAKMAyAAIAogASADIARxIAMgBEEBc3EQNCACIAFBACADEDSTOAKQAwsgACgC6AMiAyAAKALsAyIARwRAA0AgAygCACAIIAIQcyADQQRqIgMgAEcNAAsLC1UBAX0gAEEUaiIAIAEgAkECSSICIAQgBRA1IQYgACABIAIgBCAFEC0iBUMAAAAAYCADIAVecQR9IAUFIAZDAAAAAGBFBEAgAw8LIAYgAyADIAZdGwsLeAEBfwJAIAAoAgAiAgRAA0AgAUUNAiACIAEoAgQ2AgQgAiABKAIINgIIIAEoAgAhASAAKAIAIQAgAigCACICDQALCyAAIAEQPA8LAkAgAEUNACAAKAIAIgFFDQAgAEEANgIAA0AgASgCACEAIAEQIyAAIgENAAsLC5kCAgZ/AX0gAEEUaiEHQQMhBCAALQAUQQJ2QQNxIQUCQAJ/AkAgAUEBIAAoAuQDGyIIQQJGBEACQCAFQQJrDgIEAAILQQIhBAwDC0ECIQRBACAFQQFLDQEaCyAECyEGIAUhBAsgACAEIAggAyACIARBAkkiBRsQbiEKIAAgBiAIIAIgAyAFGxBuIQMgAEGcA2oiAEEBIAFBAkZBAXQiCCAFG0ECdGogCiAHIAQgASACECKSOAIAIABBAyABQQJHQQF0IgkgBRtBAnRqIAogByAEIAEgAhAhkjgCACAAIAhBASAGQQF2IgQbQQJ0aiADIAcgBiABIAIQIpI4AgAgACAJQQMgBBtBAnRqIAMgByAGIAEgAhAhkjgCAAvUAgEDfyMAQdACayIBJAAgAUEIakEAQcQCECoaIAFBADoAGCABQgA3AxAgAUGAgID+BzYCDCABQRxqQQBBxAEQKhogAUHgAWohAyABQSBqIQIDQCACQoCAgPyLgIDAv383AhAgAkKBgICAEDcCCCACQoCAgPyLgIDAv383AgAgAkEYaiICIANHDQALIAFCgICA/IuAgMC/fzcD8AEgAUKBgICAEDcD6AEgAUKAgID8i4CAwL9/NwPgASABQoCAgP6HgIDg/wA3AoQCIAFCgICA/oeAgOD/ADcC/AEgASABLQD4AUH4AXE6APgBIAFBjAJqQQBBwAAQKhogAEGYAWogAUEIakHEAhArGiAAQgA3AowDIAAgAC0AAEEBcjoAACAAEE8gACgC6AMiAiAAKALsAyIARwRAA0AgAigCABB3IAJBBGoiAiAARw0ACwsgAUHQAmokAAuuAgIKfwJ9IwBBIGsiASQAIAFBgAI7AB4gAEHuAGohByAAQfgDaiEFIABB8gBqIQggAEH2AGohCSAAQfwAaiEDQQAhAANAIAFBEGogAyAJIAFBHmogBGotAAAiAkEBdCIEaiIGLwEAEB8CQAJAIAEtABRFDQAgAUEIaiADIAYvAQAQHyABIAMgBCAIai8BABAfIAEtAAwgAS0ABEcNAAJAIAEqAggiDCAMXCIKIAEqAgAiCyALXHJFBEAgDCALk4tDF7fROF0NAQwCCyAKRSALIAtbcg0BCyABQRBqIAMgBi8BABAfDAELIAFBEGogAyAEIAdqLwEAEB8LIAUgAkEDdGoiAiABLQAUOgAEIAIgASgCEDYCAEEBIQQgACECQQEhACACRQ0ACyABQSBqJAALMgACf0EAIAAvABVBgOAAcUGAwABGDQAaQQEgABA7QwAAAABcDQAaIAAQQEMAAAAAXAsLewEBfSADIASTIgMgA1sEfUMAAAAAIABBFGoiACABIAIgBSAGEDUiByAEkyAHIAdcGyIHQ///f38gACABIAIgBSAGEC0iBSAEkyAFIAVcGyIEIAMgAyAEXhsiAyADIAddGyAHIAMgAyADXBsgAyADWyAHIAdbcRsFIAMLC98FAwR/BX0BfCAJQwAAAABdIAhDAAAAAF1yBH8gDQUgBSESIAEhEyADIRQgByERIAwqAhgiFUMAAAAAXARAIAG7IBW7IhZBAEEAEDQhEyADuyAWQQBBABA0IRQgBbsgFkEAQQAQNCESIAe7IBZBAEEAEDQhEQsCf0EAIAAgBEcNABogEiATk4tDF7fROF0gEyATXCINIBIgElxyRQ0AGkEAIBIgElsNABogDQshDAJAIAIgBkcNACAUIBRcIg0gESARXHJFBEAgESAUk4tDF7fROF0hDwwBCyARIBFbDQAgDSEPC0EBIQ5BASENAkAgDA0AIAEgCpMhAQJAIABFBEAgASABXCIAIAggCFxyRQRAQQAhDCABIAiTi0MXt9E4XUUNAgwDC0EAIQwgCCAIWw0BIAANAgwBCyAAQQJGIQwgAEECRw0AIARBAUcNACABIAhgDQECQCAIIAhcIgAgASABXHJFBEAgASAIk4tDF7fROF1FDQEMAwtBACENIAEgAVsNAkEBIQ0gAA0CC0EAIQ0MAQtBACENIAggCFwiACABIAVdRXINACAMRSABIAFcIhAgBSAFXHIgBEECR3JyDQBBASENIAEgCGANAEEAIQ0gACAQcg0AIAEgCJOLQxe30ThdIQ0LAkAgDw0AIAMgC5MhAQJAAkAgAkUEQCABIAFcIgIgCSAJXHJFBEBBACEAIAEgCZOLQxe30ThdRQ0CDAQLQQAhACAJIAlbDQEgAg0DDAELIAJBAkYhACACQQJHIAZBAUdyDQAgASAJYARADAMLIAkgCVwiACABIAFcckUEQCABIAmTi0MXt9E4XUUNAgwDC0EAIQ4gASABWw0CQQEhDiAADQIMAQsgCSAJXCICIAEgB11Fcg0AIABFIAEgAVwiBCAHIAdcciAGQQJHcnINACABIAlgDQFBACEOIAIgBHINASABIAmTi0MXt9E4XSEODAELQQAhDgsgDSAOcQsL4wEBA38jAEEQayIBJAACQAJAIAAtABRBCHFFDQBBASEDIAAvABVB8AFxQdAARg0AIAEgABAyIAEoAgQhAAJAIAEoAgAiAkUEQEEAIQMgAEUNAQsDQCACKALsAyACKALoAyICa0ECdSAATQ0DIAIgAEECdGooAgAiAC8AFSAALQAXQRB0ciIAQYDgAHFBgMAARyAAQYAecUGACkZxIgMNASABEC4gASgCBCIAIAEoAgAiAnINAAsLIAEoAggiAEUNAANAIAAoAgAhAiAAECMgAiIADQALCyABQRBqJAAgAw8LEAIAC7IBAQR/AkACQCAAKAIEIgMgACgCACIEKALsAyAEKALoAyIBa0ECdUkEQCABIANBAnRqIQIDQCACKAIAIgEtABdBEHRBgIAwcUGAgCBHDQMgASgC7AMgASgC6ANGDQJBDBAeIgIgBDYCBCACIAM2AgggAiAAKAIINgIAQQAhAyAAQQA2AgQgACABNgIAIAAgAjYCCCABIQQgASgC6AMiAiABKALsA0cNAAsLEAIACyAAEC4LC4wQAgx/B30jAEEgayINJAAgDUEIaiABEDIgDSgCCCIOIA0oAgwiDHIEQCADQQEgAxshFSAAQRRqIRQgBUEBaiEWA0ACQAJAAn8CQAJAAkACQAJAIAwgDigC7AMgDigC6AMiDmtBAnVJBEAgDiAMQQJ0aigCACILLwAVIAstABdBEHRyIgxBgIAwcUGAgBBGDQgCQAJAIAxBDHZBA3EOAwEKAAoLIAkhFyAKIRogASgC9AMtABRBBHFFBEAgACoClAMgFEECQQEQMCAUQQJBARAvkpMhFyAAKgKYAyAUQQBBARAwIBRBAEEBEC+SkyEaCyALQRRqIQ8gAS0AFEECdkEDcSEQAkACfwJAIANBAkciE0UEQEEAIQ5BAyEMAkAgEEECaw4CBAACC0ECIQwMAwtBAiEMQQAgEEEBSw0BGgsgDAshDiAQIQwLIA9BAkEBIBcQIiAPQQJBASAXECGSIR0gD0EAQQEgFxAiIRwgD0EAQQEgFxAhIRsgCyoC+AMhGAJAAkACQAJAIAstAPwDQQFrDgIBAAILIBggF5RDCtcjPJQhGAsgGEMAAAAAYEUNACAdIAsgA0EAIBcgFxAxkiEYDAELIA1BGGogDyALQTJqIhAgAxBFQwAAwH8hGCANLQAcRQ0AIA1BGGogDyAQIAMQRCANLQAcRQ0AIA1BGGogDyAQIAMQRSANLQAcQQNGDQAgDUEYaiAPIBAgAxBEIA0tABxBA0YNACALQQIgAyAAKgKUAyAUQQIgAxBLIBRBAiADEFKSkyAPQQIgAyAXEFEgD0ECIAMgFxCDAZKTIBcgFxAlIRgLIBwgG5IhHCALKgKABCEZAkACQAJAIAstAIQEQQFrDgIBAAILIBkgGpRDCtcjPJQhGQsgGUMAAAAAYEUNACAcIAsgA0EBIBogFxAxkiEZDAMLIA1BGGogDyALQTJqIhAQQwJAIA0tABxFDQAgDUEYaiAPIBAQQiANLQAcRQ0AIA1BGGogDyAQEEMgDS0AHEEDRg0AIA1BGGogDyAQEEIgDS0AHEEDRg0AIAtBACADIAAqApgDIBRBACADEEsgFEEAIAMQUpKTIA9BACADIBoQUSAPQQAgAyAaEIMBkpMgGiAXECUhGQwDC0MAAMB/IRkgGCAYXA0GIAtB/ABqIhAgC0H6AGoiEi8BABAgIhsgG1sNAwwFCyALLQAAQQhxDQggCxBPIAAgCyACIAstABRBA3EiDCAVIAwbIAQgFiAGIAsqApwDIAeSIAsqAqADIAiSIAkgChB+IBFyIQxBACERIAxBAXFFDQhBASERIAsgCy0AAEEBcjoAAAwICxACAAsgGCAYXCAZIBlcRg0BIAtB/ABqIhAgC0H6AGoiEi8BABAgIhsgG1wNASAYIBhcBEAgGSAckyAQIAsvAXoQIJQgHZIhGAwCCyAZIBlbDQELIBwgGCAdkyAQIBIvAQAQIJWSIRkLIBggGFwNASAZIBlbDQMLQQAMAQtBAQshEiALIBcgGCACQQFHIAxBAklxIBdDAAAAAF5xIBJxIhAbIBkgA0ECIBIgEBsgGSAZXCAXIBpBAEEGIAQgBSAGED0aIAsqApQDIA9BAkEBIBcQIiAPQQJBASAXECGSkiEYIAsqApgDIA9BAEEBIBcQIiAPQQBBASAXECGSkiEZC0EBIRAgCyAYIBkgA0EAQQAgFyAaQQFBASAEIAUgBhA9GiAAIAEgCyADIAxBASAXIBoQggEgACABIAsgAyAOQQAgFyAaEIIBIBFBAXFFBEAgCy0AAEEBcSEQCyABLQAUIhJBAnZBA3EhDAJAAn8CQAJAAkACQAJAAkACQAJAAkACfwJAIBNFBEBBACERQQMhDiAMQQJrDgIDDQELQQIhDkEAIAxBAUsNARoLIA4LIREgEkEEcUUNBCASQQhxRQ0BIAwhDgsgASEMIA8QXw0BDAILAkAgCy0ANEEHcQ0AIAstADhBB3ENACALLQBCQQdxDQAgDCEOIAEhDCALQUBrLwEAQQdxRQ0CDAELIAwhDgsgACEMCwJ/AkACQAJAIA5BAWsOAwABAgULIAtBmANqIQ4gC0GoA2ohE0EBIRIgDEGYA2oMAgsgC0GUA2ohDiALQZwDaiETQQIhEiAMQZQDagwBCyALQZQDaiEOIAtBpANqIRNBACESIAxBlANqCyEMIAsgEkECdGogDCoCACAOKgIAkyATKgIAkzgCnAMLIBFBAXFFDQUCQAJAIBFBAnEEQCABIQwgDxBfDQEMAgsgCy0ANEEHcQ0AIAstADhBB3ENACALLQBCQQdxDQAgASEMIAtBQGsvAQBBB3FFDQELIAAhDAsgEUEBaw4DAQIDAAsQJAALIAtBmANqIREgC0GoA2ohDkEBIRMgDEGYA2oMAgsgC0GUA2ohESALQZwDaiEOQQIhEyAMQZQDagwBCyALQZQDaiERIAtBpANqIQ5BACETIAxBlANqCyEMIAsgE0ECdGogDCoCACARKgIAkyAOKgIAkzgCnAMLIAsqAqADIRsgCyoCnAMgB0MAAAAAIA8QXxuTIRcCfQJAIAstADRBB3ENACALLQA4QQdxDQAgCy0AQkEHcQ0AIAtBQGsvAQBBB3ENAEMAAAAADAELIAgLIRogCyAXOAKcAyALIBsgGpM4AqADIBAhEQsgDUEIahAuIA0oAgwiDCANKAIIIg5yDQALCyANKAIQIgwEQANAIAwoAgAhACAMECMgACIMDQALCyANQSBqJAAgEUEBcQt2AgF/AX0jAEEQayIEJAAgBEEIaiAAIAFBAnRB7CVqKAIAIAIQUEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAl0MAAAAAIAUgBVsbC3gCAX8BfSMAQRBrIgQkACAEQQhqIABBAyACQQJHQQF0IAFB/gFxQQJHGyACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt4AgF/AX0jAEEQayIEJAAgBEEIaiAAQQEgAkECRkEBdCABQf4BcUECRxsgAhA2QwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAAAgBSAFWxsLoA0BBH8jAEEQayIJJAAgCUEIaiACQRRqIgggA0ECRkEBdEEBIARB/gFxQQJGIgobIgsgAxA2IAYgByAKGyEHAkACQAJAAkACQAJAIAktAAxFDQAgCUEIaiAIIAsgAxA2IAktAAxBA0YNACAIIAQgAyAHEIEBIABBFGogBCADEDCSIAggBCADIAcQIpIhBkEBIQMCQAJ/AkACQAJAAkAgBA4EAgMBAAcLQQIhAwwBC0EAIQMLIAMgC0YNAgJAAkAgBA4EAgIAAQYLIABBlANqIQNBAAwCCyAAQZQDaiEDQQAMAQsgAEGYA2ohA0EBCyEAIAMqAgAgAiAAQQJ0aioClAOTIAaTIQYLIAIgBEECdEHcJWooAgBBAnRqIAY4ApwDDAULIAlBCGogCCADQQJHQQF0QQMgChsiCiADEDYCQCAJLQAMRQ0AIAlBCGogCCAKIAMQNiAJLQAMQQNGDQACfwJAAkACQCAEDgQCAgABBQsgAEGUA2ohBUEADAILIABBlANqIQVBAAwBCyAAQZgDaiEFQQELIQEgBSoCACACQZQDaiIFIAFBAnRqKgIAkyAAQRRqIAQgAxAvkyAIIAQgAyAHECGTIAggBCADIAcQgAGTIQZBASEDAkACfwJAAkACQAJAIAQOBAIDAQAHC0ECIQMMAQtBACEDCyADIAtGDQICQAJAIAQOBAICAAEGCyAAQZQDaiEDQQAMAgsgAEGUA2ohA0EADAELIABBmANqIQNBAQshACADKgIAIAUgAEECdGoqAgCTIAaTIQYLIAIgBEECdEHcJWooAgBBAnRqIAY4ApwDDAULAkACQAJAIAUEQCABLQAUQQR2QQdxIgBBBUsNCEEBIAB0IgBBMnENASAAQQlxBEAgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDDAkLIAEgBEECdEHsJWooAgBBAnRqIgAqArwDIAggBCADIAYQYpIhBiACKAL0Ay0AFEECcUUEQCAGIAAqAswDkiEGCwJAAkACQAJAIAQOBAEBAgAICyABKgKUAyACKgKUA5MhB0ECIQMMAgsgASoCmAMgAioCmAOTIQdBASEDAkAgBA4CAgAHC0EDIQMMAQsgASoClAMgAioClAOTIQdBACEDCyACIANBAnRqIAcgBpM4ApwDDAgLIAIvABZBD3EiBUUEQCABLQAVQQR2IQULIAVBBUYEQCABLQAUQQhxRQ0CCyABLwAVQYCAA3FBgIACRgRAIAVBAmsOAgEHAwsgBUEISw0HQQEgBXRB8wNxDQYgBUECRw0CC0EAIQACfQJ/AkACQAJAAkACfwJAAkACQCAEDgQCAgABBAsgASoClAMhB0ECIQAgAUG8A2oMAgsgASoClAMhByABQcQDagwBCyABKgKYAyEHAkACQCAEDgIAAQMLQQMhACABQcADagwBC0EBIQAgAUHIA2oLIQUgByAFKgIAkyABQbwDaiIIIABBAnRqKgIAkyIHIAIoAvQDLQAUQQJxDQUaAkAgBA4EAAIDBAELQQMhACABQdADagwECxAkAAtBASEAIAFB2ANqDAILQQIhACABQcwDagwBC0EAIQAgAUHUA2oLIQUgByAFKgIAkyABIABBAnRqKgLMA5MLIAIgBEECdCIFQfwlaigCAEECdGoqApQDIAJBFGoiACAEQQEgBhAiIAAgBEEBIAYQIZKSk0MAAAA/lCAIIAVB3CVqKAIAIgVBAnRqKgIAkiAAIAQgAyAGEEGSIQYgAiAFQQJ0aiACKAL0Ay0AFEECcQR9IAYFIAYgASAFQQJ0aioCzAOSCzgCnAMMBgsgAS8AFUGAgANxQYCAAkcNBAsgASAEQQJ0QewlaigCAEECdGoiACoCvAMgCCAEIAMgBhBikiEGIAIoAvQDLQAUQQJxRQRAIAYgACoCzAOSIQYLAkACQCAEDgQBAQMAAgsgASoClAMgAioClAOTIQdBAiEDDAMLIAEqApgDIAIqApgDkyEHQQEhAwJAIAQOAgMAAQtBAyEDDAILECQACyABKgKUAyACKgKUA5MhB0EAIQMLIAIgA0ECdGogByAGkzgCnAMMAQsgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDCyAJQRBqJAALcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QewlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwscACAAIAFBCCACpyACQiCIpyADpyADQiCIpxAVCwUAEFgACzkAIABFBEBBAA8LAn8gAUGAf3FBgL8DRiABQf8ATXJFBEBB/DtBGTYCAEF/DAELIAAgAToAAEEBCwvEAgACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACgsMCgsCAwQFDAsMDAoLBwgJCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCwALIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAtdAQR/IAAoAgAhAgNAIAIsAAAiAxBXBEBBfyEEIAAgAkEBaiICNgIAIAFBzJmz5gBNBH9BfyADQTBrIgMgAUEKbCIEaiADIARB/////wdzShsFIAQLIQEMAQsLIAELrhQCEn8BfiMAQdAAayIIJAAgCCABNgJMIAhBN2ohFyAIQThqIRQCQAJAAkACQANAIAEhDSAHIA5B/////wdzSg0BIAcgDmohDgJAAkACQCANIgctAAAiCQRAA0ACQAJAIAlB/wFxIgFFBEAgByEBDAELIAFBJUcNASAHIQkDQCAJLQABQSVHBEAgCSEBDAILIAdBAWohByAJLQACIQogCUECaiIBIQkgCkElRg0ACwsgByANayIHIA5B/////wdzIhhKDQcgAARAIAAgDSAHECYLIAcNBiAIIAE2AkwgAUEBaiEHQX8hEgJAIAEsAAEiChBXRQ0AIAEtAAJBJEcNACABQQNqIQcgCkEwayESQQEhFQsgCCAHNgJMQQAhDAJAIAcsAAAiCUEgayIBQR9LBEAgByEKDAELIAchCkEBIAF0IgFBidEEcUUNAANAIAggB0EBaiIKNgJMIAEgDHIhDCAHLAABIglBIGsiAUEgTw0BIAohB0EBIAF0IgFBidEEcQ0ACwsCQCAJQSpGBEACfwJAIAosAAEiARBXRQ0AIAotAAJBJEcNACABQQJ0IARqQcABa0EKNgIAIApBA2ohCUEBIRUgCiwAAUEDdCADakGAA2soAgAMAQsgFQ0GIApBAWohCSAARQRAIAggCTYCTEEAIRVBACETDAMLIAIgAigCACIBQQRqNgIAQQAhFSABKAIACyETIAggCTYCTCATQQBODQFBACATayETIAxBgMAAciEMDAELIAhBzABqEIkBIhNBAEgNCCAIKAJMIQkLQQAhB0F/IQsCfyAJLQAAQS5HBEAgCSEBQQAMAQsgCS0AAUEqRgRAAn8CQCAJLAACIgEQV0UNACAJLQADQSRHDQAgAUECdCAEakHAAWtBCjYCACAJQQRqIQEgCSwAAkEDdCADakGAA2soAgAMAQsgFQ0GIAlBAmohAUEAIABFDQAaIAIgAigCACIKQQRqNgIAIAooAgALIQsgCCABNgJMIAtBf3NBH3YMAQsgCCAJQQFqNgJMIAhBzABqEIkBIQsgCCgCTCEBQQELIQ8DQCAHIRFBHCEKIAEiECwAACIHQfsAa0FGSQ0JIBBBAWohASAHIBFBOmxqQf8qai0AACIHQQFrQQhJDQALIAggATYCTAJAAkAgB0EbRwRAIAdFDQsgEkEATgRAIAQgEkECdGogBzYCACAIIAMgEkEDdGopAwA3A0AMAgsgAEUNCCAIQUBrIAcgAiAGEIcBDAILIBJBAE4NCgtBACEHIABFDQcLIAxB//97cSIJIAwgDEGAwABxGyEMQQAhEkGPCSEWIBQhCgJAAkACQAJ/AkACQAJAAkACfwJAAkACQAJAAkACQAJAIBAsAAAiB0FfcSAHIAdBD3FBA0YbIAcgERsiB0HYAGsOIQQUFBQUFBQUFA4UDwYODg4UBhQUFBQCBQMUFAkUARQUBAALAkAgB0HBAGsOBw4UCxQODg4ACyAHQdMARg0JDBMLIAgpA0AhGUGPCQwFC0EAIQcCQAJAAkACQAJAAkACQCARQf8BcQ4IAAECAwQaBQYaCyAIKAJAIA42AgAMGQsgCCgCQCAONgIADBgLIAgoAkAgDqw3AwAMFwsgCCgCQCAOOwEADBYLIAgoAkAgDjoAAAwVCyAIKAJAIA42AgAMFAsgCCgCQCAOrDcDAAwTC0EIIAsgC0EITRshCyAMQQhyIQxB+AAhBwsgFCENIAgpA0AiGVBFBEAgB0EgcSEQA0AgDUEBayINIBmnQQ9xQZAvai0AACAQcjoAACAZQg9WIQkgGUIEiCEZIAkNAAsLIAxBCHFFIAgpA0BQcg0DIAdBBHZBjwlqIRZBAiESDAMLIBQhByAIKQNAIhlQRQRAA0AgB0EBayIHIBmnQQdxQTByOgAAIBlCB1YhDSAZQgOIIRkgDQ0ACwsgByENIAxBCHFFDQIgCyAUIA1rIgdBAWogByALSBshCwwCCyAIKQNAIhlCAFMEQCAIQgAgGX0iGTcDQEEBIRJBjwkMAQsgDEGAEHEEQEEBIRJBkAkMAQtBkQlBjwkgDEEBcSISGwshFiAZIBQQRyENCyAPQQAgC0EASBsNDiAMQf//e3EgDCAPGyEMIAgpA0AiGUIAUiALckUEQCAUIQ1BACELDAwLIAsgGVAgFCANa2oiByAHIAtIGyELDAsLQQAhDAJ/Qf////8HIAsgC0H/////B08bIgoiEUEARyEQAkACfwJAAkAgCCgCQCIHQY4lIAcbIg0iD0EDcUUgEUVyDQADQCAPLQAAIgxFDQIgEUEBayIRQQBHIRAgD0EBaiIPQQNxRQ0BIBENAAsLIBBFDQICQCAPLQAARSARQQRJckUEQANAIA8oAgAiB0F/cyAHQYGChAhrcUGAgYKEeHENAiAPQQRqIQ8gEUEEayIRQQNLDQALCyARRQ0DC0EADAELQQELIRADQCAQRQRAIA8tAAAhDEEBIRAMAQsgDyAMRQ0CGiAPQQFqIQ8gEUEBayIRRQ0BQQAhEAwACwALQQALIgcgDWsgCiAHGyIHIA1qIQogC0EATgRAIAkhDCAHIQsMCwsgCSEMIAchCyAKLQAADQ0MCgsgCwRAIAgoAkAMAgtBACEHIABBICATQQAgDBApDAILIAhBADYCDCAIIAgpA0A+AgggCCAIQQhqIgc2AkBBfyELIAcLIQlBACEHAkADQCAJKAIAIg1FDQEgCEEEaiANEIYBIgpBAEgiDSAKIAsgB2tLckUEQCAJQQRqIQkgCyAHIApqIgdLDQEMAgsLIA0NDQtBPSEKIAdBAEgNCyAAQSAgEyAHIAwQKSAHRQRAQQAhBwwBC0EAIQogCCgCQCEJA0AgCSgCACINRQ0BIAhBBGogDRCGASINIApqIgogB0sNASAAIAhBBGogDRAmIAlBBGohCSAHIApLDQALCyAAQSAgEyAHIAxBgMAAcxApIBMgByAHIBNIGyEHDAgLIA9BACALQQBIGw0IQT0hCiAAIAgrA0AgEyALIAwgByAFERwAIgdBAE4NBwwJCyAIIAgpA0A8ADdBASELIBchDSAJIQwMBAsgBy0AASEJIAdBAWohBwwACwALIAANByAVRQ0CQQEhBwNAIAQgB0ECdGooAgAiAARAIAMgB0EDdGogACACIAYQhwFBASEOIAdBAWoiB0EKRw0BDAkLC0EBIQ4gB0EKTw0HA0AgBCAHQQJ0aigCAA0BIAdBAWoiB0EKRw0ACwwHC0EcIQoMBAsgCyAKIA1rIhAgCyAQShsiCSASQf////8Hc0oNAkE9IQogEyAJIBJqIgsgCyATSBsiByAYSg0DIABBICAHIAsgDBApIAAgFiASECYgAEEwIAcgCyAMQYCABHMQKSAAQTAgCSAQQQAQKSAAIA0gEBAmIABBICAHIAsgDEGAwABzECkMAQsLQQAhDgwDC0E9IQoLQfw7IAo2AgALQX8hDgsgCEHQAGokACAOC9kCAQR/IwBB0AFrIgUkACAFIAI2AswBIAVBoAFqIgJBAEEoECoaIAUgBSgCzAE2AsgBAkBBACABIAVByAFqIAVB0ABqIAIgAyAEEIoBQQBIBEBBfyEEDAELQQEgBiAAKAJMQQBOGyEGIAAoAgAhByAAKAJIQQBMBEAgACAHQV9xNgIACwJ/AkACQCAAKAIwRQRAIABB0AA2AjAgAEEANgIcIABCADcDECAAKAIsIQggACAFNgIsDAELIAAoAhANAQtBfyAAEJ0BDQEaCyAAIAEgBUHIAWogBUHQAGogBUGgAWogAyAEEIoBCyECIAgEQCAAQQBBACAAKAIkEQYAGiAAQQA2AjAgACAINgIsIABBADYCHCAAKAIUIQEgAEIANwMQIAJBfyABGyECCyAAIAAoAgAiACAHQSBxcjYCAEF/IAIgAEEgcRshBCAGRQ0ACyAFQdABaiQAIAQLfwIBfwF+IAC9IgNCNIinQf8PcSICQf8PRwR8IAJFBEAgASAARAAAAAAAAAAAYQR/QQAFIABEAAAAAAAA8EOiIAEQjAEhACABKAIAQUBqCzYCACAADwsgASACQf4HazYCACADQv////////+HgH+DQoCAgICAgIDwP4S/BSAACwsVACAARQRAQQAPC0H8OyAANgIAQX8LzgECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBxABqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQAC9EDAEHUO0GoHBAcQdU7QYoWQQFBAUEAEBtB1jtB/RJBAUGAf0H/ABAEQdc7QfYSQQFBgH9B/wAQBEHYO0H0EkEBQQBB/wEQBEHZO0GUCkECQYCAfkH//wEQBEHaO0GLCkECQQBB//8DEARB2ztBsQpBBEGAgICAeEH/////BxAEQdw7QagKQQRBAEF/EARB3TtB+BhBBEGAgICAeEH/////BxAEQd47Qe8YQQRBAEF/EARB3ztBjxBCgICAgICAgICAf0L///////////8AEIQBQeA7QY4QQgBCfxCEAUHhO0GIEEEEEA1B4jtB9BtBCBANQeM7QaQZEA5B5DtBmSIQDkHlO0EEQZcZEAhB5jtBAkGwGRAIQec7QQRBvxkQCEHoO0GPFhAaQek7QQBB1CEQAUHqO0EAQboiEAFB6ztBAUHyIRABQew7QQJB5B4QAUHtO0EDQYMfEAFB7jtBBEGrHxABQe87QQVByB8QAUHwO0EEQd8iEAFB8TtBBUH9IhABQeo7QQBBriAQAUHrO0EBQY0gEAFB7DtBAkHwIBABQe07QQNBziAQAUHuO0EEQbMhEAFB7ztBBUGRIRABQfI7QQZB7h8QAUHzO0EHQaQjEAELJQAgAEH0JjYCACAALQAEBEAgACgCCEH9DxBmCyAAKAIIEAYgAAsDAAALJQAgAEHsJzYCACAALQAEBEAgACgCCEH9DxBmCyAAKAIIEAYgAAs3AQJ/QQQQHiICIAE2AgBBBBAeIgMgATYCAEGjOyAAQeI7QfooQcEBIAJB4jtB/ihBwgEgAxAHCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRBQALOQEBfyABIAAoAgQiBEEBdWohASAAKAIAIQAgASACIAMgBEEBcQR/IAEoAgAgAGooAgAFIAALEQMACwkAIAEgABEAAAsHACAAEQ4ACzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALEQAACzABAX8jAEEQayICJAAgAiABNgIIIAJBCGogABECACEAIAIoAggQBiACQRBqJAAgAAsMACABIAAoAgARAAALCQAgAEEBOgAEC9coAQJ/QaA7QaE7QaI7QQBBjCZBB0GPJkEAQY8mQQBB2RZBkSZBCBAFQQgQHiIAQoiAgIAQNwMAQaA7QZcbQQZBoCZBuCZBCSAAQQEQAEGkO0GlO0GmO0GgO0GMJkEKQYwmQQtBjCZBDEG4EUGRJkENEAVBBBAeIgBBDjYCAEGkO0HoFEECQcAmQcgmQQ8gAEEAEABBoDtBowxBAkHMJkHUJkEQQREQA0GgO0GAHEEDQaQnQbAnQRJBExADQbg7Qbk7Qbo7QQBBjCZBFEGPJkEAQY8mQQBB6RZBkSZBFRAFQQgQHiIAQoiAgIAQNwMAQbg7QegcQQJBuCdByCZBFiAAQQEQAEG7O0G8O0G9O0G4O0GMJkEXQYwmQRhBjCZBGUHPEUGRJkEaEAVBBBAeIgBBGzYCAEG7O0HoFEECQcAnQcgmQRwgAEEAEABBuDtBowxBAkHIJ0HUJkEdQR4QA0G4O0GAHEEDQaQnQbAnQRJBHxADQb47Qb87QcA7QQBBjCZBIEGPJkEAQY8mQQBB2hpBkSZBIRAFQb47QQFB+CdBjCZBIkEjEA9BvjtBkBtBAUH4J0GMJkEiQSMQA0G+O0HpCEECQfwnQcgmQSRBJRADQQgQHiIAQQA2AgQgAEEmNgIAQb47Qa0cQQRBkChBoChBJyAAQQAQAEEIEB4iAEEANgIEIABBKDYCAEG+O0GkEUEDQagoQbQoQSkgAEEAEABBCBAeIgBBADYCBCAAQSo2AgBBvjtByB1BA0G8KEHIKEErIABBABAAQQgQHiIAQQA2AgQgAEEsNgIAQb47QaYQQQNB0ChByChBLSAAQQAQAEEIEB4iAEEANgIEIABBLjYCAEG+O0HLHEEDQdwoQbAnQS8gAEEAEABBCBAeIgBBADYCBCAAQTA2AgBBvjtB0h1BAkHoKEHUJkExIABBABAAQQgQHiIAQQA2AgQgAEEyNgIAQb47QZcQQQJB8ChB1CZBMyAAQQAQAEHBO0GECkH4KEE0QZEmQTUQCkHiD0EAEEhB6g5BCBBIQYITQRAQSEHxFUEYEEhBgxdBIBBIQfAOQSgQSEHBOxAJQaM7Qf8aQfgoQTZBkSZBNxAKQYMXQQAQkwFB8A5BCBCTAUGjOxAJQcI7QYobQfgoQThBkSZBORAKQQQQHiIAQQg2AgBBBBAeIgFBCDYCAEHCO0GEG0HiO0H6KEE6IABB4jtB/ihBOyABEAdBBBAeIgBBADYCAEEEEB4iAUEANgIAQcI7QeUOQds7QdQmQTwgAEHbO0HIKEE9IAEQB0HCOxAJQcM7QcQ7QcU7QQBBjCZBPkGPJkEAQY8mQQBB+xtBkSZBPxAFQcM7QQFBhClBjCZBwABBwQAQD0HDO0HXDkEBQYQpQYwmQcAAQcEAEANBwztB0BpBAkGIKUHUJkHCAEHDABADQcM7QekIQQJBkClByCZBxABBxQAQA0EIEB4iAEEANgIEIABBxgA2AgBBwztB9w9BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABByAA2AgBBwztB6htBA0GYKUHIKEHJACAAQQAQAEEIEB4iAEEANgIEIABBygA2AgBBwztBnxtBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABBzAA2AgBBwztB0BRBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABBzgA2AgBBwztBiA1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABBzwA2AgBBwztB3RNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0AA2AgBBwztB+QtBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0QA2AgBBwztBuBBBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0gA2AgBBwztB5RpBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0wA2AgBBwztB/BRBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1AA2AgBBwztBlRNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1QA2AgBBwztBtQpBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1gA2AgBBwztBuBVBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB1wA2AgBBwztBmw1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB2AA2AgBBwztB7RNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2QA2AgBBwztBxAlBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2gA2AgBBwztB8QhBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2wA2AgBBwztBhwlBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3QA2AgBBwztB1BBBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3gA2AgBBwztB5gxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3wA2AgBBwztBzBNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB4AA2AgBBwztBrAlBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4QA2AgBBwztBnxZBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4gA2AgBBwztBoRdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4wA2AgBBwztBvw1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5AA2AgBBwztB+xNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB5QA2AgBBwztBkQ9BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5gA2AgBBwztBwQxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5wA2AgBBwztBvhNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB6AA2AgBBwztBsxdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6QA2AgBBwztBzw1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6gA2AgBBwztBpQ9BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6wA2AgBBwztB0gxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7AA2AgBBwztBiRdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7QA2AgBBwztBrA1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7gA2AgBBwztB9w5BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7wA2AgBBwztBrQxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB8AA2AgBBwztB/RhBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB8QA2AgBBwztBshRBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB8gA2AgBBwztBlBJBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB8wA2AgBBwztBzhlBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9AA2AgBBwztB4g1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9QA2AgBBwztBrRNBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9gA2AgBBwztB+gxBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9wA2AgBBwztBnhVBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB+AA2AgBBwztBrxtBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB+gA2AgBBwztB3BRBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABB/AA2AgBBwztBiQxBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/QA2AgBBwztBxhBBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/gA2AgBBwztB8hpBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/wA2AgBBwztBjRVBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBgAE2AgBBwztBoRNBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBgQE2AgBBwztBxwpBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBggE2AgBBwztBwhVBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABBgwE2AgBBwztB4RBBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBhQE2AgBBwztBuAlBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBhwE2AgBBwztBrRZBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBiAE2AgBBwztBqhdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBiQE2AgBBwztBmw9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBigE2AgBBwztBvxdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBiwE2AgBBwztBsg9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjAE2AgBBwztBlRdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjQE2AgBBwztBhA9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjgE2AgBBwztBihlBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBjwE2AgBBwztBwRRBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBkAE2AgBBwztBnhJBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBkgE2AgBBwztB0AlBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBkwE2AgBBwztB/AhBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBlAE2AgBBwztB2RlBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABBlQE2AgBBwztBtBNBA0GMKkGYKkGWASAAQQAQAEEIEB4iAEEANgIEIABBlwE2AgBBwztBhxxBBEGgKkGgKEGYASAAQQAQAEEIEB4iAEEANgIEIABBmQE2AgBBwztBnBxBA0GwKkHIKEGaASAAQQAQAEEIEB4iAEEANgIEIABBmwE2AgBBwztBmgpBAkG8KkHUJkGcASAAQQAQAEEIEB4iAEEANgIEIABBnQE2AgBBwztBmQxBAkHEKkHUJkGeASAAQQAQAEEIEB4iAEEANgIEIABBnwE2AgBBwztBkxxBA0HMKkGwJ0GgASAAQQAQAEEIEB4iAEEANgIEIABBoQE2AgBBwztBuxZBA0HYKkHIKEGiASAAQQAQAEEIEB4iAEEANgIEIABBowE2AgBBwztBvxtBAkHkKkHUJkGkASAAQQAQAEEIEB4iAEEANgIEIABBpQE2AgBBwztB0xtBA0HYKkHIKEGiASAAQQAQAEEIEB4iAEEANgIEIABBpgE2AgBBwztBqB1BA0HsKkHIKEGnASAAQQAQAEEIEB4iAEEANgIEIABBqAE2AgBBwztBph1BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBqQE2AgBBwztBuR1BA0H4KkHIKEGqASAAQQAQAEEIEB4iAEEANgIEIABBqwE2AgBBwztBtx1BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBrAE2AgBBwztB3whBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBrQE2AgBBwztB1whBAkGEK0HUJkGuASAAQQAQAEEIEB4iAEEANgIEIABBrwE2AgBBwztB3hVBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBsAE2AgBBwztB3AlBAkGEK0HUJkGuASAAQQAQAEEIEB4iAEEANgIEIABBsQE2AgBBwztB6QlBBUGQK0GkK0GyASAAQQAQAEEIEB4iAEEANgIEIABBswE2AgBBwztB5w9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtAE2AgBBwztB0Q9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtQE2AgBBwztBhhNBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtgE2AgBBwztB+BVBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtwE2AgBBwztByxdBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBuAE2AgBBwztBvw9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBuQE2AgBBwztB+QlBAkGsK0HUJkG6ASAAQQAQAEEIEB4iAEEANgIEIABBuwE2AgBBwztBzBVBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvAE2AgBBwztBqBJBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvQE2AgBBwztB5BlBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvgE2AgBBwztBqxVBAkHUKUHUJkH5ACAAQQAQAAtZAQF/IAAgACgCSCIBQQFrIAFyNgJIIAAoAgAiAUEIcQRAIAAgAUEgcjYCAEF/DwsgAEIANwIEIAAgACgCLCIBNgIcIAAgATYCFCAAIAEgACgCMGo2AhBBAAtHAAJAIAFBA00EfyAAIAFBAnRqQQRqBSABQQRrIgEgACgCGCIAKAIEIAAoAgAiAGtBAnVPDQEgACABQQJ0agsoAgAPCxACAAs4AQF/IAFBAEgEQBACAAsgAUEBa0EFdkEBaiIBQQJ0EB4hAiAAIAE2AgggAEEANgIEIAAgAjYCAAvSBQEJfyAAIAEvAQA7AQAgACABKQIENwIEIAAgASkCDDcCDCAAIAEoAhQ2AhQCQAJAIAEoAhgiA0UNAEEYEB4iBUEANgIIIAVCADcCACADKAIEIgEgAygCACICRwRAIAEgAmsiAkEASA0CIAUgAhAeIgE2AgAgBSABIAJqNgIIIAMoAgAiAiADKAIEIgZHBEADQCABIAIoAgA2AgAgAUEEaiEBIAJBBGoiAiAGRw0ACwsgBSABNgIECyAFQgA3AgwgBUEANgIUIAMoAhAiAUUNACAFQQxqIAEQnwEgAygCDCEGIAUgBSgCECIEIAMoAhAiAkEfcWogAkFgcWoiATYCEAJAAkAgBEUEQCABQQFrIQMMAQsgAUEBayIDIARBAWtzQSBJDQELIAUoAgwgA0EFdkEAIAFBIU8bQQJ0akEANgIACyAFKAIMIARBA3ZB/P///wFxaiEBIARBH3EiA0UEQCACQQBMDQEgAkEgbSEDIAJBH2pBP08EQCABIAYgA0ECdBAzGgsgAiADQQV0ayICQQBMDQEgASADQQJ0IgNqIgEgASgCAEF/QSAgAmt2IgFBf3NxIAMgBmooAgAgAXFyNgIADAELIAJBAEwNAEF/IAN0IQhBICADayEEIAJBIE4EQCAIQX9zIQkgASgCACEHA0AgASAHIAlxIAYoAgAiByADdHI2AgAgASABKAIEIAhxIAcgBHZyIgc2AgQgBkEEaiEGIAFBBGohASACQT9LIQogAkEgayECIAoNAAsgAkEATA0BCyABIAEoAgBBfyAEIAQgAiACIARKGyIEa3YgCHFBf3NxIAYoAgBBf0EgIAJrdnEiBiADdHI2AgAgAiAEayICQQBMDQAgASADIARqQQN2Qfz///8BcWoiASABKAIAQX9BICACa3ZBf3NxIAYgBHZyNgIACyAAKAIYIQEgACAFNgIYIAEEQCABEFsLDwsQAgALvQMBB38gAARAIwBBIGsiBiQAIAAoAgAiASgC5AMiAwRAIAMgARBvGiABQQA2AuQDCyABKALsAyICIAEoAugDIgNHBEBBASACIANrQQJ1IgIgAkEBTRshBEEAIQIDQCADIAJBAnRqKAIAQQA2AuQDIAJBAWoiAiAERw0ACwsgASADNgLsAwJAIAMgAUHwA2oiAigCAEYNACAGQQhqQQBBACACEEoiAigCBCABKALsAyABKALoAyIEayIFayIDIAQgBRAzIQUgASgC6AMhBCABIAU2AugDIAIgBDYCBCABKALsAyEFIAEgAigCCDYC7AMgAiAFNgIIIAEoAvADIQcgASACKAIMNgLwAyACIAQ2AgAgAiAHNgIMIAQgBUcEQCACIAUgBCAFa0EDakF8cWo2AggLIARFDQAgBBAnIAEoAugDIQMLIAMEQCABIAM2AuwDIAMQJwsgASgClAEhAyABQQA2ApQBIAMEQCADEFsLIAEQJyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALIAAoAgQhASAAQQA2AgQgAQRAIAEgASgCACgCBBEAAAsgBkEgaiQAIAAQIwsLtQEBAX8jAEEQayICJAACfyABBEAgASgCACEBQYgEEB4gARBcIAENARogAkH3GTYCACACEHIQJAALQZQ7LQAARQRAQfg6QQM2AgBBiDtCgICAgICAgMA/NwIAQYA7QgA3AgBBlDtBAToAAEH8OkH8Oi0AAEH+AXE6AABB9DpBADYCAEGQO0EANgIAC0GIBBAeQfQ6EFwLIQEgAEIANwIEIAAgATYCACABIAA2AgQgAkEQaiQAIAALGwEBfyAABEAgACgCACIBBEAgARAjCyAAECMLC0kBAn9BBBAeIQFBIBAeIgBBADYCHCAAQoCAgICAgIDAPzcCFCAAQgA3AgwgAEEAOgAIIABBAzYCBCAAQQA2AgAgASAANgIAIAELIAAgAkEFR0EAIAIbRQRAQbgwIAMgBBBJDwsgAyAEEHALIgEBfiABIAKtIAOtQiCGhCAEIAARFQAiBUIgiKckASAFpwuoAQEFfyAAKAJUIgMoAgAhBSADKAIEIgQgACgCFCAAKAIcIgdrIgYgBCAGSRsiBgRAIAUgByAGECsaIAMgAygCACAGaiIFNgIAIAMgAygCBCAGayIENgIECyAEIAIgAiAESxsiBARAIAUgASAEECsaIAMgAygCACAEaiIFNgIAIAMgAygCBCAEazYCBAsgBUEAOgAAIAAgACgCLCIBNgIcIAAgATYCFCACCwQAQgALBABBAAuKBQIGfgJ/IAEgASgCAEEHakF4cSIBQRBqNgIAIAAhCSABKQMAIQMgASkDCCEGIwBBIGsiCCQAAkAgBkL///////////8AgyIEQoCAgICAgMCAPH0gBEKAgICAgIDA/8MAfVQEQCAGQgSGIANCPIiEIQQgA0L//////////w+DIgNCgYCAgICAgIAIWgRAIARCgYCAgICAgIDAAHwhAgwCCyAEQoCAgICAgICAQH0hAiADQoCAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgCEEgaiQAIAkgAiAGQoCAgICAgICAgH+DhL85AwALmRgDEn8BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIZQgBTBEBBASERQZkJIRMgAZoiAb0hGQwBCyAEQYAQcQRAQQEhEUGcCSETDAELQZ8JQZoJIARBAXEiERshEyARRSEVCwJAIBlCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txECkgACATIBEQJiAAQe0VQdweIAVBIHEiBRtB4RpB4B4gBRsgASABYhtBAxAmIABBICACIAMgBEGAwABzECkgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahCMASIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAVBIHIiDkHhAEYNAiAMKAIsIQlBBiADIANBAEgbDAELIAwgBkEdayIJNgIsIAFEAAAAAAAAsEGiIQFBBiADIANBAEgbCyELIAxBMGpBoAJBACAJQQBOG2oiDSEHA0AgBwJ/IAFEAAAAAAAA8EFjIAFEAAAAAAAAAABmcQRAIAGrDAELQQALIgM2AgAgB0EEaiEHIAEgA7ihRAAAAABlzc1BoiIBRAAAAAAAAAAAYg0ACwJAIAlBAEwEQCAJIQMgByEGIA0hCAwBCyANIQggCSEDA0BBHSADIANBHU4bIQMCQCAHQQRrIgYgCEkNACADrSEaQgAhGQNAIAYgGUL/////D4MgBjUCACAahnwiG0KAlOvcA4AiGUKA7JSjDH4gG3w+AgAgBkEEayIGIAhPDQALIBmnIgZFDQAgCEEEayIIIAY2AgALA0AgCCAHIgZJBEAgBkEEayIHKAIARQ0BCwsgDCAMKAIsIANrIgM2AiwgBiEHIANBAEoNAAsLIANBAEgEQCALQRlqQQluQQFqIQ8gDkHmAEYhEANAQQlBACADayIDIANBCU4bIQoCQCAGIAhNBEAgCCgCACEHDAELQYCU69wDIAp2IRRBfyAKdEF/cyEWQQAhAyAIIQcDQCAHIAMgBygCACIXIAp2ajYCACAWIBdxIBRsIQMgB0EEaiIHIAZJDQALIAgoAgAhByADRQ0AIAYgAzYCACAGQQRqIQYLIAwgDCgCLCAKaiIDNgIsIA0gCCAHRUECdGoiCCAQGyIHIA9BAnRqIAYgBiAHa0ECdSAPShshBiADQQBIDQALC0EAIQMCQCAGIAhNDQAgDSAIa0ECdUEJbCEDQQohByAIKAIAIgpBCkkNAANAIANBAWohAyAKIAdBCmwiB08NAAsLIAsgA0EAIA5B5gBHG2sgDkHnAEYgC0EAR3FrIgcgBiANa0ECdUEJbEEJa0gEQEEEQaQCIAlBAEgbIAxqIAdBgMgAaiIKQQltIg9BAnRqQdAfayEJQQohByAPQXdsIApqIgpBB0wEQANAIAdBCmwhByAKQQFqIgpBCEcNAAsLAkAgCSgCACIQIBAgB24iDyAHbCIKRiAJQQRqIhQgBkZxDQAgECAKayEQAkAgD0EBcUUEQEQAAAAAAABAQyEBIAdBgJTr3ANHIAggCU9yDQEgCUEEay0AAEEBcUUNAQtEAQAAAAAAQEMhAQtEAAAAAAAA4D9EAAAAAAAA8D9EAAAAAAAA+D8gBiAURhtEAAAAAAAA+D8gECAHQQF2IhRGGyAQIBRJGyEYAkAgFQ0AIBMtAABBLUcNACAYmiEYIAGaIQELIAkgCjYCACABIBigIAFhDQAgCSAHIApqIgM2AgAgA0GAlOvcA08EQANAIAlBADYCACAIIAlBBGsiCUsEQCAIQQRrIghBADYCAAsgCSAJKAIAQQFqIgM2AgAgA0H/k+vcA0sNAAsLIA0gCGtBAnVBCWwhA0EKIQcgCCgCACIKQQpJDQADQCADQQFqIQMgCiAHQQpsIgdPDQALCyAJQQRqIgcgBiAGIAdLGyEGCwNAIAYiByAITSIKRQRAIAdBBGsiBigCAEUNAQsLAkAgDkHnAEcEQCAEQQhxIQkMAQsgA0F/c0F/IAtBASALGyIGIANKIANBe0pxIgkbIAZqIQtBf0F+IAkbIAVqIQUgBEEIcSIJDQBBdyEGAkAgCg0AIAdBBGsoAgAiDkUNAEEKIQpBACEGIA5BCnANAANAIAYiCUEBaiEGIA4gCkEKbCIKcEUNAAsgCUF/cyEGCyAHIA1rQQJ1QQlsIQogBUFfcUHGAEYEQEEAIQkgCyAGIApqQQlrIgZBACAGQQBKGyIGIAYgC0obIQsMAQtBACEJIAsgAyAKaiAGakEJayIGQQAgBkEAShsiBiAGIAtKGyELC0F/IQogC0H9////B0H+////ByAJIAtyIhAbSg0BIAsgEEEAR2pBAWohDgJAIAVBX3EiFUHGAEYEQCADIA5B/////wdzSg0DIANBACADQQBKGyEGDAELIBIgAyADQR91IgZzIAZrrSASEEciBmtBAUwEQANAIAZBAWsiBkEwOgAAIBIgBmtBAkgNAAsLIAZBAmsiDyAFOgAAIAZBAWtBLUErIANBAEgbOgAAIBIgD2siBiAOQf////8Hc0oNAgsgBiAOaiIDIBFB/////wdzSg0BIABBICACIAMgEWoiBSAEECkgACATIBEQJiAAQTAgAiAFIARBgIAEcxApAkACQAJAIBVBxgBGBEAgDEEQaiIGQQhyIQMgBkEJciEJIA0gCCAIIA1LGyIKIQgDQCAINQIAIAkQRyEGAkAgCCAKRwRAIAYgDEEQak0NAQNAIAZBAWsiBkEwOgAAIAYgDEEQaksNAAsMAQsgBiAJRw0AIAxBMDoAGCADIQYLIAAgBiAJIAZrECYgCEEEaiIIIA1NDQALIBAEQCAAQYwlQQEQJgsgC0EATCAHIAhNcg0BA0AgCDUCACAJEEciBiAMQRBqSwRAA0AgBkEBayIGQTA6AAAgBiAMQRBqSw0ACwsgACAGQQkgCyALQQlOGxAmIAtBCWshBiAIQQRqIgggB08NAyALQQlKIQMgBiELIAMNAAsMAgsCQCALQQBIDQAgByAIQQRqIAcgCEsbIQogDEEQaiIGQQhyIQMgBkEJciENIAghBwNAIA0gBzUCACANEEciBkYEQCAMQTA6ABggAyEGCwJAIAcgCEcEQCAGIAxBEGpNDQEDQCAGQQFrIgZBMDoAACAGIAxBEGpLDQALDAELIAAgBkEBECYgBkEBaiEGIAkgC3JFDQAgAEGMJUEBECYLIAAgBiALIA0gBmsiBiAGIAtKGxAmIAsgBmshCyAHQQRqIgcgCk8NASALQQBODQALCyAAQTAgC0ESakESQQAQKSAAIA8gEiAPaxAmDAILIAshBgsgAEEwIAZBCWpBCUEAECkLIABBICACIAUgBEGAwABzECkgBSACIAIgBUgbIQoMAQsgEyAFQRp0QR91QQlxaiELAkAgA0ELSw0AQQwgA2shBkQAAAAAAAAwQCEYA0AgGEQAAAAAAAAwQKIhGCAGQQFrIgYNAAsgCy0AAEEtRgRAIBggAZogGKGgmiEBDAELIAEgGKAgGKEhAQsgEUECciEJIAVBIHEhCCASIAwoAiwiByAHQR91IgZzIAZrrSASEEciBkYEQCAMQTA6AA8gDEEPaiEGCyAGQQJrIg0gBUEPajoAACAGQQFrQS1BKyAHQQBIGzoAACAEQQhxIQYgDEEQaiEHA0AgByIFAn8gAZlEAAAAAAAA4EFjBEAgAaoMAQtBgICAgHgLIgdBkC9qLQAAIAhyOgAAIAYgA0EASnJFIAEgB7ehRAAAAAAAADBAoiIBRAAAAAAAAAAAYXEgBUEBaiIHIAxBEGprQQFHckUEQCAFQS46AAEgBUECaiEHCyABRAAAAAAAAAAAYg0AC0F/IQpB/f///wcgCSASIA1rIgVqIgZrIANIDQAgAEEgIAIgBgJ/AkAgA0UNACAHIAxBEGprIghBAmsgA04NACADQQJqDAELIAcgDEEQamsiCAsiB2oiAyAEECkgACALIAkQJiAAQTAgAiADIARBgIAEcxApIAAgDEEQaiAIECYgAEEwIAcgCGtBAEEAECkgACANIAUQJiAAQSAgAiADIARBgMAAcxApIAMgAiACIANIGyEKCyAMQbAEaiQAIAoLRgEBfyAAKAI8IQMjAEEQayIAJAAgAyABpyABQiCIpyACQf8BcSAAQQhqEBQQjQEhAiAAKQMIIQEgAEEQaiQAQn8gASACGwu+AgEHfyMAQSBrIgMkACADIAAoAhwiBDYCECAAKAIUIQUgAyACNgIcIAMgATYCGCADIAUgBGsiATYCFCABIAJqIQVBAiEGIANBEGohAQJ/A0ACQAJAAkAgACgCPCABIAYgA0EMahAYEI0BRQRAIAUgAygCDCIHRg0BIAdBAE4NAgwDCyAFQX9HDQILIAAgACgCLCIBNgIcIAAgATYCFCAAIAEgACgCMGo2AhAgAgwDCyABIAcgASgCBCIISyIJQQN0aiIEIAcgCEEAIAkbayIIIAQoAgBqNgIAIAFBDEEEIAkbaiIBIAEoAgAgCGs2AgAgBSAHayEFIAYgCWshBiAEIQEMAQsLIABBADYCHCAAQgA3AxAgACAAKAIAQSByNgIAQQAgBkECRg0AGiACIAEoAgRrCyEEIANBIGokACAECwkAIAAoAjwQGQsjAQF/Qcg7KAIAIgAEQANAIAAoAgARCQAgACgCBCIADQALCwu/AgEFfyMAQeAAayICJAAgAiAANgIAIwBBEGsiAyQAIAMgAjYCDCMAQZABayIAJAAgAEGgL0GQARArIgAgAkEQaiIFIgE2AiwgACABNgIUIABB/////wdBfiABayIEIARB/////wdPGyIENgIwIAAgASAEaiIBNgIcIAAgATYCECAAQbsTIAJBAEEAEIsBGiAEBEAgACgCFCIBIAEgACgCEEZrQQA6AAALIABBkAFqJAAgA0EQaiQAAkAgBSIAQQNxBEADQCAALQAARQ0CIABBAWoiAEEDcQ0ACwsDQCAAIgFBBGohACABKAIAIgNBf3MgA0GBgoQIa3FBgIGChHhxRQ0ACwNAIAEiAEEBaiEBIAAtAAANAAsLIAAgBWtBAWoiABBhIgEEfyABIAUgABArBUEACyEAIAJB4ABqJAAgAAvFAQICfwF8IwBBMGsiBiQAIAEoAgghBwJAQbQ7LQAAQQFxBEBBsDsoAgAhAQwBC0EFQZAnEAwhAUG0O0EBOgAAQbA7IAE2AgALIAYgBTYCKCAGIAQ4AiAgBiADNgIYIAYgAjgCEAJ/IAEgB0GXGyAGQQxqIAZBEGoQEiIIRAAAAAAAAPBBYyAIRAAAAAAAAAAAZnEEQCAIqwwBC0EACyEBIAYoAgwhAyAAIAEpAwA3AwAgACABKQMINwMIIAMQESAGQTBqJAALCQAgABCQARAjCwwAIAAoAghB6BwQZgsJACAAEJIBECMLVQECfyMAQTBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEwEB4gAkEwECshACACQTBqJAAgAAs7AQF/IAEgACgCBCIFQQF1aiEBIAAoAgAhACABIAIgAyAEIAVBAXEEfyABKAIAIABqKAIABSAACxEdAAs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERIACzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRDAALNQEBfyABIAAoAgQiAkEBdWohASAAKAIAIQAgASACQQFxBH8gASgCACAAaigCAAUgAAsRCwALYQECfyMAQRBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEQEB4iACACKQMINwMIIAAgAikDADcDACACQRBqJAAgAAtjAQJ/IwBBEGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACADIAEgAiAEQQFxBH8gASgCACAAaigCAAUgAAsRAwBBEBAeIgAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiQAIAALNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEEAAs5AQF/IAEgACgCBCIEQQF1aiEBIAAoAgAhACABIAIgAyAEQQFxBH8gASgCACAAaigCAAUgAAsRCAALCQAgASAAEQIACwUAQcM7Cw8AIAEgACgCAGogAjYCAAsNACABIAAoAgBqKAIACxgBAX9BEBAeIgBCADcDCCAAQQA2AgAgAAsYAQF/QRAQHiIAQgA3AwAgAEIANwMIIAALDABBMBAeQQBBMBAqCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRHgALBQBBvjsLIQAgACABKAIAIAEgASwAC0EASBtBuzsgAigCABAQNgIACyoBAX9BDBAeIgFBADoABCABIAAoAgA2AgggAEEANgIAIAFB2Cc2AgAgAQsFAEG7OwsFAEG4OwshACAAIAEoAgAgASABLAALQQBIG0GkOyACKAIAEBA2AgAL2AEBBH8jAEEgayIDJAAgASgCACIEQfD///8HSQRAAkACQCAEQQtPBEAgBEEPckEBaiIFEB4hBiADIAVBgICAgHhyNgIQIAMgBjYCCCADIAQ2AgwgBCAGaiEFDAELIAMgBDoAEyADQQhqIgYgBGohBSAERQ0BCyAGIAFBBGogBBArGgsgBUEAOgAAIAMgAjYCACADQRhqIANBCGogAyAAEQMAIAMoAhgQHSADKAIYIgAQBiADKAIAEAYgAywAE0EASARAIAMoAggQIwsgA0EgaiQAIAAPCxACAAsqAQF/QQwQHiIBQQA6AAQgASAAKAIANgIIIABBADYCACABQeAmNgIAIAELBQBBpDsLaQECfyMAQRBrIgYkACABIAAoAgQiB0EBdWohASAAKAIAIQAgBiABIAIgAyAEIAUgB0EBcQR/IAEoAgAgAGooAgAFIAALERAAQRAQHiIAIAYpAwg3AwggACAGKQMANwMAIAZBEGokACAACwUAQaA7Cx0AIAAoAgAiACAALQAAQfcBcUEIQQAgARtyOgAAC6oBAgJ/AX0jAEEQayICJAAgACgCACEAIAFB/wFxIgNBBkkEQAJ/AkACQAJAIANBBGsOAgABAgsgAEHUA2ogAC0AiANBA3FBAkYNAhogAEHMA2oMAgsgAEHMA2ogAC0AiANBA3FBAkYNARogAEHUA2oMAQsgACABQf8BcUECdGpBzANqCyoCACEEIAJBEGokACAEuw8LIAJB7hA2AgAgAEEFQdglIAIQLBAkAAuqAQICfwF9IwBBEGsiAiQAIAAoAgAhACABQf8BcSIDQQZJBEACfwJAAkACQCADQQRrDgIAAQILIABBxANqIAAtAIgDQQNxQQJGDQIaIABBvANqDAILIABBvANqIAAtAIgDQQNxQQJGDQEaIABBxANqDAELIAAgAUH/AXFBAnRqQbwDagsqAgAhBCACQRBqJAAgBLsPCyACQe4QNgIAIABBBUHYJSACECwQJAALqgECAn8BfSMAQRBrIgIkACAAKAIAIQAgAUH/AXEiA0EGSQRAAn8CQAJAAkAgA0EEaw4CAAECCyAAQbQDaiAALQCIA0EDcUECRg0CGiAAQawDagwCCyAAQawDaiAALQCIA0EDcUECRg0BGiAAQbQDagwBCyAAIAFB/wFxQQJ0akGsA2oLKgIAIQQgAkEQaiQAIAS7DwsgAkHuEDYCACAAQQVB2CUgAhAsECQAC08AIAAgASgCACIBKgKcA7s5AwAgACABKgKkA7s5AwggACABKgKgA7s5AxAgACABKgKoA7s5AxggACABKgKMA7s5AyAgACABKgKQA7s5AygLDAAgACgCACoCkAO7CwwAIAAoAgAqAowDuwsMACAAKAIAKgKoA7sLDAAgACgCACoCoAO7CwwAIAAoAgAqAqQDuwsMACAAKAIAKgKcA7sL6AMCBH0FfyMAQUBqIgokACAAKAIAIQAgCkEIakEAQTgQKhpB8DpB8DooAgBBAWo2AgAgABB4IAAtABRBA3EiCCADQQEgA0H/AXEbIAgbIQkgAEEUaiEIIAG2IQQgACoC+AMhBQJ9AkACQAJAIAAtAPwDQQFrDgIBAAILIAUgBJRDCtcjPJQhBQsgBUMAAAAAYEUNACAAIAlB/wFxQQAgBCAEEDEgCEECQQEgBBAiIAhBAkEBIAQQIZKSDAELIAggCUH/AXFBACAEIAQQLSIFIAVbBEBBAiELIAggCUH/AXFBACAEIAQQLQwBCyAEIARcIQsgBAshByACtiEFIAAqAoAEIQYgACAHAn0CQAJAAkAgAC0AhARBAWsOAgEAAgsgBiAFlEMK1yM8lCEGCyAGQwAAAABgRQ0AIAAgCUH/AXFBASAFIAQQMSAIQQBBASAEECIgCEEAQQEgBBAhkpIMAQsgCCAJQf8BcSIJQQEgBSAEEC0iBiAGWwRAQQIhDCAIIAlBASAFIAQQLQwBCyAFIAVcIQwgBQsgA0H/AXEgCyAMIAQgBUEBQQAgCkEIakEAQfA6KAIAED0EQCAAIAAtAIgDQQNxIAQgBRB2IABEAAAAAAAAAABEAAAAAAAAAAAQcwsgCkFAayQACw0AIAAoAgAtAABBAXELFQAgACgCACIAIAAtAABB/gFxOgAACxAAIAAoAgAtAABBBHFBAnYLegECfyMAQRBrIgEkACAAKAIAIgAoAggEQANAIAAtAAAiAkEEcUUEQCAAIAJBBHI6AAAgACgCECICBEAgACACEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQELCyABQRBqJAAPCyABQYAINgIAIABBBUHYJSABECwQJAALLgEBfyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALIAAoAgBBADYCEAsXACAAKAIEKAIIIgAgACgCACgCCBEAAAsuAQF/IAAoAgghAiAAIAE2AgggAgRAIAIgAigCACgCBBEAAAsgACgCAEEFNgIQCz4BAX8gACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIAIgBBADYCCCAAIAAtAABB7wFxOgAAC0kBAX8jAEEQayIGJAAgBiABKAIEKAIEIgEgAiADIAQgBSABKAIAKAIIERAAIAAgBisDALY4AgAgACAGKwMItjgCBCAGQRBqJAALcwECfyMAQRBrIgIkACAAKAIEIQMgACABNgIEIAMEQCADIAMoAgAoAgQRAAALIAAoAgAiACgC6AMgACgC7ANHBEAgAkH5IzYCACAAQQVB2CUgAhAsECQACyAAQQQ2AgggACAALQAAQRByOgAAIAJBEGokAAs8AQF/AkAgACgCACIAKALsAyAAKALoAyIAa0ECdSABTQ0AIAAgAUECdGooAgAiAEUNACAAKAIEIQILIAILGQAgACgCACgC5AMiAEUEQEEADwsgACgCBAsXACAAKAIAIgAoAuwDIAAoAugDa0ECdQuOAwEDfyMAQdACayICJAACQCAAKAIAIgAoAuwDIAAoAugDRg0AIAEoAgAiAygC5AMhASAAIAMQb0UNACAAIAFGBEAgAkEIakEAQcQCECoaIAJBADoAGCACQgA3AxAgAkGAgID+BzYCDCACQRxqQQBBxAEQKhogAkHgAWohBCACQSBqIQEDQCABQoCAgPyLgIDAv383AhAgAUKBgICAEDcCCCABQoCAgPyLgIDAv383AgAgAUEYaiIBIARHDQALIAJCgICA/IuAgMC/fzcD8AEgAkKBgICAEDcD6AEgAkKAgID8i4CAwL9/NwPgASACQoCAgP6HgIDg/wA3AoQCIAJCgICA/oeAgOD/ADcC/AEgAiACLQD4AUH4AXE6APgBIAJBjAJqQQBBwAAQKhogA0GYAWogAkEIakHEAhArGiADQQA2AuQDCwNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIAJB0AJqJAAL4AcBCH8jAEHQAGsiByQAIAAoAgAhAAJAAkAgASgCACIIKALkA0UEQCAAKAIIDQEgCC0AF0EQdEGAgDBxQYCAIEYEQCAAIAAoAuADQQFqNgLgAwsgACgC6AMiASACQQJ0aiEGAkAgACgC7AMiBCAAQfADaiIDKAIAIgVJBEAgBCAGRgRAIAYgCDYCACAAIAZBBGo2AuwDDAILIAQgBCICQQRrIgFLBEADQCACIAEoAgA2AgAgAkEEaiECIAFBBGoiASAESQ0ACwsgACACNgLsAyAGQQRqIgEgBEcEQCAEIAQgAWsiAUF8cWsgBiABEDMaCyAGIAg2AgAMAQsgBCABa0ECdUEBaiIEQYCAgIAETw0DAkAgB0EgakH/////AyAFIAFrIgFBAXUiBSAEIAQgBUkbIAFB/P///wdPGyACIAMQSiIDKAIIIgIgAygCDEcNACADKAIEIgEgAygCACIESwRAIAMgASABIARrQQJ1QQFqQX5tQQJ0IgRqIAEgAiABayIBEDMgAWoiAjYCCCADIAMoAgQgBGo2AgQMAQsgB0E4akEBIAIgBGtBAXUgAiAERhsiASABQQJ2IAMoAhAQSiIFKAIIIQQCfyADKAIIIgIgAygCBCIBRgRAIAQhAiABDAELIAQgAiABa2ohAgNAIAQgASgCADYCACABQQRqIQEgBEEEaiIEIAJHDQALIAMoAgghASADKAIECyEEIAMoAgAhCSADIAUoAgA2AgAgBSAJNgIAIAMgBSgCBDYCBCAFIAQ2AgQgAyACNgIIIAUgATYCCCADKAIMIQogAyAFKAIMNgIMIAUgCjYCDCABIARHBEAgBSABIAQgAWtBA2pBfHFqNgIICyAJRQ0AIAkQIyADKAIIIQILIAIgCDYCACADIAMoAghBBGo2AgggAyADKAIEIAYgACgC6AMiAWsiAmsgASACEDM2AgQgAygCCCAGIAAoAuwDIAZrIgQQMyEGIAAoAugDIQEgACADKAIENgLoAyADIAE2AgQgACgC7AMhAiAAIAQgBmo2AuwDIAMgAjYCCCAAKALwAyEEIAAgAygCDDYC8AMgAyABNgIAIAMgBDYCDCABIAJHBEAgAyACIAEgAmtBA2pBfHFqNgIICyABRQ0AIAEQIwsgCCAANgLkAwNAIAAtAAAiAUEEcUUEQCAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQELCyAHQdAAaiQADwsgB0HEIzYCECAAQQVB2CUgB0EQahAsECQACyAHQckkNgIAIABBBUHYJSAHECwQJAALEAIACxAAIAAoAgAtAABBAnFBAXYLWQIBfwF9IwBBEGsiAiQAIAJBCGogACgCACIAQfwAaiAAIAFB/wFxQQF0ai8BaBAfQwAAwH8hAwJAAkAgAi0ADA4EAQAAAQALIAIqAgghAwsgAkEQaiQAIAMLTgEBfyMAQRBrIgMkACADQQhqIAEoAgAiAUH8AGogASACQf8BcUEBdGovAUQQHyADLQAMIQEgACADKgIIuzkDCCAAIAE2AgAgA0EQaiQAC14CAX8BfCMAQRBrIgIkACACQQhqIAAoAgAiAEH8AGogACABQf8BcUEBdGovAVYQH0QAAAAAAAD4fyEDAkACQCACLQAMDgQBAAABAAsgAioCCLshAwsgAkEQaiQAIAMLJAEBfUMAAMB/IAAoAgAiAEH8AGogAC8BehAgIgEgASABXBu7C0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXgQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXYQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXQQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXIQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXAQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAW4QHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0gCAX8BfQJ9IAAoAgAiAEH8AGoiASAALwEcECAiAiACXARAQwAAgD9DAAAAACAAKAL0Ay0ACEEBcRsMAQsgASAALwEcECALuws2AgF/AX0gACgCACIAQfwAaiIBIAAvARoQICICIAJcBEBEAAAAAAAAAAAPCyABIAAvARoQILsLRAEBfyMAQRBrIgIkACACQQhqIAEoAgAiAUH8AGogAS8BHhAfIAItAAwhASAAIAIqAgi7OQMIIAAgATYCACACQRBqJAALEAAgACgCAC0AF0ECdkEDcQsNACAAKAIALQAXQQNxC04BAX8jAEEQayIDJAAgA0EIaiABKAIAIgFB/ABqIAEgAkH/AXFBAXRqLwEgEB8gAy0ADCEBIAAgAyoCCLs5AwggACABNgIAIANBEGokAAsQACAAKAIALQAUQQR2QQdxCw0AIAAoAgAvABVBDnYLDQAgACgCAC0AFEEDcQsQACAAKAIALQAUQQJ2QQNxCw0AIAAoAgAvABZBD3ELEAAgACgCAC8AFUEEdkEPcQsNACAAKAIALwAVQQ9xC04BAX8jAEEQayIDJAAgA0EIaiABKAIAIgFB/ABqIAEgAkH/AXFBAXRqLwEyEB8gAy0ADCEBIAAgAyoCCLs5AwggACABNgIAIANBEGokAAsQACAAKAIALwAVQQx2QQNxCxAAIAAoAgAtABdBBHZBAXELgQECA38BfSMAQRBrIgMkACAAKAIAIQQCfSACtiIGIAZcBEBBACEAQwAAwH8MAQtBAEECIAZDAACAf1sgBkMAAID/W3IiBRshAEMAAMB/IAYgBRsLIQYgAyAAOgAMIAMgBjgCCCADIAMpAwg3AwAgBCABQf8BcSADEIgBIANBEGokAAt5AgF9An8jAEEQayIEJAAgACgCACEFIAQCfyACtiIDIANcBEBDAADAfyEDQQAMAQtDAADAfyADIANDAACAf1sgA0MAAID/W3IiABshAyAARQs6AAwgBCADOAIIIAQgBCkDCDcDACAFIAFB/wFxIAQQiAEgBEEQaiQAC3EBAX8CQCAAKAIAIgAtAAAiAkECcUEBdiABRg0AIAAgAkH9AXFBAkEAIAEbcjoAAANAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC4EBAgN/AX0jAEEQayIDJAAgACgCACEEAn0gArYiBiAGXARAQQAhAEMAAMB/DAELQQBBAiAGQwAAgH9bIAZDAACA/1tyIgUbIQBDAADAfyAGIAUbCyEGIAMgADoADCADIAY4AgggAyADKQMINwMAIAQgAUH/AXEgAxCOASADQRBqJAALeQIBfQJ/IwBBEGsiBCQAIAAoAgAhBSAEAn8gArYiAyADXARAQwAAwH8hA0EADAELQwAAwH8gAyADQwAAgH9bIANDAACA/1tyIgAbIQMgAEULOgAMIAQgAzgCCCAEIAQpAwg3AwAgBSABQf8BcSAEEI4BIARBEGokAAv5AQICfQR/IwBBEGsiBSQAIAAoAgAhAAJ/IAK2IgMgA1wEQEMAAMB/IQNBAAwBC0MAAMB/IAMgA0MAAIB/WyADQwAAgP9bciIGGyEDIAZFCyEGQQEhByAFQQhqIABB/ABqIgggACABQf8BcUEBdGpB1gBqIgEvAQAQHwJAAkAgAyAFKgIIIgRcBH8gBCAEWw0BIAMgA1wFIAcLRQ0AIAUtAAwgBkYNAQsgCCABIAMgBhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgBUEQaiQAC7UBAgN/An0CQCAAKAIAIgBB/ABqIgMgAEH6AGoiAi8BABAgIgYgAbYiBVsNACAFIAVbIgRFIAYgBlxxDQACQCAEIAVDAAAAAFsgBYtDAACAf1tyRXFFBEAgAiACLwEAQfj/A3E7AQAMAQsgAyACIAVBAxBMCwNAIAAtAAAiAkEEcQ0BIAAgAkEEcjoAACAAKAIQIgIEQCAAIAIRAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EBIAIQVSACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEBIAMQVSADQRBqJAALfAIDfwF9IwBBEGsiAiQAIAAoAgAhAwJ9IAG2IgUgBVwEQEEAIQBDAADAfwwBC0EAQQIgBUMAAIB/WyAFQwAAgP9bciIEGyEAQwAAwH8gBSAEGwshBSACIAA6AAwgAiAFOAIIIAIgAikDCDcDACADQQAgAhBVIAJBEGokAAt0AgF9An8jAEEQayIDJAAgACgCACEEIAMCfyABtiICIAJcBEBDAADAfyECQQAMAQtDAADAfyACIAJDAACAf1sgAkMAAID/W3IiABshAiAARQs6AAwgAyACOAIIIAMgAykDCDcDACAEQQAgAxBVIANBEGokAAt8AgN/AX0jAEEQayICJAAgACgCACEDAn0gAbYiBSAFXARAQQAhAEMAAMB/DAELQQBBAiAFQwAAgH9bIAVDAACA/1tyIgQbIQBDAADAfyAFIAQbCyEFIAIgADoADCACIAU4AgggAiACKQMINwMAIANBASACEFYgAkEQaiQAC3QCAX0CfyMAQRBrIgMkACAAKAIAIQQgAwJ/IAG2IgIgAlwEQEMAAMB/IQJBAAwBC0MAAMB/IAIgAkMAAIB/WyACQwAAgP9bciIAGyECIABFCzoADCADIAI4AgggAyADKQMINwMAIARBASADEFYgA0EQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EAIAIQViACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEAIAMQViADQRBqJAALPwEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIABBASABEEYgAUEQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EBIAIQRiACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEBIAMQRiADQRBqJAALPwEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIABBACABEEYgAUEQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EAIAIQRiACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEAIAMQRiADQRBqJAALoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRxqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRpqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLPQEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIAAgARBrIAFBEGokAAt6AgN/AX0jAEEQayICJAAgACgCACEDAn0gAbYiBSAFXARAQQAhAEMAAMB/DAELQQBBAiAFQwAAgH9bIAVDAACA/1tyIgQbIQBDAADAfyAFIAQbCyEFIAIgADoADCACIAU4AgggAiACKQMINwMAIAMgAhBrIAJBEGokAAtyAgF9An8jAEEQayIDJAAgACgCACEEIAMCfyABtiICIAJcBEBDAADAfyECQQAMAQtDAADAfyACIAJDAACAf1sgAkMAAID/W3IiABshAiAARQs6AAwgAyACOAIIIAMgAykDCDcDACAEIAMQayADQRBqJAALoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRhqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLkAEBAX8CQCAAKAIAIgBBF2otAAAiAkECdkEDcSABQf8BcUYNACAAIAAvABUgAkEQdHIiAjsAFSAAIAJB///PB3EgAUEDcUESdHJBEHY6ABcDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuNAQEBfwJAIAAoAgAiAEEXai0AACICQQNxIAFB/wFxRg0AIAAgAC8AFSACQRB0ciICOwAVIAAgAkH///MHcSABQQNxQRB0ckEQdjoAFwNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC0MBAX8jAEEQayICJAAgACgCACEAIAJBAzoADCACQYCAgP4HNgIIIAIgAikDCDcDACAAIAFB/wFxIAIQZSACQRBqJAALgAECA38BfSMAQRBrIgMkACAAKAIAIQQCfSACtiIGIAZcBEBBACEAQwAAwH8MAQtBAEECIAZDAACAf1sgBkMAAID/W3IiBRshAEMAAMB/IAYgBRsLIQYgAyAAOgAMIAMgBjgCCCADIAMpAwg3AwAgBCABQf8BcSADEGUgA0EQaiQAC3gCAX0CfyMAQRBrIgQkACAAKAIAIQUgBAJ/IAK2IgMgA1wEQEMAAMB/IQNBAAwBC0MAAMB/IAMgA0MAAIB/WyADQwAAgP9bciIAGyEDIABFCzoADCAEIAM4AgggBCAEKQMINwMAIAUgAUH/AXEgBBBlIARBEGokAAt3AQF/AkAgACgCACIALQAUIgJBBHZBB3EgAUH/AXFGDQAgACACQY8BcSABQQR0QfAAcXI6ABQDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuJAQEBfwJAIAFB/wFxIAAoAgAiAC8AFSICQQ52Rg0AIABBF2ogAiAALQAXQRB0ciICQRB2OgAAIAAgAkH//wBxIAFBDnRyOwAVA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLcAEBfwJAIAAoAgAiAC0AFCICQQNxIAFB/wFxRg0AIAAgAkH8AXEgAUEDcXI6ABQDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwt2AQF/AkAgACgCACIALQAUIgJBAnZBA3EgAUH/AXFGDQAgACACQfMBcSABQQJ0QQxxcjoAFANAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC48BAQF/AkAgACgCACIALwAVIgJBCHZBD3EgAUH/AXFGDQAgAEEXaiACIAAtABdBEHRyIgJBEHY6AAAgACACQf/hA3EgAUEPcUEIdHI7ABUDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuPAQEBfwJAIAFB/wFxIAAoAgAiAC8AFSAAQRdqLQAAQRB0ciICQfABcUEEdkYNACAAIAJBEHY6ABcgACACQY/+A3EgAUEEdEHwAXFyOwAVA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLhwEBAX8CQCAAKAIAIgAvABUgAEEXai0AAEEQdHIiAkEPcSABQf8BcUYNACAAIAJBEHY6ABcgACACQfD/A3EgAUEPcXI7ABUDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwtDAQF/IwBBEGsiAiQAIAAoAgAhACACQQM6AAwgAkGAgID+BzYCCCACIAIpAwg3AwAgACABQf8BcSACEGcgAkEQaiQAC4ABAgN/AX0jAEEQayIDJAAgACgCACEEAn0gArYiBiAGXARAQQAhAEMAAMB/DAELQQBBAiAGQwAAgH9bIAZDAACA/1tyIgUbIQBDAADAfyAGIAUbCyEGIAMgADoADCADIAY4AgggAyADKQMINwMAIAQgAUH/AXEgAxBnIANBEGokAAt4AgF9An8jAEEQayIEJAAgACgCACEFIAQCfyACtiIDIANcBEBDAADAfyEDQQAMAQtDAADAfyADIANDAACAf1sgA0MAAID/W3IiABshAyAARQs6AAwgBCADOAIIIAQgBCkDCDcDACAFIAFB/wFxIAQQZyAEQRBqJAALjwEBAX8CQCAAKAIAIgAvABUiAkEMdkEDcSABQf8BcUYNACAAQRdqIAIgAC0AF0EQdHIiAkEQdjoAACAAIAJB/58DcSABQQNxQQx0cjsAFQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC5ABAQF/AkAgACgCACIAQRdqLQAAIgJBBHZBAXEgAUH/AXFGDQAgACAALwAVIAJBEHRyIgI7ABUgACACQf//vwdxIAFBAXFBFHRyQRB2OgAXA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsL9g0CCH8CfSMAQRBrIgIkAAJAAkAgASgCACIFLQAUIAAoAgAiAS0AFHNB/wBxDQAgBS8AFSAFLQAXQRB0ciABLwAVIAEtABdBEHRyc0H//z9xDQAgBUH8AGohByABQfwAaiEIAkAgAS8AGCIAQQdxRQRAIAUtABhBB3FFDQELIAggABAgIgogByAFLwAYECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AGiIAQQdxRQRAIAUtABpBB3FFDQELIAggABAgIgogByAFLwAaECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AHCIAQQdxRQRAIAUtABxBB3FFDQELIAggABAgIgogByAFLwAcECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AHiIAQQdxRQRAIAUtAB5BB3FFDQELIAJBCGogCCAAEB8gAiAHIAUvAB4QH0EBIQAgAioCCCIKIAIqAgAiC1wEfyAKIApbDQIgCyALXAUgAAtFDQEgAi0ADCACLQAERw0BCyAFQSBqIQAgAUEgaiEGA0ACQCAGIANBAXRqLwAAIgRBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAQQHyACIAcgAC8AABAfQQEhBCACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSAEC0UNAiACLQAMIAItAARHDQILIABBAmohACADQQFqIgNBCUcNAAsgBUEyaiEAIAFBMmohBkEAIQMDQAJAIAYgA0EBdGovAAAiBEEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBBAfIAIgByAALwAAEB9BASEEIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAQLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAIANBAWoiA0EJRw0ACyAFQcQAaiEAIAFBxABqIQZBACEDA0ACQCAGIANBAXRqLwAAIgRBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAQQHyACIAcgAC8AABAfQQEhBCACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSAEC0UNAiACLQAMIAItAARHDQILIABBAmohACADQQFqIgNBCUcNAAsgBUHWAGohACABQdYAaiEGQQAhAwNAAkAgBiADQQF0ai8AACIEQQdxRQRAIAAtAABBB3FFDQELIAJBCGogCCAEEB8gAiAHIAAvAAAQH0EBIQQgAioCCCIKIAIqAgAiC1wEfyAKIApbDQMgCyALXAUgBAtFDQIgAi0ADCACLQAERw0CCyAAQQJqIQAgA0EBaiIDQQlHDQALIAVB6ABqIQAgAUHoAGohBkEAIQMDQAJAIAYgA0EBdGovAAAiBEEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBBAfIAIgByAALwAAEB9BASEEIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAQLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAIANBAWoiA0EDRw0ACyAFQe4AaiEAIAFB7gBqIQlBACEEQQAhAwNAAkAgCSADQQF0ai8AACIGQQdxRQRAIAAtAABBB3FFDQELIAJBCGogCCAGEB8gAiAHIAAvAAAQH0EBIQMgAioCCCIKIAIqAgAiC1wEfyAKIApbDQMgCyALXAUgAwtFDQIgAi0ADCACLQAERw0CCyAAQQJqIQBBASEDIAQhBkEBIQQgBkUNAAsgBUHyAGohACABQfIAaiEJQQAhBEEAIQMDQAJAIAkgA0EBdGovAAAiBkEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBhAfIAIgByAALwAAEB9BASEDIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAMLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAQQEhAyAEIQZBASEEIAZFDQALIAVB9gBqIQAgAUH2AGohCUEAIQRBACEDA0ACQCAJIANBAXRqLwAAIgZBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAYQHyACIAcgAC8AABAfQQEhAyACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSADC0UNAiACLQAMIAItAARHDQILIABBAmohAEEBIQMgBCEGQQEhBCAGRQ0ACyABLwB6IgBBB3FFBEAgBS0AekEHcUUNAgsgCCAAECAiCiAHIAUvAHoQICILWw0BIAogClsNACALIAtcDQELIAFBFGogBUEUakHoABArGiABQfwAaiAFQfwAahCgAQNAIAEtAAAiAEEEcQ0BIAEgAEEEcjoAACABKAIQIgAEQCABIAARAAALIAFBgICA/gc2ApwBIAEoAuQDIgENAAsLIAJBEGokAAvGAwEEfyMAQaAEayICJAAgACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALAkAgACgCACIAKALoAyAAKALsA0YEQCAAKALkAw0BIAAgAkEYaiAAKAL0AxBcIgEpAgA3AgAgACABKAIQNgIQIAAgASkCCDcCCCAAQRRqIAFBFGpB6AAQKxogACABKQKMATcCjAEgACABKQKEATcChAEgACABKQJ8NwJ8IAEoApQBIQQgAUEANgKUASAAKAKUASEDIAAgBDYClAEgAwRAIAMQWwsgAEGYAWogAUGYAWpB0AIQKxogACgC6AMiAwRAIAAgAzYC7AMgAxAjCyAAIAEoAugDNgLoAyAAIAEoAuwDNgLsAyAAIAEoAvADNgLwAyABQQA2AvADIAFCADcC6AMgACABKQL8AzcC/AMgACABKQL0AzcC9AMgACABKAKEBDYChAQgASgClAEhACABQQA2ApQBIAAEQCAAEFsLIAJBoARqJAAPCyACQfAcNgIQIABBBUHYJSACQRBqECwQJAALIAJB5hE2AgAgAEEFQdglIAIQLBAkAAsLAEEMEB4gABCiAQsLAEEMEB5BABCiAQsNACAAKAIALQAIQQFxCwoAIAAoAgAoAhQLGQAgAUH/AXEEQBACAAsgACgCACgCEEEBcQsYACAAKAIAIgAgAC0ACEH+AXEgAXI6AAgLJgAgASAAKAIAIgAoAhRHBEAgACABNgIUIAAgACgCDEEBajYCDAsLkgEBAn8jAEEQayICJAAgACgCACEAIAFDAAAAAGAEQCABIAAqAhhcBEAgACABOAIYIAAgACgCDEEBajYCDAsgAkEQaiQADwsgAkGIFDYCACMAQRBrIgMkACADIAI2AgwCQCAARQRAQbgwQdglIAIQSRoMAQsgAEEAQQVB2CUgAiAAKAIEEQ0AGgsgA0EQaiQAECQACz8AIAFB/wFxRQRAIAIgACgCACIAKAIQIgFBAXFHBEAgACABQX5xIAJyNgIQIAAgACgCDEEBajYCDAsPCxACAAsL4CYjAEGACAuBHk9ubHkgbGVhZiBub2RlcyB3aXRoIGN1c3RvbSBtZWFzdXJlIGZ1bmN0aW9ucyBzaG91bGQgbWFudWFsbHkgbWFyayB0aGVtc2VsdmVzIGFzIGRpcnR5AGlzRGlydHkAbWFya0RpcnR5AGRlc3Ryb3kAc2V0RGlzcGxheQBnZXREaXNwbGF5AHNldEZsZXgALSsgICAwWDB4AC0wWCswWCAwWC0weCsweCAweABzZXRGbGV4R3JvdwBnZXRGbGV4R3JvdwBzZXRPdmVyZmxvdwBnZXRPdmVyZmxvdwBoYXNOZXdMYXlvdXQAY2FsY3VsYXRlTGF5b3V0AGdldENvbXB1dGVkTGF5b3V0AHVuc2lnbmVkIHNob3J0AGdldENoaWxkQ291bnQAdW5zaWduZWQgaW50AHNldEp1c3RpZnlDb250ZW50AGdldEp1c3RpZnlDb250ZW50AGF2YWlsYWJsZUhlaWdodCBpcyBpbmRlZmluaXRlIHNvIGhlaWdodFNpemluZ01vZGUgbXVzdCBiZSBTaXppbmdNb2RlOjpNYXhDb250ZW50AGF2YWlsYWJsZVdpZHRoIGlzIGluZGVmaW5pdGUgc28gd2lkdGhTaXppbmdNb2RlIG11c3QgYmUgU2l6aW5nTW9kZTo6TWF4Q29udGVudABzZXRBbGlnbkNvbnRlbnQAZ2V0QWxpZ25Db250ZW50AGdldFBhcmVudABpbXBsZW1lbnQAc2V0TWF4SGVpZ2h0UGVyY2VudABzZXRIZWlnaHRQZXJjZW50AHNldE1pbkhlaWdodFBlcmNlbnQAc2V0RmxleEJhc2lzUGVyY2VudABzZXRHYXBQZXJjZW50AHNldFBvc2l0aW9uUGVyY2VudABzZXRNYXJnaW5QZXJjZW50AHNldE1heFdpZHRoUGVyY2VudABzZXRXaWR0aFBlcmNlbnQAc2V0TWluV2lkdGhQZXJjZW50AHNldFBhZGRpbmdQZXJjZW50AGhhbmRsZS50eXBlKCkgPT0gU3R5bGVWYWx1ZUhhbmRsZTo6VHlwZTo6UG9pbnQgfHwgaGFuZGxlLnR5cGUoKSA9PSBTdHlsZVZhbHVlSGFuZGxlOjpUeXBlOjpQZXJjZW50AGNyZWF0ZURlZmF1bHQAdW5pdAByaWdodABoZWlnaHQAc2V0TWF4SGVpZ2h0AGdldE1heEhlaWdodABzZXRIZWlnaHQAZ2V0SGVpZ2h0AHNldE1pbkhlaWdodABnZXRNaW5IZWlnaHQAZ2V0Q29tcHV0ZWRIZWlnaHQAZ2V0Q29tcHV0ZWRSaWdodABsZWZ0AGdldENvbXB1dGVkTGVmdAByZXNldABfX2Rlc3RydWN0AGZsb2F0AHVpbnQ2NF90AHVzZVdlYkRlZmF1bHRzAHNldFVzZVdlYkRlZmF1bHRzAHNldEFsaWduSXRlbXMAZ2V0QWxpZ25JdGVtcwBzZXRGbGV4QmFzaXMAZ2V0RmxleEJhc2lzAENhbm5vdCBnZXQgbGF5b3V0IHByb3BlcnRpZXMgb2YgbXVsdGktZWRnZSBzaG9ydGhhbmRzAHNldFBvaW50U2NhbGVGYWN0b3IATWVhc3VyZUNhbGxiYWNrV3JhcHBlcgBEaXJ0aWVkQ2FsbGJhY2tXcmFwcGVyAENhbm5vdCByZXNldCBhIG5vZGUgc3RpbGwgYXR0YWNoZWQgdG8gYSBvd25lcgBzZXRCb3JkZXIAZ2V0Qm9yZGVyAGdldENvbXB1dGVkQm9yZGVyAGdldE51bWJlcgBoYW5kbGUudHlwZSgpID09IFN0eWxlVmFsdWVIYW5kbGU6OlR5cGU6Ok51bWJlcgB1bnNpZ25lZCBjaGFyAHRvcABnZXRDb21wdXRlZFRvcABzZXRGbGV4V3JhcABnZXRGbGV4V3JhcABzZXRHYXAAZ2V0R2FwACVwAHNldEhlaWdodEF1dG8Ac2V0RmxleEJhc2lzQXV0bwBzZXRQb3NpdGlvbkF1dG8Ac2V0TWFyZ2luQXV0bwBzZXRXaWR0aEF1dG8AU2NhbGUgZmFjdG9yIHNob3VsZCBub3QgYmUgbGVzcyB0aGFuIHplcm8Ac2V0QXNwZWN0UmF0aW8AZ2V0QXNwZWN0UmF0aW8Ac2V0UG9zaXRpb24AZ2V0UG9zaXRpb24Abm90aWZ5T25EZXN0cnVjdGlvbgBzZXRGbGV4RGlyZWN0aW9uAGdldEZsZXhEaXJlY3Rpb24Ac2V0RGlyZWN0aW9uAGdldERpcmVjdGlvbgBzZXRNYXJnaW4AZ2V0TWFyZ2luAGdldENvbXB1dGVkTWFyZ2luAG1hcmtMYXlvdXRTZWVuAG5hbgBib3R0b20AZ2V0Q29tcHV0ZWRCb3R0b20AYm9vbABlbXNjcmlwdGVuOjp2YWwAc2V0RmxleFNocmluawBnZXRGbGV4U2hyaW5rAHNldEFsd2F5c0Zvcm1zQ29udGFpbmluZ0Jsb2NrAE1lYXN1cmVDYWxsYmFjawBEaXJ0aWVkQ2FsbGJhY2sAZ2V0TGVuZ3RoAHdpZHRoAHNldE1heFdpZHRoAGdldE1heFdpZHRoAHNldFdpZHRoAGdldFdpZHRoAHNldE1pbldpZHRoAGdldE1pbldpZHRoAGdldENvbXB1dGVkV2lkdGgAcHVzaAAvaG9tZS9ydW5uZXIvd29yay95b2dhL3lvZ2EvamF2YXNjcmlwdC8uLi95b2dhL3N0eWxlL1NtYWxsVmFsdWVCdWZmZXIuaAAvaG9tZS9ydW5uZXIvd29yay95b2dhL3lvZ2EvamF2YXNjcmlwdC8uLi95b2dhL3N0eWxlL1N0eWxlVmFsdWVQb29sLmgAdW5zaWduZWQgbG9uZwBzZXRCb3hTaXppbmcAZ2V0Qm94U2l6aW5nAHN0ZDo6d3N0cmluZwBzdGQ6OnN0cmluZwBzdGQ6OnUxNnN0cmluZwBzdGQ6OnUzMnN0cmluZwBzZXRQYWRkaW5nAGdldFBhZGRpbmcAZ2V0Q29tcHV0ZWRQYWRkaW5nAFRyaWVkIHRvIGNvbnN0cnVjdCBZR05vZGUgd2l0aCBudWxsIGNvbmZpZwBBdHRlbXB0aW5nIHRvIGNvbnN0cnVjdCBOb2RlIHdpdGggbnVsbCBjb25maWcAY3JlYXRlV2l0aENvbmZpZwBpbmYAc2V0QWxpZ25TZWxmAGdldEFsaWduU2VsZgBTaXplAHZhbHVlAFZhbHVlAGNyZWF0ZQBtZWFzdXJlAHNldFBvc2l0aW9uVHlwZQBnZXRQb3NpdGlvblR5cGUAaXNSZWZlcmVuY2VCYXNlbGluZQBzZXRJc1JlZmVyZW5jZUJhc2VsaW5lAGNvcHlTdHlsZQBkb3VibGUATm9kZQBleHRlbmQAaW5zZXJ0Q2hpbGQAZ2V0Q2hpbGQAcmVtb3ZlQ2hpbGQAdm9pZABzZXRFeHBlcmltZW50YWxGZWF0dXJlRW5hYmxlZABpc0V4cGVyaW1lbnRhbEZlYXR1cmVFbmFibGVkAGRpcnRpZWQAQ2Fubm90IHJlc2V0IGEgbm9kZSB3aGljaCBzdGlsbCBoYXMgY2hpbGRyZW4gYXR0YWNoZWQAdW5zZXRNZWFzdXJlRnVuYwB1bnNldERpcnRpZWRGdW5jAHNldEVycmF0YQBnZXRFcnJhdGEATWVhc3VyZSBmdW5jdGlvbiByZXR1cm5lZCBhbiBpbnZhbGlkIGRpbWVuc2lvbiB0byBZb2dhOiBbd2lkdGg9JWYsIGhlaWdodD0lZl0ARXhwZWN0IGN1c3RvbSBiYXNlbGluZSBmdW5jdGlvbiB0byBub3QgcmV0dXJuIE5hTgBOQU4ASU5GAGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8Y2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4Ac3RkOjpiYXNpY19zdHJpbmc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGRvdWJsZT4AQ2hpbGQgYWxyZWFkeSBoYXMgYSBvd25lciwgaXQgbXVzdCBiZSByZW1vdmVkIGZpcnN0LgBDYW5ub3Qgc2V0IG1lYXN1cmUgZnVuY3Rpb246IE5vZGVzIHdpdGggbWVhc3VyZSBmdW5jdGlvbnMgY2Fubm90IGhhdmUgY2hpbGRyZW4uAENhbm5vdCBhZGQgY2hpbGQ6IE5vZGVzIHdpdGggbWVhc3VyZSBmdW5jdGlvbnMgY2Fubm90IGhhdmUgY2hpbGRyZW4uAChudWxsKQBpbmRleCA8IDQwOTYgJiYgIlNtYWxsVmFsdWVCdWZmZXIgY2FuIG9ubHkgaG9sZCB1cCB0byA0MDk2IGNodW5rcyIAJXMKAAEAAAADAAAAAAAAAAIAAAADAAAAAQAAAAIAAAAAAAAAAQAAAAEAQYwmCwdpaQB2AHZpAEGgJgs3ox0AAKEdAADhHQAA2x0AAOEdAADbHQAAaWlpZmlmaQDUHQAApB0AAHZpaQClHQAA6B0AAGlpaQBB4CYLCcQAAADFAAAAxgBB9CYLDsQAAADHAAAAyAAAANQdAEGQJws+ox0AAOEdAADbHQAA4R0AANsdAADoHQAA4x0AAOgdAABpaWlpAAAAANQdAAC5HQAA1B0AALsdAAC8HQAA6B0AQdgnCwnJAAAAygAAAMsAQewnCxbJAAAAzAAAAMgAAAC/HQAA1B0AAL8dAEGQKAuiA9QdAAC/HQAA2x0AANUdAAB2aWlpaQAAANQdAAC/HQAA4R0AAHZpaWYAAAAA1B0AAL8dAADbHQAAdmlpaQAAAADUHQAAvx0AANUdAADVHQAAwB0AANsdAADbHQAAwB0AANUdAADAHQAAaQBkaWkAdmlpZAAAxB0AAMQdAAC/HQAA1B0AAMQdAADUHQAAxB0AAMMdAADUHQAAxB0AANsdAADUHQAAxB0AANsdAADiHQAAdmlpaWQAAADUHQAAxB0AAOIdAADbHQAAxR0AAMIdAADFHQAA2x0AAMIdAADFHQAA4h0AAMUdAADiHQAAxR0AANsdAABkaWlpAAAAAOEdAADEHQAA2x0AAGZpaWkAAAAA1B0AAMQdAADEHQAA3B0AANQdAADEHQAAxB0AANwdAADFHQAAxB0AAMQdAADEHQAAxB0AANwdAADUHQAAxB0AANUdAADVHQAAxB0AANQdAADEHQAAoR0AANQdAADEHQAAuR0AANUdAADFHQAAAAAAANQdAADEHQAA4h0AAOIdAADbHQAAdmlpZGRpAADBHQAAxR0AQcArC0EZAAoAGRkZAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABkAEQoZGRkDCgcAAQAJCxgAAAkGCwAACwAGGQAAABkZGQBBkSwLIQ4AAAAAAAAAABkACg0ZGRkADQAAAgAJDgAAAAkADgAADgBByywLAQwAQdcsCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT";if(!HH(BH)){var WH=BH;BH=A.locateFile?A.locateFile(WH,B):B+WH}function wH(){var RH=BH;try{if(RH==BH&&M)return new Uint8Array(M);if(HH(RH))try{var kH=c9(RH.slice(37)),eH=new Uint8Array(kH.length);for(RH=0;RH=kH?"_"+RH:RH}function IH(RH,kH){return RH=t(RH),function(){return kH.apply(this,arguments)}}var KH=[{},{value:void 0},{value:null},{value:!0},{value:!1}],MH=[];function CH(RH){var kH=Error,eH=IH(RH,function(W$){this.name=RH,this.message=W$,W$=Error(W$).stack,W$!==void 0&&(this.stack=this.toString()+` `,A),I=L===-1?H.substring(A):H.substring(A,L);if($=Math.max($,t9$(I)),L===-1)break;A=L+1}return $}var B0A=K(()=>{yBA()});function f0A(H,$=1,A={}){let{indent:L=" ",includeEmptyLines:I=!1}=A;if(typeof H!=="string")throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof H}\``);if(typeof $!=="number")throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof $}\``);if($<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${$}\``);if(typeof L!=="string")throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof L}\``);if($===0)return H;let D=I?/^/gm:/^(?!\s*$)/gm;return H.replace(D,L.repeat($))}var WR0=(H)=>{return H.getComputedWidth()-H.getComputedPadding(J1.Left)-H.getComputedPadding(J1.Right)-H.getComputedBorder(J1.Left)-H.getComputedBorder(J1.Right)},csL;var lsL=K(()=>{Qn();csL=WR0});var isL=z((zMf,VR0)=>{VR0.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}}});var rsL=z((NMf,E0A)=>{var nsL=isL();E0A.exports=nsL;E0A.exports.default=nsL});function c6(H){switch(H){case"light":return PR0;case"light-ansi":return _R0;case"dark-ansi":return YR0;case"light-daltonized":return CR0;case"dark-daltonized":return ZR0;default:return wR0}}function F1$(H){let $=H.match(/rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)/);if($){let A=parseInt($[1],10),L=parseInt($[2],10),I=parseInt($[3],10),D=qR0.rgb(A,L,I)("X");return D.slice(0,D.indexOf("X"))}return"\x1B[35m"}var asL,PR0,_R0,YR0,CR0,wR0,ZR0,qR0;var Ky=K(()=>{r0();Z1();asL=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],PR0={autoAccept:"rgb(135,0,255)",bashBorder:"rgb(255,0,135)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(245,149,117)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(87,105,247)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(117,135,255)",permission:"rgb(87,105,247)",permissionShimmer:"rgb(137,155,255)",planMode:"rgb(0,102,102)",delegateMode:"rgb(138,43,226)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",inactiveShimmer:"rgb(142,142,142)",subtle:"rgb(175,175,175)",suggestion:"rgb(87,105,247)",remember:"rgb(0,0,255)",background:"rgb(0,153,153)",success:"rgb(44,122,57)",error:"rgb(171,43,63)",warning:"rgb(150,108,30)",merged:"rgb(135,0,255)",warningShimmer:"rgb(200,158,80)",diffAdded:"rgb(105,219,124)",diffRemoved:"rgb(255,168,180)",diffAddedDimmed:"rgb(199,225,203)",diffRemovedDimmed:"rgb(253,210,216)",diffAddedWord:"rgb(47,157,68)",diffRemovedWord:"rgb(209,69,75)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(240, 240, 240)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(87,105,247)",rate_limit_empty:"rgb(39,47,111)",penguin:"rgb(255,106,0)",penguinShimmer:"rgb(255,150,50)"},_R0={autoAccept:"ansi:magenta",bashBorder:"ansi:magenta",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blue",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blue",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyan",delegateMode:"ansi:magenta",ide:"ansi:blueBright",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:black",inverseText:"ansi:white",inactive:"ansi:blackBright",inactiveShimmer:"ansi:white",subtle:"ansi:blackBright",suggestion:"ansi:blue",remember:"ansi:blue",background:"ansi:cyan",success:"ansi:green",error:"ansi:red",warning:"ansi:yellow",merged:"ansi:magenta",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",red_FOR_SUBAGENTS_ONLY:"ansi:red",blue_FOR_SUBAGENTS_ONLY:"ansi:blue",green_FOR_SUBAGENTS_ONLY:"ansi:green",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellow",purple_FOR_SUBAGENTS_ONLY:"ansi:magenta",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyan",professionalBlue:"ansi:blueBright",chromeYellow:"ansi:yellow",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:white",bashMessageBackgroundColor:"ansi:whiteBright",memoryBackgroundColor:"ansi:white",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:black",penguin:"ansi:red",penguinShimmer:"ansi:redBright"},YR0={autoAccept:"ansi:magentaBright",bashBorder:"ansi:magentaBright",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blueBright",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blueBright",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyanBright",delegateMode:"ansi:magentaBright",ide:"ansi:blue",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:whiteBright",inverseText:"ansi:black",inactive:"ansi:white",inactiveShimmer:"ansi:whiteBright",subtle:"ansi:white",suggestion:"ansi:blueBright",remember:"ansi:blueBright",background:"ansi:cyanBright",success:"ansi:greenBright",error:"ansi:redBright",warning:"ansi:yellowBright",merged:"ansi:magentaBright",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",red_FOR_SUBAGENTS_ONLY:"ansi:redBright",blue_FOR_SUBAGENTS_ONLY:"ansi:blueBright",green_FOR_SUBAGENTS_ONLY:"ansi:greenBright",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellowBright",purple_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyanBright",professionalBlue:"rgb(106,155,204)",chromeYellow:"ansi:yellowBright",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:blackBright",bashMessageBackgroundColor:"ansi:black",memoryBackgroundColor:"ansi:blackBright",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:white",penguin:"ansi:redBright",penguinShimmer:"ansi:redBright"},CR0={autoAccept:"rgb(135,0,255)",bashBorder:"rgb(0,102,204)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(51,102,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(101,152,255)",permission:"rgb(51,102,255)",permissionShimmer:"rgb(101,152,255)",planMode:"rgb(51,102,102)",delegateMode:"rgb(138,43,226)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",inactiveShimmer:"rgb(142,142,142)",subtle:"rgb(175,175,175)",suggestion:"rgb(51,102,255)",remember:"rgb(51,102,255)",background:"rgb(0,153,153)",success:"rgb(0,102,153)",error:"rgb(204,0,0)",warning:"rgb(255,153,0)",merged:"rgb(135,0,255)",warningShimmer:"rgb(255,183,50)",diffAdded:"rgb(153,204,255)",diffRemoved:"rgb(255,204,204)",diffAddedDimmed:"rgb(209,231,253)",diffRemovedDimmed:"rgb(255,233,233)",diffAddedWord:"rgb(51,102,204)",diffRemovedWord:"rgb(153,51,51)",red_FOR_SUBAGENTS_ONLY:"rgb(204,0,0)",blue_FOR_SUBAGENTS_ONLY:"rgb(0,102,204)",green_FOR_SUBAGENTS_ONLY:"rgb(0,204,0)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,204,0)",purple_FOR_SUBAGENTS_ONLY:"rgb(128,0,128)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,128,0)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,102,178)",cyan_FOR_SUBAGENTS_ONLY:"rgb(0,178,178)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(220, 220, 220)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(51,102,255)",rate_limit_empty:"rgb(23,46,114)",penguin:"rgb(255,106,0)",penguinShimmer:"rgb(255,150,50)"},wR0={autoAccept:"rgb(175,135,255)",bashBorder:"rgb(253,93,177)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(235,159,127)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(147,165,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(177,195,255)",permission:"rgb(177,185,249)",permissionShimmer:"rgb(207,215,255)",planMode:"rgb(72,150,140)",delegateMode:"rgb(186,85,255)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",inactiveShimmer:"rgb(193,193,193)",subtle:"rgb(80,80,80)",suggestion:"rgb(177,185,249)",remember:"rgb(177,185,249)",background:"rgb(0,204,204)",success:"rgb(78,186,101)",error:"rgb(255,107,128)",warning:"rgb(255,193,7)",merged:"rgb(175,135,255)",warningShimmer:"rgb(255,223,57)",diffAdded:"rgb(34,92,43)",diffRemoved:"rgb(122,41,54)",diffAddedDimmed:"rgb(71,88,74)",diffRemovedDimmed:"rgb(105,72,77)",diffAddedWord:"rgb(56,166,96)",diffRemovedWord:"rgb(179,89,107)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(177,185,249)",rate_limit_empty:"rgb(80,83,112)",penguin:"rgb(255,120,20)",penguinShimmer:"rgb(255,165,70)"},ZR0={autoAccept:"rgb(175,135,255)",bashBorder:"rgb(51,153,255)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(153,204,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(183,224,255)",permission:"rgb(153,204,255)",permissionShimmer:"rgb(183,224,255)",planMode:"rgb(102,153,153)",delegateMode:"rgb(186,85,255)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",inactiveShimmer:"rgb(193,193,193)",subtle:"rgb(80,80,80)",suggestion:"rgb(153,204,255)",remember:"rgb(153,204,255)",background:"rgb(0,204,204)",success:"rgb(51,153,255)",error:"rgb(255,102,102)",warning:"rgb(255,204,0)",merged:"rgb(175,135,255)",warningShimmer:"rgb(255,234,50)",diffAdded:"rgb(0,68,102)",diffRemoved:"rgb(102,0,0)",diffAddedDimmed:"rgb(62,81,91)",diffRemovedDimmed:"rgb(62,44,44)",diffAddedWord:"rgb(0,119,179)",diffRemovedWord:"rgb(179,0,0)",red_FOR_SUBAGENTS_ONLY:"rgb(255,102,102)",blue_FOR_SUBAGENTS_ONLY:"rgb(102,178,255)",green_FOR_SUBAGENTS_ONLY:"rgb(102,255,102)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,255,102)",purple_FOR_SUBAGENTS_ONLY:"rgb(178,102,255)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,178,102)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,153,204)",cyan_FOR_SUBAGENTS_ONLY:"rgb(102,204,204)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(153,204,255)",rate_limit_empty:"rgb(69,92,115)",penguin:"rgb(255,120,20)",penguinShimmer:"rgb(255,165,70)"};qR0=OA.terminal==="Apple_Terminal"?new ad$({level:2}):oH});function rzH(H,$){let A=H;if($.inverse)A=oH.inverse(A);if($.strikethrough)A=oH.strikethrough(A);if($.underline)A=oH.underline(A);if($.italic)A=oH.italic(A);if($.bold)A=oH.bold(A);if($.dim)A=oH.dim(A);if($.color)A=nzH(A,$.color,"foreground");if($.backgroundColor)A=nzH(A,$.backgroundColor,"background");return A}function du(H,$){if(!$)return H;return nzH(H,$,"foreground")}function ZL(H,$,A="foreground"){return(L)=>{if(!H)return L;if(H.startsWith("rgb(")||H.startsWith("#")||H.startsWith("ansi256(")||H.startsWith("ansi:"))return nzH(L,H,A);return nzH(L,c6($)[H],A)}}var TR0,zR0,nzH=(H,$,A)=>{if(!$)return H;if($.startsWith("ansi:"))switch($.substring(5)){case"black":return A==="foreground"?oH.black(H):oH.bgBlack(H);case"red":return A==="foreground"?oH.red(H):oH.bgRed(H);case"green":return A==="foreground"?oH.green(H):oH.bgGreen(H);case"yellow":return A==="foreground"?oH.yellow(H):oH.bgYellow(H);case"blue":return A==="foreground"?oH.blue(H):oH.bgBlue(H);case"magenta":return A==="foreground"?oH.magenta(H):oH.bgMagenta(H);case"cyan":return A==="foreground"?oH.cyan(H):oH.bgCyan(H);case"white":return A==="foreground"?oH.white(H):oH.bgWhite(H);case"blackBright":return A==="foreground"?oH.blackBright(H):oH.bgBlackBright(H);case"redBright":return A==="foreground"?oH.redBright(H):oH.bgRedBright(H);case"greenBright":return A==="foreground"?oH.greenBright(H):oH.bgGreenBright(H);case"yellowBright":return A==="foreground"?oH.yellowBright(H):oH.bgYellowBright(H);case"blueBright":return A==="foreground"?oH.blueBright(H):oH.bgBlueBright(H);case"magentaBright":return A==="foreground"?oH.magentaBright(H):oH.bgMagentaBright(H);case"cyanBright":return A==="foreground"?oH.cyanBright(H):oH.bgCyanBright(H);case"whiteBright":return A==="foreground"?oH.whiteBright(H):oH.bgWhiteBright(H)}if($.startsWith("#"))return A==="foreground"?oH.hex($)(H):oH.bgHex($)(H);if($.startsWith("ansi256")){let L=zR0.exec($);if(!L)return H;let I=Number(L[1]);return A==="foreground"?oH.ansi256(I)(H):oH.bgAnsi256(I)(H)}if($.startsWith("rgb")){let L=TR0.exec($);if(!L)return H;let I=Number(L[1]),D=Number(L[2]),B=Number(L[3]);return A==="foreground"?oH.rgb(I,D,B)(H):oH.bgRgb(I,D,B)(H)}return H};var Cn=K(()=>{r0();Ky();TR0=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,zR0=/^ansi256\(\s?(\d+)\s?\)$/});function osL(H,$,A,L=0,I){let D=GI($),B=H.length;if(D>=B-2)return["",$.substring(0,B),""];let f;if(A==="center")f=Math.floor((B-D)/2);else if(A==="start")f=L+1;else f=B-D-L-1;f=Math.max(1,Math.min(f,B-D-1));let E=H.substring(0,1)+I.repeat(f-1),M=I.repeat(B-f-D-1)+H.substring(B-1);return[E,$,M]}function k5H(H,$,A){let L=du(H,$);if(A)L=oH.dim(L);return L}var tsL,NR0,OR0=(H,$,A,L)=>{if(A.style.borderStyle){let I=Math.floor(A.yogaNode.getComputedWidth()),D=Math.floor(A.yogaNode.getComputedHeight()),B=typeof A.style.borderStyle==="string"?NR0[A.style.borderStyle]??tsL.default[A.style.borderStyle]:A.style.borderStyle,f=A.style.borderTopColor??A.style.borderColor,E=A.style.borderBottomColor??A.style.borderColor,M=A.style.borderLeftColor??A.style.borderColor,G=A.style.borderRightColor??A.style.borderColor,U=A.style.borderTopDimColor??A.style.borderDimColor,X=A.style.borderBottomDimColor??A.style.borderDimColor,J=A.style.borderLeftDimColor??A.style.borderDimColor,F=A.style.borderRightDimColor??A.style.borderDimColor,Q=A.style.borderTop!==!1,W=A.style.borderBottom!==!1,P=A.style.borderLeft!==!1,C=A.style.borderRight!==!1,Y=Math.max(0,I-(P?1:0)-(C?1:0)),Z=Q?(P?B.topLeft:"")+B.top.repeat(Y)+(C?B.topRight:""):"",q;if(Q&&A.style.borderText?.position==="top"){let[p,d,k]=osL(Z,A.style.borderText.content,A.style.borderText.align,A.style.borderText.offset,B.top);q=k5H(p,f,U)+d+k5H(k,f,U)}else if(Q)q=k5H(Z,f,U);let O=D;if(Q)O-=1;if(W)O-=1;O=Math.max(0,O);let j=(du(B.left,M)+` tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var OQI=K(()=>{NQI()});async function RUA(H=n$9){let{stdout:$}=await H("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),A=/ProgId\s*REG_SZ\s*(?\S+)/.exec($);if(!A)throw new jUA(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:L}=A.groups,I=r$9[L];if(!I)throw new jUA(`Unknown browser ID: ${L}`);return I}var xQI,SQI,n$9,r$9,jUA;var jQI=K(()=>{xQI=require("util"),SQI=require("child_process"),n$9=xQI.promisify(SQI.execFile),r$9={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}};jUA=class jUA extends Error{}});async function yUA(){if(lG$.default.platform==="darwin"){let H=await OUA();return{name:await SUA(H),id:H}}if(lG$.default.platform==="linux"){let{stdout:H}=await a$9("xdg-mime",["query","default","x-scheme-handler/http"]),$=H.trim();return{name:o$9($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(lG$.default.platform==="win32")return RUA();throw Error("Only macOS, Linux, and Windows are supported")}var RQI,lG$,yQI,a$9,o$9=(H)=>H.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());var vQI=K(()=>{ZQI();OQI();jQI();RQI=require("util"),lG$=b(require("process")),yQI=require("child_process"),a$9=RQI.promisify(yQI.execFile)});var pQI={};XA(pQI,{openApp:()=>HA9,default:()=>$A9,apps:()=>Yr});async function s$9(){let H=await NUA(),$=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,A=hUA.Buffer.from($,"utf16le").toString("base64"),{stdout:L}=await t$9(H,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",A],{encoding:"utf8"}),I=L.trim(),D={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return D[I]?{id:D[I]}:{}}function uQI(H){if(typeof H==="string"||Array.isArray(H))return H;let{[bQI]:$}=H;if(!$)throw Error(`${bQI} is not supported`);return $}function rG$({[CJH]:H},{wsl:$}){if($&&Pr)return uQI($);if(!H)throw Error(`${CJH} is not supported`);return uQI(H)}var iG$,hUA,bUA,gQI,mQI,kUA,nG$,t$9,vUA,hQI,CJH,bQI,kQI=async(H,$)=>{let A;for(let L of H)try{return await $(L)}catch(I){A=I}throw A},ASH=async(H)=>{if(H={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...H},Array.isArray(H.app))return kQI(H.app,(f)=>ASH({...H,app:f}));let{name:$,arguments:A=[]}=H.app??{};if(A=[...A],Array.isArray($))return kQI($,(f)=>ASH({...H,app:{name:f,arguments:A}}));if($==="browser"||$==="browserPrivate"){let f={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},E={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},M=Pr?await s$9():await yUA();if(M.id in f){let G=f[M.id];if($==="browserPrivate")A.push(E[G]);return ASH({...H,app:{name:Yr[G],arguments:A}})}throw Error(`${M.name} is not supported as a default browser`)}let L,I=[],D={};if(CJH==="darwin"){if(L="open",H.wait)I.push("--wait-apps");if(H.background)I.push("--background");if(H.newInstance)I.push("--new");if($)I.push("-a",$)}else if(CJH==="win32"||Pr&&!YJH()&&!$){if(L=await NUA(),I.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!Pr)D.windowsVerbatimArguments=!0;let f=["Start"];if(H.wait)f.push("-Wait");if($){if(f.push(`"\`"${$}\`""`),H.target)A.push(H.target)}else if(H.target)f.push(`"${H.target}"`);if(A.length>0)A=A.map((E)=>`"\`"${E}\`""`),f.push("-ArgumentList",A.join(","));H.target=hUA.Buffer.from(f.join(" "),"utf16le").toString("base64")}else{if($)L=$;else{let f=!vUA||vUA==="/",E=!1;try{await nG$.default.access(hQI,nG$.constants.X_OK),E=!0}catch{}L=iG$.default.versions.electron??(CJH==="android"||f||!E)?"xdg-open":hQI}if(A.length>0)I.push(...A);if(!H.wait)D.stdio="ignore",D.detached=!0}if(CJH==="darwin"&&A.length>0)I.push("--args",...A);if(H.target)I.push(H.target);let B=kUA.default.spawn(L,I,D);if(H.wait)return new Promise((f,E)=>{B.once("error",E),B.once("close",(M)=>{if(!H.allowNonzeroExitCode&&M>0){E(Error(`Exited with code ${M}`));return}f(B)})});return B.unref(),B},e$9=(H,$)=>{if(typeof H!=="string")throw TypeError("Expected a `target`");return ASH({...$,target:H})},HA9=(H,$)=>{if(typeof H!=="string"&&!Array.isArray(H))throw TypeError("Expected a valid `name`");let{arguments:A=[]}=$??{};if(A!==void 0&&A!==null&&!Array.isArray(A))throw TypeError("Expected `appArguments` as Array type");return ASH({...$,app:{name:H,arguments:A}})},Yr,$A9;var dQI=K(()=>{_QI();vQI();ZUA();iG$=b(require("process")),hUA=require("buffer"),bUA=b(require("path")),gQI=require("url"),mQI=require("util"),kUA=b(require("child_process")),nG$=b(require("fs/promises")),t$9=mQI.promisify(kUA.default.execFile),vUA=bUA.default.dirname(gQI.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/open/index.js")),hQI=bUA.default.join(vUA,"xdg-open"),{platform:CJH,arch:bQI}=iG$.default;Yr={};_r(Yr,"chrome",()=>rG$({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));_r(Yr,"brave",()=>rG$({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));_r(Yr,"firefox",()=>rG$({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));_r(Yr,"edge",()=>rG$({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));_r(Yr,"browser",()=>"browser");_r(Yr,"browserPrivate",()=>"browserPrivate");$A9=e$9});function AA9(H,$,A={}){var L,I,D;let B=JGI((L=A.logger)!==null&&L!==void 0?L:GY,$,H),f=QUA(B,KUA(A)),E=new lXH(Object.assign(Object.assign({},A.tokenCredentialOptions),{authorityHost:f,loggingOptions:A.loggingOptions}));return{auth:{clientId:H,authority:f,knownAuthorities:EQI(B,f,A.disableInstanceDiscovery)},system:{networkClient:E,loggerOptions:{loggerCallback:pG$((I=A.logger)!==null&&I!==void 0?I:GY),logLevel:dG$(VE$()),piiLoggingEnabled:(D=A.loggingOptions)===null||D===void 0?void 0:D.enableUnsafeSupportLogging}}}}function Cr(H,$,A={}){var L;let I={msalConfig:AA9(H,$,A),cachedAccount:A.authenticationRecord?MQI(A.authenticationRecord):null,pluginConfiguration:nMI.generatePluginConfiguration(A),logger:(L=A.logger)!==null&&L!==void 0?L:GY},D=new Map;async function B(q={}){let O=q.enableCae?"CAE":"default",j=D.get(O);if(j)return I.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),j;I.logger.getToken.info(`Creating new PublicClientApplication with CAE ${q.enableCae?"enabled":"disabled"}.`);let u=q.enableCae?I.pluginConfiguration.cache.cachePluginCae:I.pluginConfiguration.cache.cachePlugin;return I.msalConfig.auth.clientCapabilities=q.enableCae?["cp1"]:void 0,j=new oxH(Object.assign(Object.assign({},I.msalConfig),{broker:{nativeBrokerPlugin:I.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await u}})),D.set(O,j),j}let f=new Map;async function E(q={}){let O=q.enableCae?"CAE":"default",j=f.get(O);if(j)return I.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),j;I.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${q.enableCae?"enabled":"disabled"}.`);let u=q.enableCae?I.pluginConfiguration.cache.cachePluginCae:I.pluginConfiguration.cache.cachePlugin;return I.msalConfig.auth.clientCapabilities=q.enableCae?["cp1"]:void 0,j=new sxH(Object.assign(Object.assign({},I.msalConfig),{broker:{nativeBrokerPlugin:I.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await u}})),f.set(O,j),j}async function M(q,O,j={}){if(I.cachedAccount===null)throw I.logger.getToken.info("No cached account found in local state."),new $g({scopes:O});if(j.claims)I.cachedClaims=j.claims;let u={account:I.cachedAccount,scopes:O,claims:I.cachedClaims};if(I.pluginConfiguration.broker.isEnabled){if(u.tokenQueryParameters||(u.tokenQueryParameters={}),I.pluginConfiguration.broker.enableMsaPassthrough)u.tokenQueryParameters.msal_request_type="consumer_passthrough"}if(j.proofOfPossessionOptions)u.shrNonce=j.proofOfPossessionOptions.nonce,u.authenticationScheme="pop",u.resourceRequestMethod=j.proofOfPossessionOptions.resourceRequestMethod,u.resourceRequestUri=j.proofOfPossessionOptions.resourceRequestUrl;I.logger.getToken.info("Attempting to acquire token silently");try{return await q.acquireTokenSilent(u)}catch(y){throw lIH(O,y,j)}}function G(q){if(q===null||q===void 0?void 0:q.tenantId)return QUA(q.tenantId,KUA(A));return I.msalConfig.auth.authority}async function U(q,O,j,u){var y,g;let h=null;try{h=await M(q,O,j)}catch(p){if(p.name!=="AuthenticationRequiredError")throw p;if(j.disableAutomaticAuthentication)throw new $g({scopes:O,getTokenOptions:j,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(h===null)try{h=await u()}catch(p){throw lIH(O,p,j)}return _JH(O,h,j),I.cachedAccount=(y=h===null||h===void 0?void 0:h.account)!==null&&y!==void 0?y:null,I.logger.getToken.info(ZQ(O)),{token:h.accessToken,expiresOnTimestamp:h.expiresOn.getTime(),refreshAfterTimestamp:(g=h.refreshOn)===null||g===void 0?void 0:g.getTime(),tokenType:h.tokenType}}async function X(q,O,j={}){var u;I.logger.getToken.info("Attempting to acquire token using client secret"),I.msalConfig.auth.clientSecret=O;let y=await E(j);try{let g=await y.acquireTokenByClientCredential({scopes:q,authority:G(j),azureRegion:cG$(),claims:j===null||j===void 0?void 0:j.claims});return _JH(q,g,j),I.logger.getToken.info(ZQ(q)),{token:g.accessToken,expiresOnTimestamp:g.expiresOn.getTime(),refreshAfterTimestamp:(u=g.refreshOn)===null||u===void 0?void 0:u.getTime(),tokenType:g.tokenType}}catch(g){throw lIH(q,g,j)}}async function J(q,O,j={}){var u;I.logger.getToken.info("Attempting to acquire token using client assertion"),I.msalConfig.auth.clientAssertion=O;let y=await E(j);try{let g=await y.acquireTokenByClientCredential({scopes:q,authority:G(j),azureRegion:cG$(),claims:j===null||j===void 0?void 0:j.claims,clientAssertion:O});return _JH(q,g,j),I.logger.getToken.info(ZQ(q)),{token:g.accessToken,expiresOnTimestamp:g.expiresOn.getTime(),refreshAfterTimestamp:(u=g.refreshOn)===null||u===void 0?void 0:u.getTime(),tokenType:g.tokenType}}catch(g){throw lIH(q,g,j)}}async function F(q,O,j={}){var u;I.logger.getToken.info("Attempting to acquire token using client certificate"),I.msalConfig.auth.clientCertificate=O;let y=await E(j);try{let g=await y.acquireTokenByClientCredential({scopes:q,authority:G(j),azureRegion:cG$(),claims:j===null||j===void 0?void 0:j.claims});return _JH(q,g,j),I.logger.getToken.info(ZQ(q)),{token:g.accessToken,expiresOnTimestamp:g.expiresOn.getTime(),refreshAfterTimestamp:(u=g.refreshOn)===null||u===void 0?void 0:u.getTime(),tokenType:g.tokenType}}catch(g){throw lIH(q,g,j)}}async function Q(q,O,j={}){I.logger.getToken.info("Attempting to acquire token using device code");let u=await B(j);return U(u,q,j,()=>{var y,g;let h={scopes:q,cancel:(g=(y=j===null||j===void 0?void 0:j.abortSignal)===null||y===void 0?void 0:y.aborted)!==null&&g!==void 0?g:!1,deviceCodeCallback:O,authority:G(j),claims:j===null||j===void 0?void 0:j.claims},p=u.acquireTokenByDeviceCode(h);if(j.abortSignal)j.abortSignal.addEventListener("abort",()=>{h.cancel=!0});return p})}async function W(q,O,j,u={}){I.logger.getToken.info("Attempting to acquire token using username and password");let y=await B(u);return U(y,q,u,()=>{let g={scopes:q,username:O,password:j,authority:G(u),claims:u===null||u===void 0?void 0:u.claims};return y.acquireTokenByUsernamePassword(g)})}function P(){if(!I.cachedAccount)return;return GQI(H,I.cachedAccount)}async function C(q,O,j,u,y={}){I.logger.getToken.info("Attempting to acquire token using authorization code");let g;if(u)I.msalConfig.auth.clientSecret=u,g=await E(y);else g=await B(y);return U(g,q,y,()=>{return g.acquireTokenByCode({scopes:q,redirectUri:O,code:j,authority:G(y),claims:y===null||y===void 0?void 0:y.claims})})}async function Y(q,O,j,u={}){var y;if(GY.getToken.info("Attempting to acquire token on behalf of another user"),typeof j==="string")GY.getToken.info("Using client secret for on behalf of flow"),I.msalConfig.auth.clientSecret=j;else if(typeof j==="function")GY.getToken.info("Using client assertion callback for on behalf of flow"),I.msalConfig.auth.clientAssertion=j;else GY.getToken.info("Using client certificate for on behalf of flow"),I.msalConfig.auth.clientCertificate=j;let g=await E(u);try{let h=await g.acquireTokenOnBehalfOf({scopes:q,authority:G(u),claims:u.claims,oboAssertion:O});return _JH(q,h,u),GY.getToken.info(ZQ(q)),{token:h.accessToken,expiresOnTimestamp:h.expiresOn.getTime(),refreshAfterTimestamp:(y=h.refreshOn)===null||y===void 0?void 0:y.getTime(),tokenType:h.tokenType}}catch(h){throw lIH(q,h,u)}}async function Z(q,O={}){GY.getToken.info("Attempting to acquire token interactively");let j=await B(O);async function u(g){var h;GY.verbose("Authentication will resume through the broker");let p=y();if(I.pluginConfiguration.broker.parentWindowHandle)p.windowHandle=Buffer.from(I.pluginConfiguration.broker.parentWindowHandle);else GY.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle.");if(I.pluginConfiguration.broker.enableMsaPassthrough)((h=p.tokenQueryParameters)!==null&&h!==void 0?h:p.tokenQueryParameters={}).msal_request_type="consumer_passthrough";if(g)p.prompt="none",GY.verbose("Attempting broker authentication using the default broker account");else GY.verbose("Attempting broker authentication without the default broker account");if(O.proofOfPossessionOptions)p.shrNonce=O.proofOfPossessionOptions.nonce,p.authenticationScheme="pop",p.resourceRequestMethod=O.proofOfPossessionOptions.resourceRequestMethod,p.resourceRequestUri=O.proofOfPossessionOptions.resourceRequestUrl;try{return await j.acquireTokenInteractive(p)}catch(d){if(GY.verbose(`Failed to authenticate through the broker: ${d.message}`),g)return u(!1);else throw d}}function y(){var g,h;return{openBrowser:async(p)=>{await(await Promise.resolve().then(() => (dQI(),pQI))).default(p,{wait:!0,newInstance:!0})},scopes:q,authority:G(O),claims:O===null||O===void 0?void 0:O.claims,loginHint:O===null||O===void 0?void 0:O.loginHint,errorTemplate:(g=O===null||O===void 0?void 0:O.browserCustomizationOptions)===null||g===void 0?void 0:g.errorMessage,successTemplate:(h=O===null||O===void 0?void 0:O.browserCustomizationOptions)===null||h===void 0?void 0:h.successMessage,prompt:(O===null||O===void 0?void 0:O.loginHint)?"login":"select_account"}}return U(j,q,O,async()=>{var g;let h=y();if(I.pluginConfiguration.broker.isEnabled)return u((g=I.pluginConfiguration.broker.useDefaultBrokerAccount)!==null&&g!==void 0?g:!1);if(O.proofOfPossessionOptions)h.shrNonce=O.proofOfPossessionOptions.nonce,h.authenticationScheme="pop",h.resourceRequestMethod=O.proofOfPossessionOptions.resourceRequestMethod,h.resourceRequestUri=O.proofOfPossessionOptions.resourceRequestUrl;return j.acquireTokenInteractive(h)})}return{getActiveAccount:P,getTokenByClientSecret:X,getTokenByClientAssertion:J,getTokenByClientCertificate:F,getTokenByDeviceCode:Q,getTokenByUsernamePassword:W,getTokenByAuthorizationCode:C,getTokenOnBehalfOf:Y,getTokenByInteractiveRequest:Z}}var GY;var LSH=K(()=>{mG$();MJ();rMI();WUA();pV();hEA();FQI();uLH();mO();GY=sf("MsalClient")});class uUA{constructor(H,$,A,L={}){if(!H)throw new W0("ClientAssertionCredential: tenantId is a required parameter.");if(!$)throw new W0("ClientAssertionCredential: clientId is a required parameter.");if(!A)throw new W0("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=H,this.additionallyAllowedTenantIds=$Y(L===null||L===void 0?void 0:L.additionallyAllowedTenants),this.options=L,this.getAssertion=A,this.msalClient=Cr($,H,Object.assign(Object.assign({},L),{logger:cQI,tokenCredentialOptions:this.options}))}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,cQI);let L=Array.isArray(H)?H:[H];return this.msalClient.getTokenByClientAssertion(L,this.getAssertion,A)})}}var cQI;var lQI=K(()=>{LSH();mO();pV();MJ();d2();cQI=sf("ClientAssertionCredential")});class rIH{constructor(H){this.azureFederatedTokenFileContent=void 0,this.cacheDate=void 0;let $=PE$(LA9).assigned.join(", ");ISH.info(`Found the following environment variables: ${$}`);let A=H!==null&&H!==void 0?H:{},L=A.tenantId||process.env.AZURE_TENANT_ID,I=A.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=A.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,L)HY(ISH,L);if(!I)throw new W0(`${nIH}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". `]]))[0];return EA9(D)}throw Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async()=>{let A=dV(this.tenantId,$,this.additionallyAllowedTenantIds),L=typeof H==="string"?H:H[0];if(A)HY(Tg,A);try{ZJH(L,Tg),Tg.getToken.info(`Using the scope ${L}`);let I=oG$(L),D=await this.getAzurePowerShellAccessToken(I,A,this.timeout);return Tg.getToken.info(ZQ(H)),{token:D.Token,expiresOnTimestamp:new Date(D.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(I){if(fA9(I)){let B=new W0(lUA.installed);throw Tg.getToken.info(SE(L,B)),B}else if(BA9(I)){let B=new W0(lUA.login);throw Tg.getToken.info(SE(L,B)),B}let D=new W0(`${I}. ${lUA.troubleshoot}`);throw Tg.getToken.info(SE(L,D)),D}})}}async function EA9(H){let $=/{[^{}]*}/g,A=H.match($),L=H;if(A)try{for(let I of A)try{let D=JSON.parse(I);if(D===null||D===void 0?void 0:D.Token){if(L=L.replace(I,""),L)Tg.getToken.warning(L);return D}}catch(D){continue}}catch(I){throw Error(`Unable to parse the output of PowerShell. Received output: ${H}`)}throw Error(`No access token found in the output. Received output: ${H}`)}var Tg,fWI=!1,MWI,lUA,BA9=(H)=>H.message.match(`(.*)${MWI.login}(.*)`),fA9=(H)=>H.message.match(MWI.installed),iUA;var GWI=K(()=>{mO();MJ();qJH();pV();DWI();d2();Tg=sf("AzurePowerShellCredential");MWI={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},lUA={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},iUA=[EWI("pwsh")];if(fWI)iUA.push(EWI("powershell"))});class aUA{constructor(...H){this._sources=[],this._sources=H}async getToken(H,$={}){let{token:A}=await this.getTokenInternal(H,$);return A}async getTokenInternal(H,$={}){let A=null,L,I=[];return O4.withSpan("ChainedTokenCredential.getToken",$,async(D)=>{for(let B=0;B0){let B=new ufA(I,"ChainedTokenCredential authentication failed.");throw rUA.getToken.info(SE(H,B)),B}if(rUA.getToken.info(`Result for ${L.constructor.name}: ${ZQ(H)}`),A===null)throw new W0("Failed to retrieve a valid token");return{token:A,successfulCredential:L}})}}var rUA;var UWI=K(()=>{pV();MJ();d2();rUA=sf("ChainedTokenCredential")});class oUA{constructor(H,$,A,L={}){if(!H||!$)throw Error(`${DSH}: tenantId and clientId are required parameters.`);this.tenantId=H,this.additionallyAllowedTenantIds=$Y(L===null||L===void 0?void 0:L.additionallyAllowedTenants),this.sendCertificateChain=L.sendCertificateChain,this.certificateConfiguration=Object.assign({},typeof A==="string"?{certificatePath:A}:A);let I=this.certificateConfiguration.certificate,D=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(I||D))throw Error(`${DSH}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(I&&D)throw Error(`${DSH}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=Cr($,H,Object.assign(Object.assign({},L),{logger:XWI,tokenCredentialOptions:L}))}async getToken(H,$={}){return O4.withSpan(`${DSH}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,XWI);let L=Array.isArray(H)?H:[H],I=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(L,I,A)})}async buildClientCertificate(){var H;let $=await MA9(this.certificateConfiguration,(H=this.sendCertificateChain)!==null&&H!==void 0?H:!1),A;if(this.certificateConfiguration.certificatePassword!==void 0)A=BSH.createPrivateKey({key:$.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString();else A=$.certificateContents;return{thumbprint:$.thumbprint,thumbprintSha256:$.thumbprintSha256,privateKey:A,x5c:$.x5c}}}async function MA9(H,$){let{certificate:A,certificatePath:L}=H,I=A||await JWI.readFile(L,"utf8"),D=$?I:void 0,B=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,f=[],E;do if(E=B.exec(I),E)f.push(E[3]);while(E);if(f.length===0)throw Error("The file at the specified path does not contain a PEM-encoded certificate.");let M=BSH.createHash("sha1").update(Buffer.from(f[0],"base64")).digest("hex").toUpperCase(),G=BSH.createHash("sha256").update(Buffer.from(f[0],"base64")).digest("hex").toUpperCase();return{certificateContents:I,thumbprintSha256:G,thumbprint:M,x5c:D}}var BSH,JWI,DSH="ClientCertificateCredential",XWI;var FWI=K(()=>{LSH();mO();MJ();d2();BSH=require("crypto"),JWI=require("fs/promises"),XWI=sf(DSH)});class tUA{constructor(H,$,A,L={}){if(!H)throw new W0("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!$)throw new W0("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!A)throw new W0("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=A,this.tenantId=H,this.additionallyAllowedTenantIds=$Y(L===null||L===void 0?void 0:L.additionallyAllowedTenants),this.msalClient=Cr($,H,Object.assign(Object.assign({},L),{logger:KWI,tokenCredentialOptions:L}))}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,KWI);let L=aG$(H);return this.msalClient.getTokenByClientSecret(L,this.clientSecret,A)})}}var KWI;var QWI=K(()=>{LSH();mO();pV();MJ();qJH();d2();KWI=sf("ClientSecretCredential")});class sUA{constructor(H,$,A,L,I={}){if(!H)throw new W0("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!$)throw new W0("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!A)throw new W0("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!L)throw new W0("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=H,this.additionallyAllowedTenantIds=$Y(I===null||I===void 0?void 0:I.additionallyAllowedTenants),this.username=A,this.password=L,this.msalClient=Cr($,this.tenantId,Object.assign(Object.assign({},I),{tokenCredentialOptions:I!==null&&I!==void 0?I:{}}))}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,GA9);let L=aG$(H);return this.msalClient.getTokenByUsernamePassword(L,this.username,this.password,A)})}}var GA9;var WWI=K(()=>{LSH();mO();pV();MJ();qJH();d2();GA9=sf("UsernamePasswordCredential")});function XA9(){var H;return((H=process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS)!==null&&H!==void 0?H:"").split(";")}function JA9(){var H;let $=((H=process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN)!==null&&H!==void 0?H:"").toLowerCase(),A=$==="true"||$==="1";return zg.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${A}`),A}class eUA{constructor(H){this._credential=void 0;let $=PE$(UA9).assigned.join(", ");zg.info(`Found the following environment variables: ${$}`);let A=process.env.AZURE_TENANT_ID,L=process.env.AZURE_CLIENT_ID,I=process.env.AZURE_CLIENT_SECRET,D=XA9(),B=JA9(),f=Object.assign(Object.assign({},H),{additionallyAllowedTenantIds:D,sendCertificateChain:B});if(A)HY(zg,A);if(A&&L&&I){zg.info(`Invoking ClientSecretCredential with tenant ID: ${A}, clientId: ${L} and clientSecret: [REDACTED]`),this._credential=new tUA(A,L,I,f);return}let E=process.env.AZURE_CLIENT_CERTIFICATE_PATH,M=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(A&&L&&E){zg.info(`Invoking ClientCertificateCredential with tenant ID: ${A}, clientId: ${L} and certificatePath: ${E}`),this._credential=new oUA(A,L,{certificatePath:E,certificatePassword:M},f);return}let G=process.env.AZURE_USERNAME,U=process.env.AZURE_PASSWORD;if(A&&L&&G&&U)zg.info(`Invoking UsernamePasswordCredential with tenant ID: ${A}, clientId: ${L} and username: ${G}`),zg.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new sUA(A,L,G,U,f)}async getToken(H,$={}){return O4.withSpan(`${tG$}.getToken`,$,async(A)=>{if(this._credential)try{let L=await this._credential.getToken(H,A);return zg.getToken.info(ZQ(H)),L}catch(L){let I=new AOH(400,{error:`${tG$} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:L.message.toString().split("More details:").join("")});throw zg.getToken.info(SE(H,I)),I}throw new W0(`${tG$} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}}var UA9,tG$="EnvironmentCredential",zg;var VWI=K(()=>{pV();MJ();FWI();QWI();WWI();mO();d2();UA9=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];zg=sf(tG$)});function FA9(H={}){var $,A,L,I;($=H.retryOptions)!==null&&$!==void 0||(H.retryOptions={maxRetries:5,retryDelayInMs:800});let D=(A=H===null||H===void 0?void 0:H.managedIdentityClientId)!==null&&A!==void 0?A:process.env.AZURE_CLIENT_ID,B=(L=H===null||H===void 0?void 0:H.workloadIdentityClientId)!==null&&L!==void 0?L:D,f=H===null||H===void 0?void 0:H.managedIdentityResourceId,E=process.env.AZURE_FEDERATED_TOKEN_FILE,M=(I=H===null||H===void 0?void 0:H.tenantId)!==null&&I!==void 0?I:process.env.AZURE_TENANT_ID;if(f){let G=Object.assign(Object.assign({},H),{resourceId:f});return new wJH(G)}if(E&&B){let G=Object.assign(Object.assign({},H),{tenantId:M});return new wJH(B,G)}if(D){let G=Object.assign(Object.assign({},H),{clientId:D});return new wJH(G)}return new wJH(H)}function KA9(H){var $,A,L;let I=($=H===null||H===void 0?void 0:H.managedIdentityClientId)!==null&&$!==void 0?$:process.env.AZURE_CLIENT_ID,D=(A=H===null||H===void 0?void 0:H.workloadIdentityClientId)!==null&&A!==void 0?A:I,B=process.env.AZURE_FEDERATED_TOKEN_FILE,f=(L=H===null||H===void 0?void 0:H.tenantId)!==null&&L!==void 0?L:process.env.AZURE_TENANT_ID;if(B&&D){let E=Object.assign(Object.assign({},H),{tenantId:f,clientId:D,tokenFilePath:B});return new rIH(E)}if(f){let E=Object.assign(Object.assign({},H),{tenantId:f});return new rIH(E)}return new rIH(H)}function QA9(H={}){let $=H.processTimeoutInMs;return new cUA(Object.assign({processTimeoutInMs:$},H))}function WA9(H={}){let $=H.processTimeoutInMs;return new dUA(Object.assign({processTimeoutInMs:$},H))}function VA9(H={}){let $=H.processTimeoutInMs;return new nUA(Object.assign({processTimeoutInMs:$},H))}function PA9(H={}){return new eUA(H)}class PWI{constructor(H,$){this.credentialName=H,this.credentialUnavailableErrorMessage=$}getToken(){return H4A.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}}var H4A,sG$;var _WI=K(()=>{aQI();eQI();AWI();GWI();UWI();VWI();gUA();MJ();H4A=sf("DefaultAzureCredential");sG$=class sG$ extends aUA{constructor(H){let $=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,A=[WA9,VA9,QA9],L=[PA9,KA9,FA9],I=[];if($)switch($){case"dev":I=A;break;case"prod":I=L;break;default:{let B=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev'.`;throw H4A.warning(B),Error(B)}}else I=[...L,...A];let D=I.map((B)=>{try{return B(H)}catch(f){return H4A.warning(`Skipped ${B.name} because of an error creating the credential: ${f}`),new PWI(B.name,f.message)}});super(...D)}}});function $4A(H,$,A){let{abortSignal:L,tracingOptions:I}=A||{},D=UOH();D.addPolicy(WOH({credential:H,scopes:$}));async function B(){var f;let M=(f=(await D.sendRequest({sendRequest:(G)=>Promise.resolve({request:G,status:200,headers:G.headers})},cO({url:"https://example.com",abortSignal:L,tracingOptions:I}))).headers.get("authorization"))===null||f===void 0?void 0:f.split(" ")[1];if(!M)throw Error("Failed to get access token");return M}return B}var YWI=K(()=>{Ig()});var CWI=K(()=>{_WI();YWI();m4I()});function eG$(){return{error:(H,...$)=>console.error("[Anthropic SDK ERROR]",H,...$),warn:(H,...$)=>console.error("[Anthropic SDK WARN]",H,...$),info:(H,...$)=>console.error("[Anthropic SDK INFO]",H,...$),debug:(H,...$)=>console.error("[Anthropic SDK DEBUG]",H,...$)}}async function eO({apiKey:H,maxRetries:$,model:A,fetchOverride:L}){let I=process.env.CLAUDE_CODE_CONTAINER_ID,D=process.env.CLAUDE_CODE_REMOTE_SESSION_ID,B=YA9(),f={"x-app":"cli","User-Agent":Gn(),...B,...I?{"x-claude-remote-container-id":I}:{},...D?{"x-claude-remote-session-id":D}:{}};if(N(`[API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: ${!!process.env.ANTHROPIC_CUSTOM_HEADERS}, has Authorization header: ${!!B.Authorization}`),A$(process.env.CLAUDE_CODE_ADDITIONAL_PROTECTION))f["x-anthropic-additional-protection"]="true";if(N("[API:auth] OAuth token check starting"),await iW(),N("[API:auth] OAuth token check complete"),!nL())_A9(f,tI());let M={defaultHeaders:f,maxRetries:$,timeout:parseInt(process.env.API_TIMEOUT_MS||String(600000),10),dangerouslyAllowBrowser:!0,fetchOptions:_AH(),...L&&{fetch:L}};if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)){let U=A===LJ()&&process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION?process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:NHH(),X={...M,awsRegion:U,...A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&{skipAuth:!0},...IR()&&{logger:eG$()}};if(process.env.AWS_BEARER_TOKEN_BEDROCK)X.skipAuth=!0,X.defaultHeaders={...X.defaultHeaders,Authorization:`Bearer ${process.env.AWS_BEARER_TOKEN_BEDROCK}`};else if(!A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)){let J=await YAH();if(J)X.awsAccessKey=J.accessKeyId,X.awsSecretKey=J.secretAccessKey,X.awsSessionToken=J.sessionToken}return new o8$(X)}if(A$(process.env.CLAUDE_CODE_USE_FOUNDRY)){let U;if(!process.env.ANTHROPIC_FOUNDRY_API_KEY)if(A$(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH))U=()=>Promise.resolve("");else U=$4A(new sG$,"https://cognitiveservices.azure.com/.default");let X={...M,...U&&{azureADTokenProvider:U},...IR()&&{logger:eG$()}};return new Hf$(X)}if(A$(process.env.CLAUDE_CODE_USE_VERTEX)){let U=process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project,X=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials,J=A$(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)?{getClient:()=>({getRequestHeaders:()=>({})})}:new wWI.GoogleAuth({scopes:["https://www.googleapis.com/auth/cloud-platform"],...U||X?{}:{projectId:process.env.ANTHROPIC_VERTEX_PROJECT_ID}}),F={...M,region:fiH(A),googleAuth:J,...IR()&&{logger:eG$()}};return new XE$(F)}let G={apiKey:nL()?null:H||eZ(),authToken:nL()?dD()?.accessToken:void 0,...{},...M,...IR()&&{logger:eG$()}};return new BO(G)}function _A9(H,$){let A=process.env.ANTHROPIC_AUTH_TOKEN||zqH($);if(A)H.Authorization=`Bearer ${A}`}function YA9(){let H={},$=process.env.ANTHROPIC_CUSTOM_HEADERS;if(!$)return H;let A=$.split(/\n|\r\n/);for(let L of A){if(!L.trim())continue;let I=L.match(/^\s*(.*?)\s*:\s*(.*?)\s*$/);if(I){let[,D,B]=I;if(D&&B!==void 0)H[D]=B}}return H}var wWI;var fSH=K(()=>{H8I();B8I();n_();uMI();CWI();EI();g$();_Q();NA();nR();qE();E$();aI();wWI=b(ZfA(),1)});function A4A(H){if(jGH())return t1L(H);return H}function TJH(H){return H||jGH()}function ZWI(H){return jGH()&&H.status===429}var ESH=K(()=>{$c$();n_();aI()});function qWI(H){return CA9.some(($)=>H.startsWith($))}function TWI(H,$){if(H.isUsingOverage){if(H.overageStatus==="allowed_warning")return{message:"You're close to your extra usage spending limit",severity:"warning"};return null}if(H.status==="rejected")return{message:wA9(H,$),severity:"error"};if(H.status==="allowed_warning"){if(H.utilization!==void 0&&H.utilization<0.7)return null;if($T()){let I=f0(),D=I==="team"||I==="enterprise",B=T9()?.hasExtraUsageEnabled===!0;if(D&&B&&!my())return null}let L=ZA9(H);if(L)return{message:L,severity:"warning"}}return null}function L4A(H,$){let A=TWI(H,$);if(A&&A.severity==="error")return A.message;return null}function I4A(H,$){let A=TWI(H,$);if(A&&A.severity==="warning")return A.message;return null}function wA9(H,$){let A=H.resetsAt,L=A?K5H(A,!0):void 0,I=H.overageResetsAt?K5H(H.overageResetsAt,!0):void 0,D=L?` \xB7 resets ${L}`:"";if(H.overageStatus==="rejected"){let B="";if(A&&H.overageResetsAt)if(A{Q9();EI();vA();CA9=["You've hit your","You've used","You're now using extra usage","You're close to","You're out of extra usage"]});function NA9(H,$){let A=Date.now()/1000,L=H-$,I=A-L;return Math.max(0,Math.min(1,I/$))}function E4A(H){a2=H,f4A.forEach((A)=>A(H));let $=Math.round((H.resetsAt?H.resetsAt-Date.now()/1000:0)/3600);c("tengu_claudeai_limits_status_changed",{status:H.status,unifiedRateLimitFallbackAvailable:H.unifiedRateLimitFallbackAvailable,hoursTillReset:$})}async function OA9(){let H=LJ(),$=await eO({maxRetries:0,model:H}),A=[{role:"user",content:"quota"}],L=U2(H);return $.beta.messages.create({model:H,max_tokens:1,messages:A,metadata:qr(),...L.length>0?{betas:L}:{}}).asResponse()}async function zWI(){if(!TJH(nL()))return;try{let H=await OA9();M4A(H.headers)}catch(H){if(H instanceof JD)$U$(H)}}function Zr(){let[H,$]=HU$.useState({...a2});return HU$.useEffect(()=>{let A=(L)=>{$({...L})};return f4A.add(A),()=>{f4A.delete(A)}},[]),H}function xA9(H,$){for(let[A,L]of Object.entries(zA9)){let I=H.get(`anthropic-ratelimit-unified-${A}-surpassed-threshold`);if(I!==null){let D=H.get(`anthropic-ratelimit-unified-${A}-utilization`),B=H.get(`anthropic-ratelimit-unified-${A}-reset`),f=D?Number(D):void 0;return{status:"allowed_warning",resetsAt:B?Number(B):void 0,rateLimitType:L,utilization:f,unifiedRateLimitFallbackAvailable:$,isUsingOverage:!1,surpassedThreshold:Number(I)}}}return null}function SA9(H,$,A){let{rateLimitType:L,claimAbbrev:I,windowSeconds:D,thresholds:B}=$,f=H.get(`anthropic-ratelimit-unified-${I}-utilization`),E=H.get(`anthropic-ratelimit-unified-${I}-reset`);if(f===null||E===null)return null;let M=Number(f),G=Number(E),U=NA9(G,D);if(!B.some((J)=>M>=J.utilization&&U<=J.timePct))return null;return{status:"allowed_warning",resetsAt:G,rateLimitType:L,utilization:M,unifiedRateLimitFallbackAvailable:A,isUsingOverage:!1}}function jA9(H,$){let A=xA9(H,$);if(A)return A;for(let L of TA9){let I=SA9(H,L,$);if(I)return I}return null}function NWI(H){let $=H.get("anthropic-ratelimit-unified-status")||"allowed",A=H.get("anthropic-ratelimit-unified-reset"),L=A?Number(A):void 0,I=H.get("anthropic-ratelimit-unified-fallback")==="available",D=H.get("anthropic-ratelimit-unified-representative-claim"),B=H.get("anthropic-ratelimit-unified-overage-status"),f=H.get("anthropic-ratelimit-unified-overage-reset"),E=f?Number(f):void 0,M=H.get("anthropic-ratelimit-unified-overage-disabled-reason"),G=$==="rejected"&&(B==="allowed"||B==="allowed_warning"),U=$;if($==="allowed"||$==="allowed_warning"){let X=jA9(H,I);if(X)return X;U="allowed"}return{status:U,resetsAt:L,unifiedRateLimitFallbackAvailable:I,...D&&{rateLimitType:D},...B&&{overageStatus:B},...E&&{overageResetsAt:E},...M&&{overageDisabledReason:M},isUsingOverage:G}}function M4A(H){let $=nL();if(!TJH($)){if(a2.status!=="allowed"||a2.resetsAt)E4A({status:"allowed",unifiedRateLimitFallbackAvailable:!1,isUsingOverage:!1});return}let A=A4A(H),L=NWI(A);if(!jHH(a2,L))E4A(L)}function $U$(H){if(!TJH(nL())||H.status!==429)return;try{let $={...a2};if(H.headers){let A=A4A(H.headers);$=NWI(A)}if($.status="rejected",!jHH(a2,$))E4A($)}catch($){r($)}}var HU$,TA9,zA9,a2,f4A;var py=K(()=>{fSH();_$();aI();z$();EI();$q();n_();dU();GR$();ESH();B4A();HU$=b(s(),1),TA9=[{rateLimitType:"five_hour",claimAbbrev:"5h",windowSeconds:18000,thresholds:[{utilization:0.9,timePct:0.72}]},{rateLimitType:"seven_day",claimAbbrev:"7d",windowSeconds:604800,thresholds:[{utilization:0.75,timePct:0.6},{utilization:0.5,timePct:0.35},{utilization:0.25,timePct:0.15}]}],zA9={"5h":"five_hour","7d":"seven_day",overage:"overage"};a2={status:"allowed",unifiedRateLimitFallbackAvailable:!1,isUsingOverage:!1},f4A=new Set});var NJH=5242880,Hx=3932160,OJH=2000,xJH=2000,SJH=20971520,OWI=100,xWI=3145728,G4A=104857600,jJH=20,AU$=10;var aIH=()=>{};function MSH(H){if(!H||typeof H!=="object")return null;let $=H,A=5,L=0;while($&&L([^<]+)<\/title>/);if(A&&A[1])return A[1].trim();return""}return H.message}function LU$(H){let $=MSH(H);if($){let{code:L,isSSLError:I}=$;if(L==="ETIMEDOUT")return"Request timed out. Check your internet connection and proxy settings";if(I)switch(L){case"UNABLE_TO_VERIFY_LEAF_SIGNATURE":case"UNABLE_TO_GET_ISSUER_CERT":case"UNABLE_TO_GET_ISSUER_CERT_LOCALLY":return"Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates";case"CERT_HAS_EXPIRED":return"Unable to connect to API: SSL certificate has expired";case"CERT_REVOKED":return"Unable to connect to API: SSL certificate has been revoked";case"DEPTH_ZERO_SELF_SIGNED_CERT":case"SELF_SIGNED_CERT_IN_CHAIN":return"Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates";case"ERR_TLS_CERT_ALTNAME_INVALID":case"HOSTNAME_MISMATCH":return"Unable to connect to API: SSL certificate hostname mismatch";case"CERT_NOT_YET_VALID":return"Unable to connect to API: SSL certificate is not yet valid";default:return`Unable to connect to API: SSL error (${L})`}}if(H.message==="Connection error."){if($?.code)return`Unable to connect to API (${$.code})`;return"Unable to connect to API. Check your internet connection"}let A=yA9(H);return A!==H.message&&A.length>0?A:H.message}async function $x(H,$){await new Promise((A,L)=>{let I=setTimeout(A,H);if($){let D=()=>{clearTimeout(I),L(new rf)};if($.aborted){D();return}$.addEventListener("abort",D,{once:!0}),setTimeout(()=>{$?.removeEventListener("abort",D)},H)}})}var RA9;var Ng=K(()=>{n_();RA9=new Set(["UNABLE_TO_VERIFY_LEAF_SIGNATURE","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","CERT_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CERT_REVOKED","CERT_REJECTED","CERT_UNTRUSTED","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","CERT_CHAIN_TOO_LONG","PATH_LENGTH_EXCEEDED","ERR_TLS_CERT_ALTNAME_INVALID","HOSTNAME_MISMATCH","ERR_TLS_HANDSHAKE_TIMEOUT","ERR_SSL_WRONG_VERSION_NUMBER","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC"])});var jWI={};XA(jWI,{sharp:()=>SWI,default:()=>vA9});function SWI(H){let $=null,A=[],L=0;async function I(){if(!$)$=(async()=>{if(!IU$)throw Error("Native image processor module not available");let{processImage:f}=IU$;return f(H)})();return $}function D(f){for(let E=L;E{G.resize(f,E,M)}),B},jpeg(f){return A.push((E)=>{E.jpeg(f?.quality)}),B},png(f){return A.push((E)=>{E.png(f)}),B},webp(f){return A.push((E)=>{E.webp(f?.quality)}),B},async toBuffer(){let f=await I();return D(f),f.toBuffer()}};return B}var IU$,vA9;var RWI=K(()=>{try{IU$=gmA()}catch(H){IU$=null}vA9=SWI});var dy=z((Rmf,vWI)=>{var yWI=function(H){return typeof H<"u"&&H!==null},hA9=function(H){return typeof H==="object"},bA9=function(H){return Object.prototype.toString.call(H)==="[object Object]"},kA9=function(H){return typeof H==="function"},uA9=function(H){return typeof H==="boolean"},gA9=function(H){return H instanceof Buffer},mA9=function(H){if(yWI(H))switch(H.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},pA9=function(H){return H instanceof ArrayBuffer},dA9=function(H){return typeof H==="string"&&H.length>0},cA9=function(H){return typeof H==="number"&&!Number.isNaN(H)},lA9=function(H){return Number.isInteger(H)},iA9=function(H,$,A){return H>=$&&H<=A},nA9=function(H,$){return $.includes(H)},rA9=function(H,$,A){return Error(`Expected ${$} for ${H} but received ${A} of type ${typeof A}`)},aA9=function(H,$){return $.message=H.message,$};vWI.exports={defined:yWI,object:hA9,plainObject:bA9,fn:kA9,bool:uA9,buffer:gA9,typedArray:mA9,arrayBuffer:pA9,string:dA9,number:cA9,integer:lA9,inRange:iA9,inArray:nA9,invalidParameterError:rA9,nativeError:aA9}});var kWI=z((ymf,bWI)=>{var hWI=()=>!0,DU$=null,oA9=()=>{if(!DU$)if(hWI()&&process.report){let H=process.report.excludeNetwork;process.report.excludeNetwork=!0,DU$=process.report.getReport(),process.report.excludeNetwork=H}else DU$={};return DU$};bWI.exports={isLinux:hWI,getReport:oA9}});var mWI=z((vmf,gWI)=>{var uWI=require("fs"),tA9=(H)=>uWI.readFileSync(H,"utf-8"),sA9=(H)=>new Promise(($,A)=>{uWI.readFile(H,"utf-8",(L,I)=>{if(L)A(L);else $(I)})});gWI.exports={LDD_PATH:"/usr/bin/ldd",readFileSync:tA9,readFile:sA9}});var fU$=z((hmf,L7I)=>{var dWI=require("child_process"),{isLinux:yJH,getReport:cWI}=kWI(),{LDD_PATH:BU$,readFile:lWI,readFileSync:iWI}=mWI(),cy,ly,Tr="",nWI=()=>{if(!Tr)return new Promise((H)=>{dWI.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",($,A)=>{Tr=$?" ":A,H(Tr)})});return Tr},rWI=()=>{if(!Tr)try{Tr=dWI.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(H){Tr=" "}return Tr},zr="glibc",aWI=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,RJH="musl",eA9=(H)=>H.includes("libc.musl-")||H.includes("ld-musl-"),oWI=()=>{let H=cWI();if(H.header&&H.header.glibcVersionRuntime)return zr;if(Array.isArray(H.sharedObjects)){if(H.sharedObjects.some(eA9))return RJH}return null},tWI=(H)=>{let[$,A]=H.split(/[\r\n]+/);if($&&$.includes(zr))return zr;if(A&&A.includes(RJH))return RJH;return null},sWI=(H)=>{if(H.includes("musl"))return RJH;if(H.includes("GNU C Library"))return zr;return null},HL9=async()=>{if(cy!==void 0)return cy;cy=null;try{let H=await lWI(BU$);cy=sWI(H)}catch(H){}return cy},$L9=()=>{if(cy!==void 0)return cy;cy=null;try{let H=iWI(BU$);cy=sWI(H)}catch(H){}return cy},eWI=async()=>{let H=null;if(yJH()){if(H=await HL9(),!H)H=oWI();if(!H){let $=await nWI();H=tWI($)}}return H},H7I=()=>{let H=null;if(yJH()){if(H=$L9(),!H)H=oWI();if(!H){let $=rWI();H=tWI($)}}return H},AL9=async()=>yJH()&&await eWI()!==zr,LL9=()=>yJH()&&H7I()!==zr,IL9=async()=>{if(ly!==void 0)return ly;ly=null;try{let $=(await lWI(BU$)).match(aWI);if($)ly=$[1]}catch(H){}return ly},DL9=()=>{if(ly!==void 0)return ly;ly=null;try{let $=iWI(BU$).match(aWI);if($)ly=$[1]}catch(H){}return ly},$7I=()=>{let H=cWI();if(H.header&&H.header.glibcVersionRuntime)return H.header.glibcVersionRuntime;return null},pWI=(H)=>H.trim().split(/\s+/)[1],A7I=(H)=>{let[$,A,L]=H.split(/[\r\n]+/);if($&&$.includes(zr))return pWI($);if(A&&L&&A.includes(RJH))return pWI(L);return null},BL9=async()=>{let H=null;if(yJH()){if(H=await IL9(),!H)H=$7I();if(!H){let $=await nWI();H=A7I($)}}return H},fL9=()=>{let H=null;if(yJH()){if(H=DL9(),!H)H=$7I();if(!H){let $=rWI();H=A7I($)}}return H};L7I.exports={GLIBC:zr,MUSL:RJH,family:eWI,familySync:H7I,isNonGlibcLinux:AL9,isNonGlibcLinuxSync:LL9,version:BL9,versionSync:fL9}});var GSH=z((bmf,I7I)=>{var EL9=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...H)=>console.error("SEMVER",...H):()=>{};I7I.exports=EL9});var EU$=z((kmf,D7I)=>{var ML9=Number.MAX_SAFE_INTEGER||9007199254740991,GL9=["major","premajor","minor","preminor","patch","prepatch","prerelease"];D7I.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:ML9,RELEASE_TYPES:GL9,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var USH=z((iy,B7I)=>{var{MAX_SAFE_COMPONENT_LENGTH:U4A,MAX_SAFE_BUILD_LENGTH:UL9,MAX_LENGTH:XL9}=EU$(),JL9=GSH();iy=B7I.exports={};var FL9=iy.re=[],KL9=iy.safeRe=[],qD=iy.src=[],QL9=iy.safeSrc=[],TD=iy.t={},WL9=0,X4A="[a-zA-Z0-9-]",VL9=[["\\s",1],["\\d",XL9],[X4A,UL9]],PL9=(H)=>{for(let[$,A]of VL9)H=H.split(`${$}*`).join(`${$}{0,${A}}`).split(`${$}+`).join(`${$}{1,${A}}`);return H},t9=(H,$,A)=>{let L=PL9($),I=WL9++;JL9(H,I,$),TD[H]=I,qD[I]=$,QL9[I]=L,FL9[I]=new RegExp($,A?"g":void 0),KL9[I]=new RegExp(L,A?"g":void 0)};t9("NUMERICIDENTIFIER","0|[1-9]\\d*");t9("NUMERICIDENTIFIERLOOSE","\\d+");t9("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${X4A}*`);t9("MAINVERSION",`(${qD[TD.NUMERICIDENTIFIER]})\\.(${qD[TD.NUMERICIDENTIFIER]})\\.(${qD[TD.NUMERICIDENTIFIER]})`);t9("MAINVERSIONLOOSE",`(${qD[TD.NUMERICIDENTIFIERLOOSE]})\\.(${qD[TD.NUMERICIDENTIFIERLOOSE]})\\.(${qD[TD.NUMERICIDENTIFIERLOOSE]})`);t9("PRERELEASEIDENTIFIER",`(?:${qD[TD.NUMERICIDENTIFIER]}|${qD[TD.NONNUMERICIDENTIFIER]})`);t9("PRERELEASEIDENTIFIERLOOSE",`(?:${qD[TD.NUMERICIDENTIFIERLOOSE]}|${qD[TD.NONNUMERICIDENTIFIER]})`);t9("PRERELEASE",`(?:-(${qD[TD.PRERELEASEIDENTIFIER]}(?:\\.${qD[TD.PRERELEASEIDENTIFIER]})*))`);t9("PRERELEASELOOSE",`(?:-?(${qD[TD.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${qD[TD.PRERELEASEIDENTIFIERLOOSE]})*))`);t9("BUILDIDENTIFIER",`${X4A}+`);t9("BUILD",`(?:\\+(${qD[TD.BUILDIDENTIFIER]}(?:\\.${qD[TD.BUILDIDENTIFIER]})*))`);t9("FULLPLAIN",`v?${qD[TD.MAINVERSION]}${qD[TD.PRERELEASE]}?${qD[TD.BUILD]}?`);t9("FULL",`^${qD[TD.FULLPLAIN]}$`);t9("LOOSEPLAIN",`[v=\\s]*${qD[TD.MAINVERSIONLOOSE]}${qD[TD.PRERELEASELOOSE]}?${qD[TD.BUILD]}?`);t9("LOOSE",`^${qD[TD.LOOSEPLAIN]}$`);t9("GTLT","((?:<|>)?=?)");t9("XRANGEIDENTIFIERLOOSE",`${qD[TD.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);t9("XRANGEIDENTIFIER",`${qD[TD.NUMERICIDENTIFIER]}|x|X|\\*`);t9("XRANGEPLAIN",`[v=\\s]*(${qD[TD.XRANGEIDENTIFIER]})(?:\\.(${qD[TD.XRANGEIDENTIFIER]})(?:\\.(${qD[TD.XRANGEIDENTIFIER]})(?:${qD[TD.PRERELEASE]})?${qD[TD.BUILD]}?)?)?`);t9("XRANGEPLAINLOOSE",`[v=\\s]*(${qD[TD.XRANGEIDENTIFIERLOOSE]})(?:\\.(${qD[TD.XRANGEIDENTIFIERLOOSE]})(?:\\.(${qD[TD.XRANGEIDENTIFIERLOOSE]})(?:${qD[TD.PRERELEASELOOSE]})?${qD[TD.BUILD]}?)?)?`);t9("XRANGE",`^${qD[TD.GTLT]}\\s*${qD[TD.XRANGEPLAIN]}$`);t9("XRANGELOOSE",`^${qD[TD.GTLT]}\\s*${qD[TD.XRANGEPLAINLOOSE]}$`);t9("COERCEPLAIN",`(^|[^\\d])(\\d{1,${U4A}})(?:\\.(\\d{1,${U4A}}))?(?:\\.(\\d{1,${U4A}}))?`);t9("COERCE",`${qD[TD.COERCEPLAIN]}(?:$|[^\\d])`);t9("COERCEFULL",qD[TD.COERCEPLAIN]+`(?:${qD[TD.PRERELEASE]})?(?:${qD[TD.BUILD]})?(?:$|[^\\d])`);t9("COERCERTL",qD[TD.COERCE],!0);t9("COERCERTLFULL",qD[TD.COERCEFULL],!0);t9("LONETILDE","(?:~>?)");t9("TILDETRIM",`(\\s*)${qD[TD.LONETILDE]}\\s+`,!0);iy.tildeTrimReplace="$1~";t9("TILDE",`^${qD[TD.LONETILDE]}${qD[TD.XRANGEPLAIN]}$`);t9("TILDELOOSE",`^${qD[TD.LONETILDE]}${qD[TD.XRANGEPLAINLOOSE]}$`);t9("LONECARET","(?:\\^)");t9("CARETTRIM",`(\\s*)${qD[TD.LONECARET]}\\s+`,!0);iy.caretTrimReplace="$1^";t9("CARET",`^${qD[TD.LONECARET]}${qD[TD.XRANGEPLAIN]}$`);t9("CARETLOOSE",`^${qD[TD.LONECARET]}${qD[TD.XRANGEPLAINLOOSE]}$`);t9("COMPARATORLOOSE",`^${qD[TD.GTLT]}\\s*(${qD[TD.LOOSEPLAIN]})$|^$`);t9("COMPARATOR",`^${qD[TD.GTLT]}\\s*(${qD[TD.FULLPLAIN]})$|^$`);t9("COMPARATORTRIM",`(\\s*)${qD[TD.GTLT]}\\s*(${qD[TD.LOOSEPLAIN]}|${qD[TD.XRANGEPLAIN]})`,!0);iy.comparatorTrimReplace="$1$2$3";t9("HYPHENRANGE",`^\\s*(${qD[TD.XRANGEPLAIN]})\\s+-\\s+(${qD[TD.XRANGEPLAIN]})\\s*$`);t9("HYPHENRANGELOOSE",`^\\s*(${qD[TD.XRANGEPLAINLOOSE]})\\s+-\\s+(${qD[TD.XRANGEPLAINLOOSE]})\\s*$`);t9("STAR","(<|>)?=?\\s*\\*");t9("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");t9("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var MU$=z((umf,f7I)=>{var _L9=Object.freeze({loose:!0}),YL9=Object.freeze({}),CL9=(H)=>{if(!H)return YL9;if(typeof H!=="object")return _L9;return H};f7I.exports=CL9});var U7I=z((gmf,G7I)=>{var E7I=/^[0-9]+$/,M7I=(H,$)=>{let A=E7I.test(H),L=E7I.test($);if(A&&L)H=+H,$=+$;return H===$?0:A&&!L?-1:L&&!A?1:H<$?-1:1},wL9=(H,$)=>M7I($,H);G7I.exports={compareIdentifiers:M7I,rcompareIdentifiers:wL9}});var hJH=z((mmf,K7I)=>{var GU$=GSH(),{MAX_LENGTH:X7I,MAX_SAFE_INTEGER:UU$}=EU$(),{safeRe:J7I,safeSrc:F7I,t:XU$}=USH(),ZL9=MU$(),{compareIdentifiers:vJH}=U7I();class Ax{constructor(H,$){if($=ZL9($),H instanceof Ax)if(H.loose===!!$.loose&&H.includePrerelease===!!$.includePrerelease)return H;else H=H.version;else if(typeof H!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof H}".`);if(H.length>X7I)throw TypeError(`version is longer than ${X7I} characters`);GU$("SemVer",H,$),this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease;let A=H.trim().match($.loose?J7I[XU$.LOOSE]:J7I[XU$.FULL]);if(!A)throw TypeError(`Invalid Version: ${H}`);if(this.raw=H,this.major=+A[1],this.minor=+A[2],this.patch=+A[3],this.major>UU$||this.major<0)throw TypeError("Invalid major version");if(this.minor>UU$||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>UU$||this.patch<0)throw TypeError("Invalid patch version");if(!A[4])this.prerelease=[];else this.prerelease=A[4].split(".").map((L)=>{if(/^[0-9]+$/.test(L)){let I=+L;if(I>=0&&I=0)if(typeof this.prerelease[I]==="number")this.prerelease[I]++,I=-2;if(I===-1){if($===this.prerelease.join(".")&&A===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(L)}}if($){let I=[$,L];if(A===!1)I=[$];if(vJH(this.prerelease[0],$)===0){if(isNaN(this.prerelease[1]))this.prerelease=I}else this.prerelease=I}break}default:throw Error(`invalid increment argument: ${H}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}K7I.exports=Ax});var V7I=z((pmf,W7I)=>{var Q7I=hJH(),qL9=(H,$,A=!1)=>{if(H instanceof Q7I)return H;try{return new Q7I(H,$)}catch(L){if(!A)return null;throw L}};W7I.exports=qL9});var _7I=z((dmf,P7I)=>{var TL9=hJH(),zL9=V7I(),{safeRe:JU$,t:FU$}=USH(),NL9=(H,$)=>{if(H instanceof TL9)return H;if(typeof H==="number")H=String(H);if(typeof H!=="string")return null;$=$||{};let A=null;if(!$.rtl)A=H.match($.includePrerelease?JU$[FU$.COERCEFULL]:JU$[FU$.COERCE]);else{let E=$.includePrerelease?JU$[FU$.COERCERTLFULL]:JU$[FU$.COERCERTL],M;while((M=E.exec(H))&&(!A||A.index+A[0].length!==H.length)){if(!A||M.index+M[0].length!==A.index+A[0].length)A=M;E.lastIndex=M.index+M[1].length+M[2].length}E.lastIndex=-1}if(A===null)return null;let L=A[2],I=A[3]||"0",D=A[4]||"0",B=$.includePrerelease&&A[5]?`-${A[5]}`:"",f=$.includePrerelease&&A[6]?`+${A[6]}`:"";return zL9(`${L}.${I}.${D}${B}${f}`,$)};P7I.exports=NL9});var oIH=z((cmf,C7I)=>{var Y7I=hJH(),OL9=(H,$,A)=>new Y7I(H,A).compare(new Y7I($,A));C7I.exports=OL9});var J4A=z((lmf,w7I)=>{var xL9=oIH(),SL9=(H,$,A)=>xL9(H,$,A)>=0;w7I.exports=SL9});var T7I=z((imf,q7I)=>{class Z7I{constructor(){this.max=1000,this.map=new Map}get(H){let $=this.map.get(H);if($===void 0)return;else return this.map.delete(H),this.map.set(H,$),$}delete(H){return this.map.delete(H)}set(H,$){if(!this.delete(H)&&$!==void 0){if(this.map.size>=this.max){let L=this.map.keys().next().value;this.delete(L)}this.map.set(H,$)}return this}}q7I.exports=Z7I});var N7I=z((nmf,z7I)=>{var jL9=oIH(),RL9=(H,$,A)=>jL9(H,$,A)===0;z7I.exports=RL9});var x7I=z((rmf,O7I)=>{var yL9=oIH(),vL9=(H,$,A)=>yL9(H,$,A)!==0;O7I.exports=vL9});var j7I=z((amf,S7I)=>{var hL9=oIH(),bL9=(H,$,A)=>hL9(H,$,A)>0;S7I.exports=bL9});var y7I=z((omf,R7I)=>{var kL9=oIH(),uL9=(H,$,A)=>kL9(H,$,A)<0;R7I.exports=uL9});var h7I=z((tmf,v7I)=>{var gL9=oIH(),mL9=(H,$,A)=>gL9(H,$,A)<=0;v7I.exports=mL9});var k7I=z((smf,b7I)=>{var pL9=N7I(),dL9=x7I(),cL9=j7I(),lL9=J4A(),iL9=y7I(),nL9=h7I(),rL9=(H,$,A,L)=>{switch($){case"===":if(typeof H==="object")H=H.version;if(typeof A==="object")A=A.version;return H===A;case"!==":if(typeof H==="object")H=H.version;if(typeof A==="object")A=A.version;return H!==A;case"":case"=":case"==":return pL9(H,A,L);case"!=":return dL9(H,A,L);case">":return cL9(H,A,L);case">=":return lL9(H,A,L);case"<":return iL9(H,A,L);case"<=":return nL9(H,A,L);default:throw TypeError(`Invalid operator: ${$}`)}};b7I.exports=rL9});var l7I=z((emf,c7I)=>{var XSH=Symbol("SemVer ANY");class KU${static get ANY(){return XSH}constructor(H,$){if($=u7I($),H instanceof KU$)if(H.loose===!!$.loose)return H;else H=H.value;if(H=H.trim().split(/\s+/).join(" "),K4A("comparator",H,$),this.options=$,this.loose=!!$.loose,this.parse(H),this.semver===XSH)this.value="";else this.value=this.operator+this.semver.version;K4A("comp",this)}parse(H){let $=this.options.loose?g7I[m7I.COMPARATORLOOSE]:g7I[m7I.COMPARATOR],A=H.match($);if(!A)throw TypeError(`Invalid comparator: ${H}`);if(this.operator=A[1]!==void 0?A[1]:"",this.operator==="=")this.operator="";if(!A[2])this.semver=XSH;else this.semver=new p7I(A[2],this.options.loose)}toString(){return this.value}test(H){if(K4A("Comparator.test",H,this.options.loose),this.semver===XSH||H===XSH)return!0;if(typeof H==="string")try{H=new p7I(H,this.options)}catch($){return!1}return F4A(H,this.operator,this.semver,this.options)}intersects(H,$){if(!(H instanceof KU$))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new d7I(H.value,$).test(this.value)}else if(H.operator===""){if(H.value==="")return!0;return new d7I(this.value,$).test(H.semver)}if($=u7I($),$.includePrerelease&&(this.value==="<0.0.0-0"||H.value==="<0.0.0-0"))return!1;if(!$.includePrerelease&&(this.value.startsWith("<0.0.0")||H.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&H.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&H.operator.startsWith("<"))return!0;if(this.semver.version===H.semver.version&&this.operator.includes("=")&&H.operator.includes("="))return!0;if(F4A(this.semver,"<",H.semver,$)&&this.operator.startsWith(">")&&H.operator.startsWith("<"))return!0;if(F4A(this.semver,">",H.semver,$)&&this.operator.startsWith("<")&&H.operator.startsWith(">"))return!0;return!1}}c7I.exports=KU$;var u7I=MU$(),{safeRe:g7I,t:m7I}=USH(),F4A=k7I(),K4A=GSH(),p7I=hJH(),d7I=Q4A()});var Q4A=z((Hpf,a7I)=>{var aL9=/\s+/g;class JSH{constructor(H,$){if($=tL9($),H instanceof JSH)if(H.loose===!!$.loose&&H.includePrerelease===!!$.includePrerelease)return H;else return new JSH(H.raw,$);if(H instanceof W4A)return this.raw=H.value,this.set=[[H]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=H.trim().replace(aL9," "),this.set=this.raw.split("||").map((A)=>this.parseRange(A.trim())).filter((A)=>A.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let A=this.set[0];if(this.set=this.set.filter((L)=>!n7I(L[0])),this.set.length===0)this.set=[A];else if(this.set.length>1){for(let L of this.set)if(L.length===1&&II9(L[0])){this.set=[L];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let H=0;H0)this.formatted+="||";let $=this.set[H];for(let A=0;A<$.length;A++){if(A>0)this.formatted+=" ";this.formatted+=$[A].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(H){let A=((this.options.includePrerelease&&AI9)|(this.options.loose&&LI9))+":"+H,L=i7I.get(A);if(L)return L;let I=this.options.loose,D=I?UY[eV.HYPHENRANGELOOSE]:UY[eV.HYPHENRANGE];H=H.replace(D,FI9(this.options.includePrerelease)),cU("hyphen replace",H),H=H.replace(UY[eV.COMPARATORTRIM],eL9),cU("comparator trim",H),H=H.replace(UY[eV.TILDETRIM],HI9),cU("tilde trim",H),H=H.replace(UY[eV.CARETTRIM],$I9),cU("caret trim",H);let B=H.split(" ").map((G)=>DI9(G,this.options)).join(" ").split(/\s+/).map((G)=>JI9(G,this.options));if(I)B=B.filter((G)=>{return cU("loose invalid filter",G,this.options),!!G.match(UY[eV.COMPARATORLOOSE])});cU("range list",B);let f=new Map,E=B.map((G)=>new W4A(G,this.options));for(let G of E){if(n7I(G))return[G];f.set(G.value,G)}if(f.size>1&&f.has(""))f.delete("");let M=[...f.values()];return i7I.set(A,M),M}intersects(H,$){if(!(H instanceof JSH))throw TypeError("a Range is required");return this.set.some((A)=>{return r7I(A,$)&&H.set.some((L)=>{return r7I(L,$)&&A.every((I)=>{return L.every((D)=>{return I.intersects(D,$)})})})})}test(H){if(!H)return!1;if(typeof H==="string")try{H=new sL9(H,this.options)}catch($){return!1}for(let $=0;$H.value==="<0.0.0-0",II9=(H)=>H.value==="",r7I=(H,$)=>{let A=!0,L=H.slice(),I=L.pop();while(A&&L.length)A=L.every((D)=>{return I.intersects(D,$)}),I=L.pop();return A},DI9=(H,$)=>{return cU("comp",H,$),H=EI9(H,$),cU("caret",H),H=BI9(H,$),cU("tildes",H),H=GI9(H,$),cU("xrange",H),H=XI9(H,$),cU("stars",H),H},HP=(H)=>!H||H.toLowerCase()==="x"||H==="*",BI9=(H,$)=>{return H.trim().split(/\s+/).map((A)=>fI9(A,$)).join(" ")},fI9=(H,$)=>{let A=$.loose?UY[eV.TILDELOOSE]:UY[eV.TILDE];return H.replace(A,(L,I,D,B,f)=>{cU("tilde",H,L,I,D,B,f);let E;if(HP(I))E="";else if(HP(D))E=`>=${I}.0.0 <${+I+1}.0.0-0`;else if(HP(B))E=`>=${I}.${D}.0 <${I}.${+D+1}.0-0`;else if(f)cU("replaceTilde pr",f),E=`>=${I}.${D}.${B}-${f} <${I}.${+D+1}.0-0`;else E=`>=${I}.${D}.${B} <${I}.${+D+1}.0-0`;return cU("tilde return",E),E})},EI9=(H,$)=>{return H.trim().split(/\s+/).map((A)=>MI9(A,$)).join(" ")},MI9=(H,$)=>{cU("caret",H,$);let A=$.loose?UY[eV.CARETLOOSE]:UY[eV.CARET],L=$.includePrerelease?"-0":"";return H.replace(A,(I,D,B,f,E)=>{cU("caret",H,I,D,B,f,E);let M;if(HP(D))M="";else if(HP(B))M=`>=${D}.0.0${L} <${+D+1}.0.0-0`;else if(HP(f))if(D==="0")M=`>=${D}.${B}.0${L} <${D}.${+B+1}.0-0`;else M=`>=${D}.${B}.0${L} <${+D+1}.0.0-0`;else if(E)if(cU("replaceCaret pr",E),D==="0")if(B==="0")M=`>=${D}.${B}.${f}-${E} <${D}.${B}.${+f+1}-0`;else M=`>=${D}.${B}.${f}-${E} <${D}.${+B+1}.0-0`;else M=`>=${D}.${B}.${f}-${E} <${+D+1}.0.0-0`;else if(cU("no pr"),D==="0")if(B==="0")M=`>=${D}.${B}.${f}${L} <${D}.${B}.${+f+1}-0`;else M=`>=${D}.${B}.${f}${L} <${D}.${+B+1}.0-0`;else M=`>=${D}.${B}.${f} <${+D+1}.0.0-0`;return cU("caret return",M),M})},GI9=(H,$)=>{return cU("replaceXRanges",H,$),H.split(/\s+/).map((A)=>UI9(A,$)).join(" ")},UI9=(H,$)=>{H=H.trim();let A=$.loose?UY[eV.XRANGELOOSE]:UY[eV.XRANGE];return H.replace(A,(L,I,D,B,f,E)=>{cU("xRange",H,L,I,D,B,f,E);let M=HP(D),G=M||HP(B),U=G||HP(f),X=U;if(I==="="&&X)I="";if(E=$.includePrerelease?"-0":"",M)if(I===">"||I==="<")L="<0.0.0-0";else L="*";else if(I&&X){if(G)B=0;if(f=0,I===">")if(I=">=",G)D=+D+1,B=0,f=0;else B=+B+1,f=0;else if(I==="<=")if(I="<",G)D=+D+1;else B=+B+1;if(I==="<")E="-0";L=`${I+D}.${B}.${f}${E}`}else if(G)L=`>=${D}.0.0${E} <${+D+1}.0.0-0`;else if(U)L=`>=${D}.${B}.0${E} <${D}.${+B+1}.0-0`;return cU("xRange return",L),L})},XI9=(H,$)=>{return cU("replaceStars",H,$),H.trim().replace(UY[eV.STAR],"")},JI9=(H,$)=>{return cU("replaceGTE0",H,$),H.trim().replace(UY[$.includePrerelease?eV.GTE0PRE:eV.GTE0],"")},FI9=(H)=>($,A,L,I,D,B,f,E,M,G,U,X)=>{if(HP(L))A="";else if(HP(I))A=`>=${L}.0.0${H?"-0":""}`;else if(HP(D))A=`>=${L}.${I}.0${H?"-0":""}`;else if(B)A=`>=${A}`;else A=`>=${A}${H?"-0":""}`;if(HP(M))E="";else if(HP(G))E=`<${+M+1}.0.0-0`;else if(HP(U))E=`<${M}.${+G+1}.0-0`;else if(X)E=`<=${M}.${G}.${U}-${X}`;else if(H)E=`<${M}.${G}.${+U+1}-0`;else E=`<=${E}`;return`${A} ${E}`.trim()},KI9=(H,$,A)=>{for(let L=0;L0){let I=H[L].semver;if(I.major===$.major&&I.minor===$.minor&&I.patch===$.patch)return!0}}return!1}return!0}});var t7I=z(($pf,o7I)=>{var QI9=Q4A(),WI9=(H,$,A)=>{try{$=new QI9($,A)}catch(L){return!1}return $.test(H)};o7I.exports=WI9});var V4A=z((Apf,VI9)=>{VI9.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.33.5",author:"Lovell Fuller ",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert ","Jonathan Ong ","Chanon Sajjamanochai ","Juliano Julio ","Daniel Gasienica ","Julian Walker ","Amit Pitaru ","Brandon Aaron ","Andreas Lind ","Maurus Cuelenaere ","Linus Unneb\xE4ck ","Victor Mateevitsi ","Alaric Holloway ","Bernhard K. Weisshuhn ","Chris Riley ","David Carley ","John Tobin ","Kenton Gray ","Felix B\xFCnemann ","Samy Al Zahrani ","Chintan Thakkar ","F. Orlando Galashan ","Kleis Auke Wolthuizen ","Matt Hirsch ","Matthias Thoemmes ","Patrick Paskaris ","J\xE9r\xE9my Lal ","Rahul Nanwani ","Alice Monday ","Kristo Jorgenson ","YvesBos ","Guy Maliar ","Nicolas Coden ","Matt Parrish ","Marcel Bretschneider ","Matthew McEachen ","Jarda Kot\u011B\u0161ovec ","Kenric D'Souza ","Oleh Aleinyk ","Marcel Bretschneider ","Andrea Bianco ","Rik Heywood ","Thomas Parisot ","Nathan Graves ","Tom Lokhorst ","Espen Hovlandsdal ","Sylvain Dumont ","Alun Davies ","Aidan Hoolachan ","Axel Eirola ","Freezy ","Daiz ","Julian Aubourg ","Keith Belovay ","Michael B. Klein ","Jordan Prudhomme ","Ilya Ovdin ","Andargor ","Paul Neave ","Brendan Kennedy ","Brychan Bennett-Odlum ","Edward Silverton ","Roman Malieiev ","Tomas Szabo ","Robert O'Rourke ","Guillermo Alfonso Varela Chouci\xF1o ","Christian Flintrup ","Manan Jadhav ","Leon Radley ","alza54 ","Jacob Smith ","Michael Nutt ","Brad Parham ","Taneli Vatanen ","Joris Dugu\xE9 ","Chris Banks ","Ompal Singh ","Brodan ","Ankur Parihar ","Brahim Ait elhaj ","Mart Jansink ","Lachlan Newman ","Dennis Beatty ","Ingvar Stepanyan ","Don Denton "],scripts:{install:"node install/check",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types","test-lint":"semistandard && cpplint","test-unit":"nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha","test-licensing":'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',"test-leak":"./test/leak/leak.sh","test-types":"tsd","package-from-local-build":"node npm/from-local-build","package-from-github-release":"node npm/from-github-release","docs-build":"node docs/build && node docs/search-index/build","docs-serve":"cd docs && npx serve","docs-publish":"cd docs && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{color:"^4.2.3","detect-libc":"^2.0.3",semver:"^7.6.3"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.33.5","@img/sharp-darwin-x64":"0.33.5","@img/sharp-libvips-darwin-arm64":"1.0.4","@img/sharp-libvips-darwin-x64":"1.0.4","@img/sharp-libvips-linux-arm":"1.0.5","@img/sharp-libvips-linux-arm64":"1.0.4","@img/sharp-libvips-linux-s390x":"1.0.4","@img/sharp-libvips-linux-x64":"1.0.4","@img/sharp-libvips-linuxmusl-arm64":"1.0.4","@img/sharp-libvips-linuxmusl-x64":"1.0.4","@img/sharp-linux-arm":"0.33.5","@img/sharp-linux-arm64":"0.33.5","@img/sharp-linux-s390x":"0.33.5","@img/sharp-linux-x64":"0.33.5","@img/sharp-linuxmusl-arm64":"0.33.5","@img/sharp-linuxmusl-x64":"0.33.5","@img/sharp-wasm32":"0.33.5","@img/sharp-win32-ia32":"0.33.5","@img/sharp-win32-x64":"0.33.5"},devDependencies:{"@emnapi/runtime":"^1.2.0","@img/sharp-libvips-dev":"1.0.4","@img/sharp-libvips-dev-wasm32":"1.0.5","@img/sharp-libvips-win32-ia32":"1.0.4","@img/sharp-libvips-win32-x64":"1.0.4","@types/node":"*",async:"^3.2.5",cc:"^3.0.1",emnapi:"^1.2.0","exif-reader":"^2.0.1","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^8.0.3","license-checker":"^25.0.1",mocha:"^10.7.3","node-addon-api":"^8.1.0",nyc:"^17.0.0",prebuild:"^13.0.1",semistandard:"^17.0.0","tar-fs":"^3.0.6",tsd:"^0.31.1"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.15.3"},funding:{url:"https://opencollective.com/libvips"},binary:{napi_versions:[9]},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var C4A=z((Lpf,f6I)=>{var{spawnSync:_4A}=require("child_process"),{createHash:PI9}=require("crypto"),$6I=_7I(),_I9=J4A(),YI9=t7I(),s7I=fU$(),{config:CI9,engines:e7I,optionalDependencies:wI9}=V4A(),ZI9=process.env.npm_package_config_libvips||CI9.libvips,A6I=$6I(ZI9).version,qI9=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-ia32","win32-x64"],Y4A={encoding:"utf8",shell:!0},TI9=(H)=>{if(H instanceof Error)console.error(`sharp: Installation error: ${H.message}`);else console.log(`sharp: ${H}`)},L6I=()=>s7I.isNonGlibcLinuxSync()?s7I.familySync():"",zI9=()=>`linux${L6I()}-x64`,bJH=()=>{if(I6I())return"wasm32";let{npm_config_arch:H,npm_config_platform:$,npm_config_libc:A}=process.env,L=typeof A==="string"?A:L6I();return`${$||"linux"}${L}-${H||"x64"}`},NI9=()=>{try{return require(`@img/sharp-libvips-dev-${bJH()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},OI9=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},xI9=()=>{try{return require(`@img/sharp-libvips-dev-${bJH()}/lib`)}catch{try{return require(`@img/sharp-libvips-${bJH()}/lib`)}catch{}}return""},SI9=()=>{if(process.release?.name==="node"&&process.versions){if(!YI9(process.versions.node,e7I.node))return{found:process.versions.node,expected:e7I.node}}},I6I=()=>{let{CC:H}=process.env;return Boolean(H&&H.endsWith("/emcc"))},jI9=()=>{return!1},H6I=(H)=>PI9("sha512").update(H).digest("hex"),RI9=()=>{try{let H=H6I(`imgsharp-libvips-${bJH()}`),$=$6I(wI9[`@img/sharp-libvips-${bJH()}`]).version;return H6I(`${H}npm:${$}`).slice(0,10)}catch{}return""},yI9=()=>_4A(`node-gyp rebuild --directory=src ${I6I()?"--nodedir=emscripten":""}`,{...Y4A,stdio:"inherit"}).status,D6I=()=>{return(_4A("pkg-config --modversion vips-cpp",{...Y4A,env:{...process.env,PKG_CONFIG_PATH:B6I()}}).stdout||"").trim()},B6I=()=>{return[(_4A('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',Y4A).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":")},P4A=(H,$,A)=>{if(A)A(`Detected ${$}, skipping search for globally-installed libvips`);return H},vI9=(H)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return P4A(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",H);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return P4A(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",H);if(jI9())return P4A(!1,"Rosetta",H);let $=D6I();return!!$&&_I9($,A6I)};f6I.exports={minimumLibvipsVersion:A6I,prebuiltPlatforms:qI9,buildPlatformArch:bJH,buildSharpLibvipsIncludeDir:NI9,buildSharpLibvipsCPlusPlusDir:OI9,buildSharpLibvipsLibDir:xI9,isUnsupportedNodeRuntime:SI9,runtimePlatformArch:zI9,log:TI9,yarnLocator:RI9,spawnRebuild:yI9,globalLibvipsVersion:D6I,pkgConfigPath:B6I,useGlobalLibvips:vI9}});var FSH=z((Ipf,M6I)=>{var{familySync:hI9,versionSync:bI9}=fU$(),{runtimePlatformArch:kI9,isUnsupportedNodeRuntime:E6I,prebuiltPlatforms:uI9,minimumLibvipsVersion:gI9}=C4A(),tIH=kI9(),mI9=[`../src/build/Release/sharp-${tIH}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${tIH}/sharp.node`,"@img/sharp-wasm32/sharp.node"],w4A,QU$=[];for(let H of mI9)try{w4A=require(H);break}catch($){QU$.push($)}if(w4A)M6I.exports=w4A;else{let[H,$,A]=["linux","darwin","win32"].map((D)=>tIH.startsWith(D)),L=[`Could not load the "sharp" module using the ${tIH} runtime`];QU$.forEach((D)=>{if(D.code!=="MODULE_NOT_FOUND")L.push(`${D.code}: ${D.message}`)});let I=QU$.map((D)=>D.message).join(" ");if(L.push("Possible solutions:"),E6I()){let{found:D,expected:B}=E6I();L.push("- Please upgrade Node.js:",` Found ${D}`,` Requires ${B}`)}else if(uI9.includes(tIH)){let[D,B]=tIH.split("-"),f=D.endsWith("musl")?" --libc=musl":"";L.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${D.replace("musl","")}${f} --cpu=${B} sharp`)}else L.push(`- Manually install libvips >= ${gI9}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(H&&/(symbol not found|CXXABI_)/i.test(I))try{let{config:D}=require(`@img/sharp-libvips-${tIH}/package`),B=`${hI9()} ${bI9()}`,f=`${D.musl?"musl":"glibc"} ${D.musl||D.glibc}`;L.push("- Update your OS:",` Found ${B}`,` Requires ${f}`)}catch(D){}if(H&&/\/snap\/core[0-9]{2}/.test(I))L.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if($&&/Incompatible library version/.test(I))L.push("- Update Homebrew:"," brew update && brew upgrade vips");if(QU$.some((D)=>D.code==="ERR_DLOPEN_DISABLED"))L.push("- Run Node.js without using the --no-addons flag");if(A&&/The specified procedure could not be found/.test(I))L.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw L.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(L.join(` `))}});var U6I=z((Dpf,G6I)=>{var pI9=require("util"),Z4A=require("stream"),dI9=dy();FSH();var cI9=pI9.debuglog("sharp"),sIH=function(H,$){if(arguments.length===1&&!dI9.defined(H))throw Error("Invalid input");if(!(this instanceof sIH))return new sIH(H,$);return Z4A.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],useExifOrientation:!1,angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBeforePreExtract:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,resolveWithObject:!1,jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],debuglog:(A)=>{this.emit("warning",A),cI9(A)},queueListener:function(A){sIH.queue.emit("change",A)}},this.options.input=this._createInputDescriptor(H,$,{allowStream:!0}),this};Object.setPrototypeOf(sIH.prototype,Z4A.Duplex.prototype);Object.setPrototypeOf(sIH,Z4A.Duplex);function lI9(){let H=this.constructor.call(),{debuglog:$,queueListener:A,...L}=this.options;if(H.options=structuredClone(L),H.options.debuglog=$,H.options.queueListener=A,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),H.options.input.buffer=this.options.input.buffer,H.emit("finish")});return H}Object.assign(sIH.prototype,{clone:lI9});G6I.exports=sIH});var q4A=z((Bpf,X6I)=>{X6I.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var F6I=z((fpf,J6I)=>{J6I.exports=function($){if(!$||typeof $==="string")return!1;return $ instanceof Array||Array.isArray($)||$.length>=0&&($.splice instanceof Function||Object.getOwnPropertyDescriptor($,$.length-1)&&$.constructor.name!=="String")}});var W6I=z((Epf,Q6I)=>{var iI9=F6I(),nI9=Array.prototype.concat,rI9=Array.prototype.slice,K6I=Q6I.exports=function($){var A=[];for(var L=0,I=$.length;L{var QSH=q4A(),WSH=W6I(),V6I=Object.hasOwnProperty,P6I=Object.create(null);for(KSH in QSH)if(V6I.call(QSH,KSH))P6I[QSH[KSH]]=KSH;var KSH,o2=_6I.exports={to:{},get:{}};o2.get=function(H){var $=H.substring(0,3).toLowerCase(),A,L;switch($){case"hsl":A=o2.get.hsl(H),L="hsl";break;case"hwb":A=o2.get.hwb(H),L="hwb";break;default:A=o2.get.rgb(H),L="rgb";break}if(!A)return null;return{model:L,value:A}};o2.get.rgb=function(H){if(!H)return null;var $=/^#([a-f0-9]{3,4})$/i,A=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,L=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,I=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,D=/^(\w+)$/,B=[0,0,0,1],f,E,M;if(f=H.match(A)){M=f[2],f=f[1];for(E=0;E<3;E++){var G=E*2;B[E]=parseInt(f.slice(G,G+2),16)}if(M)B[3]=parseInt(M,16)/255}else if(f=H.match($)){f=f[1],M=f[3];for(E=0;E<3;E++)B[E]=parseInt(f[E]+f[E],16);if(M)B[3]=parseInt(M+M,16)/255}else if(f=H.match(L)){for(E=0;E<3;E++)B[E]=parseInt(f[E+1],0);if(f[4])if(f[5])B[3]=parseFloat(f[4])*0.01;else B[3]=parseFloat(f[4])}else if(f=H.match(I)){for(E=0;E<3;E++)B[E]=Math.round(parseFloat(f[E+1])*2.55);if(f[4])if(f[5])B[3]=parseFloat(f[4])*0.01;else B[3]=parseFloat(f[4])}else if(f=H.match(D)){if(f[1]==="transparent")return[0,0,0,0];if(!V6I.call(QSH,f[1]))return null;return B=QSH[f[1]],B[3]=1,B}else return null;for(E=0;E<3;E++)B[E]=Nr(B[E],0,255);return B[3]=Nr(B[3],0,1),B};o2.get.hsl=function(H){if(!H)return null;var $=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,A=H.match($);if(A){var L=parseFloat(A[4]),I=(parseFloat(A[1])%360+360)%360,D=Nr(parseFloat(A[2]),0,100),B=Nr(parseFloat(A[3]),0,100),f=Nr(isNaN(L)?1:L,0,1);return[I,D,B,f]}return null};o2.get.hwb=function(H){if(!H)return null;var $=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,A=H.match($);if(A){var L=parseFloat(A[4]),I=(parseFloat(A[1])%360+360)%360,D=Nr(parseFloat(A[2]),0,100),B=Nr(parseFloat(A[3]),0,100),f=Nr(isNaN(L)?1:L,0,1);return[I,D,B,f]}return null};o2.to.hex=function(){var H=WSH(arguments);return"#"+WU$(H[0])+WU$(H[1])+WU$(H[2])+(H[3]<1?WU$(Math.round(H[3]*255)):"")};o2.to.rgb=function(){var H=WSH(arguments);return H.length<4||H[3]===1?"rgb("+Math.round(H[0])+", "+Math.round(H[1])+", "+Math.round(H[2])+")":"rgba("+Math.round(H[0])+", "+Math.round(H[1])+", "+Math.round(H[2])+", "+H[3]+")"};o2.to.rgb.percent=function(){var H=WSH(arguments),$=Math.round(H[0]/255*100),A=Math.round(H[1]/255*100),L=Math.round(H[2]/255*100);return H.length<4||H[3]===1?"rgb("+$+"%, "+A+"%, "+L+"%)":"rgba("+$+"%, "+A+"%, "+L+"%, "+H[3]+")"};o2.to.hsl=function(){var H=WSH(arguments);return H.length<4||H[3]===1?"hsl("+H[0]+", "+H[1]+"%, "+H[2]+"%)":"hsla("+H[0]+", "+H[1]+"%, "+H[2]+"%, "+H[3]+")"};o2.to.hwb=function(){var H=WSH(arguments),$="";if(H.length>=4&&H[3]!==1)$=", "+H[3];return"hwb("+H[0]+", "+H[1]+"%, "+H[2]+"%"+$+")"};o2.to.keyword=function(H){return P6I[H.slice(0,3)]};function Nr(H,$,A){return Math.min(Math.max($,H),A)}function WU$(H){var $=Math.round(H).toString(16).toUpperCase();return $.length<2?"0"+$:$}});var T4A=z((Gpf,w6I)=>{var VSH=q4A(),C6I={};for(let H of Object.keys(VSH))C6I[VSH[H]]=H;var AB={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};w6I.exports=AB;for(let H of Object.keys(AB)){if(!("channels"in AB[H]))throw Error("missing channels property: "+H);if(!("labels"in AB[H]))throw Error("missing channel labels property: "+H);if(AB[H].labels.length!==AB[H].channels)throw Error("channel and label counts mismatch: "+H);let{channels:$,labels:A}=AB[H];delete AB[H].channels,delete AB[H].labels,Object.defineProperty(AB[H],"channels",{value:$}),Object.defineProperty(AB[H],"labels",{value:A})}AB.rgb.hsl=function(H){let $=H[0]/255,A=H[1]/255,L=H[2]/255,I=Math.min($,A,L),D=Math.max($,A,L),B=D-I,f,E;if(D===I)f=0;else if($===D)f=(A-L)/B;else if(A===D)f=2+(L-$)/B;else if(L===D)f=4+($-A)/B;if(f=Math.min(f*60,360),f<0)f+=360;let M=(I+D)/2;if(D===I)E=0;else if(M<=0.5)E=B/(D+I);else E=B/(2-D-I);return[f,E*100,M*100]};AB.rgb.hsv=function(H){let $,A,L,I,D,B=H[0]/255,f=H[1]/255,E=H[2]/255,M=Math.max(B,f,E),G=M-Math.min(B,f,E),U=function(X){return(M-X)/6/G+0.5};if(G===0)I=0,D=0;else{if(D=G/M,$=U(B),A=U(f),L=U(E),B===M)I=L-A;else if(f===M)I=0.3333333333333333+$-L;else if(E===M)I=0.6666666666666666+A-$;if(I<0)I+=1;else if(I>1)I-=1}return[I*360,D*100,M*100]};AB.rgb.hwb=function(H){let $=H[0],A=H[1],L=H[2],I=AB.rgb.hsl(H)[0],D=0.00392156862745098*Math.min($,Math.min(A,L));return L=1-0.00392156862745098*Math.max($,Math.max(A,L)),[I,D*100,L*100]};AB.rgb.cmyk=function(H){let $=H[0]/255,A=H[1]/255,L=H[2]/255,I=Math.min(1-$,1-A,1-L),D=(1-$-I)/(1-I)||0,B=(1-A-I)/(1-I)||0,f=(1-L-I)/(1-I)||0;return[D*100,B*100,f*100,I*100]};function aI9(H,$){return(H[0]-$[0])**2+(H[1]-$[1])**2+(H[2]-$[2])**2}AB.rgb.keyword=function(H){let $=C6I[H];if($)return $;let A=1/0,L;for(let I of Object.keys(VSH)){let D=VSH[I],B=aI9(H,D);if(B0.04045?(($+0.055)/1.055)**2.4:$/12.92,A=A>0.04045?((A+0.055)/1.055)**2.4:A/12.92,L=L>0.04045?((L+0.055)/1.055)**2.4:L/12.92;let I=$*0.4124+A*0.3576+L*0.1805,D=$*0.2126+A*0.7152+L*0.0722,B=$*0.0193+A*0.1192+L*0.9505;return[I*100,D*100,B*100]};AB.rgb.lab=function(H){let $=AB.rgb.xyz(H),A=$[0],L=$[1],I=$[2];A/=95.047,L/=100,I/=108.883,A=A>0.008856?A**0.3333333333333333:7.787*A+0.13793103448275862,L=L>0.008856?L**0.3333333333333333:7.787*L+0.13793103448275862,I=I>0.008856?I**0.3333333333333333:7.787*I+0.13793103448275862;let D=116*L-16,B=500*(A-L),f=200*(L-I);return[D,B,f]};AB.hsl.rgb=function(H){let $=H[0]/360,A=H[1]/100,L=H[2]/100,I,D,B;if(A===0)return B=L*255,[B,B,B];if(L<0.5)I=L*(1+A);else I=L+A-L*A;let f=2*L-I,E=[0,0,0];for(let M=0;M<3;M++){if(D=$+0.3333333333333333*-(M-1),D<0)D++;if(D>1)D--;if(6*D<1)B=f+(I-f)*6*D;else if(2*D<1)B=I;else if(3*D<2)B=f+(I-f)*(0.6666666666666666-D)*6;else B=f;E[M]=B*255}return E};AB.hsl.hsv=function(H){let $=H[0],A=H[1]/100,L=H[2]/100,I=A,D=Math.max(L,0.01);L*=2,A*=L<=1?L:2-L,I*=D<=1?D:2-D;let B=(L+A)/2,f=L===0?2*I/(D+I):2*A/(L+A);return[$,f*100,B*100]};AB.hsv.rgb=function(H){let $=H[0]/60,A=H[1]/100,L=H[2]/100,I=Math.floor($)%6,D=$-Math.floor($),B=255*L*(1-A),f=255*L*(1-A*D),E=255*L*(1-A*(1-D));switch(L*=255,I){case 0:return[L,E,B];case 1:return[f,L,B];case 2:return[B,L,E];case 3:return[B,f,L];case 4:return[E,B,L];case 5:return[L,B,f]}};AB.hsv.hsl=function(H){let $=H[0],A=H[1]/100,L=H[2]/100,I=Math.max(L,0.01),D,B;B=(2-A)*L;let f=(2-A)*I;return D=A*I,D/=f<=1?f:2-f,D=D||0,B/=2,[$,D*100,B*100]};AB.hwb.rgb=function(H){let $=H[0]/360,A=H[1]/100,L=H[2]/100,I=A+L,D;if(I>1)A/=I,L/=I;let B=Math.floor(6*$),f=1-L;if(D=6*$-B,(B&1)!==0)D=1-D;let E=A+D*(f-A),M,G,U;switch(B){default:case 6:case 0:M=f,G=E,U=A;break;case 1:M=E,G=f,U=A;break;case 2:M=A,G=f,U=E;break;case 3:M=A,G=E,U=f;break;case 4:M=E,G=A,U=f;break;case 5:M=f,G=A,U=E;break}return[M*255,G*255,U*255]};AB.cmyk.rgb=function(H){let $=H[0]/100,A=H[1]/100,L=H[2]/100,I=H[3]/100,D=1-Math.min(1,$*(1-I)+I),B=1-Math.min(1,A*(1-I)+I),f=1-Math.min(1,L*(1-I)+I);return[D*255,B*255,f*255]};AB.xyz.rgb=function(H){let $=H[0]/100,A=H[1]/100,L=H[2]/100,I,D,B;return I=$*3.2406+A*-1.5372+L*-0.4986,D=$*-0.9689+A*1.8758+L*0.0415,B=$*0.0557+A*-0.204+L*1.057,I=I>0.0031308?1.055*I**0.4166666666666667-0.055:I*12.92,D=D>0.0031308?1.055*D**0.4166666666666667-0.055:D*12.92,B=B>0.0031308?1.055*B**0.4166666666666667-0.055:B*12.92,I=Math.min(Math.max(0,I),1),D=Math.min(Math.max(0,D),1),B=Math.min(Math.max(0,B),1),[I*255,D*255,B*255]};AB.xyz.lab=function(H){let $=H[0],A=H[1],L=H[2];$/=95.047,A/=100,L/=108.883,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,A=A>0.008856?A**0.3333333333333333:7.787*A+0.13793103448275862,L=L>0.008856?L**0.3333333333333333:7.787*L+0.13793103448275862;let I=116*A-16,D=500*($-A),B=200*(A-L);return[I,D,B]};AB.lab.xyz=function(H){let $=H[0],A=H[1],L=H[2],I,D,B;D=($+16)/116,I=A/500+D,B=D-L/200;let f=D**3,E=I**3,M=B**3;return D=f>0.008856?f:(D-0.13793103448275862)/7.787,I=E>0.008856?E:(I-0.13793103448275862)/7.787,B=M>0.008856?M:(B-0.13793103448275862)/7.787,I*=95.047,D*=100,B*=108.883,[I,D,B]};AB.lab.lch=function(H){let $=H[0],A=H[1],L=H[2],I;if(I=Math.atan2(L,A)*360/2/Math.PI,I<0)I+=360;let B=Math.sqrt(A*A+L*L);return[$,B,I]};AB.lch.lab=function(H){let $=H[0],A=H[1],I=H[2]/360*2*Math.PI,D=A*Math.cos(I),B=A*Math.sin(I);return[$,D,B]};AB.rgb.ansi16=function(H,$=null){let[A,L,I]=H,D=$===null?AB.rgb.hsv(H)[2]:$;if(D=Math.round(D/50),D===0)return 30;let B=30+(Math.round(I/255)<<2|Math.round(L/255)<<1|Math.round(A/255));if(D===2)B+=60;return B};AB.hsv.ansi16=function(H){return AB.rgb.ansi16(AB.hsv.rgb(H),H[2])};AB.rgb.ansi256=function(H){let $=H[0],A=H[1],L=H[2];if($===A&&A===L){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(A/255*5)+Math.round(L/255*5)};AB.ansi16.rgb=function(H){let $=H%10;if($===0||$===7){if(H>50)$+=3.5;return $=$/10.5*255,[$,$,$]}let A=(~~(H>50)+1)*0.5,L=($&1)*A*255,I=($>>1&1)*A*255,D=($>>2&1)*A*255;return[L,I,D]};AB.ansi256.rgb=function(H){if(H>=232){let D=(H-232)*10+8;return[D,D,D]}H-=16;let $,A=Math.floor(H/36)/5*255,L=Math.floor(($=H%36)/6)/5*255,I=$%6/5*255;return[A,L,I]};AB.rgb.hex=function(H){let A=(((Math.round(H[0])&255)<<16)+((Math.round(H[1])&255)<<8)+(Math.round(H[2])&255)).toString(16).toUpperCase();return"000000".substring(A.length)+A};AB.hex.rgb=function(H){let $=H.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!$)return[0,0,0];let A=$[0];if($[0].length===3)A=A.split("").map((f)=>{return f+f}).join("");let L=parseInt(A,16),I=L>>16&255,D=L>>8&255,B=L&255;return[I,D,B]};AB.rgb.hcg=function(H){let $=H[0]/255,A=H[1]/255,L=H[2]/255,I=Math.max(Math.max($,A),L),D=Math.min(Math.min($,A),L),B=I-D,f,E;if(B<1)f=D/(1-B);else f=0;if(B<=0)E=0;else if(I===$)E=(A-L)/B%6;else if(I===A)E=2+(L-$)/B;else E=4+($-A)/B;return E/=6,E%=1,[E*360,B*100,f*100]};AB.hsl.hcg=function(H){let $=H[1]/100,A=H[2]/100,L=A<0.5?2*$*A:2*$*(1-A),I=0;if(L<1)I=(A-0.5*L)/(1-L);return[H[0],L*100,I*100]};AB.hsv.hcg=function(H){let $=H[1]/100,A=H[2]/100,L=$*A,I=0;if(L<1)I=(A-L)/(1-L);return[H[0],L*100,I*100]};AB.hcg.rgb=function(H){let $=H[0]/360,A=H[1]/100,L=H[2]/100;if(A===0)return[L*255,L*255,L*255];let I=[0,0,0],D=$%1*6,B=D%1,f=1-B,E=0;switch(Math.floor(D)){case 0:I[0]=1,I[1]=B,I[2]=0;break;case 1:I[0]=f,I[1]=1,I[2]=0;break;case 2:I[0]=0,I[1]=1,I[2]=B;break;case 3:I[0]=0,I[1]=f,I[2]=1;break;case 4:I[0]=B,I[1]=0,I[2]=1;break;default:I[0]=1,I[1]=0,I[2]=f}return E=(1-A)*L,[(A*I[0]+E)*255,(A*I[1]+E)*255,(A*I[2]+E)*255]};AB.hcg.hsv=function(H){let $=H[1]/100,A=H[2]/100,L=$+A*(1-$),I=0;if(L>0)I=$/L;return[H[0],I*100,L*100]};AB.hcg.hsl=function(H){let $=H[1]/100,L=H[2]/100*(1-$)+0.5*$,I=0;if(L>0&&L<0.5)I=$/(2*L);else if(L>=0.5&&L<1)I=$/(2*(1-L));return[H[0],I*100,L*100]};AB.hcg.hwb=function(H){let $=H[1]/100,A=H[2]/100,L=$+A*(1-$);return[H[0],(L-$)*100,(1-L)*100]};AB.hwb.hcg=function(H){let $=H[1]/100,L=1-H[2]/100,I=L-$,D=0;if(I<1)D=(L-I)/(1-I);return[H[0],I*100,D*100]};AB.apple.rgb=function(H){return[H[0]/65535*255,H[1]/65535*255,H[2]/65535*255]};AB.rgb.apple=function(H){return[H[0]/255*65535,H[1]/255*65535,H[2]/255*65535]};AB.gray.rgb=function(H){return[H[0]/100*255,H[0]/100*255,H[0]/100*255]};AB.gray.hsl=function(H){return[0,0,H[0]]};AB.gray.hsv=AB.gray.hsl;AB.gray.hwb=function(H){return[0,100,H[0]]};AB.gray.cmyk=function(H){return[0,0,0,H[0]]};AB.gray.lab=function(H){return[H[0],0,0]};AB.gray.hex=function(H){let $=Math.round(H[0]/100*255)&255,L=(($<<16)+($<<8)+$).toString(16).toUpperCase();return"000000".substring(L.length)+L};AB.rgb.gray=function(H){return[(H[0]+H[1]+H[2])/3/255*100]}});var q6I=z((Upf,Z6I)=>{var VU$=T4A();function oI9(){let H={},$=Object.keys(VU$);for(let A=$.length,L=0;L{var z4A=T4A(),HD9=q6I(),kJH={},$D9=Object.keys(z4A);function AD9(H){let $=function(...A){let L=A[0];if(L===void 0||L===null)return L;if(L.length>1)A=L;return H(A)};if("conversion"in H)$.conversion=H.conversion;return $}function LD9(H){let $=function(...A){let L=A[0];if(L===void 0||L===null)return L;if(L.length>1)A=L;let I=H(A);if(typeof I==="object")for(let D=I.length,B=0;B{kJH[H]={},Object.defineProperty(kJH[H],"channels",{value:z4A[H].channels}),Object.defineProperty(kJH[H],"labels",{value:z4A[H].labels});let $=HD9(H);Object.keys($).forEach((L)=>{let I=$[L];kJH[H][L]=LD9(I),kJH[H][L].raw=AD9(I)})});T6I.exports=kJH});var _U$=z((Jpf,N6I)=>{var uJH=Y6I(),t2=N4A(),z6I=["keyword","gray","hex"],O4A={};for(let H of Object.keys(t2))O4A[[...t2[H].labels].sort().join("")]=H;var PU$={};function qQ(H,$){if(!(this instanceof qQ))return new qQ(H,$);if($&&$ in z6I)$=null;if($&&!($ in t2))throw Error("Unknown model: "+$);let A,L;if(H==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(H instanceof qQ)this.model=H.model,this.color=[...H.color],this.valpha=H.valpha;else if(typeof H==="string"){let I=uJH.get(H);if(I===null)throw Error("Unable to parse color from string: "+H);this.model=I.model,L=t2[this.model].channels,this.color=I.value.slice(0,L),this.valpha=typeof I.value[L]==="number"?I.value[L]:1}else if(H.length>0){this.model=$||"rgb",L=t2[this.model].channels;let I=Array.prototype.slice.call(H,0,L);this.color=x4A(I,L),this.valpha=typeof H[L]==="number"?H[L]:1}else if(typeof H==="number")this.model="rgb",this.color=[H>>16&255,H>>8&255,H&255],this.valpha=1;else{this.valpha=1;let I=Object.keys(H);if("alpha"in H)I.splice(I.indexOf("alpha"),1),this.valpha=typeof H.alpha==="number"?H.alpha:0;let D=I.sort().join("");if(!(D in O4A))throw Error("Unable to parse color from object: "+JSON.stringify(H));this.model=O4A[D];let{labels:B}=t2[this.model],f=[];for(A=0;A(H%360+360)%360),saturationl:VX("hsl",1,VK(100)),lightness:VX("hsl",2,VK(100)),saturationv:VX("hsv",1,VK(100)),value:VX("hsv",2,VK(100)),chroma:VX("hcg",1,VK(100)),gray:VX("hcg",2,VK(100)),white:VX("hwb",1,VK(100)),wblack:VX("hwb",2,VK(100)),cyan:VX("cmyk",0,VK(100)),magenta:VX("cmyk",1,VK(100)),yellow:VX("cmyk",2,VK(100)),black:VX("cmyk",3,VK(100)),x:VX("xyz",0,VK(95.047)),y:VX("xyz",1,VK(100)),z:VX("xyz",2,VK(108.833)),l:VX("lab",0,VK(100)),a:VX("lab",1),b:VX("lab",2),keyword(H){if(H!==void 0)return new qQ(H);return t2[this.model].keyword(this.color)},hex(H){if(H!==void 0)return new qQ(H);return uJH.to.hex(this.rgb().round().color)},hexa(H){if(H!==void 0)return new qQ(H);let $=this.rgb().round().color,A=Math.round(this.valpha*255).toString(16).toUpperCase();if(A.length===1)A="0"+A;return uJH.to.hex($)+A},rgbNumber(){let H=this.rgb().color;return(H[0]&255)<<16|(H[1]&255)<<8|H[2]&255},luminosity(){let H=this.rgb().color,$=[];for(let[A,L]of H.entries()){let I=L/255;$[A]=I<=0.04045?I/12.92:((I+0.055)/1.055)**2.4}return 0.2126*$[0]+0.7152*$[1]+0.0722*$[2]},contrast(H){let $=this.luminosity(),A=H.luminosity();if($>A)return($+0.05)/(A+0.05);return(A+0.05)/($+0.05)},level(H){let $=this.contrast(H);if($>=7)return"AAA";return $>=4.5?"AA":""},isDark(){let H=this.rgb().color;return(H[0]*2126+H[1]*7152+H[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let H=this.rgb();for(let $=0;$<3;$++)H.color[$]=255-H.color[$];return H},lighten(H){let $=this.hsl();return $.color[2]+=$.color[2]*H,$},darken(H){let $=this.hsl();return $.color[2]-=$.color[2]*H,$},saturate(H){let $=this.hsl();return $.color[1]+=$.color[1]*H,$},desaturate(H){let $=this.hsl();return $.color[1]-=$.color[1]*H,$},whiten(H){let $=this.hwb();return $.color[1]+=$.color[1]*H,$},blacken(H){let $=this.hwb();return $.color[2]+=$.color[2]*H,$},grayscale(){let H=this.rgb().color,$=H[0]*0.3+H[1]*0.59+H[2]*0.11;return qQ.rgb($,$,$)},fade(H){return this.alpha(this.valpha-this.valpha*H)},opaquer(H){return this.alpha(this.valpha+this.valpha*H)},rotate(H){let $=this.hsl(),A=$.color[0];return A=(A+H)%360,A=A<0?360+A:A,$.color[0]=A,$},mix(H,$){if(!H||!H.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof H);let A=H.rgb(),L=this.rgb(),I=$===void 0?0.5:$,D=2*I-1,B=A.alpha()-L.alpha(),f=((D*B===-1?D:(D+B)/(1+D*B))+1)/2,E=1-f;return qQ.rgb(f*A.red()+E*L.red(),f*A.green()+E*L.green(),f*A.blue()+E*L.blue(),A.alpha()*I+L.alpha()*(1-I))}};for(let H of Object.keys(t2)){if(z6I.includes(H))continue;let{channels:$}=t2[H];qQ.prototype[H]=function(...A){if(this.model===H)return new qQ(this);if(A.length>0)return new qQ(A,H);return new qQ([...BD9(t2[this.model][H].raw(this.color)),this.valpha],H)},qQ[H]=function(...A){let L=A[0];if(typeof L==="number")L=x4A(A,$);return new qQ(L,H)}}function ID9(H,$){return Number(H.toFixed($))}function DD9(H){return function($){return ID9($,H)}}function VX(H,$,A){H=Array.isArray(H)?H:[H];for(let L of H)(PU$[L]||(PU$[L]=[]))[$]=A;return H=H[0],function(L){let I;if(L!==void 0){if(A)L=A(L);return I=this[H](),I.color[$]=L,I}if(I=this[H]().color[$],A)I=A(I);return I}}function VK(H){return function($){return Math.max(0,Math.min(H,$))}}function BD9(H){return Array.isArray(H)?H:[H]}function x4A(H,$){for(let A=0;A<$;A++)if(typeof H[A]!=="number")H[A]=0;return H}N6I.exports=qQ});var S6I=z((Fpf,x6I)=>{var fD9=_U$(),cA=dy(),Or=FSH(),ED9={left:"low",center:"centre",centre:"centre",right:"high"};function O6I(H){let{raw:$,density:A,limitInputPixels:L,ignoreIcc:I,unlimited:D,sequentialRead:B,failOn:f,failOnError:E,animated:M,page:G,pages:U,subifd:X}=H;return[$,A,L,I,D,B,f,E,M,G,U,X].some(cA.defined)?{raw:$,density:A,limitInputPixels:L,ignoreIcc:I,unlimited:D,sequentialRead:B,failOn:f,failOnError:E,animated:M,page:G,pages:U,subifd:X}:void 0}function MD9(H,$,A){let L={failOn:"warning",limitInputPixels:Math.pow(16383,2),ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(cA.string(H))L.file=H;else if(cA.buffer(H)){if(H.length===0)throw Error("Input Buffer is empty");L.buffer=H}else if(cA.arrayBuffer(H)){if(H.byteLength===0)throw Error("Input bit Array is empty");L.buffer=Buffer.from(H,0,H.byteLength)}else if(cA.typedArray(H)){if(H.length===0)throw Error("Input Bit Array is empty");L.buffer=Buffer.from(H.buffer,H.byteOffset,H.byteLength)}else if(cA.plainObject(H)&&!cA.defined($)){if($=H,O6I($))L.buffer=[]}else if(!cA.defined(H)&&!cA.defined($)&&cA.object(A)&&A.allowStream)L.buffer=[];else throw Error(`Unsupported input '${H}' of type ${typeof H}${cA.defined($)?` when also providing options of type ${typeof $}`:""}`);if(cA.object($)){if(cA.defined($.failOnError))if(cA.bool($.failOnError))L.failOn=$.failOnError?"warning":"none";else throw cA.invalidParameterError("failOnError","boolean",$.failOnError);if(cA.defined($.failOn))if(cA.string($.failOn)&&cA.inArray($.failOn,["none","truncated","error","warning"]))L.failOn=$.failOn;else throw cA.invalidParameterError("failOn","one of: none, truncated, error, warning",$.failOn);if(cA.defined($.density))if(cA.inRange($.density,1,1e5))L.density=$.density;else throw cA.invalidParameterError("density","number between 1 and 100000",$.density);if(cA.defined($.ignoreIcc))if(cA.bool($.ignoreIcc))L.ignoreIcc=$.ignoreIcc;else throw cA.invalidParameterError("ignoreIcc","boolean",$.ignoreIcc);if(cA.defined($.limitInputPixels))if(cA.bool($.limitInputPixels))L.limitInputPixels=$.limitInputPixels?Math.pow(16383,2):0;else if(cA.integer($.limitInputPixels)&&cA.inRange($.limitInputPixels,0,Number.MAX_SAFE_INTEGER))L.limitInputPixels=$.limitInputPixels;else throw cA.invalidParameterError("limitInputPixels","positive integer",$.limitInputPixels);if(cA.defined($.unlimited))if(cA.bool($.unlimited))L.unlimited=$.unlimited;else throw cA.invalidParameterError("unlimited","boolean",$.unlimited);if(cA.defined($.sequentialRead))if(cA.bool($.sequentialRead))L.sequentialRead=$.sequentialRead;else throw cA.invalidParameterError("sequentialRead","boolean",$.sequentialRead);if(cA.defined($.raw))if(cA.object($.raw)&&cA.integer($.raw.width)&&$.raw.width>0&&cA.integer($.raw.height)&&$.raw.height>0&&cA.integer($.raw.channels)&&cA.inRange($.raw.channels,1,4))switch(L.rawWidth=$.raw.width,L.rawHeight=$.raw.height,L.rawChannels=$.raw.channels,L.rawPremultiplied=!!$.raw.premultiplied,H.constructor){case Uint8Array:case Uint8ClampedArray:L.rawDepth="uchar";break;case Int8Array:L.rawDepth="char";break;case Uint16Array:L.rawDepth="ushort";break;case Int16Array:L.rawDepth="short";break;case Uint32Array:L.rawDepth="uint";break;case Int32Array:L.rawDepth="int";break;case Float32Array:L.rawDepth="float";break;case Float64Array:L.rawDepth="double";break;default:L.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(cA.defined($.animated))if(cA.bool($.animated))L.pages=$.animated?-1:1;else throw cA.invalidParameterError("animated","boolean",$.animated);if(cA.defined($.pages))if(cA.integer($.pages)&&cA.inRange($.pages,-1,1e5))L.pages=$.pages;else throw cA.invalidParameterError("pages","integer between -1 and 100000",$.pages);if(cA.defined($.page))if(cA.integer($.page)&&cA.inRange($.page,0,1e5))L.page=$.page;else throw cA.invalidParameterError("page","integer between 0 and 100000",$.page);if(cA.defined($.level))if(cA.integer($.level)&&cA.inRange($.level,0,256))L.level=$.level;else throw cA.invalidParameterError("level","integer between 0 and 256",$.level);if(cA.defined($.subifd))if(cA.integer($.subifd)&&cA.inRange($.subifd,-1,1e5))L.subifd=$.subifd;else throw cA.invalidParameterError("subifd","integer between -1 and 100000",$.subifd);if(cA.defined($.create))if(cA.object($.create)&&cA.integer($.create.width)&&$.create.width>0&&cA.integer($.create.height)&&$.create.height>0&&cA.integer($.create.channels)){if(L.createWidth=$.create.width,L.createHeight=$.create.height,L.createChannels=$.create.channels,cA.defined($.create.noise)){if(!cA.object($.create.noise))throw Error("Expected noise to be an object");if(!cA.inArray($.create.noise.type,["gaussian"]))throw Error("Only gaussian noise is supported at the moment");if(!cA.inRange($.create.channels,1,4))throw cA.invalidParameterError("create.channels","number between 1 and 4",$.create.channels);if(L.createNoiseType=$.create.noise.type,cA.number($.create.noise.mean)&&cA.inRange($.create.noise.mean,0,1e4))L.createNoiseMean=$.create.noise.mean;else throw cA.invalidParameterError("create.noise.mean","number between 0 and 10000",$.create.noise.mean);if(cA.number($.create.noise.sigma)&&cA.inRange($.create.noise.sigma,0,1e4))L.createNoiseSigma=$.create.noise.sigma;else throw cA.invalidParameterError("create.noise.sigma","number between 0 and 10000",$.create.noise.sigma)}else if(cA.defined($.create.background)){if(!cA.inRange($.create.channels,3,4))throw cA.invalidParameterError("create.channels","number between 3 and 4",$.create.channels);let I=fD9($.create.background);L.createBackground=[I.red(),I.green(),I.blue(),Math.round(I.alpha()*255)]}else throw Error("Expected valid noise or background to create a new input image");delete L.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(cA.defined($.text))if(cA.object($.text)&&cA.string($.text.text)){if(L.textValue=$.text.text,cA.defined($.text.height)&&cA.defined($.text.dpi))throw Error("Expected only one of dpi or height");if(cA.defined($.text.font))if(cA.string($.text.font))L.textFont=$.text.font;else throw cA.invalidParameterError("text.font","string",$.text.font);if(cA.defined($.text.fontfile))if(cA.string($.text.fontfile))L.textFontfile=$.text.fontfile;else throw cA.invalidParameterError("text.fontfile","string",$.text.fontfile);if(cA.defined($.text.width))if(cA.integer($.text.width)&&$.text.width>0)L.textWidth=$.text.width;else throw cA.invalidParameterError("text.width","positive integer",$.text.width);if(cA.defined($.text.height))if(cA.integer($.text.height)&&$.text.height>0)L.textHeight=$.text.height;else throw cA.invalidParameterError("text.height","positive integer",$.text.height);if(cA.defined($.text.align))if(cA.string($.text.align)&&cA.string(this.constructor.align[$.text.align]))L.textAlign=this.constructor.align[$.text.align];else throw cA.invalidParameterError("text.align","valid alignment",$.text.align);if(cA.defined($.text.justify))if(cA.bool($.text.justify))L.textJustify=$.text.justify;else throw cA.invalidParameterError("text.justify","boolean",$.text.justify);if(cA.defined($.text.dpi))if(cA.integer($.text.dpi)&&cA.inRange($.text.dpi,1,1e6))L.textDpi=$.text.dpi;else throw cA.invalidParameterError("text.dpi","integer between 1 and 1000000",$.text.dpi);if(cA.defined($.text.rgba))if(cA.bool($.text.rgba))L.textRgba=$.text.rgba;else throw cA.invalidParameterError("text.rgba","bool",$.text.rgba);if(cA.defined($.text.spacing))if(cA.integer($.text.spacing)&&cA.inRange($.text.spacing,-1e6,1e6))L.textSpacing=$.text.spacing;else throw cA.invalidParameterError("text.spacing","integer between -1000000 and 1000000",$.text.spacing);if(cA.defined($.text.wrap))if(cA.string($.text.wrap)&&cA.inArray($.text.wrap,["word","char","word-char","none"]))L.textWrap=$.text.wrap;else throw cA.invalidParameterError("text.wrap","one of: word, char, word-char, none",$.text.wrap);delete L.buffer}else throw Error("Expected a valid string to create an image with text.")}else if(cA.defined($))throw Error("Invalid input options "+$);return L}function GD9(H,$,A){if(Array.isArray(this.options.input.buffer))if(cA.buffer(H)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(H),A()}else A(Error("Non-Buffer data on Writable Stream"));else A(Error("Unexpected data on Writable Stream"))}function UD9(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function XD9(){return Array.isArray(this.options.input.buffer)}function JD9(H){let $=Error();if(cA.fn(H)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Or.metadata(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)})});else Or.metadata(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)});return this}else if(this._isStreamInput())return new Promise((A,L)=>{let I=()=>{this._flattenBufferIn(),Or.metadata(this.options,(D,B)=>{if(D)L(cA.nativeError(D,$));else A(B)})};if(this.writableFinished)I();else this.once("finish",I)});else return new Promise((A,L)=>{Or.metadata(this.options,(I,D)=>{if(I)L(cA.nativeError(I,$));else A(D)})})}function FD9(H){let $=Error();if(cA.fn(H)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Or.stats(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)})});else Or.stats(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)});return this}else if(this._isStreamInput())return new Promise((A,L)=>{this.on("finish",function(){this._flattenBufferIn(),Or.stats(this.options,(I,D)=>{if(I)L(cA.nativeError(I,$));else A(D)})})});else return new Promise((A,L)=>{Or.stats(this.options,(I,D)=>{if(I)L(cA.nativeError(I,$));else A(D)})})}x6I.exports=function(H){Object.assign(H.prototype,{_inputOptionsFromObject:O6I,_createInputDescriptor:MD9,_write:GD9,_flattenBufferIn:UD9,_isStreamInput:XD9,metadata:JD9,stats:FD9}),H.align=ED9}});var b6I=z((Kpf,h6I)=>{var YB=dy(),R6I={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},y6I={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},j6I={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},v6I={entropy:16,attention:17},S4A={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3"},KD9={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},QD9={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function j4A(H){return H.angle%360!==0||H.useExifOrientation===!0||H.rotationAngle!==0}function YU$(H){return H.width!==-1||H.height!==-1}function WD9(H,$,A){if(YU$(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(YB.defined(H))if(YB.object(H)&&!YB.defined(A))A=H;else if(YB.integer(H)&&H>0)this.options.width=H;else throw YB.invalidParameterError("width","positive integer",H);else this.options.width=-1;if(YB.defined($))if(YB.integer($)&&$>0)this.options.height=$;else throw YB.invalidParameterError("height","positive integer",$);else this.options.height=-1;if(YB.object(A)){if(YB.defined(A.width))if(YB.integer(A.width)&&A.width>0)this.options.width=A.width;else throw YB.invalidParameterError("width","positive integer",A.width);if(YB.defined(A.height))if(YB.integer(A.height)&&A.height>0)this.options.height=A.height;else throw YB.invalidParameterError("height","positive integer",A.height);if(YB.defined(A.fit)){let L=QD9[A.fit];if(YB.string(L))this.options.canvas=L;else throw YB.invalidParameterError("fit","valid fit",A.fit)}if(YB.defined(A.position)){let L=YB.integer(A.position)?A.position:v6I[A.position]||y6I[A.position]||R6I[A.position];if(YB.integer(L)&&(YB.inRange(L,0,8)||YB.inRange(L,16,17)))this.options.position=L;else throw YB.invalidParameterError("position","valid position/gravity/strategy",A.position)}if(this._setBackgroundColourOption("resizeBackground",A.background),YB.defined(A.kernel))if(YB.string(S4A[A.kernel]))this.options.kernel=S4A[A.kernel];else throw YB.invalidParameterError("kernel","valid kernel name",A.kernel);if(YB.defined(A.withoutEnlargement))this._setBooleanOption("withoutEnlargement",A.withoutEnlargement);if(YB.defined(A.withoutReduction))this._setBooleanOption("withoutReduction",A.withoutReduction);if(YB.defined(A.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",A.fastShrinkOnLoad)}if(j4A(this.options)&&YU$(this.options))this.options.rotateBeforePreExtract=!0;return this}function VD9(H){if(YB.integer(H)&&H>0)this.options.extendTop=H,this.options.extendBottom=H,this.options.extendLeft=H,this.options.extendRight=H;else if(YB.object(H)){if(YB.defined(H.top))if(YB.integer(H.top)&&H.top>=0)this.options.extendTop=H.top;else throw YB.invalidParameterError("top","positive integer",H.top);if(YB.defined(H.bottom))if(YB.integer(H.bottom)&&H.bottom>=0)this.options.extendBottom=H.bottom;else throw YB.invalidParameterError("bottom","positive integer",H.bottom);if(YB.defined(H.left))if(YB.integer(H.left)&&H.left>=0)this.options.extendLeft=H.left;else throw YB.invalidParameterError("left","positive integer",H.left);if(YB.defined(H.right))if(YB.integer(H.right)&&H.right>=0)this.options.extendRight=H.right;else throw YB.invalidParameterError("right","positive integer",H.right);if(this._setBackgroundColourOption("extendBackground",H.background),YB.defined(H.extendWith))if(YB.string(j6I[H.extendWith]))this.options.extendWith=j6I[H.extendWith];else throw YB.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",H.extendWith)}else throw YB.invalidParameterError("extend","integer or object",H);return this}function PD9(H){let $=YU$(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${$}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(A){let L=H[A];if(YB.integer(L)&&L>=0)this.options[A+(A==="left"||A==="top"?"Offset":"")+$]=L;else throw YB.invalidParameterError(A,"integer",L)},this),j4A(this.options)&&!YU$(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBeforePreExtract=!0}return this}function _D9(H){if(this.options.trimThreshold=10,YB.defined(H))if(YB.object(H)){if(YB.defined(H.background))this._setBackgroundColourOption("trimBackground",H.background);if(YB.defined(H.threshold))if(YB.number(H.threshold)&&H.threshold>=0)this.options.trimThreshold=H.threshold;else throw YB.invalidParameterError("threshold","positive number",H.threshold);if(YB.defined(H.lineArt))this._setBooleanOption("trimLineArt",H.lineArt)}else throw YB.invalidParameterError("trim","object",H);if(j4A(this.options))this.options.rotateBeforePreExtract=!0;return this}h6I.exports=function(H){Object.assign(H.prototype,{resize:WD9,extend:VD9,extract:PD9,trim:_D9}),H.gravity=R6I,H.strategy=v6I,H.kernel=S4A,H.fit=KD9,H.position=y6I}});var u6I=z((Qpf,k6I)=>{var RM=dy(),R4A={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};function YD9(H){if(!Array.isArray(H))throw RM.invalidParameterError("images to composite","array",H);return this.options.composite=H.map(($)=>{if(!RM.object($))throw RM.invalidParameterError("image to composite","object",$);let A=this._inputOptionsFromObject($),L={input:this._createInputDescriptor($.input,A,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(RM.defined($.blend))if(RM.string(R4A[$.blend]))L.blend=R4A[$.blend];else throw RM.invalidParameterError("blend","valid blend name",$.blend);if(RM.defined($.tile))if(RM.bool($.tile))L.tile=$.tile;else throw RM.invalidParameterError("tile","boolean",$.tile);if(RM.defined($.left))if(RM.integer($.left))L.left=$.left;else throw RM.invalidParameterError("left","integer",$.left);if(RM.defined($.top))if(RM.integer($.top))L.top=$.top;else throw RM.invalidParameterError("top","integer",$.top);if(RM.defined($.top)!==RM.defined($.left))throw Error("Expected both left and top to be set");else L.hasOffset=RM.integer($.top)&&RM.integer($.left);if(RM.defined($.gravity))if(RM.integer($.gravity)&&RM.inRange($.gravity,0,8))L.gravity=$.gravity;else if(RM.string($.gravity)&&RM.integer(this.constructor.gravity[$.gravity]))L.gravity=this.constructor.gravity[$.gravity];else throw RM.invalidParameterError("gravity","valid gravity",$.gravity);if(RM.defined($.premultiplied))if(RM.bool($.premultiplied))L.premultiplied=$.premultiplied;else throw RM.invalidParameterError("premultiplied","boolean",$.premultiplied);return L}),this}k6I.exports=function(H){H.prototype.composite=YD9,H.blend=R4A}});var p6I=z((Wpf,m6I)=>{var CD9=_U$(),FA=dy(),g6I={integer:"integer",float:"float",approximate:"approximate"};function wD9(H,$){if(this.options.useExifOrientation||this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options");if(!FA.defined(H))this.options.useExifOrientation=!0;else if(FA.integer(H)&&!(H%90))this.options.angle=H;else if(FA.number(H)){if(this.options.rotationAngle=H,FA.object($)&&$.background){let A=CD9($.background);this.options.rotationBackground=[A.red(),A.green(),A.blue(),Math.round(A.alpha()*255)]}}else throw FA.invalidParameterError("angle","numeric",H);return this}function ZD9(H){return this.options.flip=FA.bool(H)?H:!0,this}function qD9(H){return this.options.flop=FA.bool(H)?H:!0,this}function TD9(H,$){let A=[].concat(...H);if(A.length===4&&A.every(FA.number))this.options.affineMatrix=A;else throw FA.invalidParameterError("matrix","1x4 or 2x2 array",H);if(FA.defined($))if(FA.object($)){if(this._setBackgroundColourOption("affineBackground",$.background),FA.defined($.idx))if(FA.number($.idx))this.options.affineIdx=$.idx;else throw FA.invalidParameterError("options.idx","number",$.idx);if(FA.defined($.idy))if(FA.number($.idy))this.options.affineIdy=$.idy;else throw FA.invalidParameterError("options.idy","number",$.idy);if(FA.defined($.odx))if(FA.number($.odx))this.options.affineOdx=$.odx;else throw FA.invalidParameterError("options.odx","number",$.odx);if(FA.defined($.ody))if(FA.number($.ody))this.options.affineOdy=$.ody;else throw FA.invalidParameterError("options.ody","number",$.ody);if(FA.defined($.interpolator))if(FA.inArray($.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=$.interpolator;else throw FA.invalidParameterError("options.interpolator","valid interpolator name",$.interpolator)}else throw FA.invalidParameterError("options","object",$);return this}function zD9(H,$,A){if(!FA.defined(H))this.options.sharpenSigma=-1;else if(FA.bool(H))this.options.sharpenSigma=H?-1:0;else if(FA.number(H)&&FA.inRange(H,0.01,1e4)){if(this.options.sharpenSigma=H,FA.defined($))if(FA.number($)&&FA.inRange($,0,1e4))this.options.sharpenM1=$;else throw FA.invalidParameterError("flat","number between 0 and 10000",$);if(FA.defined(A))if(FA.number(A)&&FA.inRange(A,0,1e4))this.options.sharpenM2=A;else throw FA.invalidParameterError("jagged","number between 0 and 10000",A)}else if(FA.plainObject(H)){if(FA.number(H.sigma)&&FA.inRange(H.sigma,0.000001,10))this.options.sharpenSigma=H.sigma;else throw FA.invalidParameterError("options.sigma","number between 0.000001 and 10",H.sigma);if(FA.defined(H.m1))if(FA.number(H.m1)&&FA.inRange(H.m1,0,1e6))this.options.sharpenM1=H.m1;else throw FA.invalidParameterError("options.m1","number between 0 and 1000000",H.m1);if(FA.defined(H.m2))if(FA.number(H.m2)&&FA.inRange(H.m2,0,1e6))this.options.sharpenM2=H.m2;else throw FA.invalidParameterError("options.m2","number between 0 and 1000000",H.m2);if(FA.defined(H.x1))if(FA.number(H.x1)&&FA.inRange(H.x1,0,1e6))this.options.sharpenX1=H.x1;else throw FA.invalidParameterError("options.x1","number between 0 and 1000000",H.x1);if(FA.defined(H.y2))if(FA.number(H.y2)&&FA.inRange(H.y2,0,1e6))this.options.sharpenY2=H.y2;else throw FA.invalidParameterError("options.y2","number between 0 and 1000000",H.y2);if(FA.defined(H.y3))if(FA.number(H.y3)&&FA.inRange(H.y3,0,1e6))this.options.sharpenY3=H.y3;else throw FA.invalidParameterError("options.y3","number between 0 and 1000000",H.y3)}else throw FA.invalidParameterError("sigma","number between 0.01 and 10000",H);return this}function ND9(H){if(!FA.defined(H))this.options.medianSize=3;else if(FA.integer(H)&&FA.inRange(H,1,1000))this.options.medianSize=H;else throw FA.invalidParameterError("size","integer between 1 and 1000",H);return this}function OD9(H){let $;if(FA.number(H))$=H;else if(FA.plainObject(H)){if(!FA.number(H.sigma))throw FA.invalidParameterError("options.sigma","number between 0.3 and 1000",$);if($=H.sigma,"precision"in H)if(FA.string(g6I[H.precision]))this.options.precision=g6I[H.precision];else throw FA.invalidParameterError("precision","one of: integer, float, approximate",H.precision);if("minAmplitude"in H)if(FA.number(H.minAmplitude)&&FA.inRange(H.minAmplitude,0.001,1))this.options.minAmpl=H.minAmplitude;else throw FA.invalidParameterError("minAmplitude","number between 0.001 and 1",H.minAmplitude)}if(!FA.defined(H))this.options.blurSigma=-1;else if(FA.bool(H))this.options.blurSigma=H?-1:0;else if(FA.number($)&&FA.inRange($,0.3,1000))this.options.blurSigma=$;else throw FA.invalidParameterError("sigma","number between 0.3 and 1000",$);return this}function xD9(H){if(this.options.flatten=FA.bool(H)?H:!0,FA.object(H))this._setBackgroundColourOption("flattenBackground",H.background);return this}function SD9(){return this.options.unflatten=!0,this}function jD9(H,$){if(!FA.defined(H))this.options.gamma=2.2;else if(FA.number(H)&&FA.inRange(H,1,3))this.options.gamma=H;else throw FA.invalidParameterError("gamma","number between 1.0 and 3.0",H);if(!FA.defined($))this.options.gammaOut=this.options.gamma;else if(FA.number($)&&FA.inRange($,1,3))this.options.gammaOut=$;else throw FA.invalidParameterError("gammaOut","number between 1.0 and 3.0",$);return this}function RD9(H){if(this.options.negate=FA.bool(H)?H:!0,FA.plainObject(H)&&"alpha"in H)if(!FA.bool(H.alpha))throw FA.invalidParameterError("alpha","should be boolean value",H.alpha);else this.options.negateAlpha=H.alpha;return this}function yD9(H){if(FA.plainObject(H)){if(FA.defined(H.lower))if(FA.number(H.lower)&&FA.inRange(H.lower,0,99))this.options.normaliseLower=H.lower;else throw FA.invalidParameterError("lower","number between 0 and 99",H.lower);if(FA.defined(H.upper))if(FA.number(H.upper)&&FA.inRange(H.upper,1,100))this.options.normaliseUpper=H.upper;else throw FA.invalidParameterError("upper","number between 1 and 100",H.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw FA.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function vD9(H){return this.normalise(H)}function hD9(H){if(FA.plainObject(H)){if(FA.integer(H.width)&&H.width>0)this.options.claheWidth=H.width;else throw FA.invalidParameterError("width","integer greater than zero",H.width);if(FA.integer(H.height)&&H.height>0)this.options.claheHeight=H.height;else throw FA.invalidParameterError("height","integer greater than zero",H.height);if(FA.defined(H.maxSlope))if(FA.integer(H.maxSlope)&&FA.inRange(H.maxSlope,0,100))this.options.claheMaxSlope=H.maxSlope;else throw FA.invalidParameterError("maxSlope","integer between 0 and 100",H.maxSlope)}else throw FA.invalidParameterError("options","plain object",H);return this}function bD9(H){if(!FA.object(H)||!Array.isArray(H.kernel)||!FA.integer(H.width)||!FA.integer(H.height)||!FA.inRange(H.width,3,1001)||!FA.inRange(H.height,3,1001)||H.height*H.width!==H.kernel.length)throw Error("Invalid convolution kernel");if(!FA.integer(H.scale))H.scale=H.kernel.reduce(function($,A){return $+A},0);if(H.scale<1)H.scale=1;if(!FA.integer(H.offset))H.offset=0;return this.options.convKernel=H,this}function kD9(H,$){if(!FA.defined(H))this.options.threshold=128;else if(FA.bool(H))this.options.threshold=H?128:0;else if(FA.integer(H)&&FA.inRange(H,0,255))this.options.threshold=H;else throw FA.invalidParameterError("threshold","integer between 0 and 255",H);if(!FA.object($)||$.greyscale===!0||$.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function uD9(H,$,A){if(this.options.boolean=this._createInputDescriptor(H,A),FA.string($)&&FA.inArray($,["and","or","eor"]))this.options.booleanOp=$;else throw FA.invalidParameterError("operator","one of: and, or, eor",$);return this}function gD9(H,$){if(!FA.defined(H)&&FA.number($))H=1;else if(FA.number(H)&&!FA.defined($))$=0;if(!FA.defined(H))this.options.linearA=[];else if(FA.number(H))this.options.linearA=[H];else if(Array.isArray(H)&&H.length&&H.every(FA.number))this.options.linearA=H;else throw FA.invalidParameterError("a","number or array of numbers",H);if(!FA.defined($))this.options.linearB=[];else if(FA.number($))this.options.linearB=[$];else if(Array.isArray($)&&$.length&&$.every(FA.number))this.options.linearB=$;else throw FA.invalidParameterError("b","number or array of numbers",$);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function mD9(H){if(!Array.isArray(H))throw FA.invalidParameterError("inputMatrix","array",H);if(H.length!==3&&H.length!==4)throw FA.invalidParameterError("inputMatrix","3x3 or 4x4 array",H.length);let $=H.flat().map(Number);if($.length!==9&&$.length!==16)throw FA.invalidParameterError("inputMatrix","cardinality of 9 or 16",$.length);return this.options.recombMatrix=$,this}function pD9(H){if(!FA.plainObject(H))throw FA.invalidParameterError("options","plain object",H);if("brightness"in H)if(FA.number(H.brightness)&&H.brightness>=0)this.options.brightness=H.brightness;else throw FA.invalidParameterError("brightness","number above zero",H.brightness);if("saturation"in H)if(FA.number(H.saturation)&&H.saturation>=0)this.options.saturation=H.saturation;else throw FA.invalidParameterError("saturation","number above zero",H.saturation);if("hue"in H)if(FA.integer(H.hue))this.options.hue=H.hue%360;else throw FA.invalidParameterError("hue","number",H.hue);if("lightness"in H)if(FA.number(H.lightness))this.options.lightness=H.lightness;else throw FA.invalidParameterError("lightness","number",H.lightness);return this}m6I.exports=function(H){Object.assign(H.prototype,{rotate:wD9,flip:ZD9,flop:qD9,affine:TD9,sharpen:zD9,median:ND9,blur:OD9,flatten:xD9,unflatten:SD9,gamma:jD9,negate:RD9,normalise:yD9,normalize:vD9,clahe:hD9,convolve:bD9,threshold:kD9,boolean:uD9,linear:gD9,recomb:mD9,modulate:pD9})}});var l6I=z((Vpf,c6I)=>{var dD9=_U$(),Og=dy(),d6I={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function cD9(H){return this._setBackgroundColourOption("tint",H),this}function lD9(H){return this.options.greyscale=Og.bool(H)?H:!0,this}function iD9(H){return this.greyscale(H)}function nD9(H){if(!Og.string(H))throw Og.invalidParameterError("colourspace","string",H);return this.options.colourspacePipeline=H,this}function rD9(H){return this.pipelineColourspace(H)}function aD9(H){if(!Og.string(H))throw Og.invalidParameterError("colourspace","string",H);return this.options.colourspace=H,this}function oD9(H){return this.toColourspace(H)}function tD9(H,$){if(Og.defined($))if(Og.object($)||Og.string($)){let A=dD9($);this.options[H]=[A.red(),A.green(),A.blue(),Math.round(A.alpha()*255)]}else throw Og.invalidParameterError("background","object or string",$)}c6I.exports=function(H){Object.assign(H.prototype,{tint:cD9,greyscale:lD9,grayscale:iD9,pipelineColourspace:nD9,pipelineColorspace:rD9,toColourspace:aD9,toColorspace:oD9,_setBackgroundColourOption:tD9}),H.colourspace=d6I,H.colorspace=d6I}});var n6I=z((Ppf,i6I)=>{var ny=dy(),sD9={and:"and",or:"or",eor:"eor"};function eD9(){return this.options.removeAlpha=!0,this}function HB9(H){if(ny.defined(H))if(ny.number(H)&&ny.inRange(H,0,1))this.options.ensureAlpha=H;else throw ny.invalidParameterError("alpha","number between 0 and 1",H);else this.options.ensureAlpha=1;return this}function $B9(H){let $={red:0,green:1,blue:2,alpha:3};if(Object.keys($).includes(H))H=$[H];if(ny.integer(H)&&ny.inRange(H,0,4))this.options.extractChannel=H;else throw ny.invalidParameterError("channel","integer or one of: red, green, blue, alpha",H);return this}function AB9(H,$){if(Array.isArray(H))H.forEach(function(A){this.options.joinChannelIn.push(this._createInputDescriptor(A,$))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(H,$));return this}function LB9(H){if(ny.string(H)&&ny.inArray(H,["and","or","eor"]))this.options.bandBoolOp=H;else throw ny.invalidParameterError("boolOp","one of: and, or, eor",H);return this}i6I.exports=function(H){Object.assign(H.prototype,{removeAlpha:eD9,ensureAlpha:HB9,extractChannel:$B9,joinChannel:AB9,bandbool:LB9}),H.bool=sD9}});var e6I=z((_pf,s6I)=>{var y4A=require("path"),sH=dy(),gJH=FSH(),r6I=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),IB9=/\.(jp[2x]|j2[kc])$/i,a6I=()=>Error("JP2 output requires libvips with support for OpenJPEG"),o6I=(H)=>1<<31-Math.clz32(Math.ceil(Math.log2(H)));function DB9(H,$){let A;if(!sH.string(H))A=Error("Missing output file path");else if(sH.string(this.options.input.file)&&y4A.resolve(this.options.input.file)===y4A.resolve(H))A=Error("Cannot use same file for input and output");else if(IB9.test(y4A.extname(H))&&!this.constructor.format.jp2k.output.file)A=a6I();if(A)if(sH.fn($))$(A);else return Promise.reject(A);else{this.options.fileOut=H;let L=Error();return this._pipeline($,L)}return this}function BB9(H,$){if(sH.object(H))this._setBooleanOption("resolveWithObject",H.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let A=Error();return this._pipeline(sH.fn(H)?H:$,A)}function fB9(){return this.options.keepMetadata|=1,this}function EB9(H){if(sH.object(H))for(let[$,A]of Object.entries(H))if(sH.object(A))for(let[L,I]of Object.entries(A))if(sH.string(I))this.options.withExif[`exif-${$.toLowerCase()}-${L}`]=I;else throw sH.invalidParameterError(`${$}.${L}`,"string",I);else throw sH.invalidParameterError($,"object",A);else throw sH.invalidParameterError("exif","object",H);return this.options.withExifMerge=!1,this.keepExif()}function MB9(H){return this.withExif(H),this.options.withExifMerge=!0,this}function GB9(){return this.options.keepMetadata|=8,this}function UB9(H,$){if(sH.string(H))this.options.withIccProfile=H;else throw sH.invalidParameterError("icc","string",H);if(this.keepIccProfile(),sH.object($)){if(sH.defined($.attach))if(sH.bool($.attach)){if(!$.attach)this.options.keepMetadata&=-9}else throw sH.invalidParameterError("attach","boolean",$.attach)}return this}function XB9(){return this.options.keepMetadata=31,this}function JB9(H){if(this.keepMetadata(),this.withIccProfile("srgb"),sH.object(H)){if(sH.defined(H.orientation))if(sH.integer(H.orientation)&&sH.inRange(H.orientation,1,8))this.options.withMetadataOrientation=H.orientation;else throw sH.invalidParameterError("orientation","integer between 1 and 8",H.orientation);if(sH.defined(H.density))if(sH.number(H.density)&&H.density>0)this.options.withMetadataDensity=H.density;else throw sH.invalidParameterError("density","positive number",H.density);if(sH.defined(H.icc))this.withIccProfile(H.icc);if(sH.defined(H.exif))this.withExifMerge(H.exif)}return this}function FB9(H,$){let A=r6I.get((sH.object(H)&&sH.string(H.id)?H.id:H).toLowerCase());if(!A)throw sH.invalidParameterError("format",`one of: ${[...r6I.keys()].join(", ")}`,H);return this[A]($)}function KB9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.jpegQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.progressive))this._setBooleanOption("jpegProgressive",H.progressive);if(sH.defined(H.chromaSubsampling))if(sH.string(H.chromaSubsampling)&&sH.inArray(H.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=H.chromaSubsampling;else throw sH.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",H.chromaSubsampling);let $=sH.bool(H.optimizeCoding)?H.optimizeCoding:H.optimiseCoding;if(sH.defined($))this._setBooleanOption("jpegOptimiseCoding",$);if(sH.defined(H.mozjpeg))if(sH.bool(H.mozjpeg)){if(H.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw sH.invalidParameterError("mozjpeg","boolean",H.mozjpeg);let A=sH.bool(H.trellisQuantization)?H.trellisQuantization:H.trellisQuantisation;if(sH.defined(A))this._setBooleanOption("jpegTrellisQuantisation",A);if(sH.defined(H.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",H.overshootDeringing);let L=sH.bool(H.optimizeScans)?H.optimizeScans:H.optimiseScans;if(sH.defined(L)){if(this._setBooleanOption("jpegOptimiseScans",L),L)this.options.jpegProgressive=!0}let I=sH.number(H.quantizationTable)?H.quantizationTable:H.quantisationTable;if(sH.defined(I))if(sH.integer(I)&&sH.inRange(I,0,8))this.options.jpegQuantisationTable=I;else throw sH.invalidParameterError("quantisationTable","integer between 0 and 8",I)}return this._updateFormatOut("jpeg",H)}function QB9(H){if(sH.object(H)){if(sH.defined(H.progressive))this._setBooleanOption("pngProgressive",H.progressive);if(sH.defined(H.compressionLevel))if(sH.integer(H.compressionLevel)&&sH.inRange(H.compressionLevel,0,9))this.options.pngCompressionLevel=H.compressionLevel;else throw sH.invalidParameterError("compressionLevel","integer between 0 and 9",H.compressionLevel);if(sH.defined(H.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",H.adaptiveFiltering);let $=H.colours||H.colors;if(sH.defined($))if(sH.integer($)&&sH.inRange($,2,256))this.options.pngBitdepth=o6I($);else throw sH.invalidParameterError("colours","integer between 2 and 256",$);if(sH.defined(H.palette))this._setBooleanOption("pngPalette",H.palette);else if([H.quality,H.effort,H.colours,H.colors,H.dither].some(sH.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,0,100))this.options.pngQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 0 and 100",H.quality);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,1,10))this.options.pngEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 1 and 10",H.effort);if(sH.defined(H.dither))if(sH.number(H.dither)&&sH.inRange(H.dither,0,1))this.options.pngDither=H.dither;else throw sH.invalidParameterError("dither","number between 0.0 and 1.0",H.dither)}}return this._updateFormatOut("png",H)}function WB9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.webpQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.alphaQuality))if(sH.integer(H.alphaQuality)&&sH.inRange(H.alphaQuality,0,100))this.options.webpAlphaQuality=H.alphaQuality;else throw sH.invalidParameterError("alphaQuality","integer between 0 and 100",H.alphaQuality);if(sH.defined(H.lossless))this._setBooleanOption("webpLossless",H.lossless);if(sH.defined(H.nearLossless))this._setBooleanOption("webpNearLossless",H.nearLossless);if(sH.defined(H.smartSubsample))this._setBooleanOption("webpSmartSubsample",H.smartSubsample);if(sH.defined(H.preset))if(sH.string(H.preset)&&sH.inArray(H.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=H.preset;else throw sH.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",H.preset);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,0,6))this.options.webpEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 0 and 6",H.effort);if(sH.defined(H.minSize))this._setBooleanOption("webpMinSize",H.minSize);if(sH.defined(H.mixed))this._setBooleanOption("webpMixed",H.mixed)}return t6I(H,this.options),this._updateFormatOut("webp",H)}function VB9(H){if(sH.object(H)){if(sH.defined(H.reuse))this._setBooleanOption("gifReuse",H.reuse);if(sH.defined(H.progressive))this._setBooleanOption("gifProgressive",H.progressive);let $=H.colours||H.colors;if(sH.defined($))if(sH.integer($)&&sH.inRange($,2,256))this.options.gifBitdepth=o6I($);else throw sH.invalidParameterError("colours","integer between 2 and 256",$);if(sH.defined(H.effort))if(sH.number(H.effort)&&sH.inRange(H.effort,1,10))this.options.gifEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 1 and 10",H.effort);if(sH.defined(H.dither))if(sH.number(H.dither)&&sH.inRange(H.dither,0,1))this.options.gifDither=H.dither;else throw sH.invalidParameterError("dither","number between 0.0 and 1.0",H.dither);if(sH.defined(H.interFrameMaxError))if(sH.number(H.interFrameMaxError)&&sH.inRange(H.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=H.interFrameMaxError;else throw sH.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",H.interFrameMaxError);if(sH.defined(H.interPaletteMaxError))if(sH.number(H.interPaletteMaxError)&&sH.inRange(H.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=H.interPaletteMaxError;else throw sH.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",H.interPaletteMaxError)}return t6I(H,this.options),this._updateFormatOut("gif",H)}function PB9(H){if(!this.constructor.format.jp2k.output.buffer)throw a6I();if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.jp2Quality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.lossless))if(sH.bool(H.lossless))this.options.jp2Lossless=H.lossless;else throw sH.invalidParameterError("lossless","boolean",H.lossless);if(sH.defined(H.tileWidth))if(sH.integer(H.tileWidth)&&sH.inRange(H.tileWidth,1,32768))this.options.jp2TileWidth=H.tileWidth;else throw sH.invalidParameterError("tileWidth","integer between 1 and 32768",H.tileWidth);if(sH.defined(H.tileHeight))if(sH.integer(H.tileHeight)&&sH.inRange(H.tileHeight,1,32768))this.options.jp2TileHeight=H.tileHeight;else throw sH.invalidParameterError("tileHeight","integer between 1 and 32768",H.tileHeight);if(sH.defined(H.chromaSubsampling))if(sH.string(H.chromaSubsampling)&&sH.inArray(H.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=H.chromaSubsampling;else throw sH.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",H.chromaSubsampling)}return this._updateFormatOut("jp2",H)}function t6I(H,$){if(sH.object(H)&&sH.defined(H.loop))if(sH.integer(H.loop)&&sH.inRange(H.loop,0,65535))$.loop=H.loop;else throw sH.invalidParameterError("loop","integer between 0 and 65535",H.loop);if(sH.object(H)&&sH.defined(H.delay))if(sH.integer(H.delay)&&sH.inRange(H.delay,0,65535))$.delay=[H.delay];else if(Array.isArray(H.delay)&&H.delay.every(sH.integer)&&H.delay.every((A)=>sH.inRange(A,0,65535)))$.delay=H.delay;else throw sH.invalidParameterError("delay","integer or an array of integers between 0 and 65535",H.delay)}function _B9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.tiffQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.bitdepth))if(sH.integer(H.bitdepth)&&sH.inArray(H.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=H.bitdepth;else throw sH.invalidParameterError("bitdepth","1, 2, 4 or 8",H.bitdepth);if(sH.defined(H.tile))this._setBooleanOption("tiffTile",H.tile);if(sH.defined(H.tileWidth))if(sH.integer(H.tileWidth)&&H.tileWidth>0)this.options.tiffTileWidth=H.tileWidth;else throw sH.invalidParameterError("tileWidth","integer greater than zero",H.tileWidth);if(sH.defined(H.tileHeight))if(sH.integer(H.tileHeight)&&H.tileHeight>0)this.options.tiffTileHeight=H.tileHeight;else throw sH.invalidParameterError("tileHeight","integer greater than zero",H.tileHeight);if(sH.defined(H.miniswhite))this._setBooleanOption("tiffMiniswhite",H.miniswhite);if(sH.defined(H.pyramid))this._setBooleanOption("tiffPyramid",H.pyramid);if(sH.defined(H.xres))if(sH.number(H.xres)&&H.xres>0)this.options.tiffXres=H.xres;else throw sH.invalidParameterError("xres","number greater than zero",H.xres);if(sH.defined(H.yres))if(sH.number(H.yres)&&H.yres>0)this.options.tiffYres=H.yres;else throw sH.invalidParameterError("yres","number greater than zero",H.yres);if(sH.defined(H.compression))if(sH.string(H.compression)&&sH.inArray(H.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=H.compression;else throw sH.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",H.compression);if(sH.defined(H.predictor))if(sH.string(H.predictor)&&sH.inArray(H.predictor,["none","horizontal","float"]))this.options.tiffPredictor=H.predictor;else throw sH.invalidParameterError("predictor","one of: none, horizontal, float",H.predictor);if(sH.defined(H.resolutionUnit))if(sH.string(H.resolutionUnit)&&sH.inArray(H.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=H.resolutionUnit;else throw sH.invalidParameterError("resolutionUnit","one of: inch, cm",H.resolutionUnit)}return this._updateFormatOut("tiff",H)}function YB9(H){return this.heif({...H,compression:"av1"})}function CB9(H){if(sH.object(H)){if(sH.string(H.compression)&&sH.inArray(H.compression,["av1","hevc"]))this.options.heifCompression=H.compression;else throw sH.invalidParameterError("compression","one of: av1, hevc",H.compression);if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.heifQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.lossless))if(sH.bool(H.lossless))this.options.heifLossless=H.lossless;else throw sH.invalidParameterError("lossless","boolean",H.lossless);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,0,9))this.options.heifEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 0 and 9",H.effort);if(sH.defined(H.chromaSubsampling))if(sH.string(H.chromaSubsampling)&&sH.inArray(H.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=H.chromaSubsampling;else throw sH.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",H.chromaSubsampling);if(sH.defined(H.bitdepth))if(sH.integer(H.bitdepth)&&sH.inArray(H.bitdepth,[8,10,12])){if(H.bitdepth!==8&&this.constructor.versions.heif)throw sH.invalidParameterError("bitdepth when using prebuilt binaries",8,H.bitdepth);this.options.heifBitdepth=H.bitdepth}else throw sH.invalidParameterError("bitdepth","8, 10 or 12",H.bitdepth)}else throw sH.invalidParameterError("options","Object",H);return this._updateFormatOut("heif",H)}function wB9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.jxlDistance=H.quality>=30?0.1+(100-H.quality)*0.09:0.017666666666666667*H.quality*H.quality-1.15*H.quality+25;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);else if(sH.defined(H.distance))if(sH.number(H.distance)&&sH.inRange(H.distance,0,15))this.options.jxlDistance=H.distance;else throw sH.invalidParameterError("distance","number between 0.0 and 15.0",H.distance);if(sH.defined(H.decodingTier))if(sH.integer(H.decodingTier)&&sH.inRange(H.decodingTier,0,4))this.options.jxlDecodingTier=H.decodingTier;else throw sH.invalidParameterError("decodingTier","integer between 0 and 4",H.decodingTier);if(sH.defined(H.lossless))if(sH.bool(H.lossless))this.options.jxlLossless=H.lossless;else throw sH.invalidParameterError("lossless","boolean",H.lossless);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,3,9))this.options.jxlEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 3 and 9",H.effort)}return this._updateFormatOut("jxl",H)}function ZB9(H){if(sH.object(H)){if(sH.defined(H.depth))if(sH.string(H.depth)&&sH.inArray(H.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=H.depth;else throw sH.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",H.depth)}return this._updateFormatOut("raw")}function qB9(H){if(sH.object(H)){if(sH.defined(H.size))if(sH.integer(H.size)&&sH.inRange(H.size,1,8192))this.options.tileSize=H.size;else throw sH.invalidParameterError("size","integer between 1 and 8192",H.size);if(sH.defined(H.overlap))if(sH.integer(H.overlap)&&sH.inRange(H.overlap,0,8192)){if(H.overlap>this.options.tileSize)throw sH.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,H.overlap);this.options.tileOverlap=H.overlap}else throw sH.invalidParameterError("overlap","integer between 0 and 8192",H.overlap);if(sH.defined(H.container))if(sH.string(H.container)&&sH.inArray(H.container,["fs","zip"]))this.options.tileContainer=H.container;else throw sH.invalidParameterError("container","one of: fs, zip",H.container);if(sH.defined(H.layout))if(sH.string(H.layout)&&sH.inArray(H.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=H.layout;else throw sH.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",H.layout);if(sH.defined(H.angle))if(sH.integer(H.angle)&&!(H.angle%90))this.options.tileAngle=H.angle;else throw sH.invalidParameterError("angle","positive/negative multiple of 90",H.angle);if(this._setBackgroundColourOption("tileBackground",H.background),sH.defined(H.depth))if(sH.string(H.depth)&&sH.inArray(H.depth,["onepixel","onetile","one"]))this.options.tileDepth=H.depth;else throw sH.invalidParameterError("depth","one of: onepixel, onetile, one",H.depth);if(sH.defined(H.skipBlanks))if(sH.integer(H.skipBlanks)&&sH.inRange(H.skipBlanks,-1,65535))this.options.tileSkipBlanks=H.skipBlanks;else throw sH.invalidParameterError("skipBlanks","integer between -1 and 255/65535",H.skipBlanks);else if(sH.defined(H.layout)&&H.layout==="google")this.options.tileSkipBlanks=5;let $=sH.bool(H.center)?H.center:H.centre;if(sH.defined($))this._setBooleanOption("tileCentre",$);if(sH.defined(H.id))if(sH.string(H.id))this.options.tileId=H.id;else throw sH.invalidParameterError("id","string",H.id);if(sH.defined(H.basename))if(sH.string(H.basename))this.options.tileBasename=H.basename;else throw sH.invalidParameterError("basename","string",H.basename)}if(sH.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw sH.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function TB9(H){if(!sH.plainObject(H))throw sH.invalidParameterError("options","object",H);if(sH.integer(H.seconds)&&sH.inRange(H.seconds,0,3600))this.options.timeoutSeconds=H.seconds;else throw sH.invalidParameterError("seconds","integer between 0 and 3600",H.seconds);return this}function zB9(H,$){if(!(sH.object($)&&$.force===!1))this.options.formatOut=H;return this}function NB9(H,$){if(sH.bool($))this.options[H]=$;else throw sH.invalidParameterError(H,"boolean",$)}function OB9(){if(!this.options.streamOut){this.options.streamOut=!0;let H=Error();this._pipeline(void 0,H)}}function xB9(H,$){if(typeof H==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),gJH.pipeline(this.options,(A,L,I)=>{if(A)H(sH.nativeError(A,$));else H(null,L,I)})});else gJH.pipeline(this.options,(A,L,I)=>{if(A)H(sH.nativeError(A,$));else H(null,L,I)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),gJH.pipeline(this.options,(A,L,I)=>{if(A)this.emit("error",sH.nativeError(A,$));else this.emit("info",I),this.push(L);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else gJH.pipeline(this.options,(A,L,I)=>{if(A)this.emit("error",sH.nativeError(A,$));else this.emit("info",I),this.push(L);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((A,L)=>{this.once("finish",()=>{this._flattenBufferIn(),gJH.pipeline(this.options,(I,D,B)=>{if(I)L(sH.nativeError(I,$));else if(this.options.resolveWithObject)A({data:D,info:B});else A(D)})})});else return new Promise((A,L)=>{gJH.pipeline(this.options,(I,D,B)=>{if(I)L(sH.nativeError(I,$));else if(this.options.resolveWithObject)A({data:D,info:B});else A(D)})})}s6I.exports=function(H){Object.assign(H.prototype,{toFile:DB9,toBuffer:BB9,keepExif:fB9,withExif:EB9,withExifMerge:MB9,keepIccProfile:GB9,withIccProfile:UB9,keepMetadata:XB9,withMetadata:JB9,toFormat:FB9,jpeg:KB9,jp2:PB9,png:QB9,webp:WB9,tiff:_B9,avif:YB9,heif:CB9,jxl:wB9,gif:VB9,raw:ZB9,tile:qB9,timeout:TB9,_updateFormatOut:zB9,_setBooleanOption:NB9,_read:OB9,_pipeline:xB9})}});var L3I=z((Ypf,A3I)=>{var SB9=require("events"),CU$=fU$(),AT=dy(),{runtimePlatformArch:jB9}=C4A(),$P=FSH(),H3I=jB9(),v4A=$P.libvipsVersion(),xr=$P.format();xr.heif.output.alias=["avif","heic"];xr.jpeg.output.alias=["jpe","jpg"];xr.tiff.output.alias=["tif"];xr.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var RB9={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},mJH={vips:v4A.semver};if(!v4A.isGlobal)if(!v4A.isWasm)try{mJH=require(`@img/sharp-${H3I}/versions`)}catch(H){try{mJH=require(`@img/sharp-libvips-${H3I}/versions`)}catch($){}}else try{mJH=(()=>{throw new Error("Cannot require module "+"@img/sharp-wasm32/versions");})()}catch(H){}mJH.sharp=V4A().version;if(mJH.heif&&xr.heif)xr.heif.input.fileSuffix=[".avif"],xr.heif.output.alias=["avif"];function $3I(H){if(AT.bool(H))if(H)return $P.cache(50,20,100);else return $P.cache(0,0,0);else if(AT.object(H))return $P.cache(H.memory,H.files,H.items);else return $P.cache()}$3I(!0);function yB9(H){return $P.concurrency(AT.integer(H)?H:null)}if(CU$.familySync()===CU$.GLIBC&&!$P._isUsingJemalloc())$P.concurrency(1);else if(CU$.familySync()===CU$.MUSL&&$P.concurrency()===1024)$P.concurrency(require("os").availableParallelism());var vB9=new SB9.EventEmitter;function hB9(){return $P.counters()}function bB9(H){return $P.simd(AT.bool(H)?H:null)}function kB9(H){if(AT.object(H))if(Array.isArray(H.operation)&&H.operation.every(AT.string))$P.block(H.operation,!0);else throw AT.invalidParameterError("operation","Array",H.operation);else throw AT.invalidParameterError("options","object",H)}function uB9(H){if(AT.object(H))if(Array.isArray(H.operation)&&H.operation.every(AT.string))$P.block(H.operation,!1);else throw AT.invalidParameterError("operation","Array",H.operation);else throw AT.invalidParameterError("options","object",H)}A3I.exports=function(H){H.cache=$3I,H.concurrency=yB9,H.counters=hB9,H.simd=bB9,H.format=xr,H.interpolators=RB9,H.versions=mJH,H.queue=vB9,H.block=kB9,H.unblock=uB9}});var h4A=z((Cpf,I3I)=>{var xg=U6I();S6I()(xg);b6I()(xg);u6I()(xg);p6I()(xg);l6I()(xg);n6I()(xg);e6I()(xg);L3I()(xg);I3I.exports=xg});async function b4A(){if(wU$)return wU$.default;if(U8())try{let A=await Promise.resolve().then(() => (RWI(),jWI)),L=A.sharp||A.default;return wU$={default:L},L}catch{console.warn("Native image processor not available, falling back to sharp")}let H=await Promise.resolve().then(() => b(h4A(),1)),$=H?.default||H;return wU$={default:$},$}var wU$=null;var D3I=()=>{};function pB9(H){if(H instanceof Error){let A=H;if(A.code==="MODULE_NOT_FOUND"||A.code==="ERR_MODULE_NOT_FOUND"||A.code==="ERR_DLOPEN_FAILED")return B3I}let $=H instanceof Error?H.message:String(H);if($.includes("Native image processor module not available"))return B3I;if($.includes("unsupported image format")||$.includes("Input buffer")||$.includes("Input file is missing")||$.includes("Input file has corrupt header"))return gB9;return mB9}function Sg(H){if(H<1024)return`${H} B`;if(H<1048576)return`${(H/1024).toFixed(1)} KB`;return`${(H/1048576).toFixed(1)} MB`}async function pJH(H,$,A){try{let L=await b4A(),D=await L(H).metadata(),B=D.format??A,f=B==="jpg"?"jpeg":B;if(!D.width||!D.height){if($>Hx)return{buffer:await L(H).jpeg({quality:80}).toBuffer(),mediaType:"jpeg"};return{buffer:H,mediaType:f}}let{width:E,height:M}=D,G=E,U=M;if($<=Hx&&G<=OJH&&U<=xJH)return{buffer:H,mediaType:f,dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}};let X=G>OJH||U>xJH,J=f==="png";if(!X&&$>Hx){if(J){let Q=await L(H).png({compressionLevel:9,palette:!0}).toBuffer();if(Q.length<=Hx)return{buffer:Q,mediaType:"png",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}for(let Q of[80,60,40,20]){let W=await L(H).jpeg({quality:Q}).toBuffer();if(W.length<=Hx)return{buffer:W,mediaType:"jpeg",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}}if(G>OJH)U=Math.round(U*OJH/G),G=OJH;if(U>xJH)G=Math.round(G*xJH/U),U=xJH;N(`Resizing to ${G}x${U}`);let F=await L(H).resize(G,U,{fit:"inside",withoutEnlargement:!0}).toBuffer();if(F.length>Hx){if(J){let C=await L(H).resize(G,U,{fit:"inside",withoutEnlargement:!0}).png({compressionLevel:9,palette:!0}).toBuffer();if(C.length<=Hx)return{buffer:C,mediaType:"png",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}for(let C of[80,60,40,20]){let Y=await L(H).resize(G,U,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:C}).toBuffer();if(Y.length<=Hx)return{buffer:Y,mediaType:"jpeg",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}let Q=Math.min(G,1000),W=Math.round(U*Q/Math.max(G,1));N("Still too large, compressing with JPEG");let P=await L(H).resize(Q,W,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:20}).toBuffer();return N(`JPEG compressed buffer size: ${P.length}`),{buffer:P,mediaType:"jpeg",dimensions:{originalWidth:E,originalHeight:M,displayWidth:Q,displayHeight:W}}}return{buffer:F,mediaType:f,dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}catch(L){r(L);let I=pB9(L);c("tengu_image_resize_failed",{original_size_bytes:$,error_type:I});let B=dJH(H).slice(6),f=Math.ceil($*4/3);if(f<=NJH)return c("tengu_image_resize_fallback",{original_size_bytes:$,base64_size_bytes:f,error_type:I}),{buffer:H,mediaType:B};throw new eIH(`Unable to resize image (${Sg($)} raw, ${Sg(f)} base64). The image exceeds the 5MB API limit and compression failed. Please resize the image manually or use a smaller image.`)}}async function HDH(H){if(H.source.type!=="base64")return{block:H};let $=Buffer.from(H.source.data,"base64"),A=$.length,I=H.source.media_type?.split("/")[1]||"png",D=await pJH($,A,I);return{block:{type:"image",source:{type:"base64",media_type:`image/${D.mediaType}`,data:D.buffer.toString("base64")}},dimensions:D.dimensions}}async function $DH(H,$=Hx,A){let L=A?.split("/")[1]||"jpeg",I=L==="jpg"?"jpeg":L;try{let D=await b4A(),B=await D(H).metadata(),f=B.format||I,E=H.length,M={imageBuffer:H,metadata:B,format:f,maxBytes:$,originalSize:E};if(E<=$)return PSH(H,f,E);let G=await dB9(M,D);if(G)return G;if(f==="png"){let X=await lB9(M,D);if(X)return X}let U=await iB9(M,50,D);if(U)return U;return await nB9(M,D)}catch(D){if(r(D),c("tengu_image_compress_failed",{original_size_bytes:H.length,max_bytes:$}),H.length<=$){let B=dJH(H);return{base64:H.toString("base64"),mediaType:B,originalSize:H.length}}throw new eIH(`Unable to compress image (${Sg(H.length)}) to fit within ${Sg($)}. Please use a smaller image.`)}}async function f3I(H,$,A){let L=Math.floor($/0.125),I=Math.floor(L*0.75);return $DH(H,I,A)}async function E3I(H,$=Hx){if(H.source.type!=="base64")return H;let A=Buffer.from(H.source.data,"base64");if(A.length<=$)return H;let L=await $DH(A,$);return{type:"image",source:{type:"base64",media_type:L.mediaType,data:L.base64}}}function PSH(H,$,A){let L=$==="jpg"?"jpeg":$;return{base64:H.toString("base64"),mediaType:`image/${L}`,originalSize:A}}async function dB9(H,$){let A=[1,0.75,0.5,0.25];for(let L of A){let I=Math.round((H.metadata.width||2000)*L),D=Math.round((H.metadata.height||2000)*L),B=$(H.imageBuffer).resize(I,D,{fit:"inside",withoutEnlargement:!0});B=cB9(B,H.format);let f=await B.toBuffer();if(f.length<=H.maxBytes)return PSH(f,H.format,H.originalSize)}return null}function cB9(H,$){switch($){case"png":return H.png({compressionLevel:9,palette:!0});case"jpeg":case"jpg":return H.jpeg({quality:80});case"webp":return H.webp({quality:80});default:return H}}async function lB9(H,$){let A=await $(H.imageBuffer).resize(800,800,{fit:"inside",withoutEnlargement:!0}).png({compressionLevel:9,palette:!0,colors:64}).toBuffer();if(A.length<=H.maxBytes)return PSH(A,"png",H.originalSize);return null}async function iB9(H,$,A){let L=await A(H.imageBuffer).resize(600,600,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:$}).toBuffer();if(L.length<=H.maxBytes)return PSH(L,"jpeg",H.originalSize);return null}async function nB9(H,$){let A=await $(H.imageBuffer).resize(400,400,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:20}).toBuffer();return PSH(A,"jpeg",H.originalSize)}function dJH(H){if(H.length<4)return"image/png";if(H[0]===137&&H[1]===80&&H[2]===78&&H[3]===71)return"image/png";if(H[0]===255&&H[1]===216&&H[2]===255)return"image/jpeg";if(H[0]===71&&H[1]===73&&H[2]===70)return"image/gif";if(H[0]===82&&H[1]===73&&H[2]===70&&H[3]===70){if(H.length>=12&&H[8]===87&&H[9]===69&&H[10]===66&&H[11]===80)return"image/webp"}return"image/png"}function k4A(H){try{let $=Buffer.from(H,"base64");return dJH($)}catch{return"image/png"}}function cJH(H,$){let{originalWidth:A,originalHeight:L,displayWidth:I,displayHeight:D}=H;if(!A||!L||!I||!D||I<=0||D<=0){if($)return`[Image source: ${$}]`;return null}let B=A!==I||L!==D;if(!B&&!$)return null;let f=[];if($)f.push(`source: ${$}`);if(B){let E=A/I;f.push(`original ${A}x${L}, displayed at ${I}x${D}. Multiply coordinates by ${E.toFixed(2)} to map to original image.`)}return`[Image: ${f.join(", ")}]`}var B3I=1,gB9=2,mB9=3,eIH;var LT=K(()=>{_$();E$();z$();D3I();aIH();eIH=class eIH extends Error{constructor(H){super(H);this.name="ImageResizeError"}}});function rB9(H){if(typeof H!=="object"||H===null)return!1;let $=H;if($.type!=="image")return!1;if(typeof $.source!=="object"||$.source===null)return!1;let A=$.source;return A.type==="base64"&&typeof A.data==="string"}function M3I(H){let $=[],A=0;for(let L of H){if(typeof L!=="object"||L===null)continue;let I=L;if(I.type!=="user")continue;let D=I.message;if(!D)continue;let B=D.content;if(typeof B==="string"||!Array.isArray(B))continue;for(let f of B)if(rB9(f)){A++;let E=f.source.data.length;if(E>NJH)c("tengu_image_api_validation_failed",{base64_size_bytes:E,max_bytes:NJH}),$.push({index:A,size:E})}}if($.length>0)throw new lJH($,NJH)}var lJH;var ZU$=K(()=>{z$();aIH();LT();lJH=class lJH extends Error{constructor(H,$){let A,L=H[0];if(H.length===1&&L)A=`Image base64 size (${Sg(L.size)}) exceeds API limit (${Sg($)}). Please resize the image before sending.`;else A=`${H.length} images exceed the API limit (${Sg($)}): `+H.map((I)=>`Image ${I.index}: ${Sg(I.size)}`).join(", ")+". Please resize these images before sending.";super(A);this.name="ImageSizeError"}}});function g4A(){let H=`max ${OWI} pages, ${GM(SJH)}`;return tI()?`PDF too large (${H}). Try reading the file a different way (e.g., extract text with pdftotext).`:`PDF too large (${H}). Double press esc to go back and try again, or use pdftotext to convert to text first.`}function m4A(){return tI()?"PDF is password protected. Try using a CLI tool to extract or convert the PDF.":"PDF is password protected. Please double press esc to edit your message and try again."}function qU$(){return tI()?"Image was too large. Try resizing the image or using a different approach.":"Image was too large. Double press esc to go back and try again with a smaller image."}function p4A(){let H=`max ${GM(SJH)}`;return tI()?`Request too large (${H}). Try with a smaller file.`:`Request too large (${H}). Double press esc to go back and try with a smaller file.`}function oB9(){return tI()?"Your account does not have access to Claude. Please login again or contact your administrator.":OU$}function tB9(){return tI()?"Your organization does not have access to Claude. Please login again or contact your administrator.":aB9}function sB9(H,$,A){try{let L=-1;for(let f=0;f=500)return"server_error";if($>=400)return"client_error"}if(H instanceof k6){if(MSH(H)?.isSSLError)return"ssl_cert_error";return"connection_error"}return"unknown"}function U3I(H,$){if(H!=="refusal")return;c("tengu_refusal_api_response",{});let A=tI()?`${x5}: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Try rephrasing the request or attempting a different approach.`:`${x5}: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.`;return qf({content:A+($!=="claude-sonnet-4-20250514"?" If you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models.":""),error:"invalid_request"})}var x5="API Error",jg="Prompt is too long",TU$="Credit balance is too low",zU$="Not logged in \xB7 Please run /login",NU$="Invalid API key \xB7 Fix external API key",OU$="OAuth token revoked \xB7 Please run /login",u4A="Repeated 529 Overloaded errors",ADH="Opus is experiencing high load, please use /model to switch to Sonnet",xU$="Request timed out",aB9="Your account does not have access to Claude Code. Please run /login.";var ry=K(()=>{n_();EI();_L();aI();z$();py();ESH();NA();g$();aIH();rD();Ng();ZU$();LT()});async function*RU$(H,$,A){let L=D09(A),I={model:A.model,maxThinkingTokens:A.maxThinkingTokens,...cD()?{fastMode:A.fastMode}:{}},D=null,B=0,f;for(let E=1;E<=L+1;E++){if(A.signal?.aborted)throw new rf;let M=cD()?I.fastMode&&!zq():!1;try{if(D===null||f instanceof JD&&f.status===401||K3I(f)){if(f instanceof JD&&f.status===401){let G=dD()?.accessToken;if(G)await A4H(G)}D=await H()}return await $(D,E,I)}catch(G){if(f=G,N(`API error (attempt ${E}/${L+1}): ${G instanceof JD?`${G.status} ${G.message}`:G instanceof Error?G.message:String(G)}`,{level:"error"}),M&&G instanceof JD&&(G.status===429||X3I(G))){let F=G.headers?.get("anthropic-ratelimit-unified-overage-disabled-reason");if(F!==null&&F!==void 0){XoL(F),I.fastMode=!1;continue}let Q=M09(G);if(Q!==null&&Q=H09){if(A.fallbackModel)throw c("tengu_api_opus_fallback_triggered",{original_model:A.model,fallback_model:A.fallbackModel,provider:SR()}),new jU$(A.model,A.fallbackModel);if(!process.env.IS_SANDBOX)throw c("tengu_api_custom_529_overloaded_error",{}),new ay(Error(u4A),I)}}if(E>L)throw new ay(G,I);if(!L09(G)&&(!(G instanceof JD)||!I09(G)))throw new ay(G,I);if(G instanceof JD){let F=F3I(G);if(F){let{inputTokens:Q,contextLimit:W}=F,P=1000,C=Math.max(0,W-Q-1000);if(C (\d+)/,A=H.message.match($);if(!A||A.length!==4)return;if(!A[1]||!A[2]||!A[3]){r(Error("Unable to parse max_tokens from max_tokens exceed context limit error message"));return}let L=parseInt(A[1],10),I=parseInt(A[2],10),D=parseInt(A[3],10);if(isNaN(L)||isNaN(I)||isNaN(D))return;return{inputTokens:L,maxTokens:I,contextLimit:D}}function A09(H){if(!(H instanceof JD))return!1;return H.status===400&&(H.message?.includes("Fast mode is not enabled")??!1)}function X3I(H){if(!(H instanceof JD))return!1;return H.status===529||(H.message?.includes('"type":"overloaded_error"')??!1)}function K3I(H){if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)){if(FzL(H)||H instanceof JD&&H.status===403)return!0}return!1}function L09(H){if(K3I(H))return SD$(),!0;return!1}function I09(H){if(ZWI(H))return!1;if(H.message?.includes('"type":"overloaded_error"'))return!0;if(F3I(H))return!0;let $=H.headers?.get("x-should-retry");if($==="true"&&!nL())return!0;if($==="false"){let A=H.status!==void 0&&H.status>=500;return!1}if(H instanceof k6)return!0;if(!H.status)return!1;if(H.status===408)return!0;if(H.status===409)return!0;if(H.status===429)return!nL();if(H.status===401)return xD$(),!0;if(H.status&&H.status>=500)return!0;return!1}function D09(H){if(H.maxRetries)return H.maxRetries;if(process.env.CLAUDE_CODE_MAX_RETRIES)return parseInt(process.env.CLAUDE_CODE_MAX_RETRIES,10);return eB9}function M09(H){let $=J3I(H);if($){let A=parseInt($,10);if(!isNaN(A))return A*1000}return null}var eB9=10,d4A=3000,H09=3,$09=500,ay,jU$,B09=1800000,f09=20000,E09=600000;var IDH=K(()=>{n_();_$();E$();aI();oM();EI();z$();ry();oo$();ESH();_L();Ng();NA();AJ();ay=class ay extends Error{originalError;retryContext;constructor(H,$){let A=H instanceof Error?H.message:String(H);super(A);this.originalError=H;this.retryContext=$;if(this.name="RetryError",H instanceof Error&&H.stack)this.stack=H.stack}};jU$=class jU$ extends Error{originalModel;fallbackModel;constructor(H,$){super(`Model fallback triggered: ${H} -> ${$}`);this.originalModel=H;this.fallbackModel=$;this.name="FallbackTriggeredError"}}});function G09(H){return H instanceof Error}function _3I(){if(DDH)return;if(oy())DDH=new Promise((H)=>{yg=H,setTimeout(()=>{if(yg)N("Policy limits: Loading promise timed out, resolving anyway"),yg(),yg=null},F09)})}function yU$(){return V3I.join(UL(),U09)}function K09(){return`${XD().BASE_API_URL}/api/claude_code/policy_limits`}function l4A(H){if(Array.isArray(H))return H.map(l4A);if(H!==null&&typeof H==="object"){let $={};for(let[A,L]of Object.entries(H).sort(([I],[D])=>I.localeCompare(D)))$[A]=l4A(L);return $}return H}function Q09(H){let $=l4A(H),A=yH($);return`sha256:${P3I.createHash("sha256").update(A).digest("hex")}`}function oy(){if(sI()!=="firstParty")return!1;if(!ZGH())return!1;try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return!0}catch{}let H=dD();if(!H?.accessToken)return!1;if(!H.scopes?.includes(VR))return!1;if(H.subscriptionType!=="enterprise")return!1;return!0}async function i4A(){if(DDH)await DDH}function W09(){try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return{headers:{"x-api-key":$}}}catch{}let H=dD();if(H?.accessToken)return{headers:{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}};return{headers:{},error:"No authentication available"}}async function V09(H){let $=null;for(let A=1;A<=c4A+1;A++){if($=await P09(H),$.success)return $;if($.skipRetry)return $;if(A>c4A)return $;let L=Rg(A);N(`Policy limits: Retry ${A}/${c4A} after ${L}ms`),await $x(L)}return $}async function P09(H){try{await iW();let $=W09();if($.error)return{success:!1,error:"Authentication required for policy limits",skipRetry:!0};let A=K09(),L={...$.headers,"User-Agent":sG()};if(H)L["If-None-Match"]=`"${H}"`;let I=await nA.get(A,{headers:L,timeout:X09,validateStatus:(B)=>B===200||B===304||B===404});if(I.status===304)return N("Policy limits: Using cached restrictions (304)"),{success:!0,restrictions:null,etag:H};if(I.status===404)return N("Policy limits: No restrictions found (404)"),{success:!0,restrictions:{},etag:void 0};let D=F9A.safeParse(I.data);if(!D.success)return N(`Policy limits: Invalid response format - ${D.error.message}`),{success:!1,error:"Invalid policy limits format"};return N("Policy limits: Fetched successfully"),{success:!0,restrictions:D.data.restrictions}}catch($){if(nA.isAxiosError($)){if($.response?.status===401||$.response?.status===403)return{success:!1,error:"Not authorized for policy limits",skipRetry:!0};if($.code==="ECONNABORTED")return{success:!1,error:"Policy limits request timeout"};if($.code==="ECONNREFUSED"||$.code==="ENOTFOUND")return{success:!1,error:"Cannot connect to server"}}return{success:!1,error:$ instanceof Error?$.message:"Unknown error"}}}function Y3I(){try{let H=YSH.readFileSync(yU$(),"utf-8"),$=q1(H,!1),A=F9A.safeParse($);if(!A.success)return null;return A.data.restrictions}catch{return null}}function _09(H){try{let $=yU$();d_($,yH({restrictions:H},null,2),{encoding:"utf-8",mode:384}),N(`Policy limits: Saved to ${$}`)}catch($){N(`Policy limits: Failed to save - ${$ instanceof Error?$.message:"unknown error"}`)}}async function n4A(){if(!oy())return null;let H=Y3I(),$=H?Q09(H):void 0;try{let A=await V09($);if(!A.success){if(H)return N("Policy limits: Using stale cache after fetch failure"),s2=H,H;return null}if(A.restrictions===null&&H)return N("Policy limits: Cache still valid (304 Not Modified)"),s2=H,H;let L=A.restrictions||{};if(Object.keys(L).length>0)return s2=L,_09(L),N("Policy limits: Applied new restrictions successfully"),L;s2=L;try{YSH.unlinkSync(yU$()),N("Policy limits: Deleted cached file (404 response)")}catch(D){if(G09(D)&&D.code!=="ENOENT")N(`Policy limits: Failed to delete cached file - ${D.message}`)}return L}catch{if(H)return N("Policy limits: Using stale cache after error"),s2=H,H;return null}}function PK(H){let $=Y09();if(!$)return!0;let A=$[H];if(!A)return!0;return A.allowed}function Y09(){if(!oy())return null;if(s2)return s2;let H=Y3I();if(H)return s2=H,H;return null}async function C3I(){if(oy()&&!DDH)DDH=new Promise((H)=>{yg=H});try{if(await n4A(),oy())w09()}finally{if(yg)yg(),yg=null}}async function vU$(){if(r4A(),!oy())return;await n4A(),N("Policy limits: Refreshed after auth change")}function r4A(){w3I(),s2=null,DDH=null,yg=null;try{YSH.unlinkSync(yU$())}catch{}}async function C09(){if(!oy())return;let H=s2?yH(s2):null;try{if(await n4A(),(s2?yH(s2):null)!==H)N("Policy limits: Changed during background poll")}catch{}}function w09(){if(_SH!==null)return;if(!oy())return;if(_SH=setInterval(()=>{C09()},J09),!W3I)W3I=!0,PB(async()=>w3I())}function w3I(){if(_SH!==null)clearInterval(_SH),_SH=null}var V3I,P3I,YSH,U09="policy-limits.json",X09=1e4,c4A=5,J09=3600000,_SH=null,W3I=!1,DDH=null,yg=null,F09=30000,s2=null;var XY=K(()=>{w1();_Q();E$();qE();EI();uAI();NA();oM();rD();nM();IDH();Ng();ZE();Z$();V3I=require("path"),P3I=require("crypto"),YSH=require("fs")});var Z3I=K(()=>{vA();PI();mL();FG();EI();XY();NA()});function q3I(){return!1}function yD(H){if(!q3I())return;let L=(M$().featureUsage??{})[H],I={firstUsedAt:L?.firstUsedAt??Date.now(),usageCount:(L?.usageCount??0)+1};if(!L||L.usageCount!==I.usageCount)AA((D)=>({...D,featureUsage:{...D.featureUsage,[H]:I}}))}var yE=K(()=>{vA();Z3I()});class hU${options;log;terminal;scheduleRender;isUnmounted=!1;isPaused=!1;container;rootNode;renderer;stylePool;charPool;hyperlinkPool;exitPromise;restoreConsole;unsubscribeTTYHandlers;terminalColumns;terminalRows;currentNode=null;frontFrame;backFrame;lastPoolResetTime=performance.now();constructor(H){this.options=H;if(VBA(this),this.options.patchConsole)this.restoreConsole=this.patchConsole();if(this.terminal={stdout:H.stdout,stderr:H.stderr},this.terminalColumns=H.stdout.columns||80,this.terminalRows=H.stdout.rows||24,this.stylePool=new V0A,this.charPool=new P1$,this.hyperlinkPool=new _1$,this.frontFrame=xn(this.terminalRows,this.terminalColumns,this.stylePool,this.charPool,this.hyperlinkPool),this.backFrame=xn(this.terminalRows,this.terminalColumns,this.stylePool,this.charPool,this.hyperlinkPool),this.log=new Z0A({debug:H.debug,isTTY:H.stdout.isTTY||!1,stylePool:this.stylePool}),this.scheduleRender=H.debug?this.onRender:WBA(this.onRender,n5H,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.unsubscribeExit=eoH(this.unmount,{alwaysLast:!1}),H.stdout.isTTY)H.stdout.on("resize",this.handleResize),process.on("SIGCONT",this.handleResume),this.unsubscribeTTYHandlers=()=>{H.stdout.off("resize",this.handleResize),process.off("SIGCONT",this.handleResume)};this.rootNode=U1$("ink-root"),this.renderer=C0A(this.rootNode,this.stylePool),this.rootNode.onRender=this.scheduleRender,this.rootNode.onImmediateRender=this.onRender,this.rootNode.onComputeLayout=()=>{if(this.isUnmounted)return;if(this.rootNode.yogaNode)this.rootNode.yogaNode.setWidth(this.terminalColumns),this.rootNode.yogaNode.calculateLayout(this.terminalColumns)},this.container=pu.createContainer(this.rootNode,T3I.ConcurrentRoot,null,!1,null,"id",Jk,Jk,Jk,Jk)}handleResume=()=>{if(!this.options.stdout.isTTY)return;this.frontFrame=xn(this.frontFrame.viewport.height,this.frontFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.backFrame=xn(this.backFrame.viewport.height,this.backFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.log.reset()};handleResize=()=>{if(this.terminalColumns=this.options.stdout.columns||80,this.terminalRows=this.options.stdout.rows||24,this.currentNode!==null)this.render(this.currentNode)};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};setTheme(H){this.options.theme=H}handleThemeChange=(H)=>{this.setTheme(H)};handleThemeSave=(H)=>{yD("theme"),AA(($)=>({...$,theme:H}))};onRender(){if(this.isUnmounted||this.isPaused)return;let H=performance.now(),$=this.options.stdout.columns||80,A=this.options.stdout.rows||24,L=this.renderer({frontFrame:this.frontFrame,backFrame:this.backFrame,isTTY:this.options.stdout.isTTY,terminalWidth:$,terminalRows:A}),I=this.log.render(this.frontFrame,L);if(this.backFrame=this.frontFrame,this.frontFrame=L,H-this.lastPoolResetTime>300000)this.resetPools(),this.lastPoolResetTime=H;let D=[];for(let B of I)if(B.type==="clearTerminal")D.push({desiredHeight:L.screen.height,availableHeight:L.viewport.height,reason:B.reason});B9A(this.terminal,f9A(I)),this.options.onFrame?.({durationMs:performance.now()-H,flickers:D})}pause(){pu.flushSyncFromReconciler(),this.onRender(),this.isPaused=!0}resume(){this.isPaused=!1,this.onRender()}repaint(){this.frontFrame=xn(this.frontFrame.viewport.height,this.frontFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.backFrame=xn(this.backFrame.viewport.height,this.backFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.log.reset()}stdinListeners=[];wasRawMode=!1;suspendStdin(){let H=this.options.stdin;if(!H.isTTY)return;H.listeners("readable").forEach((L)=>{this.stdinListeners.push({event:"readable",listener:L}),H.removeListener("readable",L)});let A=H;if(A.isRaw&&A.setRawMode)A.setRawMode(!1),this.wasRawMode=!0}resumeStdin(){let H=this.options.stdin;if(!H.isTTY)return;if(this.stdinListeners.forEach(({event:$,listener:A})=>{H.addListener($,A)}),this.stdinListeners=[],this.wasRawMode){let $=H;if($.setRawMode)$.setRawMode(!0);this.wasRawMode=!1}}render(H){this.currentNode=H;let $=a4A.default.createElement(b1$,{initialTheme:this.options.theme,stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount,terminalColumns:this.terminalColumns,terminalRows:this.terminalRows,onThemeChange:this.handleThemeChange,onThemeSave:this.handleThemeSave},a4A.default.createElement(PAI,{value:(A)=>this.options.stdout.write(A)},H));pu.updateContainerSync($,this.container,null,Jk),pu.flushSyncWork()}unmount(H){if(this.isUnmounted)return;if(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole==="function")this.restoreConsole();this.unsubscribeTTYHandlers?.();let $=this.log.renderPreviousOutput_DEPRECATED(this.frontFrame);if(B9A(this.terminal,f9A($)),this.options.stdout.isTTY)iJH.writeSync(1,x5H),iJH.writeSync(1,YLH),iJH.writeSync(1,a5H),iJH.writeSync(1,TO),iJH.writeSync(1,k1$);if(this.isUnmounted=!0,this.scheduleRender.cancel?.(),pu.updateContainerSync(null,this.container,null,Jk),pu.flushSyncWork(),qO.delete(this.options.stdout),H instanceof Error)this.rejectExitPromise(H);else this.resolveExitPromise()}async waitUntilExit(){return this.exitPromise||=new Promise((H,$)=>{this.resolveExitPromise=H,this.rejectExitPromise=$}),this.exitPromise}resetLineCount(){if(this.options.stdout.isTTY&&!this.options.debug)this.backFrame=this.frontFrame,this.frontFrame=xn(this.frontFrame.viewport.height,this.frontFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.log.reset()}resetPools(){this.charPool=new P1$,this.hyperlinkPool=new _1$,_eL(this.frontFrame.screen,this.charPool,this.hyperlinkPool),this.backFrame.screen.charPool=this.charPool,this.backFrame.screen.hyperlinkPool=this.hyperlinkPool}patchConsole(){if(this.options.debug)return;return GtL((H,$)=>{if(H==="stdout")N(`console.log: ${$}`);if(H==="stderr")r(Error(`console.error: ${$}`))})}}var a4A,iJH,T3I;var z3I=K(()=>{EtL();jb$();UtL();D0A();OeL();A0A();jeL();d5H();wHI();TLH();_$();E$();sj$();s1$();_AI();g5H();CLH();Jy();t5H();vA();yE();a4A=b(s(),1),iJH=require("fs"),T3I=b(xBA(),1)});var N3I,Z09=(H,$)=>{let A=T09($),L={stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0,...A,theme:A.theme??M$().theme},I=z09(L.stdout,()=>new hU$(L));return I.render(H),{rerender:I.render,unmount(){I.unmount()},waitUntilExit:I.waitUntilExit,cleanup:()=>qO.delete(L.stdout)}},q09=async(H,$)=>{N("[render] initLayout starting"),await ysL(),N("[render] initLayout complete");let A=Z09(H,$);return N(`[render] first ink render: ${Math.round(process.uptime()*1000)}ms since process start`),A},A8,T09=(H={})=>{if(H instanceof N3I.Stream)return{stdout:H,stdin:process.stdin};return H},z09=(H,$)=>{let A=qO.get(H);if(!A)A=$(),qO.set(H,A);return A};var O3I=K(()=>{z3I();sBA();d5H();vA();E$();N3I=require("stream"),A8=q09});function CSH(H,$){if(!H)return;if(H.startsWith("rgb(")||H.startsWith("#")||H.startsWith("ansi256(")||H.startsWith("ansi:"))return H;return $[H]}function N09({borderColor:H,borderTopColor:$,borderBottomColor:A,borderLeftColor:L,borderRightColor:I,children:D,ref:B,...f}){let[E]=_I(),M=c6(E),G=CSH(H,M),U=CSH($,M),X=CSH(A,M),J=CSH(L,M),F=CSH(I,M);return x3I.default.createElement(s_,{ref:B,borderColor:G,borderTopColor:U,borderBottomColor:X,borderLeftColor:J,borderRightColor:F,...f},D)}var x3I,x;var S3I=K(()=>{Ky();DNH();INH();x3I=b(s(),1);x=N09});var y3I=z((Zcf,R3I)=>{var wcf=require("os"),j3I=require("tty"),IT=YCH(),{env:TQ}=process,Sr;if(IT("no-color")||IT("no-colors")||IT("color=false")||IT("color=never"))Sr=0;else if(IT("color")||IT("colors")||IT("color=true")||IT("color=always"))Sr=1;if("FORCE_COLOR"in TQ)if(TQ.FORCE_COLOR==="true")Sr=1;else if(TQ.FORCE_COLOR==="false")Sr=0;else Sr=TQ.FORCE_COLOR.length===0?1:Math.min(parseInt(TQ.FORCE_COLOR,10),3);function o4A(H){if(H===0)return!1;return{level:H,hasBasic:!0,has256:H>=2,has16m:H>=3}}function t4A(H,$){if(Sr===0)return 0;if(IT("color=16m")||IT("color=full")||IT("color=truecolor"))return 3;if(IT("color=256"))return 2;if(H&&!$&&Sr===void 0)return 0;let A=Sr||0;if(TQ.TERM==="dumb")return A;if("CI"in TQ){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((L)=>(L in TQ))||TQ.CI_NAME==="codeship")return 1;return A}if("TEAMCITY_VERSION"in TQ)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(TQ.TEAMCITY_VERSION)?1:0;if(TQ.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in TQ){let L=parseInt((TQ.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(TQ.TERM_PROGRAM){case"iTerm.app":return L>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(TQ.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(TQ.TERM))return 1;if("COLORTERM"in TQ)return 1;return A}function O09(H){let $=t4A(H,H&&H.isTTY);return o4A($)}R3I.exports={supportsColor:O09,stdout:o4A(t4A(!0,j3I.isatty(1))),stderr:o4A(t4A(!0,j3I.isatty(2)))}});var b3I=z((qcf,h3I)=>{var x09=y3I(),nJH=YCH();function v3I(H){if(/^\d{3,4}$/.test(H)){let A=/(\d{1,2})(\d{2})/.exec(H);return{major:0,minor:parseInt(A[1],10),patch:parseInt(A[2],10)}}let $=(H||"").split(".").map((A)=>parseInt(A,10));return{major:$[0],minor:$[1],patch:$[2]}}function s4A(H){let{env:$}=process;if("FORCE_HYPERLINK"in $)return!($.FORCE_HYPERLINK.length>0&&parseInt($.FORCE_HYPERLINK,10)===0);if(nJH("no-hyperlink")||nJH("no-hyperlinks")||nJH("hyperlink=false")||nJH("hyperlink=never"))return!1;if(nJH("hyperlink=true")||nJH("hyperlink=always"))return!0;if("NETLIFY"in $)return!0;if(!x09.supportsColor(H))return!1;if(H&&!H.isTTY)return!1;if("CI"in $)return!1;if("TEAMCITY_VERSION"in $)return!1;if("TERM_PROGRAM"in $){let A=v3I($.TERM_PROGRAM_VERSION);switch($.TERM_PROGRAM){case"iTerm.app":if(A.major===3)return A.minor>=1;return A.major>3;case"WezTerm":return A.major>=20200620;case"vscode":return A.major>1||A.major===1&&A.minor>=72}}if("VTE_VERSION"in $){if($.VTE_VERSION==="0.50.0")return!1;let A=v3I($.VTE_VERSION);return A.major>0||A.minor>=50}return!1}h3I.exports={supportsHyperlink:s4A,stdout:s4A(process.stdout),stderr:s4A(process.stderr)}});function e2(){if(u3I.default.stdout)return!0;let H=process.env.TERM_PROGRAM;if(H&&k3I.includes(H))return!0;let $=process.env.LC_TERMINAL;if($&&k3I.includes($))return!0;if(process.env.TERM?.includes("kitty"))return!0;return!1}var u3I,k3I;var jr=K(()=>{u3I=b(b3I(),1),k3I=["ghostty","Hyper","kitty","alacritty","iTerm.app","iTerm2"]});function dI({children:H,url:$,fallback:A}){let L=H??$;if(e2())return bU$.default.createElement(fJ,null,bU$.default.createElement("ink-link",{href:$},L));return bU$.default.createElement(fJ,null,A??L)}var bU$;var rJH=K(()=>{jr();i5H();bU$=b(s(),1)});function aJH(){return{bold:!1,dim:!1,italic:!1,underline:"none",blink:!1,inverse:!1,hidden:!1,strikethrough:!1,overline:!1,fg:{type:"default"},bg:{type:"default"},underlineColor:{type:"default"}}}function g3I(H){if(H.length===0)return null;let $=H[0];if($==="c")return{type:"reset"};if($==="7")return{type:"cursor",action:{type:"save"}};if($==="8")return{type:"cursor",action:{type:"restore"}};if($==="D")return{type:"cursor",action:{type:"move",direction:"down",count:1}};if($==="M")return{type:"cursor",action:{type:"move",direction:"up",count:1}};if($==="E")return{type:"cursor",action:{type:"nextLine",count:1}};if($==="H")return null;if("()".includes($)&&H.length>=2)return null;return{type:"unknown",sequence:`\x1B${H}`}}function j09(H){if(H==="")return[{value:0,subparams:[],colon:!1}];let $=[],A={value:null,subparams:[],colon:!1},L="",I=!1;for(let D=0;D<=H.length;D++){let B=H[D];if(B===";"||B===void 0){let f=L===""?null:parseInt(L,10);if(I){if(f!==null)A.subparams.push(f)}else A.value=f;$.push(A),A={value:null,subparams:[],colon:!1},L="",I=!1}else if(B===":"){let f=L===""?null:parseInt(L,10);if(!I)A.value=f,A.colon=!0,I=!0;else if(f!==null)A.subparams.push(f);L=""}else if(B>="0"&&B<="9")L+=B}return $}function e4A(H,$){let A=H[$];if(!A)return null;if(A.colon&&A.subparams.length>=1){if(A.subparams[0]===5&&A.subparams.length>=2)return{index:A.subparams[1]};if(A.subparams[0]===2&&A.subparams.length>=4){let I=A.subparams.length>=5?1:0;return{r:A.subparams[1+I],g:A.subparams[2+I],b:A.subparams[3+I]}}}let L=H[$+1];if(!L)return null;if(L.value===5&&H[$+2]?.value!==null&&H[$+2]?.value!==void 0)return{index:H[$+2].value};if(L.value===2){let I=H[$+2]?.value,D=H[$+3]?.value,B=H[$+4]?.value;if(I!==null&&I!==void 0&&D!==null&&D!==void 0&&B!==null&&B!==void 0)return{r:I,g:D,b:B}}return null}function m3I(H,$){let A=j09(H),L={...$},I=0;while(I=30&&B<=37){L.fg={type:"named",name:kU$[B-30]},I++;continue}if(B===39){L.fg={type:"default"},I++;continue}if(B>=40&&B<=47){L.bg={type:"named",name:kU$[B-40]},I++;continue}if(B===49){L.bg={type:"default"},I++;continue}if(B>=90&&B<=97){L.fg={type:"named",name:kU$[B-90+8]},I++;continue}if(B>=100&&B<=107){L.bg={type:"named",name:kU$[B-100+8]},I++;continue}if(B===38){let f=e4A(A,I);if(f){L.fg="index"in f?{type:"indexed",index:f.index}:{type:"rgb",...f},I+=D.colon?1:("index"in f)?3:5;continue}}if(B===48){let f=e4A(A,I);if(f){L.bg="index"in f?{type:"indexed",index:f.index}:{type:"rgb",...f},I+=D.colon?1:("index"in f)?3:5;continue}}if(B===58){let f=e4A(A,I);if(f){L.underlineColor="index"in f?{type:"indexed",index:f.index}:{type:"rgb",...f},I+=D.colon?1:("index"in f)?3:5;continue}}if(B===59){L.underlineColor={type:"default"},I++;continue}I++}return L}var kU$,S09;var p3I=K(()=>{kU$=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],S09=["none","single","double","curly","dotted","dashed"]});function R09(H){return H>=9728&&H<=9983||H>=9984&&H<=10175||H>=127744&&H<=129535||H>=129536&&H<=129791||H>=127456&&H<=127487}function y09(H){return H>=4352&&H<=4447||H>=11904&&H<=40959||H>=44032&&H<=55203||H>=63744&&H<=64255||H>=65040&&H<=65055||H>=65072&&H<=65135||H>=65280&&H<=65376||H>=65504&&H<=65510||H>=131072&&H<=196605||H>=196608&&H<=262141}function v09(H){if([...H].length>1)return 2;let $=H.codePointAt(0);if($===void 0)return 1;if(R09($)||y09($))return 2;return 1}function*d3I(H){for(let{segment:$}of PO().segment(H))yield{value:$,width:v09($)}}function h09(H){if(H==="")return[];return H.split(/[;:]/).map(($)=>$===""?0:parseInt($,10))}function b09(H){let $=H.slice(2);if($.length===0)return null;let A=$.charCodeAt($.length-1),L=$.slice(0,-1),I="",D=L,B="";if(L.length>0&&"?>=".includes(L[0]))I=L[0],D=L.slice(1);let f=D.match(/([^0-9;:]+)$/);if(f)B=f[1],D=D.slice(0,-B.length);let E=h09(D),M=E[0]??1,G=E[1]??1;if(A===N4.SGR&&I==="")return{type:"sgr",params:D};if(A===N4.CUU)return{type:"cursor",action:{type:"move",direction:"up",count:M}};if(A===N4.CUD)return{type:"cursor",action:{type:"move",direction:"down",count:M}};if(A===N4.CUF)return{type:"cursor",action:{type:"move",direction:"forward",count:M}};if(A===N4.CUB)return{type:"cursor",action:{type:"move",direction:"back",count:M}};if(A===N4.CNL)return{type:"cursor",action:{type:"nextLine",count:M}};if(A===N4.CPL)return{type:"cursor",action:{type:"prevLine",count:M}};if(A===N4.CHA)return{type:"cursor",action:{type:"column",col:M}};if(A===N4.CUP||A===N4.HVP)return{type:"cursor",action:{type:"position",row:M,col:G}};if(A===N4.VPA)return{type:"cursor",action:{type:"row",row:M}};if(A===N4.ED)return{type:"erase",action:{type:"display",region:etL[E[0]??0]??"toEnd"}};if(A===N4.EL)return{type:"erase",action:{type:"line",region:HsL[E[0]??0]??"toEnd"}};if(A===N4.ECH)return{type:"erase",action:{type:"chars",count:M}};if(A===N4.SU)return{type:"scroll",action:{type:"up",count:M}};if(A===N4.SD)return{type:"scroll",action:{type:"down",count:M}};if(A===N4.DECSTBM)return{type:"scroll",action:{type:"setRegion",top:M,bottom:G}};if(A===N4.SCOSC)return{type:"cursor",action:{type:"save"}};if(A===N4.SCORC)return{type:"cursor",action:{type:"restore"}};if(A===N4.DECSCUSR&&B===" ")return{type:"cursor",action:{type:"style",...dBA[M]??dBA[0]}};if(I==="?"&&(A===N4.SM||A===N4.RM)){let U=A===N4.SM;if(M===eW.CURSOR_VISIBLE)return{type:"cursor",action:U?{type:"show"}:{type:"hide"}};if(M===eW.ALT_SCREEN_CLEAR||M===eW.ALT_SCREEN)return{type:"mode",action:{type:"alternateScreen",enabled:U}};if(M===eW.BRACKETED_PASTE)return{type:"mode",action:{type:"bracketedPaste",enabled:U}};if(M===eW.MOUSE_NORMAL)return{type:"mode",action:{type:"mouseTracking",mode:U?"normal":"off"}};if(M===eW.MOUSE_BUTTON)return{type:"mode",action:{type:"mouseTracking",mode:U?"button":"off"}};if(M===eW.MOUSE_ANY)return{type:"mode",action:{type:"mouseTracking",mode:U?"any":"off"}};if(M===eW.FOCUS_EVENTS)return{type:"mode",action:{type:"focusEvents",enabled:U}}}return{type:"unknown",sequence:H}}function k09(H){if(H.length<2)return"unknown";if(H.charCodeAt(0)!==Xy.ESC)return"unknown";let $=H.charCodeAt(1);if($===91)return"csi";if($===93)return"osc";if($===79)return"ss3";return"esc"}class uU${tokenizer=S5H();style=aJH();inLink=!1;linkUrl;reset(){this.tokenizer.reset(),this.style=aJH(),this.inLink=!1,this.linkUrl=void 0}feed(H){let $=this.tokenizer.feed(H),A=[];for(let L of $){let I=this.processToken(L);A.push(...I)}return A}processToken(H){switch(H.type){case"text":return this.processText(H.value);case"sequence":return this.processSequence(H.value)}}processText(H){let $=[],A="";for(let L of H)if(L.charCodeAt(0)===Xy.BEL){if(A){let I=[...d3I(A)];if(I.length>0)$.push({type:"text",graphemes:I,style:{...this.style}});A=""}$.push({type:"bell"})}else A+=L;if(A){let L=[...d3I(A)];if(L.length>0)$.push({type:"text",graphemes:L,style:{...this.style}})}return $}processSequence(H){switch(k09(H)){case"csi":{let A=b09(H);if(!A)return[];if(A.type==="sgr")return this.style=m3I(A.params,this.style),[];return[A]}case"osc":{let A=H.slice(2);if(A.endsWith("\x07"))A=A.slice(0,-1);else if(A.endsWith("\x1B\\"))A=A.slice(0,-2);let L=qHI(A);if(L){if(L.type==="link")if(L.action.type==="start")this.inLink=!0,this.linkUrl=L.action.url;else this.inLink=!1,this.linkUrl=void 0;return[L]}return[]}case"esc":{let A=H.slice(1),L=g3I(A);return L?[L]:[]}case"ss3":return[{type:"unknown",sequence:H}];default:return[{type:"unknown",sequence:H}]}}}var c3I=K(()=>{FLH();Jy();CLH();t5H();p3I();f1$();F5H()});var l3I=K(()=>{c3I()});function u09(H){let A=new uU$().feed(H),L=[],I;for(let D of A){if(D.type==="link"){if(D.action.type==="start")I=D.action.url;else I=void 0;continue}if(D.type==="text"){let B=D.graphemes.map((M)=>M.value).join("");if(!B)continue;let f=g09(D.style);if(I)f.hyperlink=I;let E=L[L.length-1];if(E&&p09(E.props,f))E.text+=B;else L.push({text:B,props:f})}}return L}function g09(H){let $={};if(H.bold)$.bold=!0;if(H.dim)$.dim=!0;if(H.italic)$.italic=!0;if(H.underline!=="none")$.underline=!0;if(H.strikethrough)$.strikethrough=!0;if(H.inverse)$.inverse=!0;let A=i3I(H.fg);if(A)$.color=A;let L=i3I(H.bg);if(L)$.backgroundColor=L;return $}function i3I(H){switch(H.type){case"named":return m09[H.name];case"indexed":return`ansi256(${H.index})`;case"rgb":return`rgb(${H.r},${H.g},${H.b})`;case"default":return}}function p09(H,$){return H.color===$.color&&H.backgroundColor===$.backgroundColor&&H.bold===$.bold&&H.dim===$.dim&&H.italic===$.italic&&H.underline===$.underline&&H.strikethrough===$.strikethrough&&H.inverse===$.inverse&&H.hyperlink===$.hyperlink}function n3I({bold:H,dim:$,children:A,...L}){if($)return AP.default.createElement(fJ,{...L,dim:!0},A);if(H)return AP.default.createElement(fJ,{...L,bold:!0},A);return AP.default.createElement(fJ,{...L},A)}var AP,m9,m09;var r3I=K(()=>{i5H();rJH();l3I();AP=b(s(),1),m9=AP.default.memo(function({children:$,dimColor:A}){if(typeof $!=="string")return A?AP.default.createElement(fJ,{dim:!0},String($)):AP.default.createElement(fJ,null,String($));if($==="")return null;let L=u09($);if(L.length===0)return null;if(L.length===1&&Object.keys(L[0].props).length===0)return A?AP.default.createElement(fJ,{dim:!0},L[0].text):AP.default.createElement(fJ,null,L[0].text);let I=L.map((D,B)=>{let{hyperlink:f,...E}=D.props;if(A)E.dim=!0;let M=Object.keys(E).length>0;if(f)return M?AP.default.createElement(dI,{key:B,url:f},AP.default.createElement(n3I,{...E},D.text)):AP.default.createElement(dI,{key:B,url:f},D.text);return M?AP.default.createElement(n3I,{key:B,...E},D.text):D.text});return A?AP.default.createElement(fJ,{dim:!0},I):AP.default.createElement(fJ,null,I)});m09={black:"ansi:black",red:"ansi:red",green:"ansi:green",yellow:"ansi:yellow",blue:"ansi:blue",magenta:"ansi:magenta",cyan:"ansi:cyan",white:"ansi:white",brightBlack:"ansi:blackBright",brightRed:"ansi:redBright",brightGreen:"ansi:greenBright",brightYellow:"ansi:yellowBright",brightBlue:"ansi:blueBright",brightMagenta:"ansi:magentaBright",brightCyan:"ansi:cyanBright",brightWhite:"ansi:whiteBright"}});function _K({count:H=1}){return a3I.default.createElement("ink-text",null,` `;if(G)L=M;$.push(new iU$(B,E,f(E),G))}}return $}getWrappedText(){return this.wrappedLines.map((H)=>H.isPrecededByNewline?H.text:H.text.trimStart())}getWrappedLines(){return this.wrappedLines}getLine(H){let $=this.wrappedLines;return $[Math.max(0,Math.min(H,$.length-1))]}getOffsetFromPosition(H){let $=this.getLine(H.line);if($.text.length===0&&$.endsWithNewline)return $.startOffset;let A=$.isPrecededByNewline?0:$.text.length-$.text.trimStart().length,L=H.column+A,I=this.displayWidthToStringIndex($.text,L),D=$.startOffset+I,B=$.startOffset+$.text.length,f=B,E=GI($.text);if($.endsWithNewline&&H.column>E)f=B+1;return Math.min(D,f)}getLineLength(H){let $=this.getLine(H);return GI($.text)}getPositionFromOffset(H){let $=this.wrappedLines;for(let I=0;I<$.length;I++){let D=$[I],B=$[I+1];if(H>=D.startOffset&&(!B||H{let $=this.getGraphemeBoundaries();return this.binarySearchBoundary($,H,!0)})}prevOffset(H){if(H<=0)return 0;return this.withCache(`prev:${H}`,()=>{let $=this.getGraphemeBoundaries();return this.binarySearchBoundary($,H,!1)})}}var F99=10,BT,lU$=0,I5A=!1,KVI=0,D5A=0,nU$=!1,K99,TSH,hg=(H)=>K99.test(H),sU$=(H)=>TSH.test(H),hr=(H)=>H.length>0&&!sU$(H)&&!hg(H);var eJH=K(()=>{$1$();DJ();F5H();BT=[];K99=/^[\p{L}\p{N}\p{M}_]$/u,TSH=/\s/});function eU$({children:H}){let{marker:$}=br.useContext(Q99);return br.default.createElement(x,{gap:1},br.default.createElement(V,{dimColor:!0},$),br.default.createElement(x,{flexDirection:"column"},H))}var br,Q99;var WVI=K(()=>{xH();br=b(s(),1),Q99=br.createContext({marker:""})});function PVI({children:H}){let{marker:$}=JY.useContext(VVI),A=0;for(let I of JY.default.Children.toArray(H)){if(!JY.isValidElement(I)||I.type!==eU$)continue;A++}let L=String(A).length;return JY.default.createElement(x,{flexDirection:"column"},JY.default.Children.map(H,(I,D)=>{if(!JY.isValidElement(I)||I.type!==eU$)return I;let B=`${String(D+1).padStart(L)}.`,f=`${$}${B}`;return JY.default.createElement(VVI.Provider,{value:{marker:f}},JY.default.createElement(W99.Provider,{value:{marker:f}},I))}))}var JY,VVI,W99,OSH;var B5A=K(()=>{xH();WVI();JY=b(s(),1),VVI=JY.createContext({marker:""}),W99=JY.createContext({marker:""});PVI.Item=eU$;OSH=PVI});function CVI(){return f5A().filter(({isCompletable:H,isEnabled:$})=>H&&$).every(({isComplete:H})=>H)}function HFH(){let H=Mf();if(CVI()&&!H.hasCompletedProjectOnboarding)MM(($)=>({...$,hasCompletedProjectOnboarding:!0}))}function f5A(){let H=zH().existsSync(_VI.join(C$(),"CLAUDE.md")),$=qVI(C$());return[{key:"workspace",text:"Ask Claude to create a new app or clone a repository",isComplete:!1,isCompletable:!0,isEnabled:$},{key:"claudemd",text:"Run /init to create a CLAUDE.md file with instructions for Claude",isComplete:H,isCompletable:!0,isEnabled:!$}]}function ZVI(){MM((H)=>({...H,projectOnboardingSeenCount:H.projectOnboardingSeenCount+1}))}var V99,_VI,YVI,wVI;var xSH=K(()=>{B5A();xH();vA();rD();PI();DL();tD();V99=b(s(),1),_VI=require("path"),YVI=b(s(),1);wVI=o$(()=>{if(CVI()||Mf().projectOnboardingSeenCount>=4||process.env.IS_DEMO)return!1;return!0})});function P99(H){AA(($)=>({...$,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:H}))}function SSH(){AA((H)=>({...H,appleTerminalSetupInProgress:!1}))}function _99(){let H=M$();return{inProgress:H.appleTerminalSetupInProgress??!1,backupPath:H.appleTerminalBackupPath||null}}function $FH(){return zVI.join(TVI.homedir(),"Library","Preferences","com.apple.Terminal.plist")}async function NVI(){let H=$FH(),$=`${H}.bak`;try{let{code:A}=await jA("defaults",["export","com.apple.Terminal",H]);if(A!==0)return null;if(zH().existsSync(H))return await jA("defaults",["export","com.apple.Terminal",$]),P99($),$;return null}catch(A){return r(A instanceof Error?A:Error(String(A))),null}}async function H4$(){let{inProgress:H,backupPath:$}=_99();if(!H)return{status:"no_backup"};if(!$||!zH().existsSync($))return SSH(),{status:"no_backup"};try{let{code:A}=await jA("defaults",["import","com.apple.Terminal",$]);if(A!==0)return{status:"failed",backupPath:$};return await jA("killall",["cfprefsd"]),SSH(),{status:"restored"}}catch(A){return r(Error(`Failed to restore Terminal.app settings with: ${A}`)),SSH(),{status:"failed",backupPath:$}}}var TVI,zVI;var E5A=K(()=>{B0();_$();vA();DL();TVI=require("os"),zVI=require("path")});function Y99(){let H=process.env.SHELL||"",$=M5A.homedir(),A=sy.join($,".claude");if(H.endsWith("/zsh")||H.endsWith("/zsh.exe")){let L=sy.join(A,"completion.zsh");return{name:"zsh",rcFile:sy.join($,".zshrc"),cacheFile:L,completionLine:`[[ -f "${L}" ]] && source "${L}"`,shellFlag:"zsh"}}if(H.endsWith("/bash")||H.endsWith("/bash.exe")){let L=sy.join(A,"completion.bash");return{name:"bash",rcFile:sy.join($,".bashrc"),cacheFile:L,completionLine:`[ -f "${L}" ] && source "${L}"`,shellFlag:"bash"}}if(H.endsWith("/fish")||H.endsWith("/fish.exe")){let L=process.env.XDG_CONFIG_HOME||sy.join($,".config"),I=sy.join(A,"completion.fish");return{name:"fish",rcFile:sy.join(L,"fish","config.fish"),cacheFile:I,completionLine:`[ -f "${I}" ] && source "${I}"`,shellFlag:"fish"}}return null}async function G5A(){let H=Y99();if(!H)return;N(`update: Regenerating ${H.name} completion cache`);let $=process.argv[1]||"claude";if((await jA($,["completion",H.shellFlag,"--output",H.cacheFile])).code!==0){N(`update: Failed to regenerate ${H.name} completion cache`);return}N(`update: Regenerated ${H.name} completion cache at ${H.cacheFile}`)}var M5A,sy;var U5A=K(()=>{xH();jr();E$();B0();DL();_$();Z$();M5A=require("os"),sy=require("path")});var jVI={};XA(jVI,{shouldOfferTerminalSetup:()=>AFH,setupTerminal:()=>A4$,markBackslashReturnUsed:()=>Q5A,isShiftEnterKeyBindingInstalled:()=>F5A,isOptionAsMetaKeyInstalled:()=>Z99,isNativeCSIuTerminal:()=>w99,hasUsedBackslashReturn:()=>K5A,getNativeCSIuTerminalDisplayName:()=>J5A,call:()=>q99});function C99(){let H=process.env.VSCODE_GIT_ASKPASS_MAIN??"",$=process.env.PATH??"";return H.includes(".vscode-server")||H.includes(".cursor-server")||H.includes(".windsurf-server")||$.includes(".vscode-server")||$.includes(".cursor-server")||$.includes(".windsurf-server")}function w99(){return OA.terminal!==null&&OA.terminal in jSH}function J5A(){if(!OA.terminal||!(OA.terminal in jSH))return null;return jSH[OA.terminal]??null}function fT(H){if(!e2())return H;return`\x1B]8;;${SVI.pathToFileURL(H).href}\x07${H}\x1B]8;;\x07`}function AFH(){return NB.platform()==="darwin"&&OA.terminal==="Apple_Terminal"||OA.terminal==="vscode"||OA.terminal==="cursor"||OA.terminal==="windsurf"||OA.terminal==="alacritty"||OA.terminal==="WarpTerminal"||OA.terminal==="zed"}async function A4$(H){let $="";switch(OA.terminal){case"Apple_Terminal":$=await T99(H);break;case"vscode":$=X5A("VSCode",H);break;case"cursor":$=X5A("Cursor",H);break;case"windsurf":$=X5A("Windsurf",H);break;case"alacritty":$=await z99(H);break;case"WarpTerminal":$=N99(H);break;case"zed":$=O99(H);break;case null:break}return AA((A)=>{if(["vscode","cursor","windsurf","alacritty","WarpTerminal","zed"].includes(OA.terminal??"")){if(A.shiftEnterKeyBindingInstalled===!0)return A;return{...A,shiftEnterKeyBindingInstalled:!0}}else if(OA.terminal==="Apple_Terminal"){if(A.optionAsMetaKeyInstalled===!0)return A;return{...A,optionAsMetaKeyInstalled:!0}}return A}),HFH(),$}function F5A(){return M$().shiftEnterKeyBindingInstalled===!0}function Z99(){return M$().optionAsMetaKeyInstalled===!0}function K5A(){return M$().hasUsedBackslashReturn===!0}function Q5A(){if(!M$().hasUsedBackslashReturn)AA(($)=>({...$,hasUsedBackslashReturn:!0}))}async function q99(H,$,A){if(OA.terminal&&OA.terminal in jSH){let I=`Shift+Enter is natively supported in ${jSH[OA.terminal]}. `)+"\u2026"}var API=67108736;var T5A,IPI=({isDisabled:H=!1,disableSelection:$=!1,state:A,options:L,isMultiSelect:I=!1,onUpFromFirstItem:D,onDownFromLastItem:B,onInputModeToggle:f,inputValues:E,imagesSelected:M=!1,onEnterImageSelection:G})=>{FY("select",!!A.onCancel);let U=T5A.useMemo(()=>{return L.find((F)=>F.value===A.focusedValue)?.type==="input"},[L,A.focusedValue]),X=T5A.useMemo(()=>{let J={};if(!U)J["select:next"]=()=>{if(B){let F=L[L.length-1];if(F&&A.focusedValue===F.value){B();return}}A.focusNextOption()},J["select:previous"]=()=>{if(D&&A.visibleFromIndex===0){let F=L[0];if(F&&A.focusedValue===F.value){D();return}}A.focusPreviousOption()},J["select:accept"]=()=>{if($===!0)return;if(A.focusedValue===void 0)return;if(L.find((Q)=>Q.value===A.focusedValue)?.disabled===!0)return;A.selectFocusedOption?.(),A.onChange?.(A.focusedValue)};if(A.onCancel)J["select:cancel"]=()=>{A.onCancel()};return J},[L,A,B,D,U,$]);bI(X,{context:"Select",isActive:!H}),WL((J,F,Q)=>{let W=fFH(J),P=L.find((Y)=>Y.value===A.focusedValue),C=P?.type==="input";if(F.tab&&f&&A.focusedValue!==void 0){f(A.focusedValue);return}if(C){if(M)return;if(F.downArrow&&G?.()){Q.stopImmediatePropagation();return}if(F.downArrow||F.ctrl&&J==="n"){if(B){let Y=L[L.length-1];if(Y&&A.focusedValue===Y.value){B(),Q.stopImmediatePropagation();return}}A.focusNextOption(),Q.stopImmediatePropagation();return}if(F.upArrow||F.ctrl&&J==="p"){if(D&&A.visibleFromIndex===0){let Y=L[0];if(Y&&A.focusedValue===Y.value){D(),Q.stopImmediatePropagation();return}}A.focusPreviousOption(),Q.stopImmediatePropagation();return}if(/^[0-9]$/.test(W)&&P?.type==="input"){if((E?.get(A.focusedValue)??"").trim())return}else return}if(F.pageDown)A.focusNextPage();if(F.pageUp)A.focusPreviousPage();if($!==!0){if(I&&K4$(J)===" "&&A.focusedValue!==void 0){if(P?.disabled!==!0)A.selectFocusedOption?.(),A.onChange?.(A.focusedValue)}if($!=="numeric"&&/^[0-9]+$/.test(W)){let Y=parseInt(W)-1;if(Y>=0&&Y{xH();Dx();$I();T5A=b(s(),1)});function m99(){let $={darwin:"No image found in clipboard. Use Cmd + Ctrl + Shift + 4 to copy a screenshot to clipboard.",win32:"No image found in clipboard. Use Print Screen to copy a screenshot to clipboard.",linux:"No image found in clipboard. Use appropriate screenshot tool to copy a screenshot to clipboard."};return $.linux||$.linux}function fPI(){let $=process.env.CLAUDE_CODE_TMPDIR||"/tmp",A="claude_cli_latest_screenshot.png",L={darwin:Hv.join($,"claude_cli_latest_screenshot.png"),linux:Hv.join($,"claude_cli_latest_screenshot.png"),win32:Hv.join($,"claude_cli_latest_screenshot.png")},I=L.linux||L.linux,D={darwin:{checkImage:"osascript -e 'the clipboard as \xABclass PNGf\xBB'",saveImage:`osascript -e 'set png_data to (the clipboard as \xABclass PNGf\xBB)' -e 'set fp to open for access POSIX file "${I}" with write permission' -e 'write png_data to fp' -e 'close access fp'`,getPath:"osascript -e 'get POSIX path of (the clipboard as \xABclass furl\xBB)'",deleteFile:`rm -f "${I}"`},linux:{checkImage:'xclip -selection clipboard -t TARGETS -o 2>/dev/null | grep -E "image/(png|jpeg|jpg|gif|webp)" || wl-paste -l 2>/dev/null | grep -E "image/(png|jpeg|jpg|gif|webp)"',saveImage:`xclip -selection clipboard -t image/png -o > "${I}" 2>/dev/null || wl-paste --type image/png > "${I}"`,getPath:"xclip -selection clipboard -t text/plain -o 2>/dev/null || wl-paste 2>/dev/null",deleteFile:`rm -f "${I}"`},win32:{checkImage:'powershell -NoProfile -Command "(Get-Clipboard -Format Image) -ne $null"',saveImage:`powershell -NoProfile -Command "$img = Get-Clipboard -Format Image; if ($img) { $img.Save('${I.replace(/\\/g,"\\\\")}', [System.Drawing.Imaging.ImageFormat]::Png) }"`,getPath:'powershell -NoProfile -Command "Get-Clipboard"',deleteFile:`del /f "${I}"`}};return{commands:D.linux||D.linux,screenshotPath:I}}async function EPI(){return!1}async function MFH(){let{commands:H,screenshotPath:$}=fPI();try{if((await fE(H.checkImage,{shell:!0,reject:!1})).exitCode!==0)return null;if((await fE(H.saveImage,{shell:!0,reject:!1})).exitCode!==0)return null;let I=zH().readFileBytesSync($),D=await pJH(I,I.length,"png"),B=D.buffer.toString("base64"),f=k4A(B);return fE(H.deleteFile,{shell:!0,reject:!1}),{base64:B,mediaType:f,dimensions:D.dimensions}}catch{return null}}async function p99(){let{commands:H}=fPI();try{let $=await fE(H.getPath,{shell:!0,reject:!1});if($.exitCode!==0||!$.stdout)return null;return $.stdout.trim()}catch($){return r($),null}}function GPI(H){if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'"))return H.slice(1,-1);return H}function UPI(H){let L=`__DOUBLE_BACKSLASH_${BPI.randomBytes(8).toString("hex")}__`;return H.replace(/\\\\/g,L).replace(/\\(.)/g,"$1").replace(new RegExp(L,"g"),"\\")}function W4$(H){let $=GPI(H.trim()),A=UPI($);return MPI.test(A)}function d99(H){let $=GPI(H.trim()),A=UPI($);if(MPI.test(A))return A;return null}async function XPI(H){let $=d99(H);if(!$)return null;let A=$,L;try{if(Hv.isAbsolute(A))L=zH().readFileBytesSync(A);else{let E=await p99();if(E&&A===Hv.basename(E))L=zH().readFileBytesSync(E)}}catch(E){return r(E),null}if(!L)return null;let I=Hv.extname(A).slice(1).toLowerCase()||"png",D=await pJH(L,L.length,I),B=D.buffer.toString("base64"),f=k4A(B);return{path:A,base64:B,mediaType:f,dimensions:D.dimensions}}var BPI,Hv,dnf,Q4$=800,MPI;var ySH=K(()=>{B0();O_();DL();_$();LT();BPI=require("crypto"),Hv=require("path");dnf=m99();MPI=/\.(png|jpe?g|gif|webp)$/i});function FPI(){return MDH.join(UL(),JPI,j$())}function KPI(H,$){if(H.existsSync($))return;let A=MDH.dirname($);if(A!==$)KPI(H,A);H.mkdirSync($)}function c99(){let H=zH(),$=FPI();KPI(H,$)}function QPI(H,$){let A=$.split("/")[1]||"png";return MDH.join(FPI(),`${H}.${A}`)}function GFH(H){if(H.type!=="image")return null;let $=QPI(H.id,H.mediaType||"image/png");return z5A.set(H.id,$),$}function GDH(H){if(H.type!=="image")return null;try{c99();let $=QPI(H.id,H.mediaType||"image/png");return iL($,H.content,{encoding:"base64",flush:!0,mode:384}),z5A.set(H.id,$),N(`Stored image ${H.id} to ${$}`),$}catch($){return N(`Failed to store image: ${$}`),null}}function WPI(H){let $=new Map;for(let[A,L]of Object.entries(H))if(L.type==="image"){let I=GDH(L);if(I)$.set(Number(A),I)}return $}function V4$(H){return z5A.get(H)??null}async function VPI(){let H=zH(),$=MDH.join(UL(),JPI),A=j$();try{let L;try{L=await H.readdir($)}catch{return}for(let I of L){if(I.name===A)continue;let D=MDH.join($,I.name);try{await H.rm(D,{recursive:!0,force:!0}),N(`Cleaned up old image cache: ${D}`)}catch{}}try{if((await H.readdir($)).length===0)await H.rmdir($)}catch{}}catch{}}var MDH,JPI="image-cache",z5A;var gr=K(()=>{NA();g$();DL();E$();Z$();MDH=require("path"),z5A=new Map});function P4$({imageId:H,backgroundColor:$,isSelected:A=!1}){let L=V4$(H),I=`[Image #${H}]`;if(L&&e2()){let D=PPI.pathToFileURL(L).href;return ug.createElement(dI,{url:D,fallback:ug.createElement(V,{backgroundColor:$,inverse:A},I)},ug.createElement(V,{backgroundColor:$,inverse:A,bold:A},I))}return ug.createElement(V,{backgroundColor:$,inverse:A},I)}var ug,PPI;var N5A=K(()=>{xH();rJH();gr();jr();ug=b(s(),1),PPI=require("url")});function s$({shortcut:H,action:$,parens:A=!1,bold:L=!1}){let I=L?_4$.default.createElement(fJ,{bold:!0},H):H;if(A)return _4$.default.createElement(fJ,null,"(",I," to ",$,")");return _4$.default.createElement(fJ,null,I," to ",$)}var _4$;var lB=K(()=>{i5H();_4$=b(s(),1)});function VA({action:H,context:$,fallback:A,description:L,parens:I,bold:D}){let B=C0(H,$,A);return O5A.createElement(s$,{shortcut:B,action:L,parens:I,bold:D})}var O5A;var j0=K(()=>{lB();FG();O5A=b(s(),1)});function rA({children:H}){let $=$v.Children.toArray(H);if($.length===0)return null;return $v.default.createElement($v.default.Fragment,null,$.map((A,L)=>$v.default.createElement($v.default.Fragment,{key:$v.isValidElement(A)?A.key??L:L},L>0&&$v.default.createElement(V,{dimColor:!0}," \xB7 "),A)))}var $v;var eB=K(()=>{xH();$v=b(s(),1)});function UFH({option:H,isFocused:$,isSelected:A,shouldShowDownArrow:L,shouldShowUpArrow:I,maxIndexWidth:D,index:B,inputValue:f,onInputChange:E,onSubmit:M,onExit:G,layout:U,children:X,showLabel:J=!1,onOpenEditor:F,resetCursorOnUpdate:Q=!1,onImagePaste:W,pastedContents:P,onRemoveImage:C,imagesSelected:Y,selectedImageIndex:Z=0,onImagesSelectedChange:q,onSelectedImageIndexChange:O}){let j=P?Object.values(P).filter((p)=>p.type==="image"):[],u=J||H.showLabelWithValue===!0,[y,g]=Gf.useState(f.length);Gf.useEffect(()=>{if(Q&&$)g(f.length)},[Q,$,f]),BA("chat:externalEditor",()=>{F?.(f,E)},{context:"Chat",isActive:$&&!!F}),BA("chat:imagePaste",()=>{if(!W)return;MFH().then((p)=>{if(p)W(p.base64,p.mediaType,void 0,p.dimensions)})},{context:"Chat",isActive:$&&!!W}),BA("attachments:remove",()=>{if(j.length>0&&C)C(j[j.length-1].id)},{context:"Attachments",isActive:$&&!Y&&f===""&&j.length>0&&!!C}),bI({"attachments:next":()=>{if(j.length>1)O?.((Z+1)%j.length)},"attachments:previous":()=>{if(j.length>1)O?.((Z-1+j.length)%j.length)},"attachments:remove":()=>{let p=j[Z];if(p&&C)if(C(p.id),j.length<=1)q?.(!1);else O?.(Math.min(Z,j.length-2))},"attachments:exit":()=>{q?.(!1)}},{context:"Attachments",isActive:$&&!!Y}),WL((p,d)=>{if(d.upArrow)q?.(!1)},{isActive:$&&!!Y}),Gf.useEffect(()=>{if(!$&&Y)q?.(!1)},[$,Y,q]);let h=U==="expanded"?D+3:D+4;return Gf.default.createElement(x,{flexDirection:"column",flexShrink:0},Gf.default.createElement(ur,{isFocused:$,isSelected:A,shouldShowDownArrow:L,shouldShowUpArrow:I},Gf.default.createElement(x,{flexDirection:"row",flexShrink:U==="compact"?0:void 0},Gf.default.createElement(V,{dimColor:!0},`${B}.`.padEnd(D+2)),X,u?Gf.default.createElement(Gf.default.Fragment,null,Gf.default.createElement(V,{color:$?"suggestion":void 0},H.label),$?Gf.default.createElement(Gf.default.Fragment,null,Gf.default.createElement(V,{color:"suggestion"},H.labelValueSeparator??", "),Gf.default.createElement(W9,{value:f,onChange:(p)=>{E(p),H.onChange(p)},onSubmit:M,onExit:G,placeholder:H.placeholder,focus:!Y,showCursor:!0,cursorOffset:y,onChangeCursorOffset:g,columns:80,onImagePaste:W,onPaste:(p)=>{let d=f.slice(0,y),k=f.slice(y),n=d+p+k;E(n),H.onChange(n),g(d.length+p.length)}})):f&&Gf.default.createElement(V,null,H.labelValueSeparator??", ",f)):$?Gf.default.createElement(W9,{value:f,onChange:(p)=>{E(p),H.onChange(p)},onSubmit:M,onExit:G,placeholder:H.placeholder||(typeof H.label==="string"?H.label:void 0),focus:!Y,showCursor:!0,cursorOffset:y,onChangeCursorOffset:g,columns:80,onImagePaste:W,onPaste:(p)=>{let d=f.slice(0,y),k=f.slice(y),n=d+p+k;E(n),H.onChange(n),g(d.length+p.length)}}):Gf.default.createElement(V,{color:f?void 0:"inactive"},f||H.placeholder||H.label))),H.description&&Gf.default.createElement(x,{paddingLeft:h},Gf.default.createElement(V,{dimColor:H.dimDescription!==!1,color:A?"success":$?"suggestion":void 0},H.description)),j.length>0&&Gf.default.createElement(x,{flexDirection:"row",gap:1,paddingLeft:h},j.map((p,d)=>Gf.default.createElement(P4$,{key:p.id,imageId:p.id,isSelected:!!Y&&d===Z})),Gf.default.createElement(x,{flexGrow:1,justifyContent:"flex-start",flexDirection:"row"},Gf.default.createElement(V,{dimColor:!0},Y?Gf.default.createElement(rA,null,j.length>1&&Gf.default.createElement(Gf.default.Fragment,null,Gf.default.createElement(VA,{action:"attachments:next",context:"Attachments",fallback:"\u2192",description:"next"}),Gf.default.createElement(VA,{action:"attachments:previous",context:"Attachments",fallback:"\u2190",description:"prev"})),Gf.default.createElement(VA,{action:"attachments:remove",context:"Attachments",fallback:"backspace",description:"remove"}),Gf.default.createElement(VA,{action:"attachments:exit",context:"Attachments",fallback:"esc",description:"cancel"})):$?"(\u2193 to select)":null))),U==="expanded"&&Gf.default.createElement(V,null," "))}var Gf;var x5A=K(()=>{xH();G4$();S5();$I();ySH();N5A();j0();eB();Gf=b(s(),1)});function Y4$(H){if(typeof H==="string")return H;if(typeof H==="number")return String(H);if(!H)return"";if(Array.isArray(H))return H.map(Y4$).join("");if(jD.default.isValidElement(H))return Y4$(H.props.children);return""}function QA({isDisabled:H=!1,hideIndexes:$=!1,visibleOptionCount:A=5,highlightText:L,options:I,defaultValue:D,onCancel:B,onChange:f,onFocus:E,defaultFocusValue:M,layout:G="compact",disableSelection:U=!1,inlineDescriptions:X=!1,onUpFromFirstItem:J,onDownFromLastItem:F,onInputModeToggle:Q,onOpenEditor:W,onImagePaste:P,pastedContents:C,onRemoveImage:Y}){let[Z,q]=jD.useState(!1),[O,j]=jD.useState(0),[u,y]=jD.useState(()=>{let HH=new Map;return I.forEach((BH)=>{if(BH.type==="input"&&BH.initialValue)HH.set(BH.value,BH.initialValue)}),HH}),g=jD.useRef(new Map);jD.useEffect(()=>{for(let HH of I)if(HH.type==="input"&&HH.initialValue!==void 0){let BH=g.current.get(HH.value)??"",WH=u.get(HH.value)??"",wH=HH.initialValue;if(wH!==BH&&WH===BH)y((QH)=>{let TH=new Map(QH);return TH.set(HH.value,wH),TH});g.current.set(HH.value,wH)}},[I,u]);let h=tVI({visibleOptionCount:A,options:I,defaultValue:D,onChange:f,onCancel:B,onFocus:E,focusValue:M});IPI({isDisabled:H,disableSelection:U||($?"numeric":!1),state:h,options:I,isMultiSelect:!1,onUpFromFirstItem:J,onDownFromLastItem:F,onInputModeToggle:Q,inputValues:u,imagesSelected:Z,onEnterImageSelection:()=>{if(C&&Object.values(C).some((HH)=>HH.type==="image")){let HH=Object.values(C).filter((BH)=>BH.type==="image").length;return q(!0),j(HH-1),!0}return!1}});let p={container:()=>({flexDirection:"column"}),highlightedText:()=>({bold:!0})};if(G==="expanded"){let HH=h.options.length.toString().length;return jD.default.createElement(x,{...p.container()},h.visibleOptions.map((BH,WH)=>{let wH=BH.index===h.visibleFromIndex,QH=BH.index===h.visibleToIndex-1,TH=h.visibleToIndex0,IH=h.visibleFromIndex+WH+1,KH=!H&&h.focusedValue===BH.value,MH=h.value===BH.value;if(BH.type==="input"){let e=u.has(BH.value)?u.get(BH.value):BH.initialValue||"";return jD.default.createElement(UFH,{key:String(BH.value),option:BH,isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH,maxIndexWidth:HH,index:IH,inputValue:e,onInputChange:(DH)=>{y((EH)=>{let $H=new Map(EH);return $H.set(BH.value,DH),$H})},onSubmit:(DH)=>{let EH=C&&Object.values(C).some(($H)=>$H.type==="image");if(DH.trim()||EH||BH.allowEmptySubmitToCancel)f?.(BH.value);else B?.()},onExit:B,layout:"expanded",showLabel:X,onOpenEditor:W,resetCursorOnUpdate:BH.resetCursorOnUpdate,onImagePaste:P,pastedContents:C,onRemoveImage:Y,imagesSelected:Z,selectedImageIndex:O,onImagesSelectedChange:q,onSelectedImageIndexChange:j})}let CH=BH.label;if(typeof BH.label==="string"&&L&&BH.label.includes(L)){let e=BH.label,DH=e.indexOf(L);CH=jD.default.createElement(jD.default.Fragment,null,e.slice(0,DH),jD.default.createElement(V,{...p.highlightedText()},L),e.slice(DH+L.length))}let OH=BH.disabled===!0,LH=OH?void 0:MH?"success":KH?"suggestion":void 0;return jD.default.createElement(x,{key:String(BH.value),flexDirection:"column",flexShrink:0},jD.default.createElement(ur,{isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH},jD.default.createElement(V,{dimColor:OH,color:LH},CH)),BH.description&&jD.default.createElement(x,{paddingLeft:2},jD.default.createElement(V,{dimColor:OH||BH.dimDescription!==!1,color:LH},jD.default.createElement(m9,null,BH.description))),jD.default.createElement(V,null," "))}))}if(G==="compact-vertical"){let HH=$?0:h.options.length.toString().length;return jD.default.createElement(x,{...p.container()},h.visibleOptions.map((BH,WH)=>{let wH=BH.index===h.visibleFromIndex,QH=BH.index===h.visibleToIndex-1,TH=h.visibleToIndex0,IH=h.visibleFromIndex+WH+1,KH=!H&&h.focusedValue===BH.value,MH=h.value===BH.value;if(BH.type==="input"){let LH=u.has(BH.value)?u.get(BH.value):BH.initialValue||"";return jD.default.createElement(UFH,{key:String(BH.value),option:BH,isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH,maxIndexWidth:HH,index:IH,inputValue:LH,onInputChange:(e)=>{y((DH)=>{let EH=new Map(DH);return EH.set(BH.value,e),EH})},onSubmit:(e)=>{let DH=C&&Object.values(C).some((EH)=>EH.type==="image");if(e.trim()||DH||BH.allowEmptySubmitToCancel)f?.(BH.value);else B?.()},onExit:B,layout:"compact",showLabel:X,onOpenEditor:W,resetCursorOnUpdate:BH.resetCursorOnUpdate,onImagePaste:P,pastedContents:C,onRemoveImage:Y,imagesSelected:Z,selectedImageIndex:O,onImagesSelectedChange:q,onSelectedImageIndexChange:j})}let CH=BH.label;if(typeof BH.label==="string"&&L&&BH.label.includes(L)){let LH=BH.label,e=LH.indexOf(L);CH=jD.default.createElement(jD.default.Fragment,null,LH.slice(0,e),jD.default.createElement(V,{...p.highlightedText()},L),LH.slice(e+L.length))}let OH=BH.disabled===!0;return jD.default.createElement(x,{key:String(BH.value),flexDirection:"column",flexShrink:0},jD.default.createElement(ur,{isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH},jD.default.createElement(jD.default.Fragment,null,!$&&jD.default.createElement(V,{dimColor:!0},`${IH}.`.padEnd(HH+1)),jD.default.createElement(V,{dimColor:OH,color:OH?void 0:MH?"success":KH?"suggestion":void 0},CH))),BH.description&&jD.default.createElement(x,{paddingLeft:$?2:HH+4},jD.default.createElement(V,{dimColor:OH||BH.dimDescription!==!1,color:OH?void 0:MH?"success":KH?"suggestion":void 0},jD.default.createElement(m9,null,BH.description))))}))}let d=$?0:h.options.length.toString().length,k=h.visibleOptions.some((HH)=>HH.type==="input"),n=!X&&!k&&h.visibleOptions.some((HH)=>HH.description),GH=h.visibleOptions.map((HH,BH)=>{let WH=HH.index===h.visibleFromIndex,wH=HH.index===h.visibleToIndex-1,QH=h.visibleToIndex0,t=h.visibleFromIndex+BH+1,IH=!H&&h.focusedValue===HH.value,KH=h.value===HH.value,MH=HH.disabled===!0,CH=HH.label;if(typeof HH.label==="string"&&L&&HH.label.includes(L)){let OH=HH.label,LH=OH.indexOf(L);CH=jD.default.createElement(jD.default.Fragment,null,OH.slice(0,LH),jD.default.createElement(V,{...p.highlightedText()},L),OH.slice(LH+L.length))}return{option:HH,index:t,label:CH,isFocused:IH,isSelected:KH,isOptionDisabled:MH,shouldShowDownArrow:QH&&wH,shouldShowUpArrow:TH&&WH}});if(n){let HH=Math.max(...GH.map((BH)=>{if(BH.option.type==="input")return 0;let WH=Y4$(BH.option.label),wH=$?0:d+2,QH=BH.isSelected?2:0;return 2+wH+GI(WH)+QH}));return jD.default.createElement(x,{...p.container()},GH.map((BH)=>{if(BH.option.type==="input")return null;let WH=Y4$(BH.option.label),wH=$?0:d+2,QH=BH.isSelected?2:0,TH=2+wH+GI(WH)+QH,t=HH-TH;return jD.default.createElement(x,{key:String(BH.option.value),flexDirection:"row"},jD.default.createElement(x,{flexDirection:"row",flexShrink:0},BH.isFocused?jD.default.createElement(V,{color:"suggestion"},pH.pointer):BH.shouldShowDownArrow?jD.default.createElement(V,{dimColor:!0},pH.arrowDown):BH.shouldShowUpArrow?jD.default.createElement(V,{dimColor:!0},pH.arrowUp):jD.default.createElement(V,null," "),jD.default.createElement(V,null," "),jD.default.createElement(V,{dimColor:BH.isOptionDisabled,color:BH.isOptionDisabled?void 0:BH.isSelected?"success":BH.isFocused?"suggestion":void 0},!$&&jD.default.createElement(V,{dimColor:!0},`${BH.index}.`.padEnd(d+2)),BH.label),BH.isSelected&&jD.default.createElement(V,{color:"success"}," ",pH.tick),t>0&&jD.default.createElement(V,null," ".repeat(t))),jD.default.createElement(x,{flexGrow:1,marginLeft:2},jD.default.createElement(V,{wrap:"wrap",dimColor:BH.isOptionDisabled||BH.option.dimDescription!==!1,color:BH.isOptionDisabled?void 0:BH.isSelected?"success":BH.isFocused?"suggestion":void 0},jD.default.createElement(m9,null,BH.option.description||" "))))}))}return jD.default.createElement(x,{...p.container()},h.visibleOptions.map((HH,BH)=>{if(HH.type==="input"){let OH=u.has(HH.value)?u.get(HH.value):HH.initialValue||"",LH=HH.index===h.visibleFromIndex,e=HH.index===h.visibleToIndex-1,DH=h.visibleToIndex0,$H=h.visibleFromIndex+BH+1,FH=!H&&h.focusedValue===HH.value,YH=h.value===HH.value;return jD.default.createElement(UFH,{key:String(HH.value),option:HH,isFocused:FH,isSelected:YH,shouldShowDownArrow:DH&&e,shouldShowUpArrow:EH&&LH,maxIndexWidth:d,index:$H,inputValue:OH,onInputChange:(qH)=>{y((bH)=>{let hH=new Map(bH);return hH.set(HH.value,qH),hH})},onSubmit:(qH)=>{let bH=C&&Object.values(C).some((hH)=>hH.type==="image");if(qH.trim()||bH||HH.allowEmptySubmitToCancel)f?.(HH.value);else B?.()},onExit:B,layout:"compact",showLabel:X,onOpenEditor:W,resetCursorOnUpdate:HH.resetCursorOnUpdate,onImagePaste:P,pastedContents:C,onRemoveImage:Y,imagesSelected:Z,selectedImageIndex:O,onImagesSelectedChange:q,onSelectedImageIndexChange:j})}let WH=HH.label;if(typeof HH.label==="string"&&L&&HH.label.includes(L)){let OH=HH.label,LH=OH.indexOf(L);WH=jD.default.createElement(jD.default.Fragment,null,OH.slice(0,LH),jD.default.createElement(V,{...p.highlightedText()},L),OH.slice(LH+L.length))}let wH=HH.index===h.visibleFromIndex,QH=HH.index===h.visibleToIndex-1,TH=h.visibleToIndex0,IH=h.visibleFromIndex+BH+1,KH=!H&&h.focusedValue===HH.value,MH=h.value===HH.value,CH=HH.disabled===!0;return jD.default.createElement(ur,{key:String(HH.value),isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH},jD.default.createElement(x,{flexDirection:"row",flexShrink:0},!$&&jD.default.createElement(V,{dimColor:!0},`${IH}.`.padEnd(d+2)),jD.default.createElement(V,{dimColor:CH,color:CH?void 0:MH?"success":KH?"suggestion":void 0},WH,X&&HH.description&&jD.default.createElement(V,{dimColor:CH||HH.dimDescription!==!1}," ",HH.description))),!X&&HH.description&&jD.default.createElement(x,{flexShrink:99,marginLeft:2},jD.default.createElement(V,{wrap:"wrap-trim",dimColor:CH||HH.dimDescription!==!1,color:CH?void 0:MH?"success":KH?"suggestion":void 0},jD.default.createElement(m9,null,HH.description))))}))}var jD;var N1=K(()=>{xH();G4$();sVI();DPI();jI();x5A();DJ();jD=b(s(),1)});function C4$({ruleValue:H}){switch(H.toolName){case aD.name:if(H.ruleContent)if(H.ruleContent.endsWith(":*"))return LP.createElement(V,{dimColor:!0},"Any Bash command starting with"," ",LP.createElement(V,{bold:!0},H.ruleContent.slice(0,-2)));else return LP.createElement(V,{dimColor:!0},"The Bash command ",LP.createElement(V,{bold:!0},H.ruleContent));else return LP.createElement(V,{dimColor:!0},"Any Bash command");default:if(!H.ruleContent)return LP.createElement(V,{dimColor:!0},"Any use of the ",LP.createElement(V,{bold:!0},H.toolName)," tool");else return null}}var LP;var S5A=K(()=>{xH();zQ();LP=b(s(),1)});function l99({orientation:H="horizontal",width:$="auto",dividerChar:A,dividerColor:L,dividerDimColor:I=!0,boxProps:D}){let B=H==="vertical",f=A||(B?"\u2502":"\u2500");if(B)return gg.default.createElement(x,{height:"100%",borderStyle:{topLeft:"",top:"",topRight:"",right:f,bottomRight:"",bottom:"",bottomLeft:"",left:""},borderColor:L,borderDimColor:I,borderBottom:!1,borderTop:!1,borderLeft:!1,borderRight:!0,...D});return gg.default.createElement(x,{width:$,borderStyle:{topLeft:"",top:"",topRight:"",right:"",bottomRight:"",bottom:f,bottomLeft:"",left:""},borderColor:L,borderDimColor:I,flexGrow:1,borderBottom:!0,borderTop:!1,borderLeft:!1,borderRight:!1,...D})}function i99({orientation:H="horizontal",title:$,width:A="auto",padding:L=0,titlePadding:I=1,titleColor:D="text",titleDimColor:B=!0,dividerChar:f,dividerColor:E,dividerDimColor:M=!0,boxProps:G}){let U=H==="vertical",J=gg.default.createElement(l99,{orientation:H,dividerChar:f||(U?"\u2502":"\u2500"),dividerColor:E,dividerDimColor:M,boxProps:G});if(U)return J;if(!$)return gg.default.createElement(x,{paddingLeft:L,paddingRight:L},J);return gg.default.createElement(x,{flexDirection:"row",width:A,paddingLeft:L,paddingRight:L,gap:I},J,gg.default.createElement(x,null,gg.default.createElement(V,{color:D,dimColor:B},gg.default.createElement(m9,null,$))),J)}var gg,Uf;var e6=K(()=>{xH();gg=b(s(),1);Uf=i99});function BL({title:H,subtitle:$,children:A,onCancel:L,color:I,borderDimColor:D,hideInputGuide:B,hideBorder:f,inputGuide:E,isCancelActive:M}){return H3.default.createElement(n99,{title:H,subtitle:$,onCancel:L,color:I,borderDimColor:D,hideInputGuide:B,hideBorder:f,inputGuide:E,isCancelActive:M},A)}function n99({title:H,subtitle:$,children:A,onCancel:L,color:I="permission",borderDimColor:D=!0,hideInputGuide:B,hideBorder:f,inputGuide:E,isCancelActive:M=!0}){let G=zB();BA("confirm:no",L,{context:"Confirmation",isActive:M});let U=G.pending?H3.default.createElement(V,null,"Press ",G.keyName," again to exit"):H3.default.createElement(rA,null,H3.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),H3.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}));return H3.default.createElement(H3.default.Fragment,null,H3.default.createElement(x,{flexDirection:"column",paddingBottom:1},!f&&H3.default.createElement(Uf,{dividerColor:I,dividerDimColor:D}),H3.default.createElement(x,{flexDirection:"column",paddingX:f?0:1,gap:1},H3.default.createElement(x,{flexDirection:"column"},H3.default.createElement(V,{bold:!0,color:I},H),$&&H3.default.createElement(V,{dimColor:!0},$)),A)),!B&&H3.default.createElement(x,{paddingX:f?0:1},H3.default.createElement(V,{dimColor:!0,italic:!0},E?E(G):U)))}var H3;var bB=K(()=>{xH();UM();e6();lB();j0();eB();$I();H3=b(s(),1)});function r99(H){return H==="projectSettings"||H==="policySettings"||H==="command"}function w4$(H){return vSH(H)}function _PI(H,$,A){let L=w4$($.source),I=w4$(A.source),D=$.ruleValue.toolName;if(H==="deny")return`Remove the "${D}" deny rule from ${L}, or remove the specific allow rule from ${I}`;return`Remove the "${D}" ask rule from ${L}, or remove the specific allow rule from ${I}`}function a99(H,$,A){let{toolName:L,ruleContent:I}=H.ruleValue;if(I===void 0)return{shadowed:!1};let D=$.find((B)=>B.ruleValue.toolName===L&&B.ruleValue.ruleContent===void 0);if(!D)return{shadowed:!1};if(L===WD&&A.sandboxAutoAllowEnabled){if(!r99(D.source))return{shadowed:!1}}return{shadowed:!0,shadowedBy:D,shadowType:"ask"}}function o99(H,$){let{toolName:A,ruleContent:L}=H.ruleValue;if(L===void 0)return{shadowed:!1};let I=$.find((D)=>D.ruleValue.toolName===A&&D.ruleValue.ruleContent===void 0);if(!I)return{shadowed:!1};return{shadowed:!0,shadowedBy:I,shadowType:"deny"}}function XFH(H,$){let A=[],L=JFH(H),I=FFH(H),D=mg(H);for(let B of L){let f=o99(B,D);if(f.shadowed){let M=w4$(f.shadowedBy.source);A.push({rule:B,reason:`Blocked by "${f.shadowedBy.ruleValue.toolName}" deny rule (from ${M})`,shadowedBy:f.shadowedBy,shadowType:"deny",fix:_PI("deny",f.shadowedBy,B)});continue}let E=a99(B,I,$);if(E.shadowed){let M=w4$(E.shadowedBy.source);A.push({rule:B,reason:`Shadowed by "${E.shadowedBy.ruleValue.toolName}" ask rule (from ${M})`,shadowedBy:E.shadowedBy,shadowType:"ask",fix:_PI("ask",E.shadowedBy,B)})}}return A}var Z4$=K(()=>{XJ()});function j5A(H){switch(H){case"localSettings":return{label:"Project settings (local)",description:`Saved in ${B4H("localSettings")}`,value:H};case"projectSettings":return{label:"Project settings",description:`Checked in at ${B4H("projectSettings")}`,value:H};case"userSettings":return{label:"User settings",description:"Saved in at ~/.claude/settings.json",value:H}}}function CPI({onAddRules:H,onCancel:$,ruleValues:A,ruleBehavior:L,initialContext:I,setToolPermissionContext:D}){let B=KFH.map(j5A),f=YPI.useCallback((M)=>{if(M==="cancel"){$();return}else if(KFH.includes(M)){let G=M,U=OM(I,{type:"addRules",rules:A,behavior:L,destination:G});eR({type:"addRules",rules:A,behavior:L,destination:G}),D(U);let X=A.map((W)=>({ruleValue:W,ruleBehavior:L,source:G})),J=vL.isSandboxingEnabled()&&vL.isAutoAllowBashIfSandboxedEnabled(),Q=XFH(U,{sandboxAutoAllowEnabled:J}).filter((W)=>A.some((P)=>P.toolName===W.rule.ruleValue.toolName&&P.ruleContent===W.rule.ruleValue.ruleContent));H(X,Q.length>0?Q:void 0)}},[H,$,A,L,I,D]),E=`Add ${L} permission rule${A.length===1?"":"s"}`;return f7.createElement(BL,{title:E,onCancel:$,color:"permission"},f7.createElement(x,{flexDirection:"column",paddingX:2},A.map((M)=>f7.createElement(x,{flexDirection:"column",key:X8(M)},f7.createElement(V,{bold:!0},X8(M)),f7.createElement(C4$,{ruleValue:M})))),f7.createElement(x,{flexDirection:"column",marginY:1},f7.createElement(V,null,A.length===1?"Where should this rule be saved?":"Where should these rules be saved?"),f7.createElement(QA,{options:B,onChange:f})))}var f7,YPI,KFH;var q4$=K(()=>{xH();N1();C5();C5();S5A();mL();bB();Z4$();EM();f7=b(s(),1),YPI=b(s(),1);KFH=["localSettings","projectSettings","userSettings"]});function T4$(H,$,A,L,I,D,B){ZPI(H,$,A,L,I,D,B)}function z4$(H,$,A,L,I,D,B){let f=B?.id||`function-hook-${Date.now()}-${Math.random()}`,E={type:"function",id:f,timeout:B?.timeout||5000,callback:I,errorMessage:D};return ZPI(H,$,A,L,E),f}function ZPI(H,$,A,L,I,D,B){H((f)=>{let E=f.sessionHooks[$]||{hooks:{}},M=E.hooks[A]||[],G=M.findIndex((J)=>J.matcher===L&&J.skillRoot===B),U;if(G>=0){U=[...M];let J=U[G];U[G]={matcher:J.matcher,skillRoot:J.skillRoot,hooks:[...J.hooks,{hook:I,onHookSuccess:D}]}}else U=[...M,{matcher:L,skillRoot:B,hooks:[{hook:I,onHookSuccess:D}]}];let X={...E.hooks,[A]:U};return{...f,sessionHooks:{...f.sessionHooks,[$]:{hooks:X}}}}),N(`Added session hook for event ${A} in session ${$}`)}function qPI(H,$,A,L){H((I)=>{let D=I.sessionHooks[$];if(!D)return I;let f=(D.hooks[A]||[]).map((M)=>{let G=M.hooks.filter((U)=>!WFH(U.hook,L));return G.length>0?{...M,hooks:G}:null}).filter((M)=>M!==null),E=f.length>0?{...D.hooks,[A]:f}:{...D.hooks};if(f.length===0)delete E[A];return{...I,sessionHooks:{...I.sessionHooks,[$]:{...D,hooks:E}}}}),N(`Removed session hook for event ${A} in session ${$}`)}function wPI(H){return H.map(($)=>({matcher:$.matcher,skillRoot:$.skillRoot,hooks:$.hooks.map((A)=>A.hook).filter((A)=>A.type!=="function")}))}function N4$(H,$,A){let L=H.sessionHooks[$];if(!L)return new Map;let I=new Map;if(A){let D=L.hooks[A];if(D)I.set(A,wPI(D));return I}for(let D of TR){let B=L.hooks[D];if(B)I.set(D,wPI(B))}return I}function TPI(H,$,A){let L=H.sessionHooks[$];if(!L)return new Map;let I=new Map,D=(B)=>{return B.map((f)=>({matcher:f.matcher,hooks:f.hooks.map((E)=>E.hook).filter((E)=>E.type==="function")})).filter((f)=>f.hooks.length>0)};if(A){let B=L.hooks[A];if(B){let f=D(B);if(f.length>0)I.set(A,f)}return I}for(let B of TR){let f=L.hooks[B];if(f){let E=D(f);if(E.length>0)I.set(B,E)}}return I}function zPI(H,$,A,L,I){let D=H.sessionHooks[$];if(!D)return;let B=D.hooks[A];if(!B)return;for(let f of B)if(f.matcher===L||L===""){let E=f.hooks.find((M)=>WFH(M.hook,I));if(E)return E}return}function QFH(H,$){H((A)=>{let L={...A.sessionHooks};return delete L[$],{...A,sessionHooks:L}}),N(`Cleared all session hooks for session ${$}`)}var pg=K(()=>{KGH();E$();Av()});function WFH(H,$){if(H.type!==$.type)return!1;switch(H.type){case"command":return $.type==="command"&&H.command===$.command;case"prompt":return $.type==="prompt"&&H.prompt===$.prompt;case"agent":return $.type==="agent"&&H.prompt===$.prompt;case"function":return!1}}function IP(H){if("statusMessage"in H&&H.statusMessage)return H.statusMessage;switch(H.type){case"command":return H.command;case"prompt":return H.prompt;case"agent":return H.prompt([]);case"callback":return"callback";case"function":return"function"}}function OPI(H){let $=[];if(ZI("policySettings")?.allowManagedHooksOnly!==!0){let B=["userSettings","projectSettings","localSettings"],f=new Set;for(let E of B){let M=aM(E);if(M){let U=NPI.resolve(M);if(f.has(U))continue;f.add(U)}let G=ZI(E);if(!G?.hooks)continue;for(let[U,X]of Object.entries(G.hooks))for(let J of X)for(let F of J.hooks)$.push({event:U,config:F,matcher:J.matcher,source:E})}}let I=j$(),D=N4$(H,I);for(let[B,f]of D.entries())for(let E of f)for(let M of E.hooks)$.push({event:B,config:M,matcher:E.matcher,source:"sessionHook"});return $}async function xPI(H,$,A="",L="userSettings"){let D=(ZI(L)??{}).hooks??{},B=D[H]??[],f=B.findIndex((U)=>U.matcher===A),E;if(f>=0){E=[...B];let U=E[f];E[f]={matcher:U.matcher,hooks:[...U.hooks,$]}}else E=[...B,{matcher:A,hooks:[$]}];let M={...D,[H]:E},{error:G}=II(L,{hooks:M});if(G)throw Error(G.message);UDH()}async function SPI(H){if(H.source==="pluginHook")throw Error("Plugin hooks cannot be removed through settings. Disable the plugin instead.");if(H.source==="sessionHook")throw Error("Session hooks cannot be removed through settings. They are temporary and will be cleared when the session ends.");let $=ZI(H.source)??{},A=$.hooks??{},I=(A[H.event]??[]).map((f)=>{if(f.matcher===H.matcher){let E=f.hooks.filter((M)=>!WFH(M,H.config));return E.length>0?{...f,hooks:E}:null}return f}).filter((f)=>f!==null),D={...A,[H.event]:I.length>0?I:void 0},B=Object.values(D).some((f)=>f!==void 0);II(H.source,{...$,hooks:B?D:void 0}),UDH()}function jPI(H){switch(H){case"userSettings":return"User settings (~/.claude/settings.json)";case"projectSettings":return"Project settings (.claude/settings.json)";case"localSettings":return"Local settings (.claude/settings.local.json)";case"pluginHook":return"Plugin hooks (~/.claude/plugins/*/hooks/hooks.json)";case"sessionHook":return"Session hooks (in-memory, temporary)";default:return H}}function R5A(H){switch(H){case"userSettings":return"User Settings";case"projectSettings":return"Project Settings";case"localSettings":return"Local Settings";case"pluginHook":return"Plugin Hooks";case"sessionHook":return"Session Hooks";default:return H}}function RPI(H){switch(H){case"userSettings":return"User";case"projectSettings":return"Project";case"localSettings":return"Local";case"pluginHook":return"Plugin";case"sessionHook":return"Session";default:return H}}function yPI(H,$,A){let L=KFH.reduce((I,D,B)=>{return I[D]=B,I},{});return[...H].sort((I,D)=>{let B=$[A]?.[I]||[],f=$[A]?.[D]||[],E=Array.from(new Set(B.map((J)=>J.source))),M=Array.from(new Set(f.map((J)=>J.source))),G=(J)=>J==="pluginHook"?999:L[J],U=Math.min(...E.map(G)),X=Math.min(...M.map(G));if(U!==X)return U-X;return I.localeCompare(D)})}var NPI;var Av=K(()=>{mL();q4$();XDH();pg();g$();NPI=require("path")});function y5A(){let H=ZI("policySettings");if(H?.allowManagedHooksOnly===!0)return H.hooks??{};return VL().hooks??{}}function dg(){return ZI("policySettings")?.allowManagedHooksOnly===!0}function v5A(H){if(!H)return null;let $={},A=Object.keys(H).sort();for(let L of A){let I=H[L];if(!I)continue;let D=[...I].sort((B,f)=>{let E=B.matcher||"",M=f.matcher||"";return E.localeCompare(M)});$[L]=D.map((B)=>({matcher:B.matcher,hooks:[...B.hooks].sort((f,E)=>IP(f).localeCompare(IP(E)))}))}return $}function h5A(){let H=y5A();mr=v5A(H)}function UDH(){E5();let H=y5A();mr=v5A(H)}function vPI(){if(mr===null)return null;let H=v5A(y5A()),$=yH(mr),A=yH(H);if($===A)return null;let L=[],I=new Set(Object.keys(mr||{})),D=new Set(Object.keys(H||{}));for(let B of D)if(!I.has(B))L.push(`Added hooks for event: ${B}`);for(let B of I)if(!D.has(B))L.push(`Removed all hooks for event: ${B}`);for(let B of I)if(D.has(B)){let f=mr?.[B]||[],E=H?.[B]||[];if(yH(f)!==yH(E)){let M=[],G=new Map(f.map((X)=>[X.matcher||"",X])),U=new Map(E.map((X)=>[X.matcher||"",X]));for(let[X]of U)if(!G.has(X))M.push(` - Added matcher: ${X||"(no matcher)"}`);for(let[X]of G)if(!U.has(X))M.push(` - Removed matcher: ${X||"(no matcher)"}`);for(let[X,J]of U)if(G.has(X)){let F=G.get(X);if(yH(F.hooks)!==yH(J.hooks))M.push(` - Modified hooks for matcher: ${X||"(no matcher)"}`)}if(M.length>0)L.push(`Modified hooks for event: ${B}`),L.push(...M);else L.push(`Modified hooks for event: ${B}`)}}return L.length>0?L.join(` `):"Hooks configuration has been modified"}function hPI(){if(mr===null)h5A();return mr}var mr=null;var XDH=K(()=>{mL();Av();g$();Z$()});function O4$(H,$){E5();let A=GB();N(`Settings changed from ${H}, updating app state`);let L=jB$();UDH(),$((I)=>{let D=bPI(I.toolPermissionContext,L);if(D.isBypassPermissionsModeAvailable&&VFH())D=PFH(D);return{...I,settings:A,toolPermissionContext:D}})}var b5A=K(()=>{mL();E$();XJ();_q();cg();XDH()});var kPI=()=>{};function uPI(){return _FH===!0}function e99(){return process.env.CLAUDE_CODE_ENTRYPOINT??"cli"}function x4$(){return{fileStates:new Map,sessionBaselines:new Map,surface:e99(),startingHeadSha:null,promptCount:0,promptCountAtLastCommit:0,permissionPromptCount:0,permissionPromptCountAtLastCommit:0,escapeCount:0,escapeCountAtLastCommit:0}}var t99,_FH=null,s99;var JDH=K(()=>{g$();DL();E$();_$();kPI();B0();aI();t8();j$H();t99=["github.com:anthropics/claude-cli-internal","github.com/anthropics/claude-cli-internal","github.com:anthropics/anthropic","github.com/anthropics/anthropic","github.com:anthropics/apps","github.com/anthropics/apps","github.com:anthropics/terraform-config","github.com/anthropics/terraform-config","github.com:anthropics/hex-export","github.com/anthropics/hex-export","github.com:anthropics/feedback-v2","github.com/anthropics/feedback-v2"];s99=rR(async()=>{if(_FH!==null)return _FH;let H=zL(),$=await asH(H);if(!$)return _FH=!1,!1;return _FH=t99.some((A)=>$.includes(A)),_FH})});class k5A{queue=[];waiters=[];listeners=new Set;_revision=0;get length(){return this.queue.length}get revision(){return this._revision}send(H){this._revision++;let $=this.waiters.findIndex((A)=>A.fn(H));if($!==-1){let A=this.waiters.splice($,1)[0];if(A){A.resolve(H),this.notify();return}}this.queue.push(H),this.notify()}poll(H=()=>!0){let $=this.queue.findIndex(H);if($===-1)return;return this.queue.splice($,1)[0]}receive(H=()=>!0){let $=this.queue.findIndex(H);if($!==-1){let A=this.queue.splice($,1)[0];if(A)return this.notify(),Promise.resolve(A)}return new Promise((A)=>{this.waiters.push({fn:H,resolve:A})})}subscribe(H){return this.listeners.add(H),()=>{this.listeners.delete(H)}}notify(){for(let H of this.listeners)H()}}function mPI({children:H}){let $=pr.useMemo(()=>new k5A,[]);return pr.default.createElement(gPI.Provider,{value:$},H)}function pPI(){let H=pr.useContext(gPI);if(!H)throw Error("useMailbox must be used within a MailboxProvider");return H}var pr,gPI;var u5A=K(()=>{pr=b(s(),1),gPI=pr.createContext(void 0)});function lg(H,$){if(process.env.MAX_THINKING_TOKENS){let I=parseInt(process.env.MAX_THINKING_TOKENS,10);if(I>0)c("tengu_thinking",{provider:SR(),tokenCount:I});return I}let L=H.filter((I)=>I.type==="user"&&!I.isMeta).map(H19).filter((I)=>I!==void 0);if($!==void 0)return Math.max(...L,$);if(L.length>0)return Math.max(...L);return}function H19(H){if(H.isMeta)return 0;if(H.thinkingMetadata){let{maxThinkingTokens:$}=H.thinkingMetadata;if($!==void 0&&$>0)c("tengu_thinking",{provider:SR(),tokenCount:$});return $}return 0}function dPI(H){let $=[],A=H.matchAll($19);for(let L of A)if(L.index!==void 0)$.push({word:L[0],start:L.index,end:L.index+L[0].length});return $}function A19(H){let $=H.toLowerCase(),A=sI();if(A==="foundry"||A==="firstParty")return!$.includes("claude-3-");return $.includes("sonnet-4")||$.includes("opus-4")}function cPI(H){return H.toLowerCase().includes("opus-4-6")}function S4$(){if(process.env.MAX_THINKING_TOKENS)return parseInt(process.env.MAX_THINKING_TOKENS,10)>0;let{settings:H}=ZAH();if(H.alwaysThinkingEnabled===!1)return!1;return A19(X1())}var $19;var ig=K(()=>{z$();oM();mL();aI();$19=/\bultrathink\b/gi});function g5A(){return!1}async function L19(H,$,A){if(!g5A())return await A();let L=hSH.createHash("sha1").update(yH(H)).digest("hex").slice(0,12),I=dr.join(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT??C$(),`fixtures/${$}-${L}.json`);if(zH().existsSync(I))return DA(zH().readFileSync(I,{encoding:"utf8"}));if(OA.isCI)throw Error(`Fixture missing: ${I}. Re-run npm test locally, then commit the result.`);let D=await A();if(!zH().existsSync(dr.dirname(I)))zH().mkdirSync(dr.dirname(I));return iL(I,yH(D,null,2),{encoding:"utf8",flush:!1}),D}async function R4$(H,$){if(!g5A())return await $();let A=JJ(H.filter((B)=>{if(B.type!=="user")return!0;if(B.isMeta)return!1;return!0})),L=D19(A.map((B)=>B.message.content),iPI),I=dr.join(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT??C$(),`fixtures/${L.map((B)=>hSH.createHash("sha1").update(yH(B)).digest("hex").slice(0,6)).join("-")}.json`);if(zH().existsSync(I)){let B=DA(zH().readFileSync(I,{encoding:"utf8"}));return B.output.forEach(I19),B.output.map((f,E)=>lPI(f,f19,E,hSH.randomUUID()))}if(OA.isCI)throw Error(`Anthropic API fixture missing: ${I}. Re-run npm test locally, then commit the result. Input messages: `);if($)A.pop();else A.push(A.pop().slice(0,-1));return A}var P_I;var Y_I=K(()=>{m4$();P_I={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0}});var qFH=K(()=>{A_I();f_I();m4$();U_I();J_I();K_I();W_I();V_I();Y_I()});function C19(){let $="";for(let A=0;A<4;A++)$+="abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(Math.random()*36)];return`/tmp/claude/cache-break-${$}.diff`}function z19(H){return H.includes("haiku")}function l4$(H,$){if($)return $;if(H==="compact")return"repl_main_thread";for(let A of w19)if(H.startsWith(A))return H;return null}function C_I(H){return H.map(($)=>{if(!("cache_control"in $))return $;let{cache_control:A,...L}=$;return L})}function w_I(H){let $=yH(H);if(typeof Bun<"u"){let L=Bun.hash($);return typeof L==="bigint"?Number(L&0xffffffffn):L}let A=0;for(let L=0;L<$.length;L++)A=(A<<5)-A+$.charCodeAt(L)|0;return A}function N19(H){let $=0;for(let A of H)$+=A.text.length;return $}function O19(H,$,A){let L=H.map((D)=>D.text).join(` `}function Z_I(H,$,A,L,I){try{let D=l4$(A,I);if(!D)return;let B=C_I(H),f=C_I($),E=w_I(B),M=w_I(f),G=$.map((P)=>("name"in P)?P.name:"unknown"),U=N19(H),X=O19(H,$,L),J=TFH.get(D);if(!J){TFH.set(D,{systemHash:E,toolsHash:M,toolNames:G,systemCharCount:U,model:L,callCount:1,pendingChanges:null,prevCacheReadTokens:null,microcompacted:!1,diffableContent:X});return}J.callCount++;let F=E!==J.systemHash,Q=M!==J.toolsHash,W=L!==J.model;if(F||Q||W){let P=new Set(J.toolNames),C=new Set(G);J.pendingChanges={systemPromptChanged:F,toolSchemasChanged:Q,modelChanged:W,addedToolCount:G.filter((Y)=>!P.has(Y)).length,removedToolCount:J.toolNames.filter((Y)=>!C.has(Y)).length,systemCharDelta:U-J.systemCharCount,previousModel:J.model,newModel:L,prevDiffableContent:J.diffableContent}}else J.pendingChanges=null;J.systemHash=E,J.toolsHash=M,J.toolNames=G,J.systemCharCount=U,J.model=L,J.diffableContent=X}catch(D){r(D instanceof Error?D:Error(String(D)))}}function q_I(H,$,A,L,I){try{let D=l4$(H,I);if(!D)return;let B=TFH.get(D);if(!B)return;if(z19(B.model))return;let f=B.prevCacheReadTokens;B.prevCacheReadTokens=$;let E=L.findLast((Y)=>Y.type==="assistant"),M=E?Date.now()-new Date(E.timestamp).getTime():null;if(f===null)return;let G=B.pendingChanges,U=f-$;if($>=f*0.95||U0?` (+${Y} chars)`:` (${Y} chars)`;X.push(`system prompt changed${Z}`)}if(G.toolSchemasChanged){let Y=G.addedToolCount>0||G.removedToolCount>0?` (+${G.addedToolCount}/-${G.removedToolCount} tools)`:" (tool prompt/schema changed, same tool set)";X.push(`tools changed${Y}`)}}let F=M!==null&&M>q19,Q=M!==null&&M>T19,P=`[PROMPT CACHE BREAK] ${X.length>0?X.join(", "):"unknown cause"} [source=${H}, call #${B.callCount}, cache read: ${f} \u2192 ${$}, creation: ${A}]`;N(P,{level:"warn"}),c("tengu_prompt_cache_break",{systemPromptChanged:G?.systemPromptChanged??!1,toolSchemasChanged:G?.toolSchemasChanged??!1,modelChanged:G?.modelChanged??!1,microcompacted:J,addedToolCount:G?.addedToolCount??0,removedToolCount:G?.removedToolCount??0,callNumber:B.callCount,prevCacheReadTokens:f,cacheReadTokens:$,cacheCreationTokens:A,timeSinceLastAssistantMsg:M??-1,lastAssistantMsgOver5minAgo:F,lastAssistantMsgOver1hAgo:Q});let C;if(G?.prevDiffableContent)C=x19(G.prevDiffableContent,B.diffableContent);Tj$(P,C),B.pendingChanges=null}catch(D){r(D instanceof Error?D:Error(String(D)))}}function T_I(H,$){let A=l4$(H,$),L=A?TFH.get(A):void 0;if(L)L.microcompacted=!0}function e5A(H,$){let A=l4$(H,$),L=A?TFH.get(A):void 0;if(L)L.prevCacheReadTokens=null}function z_I(){TFH.clear()}function x19(H,$){try{let A=C19();c4$.mkdirSync("/tmp/claude",{recursive:!0});let L=s5A("prompt-state",H,$,"before","after");return c4$.writeFileSync(A,L),A}catch{return}}var c4$,TFH,w19,Z19=2000,q19=300000,T19=3600000;var gSH=K(()=>{E$();z$();g$();Z$();_$();qFH();c4$=require("fs");TFH=new Map,w19=["repl_main_thread","sdk","agent:custom","agent:default","agent:builtin"]});function N_I(H){let $=`Your task is to create a detailed summary of the RECENT portion of the conversation \u2014 the messages that follow earlier retained context. The earlier messages are being kept intact and do NOT need to be summarized. Focus your summary on what was discussed, learned, and accomplished in the recent messages only. Please continue the conversation from where we left it off without asking the user any further questions. Continue with the last task that you were asked to work on.`;return D}function j19(H,$){return H?.includes("_staging_")===!0||$?.includes("staging")===!0}function R19(H,$){return j19(H,$)?"https://staging.claude.ai":"https://claude.ai"}function i4$(H,$){return`${R19(H,$)}/code/${H}`}var O_I="https://claude.com/claude-code";function QL(){let H=x_I.useContext(r5H);if(!H)throw Error("useTerminalSize must be used within an Ink App component");return H}var x_I;var OB=K(()=>{y1$();x_I=b(s(),1)});function S_I({children:H,lock:$="always"}){let[A,{isVisible:L}]=vg(),{rows:I}=QL(),D=XT.useRef(null),B=XT.useRef(0),[f,E]=XT.useState(0),M=XT.useCallback((U)=>{A(U)},[A]),G=$==="always"||!L;return XT.useLayoutEffect(()=>{if(!D.current)return;let{height:U}=ZSH(D.current);if(U>B.current)B.current=Math.min(U,I),E(B.current)}),XT.default.createElement(x,{minHeight:G?f:void 0,ref:M},XT.default.createElement(x,{ref:D,flexDirection:"column"},H))}var XT;var j_I=K(()=>{xH();OB();dU$();XT=b(s(),1)});function HA({children:H,height:$}){if(R_I.useContext(y_I))return H;let L=Lw.createElement(y19,null,Lw.createElement(x,{flexDirection:"row",height:$,overflowY:"hidden"},Lw.createElement(V,null," ","\u23BF \xA0"),H));if($!==void 0)return L;return Lw.createElement(S_I,{lock:"offscreen"},L)}function y19({children:H}){return Lw.createElement(y_I.Provider,{value:!0},H)}var Lw,R_I,y_I;var iB=K(()=>{xH();j_I();Lw=b(s(),1),R_I=b(s(),1);y_I=Lw.createContext(!1)});function Iv(){return Lv.createElement(Lv.Fragment,null,Lv.createElement(V,{dimColor:!0},"Interrupted "),Lv.createElement(V,{dimColor:!0},"\xB7 What should Claude do instead?"))}var Lv;var zFH=K(()=>{xH();Lv=b(s(),1)});function L8(){return pSH.createElement(HA,{height:1},pSH.createElement(Iv,null))}var pSH;var _F=K(()=>{iB();zFH();pSH=b(s(),1)});function dSH({children:H}){return FDH.default.createElement(v_I.Provider,{value:!0},H)}function Bx(){let H=FDH.useContext(v_I),$=C0("app:toggleTranscript","Global","ctrl+o");if(H)return null;return FDH.default.createElement(V,{dimColor:!0},FDH.default.createElement(s$,{shortcut:$,action:"expand",parens:!0}))}function h_I(){let H=CQ("app:toggleTranscript","Global","ctrl+o");return oH.dim(`(${H} to expand)`)}var FDH,v_I;var lr=K(()=>{xH();r0();lB();FG();FDH=b(s(),1),v_I=FDH.default.createContext(!1)});function LXA(H,$){if(A$(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))return;let A=$?`${H} ${$}`:"";process.stdout.write(`\x1B]0;${A}\x07`)}function cSH(H){if(r4$=H,!NFH)LXA(AXA,H)}function u_I(H){k_I=!0,cSH(H)}function g_I(){cSH("Claude Code")}function m_I(){return r4$}function p_I(){if(NFH)return;n4$=0,NFH=setInterval(()=>{n4$=(n4$+1)%b_I.length,LXA(b_I[n4$]??AXA,r4$)},v19)}function d_I(){if(NFH)clearInterval(NFH),NFH=null}function c_I(){if(IXA=!0,ANH()!=="blurred")p_I()}function lSH(){IXA=!1,d_I(),LXA(AXA,r4$)}async function l_I(H){if(A$(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))return;if(k_I)return;if(H.startsWith(`<${hMH}>`))return;try{let A=(await OQ({systemPrompt:["Analyze if this message indicates a new conversation topic. If it does, extract a 2-3 word title that captures the new topic. Format your response as a JSON object with two fields: 'isNewTopic' (boolean) and 'title' (string, or null if isNewTopic is false)."],userPrompt:H,outputFormat:{type:"json_schema",schema:{type:"object",properties:{isNewTopic:{type:"boolean"},title:{anyOf:[{type:"string"},{type:"null"}]}},required:["isNewTopic","title"],additionalProperties:!1}},signal:new AbortController().signal,options:{querySource:"terminal_update_title",agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content.filter((I)=>I.type==="text").map((I)=>I.text).join(""),L=q1(A);if(L&&typeof L==="object"&&"isNewTopic"in L&&"title"in L){if(L.isNewTopic&&L.title)cSH(L.title)}}catch($){r($)}}function ir(){return new Promise((H)=>{process.stdout.write(VNH(),()=>{H()})})}function b19(H,$){let A=H.split(` `).filter(Boolean).map((I)=>parseInt(I,10)).filter((I)=>!isNaN(I))}function SZI(H){try{let A=`ps -o command= -p ${String(H)}`,L=vN(A,{timeout:1000});return L?L.trim():null}catch{return null}}async function jZI(H,$=10){let A=`currentpid=${String(H)}; for i in $(seq 1 ${$}); do cmd=$(ps -o command= -p $currentpid 2>/dev/null); if [ -n "$cmd" ]; then printf '%s\\0' "$cmd"; fi; ppid=$(ps -o ppid= -p $currentpid 2>/dev/null | tr -d ' '); if [ -z "$ppid" ] || [ "$ppid" = "0" ] || [ "$ppid" = "1" ]; then break; fi; currentpid=$ppid; done`,L=await pD("sh",["-c",A],{timeout:3000});if(L.code!==0||!L.stdout?.trim())return[];return L.stdout.split("\x00").filter(Boolean)}var TX$=K(()=>{B0()});function m59(H){let $=ijH.homedir(),A=[],L=yZI[H.toLowerCase()];if(!L)return A;let I=process.env.APPDATA||SQ.join($,"AppData","Roaming"),D=process.env.LOCALAPPDATA||SQ.join($,"AppData","Local");switch(ijH.platform()){case"darwin":if(A.push(SQ.join($,"Library","Application Support","JetBrains"),SQ.join($,"Library","Application Support")),H.toLowerCase()==="androidstudio")A.push(SQ.join($,"Library","Application Support","Google"));break;case"win32":if(A.push(SQ.join(I,"JetBrains"),SQ.join(D,"JetBrains"),SQ.join(I)),H.toLowerCase()==="androidstudio")A.push(SQ.join(D,"Google"));break;case"linux":A.push(SQ.join($,".config","JetBrains"),SQ.join($,".local","share","JetBrains"));for(let B of L)A.push(SQ.join($,"."+B));if(H.toLowerCase()==="androidstudio")A.push(SQ.join($,".config","Google"));break;default:break}return A}function p59(H){let $=[],A=zH(),L=m59(H),I=yZI[H.toLowerCase()];if(!I)return $;for(let D of L){if(!A.existsSync(D))continue;for(let B of I)try{let f=new RegExp("^"+B+".*$"),E=A.readdirSync(D).filter((M)=>f.test(M.name)&&A.statSync(SQ.join(D,M.name)).isDirectory()).map((M)=>SQ.join(D,M.name));for(let M of E){let G=ijH.platform()==="linux"?M:SQ.join(M,"plugins");if(A.existsSync(G))$.push(G)}}catch{continue}}return $.filter((D,B)=>$.indexOf(D)===B)}function VKA(H){let $=p59(H);for(let A of $){let L=SQ.join(A,g59);if(zH().existsSync(L))return!0}return!1}function vZI(H,$=!1){if($)RZI.cache.delete(H);return RZI(H)}var SQ,ijH,g59="claude-code-jetbrains-plugin",yZI,RZI;var PKA=K(()=>{DL();tD();SQ=b(require("path")),ijH=b(require("os")),yZI={pycharm:["PyCharm"],intellij:["IntelliJIdea","IdeaIC"],webstorm:["WebStorm"],phpstorm:["PhpStorm"],rubymine:["RubyMine"],clion:["CLion"],goland:["GoLand"],rider:["Rider"],datagrip:["DataGrip"],appcode:["AppCode"],dataspell:["DataSpell"],aqua:["Aqua"],gateway:["Gateway"],fleet:["Fleet"],androidstudio:["AndroidStudio"]};RZI=o$(VKA)});async function hZI(){if(JKH!==void 0)return JKH;try{let H=await jZI(process.pid,10);for(let $ of H){let A=$.toLowerCase();for(let L of ab$)if(A.includes(L))return JKH=L,L}}catch{}return JKH=null,null}async function n59(){if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(OA.platform!=="darwin")return await hZI()||"pycharm"}return OA.terminal}function r59(){if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(OA.platform!=="darwin"){if(JKH!==void 0)return JKH||"pycharm";return"pycharm"}}return OA.terminal}async function _KA(){if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")await hZI()}var c59,l59=()=>{return process.env.CLAUDE_CODE_BUBBLEWRAP==="1"},i59,JKH,YY;var Ma=K(()=>{B0();TX$();tD();DL();Z1();c59=o$(async()=>{let{code:H}=await jA("test",["-f","/.dockerenv"]);if(H!==0)return!1;return!0}),i59=o$(()=>{let H="x86_64";return zH().existsSync(`/lib/libc.musl-${H}.so.1`)});YY={...OA,terminal:r59(),getIsDocker:c59,getIsBubblewrapSandbox:l59,isMuslEnvironment:i59,getTerminalWithJetBrainsDetectionAsync:n59,initJetBrainsDetection:_KA}});function bZI({onDone:H,installationStatus:$}){a59(),bI({"confirm:yes":H,"confirm:no":H},{context:"Confirmation"});let A=$?.ideType??FKH(),L=Wx(A),I=PX(A),D=$?.installedVersion,B=L?"plugin":"extension",f=OA.platform==="darwin"?"Cmd+Option+K":"Ctrl+Alt+K";return KJ.default.createElement(KJ.default.Fragment,null,KJ.default.createElement(BL,{title:KJ.default.createElement(KJ.default.Fragment,null,KJ.default.createElement(V,{color:"claude"},"\u273B "),KJ.default.createElement(V,null,"Welcome to Claude Code for ",I)),subtitle:D?`installed ${B} v${D}`:void 0,color:"ide",onCancel:H,hideInputGuide:!0},KJ.default.createElement(x,{flexDirection:"column",gap:1},KJ.default.createElement(V,null,"\u2022 Claude has context of ",KJ.default.createElement(V,{color:"suggestion"},"\u29C9 open files")," ","and ",KJ.default.createElement(V,{color:"suggestion"},"\u29C9 selected lines")),KJ.default.createElement(V,null,"\u2022 Review Claude Code's changes"," ",KJ.default.createElement(V,{color:"diffAddedWord"},"+11")," ",KJ.default.createElement(V,{color:"diffRemovedWord"},"-22")," in the comfort of your IDE"),KJ.default.createElement(V,null,"\u2022 Cmd+Esc",KJ.default.createElement(V,{dimColor:!0}," for Quick Launch")),KJ.default.createElement(V,null,"\u2022 ",f,KJ.default.createElement(V,{dimColor:!0}," to reference files or lines in your input")))),KJ.default.createElement(x,{paddingX:1},KJ.default.createElement(V,{dimColor:!0,italic:!0},"Press Enter to continue")))}function zX$(){let H=M$(),$=YY.terminal||"unknown";return H.hasIdeOnboardingBeenShown?.[$]===!0}function a59(){if(zX$())return;let H=YY.terminal||"unknown";AA(($)=>({...$,hasIdeOnboardingBeenShown:{...$.hasIdeOnboardingBeenShown,[H]:!0}}))}var KJ;var YKA=K(()=>{xH();nU();Z1();$I();vA();Ma();bB();KJ=b(s(),1)});class KKH{wslDistroName;constructor(H){this.wslDistroName=H}toLocalPath(H){if(!H)return H;if(this.wslDistroName){let $=H.match(/^\\\\wsl(?:\.localhost|\$)\\([^\\]+)(.*)$/);if($&&$[1]!==this.wslDistroName)return H}try{return CKA.execFileSync("wslpath",["-u",H],{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim()}catch{return H.replace(/\\/g,"/").replace(/^([A-Z]):/i,($,A)=>`/mnt/${A.toLowerCase()}`)}}toIDEPath(H){if(!H)return H;try{return CKA.execFileSync("wslpath",["-w",H],{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim()}catch{return H}}}function kZI(H,$){let A=H.match(/^\\\\wsl(?:\.localhost|\$)\\([^\\]+)(.*)$/);if(A)return A[1]===$;return!0}var CKA;var wKA=K(()=>{CKA=require("child_process")});function iZI(H){try{return process.kill(H,0),!0}catch{return!1}}async function o59(H){if(!iZI(H))return!1;if(!ZF())return!0;if(process.ppid===H)return!0;return(await xZI(process.ppid,10)).includes(H)}function OX$(H){if(!H)return!1;let $=QKH[H];return $&&$.ideKind==="vscode"}function Wx(H){if(!H)return!1;let $=QKH[H];return $&&$.ideKind==="jetbrains"}function FKH(){if(!ZF())return null;return OA.terminal}function xX$(){try{return t59().flatMap((A)=>{try{return zH().readdirSync(A).filter((L)=>L.name.endsWith(".lock")).map((L)=>{let I=B3.join(A,L.name);return{path:I,mtime:zH().statSync(I).mtime}})}catch(L){return r(L),[]}}).sort((A,L)=>L.mtime.getTime()-A.mtime.getTime()).map((A)=>A.path)}catch(H){return r(H),[]}}function nZI(H){try{let $=zH().readFileSync(H,{encoding:"utf-8"}),A=[],L,I,D=!1,B=!1,f;try{let G=DA($);if(G.workspaceFolders)A=G.workspaceFolders;L=G.pid,I=G.ideName,D=G.transport==="ws",B=G.runningInWindows===!0,f=G.authToken}catch(G){A=$.split(` `).map((U)=>U.trim())}let E=H.split(B3.sep).pop();if(!E)return null;let M=E.replace(".lock","");return{workspaceFolders:A,port:parseInt(M),pid:L,ideName:I,useWebSocket:D,runningInWindows:B,authToken:f}}catch($){return r($),null}}async function ZKA(H,$,A=500){try{return new Promise((L)=>{let I=lZI.createConnection({host:H,port:$,timeout:A});I.on("connect",()=>{I.destroy(),L(!0)}),I.on("error",()=>{L(!1)}),I.on("timeout",()=>{I.destroy(),L(!1)})})}catch(L){return!1}}function t59(){let H=[],$=zH(),A=oA(),L=B3.join(UL(),"ide");if($.existsSync(L))H.push(L);if(A!=="wsl")return H;let I=process.env.USERPROFILE;if(!I)try{let D=vN("powershell.exe -Command '$env:USERPROFILE'");if(D)I=D.trim()}catch{N("Unable to get Windows USERPROFILE via PowerShell - IDE detection may be incomplete")}if(I){let B=new KKH(process.env.WSL_DISTRO_NAME).toLocalPath(I),f=B3.resolve(B,".claude","ide");if($.existsSync(f))H.push(f)}try{if($.existsSync("/mnt/c/Users")){let B=$.readdirSync("/mnt/c/Users");for(let f of B){if(f.name==="Public"||f.name==="Default"||f.name==="Default User"||f.name==="All Users")continue;let E=B3.join("/mnt/c/Users",f.name,".claude","ide");if($.existsSync(E))H.push(E)}}}catch(D){r(D instanceof Error?D:Error(String(D)))}return H}async function s59(){try{let H=xX$();for(let $ of H){let A=nZI($);if(!A){try{zH().unlinkSync($)}catch(D){r(D)}continue}let L=await AqI(A.runningInWindows,A.port),I=!1;if(A.pid){if(!iZI(A.pid)){if(oA()!=="wsl")I=!0;else if(!await ZKA(L,A.port))I=!0}}else if(!await ZKA(L,A.port))I=!0;if(I)try{zH().unlinkSync($)}catch(D){r(D)}}}catch(H){r(H)}}async function HX9(H){try{let $=await AX9(H);if(c("tengu_ext_installed",{}),!M$().diffTool)AA((L)=>({...L,diffTool:"auto"}));return{installed:!0,error:null,installedVersion:$,ideType:H}}catch($){c("tengu_ext_install_error",{});let A=$ instanceof Error?$.message:String($);return r($),{installed:!1,error:A,installedVersion:null,ideType:H}}}async function uZI(){if(NX$)NX$.abort();NX$=nD();let H=NX$.signal;await s59();let $=Date.now();while(Date.now()-$<30000&&!H.aborted){let A=await ajH(!1);if(H.aborted)return null;if(A.length===1)return A[0];await new Promise((L)=>setTimeout(L,1000))}return null}async function ajH(H){let $=[];try{let A=process.env.CLAUDE_CODE_SSE_PORT,L=A?parseInt(A):null,I=zL(),D=xX$();for(let B of D){let f=nZI(B);if(!f)continue;if(oA()!=="wsl"&&ZF()){if(!(f.pid?await o59(f.pid):!1))continue}let E=!1;if(process.env.CLAUDE_CODE_IDE_SKIP_VALID_CHECK==="true")E=!0;else if(f.port===L)E=!0;else E=f.workspaceFolders.some((X)=>{if(!X)return!1;let J=X;if(oA()==="wsl"&&f.runningInWindows&&process.env.WSL_DISTRO_NAME){if(!kZI(X,process.env.WSL_DISTRO_NAME))return!1;let Q=B3.resolve(J);if(I===Q||I.startsWith(Q+B3.sep))return!0;J=new KKH(process.env.WSL_DISTRO_NAME).toLocalPath(X)}let F=B3.resolve(J);if(oA()==="windows"){let Q=I.replace(/^[a-zA-Z]:/,(P)=>P.toUpperCase()),W=F.replace(/^[a-zA-Z]:/,(P)=>P.toUpperCase());return Q===W||Q.startsWith(W+B3.sep)}return I===F||I.startsWith(F+B3.sep)});if(!E&&!H)continue;let M=f.ideName??(ZF()?PX(YY.terminal):"IDE"),G=await AqI(f.runningInWindows,f.port),U;if(f.useWebSocket)U=`ws://${G}:${f.port}`;else U=`http://${G}:${f.port}/sse`;$.push({url:U,name:M,workspaceFolders:f.workspaceFolders,port:f.port,isValid:E,authToken:f.authToken,ideRunningInWindows:f.runningInWindows})}if(!H&&L){let B=$.filter((f)=>f.isValid&&f.port===L);if(B.length===1)return B}}catch(A){r(A)}return $}async function rZI(H){await H.notification({method:"ide_connected",params:{pid:process.pid}})}function SX$(H){return H.some(($)=>$.type==="connected"&&$.name==="ide")}async function gZI(H){if(OX$(H)){let $=aZI(H);if($)try{if((await pD($,["--list-extensions"],{env:TKA()})).stdout?.includes($X9))return!0}catch{}}else if(Wx(H))return VKA(H);return!1}async function AX9(H){if(OX$(H)){let $=aZI(H);if($){let A=await LX9($);if(!A||dZI.lt(A,mZI())){await new Promise((I)=>{setTimeout(I,500)});let L=await pD($,["--force","--install-extension","anthropic.claude-code"],{env:TKA()});if(L.code!==0)throw Error(`${L.code}: ${L.error} ${L.stderr}`);A=mZI()}return A}}return null}function TKA(){if(oA()==="linux")return{...process.env,DISPLAY:""};return}function mZI(){return{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}async function LX9(H){let{stdout:$}=await jA(H,["--list-extensions","--show-versions"],{env:TKA()}),A=$?.split(` `)||[];for(let L of A){let[I,D]=L.split("@");if(I==="anthropic.claude-code"&&D)return D}return null}function IX9(){try{if(oA()!=="macos")return null;let $=process.ppid;for(let A=0;A<10;A++){if(!$||$===0||$===1)break;let L=vN(`ps -o command= -p ${$}`)?.trim();if(L){let D={"Visual Studio Code.app":"code","Cursor.app":"cursor","Windsurf.app":"windsurf","Visual Studio Code - Insiders.app":"code","VSCodium.app":"codium"},B="/Contents/MacOS/Electron";for(let[f,E]of Object.entries(D)){let M=L.indexOf(f+"/Contents/MacOS/Electron");if(M!==-1){let G=M+f.length;return L.substring(0,G)+"/Contents/Resources/app/bin/"+E}}}let I=vN(`ps -o ppid= -p ${$}`)?.trim();if(!I)break;$=parseInt(I.trim())}return null}catch{return null}}function aZI(H){let $=IX9();if($){if(zH().existsSync($))return $}switch(H){case"vscode":return"code";case"cursor":return"cursor";case"windsurf":return"windsurf";default:break}return null}async function oZI(){return(await jA("cursor",["--version"])).code===0}async function tZI(){return(await jA("windsurf",["--version"])).code===0}async function sZI(){let H=await jA("code",["--help"]);return H.code===0&&Boolean(H.stdout?.includes("Visual Studio Code"))}async function DX9(){let H=[];try{let $=oA();if($==="macos"){let L=(await fE('ps aux | grep -E "Visual Studio Code|Code Helper|Cursor Helper|Windsurf Helper|IntelliJ IDEA|PyCharm|WebStorm|PhpStorm|RubyMine|CLion|GoLand|Rider|DataGrip|AppCode|DataSpell|Aqua|Gateway|Fleet|Android Studio" | grep -v grep',{shell:!0,reject:!1})).stdout??"";for(let[I,D]of Object.entries(QKH))for(let B of D.processKeywordsMac)if(L.includes(B)){H.push(I);break}}else if($==="windows"){let I=((await fE('tasklist | findstr /I "Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe"',{shell:!0,reject:!1})).stdout??"").toLowerCase();for(let[D,B]of Object.entries(QKH))for(let f of B.processKeywordsWindows)if(I.includes(f.toLowerCase())){H.push(D);break}}else if($==="linux"){let I=((await fE('ps aux | grep -E "code|cursor|windsurf|idea|pycharm|webstorm|phpstorm|rubymine|clion|goland|rider|datagrip|dataspell|aqua|gateway|fleet|android-studio" | grep -v grep',{shell:!0,reject:!1})).stdout??"").toLowerCase();for(let[D,B]of Object.entries(QKH))for(let f of B.processKeywordsLinux)if(I.includes(f)){if(D!=="vscode"){H.push(D);break}else if(!I.includes("cursor")&&!I.includes("appcode")){H.push(D);break}}}}catch($){r($)}return H}async function zKA(){let H=await DX9();return qKA=H,H}async function eZI(){if(qKA===null)return zKA();return qKA}function jX$(H){let $=H.find((A)=>A.type==="connected"&&A.name==="ide");return NKA($)}function NKA(H){let $=H?.config;return $?.type==="sse-ide"||$?.type==="ws-ide"?$.ideName:ZF()?PX(YY.terminal):null}function PX(H){if(!H)return"IDE";let $=QKH[H];if($)return $.displayName;let A=pZI[H.toLowerCase().trim()];if(A)return A;let L=H.split(" ")[0],I=L?B3.basename(L).toLowerCase():null;if(I){let D=pZI[I];if(D)return D;return Fk(I)}return Fk(H)}function CY(H){if(!H)return;let $=H.find((A)=>A.type==="connected"&&A.name==="ide");return $?.type==="connected"?$:void 0}async function HqI(H){try{await Vx("closeAllDiffTabs",{},H)}catch($){}}async function $qI(H,$,A,L){uZI().then(H);let I=M$().autoInstallIdeExtension??!0;if(process.env.CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL!=="true"&&I){let D=$??FKH();if(D){if(OX$(D))gZI(D).then(async(B)=>{HX9(D).catch((f)=>{return{installed:!1,error:f.message||"Installation failed",installedVersion:null,ideType:D}}).then((f)=>{if(L(f),f?.installed)uZI().then(H);if(!B&&f?.installed===!0&&!zX$())A()})});else if(Wx(D)&&!zX$())gZI(D).then(async(B)=>{if(B)A()})}}}var dZI,B3,cZI,lZI,QKH,njH,rjH,ZF,e59,YBE,NX$=null,$X9="anthropic.claude-code",qKA=null,pZI,AqI;var nU=K(()=>{Z1();NA();TX$();B0();O_();vA();z$();eYH();tD();g$();DL();_$();Z9();f3();PKA();YKA();wKA();E$();eE();Ma();Z$();dZI=b(OO(),1),B3=require("path"),cZI=require("url"),lZI=require("net");QKH={cursor:{ideKind:"vscode",displayName:"Cursor",processKeywordsMac:["Cursor Helper","Cursor.app"],processKeywordsWindows:["cursor.exe"],processKeywordsLinux:["cursor"]},windsurf:{ideKind:"vscode",displayName:"Windsurf",processKeywordsMac:["Windsurf Helper","Windsurf.app"],processKeywordsWindows:["windsurf.exe"],processKeywordsLinux:["windsurf"]},vscode:{ideKind:"vscode",displayName:"VS Code",processKeywordsMac:["Visual Studio Code","Code Helper"],processKeywordsWindows:["code.exe"],processKeywordsLinux:["code"]},intellij:{ideKind:"jetbrains",displayName:"IntelliJ IDEA",processKeywordsMac:["IntelliJ IDEA"],processKeywordsWindows:["idea64.exe"],processKeywordsLinux:["idea","intellij"]},pycharm:{ideKind:"jetbrains",displayName:"PyCharm",processKeywordsMac:["PyCharm"],processKeywordsWindows:["pycharm64.exe"],processKeywordsLinux:["pycharm"]},webstorm:{ideKind:"jetbrains",displayName:"WebStorm",processKeywordsMac:["WebStorm"],processKeywordsWindows:["webstorm64.exe"],processKeywordsLinux:["webstorm"]},phpstorm:{ideKind:"jetbrains",displayName:"PhpStorm",processKeywordsMac:["PhpStorm"],processKeywordsWindows:["phpstorm64.exe"],processKeywordsLinux:["phpstorm"]},rubymine:{ideKind:"jetbrains",displayName:"RubyMine",processKeywordsMac:["RubyMine"],processKeywordsWindows:["rubymine64.exe"],processKeywordsLinux:["rubymine"]},clion:{ideKind:"jetbrains",displayName:"CLion",processKeywordsMac:["CLion"],processKeywordsWindows:["clion64.exe"],processKeywordsLinux:["clion"]},goland:{ideKind:"jetbrains",displayName:"GoLand",processKeywordsMac:["GoLand"],processKeywordsWindows:["goland64.exe"],processKeywordsLinux:["goland"]},rider:{ideKind:"jetbrains",displayName:"Rider",processKeywordsMac:["Rider"],processKeywordsWindows:["rider64.exe"],processKeywordsLinux:["rider"]},datagrip:{ideKind:"jetbrains",displayName:"DataGrip",processKeywordsMac:["DataGrip"],processKeywordsWindows:["datagrip64.exe"],processKeywordsLinux:["datagrip"]},appcode:{ideKind:"jetbrains",displayName:"AppCode",processKeywordsMac:["AppCode"],processKeywordsWindows:["appcode.exe"],processKeywordsLinux:["appcode"]},dataspell:{ideKind:"jetbrains",displayName:"DataSpell",processKeywordsMac:["DataSpell"],processKeywordsWindows:["dataspell64.exe"],processKeywordsLinux:["dataspell"]},aqua:{ideKind:"jetbrains",displayName:"Aqua",processKeywordsMac:[],processKeywordsWindows:["aqua64.exe"],processKeywordsLinux:[]},gateway:{ideKind:"jetbrains",displayName:"Gateway",processKeywordsMac:[],processKeywordsWindows:["gateway64.exe"],processKeywordsLinux:[]},fleet:{ideKind:"jetbrains",displayName:"Fleet",processKeywordsMac:[],processKeywordsWindows:["fleet.exe"],processKeywordsLinux:[]},androidstudio:{ideKind:"jetbrains",displayName:"Android Studio",processKeywordsMac:["Android Studio"],processKeywordsWindows:["studio64.exe"],processKeywordsLinux:["android-studio"]}};njH=o$(()=>{return OX$(OA.terminal)}),rjH=o$(()=>{return Wx(YY.terminal)}),ZF=o$(()=>{return njH()||rjH()||Boolean(process.env.FORCE_CODE_TERMINAL)});e59=cZI.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/ide.ts"),YBE=B3.resolve(e59,"../");pZI={code:"VS Code",cursor:"Cursor",windsurf:"Windsurf",antigravity:"Antigravity",vi:"Vim",vim:"Vim",nano:"nano",notepad:"Notepad","start /wait notepad":"Notepad",emacs:"Emacs",subl:"Sublime Text",atom:"Atom"};AqI=o$(async(H,$)=>{if(process.env.CLAUDE_CODE_IDE_HOST_OVERRIDE)return process.env.CLAUDE_CODE_IDE_HOST_OVERRIDE;if(oA()!=="wsl"||!H)return"127.0.0.1";try{let A=await fE("ip route show | grep -i default",{shell:!0,reject:!1});if(A.exitCode===0&&A.stdout){let L=A.stdout.match(/default via (\d+\.\d+\.\d+\.\d+)/);if(L){let I=L[1];if(await ZKA(I,$))return I}}}catch(A){}return"127.0.0.1"})});function BX9(){let H=Ij$();if(H!==void 0)return H;let $=process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(!$)return VHH(null),null;let A=parseInt($,10);if(Number.isNaN(A))return N(`CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${$}`,{level:"error"}),VHH(null),null;try{let L=zH(),I=`/proc/self/fd/${A}`,D=L.readFileSync(I,{encoding:"utf8"}).trim();if(!D)return N("File descriptor contained empty token",{level:"error"}),VHH(null),null;return N(`Successfully read token from file descriptor ${A}`),VHH(D),D}catch(L){return N(`Failed to read token from file descriptor ${A}: ${L instanceof Error?L.message:String(L)}`,{level:"error"}),VHH(null),null}}function wY(){let H=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN;if(H)return H;return BX9()}var Ga=K(()=>{E$();DL();g$()});function LqI(H){RX$=H}function OKA(){RX$=null}function IqI(){RX$?.()}function DqI(){return RX$!==null}var RX$=null;function fX9(H){let $=H,A="",L=0,I=10;while($!==A&&L=I)throw Error(`Unicode sanitization reached maximum iterations (${I}) for input: ${H.slice(0,100)}`);return $}function Ua(H){if(typeof H==="string")return fX9(H);if(Array.isArray(H))return H.map(Ua);if(H!==null&&typeof H==="object"){let $={};for(let[A,L]of Object.entries(H))$[Ua(A)]=Ua(L);return $}return H}function yX$(){return parseInt(process.env.MAX_MCP_OUTPUT_TOKENS??"25000",10)}function fqI(H){return H.type==="text"}function EqI(H){return H.type==="image"}function xKA(H){if(!H)return 0;if(typeof H==="string")return JE(H);return H.reduce(($,A)=>{if(fqI(A))return $+JE(A.text);else if(EqI(A))return $+BqI;return $},0)}function MX9(){return yX$()*4}function GX9(){return` `}var jKA=K(()=>{vV()});function RKA(){return GqI.getStore()}function WKH(H,$){return GqI.run(H,$)}function FX9(H){return H?.agentType==="subagent"}function UqI(){let H=RKA();if(!FX9(H)||!H.subagentName)return;return H.isBuiltIn?H.subagentName:"user-defined"}var MqI,GqI;var tjH=K(()=>{T8();MqI=require("async_hooks"),GqI=new MqI.AsyncLocalStorage});function nB(H){if(H.startsWith("mcp__"))return"mcp_tool";return H}function JqI(){return A$(process.env.OTEL_LOG_TOOL_DETAILS)}function Kv(){return A$(process.env.ANALYTICS_LOG_TOOL_DETAILS)}function Px(H){if(!H.startsWith("mcp__"))return;let $=H.split("__");if($.length<3)return;let A=$[1],L=$.slice(2).join("__");if(!A||!L)return;return{serverName:A,mcpToolName:L}}function FqI(H,$){if(H!=="Skill")return;if(typeof $==="object"&&$!==null&&"skill"in $&&typeof $.skill==="string")return $.skill;return}function sjH(H){let $=XqI.extname(H).toLowerCase();if(!$||$===".")return;let A=$.slice(1);if(A.length>WX9)return"other";return A}function KqI(H,$){if(!H.includes(".")&&!$)return;let A,L=new Set;if($){let I=sjH($);if(I)L.add(I),A=I}for(let I of H.split(PX9)){if(!I)continue;let D=I.split(_X9);if(D.length<2)continue;let B=D[0],f=B.lastIndexOf("/"),E=f>=0?B.slice(f+1):B;if(!VX9.has(E))continue;for(let M=1;M0?{betas:A.join(",")}:{},envContext:L,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(Mk()),clientType:kYH(),...I&&{processMetrics:I},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||"",sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||"",sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||"",...YX9(),...f0()&&{subscriptionType:f0()}}}function QqI(H,$={}){let{envContext:A,processMetrics:L,...I}=H;return{...$,...I,env:A,...L&&{process:L},surface:QX9}}function WqI(H,$,A={}){let{envContext:L,processMetrics:I,...D}=H,B={platform:L.platform,arch:L.arch,node_version:L.nodeVersion,terminal:L.terminal||"unknown",package_managers:L.packageManagers,runtimes:L.runtimes,is_running_with_bun:L.isRunningWithBun,is_ci:L.isCi,is_claubbit:L.isClaubbit,is_claude_code_remote:L.isClaudeCodeRemote,is_local_agent_mode:L.isLocalAgentMode,is_conductor:L.isConductor,is_github_action:L.isGithubAction,is_claude_code_action:L.isClaudeCodeAction,is_claude_ai_auth:L.isClaudeAiAuth,version:L.version,build_time:L.buildTime,deployment_environment:L.deploymentEnvironment};if(L.remoteEnvironmentType)B.remote_environment_type=L.remoteEnvironmentType;if(L.claudeCodeContainerId)B.claude_code_container_id=L.claudeCodeContainerId;if(L.claudeCodeRemoteSessionId)B.claude_code_remote_session_id=L.claudeCodeRemoteSessionId;if(L.tags)B.tags=L.tags.split(",").map((E)=>E.trim()).filter(Boolean);if(L.githubEventName)B.github_event_name=L.githubEventName;if(L.githubActionsRunnerEnvironment)B.github_actions_runner_environment=L.githubActionsRunnerEnvironment;if(L.githubActionsRunnerOs)B.github_actions_runner_os=L.githubActionsRunnerOs;if(L.githubActionRef)B.github_action_ref=L.githubActionRef;if(L.wslVersion)B.wsl_version=L.wslVersion;if(L.versionBase)B.version_base=L.versionBase;let f={session_id:D.sessionId,model:D.model,user_type:D.userType,is_interactive:D.isInteractive==="true",client_type:D.clientType};if(D.betas)f.betas=D.betas;if(D.entrypoint)f.entrypoint=D.entrypoint;if(D.agentSdkVersion)f.agent_sdk_version=D.agentSdkVersion;if(D.sweBenchRunId)f.swe_bench_run_id=D.sweBenchRunId;if(D.sweBenchInstanceId)f.swe_bench_instance_id=D.sweBenchInstanceId;if(D.sweBenchTaskId)f.swe_bench_task_id=D.sweBenchTaskId;if(D.agentId)f.agent_id=D.agentId;if(D.parentSessionId)f.parent_session_id=D.parentSessionId;if(D.agentType)f.agent_type=D.agentType;if(D.teamName)f.team_name=D.teamName;if($.githubActionsMetadata){let E=$.githubActionsMetadata;B.github_actions_metadata={actor_id:E.actorId,repository_id:E.repositoryId,repository_owner_id:E.repositoryOwnerId}}return{env:B,...I&&{process:yH(I)},core:f,additional:A}}var XqI,QX9="claude-code",WX9=10,VX9,PX9,_X9,CX9,wX9,kX$=null,yKA=null;var R4=K(()=>{tD();Z1();Ma();$q();aI();g$();NA();EI();Z9();tjH();Z$();XE();XqI=require("path");VX9=new Set(["rm","mv","cp","touch","mkdir","chmod","chown","cat","head","tail","sort","stat","diff","wc","grep","rg","sed"]),PX9=/\s*(?:&&|\|\||[;|])\s*/,_X9=/\s+/;CX9=o$(()=>{let H={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return H?H[0]:void 0}),wX9=o$(async()=>{let[H,$]=await Promise.all([OA.getPackageManagers(),OA.getRuntimes()]);return{platform:OA.platform,arch:OA.arch,nodeVersion:OA.nodeVersion,terminal:YY.terminal,packageManagers:H.join(","),runtimes:$.join(","),isRunningWithBun:OA.isRunningWithBun(),isCi:A$(!1),isClaubbit:A$(process.env.CLAUBBIT),isClaudeCodeRemote:A$(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT==="local-agent",isConductor:OA.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...{},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:A$(process.env.GITHUB_ACTIONS),isClaudeCodeAction:A$(process.env.CLAUDE_CODE_ACTION),isClaudeAiAuth:nL(),version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,versionBase:CX9(),buildTime:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.BUILD_TIME,deploymentEnvironment:OA.detectDeploymentEnvironment(),...A$(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes("claude-code-action/")?process.env.GITHUB_ACTION_PATH.split("claude-code-action/")[1]:void 0},...U$H()&&{wslVersion:U$H()}}})});function qX9(){return uX$.join(rU(zL()),j$())}function _KH(){return uX$.join(qX9(),vKA)}async function TX9(){try{await PKH.mkdir(_KH(),{recursive:!0})}catch{}}async function jDH(H,$){let A=Array.isArray(H);if(A){if(H.some((G)=>G.type!=="text"))return{error:"Cannot persist tool results containing non-text content"}}await TX9();let L=A?"json":"txt",I=uX$.join(_KH(),`${$}.${L}`),D=A?yH(H,null,2):H,B=!1;try{await PKH.stat(I),B=!0}catch{}if(!B){try{await PKH.writeFile(I,D,"utf-8")}catch(M){let G=M instanceof Error?M:Error(String(M));return r(G),{error:xX9(G)}}N(`Persisted tool result to ${I} (${GM(D.length)})`)}let{preview:f,hasMore:E}=OX9(D,VqI);return{filepath:I,originalSize:D.length,isJson:A,preview:f,hasMore:E}}function zX9(H){let $=`${gX$} `),I=L>$*0.5?L:$;return{preview:H.slice(0,I),hasMore:!0}}function RDH(H){return"error"in H}function xX9(H){let $=H;if($.code)switch($.code){case"ENOENT":return`Directory not found: ${$.path??"unknown path"}`;case"EACCES":return`Permission denied: ${$.path??"unknown path"}`;case"ENOSPC":return"No space left on device";case"EROFS":return"Read-only file system";case"EMFILE":return"Too many open files";case"EEXIST":return`File already exists: ${$.path??"unknown path"}`;default:return`${$.code}: ${$.message}`}return H.message}var uX$,PKH,vKA="tool-results",gX$="",hKA="",bKA="[Old tool result content cleared]",VqI=2000;var Bm=K(()=>{E$();_$();rD();z$();R4();g$();rB();Z$();uX$=require("path"),PKH=require("fs/promises")});function YKH(H){let $=[];return{expanded:H.replace(/\$\{([^}]+)\}/g,(L,I)=>{let[D,B]=I.split(":-",2),f=process.env[D];if(f!==void 0)return f;if(B!==void 0)return B;return $.push(D),L}),missingVars:$}}function jX9(){if(gYH())return PqI;if(A$(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return PqI;return SX9}function Dw(){return _qI.join(UL(),jX9())}var _qI,SX9="plugins",PqI="cowork_plugins";var ejH=K(()=>{NA();g$();_qI=require("path")});async function RX9(H){try{return!!await x_(H)}catch{return!1}}var pX$;var kKA=K(()=>{tD();Zk();pX$=o$(async()=>{return RX9("git")})});function CKH(H,$){let L=H.slice(0,2).map((B)=>{let f=B.reason||B.error||"unknown error";return $?`${B.name} (${f})`:B.name}).join($?"; ":", "),I=H.length-2,D=I>0?` and ${I} more`:"";return`${L}${D}`}function HRH(H){switch(H.source){case"github":return H.repo;case"url":return H.url;case"git":return H.url;case"directory":return H.path;case"file":return H.path;default:return"Unknown source"}}function Qv(H,$){return`${H}@${$}`}async function fm(H){let $=[],A=[];for(let[L,I]of Object.entries(H)){if(!vDH(I.source))continue;let D=null;try{D=await GP(L)}catch(B){let f=B instanceof Error?B.message:String(B);A.push({name:L,error:f}),r(B instanceof Error?B:Error(`Failed to load marketplace ${L}: ${B}`))}$.push({name:L,config:I,data:D})}return{marketplaces:$,failures:A}}function wKH(H,$){if(H.length===0)return null;if($>0)return{type:"warning",message:H.length===1?`Warning: Failed to load marketplace '${H[0].name}': ${H[0].error}`:`Warning: Failed to load ${H.length} marketplaces: ${yX9(H)}`};return{type:"error",message:`Failed to load all marketplaces. Errors: ${vX9(H)}`}}function yX9(H){return H.map(($)=>$.name).join(", ")}function vX9(H){return H.map(($)=>`${$.name}: ${$.error}`).join("; ")}function yDH(){let H=ZI("policySettings");if(!H?.strictKnownMarketplaces)return null;return H.strictKnownMarketplaces}function hX9(){let H=ZI("policySettings");if(!H?.blockedMarketplaces)return null;return H.blockedMarketplaces}function bX9(H,$){if(H.source!==$.source)return!1;switch(H.source){case"url":return H.url===$.url;case"github":return H.repo===$.repo&&(H.ref||void 0)===($.ref||void 0)&&(H.path||void 0)===($.path||void 0);case"git":return H.url===$.url&&(H.ref||void 0)===($.ref||void 0)&&(H.path||void 0)===($.path||void 0);case"npm":return H.package===$.package;case"file":return H.path===$.path;case"directory":return H.path===$.path;default:return!1}}function uKA(H){switch(H.source){case"github":return"github.com";case"git":{let $=H.url.match(/^[^@]+@([^:]+):/);if($?.[1])return $[1];try{return new URL(H.url).hostname}catch{return null}}case"url":try{return new URL(H.url).hostname}catch{return null}default:return null}}function kX9(H,$){let A=uKA(H);if(!A)return!1;try{return new RegExp($.hostPattern).test(A)}catch{return r(Error(`Invalid hostPattern regex: ${$.hostPattern}`)),!1}}function CqI(){let H=yDH();if(!H)return[];return H.filter(($)=>$.source==="hostPattern").map(($)=>$.hostPattern)}function YqI(H){let $=H.match(/^git@github\.com:([^/]+\/[^/]+?)(?:\.git)?$/);if($&&$[1])return $[1];let A=H.match(/^https?:\/\/github\.com\/([^/]+\/[^/]+?)(?:\.git)?$/);if(A&&A[1])return A[1];return null}function Xa(H,$){if(!H)return!0;return(H||void 0)===($||void 0)}function uX9(H,$){if(H.source===$.source)switch(H.source){case"github":{let A=$;if(H.repo!==A.repo)return!1;return Xa(A.ref,H.ref)&&Xa(A.path,H.path)}case"git":{let A=$;if(H.url!==A.url)return!1;return Xa(A.ref,H.ref)&&Xa(A.path,H.path)}case"url":return H.url===$.url;case"npm":return H.package===$.package;case"file":return H.path===$.path;case"directory":return H.path===$.path;default:return!1}if(H.source==="git"&&$.source==="github"){if(YqI(H.url)===$.repo)return Xa($.ref,H.ref)&&Xa($.path,H.path)}if(H.source==="github"&&$.source==="git"){if(YqI($.url)===H.repo)return Xa($.ref,H.ref)&&Xa($.path,H.path)}return!1}function $RH(H){let $=hX9();if($===null)return!1;return $.some((A)=>uX9(H,A))}function vDH(H){if($RH(H))return!1;let $=yDH();if($===null)return!0;return $.some((A)=>{if(A.source==="hostPattern")return kX9(H,A);return bX9(H,A)})}function ZKH(H){switch(H.source){case"github":return`github:${H.repo}${H.ref?`@${H.ref}`:""}`;case"url":return H.url;case"git":return`git:${H.url}${H.ref?`@${H.ref}`:""}`;case"npm":return`npm:${H.package}`;case"file":return`file:${H.path}`;case"directory":return`dir:${H.path}`;case"hostPattern":return`hostPattern:${H.hostPattern}`;default:return"unknown source"}}async function wqI({configuredMarketplaceCount:H,failedMarketplaceCount:$}){if(!await pX$())return"git-not-installed";let L=yDH();if(L!==null){if(L.length===0)return"all-blocked-by-policy";if(H===0)return"policy-restricts-sources"}if(H===0)return"no-marketplaces-configured";if($>0&&$===H)return"all-marketplaces-failed";return"all-plugins-installed"}var Ja=K(()=>{y4();_$();mL();kKA()});function Fa(H){if(H.includes("@")){let $=H.split("@");return{name:$[0]||"",marketplace:$[1]}}return{name:H}}function Wv(H){if(H==="managed")throw Error("Cannot install plugins to managed scope");return gX9[H]}function ZqI(H){return gKA[H]}var gKA,gX9;var hDH=K(()=>{gKA={policySettings:"managed",userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag"};gX9={user:"userSettings",project:"projectSettings",local:"localSettings"}});function ARH(){return Em.join(Dw(),"installed_plugins.json")}function mX9(){return Em.join(Dw(),"installed_plugins_v2.json")}function pX9(){if(mKA)return;let H=zH(),$=ARH(),A=mX9();try{let L=H.existsSync(A),I=H.existsSync($);if(L){H.renameSync(A,$),N("Renamed installed_plugins_v2.json to installed_plugins.json");let D=F7();qqI(D)}else if(I){let D=H.readFileSync($,{encoding:"utf-8"}),B=DA(D);if((typeof B?.version==="number"?B.version:1)===1){let E=GwH.parse(B),M=cKA(E);iL($,yH(M,null,2),{encoding:"utf-8",flush:!0}),N(`Converted installed_plugins.json from V1 to V2 format (${Object.keys(E.plugins).length} plugins)`),qqI(M)}}mKA=!0}catch(L){let I=L instanceof Error?L.message:String(L);N(`Failed to migrate plugin files: ${I}`,{level:"error"}),r(L instanceof Error?L:Error(`Failed to migrate plugin files: ${I}`)),mKA=!0}}function qqI(H){let $=zH(),A=Mm();if(!$.existsSync(A))return;try{let L=new Set;for(let D of Object.values(H.plugins))for(let B of D)L.add(B.installPath);let I=$.readdirSync(A);for(let D of I){if(!D.isDirectory())continue;let B=D.name,f=Em.join(A,B);if($.readdirSync(f).some((G)=>{if(!G.isDirectory())return!1;let U=Em.join(f,G.name);return $.readdirSync(U).some((J)=>J.isDirectory())}))continue;if(!L.has(f))$.rmSync(f,{recursive:!0,force:!0}),N(`Cleaned up legacy cache directory: ${B}`)}}catch(L){let I=L instanceof Error?L.message:String(L);N(`Failed to clean up legacy cache: ${I}`,{level:"warn"})}}function dKA(){let H=zH(),$=ARH();if(!H.existsSync($))return null;let A=H.readFileSync($,{encoding:"utf-8"}),L=DA(A);return{version:typeof L?.version==="number"?L.version:1,data:L}}function cKA(H){let $={};for(let[A,L]of Object.entries(H.plugins)){let I=Pv(A,L.version);$[A]=[{scope:"user",installPath:I,version:L.version,installedAt:L.installedAt,lastUpdated:L.lastUpdated,gitCommitSha:L.gitCommitSha}]}return{version:2,plugins:$}}function F7(){if(Vv!==null)return Vv;let H=ARH();try{let $=dKA();if($){if($.version===2){let I=UwH.parse($.data);return Vv=I,N(`Loaded ${Object.keys(I.plugins).length} installed plugins from ${H}`),I}let A=GwH.parse($.data),L=cKA(A);return Vv=L,N(`Loaded and converted ${Object.keys(A.plugins).length} plugins from V1 format`),L}return N("installed_plugins.json doesn't exist, returning empty V2 object"),Vv={version:2,plugins:{}},Vv}catch($){let A=$ instanceof Error?$.message:String($);return N(`Failed to load installed_plugins.json: ${A}. Starting with empty state.`,{level:"error"}),r($ instanceof Error?$:Error(`Failed to load installed_plugins.json: ${A}`)),Vv={version:2,plugins:{}},Vv}}function cX$(H){let $=zH(),A=ARH();try{let L=Dw();if(!$.existsSync(L))$.mkdirSync(L);let I=yH(H,null,2);iL(A,I,{encoding:"utf-8",flush:!0}),Vv=H,N(`Saved ${Object.keys(H.plugins).length} installed plugins to ${A}`)}catch(L){let I=L instanceof Error?L.message:String(L);throw r(L instanceof Error?L:Error(`Failed to save installed_plugins.json: ${I}`)),L}}function zqI(H,$,A){let L=F7(),I=L.plugins[H];if(!I)return;if(L.plugins[H]=I.filter((D)=>!(D.scope===$&&D.projectPath===A)),L.plugins[H].length===0)delete L.plugins[H];cX$(L),N(`Removed installation for ${H} at scope ${$}`)}function lKA(){if(pKA===null)pKA=F7();return pKA}function Ka(){try{let H=dKA();if(H){if(H.version===2)return UwH.parse(H.data);let $=GwH.parse(H.data);return cKA($)}return{version:2,plugins:{}}}catch(H){let $=H instanceof Error?H.message:String(H);return N(`Failed to load installed plugins from disk: ${$}`,{level:"error"}),{version:2,plugins:{}}}}function NqI(H,$,A,L,I){let D=Ka(),B=D.plugins[H];if(!B){N(`Cannot update ${H} on disk: plugin not found in installed plugins`);return}let f=B.find((E)=>E.scope===$&&E.projectPath===A);if(f){f.installPath=L,f.version=I,f.lastUpdated=new Date().toISOString();let E=ARH();iL(E,yH(D,null,2),{encoding:"utf-8",flush:!0}),Vv=null,N(`Updated ${H} on disk to version ${I} at ${L}`)}else N(`Cannot update ${H} on disk: no installation for scope ${$}`)}async function iKA(){pX9();try{await rKA()}catch($){r($ instanceof Error?$:Error(String($)))}let H=lKA();N(`Initialized versioned plugins system with ${Object.keys(H.plugins).length} plugins`)}function dX9(H){let A=F7().plugins[H];if(!A||A.length===0)return;let L=A[0];if(!L)return;return{version:L.version||"unknown",installedAt:L.installedAt||new Date().toISOString(),lastUpdated:L.lastUpdated,installPath:L.installPath,gitCommitSha:L.gitCommitSha}}function OqI(H){if(!H)return[];let $=F7(),A=`@${H}`,L=new Set,I=!1;for(let D of Object.keys($.plugins)){if(!D.endsWith(A))continue;for(let B of $.plugins[D]??[])if(B.installPath)L.add(B.installPath);delete $.plugins[D],I=!0,N(`Removed installed plugin for marketplace removal: ${D}`)}if(I)cX$($);return Array.from(L)}function K7(H){return dX9(H)!==void 0}function nKA(H,$,A="user",L){let I=F7(),D={scope:A,installPath:$.installPath,version:$.version,installedAt:$.installedAt,lastUpdated:$.lastUpdated,gitCommitSha:$.gitCommitSha,...L&&{projectPath:L}},B=I.plugins[H]||[],f=B.findIndex((M)=>M.scope===A&&M.projectPath===L),E=f>=0;if(E)B[f]=D;else B.push(D);I.plugins[H]=B,cX$(I),N(`${E?"Updated":"Added"} installed plugin: ${H} (scope: ${A})`)}async function dX$(H){return await KwH(H)??void 0}function TqI(H,$){let A=zH(),L=Em.join(H,".claude-plugin","plugin.json");if(!A.existsSync(L))return"unknown";try{let I=A.readFileSync(L,{encoding:"utf-8"});return DA(I).version||"unknown"}catch{return N(`Could not read version from manifest for ${$}`),"unknown"}}async function rKA(){let $=VL().enabledPlugins||{};if(Object.keys($).length===0)return;let A=dKA(),L=A!==null;if(L&&A?.version===2&&A){let J=UwH.safeParse(A.data);if(J?.success){let F=J.data.plugins;if(Object.keys($).filter((W)=>W.includes("@")).every((W)=>{let P=F[W];return P&&P.length>0})){N("All plugins already exist, skipping migration");return}}}N(L?"Syncing installed_plugins.json with enabledPlugins from all settings.json files":"Creating installed_plugins.json from settings.json files");let D=zH(),B=new Date().toISOString(),f=C$(),E=new Map,M=["userSettings","projectSettings","localSettings"];for(let J of M){let Q=ZI(J)?.enabledPlugins||{};for(let W of Object.keys(Q)){if(!W.includes("@"))continue;let P=ZqI(J);E.set(W,{scope:P,projectPath:P==="user"?void 0:f})}}let G={};if(L)G={...F7().plugins};let U=0,X=0;for(let[J,F]of E){let Q=G[J];if(Q&&Q.length>0){let W=Q[0];if(W&&(W.scope!==F.scope||W.projectPath!==F.projectPath)){if(W.scope=F.scope,F.projectPath)W.projectPath=F.projectPath;else delete W.projectPath;W.lastUpdated=B,U++,N(`Updated ${J} scope to ${F.scope} (settings.json is source of truth)`)}}else{let W=J.split("@"),P=W[0];if(!P||W.length!==2)continue;try{let C=await ZK(J);if(!C){N(`Plugin ${J} not found in any marketplace, skipping`);continue}let{entry:Y,marketplaceInstallLocation:Z}=C,q,O="unknown",j=void 0;if(typeof Y.source==="string")q=Em.join(Z,Y.source),O=TqI(q,J),j=await dX$(q);else{let u=Mm(),y=P.replace(/[^a-zA-Z0-9-_]/g,"-"),g=Em.join(u,y);if(!D.existsSync(g)){N(`External plugin ${J} not in cache, skipping`);continue}q=g,O=TqI(g,J),j=await dX$(g)}if(O==="unknown"&&Y.version)O=Y.version;if(O==="unknown"&&j)O=j.substring(0,12);G[J]=[{scope:F.scope,installPath:Pv(J,O),version:O,installedAt:B,lastUpdated:B,gitCommitSha:j,...F.projectPath&&{projectPath:F.projectPath}}],X++,N(`Added ${J} with scope ${F.scope}`)}catch(C){N(`Failed to add plugin ${J}: ${C}`)}}}if(!L||U>0||X>0)cX$({version:2,plugins:G}),N(`Sync completed: ${X} added, ${U} updated in installed_plugins.json`)}var Em,mKA=!1,Vv=null,pKA=null;var Q7=K(()=>{DL();Z$();E$();_$();ejH();UQ();Z$();mL();hDH();PI();_X();j$H();y4();Em=require("path")});function UP(H){switch(H.type){case"generic-error":return H.error;case"path-not-found":return`Path not found: ${H.path} (${H.component})`;case"git-auth-failed":return`Git authentication failed (${H.authType}): ${H.gitUrl}`;case"git-timeout":return`Git ${H.operation} timeout: ${H.gitUrl}`;case"network-error":return`Network error: ${H.url}${H.details?` - ${H.details}`:""}`;case"manifest-parse-error":return`Manifest parse error: ${H.parseError}`;case"manifest-validation-error":return`Manifest validation failed: ${H.validationErrors.join(", ")}`;case"plugin-not-found":return`Plugin ${H.pluginId} not found in marketplace ${H.marketplace}`;case"marketplace-not-found":return`Marketplace ${H.marketplace} not found`;case"marketplace-load-failed":return`Marketplace ${H.marketplace} failed to load: ${H.reason}`;case"repository-scan-failed":return`Repository scan failed: ${H.reason}`;case"mcp-config-invalid":return`MCP server ${H.serverName} invalid: ${H.validationError}`;case"hook-load-failed":return`Hook load failed: ${H.reason}`;case"component-load-failed":return`${H.component} load failed from ${H.path}: ${H.reason}`;case"mcpb-download-failed":return`Failed to download MCPB from ${H.url}: ${H.reason}`;case"mcpb-extract-failed":return`Failed to extract MCPB ${H.mcpbPath}: ${H.reason}`;case"mcpb-invalid-manifest":return`MCPB manifest invalid at ${H.mcpbPath}: ${H.validationError}`;case"lsp-config-invalid":return`Plugin "${H.plugin}" has invalid LSP server config for "${H.serverName}": ${H.validationError}`;case"lsp-server-start-failed":return`Plugin "${H.plugin}" failed to start LSP server "${H.serverName}": ${H.reason}`;case"lsp-server-crashed":if(H.signal)return`Plugin "${H.plugin}" LSP server "${H.serverName}" crashed with signal ${H.signal}`;return`Plugin "${H.plugin}" LSP server "${H.serverName}" crashed with exit code ${H.exitCode??"unknown"}`;case"lsp-request-timeout":return`Plugin "${H.plugin}" LSP server "${H.serverName}" timed out on ${H.method} request after ${H.timeoutMs}ms`;case"lsp-request-failed":return`Plugin "${H.plugin}" LSP server "${H.serverName}" ${H.method} request failed: ${H.error}`;case"marketplace-blocked-by-policy":if(H.blockedByBlocklist)return`Marketplace '${H.marketplace}' is blocked by enterprise policy`;return`Marketplace '${H.marketplace}' is not in the allowed marketplace list`}}async function Qa(H,$,A){let L=H;return await Promise.all([...H.matchAll(cX9),...H.matchAll(lX9)].map(async(I)=>{let D=I[1]?.trim();if(D)try{let B=await qF(aD,{command:D},$,PT({content:[]}),"");if(B.behavior!=="allow")throw N(`Bash command permission check failed for command in ${A}: ${D}. Error: ${B.message}`),new _R(`Bash command permission check failed for pattern "${I[0]}": ${B.message||"Permission denied"}`);let{data:f}=await aD.call({command:D},$),E=await mX$(aD,f,xqI.randomUUID()),M=typeof E.content==="string"?E.content:SqI(f.stdout,f.stderr);L=L.replace(I[0],M)}catch(B){if(B instanceof _R)throw B;iX9(B,I[0])}})),L}function SqI(H,$,A=!1){let L=[];if(H.trim())L.push(H.trim());if($.trim())if(A)L.push(`[stderr: ${$.trim()}]`);else L.push(`[stderr] ${L}`;throw new _R(I)}var xqI,cX9,lX9;var qKH=K(()=>{zQ();lG();E$();XJ();_L();Bm();xqI=require("crypto"),cX9=/```!\s*\n?([\s\S]*?)\n?```/g,lX9=/(?{KzH();jqI=y2({command:uL(),args:FX(uL()).optional(),env:KO(uL(),uL()).optional()}),nX9=y2({name:uL(),email:uL().email().optional(),url:uL().url().optional()}),rX9=y2({type:uL(),url:uL().url()}),aX9=jqI.partial(),oX9=jqI.extend({platform_overrides:KO(uL(),aX9).optional()}),tX9=y2({type:QO(["python","node","binary"]),entry_point:uL(),mcp_config:oX9}),sX9=y2({claude_desktop:uL().optional(),platforms:FX(QO(["darwin","win32","linux"])).optional(),runtimes:y2({python:uL().optional(),node:uL().optional()}).optional()}).passthrough(),eX9=y2({name:uL(),description:uL().optional()}),HJ9=y2({name:uL(),description:uL().optional(),arguments:FX(uL()).optional(),text:uL()}),$J9=y2({type:QO(["string","number","boolean","directory","file"]),title:uL(),description:uL(),required:PQ().optional(),default:tAH([uL(),Tq(),PQ(),FX(uL())]).optional(),multiple:PQ().optional(),sensitive:PQ().optional(),min:Tq().optional(),max:Tq().optional()}),m0E=KO(uL(),tAH([uL(),Tq(),PQ(),FX(uL())])),lX$=y2({$schema:uL().optional(),dxt_version:uL().optional().describe("@deprecated Use manifest_version instead"),manifest_version:uL().optional(),name:uL(),display_name:uL().optional(),version:uL(),description:uL(),long_description:uL().optional(),author:nX9,repository:rX9.optional(),homepage:uL().url().optional(),documentation:uL().url().optional(),support:uL().url().optional(),icon:uL().optional(),screenshots:FX(uL()).optional(),server:tX9,tools:FX(eX9).optional(),tools_generated:PQ().optional(),prompts:FX(HJ9).optional(),prompts_generated:PQ().optional(),keywords:FX(uL()).optional(),license:uL().optional(),privacy_policies:FX(uL()).optional(),compatibility:sX9.optional(),user_config:KO(uL(),$J9).optional()}).refine((H)=>!!(H.dxt_version||H.manifest_version),{message:"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided"}),p0E=y2({status:QO(["signed","unsigned","self-signed"]),publisher:uL().optional(),issuer:uL().optional(),valid_from:uL().optional(),valid_to:uL().optional(),fingerprint:uL().optional()})});var aKA=K(()=>{LRH()});function KJ9(H,$){return JJ9(H,{i:2},$&&$.out,$&&$.dictionary)}function VJ9(H,$){if($){var A="";for(var L=0;L65558)_T(13);var I=Yv(H,L+8);if(!I)return{};var D=Yx(H,L+16),B=D==4294967295||I==65535;if(B){var f=Yx(H,L-12);if(B=Yx(H,f)==101075792,B)I=Yx(H,f+32),D=Yx(H,f+48)}var E=$&&$.filter;for(var M=0;M>E]=M}}else{f=new TKH(L);for(I=0;I>15-H[I]}return f},DRH,S8,S8,S8,S8,gqI,S8,MJ9,GJ9,oKA=function(H){var $=H[0];for(var A=1;A$)$=H[A];return $},_x=function(H,$,A){var L=$/8|0;return(H[L]|H[L+1]<<8)>>($&7)&A},tKA=function(H,$){var A=$/8|0;return(H[A]|H[A+1]<<8|H[A+2]<<16)>>($&7)},UJ9=function(H){return(H+7)/8|0},$QA=function(H,$,A){if($==null||$<0)$=0;if(A==null||A>H.length)A=H.length;return new Bw(H.subarray($,A))},XJ9,_T=function(H,$,A){var L=Error($||XJ9[H]);if(L.code=H,Error.captureStackTrace)Error.captureStackTrace(L,_T);if(!A)throw L;return L},JJ9=function(H,$,A,L){var I=H.length,D=L?L.length:0;if(!I||$.f&&!$.l)return A||new Bw(0);var B=!A,f=B||$.i!=2,E=$.i;if(B)A=new Bw(I*3);var M=function(DH){var EH=A.length;if(DH>EH){var $H=new Bw(Math.max(EH*2,DH));$H.set(A),A=$H}},G=$.f||0,U=$.p||0,X=$.b||0,J=$.l,F=$.d,Q=$.m,W=$.n,P=I*8;do{if(!J){G=_x(H,U,1);var C=_x(H,U+1,3);if(U+=3,!C){var Y=UJ9(U)+4,Z=H[Y-4]|H[Y-3]<<8,q=Y+Z;if(q>I){if(E)_T(0);break}if(f)M(X+Z);A.set(H.subarray(Y,q),X),$.b=X+=Z,$.p=U=q*8,$.f=G;continue}else if(C==1)J=MJ9,F=GJ9,Q=9,W=5;else if(C==2){var O=_x(H,U,31)+257,j=_x(H,U+10,15)+4,u=O+_x(H,U+5,31)+1;U+=14;var y=new Bw(u),g=new Bw(19);for(var h=0;h>4;if(Y<16)y[h++]=Y;else{var GH=0,HH=0;if(Y==16)HH=3+_x(H,U,3),U+=2,GH=y[h-1];else if(Y==17)HH=3+_x(H,U,7),U+=3;else if(Y==18)HH=11+_x(H,U,127),U+=7;while(HH--)y[h++]=GH}}var BH=y.subarray(0,O),WH=y.subarray(O);Q=oKA(BH),W=oKA(WH),J=IRH(BH,Q,1),F=IRH(WH,W,1)}else _T(1);if(U>P){if(E)_T(0);break}}if(f)M(X+131072);var wH=(1<>4;if(U+=GH&15,U>P){if(E)_T(0);break}if(!GH)_T(2);if(t<256)A[X++]=t;else if(t==256){TH=U,J=null;break}else{var IH=t-254;if(t>264){var h=t-257,KH=yqI[h];IH=_x(H,U,(1<>4;if(!MH)_T(3);U+=MH&15;var WH=EJ9[CH];if(CH>3){var KH=vqI[CH];WH+=tKA(H,U)&(1<P){if(E)_T(0);break}if(f)M(X+131072);var OH=X+IH;if(X>>0},sKA=function(H,$){return Yx(H,$)+Yx(H,$+4)*4294967296},HQA,QJ9=0,WJ9=function(H){for(var $="",A=0;;){var L=H[A++],I=(L>127)+(L>223)+(L>239);if(A+I>H.length)return{s:$,r:$QA(H,A-1)};if(!I)$+=String.fromCharCode(L);else if(I==3)L=((L&15)<<18|(H[A++]&63)<<12|(H[A++]&63)<<6|H[A++]&63)-65536,$+=String.fromCharCode(55296|L>>10,56320|L&1023);else if(I&1)$+=String.fromCharCode((L&31)<<6|H[A++]&63);else $+=String.fromCharCode((L&15)<<12|(H[A++]&63)<<6|H[A++]&63)}},PJ9=function(H,$){return $+30+Yv(H,$+26)+Yv(H,$+28)},_J9=function(H,$,A){var L=Yv(H,$+28),I=VJ9(H.subarray($+46,$+46+L),!(Yv(H,$+8)&2048)),D=$+46+L,B=Yx(H,$+20),f=A&&B==4294967295?YJ9(H,D):[B,Yx(H,$+24),Yx(H,$+42)],E=f[0],M=f[1],G=f[2];return[Yv(H,$+10),E,M,I,D+Yv(H,$+30)+Yv(H,$+32),G]},YJ9=function(H,$){for(;Yv(H,$)!=1;$+=4+Yv(H,$+2));return[sKA(H,$+12),sKA(H,$+4),sKA(H,$+20)]};var pqI=K(()=>{RqI=require("module"),LJ9=RqI.createRequire("/");try{IJ9=LJ9("worker_threads").Worker}catch(H){}Bw=Uint8Array,TKH=Uint16Array,DJ9=Int32Array,yqI=new Bw([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),vqI=new Bw([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),BJ9=new Bw([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bqI=hqI(yqI,2),kqI=bqI.b,fJ9=bqI.r;kqI[28]=258,fJ9[258]=28;uqI=hqI(vqI,0),EJ9=uqI.b,i0E=uqI.r,eKA=new TKH(32768);for(S8=0;S8<32768;++S8)_v=(S8&43690)>>1|(S8&21845)<<1,_v=(_v&52428)>>2|(_v&13107)<<2,_v=(_v&61680)>>4|(_v&3855)<<4,eKA[S8]=((_v&65280)>>8|(_v&255)<<8)>>1;DRH=new Bw(288);for(S8=0;S8<144;++S8)DRH[S8]=8;for(S8=144;S8<256;++S8)DRH[S8]=9;for(S8=256;S8<280;++S8)DRH[S8]=7;for(S8=280;S8<288;++S8)DRH[S8]=8;gqI=new Bw(32);for(S8=0;S8<32;++S8)gqI[S8]=5;MJ9=IRH(DRH,9,1),GJ9=IRH(gqI,5,1),XJ9=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],FJ9=new Bw(0);HQA=typeof TextDecoder<"u"&&new TextDecoder;try{HQA.decode(FJ9,{stream:!0}),QJ9=1}catch(H){}});var fRH=z((r0E,rX$)=>{function lqI(H){return Array.isArray(H)?H:[H]}var CJ9=void 0,LQA="",dqI=" ",AQA="\\",wJ9=/^\s+$/,ZJ9=/(?:[^\\]|^)\\$/,qJ9=/^\\!/,TJ9=/^\\#/,zJ9=/\r?\n/g,NJ9=/^\.{0,2}\/|^\.{1,2}$/,OJ9=/\/$/,zKH="/",iqI="node-ignore";if(typeof Symbol<"u")iqI=Symbol.for("node-ignore");var nqI=iqI,NKH=(H,$,A)=>{return Object.defineProperty(H,$,{value:A}),A},xJ9=/([0-z])-([0-z])/g,rqI=()=>!1,SJ9=(H)=>H.replace(xJ9,($,A,L)=>A.charCodeAt(0)<=L.charCodeAt(0)?$:LQA),jJ9=(H)=>{let{length:$}=H;return H.slice(0,$-$%2)},RJ9=[[/^\uFEFF/,()=>LQA],[/((?:\\\\)*?)(\\?\s+)$/,(H,$,A)=>$+(A.indexOf("\\")===0?dqI:LQA)],[/(\\+?)\s/g,(H,$)=>{let{length:A}=$;return $.slice(0,A-A%2)+dqI}],[/[\\$.|*+(){^]/g,(H)=>`\\${H}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(H,$,A)=>$+6{let L=A.replace(/\\\*/g,"[^\\/]*");return $+L}],[/\\\\\\(?=[$.|*+(){^])/g,()=>AQA],[/\\\\/g,()=>AQA],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(H,$,A,L,I)=>$===AQA?`\\[${A}${jJ9(L)}${I}`:I==="]"?L.length%2===0?`[${SJ9(A)}${L}]`:"[]":"[]"],[/(?:[^*])$/,(H)=>/\/$/.test(H)?`${H}$`:`${H}(?=$|\\/$)`]],yJ9=/(^|\\\/)?\\\*$/,BRH="regex",iX$="checkRegex",cqI="_",vJ9={[BRH](H,$){return`${$?`${$}[^/]+`:"[^/]*"}(?=$|\\/$)`},[iX$](H,$){return`${$?`${$}[^/]*`:"[^/]*"}(?=$|\\/$)`}},hJ9=(H)=>RJ9.reduce(($,[A,L])=>$.replace(A,L.bind(H)),H),nX$=(H)=>typeof H==="string",bJ9=(H)=>H&&nX$(H)&&!wJ9.test(H)&&!ZJ9.test(H)&&H.indexOf("#")!==0,kJ9=(H)=>H.split(zJ9).filter(Boolean);class aqI{constructor(H,$,A,L,I,D){this.pattern=H,this.mark=$,this.negative=I,NKH(this,"body",A),NKH(this,"ignoreCase",L),NKH(this,"regexPrefix",D)}get regex(){let H=cqI+BRH;if(this[H])return this[H];return this._make(BRH,H)}get checkRegex(){let H=cqI+iX$;if(this[H])return this[H];return this._make(iX$,H)}_make(H,$){let A=this.regexPrefix.replace(yJ9,vJ9[H]),L=this.ignoreCase?new RegExp(A,"i"):new RegExp(A);return NKH(this,$,L)}}var uJ9=({pattern:H,mark:$},A)=>{let L=!1,I=H;if(I.indexOf("!")===0)L=!0,I=I.substr(1);I=I.replace(qJ9,"!").replace(TJ9,"#");let D=hJ9(I);return new aqI(H,$,I,A,L,D)};class oqI{constructor(H){this._ignoreCase=H,this._rules=[]}_add(H){if(H&&H[nqI]){this._rules=this._rules.concat(H._rules._rules),this._added=!0;return}if(nX$(H))H={pattern:H};if(bJ9(H.pattern)){let $=uJ9(H,this._ignoreCase);this._added=!0,this._rules.push($)}}add(H){return this._added=!1,lqI(nX$(H)?kJ9(H):H).forEach(this._add,this),this._added}test(H,$,A){let L=!1,I=!1,D;this._rules.forEach((f)=>{let{negative:E}=f;if(I===E&&L!==I||E&&!L&&!I&&!$)return;if(!f[A].test(H))return;L=!E,I=E,D=E?CJ9:f});let B={ignored:L,unignored:I};if(D)B.rule=D;return B}}var gJ9=(H,$)=>{throw new $(H)},Gm=(H,$,A)=>{if(!nX$(H))return A(`path must be a string, but got \`${$}\``,TypeError);if(!H)return A("path must not be empty",TypeError);if(Gm.isNotRelative(H))return A(`path should be a \`path.relative()\`d string, but got "${$}"`,RangeError);return!0},tqI=(H)=>NJ9.test(H);Gm.isNotRelative=tqI;Gm.convert=(H)=>H;class sqI{constructor({ignorecase:H=!0,ignoreCase:$=H,allowRelativePaths:A=!1}={}){NKH(this,nqI,!0),this._rules=new oqI($),this._strictPathCheck=!A,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(H){if(this._rules.add(H))this._initCache();return this}addPattern(H){return this.add(H)}_test(H,$,A,L){let I=H&&Gm.convert(H);return Gm(I,H,this._strictPathCheck?gJ9:rqI),this._t(I,$,A,L)}checkIgnore(H){if(!OJ9.test(H))return this.test(H);let $=H.split(zKH).filter(Boolean);if($.pop(),$.length){let A=this._t($.join(zKH)+zKH,this._testCache,!0,$);if(A.ignored)return A}return this._rules.test(H,!1,iX$)}_t(H,$,A,L){if(H in $)return $[H];if(!L)L=H.split(zKH).filter(Boolean);if(L.pop(),!L.length)return $[H]=this._rules.test(H,A,BRH);let I=this._t(L.join(zKH)+zKH,$,A,L);return $[H]=I.ignored?I:this._rules.test(H,A,BRH)}ignores(H){return this._test(H,this._ignoreCache,!1).ignored}createFilter(){return(H)=>!this.ignores(H)}filter(H){return lqI(H).filter(this.createFilter())}test(H){return this._test(H,this._testCache,!0)}}var IQA=(H)=>new sqI(H),mJ9=(H)=>Gm(H&&Gm.convert(H),H,rqI),pJ9=()=>{let H=(A)=>/^\\\\\?\\/.test(A)||/["<>|\u0000-\u001F]+/u.test(A)?A:A.replace(/\\/g,"/");Gm.convert=H;let $=/^[a-z]:\//i;Gm.isNotRelative=(A)=>$.test(A)||tqI(A)};rX$.exports=IQA;IQA.default=IQA;rX$.exports.isPathValid=mJ9;NKH(rX$.exports,Symbol.for("setupWindows"),pJ9)});var dJ9;var DQA=K(()=>{dJ9=b(fRH(),1)});var DU=z((BQA)=>{BQA.fromCallback=function(H){return Object.defineProperty(function(...$){if(typeof $[$.length-1]==="function")H.apply(this,$);else return new Promise((A,L)=>{$.push((I,D)=>I!=null?L(I):A(D)),H.apply(this,$)})},"name",{value:H.name})};BQA.fromPromise=function(H){return Object.defineProperty(function(...$){let A=$[$.length-1];if(typeof A!=="function")return H.apply(this,$);else $.pop(),H.apply(this,$).then((L)=>A(null,L),A)},"name",{value:H.name})}});var bDH=z((Wa)=>{var eqI=DU().fromCallback,ZY=zE(),cJ9=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((H)=>{return typeof ZY[H]==="function"});Object.assign(Wa,ZY);cJ9.forEach((H)=>{Wa[H]=eqI(ZY[H])});Wa.exists=function(H,$){if(typeof $==="function")return ZY.exists(H,$);return new Promise((A)=>{return ZY.exists(H,A)})};Wa.read=function(H,$,A,L,I,D){if(typeof D==="function")return ZY.read(H,$,A,L,I,D);return new Promise((B,f)=>{ZY.read(H,$,A,L,I,(E,M,G)=>{if(E)return f(E);B({bytesRead:M,buffer:G})})})};Wa.write=function(H,$,...A){if(typeof A[A.length-1]==="function")return ZY.write(H,$,...A);return new Promise((L,I)=>{ZY.write(H,$,...A,(D,B,f)=>{if(D)return I(D);L({bytesWritten:B,buffer:f})})})};if(typeof ZY.writev==="function")Wa.writev=function(H,$,...A){if(typeof A[A.length-1]==="function")return ZY.writev(H,$,...A);return new Promise((L,I)=>{ZY.writev(H,$,...A,(D,B,f)=>{if(D)return I(D);L({bytesWritten:B,buffers:f})})})};if(typeof ZY.realpath.native==="function")Wa.realpath.native=eqI(ZY.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var $TI=z((e0E,HTI)=>{var s0E=require("path");HTI.exports.checkPath=function($){}});var DTI=z((H9E,fQA)=>{var ATI=bDH(),{checkPath:LTI}=$TI(),ITI=(H)=>{let $={mode:511};if(typeof H==="number")return H;return{...$,...H}.mode};fQA.exports.makeDir=async(H,$)=>{return LTI(H),ATI.mkdir(H,{mode:ITI($),recursive:!0})};fQA.exports.makeDirSync=(H,$)=>{return LTI(H),ATI.mkdirSync(H,{mode:ITI($),recursive:!0})}});var Cx=z(($9E,BTI)=>{var lJ9=DU().fromPromise,{makeDir:iJ9,makeDirSync:EQA}=DTI(),MQA=lJ9(iJ9);BTI.exports={mkdirs:MQA,mkdirsSync:EQA,mkdirp:MQA,mkdirpSync:EQA,ensureDir:MQA,ensureDirSync:EQA}});var Va=z((A9E,ETI)=>{var nJ9=DU().fromPromise,fTI=bDH();function rJ9(H){return fTI.access(H).then(()=>!0).catch(()=>!1)}ETI.exports={pathExists:nJ9(rJ9),pathExistsSync:fTI.existsSync}});var GQA=z((L9E,MTI)=>{var OKH=zE();function aJ9(H,$,A,L){OKH.open(H,"r+",(I,D)=>{if(I)return L(I);OKH.futimes(D,$,A,(B)=>{OKH.close(D,(f)=>{if(L)L(B||f)})})})}function oJ9(H,$,A){let L=OKH.openSync(H,"r+");return OKH.futimesSync(L,$,A),OKH.closeSync(L)}MTI.exports={utimesMillis:aJ9,utimesMillisSync:oJ9}});var kDH=z((I9E,XTI)=>{var xKH=bDH(),jQ=require("path"),tJ9=require("util");function sJ9(H,$,A){let L=A.dereference?(I)=>xKH.stat(I,{bigint:!0}):(I)=>xKH.lstat(I,{bigint:!0});return Promise.all([L(H),L($).catch((I)=>{if(I.code==="ENOENT")return null;throw I})]).then(([I,D])=>({srcStat:I,destStat:D}))}function eJ9(H,$,A){let L,I=A.dereference?(B)=>xKH.statSync(B,{bigint:!0}):(B)=>xKH.lstatSync(B,{bigint:!0}),D=I(H);try{L=I($)}catch(B){if(B.code==="ENOENT")return{srcStat:D,destStat:null};throw B}return{srcStat:D,destStat:L}}function HF9(H,$,A,L,I){tJ9.callbackify(sJ9)(H,$,L,(D,B)=>{if(D)return I(D);let{srcStat:f,destStat:E}=B;if(E){if(ERH(f,E)){let M=jQ.basename(H),G=jQ.basename($);if(A==="move"&&M!==G&&M.toLowerCase()===G.toLowerCase())return I(null,{srcStat:f,destStat:E,isChangingCase:!0});return I(Error("Source and destination must not be the same."))}if(f.isDirectory()&&!E.isDirectory())return I(Error(`Cannot overwrite non-directory '${$}' with directory '${H}'.`));if(!f.isDirectory()&&E.isDirectory())return I(Error(`Cannot overwrite directory '${$}' with non-directory '${H}'.`))}if(f.isDirectory()&&UQA(H,$))return I(Error(aX$(H,$,A)));return I(null,{srcStat:f,destStat:E})})}function $F9(H,$,A,L){let{srcStat:I,destStat:D}=eJ9(H,$,L);if(D){if(ERH(I,D)){let B=jQ.basename(H),f=jQ.basename($);if(A==="move"&&B!==f&&B.toLowerCase()===f.toLowerCase())return{srcStat:I,destStat:D,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(I.isDirectory()&&!D.isDirectory())throw Error(`Cannot overwrite non-directory '${$}' with directory '${H}'.`);if(!I.isDirectory()&&D.isDirectory())throw Error(`Cannot overwrite directory '${$}' with non-directory '${H}'.`)}if(I.isDirectory()&&UQA(H,$))throw Error(aX$(H,$,A));return{srcStat:I,destStat:D}}function GTI(H,$,A,L,I){let D=jQ.resolve(jQ.dirname(H)),B=jQ.resolve(jQ.dirname(A));if(B===D||B===jQ.parse(B).root)return I();xKH.stat(B,{bigint:!0},(f,E)=>{if(f){if(f.code==="ENOENT")return I();return I(f)}if(ERH($,E))return I(Error(aX$(H,A,L)));return GTI(H,$,B,L,I)})}function UTI(H,$,A,L){let I=jQ.resolve(jQ.dirname(H)),D=jQ.resolve(jQ.dirname(A));if(D===I||D===jQ.parse(D).root)return;let B;try{B=xKH.statSync(D,{bigint:!0})}catch(f){if(f.code==="ENOENT")return;throw f}if(ERH($,B))throw Error(aX$(H,A,L));return UTI(H,$,D,L)}function ERH(H,$){return $.ino&&$.dev&&$.ino===H.ino&&$.dev===H.dev}function UQA(H,$){let A=jQ.resolve(H).split(jQ.sep).filter((I)=>I),L=jQ.resolve($).split(jQ.sep).filter((I)=>I);return A.reduce((I,D,B)=>I&&L[B]===D,!0)}function aX$(H,$,A){return`Cannot ${A} '${H}' to a subdirectory of itself, '${$}'.`}XTI.exports={checkPaths:HF9,checkPathsSync:$F9,checkParentPaths:GTI,checkParentPathsSync:UTI,isSrcSubdir:UQA,areIdentical:ERH}});var _TI=z((D9E,PTI)=>{var qY=zE(),MRH=require("path"),AF9=Cx().mkdirs,LF9=Va().pathExists,IF9=GQA().utimesMillis,GRH=kDH();function DF9(H,$,A,L){if(typeof A==="function"&&!L)L=A,A={};else if(typeof A==="function")A={filter:A};L=L||function(){},A=A||{},A.clobber="clobber"in A?!!A.clobber:!0,A.overwrite="overwrite"in A?!!A.overwrite:A.clobber,A.preserveTimestamps,GRH.checkPaths(H,$,"copy",A,(I,D)=>{if(I)return L(I);let{srcStat:B,destStat:f}=D;GRH.checkParentPaths(H,B,$,"copy",(E)=>{if(E)return L(E);if(A.filter)return KTI(JTI,f,H,$,A,L);return JTI(f,H,$,A,L)})})}function JTI(H,$,A,L,I){let D=MRH.dirname(A);LF9(D,(B,f)=>{if(B)return I(B);if(f)return oX$(H,$,A,L,I);AF9(D,(E)=>{if(E)return I(E);return oX$(H,$,A,L,I)})})}function KTI(H,$,A,L,I,D){Promise.resolve(I.filter(A,L)).then((B)=>{if(B)return H($,A,L,I,D);return D()},(B)=>D(B))}function BF9(H,$,A,L,I){if(L.filter)return KTI(oX$,H,$,A,L,I);return oX$(H,$,A,L,I)}function oX$(H,$,A,L,I){(L.dereference?qY.stat:qY.lstat)($,(B,f)=>{if(B)return I(B);if(f.isDirectory())return JF9(f,H,$,A,L,I);else if(f.isFile()||f.isCharacterDevice()||f.isBlockDevice())return fF9(f,H,$,A,L,I);else if(f.isSymbolicLink())return QF9(H,$,A,L,I);else if(f.isSocket())return I(Error(`Cannot copy a socket file: ${$}`));else if(f.isFIFO())return I(Error(`Cannot copy a FIFO pipe: ${$}`));return I(Error(`Unknown file: ${$}`))})}function fF9(H,$,A,L,I,D){if(!$)return QTI(H,A,L,I,D);return EF9(H,A,L,I,D)}function EF9(H,$,A,L,I){if(L.overwrite)qY.unlink(A,(D)=>{if(D)return I(D);return QTI(H,$,A,L,I)});else if(L.errorOnExist)return I(Error(`'${A}' already exists`));else return I()}function QTI(H,$,A,L,I){qY.copyFile($,A,(D)=>{if(D)return I(D);if(L.preserveTimestamps)return MF9(H.mode,$,A,I);return tX$(A,H.mode,I)})}function MF9(H,$,A,L){if(GF9(H))return UF9(A,H,(I)=>{if(I)return L(I);return FTI(H,$,A,L)});return FTI(H,$,A,L)}function GF9(H){return(H&128)===0}function UF9(H,$,A){return tX$(H,$|128,A)}function FTI(H,$,A,L){XF9($,A,(I)=>{if(I)return L(I);return tX$(A,H,L)})}function tX$(H,$,A){return qY.chmod(H,$,A)}function XF9(H,$,A){qY.stat(H,(L,I)=>{if(L)return A(L);return IF9($,I.atime,I.mtime,A)})}function JF9(H,$,A,L,I,D){if(!$)return FF9(H.mode,A,L,I,D);return WTI(A,L,I,D)}function FF9(H,$,A,L,I){qY.mkdir(A,(D)=>{if(D)return I(D);WTI($,A,L,(B)=>{if(B)return I(B);return tX$(A,H,I)})})}function WTI(H,$,A,L){qY.readdir(H,(I,D)=>{if(I)return L(I);return VTI(D,H,$,A,L)})}function VTI(H,$,A,L,I){let D=H.pop();if(!D)return I();return KF9(H,D,$,A,L,I)}function KF9(H,$,A,L,I,D){let B=MRH.join(A,$),f=MRH.join(L,$);GRH.checkPaths(B,f,"copy",I,(E,M)=>{if(E)return D(E);let{destStat:G}=M;BF9(G,B,f,I,(U)=>{if(U)return D(U);return VTI(H,A,L,I,D)})})}function QF9(H,$,A,L,I){qY.readlink($,(D,B)=>{if(D)return I(D);if(L.dereference)B=MRH.resolve(process.cwd(),B);if(!H)return qY.symlink(B,A,I);else qY.readlink(A,(f,E)=>{if(f){if(f.code==="EINVAL"||f.code==="UNKNOWN")return qY.symlink(B,A,I);return I(f)}if(L.dereference)E=MRH.resolve(process.cwd(),E);if(GRH.isSrcSubdir(B,E))return I(Error(`Cannot copy '${B}' to a subdirectory of itself, '${E}'.`));if(H.isDirectory()&&GRH.isSrcSubdir(E,B))return I(Error(`Cannot overwrite '${E}' with '${B}'.`));return WF9(B,A,I)})})}function WF9(H,$,A){qY.unlink($,(L)=>{if(L)return A(L);return qY.symlink(H,$,A)})}PTI.exports=DF9});var qTI=z((B9E,ZTI)=>{var E3=zE(),URH=require("path"),VF9=Cx().mkdirsSync,PF9=GQA().utimesMillisSync,XRH=kDH();function _F9(H,$,A){if(typeof A==="function")A={filter:A};A=A||{},A.clobber="clobber"in A?!!A.clobber:!0,A.overwrite="overwrite"in A?!!A.overwrite:A.clobber,A.preserveTimestamps;let{srcStat:L,destStat:I}=XRH.checkPathsSync(H,$,"copy",A);return XRH.checkParentPathsSync(H,L,$,"copy"),YF9(I,H,$,A)}function YF9(H,$,A,L){if(L.filter&&!L.filter($,A))return;let I=URH.dirname(A);if(!E3.existsSync(I))VF9(I);return YTI(H,$,A,L)}function CF9(H,$,A,L){if(L.filter&&!L.filter($,A))return;return YTI(H,$,A,L)}function YTI(H,$,A,L){let D=(L.dereference?E3.statSync:E3.lstatSync)($);if(D.isDirectory())return OF9(D,H,$,A,L);else if(D.isFile()||D.isCharacterDevice()||D.isBlockDevice())return wF9(D,H,$,A,L);else if(D.isSymbolicLink())return jF9(H,$,A,L);else if(D.isSocket())throw Error(`Cannot copy a socket file: ${$}`);else if(D.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${$}`);throw Error(`Unknown file: ${$}`)}function wF9(H,$,A,L,I){if(!$)return CTI(H,A,L,I);return ZF9(H,A,L,I)}function ZF9(H,$,A,L){if(L.overwrite)return E3.unlinkSync(A),CTI(H,$,A,L);else if(L.errorOnExist)throw Error(`'${A}' already exists`)}function CTI(H,$,A,L){if(E3.copyFileSync($,A),L.preserveTimestamps)qF9(H.mode,$,A);return XQA(A,H.mode)}function qF9(H,$,A){if(TF9(H))zF9(A,H);return NF9($,A)}function TF9(H){return(H&128)===0}function zF9(H,$){return XQA(H,$|128)}function XQA(H,$){return E3.chmodSync(H,$)}function NF9(H,$){let A=E3.statSync(H);return PF9($,A.atime,A.mtime)}function OF9(H,$,A,L,I){if(!$)return xF9(H.mode,A,L,I);return wTI(A,L,I)}function xF9(H,$,A,L){return E3.mkdirSync(A),wTI($,A,L),XQA(A,H)}function wTI(H,$,A){E3.readdirSync(H).forEach((L)=>SF9(L,H,$,A))}function SF9(H,$,A,L){let I=URH.join($,H),D=URH.join(A,H),{destStat:B}=XRH.checkPathsSync(I,D,"copy",L);return CF9(B,I,D,L)}function jF9(H,$,A,L){let I=E3.readlinkSync($);if(L.dereference)I=URH.resolve(process.cwd(),I);if(!H)return E3.symlinkSync(I,A);else{let D;try{D=E3.readlinkSync(A)}catch(B){if(B.code==="EINVAL"||B.code==="UNKNOWN")return E3.symlinkSync(I,A);throw B}if(L.dereference)D=URH.resolve(process.cwd(),D);if(XRH.isSrcSubdir(I,D))throw Error(`Cannot copy '${I}' to a subdirectory of itself, '${D}'.`);if(E3.statSync(A).isDirectory()&&XRH.isSrcSubdir(D,I))throw Error(`Cannot overwrite '${D}' with '${I}'.`);return RF9(I,A)}}function RF9(H,$){return E3.unlinkSync($),E3.symlinkSync(H,$)}ZTI.exports=_F9});var sX$=z((f9E,TTI)=>{var yF9=DU().fromCallback;TTI.exports={copy:yF9(_TI()),copySync:qTI()}});var RTI=z((E9E,jTI)=>{var zTI=zE(),OTI=require("path"),YX=require("assert");function xTI(H){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((A)=>{H[A]=H[A]||zTI[A],A=A+"Sync",H[A]=H[A]||zTI[A]}),H.maxBusyTries=H.maxBusyTries||3}function KQA(H,$,A){let L=0;if(typeof $==="function")A=$,$={};YX(H,"rimraf: missing path"),YX.strictEqual(typeof H,"string","rimraf: path should be a string"),YX.strictEqual(typeof A,"function","rimraf: callback function required"),YX($,"rimraf: invalid options argument provided"),YX.strictEqual(typeof $,"object","rimraf: options should be object"),xTI($),NTI(H,$,function I(D){if(D){if((D.code==="EBUSY"||D.code==="ENOTEMPTY"||D.code==="EPERM")&&L<$.maxBusyTries){L++;let B=L*100;return setTimeout(()=>NTI(H,$,I),B)}if(D.code==="ENOENT")D=null}A(D)})}function NTI(H,$,A){YX(H),YX($),YX(typeof A==="function"),$.lstat(H,(L,I)=>{if(L&&L.code==="ENOENT")return A(null);if(L&&L.code,I&&I.isDirectory())return JQA(H,$,L,A);$.unlink(H,(D)=>{if(D){if(D.code==="ENOENT")return A(null);if(D.code==="EPERM")return JQA(H,$,D,A);if(D.code==="EISDIR")return JQA(H,$,D,A)}return A(D)})})}function JQA(H,$,A,L){YX(H),YX($),YX(typeof L==="function"),$.rmdir(H,(I)=>{if(I&&(I.code==="ENOTEMPTY"||I.code==="EEXIST"||I.code==="EPERM"))vF9(H,$,L);else if(I&&I.code==="ENOTDIR")L(A);else L(I)})}function vF9(H,$,A){YX(H),YX($),YX(typeof A==="function"),$.readdir(H,(L,I)=>{if(L)return A(L);let D=I.length,B;if(D===0)return $.rmdir(H,A);I.forEach((f)=>{KQA(OTI.join(H,f),$,(E)=>{if(B)return;if(E)return A(B=E);if(--D===0)$.rmdir(H,A)})})})}function STI(H,$){let A;$=$||{},xTI($),YX(H,"rimraf: missing path"),YX.strictEqual(typeof H,"string","rimraf: path should be a string"),YX($,"rimraf: missing options"),YX.strictEqual(typeof $,"object","rimraf: options should be object");try{A=$.lstatSync(H)}catch(L){if(L.code==="ENOENT")return;L.code}try{if(A&&A.isDirectory())FQA(H,$,null);else $.unlinkSync(H)}catch(L){if(L.code==="ENOENT")return;else if(L.code==="EPERM")return FQA(H,$,L);else if(L.code!=="EISDIR")throw L;FQA(H,$,L)}}function FQA(H,$,A){YX(H),YX($);try{$.rmdirSync(H)}catch(L){if(L.code==="ENOTDIR")throw A;else if(L.code==="ENOTEMPTY"||L.code==="EEXIST"||L.code==="EPERM")hF9(H,$);else if(L.code!=="ENOENT")throw L}}function hF9(H,$){return YX(H),YX($),$.readdirSync(H).forEach((A)=>STI(OTI.join(H,A),$)),$.rmdirSync(H,$)}jTI.exports=KQA;KQA.sync=STI});var JRH=z((M9E,vTI)=>{var eX$=zE(),bF9=DU().fromCallback,yTI=RTI();function kF9(H,$){if(eX$.rm)return eX$.rm(H,{recursive:!0,force:!0},$);yTI(H,$)}function uF9(H){if(eX$.rmSync)return eX$.rmSync(H,{recursive:!0,force:!0});yTI.sync(H)}vTI.exports={remove:bF9(kF9),removeSync:uF9}});var dTI=z((G9E,pTI)=>{var gF9=DU().fromPromise,kTI=bDH(),uTI=require("path"),gTI=Cx(),mTI=JRH(),hTI=gF9(async function($){let A;try{A=await kTI.readdir($)}catch{return gTI.mkdirs($)}return Promise.all(A.map((L)=>mTI.remove(uTI.join($,L))))});function bTI(H){let $;try{$=kTI.readdirSync(H)}catch{return gTI.mkdirsSync(H)}$.forEach((A)=>{A=uTI.join(H,A),mTI.removeSync(A)})}pTI.exports={emptyDirSync:bTI,emptydirSync:bTI,emptyDir:hTI,emptydir:hTI}});var nTI=z((U9E,iTI)=>{var mF9=DU().fromCallback,cTI=require("path"),Pa=zE(),lTI=Cx();function pF9(H,$){function A(){Pa.writeFile(H,"",(L)=>{if(L)return $(L);$()})}Pa.stat(H,(L,I)=>{if(!L&&I.isFile())return $();let D=cTI.dirname(H);Pa.stat(D,(B,f)=>{if(B){if(B.code==="ENOENT")return lTI.mkdirs(D,(E)=>{if(E)return $(E);A()});return $(B)}if(f.isDirectory())A();else Pa.readdir(D,(E)=>{if(E)return $(E)})})})}function dF9(H){let $;try{$=Pa.statSync(H)}catch{}if($&&$.isFile())return;let A=cTI.dirname(H);try{if(!Pa.statSync(A).isDirectory())Pa.readdirSync(A)}catch(L){if(L&&L.code==="ENOENT")lTI.mkdirsSync(A);else throw L}Pa.writeFileSync(H,"")}iTI.exports={createFile:mF9(pF9),createFileSync:dF9}});var sTI=z((X9E,tTI)=>{var cF9=DU().fromCallback,rTI=require("path"),_a=zE(),aTI=Cx(),lF9=Va().pathExists,{areIdentical:oTI}=kDH();function iF9(H,$,A){function L(I,D){_a.link(I,D,(B)=>{if(B)return A(B);A(null)})}_a.lstat($,(I,D)=>{_a.lstat(H,(B,f)=>{if(B)return B.message=B.message.replace("lstat","ensureLink"),A(B);if(D&&oTI(f,D))return A(null);let E=rTI.dirname($);lF9(E,(M,G)=>{if(M)return A(M);if(G)return L(H,$);aTI.mkdirs(E,(U)=>{if(U)return A(U);L(H,$)})})})})}function nF9(H,$){let A;try{A=_a.lstatSync($)}catch{}try{let D=_a.lstatSync(H);if(A&&oTI(D,A))return}catch(D){throw D.message=D.message.replace("lstat","ensureLink"),D}let L=rTI.dirname($);if(_a.existsSync(L))return _a.linkSync(H,$);return aTI.mkdirsSync(L),_a.linkSync(H,$)}tTI.exports={createLink:cF9(iF9),createLinkSync:nF9}});var HzI=z((J9E,eTI)=>{var Ya=require("path"),FRH=zE(),rF9=Va().pathExists;function aF9(H,$,A){if(Ya.isAbsolute(H))return FRH.lstat(H,(L)=>{if(L)return L.message=L.message.replace("lstat","ensureSymlink"),A(L);return A(null,{toCwd:H,toDst:H})});else{let L=Ya.dirname($),I=Ya.join(L,H);return rF9(I,(D,B)=>{if(D)return A(D);if(B)return A(null,{toCwd:I,toDst:H});else return FRH.lstat(H,(f)=>{if(f)return f.message=f.message.replace("lstat","ensureSymlink"),A(f);return A(null,{toCwd:H,toDst:Ya.relative(L,H)})})})}}function oF9(H,$){let A;if(Ya.isAbsolute(H)){if(A=FRH.existsSync(H),!A)throw Error("absolute srcpath does not exist");return{toCwd:H,toDst:H}}else{let L=Ya.dirname($),I=Ya.join(L,H);if(A=FRH.existsSync(I),A)return{toCwd:I,toDst:H};else{if(A=FRH.existsSync(H),!A)throw Error("relative srcpath does not exist");return{toCwd:H,toDst:Ya.relative(L,H)}}}}eTI.exports={symlinkPaths:aF9,symlinkPathsSync:oF9}});var LzI=z((F9E,AzI)=>{var $zI=zE();function tF9(H,$,A){if(A=typeof $==="function"?$:A,$=typeof $==="function"?!1:$,$)return A(null,$);$zI.lstat(H,(L,I)=>{if(L)return A(null,"file");$=I&&I.isDirectory()?"dir":"file",A(null,$)})}function sF9(H,$){let A;if($)return $;try{A=$zI.lstatSync(H)}catch{return"file"}return A&&A.isDirectory()?"dir":"file"}AzI.exports={symlinkType:tF9,symlinkTypeSync:sF9}});var UzI=z((K9E,GzI)=>{var eF9=DU().fromCallback,DzI=require("path"),wx=bDH(),BzI=Cx(),HK9=BzI.mkdirs,$K9=BzI.mkdirsSync,fzI=HzI(),AK9=fzI.symlinkPaths,LK9=fzI.symlinkPathsSync,EzI=LzI(),IK9=EzI.symlinkType,DK9=EzI.symlinkTypeSync,BK9=Va().pathExists,{areIdentical:MzI}=kDH();function fK9(H,$,A,L){L=typeof A==="function"?A:L,A=typeof A==="function"?!1:A,wx.lstat($,(I,D)=>{if(!I&&D.isSymbolicLink())Promise.all([wx.stat(H),wx.stat($)]).then(([B,f])=>{if(MzI(B,f))return L(null);IzI(H,$,A,L)});else IzI(H,$,A,L)})}function IzI(H,$,A,L){AK9(H,$,(I,D)=>{if(I)return L(I);H=D.toDst,IK9(D.toCwd,A,(B,f)=>{if(B)return L(B);let E=DzI.dirname($);BK9(E,(M,G)=>{if(M)return L(M);if(G)return wx.symlink(H,$,f,L);HK9(E,(U)=>{if(U)return L(U);wx.symlink(H,$,f,L)})})})})}function EK9(H,$,A){let L;try{L=wx.lstatSync($)}catch{}if(L&&L.isSymbolicLink()){let f=wx.statSync(H),E=wx.statSync($);if(MzI(f,E))return}let I=LK9(H,$);H=I.toDst,A=DK9(I.toCwd,A);let D=DzI.dirname($);if(wx.existsSync(D))return wx.symlinkSync(H,$,A);return $K9(D),wx.symlinkSync(H,$,A)}GzI.exports={createSymlink:eF9(fK9),createSymlinkSync:EK9}});var PzI=z((Q9E,VzI)=>{var{createFile:XzI,createFileSync:JzI}=nTI(),{createLink:FzI,createLinkSync:KzI}=sTI(),{createSymlink:QzI,createSymlinkSync:WzI}=UzI();VzI.exports={createFile:XzI,createFileSync:JzI,ensureFile:XzI,ensureFileSync:JzI,createLink:FzI,createLinkSync:KzI,ensureLink:FzI,ensureLinkSync:KzI,createSymlink:QzI,createSymlinkSync:WzI,ensureSymlink:QzI,ensureSymlinkSync:WzI}});var SKH=z((W9E,_zI)=>{function MK9(H,{EOL:$=` `,D};iJ$.publicKeyToOpenSSH=function(H,$){var A="ssh-rsa";$=$||"";var L=TF.util.createBuffer();return tKH(L,A),xv(L,H.e),xv(L,H.n),A+" "+TF.util.encode64(L.bytes())+" "+$};iJ$.privateKeyToOpenSSH=function(H,$){if(!$)return TF.pki.privateKeyToPem(H);return TF.pki.encryptRsaPrivateKey(H,$,{legacy:!0,algorithm:"aes128"})};iJ$.getPublicKeyFingerprint=function(H,$){$=$||{};var A=$.md||TF.md.md5.create(),L="ssh-rsa",I=TF.util.createBuffer();tKH(I,L),xv(I,H.e),xv(I,H.n),A.start(),A.update(I.getBytes());var D=A.digest();if($.encoding==="hex"){var B=D.toHex();if($.delimiter)return B.match(/.{2}/g).join($.delimiter);return B}else if($.encoding==="binary")return D.getBytes();else if($.encoding)throw Error('Unknown encoding "'+$.encoding+'".');return D};function xv(H,$){var A=$.toString(16);if(A[0]>="8")A="00"+A;var L=TF.util.hexToBytes(A);H.putInt32(L.length),H.putBytes(L)}function tKH(H,$){H.putInt32($.length),H.putString($)}function lJ$(){var H=TF.md.sha1.create(),$=arguments.length;for(var A=0;A<$;++A)H.update(arguments[A]);return H.digest()}});var MjI=z((t1E,EjI)=>{EjI.exports=p1();ja();SSI();zx();KJ$();ORH();rSI();kKH();sSI();HjI();AjI();JWA();TJ$();pDH();BWA();QWA();DjI();VWA();EWA();sQA();RJ$();CT();$WA();fjI();ZWA();Nf()});var GjI,qV9,UjI,s1E;var dWA=K(()=>{GjI=require("child_process"),qV9=b(MjI(),1),UjI=require("util"),s1E=UjI.promisify(GjI.execFile)});var cWA=K(()=>{dWA()});var XjI,zV9,NV9,OV9,xV9,SV9,jV9,RV9,yV9,vV9,D8E,hV9,B8E;var JjI=K(()=>{KzH();XjI=R2({command:uL(),args:FX(uL()).optional(),env:KO(uL(),uL()).optional()}),zV9=R2({name:uL(),email:uL().email().optional(),url:uL().url().optional()}),NV9=R2({type:uL(),url:uL().url()}),OV9=XjI.partial(),xV9=XjI.extend({platform_overrides:KO(uL(),OV9).optional()}),SV9=R2({type:QO(["python","node","binary"]),entry_point:uL(),mcp_config:xV9}),jV9=R2({claude_desktop:uL().optional(),platforms:FX(QO(["darwin","win32","linux"])).optional(),runtimes:R2({python:uL().optional(),node:uL().optional()}).optional()}).passthrough(),RV9=R2({name:uL(),description:uL().optional()}),yV9=R2({name:uL(),description:uL().optional(),arguments:FX(uL()).optional(),text:uL()}),vV9=R2({type:QO(["string","number","boolean","directory","file"]),title:uL(),description:uL(),required:PQ().optional(),default:tAH([uL(),Tq(),PQ(),FX(uL())]).optional(),multiple:PQ().optional(),sensitive:PQ().optional(),min:Tq().optional(),max:Tq().optional()}),D8E=KO(uL(),tAH([uL(),Tq(),PQ(),FX(uL())])),hV9=R2({$schema:uL().optional(),dxt_version:uL().optional().describe("@deprecated Use manifest_version instead"),manifest_version:uL().optional(),name:uL(),display_name:uL().optional(),version:uL(),description:uL(),long_description:uL().optional(),author:zV9,repository:NV9.optional(),homepage:uL().url().optional(),documentation:uL().url().optional(),support:uL().url().optional(),icon:uL().optional(),screenshots:FX(uL()).optional(),server:SV9,tools:FX(RV9).optional(),tools_generated:PQ().optional(),prompts:FX(yV9).optional(),prompts_generated:PQ().optional(),keywords:FX(uL()).optional(),license:uL().optional(),compatibility:jV9.optional(),user_config:KO(uL(),vV9).optional()}).refine((H)=>!!(H.dxt_version||H.manifest_version),{message:"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided"}),B8E=R2({status:QO(["signed","unsigned","self-signed"]),publisher:uL().optional(),issuer:uL().optional(),valid_from:uL().optional(),valid_to:uL().optional(),fingerprint:uL().optional()})});var bV9,kV9;var lWA=K(()=>{cWA();LRH();JjI();bV9=b(rOI(),1),kV9=b(tOI(),1)});var FjI=K(()=>{DQA();lWA();LRH();aKA()});function iWA(H,$){if(typeof H==="string"){let A=H;for(let[L,I]of Object.entries($)){let D=new RegExp(`\\$\\{${L}\\}`,"g");if(A.match(D))if(Array.isArray(I))console.warn(`Cannot replace ${L} with array value in string context: "${H}"`,{key:L,replacement:I});else A=A.replace(D,I)}return A}else if(Array.isArray(H)){let A=[];for(let L of H)if(typeof L==="string"&&L.match(/^\$\{user_config\.[^}]+\}$/)){let I=L.match(/^\$\{([^}]+)\}$/)?.[1];if(I&&$[I]){let D=$[I];if(Array.isArray(D))A.push(...D);else A.push(D)}else A.push(L)}else A.push(iWA(L,$));return A}else if(H&&typeof H==="object"){let A={};for(let[L,I]of Object.entries(H))A[L]=iWA(I,$);return A}return H}async function nJ$(H){let{manifest:$,extensionPath:A,systemDirs:L,userConfig:I,pathSeparator:D,logger:B}=H,f=$.server?.mcp_config;if(!f)return;let E={...f};if(f.platform_overrides){if("linux"in f.platform_overrides){let U=f.platform_overrides.linux;E.command=U.command||E.command,E.args=U.args||E.args,E.env=U.env||E.env}}if(uV9({manifest:$,userConfig:I})){B?.warn(`Extension ${$.name} has missing required configuration, skipping MCP config`);return}let M={__dirname:A,pathSeparator:D,"/":D,...L},G={};if($.user_config){for(let[U,X]of Object.entries($.user_config))if(X.default!==void 0)G[U]=X.default}if(I)Object.assign(G,I);for(let[U,X]of Object.entries(G)){let J=`user_config.${U}`;if(Array.isArray(X))M[J]=X.map(String);else if(typeof X==="boolean")M[J]=X?"true":"false";else M[J]=String(X)}return E=iWA(E,M),E}function KjI(H){return H===void 0||H===null||H===""}function uV9({manifest:H,userConfig:$}){if(!H.user_config)return!1;let A=$||{};for(let[L,I]of Object.entries(H.user_config))if(I.required){let D=A[L];if(KjI(D)||Array.isArray(D)&&(D.length===0||D.some(KjI)))return!0}return!1}var QjI=()=>{};var nWA=K(()=>{aKA();FjI();cWA();DQA();dWA();lWA();LRH();QjI()});function gV9(H){let $=lX$.safeParse(H);if(!$.success){let A=$.error.flatten(),L=[...Object.entries(A.fieldErrors).map(([I,D])=>`${I}: ${D?.join(", ")}`),...A.formErrors||[]].filter(Boolean).join("; ");throw Error(`Invalid manifest: ${L}`)}return $.data}function mV9(H){let $;try{$=DA(H)}catch(A){throw Error(`Invalid JSON in manifest.json: ${A instanceof Error?A.message:String(A)}`)}return gV9($)}function rWA(H){let $=new TextDecoder().decode(H);return mV9($)}var WjI=K(()=>{nWA();Z$()});function pV9(H){if(nMH(H))return!1;let $=rJ$.normalize(H);if(rJ$.isAbsolute($))return!1;return!0}function dV9(H,$){$.fileCount++;let A;if($.fileCount>ma.MAX_FILE_COUNT)A=`Archive contains too many files: ${$.fileCount} (max: ${ma.MAX_FILE_COUNT})`;if(!pV9(H.name))A=`Unsafe file path detected: "${H.name}". Path traversal or absolute paths are not allowed.`;let L=H.originalSize||0;if(L>ma.MAX_FILE_SIZE)A=`File "${H.name}" is too large: ${Math.round(L/1024/1024)}MB (max: ${Math.round(ma.MAX_FILE_SIZE/1024/1024)}MB)`;if($.totalUncompressedSize+=L,$.totalUncompressedSize>ma.MAX_TOTAL_SIZE)A=`Archive total size is too large: ${Math.round($.totalUncompressedSize/1024/1024)}MB (max: ${Math.round(ma.MAX_TOTAL_SIZE/1024/1024)}MB)`;let I=$.totalUncompressedSize/$.compressedSize;if(I>ma.MAX_COMPRESSION_RATIO)A=`Suspicious compression ratio detected: ${I.toFixed(1)}:1 (max: ${ma.MAX_COMPRESSION_RATIO}:1). This may be a zip bomb.`;return A?{isValid:!1,error:A}:{isValid:!0}}function VjI(H){let $=zH();if(!$.existsSync(H))throw Error(`Zip file does not exist: ${H}`);try{let A=$.readFileBytesSync(H),I={fileCount:0,totalUncompressedSize:0,compressedSize:A.length,errors:[]},D=mqI(new Uint8Array(A),{filter:(B)=>{let f=dV9(B,I);if(!f.isValid)throw Error(f.error);return!0}});return N(`Zip extraction completed: ${I.fileCount} files, ${Math.round(I.totalUncompressedSize/1024)}KB uncompressed`),D}catch(A){let L=A instanceof Error?A.message:String(A);throw Error(`Failed to read or unzip file: ${L}`)}}var rJ$,ma;var PjI=K(()=>{pqI();E$();DL();ZM();rJ$=b(require("path")),ma={MAX_FILE_SIZE:536870912,MAX_TOTAL_SIZE:1073741824,MAX_FILE_COUNT:1e5,MAX_COMPRESSION_RATIO:50,MIN_COMPRESSION_RATIO:0.5}});function aJ$(H){let $=H?.platform??oA(),A=H?.homedir??_jI.homedir(),L=H?.env??process.env,I={HOME:A,DESKTOP:tDH.join(A,"Desktop"),DOCUMENTS:tDH.join(A,"Documents"),DOWNLOADS:tDH.join(A,"Downloads")};switch($){case"windows":{let D=L.USERPROFILE||A;return{HOME:A,DESKTOP:tDH.join(D,"Desktop"),DOCUMENTS:tDH.join(D,"Documents"),DOWNLOADS:tDH.join(D,"Downloads")}}case"linux":case"wsl":return{HOME:A,DESKTOP:L.XDG_DESKTOP_DIR||I.DESKTOP,DOCUMENTS:L.XDG_DOCUMENTS_DIR||I.DOCUMENTS,DOWNLOADS:L.XDG_DOWNLOAD_DIR||I.DOWNLOADS};case"macos":default:{if($==="unknown")N("Unknown platform detected, using default paths");return I}}}var _jI,tDH;var YjI=K(()=>{Z9();E$();_jI=b(require("os")),tDH=b(require("path"))});function OT(H){return H.endsWith(".mcpb")||H.endsWith(".dxt")}function TjI(H){return H.startsWith("http://")||H.startsWith("https://")}function cV9(H){return oJ$.createHash("sha256").update(H).digest("hex").substring(0,16)}function zjI(H){return Ox.join(H,".mcpb-cache")}function NjI(H,$){let A=oJ$.createHash("md5").update($).digest("hex").substring(0,8);return Ox.join(H,`${A}.metadata.json`)}function CjI(H,$){try{let L=VL().pluginConfigs?.[H]?.mcpServers?.[$];if(!L)return null;return N(`Loaded user config for ${H}/${$} from settings`),L}catch(A){let L=A instanceof Error?A:Error(String(A));return r(L),N(`Failed to load user config for ${H}/${$}: ${A}`,{level:"error"}),null}}function wjI(H,$,A){try{let L=VL();if(!L.pluginConfigs)L.pluginConfigs={};if(!L.pluginConfigs[H])L.pluginConfigs[H]={};if(!L.pluginConfigs[H].mcpServers)L.pluginConfigs[H].mcpServers={};L.pluginConfigs[H].mcpServers[$]=A;let I=II("userSettings",L);if(I.error)throw I.error;N(`Saved user config for ${H}/${$} to user settings`)}catch(L){let I=L instanceof Error?L:Error(String(L));throw r(I),Error(`Failed to save user configuration for ${H}/${$}: ${I.message}`)}}function ZjI(H,$){let A=[];for(let[L,I]of Object.entries($)){let D=H[L];if(I.required&&(D===void 0||D==="")){A.push(`${I.title||L} is required but not provided`);continue}if(D===void 0||D==="")continue;if(I.type==="string"){if(Array.isArray(D)){if(!I.multiple)A.push(`${I.title||L} must be a string, not an array`);else if(!D.every((B)=>typeof B==="string"))A.push(`${I.title||L} must be an array of strings`)}else if(typeof D!=="string")A.push(`${I.title||L} must be a string`)}else if(I.type==="number"&&typeof D!=="number")A.push(`${I.title||L} must be a number`);else if(I.type==="boolean"&&typeof D!=="boolean")A.push(`${I.title||L} must be a boolean`);else if((I.type==="file"||I.type==="directory")&&typeof D!=="string")A.push(`${I.title||L} must be a path string`);if(I.type==="number"&&typeof D==="number"){if(I.min!==void 0&&DI.max)A.push(`${I.title||L} must be at most ${I.max}`)}}return{valid:A.length===0,errors:A}}async function qjI(H,$){let A=await nJ$({manifest:H,extensionPath:$,systemDirs:aJ$(),userConfig:{},pathSeparator:"/"});if(!A){let L=Error(`Failed to generate MCP server configuration from manifest "${H.name}"`);throw r(L),L}return A}async function OjI(H,$){let A=zH(),L=NjI(H,$);if(!A.existsSync(L))return null;try{let I=A.readFileSync(L,{encoding:"utf-8"});return DA(I)}catch(I){let D=I instanceof Error?I:Error(String(I));return r(D),N(`Failed to load MCPB cache metadata: ${I}`,{level:"error"}),null}}async function aWA(H,$,A){let L=zH(),I=NjI(H,$);L.mkdirSync(H),iL(I,yH(A,null,2),"utf-8")}async function lV9(H,$,A){if(N(`Downloading MCPB from ${H}`),A)A(`Downloading ${H}...`);try{let L=await nA.get(H,{timeout:120000,responseType:"arraybuffer",maxRedirects:5,onDownloadProgress:(D)=>{if(D.total&&A){let B=Math.round(D.loaded/D.total*100);A(`Downloading... ${B}%`)}}}),I=new Uint8Array(L.data);if(iL($,Buffer.from(I)),N(`Downloaded ${I.length} bytes to ${$}`),A)A("Download complete");return I}catch(L){let I=L instanceof Error?L.message:String(L),D=Error(`Failed to download MCPB file from ${H}: ${I}`);throw r(D),D}}async function iV9(H,$,A){let L=zH();if(A)A("Extracting files...");L.mkdirSync($);let I=0,D=Object.keys(H).length;for(let[B,f]of Object.entries(H)){let E=Ox.join($,B),M=Ox.dirname(E);if(M!==$&&!L.existsSync(M))L.mkdirSync(M);if(B.endsWith(".json")||B.endsWith(".js")||B.endsWith(".ts")||B.endsWith(".txt")||B.endsWith(".md")||B.endsWith(".yml")||B.endsWith(".yaml")){let U=new TextDecoder().decode(f);iL(E,U,"utf-8")}else iL(E,Buffer.from(f));if(I++,A&&I%10===0)A(`Extracted ${I}/${D} files`)}if(N(`Extracted ${I} files to ${$}`),A)A(`Extraction complete (${I} files)`)}async function nV9(H,$){let A=zH(),L=zjI($),I=await OjI(L,H);if(!I)return!0;if(!A.existsSync(I.extractedPath))return N(`MCPB extraction path missing: ${I.extractedPath}`),!0;if(!TjI(H)){let D=Ox.join($,H);if(!A.existsSync(D))return N(`MCPB source file missing: ${D}`),!0;let B=A.statSync(D),f=new Date(I.cachedAt).getTime(),E=B.mtimeMs;if(E>f)return N(`MCPB file modified: ${new Date(E)} > ${new Date(f)}`),!0}return!1}async function uRH(H,$,A,L,I,D){let B=zH(),f=zjI($);B.mkdirSync(f),N(`Loading MCPB from source: ${H}`);let E=await OjI(f,H);if(E&&!await nV9(H,$)){N(`Using cached MCPB from ${E.extractedPath} (hash: ${E.contentHash})`);let C=Ox.join(E.extractedPath,"manifest.json");if(!B.existsSync(C)){let j=Error(`Cached manifest not found: ${C}`);throw r(j),j}let Y=B.readFileSync(C,{encoding:"utf-8"}),Z=new TextEncoder().encode(Y),q=rWA(Z);if(q.user_config&&Object.keys(q.user_config).length>0){let j=q.name,u=CjI(A,j),y=I||u||{},g=ZjI(y,q.user_config);if(D||!g.valid)return{status:"needs-config",manifest:q,extractedPath:E.extractedPath,contentHash:E.contentHash,configSchema:q.user_config,existingConfig:u||{},validationErrors:g.valid?[]:g.errors};if(I)wjI(A,j,I);let h=await nJ$({manifest:q,extensionPath:E.extractedPath,systemDirs:aJ$(),userConfig:y,pathSeparator:"/"});if(!h){let p=Error(`Failed to generate MCP server configuration from manifest "${q.name}"`);throw r(p),p}return{manifest:q,mcpConfig:h,extractedPath:E.extractedPath,contentHash:E.contentHash}}let O=await qjI(q,E.extractedPath);return{manifest:q,mcpConfig:O,extractedPath:E.extractedPath,contentHash:E.contentHash}}let M,G;if(TjI(H)){let C=oJ$.createHash("md5").update(H).digest("hex").substring(0,8);G=Ox.join(f,`${C}.mcpb`),M=await lV9(H,G,L)}else{let C=Ox.join($,H);if(!B.existsSync(C)){let Y=Error(`MCPB file not found: ${C}`);throw r(Y),Y}if(L)L(`Loading ${H}...`);M=B.readFileBytesSync(C),G=C}let U=cV9(M);if(N(`MCPB content hash: ${U}`),L)L("Extracting MCPB archive...");let X=VjI(G),J=X["manifest.json"];if(!J){let C=Error("No manifest.json found in MCPB file");throw r(C),C}let F=rWA(J);if(N(`MCPB manifest: ${F.name} v${F.version} by ${F.author.name}`),!F.server){let C=Error(`MCPB manifest for "${F.name}" does not define a server configuration`);throw r(C),C}let Q=Ox.join(f,U);if(await iV9(X,Q,L),F.user_config&&Object.keys(F.user_config).length>0){let C=F.name,Y=CjI(A,C),Z=I||Y||{},q=ZjI(Z,F.user_config);if(!q.valid){let u={source:H,contentHash:U,extractedPath:Q,cachedAt:new Date().toISOString(),lastChecked:new Date().toISOString()};return await aWA(f,H,u),{status:"needs-config",manifest:F,extractedPath:Q,contentHash:U,configSchema:F.user_config,existingConfig:Y||{},validationErrors:q.errors}}if(I)wjI(A,C,I);if(L)L("Generating MCP server configuration...");let O=await nJ$({manifest:F,extensionPath:Q,systemDirs:aJ$(),userConfig:Z,pathSeparator:"/"});if(!O){let u=Error(`Failed to generate MCP server configuration from manifest "${F.name}"`);throw r(u),u}let j={source:H,contentHash:U,extractedPath:Q,cachedAt:new Date().toISOString(),lastChecked:new Date().toISOString()};return await aWA(f,H,j),{manifest:F,mcpConfig:O,extractedPath:Q,contentHash:U}}if(L)L("Generating MCP server configuration...");let W=await qjI(F,Q),P={source:H,contentHash:U,extractedPath:Q,cachedAt:new Date().toISOString(),lastChecked:new Date().toISOString()};return await aWA(f,H,P),N(`Successfully loaded MCPB: ${F.name} (extracted to ${Q})`),{manifest:F,mcpConfig:W,extractedPath:Q,contentHash:U}}var oJ$,Ox;var oWA=K(()=>{w1();Z$();nWA();WjI();PjI();DL();E$();_$();YjI();mL();Z$();oJ$=require("crypto"),Ox=require("path")});async function xjI(H,$,A){try{N(`Loading MCP servers from MCPB: ${$}`);let L=H.repository,I=await uRH($,H.path,L,(f)=>{N(`MCPB [${H.name}]: ${f}`)});if("status"in I&&I.status==="needs-config")return N(`MCPB ${$} requires user configuration. `+`User can configure via: /plugin \u2192 Manage plugins \u2192 ${H.name} \u2192 Configure`),null;let D=I,B=D.manifest.name;return N(`Loaded MCP server "${B}" from MCPB (extracted to ${D.extractedPath})`),{[B]:D.mcpConfig}}catch(L){let I=L instanceof Error?L.message:String(L);N(`Failed to load MCPB ${$}: ${I}`,{level:"error"});let D=`${H.name}@${H.repository}`;if($.startsWith("http")&&(I.includes("download")||I.includes("network")))A.push({type:"mcpb-download-failed",source:D,plugin:H.name,url:$,reason:I});else if(I.includes("manifest")||I.includes("user configuration"))A.push({type:"mcpb-invalid-manifest",source:D,plugin:H.name,mcpbPath:$,validationError:I});else A.push({type:"mcpb-extract-failed",source:D,plugin:H.name,mcpbPath:$,reason:I});return null}}async function sWA(H,$=[]){let A={},L=tWA(H.path,".mcp.json");if(L)A={...A,...L};if(H.manifest.mcpServers){let I=H.manifest.mcpServers;if(typeof I==="string")if(OT(I)){let D=await xjI(H,I,$);if(D)A={...A,...D}}else{let D=tWA(H.path,I);if(D)A={...A,...D}}else if(Array.isArray(I))for(let D of I)if(typeof D==="string")if(OT(D)){let B=await xjI(H,D,$);if(B)A={...A,...B}}else{let B=tWA(H.path,D);if(B)A={...A,...B}}else A={...A,...D};else A={...A,...I}}return Object.keys(A).length>0?A:void 0}function tWA(H,$){let A=zH(),L=SjI.join(H,$);if(!A.existsSync(L))return null;try{let I=A.readFileSync(L,{encoding:"utf-8"}),D=DA(I),B=D.mcpServers||D,f={};for(let[E,M]of Object.entries(B)){let G=zR.safeParse(M);if(G.success)f[E]=G.data;else N(`Invalid MCP server config for ${E} in ${L}: ${G.error.message}`,{level:"error"})}return f}catch(I){return N(`Failed to load MCP servers from ${L}: ${I}`,{level:"error"}),null}}function rV9(H,$){let A={};for(let[L,I]of Object.entries(H)){let D=`plugin:${$}:${L}`;A[D]={...I,scope:"dynamic"}}return A}function gRH(H,$){return H.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g,$)}function aV9(H,$){return H.replace(/\$\{user_config\.([^}]+)\}/g,(A,L)=>{let I=$[L];if(I===void 0)throw Error(`Missing required user configuration value: ${L}. This should have been validated before variable substitution.`);return String(I)})}function oV9(H,$,A,L,I,D){let B=[],f=(M)=>{let G=gRH(M,$);if(A)G=aV9(G,A);let{expanded:U,missingVars:X}=YKH(G);return B.push(...X),U},E;switch(H.type){case void 0:case"stdio":{let M={...H};if(M.command)M.command=f(M.command);if(M.args)M.args=M.args.map((U)=>f(U));let G={CLAUDE_PLUGIN_ROOT:$,...M.env||{}};for(let[U,X]of Object.entries(G))if(U!=="CLAUDE_PLUGIN_ROOT")G[U]=f(X);M.env=G,E=M;break}case"sse":case"http":case"ws":{let M={...H};if(M.url)M.url=f(M.url);if(M.headers){let G={};for(let[U,X]of Object.entries(M.headers))G[U]=f(X);M.headers=G}E=M;break}case"sse-ide":case"ws-ide":case"sdk":case"claudeai-proxy":E=H;break}if(L&&B.length>0){let G=[...new Set(B)].join(", ");if(N(`Missing environment variables in plugin MCP config: ${G}`,{level:"warn"}),I&&D)L.push({type:"mcp-config-invalid",source:`plugin:${I}`,plugin:I,serverName:D,validationError:`Missing environment variables: ${G}`})}return E}async function jjI(H,$=[]){if(!H.enabled)return;let A=H.mcpServers||await sWA(H,$);if(!A)return;let L={};for(let[I,D]of Object.entries(A))L[I]=oV9(D,H.path,void 0,$,H.name,I);return rV9(L,H.name)}var SjI;var tJ$=K(()=>{DL();E$();O$H();oWA();Z$();SjI=require("path")});function eWA(H){if(!H||!H.trim())return[];let $=TE(H,(A)=>`$${A}`);if(!$.success)return H.split(/\s+/).filter(Boolean);return $.tokens.filter((A)=>typeof A==="string")}function mRH(H){if(!H)return[];let $=(A)=>typeof A==="string"&&A.trim()!==""&&!/^\d+$/.test(A);if(Array.isArray(H))return H.filter($);if(typeof H==="string")return H.split(/\s+/).filter($);return[]}function RjI(H,$){let A=H.slice($.length);if(A.length===0)return;return A.map((L)=>`[${L}]`).join(" ")}function sKH(H,$,A=!0,L=[]){if($===void 0||$===null)return H;let I=eWA($),D=H;for(let B=0;B{let E=parseInt(f,10);return I[E]??""}),H=H.replace(/\$(\d+)(?!\w)/g,(B,f)=>{let E=parseInt(f,10);return I[E]??""}),H=H.replaceAll("$ARGUMENTS",$),H===D&&A&&$)H=H+` `)}function L7A(){if(PG())return A7A({displayName:Pm(),memoryDir:$7A()});return null}var pa="MEMORY.md",iRH=200;var I7A=K(()=>{DL();G3();z$()});function $P9(H){return H.replace(/:/g,"-")}function B7A(H,$){let A=$P9(H);switch($){case"project":return kQ.join(C$(),".claude","agent-memory",A)+kQ.sep;case"local":return kQ.join(C$(),".claude","agent-memory-local",A)+kQ.sep;case"user":return kQ.join(D7A.homedir(),".claude","agent-memory",A)+kQ.sep}}function nRH(H){let $=kQ.normalize(H),A=kQ.join(D7A.homedir(),".claude","agent-memory")+kQ.sep,L=kQ.join(C$(),".claude","agent-memory")+kQ.sep,I=kQ.join(C$(),".claude","agent-memory-local")+kQ.sep;return $.startsWith(A)||$.startsWith(L)||$.startsWith(I)}function AP9(H,$){return kQ.join(B7A(H,$),"MEMORY.md")}function LP9(H,$){return kQ.join(B7A(H,$),"memory.md")}function IP9(H,$){let A=zH(),L=LP9(H,$),I=AP9(H,$);try{A.renameSync(L,I)}catch{}}function ujI(H){switch(H){case"user":return"User (~/.claude/agent-memory/)";case"project":return"Project (.claude/agent-memory/)";case"local":return"Local (.claude/agent-memory-local/)";default:return"None"}}function HBH(H,$){IP9(H,$);let A;switch($){case"user":A="- Since this memory is user-scope, keep learnings general since they apply across all projects";break;case"project":A="- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project";break;case"local":A="- Since this memory is local-scope (not checked into version control), tailor your memories to this project and machine";break}return A7A({displayName:"Persistent Agent Memory",memoryDir:B7A(H,$),extraGuidelines:[A]})}var kQ,D7A;var $BH=K(()=>{DL();PI();I7A();kQ=require("path"),D7A=require("os")});function mjI(H,$,A,L){let I=[],D=zH();function B(f,E=[]){try{let M=D.readdirSync(f);for(let G of M){let U=$F$.join(f,G.name);if(G.isDirectory())B(U,[...E,G.name]);else if(G.isFile()&&G.name.endsWith(".md")){let X=pjI(U,$,E,A,L);if(X)I.push(X)}}}catch(M){N(`Failed to scan agents directory ${f}: ${M}`,{level:"error"})}}return B(H),I}function pjI(H,$,A,L,I){let D=zH();if(LR(D,H,I))return null;try{let B=D.readFileSync(H,{encoding:"utf-8"}),{frontmatter:f,content:E}=MK(B,H),M=f.name||$F$.basename(H).replace(/\.md$/,""),U=[$,...A,M].join(":"),X=f.description||f["when-to-use"]||`Agent from ${$} plugin`,J=LBH(f.tools),F=xx(f.skills),Q=f.color,W=f.model,P=f.forkContext,C=E.trim(),Y=f.memory,Z;if(Y!==void 0)if(gjI.includes(Y))Z=Y;else N(`Plugin agent file ${H} has invalid memory value '${Y}'. Valid options: ${gjI.join(", ")}`);if(PG()&&Z&&J!==void 0){let q=new Set(J);for(let O of[U1,TB,$B])if(!q.has(O))J=[...J,O]}return{agentType:U,whenToUse:X,tools:J,...F!==void 0?{skills:F}:{},getSystemPrompt:()=>{if(PG()&&Z){let q=HBH(U,Z);return C+` ]`).replace("lheading",XRI).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},NP9=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OP9=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,FRI=/^( {2,}|\\)\n(?!\s*$)/,xP9=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,WRI=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vP9=XM(WRI,"u").replace(/punct/g,XF$).getRegex(),hP9=XM(WRI,"u").replace(/punct/g,QRI).getRegex(),bP9=XM(VRI,"gu").replace(/notPunctSpace/g,KRI).replace(/punctSpace/g,C7A).replace(/punct/g,XF$).getRegex(),kP9=XM(VRI,"gu").replace(/notPunctSpace/g,RP9).replace(/punctSpace/g,jP9).replace(/punct/g,QRI).getRegex(),uP9=XM("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,KRI).replace(/punctSpace/g,C7A).replace(/punct/g,XF$).getRegex(),gP9=XM(/\\(punct)/,"gu").replace(/punct/g,XF$).getRegex(),mP9=XM(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pP9=XM(_7A).replace("(?:-->|$)","-->").getRegex(),dP9=XM("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",pP9).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),GF$=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,cP9=XM(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",GF$).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),PRI=XM(/^!?\[(label)\]\[(ref)\]/).replace("label",GF$).replace("ref",P7A).getRegex(),_RI=XM(/^!?\[(ref)\](?:\[\])?/).replace("ref",P7A).getRegex(),lP9=XM("reflink|nolink(?!\\()","g").replace("reflink",PRI).replace("nolink",_RI).getRegex(),w7A={_backpedal:$yH,anyPunctuation:gP9,autolink:mP9,blockSkip:yP9,br:FRI,code:OP9,del:$yH,emStrongLDelim:vP9,emStrongRDelimAst:bP9,emStrongRDelimUnd:uP9,escape:NP9,link:cP9,nolink:_RI,punctuation:SP9,reflink:PRI,reflinkSearch:lP9,tag:dP9,text:xP9,url:$yH},iP9={...w7A,link:XM(/^!?\[(label)\]\((.*?)\)/).replace("label",GF$).getRegex(),reflink:XM(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",GF$).getRegex()},Q7A={...w7A,emStrongRDelimAst:kP9,emStrongLDelim:hP9,url:XM(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"};AyH=class AyH{options;block;constructor(H){this.options=H||BBH}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(H){return H}postprocess(H){return H}processAllTokens(H){return H}provideLexer(){return this.block?_P.lex:_P.lexInline}provideParser(){return this.block?ST.parse:ST.parseInline}};DBH=new YRI;ef.options=ef.setOptions=function(H){return DBH.setOptions(H),ef.defaults=DBH.defaults,GRI(ef.defaults),ef};ef.getDefaults=W7A;ef.defaults=BBH;ef.use=function(...H){return DBH.use(...H),ef.defaults=DBH.defaults,GRI(ef.defaults),ef};ef.walkTokens=function(H,$){return DBH.walkTokens(H,$)};ef.parseInline=DBH.parseInline;ef.Parser=ST;ef.parser=ST.parse;ef.Renderer=IyH;ef.TextRenderer=JF$;ef.Lexer=_P;ef.lexer=_P.lex;ef.Tokenizer=LyH;ef.Hooks=AyH;ef.parse=ef;mEE=ef.options,pEE=ef.setOptions,dEE=ef.use,cEE=ef.walkTokens,lEE=ef.parseInline,iEE=ST.parse,nEE=_P.lex});class CRI{cache;constructor(H,$){this.cache=new gN({max:H,maxSize:$,sizeCalculation:(A)=>Math.max(1,Buffer.byteLength(A.content))})}get(H){return this.cache.get(ByH.normalize(H))}set(H,$){return this.cache.set(ByH.normalize(H),$),this}has(H){return this.cache.has(ByH.normalize(H))}delete(H){return this.cache.delete(ByH.normalize(H))}clear(){this.cache.clear()}get size(){return this.cache.size}get max(){return this.cache.max}get maxSize(){return this.cache.maxSize}get calculatedSize(){return this.cache.calculatedSize}keys(){return this.cache.keys()}entries(){return this.cache.entries()}dump(){return this.cache.dump()}load(H){this.cache.load(H)}}function _m(H,$=tP9){return new CRI(H,$)}function Z7A(H){return Object.fromEntries(H.entries())}function yx(H){return Array.from(H.keys())}function Ym(H){let $=_m(H.max,H.maxSize);return $.load(H.dump()),$}function eKH(H,$){let A=Ym(H);for(let[L,I]of $.entries()){let D=A.get(L);if(!D||I.timestamp>D.timestamp)A.set(L,I)}return A}var ByH,fBH=100,tP9=26214400;var Y7=K(()=>{CwH();ByH=require("path")});function ZRI(H){return wm(H,zL())}function H_9(H){let{frontmatter:$,content:A}=MK(H);if(!$.paths)return{content:A};let L=_cL($.paths).map((I)=>{return I.endsWith("/**")?I.slice(0,-3):I}).filter((I)=>I.length>0);if(L.length===0||L.every((I)=>I==="**"))return{content:A};return{content:A,paths:L}}function q7A(H,$){try{let A=zH();if(!A.existsSync(H)||!A.statSync(H).isFile())return null;let L=Sf.extname(H).toLowerCase();if(L&&!eP9.has(L))return N(`Skipping non-text file in @include: ${H}`),null;let I=A.readFileSync(H,{encoding:"utf-8"}),{content:D,paths:B}=H_9(I);return{path:H,type:$,content:D,globs:B}}catch(A){if(A instanceof Error&&A.message.includes("EACCES"))c("tengu_claude_md_permission_error",{is_access_error:1,has_home_dir:H.includes(UL())?1:0})}return null}function $_9(H,$){let A=new Set,I=new _P({gfm:!1}).lex(H);function D(B){for(let f of B){if(f.type==="code"||f.type==="codespan")continue;if(f.type==="text"){let E=f.text||"",M=/(?:^|\s)@((?:[^\s\\]|\\ )+)/g,G;while((G=M.exec(E))!==null){let U=G[1];if(!U)continue;if(U=U.replace(/\\ /g," "),U){if(U.startsWith("./")||U.startsWith("~/")||U.startsWith("/")&&U!=="/"||!U.startsWith("@")&&!U.match(/^[#%^&*()]+/)&&U.match(/^[a-zA-Z0-9._-]/)){let J=xD(U,Sf.dirname($));A.add(J)}}}}if(f.tokens)D(f.tokens);if(f.items)D(f.items)}}return D(I),[...A]}function jT(H,$,A,L,I=0,D){if(A.has(H)||I>=A_9)return[];let{resolvedPath:B,isSymlink:f}=OU(zH(),H);if(A.add(H),f)A.add(B);let E=q7A(H,$);if(!E||!E.content.trim())return[];if(D)E.parent=D;let M=[];M.push(E);let G=$_9(E.content,B);for(let U of G){if(!ZRI(U)&&!L)continue;let J=jT(U,$,A,L,I+1,H);M.push(...J)}return M}function EBH({rulesDir:H,type:$,processedPaths:A,includeExternal:L,conditionalRule:I,visitedDirs:D=new Set}){if(D.has(H))return[];try{let B=zH();if(!B.existsSync(H)||!B.statSync(H).isDirectory())return[];let{resolvedPath:f,isSymlink:E}=OU(B,H);if(D.add(H),E)D.add(f);let M=[],G=B.readdirSync(f);for(let U of G){let X=Sf.join(H,U.name),{resolvedPath:J,isSymlink:F}=OU(B,X),Q=F?B.statSync(J):null,W=Q?Q.isDirectory():U.isDirectory(),P=Q?Q.isFile():U.isFile();if(W)M.push(...EBH({rulesDir:J,type:$,processedPaths:A,includeExternal:L,conditionalRule:I,visitedDirs:D}));else if(P&&U.name.endsWith(".md")){let C=jT(J,$,A,L);M.push(...C.filter((Y)=>I?Y.globs:!Y.globs))}}return M}catch(B){if(B instanceof Error&&B.message.includes("EACCES"))c("tengu_claude_rules_md_permission_error",{is_access_error:1,has_home_dir:H.includes(UL())?1:0});return[]}}function MBH(){return QJ().filter((H)=>H.content.length>Cm)}function GBH(){return null}function T7A(){return[]}function TRI(H,$){let A=[],L=N7A();if(A.push(...KF$(H,L,"Managed",$,!1)),HF("userSettings")){let I=O7A();A.push(...KF$(H,I,"User",$,!0))}return A}function zRI(H,$,A){let L=[];if(HF("projectSettings")){let B=Sf.join(H,"CLAUDE.md");L.push(...jT(B,"Project",A,!1));let f=Sf.join(H,".claude","CLAUDE.md");L.push(...jT(f,"Project",A,!1))}if(HF("localSettings")){let B=Sf.join(H,"CLAUDE.local.md");L.push(...jT(B,"Local",A,!1))}let I=Sf.join(H,".claude","rules"),D=new Set(A);L.push(...EBH({rulesDir:I,type:"Project",processedPaths:D,includeExternal:!1,conditionalRule:!1})),L.push(...KF$($,I,"Project",A,!1));for(let B of D)A.add(B);return L}function NRI(H,$,A){let L=Sf.join(H,".claude","rules");return KF$($,L,"Project",A,!1)}function KF$(H,$,A,L,I){return EBH({rulesDir:$,type:A,processedPaths:L,includeExternal:I,conditionalRule:!0}).filter((B)=>{if(!B.globs||B.globs.length===0)return!1;let f=A==="Project"?Sf.dirname(Sf.dirname($)):zL(),E=Sf.isAbsolute(H)?Sf.relative(f,H):H;return wRI.default().add(B.globs).ignores(E)})}function fyH(){let H=[];for(let $ of QJ(!0))if($.type!=="User"&&$.parent&&!ZRI($.path))H.push({path:$.path,parent:$.parent});return H}function z7A(){return fyH().length>0}async function ORI(){let H=Mf();if(H.hasClaudeMdExternalIncludesApproved||H.hasClaudeMdExternalIncludesWarningShown)return!1;return z7A()}function xRI(H){let $=Sf.basename(H);if($==="CLAUDE.md"||$==="CLAUDE.local.md")return!0;if($.endsWith(".md")&&H.includes(`${Sf.sep}.claude${Sf.sep}rules${Sf.sep}`))return!0;return!1}var Sf,wRI,sP9="Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.",Cm=40000,HQH=3000,eP9,A_9=5,QJ,qRI=()=>{let H=QJ(),$=[];for(let A of H)if(A.content){let L=A.type==="Project"?" (project instructions, checked into the codebase)":A.type==="Local"?" (user's private project instructions, not checked in)":" (user's private global instructions for all projects)";$.push(`Contents of ${A.path}${L}: `)}`};var mQ=K(()=>{tD();g$();DL();ZM();z$();FF$();W4();BM();vA();NA();Vu();Y7();E$();Z6();G3();G3();Sf=require("path"),wRI=b(fRH(),1),eP9=new Set([".md",".txt",".text",".json",".yaml",".yml",".toml",".xml",".csv",".html",".htm",".css",".scss",".sass",".less",".js",".ts",".tsx",".jsx",".mjs",".cjs",".mts",".cts",".py",".pyi",".pyw",".rb",".erb",".rake",".go",".rs",".java",".kt",".kts",".scala",".c",".cpp",".cc",".cxx",".h",".hpp",".hxx",".cs",".swift",".sh",".bash",".zsh",".fish",".ps1",".bat",".cmd",".env",".ini",".cfg",".conf",".config",".properties",".sql",".graphql",".gql",".proto",".vue",".svelte",".astro",".ejs",".hbs",".pug",".jade",".php",".pl",".pm",".lua",".r",".R",".dart",".ex",".exs",".erl",".hrl",".clj",".cljs",".cljc",".edn",".hs",".lhs",".elm",".ml",".mli",".f",".f90",".f95",".for",".cmake",".make",".makefile",".gradle",".sbt",".rst",".adoc",".asciidoc",".org",".tex",".latex",".lock",".log",".diff",".patch"]);QJ=o$((H=!1)=>{let $=Date.now();EL("info","memory_files_started");let A=[],L=new Set,I=Mf(),D=H||I.hasClaudeMdExternalIncludesApproved||!1,B=yv("Managed");A.push(...jT(B,"Managed",L,D));let f=N7A();if(A.push(...EBH({rulesDir:f,type:"Managed",processedPaths:L,includeExternal:D,conditionalRule:!1})),HF("userSettings")){let G=yv("User");A.push(...jT(G,"User",L,!0));let U=O7A();A.push(...EBH({rulesDir:U,type:"User",processedPaths:L,includeExternal:!0,conditionalRule:!1}))}let E=[],M=zL();while(M!==Sf.parse(M).root)E.push(M),M=Sf.dirname(M);for(let G of E.reverse()){if(HF("projectSettings")){let U=Sf.join(G,"CLAUDE.md");A.push(...jT(U,"Project",L,D));let X=Sf.join(G,".claude","CLAUDE.md");A.push(...jT(X,"Project",L,D));let J=Sf.join(G,".claude","rules");A.push(...EBH({rulesDir:J,type:"Project",processedPaths:L,includeExternal:D,conditionalRule:!1}))}if(HF("localSettings")){let U=Sf.join(G,"CLAUDE.local.md");A.push(...jT(U,"Local",L,D))}}if(A$(process.env.CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD)){let G=CN();for(let U of G){let X=Sf.join(U,"CLAUDE.md");A.push(...jT(X,"Project",L,D));let J=Sf.join(U,".claude","CLAUDE.md");A.push(...jT(J,"Project",L,D));let F=Sf.join(U,".claude","rules");A.push(...EBH({rulesDir:F,type:"Project",processedPaths:L,includeExternal:D,conditionalRule:!1}))}}if(PG()){let G=q7A(HF$(),"AutoMem");if(G&&!L.has(G.path))L.add(G.path),A.push(G)}return EL("info","memory_files_completed",{duration_ms:Date.now()-$,file_count:A.length,total_content_length:A.reduce((G,U)=>G+U.content.length,0)}),A})});function b4(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="in_process_teammate"}function RT(H){let{viewingAgentTaskId:$,tasks:A}=H;if(!$)return;let L=A[$];if(!L)return;if(!b4(L))return;return L}function SRI(H){let $=RT(H);if($)return{type:"viewed",task:$};return{type:"leader"}}function jRI(H){return RT(H)!==void 0}var UBH=()=>{};function RRI(H){return H.replaceAll(L_9,"'").replaceAll(I_9,"'").replaceAll(D_9,'"').replaceAll(B_9,'"')}function x7A(H){let $=H.split(/(\r\n|\n|\r)/),A="";for(let L=0;L<$.length;L++){let I=$[L];if(I!==void 0)if(L%2===0)A+=I.replace(/\s+$/,"");else A+=I}return A}function XBH(H,$){if(H.includes($))return $;let A=RRI($),I=RRI(H).indexOf(A);if(I!==-1)return H.substring(I,I+$.length);return null}function f_9(H,$,A,L=!1){let I=L?(B,f,E)=>B.replaceAll(f,()=>E):(B,f,E)=>B.replace(f,()=>E);if(A!=="")return I(H,$,A);return!$.endsWith(` This is a BLOCKING REQUIREMENT - deferred tools are NOT available until you load them using this tool. Look for messages in the conversation for the list of tools you can discover. Both query modes (keyword search and direct selection) load the returned tools \u2014 once a tool appears in the results, it is immediately available to call.${LyI}`});function ByI(H){return H.isNonInteractiveSession}function xF$(H){try{let $=new DyI.Ajv({allErrors:!0});if(!$.validateSchema(H))throw Error(`Invalid JSON Schema: ${$.errorsText($.errors)}`);let L=$.compile(H);return{...h7A,inputJSONSchema:H,async call(I){if(!L(I)){let B=L.errors?.map((f)=>`${f.instancePath||"root"}: ${f.message}`).join(", ");throw Error(`Output does not match required schema: ${B}`)}return{data:"Structured output provided successfully",structured_output:I}}}}catch{return null}}var DyI,W_9,V_9,qK="StructuredOutput",h7A;var hv=K(()=>{mI();Z$();DyI=b(AX$(),1),W_9=S.object({}).passthrough(),V_9=S.string().describe("Structured output tool result");h7A={isMcp:!1,isEnabled(){return!0},isConcurrencySafe(){return!0},isReadOnly(){return!0},isDestructive(){return!1},isOpenWorld(){return!1},name:qK,maxResultSizeChars:1e5,async description(){return"Return structured output in the requested format"},async prompt(){return"Use this tool to return your final response in the requested structured format. You MUST call this tool exactly once at the end of your response to provide the structured output."},inputSchema:W_9,outputSchema:V_9,async call(H){return{data:"Structured output provided successfully",structured_output:H}},async checkPermissions(H){return{behavior:"allow",updatedInput:H}},renderToolUseMessage(H){let $=Object.keys(H);if($.length===0)return null;if($.length<=3)return $.map((A)=>`${A}: ${yH(H[A])}`).join(", ");return`${$.length} fields: ${$.slice(0,3).join(", ")}\u2026`},userFacingName:()=>qK,renderToolUseRejectedMessage(){return"Structured output rejected"},renderToolUseErrorMessage(){return"Structured output error"},renderToolUseProgressMessage(){return null},renderToolResultMessage(H){return H},mapToolResultToToolResultBlockParam(H,$){return{tool_use_id:$,type:"tool_result",content:H}}}});var EQH,b7A,SF$,fyI,jF$;var GyH=K(()=>{tG();Mn();vV();GK();ia();hv();EQH=new Set([fQH,xY,TF$,E0,EU,BQH]),b7A=new Set([...EQH]),SF$=new Set([$B,v2,hu,s8,w4,af,WD,TB,U1,aW,WJ,qK,C7,...[],vv]),fyI=new Set([jx,WBH,VBH,xT]),jF$=new Set([vx,QBH,vv,jx,WBH,VBH,xT,E0])});function v8(){return!1}var w7=K(()=>{z$();NA();GyH();hv()});function Z7(H){return H}function ZP(H){return H}var RF$="REPL",EyI;var k7A=K(()=>{EyI=new Set(["Read","Write","Edit","Glob","Grep","Bash","NotebookEdit"])});function UyH(H){let $=UL();if(!H.startsWith($))return null;let A=H.split(bv.win32.sep).join(bv.posix.sep);if(A.includes("/session-memory/")&&A.endsWith(".md"))return"session_memory";if(A.includes("/projects/")&&A.endsWith(".jsonl"))return"session_transcript";return null}function yF$(H){let $=H.split(bv.win32.sep).join(bv.posix.sep);if($.includes("session-memory")&&($.includes(".md")||$.endsWith("*")))return"session_memory";if($.includes(".jsonl")||$.includes("projects")&&$.includes("*.jsonl"))return"session_transcript";return null}function vF$(H){if(PG())return lRH(H);return!1}function P_9(H){if(PG())return nRH(H);return!1}function na(H){if(xRI(H))return!0;if(vF$(H))return!0;if(UyH(H)!==null)return!0;if(P_9(H))return!0;return!1}function MyI(H){let $=bv.normalize(H),A=$.split(bv.win32.sep).join(bv.posix.sep);if(PG()&&(A.includes("/agent-memory/")||A.includes("/agent-memory-local/")))return!0;let L=UL();if(!$.startsWith(L))return!1;if(A.includes("/projects/")||A.includes("/session-memory/"))return!0;if(PG()&&A.includes("/memory/"))return!0;return!1}function GyI(H){if(yF$(H)!==null)return!0;let $=H.replace(/\\/g,"/");if($.includes("CLAUDE.md")||$.includes("CLAUDE.local.md")||$.includes(".claude/rules/"))return!0;if(PG()&&($.includes("agent-memory/")||$.includes("agent-memory-local/")))return!0;return!1}var bv;var XyH=K(()=>{mQ();NA();G3();$BH();G3();bv=require("path")});function __9(H){let $=H;return $?.file_path??$?.path}function Y_9(H){let $=H;if(!$)return!1;if($.path){if(na($.path)||MyI($.path))return!0}if($.glob&&GyI($.glob))return!0;return!1}function C_9(H,$){if(H!==U1&&H!==TB)return!1;let A=__9($);return A!==void 0&&na(A)}function bF$(H,$,A){if(H===RF$)return{isCollapsible:!1,isSearch:!1,isRead:!1,isREPL:!0,isMemoryWrite:!1};if(C_9(H,$))return{isCollapsible:!0,isSearch:!1,isRead:!1,isREPL:!1,isMemoryWrite:!0};let L=$w(A,H);if(!L?.isSearchOrReadCommand)return{isCollapsible:!1,isSearch:!1,isRead:!1,isREPL:!1,isMemoryWrite:!1};let I=L.isSearchOrReadCommand($);return{isCollapsible:I.isSearch||I.isRead,isSearch:I.isSearch,isRead:I.isRead,isREPL:!1,isMemoryWrite:!1}}function JyH(H,$){if(H?.type==="tool_use"&&H.name){let A=bF$(H.name,H.input,$);if(A.isCollapsible||A.isREPL)return{isSearch:A.isSearch,isRead:A.isRead,isREPL:A.isREPL,isMemoryWrite:A.isMemoryWrite}}return null}function hF$(H,$,A){return bF$(H,$,A).isCollapsible}function w_9(H,$){if(H.type==="assistant"){let A=H.message.content[0],L=JyH(A,$);if(L&&A?.type==="tool_use")return{name:A.name,input:A.input,...L}}if(H.type==="grouped_tool_use"){let A=H.messages[0]?.message.content[0],L=JyH(A?{type:"tool_use",name:H.toolName,input:A.input}:void 0,$);if(L&&A?.type==="tool_use")return{name:H.toolName,input:A.input,...L}}return null}function Z_9(H){if(H.type==="assistant"){let $=H.message.content[0];if($?.type==="text"&&$.text.trim().length>0)return!0}return!1}function q_9(H,$){if(H.type==="assistant"){let A=H.message.content[0];if(A?.type==="tool_use"&&!hF$(A.name,A.input,$))return!0}if(H.type==="grouped_tool_use"){let A=H.messages[0]?.message.content[0];if(A?.type==="tool_use"&&!hF$(H.toolName,A.input,$))return!0}return!1}function T_9(H){if(H.type==="assistant"){let $=H.message.content[0];if($?.type==="thinking"||$?.type==="redacted_thinking")return!0}if(H.type==="attachment")return!0;if(H.type==="system")return!0;return!1}function z_9(H,$){if(H.type==="assistant"){let A=H.message.content[0];return A?.type==="tool_use"&&hF$(A.name,A.input,$)}if(H.type==="grouped_tool_use"){let A=H.messages[0]?.message.content[0];return A?.type==="tool_use"&&hF$(H.toolName,A.input,$)}return!1}function N_9(H,$){if(H.type==="user"){let A=H.message.content.filter((L)=>L.type==="tool_result");return A.length>0&&A.every((L)=>$.has(L.tool_use_id))}return!1}function XyI(H){if(H.type==="assistant"){let $=H.message.content[0];if($?.type==="tool_use")return[$.id]}if(H.type==="grouped_tool_use")return H.messages.map(($)=>{let A=$.message.content[0];return A.type==="tool_use"?A.id:""}).filter(Boolean);return[]}function MQH(H){let $=[];for(let A of H.messages)$.push(...XyI(A));return $}function JyI(H,$){return MQH(H).some((A)=>$.has(A))}function FyI(H){let $=H.displayMessage;if($.type==="grouped_tool_use")return $.displayMessage;return $}function u7A(H){if(H.type==="grouped_tool_use")return H.messages.length;return 1}function O_9(H){let $=[];if(H.type==="assistant"){let A=H.message.content[0];if(A?.type==="tool_use"){let L=A.input;if(L?.file_path)$.push(L.file_path)}}else if(H.type==="grouped_tool_use")for(let A of H.messages){let L=A.message.content[0];if(L?.type==="tool_use"){let I=L.input;if(I?.file_path)$.push(I.file_path)}}return $}function UyI(){return{messages:[],searchCount:0,readFilePaths:new Set,readOperationCount:0,toolUseIds:new Set,memorySearchCount:0,memoryReadFilePaths:new Set,memoryWriteCount:0}}function x_9(H){let $=H.messages[0],A=H.readFilePaths.size+H.readOperationCount,L=H.memoryReadFilePaths.size;return{type:"collapsed_read_search",searchCount:Math.max(0,H.searchCount-H.memorySearchCount),readCount:Math.max(0,A-L),replCount:0,memorySearchCount:H.memorySearchCount,memoryReadCount:L,memoryWriteCount:H.memoryWriteCount,messages:H.messages,displayMessage:$,uuid:`collapsed-${$.uuid}`,timestamp:$.timestamp}}function KyI(H,$){let A=[],L=UyI(),I=[];function D(){if(L.messages.length===0)return;A.push(x_9(L));for(let B of I)A.push(B);I=[],L=UyI()}for(let B of H)if(z_9(B,$)){let f=w_9(B,$);if(f.isMemoryWrite)L.memoryWriteCount+=u7A(B);else if(f.isSearch){let E=u7A(B);if(L.searchCount+=E,Y_9(f.input))L.memorySearchCount+=E}else{let E=O_9(B);for(let M of E)if(L.readFilePaths.add(M),na(M))L.memoryReadFilePaths.add(M);if(E.length===0)L.readOperationCount+=u7A(B)}for(let E of XyI(B))L.toolUseIds.add(E);L.messages.push(B)}else if(N_9(B,L.toolUseIds))L.messages.push(B);else if(T_9(B))if(L.messages.length>0)I.push(B);else A.push(B);else if(Z_9(B))D(),A.push(B);else if(q_9(B,$))D(),A.push(B);else D(),A.push(B);return D(),A}function kF$(H,$,A,L=0,I){let D=[];if(I){let{memorySearchCount:f,memoryReadCount:E,memoryWriteCount:M}=I;if(E>0){let G=A?D.length===0?"Recalling":"recalling":D.length===0?"Recalled":"recalled";D.push(`${G} ${E} ${E===1?"memory":"memories"}`)}if(f>0){let G=A?D.length===0?"Searching":"searching":D.length===0?"Searched":"searched";D.push(`${G} memories`)}if(M>0){let G=A?D.length===0?"Writing":"writing":D.length===0?"Wrote":"wrote";D.push(`${G} ${M} ${M===1?"memory":"memories"}`)}}if(H>0){let f=A?D.length===0?"Searching for":"searching for":D.length===0?"Searched for":"searched for";D.push(`${f} ${H} ${H===1?"pattern":"patterns"}`)}if($>0){let f=A?D.length===0?"Reading":"reading":D.length===0?"Read":"read";D.push(`${f} ${$} ${$===1?"file":"files"}`)}if(L>0){let f=A?"REPL'ing":"REPL'd";D.push(`${f} ${L} ${L===1?"time":"times"}`)}let B=D.join(", ");return A?`${B}\u2026`:B}function kv(H){if(H.length===0)return;let $=0,A=0;for(let I=H.length-1;I>=0;I--){let D=H[I];if(D.isSearch)$++;else if(D.isRead)A++;else break}if($+A>=2)return kF$($,A,!0);for(let I=H.length-1;I>=0;I--)if(H[I]?.activityDescription)return H[I].activityDescription;return}var hx=K(()=>{k7A();GK();XyH()});function FyH(){return{toolUseCount:0,latestInputTokens:0,cumulativeOutputTokens:0,recentActivities:[]}}function g7A(H){return H.latestInputTokens+H.cumulativeOutputTokens}function GQH(H,$,A,L){if($.type!=="assistant")return;let I=$.message.usage;H.latestInputTokens=I.input_tokens+(I.cache_creation_input_tokens??0)+(I.cache_read_input_tokens??0),H.cumulativeOutputTokens+=I.output_tokens;for(let D of $.message.content)if(D.type==="tool_use"){if(H.toolUseCount++,D.name!==qK){let B=D.input,f=L?bF$(D.name,B,L):void 0;H.recentActivities.push({toolName:D.name,input:B,activityDescription:A?.(D.name,B),isSearch:f?.isSearch,isRead:f?.isRead})}}while(H.recentActivities.length>S_9)H.recentActivities.shift()}function KyH(H){return{toolUseCount:H.toolUseCount,tokenCount:g7A(H),lastActivity:H.recentActivities.length>0?H.recentActivities[H.recentActivities.length-1]:void 0,recentActivities:[...H.recentActivities]}}function QyH(H){return($,A)=>{return $w(H,$)?.getActivityDescription?.(A)??void 0}}function ra(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="local_agent"}function PBH(H,$,A,L,I,D,B){let f=!1;if(d1(H,I,(F)=>{if(F.notified)return F;return f=!0,{...F,notified:!0}}),!f)return;let E=A==="completed"?`Agent "${$}" completed`:A==="failed"?`Agent "${$}" failed: ${L||"Unknown error"}`:`Agent "${$}" was stopped`,M=vM(H),G=D?` `),N(`Session environment script ready (${ta.length} chars total)`),ta}var gv,lF$,ta=void 0;var iF$=K(()=>{E$();Z9();NA();g$();gv=require("fs"),lF$=require("path")});function a7A(H){let $=k_9[H],A=process.env[H];if(A===void 0)return $;return A==="true"}function XQH(){let H=ux(),$=j$(),A={"user.id":H};if(a7A("OTEL_METRICS_INCLUDE_SESSION_ID"))A["session.id"]=$;if(a7A("OTEL_METRICS_INCLUDE_VERSION"))A["app.version"]={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION;let L=T9();if(L){let{organizationUuid:I,emailAddress:D,accountUuid:B}=L;if(I)A["organization.id"]=I;if(D)A["user.email"]=D;if(B&&a7A("OTEL_METRICS_INCLUDE_ACCOUNT_UUID"))A["user.account_uuid"]=B}if(YY.terminal)A["terminal.type"]=YY.terminal;return A}var k_9;var nF$=K(()=>{g$();vA();Ma();EI();k_9={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}});function g_9(){return A$(process.env.OTEL_LOG_USER_PROMPTS)}function rF$(H){return g_9()?H:""}async function pQ(H,$={}){let A=eS$();if(!A)return;let L={...XQH(),"event.name":H,"event.timestamp":new Date().toISOString(),"event.sequence":u_9++};for(let[I,D]of Object.entries($))if(D!==void 0)L[I]=D;A.emit({body:`claude_code.${H}`,attributes:L})}var u_9=0;var sa=K(()=>{g$();nF$();NA()});var oyI=z((aF$)=>{Object.defineProperty(aF$,"__esModule",{value:!0});aF$._globalThis=void 0;aF$._globalThis=typeof globalThis==="object"?globalThis:global});var tyI=z((YBH)=>{var m_9=YBH&&YBH.__createBinding||(Object.create?function(H,$,A,L){if(L===void 0)L=A;Object.defineProperty(H,L,{enumerable:!0,get:function(){return $[A]}})}:function(H,$,A,L){if(L===void 0)L=A;H[L]=$[A]}),p_9=YBH&&YBH.__exportStar||function(H,$){for(var A in H)if(A!=="default"&&!Object.prototype.hasOwnProperty.call($,A))m_9($,H,A)};Object.defineProperty(YBH,"__esModule",{value:!0});p_9(oyI(),YBH)});var syI=z((CBH)=>{var d_9=CBH&&CBH.__createBinding||(Object.create?function(H,$,A,L){if(L===void 0)L=A;Object.defineProperty(H,L,{enumerable:!0,get:function(){return $[A]}})}:function(H,$,A,L){if(L===void 0)L=A;H[L]=$[A]}),c_9=CBH&&CBH.__exportStar||function(H,$){for(var A in H)if(A!=="default"&&!Object.prototype.hasOwnProperty.call($,A))d_9($,H,A)};Object.defineProperty(CBH,"__esModule",{value:!0});c_9(tyI(),CBH)});var o7A=z((oF$)=>{Object.defineProperty(oF$,"__esModule",{value:!0});oF$.VERSION=void 0;oF$.VERSION="1.9.0"});var $vI=z((JQH)=>{Object.defineProperty(JQH,"__esModule",{value:!0});JQH.isCompatible=JQH._makeCompatibilityCheck=void 0;var l_9=o7A(),eyI=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function HvI(H){let $=new Set([H]),A=new Set,L=H.match(eyI);if(!L)return()=>!1;let I={major:+L[1],minor:+L[2],patch:+L[3],prerelease:L[4]};if(I.prerelease!=null)return function(E){return E===H};function D(f){return A.add(f),!1}function B(f){return $.add(f),!0}return function(E){if($.has(E))return!0;if(A.has(E))return!1;let M=E.match(eyI);if(!M)return D(E);let G={major:+M[1],minor:+M[2],patch:+M[3],prerelease:M[4]};if(G.prerelease!=null)return D(E);if(I.major!==G.major)return D(E);if(I.major===0){if(I.minor===G.minor&&I.patch<=G.patch)return B(E);return D(E)}if(I.minor<=G.minor)return B(E);return D(E)}}JQH._makeCompatibilityCheck=HvI;JQH.isCompatible=HvI(l_9.VERSION)});var wBH=z((ea)=>{Object.defineProperty(ea,"__esModule",{value:!0});ea.unregisterGlobal=ea.getGlobal=ea.registerGlobal=void 0;var i_9=syI(),FQH=o7A(),n_9=$vI(),r_9=FQH.VERSION.split(".")[0],PyH=Symbol.for(`opentelemetry.js.api.${r_9}`),_yH=i_9._globalThis;function a_9(H,$,A,L=!1){var I;let D=_yH[PyH]=(I=_yH[PyH])!==null&&I!==void 0?I:{version:FQH.VERSION};if(!L&&D[H]){let B=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${H}`);return A.error(B.stack||B.message),!1}if(D.version!==FQH.VERSION){let B=Error(`@opentelemetry/api: Registration of version v${D.version} for ${H} does not match previously registered API v${FQH.VERSION}`);return A.error(B.stack||B.message),!1}return D[H]=$,A.debug(`@opentelemetry/api: Registered a global for ${H} v${FQH.VERSION}.`),!0}ea.registerGlobal=a_9;function o_9(H){var $,A;let L=($=_yH[PyH])===null||$===void 0?void 0:$.version;if(!L||!(0,n_9.isCompatible)(L))return;return(A=_yH[PyH])===null||A===void 0?void 0:A[H]}ea.getGlobal=o_9;function t_9(H,$){$.debug(`@opentelemetry/api: Unregistering a global for ${H} v${FQH.VERSION}.`);let A=_yH[PyH];if(A)delete A[H]}ea.unregisterGlobal=t_9});var LvI=z((tF$)=>{Object.defineProperty(tF$,"__esModule",{value:!0});tF$.DiagComponentLogger=void 0;var s_9=wBH();class AvI{constructor(H){this._namespace=H.namespace||"DiagComponentLogger"}debug(...H){return YyH("debug",this._namespace,H)}error(...H){return YyH("error",this._namespace,H)}info(...H){return YyH("info",this._namespace,H)}warn(...H){return YyH("warn",this._namespace,H)}verbose(...H){return YyH("verbose",this._namespace,H)}}tF$.DiagComponentLogger=AvI;function YyH(H,$,A){let L=(0,s_9.getGlobal)("diag");if(!L)return;return A.unshift($),L[H](...A)}});var sF$=z((CyH)=>{Object.defineProperty(CyH,"__esModule",{value:!0});CyH.DiagLogLevel=void 0;var e_9;(function(H){H[H.NONE=0]="NONE",H[H.ERROR=30]="ERROR",H[H.WARN=50]="WARN",H[H.INFO=60]="INFO",H[H.DEBUG=70]="DEBUG",H[H.VERBOSE=80]="VERBOSE",H[H.ALL=9999]="ALL"})(e_9=CyH.DiagLogLevel||(CyH.DiagLogLevel={}))});var IvI=z((eF$)=>{Object.defineProperty(eF$,"__esModule",{value:!0});eF$.createLogLevelDiagLogger=void 0;var zm=sF$();function HY9(H,$){if(Hzm.DiagLogLevel.ALL)H=zm.DiagLogLevel.ALL;$=$||{};function A(L,I){let D=$[L];if(typeof D==="function"&&H>=I)return D.bind($);return function(){}}return{error:A("error",zm.DiagLogLevel.ERROR),warn:A("warn",zm.DiagLogLevel.WARN),info:A("info",zm.DiagLogLevel.INFO),debug:A("debug",zm.DiagLogLevel.DEBUG),verbose:A("verbose",zm.DiagLogLevel.VERBOSE)}}eF$.createLogLevelDiagLogger=HY9});var ZBH=z(($K$)=>{Object.defineProperty($K$,"__esModule",{value:!0});$K$.DiagAPI=void 0;var $Y9=LvI(),AY9=IvI(),DvI=sF$(),HK$=wBH(),LY9="diag";class t7A{constructor(){function H(L){return function(...I){let D=(0,HK$.getGlobal)("diag");if(!D)return;return D[L](...I)}}let $=this,A=(L,I={logLevel:DvI.DiagLogLevel.INFO})=>{var D,B,f;if(L===$){let G=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return $.error((D=G.stack)!==null&&D!==void 0?D:G.message),!1}if(typeof I==="number")I={logLevel:I};let E=(0,HK$.getGlobal)("diag"),M=(0,AY9.createLogLevelDiagLogger)((B=I.logLevel)!==null&&B!==void 0?B:DvI.DiagLogLevel.INFO,L);if(E&&!I.suppressOverrideMessage){let G=(f=Error().stack)!==null&&f!==void 0?f:"";E.warn(`Current logger will be overwritten from ${G}`),M.warn(`Current logger will overwrite one already registered from ${G}`)}return(0,HK$.registerGlobal)("diag",M,$,!0)};$.setLogger=A,$.disable=()=>{(0,HK$.unregisterGlobal)(LY9,$)},$.createComponentLogger=(L)=>{return new $Y9.DiagComponentLogger(L)},$.verbose=H("verbose"),$.debug=H("debug"),$.info=H("info"),$.warn=H("warn"),$.error=H("error")}static instance(){if(!this._instance)this._instance=new t7A;return this._instance}}$K$.DiagAPI=t7A});var BvI=z((AK$)=>{Object.defineProperty(AK$,"__esModule",{value:!0});AK$.BaggageImpl=void 0;class KQH{constructor(H){this._entries=H?new Map(H):new Map}getEntry(H){let $=this._entries.get(H);if(!$)return;return Object.assign({},$)}getAllEntries(){return Array.from(this._entries.entries()).map(([H,$])=>[H,$])}setEntry(H,$){let A=new KQH(this._entries);return A._entries.set(H,$),A}removeEntry(H){let $=new KQH(this._entries);return $._entries.delete(H),$}removeEntries(...H){let $=new KQH(this._entries);for(let A of H)$._entries.delete(A);return $}clear(){return new KQH}}AK$.BaggageImpl=KQH});var fvI=z((LK$)=>{Object.defineProperty(LK$,"__esModule",{value:!0});LK$.baggageEntryMetadataSymbol=void 0;LK$.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var s7A=z((QQH)=>{Object.defineProperty(QQH,"__esModule",{value:!0});QQH.baggageEntryMetadataFromString=QQH.createBaggage=void 0;var IY9=ZBH(),DY9=BvI(),BY9=fvI(),fY9=IY9.DiagAPI.instance();function EY9(H={}){return new DY9.BaggageImpl(new Map(Object.entries(H)))}QQH.createBaggage=EY9;function MY9(H){if(typeof H!=="string")fY9.error(`Cannot create baggage metadata from unknown type: ${typeof H}`),H="";return{__TYPE__:BY9.baggageEntryMetadataSymbol,toString(){return H}}}QQH.baggageEntryMetadataFromString=MY9});var wyH=z((WQH)=>{Object.defineProperty(WQH,"__esModule",{value:!0});WQH.ROOT_CONTEXT=WQH.createContextKey=void 0;function GY9(H){return Symbol.for(H)}WQH.createContextKey=GY9;class IK${constructor(H){let $=this;$._currentContext=H?new Map(H):new Map,$.getValue=(A)=>$._currentContext.get(A),$.setValue=(A,L)=>{let I=new IK$($._currentContext);return I._currentContext.set(A,L),I},$.deleteValue=(A)=>{let L=new IK$($._currentContext);return L._currentContext.delete(A),L}}}WQH.ROOT_CONTEXT=new IK$});var MvI=z((DK$)=>{Object.defineProperty(DK$,"__esModule",{value:!0});DK$.DiagConsoleLogger=void 0;var e7A=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class EvI{constructor(){function H($){return function(...A){if(console){let L=console[$];if(typeof L!=="function")L=console.log;if(typeof L==="function")return L.apply(console,A)}}}for(let $=0;${Object.defineProperty(t0,"__esModule",{value:!0});t0.createNoopMeter=t0.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t0.NOOP_OBSERVABLE_GAUGE_METRIC=t0.NOOP_OBSERVABLE_COUNTER_METRIC=t0.NOOP_UP_DOWN_COUNTER_METRIC=t0.NOOP_HISTOGRAM_METRIC=t0.NOOP_GAUGE_METRIC=t0.NOOP_COUNTER_METRIC=t0.NOOP_METER=t0.NoopObservableUpDownCounterMetric=t0.NoopObservableGaugeMetric=t0.NoopObservableCounterMetric=t0.NoopObservableMetric=t0.NoopHistogramMetric=t0.NoopGaugeMetric=t0.NoopUpDownCounterMetric=t0.NoopCounterMetric=t0.NoopMetric=t0.NoopMeter=void 0;class H6A{constructor(){}createGauge(H,$){return t0.NOOP_GAUGE_METRIC}createHistogram(H,$){return t0.NOOP_HISTOGRAM_METRIC}createCounter(H,$){return t0.NOOP_COUNTER_METRIC}createUpDownCounter(H,$){return t0.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(H,$){return t0.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(H,$){return t0.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(H,$){return t0.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(H,$){}removeBatchObservableCallback(H){}}t0.NoopMeter=H6A;class VQH{}t0.NoopMetric=VQH;class $6A extends VQH{add(H,$){}}t0.NoopCounterMetric=$6A;class A6A extends VQH{add(H,$){}}t0.NoopUpDownCounterMetric=A6A;class L6A extends VQH{record(H,$){}}t0.NoopGaugeMetric=L6A;class I6A extends VQH{record(H,$){}}t0.NoopHistogramMetric=I6A;class ZyH{addCallback(H){}removeCallback(H){}}t0.NoopObservableMetric=ZyH;class D6A extends ZyH{}t0.NoopObservableCounterMetric=D6A;class B6A extends ZyH{}t0.NoopObservableGaugeMetric=B6A;class f6A extends ZyH{}t0.NoopObservableUpDownCounterMetric=f6A;t0.NOOP_METER=new H6A;t0.NOOP_COUNTER_METRIC=new $6A;t0.NOOP_GAUGE_METRIC=new L6A;t0.NOOP_HISTOGRAM_METRIC=new I6A;t0.NOOP_UP_DOWN_COUNTER_METRIC=new A6A;t0.NOOP_OBSERVABLE_COUNTER_METRIC=new D6A;t0.NOOP_OBSERVABLE_GAUGE_METRIC=new B6A;t0.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f6A;function UY9(){return t0.NOOP_METER}t0.createNoopMeter=UY9});var GvI=z((qyH)=>{Object.defineProperty(qyH,"__esModule",{value:!0});qyH.ValueType=void 0;var XY9;(function(H){H[H.INT=0]="INT",H[H.DOUBLE=1]="DOUBLE"})(XY9=qyH.ValueType||(qyH.ValueType={}))});var M6A=z((PQH)=>{Object.defineProperty(PQH,"__esModule",{value:!0});PQH.defaultTextMapSetter=PQH.defaultTextMapGetter=void 0;PQH.defaultTextMapGetter={get(H,$){if(H==null)return;return H[$]},keys(H){if(H==null)return[];return Object.keys(H)}};PQH.defaultTextMapSetter={set(H,$,A){if(H==null)return;H[$]=A}}});var XvI=z((BK$)=>{Object.defineProperty(BK$,"__esModule",{value:!0});BK$.NoopContextManager=void 0;var JY9=wyH();class UvI{active(){return JY9.ROOT_CONTEXT}with(H,$,A,...L){return $.call(A,...L)}bind(H,$){return $}enable(){return this}disable(){return this}}BK$.NoopContextManager=UvI});var TyH=z((fK$)=>{Object.defineProperty(fK$,"__esModule",{value:!0});fK$.ContextAPI=void 0;var FY9=XvI(),G6A=wBH(),JvI=ZBH(),U6A="context",KY9=new FY9.NoopContextManager;class X6A{constructor(){}static getInstance(){if(!this._instance)this._instance=new X6A;return this._instance}setGlobalContextManager(H){return(0,G6A.registerGlobal)(U6A,H,JvI.DiagAPI.instance())}active(){return this._getContextManager().active()}with(H,$,A,...L){return this._getContextManager().with(H,$,A,...L)}bind(H,$){return this._getContextManager().bind(H,$)}_getContextManager(){return(0,G6A.getGlobal)(U6A)||KY9}disable(){this._getContextManager().disable(),(0,G6A.unregisterGlobal)(U6A,JvI.DiagAPI.instance())}}fK$.ContextAPI=X6A});var J6A=z((zyH)=>{Object.defineProperty(zyH,"__esModule",{value:!0});zyH.TraceFlags=void 0;var QY9;(function(H){H[H.NONE=0]="NONE",H[H.SAMPLED=1]="SAMPLED"})(QY9=zyH.TraceFlags||(zyH.TraceFlags={}))});var EK$=z((mv)=>{Object.defineProperty(mv,"__esModule",{value:!0});mv.INVALID_SPAN_CONTEXT=mv.INVALID_TRACEID=mv.INVALID_SPANID=void 0;var WY9=J6A();mv.INVALID_SPANID="0000000000000000";mv.INVALID_TRACEID="00000000000000000000000000000000";mv.INVALID_SPAN_CONTEXT={traceId:mv.INVALID_TRACEID,spanId:mv.INVALID_SPANID,traceFlags:WY9.TraceFlags.NONE}});var GK$=z((MK$)=>{Object.defineProperty(MK$,"__esModule",{value:!0});MK$.NonRecordingSpan=void 0;var VY9=EK$();class FvI{constructor(H=VY9.INVALID_SPAN_CONTEXT){this._spanContext=H}spanContext(){return this._spanContext}setAttribute(H,$){return this}setAttributes(H){return this}addEvent(H,$){return this}addLink(H){return this}addLinks(H){return this}setStatus(H){return this}updateName(H){return this}end(H){}isRecording(){return!1}recordException(H,$){}}MK$.NonRecordingSpan=FvI});var Q6A=z((SY)=>{Object.defineProperty(SY,"__esModule",{value:!0});SY.getSpanContext=SY.setSpanContext=SY.deleteSpan=SY.setSpan=SY.getActiveSpan=SY.getSpan=void 0;var PY9=wyH(),_Y9=GK$(),YY9=TyH(),F6A=(0,PY9.createContextKey)("OpenTelemetry Context Key SPAN");function K6A(H){return H.getValue(F6A)||void 0}SY.getSpan=K6A;function CY9(){return K6A(YY9.ContextAPI.getInstance().active())}SY.getActiveSpan=CY9;function KvI(H,$){return H.setValue(F6A,$)}SY.setSpan=KvI;function wY9(H){return H.deleteValue(F6A)}SY.deleteSpan=wY9;function ZY9(H,$){return KvI(H,new _Y9.NonRecordingSpan($))}SY.setSpanContext=ZY9;function qY9(H){var $;return($=K6A(H))===null||$===void 0?void 0:$.spanContext()}SY.getSpanContext=qY9});var UK$=z((pv)=>{Object.defineProperty(pv,"__esModule",{value:!0});pv.wrapSpanContext=pv.isSpanContextValid=pv.isValidSpanId=pv.isValidTraceId=void 0;var QvI=EK$(),TY9=GK$(),zY9=/^([0-9a-f]{32})$/i,NY9=/^[0-9a-f]{16}$/i;function WvI(H){return zY9.test(H)&&H!==QvI.INVALID_TRACEID}pv.isValidTraceId=WvI;function VvI(H){return NY9.test(H)&&H!==QvI.INVALID_SPANID}pv.isValidSpanId=VvI;function OY9(H){return WvI(H.traceId)&&VvI(H.spanId)}pv.isSpanContextValid=OY9;function xY9(H){return new TY9.NonRecordingSpan(H)}pv.wrapSpanContext=xY9});var P6A=z((XK$)=>{Object.defineProperty(XK$,"__esModule",{value:!0});XK$.NoopTracer=void 0;var SY9=TyH(),PvI=Q6A(),W6A=GK$(),jY9=UK$(),V6A=SY9.ContextAPI.getInstance();class _vI{startSpan(H,$,A=V6A.active()){if(Boolean($===null||$===void 0?void 0:$.root))return new W6A.NonRecordingSpan;let I=A&&(0,PvI.getSpanContext)(A);if(RY9(I)&&(0,jY9.isSpanContextValid)(I))return new W6A.NonRecordingSpan(I);else return new W6A.NonRecordingSpan}startActiveSpan(H,$,A,L){let I,D,B;if(arguments.length<2)return;else if(arguments.length===2)B=$;else if(arguments.length===3)I=$,B=A;else I=$,D=A,B=L;let f=D!==null&&D!==void 0?D:V6A.active(),E=this.startSpan(H,I,f),M=(0,PvI.setSpan)(f,E);return V6A.with(M,B,void 0,E)}}XK$.NoopTracer=_vI;function RY9(H){return typeof H==="object"&&typeof H.spanId==="string"&&typeof H.traceId==="string"&&typeof H.traceFlags==="number"}});var _6A=z((JK$)=>{Object.defineProperty(JK$,"__esModule",{value:!0});JK$.ProxyTracer=void 0;var yY9=P6A(),vY9=new yY9.NoopTracer;class YvI{constructor(H,$,A,L){this._provider=H,this.name=$,this.version=A,this.options=L}startSpan(H,$,A){return this._getTracer().startSpan(H,$,A)}startActiveSpan(H,$,A,L){let I=this._getTracer();return Reflect.apply(I.startActiveSpan,I,arguments)}_getTracer(){if(this._delegate)return this._delegate;let H=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!H)return vY9;return this._delegate=H,this._delegate}}JK$.ProxyTracer=YvI});var wvI=z((FK$)=>{Object.defineProperty(FK$,"__esModule",{value:!0});FK$.NoopTracerProvider=void 0;var hY9=P6A();class CvI{getTracer(H,$,A){return new hY9.NoopTracer}}FK$.NoopTracerProvider=CvI});var Y6A=z((KK$)=>{Object.defineProperty(KK$,"__esModule",{value:!0});KK$.ProxyTracerProvider=void 0;var bY9=_6A(),kY9=wvI(),uY9=new kY9.NoopTracerProvider;class ZvI{getTracer(H,$,A){var L;return(L=this.getDelegateTracer(H,$,A))!==null&&L!==void 0?L:new bY9.ProxyTracer(this,H,$,A)}getDelegate(){var H;return(H=this._delegate)!==null&&H!==void 0?H:uY9}setDelegate(H){this._delegate=H}getDelegateTracer(H,$,A){var L;return(L=this._delegate)===null||L===void 0?void 0:L.getTracer(H,$,A)}}KK$.ProxyTracerProvider=ZvI});var qvI=z((NyH)=>{Object.defineProperty(NyH,"__esModule",{value:!0});NyH.SamplingDecision=void 0;var gY9;(function(H){H[H.NOT_RECORD=0]="NOT_RECORD",H[H.RECORD=1]="RECORD",H[H.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(gY9=NyH.SamplingDecision||(NyH.SamplingDecision={}))});var TvI=z((OyH)=>{Object.defineProperty(OyH,"__esModule",{value:!0});OyH.SpanKind=void 0;var mY9;(function(H){H[H.INTERNAL=0]="INTERNAL",H[H.SERVER=1]="SERVER",H[H.CLIENT=2]="CLIENT",H[H.PRODUCER=3]="PRODUCER",H[H.CONSUMER=4]="CONSUMER"})(mY9=OyH.SpanKind||(OyH.SpanKind={}))});var zvI=z((xyH)=>{Object.defineProperty(xyH,"__esModule",{value:!0});xyH.SpanStatusCode=void 0;var pY9;(function(H){H[H.UNSET=0]="UNSET",H[H.OK=1]="OK",H[H.ERROR=2]="ERROR"})(pY9=xyH.SpanStatusCode||(xyH.SpanStatusCode={}))});var NvI=z((_QH)=>{Object.defineProperty(_QH,"__esModule",{value:!0});_QH.validateValue=_QH.validateKey=void 0;var C6A="[_0-9a-z-*/]",dY9=`[a-z]${C6A}{0,255}`,cY9=`[a-z0-9]${C6A}{0,240}@[a-z]${C6A}{0,13}`,lY9=new RegExp(`^(?:${dY9}|${cY9})$`),iY9=/^[ -~]{0,255}[!-~]$/,nY9=/,|=/;function rY9(H){return lY9.test(H)}_QH.validateKey=rY9;function aY9(H){return iY9.test(H)&&!nY9.test(H)}_QH.validateValue=aY9});var RvI=z((QK$)=>{Object.defineProperty(QK$,"__esModule",{value:!0});QK$.TraceStateImpl=void 0;var OvI=NvI(),xvI=32,oY9=512,SvI=",",jvI="=";class w6A{constructor(H){if(this._internalState=new Map,H)this._parse(H)}set(H,$){let A=this._clone();if(A._internalState.has(H))A._internalState.delete(H);return A._internalState.set(H,$),A}unset(H){let $=this._clone();return $._internalState.delete(H),$}get(H){return this._internalState.get(H)}serialize(){return this._keys().reduce((H,$)=>{return H.push($+jvI+this.get($)),H},[]).join(SvI)}_parse(H){if(H.length>oY9)return;if(this._internalState=H.split(SvI).reverse().reduce(($,A)=>{let L=A.trim(),I=L.indexOf(jvI);if(I!==-1){let D=L.slice(0,I),B=L.slice(I+1,A.length);if((0,OvI.validateKey)(D)&&(0,OvI.validateValue)(B))$.set(D,B)}return $},new Map),this._internalState.size>xvI)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,xvI))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let H=new w6A;return H._internalState=new Map(this._internalState),H}}QK$.TraceStateImpl=w6A});var yvI=z((WK$)=>{Object.defineProperty(WK$,"__esModule",{value:!0});WK$.createTraceState=void 0;var tY9=RvI();function sY9(H){return new tY9.TraceStateImpl(H)}WK$.createTraceState=sY9});var vvI=z((VK$)=>{Object.defineProperty(VK$,"__esModule",{value:!0});VK$.context=void 0;var eY9=TyH();VK$.context=eY9.ContextAPI.getInstance()});var hvI=z((PK$)=>{Object.defineProperty(PK$,"__esModule",{value:!0});PK$.diag=void 0;var HC9=ZBH();PK$.diag=HC9.DiagAPI.instance()});var bvI=z((YQH)=>{Object.defineProperty(YQH,"__esModule",{value:!0});YQH.NOOP_METER_PROVIDER=YQH.NoopMeterProvider=void 0;var $C9=E6A();class Z6A{getMeter(H,$,A){return $C9.NOOP_METER}}YQH.NoopMeterProvider=Z6A;YQH.NOOP_METER_PROVIDER=new Z6A});var uvI=z((_K$)=>{Object.defineProperty(_K$,"__esModule",{value:!0});_K$.MetricsAPI=void 0;var AC9=bvI(),q6A=wBH(),kvI=ZBH(),T6A="metrics";class z6A{constructor(){}static getInstance(){if(!this._instance)this._instance=new z6A;return this._instance}setGlobalMeterProvider(H){return(0,q6A.registerGlobal)(T6A,H,kvI.DiagAPI.instance())}getMeterProvider(){return(0,q6A.getGlobal)(T6A)||AC9.NOOP_METER_PROVIDER}getMeter(H,$,A){return this.getMeterProvider().getMeter(H,$,A)}disable(){(0,q6A.unregisterGlobal)(T6A,kvI.DiagAPI.instance())}}_K$.MetricsAPI=z6A});var gvI=z((YK$)=>{Object.defineProperty(YK$,"__esModule",{value:!0});YK$.metrics=void 0;var LC9=uvI();YK$.metrics=LC9.MetricsAPI.getInstance()});var pvI=z((CK$)=>{Object.defineProperty(CK$,"__esModule",{value:!0});CK$.NoopTextMapPropagator=void 0;class mvI{inject(H,$){}extract(H,$){return H}fields(){return[]}}CK$.NoopTextMapPropagator=mvI});var cvI=z((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});dv.deleteBaggage=dv.setBaggage=dv.getActiveBaggage=dv.getBaggage=void 0;var IC9=TyH(),DC9=wyH(),N6A=(0,DC9.createContextKey)("OpenTelemetry Baggage Key");function dvI(H){return H.getValue(N6A)||void 0}dv.getBaggage=dvI;function BC9(){return dvI(IC9.ContextAPI.getInstance().active())}dv.getActiveBaggage=BC9;function fC9(H,$){return H.setValue(N6A,$)}dv.setBaggage=fC9;function EC9(H){return H.deleteValue(N6A)}dv.deleteBaggage=EC9});var nvI=z((ZK$)=>{Object.defineProperty(ZK$,"__esModule",{value:!0});ZK$.PropagationAPI=void 0;var O6A=wBH(),MC9=pvI(),lvI=M6A(),wK$=cvI(),GC9=s7A(),ivI=ZBH(),x6A="propagation",UC9=new MC9.NoopTextMapPropagator;class S6A{constructor(){this.createBaggage=GC9.createBaggage,this.getBaggage=wK$.getBaggage,this.getActiveBaggage=wK$.getActiveBaggage,this.setBaggage=wK$.setBaggage,this.deleteBaggage=wK$.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new S6A;return this._instance}setGlobalPropagator(H){return(0,O6A.registerGlobal)(x6A,H,ivI.DiagAPI.instance())}inject(H,$,A=lvI.defaultTextMapSetter){return this._getGlobalPropagator().inject(H,$,A)}extract(H,$,A=lvI.defaultTextMapGetter){return this._getGlobalPropagator().extract(H,$,A)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,O6A.unregisterGlobal)(x6A,ivI.DiagAPI.instance())}_getGlobalPropagator(){return(0,O6A.getGlobal)(x6A)||UC9}}ZK$.PropagationAPI=S6A});var rvI=z((qK$)=>{Object.defineProperty(qK$,"__esModule",{value:!0});qK$.propagation=void 0;var XC9=nvI();qK$.propagation=XC9.PropagationAPI.getInstance()});var svI=z((TK$)=>{Object.defineProperty(TK$,"__esModule",{value:!0});TK$.TraceAPI=void 0;var j6A=wBH(),avI=Y6A(),ovI=UK$(),CQH=Q6A(),tvI=ZBH(),R6A="trace";class y6A{constructor(){this._proxyTracerProvider=new avI.ProxyTracerProvider,this.wrapSpanContext=ovI.wrapSpanContext,this.isSpanContextValid=ovI.isSpanContextValid,this.deleteSpan=CQH.deleteSpan,this.getSpan=CQH.getSpan,this.getActiveSpan=CQH.getActiveSpan,this.getSpanContext=CQH.getSpanContext,this.setSpan=CQH.setSpan,this.setSpanContext=CQH.setSpanContext}static getInstance(){if(!this._instance)this._instance=new y6A;return this._instance}setGlobalTracerProvider(H){let $=(0,j6A.registerGlobal)(R6A,this._proxyTracerProvider,tvI.DiagAPI.instance());if($)this._proxyTracerProvider.setDelegate(H);return $}getTracerProvider(){return(0,j6A.getGlobal)(R6A)||this._proxyTracerProvider}getTracer(H,$){return this.getTracerProvider().getTracer(H,$)}disable(){(0,j6A.unregisterGlobal)(R6A,tvI.DiagAPI.instance()),this._proxyTracerProvider=new avI.ProxyTracerProvider}}TK$.TraceAPI=y6A});var evI=z((zK$)=>{Object.defineProperty(zK$,"__esModule",{value:!0});zK$.trace=void 0;var JC9=svI();zK$.trace=JC9.TraceAPI.getInstance()});var kB=z((xB)=>{Object.defineProperty(xB,"__esModule",{value:!0});xB.trace=xB.propagation=xB.metrics=xB.diag=xB.context=xB.INVALID_SPAN_CONTEXT=xB.INVALID_TRACEID=xB.INVALID_SPANID=xB.isValidSpanId=xB.isValidTraceId=xB.isSpanContextValid=xB.createTraceState=xB.TraceFlags=xB.SpanStatusCode=xB.SpanKind=xB.SamplingDecision=xB.ProxyTracerProvider=xB.ProxyTracer=xB.defaultTextMapSetter=xB.defaultTextMapGetter=xB.ValueType=xB.createNoopMeter=xB.DiagLogLevel=xB.DiagConsoleLogger=xB.ROOT_CONTEXT=xB.createContextKey=xB.baggageEntryMetadataFromString=void 0;var FC9=s7A();Object.defineProperty(xB,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return FC9.baggageEntryMetadataFromString}});var HhI=wyH();Object.defineProperty(xB,"createContextKey",{enumerable:!0,get:function(){return HhI.createContextKey}});Object.defineProperty(xB,"ROOT_CONTEXT",{enumerable:!0,get:function(){return HhI.ROOT_CONTEXT}});var KC9=MvI();Object.defineProperty(xB,"DiagConsoleLogger",{enumerable:!0,get:function(){return KC9.DiagConsoleLogger}});var QC9=sF$();Object.defineProperty(xB,"DiagLogLevel",{enumerable:!0,get:function(){return QC9.DiagLogLevel}});var WC9=E6A();Object.defineProperty(xB,"createNoopMeter",{enumerable:!0,get:function(){return WC9.createNoopMeter}});var VC9=GvI();Object.defineProperty(xB,"ValueType",{enumerable:!0,get:function(){return VC9.ValueType}});var $hI=M6A();Object.defineProperty(xB,"defaultTextMapGetter",{enumerable:!0,get:function(){return $hI.defaultTextMapGetter}});Object.defineProperty(xB,"defaultTextMapSetter",{enumerable:!0,get:function(){return $hI.defaultTextMapSetter}});var PC9=_6A();Object.defineProperty(xB,"ProxyTracer",{enumerable:!0,get:function(){return PC9.ProxyTracer}});var _C9=Y6A();Object.defineProperty(xB,"ProxyTracerProvider",{enumerable:!0,get:function(){return _C9.ProxyTracerProvider}});var YC9=qvI();Object.defineProperty(xB,"SamplingDecision",{enumerable:!0,get:function(){return YC9.SamplingDecision}});var CC9=TvI();Object.defineProperty(xB,"SpanKind",{enumerable:!0,get:function(){return CC9.SpanKind}});var wC9=zvI();Object.defineProperty(xB,"SpanStatusCode",{enumerable:!0,get:function(){return wC9.SpanStatusCode}});var ZC9=J6A();Object.defineProperty(xB,"TraceFlags",{enumerable:!0,get:function(){return ZC9.TraceFlags}});var qC9=yvI();Object.defineProperty(xB,"createTraceState",{enumerable:!0,get:function(){return qC9.createTraceState}});var v6A=UK$();Object.defineProperty(xB,"isSpanContextValid",{enumerable:!0,get:function(){return v6A.isSpanContextValid}});Object.defineProperty(xB,"isValidTraceId",{enumerable:!0,get:function(){return v6A.isValidTraceId}});Object.defineProperty(xB,"isValidSpanId",{enumerable:!0,get:function(){return v6A.isValidSpanId}});var h6A=EK$();Object.defineProperty(xB,"INVALID_SPANID",{enumerable:!0,get:function(){return h6A.INVALID_SPANID}});Object.defineProperty(xB,"INVALID_TRACEID",{enumerable:!0,get:function(){return h6A.INVALID_TRACEID}});Object.defineProperty(xB,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return h6A.INVALID_SPAN_CONTEXT}});var AhI=vvI();Object.defineProperty(xB,"context",{enumerable:!0,get:function(){return AhI.context}});var LhI=hvI();Object.defineProperty(xB,"diag",{enumerable:!0,get:function(){return LhI.diag}});var IhI=gvI();Object.defineProperty(xB,"metrics",{enumerable:!0,get:function(){return IhI.metrics}});var DhI=rvI();Object.defineProperty(xB,"propagation",{enumerable:!0,get:function(){return DhI.propagation}});var BhI=evI();Object.defineProperty(xB,"trace",{enumerable:!0,get:function(){return BhI.trace}});xB.default={context:AhI.context,diag:LhI.diag,metrics:IhI.metrics,propagation:DhI.propagation,trace:BhI.trace}});function zF(){if(!(A$(process.env.ENABLE_BETA_TRACING_DETAILED)&&Boolean(process.env.BETA_TRACING_ENDPOINT)))return!1;return tI()}function Nm(H,$=TC9){if(H.length<=$)return{content:H,truncated:!1};return{content:H.slice(0,$)+` ${A}`);if(H.new_context=L,I)H.new_context_truncated=!0,H.new_context_original_length=A.length}var MhI,NK$,fhI,TC9=61440,NC9;var OK$=K(()=>{NA();sa();R4();g$();Z$();MhI=require("crypto"),NK$=new Set,fhI=new Map;NC9=/^\n?([\s\S]*?)\n?<\/system-reminder>$/});function KhI(H){let $=0;for(let A=0;A0?Math.round(D/(B/1000)*100)/100:void 0,U=f!==void 0&&B!==void 0?f-B:void 0,X=U!==void 0&&E!==void 0&&U>0?Math.round(E/(U/1000)*100)/100:void 0,J=M!==void 0&&D!==void 0&&D>0?Math.round(M/D*1e4)/100:void 0,F={...A.args,ttft_ms:B,ttlt_ms:f,prompt_tokens:D,output_tokens:E,cache_read_tokens:M,cache_creation_tokens:$.cacheCreationTokens,message_id:$.messageId??A.args.message_id,success:$.success??!0,error:$.error,duration_ms:I/1000,itps:G,otps:X,cache_hit_rate_pct:J};if(B!==void 0){let Q=A.startTime+B*1000;if(TP.push({name:"First Token",cat:"api,ttft",ph:"B",ts:A.startTime,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:{ttft_ms:B,prompt_tokens:D,itps:G,cache_hit_rate_pct:J}}),TP.push({name:"First Token",cat:"api,ttft",ph:"E",ts:Q,pid:A.agentInfo.processId,tid:A.agentInfo.threadId}),U!==void 0&&U>0)TP.push({name:"Sampling",cat:"api,sampling",ph:"B",ts:Q,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:{sampling_ms:U,output_tokens:E,otps:X}}),TP.push({name:"Sampling",cat:"api,sampling",ph:"E",ts:Q+U*1000,pid:A.agentInfo.processId,tid:A.agentInfo.threadId})}TP.push({name:A.name,cat:A.category,ph:"E",ts:L,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:F}),NF.delete(H)}function _hI(H,$){if(!gx)return"";let A=SK$(),L=xK$();return NF.set(A,{name:`Tool: ${H}`,category:"tool",startTime:Ho(),agentInfo:L,args:{tool_name:H,...$}}),TP.push({name:`Tool: ${H}`,cat:"tool",ph:"B",ts:NF.get(A).startTime,pid:L.processId,tid:L.threadId,args:NF.get(A).args}),A}function YhI(H,$){if(!gx||!H)return;let A=NF.get(H);if(!A)return;let L=Ho(),I=L-A.startTime,D={...A.args,success:$?.success??!0,error:$?.error,result_tokens:$?.resultTokens,duration_ms:I/1000};TP.push({name:A.name,cat:A.category,ph:"E",ts:L,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:D}),NF.delete(H)}function ChI(H){if(!gx)return"";let $=SK$(),A=xK$();return NF.set($,{name:"Waiting for User Input",category:"user_input",startTime:Ho(),agentInfo:A,args:{context:H}}),TP.push({name:"Waiting for User Input",cat:"user_input",ph:"B",ts:NF.get($).startTime,pid:A.processId,tid:A.threadId,args:NF.get($).args}),$}function whI(H,$){if(!gx||!H)return;let A=NF.get(H);if(!A)return;let L=Ho(),I=L-A.startTime,D={...A.args,decision:$?.decision,source:$?.source,duration_ms:I/1000};TP.push({name:A.name,cat:A.category,ph:"E",ts:L,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:D}),NF.delete(H)}function ZhI(H){if(!gx)return"";let $=SK$(),A=xK$();return NF.set($,{name:"Interaction",category:"interaction",startTime:Ho(),agentInfo:A,args:{user_prompt_length:H?.length}}),TP.push({name:"Interaction",cat:"interaction",ph:"B",ts:NF.get($).startTime,pid:A.processId,tid:A.threadId,args:NF.get($).args}),$}function qhI(H){if(!gx||!H)return;let $=NF.get(H);if(!$)return;let A=Ho(),L=A-$.startTime;TP.push({name:$.name,cat:$.category,ph:"E",ts:A,pid:$.agentInfo.processId,tid:$.agentInfo.threadId,args:{...$.args,duration_ms:L/1000}}),NF.delete(H)}var gx=!1,TP,NF,g6A,xC9=0,SC9=0,u6A=1,FhI;var SyH=K(()=>{NA();g$();Z$();XE();ZE();E$();TP=[],NF=new Map,g6A=new Map,FhI=new Map});function OF(H){return H.spanContext().spanId||""}function p6A(){{let H=process.env.CLAUDE_CODE_ENHANCED_TELEMETRY_BETA??process.env.ENABLE_ENHANCED_TELEMETRY_BETA;if(A$(H))return!0;if(BE(H))return!1;return NL("enhanced_telemetry_beta",!1)}return!1}function mx(){return p6A()||zF()}function X3(){return hM.trace.getTracer("com.anthropic.claude_code.tracing","1.0.0")}function wQH(H,$={}){return{...XQH(),"span.type":H,...$}}function zhI(H){let $=Om()?ZhI(H):void 0;if(!mx()){if($){let E=hM.trace.getActiveSpan()||X3().startSpan("dummy"),M=OF(E);return _G.set(M,{span:E,startTime:Date.now(),attributes:{},perfettoSpanId:$}),$o.enterWith(E),E}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let A=X3(),I=A$(process.env.OTEL_LOG_USER_PROMPTS)?H:"";ThI++;let D=wQH("interaction",{user_prompt:I,user_prompt_length:H.length,"interaction.sequence":ThI}),B=A.startSpan("claude_code.interaction",{attributes:D});GhI(B,H);let f=OF(B);return _G.set(f,{span:B,startTime:Date.now(),attributes:D,perfettoSpanId:$}),$o.enterWith(B),B}function jyH(){let H=$o.getStore();if(!H)return;let $=OF(H),A=_G.get($);if(!A)return;if(A.ended)return;if(A.perfettoSpanId)qhI(A.perfettoSpanId);if(!mx()){A.ended=!0,_G.delete($),$o.exit(()=>{});return}let L=Date.now()-A.startTime;A.span.setAttributes({"interaction.duration_ms":L}),A.span.end(),A.ended=!0,_G.delete($),$o.exit(()=>{})}function NhI(H,$,A){let L=Om()?VhI({model:H,querySource:$?.querySource,messageId:void 0}):void 0;if(!mx()){if(L){let G=hM.trace.getActiveSpan()||X3().startSpan("dummy"),U=OF(G);return _G.set(U,{span:G,startTime:Date.now(),attributes:{model:H},perfettoSpanId:L}),G}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let I=X3(),D=$o.getStore(),B=wQH("llm_request",{model:H,"llm_request.context":D?"interaction":"standalone"}),f=D?hM.trace.setSpan(hM.context.active(),D):hM.context.active(),E=I.startSpan("claude_code.llm_request",{attributes:B},f);if($?.querySource)E.setAttribute("query_source",$.querySource);UhI(E,$,A);let M=OF(E);return _G.set(M,{span:E,startTime:Date.now(),attributes:B,perfettoSpanId:L}),E}function d6A(H,$){let A;if(H){let D=OF(H);A=_G.get(D)}else for(let[,D]of Array.from(_G.entries()).reverse())if(D.attributes["span.type"]==="llm_request"||D.attributes.model){A=D;break}if(!A)return;let L=Date.now()-A.startTime;if(A.perfettoSpanId)PhI(A.perfettoSpanId,{ttftMs:$?.ttftMs,ttltMs:L,promptTokens:$?.inputTokens,outputTokens:$?.outputTokens,cacheReadTokens:$?.cacheReadTokens,cacheCreationTokens:$?.cacheCreationTokens,success:$?.success,error:$?.error});if(!mx()){_G.delete(OF(A.span));return}let I={duration_ms:L};if($){if($.inputTokens!==void 0)I.input_tokens=$.inputTokens;if($.outputTokens!==void 0)I.output_tokens=$.outputTokens;if($.cacheReadTokens!==void 0)I.cache_read_tokens=$.cacheReadTokens;if($.cacheCreationTokens!==void 0)I.cache_creation_tokens=$.cacheCreationTokens;if($.success!==void 0)I.success=$.success;if($.statusCode!==void 0)I.status_code=$.statusCode;if($.error!==void 0)I.error=$.error;if($.attempt!==void 0)I.attempt=$.attempt;if($.hasToolCall!==void 0)I["response.has_tool_call"]=$.hasToolCall;if($.ttftMs!==void 0)I.ttft_ms=$.ttftMs;XhI(I,$)}A.span.setAttributes(I),A.span.end(),_G.delete(OF(A.span))}function OhI(H,$){let A=Om()?_hI(H,$):void 0;if(!mx()){if(A){let M=hM.trace.getActiveSpan()||X3().startSpan("dummy"),G=OF(M);return _G.set(G,{span:M,startTime:Date.now(),attributes:{"span.type":"tool",tool_name:H},perfettoSpanId:A}),Ao.enterWith(M),M}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let L=X3(),I=$o.getStore(),D=wQH("tool",{tool_name:H,...$}),B=I?hM.trace.setSpan(hM.context.active(),I):hM.context.active(),f=L.startSpan("claude_code.tool",{attributes:D},B),E=OF(f);return _G.set(E,{span:f,startTime:Date.now(),attributes:D,perfettoSpanId:A}),Ao.enterWith(f),f}function xhI(){let H=Om()?ChI("tool_permission"):void 0;if(!mx()){if(H){let f=hM.trace.getActiveSpan()||X3().startSpan("dummy"),E=OF(f);return _G.set(E,{span:f,startTime:Date.now(),attributes:{"span.type":"tool.blocked_on_user"},perfettoSpanId:H}),f}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let $=X3(),A=Ao.getStore(),L=wQH("tool.blocked_on_user"),I=A?hM.trace.setSpan(hM.context.active(),A):hM.context.active(),D=$.startSpan("claude_code.tool.blocked_on_user",{attributes:L},I),B=OF(D);return _G.set(B,{span:D,startTime:Date.now(),attributes:L,perfettoSpanId:H}),D}function c6A(H,$){let A;for(let[,B]of Array.from(_G.entries()).reverse())if(B.attributes["span.type"]==="tool.blocked_on_user"){A=B;break}if(!A)return;if(A.perfettoSpanId)whI(A.perfettoSpanId,{decision:H,source:$});if(!mx()){let B=OF(A.span);_G.delete(B);return}let I={duration_ms:Date.now()-A.startTime};if(H)I.decision=H;if($)I.source=$;A.span.setAttributes(I),A.span.end();let D=OF(A.span);_G.delete(D)}function ShI(){if(!mx())return hM.trace.getActiveSpan()||X3().startSpan("dummy");let H=X3(),$=Ao.getStore(),A=wQH("tool.execution"),L=$?hM.trace.setSpan(hM.context.active(),$):hM.context.active(),I=H.startSpan("claude_code.tool.execution",{attributes:A},L),D=OF(I);return _G.set(D,{span:I,startTime:Date.now(),attributes:A}),I}function l6A(H){if(!mx())return;let $;for(let[,D]of Array.from(_G.entries()).reverse())if(D.attributes["span.type"]==="tool.execution"){$=D;break}if(!$)return;let L={duration_ms:Date.now()-$.startTime};if(H){if(H.success!==void 0)L.success=H.success;if(H.error!==void 0)L.error=H.error}$.span.setAttributes(L),$.span.end();let I=OF($.span);_G.delete(I)}function RK$(H,$){let A;for(let[,B]of Array.from(_G.entries()).reverse())if(B.attributes["span.type"]==="tool"){A=B;break}if(!A)return;if(A.perfettoSpanId)YhI(A.perfettoSpanId,{success:!0,resultTokens:$});if(!mx()){let B=OF(A.span);_G.delete(B),Ao.exit(()=>{});return}let I={duration_ms:Date.now()-A.startTime};if(H){let B=A.attributes.tool_name||"unknown";JhI(I,B,H)}if($!==void 0)I.result_tokens=$;A.span.setAttributes(I),A.span.end();let D=OF(A.span);_G.delete(D),Ao.exit(()=>{})}function RC9(){return A$(process.env.OTEL_LOG_TOOL_CONTENT)}function jhI(H,$){if(!mx()||!RC9())return;let A=Ao.getStore();if(!A)return;let L={};for(let[I,D]of Object.entries($))if(typeof D==="string"){let{content:B,truncated:f}=Nm(D);if(L[I]=B,f)L[`${I}_truncated`]=!0,L[`${I}_original_length`]=D.length}else L[I]=D;A.addEvent(H,L)}function RhI(H,$,A,L){if(!zF())return hM.trace.getActiveSpan()||X3().startSpan("dummy");let I=X3(),D=Ao.getStore()||$o.getStore(),B=wQH("hook",{hook_event:H,hook_name:$,num_hooks:A,hook_definitions:L}),f=D?hM.trace.setSpan(hM.context.active(),D):hM.context.active(),E=I.startSpan("claude_code.hook",{attributes:B},f),M=OF(E);return _G.set(M,{span:E,startTime:Date.now(),attributes:B}),E}function yhI(H,$){if(!zF())return;let A=OF(H),L=_G.get(A);if(!L)return;let D={duration_ms:Date.now()-L.startTime};if($){if($.numSuccess!==void 0)D.num_success=$.numSuccess;if($.numBlocking!==void 0)D.num_blocking=$.numBlocking;if($.numNonBlockingError!==void 0)D.num_non_blocking_error=$.numNonBlockingError;if($.numCancelled!==void 0)D.num_cancelled=$.numCancelled}L.span.setAttributes(D),L.span.end(),_G.delete(A)}var hM,m6A,$o,Ao,_G,ThI=0;var Lo=K(()=>{SD();nF$();NA();OK$();SyH();hM=b(kB(),1),m6A=require("async_hooks"),$o=new m6A.AsyncLocalStorage,Ao=new m6A.AsyncLocalStorage,_G=new Map});var v5E,yK$;var vhI=K(()=>{mI();v5E=QD.enum(["allow","deny","ask"]),yK$=QD.object({toolName:QD.string(),ruleContent:QD.string().optional()})});var ZQH,vK$;var i6A=K(()=>{mI();vhI();yW();ZQH=QD.enum(["userSettings","projectSettings","localSettings","session","cliArg"]),vK$=QD.discriminatedUnion("type",[QD.object({type:QD.literal("addRules"),rules:QD.array(yK$),behavior:QD.enum(["allow","deny","ask"]),destination:ZQH}),QD.object({type:QD.literal("replaceRules"),rules:QD.array(yK$),behavior:QD.enum(["allow","deny","ask"]),destination:ZQH}),QD.object({type:QD.literal("removeRules"),rules:QD.array(yK$),behavior:QD.enum(["allow","deny","ask"]),destination:ZQH}),QD.object({type:QD.literal("setMode"),mode:t0L,destination:ZQH}),QD.object({type:QD.literal("addDirectories"),directories:QD.array(QD.string()),destination:ZQH}),QD.object({type:QD.literal("removeDirectories"),directories:QD.array(QD.string()),destination:ZQH})])});function hhI(H){return!(("async"in H)&&H.async===!0)}function qBH(H){return"async"in H&&H.async===!0}var yC9,vC9,hK$;var n6A=K(()=>{mI();KGH();i6A();yC9=S.object({async:S.literal(!0),asyncTimeout:S.number().optional()}),vC9=S.object({continue:S.boolean().describe("Whether Claude should continue after hook (default: true)").optional(),suppressOutput:S.boolean().describe("Hide stdout from transcript (default: false)").optional(),stopReason:S.string().describe("Message shown when continue is false").optional(),decision:S.enum(["approve","block"]).optional(),reason:S.string().describe("Explanation for the decision").optional(),systemMessage:S.string().describe("Warning message shown to the user").optional(),hookSpecificOutput:S.union([S.object({hookEventName:S.literal("PreToolUse"),permissionDecision:S.enum(["allow","deny","ask"]).optional(),permissionDecisionReason:S.string().optional(),updatedInput:S.record(S.string(),S.unknown()).optional(),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("UserPromptSubmit"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("SessionStart"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("Setup"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("SubagentStart"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("PostToolUse"),additionalContext:S.string().optional(),updatedMCPToolOutput:S.unknown().describe("Updates the output for MCP tools").optional()}),S.object({hookEventName:S.literal("PostToolUseFailure"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("Notification"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("PermissionRequest"),decision:S.union([S.object({behavior:S.literal("allow"),updatedInput:S.record(S.string(),S.unknown()).optional(),updatedPermissions:S.array(vK$).optional()}),S.object({behavior:S.literal("deny"),message:S.string().optional(),interrupt:S.boolean().optional()})])})]).optional()}),hK$=S.union([yC9,vC9])});function yT(H,$){let A=nD();if(H.aborted||$?.aborted)return A.abort(),{signal:A.signal,cleanup:()=>{}};let L=()=>{A.abort()};H.addEventListener("abort",L),$?.addEventListener("abort",L);let I=()=>{H.removeEventListener("abort",L),$?.removeEventListener("abort",L)};return{signal:A.signal,cleanup:I}}var RyH=K(()=>{eE()});function bhI(H){if(a6A=H,H&&r6A.length>0)for(let $ of r6A.splice(0))H($)}function o6A(H){if(a6A)a6A(H);else r6A.push(H)}function bK$(H){return hC9.includes(H)}function khI(H,$,A){if(!bK$(A))return;o6A({type:"started",hookId:H,hookName:$,hookEvent:A})}function bC9(H){if(!bK$(H.hookEvent))return;if(!A$(process.env.CLAUDE_CODE_REMOTE))return;o6A({type:"progress",...H})}function kK$(H){if(!bK$(H.hookEvent))return()=>{};if(!A$(process.env.CLAUDE_CODE_REMOTE))return()=>{};let $="",A=setInterval(()=>{let{stdout:L,stderr:I,output:D}=H.getOutput();if(D===$)return;$=D,bC9({hookId:H.hookId,hookName:H.hookName,hookEvent:H.hookEvent,stdout:L,stderr:I,output:D})},1000);return A.unref(),()=>clearInterval(A)}function px(H){let $=H.stdout||H.stderr||H.output;if($)N(`Hook ${H.hookName} (${H.hookEvent}) ${H.outcome}: ${f}`}catch(L){return EL("error","git_status_failed",{duration_ms:Date.now()-H}),r(L instanceof Error?L:Error(String(L))),null}}),k5=o$(async()=>{let H=Date.now();EL("info","system_context_started");let $=A$(process.env.CLAUDE_CODE_REMOTE)?null:await $3A(),A=null;return EL("info","system_context_completed",{duration_ms:Date.now()-H,has_git_status:$!==null,has_injection:A!==null}),{...$?{gitStatus:$}:{},...{}}}),u5=o$(async()=>{let H=Date.now();EL("info","user_context_started");let $=process.env.CLAUDE_CODE_DISABLE_CLAUDE_MDS,A=$?null:qRI();return EL("info","user_context_completed",{duration_ms:Date.now()-H,claudemd_length:A?.length??0,claudemd_disabled:Boolean($)}),{...A?{claudeMd:A}:{}}})});function A3A({tools:H,isBuiltIn:$,isAsync:A=!1,permissionMode:L}){return H.filter((I)=>{if(I.name.startsWith("mcp__"))return!0;if(I.name===xY&&L==="plan")return!0;if(EQH.has(I.name))return!1;if(!$&&b7A.has(I.name))return!1;if(A&&!SF$.has(I.name)){if(dL()&&oW()){if(I.name===E0)return!0;if(fyI.has(I.name))return!0}return!1}return!0})}function Io(H,$,A=!1){let{tools:L,disallowedTools:I,source:D,permissionMode:B}=H,f=A3A({tools:$,isBuiltIn:D==="built-in",isAsync:A,permissionMode:B}),E=new Set(I?.map((P)=>{let{toolName:C}=T6(P);return C})??[]),M=f.filter((P)=>!E.has(P.name));if(L===void 0||L.length===1&&L[0]==="*")return{hasWildcard:!0,validTools:[],invalidTools:[],resolvedTools:M};let U=new Map;for(let P of M)U.set(P.name,P);let X=[],J=[],F=[],Q=new Set,W;for(let P of L){let{toolName:C,ruleContent:Y}=T6(P);if(C===E0){if(X.push(P),Y)W=Y.split(",").map((q)=>q.trim());continue}let Z=U.get(C);if(Z){if(X.push(P),!Q.has(Z))F.push(Z),Q.add(Z)}else J.push(P)}return{hasWildcard:!1,validTools:X,invalidTools:J,resolvedTools:F,allowedAgentTypes:W}}function AbI(H,$){let A=R$({content:H}),L=$.message.content.find((E)=>{if(E.type!=="tool_use"||E.name!==E0)return!1;let M=E.input;return"prompt"in M&&M.prompt===H});if(!L)return N(`Could not find matching AgentTool tool use for prompt: ${H.slice(0,50)}...`,{level:"error"}),[A];let I={...$,uuid:HbI.randomUUID(),message:{...$.message,content:[L]}},D=`### FORKING CONVERSATION CONTEXT ### "id": "string", // Model ID (e.g., "claude-3-5-sonnet-20241022") 2. For longer commands, you can save a new file in the user's ~/.claude directory, e.g.: - ~/.claude/statusline-command.sh and reference that file in the settings. 3. Update the user's ~/.claude/settings.json with: 4. If ~/.claude/settings.json is a symlink, update the target file instead. REMEMBER: You can ONLY explore and plan. You CANNOT and MUST NOT write, edit, or modify any files. You do NOT have access to file editing tools.`,nK$={agentType:"Plan",whenToUse:"Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs.",disallowedTools:[E0,qF$,TB,U1,aW],source:"built-in",tools:Uw.tools,baseDir:"built-in",model:"inherit",getSystemPrompt:()=>cC9,criticalSystemReminder_EXPERIMENTAL:"CRITICAL: This is a READ-ONLY task. You CANNOT edit, write, or create files."}});function nC9(){if($O())return`- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.ISSUES_EXPLAINER}`;return"- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug"}var lC9="https://code.claude.com/docs/en/claude_code_docs_map.md",fbI="https://platform.claude.com/llms.txt",D3A="claude-code-guide",iC9,EbI;var B3A=K(()=>{tG();vV();Mn();mL();EI();Z$();iC9=`You are the Claude guide agent. Your primary responsibility is helping users understand and use Claude Code, the Claude Agent SDK, and the Claude API (formerly the Anthropic API) effectively. 7. Reference local project files (CLAUDE.md, .claude/ directory) when relevant using ${$B}, ${af}, and ${s8} Complete the user's request by providing accurate, documentation-based guidance.`;EbI={agentType:D3A,whenToUse:'Use this agent when the user asks questions ("Can Claude...", "Does Claude...", "How do I...") about: (1) Claude Code (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Claude Agent SDK - building custom agents; (3) Claude API (formerly Anthropic API) - API usage, tool use, Anthropic SDK usage. **IMPORTANT:** Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can resume using the "resume" parameter.',tools:[af,s8,$B,w4,v2],source:"built-in",baseDir:"built-in",model:"haiku",permissionMode:"dontAsk",getSystemPrompt({toolUseContext:H}){let $=H.options.commands,A=[],L=$.filter((G)=>G.type==="prompt");if(L.length>0){let G=L.map((U)=>`- /${U.name}: ${U.description}`).join(` When answering questions, consider these configured features and proactively suggest them when relevant.`;return M}}});var RJE;var MbI=K(()=>{ia();GT();RJE=[C7,`${WD}(sleep:*)`,"mcp__slack__send_message","mcp__slack__read_thread","mcp__claude_ai_Slack__slack_send_message","mcp__claude_ai_Slack__slack_read_thread"]});function f3A(){if(A$(process.env.CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS)&&tI())return[];let H=[LbI,vyH,DbI,Uw,nK$];if(process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-ts"&&process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-py"&&process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-cli")H.push(EbI);return H}var GbI=K(()=>{IbI();L3A();BbI();hyH();I3A();B3A();MbI();NA();g$()});function TK(H){return H.source==="built-in"}function rK$(H){return H.source!=="built-in"&&H.source!=="plugin"}function aK$(H){return H.source==="plugin"}function jm(H){let $=H.filter((M)=>M.source==="built-in"),A=H.filter((M)=>M.source==="plugin"),L=H.filter((M)=>M.source==="userSettings"),I=H.filter((M)=>M.source==="projectSettings"),D=H.filter((M)=>M.source==="policySettings"),B=H.filter((M)=>M.source==="flagSettings"),f=[$,A,L,I,B,D],E=new Map;for(let M of f)for(let G of M)E.set(G.agentType,G);return Array.from(E.values())}function E3A(H,$){if(!H.requiredMcpServers||H.requiredMcpServers.length===0)return!0;return H.requiredMcpServers.every((A)=>$.some((L)=>L.toLowerCase().includes(A.toLowerCase())))}function FbI(H,$){return H.filter((A)=>E3A(A,$))}function aC9(H){let{name:$,description:A,model:L}=H;if(!$||typeof $!=="string")return'Missing required "name" field in frontmatter';if(!A||typeof A!=="string")return'Missing required "description" field in frontmatter';if(L&&typeof L==="string"&&!P5H.includes(L))return`Invalid model "${L}". Valid options: ${P5H.join(", ")}`;return"Unknown parsing error"}function oC9(H,$){if(!H.hooks)return;let A=oZ.safeParse(H.hooks);if(!A.success){N(`Invalid hooks in agent '${$}': ${A.error.message}`);return}return A.data}function tC9(H,$,A="flagSettings"){try{let L=JbI.parse($),I=LBH(L.tools);if(PG()&&L.memory&&I!==void 0){let E=new Set(I);for(let M of[U1,TB,$B])if(!E.has(M))I=[...I,M]}let D=L.disallowedTools!==void 0?LBH(L.disallowedTools):void 0,B=L.prompt;return{agentType:H,whenToUse:L.description,...I!==void 0?{tools:I}:{},...D!==void 0?{disallowedTools:D}:{},getSystemPrompt:()=>{if(PG()&&L.memory){let E=HBH(H,L.memory);return B+` `).find((L)=>L.includes("IOPlatformUUID"));if(!$)return;let A=$.split('" = "');if(A.length===2)return A[1].slice(0,-1)}catch(H){Uy9.diag.debug(`error reading machine id: ${H}`)}return}SW$.getMachineId=Xy9});var XLD=z((jW$)=>{Object.defineProperty(jW$,"__esModule",{value:!0});jW$.getMachineId=void 0;var Jy9=require("fs"),Fy9=kB();async function Ky9(){let H=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let $ of H)try{return(await Jy9.promises.readFile($,{encoding:"utf8"})).trim()}catch(A){Fy9.diag.debug(`error reading machine id: ${A}`)}return}jW$.getMachineId=Ky9});var FLD=z((RW$)=>{Object.defineProperty(RW$,"__esModule",{value:!0});RW$.getMachineId=void 0;var Qy9=require("fs"),Wy9=xW$(),JLD=kB();async function Vy9(){try{return(await Qy9.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(H){JLD.diag.debug(`error reading machine id: ${H}`)}try{return(await(0,Wy9.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(H){JLD.diag.debug(`error reading machine id: ${H}`)}return}RW$.getMachineId=Vy9});var QLD=z((yW$)=>{Object.defineProperty(yW$,"__esModule",{value:!0});yW$.getMachineId=void 0;var KLD=require("process"),Py9=xW$(),_y9=kB();async function Yy9(){let $="%windir%\\System32\\REG.exe";if(KLD.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in KLD.env)$="%windir%\\sysnative\\cmd.exe /c "+$;try{let L=(await(0,Py9.execAsync)(`${$} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split("REG_SZ");if(L.length===2)return L[1].trim()}catch(A){_y9.diag.debug(`error reading machine id: ${A}`)}return}yW$.getMachineId=Yy9});var WLD=z((vW$)=>{Object.defineProperty(vW$,"__esModule",{value:!0});vW$.getMachineId=void 0;var Cy9=kB();async function wy9(){Cy9.diag.debug("could not read machine-id: unsupported platform");return}vW$.getMachineId=wy9});var VLD=z((hW$)=>{Object.defineProperty(hW$,"__esModule",{value:!0});hW$.getMachineId=void 0;var Zy9=require("process"),eBH;async function qy9(){if(!eBH)switch(Zy9.platform){case"darwin":eBH=(await Promise.resolve().then(() => b(ULD()))).getMachineId;break;case"linux":eBH=(await Promise.resolve().then(() => b(XLD()))).getMachineId;break;case"freebsd":eBH=(await Promise.resolve().then(() => b(FLD()))).getMachineId;break;case"win32":eBH=(await Promise.resolve().then(() => b(QLD()))).getMachineId;break;default:eBH=(await Promise.resolve().then(() => b(WLD()))).getMachineId;break}return eBH()}hW$.getMachineId=qy9});var rVA=z((oQH)=>{Object.defineProperty(oQH,"__esModule",{value:!0});oQH.normalizeType=oQH.normalizeArch=void 0;var Ty9=(H)=>{switch(H){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return H}};oQH.normalizeArch=Ty9;var zy9=(H)=>{switch(H){case"sunos":return"solaris";case"win32":return"windows";default:return H}};oQH.normalizeType=zy9});var YLD=z((bW$)=>{Object.defineProperty(bW$,"__esModule",{value:!0});bW$.hostDetector=void 0;var aVA=QvH(),PLD=require("os"),Ny9=VLD(),Oy9=rVA();class _LD{detect(H){return{attributes:{[aVA.ATTR_HOST_NAME]:(0,PLD.hostname)(),[aVA.ATTR_HOST_ARCH]:(0,Oy9.normalizeArch)((0,PLD.arch)()),[aVA.ATTR_HOST_ID]:(0,Ny9.getMachineId)()}}}}bW$.hostDetector=new _LD});var qLD=z((kW$)=>{Object.defineProperty(kW$,"__esModule",{value:!0});kW$.osDetector=void 0;var CLD=QvH(),wLD=require("os"),xy9=rVA();class ZLD{detect(H){return{attributes:{[CLD.ATTR_OS_TYPE]:(0,xy9.normalizeType)((0,wLD.platform)()),[CLD.ATTR_OS_VERSION]:(0,wLD.release)()}}}}kW$.osDetector=new ZLD});var zLD=z((uW$)=>{Object.defineProperty(uW$,"__esModule",{value:!0});uW$.processDetector=void 0;var Sy9=kB(),cm=QvH(),jy9=require("os");class TLD{detect(H){let $={[cm.ATTR_PROCESS_PID]:process.pid,[cm.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[cm.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[cm.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[cm.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[cm.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[cm.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};if(process.argv.length>1)$[cm.ATTR_PROCESS_COMMAND]=process.argv[1];try{let A=jy9.userInfo();$[cm.ATTR_PROCESS_OWNER]=A.username}catch(A){Sy9.diag.debug(`error obtaining process owner: ${A}`)}return{attributes:$}}}uW$.processDetector=new TLD});var OLD=z((gW$)=>{Object.defineProperty(gW$,"__esModule",{value:!0});gW$.serviceInstanceIdDetector=void 0;var Ry9=QvH(),yy9=require("crypto");class NLD{detect(H){return{attributes:{[Ry9.ATTR_SERVICE_INSTANCE_ID]:(0,yy9.randomUUID)()}}}}gW$.serviceInstanceIdDetector=new NLD});var xLD=z((av)=>{Object.defineProperty(av,"__esModule",{value:!0});av.serviceInstanceIdDetector=av.processDetector=av.osDetector=av.hostDetector=void 0;var vy9=YLD();Object.defineProperty(av,"hostDetector",{enumerable:!0,get:function(){return vy9.hostDetector}});var hy9=qLD();Object.defineProperty(av,"osDetector",{enumerable:!0,get:function(){return hy9.osDetector}});var by9=zLD();Object.defineProperty(av,"processDetector",{enumerable:!0,get:function(){return by9.processDetector}});var ky9=OLD();Object.defineProperty(av,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return ky9.serviceInstanceIdDetector}})});var SLD=z((ov)=>{Object.defineProperty(ov,"__esModule",{value:!0});ov.serviceInstanceIdDetector=ov.processDetector=ov.osDetector=ov.hostDetector=void 0;var mW$=xLD();Object.defineProperty(ov,"hostDetector",{enumerable:!0,get:function(){return mW$.hostDetector}});Object.defineProperty(ov,"osDetector",{enumerable:!0,get:function(){return mW$.osDetector}});Object.defineProperty(ov,"processDetector",{enumerable:!0,get:function(){return mW$.processDetector}});Object.defineProperty(ov,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return mW$.serviceInstanceIdDetector}})});var jLD=z((tQH)=>{Object.defineProperty(tQH,"__esModule",{value:!0});tQH.noopDetector=tQH.NoopDetector=void 0;class oVA{detect(){return{attributes:{}}}}tQH.NoopDetector=oVA;tQH.noopDetector=new oVA});var RLD=z((vY)=>{Object.defineProperty(vY,"__esModule",{value:!0});vY.noopDetector=vY.serviceInstanceIdDetector=vY.processDetector=vY.osDetector=vY.hostDetector=vY.envDetector=void 0;var uy9=GLD();Object.defineProperty(vY,"envDetector",{enumerable:!0,get:function(){return uy9.envDetector}});var pW$=SLD();Object.defineProperty(vY,"hostDetector",{enumerable:!0,get:function(){return pW$.hostDetector}});Object.defineProperty(vY,"osDetector",{enumerable:!0,get:function(){return pW$.osDetector}});Object.defineProperty(vY,"processDetector",{enumerable:!0,get:function(){return pW$.processDetector}});Object.defineProperty(vY,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return pW$.serviceInstanceIdDetector}});var gy9=jLD();Object.defineProperty(vY,"noopDetector",{enumerable:!0,get:function(){return gy9.noopDetector}})});var sQH=z((zX)=>{Object.defineProperty(zX,"__esModule",{value:!0});zX.defaultServiceName=zX.emptyResource=zX.defaultResource=zX.resourceFromAttributes=zX.serviceInstanceIdDetector=zX.processDetector=zX.osDetector=zX.hostDetector=zX.envDetector=zX.detectResources=void 0;var my9=fLD();Object.defineProperty(zX,"detectResources",{enumerable:!0,get:function(){return my9.detectResources}});var WvH=RLD();Object.defineProperty(zX,"envDetector",{enumerable:!0,get:function(){return WvH.envDetector}});Object.defineProperty(zX,"hostDetector",{enumerable:!0,get:function(){return WvH.hostDetector}});Object.defineProperty(zX,"osDetector",{enumerable:!0,get:function(){return WvH.osDetector}});Object.defineProperty(zX,"processDetector",{enumerable:!0,get:function(){return WvH.processDetector}});Object.defineProperty(zX,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return WvH.serviceInstanceIdDetector}});var tVA=iVA();Object.defineProperty(zX,"resourceFromAttributes",{enumerable:!0,get:function(){return tVA.resourceFromAttributes}});Object.defineProperty(zX,"defaultResource",{enumerable:!0,get:function(){return tVA.defaultResource}});Object.defineProperty(zX,"emptyResource",{enumerable:!0,get:function(){return tVA.emptyResource}});var py9=dVA();Object.defineProperty(zX,"defaultServiceName",{enumerable:!0,get:function(){return py9.defaultServiceName}})});class sVA{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;totalAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(H){if(this._isLogRecordReadonly())return;this._severityText=H}get severityText(){return this._severityText}set severityNumber(H){if(this._isLogRecordReadonly())return;this._severityNumber=H}get severityNumber(){return this._severityNumber}set body(H){if(this._isLogRecordReadonly())return;this._body=H}get body(){return this._body}get eventName(){return this._eventName}set eventName(H){if(this._isLogRecordReadonly())return;this._eventName=H}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(H,$,A){let{timestamp:L,observedTimestamp:I,eventName:D,severityNumber:B,severityText:f,body:E,attributes:M={},context:G}=A,U=Date.now();if(this.hrTime=eQH.timeInputToHrTime(L??U),this.hrTimeObserved=eQH.timeInputToHrTime(I??U),G){let X=tv.trace.getSpanContext(G);if(X&&tv.isSpanContextValid(X))this.spanContext=X}this.severityNumber=B,this.severityText=f,this.body=E,this.resource=H.resource,this.instrumentationScope=$,this._logRecordLimits=H.logRecordLimits,this._eventName=D,this.setAttributes(M)}setAttribute(H,$){if(this._isLogRecordReadonly())return this;if($===null)return this;if(H.length===0)return tv.diag.warn(`Invalid attribute key: ${H}`),this;if(!eQH.isAttributeValue($)&&!(typeof $==="object"&&!Array.isArray($)&&Object.keys($).length>0))return tv.diag.warn(`Invalid attribute value set for key: ${H}`),this;if(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,H)){if(this.droppedAttributesCount===1)tv.diag.warn("Dropping extra attributes.");return this}if(eQH.isAttributeValue($))this.attributes[H]=this._truncateToSize($);else this.attributes[H]=$;return this}setAttributes(H){for(let[$,A]of Object.entries(H))this.setAttribute($,A);return this}setBody(H){return this.body=H,this}setEventName(H){return this.eventName=H,this}setSeverityNumber(H){return this.severityNumber=H,this}setSeverityText(H){return this.severityText=H,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(H){let $=this._logRecordLimits.attributeValueLengthLimit;if($<=0)return tv.diag.warn(`Attribute value limit must be positive, got ${$}`),H;if(typeof H==="string")return this._truncateToLimitUtil(H,$);if(Array.isArray(H))return H.map((A)=>typeof A==="string"?this._truncateToLimitUtil(A,$):A);return H}_truncateToLimitUtil(H,$){if(H.length<=$)return H;return H.substring(0,$)}_isLogRecordReadonly(){if(this._isReadonly)tv.diag.warn("Can not execute the operation on emitted log record");return this._isReadonly}}var tv,eQH;var yLD=K(()=>{tv=b(kB(),1),eQH=b(Kf(),1)});class eVA{instrumentationScope;_sharedState;constructor(H,$){this.instrumentationScope=H,this._sharedState=$}emit(H){let $=H.context||vLD.context.active(),A=new sVA(this._sharedState,this.instrumentationScope,{context:$,...H});this._sharedState.activeProcessor.onEmit(A,$),A._makeReadonly()}}var vLD;var hLD=K(()=>{yLD();vLD=b(kB(),1)});function bLD(){return{forceFlushTimeoutMillis:30000,logRecordLimits:{attributeValueLengthLimit:H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??128},includeTraceContext:!0}}function kLD(H){return{attributeCountLimit:H.attributeCountLimit??H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??H0H.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,attributeValueLengthLimit:H.attributeValueLengthLimit??H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??H0H.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0}}var H0H;var uLD=K(()=>{H0H=b(Kf(),1)});class HPA{forceFlush(){return Promise.resolve()}onEmit(H,$){}shutdown(){return Promise.resolve()}}class $PA{processors;forceFlushTimeoutMillis;constructor(H,$){this.processors=H,this.forceFlushTimeoutMillis=$}async forceFlush(){let H=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(($)=>gLD.callWithTimeout($.forceFlush(),H)))}onEmit(H,$){this.processors.forEach((A)=>A.onEmit(H,$))}async shutdown(){await Promise.all(this.processors.map((H)=>H.shutdown()))}}var gLD;var mLD=K(()=>{gLD=b(Kf(),1)});class APA{resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];constructor(H,$,A,L){if(this.resource=H,this.forceFlushTimeoutMillis=$,this.logRecordLimits=A,this.processors=L,L.length>0)this.registeredLogRecordProcessors=L,this.activeProcessor=new $PA(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis);else this.activeProcessor=new HPA}}var pLD=K(()=>{mLD()});class $0H{_shutdownOnce;_sharedState;constructor(H={}){let $=dW$.merge({},bLD(),H),A=H.resource??dLD.defaultResource();this._sharedState=new APA(A,$.forceFlushTimeoutMillis,kLD($.logRecordLimits),H?.processors??[]),this._shutdownOnce=new dW$.BindOnceFuture(this._shutdown,this)}getLogger(H,$,A){if(this._shutdownOnce.isCalled)return VvH.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),DvH;if(!H)VvH.diag.warn("Logger requested without instrumentation scope name.");let L=H||dy9,I=`${L}@${$||""}:${A?.schemaUrl||""}`;if(!this._sharedState.loggers.has(I))this._sharedState.loggers.set(I,new eVA({name:L,version:$,schemaUrl:A?.schemaUrl},this._sharedState));return this._sharedState.loggers.get(I)}forceFlush(){if(this._shutdownOnce.isCalled)return VvH.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise;return this._sharedState.activeProcessor.forceFlush()}shutdown(){if(this._shutdownOnce.isCalled)return VvH.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise;return this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}var VvH,dLD,dW$,dy9="unknown";var cLD=K(()=>{qVA();hLD();uLD();pLD();VvH=b(kB(),1),dLD=b(sQH(),1),dW$=b(Kf(),1)});class lW${export(H,$){this._sendLogRecords(H,$)}shutdown(){return Promise.resolve()}_exportInfo(H){return{resource:{attributes:H.resource.attributes},instrumentationScope:H.instrumentationScope,timestamp:cW$.hrTimeToMicroseconds(H.hrTime),traceId:H.spanContext?.traceId,spanId:H.spanContext?.spanId,traceFlags:H.spanContext?.traceFlags,severityText:H.severityText,severityNumber:H.severityNumber,body:H.body,attributes:H.attributes}}_sendLogRecords(H,$){for(let A of H)console.dir(this._exportInfo(A),{depth:3});$?.({code:cW$.ExportResultCode.SUCCESS})}}var cW$;var lLD=K(()=>{cW$=b(Kf(),1)});class LPA{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedLogRecords=[];_timer;_shutdownOnce;constructor(H,$){if(this._exporter=H,this._maxExportBatchSize=$?.maxExportBatchSize??iQ.getNumberFromEnv("OTEL_BLRP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=$?.maxQueueSize??iQ.getNumberFromEnv("OTEL_BLRP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=$?.scheduledDelayMillis??iQ.getNumberFromEnv("OTEL_BLRP_SCHEDULE_DELAY")??5000,this._exportTimeoutMillis=$?.exportTimeoutMillis??iQ.getNumberFromEnv("OTEL_BLRP_EXPORT_TIMEOUT")??30000,this._shutdownOnce=new iQ.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)iLD.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}onEmit(H){if(this._shutdownOnce.isCalled)return;this._addToBuffer(H)}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(H){if(this._finishedLogRecords.length>=this._maxQueueSize)return;this._finishedLogRecords.push(H),this._maybeStartTimer()}_flushAll(){return new Promise((H,$)=>{let A=[],L=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let I=0;I{H()}).catch($)})}_flushOneBatch(){if(this._clearTimer(),this._finishedLogRecords.length===0)return Promise.resolve();return new Promise((H,$)=>{iQ.callWithTimeout(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>H()).catch($)})}_maybeStartTimer(){if(this._isExporting)return;let H=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{if(this._isExporting=!1,this._finishedLogRecords.length>0)this._clearTimer(),this._maybeStartTimer()}).catch(($)=>{this._isExporting=!1,iQ.globalErrorHandler($)})};if(this._finishedLogRecords.length>=this._maxExportBatchSize)return H();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>H(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}_export(H){let $=()=>iQ.internal._export(this._exporter,H).then((L)=>{if(L.code!==iQ.ExportResultCode.SUCCESS)iQ.globalErrorHandler(L.error??Error(`BatchLogRecordProcessor: log record export failed (status ${L})`))}).catch(iQ.globalErrorHandler),A=H.map((L)=>L.resource).filter((L)=>L.asyncAttributesPending);if(A.length===0)return $();else return Promise.all(A.map((L)=>L.waitForAsyncAttributes?.())).then($,iQ.globalErrorHandler)}}var iLD,iQ;var nLD=K(()=>{iLD=b(kB(),1),iQ=b(Kf(),1)});var lm;var rLD=K(()=>{nLD();lm=class lm extends LPA{onShutdown(){}}});var aLD=K(()=>{rLD()});var oLD=K(()=>{aLD()});var IPA=K(()=>{cLD();lLD();oLD()});function cy9(){return{seconds:0,nanos:0}}function tLD(H){return H!==null&&H!==void 0}var PvH;var DPA=K(()=>{PvH={fromJSON(H){return{seconds:tLD(H.seconds)?globalThis.Number(H.seconds):0,nanos:tLD(H.nanos)?globalThis.Number(H.nanos):0}},toJSON(H){let $={};if(H.seconds!==void 0)$.seconds=Math.round(H.seconds);if(H.nanos!==void 0)$.nanos=Math.round(H.nanos);return $},create(H){return PvH.fromPartial(H??{})},fromPartial(H){let $=cy9();return $.seconds=H.seconds??0,$.nanos=H.nanos??0,$}}});function ly9(){return{account_id:0,organization_uuid:"",account_uuid:""}}function BPA(H){return H!==null&&H!==void 0}var im;var fPA=K(()=>{im={fromJSON(H){return{account_id:BPA(H.account_id)?globalThis.Number(H.account_id):0,organization_uuid:BPA(H.organization_uuid)?globalThis.String(H.organization_uuid):"",account_uuid:BPA(H.account_uuid)?globalThis.String(H.account_uuid):""}},toJSON(H){let $={};if(H.account_id!==void 0)$.account_id=Math.round(H.account_id);if(H.organization_uuid!==void 0)$.organization_uuid=H.organization_uuid;if(H.account_uuid!==void 0)$.account_uuid=H.account_uuid;return $},create(H){return im.fromPartial(H??{})},fromPartial(H){let $=ly9();return $.account_id=H.account_id??0,$.organization_uuid=H.organization_uuid??"",$.account_uuid=H.account_uuid??"",$}}});function iy9(){return{actor_id:"",repository_id:"",repository_owner_id:""}}function ny9(){return{platform:"",node_version:"",terminal:"",package_managers:"",runtimes:"",is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:"",github_event_name:"",github_actions_runner_environment:"",github_actions_runner_os:"",github_action_ref:"",wsl_version:"",github_actions_metadata:void 0,arch:"",is_claude_code_remote:!1,remote_environment_type:"",claude_code_container_id:"",claude_code_remote_session_id:"",tags:[],deployment_environment:"",is_conductor:!1,version_base:"",coworker_type:""}}function ry9(){return{slack_team_id:"",is_enterprise_install:!1,trigger:"",creation_method:""}}function ay9(){return{event_name:"",client_timestamp:void 0,model:"",session_id:"",user_type:"",betas:"",env:void 0,entrypoint:"",agent_sdk_version:"",is_interactive:!1,client_type:"",process:"",additional_metadata:"",auth:void 0,server_timestamp:void 0,event_id:"",device_id:"",swe_bench_run_id:"",swe_bench_instance_id:"",swe_bench_task_id:"",email:"",agent_id:"",parent_session_id:"",agent_type:"",slack:void 0,team_name:""}}function oy9(H){let $=(H.seconds||0)*1000;return $+=(H.nanos||0)/1e6,new globalThis.Date($)}function sLD(H){if(H instanceof globalThis.Date)return H;else if(typeof H==="string")return new globalThis.Date(H);else return oy9(PvH.fromJSON(H))}function UB(H){return H!==null&&H!==void 0}var iW$,nW$,rW$,aW$;var eLD=K(()=>{DPA();fPA();iW$={fromJSON(H){return{actor_id:UB(H.actor_id)?globalThis.String(H.actor_id):"",repository_id:UB(H.repository_id)?globalThis.String(H.repository_id):"",repository_owner_id:UB(H.repository_owner_id)?globalThis.String(H.repository_owner_id):""}},toJSON(H){let $={};if(H.actor_id!==void 0)$.actor_id=H.actor_id;if(H.repository_id!==void 0)$.repository_id=H.repository_id;if(H.repository_owner_id!==void 0)$.repository_owner_id=H.repository_owner_id;return $},create(H){return iW$.fromPartial(H??{})},fromPartial(H){let $=iy9();return $.actor_id=H.actor_id??"",$.repository_id=H.repository_id??"",$.repository_owner_id=H.repository_owner_id??"",$}};nW$={fromJSON(H){return{platform:UB(H.platform)?globalThis.String(H.platform):"",node_version:UB(H.node_version)?globalThis.String(H.node_version):"",terminal:UB(H.terminal)?globalThis.String(H.terminal):"",package_managers:UB(H.package_managers)?globalThis.String(H.package_managers):"",runtimes:UB(H.runtimes)?globalThis.String(H.runtimes):"",is_running_with_bun:UB(H.is_running_with_bun)?globalThis.Boolean(H.is_running_with_bun):!1,is_ci:UB(H.is_ci)?globalThis.Boolean(H.is_ci):!1,is_claubbit:UB(H.is_claubbit)?globalThis.Boolean(H.is_claubbit):!1,is_github_action:UB(H.is_github_action)?globalThis.Boolean(H.is_github_action):!1,is_claude_code_action:UB(H.is_claude_code_action)?globalThis.Boolean(H.is_claude_code_action):!1,is_claude_ai_auth:UB(H.is_claude_ai_auth)?globalThis.Boolean(H.is_claude_ai_auth):!1,version:UB(H.version)?globalThis.String(H.version):"",github_event_name:UB(H.github_event_name)?globalThis.String(H.github_event_name):"",github_actions_runner_environment:UB(H.github_actions_runner_environment)?globalThis.String(H.github_actions_runner_environment):"",github_actions_runner_os:UB(H.github_actions_runner_os)?globalThis.String(H.github_actions_runner_os):"",github_action_ref:UB(H.github_action_ref)?globalThis.String(H.github_action_ref):"",wsl_version:UB(H.wsl_version)?globalThis.String(H.wsl_version):"",github_actions_metadata:UB(H.github_actions_metadata)?iW$.fromJSON(H.github_actions_metadata):void 0,arch:UB(H.arch)?globalThis.String(H.arch):"",is_claude_code_remote:UB(H.is_claude_code_remote)?globalThis.Boolean(H.is_claude_code_remote):!1,remote_environment_type:UB(H.remote_environment_type)?globalThis.String(H.remote_environment_type):"",claude_code_container_id:UB(H.claude_code_container_id)?globalThis.String(H.claude_code_container_id):"",claude_code_remote_session_id:UB(H.claude_code_remote_session_id)?globalThis.String(H.claude_code_remote_session_id):"",tags:globalThis.Array.isArray(H?.tags)?H.tags.map(($)=>globalThis.String($)):[],deployment_environment:UB(H.deployment_environment)?globalThis.String(H.deployment_environment):"",is_conductor:UB(H.is_conductor)?globalThis.Boolean(H.is_conductor):!1,version_base:UB(H.version_base)?globalThis.String(H.version_base):"",coworker_type:UB(H.coworker_type)?globalThis.String(H.coworker_type):""}},toJSON(H){let $={};if(H.platform!==void 0)$.platform=H.platform;if(H.node_version!==void 0)$.node_version=H.node_version;if(H.terminal!==void 0)$.terminal=H.terminal;if(H.package_managers!==void 0)$.package_managers=H.package_managers;if(H.runtimes!==void 0)$.runtimes=H.runtimes;if(H.is_running_with_bun!==void 0)$.is_running_with_bun=H.is_running_with_bun;if(H.is_ci!==void 0)$.is_ci=H.is_ci;if(H.is_claubbit!==void 0)$.is_claubbit=H.is_claubbit;if(H.is_github_action!==void 0)$.is_github_action=H.is_github_action;if(H.is_claude_code_action!==void 0)$.is_claude_code_action=H.is_claude_code_action;if(H.is_claude_ai_auth!==void 0)$.is_claude_ai_auth=H.is_claude_ai_auth;if(H.version!==void 0)$.version=H.version;if(H.github_event_name!==void 0)$.github_event_name=H.github_event_name;if(H.github_actions_runner_environment!==void 0)$.github_actions_runner_environment=H.github_actions_runner_environment;if(H.github_actions_runner_os!==void 0)$.github_actions_runner_os=H.github_actions_runner_os;if(H.github_action_ref!==void 0)$.github_action_ref=H.github_action_ref;if(H.wsl_version!==void 0)$.wsl_version=H.wsl_version;if(H.github_actions_metadata!==void 0)$.github_actions_metadata=iW$.toJSON(H.github_actions_metadata);if(H.arch!==void 0)$.arch=H.arch;if(H.is_claude_code_remote!==void 0)$.is_claude_code_remote=H.is_claude_code_remote;if(H.remote_environment_type!==void 0)$.remote_environment_type=H.remote_environment_type;if(H.claude_code_container_id!==void 0)$.claude_code_container_id=H.claude_code_container_id;if(H.claude_code_remote_session_id!==void 0)$.claude_code_remote_session_id=H.claude_code_remote_session_id;if(H.tags?.length)$.tags=H.tags;if(H.deployment_environment!==void 0)$.deployment_environment=H.deployment_environment;if(H.is_conductor!==void 0)$.is_conductor=H.is_conductor;if(H.version_base!==void 0)$.version_base=H.version_base;if(H.coworker_type!==void 0)$.coworker_type=H.coworker_type;return $},create(H){return nW$.fromPartial(H??{})},fromPartial(H){let $=ny9();return $.platform=H.platform??"",$.node_version=H.node_version??"",$.terminal=H.terminal??"",$.package_managers=H.package_managers??"",$.runtimes=H.runtimes??"",$.is_running_with_bun=H.is_running_with_bun??!1,$.is_ci=H.is_ci??!1,$.is_claubbit=H.is_claubbit??!1,$.is_github_action=H.is_github_action??!1,$.is_claude_code_action=H.is_claude_code_action??!1,$.is_claude_ai_auth=H.is_claude_ai_auth??!1,$.version=H.version??"",$.github_event_name=H.github_event_name??"",$.github_actions_runner_environment=H.github_actions_runner_environment??"",$.github_actions_runner_os=H.github_actions_runner_os??"",$.github_action_ref=H.github_action_ref??"",$.wsl_version=H.wsl_version??"",$.github_actions_metadata=H.github_actions_metadata!==void 0&&H.github_actions_metadata!==null?iW$.fromPartial(H.github_actions_metadata):void 0,$.arch=H.arch??"",$.is_claude_code_remote=H.is_claude_code_remote??!1,$.remote_environment_type=H.remote_environment_type??"",$.claude_code_container_id=H.claude_code_container_id??"",$.claude_code_remote_session_id=H.claude_code_remote_session_id??"",$.tags=H.tags?.map((A)=>A)||[],$.deployment_environment=H.deployment_environment??"",$.is_conductor=H.is_conductor??!1,$.version_base=H.version_base??"",$.coworker_type=H.coworker_type??"",$}};rW$={fromJSON(H){return{slack_team_id:UB(H.slack_team_id)?globalThis.String(H.slack_team_id):"",is_enterprise_install:UB(H.is_enterprise_install)?globalThis.Boolean(H.is_enterprise_install):!1,trigger:UB(H.trigger)?globalThis.String(H.trigger):"",creation_method:UB(H.creation_method)?globalThis.String(H.creation_method):""}},toJSON(H){let $={};if(H.slack_team_id!==void 0)$.slack_team_id=H.slack_team_id;if(H.is_enterprise_install!==void 0)$.is_enterprise_install=H.is_enterprise_install;if(H.trigger!==void 0)$.trigger=H.trigger;if(H.creation_method!==void 0)$.creation_method=H.creation_method;return $},create(H){return rW$.fromPartial(H??{})},fromPartial(H){let $=ry9();return $.slack_team_id=H.slack_team_id??"",$.is_enterprise_install=H.is_enterprise_install??!1,$.trigger=H.trigger??"",$.creation_method=H.creation_method??"",$}};aW$={fromJSON(H){return{event_name:UB(H.event_name)?globalThis.String(H.event_name):"",client_timestamp:UB(H.client_timestamp)?sLD(H.client_timestamp):void 0,model:UB(H.model)?globalThis.String(H.model):"",session_id:UB(H.session_id)?globalThis.String(H.session_id):"",user_type:UB(H.user_type)?globalThis.String(H.user_type):"",betas:UB(H.betas)?globalThis.String(H.betas):"",env:UB(H.env)?nW$.fromJSON(H.env):void 0,entrypoint:UB(H.entrypoint)?globalThis.String(H.entrypoint):"",agent_sdk_version:UB(H.agent_sdk_version)?globalThis.String(H.agent_sdk_version):"",is_interactive:UB(H.is_interactive)?globalThis.Boolean(H.is_interactive):!1,client_type:UB(H.client_type)?globalThis.String(H.client_type):"",process:UB(H.process)?globalThis.String(H.process):"",additional_metadata:UB(H.additional_metadata)?globalThis.String(H.additional_metadata):"",auth:UB(H.auth)?im.fromJSON(H.auth):void 0,server_timestamp:UB(H.server_timestamp)?sLD(H.server_timestamp):void 0,event_id:UB(H.event_id)?globalThis.String(H.event_id):"",device_id:UB(H.device_id)?globalThis.String(H.device_id):"",swe_bench_run_id:UB(H.swe_bench_run_id)?globalThis.String(H.swe_bench_run_id):"",swe_bench_instance_id:UB(H.swe_bench_instance_id)?globalThis.String(H.swe_bench_instance_id):"",swe_bench_task_id:UB(H.swe_bench_task_id)?globalThis.String(H.swe_bench_task_id):"",email:UB(H.email)?globalThis.String(H.email):"",agent_id:UB(H.agent_id)?globalThis.String(H.agent_id):"",parent_session_id:UB(H.parent_session_id)?globalThis.String(H.parent_session_id):"",agent_type:UB(H.agent_type)?globalThis.String(H.agent_type):"",slack:UB(H.slack)?rW$.fromJSON(H.slack):void 0,team_name:UB(H.team_name)?globalThis.String(H.team_name):""}},toJSON(H){let $={};if(H.event_name!==void 0)$.event_name=H.event_name;if(H.client_timestamp!==void 0)$.client_timestamp=H.client_timestamp.toISOString();if(H.model!==void 0)$.model=H.model;if(H.session_id!==void 0)$.session_id=H.session_id;if(H.user_type!==void 0)$.user_type=H.user_type;if(H.betas!==void 0)$.betas=H.betas;if(H.env!==void 0)$.env=nW$.toJSON(H.env);if(H.entrypoint!==void 0)$.entrypoint=H.entrypoint;if(H.agent_sdk_version!==void 0)$.agent_sdk_version=H.agent_sdk_version;if(H.is_interactive!==void 0)$.is_interactive=H.is_interactive;if(H.client_type!==void 0)$.client_type=H.client_type;if(H.process!==void 0)$.process=H.process;if(H.additional_metadata!==void 0)$.additional_metadata=H.additional_metadata;if(H.auth!==void 0)$.auth=im.toJSON(H.auth);if(H.server_timestamp!==void 0)$.server_timestamp=H.server_timestamp.toISOString();if(H.event_id!==void 0)$.event_id=H.event_id;if(H.device_id!==void 0)$.device_id=H.device_id;if(H.swe_bench_run_id!==void 0)$.swe_bench_run_id=H.swe_bench_run_id;if(H.swe_bench_instance_id!==void 0)$.swe_bench_instance_id=H.swe_bench_instance_id;if(H.swe_bench_task_id!==void 0)$.swe_bench_task_id=H.swe_bench_task_id;if(H.email!==void 0)$.email=H.email;if(H.agent_id!==void 0)$.agent_id=H.agent_id;if(H.parent_session_id!==void 0)$.parent_session_id=H.parent_session_id;if(H.agent_type!==void 0)$.agent_type=H.agent_type;if(H.slack!==void 0)$.slack=rW$.toJSON(H.slack);if(H.team_name!==void 0)$.team_name=H.team_name;return $},create(H){return aW$.fromPartial(H??{})},fromPartial(H){let $=ay9();return $.event_name=H.event_name??"",$.client_timestamp=H.client_timestamp??void 0,$.model=H.model??"",$.session_id=H.session_id??"",$.user_type=H.user_type??"",$.betas=H.betas??"",$.env=H.env!==void 0&&H.env!==null?nW$.fromPartial(H.env):void 0,$.entrypoint=H.entrypoint??"",$.agent_sdk_version=H.agent_sdk_version??"",$.is_interactive=H.is_interactive??!1,$.client_type=H.client_type??"",$.process=H.process??"",$.additional_metadata=H.additional_metadata??"",$.auth=H.auth!==void 0&&H.auth!==null?im.fromPartial(H.auth):void 0,$.server_timestamp=H.server_timestamp??void 0,$.event_id=H.event_id??"",$.device_id=H.device_id??"",$.swe_bench_run_id=H.swe_bench_run_id??"",$.swe_bench_instance_id=H.swe_bench_instance_id??"",$.swe_bench_task_id=H.swe_bench_task_id??"",$.email=H.email??"",$.agent_id=H.agent_id??"",$.parent_session_id=H.parent_session_id??"",$.agent_type=H.agent_type??"",$.slack=H.slack!==void 0&&H.slack!==null?rW$.fromPartial(H.slack):void 0,$.team_name=H.team_name??"",$}}});function ty9(){return{event_id:"",timestamp:void 0,experiment_id:"",variation_id:0,environment:"",user_attributes:"",experiment_metadata:"",device_id:"",auth:void 0,session_id:"",anonymous_id:"",event_metadata_vars:""}}function sy9(H){let $=(H.seconds||0)*1000;return $+=(H.nanos||0)/1e6,new globalThis.Date($)}function ey9(H){if(H instanceof globalThis.Date)return H;else if(typeof H==="string")return new globalThis.Date(H);else return sy9(PvH.fromJSON(H))}function lT(H){return H!==null&&H!==void 0}var EPA;var HID=K(()=>{DPA();fPA();EPA={fromJSON(H){return{event_id:lT(H.event_id)?globalThis.String(H.event_id):"",timestamp:lT(H.timestamp)?ey9(H.timestamp):void 0,experiment_id:lT(H.experiment_id)?globalThis.String(H.experiment_id):"",variation_id:lT(H.variation_id)?globalThis.Number(H.variation_id):0,environment:lT(H.environment)?globalThis.String(H.environment):"",user_attributes:lT(H.user_attributes)?globalThis.String(H.user_attributes):"",experiment_metadata:lT(H.experiment_metadata)?globalThis.String(H.experiment_metadata):"",device_id:lT(H.device_id)?globalThis.String(H.device_id):"",auth:lT(H.auth)?im.fromJSON(H.auth):void 0,session_id:lT(H.session_id)?globalThis.String(H.session_id):"",anonymous_id:lT(H.anonymous_id)?globalThis.String(H.anonymous_id):"",event_metadata_vars:lT(H.event_metadata_vars)?globalThis.String(H.event_metadata_vars):""}},toJSON(H){let $={};if(H.event_id!==void 0)$.event_id=H.event_id;if(H.timestamp!==void 0)$.timestamp=H.timestamp.toISOString();if(H.experiment_id!==void 0)$.experiment_id=H.experiment_id;if(H.variation_id!==void 0)$.variation_id=Math.round(H.variation_id);if(H.environment!==void 0)$.environment=H.environment;if(H.user_attributes!==void 0)$.user_attributes=H.user_attributes;if(H.experiment_metadata!==void 0)$.experiment_metadata=H.experiment_metadata;if(H.device_id!==void 0)$.device_id=H.device_id;if(H.auth!==void 0)$.auth=im.toJSON(H.auth);if(H.session_id!==void 0)$.session_id=H.session_id;if(H.anonymous_id!==void 0)$.anonymous_id=H.anonymous_id;if(H.event_metadata_vars!==void 0)$.event_metadata_vars=H.event_metadata_vars;return $},create(H){return EPA.fromPartial(H??{})},fromPartial(H){let $=ty9();return $.event_id=H.event_id??"",$.timestamp=H.timestamp??void 0,$.experiment_id=H.experiment_id??"",$.variation_id=H.variation_id??0,$.environment=H.environment??"",$.user_attributes=H.user_attributes??"",$.experiment_metadata=H.experiment_metadata??"",$.device_id=H.device_id??"",$.auth=H.auth!==void 0&&H.auth!==null?im.fromPartial(H.auth):void 0,$.session_id=H.session_id??"",$.anonymous_id=H.anonymous_id??"",$.event_metadata_vars=H.event_metadata_vars??"",$}}});function HWH(){return oW$.join(UL(),"telemetry")}class MPA{endpoint;timeout;maxBatchSize;batchDelayMs;baseBackoffDelayMs;maxBackoffDelayMs;pendingExports=[];isShutdown=!1;backoffRetryTimer=null;backoffAttempt=0;isRetrying=!1;lastExportErrorContext;constructor(H={}){let $=process.env.ANTHROPIC_BASE_URL==="https://api-staging.anthropic.com"?"https://api-staging.anthropic.com":"https://api.anthropic.com";this.endpoint=`${$}/api/event_logging/batch`,this.timeout=H.timeout||1e4,this.maxBatchSize=H.maxBatchSize||200,this.batchDelayMs=H.batchDelayMs||100,this.baseBackoffDelayMs=H.baseBackoffDelayMs||500,this.maxBackoffDelayMs=H.maxBackoffDelayMs||30000,this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return oW$.join(HWH(),`${AID}${j$()}.${$ID}.json`)}async loadEventsFromFile(H){try{let $=await hY.readFile(H);return M$H($)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(H,$){try{if($.length===0)try{await hY.unlink(H)}catch{}else{await hY.mkdir(HWH(),{recursive:!0});let A=$.map((L)=>yH(L)).join(` `;await hY.appendFile(H,A,"utf8")}catch(A){r(A)}}async deleteFile(H){try{await hY.unlink(H)}catch{}}async retryPreviousBatches(){try{if(!IID.existsSync(HWH()))return;let H=`${AID}${j$()}.`,$=(await hY.readdir(HWH())).filter((A)=>A.startsWith(H)&&A.endsWith(".json")).filter((A)=>!A.includes($ID));for(let A of $){let L=oW$.join(HWH(),A);this.retryFileInBackground(L)}}catch(H){r(H)}}async retryFileInBackground(H){let $=await this.loadEventsFromFile(H);if($.length===0){await this.deleteFile(H);return}let A=await this.sendEventsInBatches($);if(A.length===0)await this.deleteFile(H);else await this.saveEventsToFile(H,A)}async export(H,$){if(this.isShutdown){$({code:A0H.ExportResultCode.FAILED,error:Error("Exporter has been shutdown")});return}let A=this.doExport(H,$);this.pendingExports.push(A),A.finally(()=>{let L=this.pendingExports.indexOf(A);if(L>-1)this.pendingExports.splice(L,1)})}async doExport(H,$){try{let A=H.filter((D)=>D.instrumentationScope?.name==="com.anthropic.claude_code.events");if(A.length===0){$({code:A0H.ExportResultCode.SUCCESS});return}let L=this.transformLogsToEvents(A).events;if(L.length===0){$({code:A0H.ExportResultCode.SUCCESS});return}let I=await this.sendEventsInBatches(L);if(I.length>0){await this.queueFailedEvents(I),this.scheduleBackoffRetry();let D=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:"";$({code:A0H.ExportResultCode.FAILED,error:Error(`Failed to export ${I.length} events${D}`)});return}if(this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying)this.retryFailedEvents();$({code:A0H.ExportResultCode.SUCCESS})}catch(A){r(A),$({code:A0H.ExportResultCode.FAILED,error:A instanceof Error?A:Error("Unknown export error")})}}async sendEventsInBatches(H){let $=[];for(let I=0;I0)await new Promise((B)=>setTimeout(B,this.batchDelayMs))}if(A.length>0&&L)this.lastExportErrorContext=L;return A}async queueFailedEvents(H){let $=this.getCurrentBatchFilePath();await this.appendEventsToFile($,H);let A=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:"",L=`1P event logging: ${H.length} events failed to export${A}`;r(Error(L))}scheduleBackoffRetry(){if(this.backoffRetryTimer||this.isRetrying||this.isShutdown)return;let H=this.backoffAttempt+1,$=Math.min(this.baseBackoffDelayMs*H*H,this.maxBackoffDelayMs);this.backoffRetryTimer=setTimeout(()=>{this.backoffRetryTimer=null,this.retryFailedEvents()},$)}async retryFailedEvents(){let H=this.getCurrentBatchFilePath();while(!this.isShutdown){let $=await this.loadEventsFromFile(H);if($.length===0)break;this.isRetrying=!0,this.backoffAttempt++,await this.deleteFile(H);let A=await this.sendEventsInBatches($);if(this.isRetrying=!1,A.length>0){await this.saveEventsToFile(H,A),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){if(this.backoffAttempt=0,this.backoffRetryTimer)clearTimeout(this.backoffRetryTimer),this.backoffRetryTimer=null}async sendBatchWithRetry(H){let $={"Content-Type":"application/json","User-Agent":sG(),"x-service-name":"claude-code"},L=!(XG(!0)||tI());if(!L&&nL()){let f=dD();if(f&&pk(f.expiresAt))L=!0}let I=L?{headers:{},error:"trust not established or Oauth token expired"}:eG(),D=!I.error,B=D?{...$,...I.headers}:$;try{let f=await nA.post(this.endpoint,H,{timeout:this.timeout,headers:B});this.logSuccess(H.events.length,D,f.data);return}catch(f){if(D&&nA.isAxiosError(f)&&f.response?.status===401){let E=await nA.post(this.endpoint,H,{timeout:this.timeout,headers:$});this.logSuccess(H.events.length,!1,E.data);return}throw f}}logSuccess(H,$,A){}hrTimeToDate(H){let[$,A]=H;return new Date($*1000+A/1e6)}transformLogsToEvents(H){let $=[];for(let A of H){let L=A.attributes||{};if(L.event_type==="GrowthbookExperimentEvent"){let G=this.hrTimeToDate(A.hrTime);$.push({event_type:"GrowthbookExperimentEvent",event_data:EPA.toJSON({event_id:L.event_id,timestamp:G,experiment_id:L.experiment_id,variation_id:L.variation_id,environment:L.environment,user_attributes:L.user_attributes,experiment_metadata:L.experiment_metadata,device_id:L.device_id,session_id:L.session_id})});continue}let I=L.event_name||A.body||"unknown",D=L.core_metadata,B=L.user_metadata,f=L.event_metadata||{};if(!D){$.push({event_type:"ClaudeCodeInternalEvent",event_data:aW$.toJSON({event_id:L.event_id,event_name:I,client_timestamp:this.hrTimeToDate(A.hrTime),session_id:j$(),additional_metadata:yH({transform_error:"core_metadata attribute is missing"})})});continue}let E=WqI(D,B,f),M={...E.additional};$.push({event_type:"ClaudeCodeInternalEvent",event_data:aW$.toJSON({event_id:L.event_id,event_name:I,client_timestamp:this.hrTimeToDate(A.hrTime),device_id:L.user_id,email:B?.email,...E.core,env:E.env,process:E.process,additional_metadata:Object.keys(M).length>0?yH(M):void 0})})}return{events:$}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush()}async forceFlush(){await Promise.all(this.pendingExports)}}function Hv9(H){if(!nA.isAxiosError(H))return H instanceof Error?H.message:String(H);let $=[],A=H.response?.headers?.["request-id"];if(A)$.push(`request-id=${A}`);if(H.response?.status)$.push(`status=${H.response.status}`);if(H.code)$.push(`code=${H.code}`);if(H.message)$.push(H.message);return $.join(", ")}var A0H,LID,IID,hY,oW$,$ID,AID="1p_failed_events.";var DID=K(()=>{w1();E$();_$();nM();_Q();EI();Hq();R4();g$();vA();eLD();HID();NA();Z$();A0H=b(Kf(),1),LID=require("crypto"),IID=require("fs"),hY=require("fs/promises"),oW$=b(require("path")),$ID=LID.randomUUID()});var EID={};XA(EID,{shutdown1PEventLogging:()=>eW$,shouldSampleEvent:()=>sW$,logGrowthBookExperimentTo1P:()=>UPA,logEventTo1P:()=>H7$,is1PEventLoggingEnabled:()=>AWH,initialize1PEventLogging:()=>fv9,getEventSamplingConfig:()=>fID});function fID(){return rm($v9,{})}function sW$(H){let A=fID()[H];if(!A)return null;let L=A.sample_rate;if(typeof L!=="number"||L<0||L>1)return null;if(L>=1)return null;if(L<=0)return 0;return Math.random(){await $WH?.forceFlush()}),process.on("beforeExit",async()=>{await $WH?.forceFlush()})}var GPA,BID,tW$,$v9="tengu_event_sampling_config",_vH=null,$WH=null,Iv9=5000,Dv9=200,Bv9=8192;var YvH=K(()=>{vA();Fo();SD();IPA();Z9();ZE();R4();E$();hc();_$();ELH();Z$();DID();GPA=require("crypto"),BID=b(sQH(),1),tW$=b(rBH(),1)});function MID(H){return H.replace(/[A-Z]/g,($)=>`_${$.toLowerCase()}`)}async function A7$(){if(CvH.length===0)return;let H=[...CvH];CvH=[];try{await nA.post(Ev9,H,{headers:{"Content-Type":"application/json","DD-API-KEY":Mv9},timeout:Xv9})}catch($){r($ instanceof Error?$:Error(String($)))}}function Kv9(){if(iT)return;iT=setTimeout(()=>{iT=null,A7$()},Pv9()).unref()}async function XPA(){if(iT)clearTimeout(iT),iT=null;await A7$()}async function JPA(H,$){if(sI()!=="firstParty")return;let A=$7$;if(A===null)A=await Qv9();if(!A||!Jv9.has(H))return;try{let L=await VKH({model:$.model}),{envContext:I,...D}=L,B={...D,...I,...$,userBucket:Vv9()};if(typeof B.toolName==="string"&&B.toolName.startsWith("mcp__"))B.toolName="mcp";if(typeof B.model==="string"){let G=JK(B.model.replace(/\[1m]$/i,""));B.model=G in w9$?G:"other"}if(typeof B.version==="string")B.version=B.version.replace(/^(\d+\.\d+\.\d+-dev\.\d{8})\.t\d+\.sha[a-f0-9]+$/,"$1");if(B.status!==void 0&&B.status!==null){let G=String(B.status);B.http_status=G;let U=G.charAt(0);if(U>="1"&&U<="5")B.http_status_range=`${U}xx`;delete B.status}let f=B,M={ddsource:"nodejs",ddtags:Fv9.filter((G)=>f[G]!==void 0&&f[G]!==null).map((G)=>`${MID(G)}:${f[G]}`).join(","),message:H,service:"claude-code",hostname:"claude-code",env:"external"};for(let[G,U]of Object.entries(B))if(U!==void 0&&U!==null)M[MID(G)]=U;if(CvH.push(M),CvH.length>=Uv9){if(iT)clearTimeout(iT),iT=null;A7$()}else Kv9()}catch(L){r(L instanceof Error?L:Error(String(L)))}}function Pv9(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||"",10)||Gv9}var GID,Ev9="https://http-intake.logs.us5.datadoghq.com/api/v2/logs",Mv9="pubbbf48e6d78dae54bceaa4acf463299bf",Gv9=15000,Uv9=100,Xv9=5000,Jv9,Fv9,CvH,iT=null,$7$=null,Qv9,Wv9=30,Vv9;var FPA=K(()=>{w1();tD();_$();vA();aI();W5H();oM();R4();Fo();GID=require("crypto"),Jv9=new Set(["tengu_api_error","tengu_api_success","tengu_cancel","tengu_compact_failed","tengu_exit","tengu_flicker","tengu_init","tengu_model_fallback_triggered","tengu_oauth_error","tengu_oauth_success","tengu_oauth_token_refresh_failure","tengu_oauth_token_refresh_success","tengu_oauth_token_refresh_lock_acquiring","tengu_oauth_token_refresh_lock_acquired","tengu_oauth_token_refresh_starting","tengu_oauth_token_refresh_completed","tengu_oauth_token_refresh_lock_releasing","tengu_oauth_token_refresh_lock_released","tengu_query_error","tengu_session_quality_classification","tengu_tool_use_error","tengu_tool_use_granted_in_prompt_permanent","tengu_tool_use_granted_in_prompt_temporary","tengu_tool_use_rejected_in_prompt","tengu_tool_use_success"]),Fv9=["arch","clientType","errorType","http_status_range","http_status","model","platform","provider","subscriptionType","toolName","userBucket","userType","version","versionBase"];CvH=[];Qv9=o$(async()=>{if(NP())return $7$=!1,!1;try{let H=async()=>{if(iT)clearTimeout(iT),iT=null;await A7$()};return process.on("beforeExit",H),$7$=!0,!0}catch(H){return r(H instanceof Error?H:Error(String(H))),$7$=!1,!1}});Vv9=o$(()=>{let H=ux(),$=GID.createHash("sha256").update(H).digest("hex");return parseInt($.slice(0,8),16)%Wv9})});function KPA(){if(!process.stdout.isTTY)return;try{L0H.writeSync(1,x5H),L0H.writeSync(1,YLH),L0H.writeSync(1,a5H),L0H.writeSync(1,TO),L0H.writeSync(1,k1$)}catch{}}function QPA(){if(process.stdout.isTTY&&Mk()&&!uZ())try{let H=j$();if(!ZvH(H))return;let $=qvH(H),A;if($)A=`"${$.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;else A=H;L0H.writeSync(1,oH.dim(` claude --resume ${A} `))}catch{}}function L7$(H){if(wvH!==void 0)clearTimeout(wvH),wvH=void 0;try{process.exit(H)}catch($){process.kill(process.pid,"SIGKILL")}throw Error("unreachable")}function L9(H=0,$="other",A){process.exitCode=H,w0(H,$,A).catch((L)=>{N(`Graceful shutdown failed: ${L}`,{level:"error"}),KPA(),QPA(),L7$(H)})}async function w0(H=0,$="other",A){if(UID)return;UID=!0,wvH=setTimeout(()=>{L7$(H)},5000),wvH.unref(),process.exitCode=H;try{let{executeSessionEndHooks:I}=await Promise.resolve().then(() => (_3(),JID));await I($,A)}catch{}let L;try{let I=(async()=>{try{await dlA()}catch{}})();await Promise.race([I,new Promise((D,B)=>{L=setTimeout(()=>B(Error("Cleanup timeout")),2000)})]),clearTimeout(L),await eW$(),await XPA(),KPA(),QPA(),L7$(H)}catch{clearTimeout(L),await eW$(),await XPA(),KPA(),QPA(),L7$(H)}}var L0H,XID,UID=!1,wvH;var UU=K(()=>{r0();tD();E$();ZE();YvH();FPA();CLH();Jy();t5H();Z6();z$();g$();rB();L0H=require("fs");XID=o$(()=>{process.on("SIGINT",()=>{EL("info","shutdown_signal",{signal:"SIGINT"}),w0(0)}),process.on("SIGTERM",()=>{EL("info","shutdown_signal",{signal:"SIGTERM"}),w0(143)}),process.on("SIGHUP",()=>{EL("info","shutdown_signal",{signal:"SIGHUP"}),w0(129)}),process.on("uncaughtException",(H)=>{EL("error","uncaught_exception",{error_name:H.name,error_message:H.message.slice(0,2000)}),c("tengu_uncaught_exception",{error_name:H.name})}),process.on("unhandledRejection",(H)=>{let $=H instanceof Error?H.name:typeof H==="string"?"string":"unknown",A=H instanceof Error?{error_name:H.name,error_message:H.message.slice(0,2000),error_stack:H.stack?.slice(0,4000)}:{error_message:String(H).slice(0,2000)};EL("error","unhandled_rejection",A),c("tengu_unhandled_rejection",{error_name:$})})})});async function I7$(H){try{return await H()}catch($){if(nA.isAxiosError($)&&$.response?.status===401){c("tengu_grove_oauth_401_received",{});let A=dD()?.accessToken;if(A)return await A4H(A),await H()}throw $}}async function LWH(){try{return{success:!0,data:(await I7$(()=>{let $=eG();if($.error)throw Error(`Failed to get auth headers: ${$.error}`);return nA.get(`${XD().BASE_API_URL}/api/oauth/account/settings`,{headers:{...$.headers,"User-Agent":sG()}})})).data}}catch(H){return r(H),{success:!1}}}async function WPA(){try{await I7$(()=>{let H=eG();if(H.error)throw Error(`Failed to get auth headers: ${H.error}`);return nA.post(`${XD().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...H.headers,"User-Agent":sG()}})})}catch(H){r(H)}}async function D7$(H){try{await I7$(()=>{let $=eG();if($.error)throw Error(`Failed to get auth headers: ${$.error}`);return nA.patch(`${XD().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:H},{headers:{...$.headers,"User-Agent":sG()}})})}catch($){r($)}}async function IWH(){if(!jD$())return!1;let H=T9()?.accountUuid;if(!H)return!1;let A=M$().groveConfigCache?.[H],L=Date.now();if(!A)return N("Grove: No cache, fetching config in background (dialog skipped this session)"),FID(H),!1;if(L-A.timestamp>_v9)return N("Grove: Cache stale, returning cached data and refreshing in background"),FID(H),A.grove_enabled;return N("Grove: Using fresh cached config"),A.grove_enabled}async function FID(H){try{let $=await Wo();if(!$.success)return;let A=$.data.grove_enabled;AA((L)=>({...L,groveConfigCache:{...L.groveConfigCache,[H]:{grove_enabled:A,timestamp:Date.now()}}}))}catch($){N(`Grove: Failed to fetch and store config: ${$}`)}}var _v9=86400000,Wo;var DWH=K(()=>{w1();_Q();_$();qE();E$();z$();EI();vA();tD();Wo=o$(async()=>{try{let H=await I7$(()=>{let D=eG();if(D.error)throw Error(`Failed to get auth headers: ${D.error}`);return nA.get(`${XD().BASE_API_URL}/api/claude_code_grove`,{headers:{...D.headers,"User-Agent":Gn()},timeout:3000})}),{grove_enabled:$,domain_excluded:A,notice_is_grace_period:L,notice_reminder_frequency:I}=H.data;return{success:!0,data:{grove_enabled:$,domain_excluded:A??!1,notice_is_grace_period:L??!0,notice_reminder_frequency:I}}}catch(H){return N(`Failed to fetch Grove notice config: ${H}`),{success:!1}}})});var BYE,KID;var QID=K(()=>{mI();BYE=S.object({checksum:S.string(),version:S.string().optional()}),KID=S.object({uuid:S.string(),checksum:S.string(),settings:S.record(S.string(),S.unknown())})});function WID({isDisabled:H=!1,visibleOptionCount:$=5,options:A,defaultValue:L=[],onChange:I,onCancel:D,onFocus:B,focusValue:f,submitButtonText:E,onSubmit:M,onDownFromLastItem:G,onUpFromFirstItem:U,initialFocusLast:X}){let[J,F]=I0H.useState(L),[Q,W]=I0H.useState(!1),[P,C]=I0H.useState(()=>{let O=new Map;return A.forEach((j)=>{if(j.type==="input"&&j.initialValue)O.set(j.value,j.initialValue)}),O}),Y=I0H.useCallback((O)=>{let j=typeof O==="function"?O(J):O;F(j),I?.(j)},[J,I]),Z=X4$({visibleOptionCount:$,options:A,initialFocusValue:X?A[A.length-1]?.value:void 0,onFocus:B,focusValue:f});FY("multi-select");let q=I0H.useCallback((O,j)=>{C((y)=>{let g=new Map(y);return g.set(O,j),g});let u=A.find((y)=>y.value===O);if(u&&u.type==="input")u.onChange(j);Y((y)=>{if(j){if(!y.includes(O))return[...y,O];return y}else return y.filter((g)=>g!==O)})},[A,Y]);return WL((O,j,u)=>{let y=fFH(O),h=A.find((d)=>d.value===Z.focusedValue)?.type==="input";if(h){if(!(j.upArrow||j.downArrow||j.escape||j.tab||j.return||j.ctrl&&(O==="n"||O==="p"||j.return)))return}let p=A[A.length-1]?.value;if(j.tab&&!j.shift){if(E&&M&&Z.focusedValue===p&&!Q)W(!0);else if(!Q)Z.focusNextOption();return}if(j.tab&&j.shift){if(E&&M&&Q)W(!1),Z.focusOption(p);else Z.focusPreviousOption();return}if(j.downArrow||j.ctrl&&O==="n"||!j.ctrl&&!j.shift&&O==="j"){if(Q&&G)G();else if(E&&M&&Z.focusedValue===p&&!Q)W(!0);else if(!E&&G&&Z.focusedValue===p)G();else if(!Q)Z.focusNextOption();return}if(j.upArrow||j.ctrl&&O==="p"||!j.ctrl&&!j.shift&&O==="k"){if(E&&M&&Q)W(!1),Z.focusOption(p);else if(U&&Z.focusedValue===A[0]?.value)U();else Z.focusPreviousOption();return}if(j.pageDown){Z.focusNextPage();return}if(j.pageUp){Z.focusPreviousPage();return}if(j.return||K4$(O)===" "){if(j.ctrl&&j.return&&h&&M){M();return}if(Q&&M){M();return}if(Z.focusedValue!==void 0){let d=J.includes(Z.focusedValue)?J.filter((k)=>k!==Z.focusedValue):[...J,Z.focusedValue];Y(d)}return}if(/^[0-9]+$/.test(y)){let d=parseInt(y)-1;if(d>=0&&dGH!==k):[...J,k];Y(n)}return}if(j.escape)D(),u.stopImmediatePropagation()},{isActive:!H}),{...Z,selectedValues:J,inputValues:P,isSubmitFocused:Q,updateInputValue:q,onCancel:D}}var I0H;var VID=K(()=>{xH();Dx();w5A();I0H=b(s(),1)});function PID({isDisabled:H=!1,visibleOptionCount:$=5,options:A,defaultValue:L=[],onCancel:I,onChange:D,onFocus:B,focusValue:f,submitButtonText:E,onSubmit:M,onDownFromLastItem:G,onUpFromFirstItem:U,initialFocusLast:X,onOpenEditor:J,hideIndexes:F=!1,onImagePaste:Q,pastedContents:W,onRemoveImage:P}){let C=WID({isDisabled:H,visibleOptionCount:$,options:A,defaultValue:L,onChange:D,onCancel:I,onFocus:B,focusValue:f,submitButtonText:E,onSubmit:M,onDownFromLastItem:G,onUpFromFirstItem:U,initialFocusLast:X}),Y=A.length.toString().length;return Y3.default.createElement(x,{flexDirection:"column"},Y3.default.createElement(x,{flexDirection:"column"},C.visibleOptions.map((Z,q)=>{let O=!H&&C.focusedValue===Z.value&&!C.isSubmitFocused,j=C.selectedValues.includes(Z.value),u=Z.index===C.visibleFromIndex,y=Z.index===C.visibleToIndex-1,g=C.visibleToIndex0,p=C.visibleFromIndex+q+1;if(Z.type==="input"){let d=C.inputValues.get(Z.value)||"";return Y3.default.createElement(x,{key:String(Z.value),gap:1},Y3.default.createElement(UFH,{option:Z,isFocused:O,isSelected:!1,shouldShowDownArrow:g&&y,shouldShowUpArrow:h&&u,maxIndexWidth:Y,index:p,inputValue:d,onInputChange:(k)=>{C.updateInputValue(Z.value,k)},onSubmit:()=>{},onExit:()=>{I()},layout:"compact",onOpenEditor:J,onImagePaste:Q,pastedContents:W,onRemoveImage:P},Y3.default.createElement(V,{color:j?"success":void 0},"[",j?pH.tick:" ","]"," ")))}return Y3.default.createElement(x,{key:String(Z.value),gap:1},Y3.default.createElement(ur,{isFocused:O,isSelected:!1,shouldShowDownArrow:g&&y,shouldShowUpArrow:h&&u,description:Z.description},!F&&Y3.default.createElement(V,{dimColor:!0},`${p}.`.padEnd(Y)),Y3.default.createElement(V,{color:!F&&j?"success":void 0},"[",j?pH.tick:" ","]"),Y3.default.createElement(V,{color:O?"suggestion":void 0},Z.label)))})),E&&M&&Y3.default.createElement(x,{marginTop:0,gap:1},C.isSubmitFocused?Y3.default.createElement(V,{color:"suggestion"},pH.pointer):Y3.default.createElement(V,null," "),Y3.default.createElement(x,{marginLeft:3},Y3.default.createElement(V,{color:C.isSubmitFocused?"suggestion":void 0,bold:!0},E))))}var Y3;var _ID=K(()=>{jI();xH();x5A();G4$();VID();Y3=b(s(),1)});var l8=K(()=>{N1();_ID()});function BWH({title:H,subtitle:$,color:A="permission",workerBadge:L}){return HS.createElement(x,{flexDirection:"column"},HS.createElement(x,{flexDirection:"row",gap:1},HS.createElement(V,{bold:!0,color:A},H),L&&HS.createElement(V,{dimColor:!0},"\xB7 ","@",L.name)),$!=null&&(typeof $==="string"?HS.createElement(V,{dimColor:!0,wrap:"truncate-start"},$):$))}var HS;var B7$=K(()=>{xH();HS=b(s(),1)});function wG({title:H,subtitle:$,color:A="permission",titleColor:L,innerPaddingX:I=1,workerBadge:D,titleRight:B,children:f}){return $S.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:A,borderLeft:!1,borderRight:!1,borderBottom:!1,marginTop:1},$S.createElement(x,{paddingX:1,flexDirection:"column"},$S.createElement(x,{justifyContent:"space-between"},$S.createElement(BWH,{title:H,subtitle:$,color:L,workerBadge:D}),B)),$S.createElement(x,{flexDirection:"column",paddingX:I},f))}var $S;var Xw=K(()=>{xH();B7$();$S=b(s(),1)});var YID,D0H;var f7$=K(()=>{YID=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","otelHeadersHelper","statusLine"],D0H=new Set(["ANTHROPIC_CUSTOM_HEADERS","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_BASH_NO_LOGIN","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_VERTEX","DISABLE_AUTOUPDATER","DISABLE_BUG_COMMAND","DISABLE_COST_WARNINGS","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","ENABLE_EXPERIMENTAL_MCP_CLI","ENABLE_TOOL_SEARCH","MAX_MCP_OUTPUT_TOKENS","MAX_THINKING_TOKENS","MCP_TIMEOUT","MCP_TOOL_TIMEOUT","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_LOGS_HEADERS","OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE","OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_LOG_USER_PROMPTS","OTEL_LOGS_EXPORT_INTERVAL","OTEL_LOGS_EXPORTER","OTEL_METRIC_EXPORT_INTERVAL","OTEL_METRICS_EXPORTER","OTEL_METRICS_INCLUDE_ACCOUNT_UUID","OTEL_METRICS_INCLUDE_SESSION_ID","OTEL_METRICS_INCLUDE_VERSION","OTEL_RESOURCE_ATTRIBUTES","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_HAIKU_4_5"])});function fWH(H){if(!H)return{shellSettings:{},envVars:{},hasHooks:!1};let $={};for(let I of YID){let D=H[I];if(typeof D==="string"&&D.length>0)$[I]=D}let A={};if(H.env&&typeof H.env==="object"){for(let[I,D]of Object.entries(H.env))if(typeof D==="string"&&D.length>0){if(!D0H.has(I.toUpperCase()))A[I]=D}}let L=H.hooks!==void 0&&H.hooks!==null&&typeof H.hooks==="object"&&Object.keys(H.hooks).length>0;return{shellSettings:$,envVars:A,hasHooks:L,hooks:L?H.hooks:void 0}}function E7$(H){return Object.keys(H.shellSettings).length>0||Object.keys(H.envVars).length>0||H.hasHooks}function CID(H,$){let A=fWH(H),L=fWH($);if(!E7$(L))return!1;if(!E7$(A))return!0;let I=yH({shellSettings:A.shellSettings,envVars:A.envVars,hooks:A.hooks}),D=yH({shellSettings:L.shellSettings,envVars:L.envVars,hooks:L.hooks});return I!==D}function wID(H){let $=[];for(let A of Object.keys(H.shellSettings))$.push(A);for(let A of Object.keys(H.envVars))$.push(A);if(H.hasHooks)$.push("hooks");return $}var VPA=K(()=>{f7$();Z$()});function ZID({settings:H,onAccept:$,onReject:A}){let L=fWH(H),I=wID(L),D=zB();BA("confirm:no",A,{context:"Confirmation"});function B(f){if(f==="exit"){A();return}$()}return S7.default.createElement(wG,{color:"warning",titleColor:"warning",title:"Managed settings require approval"},S7.default.createElement(x,{flexDirection:"column",gap:1,paddingTop:1},S7.default.createElement(V,null,"Your organization has configured managed settings that could allow execution of arbitrary code or interception of your prompts and responses."),S7.default.createElement(x,{flexDirection:"column"},S7.default.createElement(V,{dimColor:!0},"Settings requiring approval:"),I.map((f,E)=>S7.default.createElement(x,{key:E,paddingLeft:2},S7.default.createElement(V,null,S7.default.createElement(V,{dimColor:!0},"\xB7 "),S7.default.createElement(V,null,f))))),S7.default.createElement(V,null,"Only accept if you trust your organization's IT administration and expect these settings to be configured."),S7.default.createElement(QA,{options:[{label:"Yes, I trust these settings",value:"accept"},{label:"No, exit Claude Code",value:"exit"}],onChange:(f)=>B(f),onCancel:()=>B("exit")}),S7.default.createElement(V,{dimColor:!0},D.pending?S7.default.createElement(S7.default.Fragment,null,"Press ",D.keyName," again to exit"):S7.default.createElement(S7.default.Fragment,null,"Enter to confirm \xB7 Esc to exit"))))}var S7;var qID=K(()=>{xH();l8();Xw();UM();$I();VPA();S7=b(s(),1)});function Yv9(){if(Vo!==null)return Vo;if(process.stdin.isTTY){Vo=void 0;return}if(A$(!1)){Vo=void 0;return}if(process.argv.includes("mcp")){Vo=void 0;return}try{let H=TID.openSync("/dev/tty","r"),$=new zID.ReadStream(H);return $.isTTY=!0,Vo=$,Vo}catch(H){r(H),Vo=void 0;return}}function ZG(H=!1){let $=Yv9(),A={exitOnCtrlC:H};if($)A.stdin=$;return A}var TID,zID,Vo=null;var sv=K(()=>{NA();_$();TID=require("fs"),zID=require("tty")});function wv9(H,$){let{addNotification:A,removeNotification:L}=wB();PJ.useEffect(()=>{if(H.length===0){L("keybinding-config-warning");return}let D=H.filter((E)=>E.severity==="error").length,B=H.filter((E)=>E.severity==="warning").length,f;if(D>0&&B>0)f=`Found ${D} keybinding error${D>1?"s":""} and ${B} warning${B>1?"s":""}`;else if(D>0)f=`Found ${D} keybinding error${D>1?"s":""}`;else f=`Found ${B} keybinding warning${B>1?"s":""}`;f+=" \xB7 /doctor for details",A({key:"keybinding-config-warning",text:f,color:D>0?"error":"warning",priority:D>0?"immediate":"high",timeoutMs:60000})},[H,$,A,L])}function hE({children:H}){let[{bindings:$,warnings:A},L]=PJ.useState(()=>{let W=wNH();return N(`[keybindings] KeybindingSetup initialized with ${W.bindings.length} bindings, ${W.warnings.length} warnings`),W}),[I,D]=PJ.useState(!1);wv9(A,I);let B=PJ.useRef(null),[f,E]=PJ.useState(null),M=PJ.useRef(null),G=PJ.useRef(new Map),U=PJ.useRef(new Set),X=PJ.useCallback((W)=>{U.current.add(W)},[]),J=PJ.useCallback((W)=>{U.current.delete(W)},[]),F=PJ.useCallback(()=>{if(M.current)clearTimeout(M.current),M.current=null},[]),Q=PJ.useCallback((W)=>{if(F(),W!==null)M.current=setTimeout(()=>{N("[keybindings] Chord timeout - cancelling"),B.current=null,E(null)},Cv9);B.current=W,E(W)},[F]);return PJ.useEffect(()=>{vAI();let W=hAI((P)=>{D(!0),L(P),N(`[keybindings] Reloaded: ${P.bindings.length} bindings, ${P.warnings.length} warnings`)});return()=>{W(),F()}},[F]),PJ.default.createElement(I8$,{bindings:$,pendingChordRef:B,pendingChord:f,setPendingChord:Q,activeContexts:U.current,registerActiveContext:X,unregisterActiveContext:J,handlerRegistryRef:G},PJ.default.createElement(Zv9,{bindings:$,pendingChordRef:B,setPendingChord:Q,activeContexts:U.current,handlerRegistryRef:G}),H)}function Zv9({bindings:H,pendingChordRef:$,setPendingChord:A,activeContexts:L,handlerRegistryRef:I}){let D=PJ.useCallback((B,f,E)=>{let M=I.current,G=new Set;if(M)for(let F of M.values())for(let Q of F)G.add(Q.context);let U=[...G,...L,"Global"],X=$.current!==null,J=A8$(B,f,U,H,$.current);switch(J.type){case"chord_started":A(J.pending),E.stopImmediatePropagation();break;case"match":{if(A(null),X){let F=new Set(U);if(M){let Q=M.get(J.action);if(Q&&Q.size>0){for(let W of Q)if(F.has(W.context)){W.handler(),E.stopImmediatePropagation();break}}}}break}case"chord_cancelled":A(null);break;case"unbound":A(null);break;case"none":break}},[H,$,A,L,I]);return WL(D),null}var PJ,Cv9=1000;var AS=K(()=>{xH();iu();nu();E$();bE();L8$();PJ=b(s(),1)});async function NID(H,$){if(!$||!E7$(fWH($)))return"no_check_needed";if(!CID(H,$))return"no_check_needed";if(!Mk())return"no_check_needed";return c("tengu_managed_settings_security_dialog_shown",{}),new Promise((A)=>{(async()=>{let{unmount:L}=await A8(M7$.default.createElement(i8,null,M7$.default.createElement(hE,null,M7$.default.createElement(ZID,{settings:$,onAccept:()=>{c("tengu_managed_settings_security_dialog_accepted",{}),L(),A("approved")},onReject:()=>{c("tengu_managed_settings_security_dialog_rejected",{}),L(),A("rejected")}}))),ZG(!1))})()})}function OID(H){if(H==="rejected")return L9(1),!1;return!0}var M7$;var xID=K(()=>{xH();qID();pL();g$();z$();UU();VPA();sv();AS();M7$=b(s(),1)});function jID(){if(B0H)return;if(aR())B0H=new Promise((H)=>{am=H,setTimeout(()=>{if(am)N("Remote settings: Loading promise timed out, resolving anyway"),am(),am=null},zv9)})}function Nv9(){return`${XD().BASE_API_URL}/api/claude_code/settings`}function _PA(H){if(Array.isArray(H))return H.map(_PA);if(H!==null&&typeof H==="object"){let $={};for(let A of Object.keys(H).sort())$[A]=_PA(H[A]);return $}return H}function Ov9(H){let $=_PA(H),A=yH($);return`sha256:${SID.createHash("sha256").update(A).digest("hex")}`}function YPA(){return aR()}async function RID(){if(B0H)await B0H}function xv9(){try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return{headers:{"x-api-key":$}}}catch{}let H=dD();if(H?.accessToken)return{headers:{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}};return{headers:{},error:"No authentication available"}}async function Sv9(H){let $=null;for(let A=1;A<=PPA+1;A++){if($=await jv9(H),$.success)return $;if($.skipRetry)return $;if(A>PPA)return $;let L=Rg(A);N(`Remote settings: Retry ${A}/${PPA} after ${L}ms`),await $x(L)}return $}async function jv9(H){try{await iW();let $=xv9();if($.error)return{success:!1,error:"Authentication required for remote settings",skipRetry:!0};let A=Nv9(),L={...$.headers,"User-Agent":sG()};if(H)L["If-None-Match"]=`"${H}"`;let I=await nA.get(A,{headers:L,timeout:qv9,validateStatus:(f)=>f===200||f===304||f===404});if(I.status===304)return N("Remote settings: Using cached settings (304)"),{success:!0,settings:null,checksum:H};if(I.status===404)return N("Remote settings: No settings found (404)"),{success:!0,settings:{},checksum:void 0};let D=KID.safeParse(I.data);if(!D.success)return N(`Remote settings: Invalid response format - ${D.error.message}`),{success:!1,error:"Invalid remote settings format"};let B=tZ.safeParse(D.data.settings);if(!B.success)return N(`Remote settings: Settings validation failed - ${B.error.message}`),{success:!1,error:"Invalid settings structure"};return N("Remote settings: Fetched successfully"),{success:!0,settings:B.data,checksum:D.data.checksum}}catch($){if(nA.isAxiosError($)){let A=$;if(A.response?.status===404)return{success:!0,settings:{},checksum:""};if(A.response?.status===401||A.response?.status===403)return{success:!1,error:"Not authorized for remote settings",skipRetry:!0};if(A.code==="ECONNABORTED")return{success:!1,error:"Remote settings request timeout"};if(A.code==="ECONNREFUSED"||A.code==="ENOTFOUND")return{success:!1,error:"Cannot connect to server"}}return{success:!1,error:$ instanceof Error?$.message:"Unknown error"}}}function Rv9(H){try{let $=xqH();d_($,yH(H,null,2),{encoding:"utf-8",mode:384}),N(`Remote settings: Saved to ${$}`)}catch($){N(`Remote settings: Failed to save - ${$ instanceof Error?$.message:"unknown error"}`)}}function CPA(){vID(),XmL(),B0H=null,am=null;try{let H=xqH();if(EWH.existsSync(H))EWH.unlinkSync(H)}catch{}}async function wPA(){if(!aR())return null;let H=e$A(),$=H?Ov9(H):void 0;try{let A=await Sv9($);if(!A.success){if(H)return N("Remote settings: Using stale cache after fetch failure"),I4H(H),H;return null}if(A.settings===null&&H)return N("Remote settings: Cache still valid (304 Not Modified)"),I4H(H),H;let L=A.settings||{};if(Object.keys(L).length>0){let D=await NID(H,L);if(!OID(D))return N("Remote settings: User rejected new settings, using cached settings"),H;return I4H(L),Rv9(L),N("Remote settings: Applied new settings successfully"),L}I4H(L);try{let D=xqH();if(EWH.existsSync(D))EWH.unlinkSync(D),N("Remote settings: Deleted cached file (404 response)")}catch(D){N(`Remote settings: Failed to delete cached file - ${D instanceof Error?D.message:"unknown error"}`)}return L}catch{if(H)return N("Remote settings: Using stale cache after error"),I4H(H),H;return null}}async function yID(){if(aR()&&!B0H)B0H=new Promise((H)=>{am=H});try{let H=await wPA();if(aR())vv9();if(H!==null)E5(),AF.notifyChange("policySettings")}finally{if(am)am(),am=null}}async function G7$(){if(CPA(),!aR()){E5(),AF.notifyChange("policySettings");return}await wPA(),N("Remote settings: Refreshed after auth change"),E5(),AF.notifyChange("policySettings")}async function yv9(){if(!aR())return;let H=s$A(),$=H?yH(H):null;try{await wPA();let A=s$A();if((A?yH(A):null)!==$)N("Remote settings: Changed during background poll"),E5(),AF.notifyChange("policySettings")}catch{}}function vv9(){if(TvH!==null)return;if(!aR())return;TvH=setInterval(()=>{yv9()},Tv9),PB(async()=>vID())}function vID(){if(TvH!==null)clearInterval(TvH),TvH=null}var SID,EWH,qv9=1e4,PPA=5,Tv9=3600000,TvH=null,B0H=null,am=null,zv9=30000;var zvH=K(()=>{w1();_Q();E$();qE();EI();bk();QID();rD();IDH();Ng();gk();ZE();xID();Z$();HAA();SID=require("crypto"),EWH=require("fs")});var U7$=z((NvH)=>{Object.defineProperty(NvH,"__esModule",{value:!0});NvH.AggregationTemporality=void 0;var hv9;(function(H){H[H.DELTA=0]="DELTA",H[H.CUMULATIVE=1]="CUMULATIVE"})(hv9=NvH.AggregationTemporality||(NvH.AggregationTemporality={}))});var _o=z((Po)=>{Object.defineProperty(Po,"__esModule",{value:!0});Po.DataPointType=Po.InstrumentType=void 0;var bv9;(function(H){H.COUNTER="COUNTER",H.GAUGE="GAUGE",H.HISTOGRAM="HISTOGRAM",H.UP_DOWN_COUNTER="UP_DOWN_COUNTER",H.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",H.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",H.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(bv9=Po.InstrumentType||(Po.InstrumentType={}));var kv9;(function(H){H[H.HISTOGRAM=0]="HISTOGRAM",H[H.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",H[H.GAUGE=2]="GAUGE",H[H.SUM=3]="SUM"})(kv9=Po.DataPointType||(Po.DataPointType={}))});var LS=z((k4)=>{Object.defineProperty(k4,"__esModule",{value:!0});k4.equalsCaseInsensitive=k4.binarySearchUB=k4.setEquals=k4.FlatMap=k4.isPromiseAllSettledRejectionResult=k4.PromiseAllSettled=k4.callWithTimeout=k4.TimeoutError=k4.instrumentationScopeId=k4.hashAttributes=k4.isNotNullish=void 0;function uv9(H){return H!==void 0&&H!==null}k4.isNotNullish=uv9;function gv9(H){let $=Object.keys(H);if($.length===0)return"";return $=$.sort(),JSON.stringify($.map((A)=>[A,H[A]]))}k4.hashAttributes=gv9;function mv9(H){return`${H.name}:${H.version??""}:${H.schemaUrl??""}`}k4.instrumentationScopeId=mv9;class X7$ extends Error{constructor(H){super(H);Object.setPrototypeOf(this,X7$.prototype)}}k4.TimeoutError=X7$;function pv9(H,$){let A,L=new Promise(function(D,B){A=setTimeout(function(){B(new X7$("Operation timed out."))},$)});return Promise.race([H,L]).then((I)=>{return clearTimeout(A),I},(I)=>{throw clearTimeout(A),I})}k4.callWithTimeout=pv9;async function dv9(H){return Promise.all(H.map(async($)=>{try{return{status:"fulfilled",value:await $}}catch(A){return{status:"rejected",reason:A}}}))}k4.PromiseAllSettled=dv9;function cv9(H){return H.status==="rejected"}k4.isPromiseAllSettledRejectionResult=cv9;function lv9(H,$){let A=[];return H.forEach((L)=>{A.push(...$(L))}),A}k4.FlatMap=lv9;function iv9(H,$){if(H.size!==$.size)return!1;for(let A of H)if(!$.has(A))return!1;return!0}k4.setEquals=iv9;function nv9(H,$){let A=0,L=H.length-1,I=H.length;while(L>=A){let D=A+Math.trunc((L-A)/2);if(H[D]<$)A=D+1;else I=D,L=D-1}return I}k4.binarySearchUB=nv9;function rv9(H,$){return H.toLowerCase()===$.toLowerCase()}k4.equalsCaseInsensitive=rv9});var MWH=z((OvH)=>{Object.defineProperty(OvH,"__esModule",{value:!0});OvH.AggregatorKind=void 0;var av9;(function(H){H[H.DROP=0]="DROP",H[H.SUM=1]="SUM",H[H.LAST_VALUE=2]="LAST_VALUE",H[H.HISTOGRAM=3]="HISTOGRAM",H[H.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(av9=OvH.AggregatorKind||(OvH.AggregatorKind={}))});var bID=z((J7$)=>{Object.defineProperty(J7$,"__esModule",{value:!0});J7$.DropAggregator=void 0;var ov9=MWH();class hID{kind=ov9.AggregatorKind.DROP;createAccumulation(){return}merge(H,$){return}diff(H,$){return}toMetricData(H,$,A,L){return}}J7$.DropAggregator=hID});var uID=z((GWH)=>{Object.defineProperty(GWH,"__esModule",{value:!0});GWH.HistogramAggregator=GWH.HistogramAccumulation=void 0;var tv9=MWH(),xvH=_o(),sv9=LS();function ev9(H){let $=H.map(()=>0);return $.push(0),{buckets:{boundaries:H,counts:$},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}class SvH{startTime;_boundaries;_recordMinMax;_current;constructor(H,$,A=!0,L=ev9($)){this.startTime=H,this._boundaries=$,this._recordMinMax=A,this._current=L}record(H){if(Number.isNaN(H))return;if(this._current.count+=1,this._current.sum+=H,this._recordMinMax)this._current.min=Math.min(H,this._current.min),this._current.max=Math.max(H,this._current.max),this._current.hasMinMax=!0;let $=(0,sv9.binarySearchUB)(this._boundaries,H);this._current.buckets.counts[$]+=1}setStartTime(H){this.startTime=H}toPointValue(){return this._current}}GWH.HistogramAccumulation=SvH;class kID{_boundaries;_recordMinMax;kind=tv9.AggregatorKind.HISTOGRAM;constructor(H,$){this._boundaries=H,this._recordMinMax=$}createAccumulation(H){return new SvH(H,this._boundaries,this._recordMinMax)}merge(H,$){let A=H.toPointValue(),L=$.toPointValue(),I=A.buckets.counts,D=L.buckets.counts,B=Array(I.length);for(let M=0;M{let B=D.toPointValue(),f=H.type===xvH.InstrumentType.GAUGE||H.type===xvH.InstrumentType.UP_DOWN_COUNTER||H.type===xvH.InstrumentType.OBSERVABLE_GAUGE||H.type===xvH.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:I,startTime:D.startTime,endTime:L,value:{min:B.hasMinMax?B.min:void 0,max:B.hasMinMax?B.max:void 0,sum:!f?B.sum:void 0,buckets:B.buckets,count:B.count}}})}}}GWH.HistogramAggregator=kID});var gID=z((F7$)=>{Object.defineProperty(F7$,"__esModule",{value:!0});F7$.Buckets=void 0;class ZPA{backing;indexBase;indexStart;indexEnd;constructor(H=new qPA,$=0,A=0,L=0){this.backing=H,this.indexBase=$,this.indexStart=A,this.indexEnd=L}get offset(){return this.indexStart}get length(){if(this.backing.length===0)return 0;if(this.indexEnd===this.indexStart&&this.at(0)===0)return 0;return this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(H,$)=>this.at($))}at(H){let $=this.indexBase-this.indexStart;if(H<$)H+=this.backing.length;return H-=$,this.backing.countAt(H)}incrementBucket(H,$){this.backing.increment(H,$)}decrementBucket(H,$){this.backing.decrement(H,$)}trim(){for(let H=0;H=0;H--)if(this.at(H)!==0){this.indexEnd-=this.length-H-1;break}this._rotate()}downscale(H){this._rotate();let $=1+this.indexEnd-this.indexStart,A=1<>=H,this.indexEnd>>=H,this.indexBase=this.indexStart}clone(){return new ZPA(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let H=this.indexBase-this.indexStart;if(H===0)return;else if(H>0)this.backing.reverse(0,this.backing.length),this.backing.reverse(0,H),this.backing.reverse(H,this.backing.length);else this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+H);this.indexBase=this.indexStart}_relocateBucket(H,$){if(H===$)return;this.incrementBucket(H,this.backing.emptyBucket($))}}F7$.Buckets=ZPA;class qPA{_counts;constructor(H=[0]){this._counts=H}get length(){return this._counts.length}countAt(H){return this._counts[H]}growTo(H,$,A){let L=Array(H).fill(0);L.splice(A,this._counts.length-$,...this._counts.slice($)),L.splice(0,$,...this._counts.slice(0,$)),this._counts=L}reverse(H,$){let A=Math.floor((H+$)/2)-H;for(let L=0;L=$)this._counts[H]-=$;else this._counts[H]=0}clone(){return new qPA([...this._counts])}}});var zPA=z((bY)=>{Object.defineProperty(bY,"__esModule",{value:!0});bY.getSignificand=bY.getNormalBase2=bY.MIN_VALUE=bY.MAX_NORMAL_EXPONENT=bY.MIN_NORMAL_EXPONENT=bY.SIGNIFICAND_WIDTH=void 0;bY.SIGNIFICAND_WIDTH=52;var Hh9=2146435072,$h9=1048575,TPA=1023;bY.MIN_NORMAL_EXPONENT=-TPA+1;bY.MAX_NORMAL_EXPONENT=TPA;bY.MIN_VALUE=Math.pow(2,-1022);function Ah9(H){let $=new DataView(new ArrayBuffer(8));return $.setFloat64(0,H),(($.getUint32(0)&Hh9)>>20)-TPA}bY.getNormalBase2=Ah9;function Lh9(H){let $=new DataView(new ArrayBuffer(8));$.setFloat64(0,H);let A=$.getUint32(0),L=$.getUint32(4);return(A&$h9)*Math.pow(2,32)+L}bY.getSignificand=Lh9});var K7$=z((UWH)=>{Object.defineProperty(UWH,"__esModule",{value:!0});UWH.nextGreaterSquare=UWH.ldexp=void 0;function Ih9(H,$){if(H===0||H===Number.POSITIVE_INFINITY||H===Number.NEGATIVE_INFINITY||Number.isNaN(H))return H;return H*Math.pow(2,$)}UWH.ldexp=Ih9;function Dh9(H){return H--,H|=H>>1,H|=H>>2,H|=H>>4,H|=H>>8,H|=H>>16,H++,H}UWH.nextGreaterSquare=Dh9});var W7$=z((Q7$)=>{Object.defineProperty(Q7$,"__esModule",{value:!0});Q7$.MappingError=void 0;class mID extends Error{}Q7$.MappingError=mID});var cID=z((V7$)=>{Object.defineProperty(V7$,"__esModule",{value:!0});V7$.ExponentMapping=void 0;var XWH=zPA(),Bh9=K7$(),pID=W7$();class dID{_shift;constructor(H){this._shift=-H}mapToIndex(H){if(H>this._shift}lowerBoundary(H){let $=this._minNormalLowerBoundaryIndex();if(H<$)throw new pID.MappingError(`underflow: ${H} is < minimum lower boundary: ${$}`);let A=this._maxNormalLowerBoundaryIndex();if(H>A)throw new pID.MappingError(`overflow: ${H} is > maximum lower boundary: ${A}`);return Bh9.ldexp(1,H<>this._shift;if(this._shift<2)H--;return H}_maxNormalLowerBoundaryIndex(){return XWH.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(H,$){return Math.floor(H*Math.pow(2,-$))}}V7$.ExponentMapping=dID});var rID=z((P7$)=>{Object.defineProperty(P7$,"__esModule",{value:!0});P7$.LogarithmMapping=void 0;var JWH=zPA(),lID=K7$(),iID=W7$();class nID{_scale;_scaleFactor;_inverseFactor;constructor(H){this._scale=H,this._scaleFactor=lID.ldexp(Math.LOG2E,H),this._inverseFactor=lID.ldexp(Math.LN2,-H)}mapToIndex(H){if(H<=JWH.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(JWH.getSignificand(H)===0)return(JWH.getNormalBase2(H)<=A)return A;return $}lowerBoundary(H){let $=this._maxNormalLowerBoundaryIndex();if(H>=$){if(H===$)return 2*Math.exp((H-(1< maximum lower boundary: ${$}`)}let A=this._minNormalLowerBoundaryIndex();if(H<=A){if(H===A)return JWH.MIN_VALUE;else if(H===A-1)return Math.exp((H+(1<{Object.defineProperty(_7$,"__esModule",{value:!0});_7$.getMapping=void 0;var fh9=cID(),Eh9=rID(),Mh9=W7$(),aID=-10,oID=20,Gh9=Array.from({length:31},(H,$)=>{if($>10)return new Eh9.LogarithmMapping($-10);return new fh9.ExponentMapping($-10)});function Uh9(H){if(H>oID||H= ${aID} && <= ${oID}, got: ${H}`);return Gh9[H+10]}_7$.getMapping=Uh9});var $DD=z((KWH)=>{Object.defineProperty(KWH,"__esModule",{value:!0});KWH.ExponentialHistogramAggregator=KWH.ExponentialHistogramAccumulation=void 0;var Xh9=MWH(),jvH=_o(),Jh9=kB(),sID=gID(),eID=tID(),Fh9=K7$();class FWH{low;high;static combine(H,$){return new FWH(Math.min(H.low,$.low),Math.max(H.high,$.high))}constructor(H,$){this.low=H,this.high=$}}var Kh9=20,Qh9=160,NPA=2;class Y7${startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(H,$=Qh9,A=!0,L=0,I=0,D=0,B=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,E=new sID.Buckets,M=new sID.Buckets,G=(0,eID.getMapping)(Kh9)){if(this.startTime=H,this._maxSize=$,this._recordMinMax=A,this._sum=L,this._count=I,this._zeroCount=D,this._min=B,this._max=f,this._positive=E,this._negative=M,this._mapping=G,this._maxSizethis._max)this._max=H;if(H0)this._updateBuckets(this._positive,H,$);else this._updateBuckets(this._negative,-H,$)}merge(H){if(this._count===0)this._min=H.min,this._max=H.max;else if(H.count!==0){if(H.minthis.max)this._max=H.max}this.startTime=H.startTime,this._sum+=H.sum,this._count+=H.count,this._zeroCount+=H.zeroCount;let $=this._minScale(H);this._downscale(this.scale-$),this._mergeBuckets(this.positive,H,H.positive,$),this._mergeBuckets(this.negative,H,H.negative,$)}diff(H){this._min=1/0,this._max=-1/0,this._sum-=H.sum,this._count-=H.count,this._zeroCount-=H.zeroCount;let $=this._minScale(H);this._downscale(this.scale-$),this._diffBuckets(this.positive,H,H.positive,$),this._diffBuckets(this.negative,H,H.negative,$)}clone(){return new Y7$(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(H,$,A){let L=this._mapping.mapToIndex($),I=!1,D=0,B=0;if(H.length===0)H.indexStart=L,H.indexEnd=H.indexStart,H.indexBase=H.indexStart;else if(L=this._maxSize)I=!0,B=L,D=H.indexEnd;else if(L>H.indexEnd&&L-H.indexStart>=this._maxSize)I=!0,B=H.indexStart,D=L;if(I){let f=this._changeScale(D,B);this._downscale(f),L=this._mapping.mapToIndex($)}this._incrementIndexBy(H,L,A)}_incrementIndexBy(H,$,A){if(A===0)return;if(H.length===0)H.indexStart=H.indexEnd=H.indexBase=$;if($=H.backing.length)this._grow(H,I+1);H.indexStart=$}else if($>H.indexEnd){let I=$-H.indexStart;if(I>=H.backing.length)this._grow(H,I+1);H.indexEnd=$}let L=$-H.indexBase;if(L<0)L+=H.backing.length;H.incrementBucket(L,A)}_grow(H,$){let A=H.backing.length,L=H.indexBase-H.indexStart,I=A-L,D=(0,Fh9.nextGreaterSquare)($);if(D>this._maxSize)D=this._maxSize;let B=D-L;H.backing.growTo(D,I,B)}_changeScale(H,$){let A=0;while(H-$>=this._maxSize)H>>=1,$>>=1,A++;return A}_downscale(H){if(H===0)return;if(H<0)throw Error(`impossible change of scale: ${this.scale}`);let $=this._mapping.scale-H;this._positive.downscale(H),this._negative.downscale(H),this._mapping=(0,eID.getMapping)($)}_minScale(H){let $=Math.min(this.scale,H.scale),A=FWH.combine(this._highLowAtScale(this.positive,this.scale,$),this._highLowAtScale(H.positive,H.scale,$)),L=FWH.combine(this._highLowAtScale(this.negative,this.scale,$),this._highLowAtScale(H.negative,H.scale,$));return Math.min($-this._changeScale(A.high,A.low),$-this._changeScale(L.high,L.low))}_highLowAtScale(H,$,A){if(H.length===0)return new FWH(0,-1);let L=$-A;return new FWH(H.indexStart>>L,H.indexEnd>>L)}_mergeBuckets(H,$,A,L){let I=A.offset,D=$.scale-L;for(let B=0;B>D,A.at(B))}_diffBuckets(H,$,A,L){let I=A.offset,D=$.scale-L;for(let B=0;B>D)-H.indexBase;if(E<0)E+=H.backing.length;H.decrementBucket(E,A.at(B))}H.trim()}}KWH.ExponentialHistogramAccumulation=Y7$;class HDD{_maxSize;_recordMinMax;kind=Xh9.AggregatorKind.EXPONENTIAL_HISTOGRAM;constructor(H,$){this._maxSize=H,this._recordMinMax=$}createAccumulation(H){return new Y7$(H,this._maxSize,this._recordMinMax)}merge(H,$){let A=$.clone();return A.merge(H),A}diff(H,$){let A=$.clone();return A.diff(H),A}toMetricData(H,$,A,L){return{descriptor:H,aggregationTemporality:$,dataPointType:jvH.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:A.map(([I,D])=>{let B=D.toPointValue(),f=H.type===jvH.InstrumentType.GAUGE||H.type===jvH.InstrumentType.UP_DOWN_COUNTER||H.type===jvH.InstrumentType.OBSERVABLE_GAUGE||H.type===jvH.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:I,startTime:D.startTime,endTime:L,value:{min:B.hasMinMax?B.min:void 0,max:B.hasMinMax?B.max:void 0,sum:!f?B.sum:void 0,positive:{offset:B.positive.offset,bucketCounts:B.positive.bucketCounts},negative:{offset:B.negative.offset,bucketCounts:B.negative.bucketCounts},count:B.count,scale:B.scale,zeroCount:B.zeroCount}}})}}}KWH.ExponentialHistogramAggregator=HDD});var LDD=z((QWH)=>{Object.defineProperty(QWH,"__esModule",{value:!0});QWH.LastValueAggregator=QWH.LastValueAccumulation=void 0;var Wh9=MWH(),RvH=Kf(),Vh9=_o();class yvH{startTime;_current;sampleTime;constructor(H,$=0,A=[0,0]){this.startTime=H,this._current=$,this.sampleTime=A}record(H){this._current=H,this.sampleTime=(0,RvH.millisToHrTime)(Date.now())}setStartTime(H){this.startTime=H}toPointValue(){return this._current}}QWH.LastValueAccumulation=yvH;class ADD{kind=Wh9.AggregatorKind.LAST_VALUE;createAccumulation(H){return new yvH(H)}merge(H,$){let A=(0,RvH.hrTimeToMicroseconds)($.sampleTime)>=(0,RvH.hrTimeToMicroseconds)(H.sampleTime)?$:H;return new yvH(H.startTime,A.toPointValue(),A.sampleTime)}diff(H,$){let A=(0,RvH.hrTimeToMicroseconds)($.sampleTime)>=(0,RvH.hrTimeToMicroseconds)(H.sampleTime)?$:H;return new yvH($.startTime,A.toPointValue(),A.sampleTime)}toMetricData(H,$,A,L){return{descriptor:H,aggregationTemporality:$,dataPointType:Vh9.DataPointType.GAUGE,dataPoints:A.map(([I,D])=>{return{attributes:I,startTime:D.startTime,endTime:L,value:D.toPointValue()}})}}}QWH.LastValueAggregator=ADD});var DDD=z((WWH)=>{Object.defineProperty(WWH,"__esModule",{value:!0});WWH.SumAggregator=WWH.SumAccumulation=void 0;var Ph9=MWH(),_h9=_o();class f0H{startTime;monotonic;_current;reset;constructor(H,$,A=0,L=!1){this.startTime=H,this.monotonic=$,this._current=A,this.reset=L}record(H){if(this.monotonic&&H<0)return;this._current+=H}setStartTime(H){this.startTime=H}toPointValue(){return this._current}}WWH.SumAccumulation=f0H;class IDD{monotonic;kind=Ph9.AggregatorKind.SUM;constructor(H){this.monotonic=H}createAccumulation(H){return new f0H(H,this.monotonic)}merge(H,$){let A=H.toPointValue(),L=$.toPointValue();if($.reset)return new f0H($.startTime,this.monotonic,L,$.reset);return new f0H(H.startTime,this.monotonic,A+L)}diff(H,$){let A=H.toPointValue(),L=$.toPointValue();if(this.monotonic&&A>L)return new f0H($.startTime,this.monotonic,L,!0);return new f0H($.startTime,this.monotonic,L-A)}toMetricData(H,$,A,L){return{descriptor:H,aggregationTemporality:$,dataPointType:_h9.DataPointType.SUM,dataPoints:A.map(([I,D])=>{return{attributes:I,startTime:D.startTime,endTime:L,value:D.toPointValue()}}),isMonotonic:this.monotonic}}}WWH.SumAggregator=IDD});var GDD=z((SF)=>{Object.defineProperty(SF,"__esModule",{value:!0});SF.SumAggregator=SF.SumAccumulation=SF.LastValueAggregator=SF.LastValueAccumulation=SF.ExponentialHistogramAggregator=SF.ExponentialHistogramAccumulation=SF.HistogramAggregator=SF.HistogramAccumulation=SF.DropAggregator=void 0;var Yh9=bID();Object.defineProperty(SF,"DropAggregator",{enumerable:!0,get:function(){return Yh9.DropAggregator}});var BDD=uID();Object.defineProperty(SF,"HistogramAccumulation",{enumerable:!0,get:function(){return BDD.HistogramAccumulation}});Object.defineProperty(SF,"HistogramAggregator",{enumerable:!0,get:function(){return BDD.HistogramAggregator}});var fDD=$DD();Object.defineProperty(SF,"ExponentialHistogramAccumulation",{enumerable:!0,get:function(){return fDD.ExponentialHistogramAccumulation}});Object.defineProperty(SF,"ExponentialHistogramAggregator",{enumerable:!0,get:function(){return fDD.ExponentialHistogramAggregator}});var EDD=LDD();Object.defineProperty(SF,"LastValueAccumulation",{enumerable:!0,get:function(){return EDD.LastValueAccumulation}});Object.defineProperty(SF,"LastValueAggregator",{enumerable:!0,get:function(){return EDD.LastValueAggregator}});var MDD=DDD();Object.defineProperty(SF,"SumAccumulation",{enumerable:!0,get:function(){return MDD.SumAccumulation}});Object.defineProperty(SF,"SumAggregator",{enumerable:!0,get:function(){return MDD.SumAggregator}})});var UDD=z(($E)=>{Object.defineProperty($E,"__esModule",{value:!0});$E.DEFAULT_AGGREGATION=$E.EXPONENTIAL_HISTOGRAM_AGGREGATION=$E.HISTOGRAM_AGGREGATION=$E.LAST_VALUE_AGGREGATION=$E.SUM_AGGREGATION=$E.DROP_AGGREGATION=$E.DefaultAggregation=$E.ExponentialHistogramAggregation=$E.ExplicitBucketHistogramAggregation=$E.HistogramAggregation=$E.LastValueAggregation=$E.SumAggregation=$E.DropAggregation=void 0;var Ch9=kB(),E0H=GDD(),ev=_o();class C7${static DEFAULT_INSTANCE=new E0H.DropAggregator;createAggregator(H){return C7$.DEFAULT_INSTANCE}}$E.DropAggregation=C7$;class vvH{static MONOTONIC_INSTANCE=new E0H.SumAggregator(!0);static NON_MONOTONIC_INSTANCE=new E0H.SumAggregator(!1);createAggregator(H){switch(H.type){case ev.InstrumentType.COUNTER:case ev.InstrumentType.OBSERVABLE_COUNTER:case ev.InstrumentType.HISTOGRAM:return vvH.MONOTONIC_INSTANCE;default:return vvH.NON_MONOTONIC_INSTANCE}}}$E.SumAggregation=vvH;class w7${static DEFAULT_INSTANCE=new E0H.LastValueAggregator;createAggregator(H){return w7$.DEFAULT_INSTANCE}}$E.LastValueAggregation=w7$;class Z7${static DEFAULT_INSTANCE=new E0H.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1000,2500,5000,7500,1e4],!0);createAggregator(H){return Z7$.DEFAULT_INSTANCE}}$E.HistogramAggregation=Z7$;class OPA{_recordMinMax;_boundaries;constructor(H,$=!0){if(this._recordMinMax=$,H==null)throw Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");H=H.concat(),H=H.sort((I,D)=>I-D);let A=H.lastIndexOf(-1/0),L=H.indexOf(1/0);if(L===-1)L=void 0;this._boundaries=H.slice(A+1,L)}createAggregator(H){return new E0H.HistogramAggregator(this._boundaries,this._recordMinMax)}}$E.ExplicitBucketHistogramAggregation=OPA;class xPA{_maxSize;_recordMinMax;constructor(H=160,$=!0){this._maxSize=H,this._recordMinMax=$}createAggregator(H){return new E0H.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}}$E.ExponentialHistogramAggregation=xPA;class SPA{_resolve(H){switch(H.type){case ev.InstrumentType.COUNTER:case ev.InstrumentType.UP_DOWN_COUNTER:case ev.InstrumentType.OBSERVABLE_COUNTER:case ev.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return $E.SUM_AGGREGATION;case ev.InstrumentType.GAUGE:case ev.InstrumentType.OBSERVABLE_GAUGE:return $E.LAST_VALUE_AGGREGATION;case ev.InstrumentType.HISTOGRAM:{if(H.advice.explicitBucketBoundaries)return new OPA(H.advice.explicitBucketBoundaries);return $E.HISTOGRAM_AGGREGATION}}return Ch9.diag.warn(`Unable to recognize instrument type: ${H.type}`),$E.DROP_AGGREGATION}createAggregator(H){return this._resolve(H).createAggregator(H)}}$E.DefaultAggregation=SPA;$E.DROP_AGGREGATION=new C7$;$E.SUM_AGGREGATION=new vvH;$E.LAST_VALUE_AGGREGATION=new w7$;$E.HISTOGRAM_AGGREGATION=new Z7$;$E.EXPONENTIAL_HISTOGRAM_AGGREGATION=new xPA;$E.DEFAULT_AGGREGATION=new SPA});var hvH=z((U0H)=>{Object.defineProperty(U0H,"__esModule",{value:!0});U0H.toAggregation=U0H.AggregationType=void 0;var M0H=UDD(),G0H;(function(H){H[H.DEFAULT=0]="DEFAULT",H[H.DROP=1]="DROP",H[H.SUM=2]="SUM",H[H.LAST_VALUE=3]="LAST_VALUE",H[H.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",H[H.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(G0H=U0H.AggregationType||(U0H.AggregationType={}));function wh9(H){switch(H.type){case G0H.DEFAULT:return M0H.DEFAULT_AGGREGATION;case G0H.DROP:return M0H.DROP_AGGREGATION;case G0H.SUM:return M0H.SUM_AGGREGATION;case G0H.LAST_VALUE:return M0H.LAST_VALUE_AGGREGATION;case G0H.EXPONENTIAL_HISTOGRAM:{let $=H;return new M0H.ExponentialHistogramAggregation($.options?.maxSize,$.options?.recordMinMax)}case G0H.EXPLICIT_BUCKET_HISTOGRAM:{let $=H;if($.options==null)return M0H.HISTOGRAM_AGGREGATION;else return new M0H.ExplicitBucketHistogramAggregation($.options?.boundaries,$.options?.recordMinMax)}default:throw Error("Unsupported Aggregation")}}U0H.toAggregation=wh9});var jPA=z((VWH)=>{Object.defineProperty(VWH,"__esModule",{value:!0});VWH.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=VWH.DEFAULT_AGGREGATION_SELECTOR=void 0;var Zh9=U7$(),qh9=hvH(),Th9=(H)=>{return{type:qh9.AggregationType.DEFAULT}};VWH.DEFAULT_AGGREGATION_SELECTOR=Th9;var zh9=(H)=>Zh9.AggregationTemporality.CUMULATIVE;VWH.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=zh9});var RPA=z((T7$)=>{Object.defineProperty(T7$,"__esModule",{value:!0});T7$.MetricReader=void 0;var XDD=kB(),q7$=LS(),JDD=jPA();class FDD{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(H){this._aggregationSelector=H?.aggregationSelector??JDD.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=H?.aggregationTemporalitySelector??JDD.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=H?.metricProducers??[],this._cardinalitySelector=H?.cardinalitySelector}setMetricProducer(H){if(this._sdkMetricProducer)throw Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=H,this.onInitialized()}selectAggregation(H){return this._aggregationSelector(H)}selectAggregationTemporality(H){return this._aggregationTemporalitySelector(H)}selectCardinalityLimit(H){return this._cardinalitySelector?this._cardinalitySelector(H):2000}onInitialized(){}async collect(H){if(this._sdkMetricProducer===void 0)throw Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw Error("MetricReader is shutdown");let[$,...A]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:H?.timeoutMillis}),...this._metricProducers.map((B)=>B.collect({timeoutMillis:H?.timeoutMillis}))]),L=$.errors.concat((0,q7$.FlatMap)(A,(B)=>B.errors)),I=$.resourceMetrics.resource,D=$.resourceMetrics.scopeMetrics.concat((0,q7$.FlatMap)(A,(B)=>B.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:I,scopeMetrics:D},errors:L}}async shutdown(H){if(this._shutdown){XDD.diag.error("Cannot call shutdown twice.");return}if(H?.timeoutMillis==null)await this.onShutdown();else await(0,q7$.callWithTimeout)(this.onShutdown(),H.timeoutMillis);this._shutdown=!0}async forceFlush(H){if(this._shutdown){XDD.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(H?.timeoutMillis==null){await this.onForceFlush();return}await(0,q7$.callWithTimeout)(this.onForceFlush(),H.timeoutMillis)}}T7$.MetricReader=FDD});var WDD=z((N7$)=>{Object.defineProperty(N7$,"__esModule",{value:!0});N7$.PeriodicExportingMetricReader=void 0;var yPA=kB(),z7$=Kf(),Nh9=RPA(),KDD=LS();class QDD extends Nh9.MetricReader{_interval;_exporter;_exportInterval;_exportTimeout;constructor(H){super({aggregationSelector:H.exporter.selectAggregation?.bind(H.exporter),aggregationTemporalitySelector:H.exporter.selectAggregationTemporality?.bind(H.exporter),metricProducers:H.metricProducers});if(H.exportIntervalMillis!==void 0&&H.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(H.exportTimeoutMillis!==void 0&&H.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(H.exportTimeoutMillis!==void 0&&H.exportIntervalMillis!==void 0&&H.exportIntervalMillis0)yPA.diag.error("PeriodicExportingMetricReader: metrics collection errors",...$);if(H.resource.asyncAttributesPending)try{await H.resource.waitForAsyncAttributes?.()}catch(L){yPA.diag.debug("Error while resolving async portion of resource: ",L),(0,z7$.globalErrorHandler)(L)}if(H.scopeMetrics.length===0)return;let A=await z7$.internal._export(this._exporter,H);if(A.code!==z7$.ExportResultCode.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${A.error})`)}onInitialized(){if(this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=="number")this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){if(this._interval)clearInterval(this._interval);await this.onForceFlush(),await this._exporter.shutdown()}}N7$.PeriodicExportingMetricReader=QDD});var _DD=z((O7$)=>{Object.defineProperty(O7$,"__esModule",{value:!0});O7$.InMemoryMetricExporter=void 0;var VDD=Kf();class PDD{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(H){this._aggregationTemporality=H}export(H,$){if(this._shutdown){setTimeout(()=>$({code:VDD.ExportResultCode.FAILED}),0);return}this._metrics.push(H),setTimeout(()=>$({code:VDD.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(H){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}O7$.InMemoryMetricExporter=PDD});var CDD=z((x7$)=>{Object.defineProperty(x7$,"__esModule",{value:!0});x7$.ConsoleMetricExporter=void 0;var YDD=Kf(),Oh9=jPA();class vPA{_shutdown=!1;_temporalitySelector;constructor(H){this._temporalitySelector=H?.temporalitySelector??Oh9.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(H,$){if(this._shutdown){setImmediate($,{code:YDD.ExportResultCode.FAILED});return}return vPA._sendMetrics(H,$)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(H){return this._temporalitySelector(H)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(H,$){for(let A of H.scopeMetrics)for(let L of A.metrics)console.dir({descriptor:L.descriptor,dataPointType:L.dataPointType,dataPoints:L.dataPoints},{depth:null});$({code:YDD.ExportResultCode.SUCCESS})}}x7$.ConsoleMetricExporter=vPA});var ZDD=z((S7$)=>{Object.defineProperty(S7$,"__esModule",{value:!0});S7$.ViewRegistry=void 0;class wDD{_registeredViews=[];addView(H){this._registeredViews.push(H)}findViews(H,$){return this._registeredViews.filter((L)=>{return this._matchInstrument(L.instrumentSelector,H)&&this._matchMeter(L.meterSelector,$)})}_matchInstrument(H,$){return(H.getType()===void 0||$.type===H.getType())&&H.getNameFilter().match($.name)&&H.getUnitFilter().match($.unit)}_matchMeter(H,$){return H.getNameFilter().match($.name)&&($.version===void 0||H.getVersionFilter().match($.version))&&($.schemaUrl===void 0||H.getSchemaUrlFilter().match($.schemaUrl))}}S7$.ViewRegistry=wDD});var bvH=z((Hh)=>{Object.defineProperty(Hh,"__esModule",{value:!0});Hh.isValidName=Hh.isDescriptorCompatibleWith=Hh.createInstrumentDescriptorWithView=Hh.createInstrumentDescriptor=void 0;var qDD=kB(),xh9=LS();function Sh9(H,$,A){if(!TDD(H))qDD.diag.warn(`Invalid metric name: "${H}". The metric name should be a ASCII string with a length no greater than 255 characters.`);return{name:H,type:$,description:A?.description??"",unit:A?.unit??"",valueType:A?.valueType??qDD.ValueType.DOUBLE,advice:A?.advice??{}}}Hh.createInstrumentDescriptor=Sh9;function jh9(H,$){return{name:H.name??$.name,description:H.description??$.description,type:$.type,unit:$.unit,valueType:$.valueType,advice:$.advice}}Hh.createInstrumentDescriptorWithView=jh9;function Rh9(H,$){return(0,xh9.equalsCaseInsensitive)(H.name,$.name)&&H.unit===$.unit&&H.type===$.type&&H.valueType===$.valueType}Hh.isDescriptorCompatibleWith=Rh9;var yh9=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function TDD(H){return H.match(yh9)!=null}Hh.isValidName=TDD});var j7$=z((NX)=>{Object.defineProperty(NX,"__esModule",{value:!0});NX.isObservableInstrument=NX.ObservableUpDownCounterInstrument=NX.ObservableGaugeInstrument=NX.ObservableCounterInstrument=NX.ObservableInstrument=NX.HistogramInstrument=NX.GaugeInstrument=NX.CounterInstrument=NX.UpDownCounterInstrument=NX.SyncInstrument=void 0;var PWH=kB(),vh9=Kf();class _WH{_writableMetricStorage;_descriptor;constructor(H,$){this._writableMetricStorage=H,this._descriptor=$}_record(H,$={},A=PWH.context.active()){if(typeof H!=="number"){PWH.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${H}`);return}if(this._descriptor.valueType===PWH.ValueType.INT&&!Number.isInteger(H)){if(PWH.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),H=Math.trunc(H),!Number.isInteger(H))return}this._writableMetricStorage.record(H,$,A,(0,vh9.millisToHrTime)(Date.now()))}}NX.SyncInstrument=_WH;class zDD extends _WH{add(H,$,A){this._record(H,$,A)}}NX.UpDownCounterInstrument=zDD;class NDD extends _WH{add(H,$,A){if(H<0){PWH.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${H}`);return}this._record(H,$,A)}}NX.CounterInstrument=NDD;class ODD extends _WH{record(H,$,A){this._record(H,$,A)}}NX.GaugeInstrument=ODD;class xDD extends _WH{record(H,$,A){if(H<0){PWH.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${H}`);return}this._record(H,$,A)}}NX.HistogramInstrument=xDD;class YWH{_observableRegistry;_metricStorages;_descriptor;constructor(H,$,A){this._observableRegistry=A,this._descriptor=H,this._metricStorages=$}addCallback(H){this._observableRegistry.addCallback(H,this)}removeCallback(H){this._observableRegistry.removeCallback(H,this)}}NX.ObservableInstrument=YWH;class SDD extends YWH{}NX.ObservableCounterInstrument=SDD;class jDD extends YWH{}NX.ObservableGaugeInstrument=jDD;class RDD extends YWH{}NX.ObservableUpDownCounterInstrument=RDD;function hh9(H){return H instanceof YWH}NX.isObservableInstrument=hh9});var vDD=z((R7$)=>{Object.defineProperty(R7$,"__esModule",{value:!0});R7$.Meter=void 0;var X0H=bvH(),J0H=j7$(),F0H=_o();class yDD{_meterSharedState;constructor(H){this._meterSharedState=H}createGauge(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.GAUGE,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.GaugeInstrument(L,A)}createHistogram(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.HISTOGRAM,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.HistogramInstrument(L,A)}createCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.COUNTER,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.CounterInstrument(L,A)}createUpDownCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.UP_DOWN_COUNTER,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.UpDownCounterInstrument(L,A)}createObservableGauge(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.OBSERVABLE_GAUGE,$),L=this._meterSharedState.registerAsyncMetricStorage(A);return new J0H.ObservableGaugeInstrument(A,L,this._meterSharedState.observableRegistry)}createObservableCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.OBSERVABLE_COUNTER,$),L=this._meterSharedState.registerAsyncMetricStorage(A);return new J0H.ObservableCounterInstrument(A,L,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,$),L=this._meterSharedState.registerAsyncMetricStorage(A);return new J0H.ObservableUpDownCounterInstrument(A,L,this._meterSharedState.observableRegistry)}addBatchObservableCallback(H,$){this._meterSharedState.observableRegistry.addBatchCallback(H,$)}removeBatchObservableCallback(H,$){this._meterSharedState.observableRegistry.removeBatchCallback(H,$)}}R7$.Meter=yDD});var hPA=z((y7$)=>{Object.defineProperty(y7$,"__esModule",{value:!0});y7$.MetricStorage=void 0;var bh9=bvH();class hDD{_instrumentDescriptor;constructor(H){this._instrumentDescriptor=H}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(H){this._instrumentDescriptor=(0,bh9.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:H,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}y7$.MetricStorage=hDD});var kvH=z((CWH)=>{Object.defineProperty(CWH,"__esModule",{value:!0});CWH.AttributeHashMap=CWH.HashMap=void 0;var kh9=LS();class bPA{_hash;_valueMap=new Map;_keyMap=new Map;constructor(H){this._hash=H}get(H,$){return $??=this._hash(H),this._valueMap.get($)}getOrDefault(H,$){let A=this._hash(H);if(this._valueMap.has(A))return this._valueMap.get(A);let L=$();if(!this._keyMap.has(A))this._keyMap.set(A,H);return this._valueMap.set(A,L),L}set(H,$,A){if(A??=this._hash(H),!this._keyMap.has(A))this._keyMap.set(A,H);this._valueMap.set(A,$)}has(H,$){return $??=this._hash(H),this._valueMap.has($)}*keys(){let H=this._keyMap.entries(),$=H.next();while($.done!==!0)yield[$.value[1],$.value[0]],$=H.next()}*entries(){let H=this._valueMap.entries(),$=H.next();while($.done!==!0)yield[this._keyMap.get($.value[0]),$.value[1],$.value[0]],$=H.next()}get size(){return this._valueMap.size}}CWH.HashMap=bPA;class bDD extends bPA{constructor(){super(kh9.hashAttributes)}}CWH.AttributeHashMap=bDD});var uPA=z((v7$)=>{Object.defineProperty(v7$,"__esModule",{value:!0});v7$.DeltaMetricProcessor=void 0;var uh9=LS(),kPA=kvH();class kDD{_aggregator;_activeCollectionStorage=new kPA.AttributeHashMap;_cumulativeMemoStorage=new kPA.AttributeHashMap;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;constructor(H,$){this._aggregator=H,this._cardinalityLimit=($??2000)-1,this._overflowHashCode=(0,uh9.hashAttributes)(this._overflowAttributes)}record(H,$,A,L){let I=this._activeCollectionStorage.get($);if(!I){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(L))?.record(H);return}I=this._aggregator.createAccumulation(L),this._activeCollectionStorage.set($,I)}I?.record(H)}batchCumulate(H,$){Array.from(H.entries()).forEach(([A,L,I])=>{let D=this._aggregator.createAccumulation($);D?.record(L);let B=D;if(this._cumulativeMemoStorage.has(A,I)){let f=this._cumulativeMemoStorage.get(A,I);B=this._aggregator.diff(f,D)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit){if(A=this._overflowAttributes,I=this._overflowHashCode,this._cumulativeMemoStorage.has(A,I)){let f=this._cumulativeMemoStorage.get(A,I);B=this._aggregator.diff(f,D)}}if(this._activeCollectionStorage.has(A,I)){let f=this._activeCollectionStorage.get(A,I);B=this._aggregator.merge(f,B)}this._cumulativeMemoStorage.set(A,D,I),this._activeCollectionStorage.set(A,B,I)})}collect(){let H=this._activeCollectionStorage;return this._activeCollectionStorage=new kPA.AttributeHashMap,H}}v7$.DeltaMetricProcessor=kDD});var gPA=z((h7$)=>{Object.defineProperty(h7$,"__esModule",{value:!0});h7$.TemporalMetricProcessor=void 0;var gh9=U7$(),mh9=kvH();class uvH{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(H,$){this._aggregator=H,$.forEach((A)=>{this._unreportedAccumulations.set(A,[])})}buildMetrics(H,$,A,L){this._stashAccumulations(A);let I=this._getMergedUnreportedAccumulations(H),D=I,B;if(this._reportHistory.has(H)){let E=this._reportHistory.get(H),M=E.collectionTime;if(B=E.aggregationTemporality,B===gh9.AggregationTemporality.CUMULATIVE)D=uvH.merge(E.accumulations,I,this._aggregator);else D=uvH.calibrateStartTime(E.accumulations,I,M)}else B=H.selectAggregationTemporality($.type);this._reportHistory.set(H,{accumulations:D,collectionTime:L,aggregationTemporality:B});let f=ph9(D);if(f.length===0)return;return this._aggregator.toMetricData($,B,f,L)}_stashAccumulations(H){let $=this._unreportedAccumulations.keys();for(let A of $){let L=this._unreportedAccumulations.get(A);if(L===void 0)L=[],this._unreportedAccumulations.set(A,L);L.push(H)}}_getMergedUnreportedAccumulations(H){let $=new mh9.AttributeHashMap,A=this._unreportedAccumulations.get(H);if(this._unreportedAccumulations.set(H,[]),A===void 0)return $;for(let L of A)$=uvH.merge($,L,this._aggregator);return $}static merge(H,$,A){let L=H,I=$.entries(),D=I.next();while(D.done!==!0){let[B,f,E]=D.value;if(H.has(B,E)){let M=H.get(B,E),G=A.merge(M,f);L.set(B,G,E)}else L.set(B,f,E);D=I.next()}return L}static calibrateStartTime(H,$,A){for(let[L,I]of H.keys())$.get(L,I)?.setStartTime(A);return $}}h7$.TemporalMetricProcessor=uvH;function ph9(H){return Array.from(H.entries())}});var gDD=z((b7$)=>{Object.defineProperty(b7$,"__esModule",{value:!0});b7$.AsyncMetricStorage=void 0;var dh9=hPA(),ch9=uPA(),lh9=gPA(),ih9=kvH();class uDD extends dh9.MetricStorage{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(H,$,A,L,I){super(H);this._attributesProcessor=A,this._aggregationCardinalityLimit=I,this._deltaMetricStorage=new ch9.DeltaMetricProcessor($,this._aggregationCardinalityLimit),this._temporalMetricStorage=new lh9.TemporalMetricProcessor($,L)}record(H,$){let A=new ih9.AttributeHashMap;Array.from(H.entries()).forEach(([L,I])=>{A.set(this._attributesProcessor.process(L),I)}),this._deltaMetricStorage.batchCumulate(A,$)}collect(H,$){let A=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(H,this._instrumentDescriptor,A,$)}}b7$.AsyncMetricStorage=uDD});var lDD=z((kY)=>{Object.defineProperty(kY,"__esModule",{value:!0});kY.getConflictResolutionRecipe=kY.getDescriptionResolutionRecipe=kY.getTypeConflictResolutionRecipe=kY.getUnitConflictResolutionRecipe=kY.getValueTypeConflictResolutionRecipe=kY.getIncompatibilityDetails=void 0;function nh9(H,$){let A="";if(H.unit!==$.unit)A+=` - Unit '${H.unit}' does not match '${$.unit}' `)++I;if(++A===L)throw M("comment");q=O,O=U(A)}while(q!=="*"||O!=="/");if(++A,u)X(j,A-2,y),y=!0;Z=!0}else return"/"}}while(Z);var g=A;OYA.lastIndex=0;var h=OYA.test(U(g++));if(!h)while(g{_fD.exports=Lp;Lp.filename=null;Lp.defaults={keepCase:!1};var Wc9=xYA(),QfD=v3$(),WfD=S3$(),VfD=xo(),Vc9=q3$(),PfD=Z0H(),Pc9=XS(),_c9=z3$(),Yc9=T3$(),Cc9=So(),wc9=q0H(),SYA=aQ(),Zc9=/^[1-9][0-9]*$/,qc9=/^-?[1-9][0-9]*$/,Tc9=/^0[x][0-9a-fA-F]+$/,zc9=/^-?0[x][0-9a-fA-F]+$/,Nc9=/^0[0-7]+$/,Oc9=/^-?0[0-7]+$/,xc9=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Kh=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Qh=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function Lp(H,$,A){if(!($ instanceof QfD))A=$,$=new QfD;if(!A)A=Lp.defaults;var L=A.preferTrailingComment||!1,I=Wc9(H,A.alternateCommentMode||!1),D=I.next,B=I.push,f=I.peek,E=I.skip,M=I.cmnt,G=!0,U,X,J,F="proto2",Q=$,W=[],P={},C=A.keepCase?function(EH){return EH}:SYA.camelCase;function Y(){W.forEach((EH)=>{EH._edition=F,Object.keys(P).forEach(($H)=>{if(EH.getOption($H)!==void 0)return;EH.setOption($H,P[$H],!0)})})}function Z(EH,$H,FH){var YH=Lp.filename;if(!FH)Lp.filename=null;return Error("illegal "+($H||"token")+" '"+EH+"' ("+(YH?YH+", ":"")+"line "+I.line+")")}function q(){var EH=[],$H;do{if(($H=D())!=='"'&&$H!=="'")throw Z($H);EH.push(D()),E($H),$H=f()}while($H==='"'||$H==="'");return EH.join("")}function O(EH){var $H=D();switch($H){case"'":case'"':return B($H),q();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return u($H,!0)}catch(FH){if(EH&&Qh.test($H))return $H;throw Z($H,"value")}}function j(EH,$H){var FH,YH;do if($H&&((FH=f())==='"'||FH==="'")){var qH=q();if(EH.push(qH),F>=2023)throw Z(qH,"id")}else try{EH.push([YH=y(D()),E("to",!0)?y(D()):YH])}catch(hH){if($H&&Qh.test(FH)&&F>=2023)EH.push(FH);else throw hH}while(E(",",!0));var bH={options:void 0};bH.setOption=function(hH,PH){if(this.options===void 0)this.options={};this.options[hH]=PH},n(bH,function(PH){if(PH==="option")t(bH,PH),E(";");else throw Z(PH)},function(){CH(bH)})}function u(EH,$H){var FH=1;if(EH.charAt(0)==="-")FH=-1,EH=EH.substring(1);switch(EH){case"inf":case"INF":case"Inf":return FH*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(Zc9.test(EH))return FH*parseInt(EH,10);if(Tc9.test(EH))return FH*parseInt(EH,16);if(Nc9.test(EH))return FH*parseInt(EH,8);if(xc9.test(EH))return FH*parseFloat(EH);throw Z(EH,"number",$H)}function y(EH,$H){switch(EH){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!$H&&EH.charAt(0)==="-")throw Z(EH,"id");if(qc9.test(EH))return parseInt(EH,10);if(zc9.test(EH))return parseInt(EH,16);if(Oc9.test(EH))return parseInt(EH,8);throw Z(EH,"id")}function g(){if(U!==void 0)throw Z("package");if(U=D(),!Qh.test(U))throw Z(U,"name");Q=Q.define(U),E(";")}function h(){var EH=f(),$H;switch(EH){case"weak":$H=J||(J=[]),D();break;case"public":D();default:$H=X||(X=[]);break}EH=q(),E(";"),$H.push(EH)}function p(){if(E("="),F=q(),F<2023)throw Z(F,"syntax");E(";")}function d(){if(E("="),F=q(),!["2023"].includes(F))throw Z(F,"edition");E(";")}function k(EH,$H){switch($H){case"option":return t(EH,$H),E(";"),!0;case"message":return GH(EH,$H),!0;case"enum":return QH(EH,$H),!0;case"service":return OH(EH,$H),!0;case"extend":return e(EH,$H),!0}return!1}function n(EH,$H,FH){var YH=I.line;if(EH){if(typeof EH.comment!=="string")EH.comment=M();EH.filename=Lp.filename}if(E("{",!0)){var qH;while((qH=D())!=="}")$H(qH);E(";",!0)}else{if(FH)FH();if(E(";"),EH&&(typeof EH.comment!=="string"||L))EH.comment=M(YH)||EH.comment}}function GH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"type name");var FH=new WfD($H);if(n(FH,function(qH){if(k(FH,qH))return;switch(qH){case"map":WH(FH,qH);break;case"required":if(F!=="proto2")throw Z(qH);case"repeated":HH(FH,qH);break;case"optional":if(F==="proto3")HH(FH,"proto3_optional");else if(F!=="proto2")throw Z(qH);else HH(FH,"optional");break;case"oneof":wH(FH,qH);break;case"extensions":j(FH.extensions||(FH.extensions=[]));break;case"reserved":j(FH.reserved||(FH.reserved=[]),!0);break;default:if(F==="proto2"||!Qh.test(qH))throw Z(qH);B(qH),HH(FH,"optional");break}}),EH.add(FH),EH===Q)W.push(FH)}function HH(EH,$H,FH){var YH=D();if(YH==="group"){BH(EH,$H);return}while(YH.endsWith(".")||f().startsWith("."))YH+=D();if(!Qh.test(YH))throw Z(YH,"type");var qH=D();if(!Kh.test(qH))throw Z(qH,"name");qH=C(qH),E("=");var bH=new VfD(qH,y(D()),YH,$H,FH);if(n(bH,function(gH){if(gH==="option")t(bH,gH),E(";");else throw Z(gH)},function(){CH(bH)}),$H==="proto3_optional"){var hH=new PfD("_"+qH);bH.setOption("proto3_optional",!0),hH.add(bH),EH.add(hH)}else EH.add(bH);if(EH===Q)W.push(bH)}function BH(EH,$H){if(F>=2023)throw Z("group");var FH=D();if(!Kh.test(FH))throw Z(FH,"name");var YH=SYA.lcFirst(FH);if(FH===YH)FH=SYA.ucFirst(FH);E("=");var qH=y(D()),bH=new WfD(FH);bH.group=!0;var hH=new VfD(YH,qH,FH,$H);hH.filename=Lp.filename,n(bH,function(gH){switch(gH){case"option":t(bH,gH),E(";");break;case"required":case"repeated":HH(bH,gH);break;case"optional":if(F==="proto3")HH(bH,"proto3_optional");else HH(bH,"optional");break;case"message":GH(bH,gH);break;case"enum":QH(bH,gH);break;case"reserved":j(bH.reserved||(bH.reserved=[]),!0);break;default:throw Z(gH)}}),EH.add(bH).add(hH)}function WH(EH){E("<");var $H=D();if(wc9.mapKey[$H]===void 0)throw Z($H,"type");E(",");var FH=D();if(!Qh.test(FH))throw Z(FH,"type");E(">");var YH=D();if(!Kh.test(YH))throw Z(YH,"name");E("=");var qH=new Vc9(C(YH),y(D()),$H,FH);n(qH,function(hH){if(hH==="option")t(qH,hH),E(";");else throw Z(hH)},function(){CH(qH)}),EH.add(qH)}function wH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"name");var FH=new PfD(C($H));n(FH,function(qH){if(qH==="option")t(FH,qH),E(";");else B(qH),HH(FH,"optional")}),EH.add(FH)}function QH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"name");var FH=new Pc9($H);if(n(FH,function(qH){switch(qH){case"option":t(FH,qH),E(";");break;case"reserved":if(j(FH.reserved||(FH.reserved=[]),!0),FH.reserved===void 0)FH.reserved=[];break;default:TH(FH,qH)}}),EH.add(FH),EH===Q)W.push(FH)}function TH(EH,$H){if(!Kh.test($H))throw Z($H,"name");E("=");var FH=y(D(),!0),YH={options:void 0};YH.getOption=function(qH){return this.options[qH]},YH.setOption=function(qH,bH){Cc9.prototype.setOption.call(YH,qH,bH)},YH.setParsedOption=function(){return},n(YH,function(bH){if(bH==="option")t(YH,bH),E(";");else throw Z(bH)},function(){CH(YH)}),EH.add($H,FH,YH.comment,YH.parsedOptions||YH.options)}function t(EH,$H){var FH,YH,qH=!0;if($H==="option")$H=D();while($H!=="="){if($H==="("){var bH=D();E(")"),$H="("+bH+")"}if(qH){if(qH=!1,$H.includes(".")&&!$H.includes("(")){var hH=$H.split(".");FH=hH[0]+".",$H=hH[1];continue}FH=$H}else YH=YH?YH+=$H:$H;$H=D()}var PH=YH?FH.concat(YH):FH,gH=IH(EH,PH);YH=YH&&YH[0]==="."?YH.slice(1):YH,FH=FH&&FH[FH.length-1]==="."?FH.slice(0,-1):FH,MH(EH,FH,gH,YH)}function IH(EH,$H){if(E("{",!0)){var FH={};while(!E("}",!0)){if(!Kh.test(DH=D()))throw Z(DH,"name");if(DH===null)throw Z(DH,"end of input");var YH,qH=DH;if(E(":",!0),f()==="{")YH=IH(EH,$H+"."+DH);else if(f()==="["){YH=[];var bH;if(E("[",!0)){do bH=O(!0),YH.push(bH);while(E(",",!0));if(E("]"),typeof bH<"u")KH(EH,$H+"."+DH,bH)}}else YH=O(!0),KH(EH,$H+"."+DH,YH);var hH=FH[qH];if(hH)YH=[].concat(hH).concat(YH);FH[qH]=YH,E(",",!0),E(";",!0)}return FH}var PH=O(!0);return KH(EH,$H,PH),PH}function KH(EH,$H,FH){if(Q===EH&&/^features\./.test($H)){P[$H]=FH;return}if(EH.setOption)EH.setOption($H,FH)}function MH(EH,$H,FH,YH){if(EH.setParsedOption)EH.setParsedOption($H,FH,YH)}function CH(EH){if(E("[",!0)){do t(EH,"option");while(E(",",!0));E("]")}return EH}function OH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"service name");var FH=new _c9($H);if(n(FH,function(qH){if(k(FH,qH))return;if(qH==="rpc")LH(FH,qH);else throw Z(qH)}),EH.add(FH),EH===Q)W.push(FH)}function LH(EH,$H){var FH=M(),YH=$H;if(!Kh.test($H=D()))throw Z($H,"name");var qH=$H,bH,hH,PH,gH;if(E("("),E("stream",!0))hH=!0;if(!Qh.test($H=D()))throw Z($H);if(bH=$H,E(")"),E("returns"),E("("),E("stream",!0))gH=!0;if(!Qh.test($H=D()))throw Z($H);PH=$H,E(")");var vH=new Yc9(qH,YH,bH,PH,hH,gH);vH.comment=FH,n(vH,function(K$){if(K$==="option")t(vH,K$),E(";");else throw Z(K$)}),EH.add(vH)}function e(EH,$H){if(!Qh.test($H=D()))throw Z($H,"reference");var FH=$H;n(null,function(qH){switch(qH){case"required":case"repeated":HH(EH,qH,FH);break;case"optional":if(F==="proto3")HH(EH,"proto3_optional",FH);else HH(EH,"optional",FH);break;default:if(F==="proto2"||!Qh.test(qH))throw Z(qH);B(qH),HH(EH,"optional",FH);break}})}var DH;while((DH=D())!==null)switch(DH){case"package":if(!G)throw Z(DH);g();break;case"import":if(!G)throw Z(DH);h();break;case"syntax":if(!G)throw Z(DH);p();break;case"edition":if(!G)throw Z(DH);d();break;case"option":t(Q,DH),E(";",!0);break;default:if(k(Q,DH)){G=!1;continue}throw Z(DH)}return Y(),Lp.filename=null,{package:U,imports:X,weakImports:J,root:$}}});var ZfD=z((vZE,wfD)=>{wfD.exports=FS;var Sc9=/\/|\./;function FS(H,$){if(!Sc9.test(H))H="google/protobuf/"+H+".proto",$={nested:{google:{nested:{protobuf:{nested:$}}}}};FS[H]=$}FS("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var CfD;FS("duration",{Duration:CfD={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});FS("timestamp",{Timestamp:CfD});FS("empty",{Empty:{fields:{}}});FS("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});FS("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});FS("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});FS.get=function($){return FS[$]||null}});var TfD=z((hZE,qfD)=>{var Ro=qfD.exports=XfD();Ro.build="full";Ro.tokenize=xYA();Ro.parse=YfD();Ro.common=ZfD();Ro.Root._configure(Ro.Type,Ro.parse,Ro.common)});var g3$=z((bZE,zfD)=>{zfD.exports=TfD()});var jYA=z((kZE,jc9)=>{jc9.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536000000,536000000]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1000,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1000,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1000,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536000000,536000000]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var yfD=z((c1,RfD)=>{var Ww=g3$();RfD.exports=c1=Ww.descriptor=Ww.Root.fromJSON(jYA()).lookup(".google.protobuf");var{Namespace:NfD,Root:YhH,Enum:Ip,Type:Wh,Field:yo,MapField:Rc9,OneOf:m3$,Service:ChH,Method:p3$}=Ww;YhH.fromDescriptor=function($){if(typeof $.length==="number")$=c1.FileDescriptorSet.decode($);var A=new YhH;if($.file){var L,I;for(var D=0,B;D<$.file.length;++D){if(I=A,(L=$.file[D]).package&&L.package.length)I=A.define(L.package);var f=dc9(L);if(L.name&&L.name.length)A.files.push(I.filename=L.name);if(L.messageType)for(B=0;B{lc9.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var hfD=z((gZE,ic9)=>{ic9.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var bfD=z((mZE,nc9)=>{nc9.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var mfD=z((vo)=>{Object.defineProperty(vo,"__esModule",{value:!0});vo.addCommonProtos=vo.loadProtosWithOptionsSync=vo.loadProtosWithOptions=void 0;var kfD=require("fs"),ufD=require("path"),oWH=g3$();function gfD(H,$){let A=H.resolvePath;H.resolvePath=(L,I)=>{if(ufD.isAbsolute(I))return I;for(let D of $){let B=ufD.join(D,I);try{return kfD.accessSync(B,kfD.constants.R_OK),B}catch(f){continue}}return process.emitWarning(`${I} not found in any of the include paths ${$}`),A(L,I)}}async function rc9(H,$){let A=new oWH.Root;if($=$||{},$.includeDirs){if(!Array.isArray($.includeDirs))return Promise.reject(Error("The includeDirs option must be an array"));gfD(A,$.includeDirs)}let L=await A.load(H,$);return L.resolveAll(),L}vo.loadProtosWithOptions=rc9;function ac9(H,$){let A=new oWH.Root;if($=$||{},$.includeDirs){if(!Array.isArray($.includeDirs))throw Error("The includeDirs option must be an array");gfD(A,$.includeDirs)}let L=A.loadSync(H,$);return L.resolveAll(),L}vo.loadProtosWithOptionsSync=ac9;function oc9(){let H=vfD(),$=jYA(),A=hfD(),L=bfD();oWH.common("api",H.nested.google.nested.protobuf.nested),oWH.common("descriptor",$.nested.google.nested.protobuf.nested),oWH.common("source_context",A.nested.google.nested.protobuf.nested),oWH.common("type",L.nested.google.nested.protobuf.nested)}vo.addCommonProtos=oc9});var pfD=z((whH,yYA)=>{(function(H,$){function A(L){return"default"in L?L.default:L}if(typeof define==="function"&&define.amd)define([],function(){var L={};return $(L),A(L)});else if(typeof whH==="object"){if($(whH),typeof yYA==="object")yYA.exports=A(whH)}else(function(){var L={};$(L),H.Long=A(L)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:whH,function(H){Object.defineProperty(H,"__esModule",{value:!0}),H.default=void 0;var $=null;try{$=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function A(d,k,n){this.low=d|0,this.high=k|0,this.unsigned=!!n}A.prototype.__isLong__,Object.defineProperty(A.prototype,"__isLong__",{value:!0});function L(d){return(d&&d.__isLong__)===!0}function I(d){var k=Math.clz32(d&-d);return d?31-k:k}A.isLong=L;var D={},B={};function f(d,k){var n,GH,HH;if(k){if(d>>>=0,HH=0<=d&&d<256){if(GH=B[d],GH)return GH}if(n=M(d,0,!0),HH)B[d]=n;return n}else{if(d|=0,HH=-128<=d&&d<128){if(GH=D[d],GH)return GH}if(n=M(d,d<0?-1:0,!1),HH)D[d]=n;return n}}A.fromInt=f;function E(d,k){if(isNaN(d))return k?Z:Y;if(k){if(d<0)return Z;if(d>=W)return y}else{if(d<=-P)return g;if(d+1>=P)return u}if(d<0)return E(-d,k).neg();return M(d%Q|0,d/Q|0,k)}A.fromNumber=E;function M(d,k,n){return new A(d,k,n)}A.fromBits=M;var G=Math.pow;function U(d,k,n){if(d.length===0)throw Error("empty string");if(typeof k==="number")n=k,k=!1;else k=!!k;if(d==="NaN"||d==="Infinity"||d==="+Infinity"||d==="-Infinity")return k?Z:Y;if(n=n||10,n<2||360)throw Error("interior hyphen");else if(GH===0)return U(d.substring(1),k,n).neg();var HH=E(G(n,8)),BH=Y;for(var WH=0;WH>>0:this.low},h.toNumber=function(){if(this.unsigned)return(this.high>>>0)*Q+(this.low>>>0);return this.high*Q+(this.low>>>0)},h.toString=function(k){if(k=k||10,k<2||36>>0,t=TH.toString(k);if(WH=QH,WH.isZero())return t+wH;else{while(t.length<6)t="0"+t;wH=""+t+wH}}},h.getHighBits=function(){return this.high},h.getHighBitsUnsigned=function(){return this.high>>>0},h.getLowBits=function(){return this.low},h.getLowBitsUnsigned=function(){return this.low>>>0},h.getNumBitsAbs=function(){if(this.isNegative())return this.eq(g)?64:this.neg().getNumBitsAbs();var k=this.high!=0?this.high:this.low;for(var n=31;n>0;n--)if((k&1<>21;if(!k)return!0;if(this.unsigned)return!1;return k===-1&&!(this.low===0&&this.high===-2097152)},h.isZero=function(){return this.high===0&&this.low===0},h.eqz=h.isZero,h.isNegative=function(){return!this.unsigned&&this.high<0},h.isPositive=function(){return this.unsigned||this.high>=0},h.isOdd=function(){return(this.low&1)===1},h.isEven=function(){return(this.low&1)===0},h.equals=function(k){if(!L(k))k=X(k);if(this.unsigned!==k.unsigned&&this.high>>>31===1&&k.high>>>31===1)return!1;return this.high===k.high&&this.low===k.low},h.eq=h.equals,h.notEquals=function(k){return!this.eq(k)},h.neq=h.notEquals,h.ne=h.notEquals,h.lessThan=function(k){return this.comp(k)<0},h.lt=h.lessThan,h.lessThanOrEqual=function(k){return this.comp(k)<=0},h.lte=h.lessThanOrEqual,h.le=h.lessThanOrEqual,h.greaterThan=function(k){return this.comp(k)>0},h.gt=h.greaterThan,h.greaterThanOrEqual=function(k){return this.comp(k)>=0},h.gte=h.greaterThanOrEqual,h.ge=h.greaterThanOrEqual,h.compare=function(k){if(!L(k))k=X(k);if(this.eq(k))return 0;var n=this.isNegative(),GH=k.isNegative();if(n&&!GH)return-1;if(!n&&GH)return 1;if(!this.unsigned)return this.sub(k).isNegative()?-1:1;return k.high>>>0>this.high>>>0||k.high===this.high&&k.low>>>0>this.low>>>0?-1:1},h.comp=h.compare,h.negate=function(){if(!this.unsigned&&this.eq(g))return g;return this.not().add(q)},h.neg=h.negate,h.add=function(k){if(!L(k))k=X(k);var n=this.high>>>16,GH=this.high&65535,HH=this.low>>>16,BH=this.low&65535,WH=k.high>>>16,wH=k.high&65535,QH=k.low>>>16,TH=k.low&65535,t=0,IH=0,KH=0,MH=0;return MH+=BH+TH,KH+=MH>>>16,MH&=65535,KH+=HH+QH,IH+=KH>>>16,KH&=65535,IH+=GH+wH,t+=IH>>>16,IH&=65535,t+=n+WH,t&=65535,M(KH<<16|MH,t<<16|IH,this.unsigned)},h.subtract=function(k){if(!L(k))k=X(k);return this.add(k.neg())},h.sub=h.subtract,h.multiply=function(k){if(this.isZero())return this;if(!L(k))k=X(k);if($){var n=$.mul(this.low,this.high,k.low,k.high);return M(n,$.get_high(),this.unsigned)}if(k.isZero())return this.unsigned?Z:Y;if(this.eq(g))return k.isOdd()?g:Y;if(k.eq(g))return this.isOdd()?g:Y;if(this.isNegative())if(k.isNegative())return this.neg().mul(k.neg());else return this.neg().mul(k).neg();else if(k.isNegative())return this.mul(k.neg()).neg();if(this.lt(C)&&k.lt(C))return E(this.toNumber()*k.toNumber(),this.unsigned);var GH=this.high>>>16,HH=this.high&65535,BH=this.low>>>16,WH=this.low&65535,wH=k.high>>>16,QH=k.high&65535,TH=k.low>>>16,t=k.low&65535,IH=0,KH=0,MH=0,CH=0;return CH+=WH*t,MH+=CH>>>16,CH&=65535,MH+=BH*t,KH+=MH>>>16,MH&=65535,MH+=WH*TH,KH+=MH>>>16,MH&=65535,KH+=HH*t,IH+=KH>>>16,KH&=65535,KH+=BH*TH,IH+=KH>>>16,KH&=65535,KH+=WH*QH,IH+=KH>>>16,KH&=65535,IH+=GH*t+HH*TH+BH*QH+WH*wH,IH&=65535,M(MH<<16|CH,IH<<16|KH,this.unsigned)},h.mul=h.multiply,h.divide=function(k){if(!L(k))k=X(k);if(k.isZero())throw Error("division by zero");if($){if(!this.unsigned&&this.high===-2147483648&&k.low===-1&&k.high===-1)return this;var n=(this.unsigned?$.div_u:$.div_s)(this.low,this.high,k.low,k.high);return M(n,$.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Z:Y;var GH,HH,BH;if(!this.unsigned){if(this.eq(g))if(k.eq(q)||k.eq(j))return g;else if(k.eq(g))return q;else{var WH=this.shr(1);if(GH=WH.div(k).shl(1),GH.eq(Y))return k.isNegative()?q:j;else return HH=this.sub(k.mul(GH)),BH=GH.add(HH.div(k)),BH}else if(k.eq(g))return this.unsigned?Z:Y;if(this.isNegative()){if(k.isNegative())return this.neg().div(k.neg());return this.neg().div(k).neg()}else if(k.isNegative())return this.div(k.neg()).neg();BH=Y}else{if(!k.unsigned)k=k.toUnsigned();if(k.gt(this))return Z;if(k.gt(this.shru(1)))return O;BH=Z}HH=this;while(HH.gte(k)){GH=Math.max(1,Math.floor(HH.toNumber()/k.toNumber()));var wH=Math.ceil(Math.log(GH)/Math.LN2),QH=wH<=48?1:G(2,wH-48),TH=E(GH),t=TH.mul(k);while(t.isNegative()||t.gt(HH))GH-=QH,TH=E(GH,this.unsigned),t=TH.mul(k);if(TH.isZero())TH=q;BH=BH.add(TH),HH=HH.sub(t)}return BH},h.div=h.divide,h.modulo=function(k){if(!L(k))k=X(k);if($){var n=(this.unsigned?$.rem_u:$.rem_s)(this.low,this.high,k.low,k.high);return M(n,$.get_high(),this.unsigned)}return this.sub(this.div(k).mul(k))},h.mod=h.modulo,h.rem=h.modulo,h.not=function(){return M(~this.low,~this.high,this.unsigned)},h.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},h.clz=h.countLeadingZeros,h.countTrailingZeros=function(){return this.low?I(this.low):I(this.high)+32},h.ctz=h.countTrailingZeros,h.and=function(k){if(!L(k))k=X(k);return M(this.low&k.low,this.high&k.high,this.unsigned)},h.or=function(k){if(!L(k))k=X(k);return M(this.low|k.low,this.high|k.high,this.unsigned)},h.xor=function(k){if(!L(k))k=X(k);return M(this.low^k.low,this.high^k.high,this.unsigned)},h.shiftLeft=function(k){if(L(k))k=k.toInt();if((k&=63)===0)return this;else if(k<32)return M(this.low<>>32-k,this.unsigned);else return M(0,this.low<>>k|this.high<<32-k,this.high>>k,this.unsigned);else return M(this.high>>k-32,this.high>=0?0:-1,this.unsigned)},h.shr=h.shiftRight,h.shiftRightUnsigned=function(k){if(L(k))k=k.toInt();if((k&=63)===0)return this;if(k<32)return M(this.low>>>k|this.high<<32-k,this.high>>>k,this.unsigned);if(k===32)return M(this.high,0,this.unsigned);return M(this.high>>>k-32,0,this.unsigned)},h.shru=h.shiftRightUnsigned,h.shr_u=h.shiftRightUnsigned,h.rotateLeft=function(k){var n;if(L(k))k=k.toInt();if((k&=63)===0)return this;if(k===32)return M(this.high,this.low,this.unsigned);if(k<32)return n=32-k,M(this.low<>>n,this.high<>>n,this.unsigned);return k-=32,n=32-k,M(this.high<>>n,this.low<>>n,this.unsigned)},h.rotl=h.rotateLeft,h.rotateRight=function(k){var n;if(L(k))k=k.toInt();if((k&=63)===0)return this;if(k===32)return M(this.high,this.low,this.unsigned);if(k<32)return n=32-k,M(this.high<>>k,this.low<>>k,this.unsigned);return k-=32,n=32-k,M(this.low<>>k,this.high<>>k,this.unsigned)},h.rotr=h.rotateRight,h.toSigned=function(){if(!this.unsigned)return this;return M(this.low,this.high,!1)},h.toUnsigned=function(){if(this.unsigned)return this;return M(this.low,this.high,!0)},h.toBytes=function(k){return k?this.toBytesLE():this.toBytesBE()},h.toBytesLE=function(){var k=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,k&255,k>>>8&255,k>>>16&255,k>>>24]},h.toBytesBE=function(){var k=this.high,n=this.low;return[k>>>24,k>>>16&255,k>>>8&255,k&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},A.fromBytes=function(k,n,GH){return GH?A.fromBytesLE(k,n):A.fromBytesBE(k,n)},A.fromBytesLE=function(k,n){return new A(k[0]|k[1]<<8|k[2]<<16|k[3]<<24,k[4]|k[5]<<8|k[6]<<16|k[7]<<24,n)},A.fromBytesBE=function(k,n){return new A(k[4]<<24|k[5]<<16|k[6]<<8|k[7],k[0]<<24|k[1]<<16|k[2]<<8|k[3],n)},typeof BigInt==="function")A.fromBigInt=function(k,n){var GH=Number(BigInt.asIntN(32,k)),HH=Number(BigInt.asIntN(32,k>>BigInt(32)));return M(GH,HH,n)},A.fromValue=function(k,n){if(typeof k==="bigint")return fromBigInt(k,n);return X(k,n)},h.toBigInt=function(){var k=BigInt(this.low>>>0),n=BigInt(this.unsigned?this.high>>>0:this.high);return n<{Object.defineProperty(NK,"__esModule",{value:!0});NK.loadFileDescriptorSetFromObject=NK.loadFileDescriptorSetFromBuffer=NK.fromJSON=NK.loadSync=NK.load=NK.IdempotencyLevel=NK.isAnyExtension=NK.Long=void 0;var tc9=q8D(),Vh=g3$(),kYA=yfD(),uYA=mfD(),sc9=pfD();NK.Long=sc9;function ec9(H){return"@type"in H&&typeof H["@type"]==="string"}NK.isAnyExtension=ec9;var dfD;(function(H){H.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",H.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",H.IDEMPOTENT="IDEMPOTENT"})(dfD=NK.IdempotencyLevel||(NK.IdempotencyLevel={}));var cfD={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Hl9(H,$){if(H==="")return $;else return H+"."+$}function $l9(H){return H instanceof Vh.Service||H instanceof Vh.Type||H instanceof Vh.Enum}function Al9(H){return H instanceof Vh.Namespace||H instanceof Vh.Root}function lfD(H,$){let A=Hl9($,H.name);if($l9(H))return[[A,H]];else if(Al9(H)&&typeof H.nested<"u")return Object.keys(H.nested).map((L)=>{return lfD(H.nested[L],A)}).reduce((L,I)=>L.concat(I),[]);return[]}function vYA(H,$){return function(L){return H.toObject(H.decode(L),$)}}function hYA(H){return function(A){if(Array.isArray(A))throw Error(`Failed to serialize message: expected object with ${H.name} structure, got array instead`);let L=H.fromObject(A);return H.encode(L).finish()}}function Ll9(H){return(H||[]).reduce(($,A)=>{for(let[L,I]of Object.entries(A))switch(L){case"uninterpreted_option":$.uninterpreted_option.push(A.uninterpreted_option);break;default:$[L]=I}return $},{deprecated:!1,idempotency_level:dfD.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Il9(H,$,A,L){let{resolvedRequestType:I,resolvedResponseType:D}=H;return{path:"/"+$+"/"+H.name,requestStream:!!H.requestStream,responseStream:!!H.responseStream,requestSerialize:hYA(I),requestDeserialize:vYA(I,A),responseSerialize:hYA(D),responseDeserialize:vYA(D,A),originalName:tc9(H.name),requestType:bYA(I,A,L),responseType:bYA(D,A,L),options:Ll9(H.parsedOptions)}}function Dl9(H,$,A,L){let I={};for(let D of H.methodsArray)I[D.name]=Il9(D,$,A,L);return I}function bYA(H,$,A){let L=H.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:L.$type.toObject(L,cfD),fileDescriptorProtos:A,serialize:hYA(H),deserialize:vYA(H,$)}}function Bl9(H,$){let A=H.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:A.$type.toObject(A,cfD),fileDescriptorProtos:$}}function fl9(H,$,A,L){if(H instanceof Vh.Service)return Dl9(H,$,A,L);else if(H instanceof Vh.Type)return bYA(H,A,L);else if(H instanceof Vh.Enum)return Bl9(H,L);else throw Error("Type mismatch in reflection object handling")}function d3$(H,$){let A={};H.resolveAll();let I=H.toDescriptor("proto3").file.map((D)=>Buffer.from(kYA.FileDescriptorProto.encode(D).finish()));for(let[D,B]of lfD(H,""))A[D]=fl9(B,D,$,I);return A}function ifD(H,$){$=$||{};let A=Vh.Root.fromDescriptor(H);return A.resolveAll(),d3$(A,$)}function El9(H,$){return(0,uYA.loadProtosWithOptions)(H,$).then((A)=>{return d3$(A,$)})}NK.load=El9;function Ml9(H,$){let A=(0,uYA.loadProtosWithOptionsSync)(H,$);return d3$(A,$)}NK.loadSync=Ml9;function Gl9(H,$){$=$||{};let A=Vh.Root.fromJSON(H);return A.resolveAll(),d3$(A,$)}NK.fromJSON=Gl9;function Ul9(H,$){let A=kYA.FileDescriptorSet.decode(H);return ifD(A,$)}NK.loadFileDescriptorSetFromBuffer=Ul9;function Xl9(H,$){let A=kYA.FileDescriptorSet.fromObject(H);return ifD(A,$)}NK.loadFileDescriptorSetFromObject=Xl9;(0,uYA.addCommonProtos)()});var ho=z((JU)=>{var __dirname="/home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(JU,"__esModule",{value:!0});JU.registerChannelzSocket=JU.registerChannelzServer=JU.registerChannelzSubchannel=JU.registerChannelzChannel=JU.ChannelzCallTrackerStub=JU.ChannelzCallTracker=JU.ChannelzChildrenTrackerStub=JU.ChannelzChildrenTracker=JU.ChannelzTrace=JU.ChannelzTraceStub=void 0;JU.unregisterChannelzRef=Wl9;JU.getChannelzHandlers=IED;JU.getChannelzServiceDefinition=DED;JU.setup=Nl9;var l3$=require("net"),z0H=b1D(),ZhH=xP(),qhH=B8(),Jl9=cY(),Fl9=K3$(),Kl9=P3$();function mYA(H){return{channel_id:H.id,name:H.name}}function pYA(H){return{subchannel_id:H.id,name:H.name}}function Ql9(H){return{server_id:H.id}}function i3$(H){return{socket_id:H.id,name:H.name}}var nfD=32,dYA=100;class tfD{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Ph(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}}JU.ChannelzTraceStub=tfD;class sfD{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(H,$,A){let L=new Date;if(this.events.push({description:$,severity:H,timestamp:L,childChannel:(A===null||A===void 0?void 0:A.kind)==="channel"?A:void 0,childSubchannel:(A===null||A===void 0?void 0:A.kind)==="subchannel"?A:void 0}),this.events.length>=nfD*2)this.events=this.events.slice(nfD);this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Ph(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map((H)=>{return{description:H.description,severity:H.severity,timestamp:Ph(H.timestamp),channel_ref:H.childChannel?mYA(H.childChannel):null,subchannel_ref:H.childSubchannel?pYA(H.childSubchannel):null}})}}}JU.ChannelzTrace=sfD;class cYA{constructor(){this.channelChildren=new z0H.OrderedMap,this.subchannelChildren=new z0H.OrderedMap,this.socketChildren=new z0H.OrderedMap,this.trackerMap={["channel"]:this.channelChildren,["subchannel"]:this.subchannelChildren,["socket"]:this.socketChildren}}refChild(H){let $=this.trackerMap[H.kind],A=$.find(H.id);if(A.equals($.end()))$.setElement(H.id,{ref:H,count:1},A);else A.pointer[1].count+=1}unrefChild(H){let $=this.trackerMap[H.kind],A=$.getElementByKey(H.id);if(A!==void 0){if(A.count-=1,A.count===0)$.eraseElementByKey(H.id)}}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}}JU.ChannelzChildrenTracker=cYA;class efD extends cYA{refChild(){}unrefChild(){}}JU.ChannelzChildrenTrackerStub=efD;class lYA{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}}JU.ChannelzCallTracker=lYA;class HED extends lYA{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}}JU.ChannelzCallTrackerStub=HED;var Dp={["channel"]:new z0H.OrderedMap,["subchannel"]:new z0H.OrderedMap,["server"]:new z0H.OrderedMap,["socket"]:new z0H.OrderedMap},n3$=(H)=>{let $=1;function A(){return $++}let L=Dp[H];return(I,D,B)=>{let f=A(),E={id:f,name:I,kind:H};if(B)L.setElement(f,{ref:E,getInfo:D});return E}};JU.registerChannelzChannel=n3$("channel");JU.registerChannelzSubchannel=n3$("subchannel");JU.registerChannelzServer=n3$("server");JU.registerChannelzSocket=n3$("socket");function Wl9(H){Dp[H.kind].eraseElementByKey(H.id)}function Vl9(H){let $=Number.parseInt(H,16);return[$/256|0,$%256]}function rfD(H){if(H==="")return[];let $=H.split(":").map((L)=>Vl9(L));return[].concat(...$)}function Pl9(H){return(0,l3$.isIPv6)(H)&&H.toLowerCase().startsWith("::ffff:")&&(0,l3$.isIPv4)(H.substring(7))}function afD(H){return Buffer.from(Uint8Array.from(H.split(".").map(($)=>Number.parseInt($))))}function _l9(H){if((0,l3$.isIPv4)(H))return afD(H);else if(Pl9(H))return afD(H.substring(7));else if((0,l3$.isIPv6)(H)){let $,A,L=H.indexOf("::");if(L===-1)$=H,A="";else $=H.substring(0,L),A=H.substring(L+2);let I=Buffer.from(rfD($)),D=Buffer.from(rfD(A)),B=Buffer.alloc(16-I.length-D.length,0);return Buffer.concat([I,B,D])}else return null}function $ED(H){switch(H){case ZhH.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case ZhH.ConnectivityState.IDLE:return{state:"IDLE"};case ZhH.ConnectivityState.READY:return{state:"READY"};case ZhH.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case ZhH.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Ph(H){if(!H)return null;let $=H.getTime();return{seconds:$/1000|0,nanos:$%1000*1e6}}function AED(H){let $=H.getInfo(),A=[],L=[];return $.children.channels.forEach((I)=>{A.push(mYA(I[1].ref))}),$.children.subchannels.forEach((I)=>{L.push(pYA(I[1].ref))}),{ref:mYA(H.ref),data:{target:$.target,state:$ED($.state),calls_started:$.callTracker.callsStarted,calls_succeeded:$.callTracker.callsSucceeded,calls_failed:$.callTracker.callsFailed,last_call_started_timestamp:Ph($.callTracker.lastCallStartedTimestamp),trace:$.trace.getTraceMessage()},channel_ref:A,subchannel_ref:L}}function Yl9(H,$){let A=parseInt(H.request.channel_id,10),L=Dp.channel.getElementByKey(A);if(L===void 0){$({code:qhH.Status.NOT_FOUND,details:"No channel data found for id "+A});return}$(null,{channel:AED(L)})}function Cl9(H,$){let A=parseInt(H.request.max_results,10)||dYA,L=[],I=parseInt(H.request.start_channel_id,10),D=Dp.channel,B;for(B=D.lowerBound(I);!B.equals(D.end())&&L.length{A.push(i3$(L[1].ref))}),{ref:Ql9(H.ref),data:{calls_started:$.callTracker.callsStarted,calls_succeeded:$.callTracker.callsSucceeded,calls_failed:$.callTracker.callsFailed,last_call_started_timestamp:Ph($.callTracker.lastCallStartedTimestamp),trace:$.trace.getTraceMessage()},listen_socket:A}}function wl9(H,$){let A=parseInt(H.request.server_id,10),I=Dp.server.getElementByKey(A);if(I===void 0){$({code:qhH.Status.NOT_FOUND,details:"No server data found for id "+A});return}$(null,{server:LED(I)})}function Zl9(H,$){let A=parseInt(H.request.max_results,10)||dYA,L=parseInt(H.request.start_server_id,10),I=Dp.server,D=[],B;for(B=I.lowerBound(L);!B.equals(I.end())&&D.length{D.push(i3$(f[1].ref))});let B={ref:pYA(L.ref),data:{target:I.target,state:$ED(I.state),calls_started:I.callTracker.callsStarted,calls_succeeded:I.callTracker.callsSucceeded,calls_failed:I.callTracker.callsFailed,last_call_started_timestamp:Ph(I.callTracker.lastCallStartedTimestamp),trace:I.trace.getTraceMessage()},socket_ref:D};$(null,{subchannel:B})}function ofD(H){var $;if((0,Jl9.isTcpSubchannelAddress)(H))return{address:"tcpip_address",tcpip_address:{ip_address:($=_l9(H.host))!==null&&$!==void 0?$:void 0,port:H.port}};else return{address:"uds_address",uds_address:{filename:H.path}}}function Tl9(H,$){var A,L,I,D,B;let f=parseInt(H.request.socket_id,10),E=Dp.socket.getElementByKey(f);if(E===void 0){$({code:qhH.Status.NOT_FOUND,details:"No socket data found for id "+f});return}let M=E.getInfo(),G=M.security?{model:"tls",tls:{cipher_suite:M.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(A=M.security.cipherSuiteStandardName)!==null&&A!==void 0?A:void 0,other_name:(L=M.security.cipherSuiteOtherName)!==null&&L!==void 0?L:void 0,local_certificate:(I=M.security.localCertificate)!==null&&I!==void 0?I:void 0,remote_certificate:(D=M.security.remoteCertificate)!==null&&D!==void 0?D:void 0}}:null,U={ref:i3$(E.ref),local:M.localAddress?ofD(M.localAddress):null,remote:M.remoteAddress?ofD(M.remoteAddress):null,remote_name:(B=M.remoteName)!==null&&B!==void 0?B:void 0,security:G,data:{keep_alives_sent:M.keepAlivesSent,streams_started:M.streamsStarted,streams_succeeded:M.streamsSucceeded,streams_failed:M.streamsFailed,last_local_stream_created_timestamp:Ph(M.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Ph(M.lastRemoteStreamCreatedTimestamp),messages_received:M.messagesReceived,messages_sent:M.messagesSent,last_message_received_timestamp:Ph(M.lastMessageReceivedTimestamp),last_message_sent_timestamp:Ph(M.lastMessageSentTimestamp),local_flow_control_window:M.localFlowControlWindow?{value:M.localFlowControlWindow}:null,remote_flow_control_window:M.remoteFlowControlWindow?{value:M.remoteFlowControlWindow}:null}};$(null,{socket:U})}function zl9(H,$){let A=parseInt(H.request.server_id,10),L=Dp.server.getElementByKey(A);if(L===void 0){$({code:qhH.Status.NOT_FOUND,details:"No server data found for id "+A});return}let I=parseInt(H.request.start_socket_id,10),D=parseInt(H.request.max_results,10)||dYA,f=L.getInfo().sessionChildren.sockets,E=[],M;for(M=f.lowerBound(I);!M.equals(f.end())&&E.length{Object.defineProperty(iYA,"__esModule",{value:!0});iYA.getNextCallNumber=xl9;var Ol9=0;function xl9(){return Ol9++}});var nYA=z((a3$)=>{Object.defineProperty(a3$,"__esModule",{value:!0});a3$.CompressionAlgorithms=void 0;var BED;(function(H){H[H.identity=0]="identity",H[H.deflate=1]="deflate",H[H.gzip=2]="gzip"})(BED||(a3$.CompressionAlgorithms=BED={}))});var rYA=z((o3$)=>{Object.defineProperty(o3$,"__esModule",{value:!0});o3$.BaseFilter=void 0;class fED{async sendMetadata(H){return H}receiveMetadata(H){return H}async sendMessage(H){return H}async receiveMessage(H){return H}receiveTrailers(H){return H}}o3$.BaseFilter=fED});var oYA=z((eWH)=>{Object.defineProperty(eWH,"__esModule",{value:!0});eWH.CompressionFilterFactory=eWH.CompressionFilter=void 0;var t3$=require("zlib"),MED=nYA(),tWH=B8(),Sl9=rYA(),jl9=qG(),Rl9=(H)=>{return typeof H==="number"&&typeof MED.CompressionAlgorithms[H]==="string"};class ThH{async writeMessage(H,$){let A=H;if($)A=await this.compressMessage(A);let L=Buffer.allocUnsafe(A.length+5);return L.writeUInt8($?1:0,0),L.writeUInt32BE(A.length,1),A.copy(L,5),L}async readMessage(H){let $=H.readUInt8(0)===1,A=H.slice(5);if($)A=await this.decompressMessage(A);return A}}class sWH extends ThH{async compressMessage(H){return H}async writeMessage(H,$){let A=Buffer.allocUnsafe(H.length+5);return A.writeUInt8(0,0),A.writeUInt32BE(H.length,1),H.copy(A,5),A}decompressMessage(H){return Promise.reject(Error('Received compressed message but "grpc-encoding" header was identity'))}}class GED extends ThH{constructor(H){super();this.maxRecvMessageLength=H}compressMessage(H){return new Promise(($,A)=>{t3$.deflate(H,(L,I)=>{if(L)A(L);else $(I)})})}decompressMessage(H){return new Promise(($,A)=>{let L=0,I=[],D=t3$.createInflate();D.on("data",(B)=>{if(I.push(B),L+=B.byteLength,this.maxRecvMessageLength!==-1&&L>this.maxRecvMessageLength)D.destroy(),A({code:tWH.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),D.on("end",()=>{$(Buffer.concat(I))}),D.write(H),D.end()})}}class UED extends ThH{constructor(H){super();this.maxRecvMessageLength=H}compressMessage(H){return new Promise(($,A)=>{t3$.gzip(H,(L,I)=>{if(L)A(L);else $(I)})})}decompressMessage(H){return new Promise(($,A)=>{let L=0,I=[],D=t3$.createGunzip();D.on("data",(B)=>{if(I.push(B),L+=B.byteLength,this.maxRecvMessageLength!==-1&&L>this.maxRecvMessageLength)D.destroy(),A({code:tWH.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),D.on("end",()=>{$(Buffer.concat(I))}),D.write(H),D.end()})}}class XED extends ThH{constructor(H){super();this.compressionName=H}compressMessage(H){return Promise.reject(Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(H){return Promise.reject(Error(`Compression method not supported: ${this.compressionName}`))}}function EED(H,$){switch(H){case"identity":return new sWH;case"deflate":return new GED($);case"gzip":return new UED($);default:return new XED(H)}}class aYA extends Sl9.BaseFilter{constructor(H,$){var A,L,I;super();this.sharedFilterConfig=$,this.sendCompression=new sWH,this.receiveCompression=new sWH,this.currentCompressionAlgorithm="identity";let D=H["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(A=H["grpc.max_receive_message_length"])!==null&&A!==void 0?A:tWH.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(L=H["grpc.max_send_message_length"])!==null&&L!==void 0?L:tWH.DEFAULT_MAX_SEND_MESSAGE_LENGTH,D!==void 0)if(Rl9(D)){let B=MED.CompressionAlgorithms[D],f=(I=$.serverSupportedEncodingHeader)===null||I===void 0?void 0:I.split(",");if(!f||f.includes(B))this.currentCompressionAlgorithm=B,this.sendCompression=EED(this.currentCompressionAlgorithm,-1)}else jl9.log(tWH.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${D}`)}async sendMetadata(H){let $=await H;if($.set("grpc-accept-encoding","identity,deflate,gzip"),$.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity")$.remove("grpc-encoding");else $.set("grpc-encoding",this.currentCompressionAlgorithm);return $}receiveMetadata(H){let $=H.get("grpc-encoding");if($.length>0){let L=$[0];if(typeof L==="string")this.receiveCompression=EED(L,this.maxReceiveMessageLength)}H.remove("grpc-encoding");let A=H.get("grpc-accept-encoding")[0];if(A){if(this.sharedFilterConfig.serverSupportedEncodingHeader=A,!A.split(",").includes(this.currentCompressionAlgorithm))this.sendCompression=new sWH,this.currentCompressionAlgorithm="identity"}return H.remove("grpc-accept-encoding"),H}async sendMessage(H){var $;let A=await H;if(this.maxSendMessageLength!==-1&&A.message.length>this.maxSendMessageLength)throw{code:tWH.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let L;if(this.sendCompression instanceof sWH)L=!1;else L=((($=A.flags)!==null&&$!==void 0?$:0)&2)===0;return{message:await this.sendCompression.writeMessage(A.message,L),flags:A.flags}}async receiveMessage(H){return this.receiveCompression.readMessage(await H)}}eWH.CompressionFilter=aYA;class JED{constructor(H,$){this.options=$,this.sharedFilterConfig={}}createFilter(){return new aYA(this.options,this.sharedFilterConfig)}}eWH.CompressionFilterFactory=JED});var zhH=z((tYA)=>{Object.defineProperty(tYA,"__esModule",{value:!0});tYA.restrictControlPlaneStatusCode=vl9;var _h=B8(),yl9=[_h.Status.OK,_h.Status.INVALID_ARGUMENT,_h.Status.NOT_FOUND,_h.Status.ALREADY_EXISTS,_h.Status.FAILED_PRECONDITION,_h.Status.ABORTED,_h.Status.OUT_OF_RANGE,_h.Status.DATA_LOSS];function vl9(H,$){if(yl9.includes(H))return{code:_h.Status.INTERNAL,details:`Invalid status from control plane: ${H} ${_h.Status[H]} ${$}`};else return{code:H,details:$}}});var H7H=z((N0H)=>{Object.defineProperty(N0H,"__esModule",{value:!0});N0H.minDeadline=hl9;N0H.getDeadlineTimeoutString=kl9;N0H.getRelativeTimeout=gl9;N0H.deadlineToString=ml9;N0H.formatDateDifference=pl9;function hl9(...H){let $=1/0;for(let A of H){let L=A instanceof Date?A.getTime():A;if(L<$)$=L}return $}var bl9=[["m",1],["S",1000],["M",60000],["H",3600000]];function kl9(H){let $=new Date().getTime();if(H instanceof Date)H=H.getTime();let A=Math.max(H-$,0);for(let[L,I]of bl9){let D=A/I;if(D<1e8)return String(Math.ceil(D))+L}throw Error("Deadline is too far in the future")}var ul9=2147483647;function gl9(H){let $=H instanceof Date?H.getTime():H,A=new Date().getTime(),L=$-A;if(L<0)return 0;else if(L>ul9)return 1/0;else return L}function ml9(H){if(H instanceof Date)return H.toISOString();else{let $=new Date(H);if(Number.isNaN($.getTime()))return""+H;else return $.toISOString()}}function pl9(H,$){return(($.getTime()-H.getTime())/1000).toFixed(3)+"s"}});var s3$=z(($7H)=>{Object.defineProperty($7H,"__esModule",{value:!0});$7H.FilterStackFactory=$7H.FilterStack=void 0;class sYA{constructor(H){this.filters=H}sendMetadata(H){let $=H;for(let A=0;A=0;A--)$=this.filters[A].receiveMetadata($);return $}sendMessage(H){let $=H;for(let A=0;A=0;A--)$=this.filters[A].receiveMessage($);return $}receiveTrailers(H){let $=H;for(let A=this.filters.length-1;A>=0;A--)$=this.filters[A].receiveTrailers($);return $}push(H){this.filters.unshift(...H)}getFilters(){return this.filters}}$7H.FilterStack=sYA;class eYA{constructor(H){this.factories=H}push(H){this.factories.unshift(...H)}clone(){return new eYA([...this.factories])}createFilter(){return new sYA(this.factories.map((H)=>H.createFilter()))}}$7H.FilterStackFactory=eYA});var QED=z((HV$)=>{Object.defineProperty(HV$,"__esModule",{value:!0});HV$.SingleSubchannelChannel=void 0;var dl9=r3$(),NhH=ho(),cl9=oYA(),ll9=xP(),OhH=B8(),il9=zhH(),nl9=H7H(),rl9=s3$(),HCA=rQ(),al9=BS(),e3$=OP();class FED{constructor(H,$,A,L,I){var D,B;this.subchannel=H,this.method=$,this.options=L,this.callNumber=I,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let f=this.method.split("/"),E="";if(f.length>=2)E=f[1];let M=(B=(D=(0,e3$.splitHostPort)(this.options.host))===null||D===void 0?void 0:D.host)!==null&&B!==void 0?B:"localhost";this.serviceUrl=`https://${M}/${E}`;let G=(0,nl9.getRelativeTimeout)(L.deadline);if(G!==1/0)if(G<=0)this.cancelWithStatus(OhH.Status.DEADLINE_EXCEEDED,"Deadline exceeded");else setTimeout(()=>{this.cancelWithStatus(OhH.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},G);this.filterStack=A.createFilter()}cancelWithStatus(H,$){if(this.childCall)this.childCall.cancelWithStatus(H,$);else this.pendingStatus={code:H,details:$,metadata:new HCA.Metadata}}getPeer(){var H,$;return($=(H=this.childCall)===null||H===void 0?void 0:H.getPeer())!==null&&$!==void 0?$:this.subchannel.getAddress()}async start(H,$){if(this.pendingStatus){$.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==ll9.ConnectivityState.READY){$.onReceiveStatus({code:OhH.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new HCA.Metadata});return}let A=await this.filterStack.sendMetadata(Promise.resolve(H)),L;try{L=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(D){let B=D,{code:f,details:E}=(0,il9.restrictControlPlaneStatusCode)(typeof B.code==="number"?B.code:OhH.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${B.message}`);$.onReceiveStatus({code:f,details:E,metadata:new HCA.Metadata});return}L.merge(A);let I={onReceiveMetadata:async(D)=>{$.onReceiveMetadata(await this.filterStack.receiveMetadata(D))},onReceiveMessage:async(D)=>{this.readFilterPending=!0;let B=await this.filterStack.receiveMessage(D);if(this.readFilterPending=!1,$.onReceiveMessage(B),this.pendingStatus)$.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async(D)=>{let B=await this.filterStack.receiveTrailers(D);if(this.readFilterPending)this.pendingStatus=B;else $.onReceiveStatus(B)}};if(this.childCall=this.subchannel.createCall(L,this.options.host,this.method,I),this.readPending)this.childCall.startRead();if(this.pendingMessage)this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message);if(this.halfClosePending&&!this.writeFilterPending)this.childCall.halfClose()}async sendMessageWithContext(H,$){this.writeFilterPending=!0;let A=await this.filterStack.sendMessage(Promise.resolve({message:$,flags:H.flags}));if(this.writeFilterPending=!1,this.childCall){if(this.childCall.sendMessageWithContext(H,A.message),this.halfClosePending)this.childCall.halfClose()}else this.pendingMessage={context:H,message:A.message}}startRead(){if(this.childCall)this.childCall.startRead();else this.readPending=!0}halfClose(){if(this.childCall&&!this.writeFilterPending)this.childCall.halfClose();else this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(H){throw Error("Method not implemented.")}getAuthContext(){if(this.childCall)return this.childCall.getAuthContext();else return null}}class KED{constructor(H,$,A){if(this.subchannel=H,this.target=$,this.channelzEnabled=!1,this.channelzTrace=new NhH.ChannelzTrace,this.callTracker=new NhH.ChannelzCallTracker,this.childrenTracker=new NhH.ChannelzChildrenTracker,this.channelzEnabled=A["grpc.enable_channelz"]!==0,this.channelzRef=(0,NhH.registerChannelzChannel)((0,e3$.uriToString)($),()=>({target:`${(0,e3$.uriToString)($)} (${H.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled)this.childrenTracker.refChild(H.getChannelzRef());this.filterStackFactory=new rl9.FilterStackFactory([new cl9.CompressionFilterFactory(this,A)])}close(){if(this.channelzEnabled)this.childrenTracker.unrefChild(this.subchannel.getChannelzRef());(0,NhH.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,e3$.uriToString)(this.target)}getConnectivityState(H){throw Error("Method not implemented.")}watchConnectivityState(H,$,A){throw Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(H,$){let A={deadline:$,host:(0,al9.getDefaultAuthority)(this.target),flags:OhH.Propagate.DEFAULTS,parentCall:null};return new FED(this.subchannel,H,this.filterStackFactory,A,(0,dl9.getNextCallNumber)())}}HV$.SingleSubchannelChannel=KED});var VED=z((AV$)=>{Object.defineProperty(AV$,"__esModule",{value:!0});AV$.Subchannel=void 0;var uM=xP(),ol9=uWH(),$CA=qG(),$V$=B8(),tl9=OP(),sl9=cY(),Yh=ho(),el9=QED(),Hi9="subchannel",$i9=2147483647;class WED{constructor(H,$,A,L,I){var D;this.channelTarget=H,this.subchannelAddress=$,this.options=A,this.connector=I,this.connectivityState=uM.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let B={initialDelay:A["grpc.initial_reconnect_backoff_ms"],maxDelay:A["grpc.max_reconnect_backoff_ms"]};if(this.backoffTimeout=new ol9.BackoffTimeout(()=>{this.handleBackoffTimer()},B),this.backoffTimeout.unref(),this.subchannelAddressString=(0,sl9.subchannelAddressToString)($),this.keepaliveTime=(D=A["grpc.keepalive_time_ms"])!==null&&D!==void 0?D:-1,A["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new Yh.ChannelzTraceStub,this.callTracker=new Yh.ChannelzCallTrackerStub,this.childrenTracker=new Yh.ChannelzChildrenTrackerStub,this.streamTracker=new Yh.ChannelzCallTrackerStub;else this.channelzTrace=new Yh.ChannelzTrace,this.callTracker=new Yh.ChannelzCallTracker,this.childrenTracker=new Yh.ChannelzChildrenTracker,this.streamTracker=new Yh.ChannelzCallTracker;this.channelzRef=(0,Yh.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(A,void 0,2)),this.secureConnector=L._createSecureConnector(H,A)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(H){$CA.trace($V$.LogVerbosity.DEBUG,Hi9,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+H)}refTrace(H){$CA.trace($V$.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+H)}handleBackoffTimer(){if(this.continueConnecting)this.transitionToState([uM.ConnectivityState.TRANSIENT_FAILURE],uM.ConnectivityState.CONNECTING);else this.transitionToState([uM.ConnectivityState.TRANSIENT_FAILURE],uM.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let H=this.options;if(H["grpc.keepalive_time_ms"]){let $=Math.min(this.keepaliveTime,$i9);H=Object.assign(Object.assign({},H),{"grpc.keepalive_time_ms":$})}this.connector.connect(this.subchannelAddress,this.secureConnector,H).then(($)=>{if(this.transitionToState([uM.ConnectivityState.CONNECTING],uM.ConnectivityState.READY)){if(this.transport=$,this.channelzEnabled)this.childrenTracker.refChild($.getChannelzRef());$.addDisconnectListener((A)=>{if(this.transitionToState([uM.ConnectivityState.READY],uM.ConnectivityState.IDLE),A&&this.keepaliveTime>0)this.keepaliveTime*=2,$CA.log($V$.LogVerbosity.ERROR,`Connection to ${(0,tl9.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`)})}else $.shutdown()},($)=>{this.transitionToState([uM.ConnectivityState.CONNECTING],uM.ConnectivityState.TRANSIENT_FAILURE,`${$}`)})}transitionToState(H,$,A){var L,I;if(H.indexOf(this.connectivityState)===-1)return!1;if(A)this.trace(uM.ConnectivityState[this.connectivityState]+" -> "+uM.ConnectivityState[$]+' with error "'+A+'"');else this.trace(uM.ConnectivityState[this.connectivityState]+" -> "+uM.ConnectivityState[$]);if(this.channelzEnabled)this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+uM.ConnectivityState[$]);let D=this.connectivityState;switch(this.connectivityState=$,$){case uM.ConnectivityState.READY:this.stopBackoff();break;case uM.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case uM.ConnectivityState.TRANSIENT_FAILURE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());if((L=this.transport)===null||L===void 0||L.shutdown(),this.transport=null,!this.backoffTimeout.isRunning())process.nextTick(()=>{this.handleBackoffTimer()});break;case uM.ConnectivityState.IDLE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());(I=this.transport)===null||I===void 0||I.shutdown(),this.transport=null;break;default:throw Error(`Invalid state: unknown ConnectivityState ${$}`)}for(let B of this.stateListeners)B(this,D,$,this.keepaliveTime,A);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){if(this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0)this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,Yh.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([uM.ConnectivityState.CONNECTING,uM.ConnectivityState.READY],uM.ConnectivityState.IDLE)})}unrefIfOneRef(){if(this.refcount===1)return this.unref(),!0;return!1}createCall(H,$,A,L){if(!this.transport)throw Error("Cannot create call, subchannel not READY");let I;if(this.channelzEnabled)this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),I={onCallEnd:(D)=>{if(D.code===$V$.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()}};else I={};return this.transport.createCall(H,$,A,L,I)}startConnecting(){process.nextTick(()=>{if(!this.transitionToState([uM.ConnectivityState.IDLE],uM.ConnectivityState.CONNECTING)){if(this.connectivityState===uM.ConnectivityState.TRANSIENT_FAILURE)this.continueConnecting=!0}})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(H){this.stateListeners.add(H)}removeConnectivityStateListener(H){this.stateListeners.delete(H)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([uM.ConnectivityState.TRANSIENT_FAILURE],uM.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(H){}removeHealthStateWatcher(H){}getRealSubchannel(){return this}realSubchannelEquals(H){return H.getRealSubchannel()===this}throttleKeepalive(H){if(H>this.keepaliveTime)this.keepaliveTime=H}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){if(!this.subchannelChannel)this.subchannelChannel=new el9.SingleSubchannelChannel(this,this.channelTarget,this.options);return this.subchannelChannel}addDataWatcher(H){throw Error("Not implemented")}getOrCreateDataProducer(H,$){let A=this.dataProducers.get(H);if(A)return A;let L=$(this);return this.dataProducers.set(H,L),L}removeDataProducer(H){this.dataProducers.delete(H)}}AV$.Subchannel=WED});var PED=z((LV$)=>{var ACA;Object.defineProperty(LV$,"__esModule",{value:!0});LV$.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;LV$.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((ACA=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&ACA!==void 0?ACA:"false")==="true"});var DCA=z((O0H)=>{Object.defineProperty(O0H,"__esModule",{value:!0});O0H.DEFAULT_PORT=void 0;O0H.setup=Mi9;var _ED=BS(),LCA=require("dns"),Ai9=k_A(),ICA=B8(),A7H=Y0H(),Li9=rQ(),Ii9=qG(),Di9=B8(),bo=OP(),YED=require("net"),Bi9=uWH(),CED=PED(),fi9="dns_resolver";function Ch(H){Ii9.trace(Di9.LogVerbosity.DEBUG,fi9,H)}O0H.DEFAULT_PORT=443;var Ei9=30000;class wED{constructor(H,$,A){var L,I,D;if(this.target=H,this.listener=$,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new LCA.promises.Resolver,Ch("Resolver constructed for target "+(0,bo.uriToString)(H)),H.authority)this.alternativeResolver.setServers([H.authority]);let B=(0,bo.splitHostPort)(H.path);if(B===null)this.ipResult=null,this.dnsHostname=null,this.port=null;else if((0,YED.isIPv4)(B.host)||(0,YED.isIPv6)(B.host))this.ipResult=[{addresses:[{host:B.host,port:(L=B.port)!==null&&L!==void 0?L:O0H.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null;else this.ipResult=null,this.dnsHostname=B.host,this.port=(I=B.port)!==null&&I!==void 0?I:O0H.DEFAULT_PORT;if(this.percentage=Math.random()*100,A["grpc.service_config_disable_resolution"]===1)this.isServiceConfigEnabled=!1;this.defaultResolutionError={code:ICA.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,bo.uriToString)(this.target)}`,metadata:new Li9.Metadata};let f={initialDelay:A["grpc.initial_reconnect_backoff_ms"],maxDelay:A["grpc.max_reconnect_backoff_ms"]};this.backoff=new Bi9.BackoffTimeout(()=>{if(this.continueResolving)this.startResolutionWithBackoff()},f),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(D=A["grpc.dns_min_time_between_resolutions_ms"])!==null&&D!==void 0?D:Ei9,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){if(!this.returnedIpResult)Ch("Returning IP address for target "+(0,bo.uriToString)(this.target)),setImmediate(()=>{this.listener((0,A7H.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0;this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)Ch("Failed to parse DNS address "+(0,bo.uriToString)(this.target)),setImmediate(()=>{this.listener((0,A7H.statusOrFromError)({code:ICA.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,bo.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;Ch("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let H=this.dnsHostname;if(this.pendingLookupPromise=this.lookup(H),this.pendingLookupPromise.then(($)=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,A7H.statusOrFromValue)($.map((I)=>({addresses:[I]})));let A="["+$.map((I)=>I.host+":"+I.port).join(",")+"]";Ch("Resolved addresses for target "+(0,bo.uriToString)(this.target)+": "+A);let L=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(L)},($)=>{if(this.pendingLookupPromise===null)return;Ch("Resolution error for target "+(0,bo.uriToString)(this.target)+": "+$.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,A7H.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,"")}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null)this.pendingTxtPromise=this.resolveTxt(H),this.pendingTxtPromise.then(($)=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let A;try{if(A=(0,Ai9.extractAndSelectServiceConfig)($,this.percentage),A)this.latestServiceConfigResult=(0,A7H.statusOrFromValue)(A);else this.latestServiceConfigResult=null}catch(L){this.latestServiceConfigResult=(0,A7H.statusOrFromError)({code:ICA.Status.UNAVAILABLE,details:`Parsing service config failed with error ${L.message}`})}if(this.latestLookupResult!==null)this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},($)=>{})}}handleHealthStatus(H){if(H)this.backoff.stop(),this.backoff.reset();else this.continueResolving=!0}async lookup(H){if(CED.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){Ch("Using alternative DNS resolver.");let A=await Promise.allSettled([this.alternativeResolver.resolve4(H),this.alternativeResolver.resolve6(H)]);if(A.every((L)=>L.status==="rejected"))throw Error(A[0].reason);return A.reduce((L,I)=>{return I.status==="fulfilled"?[...L,...I.value]:L},[]).map((L)=>({host:L,port:+this.port}))}return(await LCA.promises.lookup(H,{all:!0})).map((A)=>({host:A.address,port:+this.port}))}async resolveTxt(H){if(CED.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)return Ch("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(H);return LCA.promises.resolveTxt(H)}startNextResolutionTimer(){var H,$;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{if(this.stopNextResolutionTimer(),this.continueResolving)this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),($=(H=this.nextResolutionTimer).unref)===null||$===void 0||$.call(H),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){if(this.pendingLookupPromise===null)this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution()}updateResolution(){if(this.pendingLookupPromise===null)if(this.isNextResolutionTimerRunning||this.backoff.isRunning()){if(this.isNextResolutionTimerRunning)Ch('resolution update delayed by "min time between resolutions" rate limit');else Ch("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString());this.continueResolving=!0}else this.startResolutionWithBackoff()}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(H){return H.path}}function Mi9(){(0,_ED.registerResolver)("dns",wED),(0,_ED.registerDefaultScheme)("dns")}});var BCA=z((jhH)=>{Object.defineProperty(jhH,"__esModule",{value:!0});jhH.parseCIDR=TED;jhH.mapProxyName=Pi9;jhH.getProxiedConnection=_i9;var xhH=qG(),L7H=B8(),qED=require("net"),Gi9=require("http"),Ui9=qG(),ZED=cY(),ShH=OP(),Xi9=require("url"),Ji9=DCA(),Fi9="proxy";function I7H(H){Ui9.trace(L7H.LogVerbosity.DEBUG,Fi9,H)}function Ki9(){let H="",$="";if(process.env.grpc_proxy)$="grpc_proxy",H=process.env.grpc_proxy;else if(process.env.https_proxy)$="https_proxy",H=process.env.https_proxy;else if(process.env.http_proxy)$="http_proxy",H=process.env.http_proxy;else return{};let A;try{A=new Xi9.URL(H)}catch(f){return(0,xhH.log)(L7H.LogVerbosity.ERROR,`cannot parse value of "${$}" env var`),{}}if(A.protocol!=="http:")return(0,xhH.log)(L7H.LogVerbosity.ERROR,`"${A.protocol}" scheme not supported in proxy URI`),{};let L=null;if(A.username)if(A.password)(0,xhH.log)(L7H.LogVerbosity.INFO,"userinfo found in proxy URI"),L=decodeURIComponent(`${A.username}:${A.password}`);else L=A.username;let{hostname:I,port:D}=A;if(D==="")D="80";let B={address:`${I}:${D}`};if(L)B.creds=L;return I7H("Proxy server "+B.address+" set by environment variable "+$),B}function Qi9(){let H=process.env.no_grpc_proxy,$="no_grpc_proxy";if(!H)H=process.env.no_proxy,$="no_proxy";if(H)return I7H("No proxy server list set by environment variable "+$),H.split(",");else return[]}function TED(H){let $=H.split("/");if($.length!==2)return null;let A=parseInt($[1],10);if(!(0,qED.isIPv4)($[0])||Number.isNaN(A)||A<0||A>32)return null;return{ip:zED($[0]),prefixLength:A}}function zED(H){return H.split(".").reduce(($,A)=>($<<8)+parseInt(A,10),0)}function Wi9(H,$){let A=H.ip,L=-1<<32-H.prefixLength;return(zED($)&L)===(A&L)}function Vi9(H){for(let $ of Qi9()){let A=TED($);if((0,qED.isIPv4)(H)&&A&&Wi9(A,H))return!0;else if(H.endsWith($))return!0}return!1}function Pi9(H,$){var A;let L={target:H,extraOptions:{}};if(((A=$["grpc.enable_http_proxy"])!==null&&A!==void 0?A:1)===0)return L;if(H.scheme==="unix")return L;let I=Ki9();if(!I.address)return L;let D=(0,ShH.splitHostPort)(H.path);if(!D)return L;let B=D.host;if(Vi9(B))return I7H("Not using proxy for target in no_proxy list: "+(0,ShH.uriToString)(H)),L;let f={"grpc.http_connect_target":(0,ShH.uriToString)(H)};if(I.creds)f["grpc.http_connect_creds"]=I.creds;return{target:{scheme:"dns",path:I.address},extraOptions:f}}function _i9(H,$){var A;if(!("grpc.http_connect_target"in $))return Promise.resolve(null);let L=$["grpc.http_connect_target"],I=(0,ShH.parseUri)(L);if(I===null)return Promise.resolve(null);let D=(0,ShH.splitHostPort)(I.path);if(D===null)return Promise.resolve(null);let B=`${D.host}:${(A=D.port)!==null&&A!==void 0?A:Ji9.DEFAULT_PORT}`,f={method:"CONNECT",path:B},E={Host:B};if((0,ZED.isTcpSubchannelAddress)(H))f.host=H.host,f.port=H.port;else f.socketPath=H.path;if("grpc.http_connect_creds"in $)E["Proxy-Authorization"]="Basic "+Buffer.from($["grpc.http_connect_creds"]).toString("base64");f.headers=E;let M=(0,ZED.subchannelAddressToString)(H);return I7H("Using proxy "+M+" to connect to "+f.path),new Promise((G,U)=>{let X=Gi9.request(f);X.once("connect",(J,F,Q)=>{if(X.removeAllListeners(),F.removeAllListeners(),J.statusCode===200){if(I7H("Successfully connected to "+f.path+" through proxy "+M),Q.length>0)F.unshift(Q);I7H("Successfully established a plaintext connection to "+f.path+" through proxy "+M),G(F)}else(0,xhH.log)(L7H.LogVerbosity.ERROR,"Failed to connect to "+f.path+" through proxy "+M+" with status "+J.statusCode),U()}),X.once("error",(J)=>{X.removeAllListeners(),(0,xhH.log)(L7H.LogVerbosity.ERROR,"Failed to connect to proxy "+M+" with error "+J.message),U()}),X.end()})}});var fCA=z((IV$)=>{Object.defineProperty(IV$,"__esModule",{value:!0});IV$.StreamDecoder=void 0;var wh;(function(H){H[H.NO_DATA=0]="NO_DATA",H[H.READING_SIZE=1]="READING_SIZE",H[H.READING_MESSAGE=2]="READING_MESSAGE"})(wh||(wh={}));class NED{constructor(H){this.maxReadMessageLength=H,this.readState=wh.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(H){let $=0,A,L=[];while($this.maxReadMessageLength)throw Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=wh.READING_MESSAGE;else{let I=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=wh.NO_DATA,L.push(I)}}break;case wh.READING_MESSAGE:if(A=Math.min(H.length-$,this.readMessageRemaining),this.readPartialMessage.push(H.slice($,$+A)),this.readMessageRemaining-=A,$+=A,this.readMessageRemaining===0){let I=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),D=Buffer.concat(I,this.readMessageSize+5);this.readState=wh.NO_DATA,L.push(D)}break;default:throw Error("Unexpected read state")}return L}}IV$.StreamDecoder=NED});var xED=z((DV$)=>{Object.defineProperty(DV$,"__esModule",{value:!0});DV$.Http2SubchannelCall=void 0;var Bp=require("http2"),Yi9=require("os"),gM=B8(),fp=rQ(),Ci9=fCA(),wi9=qG(),Zi9=B8(),qi9="subchannel_call";function Ti9(H){for(let[$,A]of Object.entries(Yi9.constants.errno))if(A===H)return $;return"Unknown system error "+H}function ECA(H){let $=`Received HTTP status code ${H}`,A;switch(H){case 400:A=gM.Status.INTERNAL;break;case 401:A=gM.Status.UNAUTHENTICATED;break;case 403:A=gM.Status.PERMISSION_DENIED;break;case 404:A=gM.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:A=gM.Status.UNAVAILABLE;break;default:A=gM.Status.UNKNOWN}return{code:A,details:$,metadata:new fp.Metadata}}class OED{constructor(H,$,A,L,I){var D;this.http2Stream=H,this.callEventTracker=$,this.listener=A,this.transport=L,this.callId=I,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let B=(D=L.getOptions()["grpc.max_receive_message_length"])!==null&&D!==void 0?D:gM.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Ci9.StreamDecoder(B),H.on("response",(f,E)=>{let M="";for(let G of Object.keys(f))M+="\t\t"+G+": "+f[G]+` `)+1)));this.lastActivityTimestamp=new Date}trace(H,$){(0,QV$.trace)($!==null&&$!==void 0?$:uo.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,WV$.uriToString)(this.target)+" "+H)}callRefTimerRef(){var H,$,A,L;if(!this.callRefTimer)this.callRefTimer=setInterval(()=>{},Cn9);if(!(($=(H=this.callRefTimer).hasRef)===null||$===void 0?void 0:$.call(H)))this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(L=(A=this.callRefTimer).ref)===null||L===void 0||L.call(A)}callRefTimerUnref(){var H,$,A;if(!((H=this.callRefTimer)===null||H===void 0?void 0:H.hasRef)||this.callRefTimer.hasRef())this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(A=($=this.callRefTimer)===null||$===void 0?void 0:$.unref)===null||A===void 0||A.call($)}removeConnectivityStateWatcher(H){let $=this.connectivityStateWatchers.findIndex((A)=>A===H);if($>=0)this.connectivityStateWatchers.splice($,1)}updateState(H){if((0,QV$.trace)(uo.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,WV$.uriToString)(this.target)+" "+Hz.ConnectivityState[this.connectivityState]+" -> "+Hz.ConnectivityState[H]),this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Hz.ConnectivityState[H]);this.connectivityState=H,this.channelzInfoTracker.state=H;let $=this.connectivityStateWatchers.slice();for(let A of $)if(H!==A.currentState){if(A.timer)clearTimeout(A.timer);this.removeConnectivityStateWatcher(A),A.callback()}if(H!==Hz.ConnectivityState.TRANSIENT_FAILURE)this.currentResolutionError=null}throttleKeepalive(H){if(H>this.keepaliveTime){this.keepaliveTime=H;for(let $ of this.wrappedSubchannels)$.throttleKeepalive(H)}}addWrappedSubchannel(H){this.wrappedSubchannels.add(H)}removeWrappedSubchannel(H){this.wrappedSubchannels.delete(H)}doPick(H,$){return this.currentPicker.pick({metadata:H,extraPickInfo:$})}queueCallForPick(H){this.pickQueue.push(H),this.callRefTimerRef()}getConfig(H,$){if(this.connectivityState!==Hz.ConnectivityState.SHUTDOWN)this.resolvingLoadBalancer.exitIdle();if(this.configSelector)return{type:"SUCCESS",config:this.configSelector.invoke(H,$,this.randomChannelId)};else if(this.currentResolutionError)return{type:"ERROR",error:this.currentResolutionError};else return{type:"NONE"}}queueCallForConfig(H){this.configSelectionQueue.push(H),this.callRefTimerRef()}enterIdle(){if(this.resolvingLoadBalancer.destroy(),this.updateState(Hz.ConnectivityState.IDLE),this.currentPicker=new KCA.QueuePicker(this.resolvingLoadBalancer),this.idleTimer)clearTimeout(this.idleTimer),this.idleTimer=null;if(this.callRefTimer)clearInterval(this.callRefTimer),this.callRefTimer=null}startIdleTimeout(H){var $,A;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let I=new Date().valueOf()-this.lastActivityTimestamp.valueOf();if(I>=this.idleTimeoutMs)this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle();else this.startIdleTimeout(this.idleTimeoutMs-I)},H),(A=($=this.idleTimer).unref)===null||A===void 0||A.call($)}maybeStartIdleTimer(){if(this.connectivityState!==Hz.ConnectivityState.SHUTDOWN&&!this.idleTimer)this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){if(this.channelzEnabled)this.channelzInfoTracker.callTracker.addCallStarted();this.callCount+=1}onCallEnd(H){if(this.channelzEnabled)if(H.code===uo.Status.OK)this.channelzInfoTracker.callTracker.addCallSucceeded();else this.channelzInfoTracker.callTracker.addCallFailed();this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(H,$,A,L,I){let D=(0,JCA.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+D+'] method="'+$+'"'),new Wn9.LoadBalancingCall(this,H,$,A,L,I,D)}createRetryingCall(H,$,A,L,I){let D=(0,JCA.getNextCallNumber)();return this.trace("createRetryingCall ["+D+'] method="'+$+'"'),new FCA.RetryingCall(this,H,$,A,L,I,D,this.retryBufferTracker,VV$.get(this.getTarget()))}createResolvingCall(H,$,A,L,I){let D=(0,JCA.getNextCallNumber)();this.trace("createResolvingCall ["+D+'] method="'+H+'", deadline='+(0,Vn9.deadlineToString)($));let B={deadline:$,flags:I!==null&&I!==void 0?I:uo.Propagate.DEFAULTS,host:A!==null&&A!==void 0?A:this.defaultAuthority,parentCall:L},f=new Pn9.ResolvingCall(this,H,B,this.filterStackFactory.clone(),D);return this.onCallStart(),f.addStatusWatcher((E)=>{this.onCallEnd(E)}),f}close(){var H;this.resolvingLoadBalancer.destroy(),this.updateState(Hz.ConnectivityState.SHUTDOWN),this.currentPicker=new aED;for(let $ of this.configSelectionQueue)$.cancelWithStatus(uo.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let $ of this.pickQueue)$.cancelWithStatus(uo.Status.UNAVAILABLE,"Channel closed before call started");if(this.pickQueue=[],this.callRefTimer)clearInterval(this.callRefTimer);if(this.idleTimer)clearTimeout(this.idleTimer);if(this.channelzEnabled)(0,bhH.unregisterChannelzRef)(this.channelzRef);this.subchannelPool.unrefUnusedSubchannels(),(H=this.configSelector)===null||H===void 0||H.unref(),this.configSelector=null}getTarget(){return(0,WV$.uriToString)(this.target)}getConnectivityState(H){let $=this.connectivityState;if(H)this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer();return $}watchConnectivityState(H,$,A){if(this.connectivityState===Hz.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");let L=null;if($!==1/0){let D=$ instanceof Date?$:new Date($),B=new Date;if($===-1/0||D<=B){process.nextTick(A,Error("Deadline passed without connectivity state change"));return}L=setTimeout(()=>{this.removeConnectivityStateWatcher(I),A(Error("Deadline passed without connectivity state change"))},D.getTime()-B.getTime())}let I={currentState:H,callback:A,timer:L};this.connectivityStateWatchers.push(I)}getChannelzRef(){return this.channelzRef}createCall(H,$,A,L,I){if(typeof H!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof $==="number"||$ instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Hz.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");return this.createResolvingCall(H,$,A,L,I)}getOptions(){return this.options}}R0H.InternalChannel=tED});var r_A=z((PV$)=>{Object.defineProperty(PV$,"__esModule",{value:!0});PV$.ChannelImplementation=void 0;var zn9=kWH(),Nn9=QCA();class sED{constructor(H,$,A){if(typeof H!=="string")throw TypeError("Channel target must be a string");if(!($ instanceof zn9.ChannelCredentials))throw TypeError("Channel credentials must be a ChannelCredentials object");if(A){if(typeof A!=="object")throw TypeError("Channel options must be an object")}this.internalChannel=new Nn9.InternalChannel(H,$,A)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(H){return this.internalChannel.getConnectivityState(H)}watchConnectivityState(H,$,A){this.internalChannel.watchConnectivityState(H,$,A)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(H,$,A,L,I){if(typeof H!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof $==="number"||$ instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(H,$,A,L,I)}}PV$.ChannelImplementation=sED});var IMD=z((KS)=>{Object.defineProperty(KS,"__esModule",{value:!0});KS.ServerDuplexStreamImpl=KS.ServerWritableStreamImpl=KS.ServerReadableStreamImpl=KS.ServerUnaryCallImpl=void 0;KS.serverErrorToStatus=PCA;var On9=require("events"),WCA=require("stream"),VCA=B8(),eED=rQ();function PCA(H,$){var A;let L={code:VCA.Status.UNKNOWN,details:"message"in H?H.message:"Unknown Error",metadata:(A=$!==null&&$!==void 0?$:H.metadata)!==null&&A!==void 0?A:null};if("code"in H&&typeof H.code==="number"&&Number.isInteger(H.code)){if(L.code=H.code,"details"in H&&typeof H.details==="string")L.details=H.details}return L}class HMD extends On9.EventEmitter{constructor(H,$,A,L){super();this.path=H,this.call=$,this.metadata=A,this.request=L,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}KS.ServerUnaryCallImpl=HMD;class $MD extends WCA.Readable{constructor(H,$,A){super({objectMode:!0});this.path=H,this.call=$,this.metadata=A,this.cancelled=!1}_read(H){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}KS.ServerReadableStreamImpl=$MD;class AMD extends WCA.Writable{constructor(H,$,A,L){super({objectMode:!0});this.path=H,this.call=$,this.metadata=A,this.request=L,this.pendingStatus={code:VCA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new eED.Metadata,this.on("error",(I)=>{this.pendingStatus=PCA(I),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(H,$,A){this.call.sendMessage(H,A)}_final(H){var $;H(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:($=this.pendingStatus.metadata)!==null&&$!==void 0?$:this.trailingMetadata}))}end(H){if(H)this.trailingMetadata=H;return super.end()}}KS.ServerWritableStreamImpl=AMD;class LMD extends WCA.Duplex{constructor(H,$,A){super({objectMode:!0});this.path=H,this.call=$,this.metadata=A,this.pendingStatus={code:VCA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new eED.Metadata,this.on("error",(L)=>{this.pendingStatus=PCA(L),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(H){this.call.startRead()}_write(H,$,A){this.call.sendMessage(H,A)}_final(H){var $;H(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:($=this.pendingStatus.metadata)!==null&&$!==void 0?$:this.trailingMetadata}))}end(H){if(H)this.trailingMetadata=H;return super.end()}}KS.ServerDuplexStreamImpl=LMD});var _V$=z((f7H)=>{Object.defineProperty(f7H,"__esModule",{value:!0});f7H.ServerCredentials=void 0;f7H.createCertificateProviderServerCredentials=xn9;f7H.createServerCredentialsWithInterceptors=Sn9;var _CA=j_A();class B7H{constructor(H,$){this.serverConstructorOptions=H,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=$!==null&&$!==void 0?$:null}_addWatcher(H){this.watchers.add(H)}_removeWatcher(H){this.watchers.delete(H)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(H){this.latestContextOptions=H;for(let $ of this.watchers)$(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new YCA}static createSsl(H,$,A=!1){var L;if(H!==null&&!Buffer.isBuffer(H))throw TypeError("rootCerts must be null or a Buffer");if(!Array.isArray($))throw TypeError("keyCertPairs must be an array");if(typeof A!=="boolean")throw TypeError("checkClientCertificate must be a boolean");let I=[],D=[];for(let B=0;B<$.length;B++){let f=$[B];if(f===null||typeof f!=="object")throw TypeError(`keyCertPair[${B}] must be an object`);if(!Buffer.isBuffer(f.private_key))throw TypeError(`keyCertPair[${B}].private_key must be a Buffer`);if(!Buffer.isBuffer(f.cert_chain))throw TypeError(`keyCertPair[${B}].cert_chain must be a Buffer`);I.push(f.cert_chain),D.push(f.private_key)}return new CCA({requestCert:A,ciphers:_CA.CIPHER_SUITES},{ca:(L=H!==null&&H!==void 0?H:(0,_CA.getDefaultRootsData)())!==null&&L!==void 0?L:void 0,cert:I,key:D})}}f7H.ServerCredentials=B7H;class YCA extends B7H{constructor(){super(null)}_getSettings(){return null}_equals(H){return H instanceof YCA}}class CCA extends B7H{constructor(H,$){super(H,$);this.options=Object.assign(Object.assign({},H),$)}_equals(H){if(this===H)return!0;if(!(H instanceof CCA))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(H.options.ca)){if(!this.options.ca.equals(H.options.ca))return!1}else if(this.options.ca!==H.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(H.options.cert)){if(this.options.cert.length!==H.options.cert.length)return!1;for(let $=0;${Object.defineProperty(Ep,"__esModule",{value:!0});Ep.durationMessageToDuration=jn9;Ep.msToDuration=Rn9;Ep.durationToMs=yn9;Ep.isDuration=vn9;Ep.isDurationMessage=hn9;Ep.parseDuration=kn9;Ep.durationToString=un9;function jn9(H){return{seconds:Number.parseInt(H.seconds),nanos:H.nanos}}function Rn9(H){return{seconds:H/1000|0,nanos:H%1000*1e6|0}}function yn9(H){return H.seconds*1000+H.nanos/1e6|0}function vn9(H){return typeof H.seconds==="number"&&typeof H.nanos==="number"}function hn9(H){return typeof H.seconds==="string"&&typeof H.nanos==="number"}var bn9=/^(\d+)(?:\.(\d+))?s$/;function kn9(H){let $=H.match(bn9);if(!$)return null;return{seconds:Number.parseInt($[1],10),nanos:$[2]?Number.parseInt($[2].padEnd(9,"0"),10):0}}function un9(H){if(H.nanos===0)return`${H.seconds}s`;let $;if(H.nanos%1e6===0)$=1e6;else if(H.nanos%1000===0)$=1000;else $=1;return`${H.seconds}.${H.nanos/$}s`}});var CV$=z((Vw)=>{var __dirname="/home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(Vw,"__esModule",{value:!0});Vw.OrcaOobMetricsSubchannelWrapper=Vw.GRPC_METRICS_HEADER=Vw.ServerMetricRecorder=Vw.PerRequestMetricRecorder=void 0;Vw.createOrcaClient=GMD;Vw.createMetricsReader=in9;var gn9=P3$(),qCA=khH(),mn9=kWH(),pn9=hhH(),DMD=B8(),dn9=uWH(),cn9=xP(),BMD=null;function YV$(){if(BMD)return BMD;let H=gYA().loadSync,$=H("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,gn9.loadPackageDefinition)($)}class EMD{constructor(){this.message={}}recordRequestCostMetric(H,$){if(!this.message.request_cost)this.message.request_cost={};this.message.request_cost[H]=$}recordUtilizationMetric(H,$){if(!this.message.utilization)this.message.utilization={};this.message.utilization[H]=$}recordNamedMetric(H,$){if(!this.message.named_metrics)this.message.named_metrics={};this.message.named_metrics[H]=$}recordCPUUtilizationMetric(H){this.message.cpu_utilization=H}recordMemoryUtilizationMetric(H){this.message.mem_utilization=H}recordApplicationUtilizationMetric(H){this.message.application_utilization=H}recordQpsMetric(H){this.message.rps_fractional=H}recordEpsMetric(H){this.message.eps=H}serialize(){return YV$().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}}Vw.PerRequestMetricRecorder=EMD;var ln9=30000;class MMD{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:(H)=>{let $=H.request.report_interval?(0,qCA.durationToMs)((0,qCA.durationMessageToDuration)(H.request.report_interval)):ln9,A=setInterval(()=>{H.write(this.message)},$);H.on("cancelled",()=>{clearInterval(A)})}}}putUtilizationMetric(H,$){if(!this.message.utilization)this.message.utilization={};this.message.utilization[H]=$}setAllUtilizationMetrics(H){this.message.utilization=Object.assign({},H)}deleteUtilizationMetric(H){var $;($=this.message.utilization)===null||$===void 0||delete $[H]}setCpuUtilizationMetric(H){this.message.cpu_utilization=H}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(H){this.message.application_utilization=H}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(H){this.message.rps_fractional=H}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(H){this.message.eps=H}deleteEpsMetric(){delete this.message.eps}addToServer(H){let $=YV$().xds.service.orca.v3.OpenRcaService.service;H.addService($,this.serviceImplementation)}}Vw.ServerMetricRecorder=MMD;function GMD(H){return new(YV$()).xds.service.orca.v3.OpenRcaService("unused",mn9.ChannelCredentials.createInsecure(),{channelOverride:H})}Vw.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var fMD="grpc_orca_load_report";function in9(H,$){return(A,L,I)=>{let D=I.getOpaque(fMD);if(D)H(D);else{let B=I.get(Vw.GRPC_METRICS_HEADER);if(B.length>0)D=YV$().xds.data.orca.v3.OrcaLoadReport.deserialize(B[0]),H(D),I.setOpaque(fMD,D)}if($)$(A,L,I)}}var UMD="orca_oob_metrics";class XMD{constructor(H,$){this.metricsListener=H,this.intervalMs=$,this.dataProducer=null}setSubchannel(H){let $=H.getOrCreateDataProducer(UMD,nn9);this.dataProducer=$,$.addDataWatcher(this)}destroy(){var H;(H=this.dataProducer)===null||H===void 0||H.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(H){this.metricsListener(H)}}class JMD{constructor(H){this.subchannel=H,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new dn9.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let $=H.getChannel();this.client=GMD($),H.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(H){this.dataWatchers.add(H),this.updateMetricsSubscription()}removeDataWatcher(H){var $;if(this.dataWatchers.delete(H),this.dataWatchers.size===0)this.subchannel.removeDataProducer(UMD),($=this.metricsCall)===null||$===void 0||$.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener);else this.updateMetricsSubscription()}updateMetricsSubscription(){var H;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==cn9.ConnectivityState.READY)return;let $=Math.min(...Array.from(this.dataWatchers).map((A)=>A.getInterval()));if(!this.metricsCall||$!==this.currentInterval){(H=this.metricsCall)===null||H===void 0||H.cancel(),this.currentInterval=$;let A=this.client.streamCoreMetrics({report_interval:(0,qCA.msToDuration)($)});this.metricsCall=A,A.on("data",(L)=>{this.dataWatchers.forEach((I)=>{I.onMetricsUpdate(L)})}),A.on("error",(L)=>{if(this.metricsCall=null,L.code===DMD.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}if(L.code===DMD.Status.CANCELLED)return;this.backoffTimer.runOnce()})}}}class FMD extends pn9.BaseSubchannelWrapper{constructor(H,$,A){super(H);this.addDataWatcher(new XMD($,A))}getWrappedSubchannel(){return this.child}}Vw.OrcaOobMetricsSubchannelWrapper=FMD;function nn9(H){return new JMD(H)}});var OCA=z(($z)=>{Object.defineProperty($z,"__esModule",{value:!0});$z.BaseServerInterceptingCall=$z.ServerInterceptingCall=$z.ResponderBuilder=$z.ServerListenerBuilder=void 0;$z.isInterceptingServerListener=on9;$z.getServerInterceptingCall=$r9;var qV$=rQ(),lY=B8(),E7H=require("http2"),KMD=r6$(),QMD=require("zlib"),rn9=fCA(),YMD=qG(),an9=require("tls"),WMD=CV$(),CMD="server_call";function y0H(H){YMD.trace(lY.LogVerbosity.DEBUG,CMD,H)}class wMD{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(H){return this.metadata=H,this}withOnReceiveMessage(H){return this.message=H,this}withOnReceiveHalfClose(H){return this.halfClose=H,this}withOnCancel(H){return this.cancel=H,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}}$z.ServerListenerBuilder=wMD;function on9(H){return H.onReceiveMetadata!==void 0&&H.onReceiveMetadata.length===1}class ZMD{constructor(H,$){this.listener=H,this.nextListener=$,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){if(this.hasPendingMessage)this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1}processPendingHalfClose(){if(this.hasPendingHalfClose)this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1}onReceiveMetadata(H){if(this.cancelled)return;this.processingMetadata=!0,this.listener.onReceiveMetadata(H,($)=>{if(this.processingMetadata=!1,this.cancelled)return;this.nextListener.onReceiveMetadata($),this.processPendingMessage(),this.processPendingHalfClose()})}onReceiveMessage(H){if(this.cancelled)return;this.processingMessage=!0,this.listener.onReceiveMessage(H,($)=>{if(this.processingMessage=!1,this.cancelled)return;if(this.processingMetadata)this.pendingMessage=$,this.hasPendingMessage=!0;else this.nextListener.onReceiveMessage($),this.processPendingHalfClose()})}onReceiveHalfClose(){if(this.cancelled)return;this.listener.onReceiveHalfClose(()=>{if(this.cancelled)return;if(this.processingMetadata||this.processingMessage)this.hasPendingHalfClose=!0;else this.nextListener.onReceiveHalfClose()})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}}class qMD{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(H){return this.start=H,this}withSendMetadata(H){return this.metadata=H,this}withSendMessage(H){return this.message=H,this}withSendStatus(H){return this.status=H,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}}$z.ResponderBuilder=qMD;var wV$={onReceiveMetadata:(H,$)=>{$(H)},onReceiveMessage:(H,$)=>{$(H)},onReceiveHalfClose:(H)=>{H()},onCancel:()=>{}},ZV$={start:(H)=>{H()},sendMetadata:(H,$)=>{$(H)},sendMessage:(H,$)=>{$(H)},sendStatus:(H,$)=>{$(H)}};class TMD{constructor(H,$){var A,L,I,D;this.nextCall=H,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(A=$===null||$===void 0?void 0:$.start)!==null&&A!==void 0?A:ZV$.start,sendMetadata:(L=$===null||$===void 0?void 0:$.sendMetadata)!==null&&L!==void 0?L:ZV$.sendMetadata,sendMessage:(I=$===null||$===void 0?void 0:$.sendMessage)!==null&&I!==void 0?I:ZV$.sendMessage,sendStatus:(D=$===null||$===void 0?void 0:$.sendStatus)!==null&&D!==void 0?D:ZV$.sendStatus}}processPendingMessage(){if(this.pendingMessageCallback)this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null}processPendingStatus(){if(this.pendingStatus)this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null}start(H){this.responder.start(($)=>{var A,L,I,D;let B={onReceiveMetadata:(A=$===null||$===void 0?void 0:$.onReceiveMetadata)!==null&&A!==void 0?A:wV$.onReceiveMetadata,onReceiveMessage:(L=$===null||$===void 0?void 0:$.onReceiveMessage)!==null&&L!==void 0?L:wV$.onReceiveMessage,onReceiveHalfClose:(I=$===null||$===void 0?void 0:$.onReceiveHalfClose)!==null&&I!==void 0?I:wV$.onReceiveHalfClose,onCancel:(D=$===null||$===void 0?void 0:$.onCancel)!==null&&D!==void 0?D:wV$.onCancel},f=new ZMD(B,H);this.nextCall.start(f)})}sendMetadata(H){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(H,($)=>{this.processingMetadata=!1,this.nextCall.sendMetadata($),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(H,$){if(this.processingMessage=!0,!this.sentMetadata)this.sendMetadata(new qV$.Metadata);this.responder.sendMessage(H,(A)=>{if(this.processingMessage=!1,this.processingMetadata)this.pendingMessage=A,this.pendingMessageCallback=$;else this.nextCall.sendMessage(A,$)})}sendStatus(H){this.responder.sendStatus(H,($)=>{if(this.processingMetadata||this.processingMessage)this.pendingStatus=$;else this.nextCall.sendStatus($)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}}$z.ServerInterceptingCall=TMD;var zMD="grpc-accept-encoding",zCA="grpc-encoding",VMD="grpc-message",PMD="grpc-status",TCA="grpc-timeout",tn9=/(\d{1,8})\s*([HMSmun])/,sn9={H:3600000,M:60000,S:1000,m:1,u:0.001,n:0.000001},en9={[zMD]:"identity,deflate,gzip",[zCA]:"identity"},_MD={[E7H.constants.HTTP2_HEADER_STATUS]:E7H.constants.HTTP_STATUS_OK,[E7H.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},Hr9={waitForTrailers:!0};class NCA{constructor(H,$,A,L,I){var D,B;if(this.stream=H,this.callEventTracker=A,this.handler=L,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=lY.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=lY.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new WMD.PerRequestMetricRecorder,this.stream.once("error",(U)=>{}),this.stream.once("close",()=>{var U;if(y0H("Request to method "+((U=this.handler)===null||U===void 0?void 0:U.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:lY.Status.CANCELLED,details:"Stream closed before sending status",metadata:null});this.notifyOnCancel()}),this.stream.on("data",(U)=>{this.handleDataFrame(U)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in I)this.maxSendMessageSize=I["grpc.max_send_message_length"];if("grpc.max_receive_message_length"in I)this.maxReceiveMessageSize=I["grpc.max_receive_message_length"];this.host=(D=$[":authority"])!==null&&D!==void 0?D:$.host,this.decoder=new rn9.StreamDecoder(this.maxReceiveMessageSize);let f=qV$.Metadata.fromHttp2Headers($);if(YMD.isTracerEnabled(CMD))y0H("Request to "+this.handler.path+" received headers "+JSON.stringify(f.toJSON()));let E=f.get(TCA);if(E.length>0)this.handleTimeoutHeader(E[0]);let M=f.get(zCA);if(M.length>0)this.incomingEncoding=M[0];f.remove(TCA),f.remove(zCA),f.remove(zMD),f.remove(E7H.constants.HTTP2_HEADER_ACCEPT_ENCODING),f.remove(E7H.constants.HTTP2_HEADER_TE),f.remove(E7H.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=f;let G=(B=H.session)===null||B===void 0?void 0:B.socket;this.connectionInfo={localAddress:G===null||G===void 0?void 0:G.localAddress,localPort:G===null||G===void 0?void 0:G.localPort,remoteAddress:G===null||G===void 0?void 0:G.remoteAddress,remotePort:G===null||G===void 0?void 0:G.remotePort},this.shouldSendMetrics=!!I["grpc.server_call_metric_recording"]}handleTimeoutHeader(H){let $=H.toString().match(tn9);if($===null){let I={code:lY.Status.INTERNAL,details:`Invalid ${TCA} value "${H}"`,metadata:null};process.nextTick(()=>{this.sendStatus(I)});return}let A=+$[1]*sn9[$[2]]|0,L=new Date;this.deadline=L.setMilliseconds(L.getMilliseconds()+A),this.deadlineTimer=setTimeout(()=>{let I={code:lY.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(I)},A)}checkCancelled(){if(!this.cancelled&&(this.stream.destroyed||this.stream.closed))this.notifyOnCancel(),this.cancelled=!0;return this.cancelled}notifyOnCancel(){if(this.cancelNotified)return;if(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var H;(H=this.listener)===null||H===void 0||H.onCancel()}),this.deadlineTimer)clearTimeout(this.deadlineTimer);this.stream.resume()}maybeSendMetadata(){if(!this.metadataSent)this.sendMetadata(new qV$.Metadata)}serializeMessage(H){let $=this.handler.serialize(H),A=$.byteLength,L=Buffer.allocUnsafe(A+5);return L.writeUInt8(0,0),L.writeUInt32BE(A,1),$.copy(L,5),L}decompressMessage(H,$){let A=H.subarray(5);if($==="identity")return A;else if($==="deflate"||$==="gzip"){let L;if($==="deflate")L=QMD.createInflate();else L=QMD.createGunzip();return new Promise((I,D)=>{let B=0,f=[];L.on("data",(E)=>{if(f.push(E),B+=E.byteLength,this.maxReceiveMessageSize!==-1&&B>this.maxReceiveMessageSize)L.destroy(),D({code:lY.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`})}),L.on("end",()=>{I(Buffer.concat(f))}),L.write(A),L.end()})}else return Promise.reject({code:lY.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${$}"`})}async decompressAndMaybePush(H){if(H.type!=="COMPRESSED")throw Error(`Invalid queue entry type: ${H.type}`);let A=H.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",L;try{L=await this.decompressMessage(H.compressedMessage,A)}catch(I){this.sendStatus(I);return}try{H.parsedMessage=this.handler.deserialize(L)}catch(I){this.sendStatus({code:lY.Status.INTERNAL,details:`Error deserializing request: ${I.message}`});return}H.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let H=this.readQueue.shift();if(H.type==="READABLE")this.listener.onReceiveMessage(H.parsedMessage);else this.listener.onReceiveHalfClose()}}handleDataFrame(H){var $;if(this.checkCancelled())return;y0H("Request to "+this.handler.path+" received data frame of size "+H.length);let A;try{A=this.decoder.write(H)}catch(L){this.sendStatus({code:lY.Status.RESOURCE_EXHAUSTED,details:L.message});return}for(let L of A){this.stream.pause();let I={type:"COMPRESSED",compressedMessage:L,parsedMessage:null};this.readQueue.push(I),this.decompressAndMaybePush(I),($=this.callEventTracker)===null||$===void 0||$.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(H){if(y0H("Request to "+this.handler.path+" start called"),this.checkCancelled())return;this.listener=H,H.onReceiveMetadata(this.metadata)}sendMetadata(H){if(this.checkCancelled())return;if(this.metadataSent)return;this.metadataSent=!0;let $=H?H.toHttp2Headers():null,A=Object.assign(Object.assign(Object.assign({},_MD),en9),$);this.stream.respond(A,Hr9)}sendMessage(H,$){if(this.checkCancelled())return;let A;try{A=this.serializeMessage(H)}catch(L){this.sendStatus({code:lY.Status.INTERNAL,details:`Error serializing response: ${(0,KMD.getErrorMessage)(L)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&A.length-5>this.maxSendMessageSize){this.sendStatus({code:lY.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${A.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),y0H("Request to "+this.handler.path+" sent data frame of size "+A.length),this.stream.write(A,(L)=>{var I;if(L){this.sendStatus({code:lY.Status.INTERNAL,details:`Error writing message: ${(0,KMD.getErrorMessage)(L)}`,metadata:null});return}(I=this.callEventTracker)===null||I===void 0||I.addMessageSent(),$()})}sendStatus(H){var $,A,L;if(this.checkCancelled())return;y0H("Request to method "+(($=this.handler)===null||$===void 0?void 0:$.path)+" ended with status code: "+lY.Status[H.code]+" details: "+H.details);let I=(L=(A=H.metadata)===null||A===void 0?void 0:A.clone())!==null&&L!==void 0?L:new qV$.Metadata;if(this.shouldSendMetrics)I.set(WMD.GRPC_METRICS_HEADER,this.metricsRecorder.serialize());if(this.metadataSent)if(!this.wantTrailers)this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(H);let D=Object.assign({[PMD]:H.code,[VMD]:encodeURI(H.details)},I.toHttp2Headers());this.stream.sendTrailers(D),this.notifyOnCancel()}),this.stream.end();else this.notifyOnCancel();else{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(H);let D=Object.assign(Object.assign({[PMD]:H.code,[VMD]:encodeURI(H.details)},_MD),I.toHttp2Headers());this.stream.respond(D,{endStream:!0}),this.notifyOnCancel()}}startRead(){if(y0H("Request to "+this.handler.path+" startRead called"),this.checkCancelled())return;if(this.isReadPending=!0,this.readQueue.length===0){if(!this.receivedHalfClose)this.stream.resume()}else this.maybePushNextMessage()}getPeer(){var H;let $=(H=this.stream.session)===null||H===void 0?void 0:H.socket;if($===null||$===void 0?void 0:$.remoteAddress)if($.remotePort)return`${$.remoteAddress}:${$.remotePort}`;else return $.remoteAddress;else return"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var H;if(((H=this.stream.session)===null||H===void 0?void 0:H.socket)instanceof an9.TLSSocket){let $=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:$.raw?$:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}}$z.BaseServerInterceptingCall=NCA;function $r9(H,$,A,L,I,D){let B={path:I.path,requestStream:I.type==="clientStream"||I.type==="bidi",responseStream:I.type==="serverStream"||I.type==="bidi",requestDeserialize:I.deserialize,responseSerialize:I.serialize},f=new NCA($,A,L,I,D);return H.reduce((E,M)=>{return M(B,E)},f)}});var yMD=z((mo)=>{var Ar9=mo&&mo.__runInitializers||function(H,$,A){var L=arguments.length>2;for(var I=0;I<$.length;I++)A=L?$[I].call(H,A):$[I].call(H);return L?A:void 0},Lr9=mo&&mo.__esDecorate||function(H,$,A,L,I,D){function B(P){if(P!==void 0&&typeof P!=="function")throw TypeError("Function expected");return P}var f=L.kind,E=f==="getter"?"get":f==="setter"?"set":"value",M=!$&&H?L.static?H:H.prototype:null,G=$||(M?Object.getOwnPropertyDescriptor(M,L.name):{}),U,X=!1;for(var J=A.length-1;J>=0;J--){var F={};for(var Q in L)F[Q]=Q==="access"?{}:L[Q];for(var Q in L.access)F.access[Q]=L.access[Q];F.addInitializer=function(P){if(X)throw TypeError("Cannot add initializers after decoration has completed");D.push(B(P||null))};var W=(0,A[J])(f==="accessor"?{get:G.get,set:G.set}:G[E],F);if(f==="accessor"){if(W===void 0)continue;if(W===null||typeof W!=="object")throw TypeError("Object expected");if(U=B(W.get))G.get=U;if(U=B(W.set))G.set=U;if(U=B(W.init))I.unshift(U)}else if(U=B(W))if(f==="field")I.unshift(U);else G[E]=U}if(M)Object.defineProperty(M,L.name,G);X=!0};Object.defineProperty(mo,"__esModule",{value:!0});mo.Server=void 0;var iY=require("http2"),Ir9=require("util"),CJ=B8(),U7H=IMD(),xCA=_V$(),NMD=BS(),G7H=qG(),go=cY(),QS=OP(),OK=ho(),OMD=OCA(),M7H=2147483647,SCA=2147483647,Dr9=20000,xMD=2147483647,{HTTP2_HEADER_PATH:SMD}=iY.constants,Br9="server",jMD=Buffer.from("max_age");function RMD(H){G7H.trace(CJ.LogVerbosity.DEBUG,"server_call",H)}function fr9(){}function Er9(H){return function($,A){return Ir9.deprecate($,H)}}function jCA(H){return{code:CJ.Status.UNIMPLEMENTED,details:`The server does not implement the method ${H}`}}function Mr9(H,$){let A=jCA($);switch(H){case"unary":return(L,I)=>{I(A,null)};case"clientStream":return(L,I)=>{I(A,null)};case"serverStream":return(L)=>{L.emit("error",A)};case"bidi":return(L)=>{L.emit("error",A)};default:throw Error(`Invalid handlerType ${H}`)}}var Gr9=(()=>{var H;let $=[],A;return H=class{constructor(I){var D,B,f,E,M,G;if(this.boundPorts=(Ar9(this,$),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=I!==null&&I!==void 0?I:{},this.options["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new OK.ChannelzTraceStub,this.callTracker=new OK.ChannelzCallTrackerStub,this.listenerChildrenTracker=new OK.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new OK.ChannelzChildrenTrackerStub;else this.channelzTrace=new OK.ChannelzTrace,this.callTracker=new OK.ChannelzCallTracker,this.listenerChildrenTracker=new OK.ChannelzChildrenTracker,this.sessionChildrenTracker=new OK.ChannelzChildrenTracker;if(this.channelzRef=(0,OK.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(D=this.options["grpc.max_connection_age_ms"])!==null&&D!==void 0?D:M7H,this.maxConnectionAgeGraceMs=(B=this.options["grpc.max_connection_age_grace_ms"])!==null&&B!==void 0?B:M7H,this.keepaliveTimeMs=(f=this.options["grpc.keepalive_time_ms"])!==null&&f!==void 0?f:SCA,this.keepaliveTimeoutMs=(E=this.options["grpc.keepalive_timeout_ms"])!==null&&E!==void 0?E:Dr9,this.sessionIdleTimeout=(M=this.options["grpc.max_connection_idle_ms"])!==null&&M!==void 0?M:xMD,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options)this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"];else this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER;if("grpc.max_concurrent_streams"in this.options)this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]};this.interceptors=(G=this.options.interceptors)!==null&&G!==void 0?G:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(I){var D,B,f;let E=this.sessions.get(I),M=I.socket,G=M.remoteAddress?(0,go.stringToSubchannelAddress)(M.remoteAddress,M.remotePort):null,U=M.localAddress?(0,go.stringToSubchannelAddress)(M.localAddress,M.localPort):null,X;if(I.encrypted){let F=M,Q=F.getCipher(),W=F.getCertificate(),P=F.getPeerCertificate();X={cipherSuiteStandardName:(D=Q.standardName)!==null&&D!==void 0?D:null,cipherSuiteOtherName:Q.standardName?null:Q.name,localCertificate:W&&"raw"in W?W.raw:null,remoteCertificate:P&&"raw"in P?P.raw:null}}else X=null;return{remoteAddress:G,localAddress:U,security:X,remoteName:null,streamsStarted:E.streamTracker.callsStarted,streamsSucceeded:E.streamTracker.callsSucceeded,streamsFailed:E.streamTracker.callsFailed,messagesSent:E.messagesSent,messagesReceived:E.messagesReceived,keepAlivesSent:E.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:E.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:E.lastMessageSentTimestamp,lastMessageReceivedTimestamp:E.lastMessageReceivedTimestamp,localFlowControlWindow:(B=I.state.localWindowSize)!==null&&B!==void 0?B:null,remoteFlowControlWindow:(f=I.state.remoteWindowSize)!==null&&f!==void 0?f:null}}trace(I){G7H.trace(CJ.LogVerbosity.DEBUG,Br9,"("+this.channelzRef.id+") "+I)}keepaliveTrace(I){G7H.trace(CJ.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+I)}addProtoService(){throw Error("Not implemented. Use addService() instead")}addService(I,D){if(I===null||typeof I!=="object"||D===null||typeof D!=="object")throw Error("addService() requires two objects as arguments");let B=Object.keys(I);if(B.length===0)throw Error("Cannot add an empty service to a server");B.forEach((f)=>{let E=I[f],M;if(E.requestStream)if(E.responseStream)M="bidi";else M="clientStream";else if(E.responseStream)M="serverStream";else M="unary";let G=D[f],U;if(G===void 0&&typeof E.originalName==="string")G=D[E.originalName];if(G!==void 0)U=G.bind(D);else U=Mr9(M,f);if(this.register(E.path,U,E.responseSerialize,E.requestDeserialize,M)===!1)throw Error(`Method handler for ${E.path} already provided.`)})}removeService(I){if(I===null||typeof I!=="object")throw Error("removeService() requires object as argument");Object.keys(I).forEach((B)=>{let f=I[B];this.unregister(f.path)})}bind(I,D){throw Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(I){return(0,OK.registerChannelzSocket)((0,go.subchannelAddressToString)(I),()=>{return{localAddress:I,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}},this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(I){(0,OK.unregisterChannelzRef)(I)}createHttp2Server(I){let D;if(I._isSecure()){let B=I._getConstructorOptions(),f=I._getSecureContextOptions(),E=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),B),f),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),M=f!==null;this.trace("Initial credentials valid: "+M),D=iY.createSecureServer(E),D.prependListener("connection",(U)=>{if(!M)this.trace("Dropped connection from "+JSON.stringify(U.address())+" due to unloaded credentials"),U.destroy()}),D.on("secureConnection",(U)=>{U.on("error",(X)=>{this.trace("An incoming TLS connection closed with error: "+X.message)})});let G=(U)=>{if(U){let X=D;try{X.setSecureContext(U)}catch(J){G7H.log(CJ.LogVerbosity.ERROR,"Failed to set secure context with error "+J.message),U=null}}M=U!==null,this.trace("Post-update credentials valid: "+M)};I._addWatcher(G),D.on("close",()=>{I._removeWatcher(G)})}else D=iY.createServer(this.commonServerOptions);return D.setTimeout(0,fr9),this._setupHandlers(D,I._getInterceptors()),D}bindOneAddress(I,D){this.trace("Attempting to bind "+(0,go.subchannelAddressToString)(I));let B=this.createHttp2Server(D.credentials);return new Promise((f,E)=>{let M=(G)=>{this.trace("Failed to bind "+(0,go.subchannelAddressToString)(I)+" with error "+G.message),f({port:"port"in I?I.port:1,error:G.message})};B.once("error",M),B.listen(I,()=>{let G=B.address(),U;if(typeof G==="string")U={path:G};else U={host:G.address,port:G.port};let X=this.experimentalRegisterListenerToChannelz(U);this.listenerChildrenTracker.refChild(X),this.http2Servers.set(B,{channelzRef:X,sessions:new Set,ownsChannelzRef:!0}),D.listeningServers.add(B),this.trace("Successfully bound "+(0,go.subchannelAddressToString)(U)),f({port:"port"in U?U.port:1}),B.removeListener("error",M)})})}async bindManyPorts(I,D){if(I.length===0)return{count:0,port:0,errors:[]};if((0,go.isTcpSubchannelAddress)(I[0])&&I[0].port===0){let B=await this.bindOneAddress(I[0],D);if(B.error){let f=await this.bindManyPorts(I.slice(1),D);return Object.assign(Object.assign({},f),{errors:[B.error,...f.errors]})}else{let f=I.slice(1).map((G)=>(0,go.isTcpSubchannelAddress)(G)?{host:G.host,port:B.port}:G),E=await Promise.all(f.map((G)=>this.bindOneAddress(G,D))),M=[B,...E];return{count:M.filter((G)=>G.error===void 0).length,port:B.port,errors:M.filter((G)=>G.error).map((G)=>G.error)}}}else{let B=await Promise.all(I.map((f)=>this.bindOneAddress(f,D)));return{count:B.filter((f)=>f.error===void 0).length,port:B[0].port,errors:B.filter((f)=>f.error).map((f)=>f.error)}}}async bindAddressList(I,D){let B=await this.bindManyPorts(I,D);if(B.count>0){if(B.count{let f=!1,E=(G,U,X,J)=>{if(f)return!0;if(f=!0,!G.ok)return B(Error(G.error.details)),!0;let F=[].concat(...G.value.map((Q)=>Q.addresses));if(F.length===0)return B(Error(`No addresses resolved for port ${I}`)),!0;return D(F),!0};(0,NMD.createResolver)(I,E,this.options).updateResolution()})}async bindPort(I,D){let B=await this.resolvePort(I);if(D.cancelled)throw this.completeUnbind(D),Error("bindAsync operation cancelled by unbind call");let f=await this.bindAddressList(B,D);if(D.cancelled)throw this.completeUnbind(D),Error("bindAsync operation cancelled by unbind call");return f}normalizePort(I){let D=(0,QS.parseUri)(I);if(D===null)throw Error(`Could not parse port "${I}"`);let B=(0,NMD.mapUriDefaultScheme)(D);if(B===null)throw Error(`Could not get a default scheme for port "${I}"`);return B}bindAsync(I,D,B){if(this.shutdown)throw Error("bindAsync called after shutdown");if(typeof I!=="string")throw TypeError("port must be a string");if(D===null||!(D instanceof xCA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(typeof B!=="function")throw TypeError("callback must be a function");this.trace("bindAsync port="+I);let f=this.normalizePort(I),E=(X,J)=>{process.nextTick(()=>B(X,J))},M=this.boundPorts.get((0,QS.uriToString)(f));if(M){if(!D._equals(M.credentials)){E(Error(`${I} already bound with incompatible credentials`),0);return}if(M.cancelled=!1,M.completionPromise)M.completionPromise.then((X)=>B(null,X),(X)=>B(X,0));else E(null,M.portNumber);return}M={mapKey:(0,QS.uriToString)(f),originalUri:f,completionPromise:null,cancelled:!1,portNumber:0,credentials:D,listeningServers:new Set};let G=(0,QS.splitHostPort)(f.path),U=this.bindPort(f,M);if(M.completionPromise=U,(G===null||G===void 0?void 0:G.port)===0)U.then((X)=>{let J={scheme:f.scheme,authority:f.authority,path:(0,QS.combineHostPort)({host:G.host,port:X})};M.mapKey=(0,QS.uriToString)(J),M.completionPromise=null,M.portNumber=X,this.boundPorts.set(M.mapKey,M),B(null,X)},(X)=>{B(X,0)});else this.boundPorts.set(M.mapKey,M),U.then((X)=>{M.completionPromise=null,M.portNumber=X,B(null,X)},(X)=>{B(X,0)})}registerInjectorToChannelz(){return(0,OK.registerChannelzSocket)("injector",()=>{return{localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}},this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(I,D,B=!1){if(I===null||!(I instanceof xCA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(this.channelzEnabled)this.listenerChildrenTracker.refChild(D);let f=this.createHttp2Server(I),E=new Set;return this.http2Servers.set(f,{channelzRef:D,sessions:E,ownsChannelzRef:B}),{injectConnection:(M)=>{f.emit("connection",M)},drain:(M)=>{var G,U;for(let X of E)this.closeSession(X);(U=(G=setTimeout(()=>{for(let X of E)X.destroy(iY.constants.NGHTTP2_CANCEL)},M)).unref)===null||U===void 0||U.call(G)},destroy:()=>{this.closeServer(f);for(let M of E)this.closeSession(M)}}}createConnectionInjector(I){if(I===null||!(I instanceof xCA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");let D=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(I,D,!0)}closeServer(I,D){this.trace("Closing server with address "+JSON.stringify(I.address()));let B=this.http2Servers.get(I);I.close(()=>{if(B&&B.ownsChannelzRef)this.listenerChildrenTracker.unrefChild(B.channelzRef),(0,OK.unregisterChannelzRef)(B.channelzRef);this.http2Servers.delete(I),D===null||D===void 0||D()})}closeSession(I,D){var B;this.trace("Closing session initiated by "+((B=I.socket)===null||B===void 0?void 0:B.remoteAddress));let f=this.sessions.get(I),E=()=>{if(f)this.sessionChildrenTracker.unrefChild(f.ref),(0,OK.unregisterChannelzRef)(f.ref);D===null||D===void 0||D()};if(I.closed)queueMicrotask(E);else I.close(E)}completeUnbind(I){for(let D of I.listeningServers){let B=this.http2Servers.get(D);if(this.closeServer(D,()=>{I.listeningServers.delete(D)}),B)for(let f of B.sessions)this.closeSession(f)}this.boundPorts.delete(I.mapKey)}unbind(I){this.trace("unbind port="+I);let D=this.normalizePort(I),B=(0,QS.splitHostPort)(D.path);if((B===null||B===void 0?void 0:B.port)===0)throw Error("Cannot unbind port 0");let f=this.boundPorts.get((0,QS.uriToString)(D));if(f)if(this.trace("unbinding "+f.mapKey+" originally bound as "+(0,QS.uriToString)(f.originalUri)),f.completionPromise)f.cancelled=!0;else this.completeUnbind(f)}drain(I,D){var B,f;this.trace("drain port="+I+" graceTimeMs="+D);let E=this.normalizePort(I),M=(0,QS.splitHostPort)(E.path);if((M===null||M===void 0?void 0:M.port)===0)throw Error("Cannot drain port 0");let G=this.boundPorts.get((0,QS.uriToString)(E));if(!G)return;let U=new Set;for(let X of G.listeningServers){let J=this.http2Servers.get(X);if(J)for(let F of J.sessions)U.add(F),this.closeSession(F,()=>{U.delete(F)})}(f=(B=setTimeout(()=>{for(let X of U)X.destroy(iY.constants.NGHTTP2_CANCEL)},D)).unref)===null||f===void 0||f.call(B)}forceShutdown(){for(let I of this.boundPorts.values())I.cancelled=!0;this.boundPorts.clear();for(let I of this.http2Servers.keys())this.closeServer(I);this.sessions.forEach((I,D)=>{this.closeSession(D),D.destroy(iY.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,OK.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(I,D,B,f,E){if(this.handlers.has(I))return!1;return this.handlers.set(I,{func:D,serialize:B,deserialize:f,type:E,path:I}),!0}unregister(I){return this.handlers.delete(I)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every((I)=>!I.listening))throw Error("server must be bound in order to start");if(this.started===!0)throw Error("server is already started");this.started=!0}tryShutdown(I){var D;let B=(M)=>{(0,OK.unregisterChannelzRef)(this.channelzRef),I(M)},f=0;function E(){if(f--,f===0)B()}this.shutdown=!0;for(let[M,G]of this.http2Servers.entries()){f++;let U=G.channelzRef.name;this.trace("Waiting for server "+U+" to close"),this.closeServer(M,()=>{this.trace("Server "+U+" finished closing"),E()});for(let X of G.sessions.keys()){f++;let J=(D=X.socket)===null||D===void 0?void 0:D.remoteAddress;this.trace("Waiting for session "+J+" to close"),this.closeSession(X,()=>{this.trace("Session "+J+" finished closing"),E()})}}if(f===0)B()}addHttp2Port(){throw Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(I,D){let B=D[iY.constants.HTTP2_HEADER_CONTENT_TYPE];if(typeof B!=="string"||!B.startsWith("application/grpc"))return I.respond({[iY.constants.HTTP2_HEADER_STATUS]:iY.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1;return!0}_retrieveHandler(I){RMD("Received call to method "+I+" at address "+this.serverAddressString);let D=this.handlers.get(I);if(D===void 0)return RMD("No handler registered for method "+I+". Sending UNIMPLEMENTED status."),null;return D}_respondWithError(I,D,B=null){var f,E;let M=Object.assign({"grpc-status":(f=I.code)!==null&&f!==void 0?f:CJ.Status.INTERNAL,"grpc-message":I.details,[iY.constants.HTTP2_HEADER_STATUS]:iY.constants.HTTP_STATUS_OK,[iY.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(E=I.metadata)===null||E===void 0?void 0:E.toHttp2Headers());D.respond(M,{endStream:!0}),this.callTracker.addCallFailed(),B===null||B===void 0||B.streamTracker.addCallFailed()}_channelzHandler(I,D,B){this.onStreamOpened(D);let f=this.sessions.get(D.session);if(this.callTracker.addCallStarted(),f===null||f===void 0||f.streamTracker.addCallStarted(),!this._verifyContentType(D,B)){this.callTracker.addCallFailed(),f===null||f===void 0||f.streamTracker.addCallFailed();return}let E=B[SMD],M=this._retrieveHandler(E);if(!M){this._respondWithError(jCA(E),D,f);return}let G={addMessageSent:()=>{if(f)f.messagesSent+=1,f.lastMessageSentTimestamp=new Date},addMessageReceived:()=>{if(f)f.messagesReceived+=1,f.lastMessageReceivedTimestamp=new Date},onCallEnd:(X)=>{if(X.code===CJ.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()},onStreamEnd:(X)=>{if(f)if(X)f.streamTracker.addCallSucceeded();else f.streamTracker.addCallFailed()}},U=(0,OMD.getServerInterceptingCall)([...I,...this.interceptors],D,B,G,M,this.options);if(!this._runHandlerForCall(U,M))this.callTracker.addCallFailed(),f===null||f===void 0||f.streamTracker.addCallFailed(),U.sendStatus({code:CJ.Status.INTERNAL,details:`Unknown handler type: ${M.type}`})}_streamHandler(I,D,B){if(this.onStreamOpened(D),this._verifyContentType(D,B)!==!0)return;let f=B[SMD],E=this._retrieveHandler(f);if(!E){this._respondWithError(jCA(f),D,null);return}let M=(0,OMD.getServerInterceptingCall)([...I,...this.interceptors],D,B,null,E,this.options);if(!this._runHandlerForCall(M,E))M.sendStatus({code:CJ.Status.INTERNAL,details:`Unknown handler type: ${E.type}`})}_runHandlerForCall(I,D){let{type:B}=D;if(B==="unary")Ur9(I,D);else if(B==="clientStream")Xr9(I,D);else if(B==="serverStream")Jr9(I,D);else if(B==="bidi")Fr9(I,D);else return!1;return!0}_setupHandlers(I,D){if(I===null)return;let B=I.address(),f="null";if(B)if(typeof B==="string")f=B;else f=B.address+":"+B.port;this.serverAddressString=f;let E=this.channelzEnabled?this._channelzHandler:this._streamHandler,M=this.channelzEnabled?this._channelzSessionHandler(I):this._sessionHandler(I);I.on("stream",E.bind(this,D)),I.on("session",M)}_sessionHandler(I){return(D)=>{var B,f;(B=this.http2Servers.get(I))===null||B===void 0||B.sessions.add(D);let E=null,M=null,G=null,U=!1,X=this.enableIdleTimeout(D);if(this.maxConnectionAgeMs!==M7H){let P=this.maxConnectionAgeMs/10,C=Math.random()*P*2-P;E=setTimeout(()=>{var Y,Z;U=!0,this.trace("Connection dropped by max connection age: "+((Y=D.socket)===null||Y===void 0?void 0:Y.remoteAddress));try{D.goaway(iY.constants.NGHTTP2_NO_ERROR,2147483647,jMD)}catch(q){D.destroy();return}if(D.close(),this.maxConnectionAgeGraceMs!==M7H)M=setTimeout(()=>{D.destroy()},this.maxConnectionAgeGraceMs),(Z=M.unref)===null||Z===void 0||Z.call(M)},this.maxConnectionAgeMs+C),(f=E.unref)===null||f===void 0||f.call(E)}let J=()=>{if(G)clearTimeout(G),G=null},F=()=>{return!D.destroyed&&this.keepaliveTimeMs0},Q,W=()=>{var P;if(!F())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),G=setTimeout(()=>{J(),Q()},this.keepaliveTimeMs),(P=G.unref)===null||P===void 0||P.call(G)};Q=()=>{var P;if(!F())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let C="";try{if(!D.ping((Z,q,O)=>{if(J(),Z)this.keepaliveTrace("Ping failed with error: "+Z.message),U=!0,D.close();else this.keepaliveTrace("Received ping response"),W()}))C="Ping returned false"}catch(Y){C=(Y instanceof Error?Y.message:"")||"Unknown error"}if(C){this.keepaliveTrace("Ping send failed: "+C),this.trace("Connection dropped due to ping send error: "+C),U=!0,D.close();return}G=setTimeout(()=>{J(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),U=!0,D.close()},this.keepaliveTimeoutMs),(P=G.unref)===null||P===void 0||P.call(G)},W(),D.on("close",()=>{var P,C;if(!U)this.trace(`Connection dropped by client ${(P=D.socket)===null||P===void 0?void 0:P.remoteAddress}`);if(E)clearTimeout(E);if(M)clearTimeout(M);if(J(),X!==null)clearTimeout(X.timeout),this.sessionIdleTimeouts.delete(D);(C=this.http2Servers.get(I))===null||C===void 0||C.sessions.delete(D)})}}_channelzSessionHandler(I){return(D)=>{var B,f,E,M;let G=(0,OK.registerChannelzSocket)((f=(B=D.socket)===null||B===void 0?void 0:B.remoteAddress)!==null&&f!==void 0?f:"unknown",this.getChannelzSessionInfo.bind(this,D),this.channelzEnabled),U={ref:G,streamTracker:new OK.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(E=this.http2Servers.get(I))===null||E===void 0||E.sessions.add(D),this.sessions.set(D,U);let X=`${D.socket.remoteAddress}:${D.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+X),this.trace("Connection established by client "+X),this.sessionChildrenTracker.refChild(G);let J=null,F=null,Q=null,W=!1,P=this.enableIdleTimeout(D);if(this.maxConnectionAgeMs!==M7H){let O=this.maxConnectionAgeMs/10,j=Math.random()*O*2-O;J=setTimeout(()=>{var u;W=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+X);try{D.goaway(iY.constants.NGHTTP2_NO_ERROR,2147483647,jMD)}catch(y){D.destroy();return}if(D.close(),this.maxConnectionAgeGraceMs!==M7H)F=setTimeout(()=>{D.destroy()},this.maxConnectionAgeGraceMs),(u=F.unref)===null||u===void 0||u.call(F)},this.maxConnectionAgeMs+j),(M=J.unref)===null||M===void 0||M.call(J)}let C=()=>{if(Q)clearTimeout(Q),Q=null},Y=()=>{return!D.destroyed&&this.keepaliveTimeMs0},Z,q=()=>{var O;if(!Y())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),Q=setTimeout(()=>{C(),Z()},this.keepaliveTimeMs),(O=Q.unref)===null||O===void 0||O.call(Q)};Z=()=>{var O;if(!Y())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let j="";try{if(!D.ping((y,g,h)=>{if(C(),y)this.keepaliveTrace("Ping failed with error: "+y.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+y.message+" return in "+g),W=!0,D.close();else this.keepaliveTrace("Received ping response"),q()}))j="Ping returned false"}catch(u){j=(u instanceof Error?u.message:"")||"Unknown error"}if(j){this.keepaliveTrace("Ping send failed: "+j),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+j),W=!0,D.close();return}U.keepAlivesSent+=1,Q=setTimeout(()=>{C(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+X),W=!0,D.close()},this.keepaliveTimeoutMs),(O=Q.unref)===null||O===void 0||O.call(Q)},q(),D.on("close",()=>{var O;if(!W)this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+X);if(this.sessionChildrenTracker.unrefChild(G),(0,OK.unregisterChannelzRef)(G),J)clearTimeout(J);if(F)clearTimeout(F);if(C(),P!==null)clearTimeout(P.timeout),this.sessionIdleTimeouts.delete(D);(O=this.http2Servers.get(I))===null||O===void 0||O.sessions.delete(D),this.sessions.delete(D)})}}enableIdleTimeout(I){var D,B;if(this.sessionIdleTimeout>=xMD)return null;let f={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,I),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,I)};(B=(D=f.timeout).unref)===null||B===void 0||B.call(D),this.sessionIdleTimeouts.set(I,f);let{socket:E}=I;return this.trace("Enable idle timeout for "+E.remoteAddress+":"+E.remotePort),f}onIdleTimeout(I,D){let{socket:B}=D,f=I.sessionIdleTimeouts.get(D);if(f!==void 0&&f.activeStreams===0)if(Date.now()-f.lastIdle>=I.sessionIdleTimeout)I.trace("Session idle timeout triggered for "+(B===null||B===void 0?void 0:B.remoteAddress)+":"+(B===null||B===void 0?void 0:B.remotePort)+" last idle at "+f.lastIdle),I.closeSession(D);else f.timeout.refresh()}onStreamOpened(I){let D=I.session,B=this.sessionIdleTimeouts.get(D);if(B)B.activeStreams+=1,I.once("close",B.onClose)}onStreamClose(I){var D,B;let f=this.sessionIdleTimeouts.get(I);if(f){if(f.activeStreams-=1,f.activeStreams===0)f.lastIdle=Date.now(),f.timeout.refresh(),this.trace("Session onStreamClose"+((D=I.socket)===null||D===void 0?void 0:D.remoteAddress)+":"+((B=I.socket)===null||B===void 0?void 0:B.remotePort)+" at "+f.lastIdle)}}},(()=>{let L=typeof Symbol==="function"&&Symbol.metadata?Object.create(null):void 0;if(A=[Er9("Calling start() is no longer necessary. It can be safely omitted.")],Lr9(H,null,A,{kind:"method",name:"start",static:!1,private:!1,access:{has:(I)=>("start"in I),get:(I)=>I.start},metadata:L},null,$),L)Object.defineProperty(H,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:L})})(),H})();mo.Server=Gr9;async function Ur9(H,$){let A;function L(B,f,E,M){if(B){H.sendStatus((0,U7H.serverErrorToStatus)(B,E));return}H.sendMessage(f,()=>{H.sendStatus({code:CJ.Status.OK,details:"OK",metadata:E!==null&&E!==void 0?E:null})})}let I,D=null;H.start({onReceiveMetadata(B){I=B,H.startRead()},onReceiveMessage(B){if(D){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${$.path}`,metadata:null});return}D=B,H.startRead()},onReceiveHalfClose(){if(!D){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${$.path}`,metadata:null});return}A=new U7H.ServerWritableStreamImpl($.path,H,I,D);try{$.func(A,L)}catch(B){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${B.message}`,metadata:null})}},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled")}})}function Xr9(H,$){let A;function L(I,D,B,f){if(I){H.sendStatus((0,U7H.serverErrorToStatus)(I,B));return}H.sendMessage(D,()=>{H.sendStatus({code:CJ.Status.OK,details:"OK",metadata:B!==null&&B!==void 0?B:null})})}H.start({onReceiveMetadata(I){A=new U7H.ServerDuplexStreamImpl($.path,H,I);try{$.func(A,L)}catch(D){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${D.message}`,metadata:null})}},onReceiveMessage(I){A.push(I)},onReceiveHalfClose(){A.push(null)},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled"),A.destroy()}})}function Jr9(H,$){let A,L,I=null;H.start({onReceiveMetadata(D){L=D,H.startRead()},onReceiveMessage(D){if(I){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${$.path}`,metadata:null});return}I=D,H.startRead()},onReceiveHalfClose(){if(!I){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${$.path}`,metadata:null});return}A=new U7H.ServerWritableStreamImpl($.path,H,L,I);try{$.func(A)}catch(D){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${D.message}`,metadata:null})}},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled"),A.destroy()}})}function Fr9(H,$){let A;H.start({onReceiveMetadata(L){A=new U7H.ServerDuplexStreamImpl($.path,H,L);try{$.func(A)}catch(I){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${I.message}`,metadata:null})}},onReceiveMessage(L){A.push(L)},onReceiveHalfClose(){A.push(null)},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled"),A.destroy()}})}});var hMD=z((TV$)=>{Object.defineProperty(TV$,"__esModule",{value:!0});TV$.StatusBuilder=void 0;class vMD{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(H){return this.code=H,this}withDetails(H){return this.details=H,this}withMetadata(H){return this.metadata=H,this}build(){let H={};if(this.code!==null)H.code=this.code;if(this.details!==null)H.details=this.details;if(this.metadata!==null)H.metadata=this.metadata;return H}}TV$.StatusBuilder=vMD});var mhH=z((Zh)=>{Object.defineProperty(Zh,"__esModule",{value:!0});Zh.LeafLoadBalancer=Zh.PickFirstLoadBalancer=Zh.PickFirstLoadBalancingConfig=void 0;Zh.shuffled=mMD;Zh.setup=Cr9;var RCA=zo(),wJ=xP(),po=sm(),bMD=cY(),Kr9=qG(),Qr9=B8(),kMD=cY(),uMD=require("net"),Wr9=Y0H(),Vr9="pick_first";function uhH(H){Kr9.trace(Qr9.LogVerbosity.DEBUG,Vr9,H)}var ghH="pick_first",Pr9=250;class X7H{constructor(H){this.shuffleAddressList=H}getLoadBalancerName(){return ghH}toJsonObject(){return{[ghH]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(H){if("shuffleAddressList"in H&&typeof H.shuffleAddressList!=="boolean")throw Error("pick_first config field shuffleAddressList must be a boolean if provided");return new X7H(H.shuffleAddressList===!0)}}Zh.PickFirstLoadBalancingConfig=X7H;class gMD{constructor(H){this.subchannel=H}pick(H){return{pickResultType:po.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}}function mMD(H){let $=H.slice();for(let A=$.length-1;A>1;A--){let L=Math.floor(Math.random()*(A+1)),I=$[A];$[A]=$[L],$[L]=I}return $}function _r9(H){if(H.length===0)return[];let $=[],A=[],L=[],I=(0,kMD.isTcpSubchannelAddress)(H[0])&&(0,uMD.isIPv6)(H[0].host);for(let f of H)if((0,kMD.isTcpSubchannelAddress)(f)&&(0,uMD.isIPv6)(f.host))A.push(f);else L.push(f);let D=I?A:L,B=I?L:A;for(let f=0;f{this.onSubchannelStateUpdate($,A,L,D)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every((H)=>H.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every((H)=>H.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var H;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let $=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker({details:$}),$)}else this.updateState(wJ.ConnectivityState.READY,new gMD(this.currentPick),null);else if(((H=this.latestAddressList)===null||H===void 0?void 0:H.length)===0){let $=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker({details:$}),$)}else if(this.children.length===0)this.updateState(wJ.ConnectivityState.IDLE,new po.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let $=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker({details:$}),$)}else this.updateState(wJ.ConnectivityState.CONNECTING,new po.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(!this.allChildrenHaveReportedTF())return;if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:H}of this.children)H.startConnecting();this.calculateAndReportNewState()}removeCurrentPick(){if(this.currentPick!==null)this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null}onSubchannelStateUpdate(H,$,A,L){var I;if((I=this.currentPick)===null||I===void 0?void 0:I.realSubchannelEquals(H)){if(A!==wJ.ConnectivityState.READY)this.removeCurrentPick(),this.calculateAndReportNewState();return}for(let[D,B]of this.children.entries())if(H.realSubchannelEquals(B.subchannel)){if(A===wJ.ConnectivityState.READY)this.pickSubchannel(B.subchannel);if(A===wJ.ConnectivityState.TRANSIENT_FAILURE){if(B.hasReportedTransientFailure=!0,L)this.lastError=L;if(this.maybeEnterStickyTransientFailureMode(),D===this.currentSubchannelIndex)this.startNextSubchannelConnecting(D+1)}B.subchannel.startConnecting();return}}startNextSubchannelConnecting(H){clearTimeout(this.connectionDelayTimeout);for(let[$,A]of this.children.entries())if($>=H){let L=A.subchannel.getConnectivityState();if(L===wJ.ConnectivityState.IDLE||L===wJ.ConnectivityState.CONNECTING){this.startConnecting($);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(H){var $,A;if(clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=H,this.children[H].subchannel.getConnectivityState()===wJ.ConnectivityState.IDLE)uhH("Start connecting to subchannel with address "+this.children[H].subchannel.getAddress()),process.nextTick(()=>{var L;(L=this.children[H])===null||L===void 0||L.subchannel.startConnecting()});this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(H+1)},Pr9),(A=($=this.connectionDelayTimeout).unref)===null||A===void 0||A.call($)}pickSubchannel(H){uhH("Pick subchannel with address "+H.getAddress()),this.stickyTransientFailureMode=!1,H.ref(),this.channelControlHelper.addChannelzChild(H.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),H.addConnectivityStateListener(this.subchannelStateListener),H.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=H,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(H,$,A){uhH(wJ.ConnectivityState[this.currentState]+" -> "+wJ.ConnectivityState[H]),this.currentState=H,this.channelControlHelper.updateState(H,$,A)}resetSubchannelList(){for(let H of this.children)H.subchannel.removeConnectivityStateListener(this.subchannelStateListener),H.subchannel.unref(),this.channelControlHelper.removeChannelzChild(H.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(H,$){uhH("connectToAddressList(["+H.map((L)=>(0,bMD.subchannelAddressToString)(L))+"])");let A=H.map((L)=>({subchannel:this.channelControlHelper.createSubchannel(L,$),hasReportedTransientFailure:!1}));for(let{subchannel:L}of A)if(L.getConnectivityState()===wJ.ConnectivityState.READY){this.pickSubchannel(L);return}for(let{subchannel:L}of A)L.ref(),this.channelControlHelper.addChannelzChild(L.getChannelzRef());this.resetSubchannelList(),this.children=A;for(let{subchannel:L}of this.children)L.addConnectivityStateListener(this.subchannelStateListener);for(let L of this.children)if(L.subchannel.getConnectivityState()===wJ.ConnectivityState.TRANSIENT_FAILURE)L.hasReportedTransientFailure=!0;this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(H,$,A,L){if(!($ instanceof X7H))return!1;if(!H.ok){if(this.children.length===0&&this.currentPick===null)this.channelControlHelper.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker(H.error),H.error.details);return!0}let I=H.value;if(this.reportHealthStatus=A[pMD],$.getShuffleAddressList())I=mMD(I);let D=[].concat(...I.map((f)=>f.addresses));uhH("updateAddressList(["+D.map((f)=>(0,bMD.subchannelAddressToString)(f))+"])");let B=_r9(D);if(this.latestAddressList=B,this.latestOptions=A,this.connectToAddressList(B,A),this.latestResolutionNote=L,D.length>0)return!0;else return this.lastError="No addresses resolved",!1}exitIdle(){if(this.currentState===wJ.ConnectivityState.IDLE&&this.latestAddressList)this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return ghH}}Zh.PickFirstLoadBalancer=zV$;var Yr9=new X7H(!1);class dMD{constructor(H,$,A,L){this.endpoint=H,this.options=A,this.resolutionNote=L,this.latestState=wJ.ConnectivityState.IDLE;let I=(0,RCA.createChildChannelControlHelper)($,{updateState:(D,B,f)=>{this.latestState=D,this.latestPicker=B,$.updateState(D,B,f)}});this.pickFirstBalancer=new zV$(I),this.latestPicker=new po.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,Wr9.statusOrFromValue)([this.endpoint]),Yr9,Object.assign(Object.assign({},this.options),{[pMD]:!0}),this.resolutionNote)}updateEndpoint(H,$){if(this.options=$,this.endpoint=H,this.latestState!==wJ.ConnectivityState.IDLE)this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}}Zh.LeafLoadBalancer=dMD;function Cr9(){(0,RCA.registerLoadBalancerType)(ghH,zV$,X7H),(0,RCA.registerDefaultLoadBalancerType)(ghH)}});var lMD=z((OV$)=>{Object.defineProperty(OV$,"__esModule",{value:!0});OV$.FileWatcherCertificateProvider=void 0;var wr9=require("fs"),Zr9=qG(),qr9=B8(),Tr9=require("util"),zr9="certificate_provider";function NV$(H){Zr9.trace(qr9.LogVerbosity.DEBUG,zr9,H)}var yCA=(0,Tr9.promisify)(wr9.readFile);class cMD{constructor(H){if(this.config=H,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,H.certificateFile===void 0!==(H.privateKeyFile===void 0))throw Error("certificateFile and privateKeyFile must be set or unset together");if(H.certificateFile===void 0&&H.caCertificateFile===void 0)throw Error("At least one of certificateFile and caCertificateFile must be set");NV$("File watcher constructed with config "+JSON.stringify(H))}updateCertificates(){if(this.fileResultPromise)return;this.fileResultPromise=Promise.allSettled([this.config.certificateFile?yCA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?yCA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?yCA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([H,$,A])=>{if(!this.refreshTimer)return;if(NV$("File watcher read certificates certificate "+H.status+", privateKey "+$.status+", CA certificate "+A.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,H.status==="fulfilled"&&$.status==="fulfilled")this.latestIdentityUpdate={certificate:H.value,privateKey:$.value};else this.latestIdentityUpdate=null;if(A.status==="fulfilled")this.latestCaUpdate={caCertificate:A.value};else this.latestCaUpdate=null;for(let L of this.identityListeners)L(this.latestIdentityUpdate);for(let L of this.caListeners)L(this.latestCaUpdate)}),NV$("File watcher initiated certificate update")}maybeStartWatchingFiles(){if(!this.refreshTimer){let H=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;if(H>this.config.refreshIntervalMs)this.updateCertificates();if(H>this.config.refreshIntervalMs*2)this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0;this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),NV$("File watcher started watching")}}maybeStopWatchingFiles(){if(this.caListeners.size===0&&this.identityListeners.size===0){if(this.fileResultPromise=null,this.refreshTimer)clearInterval(this.refreshTimer),this.refreshTimer=null}}addCaCertificateListener(H){if(this.caListeners.add(H),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0)process.nextTick(H,this.latestCaUpdate)}removeCaCertificateListener(H){this.caListeners.delete(H),this.maybeStopWatchingFiles()}addIdentityCertificateListener(H){if(this.identityListeners.add(H),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0)process.nextTick(H,this.latestIdentityUpdate)}removeIdentityCertificateListener(H){this.identityListeners.delete(H),this.maybeStopWatchingFiles()}}OV$.FileWatcherCertificateProvider=cMD});var bCA=z((BD)=>{Object.defineProperty(BD,"__esModule",{value:!0});BD.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=BD.createCertificateProviderChannelCredentials=BD.FileWatcherCertificateProvider=BD.createCertificateProviderServerCredentials=BD.createServerCredentialsWithInterceptors=BD.BaseSubchannelWrapper=BD.registerAdminService=BD.FilterStackFactory=BD.BaseFilter=BD.statusOrFromError=BD.statusOrFromValue=BD.PickResultType=BD.QueuePicker=BD.UnavailablePicker=BD.ChildLoadBalancerHandler=BD.EndpointMap=BD.endpointHasAddress=BD.endpointToString=BD.subchannelAddressToString=BD.LeafLoadBalancer=BD.isLoadBalancerNameRegistered=BD.parseLoadBalancingConfig=BD.selectLbConfigFromList=BD.registerLoadBalancerType=BD.createChildChannelControlHelper=BD.BackoffTimeout=BD.parseDuration=BD.durationToMs=BD.splitHostPort=BD.uriToString=BD.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=BD.createResolver=BD.registerResolver=BD.log=BD.trace=void 0;var iMD=qG();Object.defineProperty(BD,"trace",{enumerable:!0,get:function(){return iMD.trace}});Object.defineProperty(BD,"log",{enumerable:!0,get:function(){return iMD.log}});var vCA=BS();Object.defineProperty(BD,"registerResolver",{enumerable:!0,get:function(){return vCA.registerResolver}});Object.defineProperty(BD,"createResolver",{enumerable:!0,get:function(){return vCA.createResolver}});Object.defineProperty(BD,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return vCA.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var nMD=OP();Object.defineProperty(BD,"uriToString",{enumerable:!0,get:function(){return nMD.uriToString}});Object.defineProperty(BD,"splitHostPort",{enumerable:!0,get:function(){return nMD.splitHostPort}});var rMD=khH();Object.defineProperty(BD,"durationToMs",{enumerable:!0,get:function(){return rMD.durationToMs}});Object.defineProperty(BD,"parseDuration",{enumerable:!0,get:function(){return rMD.parseDuration}});var Nr9=uWH();Object.defineProperty(BD,"BackoffTimeout",{enumerable:!0,get:function(){return Nr9.BackoffTimeout}});var phH=zo();Object.defineProperty(BD,"createChildChannelControlHelper",{enumerable:!0,get:function(){return phH.createChildChannelControlHelper}});Object.defineProperty(BD,"registerLoadBalancerType",{enumerable:!0,get:function(){return phH.registerLoadBalancerType}});Object.defineProperty(BD,"selectLbConfigFromList",{enumerable:!0,get:function(){return phH.selectLbConfigFromList}});Object.defineProperty(BD,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return phH.parseLoadBalancingConfig}});Object.defineProperty(BD,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return phH.isLoadBalancerNameRegistered}});var Or9=mhH();Object.defineProperty(BD,"LeafLoadBalancer",{enumerable:!0,get:function(){return Or9.LeafLoadBalancer}});var xV$=cY();Object.defineProperty(BD,"subchannelAddressToString",{enumerable:!0,get:function(){return xV$.subchannelAddressToString}});Object.defineProperty(BD,"endpointToString",{enumerable:!0,get:function(){return xV$.endpointToString}});Object.defineProperty(BD,"endpointHasAddress",{enumerable:!0,get:function(){return xV$.endpointHasAddress}});Object.defineProperty(BD,"EndpointMap",{enumerable:!0,get:function(){return xV$.EndpointMap}});var xr9=U3$();Object.defineProperty(BD,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return xr9.ChildLoadBalancerHandler}});var hCA=sm();Object.defineProperty(BD,"UnavailablePicker",{enumerable:!0,get:function(){return hCA.UnavailablePicker}});Object.defineProperty(BD,"QueuePicker",{enumerable:!0,get:function(){return hCA.QueuePicker}});Object.defineProperty(BD,"PickResultType",{enumerable:!0,get:function(){return hCA.PickResultType}});var aMD=Y0H();Object.defineProperty(BD,"statusOrFromValue",{enumerable:!0,get:function(){return aMD.statusOrFromValue}});Object.defineProperty(BD,"statusOrFromError",{enumerable:!0,get:function(){return aMD.statusOrFromError}});var Sr9=rYA();Object.defineProperty(BD,"BaseFilter",{enumerable:!0,get:function(){return Sr9.BaseFilter}});var jr9=s3$();Object.defineProperty(BD,"FilterStackFactory",{enumerable:!0,get:function(){return jr9.FilterStackFactory}});var Rr9=K3$();Object.defineProperty(BD,"registerAdminService",{enumerable:!0,get:function(){return Rr9.registerAdminService}});var yr9=hhH();Object.defineProperty(BD,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return yr9.BaseSubchannelWrapper}});var oMD=_V$();Object.defineProperty(BD,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return oMD.createServerCredentialsWithInterceptors}});Object.defineProperty(BD,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return oMD.createCertificateProviderServerCredentials}});var vr9=lMD();Object.defineProperty(BD,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return vr9.FileWatcherCertificateProvider}});var hr9=kWH();Object.defineProperty(BD,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return hr9.createCertificateProviderChannelCredentials}});var br9=QCA();Object.defineProperty(BD,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return br9.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var sMD=z((kCA)=>{Object.defineProperty(kCA,"__esModule",{value:!0});kCA.setup=gr9;var kr9=BS(),ur9=Y0H();class tMD{constructor(H,$,A){this.listener=$,this.hasReturnedResult=!1,this.endpoints=[];let L;if(H.authority==="")L="/"+H.path;else L=H.path;this.endpoints=[{addresses:[{path:L}]}]}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(this.listener,(0,ur9.statusOrFromValue)(this.endpoints),{},null,"")}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(H){return"localhost"}}function gr9(){(0,kr9.registerResolver)("unix",tMD)}});var IGD=z((dCA)=>{Object.defineProperty(dCA,"__esModule",{value:!0});dCA.setup=lr9;var eMD=require("net"),HGD=Y0H(),SV$=B8(),uCA=rQ(),$GD=BS(),mr9=cY(),AGD=OP(),pr9=qG(),dr9="ip_resolver";function LGD(H){pr9.trace(SV$.LogVerbosity.DEBUG,dr9,H)}var gCA="ipv4",mCA="ipv6",cr9=443;class pCA{constructor(H,$,A){var L;this.listener=$,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,LGD("Resolver constructed for target "+(0,AGD.uriToString)(H));let I=[];if(!(H.scheme===gCA||H.scheme===mCA)){this.error={code:SV$.Status.UNAVAILABLE,details:`Unrecognized scheme ${H.scheme} in IP resolver`,metadata:new uCA.Metadata};return}let D=H.path.split(",");for(let B of D){let f=(0,AGD.splitHostPort)(B);if(f===null){this.error={code:SV$.Status.UNAVAILABLE,details:`Failed to parse ${H.scheme} address ${B}`,metadata:new uCA.Metadata};return}if(H.scheme===gCA&&!(0,eMD.isIPv4)(f.host)||H.scheme===mCA&&!(0,eMD.isIPv6)(f.host)){this.error={code:SV$.Status.UNAVAILABLE,details:`Failed to parse ${H.scheme} address ${B}`,metadata:new uCA.Metadata};return}I.push({host:f.host,port:(L=f.port)!==null&&L!==void 0?L:cr9})}this.endpoints=I.map((B)=>({addresses:[B]})),LGD("Parsed "+H.scheme+" address list "+I.map(mr9.subchannelAddressToString))}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(()=>{if(this.error)this.listener((0,HGD.statusOrFromError)(this.error),{},null,"");else this.listener((0,HGD.statusOrFromValue)(this.endpoints),{},null,"")})}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(H){return H.path.split(",")[0]}}function lr9(){(0,$GD.registerResolver)(gCA,pCA),(0,$GD.registerResolver)(mCA,pCA)}});var MGD=z((chH)=>{Object.defineProperty(chH,"__esModule",{value:!0});chH.RoundRobinLoadBalancer=void 0;chH.setup=tr9;var fGD=zo(),y7=xP(),dhH=sm(),ir9=qG(),nr9=B8(),DGD=cY(),rr9=mhH(),ar9="round_robin";function BGD(H){ir9.trace(nr9.LogVerbosity.DEBUG,ar9,H)}var jV$="round_robin";class RV${getLoadBalancerName(){return jV$}constructor(){}toJsonObject(){return{[jV$]:{}}}static createFromJson(H){return new RV$}}class EGD{constructor(H,$=0){this.children=H,this.nextIndex=$}pick(H){let $=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,$.pick(H)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}}function or9(H,$){return[...H.slice($),...H.slice(0,$)]}class cCA{constructor(H){this.channelControlHelper=H,this.children=[],this.currentState=y7.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,fGD.createChildChannelControlHelper)(H,{updateState:($,A,L)=>{if(this.currentState===y7.ConnectivityState.READY&&$!==y7.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(L)this.lastError=L;this.calculateAndUpdateState()}})}countChildrenWithState(H){return this.children.filter(($)=>$.getConnectivityState()===H).length}calculateAndUpdateState(){if(this.updatesPaused)return;if(this.countChildrenWithState(y7.ConnectivityState.READY)>0){let H=this.children.filter((A)=>A.getConnectivityState()===y7.ConnectivityState.READY),$=0;if(this.currentReadyPicker!==null){let A=this.currentReadyPicker.peekNextEndpoint();if($=H.findIndex((L)=>(0,DGD.endpointEqual)(L.getEndpoint(),A)),$<0)$=0}this.updateState(y7.ConnectivityState.READY,new EGD(H.map((A)=>({endpoint:A.getEndpoint(),picker:A.getPicker()})),$),null)}else if(this.countChildrenWithState(y7.ConnectivityState.CONNECTING)>0)this.updateState(y7.ConnectivityState.CONNECTING,new dhH.QueuePicker(this),null);else if(this.countChildrenWithState(y7.ConnectivityState.TRANSIENT_FAILURE)>0){let H=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(y7.ConnectivityState.TRANSIENT_FAILURE,new dhH.UnavailablePicker({details:H}),H)}else this.updateState(y7.ConnectivityState.IDLE,new dhH.QueuePicker(this),null);for(let H of this.children)if(H.getConnectivityState()===y7.ConnectivityState.IDLE)H.exitIdle()}updateState(H,$,A){if(BGD(y7.ConnectivityState[this.currentState]+" -> "+y7.ConnectivityState[H]),H===y7.ConnectivityState.READY)this.currentReadyPicker=$;else this.currentReadyPicker=null;this.currentState=H,this.channelControlHelper.updateState(H,$,A)}resetSubchannelList(){for(let H of this.children)H.destroy();this.children=[]}updateAddressList(H,$,A,L){if(!($ instanceof RV$))return!1;if(!H.ok){if(this.children.length===0)this.updateState(y7.ConnectivityState.TRANSIENT_FAILURE,new dhH.UnavailablePicker(H.error),H.error.details);return!0}let I=Math.random()*H.value.length|0,D=or9(H.value,I);if(this.resetSubchannelList(),D.length===0){let B=`No addresses resolved. Resolution note: ${L}`;this.updateState(y7.ConnectivityState.TRANSIENT_FAILURE,new dhH.UnavailablePicker({details:B}),B)}BGD("Connect to endpoint list "+D.map(DGD.endpointToString)),this.updatesPaused=!0,this.children=D.map((B)=>new rr9.LeafLoadBalancer(B,this.childChannelControlHelper,A,L));for(let B of this.children)B.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return jV$}}chH.RoundRobinLoadBalancer=cCA;function tr9(){(0,fGD.registerLoadBalancerType)(jV$,cCA,RV$)}});var KGD=z((h0H)=>{var lCA;Object.defineProperty(h0H,"__esModule",{value:!0});h0H.OutlierDetectionLoadBalancer=h0H.OutlierDetectionLoadBalancingConfig=void 0;h0H.setup=Ea9;var sr9=xP(),GGD=B8(),v0H=khH(),UGD=bCA(),er9=zo(),Ha9=U3$(),$a9=sm(),iCA=cY(),Aa9=hhH(),La9=qG(),Ia9="outlier_detection";function tQ(H){La9.trace(GGD.LogVerbosity.DEBUG,Ia9,H)}var aCA="outlier_detection",Da9=((lCA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&lCA!==void 0?lCA:"true")==="true",Ba9={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},fa9={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function J7H(H,$,A,L){if($ in H&&H[$]!==void 0&&typeof H[$]!==A){let I=L?`${L}.${$}`:$;throw Error(`outlier detection config ${I} parse error: expected ${A}, got ${typeof H[$]}`)}}function nCA(H,$,A){let L=A?`${A}.${$}`:$;if($ in H&&H[$]!==void 0){if(!(0,v0H.isDuration)(H[$]))throw Error(`outlier detection config ${L} parse error: expected Duration, got ${typeof H[$]}`);if(!(H[$].seconds>=0&&H[$].seconds<=315576000000&&H[$].nanos>=0&&H[$].nanos<=999999999))throw Error(`outlier detection config ${L} parse error: values out of range for non-negative Duaration`)}}function yV$(H,$,A){let L=A?`${A}.${$}`:$;if(J7H(H,$,"number",A),$ in H&&H[$]!==void 0&&!(H[$]>=0&&H[$]<=100))throw Error(`outlier detection config ${L} parse error: value out of range for percentage (0-100)`)}class lhH{constructor(H,$,A,L,I,D,B){if(this.childPolicy=B,B.getLoadBalancerName()==="pick_first")throw Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=H!==null&&H!==void 0?H:1e4,this.baseEjectionTimeMs=$!==null&&$!==void 0?$:30000,this.maxEjectionTimeMs=A!==null&&A!==void 0?A:300000,this.maxEjectionPercent=L!==null&&L!==void 0?L:10,this.successRateEjection=I?Object.assign(Object.assign({},Ba9),I):null,this.failurePercentageEjection=D?Object.assign(Object.assign({},fa9),D):null}getLoadBalancerName(){return aCA}toJsonObject(){var H,$;return{outlier_detection:{interval:(0,v0H.msToDuration)(this.intervalMs),base_ejection_time:(0,v0H.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,v0H.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(H=this.successRateEjection)!==null&&H!==void 0?H:void 0,failure_percentage_ejection:($=this.failurePercentageEjection)!==null&&$!==void 0?$:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(H){var $;if(nCA(H,"interval"),nCA(H,"base_ejection_time"),nCA(H,"max_ejection_time"),yV$(H,"max_ejection_percent"),"success_rate_ejection"in H&&H.success_rate_ejection!==void 0){if(typeof H.success_rate_ejection!=="object")throw Error("outlier detection config success_rate_ejection must be an object");J7H(H.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),yV$(H.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),J7H(H.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),J7H(H.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in H&&H.failure_percentage_ejection!==void 0){if(typeof H.failure_percentage_ejection!=="object")throw Error("outlier detection config failure_percentage_ejection must be an object");yV$(H.failure_percentage_ejection,"threshold","failure_percentage_ejection"),yV$(H.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),J7H(H.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),J7H(H.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in H)||!Array.isArray(H.child_policy))throw Error("outlier detection config child_policy must be an array");let A=(0,er9.selectLbConfigFromList)(H.child_policy);if(!A)throw Error("outlier detection config child_policy: no valid recognized policy found");return new lhH(H.interval?(0,v0H.durationToMs)(H.interval):null,H.base_ejection_time?(0,v0H.durationToMs)(H.base_ejection_time):null,H.max_ejection_time?(0,v0H.durationToMs)(H.max_ejection_time):null,($=H.max_ejection_percent)!==null&&$!==void 0?$:null,H.success_rate_ejection,H.failure_percentage_ejection,A)}}h0H.OutlierDetectionLoadBalancingConfig=lhH;class XGD extends Aa9.BaseSubchannelWrapper{constructor(H,$){super(H);this.mapEntry=$,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0){if(this.mapEntry){let H=this.mapEntry.subchannelWrappers.indexOf(this);if(H>=0)this.mapEntry.subchannelWrappers.splice(H,1)}}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}}function rCA(){return{success:0,failure:0}}class JGD{constructor(){this.activeBucket=rCA(),this.inactiveBucket=rCA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=rCA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}}class FGD{constructor(H,$){this.wrappedPicker=H,this.countCalls=$}pick(H){let $=this.wrappedPicker.pick(H);if($.pickResultType===$a9.PickResultType.COMPLETE){let A=$.subchannel,L=A.getMapEntry();if(L){let I=$.onCallEnded;if(this.countCalls)I=(D,B,f)=>{var E;if(D===GGD.Status.OK)L.counter.addSuccess();else L.counter.addFailure();(E=$.onCallEnded)===null||E===void 0||E.call($,D,B,f)};return Object.assign(Object.assign({},$),{subchannel:A.getWrappedSubchannel(),onCallEnded:I})}else return Object.assign(Object.assign({},$),{subchannel:A.getWrappedSubchannel()})}else return $}}class oCA{constructor(H){this.entryMap=new iCA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new Ha9.ChildLoadBalancerHandler((0,UGD.createChildChannelControlHelper)(H,{createSubchannel:($,A)=>{let L=H.createSubchannel($,A),I=this.entryMap.getForSubchannelAddress($),D=new XGD(L,I);if((I===null||I===void 0?void 0:I.currentEjectionTimestamp)!==null)D.eject();return I===null||I===void 0||I.subchannelWrappers.push(D),D},updateState:($,A,L)=>{if($===sr9.ConnectivityState.READY)H.updateState($,new FGD(A,this.isCountingEnabled()),L);else H.updateState($,A,L)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let H=0;for(let $ of this.entryMap.values())if($.currentEjectionTimestamp!==null)H+=1;return H*100/this.entryMap.size}runSuccessRateCheck(H){if(!this.latestConfig)return;let $=this.latestConfig.getSuccessRateEjectionConfig();if(!$)return;tQ("Running success rate check");let A=$.request_volume,L=0,I=[];for(let[G,U]of this.entryMap.entries()){let X=U.counter.getLastSuccesses(),J=U.counter.getLastFailures();if(tQ("Stats for "+(0,iCA.endpointToString)(G)+": successes="+X+" failures="+J+" targetRequestVolume="+A),X+J>=A)L+=1,I.push(X/(X+J))}if(tQ("Found "+L+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+I+"]"),L<$.minimum_hosts)return;let D=I.reduce((G,U)=>G+U)/I.length,B=0;for(let G of I){let U=G-D;B+=U*U}let f=B/I.length,E=Math.sqrt(f),M=D-E*($.stdev_factor/1000);tQ("stdev="+E+" ejectionThreshold="+M);for(let[G,U]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let X=U.counter.getLastSuccesses(),J=U.counter.getLastFailures();if(X+Jthis.runChecks(),H),(A=($=this.ejectionTimer).unref)===null||A===void 0||A.call($)}runChecks(){let H=new Date;if(tQ("Ejection timer running"),this.switchAllBuckets(),!this.latestConfig)return;this.timerStartTime=H,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(H),this.runFailurePercentageCheck(H);for(let[$,A]of this.entryMap.entries())if(A.currentEjectionTimestamp===null){if(A.ejectionTimeMultiplier>0)A.ejectionTimeMultiplier-=1}else{let L=this.latestConfig.getBaseEjectionTimeMs(),I=this.latestConfig.getMaxEjectionTimeMs(),D=new Date(A.currentEjectionTimestamp.getTime());if(D.setMilliseconds(D.getMilliseconds()+Math.min(L*A.ejectionTimeMultiplier,Math.max(L,I))),D{Object.defineProperty(hV$,"__esModule",{value:!0});hV$.PriorityQueue=void 0;var F7H=0,tCA=(H)=>Math.floor(H/2),vV$=(H)=>H*2+1,ihH=(H)=>H*2+2;class QGD{constructor(H=($,A)=>$>A){this.comparator=H,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[F7H]}push(...H){return H.forEach(($)=>{this.heap.push($),this.siftUp()}),this.size()}pop(){let H=this.peek(),$=this.size()-1;if($>F7H)this.swap(F7H,$);return this.heap.pop(),this.siftDown(),H}replace(H){let $=this.peek();return this.heap[F7H]=H,this.siftDown(),$}greater(H,$){return this.comparator(this.heap[H],this.heap[$])}swap(H,$){[this.heap[H],this.heap[$]]=[this.heap[$],this.heap[H]]}siftUp(){let H=this.size()-1;while(H>F7H&&this.greater(H,tCA(H)))this.swap(H,tCA(H)),H=tCA(H)}siftDown(){let H=F7H;while(vV$(H){Object.defineProperty(rhH,"__esModule",{value:!0});rhH.WeightedRoundRobinLoadBalancingConfig=void 0;rhH.setup=Pa9;var sQ=xP(),Ma9=B8(),Pw=khH(),_GD=zo(),Ga9=mhH(),Ua9=qG(),YGD=CV$(),K7H=sm(),Xa9=WGD(),VGD=cY(),Ja9="weighted_round_robin";function sCA(H){Ua9.trace(Ma9.LogVerbosity.DEBUG,Ja9,H)}var eCA="weighted_round_robin",Fa9=1e4,Ka9=1e4,Qa9=180000,Wa9=1000,Va9=1;function PGD(H,$,A){if($ in H&&H[$]!==void 0&&typeof H[$]!==A)throw Error(`weighted round robin config ${$} parse error: expected ${A}, got ${typeof H[$]}`)}function bV$(H,$){if($ in H&&H[$]!==void 0&&H[$]!==null){let A;if((0,Pw.isDuration)(H[$]))A=H[$];else if((0,Pw.isDurationMessage)(H[$]))A=(0,Pw.durationMessageToDuration)(H[$]);else if(typeof H[$]==="string"){let L=(0,Pw.parseDuration)(H[$]);if(!L)throw Error(`weighted round robin config ${$}: failed to parse duration string ${H[$]}`);A=L}else throw Error(`weighted round robin config ${$}: expected duration, got ${typeof H[$]}`);return(0,Pw.durationToMs)(A)}return null}class nhH{constructor(H,$,A,L,I,D){this.enableOobLoadReport=H!==null&&H!==void 0?H:!1,this.oobLoadReportingPeriodMs=$!==null&&$!==void 0?$:Fa9,this.blackoutPeriodMs=A!==null&&A!==void 0?A:Ka9,this.weightExpirationPeriodMs=L!==null&&L!==void 0?L:Qa9,this.weightUpdatePeriodMs=Math.max(I!==null&&I!==void 0?I:Wa9,100),this.errorUtilizationPenalty=D!==null&&D!==void 0?D:Va9}getLoadBalancerName(){return eCA}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(H){if(PGD(H,"enable_oob_load_report","boolean"),PGD(H,"error_utilization_penalty","number"),H.error_utilization_penalty<0)throw Error("weighted round robin config error_utilization_penalty < 0");return new nhH(H.enable_oob_load_report,bV$(H,"oob_load_reporting_period"),bV$(H,"blackout_period"),bV$(H,"weight_expiration_period"),bV$(H,"weight_update_period"),H.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}}rhH.WeightedRoundRobinLoadBalancingConfig=nhH;class CGD{constructor(H,$){this.metricsHandler=$,this.queue=new Xa9.PriorityQueue((I,D)=>I.deadlineI.weight>0),L;if(A.length<2)L=1;else{let I=0;for(let{weight:D}of A)I+=D;L=I/A.length}for(let I of H){let D=I.weight>0?1/I.weight:L;this.queue.push({endpointName:I.endpointName,picker:I.picker,period:D,deadline:Math.random()*D})}}pick(H){let $=this.queue.pop();this.queue.push(Object.assign(Object.assign({},$),{deadline:$.deadline+$.period}));let A=$.picker.pick(H);if(A.pickResultType===K7H.PickResultType.COMPLETE)if(this.metricsHandler)return Object.assign(Object.assign({},A),{onCallEnded:(0,YGD.createMetricsReader)((L)=>this.metricsHandler(L,$.endpointName),A.onCallEnded)});else{let L=A.subchannel;return Object.assign(Object.assign({},A),{subchannel:L.getWrappedSubchannel()})}else return A}}class wGD{constructor(H){this.channelControlHelper=H,this.latestConfig=null,this.children=new Map,this.currentState=sQ.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(H){let $=0;for(let A of this.children.values())if(A.child.getConnectivityState()===H)$+=1;return $}updateWeight(H,$){var A,L;let{rps_fractional:I,application_utilization:D}=$;if(D>0&&I>0)D+=$.eps/I*((L=(A=this.latestConfig)===null||A===void 0?void 0:A.getErrorUtilizationPenalty())!==null&&L!==void 0?L:0);let B=D===0?0:I/D;if(B===0)return;let f=new Date;if(H.nonEmptySince===null)H.nonEmptySince=f;H.lastUpdated=f,H.weight=B}getWeight(H){if(!this.latestConfig)return 0;let $=new Date().getTime();if($-H.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return H.nonEmptySince=null,0;let A=this.latestConfig.getBlackoutPeriodMs();if(A>0&&(H.nonEmptySince===null||$-H.nonEmptySince.getTime()0){let H=[];for(let[A,L]of this.children){if(L.child.getConnectivityState()!==sQ.ConnectivityState.READY)continue;H.push({endpointName:A,picker:L.child.getPicker(),weight:this.getWeight(L)})}sCA("Created picker with weights: "+H.map((A)=>A.endpointName+":"+A.weight).join(","));let $;if(!this.latestConfig.getEnableOobLoadReport())$=(A,L)=>{let I=this.children.get(L);if(I)this.updateWeight(I,A)};else $=null;this.updateState(sQ.ConnectivityState.READY,new CGD(H,$),null)}else if(this.countChildrenWithState(sQ.ConnectivityState.CONNECTING)>0)this.updateState(sQ.ConnectivityState.CONNECTING,new K7H.QueuePicker(this),null);else if(this.countChildrenWithState(sQ.ConnectivityState.TRANSIENT_FAILURE)>0){let H=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(sQ.ConnectivityState.TRANSIENT_FAILURE,new K7H.UnavailablePicker({details:H}),H)}else this.updateState(sQ.ConnectivityState.IDLE,new K7H.QueuePicker(this),null);for(let{child:H}of this.children.values())if(H.getConnectivityState()===sQ.ConnectivityState.IDLE)H.exitIdle()}updateState(H,$,A){sCA(sQ.ConnectivityState[this.currentState]+" -> "+sQ.ConnectivityState[H]),this.currentState=H,this.channelControlHelper.updateState(H,$,A)}updateAddressList(H,$,A,L){var I,D;if(!($ instanceof nhH))return!1;if(!H.ok){if(this.children.size===0)this.updateState(sQ.ConnectivityState.TRANSIENT_FAILURE,new K7H.UnavailablePicker(H.error),H.error.details);return!0}if(H.value.length===0){let E=`No addresses resolved. Resolution note: ${L}`;return this.updateState(sQ.ConnectivityState.TRANSIENT_FAILURE,new K7H.UnavailablePicker({details:E}),E),!1}sCA("Connect to endpoint list "+H.value.map(VGD.endpointToString));let B=new Date,f=new Set;this.updatesPaused=!0,this.latestConfig=$;for(let E of H.value){let M=(0,VGD.endpointToString)(E);f.add(M);let G=this.children.get(M);if(!G)G={child:new Ga9.LeafLoadBalancer(E,(0,_GD.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(U,X,J)=>{if(this.currentState===sQ.ConnectivityState.READY&&U!==sQ.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(U===sQ.ConnectivityState.READY)G.nonEmptySince=null;if(J)this.lastError=J;this.calculateAndUpdateState()},createSubchannel:(U,X)=>{let J=this.channelControlHelper.createSubchannel(U,X);if(G===null||G===void 0?void 0:G.oobMetricsListener)return new YGD.OrcaOobMetricsSubchannelWrapper(J,G.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs());else return J}}),A,L),lastUpdated:B,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(M,G);if($.getEnableOobLoadReport())G.oobMetricsListener=(U)=>{this.updateWeight(G,U)};else G.oobMetricsListener=null}for(let[E,M]of this.children)if(f.has(E))M.child.startConnecting();else M.child.destroy(),this.children.delete(E);if(this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer);return this.weightUpdateTimer=(D=(I=setInterval(()=>{if(this.currentState===sQ.ConnectivityState.READY)this.calculateAndUpdateState()},$.getWeightUpdatePeriodMs())).unref)===null||D===void 0?void 0:D.call(I),!0}exitIdle(){}resetBackoff(){}destroy(){for(let H of this.children.values())H.child.destroy();if(this.children.clear(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer)}getTypeName(){return eCA}}function Pa9(){(0,_GD.registerLoadBalancerType)(eCA,wGD,nhH)}});var ahH=z((HD)=>{Object.defineProperty(HD,"__esModule",{value:!0});HD.experimental=HD.ServerMetricRecorder=HD.ServerInterceptingCall=HD.ResponderBuilder=HD.ServerListenerBuilder=HD.addAdminServicesToServer=HD.getChannelzHandlers=HD.getChannelzServiceDefinition=HD.InterceptorConfigurationError=HD.InterceptingCall=HD.RequesterBuilder=HD.ListenerBuilder=HD.StatusBuilder=HD.getClientChannel=HD.ServerCredentials=HD.Server=HD.setLogVerbosity=HD.setLogger=HD.load=HD.loadObject=HD.CallCredentials=HD.ChannelCredentials=HD.waitForClientReady=HD.closeClient=HD.Channel=HD.makeGenericClientConstructor=HD.makeClientConstructor=HD.loadPackageDefinition=HD.Client=HD.compressionAlgorithms=HD.propagate=HD.connectivityState=HD.status=HD.logVerbosity=HD.Metadata=HD.credentials=void 0;var kV$=H3$();Object.defineProperty(HD,"CallCredentials",{enumerable:!0,get:function(){return kV$.CallCredentials}});var _a9=r_A();Object.defineProperty(HD,"Channel",{enumerable:!0,get:function(){return _a9.ChannelImplementation}});var Ya9=nYA();Object.defineProperty(HD,"compressionAlgorithms",{enumerable:!0,get:function(){return Ya9.CompressionAlgorithms}});var Ca9=xP();Object.defineProperty(HD,"connectivityState",{enumerable:!0,get:function(){return Ca9.ConnectivityState}});var uV$=kWH();Object.defineProperty(HD,"ChannelCredentials",{enumerable:!0,get:function(){return uV$.ChannelCredentials}});var qGD=n_A();Object.defineProperty(HD,"Client",{enumerable:!0,get:function(){return qGD.Client}});var H2A=B8();Object.defineProperty(HD,"logVerbosity",{enumerable:!0,get:function(){return H2A.LogVerbosity}});Object.defineProperty(HD,"status",{enumerable:!0,get:function(){return H2A.Status}});Object.defineProperty(HD,"propagate",{enumerable:!0,get:function(){return H2A.Propagate}});var TGD=qG(),$2A=P3$();Object.defineProperty(HD,"loadPackageDefinition",{enumerable:!0,get:function(){return $2A.loadPackageDefinition}});Object.defineProperty(HD,"makeClientConstructor",{enumerable:!0,get:function(){return $2A.makeClientConstructor}});Object.defineProperty(HD,"makeGenericClientConstructor",{enumerable:!0,get:function(){return $2A.makeClientConstructor}});var wa9=rQ();Object.defineProperty(HD,"Metadata",{enumerable:!0,get:function(){return wa9.Metadata}});var Za9=yMD();Object.defineProperty(HD,"Server",{enumerable:!0,get:function(){return Za9.Server}});var qa9=_V$();Object.defineProperty(HD,"ServerCredentials",{enumerable:!0,get:function(){return qa9.ServerCredentials}});var Ta9=hMD();Object.defineProperty(HD,"StatusBuilder",{enumerable:!0,get:function(){return Ta9.StatusBuilder}});HD.credentials={combineChannelCredentials:(H,...$)=>{return $.reduce((A,L)=>A.compose(L),H)},combineCallCredentials:(H,...$)=>{return $.reduce((A,L)=>A.compose(L),H)},createInsecure:uV$.ChannelCredentials.createInsecure,createSsl:uV$.ChannelCredentials.createSsl,createFromSecureContext:uV$.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:kV$.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:kV$.CallCredentials.createFromGoogleCredential,createEmpty:kV$.CallCredentials.createEmpty};var za9=(H)=>H.close();HD.closeClient=za9;var Na9=(H,$,A)=>H.waitForReady($,A);HD.waitForClientReady=Na9;var Oa9=(H,$)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};HD.loadObject=Oa9;var xa9=(H,$,A)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};HD.load=xa9;var Sa9=(H)=>{TGD.setLogger(H)};HD.setLogger=Sa9;var ja9=(H)=>{TGD.setLoggerVerbosity(H)};HD.setLogVerbosity=ja9;var Ra9=(H)=>{return qGD.Client.prototype.getChannel.call(H)};HD.getClientChannel=Ra9;var gV$=l_A();Object.defineProperty(HD,"ListenerBuilder",{enumerable:!0,get:function(){return gV$.ListenerBuilder}});Object.defineProperty(HD,"RequesterBuilder",{enumerable:!0,get:function(){return gV$.RequesterBuilder}});Object.defineProperty(HD,"InterceptingCall",{enumerable:!0,get:function(){return gV$.InterceptingCall}});Object.defineProperty(HD,"InterceptorConfigurationError",{enumerable:!0,get:function(){return gV$.InterceptorConfigurationError}});var zGD=ho();Object.defineProperty(HD,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return zGD.getChannelzServiceDefinition}});Object.defineProperty(HD,"getChannelzHandlers",{enumerable:!0,get:function(){return zGD.getChannelzHandlers}});var ya9=K3$();Object.defineProperty(HD,"addAdminServicesToServer",{enumerable:!0,get:function(){return ya9.addAdminServicesToServer}});var A2A=OCA();Object.defineProperty(HD,"ServerListenerBuilder",{enumerable:!0,get:function(){return A2A.ServerListenerBuilder}});Object.defineProperty(HD,"ResponderBuilder",{enumerable:!0,get:function(){return A2A.ResponderBuilder}});Object.defineProperty(HD,"ServerInterceptingCall",{enumerable:!0,get:function(){return A2A.ServerInterceptingCall}});var va9=CV$();Object.defineProperty(HD,"ServerMetricRecorder",{enumerable:!0,get:function(){return va9.ServerMetricRecorder}});var ha9=bCA();HD.experimental=ha9;var ba9=DCA(),ka9=sMD(),ua9=IGD(),ga9=mhH(),ma9=MGD(),pa9=KGD(),da9=ZGD(),ca9=ho();(()=>{ba9.setup(),ka9.setup(),ua9.setup(),ga9.setup(),ma9.setup(),pa9.setup(),da9.setup(),ca9.setup()})()});var NGD=z((mV$)=>{Object.defineProperty(mV$,"__esModule",{value:!0});mV$.createServiceClientConstructor=void 0;var la9=ahH();function ia9(H,$){let A={export:{path:H,requestStream:!1,responseStream:!1,requestSerialize:(L)=>{return L},requestDeserialize:(L)=>{return L},responseSerialize:(L)=>{return L},responseDeserialize:(L)=>{return L}}};return la9.makeGenericClientConstructor(A,$)}mV$.createServiceClientConstructor=ia9});var ohH=z((Az)=>{Object.defineProperty(Az,"__esModule",{value:!0});Az.createOtlpGrpcExporterTransport=Az.GrpcExporterTransport=Az.createEmptyMetadata=Az.createSslCredentials=Az.createInsecureCredentials=void 0;var na9=$1D(),OGD=`OTel-OTLP-Exporter-JavaScript/${na9.VERSION}`;function ra9(H){if(H)return`${H} ${OGD}`;return OGD}var aa9=0,oa9=2;function ta9(H){return H==="gzip"?oa9:aa9}function sa9(){let{credentials:H}=ahH();return H.createInsecure()}Az.createInsecureCredentials=sa9;function ea9(H,$,A){let{credentials:L}=ahH();return L.createSsl(H,$,A)}Az.createSslCredentials=ea9;function Ho9(){let{Metadata:H}=ahH();return new H}Az.createEmptyMetadata=Ho9;class L2A{_parameters;_client;_metadata;constructor(H){this._parameters=H}shutdown(){this._client?.close()}send(H,$){let A=Buffer.from(H);if(this._client==null){let{createServiceClientConstructor:L}=NGD();try{this._metadata=this._parameters.metadata()}catch(D){return Promise.resolve({status:"failure",error:D})}let I=L(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new I(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":ta9(this._parameters.compression),"grpc.primary_user_agent":ra9(this._parameters.userAgent)})}catch(D){return Promise.resolve({status:"failure",error:D})}}return new Promise((L)=>{let I=Date.now()+$;if(this._metadata==null)return L({error:Error("metadata was null"),status:"failure"});this._client.export(A,this._metadata,{deadline:I},(D,B)=>{if(D)L({status:"failure",error:D});else L({data:B,status:"success"})})})}}Az.GrpcExporterTransport=L2A;function $o9(H){return new L2A(H)}Az.createOtlpGrpcExporterTransport=$o9});var yGD=z((co)=>{Object.defineProperty(co,"__esModule",{value:!0});co.getOtlpGrpcDefaultConfiguration=co.mergeOtlpGrpcConfigurationWithDefaults=co.validateAndNormalizeUrl=void 0;var jGD=Lh(),thH=ohH(),Ao9=require("url"),xGD=kB();function RGD(H){if(H=H.trim(),!H.match(/^([\w]{1,8}):\/\//))H=`https://${H}`;let A=new Ao9.URL(H);if(A.protocol==="unix:")return H;if(A.pathname&&A.pathname!=="/")xGD.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored.");if(A.protocol!==""&&!A.protocol?.match(/^(http)s?:$/))xGD.diag.warn("URL protocol should be http(s)://. Using http://.");return A.host}co.validateAndNormalizeUrl=RGD;function SGD(H,$){for(let[A,L]of Object.entries($.getMap()))if(H.get(A).length<1)H.set(A,L)}function Lo9(H,$,A){let L=H.url??$.url??A.url;return{...(0,jGD.mergeOtlpSharedConfigurationWithDefaults)(H,$,A),metadata:()=>{let I=A.metadata();return SGD(I,H.metadata?.().clone()??(0,thH.createEmptyMetadata)()),SGD(I,$.metadata?.()??(0,thH.createEmptyMetadata)()),I},url:RGD(L),credentials:H.credentials??$.credentials?.(L)??A.credentials(L),userAgent:H.userAgent}}co.mergeOtlpGrpcConfigurationWithDefaults=Lo9;function Io9(){return{...(0,jGD.getSharedConfigurationDefaults)(),metadata:()=>(0,thH.createEmptyMetadata)(),url:"http://localhost:4317",credentials:(H)=>{if(H.startsWith("http://"))return()=>(0,thH.createInsecureCredentials)();else return()=>(0,thH.createSslCredentials)()}}}co.getOtlpGrpcDefaultConfiguration=Io9});var uGD=z((pV$)=>{Object.defineProperty(pV$,"__esModule",{value:!0});pV$.getOtlpGrpcConfigurationFromEnv=void 0;var vGD=Kf(),shH=ohH(),Do9=om(),Bo9=require("fs"),fo9=require("path"),bGD=kB();function I2A(H,$){if(H!=null&&H!=="")return H;if($!=null&&$!=="")return $;return}function Eo9(H){let $=process.env[`OTEL_EXPORTER_OTLP_${H}_HEADERS`]?.trim(),A=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),L=(0,vGD.parseKeyPairsIntoRecord)($),I=(0,vGD.parseKeyPairsIntoRecord)(A);if(Object.keys(L).length===0&&Object.keys(I).length===0)return;let D=Object.assign({},I,L),B=(0,shH.createEmptyMetadata)();for(let[f,E]of Object.entries(D))B.set(f,E);return B}function Mo9(H){let $=Eo9(H);if($==null)return;return()=>$}function Go9(H){let $=process.env[`OTEL_EXPORTER_OTLP_${H}_ENDPOINT`]?.trim(),A=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return I2A($,A)}function Uo9(H){let $=process.env[`OTEL_EXPORTER_OTLP_${H}_INSECURE`]?.toLowerCase().trim(),A=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return I2A($,A)==="true"}function D2A(H,$,A){let L=process.env[H]?.trim(),I=process.env[$]?.trim(),D=I2A(L,I);if(D!=null)try{return Bo9.readFileSync(fo9.resolve(process.cwd(),D))}catch{bGD.diag.warn(A);return}else return}function Xo9(H){return D2A(`OTEL_EXPORTER_OTLP_${H}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function Jo9(H){return D2A(`OTEL_EXPORTER_OTLP_${H}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function hGD(H){return D2A(`OTEL_EXPORTER_OTLP_${H}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function kGD(H){let $=Jo9(H),A=Xo9(H),L=hGD(H),I=$!=null&&A!=null;if(L!=null&&!I)return bGD.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,shH.createSslCredentials)(hGD(H));return(0,shH.createSslCredentials)(L,$,A)}function Fo9(H){if(Uo9(H))return(0,shH.createInsecureCredentials)();return kGD(H)}function Ko9(H){return{...(0,Do9.getSharedConfigurationFromEnvironment)(H),metadata:Mo9(H),url:Go9(H),credentials:($)=>{if($.startsWith("http://"))return()=>{return(0,shH.createInsecureCredentials)()};else if($.startsWith("https://"))return()=>{return kGD(H)};return()=>{return Fo9(H)}}}}pV$.getOtlpGrpcConfigurationFromEnv=Ko9});var mGD=z((dV$)=>{Object.defineProperty(dV$,"__esModule",{value:!0});dV$.convertLegacyOtlpGrpcOptions=void 0;var Qo9=kB(),gGD=yGD(),Wo9=ohH(),Vo9=uGD();function Po9(H,$){if(H.headers)Qo9.diag.warn("Headers cannot be set when using grpc");let A=H.credentials;return(0,gGD.mergeOtlpGrpcConfigurationWithDefaults)({url:H.url,metadata:()=>{return H.metadata??(0,Wo9.createEmptyMetadata)()},compression:H.compression,timeoutMillis:H.timeoutMillis,concurrencyLimit:H.concurrencyLimit,credentials:A!=null?()=>A:void 0,userAgent:H.userAgent},(0,Vo9.getOtlpGrpcConfigurationFromEnv)($),(0,gGD.getOtlpGrpcDefaultConfiguration)())}dV$.convertLegacyOtlpGrpcOptions=Po9});var pGD=z((cV$)=>{Object.defineProperty(cV$,"__esModule",{value:!0});cV$.createOtlpGrpcExportDelegate=void 0;var _o9=Lh(),Yo9=ohH();function Co9(H,$,A,L){return(0,_o9.createOtlpNetworkExportDelegate)(H,$,(0,Yo9.createOtlpGrpcExporterTransport)({address:H.url,compression:H.compression,credentials:H.credentials,metadata:H.metadata,userAgent:H.userAgent,grpcName:A,grpcPath:L}))}cV$.createOtlpGrpcExportDelegate=Co9});var lV$=z((Q7H)=>{Object.defineProperty(Q7H,"__esModule",{value:!0});Q7H.createOtlpGrpcExportDelegate=Q7H.convertLegacyOtlpGrpcOptions=void 0;var wo9=mGD();Object.defineProperty(Q7H,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return wo9.convertLegacyOtlpGrpcOptions}});var Zo9=pGD();Object.defineProperty(Q7H,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return Zo9.createOtlpGrpcExportDelegate}})});var lGD=z((iV$)=>{Object.defineProperty(iV$,"__esModule",{value:!0});iV$.OTLPMetricExporter=void 0;var qo9=c6$(),dGD=lV$(),To9=Eh();class cGD extends qo9.OTLPMetricExporterBase{constructor(H){super((0,dGD.createOtlpGrpcExportDelegate)((0,dGD.convertLegacyOtlpGrpcOptions)(H??{},"METRICS"),To9.ProtobufMetricsSerializer,"MetricsExportService","/opentelemetry.proto.collector.metrics.v1.MetricsService/Export"),H)}}iV$.OTLPMetricExporter=cGD});var iGD=z((nV$)=>{Object.defineProperty(nV$,"__esModule",{value:!0});nV$.OTLPMetricExporter=void 0;var zo9=lGD();Object.defineProperty(nV$,"OTLPMetricExporter",{enumerable:!0,get:function(){return zo9.OTLPMetricExporter}})});var E2A=z((oV$)=>{Object.defineProperty(oV$,"__esModule",{value:!0});oV$.PrometheusSerializer=void 0;var No9=kB(),b0H=Yo(),nGD=Kf();function aV$(H){return H.replace(/\\/g,"\\\\").replace(/\n/g,"\\n")}function rGD(H=""){if(typeof H!=="string")H=JSON.stringify(H);return aV$(H).replace(/"/g,"\\\"")}var Oo9=/[^a-z0-9_]/gi,xo9=/_{2,}/g;function f2A(H){return H.replace(Oo9,"_").replace(xo9,"_")}function B2A(H,$){if(!H.endsWith("_total")&&$.dataPointType===b0H.DataPointType.SUM&&$.isMonotonic)H=H+"_total";return H}function So9(H){if(H===1/0)return"+Inf";else if(H===-1/0)return"-Inf";else return`${H}`}function jo9(H){switch(H.dataPointType){case b0H.DataPointType.SUM:if(H.isMonotonic)return"counter";return"gauge";case b0H.DataPointType.GAUGE:return"gauge";case b0H.DataPointType.HISTOGRAM:return"histogram";default:return"untyped"}}function rV$(H,$,A,L,I){let D=!1,B="";for(let[f,E]of Object.entries($)){let M=f2A(f);D=!0,B+=`${B.length>0?",":""}${M}="${rGD(E)}"`}if(I)for(let[f,E]of Object.entries(I)){let M=f2A(f);D=!0,B+=`${B.length>0?",":""}${M}="${rGD(E)}"`}if(D)H+=`{${B}}`;return`${H} ${So9(A)}${L!==void 0?" "+String(L):""} `}}oV$.PrometheusSerializer=aGD});var oGD=z((tV$)=>{Object.defineProperty(tV$,"__esModule",{value:!0});tV$.PrometheusExporter=void 0;var ehH=kB(),yo9=Kf(),M2A=Yo(),vo9=require("http"),ho9=E2A(),bo9=require("url");class Mp extends M2A.MetricReader{static DEFAULT_OPTIONS={host:void 0,port:9464,endpoint:"/metrics",prefix:"",appendTimestamp:!1,withResourceConstantLabels:void 0,withoutTargetInfo:!1};_host;_port;_baseUrl;_endpoint;_server;_prefix;_appendTimestamp;_serializer;_startServerPromise;constructor(H={},$=()=>{}){super({aggregationSelector:(I)=>{return{type:M2A.AggregationType.DEFAULT}},aggregationTemporalitySelector:(I)=>M2A.AggregationTemporality.CUMULATIVE,metricProducers:H.metricProducers});this._host=H.host||process.env.OTEL_EXPORTER_PROMETHEUS_HOST||Mp.DEFAULT_OPTIONS.host,this._port=H.port||Number(process.env.OTEL_EXPORTER_PROMETHEUS_PORT)||Mp.DEFAULT_OPTIONS.port,this._prefix=H.prefix||Mp.DEFAULT_OPTIONS.prefix,this._appendTimestamp=typeof H.appendTimestamp==="boolean"?H.appendTimestamp:Mp.DEFAULT_OPTIONS.appendTimestamp;let A=H.withResourceConstantLabels||Mp.DEFAULT_OPTIONS.withResourceConstantLabels,L=H.withoutTargetInfo||Mp.DEFAULT_OPTIONS.withoutTargetInfo;if(this._server=(0,vo9.createServer)(this._requestHandler).unref(),this._serializer=new ho9.PrometheusSerializer(this._prefix,this._appendTimestamp,A,L),this._baseUrl=`http://${this._host}:${this._port}/`,this._endpoint=(H.endpoint||Mp.DEFAULT_OPTIONS.endpoint).replace(/^([^/])/,"/$1"),H.preventServerStart!==!0)this.startServer().then($,(I)=>{ehH.diag.error(I),$(I)});else if($)queueMicrotask($)}async onForceFlush(){}onShutdown(){return this.stopServer()}stopServer(){if(!this._server)return ehH.diag.debug("Prometheus stopServer() was called but server was never started."),Promise.resolve();else return new Promise((H)=>{this._server.close(($)=>{if(!$)ehH.diag.debug("Prometheus exporter was stopped");else if($.code!=="ERR_SERVER_NOT_RUNNING")(0,yo9.globalErrorHandler)($);H()})})}startServer(){return this._startServerPromise??=new Promise((H,$)=>{this._server.once("error",$),this._server.listen({port:this._port,host:this._host},()=>{ehH.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`),H()})}),this._startServerPromise}getMetricsRequestHandler(H,$){this._exportMetrics($)}_requestHandler=(H,$)=>{if(H.url!=null&&new bo9.URL(H.url,this._baseUrl).pathname===this._endpoint)this._exportMetrics($);else this._notFound($)};_exportMetrics=(H)=>{H.statusCode=200,H.setHeader("content-type","text/plain"),this.collect().then(($)=>{let{resourceMetrics:A,errors:L}=$;if(L.length)ehH.diag.error("PrometheusExporter: metrics collection errors",...L);H.end(this._serializer.serialize(A))},($)=>{H.end(`# failed to export metrics: ${$}`)})};_notFound=(H)=>{H.statusCode=404,H.end()}}tV$.PrometheusExporter=Mp});var tGD=z((W7H)=>{Object.defineProperty(W7H,"__esModule",{value:!0});W7H.PrometheusSerializer=W7H.PrometheusExporter=void 0;var ko9=oGD();Object.defineProperty(W7H,"PrometheusExporter",{enumerable:!0,get:function(){return ko9.PrometheusExporter}});var uo9=E2A();Object.defineProperty(W7H,"PrometheusSerializer",{enumerable:!0,get:function(){return uo9.PrometheusSerializer}})});var sGD,eGD,sV$,V7H;var HUD=K(()=>{sGD=b(Lh(),1),eGD=b(Eh(),1),sV$=b(om(),1);V7H=class V7H extends sGD.OTLPExporterBase{constructor(H={}){super(sV$.createOtlpHttpExportDelegate(sV$.convertLegacyHttpOptions(H,"LOGS","v1/logs",{"Content-Type":"application/x-protobuf"}),eGD.ProtobufLogsSerializer))}}});var $UD=K(()=>{HUD()});var AUD=K(()=>{$UD()});var LUD=K(()=>{AUD()});var BUD=z((eV$)=>{Object.defineProperty(eV$,"__esModule",{value:!0});eV$.OTLPLogExporter=void 0;var IUD=lV$(),go9=Eh(),mo9=Lh();class DUD extends mo9.OTLPExporterBase{constructor(H={}){super((0,IUD.createOtlpGrpcExportDelegate)((0,IUD.convertLegacyOtlpGrpcOptions)(H,"LOGS"),go9.ProtobufLogsSerializer,"LogsExportService","/opentelemetry.proto.collector.logs.v1.LogsService/Export"))}}eV$.OTLPLogExporter=DUD});var fUD=z((HP$)=>{Object.defineProperty(HP$,"__esModule",{value:!0});HP$.OTLPLogExporter=void 0;var po9=BUD();Object.defineProperty(HP$,"OTLPLogExporter",{enumerable:!0,get:function(){return po9.OTLPLogExporter}})});var EUD,MUD,$P$,k0H;var GUD=K(()=>{EUD=b(Lh(),1),MUD=b(Eh(),1),$P$=b(om(),1);k0H=class k0H extends EUD.OTLPExporterBase{constructor(H={}){super($P$.createOtlpHttpExportDelegate($P$.convertLegacyHttpOptions(H,"LOGS","v1/logs",{"Content-Type":"application/json"}),MUD.JsonLogsSerializer))}}});var UUD=K(()=>{GUD()});var XUD=K(()=>{UUD()});var JUD=K(()=>{XUD()});var FUD="exception";class G2A{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:nY.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(H){let $=Date.now();if(this._spanContext=H.spanContext,this._performanceStartTime=FU.otperformance.now(),this._performanceOffset=$-(this._performanceStartTime+FU.getTimeOrigin()),this._startTimeProvided=H.startTime!=null,this._spanLimits=H.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=H.spanProcessor,this.name=H.name,this.parentSpanContext=H.parentSpanContext,this.kind=H.kind,this.links=H.links||[],this.startTime=this._getTime(H.startTime??$),this.resource=H.resource,this.instrumentationScope=H.scope,H.attributes!=null)this.setAttributes(H.attributes);this._spanProcessor.onStart(this,H.context)}spanContext(){return this._spanContext}setAttribute(H,$){if($==null||this._isSpanEnded())return this;if(H.length===0)return nY.diag.warn(`Invalid attribute key: ${H}`),this;if(!FU.isAttributeValue($))return nY.diag.warn(`Invalid attribute value set for key: ${H}`),this;let{attributeCountLimit:A}=this._spanLimits;if(A!==void 0&&Object.keys(this.attributes).length>=A&&!Object.prototype.hasOwnProperty.call(this.attributes,H))return this._droppedAttributesCount++,this;return this.attributes[H]=this._truncateToSize($),this}setAttributes(H){for(let[$,A]of Object.entries(H))this.setAttribute($,A);return this}addEvent(H,$,A){if(this._isSpanEnded())return this;let{eventCountLimit:L}=this._spanLimits;if(L===0)return nY.diag.warn("No events allowed."),this._droppedEventsCount++,this;if(L!==void 0&&this.events.length>=L){if(this._droppedEventsCount===0)nY.diag.debug("Dropping extra events.");this.events.shift(),this._droppedEventsCount++}if(FU.isTimeInput($)){if(!FU.isTimeInput(A))A=$;$=void 0}let I=FU.sanitizeAttributes($);return this.events.push({name:H,attributes:I,time:this._getTime(A),droppedAttributesCount:0}),this}addLink(H){return this.links.push(H),this}addLinks(H){return this.links.push(...H),this}setStatus(H){if(this._isSpanEnded())return this;if(this.status={...H},this.status.message!=null&&typeof H.message!=="string")nY.diag.warn(`Dropping invalid status.message of type '${typeof H.message}', expected 'string'`),delete this.status.message;return this}updateName(H){if(this._isSpanEnded())return this;return this.name=H,this}end(H){if(this._isSpanEnded()){nY.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}if(this._ended=!0,this.endTime=this._getTime(H),this._duration=FU.hrTimeDuration(this.startTime,this.endTime),this._duration[0]<0)nY.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0];if(this._droppedEventsCount>0)nY.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);this._spanProcessor.onEnd(this)}_getTime(H){if(typeof H==="number"&&H<=FU.otperformance.now())return FU.hrTime(H+this._performanceOffset);if(typeof H==="number")return FU.millisToHrTime(H);if(H instanceof Date)return FU.millisToHrTime(H.getTime());if(FU.isTimeInputHrTime(H))return H;if(this._startTimeProvided)return FU.millisToHrTime(Date.now());let $=FU.otperformance.now()-this._performanceStartTime;return FU.addHrTimes(this.startTime,FU.millisToHrTime($))}isRecording(){return this._ended===!1}recordException(H,$){let A={};if(typeof H==="string")A[qh.ATTR_EXCEPTION_MESSAGE]=H;else if(H){if(H.code)A[qh.ATTR_EXCEPTION_TYPE]=H.code.toString();else if(H.name)A[qh.ATTR_EXCEPTION_TYPE]=H.name;if(H.message)A[qh.ATTR_EXCEPTION_MESSAGE]=H.message;if(H.stack)A[qh.ATTR_EXCEPTION_STACKTRACE]=H.stack}if(A[qh.ATTR_EXCEPTION_TYPE]||A[qh.ATTR_EXCEPTION_MESSAGE])this.addEvent(FUD,A,$);else nY.diag.warn(`Failed to record an exception ${H}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let H=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);nY.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,H)}return this._ended}_truncateToLimitUtil(H,$){if(H.length<=$)return H;return H.substring(0,$)}_truncateToSize(H){let $=this._attributeValueLengthLimit;if($<=0)return nY.diag.warn(`Attribute value limit must be positive, got ${$}`),H;if(typeof H==="string")return this._truncateToLimitUtil(H,$);if(Array.isArray(H))return H.map((A)=>typeof A==="string"?this._truncateToLimitUtil(A,$):A);return H}}var nY,FU,qh;var KUD=K(()=>{nY=b(kB(),1),FU=b(Kf(),1),qh=b(rBH(),1)});var Gp;var AP$=K(()=>{(function(H){H[H.NOT_RECORD=0]="NOT_RECORD",H[H.RECORD=1]="RECORD",H[H.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Gp||(Gp={}))});class u0H{shouldSample(){return{decision:Gp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}var U2A=K(()=>{AP$()});class Up{shouldSample(){return{decision:Gp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}var X2A=K(()=>{AP$()});class P7H{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(H){if(this._root=H.root,!this._root)QUD.globalErrorHandler(Error("ParentBasedSampler must have a root sampler configured")),this._root=new Up;this._remoteParentSampled=H.remoteParentSampled??new Up,this._remoteParentNotSampled=H.remoteParentNotSampled??new u0H,this._localParentSampled=H.localParentSampled??new Up,this._localParentNotSampled=H.localParentNotSampled??new u0H}shouldSample(H,$,A,L,I,D){let B=g0H.trace.getSpanContext(H);if(!B||!g0H.isSpanContextValid(B))return this._root.shouldSample(H,$,A,L,I,D);if(B.isRemote){if(B.traceFlags&g0H.TraceFlags.SAMPLED)return this._remoteParentSampled.shouldSample(H,$,A,L,I,D);return this._remoteParentNotSampled.shouldSample(H,$,A,L,I,D)}if(B.traceFlags&g0H.TraceFlags.SAMPLED)return this._localParentSampled.shouldSample(H,$,A,L,I,D);return this._localParentNotSampled.shouldSample(H,$,A,L,I,D)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}var g0H,QUD;var WUD=K(()=>{U2A();X2A();g0H=b(kB(),1),QUD=b(Kf(),1)});class LP${_ratio;_upperBound;constructor(H=0){this._ratio=H,this._ratio=this._normalize(H),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(H,$){return{decision:VUD.isValidTraceId($)&&this._accumulate($)=1?1:H<=0?0:H}_accumulate(H){let $=0;for(let A=0;A>>0}return $}}var VUD;var PUD=K(()=>{AP$();VUD=b(kB(),1)});function BP$(){return{sampler:J2A(),forceFlushTimeoutMillis:30000,generalLimits:{attributeValueLengthLimit:Lz.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Lz.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function J2A(){let H=Lz.getStringFromEnv("OTEL_TRACES_SAMPLER")??Th.ParentBasedAlwaysOn;switch(H){case Th.AlwaysOn:return new Up;case Th.AlwaysOff:return new u0H;case Th.ParentBasedAlwaysOn:return new P7H({root:new Up});case Th.ParentBasedAlwaysOff:return new P7H({root:new u0H});case Th.TraceIdRatio:return new LP$(_UD());case Th.ParentBasedTraceIdRatio:return new P7H({root:new LP$(_UD())});default:return DP$.diag.error(`OTEL_TRACES_SAMPLER value "${H}" invalid, defaulting to "${Th.ParentBasedAlwaysOn}".`),new P7H({root:new Up})}}function _UD(){let H=Lz.getNumberFromEnv("OTEL_TRACES_SAMPLER_ARG");if(H==null)return DP$.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${IP$}.`),IP$;if(H<0||H>1)return DP$.diag.error(`OTEL_TRACES_SAMPLER_ARG=${H} was given, but it is out of range ([0..1]), defaulting to ${IP$}.`),IP$;return H}var DP$,Lz,Th,IP$=1;var F2A=K(()=>{U2A();X2A();WUD();PUD();DP$=b(kB(),1),Lz=b(Kf(),1);(function(H){H.AlwaysOff="always_off",H.AlwaysOn="always_on",H.ParentBasedAlwaysOff="parentbased_always_off",H.ParentBasedAlwaysOn="parentbased_always_on",H.ParentBasedTraceIdRatio="parentbased_traceidratio",H.TraceIdRatio="traceidratio"})(Th||(Th={}))});function YUD(H){let $={sampler:J2A()},A=BP$(),L=Object.assign({},A,$,H);return L.generalLimits=Object.assign({},A.generalLimits,H.generalLimits||{}),L.spanLimits=Object.assign({},A.spanLimits,H.spanLimits||{}),L}function CUD(H){let $=Object.assign({},H.spanLimits);return $.attributeCountLimit=H.spanLimits?.attributeCountLimit??H.generalLimits?.attributeCountLimit??HbH.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??HbH.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??do9,$.attributeValueLengthLimit=H.spanLimits?.attributeValueLengthLimit??H.generalLimits?.attributeValueLengthLimit??HbH.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??HbH.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??co9,Object.assign({},H,{spanLimits:$})}var HbH,do9=128,co9=1/0;var K2A=K(()=>{F2A();HbH=b(Kf(),1)});class Q2A{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(H,$){if(this._exporter=H,this._maxExportBatchSize=typeof $?.maxExportBatchSize==="number"?$.maxExportBatchSize:rY.getNumberFromEnv("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof $?.maxQueueSize==="number"?$.maxQueueSize:rY.getNumberFromEnv("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof $?.scheduledDelayMillis==="number"?$.scheduledDelayMillis:rY.getNumberFromEnv("OTEL_BSP_SCHEDULE_DELAY")??5000,this._exportTimeoutMillis=typeof $?.exportTimeoutMillis==="number"?$.exportTimeoutMillis:rY.getNumberFromEnv("OTEL_BSP_EXPORT_TIMEOUT")??30000,this._shutdownOnce=new rY.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)Xp.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}onStart(H,$){}onEnd(H){if(this._shutdownOnce.isCalled)return;if((H.spanContext().traceFlags&Xp.TraceFlags.SAMPLED)===0)return;this._addToBuffer(H)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>{return this.onShutdown()}).then(()=>{return this._flushAll()}).then(()=>{return this._exporter.shutdown()})}_addToBuffer(H){if(this._finishedSpans.length>=this._maxQueueSize){if(this._droppedSpansCount===0)Xp.diag.debug("maxQueueSize reached, dropping spans");this._droppedSpansCount++;return}if(this._droppedSpansCount>0)Xp.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0;this._finishedSpans.push(H),this._maybeStartTimer()}_flushAll(){return new Promise((H,$)=>{let A=[],L=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let I=0,D=L;I{H()}).catch($)})}_flushOneBatch(){if(this._clearTimer(),this._finishedSpans.length===0)return Promise.resolve();return new Promise((H,$)=>{let A=setTimeout(()=>{$(Error("Timeout"))},this._exportTimeoutMillis);Xp.context.with(rY.suppressTracing(Xp.context.active()),()=>{let L;if(this._finishedSpans.length<=this._maxExportBatchSize)L=this._finishedSpans,this._finishedSpans=[];else L=this._finishedSpans.splice(0,this._maxExportBatchSize);let I=()=>this._exporter.export(L,(B)=>{if(clearTimeout(A),B.code===rY.ExportResultCode.SUCCESS)H();else $(B.error??Error("BatchSpanProcessor: span export failed"))}),D=null;for(let B=0,f=L.length;B{rY.globalErrorHandler(B),$(B)})})})}_maybeStartTimer(){if(this._isExporting)return;let H=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{if(this._isExporting=!1,this._finishedSpans.length>0)this._clearTimer(),this._maybeStartTimer()}).catch(($)=>{this._isExporting=!1,rY.globalErrorHandler($)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return H();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>H(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}}var Xp,rY;var wUD=K(()=>{Xp=b(kB(),1),rY=b(Kf(),1)});var m0H;var ZUD=K(()=>{wUD();m0H=class m0H extends Q2A{onShutdown(){}}});class _7H{generateTraceId=qUD(16);generateSpanId=qUD(8)}function qUD(H){return function(){for(let A=0;A>>0,A*4);for(let A=0;A0)break;else if(A===H-1)fP$[H-1]=1;return fP$.toString("hex",0,H)}}var fP$;var TUD=K(()=>{fP$=Buffer.allocUnsafe(16)});var zUD=K(()=>{ZUD();TUD()});var W2A=K(()=>{zUD()});class V2A{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(H,$,A,L){let I=YUD($);this._sampler=I.sampler,this._generalLimits=I.generalLimits,this._spanLimits=I.spanLimits,this._idGenerator=$.idGenerator||new _7H,this._resource=A,this._spanProcessor=L,this.instrumentationScope=H}startSpan(H,$={},A=u4.context.active()){if($.root)A=u4.trace.deleteSpan(A);let L=u4.trace.getSpan(A);if(Y7H.isTracingSuppressed(A))return u4.diag.debug("Instrumentation suppressed, returning Noop Span"),u4.trace.wrapSpanContext(u4.INVALID_SPAN_CONTEXT);let I=L?.spanContext(),D=this._idGenerator.generateSpanId(),B,f,E;if(!I||!u4.trace.isSpanContextValid(I))f=this._idGenerator.generateTraceId();else f=I.traceId,E=I.traceState,B=I;let M=$.kind??u4.SpanKind.INTERNAL,G=($.links??[]).map((P)=>{return{context:P.context,attributes:Y7H.sanitizeAttributes(P.attributes)}}),U=Y7H.sanitizeAttributes($.attributes),X=this._sampler.shouldSample(A,f,H,M,U,G);E=X.traceState??E;let J=X.decision===u4.SamplingDecision.RECORD_AND_SAMPLED?u4.TraceFlags.SAMPLED:u4.TraceFlags.NONE,F={traceId:f,spanId:D,traceFlags:J,traceState:E};if(X.decision===u4.SamplingDecision.NOT_RECORD)return u4.diag.debug("Recording is off, propagating context in a non-recording span"),u4.trace.wrapSpanContext(F);let Q=Y7H.sanitizeAttributes(Object.assign(U,X.attributes));return new G2A({resource:this._resource,scope:this.instrumentationScope,context:A,spanContext:F,name:H,kind:M,links:G,parentSpanContext:B,attributes:Q,startTime:$.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(H,$,A,L){let I,D,B;if(arguments.length<2)return;else if(arguments.length===2)B=$;else if(arguments.length===3)I=$,B=A;else I=$,D=A,B=L;let f=D??u4.context.active(),E=this.startSpan(H,I,f),M=u4.trace.setSpan(f,E);return u4.context.with(M,B,void 0,E)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}var u4,Y7H;var NUD=K(()=>{KUD();K2A();W2A();u4=b(kB(),1),Y7H=b(Kf(),1)});class P2A{_spanProcessors;constructor(H){this._spanProcessors=H}forceFlush(){let H=[];for(let $ of this._spanProcessors)H.push($.forceFlush());return new Promise(($)=>{Promise.all(H).then(()=>{$()}).catch((A)=>{OUD.globalErrorHandler(A||Error("MultiSpanProcessor: forceFlush failed")),$()})})}onStart(H,$){for(let A of this._spanProcessors)A.onStart(H,$)}onEnd(H){for(let $ of this._spanProcessors)$.onEnd(H)}shutdown(){let H=[];for(let $ of this._spanProcessors)H.push($.shutdown());return new Promise(($,A)=>{Promise.all(H).then(()=>{$()},A)})}}var OUD;var xUD=K(()=>{OUD=b(Kf(),1)});class $bH{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(H={}){let $=SUD.merge({},BP$(),CUD(H));this._resource=$.resource??jUD.defaultResource(),this._config=Object.assign({},$,{resource:this._resource});let A=[];if(H.spanProcessors?.length)A.push(...H.spanProcessors);this._activeSpanProcessor=new P2A(A)}getTracer(H,$,A){let L=`${H}@${$||""}:${A?.schemaUrl||""}`;if(!this._tracers.has(L))this._tracers.set(L,new V2A({name:H,version:$,schemaUrl:A?.schemaUrl},this._config,this._resource,this._activeSpanProcessor));return this._tracers.get(L)}forceFlush(){let H=this._config.forceFlushTimeoutMillis,$=this._activeSpanProcessor._spanProcessors.map((A)=>{return new Promise((L)=>{let I,D=setTimeout(()=>{L(Error(`Span processor did not completed within timeout period of ${H} ms`)),I=p0H.timeout},H);A.forceFlush().then(()=>{if(clearTimeout(D),I!==p0H.timeout)I=p0H.resolved,L(I)}).catch((B)=>{clearTimeout(D),I=p0H.error,L(B)})})});return new Promise((A,L)=>{Promise.all($).then((I)=>{let D=I.filter((B)=>B!==p0H.resolved);if(D.length>0)L(D);else A()}).catch((I)=>L([I]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}var SUD,jUD,p0H;var RUD=K(()=>{NUD();F2A();xUD();K2A();SUD=b(Kf(),1),jUD=b(sQH(),1);(function(H){H[H.resolved=0]="resolved",H[H.timeout=1]="timeout",H[H.error=2]="error",H[H.unresolved=3]="unresolved"})(p0H||(p0H={}))});class EP${export(H,$){return this._sendSpans(H,$)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(H){return{resource:{attributes:H.resource.attributes},instrumentationScope:H.instrumentationScope,traceId:H.spanContext().traceId,parentSpanContext:H.parentSpanContext,traceState:H.spanContext().traceState?.serialize(),name:H.name,id:H.spanContext().spanId,kind:H.kind,timestamp:AbH.hrTimeToMicroseconds(H.startTime),duration:AbH.hrTimeToMicroseconds(H.duration),attributes:H.attributes,status:H.status,events:H.events,links:H.links}}_sendSpans(H,$){for(let A of H)console.dir(this._exportInfo(A),{depth:3});if($)return $({code:AbH.ExportResultCode.SUCCESS})}}var AbH;var yUD=K(()=>{AbH=b(Kf(),1)});var vUD=K(()=>{RUD();W2A();yUD()});var hUD,bUD,MP$,C7H;var kUD=K(()=>{hUD=b(Lh(),1),bUD=b(Eh(),1),MP$=b(om(),1);C7H=class C7H extends hUD.OTLPExporterBase{constructor(H={}){super(MP$.createOtlpHttpExportDelegate(MP$.convertLegacyHttpOptions(H,"TRACES","v1/traces",{"Content-Type":"application/x-protobuf"}),bUD.ProtobufTraceSerializer))}}});var uUD=K(()=>{kUD()});var gUD=K(()=>{uUD()});var mUD=K(()=>{gUD()});var cUD=z((GP$)=>{Object.defineProperty(GP$,"__esModule",{value:!0});GP$.OTLPTraceExporter=void 0;var pUD=lV$(),lo9=Eh(),io9=Lh();class dUD extends io9.OTLPExporterBase{constructor(H={}){super((0,pUD.createOtlpGrpcExportDelegate)((0,pUD.convertLegacyOtlpGrpcOptions)(H,"TRACES"),lo9.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}}GP$.OTLPTraceExporter=dUD});var lUD=z((UP$)=>{Object.defineProperty(UP$,"__esModule",{value:!0});UP$.OTLPTraceExporter=void 0;var no9=cUD();Object.defineProperty(UP$,"OTLPTraceExporter",{enumerable:!0,get:function(){return no9.OTLPTraceExporter}})});var iUD,nUD,XP$,d0H;var rUD=K(()=>{iUD=b(Lh(),1),nUD=b(Eh(),1),XP$=b(om(),1);d0H=class d0H extends iUD.OTLPExporterBase{constructor(H={}){super(XP$.createOtlpHttpExportDelegate(XP$.convertLegacyHttpOptions(H,"TRACES","v1/traces",{"Content-Type":"application/json"}),nUD.JsonTraceSerializer))}}});var aUD=K(()=>{rUD()});var oUD=K(()=>{aUD()});var tUD=K(()=>{oUD()});class _2A{error(H,...$){r(Error(H))}warn(H,...$){r(Error(H))}info(H,...$){return}debug(H,...$){return}verbose(H,...$){return}}var sUD=K(()=>{_$()});async function ao9(){let H=eG();if(H.error)throw N(`Metrics opt-out check failed: ${H.error}`),Error(`Auth error: ${H.error}`);let $={"Content-Type":"application/json","User-Agent":sG(),...H.headers};try{let L=await nA.get("https://api.anthropic.com/api/claude_code/organizations/metrics_enabled",{headers:$,timeout:5000});return N(`Metrics opt-out API response: enabled=${L.data.metrics_logging_enabled}, vcsLinking=${L.data.vcs_account_linking_enabled}`),{enabled:L.data.metrics_logging_enabled,vcsAccountLinkingEnabled:L.data.vcs_account_linking_enabled,hasError:!1}}catch(A){return N(`Failed to check metrics opt-out status: ${A instanceof Error?A.message:String(A)}`),r(A),{enabled:!1,vcsAccountLinkingEnabled:!1,hasError:!0}}}async function JP$(){try{return await oo9()}catch(H){return N("Metrics check failed, defaulting to disabled"),{enabled:!1,vcsAccountLinkingEnabled:!1,hasError:!0}}}var ro9=3600000,oo9;var Y2A=K(()=>{w1();wwH();_Q();E$();_$();oo9=zGH(ao9,ro9)});class w2A{endpoint;timeout;pendingExports=[];isShutdown=!1;constructor(H={}){this.endpoint="https://api.anthropic.com/api/claude_code/metrics",this.timeout=H.timeout||5000}async export(H,$){if(this.isShutdown){$({code:c0H.ExportResultCode.FAILED,error:Error("Exporter has been shutdown")});return}let A=this.doExport(H,$);this.pendingExports.push(A),A.finally(()=>{let L=this.pendingExports.indexOf(A);if(L>-1)this.pendingExports.splice(L,1)})}async doExport(H,$){try{if(!(XG(!0)||tI())){N("BigQuery metrics export: trust not established, skipping"),$({code:c0H.ExportResultCode.SUCCESS});return}if(!(await JP$()).enabled){N("Metrics export disabled by organization setting"),$({code:c0H.ExportResultCode.SUCCESS});return}let I=this.transformMetricsForInternal(H),D=eG();if(D.error){N(`Metrics export failed: ${D.error}`),$({code:c0H.ExportResultCode.FAILED,error:Error(D.error)});return}let B={"Content-Type":"application/json","User-Agent":sG(),...D.headers},f=await nA.post(this.endpoint,I,{timeout:this.timeout,headers:B});N("BigQuery metrics exported successfully"),N(`BigQuery API Response: ${yH(f.data,null,2)}`),$({code:c0H.ExportResultCode.SUCCESS})}catch(A){N(`BigQuery metrics export failed: ${A instanceof Error?A.message:String(A)}`),r(A),$({code:c0H.ExportResultCode.FAILED,error:A instanceof Error?A:Error("Unknown export error")})}}transformMetricsForInternal(H){let $=H.resource.attributes,A={"service.name":$["service.name"]||"claude-code","service.version":$["service.version"]||"unknown","os.type":$["os.type"]||"unknown","os.version":$["os.version"]||"unknown","host.arch":$["host.arch"]||"unknown","aggregation.temporality":this.selectAggregationTemporality()===C2A.AggregationTemporality.DELTA?"delta":"cumulative"};if($["wsl.version"])A["wsl.version"]=$["wsl.version"];if(nL()){A["user.customer_type"]="claude_ai";let I=f0();if(I)A["user.subscription_type"]=I}else A["user.customer_type"]="api";return{resource_attributes:A,metrics:H.scopeMetrics.flatMap((I)=>I.metrics.map((D)=>({name:D.descriptor.name,description:D.descriptor.description,unit:D.descriptor.unit,data_points:this.extractDataPoints(D)})))}}extractDataPoints(H){return(H.dataPoints||[]).filter((A)=>typeof A.value==="number").map((A)=>({attributes:this.convertAttributes(A.attributes),value:A.value,timestamp:this.hrTimeToISOString(A.endTime||A.startTime||[Date.now()/1000,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),N("BigQuery metrics exporter shutdown complete")}async forceFlush(){await Promise.all(this.pendingExports),N("BigQuery metrics exporter flush complete")}convertAttributes(H){let $={};if(H){for(let[A,L]of Object.entries(H))if(L!==void 0&&L!==null)$[A]=String(L)}return $}hrTimeToISOString(H){let[$,A]=H;return new Date($*1000+A/1e6).toISOString()}selectAggregationTemporality(){return C2A.AggregationTemporality.DELTA}}var C2A,c0H;var eUD=K(()=>{w1();E$();_$();_Q();Y2A();EI();vA();g$();Z$();C2A=b(Yo(),1),c0H=b(Kf(),1)});var z2A={};XA(z2A,{isTelemetryEnabled:()=>FP$,initializeTelemetry:()=>It9,flushTelemetry:()=>Dt9,bootstrapTelemetry:()=>f4D});function f4D(){if(!process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE)process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="delta"}function so9(){let H=(process.env.OTEL_METRICS_EXPORTER||"").trim().split(",").filter(Boolean),$=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||to9.toString()),A=[];for(let L of H)if(L==="console"){let I=new LbH.ConsoleMetricExporter,D=I.export.bind(I);I.export=(B,f)=>{if(B.resource&&B.resource.attributes)N(` `);return D(B,f)},A.push(I)}else if(L==="otlp"){let I=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),D=T2A();switch(I){case"grpc":A.push(new H4D.OTLPMetricExporter);break;case"http/json":A.push(new $4D.OTLPMetricExporter(D));break;case"http/protobuf":A.push(new jWH(D));break;default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${I}`)}}else if(L==="prometheus")A.push(new A4D.PrometheusExporter);else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${L}`);return A.map((L)=>{if("export"in L)return new q2A.PeriodicExportingMetricReader({exporter:L,exportIntervalMillis:$});return L})}function eo9(){let H=(process.env.OTEL_LOGS_EXPORTER||"").trim().split(",").filter(Boolean),$=[];for(let A of H)if(A==="console")$.push(new lW$);else if(A==="otlp"){let L=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),I=T2A();switch(L){case"grpc":$.push(new L4D.OTLPLogExporter);break;case"http/json":$.push(new k0H(I));break;case"http/protobuf":$.push(new V7H(I));break;default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${L}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${A}`);return $}function Ht9(){let H=(process.env.OTEL_TRACES_EXPORTER||"").trim().split(",").filter(Boolean),$=[];for(let A of H)if(A==="console")$.push(new EP$);else if(A==="otlp"){let L=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),I=T2A();switch(L){case"grpc":$.push(new I4D.OTLPTraceExporter);break;case"http/json":$.push(new d0H(I));break;case"http/protobuf":$.push(new C7H(I));break;default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${L}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${A}`);return $}function FP$(){return A$(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function $t9(){let H=new w2A;return new q2A.PeriodicExportingMetricReader({exporter:H,exportIntervalMillis:300000})}function At9(){let H=f0(),$=nL()&&(H==="enterprise"||H==="team");return EmL()||$}function Lt9(H){let $=process.env.BETA_TRACING_ENDPOINT;if(!$)return;let A={url:`${$}/v1/traces`},L={url:`${$}/v1/logs`},I=new d0H(A),D=new m0H(I,{scheduledDelayMillis:B4D}),B=new $bH({resource:H,spanProcessors:[D]});l0H.trace.setGlobalTracerProvider(B),llH(B);let f=new k0H(L),E=new $0H({resource:H,processors:[new lm(f,{scheduledDelayMillis:D4D})]});fvH.setGlobalLoggerProvider(E),plH(E);let M=fvH.getLogger("com.anthropic.claude_code.events",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION);dlH(M),process.on("beforeExit",async()=>{await E?.forceFlush(),await B?.forceFlush()}),process.on("exit",()=>{E?.forceFlush(),B?.forceFlush()})}function It9(){_0("telemetry_init_start"),f4D(),l0H.diag.setLogger(new _2A,l0H.DiagLogLevel.ERROR),WhI();let H=[];if(FP$())H.push(...so9());if(At9())H.push($t9());let $=oA(),A={[lo.ATTR_SERVICE_NAME]:"claude-code",[lo.ATTR_SERVICE_VERSION]:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION};if($==="wsl"){let X=U$H();if(X)A["wsl.version"]=X}let L=WS.resourceFromAttributes(A),I=WS.resourceFromAttributes(WS.osDetector.detect().attributes||{}),D=WS.hostDetector.detect(),B=D.attributes?.[lo.SEMRESATTRS_HOST_ARCH]?{[lo.SEMRESATTRS_HOST_ARCH]:D.attributes[lo.SEMRESATTRS_HOST_ARCH]}:{},f=WS.resourceFromAttributes(B),E=WS.resourceFromAttributes(WS.envDetector.detect().attributes||{}),M=L.merge(I).merge(f).merge(E);if(zF()){Lt9(M);let X=new LbH.MeterProvider({resource:M,views:[],readers:H});return clH(X),PB(async()=>{let F=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||"2000");try{jyH();let Q=bYH(),W=WHH(),P=[];if(Q)P.push(Q.forceFlush());if(W)P.push(W.forceFlush());await Promise.all(P);let C=[X.shutdown()];if(Q)C.push(Q.shutdown());if(W)C.push(W.shutdown());await Promise.race([Promise.all(C),new Promise((Y,Z)=>setTimeout(()=>Z(Error("OpenTelemetry shutdown timeout")),F))])}catch{}}),X.getMeter("com.anthropic.claude_code",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)}let G=new LbH.MeterProvider({resource:M,views:[],readers:H});if(clH(G),FP$()){let X=eo9();if(X.length>0){let J=new $0H({resource:M,processors:X.map((Q)=>new lm(Q,{scheduledDelayMillis:parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||D4D.toString())}))});fvH.setGlobalLoggerProvider(J),plH(J);let F=fvH.getLogger("com.anthropic.claude_code.events",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION);dlH(F),process.on("beforeExit",async()=>{await J?.forceFlush(),await WHH()?.forceFlush()}),process.on("exit",()=>{J?.forceFlush(),WHH()?.forceFlush()})}}if(FP$()&&p6A()){let X=Ht9();if(X.length>0){let J=X.map((Q)=>new m0H(Q,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||B4D.toString())})),F=new $bH({resource:M,spanProcessors:J});l0H.trace.setGlobalTracerProvider(F),llH(F)}}return PB(async()=>{let X=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||"2000");try{jyH();let J=[G.shutdown()],F=bYH();if(F)J.push(F.shutdown());let Q=WHH();if(Q)J.push(Q.shutdown());await Promise.race([Promise.all(J),new Promise((W,P)=>setTimeout(()=>P(Error("OpenTelemetry shutdown timeout")),X))])}catch(J){if(J instanceof Error&&J.message.includes("timeout"))N(` `,{level:"error"});throw J}}),G.getMeter("com.anthropic.claude_code",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)}async function Dt9(){let H=Hj$();if(!H)return;let $=parseInt(process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS||"5000");try{let A=[H.forceFlush()],L=bYH();if(L)A.push(L.forceFlush());let I=WHH();if(I)A.push(I.forceFlush());await Promise.race([Promise.all(A),new Promise((D,B)=>setTimeout(()=>B(Error("OpenTelemetry flush timeout")),$))]),N("Telemetry flushed successfully")}catch(A){if(A instanceof Error&&A.message.includes("timeout"))N(`Telemetry flush timed out after ${$}ms. Some metrics may not be exported.`,{level:"warn"});else N(`Telemetry flush failed: ${A instanceof Error?A.message:String(A)}`,{level:"error"})}}function Bt9(){let H={},$=process.env.OTEL_EXPORTER_OTLP_HEADERS;if($)for(let A of $.split(",")){let[L,...I]=A.split("=");if(L&&I.length>0)H[L.trim()]=I.join("=").trim()}return H}function T2A(){let H=Ku(),$=sN(),A=VL(),L={},I=Bt9();if(A?.otelHeadersHelper)L.headers=async()=>{let f=GmL();return{...I,...f}};else if(Object.keys(I).length>0)L.headers=async()=>I;let D=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!H||D&&JqH(D)){if($)L.httpAgentOptions=$;return L}let B=(f)=>{return $?new Z2A.HttpsProxyAgent(H,{cert:$.cert,key:$.key,passphrase:$.passphrase}):new Z2A.HttpsProxyAgent(H)};return L.httpAgentOptions=B,L}var l0H,LbH,H4D,$4D,A4D,q2A,L4D,I4D,WS,lo,Z2A,to9=60000,D4D=5000,B4D=5000;var N2A=K(()=>{qVA();H1D();IPA();LUD();JUD();vUD();mUD();tUD();sUD();eUD();ZE();nR();EI();g$();Lo();OK$();Z9();EI();mL();E$();hc();H4H();NA();Z$();SyH();l0H=b(kB(),1),LbH=b(Yo(),1),H4D=b(iGD(),1),$4D=b(c6$(),1),A4D=b(tGD(),1),q2A=b(Yo(),1),L4D=b(fUD(),1),I4D=b(lUD(),1),WS=b(sQH(),1),lo=b(rBH(),1),Z2A=b(UqH(),1)});var E4D={};XA(E4D,{performLogout:()=>KP$,clearAuthRelatedCaches:()=>IbH,call:()=>ft9});async function KP$({clearOnboarding:H=!1}){let{flushTelemetry:$}=await Promise.resolve().then(() => (N2A(),z2A));await $(),await BmL(),hW().delete(),IbH(),AA((L)=>{let I={...L};if(H){if(I.hasCompletedOnboarding=!1,I.subscriptionNoticeCount=0,I.hasAvailableSubscription=!1,I.customApiKeyResponses?.approved)I.customApiKeyResponses={...I.customApiKeyResponses,approved:[]}}return I.oauthAccount=void 0,I})}async function ft9(){await KP$({clearOnboarding:!0});let H=O2A.createElement(V,null,"Successfully logged out from your Anthropic account.");return setTimeout(()=>{L9(0,"logout")},200),H}var O2A,IbH=()=>{dD.cache?.clear?.(),CeH(),nm.cache?.clear?.(),M4D(),Wo.cache?.clear?.(),CPA(),r4A()};var QP$=K(()=>{vA();xH();EI();KeH();$q();ELH();UU();DWH();zvH();XY();SD();O2A=b(s(),1)});class DbH{codeVerifier;authCodeListener=null;port=null;manualAuthCodeResolver=null;constructor(){this.codeVerifier=XrI()}async startOAuthFlow(H,$){this.authCodeListener=new _VA,this.port=await this.authCodeListener.start();let A=JrI(this.codeVerifier),L=FrI(),I={codeChallenge:A,state:L,port:this.port,loginWithClaudeAi:$?.loginWithClaudeAi,inferenceOnly:$?.inferenceOnly,orgUUID:$?.orgUUID},D=sd$({...I,isManual:!0}),B=sd$({...I,isManual:!1}),f=await this.waitForAuthorizationCode(L,async()=>{await H(D),await HE(B)}),E=this.authCodeListener?.hasPendingResponse()??!1;c("tengu_oauth_auth_code_received",{automatic:E});try{let M=await d1L(f,L,this.codeVerifier,this.port,!E,$?.expiresIn);await KP$({clearOnboarding:!1});let G=await ed$(M.access_token);if(M.account)Hc$({accountUuid:M.account.uuid,emailAddress:M.account.email_address,organizationUuid:M.organization?.uuid,displayName:G.displayName,hasExtraUsageEnabled:G.hasExtraUsageEnabled??void 0,billingType:G.billingType??void 0,subscriptionCreatedAt:G.subscriptionCreatedAt});if(E){let U=VeH(M.scope);this.authCodeListener?.handleSuccessRedirect(U)}return this.formatTokens(M,G.subscriptionType,G.rateLimitTier)}catch(M){if(E)this.authCodeListener?.handleErrorRedirect();throw M}finally{this.authCodeListener?.close()}}async waitForAuthorizationCode(H,$){return new Promise((A,L)=>{this.manualAuthCodeResolver=A,this.authCodeListener?.waitForAuthorization(H,$).then((I)=>{this.manualAuthCodeResolver=null,A(I)}).catch((I)=>{this.manualAuthCodeResolver=null,L(I)})})}handleManualAuthCodeInput(H){if(this.manualAuthCodeResolver)this.manualAuthCodeResolver(H.authorizationCode),this.manualAuthCodeResolver=null,this.authCodeListener?.close()}formatTokens(H,$,A){return{accessToken:H.access_token,refreshToken:H.refresh_token,expiresAt:Date.now()+H.expires_in*1000,scopes:VeH(H.scope),subscriptionType:$,rateLimitTier:A}}cleanup(){this.authCodeListener?.close(),this.manualAuthCodeResolver=null}}var x2A=K(()=>{F3();UrI();KrI();Hq();QP$();z$()});async function Et9(){try{if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY))return!0;return await nA.get("https://api.anthropic.com/api/hello",{timeout:5000,headers:{"Cache-Control":"no-cache"}}),!0}catch(H){if(!(H instanceof tsA))return!0;return H.code!=="EHOSTUNREACH"}}function S2A(){let[H,$]=WP$.useState(null);return WP$.useEffect(()=>{let A=!0;if(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return;let L=async()=>{if(!A)return;let D=await Et9();if(A)$(D)};L();let I=setInterval(L,Mt9);return()=>{A=!1,clearInterval(I)}},[]),{isConnected:H}}var WP$,Mt9=30000;var G4D=K(()=>{w1();NA();WP$=b(s(),1)});class w7H{activeOperations=new Set;lastUserActivityTime=0;lastCLIRecordedTime=Date.now();isCLIActive=!1;USER_ACTIVITY_TIMEOUT_MS=5000;static instance=null;static getInstance(){if(!w7H.instance)w7H.instance=new w7H;return w7H.instance}recordUserActivity(){if(!this.isCLIActive&&this.lastUserActivityTime!==0){let $=(Date.now()-this.lastUserActivityTime)/1000;if($>0){let A=mlH();if(A){let L=this.USER_ACTIVITY_TIMEOUT_MS/1000;if($0){let L=mlH();if(L)L.add(A,{type:"cli"})}this.lastCLIRecordedTime=$,this.isCLIActive=!1}}async trackOperation(H,$){this.startCLIActivity(H);try{return await $()}finally{this.endCLIActivity(H)}}getActivityStates(){return{isUserActive:(Date.now()-this.lastUserActivityTime)/1000{g$();BbH=w7H.getInstance()});function U4D(){let $=GB().spinnerVerbs;if(!$)return i0H;if($.mode==="replace")return $.verbs.length>0?$.verbs:i0H;return[...i0H,...$.verbs]}var i0H;var VP$=K(()=>{mL();i0H=["Accomplishing","Actioning","Actualizing","Architecting","Baking","Beaming","Beboppin'","Befuddling","Billowing","Blanching","Bloviating","Boogieing","Boondoggling","Booping","Bootstrapping","Brewing","Burrowing","Calculating","Canoodling","Caramelizing","Cascading","Catapulting","Cerebrating","Channeling","Channelling","Choreographing","Churning","Clauding","Coalescing","Cogitating","Combobulating","Composing","Computing","Concocting","Considering","Contemplating","Cooking","Crafting","Creating","Crunching","Crystallizing","Cultivating","Deciphering","Deliberating","Determining","Dilly-dallying","Discombobulating","Doing","Doodling","Drizzling","Ebbing","Effecting","Elucidating","Embellishing","Enchanting","Envisioning","Evaporating","Fermenting","Fiddle-faddling","Finagling","Flamb\xE9ing","Flibbertigibbeting","Flowing","Flummoxing","Fluttering","Forging","Forming","Frolicking","Frosting","Gallivanting","Galloping","Garnishing","Generating","Germinating","Gitifying","Grooving","Gusting","Harmonizing","Hashing","Hatching","Herding","Honking","Hullaballooing","Hyperspacing","Ideating","Imagining","Improvising","Incubating","Inferring","Infusing","Ionizing","Jitterbugging","Julienning","Kneading","Leavening","Levitating","Lollygagging","Manifesting","Marinating","Meandering","Metamorphosing","Misting","Moonwalking","Moseying","Mulling","Mustering","Musing","Nebulizing","Nesting","Newspapering","Noodling","Nucleating","Orbiting","Orchestrating","Osmosing","Perambulating","Percolating","Perusing","Philosophising","Photosynthesizing","Pollinating","Pondering","Pontificating","Pouncing","Precipitating","Prestidigitating","Processing","Proofing","Propagating","Puttering","Puzzling","Quantumizing","Razzle-dazzling","Razzmatazzing","Recombobulating","Reticulating","Roosting","Ruminating","Saut\xE9ing","Scampering","Schlepping","Scurrying","Seasoning","Shenaniganing","Shimmying","Simmering","Skedaddling","Sketching","Slithering","Smooshing","Sock-hopping","Spelunking","Spinning","Sprouting","Stewing","Sublimating","Swirling","Swooping","Symbioting","Synthesizing","Tempering","Thinking","Thundering","Tinkering","Tomfoolering","Topsy-turvying","Transfiguring","Transmuting","Twisting","Undulating","Unfurling","Unravelling","Vibing","Waddling","Wandering","Warping","Whatchamacalliting","Whirlpooling","Whirring","Whisking","Wibbling","Working","Wrangling","Zesting","Zigzagging"]});function io({todos:H,isStandalone:$=!1}){if(H.length===0)return null;let A=g4.createElement(g4.Fragment,null,H.map((L,I)=>{let D=L.status==="completed"?pH.checkboxOn:pH.checkboxOff;return g4.createElement(x,{key:I},g4.createElement(V,{dimColor:L.status==="completed"},D," "),g4.createElement(V,{bold:L.status==="in_progress",dimColor:L.status==="completed",strikethrough:L.status==="completed"},L.content))}));if($)return g4.createElement(x,{flexDirection:"column",marginTop:1,marginLeft:2},g4.createElement(x,null,g4.createElement(V,{bold:!0,dimColor:!0},"Todos"),g4.createElement(V,{dimColor:!0}," \xB7 ",g4.createElement(s$,{shortcut:"ctrl+t",action:"hide todos",bold:!0}))),A);return g4.createElement(x,{flexDirection:"column"},A)}var g4;var fbH=K(()=>{xH();jI();lB();g4=b(s(),1)});function PP$(H,$){let A=parseInt(H.id,10),L=parseInt($.id,10);if(!isNaN(A)&&!isNaN(L))return A-L;return H.id.localeCompare($.id)}function _P$({tasks:H,isStandalone:$=!1}){let A=J$((h)=>h.teamContext),L=J$((h)=>h.tasks),I=Object.values(L).some((h)=>b4(h)&&h.status==="running"),[,D]=uB.useState(0),{rows:B,columns:f}=QL(),E=B<=10?0:Math.min(10,Math.max(3,B-14)),M=new Set(H.filter((h)=>h.status==="completed").map((h)=>h.id)),G=Date.now();for(let h of M)if(!J4D.has(h))Z7H.set(h,G);for(let h of Z7H.keys())if(!M.has(h))Z7H.delete(h);if(J4D=M,uB.useEffect(()=>{if(Z7H.size===0)return;let h=Date.now(),p=1/0;for(let k of Z7H.values()){let n=k+X4D;if(n>h&&nD((k)=>k+1),p-h);return()=>clearTimeout(d)},[H]),!HU())return null;if(H.length===0)return null;let U={};if(dL()&&A?.teammates){for(let h of Object.values(A.teammates))if(h.color){let p=b5[h.color];if(p)U[h.name]=p}}let X={},J=new Set;if(dL()){for(let h of Object.values(L))if(b4(h)&&h.status==="running"){J.add(h.identity.agentName),J.add(h.identity.agentId);let p=h.progress?.recentActivities,d=(p&&kv(p))??h.progress?.lastActivity?.activityDescription;if(d)X[h.identity.agentName]=d,X[h.identity.agentId]=d}}let F=H.filter((h)=>h.status==="completed").length,Q=H.filter((h)=>h.status==="pending").length,W=H.length-F-Q,P=new Set(H.filter((h)=>h.status!=="completed").map((h)=>h.id)),C=[],Y=[];for(let h of H.filter((p)=>p.status==="completed")){let p=Z7H.get(h.id);if(p&&G-ph.status==="in_progress").sort(PP$),q=H.filter((h)=>h.status==="pending").sort((h,p)=>{let d=h.blockedBy.some((n)=>P.has(n)),k=p.blockedBy.some((n)=>P.has(n));if(d!==k)return d?1:-1;return PP$(h,p)}),O=[...C,...Z,...q,...Y],j=O.slice(0,E),u=O.slice(E),y="";if(u.length>0){let h=[],p=u.filter((n)=>n.status==="pending").length,d=u.filter((n)=>n.status==="in_progress").length,k=u.filter((n)=>n.status==="completed").length;if(d>0)h.push(`${d} in progress`);if(p>0)h.push(`${p} pending`);if(k>0)h.push(`${k} completed`);y=` \u2026 +${h.join(", ")}`}let g=uB.createElement(uB.Fragment,null,j.map((h)=>uB.createElement(Ut9,{key:h.id,task:h,ownerColor:h.owner?U[h.owner]:void 0,openBlockers:h.blockedBy.filter((p)=>P.has(p)),activity:h.owner?X[h.owner]:void 0,ownerActive:h.owner?J.has(h.owner):!1,columns:f})),E>0&&y&&uB.createElement(V,{dimColor:!0},y));if($)return uB.createElement(x,{flexDirection:"column",marginTop:1,marginLeft:2},uB.createElement(x,null,uB.createElement(V,{dimColor:!0},uB.createElement(V,{bold:!0},H.length)," tasks (",uB.createElement(V,{bold:!0},F)," done, ",W>0&&uB.createElement(uB.Fragment,null,uB.createElement(V,{bold:!0},W)," in progress, "),uB.createElement(V,{bold:!0},Q)," open)"),uB.createElement(V,{dimColor:!0}," \xB7 ",uB.createElement(s$,{shortcut:"ctrl+t",action:I?"show teammates":"hide tasks",bold:!0}))),g);return uB.createElement(x,{flexDirection:"column"},g)}function Gt9(H){switch(H){case"completed":return{icon:pH.tick,color:"success"};case"in_progress":return{icon:pH.squareSmallFilled,color:"claude"};case"pending":return{icon:pH.squareSmall,color:void 0}}}function F4D(H,$){if(GI(H)<=$)return H;let A=H;while(GI(A+"\u2026")>$&&A.length>0)A=A.slice(0,-1);return A+"\u2026"}function Ut9({task:H,ownerColor:$,openBlockers:A,activity:L,ownerActive:I,columns:D}){let B=H.status==="completed",f=H.status==="in_progress",E=A.length>0,{icon:M,color:G}=Gt9(H.status),U=f&&!E&&L,X=D>=60&&H.owner&&I,J=X?GI(` (@${H.owner})`):0,F=Math.max(15,D-15-J),Q=F4D(H.subject,F),W=Math.max(15,D-15),P=L?F4D(L,W):void 0;return uB.createElement(x,{flexDirection:"column"},uB.createElement(x,null,uB.createElement(V,{color:G},M," "),uB.createElement(V,{bold:f,strikethrough:B,dimColor:B||E},Q),X&&uB.createElement(V,{dimColor:!0}," (",$?uB.createElement(V,{color:$},"@",H.owner):`@${H.owner}`,")"),E&&uB.createElement(V,{dimColor:!0}," ",pH.pointerSmall," blocked by"," ",[...A].sort((C,Y)=>parseInt(C,10)-parseInt(Y,10)).map((C)=>`#${C}`).join(", "))),U&&P&&uB.createElement(x,null,uB.createElement(V,{dimColor:!0}," ",P,pH.ellipsis)))}var uB,X4D=30000,Z7H,J4D;var R2A=K(()=>{xH();jI();JG();pL();q7();BNH();lB();T8();OB();hx();DJ();uB=b(s(),1);Z7H=new Map,J4D=new Set});function wP$(){let H=J$((A)=>A.teamContext),[,$]=YP$.useState(0);if(YP$.useEffect(()=>{if(!HU()||H&&!tW(H))return;X7A();let A=null,L=null,I=null,D=null;function B(){let U=sW(),X=GF(U).filter((F)=>!F.metadata?._internal);q7H=X;let J=X.some((F)=>F.status!=="completed");if(J||X.length===0){if(n0H=null,A)clearTimeout(A),A=null}else if(n0H===null)n0H=Date.now(),A=setTimeout(()=>{let F=GF(U);if(F.length>0&&F.every((W)=>W.status==="completed"))m9$(U),q7H=[],n0H=null;$((W)=>W+1)},K4D);if($((F)=>F+1),I)clearTimeout(I),I=null;if(J)I=setTimeout(f,Jt9)}function f(){if(L)clearTimeout(L);L=setTimeout(B,Xt9)}B();let E=soL(f),M=sW(),G=jq(M);if(CP$.existsSync(G))try{D=CP$.watch(G,f)}catch{}return()=>{if(q7H=void 0,n0H=null,E(),D)D.close();if(I)clearTimeout(I);if(L)clearTimeout(L);if(A)clearTimeout(A)}},[H]),!q7H||q7H.length===0)return;if(n0H!==null&&Date.now()-n0H>=K4D)return;return q7H}var YP$,CP$,K4D=5000,Xt9=50,Jt9=5000,n0H=null,q7H=void 0;var y2A=K(()=>{JG();jv();XE();pL();YP$=b(s(),1),CP$=require("fs")});function EbH(){if(process.env.TERM==="xterm-ghostty")return["\xB7","\u2722","\u2733","\u2736","\u273B","*"];return["\xB7","\u2722","*","\u2736","\u273B","\u273D"]}function Jp(H,$,A){return{r:Math.round(H.r+($.r-H.r)*A),g:Math.round(H.g+($.g-H.g)*A),b:Math.round(H.b+($.b-H.b)*A)}}function no(H){return`rgb(${H.r},${H.g},${H.b})`}function r0H(H){let $=Q4D.get(H);if($!==void 0)return $;let A=H.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/),L=A?{r:parseInt(A[1],10),g:parseInt(A[2],10),b:parseInt(A[3],10)}:null;return Q4D.set(H,L),L}var Q4D;var T7H=K(()=>{Q4D=new Map});var Ft9;var W4D=K(()=>{xH();Ky();T7H();Ft9=b(s(),1)});function h2A({char:H,index:$,glimmerIndex:A,messageColor:L,shimmerColor:I}){let D=$===A,B=Math.abs($-A)===1;return v2A.createElement(V,{color:D||B?I:L},H)}var v2A;var ZP$=K(()=>{xH();v2A=b(s(),1)});function b2A({message:H,mode:$,isConnected:A,messageColor:L,glimmerIndex:I,flashOpacity:D,shimmerColor:B,stalledIntensity:f=0}){let[E]=_I(),M=c6(E);if(!H)return null;if(A===!1)return gB.createElement(V,{color:L},H," ");if(f>0){let Q=M[L],W=Q?r0H(Q):null;if(W){let C=Jp(W,Kt9,f),Y=no(C);return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:Y},H),gB.createElement(V,{color:Y}," "))}let P=f>0.5?"error":L;return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:P},H),gB.createElement(V,{color:P}," "))}if($==="tool-use"){let Q=M[L],W=M[B],P=Q?r0H(Q):null,C=W?r0H(W):null;if(P&&C){let Z=Jp(P,C,D);return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:no(Z)},H),gB.createElement(V,{color:L}," "))}let Y=D>0.5?B:L;return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:Y},H),gB.createElement(V,{color:L}," "))}let G=I-1,U=I+1;if(G>=H.length||U<0)return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:L},H),gB.createElement(V,{color:L}," "));let X=G>0?H.slice(0,G):"",J=H.slice(Math.max(0,G),U+1),F=U+1{xH();Ky();T7H();gB=b(s(),1),Kt9={r:171,g:43,b:63}});function MbH({frame:H,messageColor:$,stalledIntensity:A=0,isConnected:L,reducedMotion:I=!1,time:D=0}){let[B]=_I(),f=c6(B);if(I){let M=Math.floor(D/(Wt9/2))%2===1;return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:$,dimColor:M},Qt9))}let E=_4D[H%_4D.length];if(L===!1)return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:$},E));if(A>0){let M=f[$],G=M?r0H(M):null;if(G){let X=Jp(G,Vt9,A);return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:no(X)},E))}let U=A>0.5?"error":$;return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:U},E))}return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:$},E))}var ZJ,P4D,_4D,Qt9="\u25CF",Wt9=2000,Vt9;var k2A=K(()=>{xH();Ky();T7H();ZJ=b(s(),1),P4D=EbH(),_4D=[...P4D,...[...P4D].reverse()],Vt9={r:171,g:43,b:63}});function GbH(H,$,A,L){let I=H==="requesting"?50:200,[D,B]=DT(I);if(A===!1||L)return[D,-100];let f=Math.floor(B/I),E=$.length+20;if(H==="requesting")return[D,f%E-10];return[D,$.length+10-f%E]}var qP$=K(()=>{xH()});function u2A(H,$,A=!1,L=!1){let I=z7H.useRef(H),D=z7H.useRef($),B=z7H.useRef(H),f=z7H.useRef(0),E=z7H.useRef(H);if($>D.current)I.current=H,D.current=$,f.current=0,E.current=H;let M;if(A)M=0,I.current=H;else if($>0)M=H-I.current;else M=H-B.current;let G=M>3000&&!A,U=G?Math.min((M-3000)/2000,1):0;if(!L&&(U>0||f.current>0)){let J=H-E.current;if(J>=50){let F=Math.floor(J/50),Q=f.current;for(let W=0;W{z7H=b(s(),1)});var C4D=K(()=>{W4D();ZP$();V4D();k2A();qP$();Y4D();T7H()});function _w(H,$){return`${H}@${$}`}function a0H(H){let $=H.indexOf("@");if($===-1)return null;return{agentName:H.slice(0,$),teamName:H.slice($+1)}}function N7H(H,$){let A=Date.now();return`${H}-${A}@${$}`}function w4D(H){return H.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()}function TP$(H){return ro.join(P6(),w4D(H))}function yF(H){let $=ro.join(TP$(H),"config.json");if(!Kp.existsSync($))return null;try{let A=Kp.readFileSync($,"utf-8");return DA(A)}catch(A){return N(`[TeammateTool] Failed to read team file for ${H}: ${A instanceof Error?A.message:String(A)}`),null}}function UbH(H,$){let A=TP$(H);Kp.mkdirSync(A,{recursive:!0});let L=ro.join(A,"config.json");iL(L,yH($,null,2))}function O7H(H,$){let A=$.agentId||$.name;if(!A)return N("[TeammateTool] removeTeammateFromTeamFile called with no identifier"),!1;let L=yF(H);if(!L)return N(`[TeammateTool] Cannot remove teammate ${A}: failed to read team file for "${H}"`),!1;let I=L.members.length;if(L.members=L.members.filter((D)=>{if($.agentId&&D.agentId===$.agentId)return!1;if($.name&&D.name===$.name)return!1;return!0}),L.members.length===I)return N(`[TeammateTool] Teammate ${A} not found in team file for "${H}"`),!1;return UbH(H,L),N(`[TeammateTool] Removed teammate from team file: ${A}`),!0}function Pt9(H){return yF(H)?.hiddenPaneIds??[]}function Z4D(H,$){return Pt9(H).includes($)}function q4D(H,$){let A=yF(H);if(!A)return!1;let L=A.members.findIndex((I)=>I.tmuxPaneId===$);if(L===-1)return!1;if(A.members.splice(L,1),A.hiddenPaneIds){let I=A.hiddenPaneIds.indexOf($);if(I!==-1)A.hiddenPaneIds.splice(I,1)}return UbH(H,A),N(`[TeammateTool] Removed member with pane ${$} from team ${H}`),!0}function T4D(H,$){let A=yF(H);if(!A)return!1;let L=A.members.findIndex((I)=>I.agentId===$);if(L===-1)return!1;return A.members.splice(L,1),UbH(H,A),N(`[TeammateTool] Removed member ${$} from team ${H}`),!0}function XbH(H,$,A){let L=yF(H);if(!L)return!1;let I=L.members.find((B)=>B.name===$);if(!I)return N(`[TeammateTool] Cannot set member mode: member ${$} not found in team ${H}`),!1;if(I.mode===A)return!0;let D=L.members.map((B)=>B.name===$?{...B,mode:A}:B);return UbH(H,{...L,members:D}),N(`[TeammateTool] Set member ${$} in team ${H} to mode: ${A}`),!0}function z4D(H,$){if(!tf())return;let A=$??g9(),L=g1();if(A&&L)XbH(A,L,H)}function N4D(H,$){let A=yF(H);if(!A)return!1;let L=new Map($.map((B)=>[B.memberName,B.mode])),I=!1,D=A.members.map((B)=>{let f=L.get(B.name);if(f!==void 0&&B.mode!==f)return I=!0,{...B,mode:f};return B});if(I)UbH(H,{...A,members:D}),N(`[TeammateTool] Set ${$.length} member modes in team ${H}`);return!0}async function zP$(H,$,A){let L=TP$(H),I=ro.join(L,"config.json"),D;try{let f=await Fp.readFile(I,"utf-8");D=DA(f)}catch{N(`[TeammateTool] Cannot set member active: team ${H} not found`);return}let B=D.members.find((f)=>f.name===$);if(!B){N(`[TeammateTool] Cannot set member active: member ${$} not found in team ${H}`);return}if(B.isActive===A)return;B.isActive=A,await Fp.mkdir(L,{recursive:!0}),await Fp.writeFile(I,yH(D,null,2)),N(`[TeammateTool] Set member ${$} in team ${H} to ${A?"active":"idle"}`)}async function _t9(H){let $=ro.join(H,".git"),A=null;try{let I=Kp.readFileSync($,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(I&&I[1]){let D=I[1],B=ro.join(D,"..","..");A=ro.join(B,"..")}}catch{}if(A){let L=await pD(cB(),["worktree","remove","--force",H],{cwd:A});if(L.code===0){N(`[TeammateTool] Removed worktree via git: ${H}`);return}if(L.stderr?.includes("not a working tree")){N(`[TeammateTool] Worktree already removed: ${H}`);return}N(`[TeammateTool] git worktree remove failed, falling back to rm: ${L.stderr}`)}try{Kp.rmSync(H,{recursive:!0,force:!0}),N(`[TeammateTool] Removed worktree directory manually: ${H}`)}catch(L){N(`[TeammateTool] Failed to remove worktree ${H}: ${L instanceof Error?L.message:String(L)}`)}}async function O4D(H){let $=w4D(H),A=yF(H),L=[];if(A){for(let B of A.members)if(B.worktreePath)L.push(B.worktreePath)}for(let B of L)await _t9(B);let I=TP$(H);try{await Fp.rm(I,{recursive:!0,force:!0}),N(`[TeammateTool] Cleaned up team directory: ${I}`)}catch(B){N(`[TeammateTool] Failed to clean up team directory ${I}: ${B instanceof Error?B.message:String(B)}`)}let D=jq($);try{await Fp.rm(D,{recursive:!0,force:!0}),N(`[TeammateTool] Cleaned up tasks directory: ${D}`),C5H()}catch(B){N(`[TeammateTool] Failed to clean up tasks directory ${D}: ${B instanceof Error?B.message:String(B)}`)}}var ro,Kp,Fp,zOE;var aY=K(()=>{mI();NA();Z$();E$();Z$();XE();B0();JG();t8();ro=require("path"),Kp=require("fs"),Fp=require("fs/promises"),zOE=S.strictObject({operation:S.enum(["spawnTeam","cleanup"]).describe("Operation: spawnTeam to create a team, cleanup to remove team and task directories."),agent_type:S.string().optional().describe('Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.'),team_name:S.string().optional().describe("Name for the new team to create (required for spawnTeam)."),description:S.string().optional().describe("Team description/purpose (only used with spawnTeam).")})});var x7H;var NP$=K(()=>{x7H=["Baked","Brewed","Churned","Cogitated","Cooked","Crunched","Saut\xE9ed","Worked"]});async function S7H(H,$){let{name:A,teamName:L,prompt:I,color:D,planModeRequired:B,model:f}=H,{setAppState:E}=$,M=_w(A,L),G=Zm("in_process_teammate");N(`[spawnInProcessTeammate] Spawning ${M} (taskId: ${G})`);try{let U=nD(),X=j$(),J={agentId:M,agentName:A,teamName:L,color:D,planModeRequired:B,parentSessionId:X},F=u9$({agentId:M,agentName:A,teamName:L,color:D,planModeRequired:B,parentSessionId:X,abortController:U});if(Om())jK$(M,A,X);let Q=`${A}: ${I.substring(0,50)}${I.length>50?"...":""}`,W=Z5H(L,{subject:A,description:I.substring(0,100),status:"in_progress",blocks:[],blockedBy:[],metadata:{_internal:!0}}),P={...wP(G,"in_process_teammate",Q),type:"in_process_teammate",status:"running",identity:J,prompt:I,model:f,abortController:U,awaitingPlanApproval:!1,spinnerVerb:QV(i0H),pastTenseVerb:QV(x7H),permissionMode:B?"plan":"default",isIdle:!1,shutdownRequested:!1,lastReportedToolCount:0,lastReportedTokenCount:0,pendingUserMessages:[],messages:[],localTaskId:W},C=PB(async()=>{N(`[spawnInProcessTeammate] Cleanup called for ${M}`),U.abort()});return P.unregisterCleanup=C,qP(P,E),N(`[spawnInProcessTeammate] Registered ${M} in AppState`),{success:!0,agentId:M,taskId:G,abortController:U,teammateContext:F}}catch(U){let X=U instanceof Error?U.message:"Unknown error during spawn";return N(`[spawnInProcessTeammate] Failed to spawn ${M}: ${X}`),{success:!1,agentId:M,error:X}}}function OP$(H,$){let A=!1,L=null,I=null;if($((D)=>{let B=D.tasks[H];if(!B||B.type!=="in_process_teammate")return D;let f=B;L=f.identity.teamName,I=f.identity.agentId,f.abortController.abort(),f.unregisterCleanup?.(),A=!0,f.onIdleCallbacks?.forEach((M)=>M());let E=D.teamContext;if(D.teamContext&&D.teamContext.teammates&&I){let{[I]:M,...G}=D.teamContext.teammates;E={...D.teamContext,teammates:G}}return{...D,teamContext:E,tasks:{...D.tasks,[H]:{...f,status:"killed",endTime:Date.now(),onIdleCallbacks:[]}}}}),L&&I)T4D(L,I);return A}var xP$=K(()=>{KBH();eE();h2();bx();ZE();E$();JG();g$();aY();SyH();yHH();VP$();NP$()});var x4D={};XA(x4D,{requestTeammateShutdown:()=>g2A,markTeammateIdle:()=>Ct9,markTeammateAwaitingPlanApproval:()=>Zt9,markTeammateActive:()=>wt9,injectUserMessageToTeammate:()=>m2A,getRunningTeammatesForTeam:()=>Nt9,getAllInProcessTeammateTasks:()=>Yw,findTeammateTaskByAgentId:()=>ao,failTeammateTask:()=>zt9,enqueueTeammateNotification:()=>Yt9,completeTeammateTask:()=>Tt9,clearTeammatePlanApproval:()=>qt9,appendTeammateMessage:()=>SP$,InProcessTeammateTask:()=>JbH});function Yt9(H,$,A,L,I){let D=$.agentName,B=A==="completed"?`Teammate "${D}" completed their task.`:A==="failed"?`Teammate "${D}" failed: ${L||"Unknown error"}`:A==="killed"?`Teammate "${D}" was stopped.`:`Teammate "${D}" is idle and ready for new work.`,f=vM(H),E=`<${G5}> `).filter((E)=>E.trim());for(let E=f.length-1;E>=0&&$.length<3;E--){let M=f[E];if(!M)continue;let G=M.length>A?M.slice(0,A-1)+"\u2026":M;$.push(G)}}}}return $.reverse()}function y4D(H,$){if(GI(H)<=$)return H;let A=H;while(GI(A+"\u2026")>$&&A.length>0)A=A.slice(0,-1);return A+"\u2026"}function v4D({teammate:H,isLast:$,isSelected:A,isForegrounded:L,allIdle:I,showPreview:D}){let[B]=R7H.useState(()=>H.spinnerVerb??QV(i0H)),[f]=R7H.useState(()=>H.pastTenseVerb??QV(x7H)),E=A||L,M=E?$?"\u2558\u2550":"\u255E\u2550":$?"\u2514\u2500":"\u251C\u2500",G=v7(H.identity.color),{columns:U}=QL(),X=R7H.useRef(null),J=R7H.useRef(null);if(H.isIdle&&X.current===null)X.current=Date.now();else if(!H.isIdle)X.current=null;if(!I&&J.current!==null)J.current=null;let F=j7H(X.current??Date.now(),H.isIdle&&!I);if(I&&J.current===null)J.current=of(Date.now()-H.startTime);let Q=I?J.current??(()=>{throw Error(`frozenDurationRef is null for idle teammate ${H.identity.agentName}`)})():F,W=8,P=`@${H.identity.agentName}`,C=GI(P),Y=H.progress?.toolUseCount??0,Z=H.progress?.tokenCount??0,q=` \xB7 ${Y} tool ${Y===1?"use":"uses"} \xB7 ${a0(Z)} tokens`,O=GI(q),j=` \xB7 ${KbH}`,u=GI(j),g=GI(" \xB7 enter to view"),h=25,p=U-W-C-2,d=U>=60&&p>=h,k=d?C+2:0,n=U-W-k,GH=A&&!L&&n>g+O+h+5,HH=E&&n>u+(GH?g:0)+O+h+5,BH=n>O+h+5,WH=(BH?O:0)+(HH?u:0)+(GH?g:0),wH=Math.max(h,n-WH-1),QH=(()=>{let KH=H.progress?.recentActivities;if(KH&&KH.length>0){let CH=kv(KH);if(CH)return y4D(CH,wH)}let MH=H.progress?.lastActivity?.activityDescription;if(MH)return y4D(MH,wH);return B})(),TH=()=>{if(H.shutdownRequested)return h8.createElement(V,{dimColor:!0},"[stopping]");if(H.awaitingPlanApproval)return h8.createElement(V,{color:"warning"},"[awaiting approval]");if(H.isIdle){if(I)return h8.createElement(V,{dimColor:!0},f," for ",Q);return h8.createElement(V,{dimColor:!0},"Idle for ",F)}if(E)return null;return h8.createElement(V,{dimColor:!0},QH?.endsWith("\u2026")?QH:`${QH}\u2026`)},t=D?Rt9(H.messages):[],IH=$?" ":"\u2502 ";return h8.createElement(x,{flexDirection:"column"},h8.createElement(x,{paddingLeft:3},h8.createElement(V,{color:A?"suggestion":void 0,bold:A},A?pH.pointer:" "),h8.createElement(V,{dimColor:!A},M," "),d&&h8.createElement(V,{color:A?"suggestion":G},"@",H.identity.agentName),d&&h8.createElement(V,{dimColor:!A},": "),TH(),BH&&h8.createElement(V,{dimColor:!0}," ","\xB7 ",Y," tool ",Y===1?"use":"uses"," \xB7"," ",a0(Z)," tokens"),HH&&h8.createElement(V,{dimColor:!0}," \xB7 ",KbH),GH&&h8.createElement(V,{dimColor:!0}," \xB7 enter to view")),t.map((KH,MH)=>h8.createElement(x,{key:MH,paddingLeft:3},h8.createElement(V,{dimColor:!0}," "),h8.createElement(V,{dimColor:!0},IH," "),h8.createElement(V,{dimColor:!0},KH))))}var h8,R7H;var h4D=K(()=>{jI();xH();yHH();Wp();Q9();NP$();RP$();Q9();DJ();hx();OB();VP$();h8=b(s(),1),R7H=b(s(),1)});function p2A({selectedIndex:H,isInSelectionMode:$,allIdle:A,leaderVerb:L,leaderTokenCount:I,leaderIdleText:D}){let B=J$((P)=>P.tasks),f=J$((P)=>P.viewingAgentTaskId),E=J$((P)=>P.showTeammateMessagePreview),M=void 0,G=Yw(B).filter((P)=>P.status==="running").sort((P,C)=>P.identity.agentName.localeCompare(C.identity.agentName));if(G.length===0)return null;let U=f===void 0,X=$&&H===-1,J=U||X,F="cyan_FOR_SUBAGENTS_ONLY",Q=$===!0&&H===G.length;return Af.createElement(x,{flexDirection:"column",marginTop:1},!!1&&Af.createElement(x,{paddingLeft:3},Af.createElement(V,{color:X?"suggestion":void 0,bold:J},X?pH.pointer:" "),Af.createElement(V,{dimColor:!J,bold:J},J?"\u2552\u2550":"\u250C\u2500"," "),Af.createElement(V,{bold:J,color:X?"suggestion":F},"team-lead"),!U&&L&&Af.createElement(V,{dimColor:!0},": ",L,"\u2026"),!U&&!L&&D&&Af.createElement(V,{dimColor:!0},": ",D),I!==void 0&&I>0&&Af.createElement(V,{dimColor:!J}," ","\xB7 ",a0(I)," tokens"),J&&Af.createElement(V,{dimColor:!0}," \xB7 ",KbH),X&&!U&&Af.createElement(V,{dimColor:!0}," \xB7 enter to view")),G.map((P,C)=>Af.createElement(v4D,{key:P.id,teammate:P,isLast:!$&&C===G.length-1,isSelected:$&&H===C,isForegrounded:f===P.id,allIdle:A,showPreview:E})),$&&Af.createElement(yt9,{isSelected:Q}))}function yt9({isSelected:H}){return Af.createElement(x,{paddingLeft:3},Af.createElement(V,{color:H?"suggestion":void 0,bold:H},H?pH.pointer:" "),Af.createElement(V,{dimColor:!H,bold:H},H?"\u2558\u2550":"\u2514\u2500"," "),Af.createElement(V,{dimColor:!H,bold:H},"hide"),H&&Af.createElement(V,{dimColor:!0}," \xB7 enter to collapse"))}var Af;var d2A=K(()=>{jI();xH();pL();Iz();Q9();h4D();Af=b(s(),1)});function u4D({mode:H,loadingStartTimeRef:$,totalPausedMsRef:A,pauseStartTimeRef:L,spinnerTip:I,responseLengthRef:D,overrideColor:B,overrideShimmerColor:f,overrideMessage:E,spinnerSuffix:M,verbose:G,todos:U,hasActiveTools:X=!1}){let[J,F]=DT(50),Q=L.current!==null?L.current-$.current-A.current:Date.now()-$.current-A.current,P=lQ().prefersReducedMotion??!1,C=J$((sA)=>sA.tasks),Y=J$((sA)=>sA.viewingAgentTaskId),Z=J$((sA)=>sA.expandedView),q=Z==="tasks",O=Z==="teammates",j=J$((sA)=>sA.selectedIPAgentIndex),u=J$((sA)=>sA.viewSelectionMode),y=Y?RT({viewingAgentTaskId:Y,tasks:C}):void 0,{isConnected:g}=S2A(),{columns:h}=QL(),p=wP$(),[d,k]=Cw.useState(null),n=Cw.useRef(null);Cw.useEffect(()=>{let sA=null,_D=null;if(H==="thinking"){if(n.current===null)n.current=Date.now(),k("thinking")}else if(n.current!==null){let M9=Date.now()-n.current,g8=Date.now()-n.current,v9=Math.max(0,2000-g8);n.current=null;let QI=()=>{k(M9),_D=setTimeout(()=>k(null),2000)};if(v9>0)sA=setTimeout(QI,v9);else QI()}return()=>{if(sA)clearTimeout(sA);if(_D)clearTimeout(_D)}},[H]);let GH=HU()?p?.find((sA)=>sA.status!=="pending"&&sA.status!=="completed"):U?.find((sA)=>sA.status==="in_progress"),HH=HU()?bt9(p):U?.find((sA)=>sA.status==="pending"),[BH]=Cw.useState(()=>QV(U4D())),WH=E??GH?.activeForm??BH,QH=(y&&!y.isIdle?y.spinnerVerb??BH:WH)+"\u2026",TH=D.current,{isStalled:t,stalledIntensity:IH}=u2A(F,TH,X,P),KH=P?0:g===!1?4:Math.floor(F/120),MH=H==="requesting"?50:200,CH=QH.length+20,OH=Math.floor(F/MH),LH=P?-100:g===!1||t?-100:H==="requesting"?OH%CH-10:QH.length+10-OH%CH,e=P?0:H==="tool-use"?(Math.sin(F/1000*Math.PI)+1)/2:0,DH=Cw.useRef(0);if(P)DH.current=TH;else{let sA=TH-DH.current;if(sA>0){let _D;if(sA<70)_D=3;else if(sA<200)_D=Math.max(8,Math.ceil(sA*0.15));else _D=50;DH.current=Math.min(DH.current+_D,TH)}}let EH=DH.current;Cw.useEffect(()=>{let sA="spinner-"+H;return BbH.startCLIActivity(sA),()=>{BbH.endCLIActivity(sA)}},[H]);let $H=GI(QH)+2,FH=d==="thinking"?"thinking":typeof d==="number"?`thought for ${Math.max(1,Math.round(d/1000))}s`:null,YH=FH?GI(FH):0,qH=Math.round(EH/4),bH=Yw(C).filter((sA)=>sA.status==="running"),hH=bH.length>0,PH=hH&&bH.every((sA)=>sA.isIdle),gH=0;if(!O){for(let sA of Object.values(C))if(b4(sA)&&sA.status==="running"){if(sA.progress?.tokenCount)gH+=sA.progress.tokenCount}}let vH=Cw.useRef(Date.now()-Q);Cw.useEffect(()=>{let sA=Date.now()-Q;if(!hH||sAK$(Date.now()-vH.current),hH?100:null);let KA=Cw.useRef(hH);if(KA.current&&!hH)vH.current=Date.now()-Q,K$(Q);KA.current=hH;let UA=hH?Math.max(Q,tH):Q,U$=of(UA),hA=GI(U$),iA=y&&!y.isIdle?y.progress?.tokenCount??0:qH+gH,rH=a0(iA),G$=hH?`${rH} tokens`:`${pH.arrowDown} ${rH} tokens`,b$=GI(G$),ZA=qH,n$=GI(" \xB7 "),fA=d!==null,UH=G||hH||UA>vt9,_H=h-$H-5,aH=fA&&_H>YH,f$=aH?YH+n$:0,I$=UH&&_H>f$+hA,$$=f$+(I$?hA+n$:0),e$=UH&&_H>$$+b$,x$=aH&&d==="thinking"&&!M&&!I$&&!e$,zA=[...M?[eL.createElement(V,{dimColor:!0,key:"suffix"},M)]:[],...I$?[eL.createElement(V,{dimColor:!0,key:"elapsedTime"},U$)]:[],...e$?[eL.createElement(x,{flexDirection:"row",key:"tokens"},!hH&&eL.createElement(ht9,{mode:H}),eL.createElement(V,{dimColor:!0},rH," tokens"))]:[],...aH&&FH?[d==="thinking"?eL.createElement(j4D,{key:"thinking",text:x$?`(${FH})`:FH}):eL.createElement(V,{dimColor:!0,key:"thinking"},FH)]:[]];if(g===!1)zA.push(eL.createElement(x,{key:"offline"},eL.createElement(V,{color:"error",bold:!0},"offline")));let gA=g===!1?"inactive":"claude",HI="claudeShimmer",AI=B??gA,qB=f??HI,RB=y&&!y.isIdle?eL.createElement(eL.Fragment,null,eL.createElement(V,{dimColor:!0},"(esc to interrupt "),eL.createElement(V,{color:v7(y.identity.color)},y.identity.agentName),eL.createElement(V,{dimColor:!0},")")):!y&&zA.length>0?x$?eL.createElement(rA,null,zA):eL.createElement(eL.Fragment,null,eL.createElement(V,{dimColor:!0},"("),eL.createElement(rA,null,zA),eL.createElement(V,{dimColor:!0},")")):null;if(y?.isIdle){let sA=PH?`${qzH} Worked for ${of(Date.now()-y.startTime)}`:`${qzH} Idle`;return eL.createElement(x,{flexDirection:"column",width:"100%",alignItems:"flex-start"},eL.createElement(x,{flexDirection:"row",flexWrap:"wrap",marginTop:1,width:"100%"},eL.createElement(V,{dimColor:!0},sA)),O&&hH&&eL.createElement(p2A,{selectedIndex:j,isInSelectionMode:u==="selecting-agent",allIdle:PH,leaderVerb:WH,leaderTokenCount:ZA}))}return eL.createElement(x,{ref:J,flexDirection:"column",width:"100%",alignItems:"flex-start"},eL.createElement(x,{flexDirection:"row",flexWrap:"wrap",marginTop:1,width:"100%"},eL.createElement(MbH,{frame:KH,messageColor:AI,stalledIntensity:B?0:IH,isConnected:g,reducedMotion:P,time:F}),eL.createElement(b2A,{message:QH,mode:H,isConnected:g,messageColor:AI,glimmerIndex:LH,flashOpacity:e,shimmerColor:qB,stalledIntensity:B?0:IH}),RB),O&&hH?eL.createElement(p2A,{selectedIndex:j,isInSelectionMode:u==="selecting-agent",allIdle:PH,leaderVerb:WH,leaderTokenCount:ZA}):q&&p&&p.length>0?eL.createElement(x,{width:"100%",flexDirection:"column"},eL.createElement(HA,null,eL.createElement(_P$,{tasks:p}))):q&&U&&U.length>0?eL.createElement(x,{width:"100%",flexDirection:"column"},eL.createElement(HA,null,eL.createElement(io,{todos:U}))):HH||I?eL.createElement(x,{width:"100%"},eL.createElement(HA,null,eL.createElement(V,{dimColor:!0},HH?`Next: ${"subject"in HH?HH.subject:HH.content}`:`Tip: ${I}`))):null)}function ht9({mode:H}){switch(H){case"tool-input":case"tool-use":case"responding":case"thinking":return eL.createElement(x,{width:2},eL.createElement(V,{dimColor:!0},pH.arrowDown));case"requesting":return eL.createElement(x,{width:2},eL.createElement(V,{dimColor:!0},pH.arrowUp))}}function vD(){let[H,$]=DT(120),{isConnected:A}=S2A(),I=lQ().prefersReducedMotion??!1,D=I?0:Math.floor($/120)%k4D.length,B=A===!1?"inactive":"text";if(I){let f=Math.floor($/1000)%2===1;return eL.createElement(x,{ref:H,flexWrap:"wrap",height:1,width:2},eL.createElement(V,{color:B,dimColor:f},"\u25CF"))}return eL.createElement(x,{ref:H,flexWrap:"wrap",height:1,width:2},eL.createElement(V,{color:B},k4D[D]))}function bt9(H){if(!H)return;let $=H.filter((L)=>L.status==="pending");if($.length===0)return;let A=new Set(H.filter((L)=>L.status!=="completed").map((L)=>L.id));return $.find((L)=>!L.blockedBy.some((I)=>A.has(I)))??$[0]}var eL,Cw,b4D,k4D,vt9=30000;var JM=K(()=>{xH();yHH();Q9();s6();jI();G4D();j2A();VP$();iB();fbH();R2A();y2A();JG();pL();OB();eB();C4D();um();Iz();UBH();Wp();p6();R4D();d2A();DJ();xH();eL=b(s(),1),Cw=b(s(),1),b4D=EbH(),k4D=[...b4D,...[...b4D].reverse()]});var QbH=z((y7H)=>{function kt9(H,$,A){if(A===void 0)A=Array.prototype;if(H&&typeof A.find==="function")return A.find.call(H,$);for(var L=0;L{var a4D=QbH(),zh=a4D.find,WbH=a4D.NAMESPACE;function gt9(H){return H!==""}function mt9(H){return H?H.split(/[\t\n\f\r ]+/).filter(gt9):[]}function pt9(H,$){if(!H.hasOwnProperty($))H[$]=!0;return H}function p4D(H){if(!H)return[];var $=mt9(H);return Object.keys($.reduce(pt9,{}))}function dt9(H){return function($){return H&&H.indexOf($)!==-1}}function PbH(H,$){for(var A in H)if(Object.prototype.hasOwnProperty.call(H,A))$[A]=H[A]}function tY(H,$){var A=H.prototype;if(!(A instanceof $)){let I=function(){};var L=I;I.prototype=$.prototype,I=new I,PbH(A,I),H.prototype=A=I}if(A.constructor!=H){if(typeof H!="function")console.error("unknown Class:"+H);A.constructor=H}}var sY={},VS=sY.ELEMENT_NODE=1,h7H=sY.ATTRIBUTE_NODE=2,yP$=sY.TEXT_NODE=3,o4D=sY.CDATA_SECTION_NODE=4,t4D=sY.ENTITY_REFERENCE_NODE=5,ct9=sY.ENTITY_NODE=6,s4D=sY.PROCESSING_INSTRUCTION_NODE=7,e4D=sY.COMMENT_NODE=8,H5D=sY.DOCUMENT_NODE=9,$5D=sY.DOCUMENT_TYPE_NODE=10,Pp=sY.DOCUMENT_FRAGMENT_NODE=11,lt9=sY.NOTATION_NODE=12,w3={},eQ={},BSE=w3.INDEX_SIZE_ERR=(eQ[1]="Index size error",1),fSE=w3.DOMSTRING_SIZE_ERR=(eQ[2]="DOMString size error",2),oY=w3.HIERARCHY_REQUEST_ERR=(eQ[3]="Hierarchy request error",3),ESE=w3.WRONG_DOCUMENT_ERR=(eQ[4]="Wrong document",4),MSE=w3.INVALID_CHARACTER_ERR=(eQ[5]="Invalid character",5),GSE=w3.NO_DATA_ALLOWED_ERR=(eQ[6]="No data allowed",6),USE=w3.NO_MODIFICATION_ALLOWED_ERR=(eQ[7]="No modification allowed",7),A5D=w3.NOT_FOUND_ERR=(eQ[8]="Not found",8),XSE=w3.NOT_SUPPORTED_ERR=(eQ[9]="Not supported",9),d4D=w3.INUSE_ATTRIBUTE_ERR=(eQ[10]="Attribute in use",10),JSE=w3.INVALID_STATE_ERR=(eQ[11]="Invalid state",11),FSE=w3.SYNTAX_ERR=(eQ[12]="Syntax error",12),KSE=w3.INVALID_MODIFICATION_ERR=(eQ[13]="Invalid modification",13),QSE=w3.NAMESPACE_ERR=(eQ[14]="Invalid namespace",14),WSE=w3.INVALID_ACCESS_ERR=(eQ[15]="Invalid access",15);function qJ(H,$){if($ instanceof Error)var A=$;else if(A=this,Error.call(this,eQ[H]),this.message=eQ[H],Error.captureStackTrace)Error.captureStackTrace(this,qJ);if(A.code=H,$)this.message=this.message+": "+$;return A}qJ.prototype=Error.prototype;PbH(w3,qJ);function Vp(){}Vp.prototype={length:0,item:function(H){return H>=0&&H=0){var I=$.length-1;while(L0},lookupPrefix:function(H){var $=this;while($){var A=$._nsMap;if(A){for(var L in A)if(Object.prototype.hasOwnProperty.call(A,L)&&A[L]===H)return L}$=$.nodeType==h7H?$.ownerDocument:$.parentNode}return null},lookupNamespaceURI:function(H){var $=this;while($){var A=$._nsMap;if(A){if(Object.prototype.hasOwnProperty.call(A,H))return A[H]}$=$.nodeType==h7H?$.ownerDocument:$.parentNode}return null},isDefaultNamespace:function(H){var $=this.lookupPrefix(H);return $==null}};function D5D(H){return H=="<"&&"<"||H==">"&&">"||H=="&"&&"&"||H=='"'&&"""||"&#"+H.charCodeAt()+";"}PbH(sY,FM);PbH(sY,FM.prototype);function VbH(H,$){if($(H))return!0;if(H=H.firstChild)do if(VbH(H,$))return!0;while(H=H.nextSibling)}function _bH(){this.ownerDocument=this}function it9(H,$,A){H&&H._inc++;var L=A.namespaceURI;if(L===WbH.XMLNS)$._nsMap[A.prefix?A.localName:""]=A.value}function B5D(H,$,A,L){H&&H._inc++;var I=A.namespaceURI;if(I===WbH.XMLNS)delete $._nsMap[A.prefix?A.localName:""]}function r2A(H,$,A){if(H&&H._inc){H._inc++;var L=$.childNodes;if(A)L[L.length++]=A;else{var I=$.firstChild,D=0;while(I)L[D++]=I,I=I.nextSibling;L.length=D,delete L[L.length]}}}function f5D(H,$){var{previousSibling:A,nextSibling:L}=$;if(A)A.nextSibling=L;else H.firstChild=L;if(L)L.previousSibling=A;else H.lastChild=A;return $.parentNode=null,$.previousSibling=null,$.nextSibling=null,r2A(H.ownerDocument,H),$}function nt9(H){return H&&(H.nodeType===FM.DOCUMENT_NODE||H.nodeType===FM.DOCUMENT_FRAGMENT_NODE||H.nodeType===FM.ELEMENT_NODE)}function rt9(H){return H&&(Nh(H)||a2A(H)||_p(H)||H.nodeType===FM.DOCUMENT_FRAGMENT_NODE||H.nodeType===FM.COMMENT_NODE||H.nodeType===FM.PROCESSING_INSTRUCTION_NODE)}function _p(H){return H&&H.nodeType===FM.DOCUMENT_TYPE_NODE}function Nh(H){return H&&H.nodeType===FM.ELEMENT_NODE}function a2A(H){return H&&H.nodeType===FM.TEXT_NODE}function i4D(H,$){var A=H.childNodes||[];if(zh(A,Nh)||_p($))return!1;var L=zh(A,_p);return!($&&L&&A.indexOf(L)>A.indexOf($))}function n4D(H,$){var A=H.childNodes||[];function L(D){return Nh(D)&&D!==$}if(zh(A,L))return!1;var I=zh(A,_p);return!($&&I&&A.indexOf(I)>A.indexOf($))}function at9(H,$,A){if(!nt9(H))throw new qJ(oY,"Unexpected parent node type "+H.nodeType);if(A&&A.parentNode!==H)throw new qJ(A5D,"child not in parent");if(!rt9($)||_p($)&&H.nodeType!==FM.DOCUMENT_NODE)throw new qJ(oY,"Unexpected node type "+$.nodeType+" for parent node type "+H.nodeType)}function ot9(H,$,A){var L=H.childNodes||[],I=$.childNodes||[];if($.nodeType===FM.DOCUMENT_FRAGMENT_NODE){var D=I.filter(Nh);if(D.length>1||zh(I,a2A))throw new qJ(oY,"More than one element or text in fragment");if(D.length===1&&!i4D(H,A))throw new qJ(oY,"Element in fragment can not be inserted before doctype")}if(Nh($)){if(!i4D(H,A))throw new qJ(oY,"Only one element can be added and only after doctype")}if(_p($)){if(zh(L,_p))throw new qJ(oY,"Only one doctype is allowed");var B=zh(L,Nh);if(A&&L.indexOf(B)1||zh(I,a2A))throw new qJ(oY,"More than one element or text in fragment");if(D.length===1&&!n4D(H,A))throw new qJ(oY,"Element in fragment can not be inserted before doctype")}if(Nh($)){if(!n4D(H,A))throw new qJ(oY,"Only one element can be added and only after doctype")}if(_p($)){let E=function(M){return _p(M)&&M!==A};var f=E;if(zh(L,E))throw new qJ(oY,"Only one doctype is allowed");var B=zh(L,Nh);if(A&&L.indexOf(B)0)VbH(A.documentElement,function(I){if(I!==A&&I.nodeType===VS){var D=I.getAttribute("class");if(D){var B=H===D;if(!B){var f=p4D(D);B=$.every(dt9(f))}if(B)L.push(I)}}});return L})},createElement:function(H){var $=new o0H;$.ownerDocument=this,$.nodeName=H,$.tagName=H,$.localName=H,$.childNodes=new Vp;var A=$.attributes=new vP$;return A._ownerElement=$,$},createDocumentFragment:function(){var H=new uP$;return H.ownerDocument=this,H.childNodes=new Vp,H},createTextNode:function(H){var $=new o2A;return $.ownerDocument=this,$.appendData(H),$},createComment:function(H){var $=new t2A;return $.ownerDocument=this,$.appendData(H),$},createCDATASection:function(H){var $=new s2A;return $.ownerDocument=this,$.appendData(H),$},createProcessingInstruction:function(H,$){var A=new HwA;return A.ownerDocument=this,A.tagName=A.nodeName=A.target=H,A.nodeValue=A.data=$,A},createAttribute:function(H){var $=new bP$;return $.ownerDocument=this,$.name=H,$.nodeName=H,$.localName=H,$.specified=!0,$},createEntityReference:function(H){var $=new e2A;return $.ownerDocument=this,$.nodeName=H,$},createElementNS:function(H,$){var A=new o0H,L=$.split(":"),I=A.attributes=new vP$;if(A.childNodes=new Vp,A.ownerDocument=this,A.nodeName=$,A.tagName=$,A.namespaceURI=H,L.length==2)A.prefix=L[0],A.localName=L[1];else A.localName=$;return I._ownerElement=A,A},createAttributeNS:function(H,$){var A=new bP$,L=$.split(":");if(A.ownerDocument=this,A.nodeName=$,A.name=$,A.namespaceURI=H,A.specified=!0,L.length==2)A.prefix=L[0],A.localName=L[1];else A.localName=$;return A}};tY(_bH,FM);function o0H(){this._nsMap={}}o0H.prototype={nodeType:VS,hasAttribute:function(H){return this.getAttributeNode(H)!=null},getAttribute:function(H){var $=this.getAttributeNode(H);return $&&$.value||""},getAttributeNode:function(H){return this.attributes.getNamedItem(H)},setAttribute:function(H,$){var A=this.ownerDocument.createAttribute(H);A.value=A.nodeValue=""+$,this.setAttributeNode(A)},removeAttribute:function(H){var $=this.getAttributeNode(H);$&&this.removeAttributeNode($)},appendChild:function(H){if(H.nodeType===Pp)return this.insertBefore(H,null);else return tt9(this,H)},setAttributeNode:function(H){return this.attributes.setNamedItem(H)},setAttributeNodeNS:function(H){return this.attributes.setNamedItemNS(H)},removeAttributeNode:function(H){return this.attributes.removeNamedItem(H.nodeName)},removeAttributeNS:function(H,$){var A=this.getAttributeNodeNS(H,$);A&&this.removeAttributeNode(A)},hasAttributeNS:function(H,$){return this.getAttributeNodeNS(H,$)!=null},getAttributeNS:function(H,$){var A=this.getAttributeNodeNS(H,$);return A&&A.value||""},setAttributeNS:function(H,$,A){var L=this.ownerDocument.createAttributeNS(H,$);L.value=L.nodeValue=""+A,this.setAttributeNode(L)},getAttributeNodeNS:function(H,$){return this.attributes.getNamedItemNS(H,$)},getElementsByTagName:function(H){return new b7H(this,function($){var A=[];return VbH($,function(L){if(L!==$&&L.nodeType==VS&&(H==="*"||L.tagName==H))A.push(L)}),A})},getElementsByTagNameNS:function(H,$){return new b7H(this,function(A){var L=[];return VbH(A,function(I){if(I!==A&&I.nodeType===VS&&(H==="*"||I.namespaceURI===H)&&($==="*"||I.localName==$))L.push(I)}),L})}};_bH.prototype.getElementsByTagName=o0H.prototype.getElementsByTagName;_bH.prototype.getElementsByTagNameNS=o0H.prototype.getElementsByTagNameNS;tY(o0H,FM);function bP$(){}bP$.prototype.nodeType=h7H;tY(bP$,FM);function YbH(){}YbH.prototype={data:"",substringData:function(H,$){return this.data.substring(H,H+$)},appendData:function(H){H=this.data+H,this.nodeValue=this.data=H,this.length=H.length},insertData:function(H,$){this.replaceData(H,0,$)},appendChild:function(H){throw Error(eQ[oY])},deleteData:function(H,$){this.replaceData(H,$,"")},replaceData:function(H,$,A){var L=this.data.substring(0,H),I=this.data.substring(H+$);A=L+A+I,this.nodeValue=this.data=A,this.length=A.length}};tY(YbH,FM);function o2A(){}o2A.prototype={nodeName:"#text",nodeType:yP$,splitText:function(H){var $=this.data,A=$.substring(H);$=$.substring(0,H),this.data=this.nodeValue=$,this.length=$.length;var L=this.ownerDocument.createTextNode(A);if(this.parentNode)this.parentNode.insertBefore(L,this.nextSibling);return L}};tY(o2A,YbH);function t2A(){}t2A.prototype={nodeName:"#comment",nodeType:e4D};tY(t2A,YbH);function s2A(){}s2A.prototype={nodeName:"#cdata-section",nodeType:o4D};tY(s2A,YbH);function kP$(){}kP$.prototype.nodeType=$5D;tY(kP$,FM);function M5D(){}M5D.prototype.nodeType=lt9;tY(M5D,FM);function G5D(){}G5D.prototype.nodeType=ct9;tY(G5D,FM);function e2A(){}e2A.prototype.nodeType=t4D;tY(e2A,FM);function uP$(){}uP$.prototype.nodeName="#document-fragment";uP$.prototype.nodeType=Pp;tY(uP$,FM);function HwA(){}HwA.prototype.nodeType=s4D;tY(HwA,FM);function U5D(){}U5D.prototype.serializeToString=function(H,$,A){return X5D.call(H,$,A)};FM.prototype.toString=X5D;function X5D(H,$){var A=[],L=this.nodeType==9&&this.documentElement||this,I=L.prefix,D=L.namespaceURI;if(D&&I==null){var I=L.lookupPrefix(D);if(I==null)var B=[{namespace:D,prefix:null}]}return v7H(this,A,H,$,B),A.join("")}function r4D(H,$,A){var L=H.prefix||"",I=H.namespaceURI;if(!I)return!1;if(L==="xml"&&I===WbH.XML||I===WbH.XMLNS)return!1;var D=A.length;while(D--){var B=A[D];if(B.prefix===L)return B.namespace!==I}return!0}function l2A(H,$,A){H.push(" ",$,'="',A.replace(/[<>&"\t\n\r]/g,D5D),'"')}function v7H(H,$,A,L,I){if(!I)I=[];if(L)if(H=L(H),H){if(typeof H=="string"){$.push(H);return}}else return;switch(H.nodeType){case VS:var D=H.attributes,B=D.length,P=H.firstChild,f=H.tagName;A=WbH.isHTML(H.namespaceURI)||A;var E=f;if(!A&&!H.prefix&&H.namespaceURI){var M;for(var G=0;G=0;U--){var X=I[U];if(X.prefix===""&&X.namespace===H.namespaceURI){M=X.namespace;break}}if(M!==H.namespaceURI)for(var U=I.length-1;U>=0;U--){var X=I[U];if(X.namespace===H.namespaceURI){if(X.prefix)E=X.prefix+":"+f;break}}}$.push("<",E);for(var J=0;J"),A&&/^script$/i.test(f))while(P){if(P.data)$.push(P.data);else v7H(P,$,A,L,I.slice());P=P.nextSibling}else while(P)v7H(P,$,A,L,I.slice()),P=P.nextSibling;$.push("")}else $.push("/>");return;case H5D:case Pp:var P=H.firstChild;while(P)v7H(P,$,A,L,I.slice()),P=P.nextSibling;return;case h7H:return l2A($,H.name,H.value);case yP$:return $.push(H.data.replace(/[<&>]/g,D5D));case o4D:return $.push("");case e4D:return $.push("");case $5D:var{publicId:C,systemId:Y}=H;if($.push("")}else if(Y&&Y!=".")$.push(" SYSTEM ",Y,">");else{var Z=H.internalSubset;if(Z)$.push(" [",Z,"]");$.push(">")}return;case s4D:return $.push("");case t4D:return $.push("&",H.nodeName,";");default:$.push("??",H.nodeName)}}function J5D(H,$,A){var L;switch($.nodeType){case VS:L=$.cloneNode(!1),L.ownerDocument=H;case Pp:break;case h7H:A=!0;break}if(!L)L=$.cloneNode(!1);if(L.ownerDocument=H,L.parentNode=null,A){var I=$.firstChild;while(I)L.appendChild(J5D(H,I,A)),I=I.nextSibling}return L}function i2A(H,$,A){var L=new $.constructor;for(var I in $)if(Object.prototype.hasOwnProperty.call($,I)){var D=$[I];if(typeof D!="object"){if(D!=L[I])L[I]=D}}if($.childNodes)L.childNodes=new Vp;switch(L.ownerDocument=H,L.nodeType){case VS:var B=$.attributes,f=L.attributes=new vP$,E=B.length;f._ownerElement=L;for(var M=0;M{var K5D=QbH().freeze;CbH.XML_ENTITIES=K5D({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});CbH.HTML_ENTITIES=K5D({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\uD835\uDD38",aopf:"\uD835\uDD52",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\uD835\uDC9C",ascr:"\uD835\uDCB6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\uD835\uDD05",bfr:"\uD835\uDD1F",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\uD835\uDD39",bopf:"\uD835\uDD53",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\uD835\uDCB7",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\uD835\uDD20",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\uD835\uDD54",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\uD835\uDC9E",cscr:"\uD835\uDCB8",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\uD835\uDD07",dfr:"\uD835\uDD21",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\uD835\uDD3B",dopf:"\uD835\uDD55",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\uD835\uDC9F",dscr:"\uD835\uDCB9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\uD835\uDD08",efr:"\uD835\uDD22",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\uD835\uDD3C",eopf:"\uD835\uDD56",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\uD835\uDD09",ffr:"\uD835\uDD23",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\uD835\uDD3D",fopf:"\uD835\uDD57",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\uD835\uDCBB",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\uD835\uDD0A",gfr:"\uD835\uDD24",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\uD835\uDD3E",gopf:"\uD835\uDD58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\uD835\uDCA2",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\uD835\uDD25",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\uD835\uDD59",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\uD835\uDCBD",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\uD835\uDD26",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\uD835\uDD40",iopf:"\uD835\uDD5A",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\uD835\uDCBE",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\uD835\uDD0D",jfr:"\uD835\uDD27",jmath:"\u0237",Jopf:"\uD835\uDD41",jopf:"\uD835\uDD5B",Jscr:"\uD835\uDCA5",jscr:"\uD835\uDCBF",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\uD835\uDD0E",kfr:"\uD835\uDD28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\uD835\uDD42",kopf:"\uD835\uDD5C",Kscr:"\uD835\uDCA6",kscr:"\uD835\uDCC0",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\uD835\uDD0F",lfr:"\uD835\uDD29",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\uD835\uDD43",lopf:"\uD835\uDD5D",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\uD835\uDCC1",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\uD835\uDD10",mfr:"\uD835\uDD2A",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\uD835\uDD44",mopf:"\uD835\uDD5E",mp:"\u2213",Mscr:"\u2133",mscr:"\uD835\uDCC2",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` `,Z.offset=(j=Y.offset)!=null?j:0,Z.width=(u=Y.width)!=null?u:0,Z.dontPrettyTextNodes=(y=(g=Y.dontPrettyTextNodes)!=null?g:Y.dontprettytextnodes)!=null?y:0,Z.spaceBeforeSlash=(h=(p=Y.spaceBeforeSlash)!=null?p:Y.spacebeforeslash)!=null?h:"",Z.spaceBeforeSlash===!0)Z.spaceBeforeSlash=" ";return Z.suppressPrettyCount=0,Z.user={},Z.state=$.None,Z}indent(Y,Z,q){var O;if(!Z.pretty||Z.suppressPrettyCount)return"";else if(Z.pretty){if(O=(q||0)+Z.offset+1,O>0)return Array(O).join(Z.indent)}return""}endline(Y,Z,q){if(!Z.pretty||Z.suppressPrettyCount)return"";else return Z.newline}attribute(Y,Z,q){var O;if(this.openAttribute(Y,Z,q),Z.pretty&&Z.width>0)O=Y.name+'="'+Y.value+'"';else O=" "+Y.name+'="'+Y.value+'"';return this.closeAttribute(Y,Z,q),O}cdata(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}comment(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}declaration(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+"",O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}docType(Y,Z,q){var O,j,u,y,g;if(q||(q=0),this.openNode(Y,Z,q),Z.state=$.OpenTag,y=this.indent(Y,Z,q),y+="0){y+=" [",y+=this.endline(Y,Z,q),Z.state=$.InsideTag,g=Y.children;for(j=0,u=g.length;j",y+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),y}element(Y,Z,q){var O,j,u,y,g,h,p,d,k,n,GH,HH,BH,WH,wH,QH,TH,t,IH;if(q||(q=0),HH=!1,this.openNode(Y,Z,q),Z.state=$.OpenTag,BH=this.indent(Y,Z,q)+"<"+Y.name,Z.pretty&&Z.width>0){d=BH.length,wH=Y.attribs;for(GH in wH){if(!P.call(wH,GH))continue;if(O=wH[GH],WH=this.attribute(O,Z,q),j=WH.length,d+j>Z.width)IH=this.indent(Y,Z,q+1)+WH,BH+=this.endline(Y,Z,q)+IH,d=IH.length;else IH=" "+WH,BH+=IH,d+=IH.length}}else{QH=Y.attribs;for(GH in QH){if(!P.call(QH,GH))continue;O=QH[GH],BH+=this.attribute(O,Z,q)}}if(y=Y.children.length,g=y===0?null:Y.children[0],y===0||Y.children.every(function(KH){return(KH.type===H.Text||KH.type===H.Raw||KH.type===H.CData)&&KH.value===""}))if(Z.allowEmpty)BH+=">",Z.state=$.CloseTag,BH+=""+this.endline(Y,Z,q);else Z.state=$.CloseTag,BH+=Z.spaceBeforeSlash+"/>"+this.endline(Y,Z,q);else if(Z.pretty&&y===1&&(g.type===H.Text||g.type===H.Raw||g.type===H.CData)&&g.value!=null)BH+=">",Z.state=$.InsideTag,Z.suppressPrettyCount++,HH=!0,BH+=this.writeChildNode(g,Z,q+1),Z.suppressPrettyCount--,HH=!1,Z.state=$.CloseTag,BH+=""+this.endline(Y,Z,q);else{if(Z.dontPrettyTextNodes){TH=Y.children;for(h=0,k=TH.length;h"+this.endline(Y,Z,q),Z.state=$.InsideTag,t=Y.children;for(p=0,n=t.length;p",HH)Z.suppressPrettyCount--;BH+=this.endline(Y,Z,q),Z.state=$.None}return this.closeNode(Y,Z,q),BH}writeChildNode(Y,Z,q){switch(Y.type){case H.CData:return this.cdata(Y,Z,q);case H.Comment:return this.comment(Y,Z,q);case H.Element:return this.element(Y,Z,q);case H.Raw:return this.raw(Y,Z,q);case H.Text:return this.text(Y,Z,q);case H.ProcessingInstruction:return this.processingInstruction(Y,Z,q);case H.Dummy:return"";case H.Declaration:return this.declaration(Y,Z,q);case H.DocType:return this.docType(Y,Z,q);case H.AttributeDeclaration:return this.dtdAttList(Y,Z,q);case H.ElementDeclaration:return this.dtdElement(Y,Z,q);case H.EntityDeclaration:return this.dtdEntity(Y,Z,q);case H.NotationDeclaration:return this.dtdNotation(Y,Z,q);default:throw Error("Unknown XML node type: "+Y.constructor.name)}}processingInstruction(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+"",O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}raw(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q),Z.state=$.InsideTag,O+=Y.value,Z.state=$.CloseTag,O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}text(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q),Z.state=$.InsideTag,O+=Y.value,Z.state=$.CloseTag,O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdAttList(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdElement(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdEntity(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdNotation(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}openNode(Y,Z,q){}closeNode(Y,Z,q){}openAttribute(Y,Z,q){}closeAttribute(Y,Z,q){}}}).call(mXD)});var I_$=z((dXD,cXD)=>{(function(){var H,$;$=GwA(),cXD.exports=H=class extends ${constructor(L){super(L)}document(L,I){var D,B,f,E,M;I=this.filterOptions(I),E="",M=L.children;for(B=0,f=M.length;B{(function(){var H,$,A,L,I,D,B,f;({isPlainObject:f}=Oh()),A=BwA(),$=r5D(),I=ww(),H=TJ(),B=MwA(),D=I_$(),iXD.exports=L=function(){class E extends I{constructor(M){super(null);if(this.name="#document",this.type=H.Document,this.documentURI=null,this.domConfig=new $,M||(M={}),!M.writer)M.writer=new D;this.options=M,this.stringify=new B(M)}end(M){var G={};if(!M)M=this.options.writer;else if(f(M))G=M,M=this.options.writer;return M.document(this,M.filterOptions(G))}toString(M){return this.options.writer.document(this,this.options.writer.filterOptions(M))}createElement(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createComment(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(M){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(M){throw Error("This DOM method is not implemented."+this.debugInfo())}importNode(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementById(M){throw Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(M){throw Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw Error("This DOM method is not implemented."+this.debugInfo())}renameNode(M,G,U){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createEvent(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(M,G,U){throw Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(M,G,U){throw Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(E.prototype,"implementation",{value:new A}),Object.defineProperty(E.prototype,"doctype",{get:function(){var M,G,U,X;X=this.children;for(G=0,U=X.length;G{(function(){var H,$,A,L,I,D,B,f,E,M,G,U,X,J,F,Q,W,P,C,Y,Z,q,O,j={}.hasOwnProperty;({isObject:q,isFunction:Z,isPlainObject:O,getValue:Y}=Oh()),H=TJ(),U=UwA(),J=iP$(),L=nP$(),I=rP$(),Q=$_$(),C=A_$(),F=L_$(),M=aP$(),G=H_$(),D=oP$(),f=tP$(),B=sP$(),E=eP$(),A=fwA(),P=MwA(),W=I_$(),$=ObH(),rXD.exports=X=class{constructor(y,g,h){var p;if(this.name="?xml",this.type=H.Document,y||(y={}),p={},!y.writer)y.writer=new W;else if(O(y.writer))p=y.writer,y.writer=new W;this.options=y,this.writer=y.writer,this.writerOptions=this.writer.filterOptions(p),this.stringify=new P(y),this.onDataCallback=g||function(){},this.onEndCallback=h||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}createChildNode(y){var g,h,p,d,k,n,GH,HH;switch(y.type){case H.CData:this.cdata(y.value);break;case H.Comment:this.comment(y.value);break;case H.Element:p={},GH=y.attribs;for(h in GH){if(!j.call(GH,h))continue;g=GH[h],p[h]=g.value}this.node(y.name,p);break;case H.Dummy:this.dummy();break;case H.Raw:this.raw(y.value);break;case H.Text:this.text(y.value);break;case H.ProcessingInstruction:this.instruction(y.target,y.value);break;default:throw Error("This XML node type is not supported in a JS object: "+y.constructor.name)}HH=y.children;for(k=0,n=HH.length;k=0)this.up();return this.onEnd()}openCurrent(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)}openNode(y){var g,h,p,d;if(!y.isOpen){if(!this.root&&this.currentLevel===0&&y.type===H.Element)this.root=y;if(h="",y.type===H.Element){this.writerOptions.state=$.OpenTag,h=this.writer.indent(y,this.writerOptions,this.currentLevel)+"<"+y.name,d=y.attribs;for(p in d){if(!j.call(d,p))continue;g=d[p],h+=this.writer.attribute(g,this.writerOptions,this.currentLevel)}h+=(y.children?">":"/>")+this.writer.endline(y,this.writerOptions,this.currentLevel),this.writerOptions.state=$.InsideTag}else{if(this.writerOptions.state=$.OpenTag,h=this.writer.indent(y,this.writerOptions,this.currentLevel)+"";h+=this.writer.endline(y,this.writerOptions,this.currentLevel)}return this.onData(h,this.currentLevel),y.isOpen=!0}}closeNode(y){var g;if(!y.isClosed){if(g="",this.writerOptions.state=$.CloseTag,y.type===H.Element)g=this.writer.indent(y,this.writerOptions,this.currentLevel)+""+this.writer.endline(y,this.writerOptions,this.currentLevel);else g=this.writer.indent(y,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(y,this.writerOptions,this.currentLevel);return this.writerOptions.state=$.None,this.onData(g,this.currentLevel),y.isClosed=!0}}onData(y,g){return this.documentStarted=!0,this.onDataCallback(y,g+1)}onEnd(){return this.documentCompleted=!0,this.onEndCallback()}debugInfo(y){if(y==null)return"";else return"node: <"+y+">"}ele(){return this.element(...arguments)}nod(y,g,h){return this.node(y,g,h)}txt(y){return this.text(y)}dat(y){return this.cdata(y)}com(y){return this.comment(y)}ins(y,g){return this.instruction(y,g)}dec(y,g,h){return this.declaration(y,g,h)}dtd(y,g,h){return this.doctype(y,g,h)}e(y,g,h){return this.element(y,g,h)}n(y,g,h){return this.node(y,g,h)}t(y){return this.text(y)}d(y){return this.cdata(y)}c(y){return this.comment(y)}r(y){return this.raw(y)}i(y,g){return this.instruction(y,g)}att(){if(this.currentNode&&this.currentNode.type===H.DocType)return this.attList(...arguments);else return this.attribute(...arguments)}a(){if(this.currentNode&&this.currentNode.type===H.DocType)return this.attList(...arguments);else return this.attribute(...arguments)}ent(y,g){return this.entity(y,g)}pent(y,g){return this.pEntity(y,g)}not(y,g){return this.notation(y,g)}}}).call(nXD)});var sXD=z((oXD,tXD)=>{(function(){var H,$,A,L,I={}.hasOwnProperty;H=TJ(),L=GwA(),$=ObH(),tXD.exports=A=class extends L{constructor(B,f){super(f);this.stream=B}endline(B,f,E){if(B.isLastRootNode&&f.state===$.CloseTag)return"";else return super.endline(B,f,E)}document(B,f){var E,M,G,U,X,J,F,Q,W;F=B.children;for(M=G=0,X=F.length;G0){this.stream.write(" ["),this.stream.write(this.endline(B,f,E)),f.state=$.InsideTag,X=B.children;for(G=0,U=X.length;G"),this.stream.write(this.endline(B,f,E)),f.state=$.None,this.closeNode(B,f,E)}element(B,f,E){var M,G,U,X,J,F,Q,W,P,C,Y,Z,q,O,j,u;if(E||(E=0),this.openNode(B,f,E),f.state=$.OpenTag,Y=this.indent(B,f,E)+"<"+B.name,f.pretty&&f.width>0){Q=Y.length,q=B.attribs;for(P in q){if(!I.call(q,P))continue;if(M=q[P],Z=this.attribute(M,f,E),G=Z.length,Q+G>f.width)u=this.indent(B,f,E+1)+Z,Y+=this.endline(B,f,E)+u,Q=u.length;else u=" "+Z,Y+=u,Q+=u.length}}else{O=B.attribs;for(P in O){if(!I.call(O,P))continue;M=O[P],Y+=this.attribute(M,f,E)}}if(this.stream.write(Y),X=B.children.length,J=X===0?null:B.children[0],X===0||B.children.every(function(y){return(y.type===H.Text||y.type===H.Raw||y.type===H.CData)&&y.value===""}))if(f.allowEmpty)this.stream.write(">"),f.state=$.CloseTag,this.stream.write("");else f.state=$.CloseTag,this.stream.write(f.spaceBeforeSlash+"/>");else if(f.pretty&&X===1&&(J.type===H.Text||J.type===H.Raw||J.type===H.CData)&&J.value!=null)this.stream.write(">"),f.state=$.InsideTag,f.suppressPrettyCount++,C=!0,this.writeChildNode(J,f,E+1),f.suppressPrettyCount--,C=!1,f.state=$.CloseTag,this.stream.write("");else{this.stream.write(">"+this.endline(B,f,E)),f.state=$.InsideTag,j=B.children;for(F=0,W=j.length;F")}return this.stream.write(this.endline(B,f,E)),f.state=$.None,this.closeNode(B,f,E)}processingInstruction(B,f,E){return this.stream.write(super.processingInstruction(B,f,E))}raw(B,f,E){return this.stream.write(super.raw(B,f,E))}text(B,f,E){return this.stream.write(super.text(B,f,E))}dtdAttList(B,f,E){return this.stream.write(super.dtdAttList(B,f,E))}dtdElement(B,f,E){return this.stream.write(super.dtdElement(B,f,E))}dtdEntity(B,f,E){return this.stream.write(super.dtdEntity(B,f,E))}dtdNotation(B,f,E){return this.stream.write(super.dtdNotation(B,f,E))}}}).call(oXD)});var HJD=z((eXD,eo)=>{(function(){var H,$,A,L,I,D,B,f,E;({assign:f,isFunction:E}=Oh()),A=BwA(),L=UwA(),I=aXD(),B=I_$(),D=sXD(),H=TJ(),$=ObH(),eo.exports.create=function(M,G,U,X){var J,F;if(M==null)throw Error("Root element needs a name.");if(X=f({},G,U,X),J=new L(X),F=J.element(M),!X.headless){if(J.declaration(X),X.pubID!=null||X.sysID!=null)J.dtd(X)}return F},eo.exports.begin=function(M,G,U){if(E(M))[G,U]=[M,G],M={};if(G)return new I(M,G,U);else return new L(M)},eo.exports.stringWriter=function(M){return new B(M)},eo.exports.streamWriter=function(M,G){return new D(M,G)},eo.exports.implementation=new A,eo.exports.nodeType=H,eo.exports.writerState=$}).call(eXD)});var IJD=z((LJD)=>{var $JD=G8A(),Ks9=HJD();LJD.build=Vs9;function Qs9(H){function $(A){return A<10?"0"+A:A}return H.getUTCFullYear()+"-"+$(H.getUTCMonth()+1)+"-"+$(H.getUTCDate())+"T"+$(H.getUTCHours())+":"+$(H.getUTCMinutes())+":"+$(H.getUTCSeconds())+"Z"}var Ws9=Object.prototype.toString;function AJD(H){var $=Ws9.call(H).match(/\[object (.*)\]/);return $?$[1]:$}function Vs9(H,$){var A={version:"1.0",encoding:"UTF-8"},L={pubid:"-//Apple//DTD PLIST 1.0//EN",sysid:"http://www.apple.com/DTDs/PropertyList-1.0.dtd"},I=Ks9.create("plist");if(I.dec(A.version,A.encoding,A.standalone),I.dtd(L.pubid,L.sysid),I.att("version","1.0"),XwA(H,I),!$)$={};return $.pretty=$.pretty!==!1,I.end($)}function XwA(H,$){var A,L,I,D=AJD(H);if(D=="Undefined")return;else if(Array.isArray(H)){$=$.ele("array");for(L=0;L{var DJD=h5D();Object.keys(DJD).forEach(function(H){JwA[H]=DJD[H]});var BJD=IJD();Object.keys(BJD).forEach(function(H){JwA[H]=BJD[H]})});async function xh(H,$){let L=M$().preferredNotifChannel;await FwA(H);let I=await Ps9(L,H,$);c("tengu_notification_method_used",{configured_channel:L,method_used:I,term:OA.terminal})}async function Ps9(H,$,A){let L=$.title||MJD;try{switch(H){case"auto":return _s9($,A);case"iterm2":return A.notifyITerm2($),"iterm2";case"iterm2_with_bell":return A.notifyITerm2($),A.notifyBell(),"iterm2_with_bell";case"kitty":return A.notifyKitty({...$,title:L,id:GJD()}),"kitty";case"terminal_bell":return A.notifyBell(),"terminal_bell";case"notifications_disabled":return"disabled";default:return"none"}}catch{return"error"}}async function _s9(H,$){let A=H.title||MJD;switch(OA.terminal){case"Apple_Terminal":{if(await Ys9())return $.notifyBell(),"terminal_bell";return"no_method_available"}case"iTerm.app":return $.notifyITerm2(H),"iterm2";case"kitty":return $.notifyKitty({...H,title:A,id:GJD()}),"kitty";case"ghostty":return $.notifyGhostty({...H,title:A}),"ghostty";default:return"no_method_available"}}function GJD(){return Math.floor(Math.random()*1e4)}async function Ys9(){try{if(OA.terminal!=="Apple_Terminal")return!1;let $=(await jA("osascript",["-e",'tell application "Terminal" to name of current settings of front window'])).stdout.trim();if(!$)return!1;let A=await jA("defaults",["export","com.apple.Terminal","-"]);if(A.code!==0)return!1;let D=EJD.default.parse(A.stdout)?.["Window Settings"]?.[$];if(!D)return!1;return D.Bell===!1}catch(H){return r(H instanceof Error?H:Error(String(H))),!1}}var EJD,MJD="Claude Code";var xbH=K(()=>{vA();B0();z$();Z1();_$();_3();EJD=b(fJD(),1)});async function UJD(H,$,A){try{let L=eG();if(L.error)return;let I={"Content-Type":"application/json","User-Agent":sG(),...L.headers},D={vcs_type:"github",vcs_host:$,vcs_username:H,git_user_email:A},B="https://api.anthropic.com/api/claude_code/link_vcs_account";await nA.post(B,D,{headers:I,timeout:5000})}catch(L){}}var XJD=K(()=>{w1();_Q()});async function Cs9(){try{let H=await jA("gh",["auth","status","--active","--json","hosts"],{useCwd:!1,timeout:5000});if(H.code!==0||!H.stdout.trim())return null;let A=DA(H.stdout)?.hosts;if(!A||typeof A!=="object")return null;for(let[L,I]of Object.entries(A)){if(!Array.isArray(I)||I.length===0)continue;let D=I[0];if(D?.login)return{username:D.login,hostname:L}}return null}catch(H){return null}}async function ws9(){try{let H=await jA(cB(),["config","--get","user.email"],{useCwd:!1,timeout:5000});if(H.code===0&&H.stdout.trim())return H.stdout.trim();return null}catch(H){return null}}async function KwA(){if(!XG(!0)&&!tI())return;if($O())return;if(!0){let I=await JP$();if(I.hasError||!I.vcsAccountLinkingEnabled)return}let[A,L]=await Promise.all([Cs9(),ws9()]);if(A||L)UJD(A?.username??"",A?.hostname??"",L??"")}var JJD=K(()=>{B0();XJD();EI();Y2A();vA();g$();Z$();t8()});var KJD={};XA(KJD,{ConsoleOAuthFlow:()=>s0H});function s0H({onDone:H,startingMessage:$,mode:A="login",forceLoginMethod:L}){let I=VL()||{},D=L??I.forceLoginMethod,B=I.forceLoginOrgUUID,f=D==="claudeai"?"Login method pre-selected: Subscription Plan (Claude Pro/Max)":D==="console"?"Login method pre-selected: API Usage Billing (Anthropic Console)":null,E=Vy(),[M,G]=MI.useState(()=>{if(A==="setup-token")return{state:"ready_to_start"};if(D==="claudeai"||D==="console")return{state:"ready_to_start"};return{state:"idle"}}),[U,X]=MI.useState(""),[J,F]=MI.useState(0),[Q]=MI.useState(()=>new DbH),[W,P]=MI.useState(()=>{return A==="setup-token"||D==="claudeai"}),[C,Y]=MI.useState(!1),[Z,q]=MI.useState(!1),O=QL().columns-FJD.length-1;MI.useEffect(()=>{if(D==="claudeai")c("tengu_oauth_claudeai_forced",{});else if(D==="console")c("tengu_oauth_console_forced",{})},[D]),MI.useEffect(()=>{if(M.state==="about_to_retry")setTimeout(()=>{G(M.nextState)},1000)},[M]),BA("confirm:yes",()=>{c("tengu_oauth_success",{loginWithClaudeAi:W}),H()},{context:"Confirmation",isActive:M.state==="success"&&A!=="setup-token"}),BA("confirm:yes",()=>{G({state:"idle"})},{context:"Confirmation",isActive:M.state==="platform_setup"}),BA("confirm:yes",()=>{if(M.state==="error"&&M.toRetry)X(""),G({state:"about_to_retry",nextState:M.toRetry})},{context:"Confirmation",isActive:M.state==="error"&&!!M.toRetry}),MI.useEffect(()=>{if(U==="c"&&M.state==="waiting_for_login"&&C&&!Z)K3(M.url).then((h)=>{if(h)q(!0),setTimeout(()=>q(!1),2000)}),X("")},[U,M,C,Z]);async function j(h,p){try{let[d,k]=h.split("#");if(!d||!k){G({state:"error",message:"Invalid code. Please make sure the full code was copied",toRetry:{state:"waiting_for_login",url:p}});return}c("tengu_oauth_manual_entry",{}),Q.handleManualAuthCodeInput({authorizationCode:d,state:k})}catch(d){r(d instanceof Error?d:Error(String(d))),G({state:"error",message:d.message,toRetry:{state:"waiting_for_login",url:p}})}}let u=MI.useCallback(async()=>{try{c("tengu_oauth_flow_start",{loginWithClaudeAi:W});let h=await Q.startOAuthFlow(async(p)=>{G({state:"waiting_for_login",url:p}),setTimeout(()=>Y(!0),3000)},{loginWithClaudeAi:W,inferenceOnly:A==="setup-token",expiresIn:A==="setup-token"?31536000:void 0,orgUUID:B}).catch((p)=>{let d=p.message.includes("Token exchange failed");throw G({state:"error",message:d?"Failed to exchange authorization code for access token. Please try again.":p.message,toRetry:A==="setup-token"?{state:"ready_to_start"}:{state:"idle"}}),c("tengu_oauth_token_exchange_error",{error:p.message}),p});if(A==="setup-token")G({state:"success",token:h.accessToken});else{let p=OqH(h);if(p.warning)c("tengu_oauth_storage_warning",{warning:p.warning});if(await l1L(h.accessToken).catch((d)=>{throw G({state:"error",message:"Failed to fetch user roles: "+d.message,toRetry:{state:"idle"}}),c("tengu_oauth_user_roles_error",{error:d.message}),d}),mk(h.scopes))await OoL(),IbH(),G({state:"success"}),xh({message:"Claude Code login successful",notificationType:"auth_success"},E),KwA();else if(G({state:"creating_api_key"}),await i1L(h.accessToken).catch((k)=>{throw G({state:"error",message:"Failed to create API key: "+k.message,toRetry:{state:"idle"}}),c("tengu_oauth_api_key_error",{error:k.message}),k}))IbH(),G({state:"success"}),xh({message:"Claude Code login successful",notificationType:"auth_success"},E),KwA();else G({state:"error",message:"Unable to create API key. The server accepted the request but didn't return a key.",toRetry:{state:"idle"}}),c("tengu_oauth_api_key_error",{error:"server_returned_no_key"})}}catch(h){let p=h.message;c("tengu_oauth_error",{error:p})}},[Q,Y,W,A,B]),y=MI.useRef(!1);MI.useEffect(()=>{if(M.state==="ready_to_start"&&!y.current)y.current=!0,process.nextTick(()=>{u(),y.current=!1})},[M.state,u]),MI.useEffect(()=>{if(A==="setup-token"&&M.state==="success"){let h=setTimeout(async()=>{c("tengu_oauth_success",{loginWithClaudeAi:W}),H()},500);return()=>clearTimeout(h)}},[A,M,W,H]),MI.useEffect(()=>{return()=>{Q.cleanup()}},[Q]);function g(){switch(M.state){case"idle":return MI.default.createElement(x,{flexDirection:"column",gap:1,marginTop:1},MI.default.createElement(V,{bold:!0},$?$:"Claude Code can be used with your Claude subscription or billed based on API usage through your Console account."),MI.default.createElement(V,null,"Select login method:"),MI.default.createElement(x,null,MI.default.createElement(QA,{options:[{label:MI.default.createElement(V,null,"Claude account with subscription \xB7"," ",MI.default.createElement(V,{dimColor:!0},"Pro, Max, Team, or Enterprise"),` `),value:"claudeai"},{label:MI.default.createElement(V,null,"Anthropic Console account \xB7"," ",MI.default.createElement(V,{dimColor:!0},"API usage billing"),` `),value:"platform"}],onCancel:()=>{},onChange:(h)=>{if(h==="platform")c("tengu_oauth_platform_selected",{}),G({state:"platform_setup"});else if(G({state:"ready_to_start"}),h==="claudeai")c("tengu_oauth_claudeai_selected",{}),P(!0);else c("tengu_oauth_console_selected",{}),P(!1)}})));case"platform_setup":return MI.default.createElement(x,{flexDirection:"column",gap:1,marginTop:1},MI.default.createElement(V,{bold:!0},"Using 3rd-party platforms"),MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,null,"Claude Code supports Amazon Bedrock, Microsoft Foundry, and Vertex AI. Set the required environment variables, then restart Claude Code."),MI.default.createElement(V,null,"If you are part of an enterprise organization, contact your administrator for setup instructions."),MI.default.createElement(x,{flexDirection:"column",marginTop:1},MI.default.createElement(V,{bold:!0},"Documentation:"),MI.default.createElement(V,null,"\xB7 Amazon Bedrock:"," ",MI.default.createElement(dI,{url:"https://code.claude.com/docs/en/amazon-bedrock"},"https://code.claude.com/docs/en/amazon-bedrock")),MI.default.createElement(V,null,"\xB7 Microsoft Foundry:"," ",MI.default.createElement(dI,{url:"https://code.claude.com/docs/en/microsoft-foundry"},"https://code.claude.com/docs/en/microsoft-foundry")),MI.default.createElement(V,null,"\xB7 Vertex AI:"," ",MI.default.createElement(dI,{url:"https://code.claude.com/docs/en/google-vertex-ai"},"https://code.claude.com/docs/en/google-vertex-ai"))),MI.default.createElement(x,{marginTop:1},MI.default.createElement(V,{dimColor:!0},"Press ",MI.default.createElement(V,{bold:!0},"Enter")," to go back to login options."))));case"waiting_for_login":return MI.default.createElement(x,{flexDirection:"column",gap:1},f&&MI.default.createElement(x,null,MI.default.createElement(V,{dimColor:!0},f)),!C&&MI.default.createElement(x,null,MI.default.createElement(vD,null),MI.default.createElement(V,null,"Opening browser to sign in\u2026")),C&&MI.default.createElement(x,null,MI.default.createElement(V,null,FJD),MI.default.createElement(W9,{value:U,onChange:X,onSubmit:(h)=>j(h,M.url),cursorOffset:J,onChangeCursorOffset:F,columns:O})));case"creating_api_key":return MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(x,null,MI.default.createElement(vD,null),MI.default.createElement(V,null,"Creating API key for Claude Code\u2026")));case"about_to_retry":return MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,{color:"permission"},"Retrying\u2026"));case"success":return MI.default.createElement(x,{flexDirection:"column"},A==="setup-token"&&M.token?null:MI.default.createElement(MI.default.Fragment,null,T9()?.emailAddress?MI.default.createElement(V,{dimColor:!0},"Logged in as"," ",MI.default.createElement(V,null,T9()?.emailAddress)):null,MI.default.createElement(V,{color:"success"},"Login successful. Press ",MI.default.createElement(V,{bold:!0},"Enter")," to continue\u2026")));case"error":return MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,{color:"error"},"OAuth error: ",M.message),M.toRetry&&MI.default.createElement(x,{marginTop:1},MI.default.createElement(V,{color:"permission"},"Press ",MI.default.createElement(V,{bold:!0},"Enter")," to retry.")));default:return null}}return MI.default.createElement(x,{flexDirection:"column",gap:1},M.state==="waiting_for_login"&&C&&MI.default.createElement(x,{flexDirection:"column",key:"urlToCopy",gap:1,paddingBottom:1},MI.default.createElement(x,{paddingX:1},MI.default.createElement(V,{dimColor:!0},"Browser didn't open? Use the url below to sign in"," "),Z?MI.default.createElement(V,{color:"success"},"(Copied!)"):MI.default.createElement(V,{dimColor:!0},MI.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),MI.default.createElement(dI,{url:M.url},MI.default.createElement(V,{dimColor:!0},M.url))),A==="setup-token"&&M.state==="success"&&M.token&&MI.default.createElement(x,{key:"tokenOutput",flexDirection:"column",gap:1,paddingTop:1},MI.default.createElement(V,{color:"success"},"\u2713 Long-lived authentication token created successfully!"),MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,null,"Your OAuth token (valid for 1 year):"),MI.default.createElement(V,{color:"warning"},M.token),MI.default.createElement(V,{dimColor:!0},"Store this token securely. You won't be able to see it again."),MI.default.createElement(V,{dimColor:!0},"Use this token by setting: export CLAUDE_CODE_OAUTH_TOKEN="))),MI.default.createElement(x,{paddingLeft:1,flexDirection:"column",gap:1},g()))}var MI,FJD="Paste code here if prompted > ";var SbH=K(()=>{xH();$I();pm();lB();S5();x2A();Hq();EI();z$();OB();_$();JM();xbH();TLH();N1();QP$();mL();aI();JJD();MI=b(s(),1)});function Ht(){let H=J$((A)=>A.mainLoopModel),$=J$((A)=>A.mainLoopModelForSession);return QJD.useMemo(()=>{return m8($??H??J5H())},[$,H])}var QJD;var jbH=K(()=>{aI();pL();QJD=b(s(),1)});var WJD=()=>{};var VJD=()=>{};var QwA=()=>{};function RbH(H,$,A){$.split&&($=$.split("."));var L=0,I=$.length,D=H,B,f;while(L{C2();PS=function(H){qi($,H);function $(A,L){var I=H.call(this,"".concat(A," ").concat(L))||this;return I.field=A,I}return $}(Error)});function D_$(H){return typeof H==="string"}function VwA(H){return H!==void 0&&H!==null}function PwA(H){return Object.prototype.toString.call(H).slice(8,-1).toLowerCase()==="object"}function Zs9(H){var $=".userId/anonymousId/previousId/groupId",A=function(I){var D,B,f;return(f=(B=(D=I.userId)!==null&&D!==void 0?D:I.anonymousId)!==null&&B!==void 0?B:I.groupId)!==null&&f!==void 0?f:I.previousId},L=A(H);if(!VwA(L))throw new PS($,_JD);else if(!D_$(L))throw new PS($,_wA)}function qs9(H){if(!VwA(H))throw new PS("Event",_JD);if(typeof H!=="object")throw new PS("Event",YwA)}function Ts9(H){if(!D_$(H.type))throw new PS(".type",_wA)}function zs9(H){if(!D_$(H.event))throw new PS(".event",_wA)}function Ns9(H){if(!PwA(H.properties))throw new PS(".properties",YwA)}function Os9(H){if(!PwA(H.traits))throw new PS(".traits",YwA)}function YJD(H){if(qs9(H),Ts9(H),H.type==="track")zs9(H),Ns9(H);if(["group","identify"].includes(H.type))Os9(H);Zs9(H)}var _wA="is not a string",YwA="is not an object",_JD="is nil";var CwA=K(()=>{WwA()});var CJD;var wJD=K(()=>{C2();CwA();QwA();CJD=function(){function H($){this.user=$.user,this.createMessageId=$.createMessageId}return H.prototype.track=function($,A,L,I){return this.normalize(q9(q9({},this.baseEvent()),{event:$,type:"track",properties:A!==null&&A!==void 0?A:{},options:q9({},L),integrations:q9({},I)}))},H.prototype.page=function($,A,L,I,D){var B,f={type:"page",properties:q9({},L),options:q9({},I),integrations:q9({},D)};if($!==null)f.category=$,f.properties=(B=f.properties)!==null&&B!==void 0?B:{},f.properties.category=$;if(A!==null)f.name=A;return this.normalize(q9(q9({},this.baseEvent()),f))},H.prototype.screen=function($,A,L,I,D){var B={type:"screen",properties:q9({},L),options:q9({},I),integrations:q9({},D)};if($!==null)B.category=$;if(A!==null)B.name=A;return this.normalize(q9(q9({},this.baseEvent()),B))},H.prototype.identify=function($,A,L,I){return this.normalize(q9(q9({},this.baseEvent()),{type:"identify",userId:$,traits:A!==null&&A!==void 0?A:{},options:q9({},L),integrations:I}))},H.prototype.group=function($,A,L,I){return this.normalize(q9(q9({},this.baseEvent()),{type:"group",traits:A!==null&&A!==void 0?A:{},options:q9({},L),integrations:q9({},I),groupId:$}))},H.prototype.alias=function($,A,L,I){var D={userId:$,type:"alias",options:q9({},L),integrations:q9({},I)};if(A!==null)D.previousId=A;if($===void 0)return this.normalize(q9(q9({},D),this.baseEvent()));return this.normalize(q9(q9({},this.baseEvent()),D))},H.prototype.baseEvent=function(){var $={integrations:{},options:{}};if(!this.user)return $;var A=this.user;if(A.id())$.userId=A.id();if(A.anonymousId())$.anonymousId=A.anonymousId();return $},H.prototype.context=function($){var A,L=["userId","anonymousId","timestamp"];delete $.integrations;var I=Object.keys($),D=(A=$.context)!==null&&A!==void 0?A:{},B={};return I.forEach(function(f){if(f==="context")return;if(L.includes(f))RbH(B,f,$[f]);else RbH(D,f,$[f])}),[D,B]},H.prototype.normalize=function($){var A,L,I=Object.keys((A=$.integrations)!==null&&A!==void 0?A:{}).reduce(function(J,F){var Q,W;return q9(q9({},J),(Q={},Q[F]=Boolean((W=$.integrations)===null||W===void 0?void 0:W[F]),Q))},{});$.options=PJD($.options||{},function(J,F){return F!==void 0});var D=q9(q9({},I),(L=$.options)===null||L===void 0?void 0:L.integrations),B=$.options?this.context($.options):[],f=B[0],E=B[1],M=$.options,G=xvL($,["options"]),U=q9(q9(q9({timestamp:new Date},G),{integrations:D,context:f}),E),X=q9(q9({},U),{messageId:this.createMessageId()});return YJD(X),X},H}()});function wwA(H,$){return new Promise(function(A,L){var I=setTimeout(function(){L(Error("Promise timed out"))},$);H.then(function(D){return clearTimeout(I),A(D)}).catch(L)})}function xs9(H){return new Promise(function($){return setTimeout($,H)})}function ZJD(H,$,A){var L=function(){try{return Promise.resolve($(H))}catch(I){return Promise.reject(I)}};return xs9(A).then(function(){return wwA(L(),1000)}).catch(function(I){H===null||H===void 0||H.log("warn","Callback Error",{error:I}),H===null||H===void 0||H.stats.increment("callback_error")}).then(function(){return H})}var qJD=function(){var H,$,A=new Promise(function(L,I){H=L,$=I});return{resolve:H,reject:$,promise:A}};var TJD=()=>{};var $t;var zJD=K(()=>{$t=function(){function H($){var A;this.callbacks={},this.warned=!1,this.maxListeners=(A=$===null||$===void 0?void 0:$.maxListeners)!==null&&A!==void 0?A:10}return H.prototype.warnIfPossibleMemoryLeak=function($){if(this.warned)return;if(this.maxListeners&&this.callbacks[$].length>this.maxListeners)console.warn("Event Emitter: Possible memory leak detected; ".concat(String($)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0},H.prototype.on=function($,A){if(!this.callbacks[$])this.callbacks[$]=[A];else this.callbacks[$].push(A),this.warnIfPossibleMemoryLeak($);return this},H.prototype.once=function($,A){var L=this,I=function(){var D=[];for(var B=0;B{zJD()});var c7H=K(()=>{TJD();NJD()});function ybH(H){var $=Math.random()+1,A=H.minTimeout,L=A===void 0?500:A,I=H.factor,D=I===void 0?2:I,B=H.attempt,f=H.maxTimeout,E=f===void 0?1/0:f;return Math.min($*L*Math.pow(D,B),E)}var ZwA="onRemoveFromFuture",OJD;var qwA=K(()=>{C2();c7H();OJD=function(H){qi($,H);function $(A,L,I){var D=H.call(this)||this;return D.future=[],D.maxAttempts=A,D.queue=L,D.seen=I!==null&&I!==void 0?I:{},D}return $.prototype.push=function(){var A=this,L=[];for(var I=0;IA.maxAttempts||A.includes(B))return!1;return A.queue.push(B),!0});return this.queue=this.queue.sort(function(B,f){return A.getAttempts(B)-A.getAttempts(f)}),D},$.prototype.pushWithBackoff=function(A){var L=this;if(this.getAttempts(A)===0)return this.push(A)[0];var I=this.updateAttempts(A);if(I>this.maxAttempts||this.includes(A))return!1;var D=ybH({attempt:I-1});return setTimeout(function(){L.queue.push(A),L.future=L.future.filter(function(B){return B.id!==A.id}),L.emit(ZwA)},D),this.future.push(A),!0},$.prototype.getAttempts=function(A){var L;return(L=this.seen[A.id])!==null&&L!==void 0?L:0},$.prototype.updateAttempts=function(A){return this.seen[A.id]=this.getAttempts(A)+1,this.getAttempts(A)},$.prototype.includes=function(A){return this.queue.includes(A)||this.future.includes(A)||Boolean(this.queue.find(function(L){return L.id===A.id}))||Boolean(this.future.find(function(L){return L.id===A.id}))},$.prototype.pop=function(){return this.queue.shift()},Object.defineProperty($.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),$}($t)});function H9H(){var H=0,$,A="";if(!B_$||e0H+16>256){B_$=Array(H=256);while(H--)B_$[H]=256*Math.random()|0;H=e0H=0}for(;H<16;H++){if($=B_$[e0H+H],H==6)A+=f_$[$&15|64];else if(H==8)A+=f_$[$&63|128];else A+=f_$[$];if(H&1&&H>1&&H<11)A+="-"}return e0H++,A}var e0H=256,f_$,B_$;var TwA=K(()=>{f_$=[];while(e0H--)f_$[e0H]=(e0H+256).toString(16).substring(1)});var xJD;var SJD=K(()=>{C2();xJD=function(){function H(){this._logs=[]}return H.prototype.log=function($,A,L){var I=new Date;this._logs.push({level:$,message:A,time:I,extras:L})},Object.defineProperty(H.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),H.prototype.flush=function(){if(this.logs.length>1){var $=this._logs.reduce(function(A,L){var I,D,B,f=q9(q9({},L),{json:JSON.stringify(L.extras,null," "),extras:L.extras});delete f.time;var E=(B=(D=L.time)===null||D===void 0?void 0:D.toISOString())!==null&&B!==void 0?B:"";if(A[E])E="".concat(E,"-").concat(Math.random());return q9(q9({},A),(I={},I[E]=f,I))},{});if(console.table)console.table($);else console.log($)}else this.logs.forEach(function(A){var{level:L,message:I,extras:D}=A;if(L==="info"||L==="debug")console.log(I,D!==null&&D!==void 0?D:"");else console[L](I,D!==null&&D!==void 0?D:"")});this._logs=[]},H}()});var Ss9=function(H){var $={gauge:"g",counter:"c"};return $[H]},js9,jJD;var zwA=K(()=>{C2();js9=function(){function H(){this.metrics=[]}return H.prototype.increment=function($,A,L){if(A===void 0)A=1;this.metrics.push({metric:$,value:A,tags:L!==null&&L!==void 0?L:[],type:"counter",timestamp:Date.now()})},H.prototype.gauge=function($,A,L){this.metrics.push({metric:$,value:A,tags:L!==null&&L!==void 0?L:[],type:"gauge",timestamp:Date.now()})},H.prototype.flush=function(){var $=this.metrics.map(function(A){return q9(q9({},A),{tags:A.tags.join(",")})});if(console.table)console.table($);else console.log($);this.metrics=[]},H.prototype.serialize=function(){return this.metrics.map(function($){return{m:$.metric,v:$.value,t:$.tags,k:Ss9($.type),e:$.timestamp}})},H}(),jJD=function(H){qi($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $.prototype.gauge=function(){var A=[];for(var L=0;L{TwA();SJD();zwA();l7H=function(){function H($){var A,L,I;this.retry=(A=$.retry)!==null&&A!==void 0?A:!0,this.type=(L=$.type)!==null&&L!==void 0?L:"plugin Error",this.reason=(I=$.reason)!==null&&I!==void 0?I:""}return H}(),$9H=function(){function H($,A,L,I){if(A===void 0)A=H9H();if(L===void 0)L=new jJD;if(I===void 0)I=new xJD;this.attempts=0,this.event=$,this._id=A,this.logger=I,this.stats=L}return H.system=function(){},H.prototype.isSame=function($){return $.id===this.id},H.prototype.cancel=function($){if($)throw $;throw new l7H({reason:"Context Cancel"})},H.prototype.log=function($,A,L){this.logger.log($,A,L)},Object.defineProperty(H.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),H.prototype.updateEvent=function($,A){var L;if($.split(".")[0]==="integrations"){var I=$.split(".")[1];if(((L=this.event.integrations)===null||L===void 0?void 0:L[I])===!1)return this.event}return RbH(this.event,$,A),this.event},H.prototype.failedDelivery=function(){return this._failedDelivery},H.prototype.setFailedDelivery=function($){this._failedDelivery=$},H.prototype.logs=function(){return this.logger.logs},H.prototype.flush=function(){this.logger.flush(),this.stats.flush()},H.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},H}()});function RJD(H,$){var A={};return H.forEach(function(L){var I,D=void 0;if(typeof $==="string"){var B=L[$];D=typeof B!=="string"?JSON.stringify(B):B}else if($ instanceof Function)D=$(L);if(D===void 0)return;A[D]=wHA(wHA([],(I=A[D])!==null&&I!==void 0?I:[],!0),[L],!1)}),A}var yJD=K(()=>{C2()});var vJD=function(H){return typeof H==="object"&&H!==null&&"then"in H&&typeof H.then==="function"};var hJD=function(){var H,$,A=0;return{done:function(){return H},run:function(L){var I=L();if(vJD(I)){if(++A===1)H=new Promise(function(D){return $=D});I.finally(function(){return--A===0&&$()})}return I}}};var bJD=()=>{};function Rs9(H){return OV(this,void 0,void 0,function(){var $;return xV(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),[4,H()];case 1:return[2,A.sent()];case 2:return $=A.sent(),[2,Promise.reject($)];case 3:return[2]}})})}function vbH(H,$){H.log("debug","plugin",{plugin:$.name});var A=new Date().getTime(),L=$[H.event.type];if(L===void 0)return Promise.resolve(H);var I=Rs9(function(){return L.apply($,[H])}).then(function(D){var B=new Date().getTime()-A;return D.stats.gauge("plugin_time",B,["plugin:".concat($.name)]),D}).catch(function(D){if(D instanceof l7H&&D.type==="middleware_cancellation")throw D;if(D instanceof l7H)return H.log("warn",D.type,{plugin:$.name,error:D}),D;return H.log("error","plugin Error",{plugin:$.name,error:D}),H.stats.increment("plugin_error",1,["plugin:".concat($.name)]),D});return I}function kJD(H,$){return vbH(H,$).then(function(A){if(A instanceof $9H)return A;H.log("debug","Context canceled"),H.stats.increment("context_canceled"),H.cancel(A)})}var NwA=K(()=>{C2();E_$()});var uJD;var gJD=K(()=>{C2();yJD();qwA();E_$();c7H();bJD();NwA();uJD=function(H){qi($,H);function $(A){var L=H.call(this)||this;return L.criticalTasks=hJD(),L.plugins=[],L.failedInitializations=[],L.flushing=!1,L.queue=A,L.queue.on(ZwA,function(){L.scheduleFlush(0)}),L}return $.prototype.register=function(A,L,I){return OV(this,void 0,void 0,function(){var D=this;return xV(this,function(B){switch(B.label){case 0:return[4,Promise.resolve(L.load(A,I)).then(function(){D.plugins.push(L)}).catch(function(f){if(L.type==="destination"){D.failedInitializations.push(L.name),console.warn(L.name,f),A.log("warn","Failed to load destination",{plugin:L.name,error:f});return}throw f})];case 1:return B.sent(),[2]}})})},$.prototype.deregister=function(A,L,I){return OV(this,void 0,void 0,function(){var D;return xV(this,function(B){switch(B.label){case 0:if(B.trys.push([0,3,,4]),!L.unload)return[3,2];return[4,Promise.resolve(L.unload(A,I))];case 1:B.sent(),B.label=2;case 2:return this.plugins=this.plugins.filter(function(f){return f.name!==L.name}),[3,4];case 3:return D=B.sent(),A.log("warn","Failed to unload destination",{plugin:L.name,error:D}),[3,4];case 4:return[2]}})})},$.prototype.dispatch=function(A){return OV(this,void 0,void 0,function(){var L;return xV(this,function(I){return A.log("debug","Dispatching"),A.stats.increment("message_dispatched"),this.queue.push(A),L=this.subscribeToDelivery(A),this.scheduleFlush(0),[2,L]})})},$.prototype.subscribeToDelivery=function(A){return OV(this,void 0,void 0,function(){var L=this;return xV(this,function(I){return[2,new Promise(function(D){var B=function(f,E){if(f.isSame(A))if(L.off("flush",B),E)D(f);else D(f)};L.on("flush",B)})]})})},$.prototype.dispatchSingle=function(A){return OV(this,void 0,void 0,function(){var L=this;return xV(this,function(I){return A.log("debug","Dispatching"),A.stats.increment("message_dispatched"),this.queue.updateAttempts(A),A.attempts=1,[2,this.deliver(A).catch(function(D){var B=L.enqueuRetry(D,A);if(!B)return A.setFailedDelivery({reason:D}),A;return L.subscribeToDelivery(A)})]})})},$.prototype.isEmpty=function(){return this.queue.length===0},$.prototype.scheduleFlush=function(A){var L=this;if(A===void 0)A=500;if(this.flushing)return;this.flushing=!0,setTimeout(function(){L.flush().then(function(){setTimeout(function(){if(L.flushing=!1,L.queue.length)L.scheduleFlush(0)},0)})},A)},$.prototype.deliver=function(A){return OV(this,void 0,void 0,function(){var L,I,D,B;return xV(this,function(f){switch(f.label){case 0:return[4,this.criticalTasks.done()];case 1:f.sent(),L=Date.now(),f.label=2;case 2:return f.trys.push([2,4,,5]),[4,this.flushOne(A)];case 3:return A=f.sent(),I=Date.now()-L,this.emit("delivery_success",A),A.stats.gauge("delivered",I),A.log("debug","Delivered",A.event),[2,A];case 4:throw D=f.sent(),B=D,A.log("error","Failed to deliver",B),this.emit("delivery_failure",A,B),A.stats.increment("delivery_failed"),D;case 5:return[2]}})})},$.prototype.enqueuRetry=function(A,L){var I=!(A instanceof l7H)||A.retry;if(!I)return!1;return this.queue.pushWithBackoff(L)},$.prototype.flush=function(){return OV(this,void 0,void 0,function(){var A,L,I;return xV(this,function(D){switch(D.label){case 0:if(this.queue.length===0)return[2,[]];if(A=this.queue.pop(),!A)return[2,[]];A.attempts=this.queue.getAttempts(A),D.label=1;case 1:return D.trys.push([1,3,,4]),[4,this.deliver(A)];case 2:return A=D.sent(),this.emit("flush",A,!0),[3,4];case 3:if(L=D.sent(),I=this.enqueuRetry(L,A),!I)A.setFailedDelivery({reason:L}),this.emit("flush",A,!1);return[2,[]];case 4:return[2,[A]]}})})},$.prototype.isReady=function(){return!0},$.prototype.availableExtensions=function(A){var L=this.plugins.filter(function(J){var F,Q,W;if(J.type!=="destination"&&J.name!=="Segment.io")return!0;var P=void 0;return(F=J.alternativeNames)===null||F===void 0||F.forEach(function(C){if(A[C]!==void 0)P=A[C]}),(W=(Q=A[J.name])!==null&&Q!==void 0?Q:P)!==null&&W!==void 0?W:(J.name==="Segment.io"?!0:A.All)!==!1}),I=RJD(L,"type"),D=I.before,B=D===void 0?[]:D,f=I.enrichment,E=f===void 0?[]:f,M=I.destination,G=M===void 0?[]:M,U=I.after,X=U===void 0?[]:U;return{before:B,enrichment:E,destinations:G,after:X}},$.prototype.flushOne=function(A){var L,I;return OV(this,void 0,void 0,function(){var D,B,f,E,M,G,F,U,X,J,F,Q,W,P,C;return xV(this,function(Y){switch(Y.label){case 0:if(!this.isReady())throw Error("Not ready");if(A.attempts>1)this.emit("delivery_retry",A);D=this.availableExtensions((L=A.event.integrations)!==null&&L!==void 0?L:{}),B=D.before,f=D.enrichment,E=0,M=B,Y.label=1;case 1:if(!(E{};function pJD(H,$,A,L){return OV(this,void 0,void 0,function(){var I,D;return xV(this,function(B){switch(B.label){case 0:if(A.emit("dispatch_start",H),I=Date.now(),!$.isEmpty())return[3,2];return[4,$.dispatchSingle(H)];case 1:return D=B.sent(),[3,4];case 2:return[4,$.dispatch(H)];case 3:D=B.sent(),B.label=4;case 4:if(!(L===null||L===void 0?void 0:L.callback))return[3,6];return[4,ZJD(D,L.callback,ys9(I,L.timeout))];case 5:D=B.sent(),B.label=6;case 6:if(L===null||L===void 0?void 0:L.debug)D.flush();return[2,D]}})})}var ys9=function(H,$){var A=Date.now()-H;return Math.max(($!==null&&$!==void 0?$:300)-A,0)};var dJD=K(()=>{C2()});function cJD(H){var $=H.constructor.prototype;for(var A=0,L=Object.getOwnPropertyNames($);A{WJD();VJD();QwA();wJD();qwA();E_$();gJD();mJD();dJD();WwA();CwA();zwA();NwA()});var lJD=(H)=>{if(!H.writeKey)throw new PS("writeKey","writeKey is missing.")};var iJD=K(()=>{At()});var M_$="1.3.0";var vs9=(H)=>H.replace(/\/$/,""),nJD=(H,$)=>{return vs9(new URL($||"",H).href)};var OwA=K(()=>{TwA()});class xwA{constructor(H){this.id=H9H(),this.items=[],this.sizeInBytes=0,this.maxEventCount=Math.max(1,H)}tryAdd(H){if(this.length===this.maxEventCount)return{success:!1,message:`Event limit of ${this.maxEventCount} has been exceeded.`};let $=this.calculateSize(H.context);if($>rJD*1024)return{success:!1,message:`Event exceeds maximum event size of ${rJD} KB`};if(this.sizeInBytes+$>aJD*1024)return{success:!1,message:`Event has caused batch size to exceed ${aJD} KB`};return this.items.push(H),this.sizeInBytes+=$,{success:!0}}get length(){return this.items.length}calculateSize(H){return Buffer.byteLength(JSON.stringify(H.event),"utf8")}getEvents(){return this.items.map(({context:$})=>$.event)}getContexts(){return this.items.map((H)=>H.context)}resolveEvents(){this.items.forEach(({resolver:H,context:$})=>H($))}}var rJD=32,aJD=480;var oJD=K(()=>{OwA()});var tJD,sJD=(H)=>{return tJD.Buffer.from(H).toString("base64")};var eJD=K(()=>{tJD=require("buffer")});function hs9(H){return new Promise(($)=>setTimeout($,H))}function hbH(){}class SwA{constructor({host:H,path:$,maxRetries:A,flushAt:L,flushInterval:I,writeKey:D,httpRequestTimeout:B,httpClient:f,disable:E},M){this._emitter=M,this._maxRetries=A,this._flushAt=Math.max(L,1),this._flushInterval=I,this._auth=sJD(`${D}:`),this._url=nJD(H??"https://api.segment.io",$??"/v1/batch"),this._httpRequestTimeout=B??1e4,this._disable=Boolean(E),this._httpClient=f}createBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout);let H=new xwA(this._flushAt);return this._batch=H,this.pendingFlushTimeout=setTimeout(()=>{if(H===this._batch)this._batch=void 0;if(this.pendingFlushTimeout=void 0,H.length)this.send(H).catch(hbH)},this._flushInterval),H}clearBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout),this._batch=void 0}flush(H){if(!H)return;if(this._flushPendingItemsCount=H,!this._batch)return;if(this._batch.length===H)this.send(this._batch).catch(hbH),this.clearBatch()}enqueue(H){let $=this._batch??this.createBatch(),{promise:A,resolve:L}=qJD(),I={context:H,resolver:L};if($.tryAdd(I).success){let E=$.length===this._flushPendingItemsCount;if($.length===this._flushAt||E)this.send($).catch(hbH),this.clearBatch();return A}if($.length)this.send($).catch(hbH),this.clearBatch();let B=this.createBatch(),f=B.tryAdd(I);if(f.success){if(B.length===this._flushPendingItemsCount)this.send(B).catch(hbH),this.clearBatch();return A}else return H.setFailedDelivery({reason:Error(f.message)}),Promise.resolve(H)}async send(H){if(this._flushPendingItemsCount)this._flushPendingItemsCount-=H.length;let $=H.getEvents(),A=this._maxRetries+1,L=0;while(L=200&&B.status<300){H.resolveEvents();return}else if(B.status===400){HFD(H,Error(`[${B.status}] ${B.statusText}`));return}else I=Error(`[${B.status}] ${B.statusText}`)}catch(D){I=D}if(L===A){HFD(H,I);return}await hs9(ybH({attempt:L,minTimeout:25,maxTimeout:1000}))}}}function HFD(H,$){H.getContexts().forEach((A)=>A.setFailedDelivery({reason:$})),H.resolveEvents()}var $FD=K(()=>{At();c7H();oJD();eJD()});var G_$=()=>{if(typeof process==="object"&&process&&typeof process.env==="object"&&process.env&&typeof process.version==="string")return"node";if(typeof window==="object")return"browser";if(typeof WebSocketPair<"u")return"cloudflare-worker";if(typeof EdgeRuntime==="string")return"vercel-edge";if(typeof WorkerGlobalScope<"u"&&typeof importScripts==="function")return"web-worker";return"unknown"};function bs9(H){H.updateEvent("context.library.name","@segment/analytics-node"),H.updateEvent("context.library.version",M_$);let $=G_$();if($==="node")H.updateEvent("_metadata.nodeVersion",process.version);H.updateEvent("_metadata.jsRuntime",$)}function ks9(H){function $(A){return bs9(A),H.enqueue(A)}return{name:"Segment.io",type:"destination",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),alias:$,group:$,identify:$,page:$,screen:$,track:$}}var AFD=(H,$)=>{let A=new SwA(H,$);return{publisher:A,plugin:ks9(A)}};var LFD=K(()=>{$FD()});var IFD=()=>{return`node-next-${Date.now()}-${H9H()}`};var DFD=K(()=>{OwA()});var jwA;var BFD=K(()=>{At();DFD();jwA=class jwA extends CJD{constructor(){super({createMessageId:IFD})}}});var A9H;var U_$=K(()=>{At();A9H=class A9H extends $9H{static system(){return new this({type:"track",event:"system"})}}});var us9=(H)=>($)=>{let A=$.failedDelivery();return A?H(A.reason,$):H(void 0,$)},fFD=async(H,$,A,L)=>{try{let I=new A9H(H),D=await pJD(I,$,A,{...L?{callback:us9(L)}:{}}),B=D.failedDelivery();if(B)A.emit("error",{code:"delivery_failure",reason:B.reason,ctx:D});else A.emit(H.type,D)}catch(I){A.emit("error",{code:"unknown",reason:I})}};var EFD=K(()=>{At();U_$()});var RwA;var MFD=K(()=>{c7H();RwA=class RwA extends $t{}});var GFD,ywA;var UFD=K(()=>{At();GFD=class GFD extends OJD{constructor(){super(1,[])}getAttempts(H){return H.attempts??0}updateAttempts(H){return H.attempts=this.getAttempts(H)+1,this.getAttempts(H)}};ywA=class ywA extends uJD{constructor(){super(new GFD)}}});var XFD,JFD,FFD=(H)=>{if(G_$()==="cloudflare-worker")return[];let $=new(globalThis.AbortController||JFD),A=setTimeout(()=>{$.abort()},H);return A?.unref?.(),[$.signal,A]};var KFD=K(()=>{c7H();XFD=class XFD{constructor(){this.onabort=null,this.aborted=!1,this.eventEmitter=new $t}toString(){return"[object AbortSignal]"}get[Symbol.toStringTag](){return"AbortSignal"}removeEventListener(...H){this.eventEmitter.off(...H)}addEventListener(...H){this.eventEmitter.on(...H)}dispatchEvent(H){let $={type:H,target:this},A=`on${H}`;if(typeof this[A]==="function")this[A]($);this.eventEmitter.emit(H,$)}};JFD=class JFD{constructor(){this.signal=new XFD}abort(){if(this.signal.aborted)return;this.signal.aborted=!0,this.signal.dispatchEvent("abort")}toString(){return"[object AbortController]"}get[Symbol.toStringTag](){return"AbortController"}}});var QFD=async(...H)=>{if(globalThis.fetch)return globalThis.fetch(...H);else if(typeof EdgeRuntime!=="string")return(await import("node-fetch")).default(...H);else throw Error("Invariant: an edge runtime that does not support fetch should not exist")};class bbH{constructor(H){this._fetch=H??QFD}async makeRequest(H){let[$,A]=FFD(H.httpRequestTimeout),L={url:H.url,method:H.method,headers:H.headers,body:JSON.stringify(H.data),signal:$};return this._fetch(H.url,L).finally(()=>clearTimeout(A))}}var vwA=K(()=>{KFD()});var kbH;var hwA=K(()=>{At();iJD();LFD();BFD();EFD();MFD();U_$();UFD();vwA();kbH=class kbH extends RwA{constructor(H){super();this._isClosed=!1,this._pendingEvents=0,this._isFlushing=!1,lJD(H),this._eventFactory=new jwA,this._queue=new ywA;let $=H.flushInterval??1e4;this._closeAndFlushDefaultTimeout=$*1.25;let{plugin:A,publisher:L}=AFD({writeKey:H.writeKey,host:H.host,path:H.path,maxRetries:H.maxRetries??3,flushAt:H.flushAt??H.maxEventsInBatch??15,httpRequestTimeout:H.httpRequestTimeout,disable:H.disable,flushInterval:$,httpClient:typeof H.httpClient==="function"?new bbH(H.httpClient):H.httpClient??new bbH},this);this._publisher=L,this.ready=this.register(A).then(()=>{return}),this.emit("initialize",H),cJD(this)}get VERSION(){return M_$}closeAndFlush({timeout:H=this._closeAndFlushDefaultTimeout}={}){return this.flush({timeout:H,close:!0})}async flush({timeout:H,close:$=!1}={}){if(this._isFlushing){console.warn("Overlapping flush calls detected. Please wait for the previous flush to finish before calling .flush again");return}else this._isFlushing=!0;if($)this._isClosed=!0;this._publisher.flush(this._pendingEvents);let A=new Promise((L)=>{if(!this._pendingEvents)L();else this.once("drained",()=>{L()})}).finally(()=>{this._isFlushing=!1});return H?wwA(A,H).catch(()=>{return}):A}_dispatch(H,$){if(this._isClosed){this.emit("call_after_close",H);return}this._pendingEvents++,fFD(H,this._queue,this,$).catch((A)=>A).finally(()=>{if(this._pendingEvents--,!this._pendingEvents)this.emit("drained")})}alias({userId:H,previousId:$,context:A,timestamp:L,integrations:I},D){let B=this._eventFactory.alias(H,$,{context:A,integrations:I,timestamp:L});this._dispatch(B,D)}group({timestamp:H,groupId:$,userId:A,anonymousId:L,traits:I={},context:D,integrations:B},f){let E=this._eventFactory.group($,I,{context:D,anonymousId:L,userId:A,timestamp:H,integrations:B});this._dispatch(E,f)}identify({userId:H,anonymousId:$,traits:A={},context:L,timestamp:I,integrations:D},B){let f=this._eventFactory.identify(H,A,{context:L,anonymousId:$,userId:H,timestamp:I,integrations:D});this._dispatch(f,B)}page({userId:H,anonymousId:$,category:A,name:L,properties:I,context:D,timestamp:B,integrations:f},E){let M=this._eventFactory.page(A??null,L??null,I,{context:D,anonymousId:$,userId:H,timestamp:B,integrations:f});this._dispatch(M,E)}screen({userId:H,anonymousId:$,category:A,name:L,properties:I,context:D,timestamp:B,integrations:f},E){let M=this._eventFactory.screen(A??null,L??null,I,{context:D,anonymousId:$,userId:H,timestamp:B,integrations:f});this._dispatch(M,E)}track({userId:H,anonymousId:$,event:A,properties:L,context:I,timestamp:D,integrations:B},f){let E=this._eventFactory.track(A,L,{context:I,userId:H,anonymousId:$,timestamp:D,integrations:B});this._dispatch(E,f)}register(...H){return this._queue.criticalTasks.run(async()=>{let $=A9H.system(),A=H.map((L)=>this._queue.register($,L,this));await Promise.all(A),this.emit("register",H.map((L)=>L.name))})}async deregister(...H){let $=A9H.system(),A=H.map((L)=>{let I=this._queue.plugins.find((D)=>D.name===L);if(I)return this._queue.deregister($,I,this);else $.log("warn",`plugin ${L} not found`)});await Promise.all(A),this.emit("deregister",H)}}});var WFD=K(()=>{hwA();U_$();vwA();hwA()});function ms9(){return gs9.production}async function ps9(){if(NP())return!1;return!0}async function bwA(H,$){let A=await VFD();if(!A)return;try{let L=uwA(),I=T9(),D=await VKH({model:$.model}),B=QqI(D,$),f={anonymousId:L,event:H,properties:B};if(I){let E=nm(!0);f.userId=E.deviceId,f.properties.accountUuid=I.accountUuid,f.properties.organizationUuid=I.organizationUuid}A.track(f)}catch(L){r(L instanceof Error?L:Error(String(L)))}}async function PFD(H){let $=await VFD();if(!$)return;try{let A=uwA(),L=T9(),I={anonymousId:A,traits:H};if(L){let D=nm(!0);I.userId=D.deviceId}$.identify(I)}catch(A){r(A instanceof Error?A:Error(String(A)))}}var gs9,X_$=null,VFD;var kwA=K(()=>{WFD();tD();ELH();vA();_$();EI();R4();Fo();gs9={production:"LKJN8LsLERHEOXkw487o7qCTFOrGPimI",development:"b64sf1kxwDGe1PiSAlv5ixuH0f509RKK"};VFD=o$(async()=>{if(!await ps9())return null;try{return X_$=new kbH({writeKey:ms9()}),process.on("beforeExit",async()=>{await X_$?.closeAndFlush()}),process.on("exit",()=>{X_$?.closeAndFlush()}),X_$}catch($){return r($ instanceof Error?$:Error(String($))),null}})});var _FD={};XA(_FD,{call:()=>cs9,Login:()=>i7H});function ds9(){let H=T9();if(!H)return{};return{email:H.emailAddress,account_uuid:H.accountUuid,organization_uuid:H.organizationUuid}}async function cs9(H,$){return Z3.createElement(i7H,{onDone:async(A)=>{if($.onChangeAPIKey(),$.setMessages(YFD),A)MEH(),PFD(ds9()),G7$(),vU$(),$.setAppState((L)=>({...L,authVersion:L.authVersion+1}));H(A?"Login successful":"Login interrupted")}})}function i7H(H){let $=Ht(),A=zB(()=>H.onDone(!1,$));return BA("confirm:no",()=>H.onDone(!1,$),{context:"Confirmation"}),Z3.createElement(x,{flexDirection:"column",marginTop:1},Z3.createElement(s0H,{onDone:()=>H.onDone(!0,$),startingMessage:H.startingMessage}),Z3.createElement(x,{marginLeft:1},Z3.createElement(V,{dimColor:!0},A.pending?Z3.createElement(Z3.Fragment,null,"Press ",A.keyName," again to exit"):"")))}var Z3;var J_$=K(()=>{SbH();UM();xH();$I();jbH();g$();_L();kwA();EI();zvH();XY();Z3=b(s(),1)});async function _S(){let H=C$();if(ubH.has(H))return ubH.get(H)??null;try{let $=await WwH();if(N(`Git remote URL: ${$}`),!$)return N("No git remote URL found"),ubH.set(H,null),null;let A=L9H($);return N(`Parsed repository: ${A} from URL: ${$}`),ubH.set(H,A),A}catch($){return N(`Error detecting repository: ${$}`),ubH.set(H,null),null}}function L9H(H){let $=H.trim(),A=/github\.com[:/]([^/]+)\/([^/]+)$/,L=$.match(A);if(L&&L[1]&&L[2]){let I=L[1],D=L[2].replace(/\.git$/,""),B=`${I}/${D}`;return N(`Parsed repository: ${B} from ${$}`),B}if(!$.includes("://")&&!$.includes("@")&&$.includes("/")){let I=$.split("/");if(I.length===2&&I[0]&&I[1]){let D=I[1].replace(/\.git$/,"");return`${I[0]}/${D}`}}return N(`Could not parse repository from: ${$}`),null}var ubH;var I9H=K(()=>{t8();E$();PI();ubH=new Map});function ls9(H){if(!nA.isAxiosError(H))return!1;if(!H.response)return!0;if(H.response.status>=500)return!0;return!1}async function is9(H,$){let A;for(let L=0;L<=gwA;L++)try{return await nA.get(H,$)}catch(I){if(A=I,!ls9(I))throw I;if(L>=gwA)throw N(`Teleport request failed after ${L+1} attempts: ${I instanceof Error?I.message:String(I)}`),I;let D=wFD[L]??2000;N(`Teleport request failed (attempt ${L+1}/${gwA+1}), retrying in ${D}ms: ${I instanceof Error?I.message:String(I)}`),await new Promise((B)=>setTimeout(B,D))}throw A}async function Zw(){let H=dD()?.accessToken;if(H===void 0)throw Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let $=await jR();if(!$)throw Error("Unable to get organization UUID");return{accessToken:H,orgUUID:$}}async function ZFD(){let{accessToken:H,orgUUID:$}=await Zw(),A=`${XD().BASE_API_URL}/v1/sessions`;try{let L={...xK(H),"x-organization-uuid":$},I=await is9(A,{headers:L});if(I.status!==200)throw Error(`Failed to fetch code sessions: ${I.statusText}`);return I.data.data.map((B)=>{let f=B.session_context.sources.find((M)=>M.type==="git_repository"),E=null;if(f?.url){let M=L9H(f.url);if(M){let[G,U]=M.split("/");if(G&&U)E={name:U,owner:{login:G},default_branch:f.revision||void 0}}}return{id:B.id,title:B.title||"Untitled",description:"",status:B.session_status,repo:E,turns:[],created_at:B.created_at,updated_at:B.updated_at}})}catch(L){let I=L instanceof Error?L:Error(String(L));throw r(I),L}}function xK(H){return{Authorization:`Bearer ${H}`,"Content-Type":"application/json","anthropic-version":"2023-06-01"}}async function gbH(H){let{accessToken:$,orgUUID:A}=await Zw(),L=`${XD().BASE_API_URL}/v1/sessions/${H}`,I={...xK($),"x-organization-uuid":A},D=await nA.get(L,{headers:I,timeout:15000,validateStatus:(B)=>B<500});if(D.status!==200){let f=D.data?.error?.message;if(D.status===404)throw Error(`Session not found: ${H}`);if(D.status===401)throw Error("Session expired. Please run /login to sign in again.");throw Error(f||`Failed to fetch session: ${D.status} ${D.statusText}`)}return D.data}function mwA(H){return H.session_context.outcomes?.find((A)=>A.type==="git_repository")?.git_info?.branches[0]}async function F_$(H,$){try{let{accessToken:A,orgUUID:L}=await Zw(),I=`${XD().BASE_API_URL}/v1/sessions/${H}/events`,D={...xK(A),"x-organization-uuid":L},f={events:[{uuid:CFD.randomUUID(),session_id:H,type:"user",parent_tool_use_id:null,message:{role:"user",content:$}}]};N(`[sendEventToRemoteSession] Sending event to session ${H}`);let E=await nA.post(I,f,{headers:D,validateStatus:(M)=>M<500});if(E.status===200||E.status===201)return N(`[sendEventToRemoteSession] Successfully sent event to session ${H}`),!0;return N(`[sendEventToRemoteSession] Failed with status ${E.status}: ${yH(E.data)}`),!1}catch(A){return N(`[sendEventToRemoteSession] Error: ${A instanceof Error?A.message:String(A)}`),!1}}var CFD,wFD,gwA,ns9,VvE;var YS=K(()=>{qE();EI();w1();Hq();_$();E$();I9H();mI();Z$();CFD=require("crypto"),wFD=[2000,4000,8000,16000],gwA=wFD.length;ns9=QD.object({id:QD.string(),title:QD.string(),description:QD.string(),status:QD.enum(["idle","working","waiting","completed","archived","cancelled","rejected"]),repo:QD.object({name:QD.string(),owner:QD.object({login:QD.string()}),default_branch:QD.string().optional()}).nullable(),turns:QD.array(QD.string()),created_at:QD.string(),updated_at:QD.string()}),VvE=QD.array(ns9)});async function qFD(H){let{accessToken:$,orgUUID:A}=await Zw(),L={...xK($),"x-organization-uuid":A},I=`${XD().BASE_API_URL}/api/oauth/organizations/${A}/admin_requests`;return(await nA.post(I,H,{headers:L})).data}async function TFD(H,$){let{accessToken:A,orgUUID:L}=await Zw(),I={...xK(A),"x-organization-uuid":L},D=`${XD().BASE_API_URL}/api/oauth/organizations/${L}/admin_requests/me?request_type=${H}`;for(let f of $)D+=`&statuses=${f}`;return(await nA.get(D,{headers:I})).data}var zFD=K(()=>{w1();qE();YS()});var OFD={};XA(OFD,{call:()=>pwA});async function pwA(H,$){if(!M$().hasVisitedExtraUsage)AA((E)=>({...E,hasVisitedExtraUsage:!0}));let A=f0(),L=A==="team"||A==="enterprise",I=my(),D=$T(),B=T9()?.hasExtraUsageEnabled===!0;if(!I&&L){if(D){try{let E=await TFD("limit_increase",["pending","dismissed"]);if(E&&E.length>0)return H("You have already submitted a request for extra usage to your admin."),null}catch(E){r(E)}try{return await qFD({request_type:"limit_increase",details:null}),H(B?"Request sent to your admin to increase extra usage.":"Request sent to your admin to enable extra usage."),null}catch(E){r(E)}}return H("Please contact your admin to manage extra usage settings."),null}let f=L?"https://claude.ai/admin-settings/usage":"https://claude.ai/settings/usage";try{return await HE(f),NFD.default.createElement(i7H,{startingMessage:"Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.",onDone:(E)=>{$.onChangeAPIKey(),H(E?"Login successful":"Login interrupted")}})}catch(E){r(E),H(`Failed to open browser. Please visit ${f} to see your extra usage.`)}return null}var NFD;var dwA=K(()=>{_$();EI();F3();J_$();vA();zFD();NFD=b(s(),1)});var rs9,Lt;var mbH=K(()=>{EI();vA();rs9={type:"local-jsx",name:"extra-usage",description:"Configure extra usage to keep working when limits are hit",isEnabled:()=>{if(process.env.DISABLE_EXTRA_USAGE_COMMAND)return!1;if(!HO())return!1;if($T())return!0;let H=f0();return H==="pro"||H==="max"},isHidden:!1,load:()=>Promise.resolve().then(() => (dwA(),OFD)),userFacingName(){return"extra-usage"}},Lt=rs9});function as9({shouldShowUpsell:H,isMax20x:$,isExtraUsageCommandEnabled:A,shouldAutoOpenRateLimitOptionsMenu:L,isTeamOrEnterprise:I,isC4WNotificationsEnabled:D,hasBillingAccess:B}){if(!H)return null;if($){if(A)return"/extra-usage to finish what you\u2019re working on.";return"/login to switch to an API usage-billed account."}if(L)return"Opening your options\u2026";if(!I&&!A)return"/upgrade to increase your usage limit.";if(I){if(!A)return null;if(B)return"/extra-usage to finish what you\u2019re working on.";if(D)return"/extra-usage to request more usage from your admin.";return"Contact your admin to request extra usage."}return"/upgrade or /extra-usage to finish what you\u2019re working on."}function xFD({text:H,onOpenRateLimitOptions:$}){let A=f0(),L=Ri(),I=$T(),D=A==="pro"||A==="max",B=A==="team"||A==="enterprise",f=L==="default_claude_max_20x",E=(jGH()||nL())&&(D||I),M=E&&!f,[G,U]=n7H.useState(!1),X=Zr(),J=X.status==="rejected"&&X.resetsAt!==void 0,F=M&&!G&&J&&$;n7H.useEffect(()=>{if(F)U(!0),$()},[F,$]);let Q=n7H.useMemo(()=>{let W=as9({shouldShowUpsell:E,isMax20x:f,isExtraUsageCommandEnabled:Lt.isEnabled(),shouldAutoOpenRateLimitOptionsMenu:!!F,isTeamOrEnterprise:B,isC4WNotificationsEnabled:I,hasBillingAccess:my()});if(!W)return null;return pbH.default.createElement(V,{dimColor:!0},W)},[E,f,B,I,F]);return pbH.default.createElement(HA,null,pbH.default.createElement(x,{flexDirection:"column"},pbH.default.createElement(V,{color:"error"},H),G?null:Q))}var pbH,n7H;var SFD=K(()=>{EI();ESH();xH();iB();mbH();vA();py();pbH=b(s(),1),n7H=b(s(),1)});function os9(){let H=b1L();return yf.default.createElement(HA,null,yf.default.createElement(x,{flexDirection:"column"},yf.default.createElement(V,{color:"error"},zU$),H&&yf.default.createElement(V,{dimColor:!0},"\xB7 Run in another terminal: security unlock-keychain")))}function jFD({param:{text:H},addMargin:$,shouldShowDot:A,onOpenRateLimitOptions:L}){if(K_$(H))return null;if(qWI(H))return yf.default.createElement(xFD,{text:H,onOpenRateLimitOptions:L});switch(H){case LDH:return null;case jg:{let I=pBH("warning");return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},"Context limit reached \xB7 /compact or /clear to continue",I?` \xB7 ${I}`:""))}case TU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},"Credit balance too low \xB7 Add funds: https://platform.claude.com/settings/billing"));case zU$:return yf.default.createElement(os9,null);case NU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},NU$));case OU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},OU$));case xU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},xU$,process.env.API_TIMEOUT_MS&&yf.default.createElement(yf.default.Fragment,null," ","(API_TIMEOUT_MS=",process.env.API_TIMEOUT_MS,"ms, try increasing it)")));case ADH:return yf.default.createElement(HA,null,yf.default.createElement(x,{flexDirection:"column",gap:1},yf.default.createElement(V,{color:"error"},"We are experiencing high demand for Opus 4."),yf.default.createElement(V,null,"To continue immediately, use /model to switch to"," ",hV(Oq())," and continue coding.")));case D9H:return yf.default.createElement(HA,{height:1},yf.default.createElement(Iv,null));default:if(H.startsWith(x5))return yf.default.createElement(HA,null,yf.default.createElement(V,{color:"error"},H===x5?`${x5}: Please wait a moment and try again.`:H));return yf.default.createElement(x,{alignItems:"flex-start",flexDirection:"row",justifyContent:"space-between",marginTop:$?1:0,width:"100%"},yf.default.createElement(x,{flexDirection:"row"},A&&yf.default.createElement(x,{minWidth:2},yf.default.createElement(V,{color:"text"},Zf)),yf.default.createElement(x,{flexDirection:"column"},yf.default.createElement(VJ,null,H))))}}var yf;var RFD=K(()=>{xH();ry();_L();p6();nx();iB();aI();dQ$();Cp();zFH();B4A();TwH();SFD();yf=b(s(),1)});function Q_$({param:{text:H},addMargin:$}){let A=VD(H,"bash-input");if(!A)return null;return wp.createElement(x,{flexDirection:"column",marginTop:$?1:0,width:"100%"},wp.createElement(x,null,wp.createElement(V,{backgroundColor:"bashMessageBackgroundColor",color:"bashBorder"},"!"),wp.createElement(V,{backgroundColor:"bashMessageBackgroundColor",color:"text"}," ",A," ")))}var wp;var cwA=K(()=>{xH();_L();wp=b(s(),1)});function yFD({addMargin:H,param:{text:$}}){let A=VD($,C6),L=VD($,"command-args"),I=VD($,"skill-format")==="true";if(!A)return null;if(I)return h7.createElement(x,{flexDirection:"column",marginTop:H?1:0,width:"100%"},h7.createElement(V,{backgroundColor:"userMessageBackground"},h7.createElement(V,{color:"subtle"},pH.pointer," "),h7.createElement(V,{color:"text"},"Skill(",A,") ")));let D=`/${[A,L].filter(Boolean).join(" ")}`;return h7.createElement(x,{flexDirection:"column",marginTop:H?1:0,width:"100%"},h7.createElement(V,{backgroundColor:"userMessageBackground"},h7.createElement(V,{color:"subtle"},pH.pointer," "),h7.createElement(V,{color:"text"},D," ")))}var h7;var vFD=K(()=>{jI();xH();_L();EE();h7=b(s(),1)});function hFD(H,$,A){return H.split(` }`;var b1=hmA(function(){return n1(nH,fB+"return "+RL).apply(H,X$)});if(b1.source=RL,ix$(b1))throw b1;return b1}function R4B(T){return CE(T).toLowerCase()}function y4B(T){return CE(T).toUpperCase()}function v4B(T,R,l){if(T=CE(T),T&&(l||R===H))return $X(T);if(!T||!(R=DV(R)))return T;var fH=wW(T),jH=wW(R),nH=M_(fH,jH),X$=Oj(fH,jH)+1;return xZ(fH,nH,X$).join("")}function h4B(T,R,l){if(T=CE(T),T&&(l||R===H))return T.slice(0,rd(T)+1);if(!T||!(R=DV(R)))return T;var fH=wW(T),jH=Oj(fH,wW(R))+1;return xZ(fH,0,jH).join("")}function b4B(T,R,l){if(T=CE(T),T&&(l||R===H))return T.replace(M9,"");if(!T||!(R=DV(R)))return T;var fH=wW(T),jH=M_(fH,wW(R));return xZ(fH,jH).join("")}function k4B(T,R){var l=u,fH=y;if(B5(R)){var jH="separator"in R?R.separator:jH;l="length"in R?C1(R.length):l,fH="omission"in R?DV(R.omission):fH}T=CE(T);var nH=T.length;if(TZ(T)){var X$=wW(T);nH=X$.length}if(l>=nH)return T;var q$=l-tK(fH);if(q$<1)return fH;var t$=X$?xZ(X$,0,q$).join(""):T.slice(0,q$);if(jH===H)return t$+fH;if(X$)q$+=t$.length-q$;if(nx$(jH)){if(T.slice(q$).search(jH)){var GL,KL=t$;if(!jH.global)jH=gb(jH.source,CE(WB.exec(jH))+"g");jH.lastIndex=0;while(GL=jH.exec(KL))var RL=GL.index;t$=t$.slice(0,RL===H?q$:RL)}}else if(T.indexOf(DV(jH),q$)!=q$){var nI=t$.lastIndexOf(jH);if(nI>-1)t$=t$.slice(0,nI)}return t$+fH}function u4B(T){return T=CE(T),T&&e$.test(T)?T.replace(I$,u8H):T}var g4B=Ic(function(T,R,l){return T+(l?" ":"")+R.toUpperCase()}),ox$=zcH("toUpperCase");function vmA(T,R,l){if(T=CE(T),R=l?H:R,R===H)return G_(T)?oE(T):vb(T);return T.match(R)||[]}var hmA=Y1(function(T,R){try{return qU(T,H,R)}catch(l){return ix$(l)?l:new u0(l)}}),m4B=fN(function(T,R){return aE(R,function(l){l=CM(l),OZ(T,l,RZ(T[l],T))}),T});function p4B(T){var R=T==null?0:T.length,l=sB();return T=!R?[]:hD(T,function(fH){if(typeof fH[1]!="function")throw new dJ(I);return[l(fH[0]),fH[1]]}),Y1(function(fH){var jH=-1;while(++jHGH)return[];var l=WH,fH=iJ(T,WH);R=sB(R),T-=WH;var jH=a8(fH,R);while(++l0||R<0))return new _1(l);if(T<0)l=l.takeRight(-T);else if(T)l=l.drop(T);if(R!==H)R=C1(R),l=R<0?l.dropRight(-R):l.take(R-T);return l},_1.prototype.takeRightWhile=function(T){return this.reverse().takeWhile(T).reverse()},_1.prototype.toArray=function(){return this.take(WH)},uC(_1.prototype,function(T,R){var l=/^(?:filter|find|map|reject)|While$/.test(R),fH=/^(?:head|last)$/.test(R),jH=iH[fH?"take"+(R=="last"?"Right":""):R],nH=fH||/^find/.test(R);if(!jH)return;iH.prototype[R]=function(){var X$=this.__wrapped__,q$=fH?[1]:arguments,t$=X$ instanceof _1,GL=q$[0],KL=t$||ND(X$),RL=function(Z8){var o8=jH.apply(iH,b9([Z8],q$));return fH&&nI?o8[0]:o8};if(KL&&l&&typeof GL=="function"&&GL.length!=1)t$=KL=!1;var nI=this.__chain__,fB=!!this.__actions__.length,O0=nH&&!nI,b1=t$&&!fB;if(!nH&&KL){X$=b1?X$:new _1(this);var x0=T.apply(X$,q$);return x0.__actions__.push({func:$HH,args:[RL],thisArg:H}),new aF(x0,nI)}if(O0&&b1)return T.apply(this,q$);return x0=this.thru(RL),O0?fH?x0.value()[0]:x0.value():x0}}),aE(["pop","push","shift","sort","splice","unshift"],function(T){var R=ez[T],l=/^(?:push|sort|unshift)$/.test(T)?"tap":"thru",fH=/^(?:pop|shift)$/.test(T);iH.prototype[T]=function(){var jH=arguments;if(fH&&!this.__chain__){var nH=this.value();return R.apply(ND(nH)?nH:[],jH)}return this[l](function(X$){return R.apply(ND(X$)?X$:[],jH)})}}),uC(_1.prototype,function(T,R){var l=iH[R];if(l){var fH=l.name+"";if(!C8.call(kC,fH))kC[fH]=[];kC[fH].push({name:R,func:l})}}),kC[EfH(H,Q).name]=[{name:"wrapper",func:H}],_1.prototype.clone=idH,_1.prototype.reverse=ndH,_1.prototype.value=rdH,iH.prototype.at=rJ,iH.prototype.chain=IX,iH.prototype.commit=Q6,iH.prototype.next=pC,iH.prototype.plant=dx$,iH.prototype.reverse=qfH,iH.prototype.toJSON=iH.prototype.valueOf=iH.prototype.value=TfH,iH.prototype.first=iH.prototype.head,sK)iH.prototype[sK]=Vc;return iH},zZ=J_H();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)rE._=zZ,define(function(){return zZ});else if(mJ)(mJ.exports=zZ)._=zZ,vC._=zZ;else rE._=zZ}).call(r7H)});function ts9(){return cFD.sample(["Got it.","Good to know.","Noted."])}function iFD({text:H,addMargin:$}){let A=VD(H,"user-memory-input"),L=lFD.useMemo(()=>ts9(),[]);if(!A)return null;return Tw.createElement(x,{flexDirection:"column",marginTop:$?1:0,width:"100%"},Tw.createElement(x,null,Tw.createElement(V,{color:"remember",backgroundColor:"memoryBackgroundColor"},"#"),Tw.createElement(V,{backgroundColor:"memoryBackgroundColor",color:"text"}," ",A," ")),Tw.createElement(HA,{height:1},Tw.createElement(V,{dimColor:!0},L)))}var Tw,cFD,lFD;var nFD=K(()=>{xH();_L();iB();Tw=b(s(),1),cFD=b(dFD(),1),lFD=b(s(),1)});function cbH({elapsedTimeSeconds:H,timeoutMs:$}){if(H===void 0&&!$)return null;let A=$?of($,{hideTrailingZeros:!0}):void 0;if(H===void 0)return W_$.default.createElement(V,{dimColor:!0},`(timeout ${A})`);let L=of(H*1000);if(A)return W_$.default.createElement(V,{dimColor:!0},`(${L} \xB7 timeout ${A})`);return W_$.default.createElement(V,{dimColor:!0},`(${L})`)}var W_$;var iwA=K(()=>{xH();Q9();W_$=b(s(),1)});function ss9(H){if(!H.match(/([\s\S]*?)<\/sandbox_violations>/))return{cleanedStderr:H};return{cleanedStderr:o4$(H).trim()}}function es9(H){let $=H.match(rFD);if(!$)return{cleanedStderr:H,cwdResetWarning:null};let A=$[1]??null;return{cleanedStderr:H.replace(rFD,"").trim(),cwdResetWarning:A}}function f9H({content:{stdout:H,stderr:$,isImage:A,returnCodeInterpretation:L,backgroundTaskId:I},verbose:D,timeoutMs:B}){let{cleanedStderr:f}=ss9($),{cleanedStderr:E,cwdResetWarning:M}=es9(f);if(A)return SP.default.createElement(HA,{height:1},SP.default.createElement(V,{dimColor:!0},"[Image data detected and sent to Claude]"));return SP.default.createElement(x,{flexDirection:"column"},H!==""?SP.default.createElement(Dv,{content:H,verbose:D}):null,E.trim()!==""?SP.default.createElement(Dv,{content:E,verbose:D,isError:!0}):null,M?SP.default.createElement(HA,null,SP.default.createElement(V,{dimColor:!0},M)):null,H===""&&E.trim()===""&&!M?SP.default.createElement(HA,{height:1},SP.default.createElement(V,{dimColor:!0},I?SP.default.createElement(SP.default.Fragment,null,"Running in the background"," ",SP.default.createElement(s$,{shortcut:"\u2193",action:"manage",parens:!0})):L||"(No content)")):null,B&&SP.default.createElement(HA,null,SP.default.createElement(cbH,{timeoutMs:B})))}var SP,rFD;var V_$=K(()=>{xH();OFH();iB();lB();iwA();SP=b(s(),1),rFD=/(?:^|\n)(Shell cwd was reset to .+)$/});function aFD({content:H,verbose:$}){let A=VD(H,"bash-stdout")??"",L=VD(H,"bash-stderr")??"";return nwA.createElement(f9H,{content:{stdout:A,stderr:L},verbose:!!$})}var nwA;var oFD=K(()=>{V_$();_L();nwA=b(s(),1)});function sFD({content:H}){let $=VD(H,"local-command-stdout"),A=VD(H,"local-command-stderr");if(!$&&!A)return b7.createElement(HA,null,b7.createElement(V,{dimColor:!0},qw));let L=[];if($?.trim())L.push(b7.createElement(tFD,{key:"stdout"},$.trim()));if(A?.trim())L.push(b7.createElement(tFD,{key:"stderr",isError:!0},A.trim()));return L}function tFD({children:H,isError:$}){return b7.createElement(x,{flexDirection:"row"},b7.createElement(V,{color:$?"error":"text"}," \u23BF "),b7.createElement(x,{flexDirection:"column",flexGrow:1},b7.createElement(VJ,null,H)))}var b7;var eFD=K(()=>{_L();xH();iB();nx();b7=b(s(),1)});function E9H({param:{text:H},addMargin:$}){let A=VD(H,"background-task-input");if(!A)return null;return Zp.createElement(x,{flexDirection:"column",marginTop:$?1:0,width:"100%"},Zp.createElement(x,null,Zp.createElement(V,{color:"background"},"&"),Zp.createElement(V,{dimColor:!0}," ",A)))}var Zp;var rwA=K(()=>{xH();_L();Zp=b(s(),1)});function HKD({content:H}){let $=VD(H,"background-task-output")??"";return lbH.createElement(HA,null,lbH.createElement(V,{dimColor:!0},$))}var lbH;var $KD=K(()=>{xH();_L();iB();lbH=b(s(),1)});function o7H(){return`claude-swarm-${process.pid}`}var kE="team-lead",eY="claude-swarm",a7H="swarm-view",q3="tmux",awA="claude-hidden",t7H="CLAUDE_CODE_TEAMMATE_COMMAND";var AKD,He9,HbE,$bE,$e9,AbE,LbE,Ae9,Le9,Ie9,De9,LKD,Be9,fe9,IbE,DbE,s7H,owA,twA,swA,BbE,e7H,Ee9,fbE,jP,Me9,Ge9,Ue9,Xe9,Je9,Fe9,Ke9,Qe9,We9,Ve9,Pe9,_e9,Ye9,Ce9,we9,Ze9,qe9,EbE,Te9,ze9,Ne9,Oe9,xe9,Se9,je9,Re9,ye9,ve9,he9,MbE,GbE,UbE,XbE,be9,JbE,FbE,KbE,QbE,ke9,ue9,ge9,SK,IKD,me9,pe9,DKD,de9,ce9,le9,WbE,VbE,BKD,ie9,ne9,re9,ae9,oe9,te9,se9,ee9,HH1,$H1,AH1,LH1,IH1,DH1,BH1,PbE;var fKD=K(()=>{mI();AKD=S.object({inputTokens:S.number(),outputTokens:S.number(),cacheReadInputTokens:S.number(),cacheCreationInputTokens:S.number(),webSearchRequests:S.number(),costUSD:S.number(),contextWindow:S.number(),maxOutputTokens:S.number()}),He9=S.literal("json_schema"),HbE=S.object({type:He9}),$bE=S.object({type:S.literal("json_schema"),schema:S.record(S.string(),S.unknown())}),$e9=S.enum(["user","project","org","temporary"]),AbE=S.enum(["local","user","project"]).describe("Config scope for settings."),LbE=S.literal("context-1m-2025-08-07"),Ae9=S.object({type:S.literal("stdio").optional(),command:S.string(),args:S.array(S.string()).optional(),env:S.record(S.string(),S.string()).optional()}),Le9=S.object({type:S.literal("sse"),url:S.string(),headers:S.record(S.string(),S.string()).optional()}),Ie9=S.object({type:S.literal("http"),url:S.string(),headers:S.record(S.string(),S.string()).optional()}),De9=S.object({type:S.literal("sdk"),name:S.string()}),LKD=S.union([Ae9,Le9,Ie9,De9]),Be9=S.object({type:S.literal("claudeai-proxy"),url:S.string(),id:S.string()}),fe9=S.union([LKD,Be9]),IbE=S.object({name:S.string().describe("Server name as configured"),status:S.enum(["connected","failed","needs-auth","pending","disabled"]).describe("Current connection status"),serverInfo:S.object({name:S.string(),version:S.string()}).optional().describe("Server information (available when connected)"),error:S.string().optional().describe("Error message (available when status is 'failed')"),config:fe9.optional().describe("Server configuration (includes URL for HTTP/SSE servers)"),scope:S.string().optional().describe("Configuration scope (e.g., project, user, local, claudeai, managed)"),tools:S.array(S.object({name:S.string(),description:S.string().optional(),annotations:S.object({readOnly:S.boolean().optional(),destructive:S.boolean().optional(),openWorld:S.boolean().optional()}).optional()})).optional().describe("Tools provided by this server (available when connected)")}).describe("Status information for an MCP server connection."),DbE=S.object({added:S.array(S.string()).describe("Names of servers that were added"),removed:S.array(S.string()).describe("Names of servers that were removed"),errors:S.record(S.string(),S.string()).describe("Map of server names to error messages for servers that failed to connect")}).describe("Result of a setMcpServers operation."),s7H=S.enum(["userSettings","projectSettings","localSettings","session","cliArg"]),owA=S.enum(["allow","deny","ask"]),twA=S.object({toolName:S.string(),ruleContent:S.string().optional()}),swA=S.discriminatedUnion("type",[S.object({type:S.literal("addRules"),rules:S.array(twA),behavior:owA,destination:s7H}),S.object({type:S.literal("replaceRules"),rules:S.array(twA),behavior:owA,destination:s7H}),S.object({type:S.literal("removeRules"),rules:S.array(twA),behavior:owA,destination:s7H}),S.object({type:S.literal("setMode"),mode:S.lazy(()=>e7H),destination:s7H}),S.object({type:S.literal("addDirectories"),directories:S.array(S.string()),destination:s7H}),S.object({type:S.literal("removeDirectories"),directories:S.array(S.string()),destination:s7H})]),BbE=S.union([S.object({behavior:S.literal("allow"),updatedInput:S.record(S.string(),S.unknown()).optional(),updatedPermissions:S.array(swA).optional(),toolUseID:S.string().optional()}),S.object({behavior:S.literal("deny"),message:S.string(),interrupt:S.boolean().optional(),toolUseID:S.string().optional()})]),e7H=S.enum(["default","acceptEdits","bypassPermissions","plan","delegate","dontAsk"]).describe("Permission mode for controlling how tool executions are handled. 'default' - Standard behavior, prompts for dangerous operations. 'acceptEdits' - Auto-accept file edit operations. 'bypassPermissions' - Bypass all permission checks (requires allowDangerouslySkipPermissions). 'plan' - Planning mode, no actual tool execution. 'delegate' - Delegate mode, restricts team leader to only Teammate and Task tools. 'dontAsk' - Don't prompt for permissions, deny if not pre-approved."),Ee9=["PreToolUse","PostToolUse","PostToolUseFailure","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","SubagentStart","SubagentStop","PreCompact","PermissionRequest","Setup","TeammateIdle","TaskCompleted"],fbE=S.enum(Ee9),jP=S.object({session_id:S.string(),transcript_path:S.string(),cwd:S.string(),permission_mode:S.string().optional()}),Me9=jP.and(S.object({hook_event_name:S.literal("PreToolUse"),tool_name:S.string(),tool_input:S.unknown(),tool_use_id:S.string()})),Ge9=jP.and(S.object({hook_event_name:S.literal("PermissionRequest"),tool_name:S.string(),tool_input:S.unknown(),permission_suggestions:S.array(swA).optional()})),Ue9=jP.and(S.object({hook_event_name:S.literal("PostToolUse"),tool_name:S.string(),tool_input:S.unknown(),tool_response:S.unknown(),tool_use_id:S.string()})),Xe9=jP.and(S.object({hook_event_name:S.literal("PostToolUseFailure"),tool_name:S.string(),tool_input:S.unknown(),tool_use_id:S.string(),error:S.string(),is_interrupt:S.boolean().optional()})),Je9=jP.and(S.object({hook_event_name:S.literal("Notification"),message:S.string(),title:S.string().optional(),notification_type:S.string()})),Fe9=jP.and(S.object({hook_event_name:S.literal("UserPromptSubmit"),prompt:S.string()})),Ke9=jP.and(S.object({hook_event_name:S.literal("SessionStart"),source:S.enum(["startup","resume","clear","compact"]),agent_type:S.string().optional(),model:S.string().optional()})),Qe9=jP.and(S.object({hook_event_name:S.literal("Setup"),trigger:S.enum(["init","maintenance"])})),We9=jP.and(S.object({hook_event_name:S.literal("Stop"),stop_hook_active:S.boolean()})),Ve9=jP.and(S.object({hook_event_name:S.literal("SubagentStart"),agent_id:S.string(),agent_type:S.string()})),Pe9=jP.and(S.object({hook_event_name:S.literal("SubagentStop"),stop_hook_active:S.boolean(),agent_id:S.string(),agent_transcript_path:S.string(),agent_type:S.string()})),_e9=jP.and(S.object({hook_event_name:S.literal("PreCompact"),trigger:S.enum(["manual","auto"]),custom_instructions:S.string().nullable()})),Ye9=jP.and(S.object({hook_event_name:S.literal("TeammateIdle"),teammate_name:S.string(),team_name:S.string()})),Ce9=jP.and(S.object({hook_event_name:S.literal("TaskCompleted"),task_id:S.string(),task_subject:S.string(),task_description:S.string().optional(),teammate_name:S.string().optional(),team_name:S.string().optional()})),we9=["clear","logout","prompt_input_exit","other","bypass_permissions_disabled"],Ze9=S.enum(we9),qe9=jP.and(S.object({hook_event_name:S.literal("SessionEnd"),reason:Ze9})),EbE=S.union([Me9,Ue9,Xe9,Je9,Fe9,Ke9,qe9,We9,Ve9,Pe9,_e9,Ge9,Qe9,Ye9,Ce9]),Te9=S.object({async:S.literal(!0),asyncTimeout:S.number().optional()}),ze9=S.object({hookEventName:S.literal("PreToolUse"),permissionDecision:S.enum(["allow","deny","ask"]).optional(),permissionDecisionReason:S.string().optional(),updatedInput:S.record(S.string(),S.unknown()).optional(),additionalContext:S.string().optional()}),Ne9=S.object({hookEventName:S.literal("UserPromptSubmit"),additionalContext:S.string().optional()}),Oe9=S.object({hookEventName:S.literal("SessionStart"),additionalContext:S.string().optional()}),xe9=S.object({hookEventName:S.literal("Setup"),additionalContext:S.string().optional()}),Se9=S.object({hookEventName:S.literal("SubagentStart"),additionalContext:S.string().optional()}),je9=S.object({hookEventName:S.literal("PostToolUse"),additionalContext:S.string().optional(),updatedMCPToolOutput:S.unknown().optional()}),Re9=S.object({hookEventName:S.literal("PostToolUseFailure"),additionalContext:S.string().optional()}),ye9=S.object({hookEventName:S.literal("Notification"),additionalContext:S.string().optional()}),ve9=S.object({hookEventName:S.literal("PermissionRequest"),decision:S.union([S.object({behavior:S.literal("allow"),updatedInput:S.record(S.string(),S.unknown()).optional(),updatedPermissions:S.array(swA).optional()}),S.object({behavior:S.literal("deny"),message:S.string().optional(),interrupt:S.boolean().optional()})])}),he9=S.object({continue:S.boolean().optional(),suppressOutput:S.boolean().optional(),stopReason:S.string().optional(),decision:S.enum(["approve","block"]).optional(),systemMessage:S.string().optional(),reason:S.string().optional(),hookSpecificOutput:S.union([ze9,Ne9,Oe9,xe9,Se9,je9,Re9,ye9,ve9]).optional()}),MbE=S.union([Te9,he9]),GbE=S.object({name:S.string().describe("Skill name (without the leading slash)"),description:S.string().describe("Description of what the skill does"),argumentHint:S.string().describe('Hint for skill arguments (e.g., "")')}).describe("Information about an available skill (invoked via /command syntax)."),UbE=S.object({value:S.string().describe("Model identifier to use in API calls"),displayName:S.string().describe("Human-readable display name"),description:S.string().describe("Description of the model's capabilities")}).describe("Information about an available model."),XbE=S.object({email:S.string().optional(),organization:S.string().optional(),subscriptionType:S.string().optional(),tokenSource:S.string().optional(),apiKeySource:S.string().optional()}).describe("Information about the logged in user's account."),be9=S.union([S.string(),S.record(S.string(),LKD)]),JbE=S.object({description:S.string().describe("Natural language description of when to use this agent"),tools:S.array(S.string()).optional().describe("Array of allowed tool names. If omitted, inherits all tools from parent"),disallowedTools:S.array(S.string()).optional().describe("Array of tool names to explicitly disallow for this agent"),prompt:S.string().describe("The agent's system prompt"),model:S.enum(["sonnet","opus","haiku","inherit"]).optional().describe("Model to use for this agent. If omitted or 'inherit', uses the main model"),mcpServers:S.array(be9).optional(),criticalSystemReminder_EXPERIMENTAL:S.string().optional().describe("Experimental: Critical reminder added to system prompt"),skills:S.array(S.string()).optional().describe("Array of skill names to preload into the agent context"),maxTurns:S.number().int().positive().optional().describe("Maximum number of agentic turns (API round-trips) before stopping")}).describe("Definition for a custom subagent that can be invoked via the Task tool."),FbE=S.enum(["user","project","local"]).describe("Source for loading filesystem-based settings. 'user' - Global user settings (~/.claude/settings.json). 'project' - Project settings (.claude/settings.json). 'local' - Local settings (.claude/settings.local.json)."),KbE=S.object({type:S.literal("local").describe("Plugin type. Currently only 'local' is supported"),path:S.string().describe("Absolute or relative path to the plugin directory")}).describe("Configuration for loading a plugin."),QbE=S.object({canRewind:S.boolean(),error:S.string().optional(),filesChanged:S.array(S.string()).optional(),insertions:S.number().optional(),deletions:S.number().optional()}).describe("Result of a rewindFiles operation."),ke9=S.unknown(),ue9=S.unknown(),ge9=S.unknown(),SK=S.string(),IKD=S.unknown(),me9=S.enum(["authentication_failed","billing_error","rate_limit","invalid_request","server_error","unknown"]),pe9=S.union([S.literal("compacting"),S.null()]),DKD=S.object({type:S.literal("user"),message:ke9,parent_tool_use_id:S.string().nullable(),isSynthetic:S.boolean().optional(),tool_use_result:S.unknown().optional()}),de9=DKD.extend({uuid:SK.optional(),session_id:S.string()}),ce9=DKD.extend({uuid:SK,session_id:S.string(),isReplay:S.literal(!0)}),le9=S.object({type:S.literal("assistant"),message:ue9,parent_tool_use_id:S.string().nullable(),error:me9.optional(),uuid:SK,session_id:S.string()}),WbE=S.object({type:S.literal("streamlined_text"),text:S.string().describe("Text content preserved from the assistant message"),session_id:S.string(),uuid:SK}).describe("@internal Streamlined text message - replaces SDKAssistantMessage in streamlined output. Text content preserved, thinking and tool_use blocks removed."),VbE=S.object({type:S.literal("streamlined_tool_use_summary"),tool_summary:S.string().describe('Summary of tool calls (e.g., "Read 2 files, wrote 1 file")'),session_id:S.string(),uuid:SK}).describe("@internal Streamlined tool use summary - replaces tool_use blocks in streamlined output with a cumulative summary string."),BKD=S.object({tool_name:S.string(),tool_use_id:S.string(),tool_input:S.record(S.string(),S.unknown())}),ie9=S.object({type:S.literal("result"),subtype:S.literal("success"),duration_ms:S.number(),duration_api_ms:S.number(),is_error:S.boolean(),num_turns:S.number(),result:S.string(),stop_reason:S.string().nullable(),total_cost_usd:S.number(),usage:IKD,modelUsage:S.record(S.string(),AKD),permission_denials:S.array(BKD),structured_output:S.unknown().optional(),uuid:SK,session_id:S.string()}),ne9=S.object({type:S.literal("result"),subtype:S.enum(["error_during_execution","error_max_turns","error_max_budget_usd","error_max_structured_output_retries"]),duration_ms:S.number(),duration_api_ms:S.number(),is_error:S.boolean(),num_turns:S.number(),stop_reason:S.string().nullable(),total_cost_usd:S.number(),usage:IKD,modelUsage:S.record(S.string(),AKD),permission_denials:S.array(BKD),errors:S.array(S.string()),uuid:SK,session_id:S.string()}),re9=S.union([ie9,ne9]),ae9=S.object({type:S.literal("system"),subtype:S.literal("init"),agents:S.array(S.string()).optional(),apiKeySource:$e9,betas:S.array(S.string()).optional(),claude_code_version:S.string(),cwd:S.string(),tools:S.array(S.string()),mcp_servers:S.array(S.object({name:S.string(),status:S.string()})),model:S.string(),permissionMode:e7H,slash_commands:S.array(S.string()),output_style:S.string(),skills:S.array(S.string()),plugins:S.array(S.object({name:S.string(),path:S.string()})),uuid:SK,session_id:S.string()}),oe9=S.object({type:S.literal("stream_event"),event:ge9,parent_tool_use_id:S.string().nullable(),uuid:SK,session_id:S.string()}),te9=S.object({type:S.literal("system"),subtype:S.literal("compact_boundary"),compact_metadata:S.object({trigger:S.enum(["manual","auto"]),pre_tokens:S.number()}),uuid:SK,session_id:S.string()}),se9=S.object({type:S.literal("system"),subtype:S.literal("status"),status:pe9,permissionMode:e7H.optional(),uuid:SK,session_id:S.string()}),ee9=S.object({type:S.literal("system"),subtype:S.literal("hook_started"),hook_id:S.string(),hook_name:S.string(),hook_event:S.string(),uuid:SK,session_id:S.string()}),HH1=S.object({type:S.literal("system"),subtype:S.literal("hook_progress"),hook_id:S.string(),hook_name:S.string(),hook_event:S.string(),stdout:S.string(),stderr:S.string(),output:S.string(),uuid:SK,session_id:S.string()}),$H1=S.object({type:S.literal("system"),subtype:S.literal("hook_response"),hook_id:S.string(),hook_name:S.string(),hook_event:S.string(),output:S.string(),stdout:S.string(),stderr:S.string(),exit_code:S.number().optional(),outcome:S.enum(["success","error","cancelled"]),uuid:SK,session_id:S.string()}),AH1=S.object({type:S.literal("tool_progress"),tool_use_id:S.string(),tool_name:S.string(),parent_tool_use_id:S.string().nullable(),elapsed_time_seconds:S.number(),uuid:SK,session_id:S.string()}),LH1=S.object({type:S.literal("auth_status"),isAuthenticating:S.boolean(),output:S.array(S.string()),error:S.string().optional(),uuid:SK,session_id:S.string()}),IH1=S.object({type:S.literal("system"),subtype:S.literal("files_persisted"),files:S.array(S.object({filename:S.string(),file_id:S.string()})),failed:S.array(S.object({filename:S.string(),error:S.string()})),processed_at:S.string(),uuid:SK,session_id:S.string()}),DH1=S.object({type:S.literal("system"),subtype:S.literal("task_notification"),task_id:S.string(),status:S.enum(["completed","failed","stopped"]),output_file:S.string(),summary:S.string(),uuid:SK,session_id:S.string()}),BH1=S.object({type:S.literal("tool_use_summary"),summary:S.string(),preceding_tool_use_ids:S.array(S.string()),uuid:SK,session_id:S.string()}),PbE=S.union([le9,de9,ce9,re9,ae9,oe9,te9,se9,ee9,HH1,$H1,AH1,LH1,DH1,IH1,BH1])});var FKD={};XA(FKD,{writeToMailbox:()=>K8,sendShutdownRequestToMailbox:()=>Y_$,readUnreadMessages:()=>M9H,readMailbox:()=>qp,markMessagesAsReadByPredicate:()=>DZA,markMessagesAsRead:()=>rbH,markMessageAsReadByIndex:()=>nbH,isTeammate:()=>tf,isTeamPermissionUpdate:()=>q_$,isTaskCompletedNotification:()=>XH1,isTaskAssignment:()=>Z_$,isStructuredProtocolMessage:()=>N_$,isShutdownRequest:()=>Dt,isShutdownRejected:()=>w_$,isShutdownApproved:()=>RP,isSandboxPermissionResponse:()=>sbH,isSandboxPermissionRequest:()=>__$,isPlanApprovalResponse:()=>$6H,isPlanApprovalRequest:()=>C_$,isPermissionResponse:()=>G9H,isPermissionRequest:()=>tbH,isModeSetRequest:()=>z_$,isIdleNotification:()=>obH,getTeamName:()=>g9,getMailboxPath:()=>fH1,getLastPeerDmSummary:()=>ebH,getInboxPath:()=>It,getAgentName:()=>g1,getAgentId:()=>FK,formatTeammateMessages:()=>GH1,createTaskCompletedNotification:()=>UH1,createShutdownRequestMessage:()=>H6H,createShutdownRejectedMessage:()=>IZA,createShutdownApprovedMessage:()=>LZA,createSandboxPermissionResponseMessage:()=>AZA,createSandboxPermissionRequestMessage:()=>$ZA,createPermissionResponseMessage:()=>HZA,createPermissionRequestMessage:()=>ewA,createModeSetRequestMessage:()=>T_$,createIdleNotification:()=>abH,clearMailbox:()=>MH1,ShutdownRequestMessageSchema:()=>GKD,ShutdownRejectedMessageSchema:()=>XKD,ShutdownApprovedMessageSchema:()=>UKD,PlanApprovalResponseMessageSchema:()=>MKD,PlanApprovalRequestMessageSchema:()=>EKD,ModeSetRequestMessageSchema:()=>JKD});function It(H,$){let A=$||g9()||"default",L=w5H(A),I=w5H(H),D=P_$.join(P6(),L,"inboxes"),B=P_$.join(D,`${I}.json`);return N(`[TeammateMailbox] getInboxPath: agent=${H}, team=${A}, fullPath=${B}`),B}function fH1(H){return It(H)}function EH1(H){let $=H||g9()||"default",A=w5H($),L=P_$.join(P6(),A,"inboxes");if(!zw.existsSync(L))zw.mkdirSync(L,{recursive:!0}),N(`[TeammateMailbox] Created inbox directory: ${L}`)}function qp(H,$){let A=It(H,$);if(N(`[TeammateMailbox] readMailbox: path=${A}`),!zw.existsSync(A))return N("[TeammateMailbox] readMailbox: file does not exist"),[];try{let L=zw.readFileSync(A,"utf-8"),I=DA(L);return N(`[TeammateMailbox] readMailbox: read ${I.length} message(s)`),I}catch(L){return N(`Failed to read inbox for ${H}: ${L}`),r(L instanceof Error?L:Error(String(L))),[]}}function M9H(H,$){let A=qp(H,$),L=A.filter((I)=>!I.read);return N(`[TeammateMailbox] readUnreadMessages: ${L.length} unread of ${A.length} total`),L}function K8(H,$,A){EH1(A);let L=It(H,A),I=`${L}.lock`;if(N(`[TeammateMailbox] writeToMailbox: recipient=${H}, from=${$.from}, path=${L}`),!zw.existsSync(L))iL(L,"[]","utf-8"),N("[TeammateMailbox] writeToMailbox: created new inbox file");let D;try{D=ibH.lockSync(L,{lockfilePath:I});let B=qp(H,A),f={...$,read:!1};B.push(f),iL(L,yH(B,null,2),"utf-8"),N(`[TeammateMailbox] Wrote message to ${H}'s inbox from ${$.from}`)}catch(B){N(`Failed to write to inbox for ${H}: ${B}`),r(B instanceof Error?B:Error(String(B)))}finally{if(D)D()}}function nbH(H,$,A){let L=It(H,$);if(N(`[TeammateMailbox] markMessageAsReadByIndex called: agentName=${H}, teamName=${$}, index=${A}, path=${L}`),!zw.existsSync(L)){N(`[TeammateMailbox] markMessageAsReadByIndex: file does not exist at ${L}`);return}let I=`${L}.lock`,D;try{N("[TeammateMailbox] markMessageAsReadByIndex: acquiring lock..."),D=ibH.lockSync(L,{lockfilePath:I}),N("[TeammateMailbox] markMessageAsReadByIndex: lock acquired");let B=qp(H,$);if(N(`[TeammateMailbox] markMessageAsReadByIndex: read ${B.length} messages after lock`),A<0||A>=B.length){N(`[TeammateMailbox] markMessageAsReadByIndex: index ${A} out of bounds (${B.length} messages)`);return}let f=B[A];if(!f||f.read){N("[TeammateMailbox] markMessageAsReadByIndex: message already read or missing");return}B[A]={...f,read:!0},iL(L,yH(B,null,2),"utf-8"),N(`[TeammateMailbox] markMessageAsReadByIndex: marked message at index ${A} as read`)}catch(B){N(`[TeammateMailbox] markMessageAsReadByIndex FAILED for ${H}: ${B}`),r(B instanceof Error?B:Error(String(B)))}finally{if(D)D(),N("[TeammateMailbox] markMessageAsReadByIndex: lock released")}}function rbH(H,$){let A=It(H,$);if(N(`[TeammateMailbox] markMessagesAsRead called: agentName=${H}, teamName=${$}, path=${A}`),!zw.existsSync(A)){N(`[TeammateMailbox] markMessagesAsRead: file does not exist at ${A}`);return}let L=`${A}.lock`,I;try{N("[TeammateMailbox] markMessagesAsRead: acquiring lock..."),I=ibH.lockSync(A,{lockfilePath:L}),N("[TeammateMailbox] markMessagesAsRead: lock acquired");let D=qp(H,$);if(N(`[TeammateMailbox] markMessagesAsRead: read ${D.length} messages after lock`),D.length===0){N("[TeammateMailbox] markMessagesAsRead: no messages to mark");return}let B=D.filter((U)=>!U.read).length;N(`[TeammateMailbox] markMessagesAsRead: ${B} unread of ${D.length} total`);let f=D.map((U)=>({...U,read:!0}));iL(A,yH(f,null,2),"utf-8"),N(`[TeammateMailbox] markMessagesAsRead: WROTE ${B} message(s) as read to ${A}`);let E=zw.readFileSync(A,"utf-8"),G=DA(E).filter((U)=>!U.read).length;N(`[TeammateMailbox] markMessagesAsRead: VERIFY - ${G} still unread after write`)}catch(D){N(`[TeammateMailbox] markMessagesAsRead FAILED for ${H}: ${D}`),r(D instanceof Error?D:Error(String(D)))}finally{if(I)I(),N("[TeammateMailbox] markMessagesAsRead: lock released")}}function MH1(H,$){let A=It(H,$);if(!zw.existsSync(A))return;try{iL(A,"[]","utf-8"),N(`[TeammateMailbox] Cleared inbox for ${H}`)}catch(L){N(`Failed to clear inbox for ${H}: ${L}`),r(L instanceof Error?L:Error(String(L)))}}function GH1(H){return H.map(($)=>{let A=$.color?` color="${$.color}"`:"",L=$.summary?` summary="${$.summary}"`:"";return`<${sX} teammate_id="${$.from}"${A}${L}> `)}function abH(H,$){return{type:"idle_notification",from:H,timestamp:new Date().toISOString(),idleReason:$?.idleReason,summary:$?.summary,completedTaskId:$?.completedTaskId,completedStatus:$?.completedStatus,failureReason:$?.failureReason}}function obH(H){try{let $=DA(H);if($&&$.type==="idle_notification")return $}catch{}return null}function UH1(H,$,A){return{type:"task_completed",from:H,taskId:$,taskSubject:A,timestamp:new Date().toISOString()}}function XH1(H){try{let $=DA(H);if($&&$.type==="task_completed")return $}catch{}return null}function ewA(H){return{type:"permission_request",request_id:H.request_id,agent_id:H.agent_id,tool_name:H.tool_name,tool_use_id:H.tool_use_id,description:H.description,input:H.input,permission_suggestions:H.permission_suggestions||[]}}function HZA(H){if(H.subtype==="error")return{type:"permission_response",request_id:H.request_id,subtype:"error",error:H.error||"Permission denied"};return{type:"permission_response",request_id:H.request_id,subtype:"success",response:{updated_input:H.updated_input,permission_updates:H.permission_updates}}}function tbH(H){try{let $=DA(H);if($&&$.type==="permission_request")return $}catch{}return null}function G9H(H){try{let $=DA(H);if($&&$.type==="permission_response")return $}catch{}return null}function $ZA(H){return{type:"sandbox_permission_request",requestId:H.requestId,workerId:H.workerId,workerName:H.workerName,workerColor:H.workerColor,hostPattern:{host:H.host},createdAt:Date.now()}}function AZA(H){return{type:"sandbox_permission_response",requestId:H.requestId,host:H.host,allow:H.allow,timestamp:new Date().toISOString()}}function __$(H){try{let $=DA(H);if($&&$.type==="sandbox_permission_request")return $}catch{}return null}function sbH(H){try{let $=DA(H);if($&&$.type==="sandbox_permission_response")return $}catch{}return null}function H6H(H){return{type:"shutdown_request",requestId:H.requestId,from:H.from,reason:H.reason,timestamp:new Date().toISOString()}}function LZA(H){return{type:"shutdown_approved",requestId:H.requestId,from:H.from,timestamp:new Date().toISOString(),paneId:H.paneId,backendType:H.backendType}}function IZA(H){return{type:"shutdown_rejected",requestId:H.requestId,from:H.from,reason:H.reason,timestamp:new Date().toISOString()}}function Y_$(H,$,A){let L=$||g9(),I=g1()||kE,D=N7H("shutdown",H),B=H6H({requestId:D,from:I,reason:A});return K8(H,{from:I,text:yH(B),timestamp:new Date().toISOString(),color:q4()},L),{requestId:D,target:H}}function Dt(H){try{let $=GKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function C_$(H){try{let $=EKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function RP(H){try{let $=UKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function w_$(H){try{let $=XKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function $6H(H){try{let $=MKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function Z_$(H){try{let $=DA(H);if($&&$.type==="task_assignment")return $}catch{}return null}function q_$(H){try{let $=DA(H);if($&&$.type==="team_permission_update")return $}catch{}return null}function T_$(H){return{type:"mode_set_request",mode:H.mode,from:H.from}}function z_$(H){try{let $=JKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function N_$(H){try{let $=DA(H);if(!$||typeof $!=="object"||!("type"in $))return!1;let A=$.type;return A==="permission_request"||A==="permission_response"||A==="sandbox_permission_request"||A==="sandbox_permission_response"||A==="shutdown_request"||A==="shutdown_approved"||A==="team_permission_update"||A==="mode_set_request"||A==="plan_approval_request"||A==="plan_approval_response"}catch{return!1}}function DZA(H,$,A){let L=It(H,A);if(!zw.existsSync(L))return;let I=`${L}.lock`,D;try{D=ibH.lockSync(L,{lockfilePath:I});let B=qp(H,A);if(B.length===0)return;let f=B.map((E)=>!E.read&&$(E)?{...E,read:!0}:E);iL(L,yH(f,null,2),"utf-8")}catch(B){r(B instanceof Error?B:Error(String(B)))}finally{if(D)try{D()}catch{}}}function ebH(H){for(let $=H.length-1;$>=0;$--){let A=H[$];if(!A)continue;if(A.type==="user"&&typeof A.message.content==="string")break;if(A.type!=="assistant")continue;for(let L of A.message.content)if(L.type==="tool_use"&&L.name===vv&&typeof L.input==="object"&&L.input!==null&&"type"in L.input&&L.input.type==="message"&&"recipient"in L.input&&typeof L.input.recipient==="string"&&L.input.recipient.toLowerCase()!==kE.toLowerCase()){let I=L.input.recipient,D="summary"in L.input&&typeof L.input.summary==="string"?L.input.summary:("content"in L.input)&&typeof L.input.content==="string"?L.input.content.slice(0,80):void 0;if(D)return`[to ${I}] ${D}`}}return}var zw,P_$,ibH,EKD,MKD,GKD,UKD,XKD,JKD;var sU=K(()=>{Z$();NA();mI();_$();EE();E$();XE();JG();fKD();Z$();zw=require("fs"),P_$=require("path"),ibH=b(zk(),1);EKD=S.object({type:S.literal("plan_approval_request"),from:S.string(),timestamp:S.string(),planFilePath:S.string(),planContent:S.string(),requestId:S.string()}),MKD=S.object({type:S.literal("plan_approval_response"),requestId:S.string(),approved:S.boolean(),feedback:S.string().optional(),timestamp:S.string(),permissionMode:e7H.optional()}),GKD=S.object({type:S.literal("shutdown_request"),requestId:S.string(),from:S.string(),reason:S.string().optional(),timestamp:S.string()}),UKD=S.object({type:S.literal("shutdown_approved"),requestId:S.string(),from:S.string(),timestamp:S.string(),paneId:S.string().optional(),backendType:S.string().optional()}),XKD=S.object({type:S.literal("shutdown_rejected"),requestId:S.string(),from:S.string(),reason:S.string(),timestamp:S.string()});JKD=S.object({type:S.literal("mode_set_request"),mode:e7H,from:S.string()})});function JH1({request:H}){return FE.createElement(x,{flexDirection:"column",marginY:1},FE.createElement(x,{borderStyle:"round",borderColor:"warning",flexDirection:"column",paddingX:1,paddingY:1},FE.createElement(x,{marginBottom:1},FE.createElement(V,{color:"warning",bold:!0},"Shutdown request from ",H.from)),H.reason&&FE.createElement(x,null,FE.createElement(V,null,"Reason: ",H.reason))))}function FH1({response:H}){return FE.createElement(x,{flexDirection:"column",marginY:1},FE.createElement(x,{borderStyle:"round",borderColor:"subtle",flexDirection:"column",paddingX:1,paddingY:1},FE.createElement(V,{color:"subtle",bold:!0},"Shutdown rejected by ",H.from),FE.createElement(x,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1},FE.createElement(V,null,"Reason: ",H.reason)),FE.createElement(x,{marginTop:1},FE.createElement(V,{dimColor:!0},"Teammate is continuing to work. You may request shutdown again later."))))}function KKD(H){let $=Dt(H);if($)return FE.createElement(JH1,{request:$});if(RP(H))return null;let A=w_$(H);if(A)return FE.createElement(FH1,{response:A});return null}function QKD(H){let $=Dt(H);if($)return`[Shutdown Request from ${$.from}]${$.reason?` ${$.reason}`:""}`;let A=RP(H);if(A)return`[Shutdown Approved] ${A.from} is now exiting`;let L=w_$(H);if(L)return`[Shutdown Rejected] ${L.from}: ${L.reason}`;return null}var FE;var BZA=K(()=>{xH();sU();FE=b(s(),1)});function KH1({assignment:H}){return jK.createElement(x,{flexDirection:"column",marginY:1},jK.createElement(x,{borderStyle:"round",borderColor:"cyan_FOR_SUBAGENTS_ONLY",flexDirection:"column",paddingX:1,paddingY:1},jK.createElement(x,{marginBottom:1},jK.createElement(V,{color:"cyan_FOR_SUBAGENTS_ONLY",bold:!0},"Task #",H.taskId," assigned by ",H.assignedBy)),jK.createElement(x,null,jK.createElement(V,{bold:!0},H.subject)),H.description&&jK.createElement(x,{marginTop:1},jK.createElement(V,{dimColor:!0},H.description))))}function WKD(H){let $=Z_$(H);if($)return jK.createElement(KH1,{assignment:$});return null}function VKD(H){let $=Z_$(H);if($)return`[Task Assigned] #${$.taskId} - ${$.subject}`;return null}var jK;var fZA=K(()=>{xH();sU();jK=b(s(),1)});function QH1({request:H}){return I9.createElement(x,{flexDirection:"column",marginY:1},I9.createElement(x,{borderStyle:"round",borderColor:"planMode",flexDirection:"column",paddingX:1},I9.createElement(x,{marginBottom:1},I9.createElement(V,{color:"planMode",bold:!0},"Plan Approval Request from ",H.from)),I9.createElement(x,{borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:1,marginBottom:1},I9.createElement(VJ,null,H.planContent)),I9.createElement(V,{dimColor:!0},"Plan file: ",H.planFilePath)))}function WH1({response:H,senderName:$}){if(H.approved)return I9.createElement(x,{flexDirection:"column",marginY:1},I9.createElement(x,{borderStyle:"round",borderColor:"success",flexDirection:"column",paddingX:1,paddingY:1},I9.createElement(x,null,I9.createElement(V,{color:"success",bold:!0},"\u2713 Plan Approved by ",$)),I9.createElement(x,{marginTop:1},I9.createElement(V,null,"You can now proceed with implementation. Your plan mode restrictions have been lifted."))));return I9.createElement(x,{flexDirection:"column",marginY:1},I9.createElement(x,{borderStyle:"round",borderColor:"error",flexDirection:"column",paddingX:1,paddingY:1},I9.createElement(x,null,I9.createElement(V,{color:"error",bold:!0},"\u2717 Plan Rejected by ",$)),H.feedback&&I9.createElement(x,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1},I9.createElement(V,null,"Feedback: ",H.feedback)),I9.createElement(x,{marginTop:1},I9.createElement(V,{dimColor:!0},"Please revise your plan based on the feedback and call ExitPlanMode again."))))}function O_$(H,$){let A=C_$(H);if(A)return I9.createElement(QH1,{request:A});let L=$6H(H);if(L)return I9.createElement(WH1,{response:L,senderName:$});return null}function VH1(H){let $=C_$(H);if($)return`[Plan Approval Request from ${$.from}]`;let A=$6H(H);if(A)if(A.approved)return"[Plan Approved] You can now proceed with implementation";else return`[Plan Rejected] ${A.feedback||"Please revise your plan"}`;return null}function PH1(H){let $=["Agent idle"];if(H.completedTaskId){let A=H.completedStatus||"completed";$.push(`Task ${H.completedTaskId} ${A}`)}if(H.summary)$.push(`Last DM: ${H.summary}`);return $.join(" \xB7 ")}function PKD(H){let $=VH1(H);if($)return $;let A=QKD(H);if(A)return A;let L=obH(H);if(L)return PH1(L);let I=VKD(H);if(I)return I;try{let D=DA(H);if(D?.type==="teammate_terminated"&&D.message)return D.message}catch{}return H}var I9;var EZA=K(()=>{xH();nx();sU();Z$();BZA();fZA();I9=b(s(),1)});function _H1(H){let $=[],A=new RegExp(`<${sX}\\s+teammate_id="([^"]+)"(?:\\s+color="([^"]+)")?(?:\\s+summary="([^"]+)")?>\\n?([\\s\\S]*?)\\n?<\\/${sX}>`,"g");for(let L of H.matchAll(A))if(L[1]&&L[4])$.push({teammateId:L[1],color:L[2],summary:L[3],content:L[4].trim()});return $}function YH1(H){if(H==="leader")return"leader";return H}function _KD({addMargin:H,param:{text:$},isTranscriptMode:A}){let L=_H1($).filter((I)=>{if(RP(I.content))return!1;try{if(DA(I.content)?.type==="teammate_terminated")return!1}catch{}return!0});if(L.length===0)return null;return S1.createElement(x,{flexDirection:"column",marginTop:H?1:0,width:"100%"},L.map((I,D)=>{let B=v7(I.color),f=YH1(I.teammateId),E=O_$(I.content,f);if(E)return S1.createElement(S1.Fragment,{key:D},E);let M=KKD(I.content);if(M)return S1.createElement(S1.Fragment,{key:D},M);let G=WKD(I.content);if(G)return S1.createElement(S1.Fragment,{key:D},G);let U=null;try{U=DA(I.content)}catch{}if(U?.type==="idle_notification")return null;if(U?.type==="task_completed"){let X=U;return S1.createElement(x,{key:D,flexDirection:"column",marginTop:1},S1.createElement(V,{color:B},`@${f}${pH.pointer}`),S1.createElement(HA,null,S1.createElement(V,{color:"success"},"\u2713"),S1.createElement(V,null," ","Completed task #",X.taskId,X.taskSubject&&S1.createElement(V,{dimColor:!0}," (",X.taskSubject,")"))))}return S1.createElement(CH1,{key:D,displayName:f,inkColor:B,content:I.content,summary:I.summary,isTranscriptMode:A})}))}function CH1({displayName:H,inkColor:$,content:A,summary:L,isTranscriptMode:I}){return S1.createElement(x,{flexDirection:"column",marginTop:1},S1.createElement(x,null,S1.createElement(V,{color:$},`@${H}${pH.pointer}`),L&&S1.createElement(V,null," ",L)),I&&S1.createElement(x,{paddingLeft:2},S1.createElement(V,null,S1.createElement(m9,null,A))))}var S1;var YKD=K(()=>{xH();jI();Wp();EE();Z$();EZA();BZA();sU();fZA();iB();S1=b(s(),1)});function wH1(H){switch(H){case"completed":return"success";case"failed":return"error";case"killed":return"warning";default:return"text"}}function CKD({addMargin:H,param:{text:$}}){let A=VD($,"summary");if(!A)return null;let L=VD($,"status"),I=wH1(L);return U9H.createElement(x,{marginTop:H?1:0},U9H.createElement(V,null,U9H.createElement(V,{color:I},Zf)," ",A))}var U9H;var wKD=K(()=>{xH();p6();_L();U9H=b(s(),1)});function x_$({addMargin:H,planContent:$}){return Tp.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:"planMode",marginTop:H?1:0,paddingX:1},Tp.createElement(x,{marginBottom:1},Tp.createElement(V,{bold:!0,color:"planMode"},"Plan to implement")),Tp.createElement(VJ,null,$))}var Tp;var MZA=K(()=>{xH();nx();Tp=b(s(),1)});function X9H({addMargin:H,param:$,verbose:A,thinkingMetadata:L,planContent:I,isTranscriptMode:D}){if($.text.trim()===qw)return null;if(I)return zG.createElement(x_$,{addMargin:H,planContent:I});if(VD($.text,jN))return null;if($.text.startsWith(""))return zG.createElement(HKD,{content:$.text});if($.text.startsWith(""))return zG.createElement(Q_$,{addMargin:H,param:$});if($.text.includes(""))return zG.createElement(E9H,{addMargin:H,param:$});if($.text.includes(`<${C6}>`))return zG.createElement(yFD,{addMargin:H,param:$});if($.text.includes(""))return zG.createElement(iFD,{addMargin:H,text:$.text});if(dL()&&$.text.includes(`<${sX}`))return zG.createElement(_KD,{addMargin:H,param:$,isTranscriptMode:D});if($.text.includes(`<${G5}`))return zG.createElement(CKD,{addMargin:H,param:$});return zG.createElement(mFD,{addMargin:H,param:$,thinkingMetadata:L})}var zG;var S_$=K(()=>{cwA();vFD();pFD();nFD();zFH();_L();iB();oFD();eFD();rwA();$KD();T8();YKD();wKD();EE();MZA();_L();zG=b(s(),1)});function j_$({imageId:H,addMargin:$}){let A=H?`[Image #${H}]`:"[Image]",L=H?V4$(H):null,I=L&&e2()?CS.createElement(dI,{url:ZKD.pathToFileURL(L).href},CS.createElement(V,null,A)):CS.createElement(V,null,A);if($)return CS.createElement(x,{marginTop:1},I);return CS.createElement(HA,null,I)}var CS,ZKD;var GZA=K(()=>{xH();rJH();gr();jr();iB();CS=b(s(),1),ZKD=require("url")});function R_$({param:{thinking:H},addMargin:$=!1,isTranscriptMode:A,hideInTranscript:L=!1}){let I=C0("app:toggleTranscript","Global","ctrl+o"),D=!1;if(!H)return null;if(L)return null;let B=A,f="\u2234 Thinking";if(!B)return J9H.default.createElement(x,{marginTop:$?1:0},J9H.default.createElement(V,{dimColor:!0,italic:!0},f," (",I," to expand)"));return J9H.default.createElement(x,{flexDirection:"column",gap:1,marginTop:$?1:0,width:"100%"},J9H.default.createElement(V,{dimColor:!0,italic:!0},f,"\u2026"),J9H.default.createElement(x,{paddingLeft:2},J9H.default.createElement(VJ,{dimColor:!0},H)))}var J9H;var UZA=K(()=>{xH();nx();FG();vA();J9H=b(s(),1)});function qKD({addMargin:H=!1}){return XZA.default.createElement(x,{marginTop:H?1:0},XZA.default.createElement(V,{dimColor:!0,italic:!0},"\u273B Thinking\u2026"))}var XZA;var TKD=K(()=>{xH();XZA=b(s(),1)});function NKD({attachment:H,verbose:$}){let A=C0("app:toggleTranscript","Global","ctrl+o");if(H.files.length===0)return null;let L=H.files.reduce((D,B)=>D+B.diagnostics.length,0),I=H.files.length;if($)return Nw.default.createElement(x,{flexDirection:"column"},H.files.map((D,B)=>Nw.default.createElement(Nw.default.Fragment,{key:B},Nw.default.createElement(HA,null,Nw.default.createElement(V,{dimColor:!0,wrap:"wrap"},Nw.default.createElement(V,{bold:!0},zKD.relative(C$(),D.uri.replace("file://","").replace("_claude_fs_right:","")))," ",Nw.default.createElement(V,{dimColor:!0},D.uri.startsWith("file://")?"(file://)":D.uri.startsWith("_claude_fs_right:")?"(claude_fs_right)":`(${D.uri.split(":")[0]})`),":")),D.diagnostics.map((f,E)=>Nw.default.createElement(HA,{key:E},Nw.default.createElement(V,{dimColor:!0,wrap:"wrap"}," ",wS.getSeveritySymbol(f.severity)," [Line ",f.range.start.line+1,":",f.range.start.character+1,"] ",f.message,f.code?` [${f.code}]`:"",f.source?` (${f.source})`:""))))));else return Nw.default.createElement(HA,null,Nw.default.createElement(V,{dimColor:!0,wrap:"wrap"},"Found ",Nw.default.createElement(V,{bold:!0},L)," new diagnostic"," ",L===1?"issue":"issues"," in ",I," ",I===1?"file":"files"," (",A," to expand)"))}var Nw,zKD;var OKD=K(()=>{xH();PI();iB();F9H();FG();Nw=b(s(),1),zKD=require("path")});function xKD({attachment:H,addMargin:$,verbose:A,isTranscriptMode:L}){let I=J$((D)=>D.tasks);if(dL()&&H.type==="teammate_mailbox"){let D=H.messages.filter((B)=>{if(RP(B.text))return!1;try{let f=DA(B.text);return f?.type!=="idle_notification"&&f?.type!=="teammate_terminated"}catch{return!0}});if(D.length===0)return null;return PD.default.createElement(x,{flexDirection:"column"},D.map((B,f)=>{let E=null;try{E=DA(B.text)}catch{}if(E?.type==="task_assignment")return PD.default.createElement(x,{key:f,paddingLeft:2},PD.default.createElement(V,null,Zf," "),PD.default.createElement(V,null,"Task assigned: "),PD.default.createElement(V,{bold:!0},"#",E.taskId),PD.default.createElement(V,null," - ",E.subject),PD.default.createElement(V,{dimColor:!0}," (from ",E.assignedBy||B.from,")"));let M=O_$(B.text,B.from);if(M)return PD.default.createElement(PD.default.Fragment,{key:f},M);let G=v7(B.color),U=PKD(B.text)??B.text;return PD.default.createElement(ZH1,{key:f,displayName:B.from,inkColor:G,content:U,summary:B.summary,isTranscriptMode:L})}))}switch(H.type){case"directory":return PD.default.createElement(vF,null,"Listed directory"," ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.path)+ZS.sep));case"file":case"already_read_file":if(H.content.type==="notebook")return PD.default.createElement(vF,null,"Read ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," (",H.content.file.cells.length," cells)");return PD.default.createElement(vF,null,"Read ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," (",H.content.type==="text"?`${H.content.file.numLines}${H.truncated?"+":""} lines`:GM(H.content.file.originalSize),")");case"compact_file_reference":return PD.default.createElement(vF,null,"Referenced file"," ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename)));case"pdf_reference":return PD.default.createElement(vF,null,"Referenced PDF"," ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," (",H.pageCount," pages)");case"selected_lines_in_ide":return PD.default.createElement(vF,null,"\u29C9 Selected"," ",PD.default.createElement(V,{bold:!0},H.lineEnd-H.lineStart+1)," ","lines from ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," ","in ",H.ideName);case"nested_memory":return PD.default.createElement(vF,null,"Loaded ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.path)));case"dynamic_skill":{let D=ZS.relative(C$(),H.skillDir),B=H.skillNames.length;return PD.default.createElement(vF,null,"Loaded"," ",PD.default.createElement(V,{bold:!0},B," skill",B!==1?"s":"")," ","from ",PD.default.createElement(V,{bold:!0},D))}case"skill_listing":{if(H.isInitial)return null;return PD.default.createElement(vF,null,PD.default.createElement(V,{bold:!0},H.skillCount)," skill",H.skillCount!==1?"s":""," available")}case"queued_command":{let D=typeof H.prompt==="string"?H.prompt:K9H(H.prompt)||"",B=H.imagePasteIds&&H.imagePasteIds.length>0;return PD.default.createElement(x,{flexDirection:"column"},PD.default.createElement(X9H,{addMargin:$,param:{text:D,type:"text"},verbose:A}),B&&H.imagePasteIds?.map((f)=>PD.default.createElement(j_$,{key:f,imageId:f})))}case"todo":if(H.context==="post-compact")return PD.default.createElement(vF,null,"Todo list read (",H.itemCount," ",H.itemCount===1?"item":"items",")");return null;case"plan_file_reference":return PD.default.createElement(vF,null,"Plan file referenced (",V9(H.planFilePath),")");case"invoked_skills":{if(H.skills.length===0)return null;let D=H.skills.map((B)=>B.name).join(", ");return PD.default.createElement(vF,null,"Skills restored (",D,")")}case"diagnostics":return PD.default.createElement(NKD,{attachment:H,verbose:A});case"mcp_resource":return PD.default.createElement(vF,null,"Read MCP resource ",PD.default.createElement(V,{bold:!0},H.name)," from"," ",H.server);case"command_permissions":return null;case"async_hook_response":{if(H.hookEvent==="SessionStart"&&!A)return null;return PD.default.createElement(vF,null,"Async hook ",PD.default.createElement(V,{bold:!0},H.hookEvent)," completed")}case"hook_blocking_error":{if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,{color:"error"},H.hookName," hook returned blocking error")}case"hook_non_blocking_error":{if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,{color:"error"},H.hookName," hook error")}case"hook_error_during_execution":if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,null,H.hookName," hook warning");case"hook_success":return null;case"hook_stopped_continuation":if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,{color:"warning"},H.hookName," hook stopped continuation: ",H.message);case"hook_system_message":return PD.default.createElement(vF,null,H.hookName," says: ",H.content);case"hook_permission_decision":{let D=H.decision==="allow"?"Allowed":"Denied";return PD.default.createElement(vF,null,D," by ",PD.default.createElement(V,{bold:!0},H.hookEvent)," hook")}case"task_status":{if(v8()&&H.status==="killed")return null;if(dL()){let B=I[H.taskId];if(H.taskType==="in_process_teammate"&&B?.type==="in_process_teammate"){let f=v7(B.identity.color),E=H.status==="completed"?"shut down gracefully":H.status;return PD.default.createElement(x,{flexDirection:"row",width:"100%",marginTop:1},PD.default.createElement(V,{dimColor:!0},Zf," "),PD.default.createElement(V,{dimColor:!0},"Teammate"," ",PD.default.createElement(V,{color:f,bold:!0,dimColor:!1},"@",B.identity.agentName)," ",E))}}let D=H.status==="completed"?"completed in background":H.status==="killed"?"stopped":H.status;return PD.default.createElement(x,{flexDirection:"row",width:"100%",marginTop:1},PD.default.createElement(V,{dimColor:!0},Zf," "),PD.default.createElement(V,{dimColor:!0},'Task "',PD.default.createElement(V,{bold:!0},H.description),'"'," ",D))}case"task_progress":return null;case"teammate_shutdown_batch":return PD.default.createElement(x,{flexDirection:"row",width:"100%",marginTop:1},PD.default.createElement(V,{dimColor:!0},Zf," "),PD.default.createElement(V,{dimColor:!0},H.count," teammate",H.count===1?"":"s"," shut down gracefully"));case"agent_mention":case"budget_usd":case"critical_system_reminder":case"delegate_mode":case"delegate_mode_exit":case"edited_image_file":case"edited_text_file":case"hook_additional_context":case"hook_cancelled":case"opened_file_in_ide":case"output_style":case"plan_mode":case"plan_mode_exit":case"plan_mode_reentry":case"structured_output":case"team_context":case"todo_reminder":case"ultramemory":case"token_usage":return null}}function ZH1({displayName:H,inkColor:$,content:A,summary:L,isTranscriptMode:I}){return PD.default.createElement(x,{flexDirection:"column",marginTop:1},PD.default.createElement(x,null,PD.default.createElement(V,{color:$},`@${H}${pH.pointer}`),L&&PD.default.createElement(V,null," ",L)),I&&PD.default.createElement(x,{paddingLeft:2},PD.default.createElement(V,null,PD.default.createElement(m9,null,A))))}function vF({dimColor:H=!0,children:$,color:A}){return PD.default.createElement(HA,null,PD.default.createElement(V,{color:A,dimColor:H,wrap:"wrap"},$))}var PD,ZS;var SKD=K(()=>{xH();pL();rD();iB();PI();S_$();OKD();_L();GZA();Wp();Z$();T8();w7();EZA();p6();jI();sU();PD=b(s(),1),ZS=require("path")});function Dz(H){if(H.status!=="running"&&H.status!=="pending")return!1;if("isBackgrounded"in H&&H.isBackgrounded===!1)return!1;return!0}function jKD({message:{retryAttempt:H,error:$,retryInMs:A,maxRetries:L}}){let[I,D]=y_$.useState(0);if(VF(()=>D((f)=>f+1000),1000),y_$.useEffect(()=>D(0),[]),H<4)return null;let B=Math.max(0,Math.round((A-I)/1000));return zp.createElement(HA,null,zp.createElement(x,{flexDirection:"column"},zp.createElement(V,{color:"error"},LU$($)),zp.createElement(V,{dimColor:!0},"Retrying in ",B," ",B===1?"second":"seconds","\u2026 (attempt"," ",H,"/",L,")",process.env.API_TIMEOUT_MS?` \xB7 API_TIMEOUT_MS=${process.env.API_TIMEOUT_MS}ms, try increasing it`:"")))}var zp,y_$;var RKD=K(()=>{iB();xH();Ng();s6();zp=b(s(),1),y_$=b(s(),1)});function vKD({message:H,addMargin:$,verbose:A}){if(H.subtype==="turn_duration")return D9.createElement(zH1,{message:H,addMargin:$});if(H.subtype==="thinking")return null;if(H.subtype!=="stop_hook_summary"&&!A&&H.level==="info")return null;if(H.subtype==="api_error")return D9.createElement(jKD,{message:H});if(H.subtype==="stop_hook_summary")return D9.createElement(qH1,{message:H,addMargin:$,verbose:A});let I=H.content;return D9.createElement(x,{flexDirection:"row",width:"100%"},D9.createElement(TH1,{content:I,addMargin:$,dot:H.level!=="info",color:H.level==="warning"?"warning":void 0,dimColor:H.level==="info"}))}function qH1({message:H,addMargin:$,verbose:A}){let{hookCount:L,hookInfos:I,hookErrors:D,preventedContinuation:B,stopReason:f}=H,{columns:E}=QL();if(D.length===0&&!B)return null;return D9.createElement(x,{flexDirection:"row",marginTop:$?1:0,width:"100%"},D9.createElement(x,{minWidth:2},D9.createElement(V,null,Zf)),D9.createElement(x,{flexDirection:"column",width:E-10},D9.createElement(V,null,"Ran ",D9.createElement(V,{bold:!0},L)," stop"," ",L===1?"hook":"hooks"),A&&I.length>0&&I.map((M,G)=>D9.createElement(V,{key:`cmd-${G}`},"\u23BF \xA0",M.command==="prompt"?`prompt: ${M.promptText||""}`:`command: ${M.command}`)),B&&f&&D9.createElement(V,null,"\u23BF \xA0",f),D.length>0&&D.map((M,G)=>D9.createElement(V,{key:G},"\u23BF \xA0Stop hook error: ",M))))}function TH1({content:H,addMargin:$,dot:A,color:L,dimColor:I}){let{columns:D}=QL();return D9.createElement(x,{flexDirection:"row",marginTop:$?1:0,width:"100%"},A&&D9.createElement(x,{minWidth:2},D9.createElement(V,{color:L,dimColor:I},Zf)),D9.createElement(x,{flexDirection:"column",width:D-10},D9.createElement(V,{color:L,dimColor:I,wrap:"wrap"},H.trim())))}function zH1({message:H,addMargin:$}){let[A]=yKD.useState(()=>QV(x7H)??"Worked"),L=J$((f)=>f.tasks);if(!(M$().showTurnDuration??!0))return null;let D=of(H.durationMs),B=Object.values(L).filter(Dz).length;return D9.createElement(x,{flexDirection:"row",marginTop:$?1:0,width:"100%"},D9.createElement(x,{minWidth:2},D9.createElement(V,{dimColor:!0},qzH)),D9.createElement(V,{dimColor:!0},A," for ",D,B>0&&` \xB7 ${B} ${B===1?"agent":"agents"} running in the background`))}var D9,yKD;var hKD=K(()=>{xH();yHH();p6();NP$();OB();pL();RKD();Q9();vA();D9=b(s(),1),yKD=b(s(),1)});function bKD(){let H=C0("app:toggleTranscript","Global","ctrl+o");return HkH.createElement(x,{marginY:1},HkH.createElement(V,{dimColor:!0},"\u273B Conversation compacted (",H," for history)"))}var HkH;var kKD=K(()=>{xH();FG();HkH=b(s(),1)});var NH1;var uKD=K(()=>{xH();p6();OB();NH1=b(s(),1)});function gKD({message:H,tools:$,lookups:A,inProgressToolUseIDs:L,shouldAnimate:I}){let D=$.find((M)=>M.name===H.toolName);if(!D?.renderGroupedToolUse)return null;let B=new Map;for(let M of H.results)for(let G of M.message.content)if(G.type==="tool_result")B.set(G.tool_use_id,{param:G,output:M.toolUseResult});let f=H.messages.map((M)=>{let G=M.message.content[0],U=B.get(G.id);return{param:G,isResolved:A.resolvedToolUseIDs.has(G.id),isError:A.erroredToolUseIDs.has(G.id),isInProgress:L.has(G.id),progressMessages:kr(A.progressMessagesByToolUseID.get(G.id)??[]),result:U}}),E=f.some((M)=>M.isInProgress);return D.renderGroupedToolUse(f,{shouldAnimate:I&&E,tools:$})}var mKD=()=>{};function OH1({content:H,tools:$,lookups:A,inProgressToolUseIDs:L,shouldAnimate:I,theme:D}){let B=$.find((C)=>C.name===H.name);if(!B)return null;let f=A.resolvedToolUseIDs.has(H.id),E=A.erroredToolUseIDs.has(H.id),M=L.has(H.id),G=A.toolResultByToolUseID.get(H.id),U=G?.type==="user"?G.toolUseResult:void 0,X=B.outputSchema?.safeParse(U),J=X?.success?X.data:void 0,F=B.inputSchema.safeParse(H.input),Q=F.success?F.data:void 0,W=B.userFacingName(Q),P=Q?B.renderToolUseMessage(Q,{theme:D,verbose:!1}):null;return uE.default.createElement(x,{key:H.id,flexDirection:"column",marginTop:1},uE.default.createElement(x,{flexDirection:"row"},uE.default.createElement(mBH,{shouldAnimate:I&&M,isUnresolved:!f,isError:E}),uE.default.createElement(V,{bold:!0},W),P&&uE.default.createElement(V,null,"(",P,")"),Q&&B.renderToolUseTag?.(Q)),f&&!E&&J!==void 0&&uE.default.createElement(x,null,B.renderToolResultMessage(J,[],{verbose:!1,tools:$,theme:D})))}function pKD({message:H,inProgressToolUseIDs:$,shouldAnimate:A,verbose:L,tools:I,lookups:D,isActiveGroup:B}){let{searchCount:f,readCount:E,replCount:M,memorySearchCount:G,memoryReadCount:U,memoryWriteCount:X,messages:J}=H,[F]=_I(),Q=MQH(H).some((Y)=>D.erroredToolUseIDs.has(Y)),W=G>0||U>0||X>0,P=f>0||E>0||M>0;if(L){let Y=[];for(let Z of J)if(Z.type==="assistant")Y.push(Z);else if(Z.type==="grouped_tool_use")Y.push(...Z.messages);return uE.default.createElement(x,{flexDirection:"column"},Y.map((Z)=>{let q=Z.message.content[0];if(q?.type!=="tool_use")return null;return uE.default.createElement(OH1,{key:q.id,content:q,tools:I,lookups:D,inProgressToolUseIDs:$,shouldAnimate:A,theme:F})}))}if(!W&&!P)return null;let C=[];if(U>0){let Y=B?C.length===0?"Recalling":"recalling":C.length===0?"Recalled":"recalled";C.push(uE.default.createElement(V,{key:"mem-read"},Y," ",uE.default.createElement(V,{bold:!0},U)," ",U===1?"memory":"memories"))}if(G>0){let Y=B?C.length===0?"Searching":"searching":C.length===0?"Searched":"searched";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-ms"},", "));C.push(uE.default.createElement(V,{key:"mem-search"},`${Y} memories`))}if(X>0){let Y=B?C.length===0?"Writing":"writing":C.length===0?"Wrote":"wrote";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-mw"},", "));C.push(uE.default.createElement(V,{key:"mem-write"},Y," ",uE.default.createElement(V,{bold:!0},X)," ",X===1?"memory":"memories"))}if(f>0){let Y=B?C.length===0?"Searching for":"searching for":C.length===0?"Searched for":"searched for";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-s"},", "));C.push(uE.default.createElement(V,{key:"search"},Y," ",uE.default.createElement(V,{bold:!0},f)," ",f===1?"pattern":"patterns"))}if(E>0){let Y=B?C.length===0?"Reading":"reading":C.length===0?"Read":"read";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-r"},", "));C.push(uE.default.createElement(V,{key:"read"},Y," ",uE.default.createElement(V,{bold:!0},E)," ",E===1?"file":"files"))}if(M>0){let Y=B?"REPL'ing":"REPL'd";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-repl"},", "));C.push(uE.default.createElement(V,{key:"repl"},Y," ",uE.default.createElement(V,{bold:!0},M)," ",M===1?"time":"times"))}if(B)C.push(uE.default.createElement(V,{key:"ellipsis"},"\u2026"));return uE.default.createElement(x,{flexDirection:"row",marginTop:1},uE.default.createElement(mBH,{shouldAnimate:!!B,isUnresolved:!!B,isError:Q}),uE.default.createElement(V,null,C," ",uE.default.createElement(Bx,null)))}var uE;var dKD=K(()=>{xH();pQ$();lr();hx();uE=b(s(),1)});function cKD({message:H,screen:$}){let A=$==="transcript",L=$kH(H)||"",I=H.summarizeMetadata;if(I)return c0.createElement(x,{flexDirection:"column",marginTop:1},c0.createElement(x,{flexDirection:"row"},c0.createElement(x,{minWidth:2},c0.createElement(V,{color:"text"},Zf)),c0.createElement(x,{flexDirection:"column"},c0.createElement(V,{bold:!0},"Summarized conversation"),!A&&c0.createElement(HA,null,c0.createElement(x,{flexDirection:"column"},c0.createElement(V,{dimColor:!0},"Summarized ",I.messagesSummarized," messages from this point"),I.userContext&&c0.createElement(V,{dimColor:!0},"Context: ","\u201C",I.userContext,"\u201D"),c0.createElement(V,{dimColor:!0},c0.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand history",parens:!0})))),A&&c0.createElement(HA,null,c0.createElement(V,null,L)))));return c0.createElement(x,{flexDirection:"column",marginTop:1},c0.createElement(x,{flexDirection:"row"},c0.createElement(x,{minWidth:2},c0.createElement(V,{color:"text"},Zf)),c0.createElement(x,{flexDirection:"column"},c0.createElement(V,{bold:!0},"Compact summary",!A&&c0.createElement(V,{dimColor:!0}," ",c0.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand",parens:!0}))))),A&&c0.createElement(HA,null,c0.createElement(V,null,L)))}var c0;var lKD=K(()=>{xH();_L();p6();iB();j0();c0=b(s(),1)});function xH1({message:H,lookups:$,addMargin:A,tools:L,commands:I,verbose:D,inProgressToolUseIDs:B,progressMessagesForMessage:f,shouldAnimate:E,shouldShowDot:M,style:G,width:U,isTranscriptMode:X,onOpenRateLimitOptions:J,isActiveCollapsedGroup:F,isUserContinuation:Q=!1,lastThinkingBlockId:W,latestBashOutputUUID:P}){switch(H.type){case"attachment":return j1.createElement(xKD,{addMargin:A,attachment:H.attachment,verbose:D,isTranscriptMode:X});case"assistant":return j1.createElement(x,{flexDirection:"column",width:"100%"},H.message.content.map((C,Y)=>j1.createElement(jH1,{key:Y,param:C,addMargin:A,tools:L,commands:I,verbose:D,inProgressToolUseIDs:B,progressMessagesForMessage:f,shouldAnimate:E,shouldShowDot:M,width:U,inProgressToolCallCount:B.size,isTranscriptMode:X,lookups:$,onOpenRateLimitOptions:J,thinkingBlockId:`${H.uuid}:${Y}`,lastThinkingBlockId:W})));case"user":{if(H.isCompactSummary)return j1.createElement(cKD,{message:H,screen:X?"transcript":"prompt"});let C=0,Y=P===H.uuid,Z=j1.createElement(x,{flexDirection:"column",width:"100%"},H.message.content.map((q,O)=>{let j;if(q.type==="image")j=H.imagePasteIds?.[C],C++;return j1.createElement(SH1,{key:O,message:H,addMargin:A,tools:L,progressMessagesForMessage:f,param:q,style:G,verbose:D,imageIndex:j??C,isUserContinuation:Q,lookups:$,isTranscriptMode:X})}));return Y?j1.createElement(a_I,null,Z):Z}case"system":if(H.subtype==="compact_boundary")return j1.createElement(bKD,null);if(H.subtype==="microcompact_boundary")return null;if(H.subtype==="local_command")return j1.createElement(X9H,{addMargin:A,param:{type:"text",text:H.content},verbose:D});return j1.createElement(vKD,{message:H,addMargin:A,verbose:D});case"grouped_tool_use":return j1.createElement(gKD,{message:H,tools:L,lookups:$,inProgressToolUseIDs:B,shouldAnimate:E});case"collapsed_read_search":return j1.createElement(pKD,{message:H,inProgressToolUseIDs:B,shouldAnimate:E,verbose:D,tools:L,lookups:$,isActiveGroup:F})}}function SH1({message:H,addMargin:$,tools:A,progressMessagesForMessage:L,param:I,style:D,verbose:B,imageIndex:f,isUserContinuation:E,lookups:M,isTranscriptMode:G}){let{columns:U}=QL();switch(I.type){case"text":return j1.createElement(X9H,{addMargin:$,param:I,verbose:B,thinkingMetadata:H.thinkingMetadata,planContent:H.planContent,isTranscriptMode:G});case"image":return j1.createElement(j_$,{imageId:f,addMargin:$&&!E});case"tool_result":return j1.createElement($rI,{param:I,message:H,lookups:M,progressMessagesForMessage:L,style:D,tools:A,verbose:B,width:U-5});default:return}}function jH1({param:H,addMargin:$,tools:A,commands:L,verbose:I,inProgressToolUseIDs:D,progressMessagesForMessage:B,shouldAnimate:f,shouldShowDot:E,width:M,inProgressToolCallCount:G,isTranscriptMode:U,lookups:X,onOpenRateLimitOptions:J,thinkingBlockId:F,lastThinkingBlockId:Q}){switch(H.type){case"tool_use":return j1.createElement(BrI,{param:H,addMargin:$,tools:A,commands:L,verbose:I,inProgressToolUseIDs:D,progressMessagesForMessage:B,shouldAnimate:f,shouldShowDot:E,inProgressToolCallCount:G,lookups:X});case"text":return j1.createElement(jFD,{param:H,addMargin:$,shouldShowDot:E,width:M,onOpenRateLimitOptions:J});case"redacted_thinking":if(!U)return null;return j1.createElement(qKD,{addMargin:$});case"thinking":{if(!U)return null;return j1.createElement(R_$,{addMargin:$,param:H,isTranscriptMode:U,hideInTranscript:U&&!(!Q||F===Q)&&!0})}default:return r(Error(`Unable to render message type: ${H.type}`)),null}}function RH1(H,$){if(H.message.uuid!==$.message.uuid)return!1;if(H.lastThinkingBlockId!==$.lastThinkingBlockId)return!1;let A=H.latestBashOutputUUID===H.message.uuid,L=$.latestBashOutputUUID===$.message.uuid;if(A!==L)return!1;if(H.isStatic&&$.isStatic)return!0;return!1}var j1,Bz;var A6H=K(()=>{xH();_$();vA();ArI();frI();RFD();S_$();GZA();UZA();TKD();OB();SKD();hKD();kKD();uKD();mKD();dKD();DXA();lKD();j1=b(s(),1);Bz=j1.memo(xH1,RH1)});function iKD({agentType:H,description:$,descriptionColor:A,taskDescription:L,toolUseCount:I,tokens:D,color:B,isLast:f,isResolved:E,isError:M,isAsync:G=!1,shouldAnimate:U,lastToolInfo:X,hideType:J=!1}){let F=f?"\u2514\u2500":"\u251C\u2500",Q=G&&E,W=()=>{if(!E)return X||"Initializing\u2026";if(Q)return F1.createElement(V,null,L??"Running in the background"," ",F1.createElement(s$,{shortcut:"shift+\u2191",action:"manage",parens:!0}));return"Done"};return F1.createElement(x,{flexDirection:"column"},F1.createElement(x,{paddingLeft:3},F1.createElement(V,{dimColor:!E},F," ",J?F1.createElement(V,{bold:!0},$||H):F1.createElement(F1.Fragment,null,F1.createElement(V,{bold:!0,backgroundColor:B,color:B?"inverseText":void 0},H),$&&F1.createElement(F1.Fragment,null," (",F1.createElement(V,{backgroundColor:A,color:A?"inverseText":void 0},$),")")),!Q&&F1.createElement(F1.Fragment,null," \xB7 ",I," tool ",I===1?"use":"uses",D!==null&&F1.createElement(F1.Fragment,null," \xB7 ",a0(D)," tokens")))),F1.createElement(x,{paddingLeft:3,flexDirection:"row"},F1.createElement(V,{dimColor:!E},f?" ":"\u2502"),F1.createElement(HA,null,F1.createElement(V,{dimColor:!0},W()))))}var F1;var nKD=K(()=>{xH();Q9();iB();lB();F1=b(s(),1)});function aKD(H,$){let A=H.data.message;if(A.type==="assistant")return JyH(A.message.content[0],$);if(A.type==="user"){let L=A.message.content[0];if(L?.type==="tool_result"){let I=L.tool_use_id;for(let D of H.data.normalizedMessages)if(D.type==="assistant"){let B=D.message.content.find((f)=>f.type==="tool_use"&&f.id===I);if(B)return JyH(B,$)}}}return null}function vH1(H,$,A){return H.map((B)=>({type:"original",message:B}));function D(B){if(I&&(I.searchCount>0||I.readCount>0||I.replCount>0))L.push({type:"summary",searchCount:I.searchCount,readCount:I.readCount,replCount:I.replCount,uuid:`summary-${I.startUuid}`,isActive:B});I=null}}function AkH({prompt:H,dim:$=!1}){return kA.createElement(x,{flexDirection:"column"},kA.createElement(V,{color:"success",bold:!0},"Prompt:"),kA.createElement(x,{paddingLeft:2},kA.createElement(VJ,null,H)))}function JZA({content:H}){return kA.createElement(x,{flexDirection:"column"},kA.createElement(V,{color:"success",bold:!0},"Response:"),H.map(($,A)=>kA.createElement(x,{key:A,paddingLeft:2,marginTop:A===0?0:1},kA.createElement(VJ,null,$.text))))}function oKD(H,$,{tools:A,verbose:L,theme:I}){if(H.status==="async_launched"){let{prompt:Q}=H;return kA.createElement(x,{flexDirection:"column"},kA.createElement(HA,{height:1},kA.createElement(V,null,"Backgrounded agent",!L&&kA.createElement(V,{dimColor:!0}," (",kA.createElement(rA,null,kA.createElement(s$,{shortcut:"shift+\u2191",action:"manage"}),Q&&kA.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand"})),")"))),L&&Q&&kA.createElement(HA,null,kA.createElement(AkH,{prompt:Q,theme:I})))}if(H.status!=="completed")return null;let{agentId:D,totalDurationMs:B,totalToolUseCount:f,totalTokens:E,usage:M,content:G,prompt:U}=H,J=`Done (${[f===1?"1 tool use":`${f} tool uses`,a0(E)+" tokens",of(B)].join(" \xB7 ")})`,F=PT({content:J,usage:M});return kA.createElement(x,{flexDirection:"column"},!1,L&&U&&kA.createElement(HA,null,kA.createElement(AkH,{prompt:U,theme:I})),L?kA.createElement(dSH,null,$.map((Q)=>kA.createElement(HA,{key:Q.uuid},kA.createElement(Bz,{message:Q.data.message,lookups:Sh,addMargin:!1,tools:A,commands:[],verbose:L,inProgressToolUseIDs:new Set,progressMessagesForMessage:$,shouldAnimate:!1,shouldShowDot:!1,isTranscriptMode:!1,isStatic:!0})))):null,L&&G&&G.length>0&&kA.createElement(HA,null,kA.createElement(JZA,{content:G,theme:I})),kA.createElement(HA,{height:1},kA.createElement(Bz,{message:F,lookups:Sh,addMargin:!1,tools:A,commands:[],verbose:L,inProgressToolUseIDs:new Set,progressMessagesForMessage:[],shouldAnimate:!1,shouldShowDot:!1,isTranscriptMode:!1,isStatic:!0})))}function tKD({description:H,prompt:$}){if(v8())return null;if(!H||!$)return null;return H}function sKD(H){let $=[];if(H.resume)$.push(kA.createElement(x,{key:"resume",flexWrap:"nowrap",marginLeft:1},kA.createElement(V,{dimColor:!0},"resuming ",H.resume)));if(H.model){let A=m8(H.model),L=X1();if(A!==L)$.push(kA.createElement(x,{key:"model",flexWrap:"nowrap",marginLeft:1},kA.createElement(V,{dimColor:!0},hV(A))))}if($.length===0)return null;return kA.createElement(kA.Fragment,null,$)}function L6H(H,{tools:$,verbose:A,terminalSize:L,inProgressToolCallCount:I}){if(!H.length)return kA.createElement(HA,{height:1},kA.createElement(V,{dimColor:!0},kH1));let D=(I??1)*hH1+bH1,B=!A&&L&&L.rows&&L.rows{let X=H.filter((Q)=>{return Q.data.message.message.content.some((P)=>P.type==="tool_use")}).length,J=[...H].reverse().find((Q)=>Q.data.message.type==="assistant"),F=null;if(J?.data.message.type==="assistant"){let Q=J.data.message.message.usage;F=(Q.cache_creation_input_tokens??0)+(Q.cache_read_input_tokens??0)+Q.input_tokens+Q.output_tokens}return{toolUseCount:X,tokens:F}};if(B){let{toolUseCount:X,tokens:J}=f();return kA.createElement(HA,{height:1},kA.createElement(V,{dimColor:!0},"In progress\u2026 \xB7 ",kA.createElement(V,{bold:!0},X)," tool"," ",X===1?"use":"uses",J&&` \xB7 ${a0(J)} tokens`," \xB7"," ",kA.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand",parens:!0})))}let E=vH1(H,$,!0),M=A?E:E.slice(-yH1),G=E.length-M.length,U=H[0]?.data.prompt;return kA.createElement(HA,null,kA.createElement(x,{flexDirection:"column"},kA.createElement(dSH,null,A&&U&&kA.createElement(x,{marginBottom:1},kA.createElement(AkH,{prompt:U})),M.map((X)=>{if(X.type==="summary"){let J=kF$(X.searchCount,X.readCount,X.isActive,X.replCount);return kA.createElement(x,{key:X.uuid,height:1,overflow:"hidden"},kA.createElement(V,{dimColor:!0},J))}return kA.createElement(x,{key:X.message.uuid,height:1,overflow:"hidden"},kA.createElement(Bz,{message:X.message.data.message,lookups:Sh,addMargin:!1,tools:$,commands:[],verbose:A,inProgressToolUseIDs:new Set,progressMessagesForMessage:H,shouldAnimate:!1,shouldShowDot:!1,style:"condensed",isTranscriptMode:!1,isStatic:!0}))})),G>0&&kA.createElement(V,{dimColor:!0},"+",G," more tool ",G===1?"use":"uses"," ",kA.createElement(Bx,null))))}function eKD(H,{progressMessagesForMessage:$,tools:A,verbose:L}){let I=$[0]?.data?.agentId;return kA.createElement(kA.Fragment,null,!1,L6H($,{tools:A,verbose:L}),kA.createElement(L8,null))}function HQD(H,{progressMessagesForMessage:$,tools:A,verbose:L}){return kA.createElement(kA.Fragment,null,L6H($,{tools:A,verbose:L}),kA.createElement(s9,{result:H,verbose:L}))}function uH1(H){let $=H.filter((I)=>{let D=I.data.message;return D.type==="user"&&D.message.content.some((B)=>B.type==="tool_result")}).length,A=[...H].reverse().find((I)=>I.data.message.type==="assistant"),L=null;if(A?.data.message.type==="assistant"){let I=A.data.message.message.usage;L=(I.cache_creation_input_tokens??0)+(I.cache_read_input_tokens??0)+I.input_tokens+I.output_tokens}return{toolUseCount:$,tokens:L}}function $QD(H,$){if(v8())return null;let{shouldAnimate:A,tools:L}=$,I=H.map(({param:U,isResolved:X,isError:J,progressMessages:F,result:Q})=>{let W=uH1(F),P=gH1(F,L),C=QZA.safeParse(U.input),Y=Q?.output?.status==="teammate_spawned",Z,q,O,j,u;if(Y&&C.success&&C.data.name){Z=`@${C.data.name}`;let p=C.data.subagent_type;q=rKD(p)?p:void 0,u=C.data.description,j=rKD(p)?zBH(p):void 0}else Z=C.success?FZA(C.data):"Task",q=C.success?C.data.description:void 0,O=C.success?KZA(C.data):void 0,u=void 0;let y=C.success&&"run_in_background"in C.data&&C.data.run_in_background===!0,g=Q?.output?.status==="async_launched",h=y||g||Y;return{id:U.id,agentType:Z,description:q,toolUseCount:W.toolUseCount,tokens:W.tokens,isResolved:X,isError:J,isAsync:h,color:O,descriptionColor:j,lastToolInfo:P,taskDescription:u}}),D=H.some((U)=>!U.isResolved),B=H.some((U)=>U.isError),f=!D,E=I.length>0&&I.every((U)=>U.agentType===I[0]?.agentType),M=E?I[0]?.agentType:null,G=I.every((U)=>U.isAsync);return kA.createElement(x,{flexDirection:"column",marginTop:1},kA.createElement(x,{flexDirection:"row"},kA.createElement(mBH,{shouldAnimate:A&&D,isUnresolved:D,isError:B}),kA.createElement(V,null,f?kA.createElement(kA.Fragment,null,kA.createElement(V,{bold:!0},H.length)," ",M?`${M} agents`:"agents"," ",G?"launched":"finished"):kA.createElement(kA.Fragment,null,"Running ",kA.createElement(V,{bold:!0},H.length)," ",M?`${M} agents`:"agents","\u2026")," "),kA.createElement(Bx,null)),I.map((U,X)=>kA.createElement(iKD,{key:U.id,agentType:U.agentType,description:U.description,descriptionColor:U.descriptionColor,taskDescription:U.taskDescription,toolUseCount:U.toolUseCount,tokens:U.tokens,color:U.color,isLast:X===I.length-1,isResolved:U.isResolved,isError:U.isError,isAsync:U.isAsync,shouldAnimate:A,lastToolInfo:U.lastToolInfo,hideType:E})))}function FZA(H){if(H?.subagent_type&&H.subagent_type!==vyH.agentType){if(H.subagent_type==="worker")return"Task";return H.subagent_type}return"Task"}function KZA(H){if(!H?.subagent_type)return;return zBH(H.subagent_type)}function gH1(H,$){let A=0,L=0;for(let D=H.length-1;D>=0;D--){let B=H[D],f=aKD(B,$);if(f&&(f.isSearch||f.isRead)){if(B.data.message.type==="user"){if(f.isSearch)A++;else if(f.isRead)L++}}else break}if(A+L>=2)return kF$(A,L,!0);let I=[...H].reverse().find((D)=>{let B=D.data.message;return B.type==="user"&&B.message.content.some((f)=>f.type==="tool_result")});if(I?.data.message.type==="user"){let D=I.data.message.message.content.find((B)=>B.type==="tool_result");if(D?.type==="tool_result"){let B=D.tool_use_id,f=H.find((E)=>{let M=E.data.message;return M.type==="assistant"&&M.message.content.some((G)=>G.type==="tool_use"&&G.id===B)});if(f?.data.message.type==="assistant"){let E=f.data.message.message.content.find((M)=>M.type==="tool_use"&&M.id===B);if(E?.type==="tool_use"){let M=$.find((J)=>J.name===E.name);if(!M)return E.name;let G=E.input,U=M.inputSchema.safeParse(G),X=M.userFacingName(U.success?U.data:void 0);if(M.getToolUseSummary){let J=M.getToolUseSummary(U.success?U.data:void 0);if(J)return`${X}: ${J}`}return X}}}}return null}function rKD(H){return!!H&&H!==vyH.agentType&&H!=="worker"}var kA,yH1=3,hH1=9,bH1=7,kH1="Initializing\u2026";var v_$=K(()=>{xH();_F();j5();Q9();nx();iB();A6H();_L();L3A();w7();q7();lr();lB();j0();eB();pQ$();nKD();iK$();TQH();rD();hx();aI();kA=b(s(),1)});function AQD(H){let $=H.trim();if(!$.startsWith("/"))return null;let L=$.slice(1).split(" ");if(!L[0])return null;let I=L[0],D=!1,B=1;if(L.length>1&&L[1]==="(MCP)")I=I+" (MCP)",D=!0,B=2;let f=L.slice(B).join(" ");return{commandName:I,args:f,isMcp:D}}function h_$(H,$,A,L,I){let D=0;for(let B of TR){let f=A[B];if(!f)continue;for(let E of f)for(let M of E.hooks){let G=M.once?()=>{N(`Removing one-shot hook for event ${B} in skill '${L}'`),qPI(H,$,B,M)}:void 0;T4$(H,$,B,E.matcher||"",M,G,I),D++}}if(D>0)N(`Registered ${D} hooks from skill '${L}'`)}var WZA=K(()=>{KGH();pg();E$()});function b_$(H){let A=M$().skillUsage?.[H],L=Date.now(),I=(A?.usageCount??0)+1;if(!A||A.usageCount!==I||A.lastUsedAt!==L)AA((D)=>({...D,skillUsage:{...D.skillUsage,[H]:{usageCount:I,lastUsedAt:L}}}))}function k_$(H){let A=M$().skillUsage?.[H];if(!A)return 0;let L=(Date.now()-A.lastUsedAt)/86400000,I=Math.pow(0.5,L/7);return A.usageCount*Math.max(I,0.1)}var u_$=K(()=>{vA()});async function mH1(H,$,A,L,I,D){let B=hT();c("tengu_slash_command_forked",{command_name:H.name});let{skillContent:f,modifiedGetAppState:E,baseAgent:M,promptMessages:G}=await m_$(H,$,A),U=[],X=[];N(`Executing forked slash command /${H.name} with agent ${M.agentType}`);let J=[],F=`forked-command-${H.name}`,Q=0,W=(Z)=>{return Q++,{type:"progress",data:{message:Z,normalizedMessages:X,type:"agent_progress",prompt:f,agentId:B},parentToolUseID:F,toolUseID:`${F}-${Q}`,timestamp:new Date().toISOString(),uuid:IQD.randomUUID()}},P=()=>{I({jsx:L6H(J,{tools:A.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};P();try{for await(let Z of fz({agentDefinition:M,promptMessages:G,toolUseContext:{...A,getAppState:E},canUseTool:D,isAsync:!1,querySource:"agent:custom",model:H.model,availableTools:A.options.tools})){U.push(Z);let q=g5([Z]);if(X.push(...q),Z.type==="assistant"){let O=b4$(Z);if(O>0)A.setResponseLength((u)=>u+O);let j=q[0];if(j&&j.type==="assistant")J.push(W(Z)),P()}if(Z.type==="user"){let O=q[0];if(O&&O.type==="user")J.push(W(O)),P()}}}finally{I(null)}let C=p_$(U,"Command completed");return N(`Forked slash command /${H.name} completed with agent ${B}`),{messages:[R$({content:yP({inputString:`/${H.userFacingName()} ${$}`.trim(),precedingInputBlocks:L})}),R$({content:` Then start a tmux session with: tmux new-session -s claude`;case"linux":case"wsl":return`To use agent swarms, install tmux: Then start a tmux session with: tmux new-session -s claude`;case"windows":return`To use agent swarms, you need tmux which requires WSL (Windows Subsystem for Linux). Then start a tmux session with: tmux new-session -s claude`;default:return`To use agent swarms, install tmux using your system's package manager. Then start a tmux session with: tmux new-session -s claude`}}function aZA(H){switch(H){case"tmux":return DY$();case"iterm2":return GWD()}}function F6H(){return J6H}function Z$1(){return QkH()}function vh(){if(tI())return N("[BackendRegistry] isInProcessEnabled: true (non-interactive session)"),!0;let H=Z$1(),$;if(H==="in-process")$=!0;else if(H==="tmux")$=!1;else $=!e_$();return N(`[BackendRegistry] isInProcessEnabled: ${$} (mode=${H}, insideTmux=${e_$()})`),$}function UWD(){if(!LY$)LY$=pQD();return LY$}async function q$1(H=!1){if(H&&vh())return N("[BackendRegistry] Using in-process executor"),UWD();return N("[BackendRegistry] Using pane backend executor"),T$1()}async function T$1(){if(!IY$){let H=await Ut();IY$=tQD(H.backend),N(`[BackendRegistry] Created PaneBackendExecutor wrapping ${H.backend.type}`)}return IY$}function z$1(){J6H=null,Uz=null,LY$=null,IY$=null,iZA=!1}var J6H=null,Uz=null,iZA=!1,LY$=null,IY$=null,nZA=null,rZA=null;var jS=K(()=>{dQD();sQD();yh();E$();hZA();Z9();U6H();g$()});async function eZA(){if(!oZA)oZA=await Ut();return oZA.backend}function Rp(H){let $=tZA.get(H);if($)return $;let A=h5[sZA%h5.length];return tZA.set(H,A),sZA++,A}function JWD(){tZA.clear(),sZA=0}async function FWD(){let{isInsideTmux:H}=await Promise.resolve().then(() => (yh(),lQD));return H()}async function KWD(H,$){return(await eZA()).createTeammatePaneInSwarmView(H,$)}async function QWD(H,$=!1){return(await eZA()).enablePaneBorderStatus(H,$)}async function WWD(H,$,A=!1){return(await eZA()).sendCommandToPane(H,$,A)}var tZA,sZA=0,oZA=null;var WkH=K(()=>{q7();jS();tZA=new Map});function VWD({onDone:H,tmuxAvailable:$}){let[A,L]=K6H.useState("initial"),[I,D]=K6H.useState(null),[B,f]=K6H.useState(null),E=zB();K6H.useEffect(()=>{eQD().then((Z)=>{D(Z)})},[]);let M=y0.useCallback(()=>{H("cancelled")},[H]);BA("confirm:no",M,{context:"Confirmation",isActive:A!=="installing"&&A!=="verifying"}),WL((Z,q)=>{if(A==="api-instructions"&&q.return)L("verifying"),yZA().then((O)=>{if(O.success)vZA(),L("success"),setTimeout(()=>H("installed"),1500);else f(O.error||"Verification failed"),L("failed")})});async function G(){if(!I){f("No Python package manager found (uvx, pipx, or pip)"),L("failed");return}L("installing");let Z=await HWD(I);if(Z.success)L("api-instructions");else f(Z.error||"Installation failed"),L("install-failed")}function U(){AWD(!0),H("use-tmux")}let X=()=>{switch(A){case"initial":return J();case"installing":return F();case"install-failed":return Q();case"api-instructions":return W();case"verifying":return P();case"success":return C();case"failed":return Y();default:return null}};function J(){let Z=[{label:"Install it2 now",value:"install",description:I?`Uses ${I} to install the it2 CLI tool`:"Requires Python (uvx, pipx, or pip)"}];if($)Z.push({label:"Use tmux instead",value:"tmux",description:"Opens teammates in a separate tmux session"});return Z.push({label:"Cancel",value:"cancel",description:"Skip teammate spawning for now"}),y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,null,"To use native iTerm2 split panes for teammates, you need the"," ",y0.default.createElement(V,{bold:!0},"it2")," CLI tool."),y0.default.createElement(V,{dimColor:!0},"This enables teammates to appear as split panes within your current window."),y0.default.createElement(x,{marginTop:1},y0.default.createElement(QA,{options:Z,onChange:(q)=>{switch(q){case"install":G();break;case"tmux":U();break;case"cancel":H("cancelled");break}},onCancel:()=>H("cancelled")})))}function F(){return y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(x,null,y0.default.createElement(vD,null),y0.default.createElement(V,null," Installing it2 using ",I,"\u2026")),y0.default.createElement(V,{dimColor:!0},"This may take a moment."))}function Q(){let Z=[{label:"Try again",value:"retry",description:"Retry the installation"}];if($)Z.push({label:"Use tmux instead",value:"tmux",description:"Falls back to tmux for teammate panes"});return Z.push({label:"Cancel",value:"cancel",description:"Skip teammate spawning for now"}),y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,{color:"error"},"Installation failed"),B&&y0.default.createElement(V,{dimColor:!0},B),y0.default.createElement(V,{dimColor:!0},"You can try installing manually:"," ",I==="uvx"?"uv tool install it2":I==="pipx"?"pipx install it2":"pip install --user it2"),y0.default.createElement(x,{marginTop:1},y0.default.createElement(QA,{options:Z,onChange:(q)=>{switch(q){case"retry":G();break;case"tmux":U();break;case"cancel":H("cancelled");break}},onCancel:()=>H("cancelled")})))}function W(){let Z=$WD();return y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,{color:"success"},"\u2713 it2 installed successfully"),y0.default.createElement(x,{flexDirection:"column",marginTop:1},Z.map((q,O)=>y0.default.createElement(V,{key:O},q))),y0.default.createElement(x,{marginTop:1},y0.default.createElement(V,{dimColor:!0},"Press Enter when ready to verify\u2026")))}function P(){return y0.default.createElement(x,null,y0.default.createElement(vD,null),y0.default.createElement(V,null," Verifying it2 can communicate with iTerm2\u2026"))}function C(){return y0.default.createElement(x,{flexDirection:"column"},y0.default.createElement(V,{color:"success"},"\u2713 iTerm2 split pane support is ready"),y0.default.createElement(V,{dimColor:!0},"Teammates will now appear as split panes."))}function Y(){let Z=[{label:"Try again",value:"retry",description:"Verify the connection again"}];if($)Z.push({label:"Use tmux instead",value:"tmux",description:"Falls back to tmux for teammate panes"});return Z.push({label:"Cancel",value:"cancel",description:"Skip teammate spawning for now"}),y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,{color:"error"},"Verification failed"),B&&y0.default.createElement(V,{dimColor:!0},B),y0.default.createElement(V,null,"Make sure:"),y0.default.createElement(x,{flexDirection:"column",paddingLeft:2},y0.default.createElement(V,null,"\u2022 Python API is enabled in iTerm2 preferences"),y0.default.createElement(V,null,"\u2022 You may need to restart iTerm2 after enabling")),y0.default.createElement(x,{marginTop:1},y0.default.createElement(QA,{options:Z,onChange:(q)=>{switch(q){case"retry":L("verifying"),yZA().then((O)=>{if(O.success)vZA(),L("success"),setTimeout(()=>H("installed"),1500);else f(O.error||"Verification failed"),L("failed")});break;case"tmux":U();break;case"cancel":H("cancelled");break}},onCancel:()=>H("cancelled")})))}return y0.default.createElement(x,{flexDirection:"column"},y0.default.createElement(Uf,{dividerColor:"permission"}),y0.default.createElement(x,{marginX:1,flexDirection:"column",gap:1,paddingBottom:1},y0.default.createElement(V,{bold:!0,color:"permission"},"iTerm2 Split Pane Setup"),X(),A!=="installing"&&A!=="verifying"&&A!=="success"&&y0.default.createElement(V,{dimColor:!0,italic:!0},E.pending?y0.default.createElement(y0.default.Fragment,null,"Press ",E.keyName," again to exit"):y0.default.createElement(y0.default.Fragment,null,"Esc to cancel"))))}var y0,K6H;var PWD=K(()=>{xH();UM();$I();l8();JM();e6();hZA();y0=b(s(),1),K6H=b(s(),1)});async function N$1(H){return(await jA(q3,["has-session","-t",H])).code===0}async function O$1(H){if(!await N$1(H)){let A=await jA(q3,["new-session","-d","-s",H]);if(A.code!==0)throw Error(`Failed to create tmux session '${H}': ${A.stderr||"Unknown error"}`)}}function YWD(H){return H.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()}function $qA(H){return H.replace(/@/g,"-")}function CWD(){if(process.env[t7H])return process.env[t7H];return U8()?process.execPath:process.argv[1]}function wWD(H){let $=[],{planModeRequired:A,permissionMode:L}=H||{};if(A);else if(L==="bypassPermissions"||Gk())$.push("--dangerously-skip-permissions");else if(L==="acceptEdits")$.push("--permission-mode acceptEdits");let I=C_();if(I)$.push(`--model ${wI([I])}`);let D=xc();if(D)$.push(`--settings ${wI([D])}`);let B=YHH();for(let f of B)$.push(`--plugin-dir ${wI([f])}`);return $.join(" ")}function ZWD(H){return BY$.join(P6(),YWD(H))}function Y9H(H){let $=BY$.join(ZWD(H),"config.json");if(!Q6H.existsSync($))return null;try{let A=Q6H.readFileSync($,"utf-8");return DA(A)}catch(A){return N(`[spawnTeammate] Failed to read team file for ${H}: ${A instanceof Error?A.message:String(A)}`),null}}function AqA(H,$){let A=ZWD(H);Q6H.mkdirSync(A,{recursive:!0});let L=BY$.join(A,"config.json");iL(L,yH($,null,2))}function LqA(H,$){if(!$)return H;let A=Y9H($);if(!A)return H;let L=new Set(A.members.map((D)=>D.name.toLowerCase()));if(!L.has(H.toLowerCase()))return H;let I=2;while(L.has(`${H}-${I}`.toLowerCase()))I++;return`${H}-${I}`}async function x$1(H,$){let{setAppState:A,getAppState:L}=$,{name:I,prompt:D,agent_type:B,cwd:f,plan_mode_required:E}=H,M=H.model??HqA;if(!I||!D)throw Error("name and prompt are required for spawn operation");let G=await L(),U=H.team_name||G.teamContext?.teamName;if(!U)throw Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context.");let X=LqA(I,U),J=$qA(X),F=_w(J,U),Q=f||C$(),W=await Ut();if(W.needsIt2Setup&&$.setToolJSX){let d=await Mt(),k=await new Promise((n)=>{$.setToolJSX({jsx:_WD.default.createElement(VWD,{onDone:n,tmuxAvailable:d}),shouldHidePromptInput:!0})});if($.setToolJSX(null),k==="cancelled")throw Error("Teammate spawn cancelled - iTerm2 setup required");if(k==="installed"){let{resetBackendDetection:n}=await Promise.resolve().then(() => (jS(),XWD));n()}}let P=await FWD(),C=Rp(F),{paneId:Y,isFirstTeammate:Z}=await KWD(J,C);if(Z&&P)await QWD();let q=CWD(),O=[`--agent-id ${wI([F])}`,`--agent-name ${wI([J])}`,`--team-name ${wI([U])}`,`--agent-color ${wI([C])}`,`--parent-session-id ${wI([j$()])}`,E?"--plan-mode-required":"",B?`--agent-type ${wI([B])}`:""].filter(Boolean).join(" "),j=wWD({planModeRequired:E,permissionMode:G.toolPermissionContext.mode});if(M)j=j.split(" ").filter((d,k,n)=>d!=="--model"&&n[k-1]!=="--model").join(" "),j=j?`${j} --model ${wI([M])}`:`--model ${wI([M])}`;let u=j?` ${j}`:"",y=`cd ${wI([Q])} && CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 ${wI([q])} ${O}${u}`;await WWD(Y,y,!P);let g=P?"current":eY,h=P?"current":"swarm-view";A((d)=>({...d,teamContext:{...d.teamContext,teamName:U??d.teamContext?.teamName??"default",teamFilePath:d.teamContext?.teamFilePath??"",leadAgentId:d.teamContext?.leadAgentId??"",teammates:{...d.teamContext?.teammates||{},[F]:{name:J,agentType:B,color:C,tmuxSessionName:g,tmuxPaneId:Y,cwd:Q,spawnedAt:Date.now()}}}})),qWD(A,{teammateId:F,sanitizedName:J,teamName:U,teammateColor:C,prompt:D,plan_mode_required:E,paneId:Y,insideTmux:P});let p=Y9H(U);if(!p)throw Error(`Team "${U}" does not exist. Call spawnTeam first to create the team.`);return p.members.push({agentId:F,name:J,agentType:B,model:M,prompt:D,color:C,planModeRequired:E,joinedAt:Date.now(),tmuxPaneId:Y,cwd:Q,subscriptions:[],backendType:W.backend.type}),AqA(U,p),K8(J,{from:kE,text:D,timestamp:new Date().toISOString()},U),{data:{teammate_id:F,agent_id:F,agent_type:B,model:M,name:J,color:C,tmux_session_name:g,tmux_window_name:h,tmux_pane_id:Y,team_name:U,is_splitpane:!0,plan_mode_required:E}}}async function S$1(H,$){let{setAppState:A,getAppState:L}=$,{name:I,prompt:D,agent_type:B,cwd:f,plan_mode_required:E}=H,M=H.model??HqA;if(!I||!D)throw Error("name and prompt are required for spawn operation");let G=await L(),U=H.team_name||G.teamContext?.teamName;if(!U)throw Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context.");let X=LqA(I,U),J=$qA(X),F=_w(J,U),Q=`teammate-${YWD(J)}`,W=f||C$();await O$1(eY);let P=Rp(F),C=await jA(q3,["new-window","-t",eY,"-n",Q,"-P","-F","#{pane_id}"]);if(C.code!==0)throw Error(`Failed to create tmux window: ${C.stderr}`);let Y=C.stdout.trim(),Z=CWD(),q=[`--agent-id ${wI([F])}`,`--agent-name ${wI([J])}`,`--team-name ${wI([U])}`,`--agent-color ${wI([P])}`,`--parent-session-id ${wI([j$()])}`,E?"--plan-mode-required":"",B?`--agent-type ${wI([B])}`:""].filter(Boolean).join(" "),O=wWD({planModeRequired:E,permissionMode:G.toolPermissionContext.mode});if(M)O=O.split(" ").filter((h,p,d)=>h!=="--model"&&d[p-1]!=="--model").join(" "),O=O?`${O} --model ${wI([M])}`:`--model ${wI([M])}`;let j=O?` ${O}`:"",u=`cd ${wI([W])} && CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 ${wI([Z])} ${q}${j}`,y=await jA(q3,["send-keys","-t",`${eY}:${Q}`,u,"Enter"]);if(y.code!==0)throw Error(`Failed to send command to tmux window: ${y.stderr}`);A((h)=>({...h,teamContext:{...h.teamContext,teamName:U??h.teamContext?.teamName??"default",teamFilePath:h.teamContext?.teamFilePath??"",leadAgentId:h.teamContext?.leadAgentId??"",teammates:{...h.teamContext?.teammates||{},[F]:{name:J,agentType:B,color:P,tmuxSessionName:eY,tmuxPaneId:Y,cwd:W,spawnedAt:Date.now()}}}})),qWD(A,{teammateId:F,sanitizedName:J,teamName:U,teammateColor:P,prompt:D,plan_mode_required:E,paneId:Y,insideTmux:!1});let g=Y9H(U);if(!g)throw Error(`Team "${U}" does not exist. Call spawnTeam first to create the team.`);return g.members.push({agentId:F,name:J,agentType:B,model:M,prompt:D,color:P,planModeRequired:E,joinedAt:Date.now(),tmuxPaneId:Y,cwd:W,subscriptions:[],backendType:"tmux"}),AqA(U,g),K8(J,{from:kE,text:D,timestamp:new Date().toISOString()},U),{data:{teammate_id:F,agent_id:F,agent_type:B,model:M,name:J,color:P,tmux_session_name:eY,tmux_window_name:Q,tmux_pane_id:Y,team_name:U,is_splitpane:!1,plan_mode_required:E}}}function qWD(H,{teammateId:$,sanitizedName:A,teamName:L,teammateColor:I,prompt:D,plan_mode_required:B,paneId:f,insideTmux:E}){let M=Zm("in_process_teammate"),G=`${A}: ${D.substring(0,50)}${D.length>50?"...":""}`,U=new AbortController,X={...wP(M,"in_process_teammate",G),type:"in_process_teammate",status:"running",identity:{agentId:$,agentName:A,teamName:L,color:I,planModeRequired:B??!1,parentSessionId:j$()},prompt:D,abortController:U,awaitingPlanApproval:!1,permissionMode:B?"plan":"default",isIdle:!1,shutdownRequested:!1,lastReportedToolCount:0,lastReportedTokenCount:0,pendingUserMessages:[]};qP(X,H),U.signal.addEventListener("abort",()=>{let F=!E?["-L",o7H(),"kill-pane","-t",f]:["kill-pane","-t",f];jA(q3,F)})}async function j$1(H,$){let{setAppState:A,getAppState:L}=$,{name:I,prompt:D,agent_type:B,plan_mode_required:f}=H,E=H.model??HqA;if(!I||!D)throw Error("name and prompt are required for spawn operation");let M=await L(),G=H.team_name||M.teamContext?.teamName;if(!G)throw Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context.");let U=LqA(I,G),X=$qA(U),J=_w(X,G),F=Rp(J),Q;if(B){let Z=$.options.agentDefinitions.activeAgents.find((q)=>q.agentType===B);if(Z&&rK$(Z))Q=Z;N(`[handleSpawnInProcess] agent_type=${B}, found=${!!Q}`)}let P=await S7H({name:X,teamName:G,prompt:D,color:F,planModeRequired:f??!1,model:E},$);if(!P.success)throw Error(P.error??"Failed to spawn in-process teammate");if(N(`[handleSpawnInProcess] spawn result: taskId=${P.taskId}, hasContext=${!!P.teammateContext}, hasAbort=${!!P.abortController}`),P.taskId&&P.teammateContext&&P.abortController)s_$({identity:{agentId:J,agentName:X,teamName:G,color:F,planModeRequired:f??!1,parentSessionId:P.teammateContext.parentSessionId},taskId:P.taskId,prompt:D,description:H.description,agentDefinition:Q,teammateContext:P.teammateContext,toolUseContext:$,abortController:P.abortController}),N(`[handleSpawnInProcess] Started agent execution for ${J}`);A((Y)=>{let Z=!Y.teamContext?.leadAgentId,q=Z?_w(kE,G):Y.teamContext.leadAgentId,O=Y.teamContext?.teammates||{},j=Z?{[q]:{name:kE,agentType:kE,color:Rp(q),tmuxSessionName:"in-process",tmuxPaneId:"leader",cwd:C$(),spawnedAt:Date.now()}}:{};return{...Y,teamContext:{...Y.teamContext,teamName:G??Y.teamContext?.teamName??"default",teamFilePath:Y.teamContext?.teamFilePath??"",leadAgentId:q,teammates:{...O,...j,[J]:{name:X,agentType:B,color:F,tmuxSessionName:"in-process",tmuxPaneId:"in-process",cwd:C$(),spawnedAt:Date.now()}}}}});let C=Y9H(G);if(!C)throw Error(`Team "${G}" does not exist. Call spawnTeam first to create the team.`);return C.members.push({agentId:J,name:X,agentType:B,model:E,prompt:D,color:F,planModeRequired:f,joinedAt:Date.now(),tmuxPaneId:"in-process",cwd:C$(),subscriptions:[],backendType:"in-process"}),AqA(G,C),{data:{teammate_id:J,agent_id:J,agent_type:B,model:E,name:X,color:F,tmux_session_name:"in-process",tmux_window_name:"in-process",tmux_pane_id:"in-process",team_name:G,is_splitpane:!1,plan_mode_required:f}}}async function R$1(H,$){if(vh())return j$1(H,$);if(H.use_splitpane!==!1)return x$1(H,$);return S$1(H,$)}async function TWD(H,$){return R$1(H,$)}var BY$,Q6H,_WD,HqA;var IqA=K(()=>{NA();Z$();WkH();B0();EX();PI();sU();E$();jS();xP$();xZA();yh();PWD();g$();$4H();Z$();kT();KBH();bx();BY$=require("path"),Q6H=require("fs"),_WD=b(s(),1),HqA=wAH.firstParty});function p$1(H){let $=0,A=g5(H);for(let L of A)if(L.type==="assistant"){for(let I of L.message.content)if(I.type==="tool_use")$++}return $}function BqA(H,$,A){let{prompt:L,resolvedAgentModel:I,isBuiltInAgent:D,startTime:B,agentType:f}=A,E=$C(H);if(E===void 0)throw Error("No assistant messages found");let M=E.message.content.filter((X)=>X.type==="text"),G=kSH(E.message.usage),U=p$1(H);return c("tengu_agent_tool_completed",{agent_type:f,model:I,prompt_char_count:L.length,response_char_count:M.length,assistant_message_count:H.length,total_tool_uses:U,duration_ms:Date.now()-B,total_tokens:G,is_built_in_agent:D}),{agentId:$,content:M,totalDurationMs:Date.now()-B,totalTokens:G,totalToolUseCount:U,usage:E.message.usage}}function d$1(H,$){if(!dL())return;return H.team_name||$.teamContext?.teamName}var EqA,y$1=2000,fY$,v$1="Optional model to use for this agent. If not specified, inherits from parent. Prefer haiku for quick, straightforward tasks to minimize cost and latency.",h$1,b$1,zWD,QZA,k$1,u$1,g$1,m$1,qQH;var iK$=K(()=>{SHH();mI();yW();XJ();_L();thI();q7();aI();lG();NA();T8();z$();ft();$3();_L();v_$();oa();YP();kT();OBH();tG();YZA();dx();rB();ZZA();E$();Ow();tjH();CQD();XE();IqA();h2();g7();EqA=b(s(),1),fY$=A$(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS),h$1=S.object({description:S.string().describe("A short (3-5 word) description of the task"),prompt:S.string().describe("The task for the agent to perform"),subagent_type:S.string().describe("The type of specialized agent to use for this task"),model:S.enum(["sonnet","opus","haiku"]).optional().describe(v$1),resume:S.string().optional().describe("Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript."),run_in_background:S.boolean().optional().describe(`Set to true to run this agent in the background. The tool result will include an output_file path - use ${$B} tool or ${WD} tail to check on output.`),max_turns:S.number().int().positive().optional().describe("Maximum number of agentic turns (API round-trips) before stopping. Used internally for warmup.")}),b$1=S.object({name:S.string().optional().describe("Name for the spawned agent"),team_name:S.string().optional().describe("Team name for spawning. Uses current team context if omitted."),mode:o0L.optional().describe('Permission mode for spawned teammate (e.g., "plan" to require plan approval).')}),zWD=h$1.merge(b$1),QZA=fY$?zWD.omit({run_in_background:!0}):zWD,k$1=S.object({agentId:S.string(),content:S.array(S.object({type:S.literal("text"),text:S.string()})),totalToolUseCount:S.number(),totalDurationMs:S.number(),totalTokens:S.number(),usage:S.object({input_tokens:S.number(),output_tokens:S.number(),cache_creation_input_tokens:S.number().nullable(),cache_read_input_tokens:S.number().nullable(),server_tool_use:S.object({web_search_requests:S.number(),web_fetch_requests:S.number()}).nullable(),service_tier:S.enum(["standard","priority","batch"]).nullable(),cache_creation:S.object({ephemeral_1h_input_tokens:S.number(),ephemeral_5m_input_tokens:S.number()}).nullable()})}),u$1=k$1.extend({status:S.literal("completed"),prompt:S.string()}),g$1=S.object({status:S.literal("async_launched"),agentId:S.string().describe("The ID of the async agent"),description:S.string().describe("The description of the task"),prompt:S.string().describe("The prompt for the agent"),outputFile:S.string().describe("Path to the output file for checking agent progress")}),m$1=S.union([u$1,g$1,$bI]);qQH={async prompt({agents:H,tools:$,getToolPermissionContext:A,allowedAgentTypes:L}){let I=await A(),D=[];for(let M of $)if(M.name?.startsWith("mcp__")){let U=M.name.split("__")[1];if(U&&!D.includes(U))D.push(U)}let B=FbI(H,D),f=fqA(B,I,E0);return await ohI(f,!1,L)},name:E0,maxResultSizeChars:1e5,async description(){return"Launch a new task"},inputSchema:QZA,outputSchema:m$1,async call({prompt:H,subagent_type:$,description:A,model:L,resume:I,run_in_background:D,max_turns:B,name:f,team_name:E,mode:M},G,U,X,J){let F=Date.now(),Q=await G.getAppState(),W=Q.toolPermissionContext.mode;if(E&&!dL())throw Error("Agent Teams is not yet available on your plan.");let P=d$1({team_name:E},Q);if(oW()&&P){if(f)throw Error("In-process teammates cannot spawn other teammates. Only the team leader can spawn teammates.");if(D===!0)throw Error("In-process teammates cannot spawn background agents. Use run_in_background=false for synchronous subagents.")}if(P&&f){if($){let WH=G.options.agentDefinitions.activeAgents.find((wH)=>wH.agentType===$);if(WH?.color)NBH($,WH.color)}let HH=await TWD({name:f,prompt:H,description:A,team_name:P,use_splitpane:!0,plan_mode_required:M==="plan",model:L,agent_type:$},G);return{data:{status:"teammate_spawned",prompt:H,...HH.data}}}let C=G.options.agentDefinitions.activeAgents,{allowedAgentTypes:Y}=G.options.agentDefinitions,Z=fqA(Y?C.filter((HH)=>Y.includes(HH.agentType)):C,Q.toolPermissionContext,E0),q=Z.find((HH)=>HH.agentType===$);if(!q){if(C.find((BH)=>BH.agentType===$)){let BH=MqA(Q.toolPermissionContext,E0,$);throw Error(`Agent type '${$}' has been denied by permission rule '${E0}(${$})' from ${BH?.source??"settings"}.`)}throw Error(`Agent type '${$}' not found. Available agents: ${Z.map((BH)=>BH.agentType).join(", ")}`)}if(q.requiredMcpServers?.length){let HH=[];for(let BH of Q.mcp.tools)if(BH.name?.startsWith("mcp__")){let wH=BH.name.split("__")[1];if(wH&&!HH.includes(wH))HH.push(wH)}if(!E3A(q,HH)){let BH=q.requiredMcpServers.filter((WH)=>!HH.some((wH)=>wH.toLowerCase().includes(WH.toLowerCase())));throw Error(`Agent '${$}' requires MCP servers matching: ${BH.join(", ")}. MCP servers with tools: ${HH.length>0?HH.join(", "):"none"}. Use /mcp to configure and authenticate the required MCP servers.`)}}if(q.color)NBH($,q.color);let O=j9$(q.model,G.options.mainLoopModel,L,W,q.agentType);c("tengu_agent_tool_selected",{agent_type:q.agentType,model:O,source:q.source,color:q.color,is_built_in_agent:TK(q)});let j;if(I){let HH=Q.tasks[I];if(HH&&HH.status==="running")throw Error(`Cannot resume agent ${I}: it is still running. Use TaskStop to stop it first, or wait for it to complete.`);let BH=await B6H(ZP(I));if(!BH)throw Error(`No transcript found for agent ID: ${I}`);j=PkH(_kH(GY$(BH)))}let u=q?.forkContext?G.messages:void 0,y;try{let HH=Array.from(Q.toolPermissionContext.additionalWorkingDirectories.keys()),BH=q.getSystemPrompt({toolUseContext:G});if(q.memory)c("tengu_agent_memory_loaded",{...{},scope:q.memory,isMainLoopAgent:!1});y=await IkH([BH],O,HH)}catch(HH){N(`Failed to get system prompt for agent ${q.agentType}: ${HH instanceof Error?HH.message:String(HH)}`)}let g=q?.forkContext?AbI(H,X):[R$({content:H})],h={prompt:H,resolvedAgentModel:O,isBuiltInAgent:TK(q),startTime:F,agentType:q.agentType},p=!1,d=(D===!0||p)&&!fY$,k={...Q.toolPermissionContext,mode:q.permissionMode??"acceptEdits"},n=EY$(k,Q.mcp.tools),GH={agentDefinition:q,promptMessages:j?[...j,...g]:g,toolUseContext:G,canUseTool:U,forkContextMessages:u,isAsync:d,...p?{canShowPermissionPrompts:!0}:{},querySource:G.options.querySource??UQD(q.agentType,TK(q)),model:L,maxTurns:B,override:y?{systemPrompt:y}:void 0,availableTools:n};if(d){let HH=I||hT(),BH=VyI({agentId:HH,description:A,prompt:H,selectedAgent:q,setAppState:G.setAppState,parentAbortController:G.abortController}),WH={agentId:HH,parentSessionId:Xn(),agentType:"subagent",subagentName:q.agentType,isBuiltIn:TK(q)};return WKH(WH,async()=>{let wH;try{let QH=[],TH=FyH(),t=QyH(G.options.tools);for await(let MH of fz({...GH,override:{...GH.override,agentId:ZP(BH.agentId),abortController:BH.abortController},onCacheSafeParams:p?(CH)=>{let{stop:OH}=YQD(BH.agentId,ZP(BH.agentId),CH,G.setAppState);wH=OH}:void 0}))QH.push(MH),GQH(TH,MH,t,G.options.tools),m7A(BH.agentId,KyH(TH),G.setAppState);wH?.();let IH=BqA(QH,BH.agentId,h),KH=IH.content.filter((MH)=>MH.type==="text").map((MH)=>MH.text).join(` IMPORTANT: Do not update the env unless explicitly instructed to do so.`,errorCode:10};return null}var N6D=K(()=>{xd$();BM()});function _t(H,$,A){return}function x6D(H){let $=H.find((A)=>A.name==="claude-vscode");if($&&$.type==="connected"){O6D=$,$.client.setNotificationHandler(iA1,async(L)=>{let{eventName:I,eventData:D}=L.params;c(`tengu_vscode_${I}`,D)});let A={tengu_vscode_review_upsell:cf("tengu_vscode_review_upsell"),tengu_vscode_onboarding:cf("tengu_vscode_onboarding"),tengu_quiet_fern:NL("tengu_quiet_fern",!1),tengu_penguins_enabled:NL("tengu_penguins_enabled",!1)};$.client.notification({method:"experiment_gates",params:{gates:A}})}}var iA1,O6D=null;var N6H=K(()=>{mI();z$();SD();E$();iA1=S.object({method:S.literal("log_event"),params:S.object({eventName:S.string(),eventData:S.object({}).passthrough()})})});function gE(){if(tI())return nA1();return M$().fileCheckpointingEnabled!==!1&&!A$(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING)}function nA1(){return A$(process.env.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING)&&!A$(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING)}async function Ct(H,$,A){if(!gE())return;H((L)=>{try{let I=L.snapshots.at(-1);if(!I)return r(Error("FileHistory: Missing most recent snapshot")),c("tengu_file_history_track_edit_failed",{}),L;let D=h6D($);if(I.trackedFileBackups[D])return L;let B=L.trackedFiles.has(D)?L.trackedFiles:new Set(L.trackedFiles).add(D),E=!zH().existsSync($),M=E?dqA(null,1):dqA($,1),G=THH(I);G.trackedFileBackups[D]=M;let U={...L,snapshots:[...L.snapshots.slice(0,-1),G],trackedFiles:B};return b6D(U),OkH(A,G,!0).catch((X)=>{r(Error(`FileHistory: Failed to record snapshot: ${X}`))}),c("tengu_file_history_track_edit_success",{isNewFile:E,version:M.version}),N(`FileHistory: Tracked file modification for ${$}`),U}catch(I){return r(I),c("tengu_file_history_track_edit_failed",{}),L}})}async function O6H(H,$){if(!gE())return;H((A)=>{try{let L=zH(),I=new Date,D={},B=A.snapshots.at(-1);if(B){N(`FileHistory: Making snapshot for message ${$}`);for(let M of A.trackedFiles)try{let G=lqA(M);if(!L.existsSync(G)){let U=B.trackedFileBackups[M],X=U?U.version+1:1;D[M]={backupFileName:null,version:X,backupTime:new Date},c("tengu_file_history_backup_deleted_file",{version:X}),N(`FileHistory: Missing tracked file: ${M}`)}else{let U=B.trackedFileBackups[M];if(U&&U.backupFileName!==null&&!v6D(G,U.backupFileName)){D[M]=U;continue}let X=U?U.version+1:1,J=dqA(G,X);D[M]=J}}catch(G){r(G),c("tengu_file_history_backup_file_failed",{})}}let f={messageId:$,trackedFileBackups:D,timestamp:I},E={...A,snapshots:[...A.snapshots,f]};return b6D(E),tA1(A,E),OkH($,f,!1).catch((M)=>{r(Error(`FileHistory: Failed to record snapshot: ${M}`))}),N(`FileHistory: Added snapshot for ${$}, tracking ${A.trackedFiles.size} files`),c("tengu_file_history_snapshot_success",{trackedFilesCount:A.trackedFiles.size,snapshotCount:E.snapshots.length}),E}catch(L){return r(L),c("tengu_file_history_snapshot_failed",{}),A}})}async function RY$(H,$){if(!gE())return;let A=null;if(H((L)=>{let I=L;try{let D=L.snapshots.findLast((f)=>f.messageId===$);if(!D)return r(Error(`FileHistory: Snapshot for ${$} not found`)),c("tengu_file_history_rewind_failed",{trackedFilesCount:I.trackedFiles.size,snapshotFound:!1}),A=Error("The selected snapshot was not found"),I;N(`FileHistory: [Rewind] Rewinding to snapshot for ${$}`);let B=y6D(I,D,!1);N(`FileHistory: [Rewind] Finished rewinding to ${$}`),c("tengu_file_history_rewind_success",{trackedFilesCount:I.trackedFiles.size,filesChangedCount:B?.filesChanged?.length})}catch(D){A=D,r(D),c("tengu_file_history_rewind_failed",{trackedFilesCount:I.trackedFiles.size,snapshotFound:!0})}return I}),A)throw A}function yY$(H,$){if(!gE())return!1;return H.snapshots.some((A)=>A.messageId===$)}function vY$(H,$){if(!gE())return;let A=H.snapshots.findLast((L)=>L.messageId===$);if(!A)return;return y6D(H,A,!0)}function y6D(H,$,A){let L=zH(),I=[],D=0,B=0;for(let f of H.trackedFiles)try{let E=lqA(f),M=$.trackedFileBackups[f],G=M?M.backupFileName:oA1(f,H);if(G===void 0)r(Error("FileHistory: Error finding the backup file to apply")),c("tengu_file_history_rewind_restore_file_failed",{dryRun:A});else if(G===null){if(L.existsSync(E)){if(A){let U=S6D(E,void 0);D+=U?.insertions||0,B+=U?.deletions||0}else L.unlinkSync(E),N(`FileHistory: [Rewind] Deleted ${E}`);I.push(E)}}else if(A){let U=S6D(E,G);if(D+=U?.insertions||0,B+=U?.deletions||0,U?.insertions||U?.deletions)I.push(E)}else if(v6D(E,G))aA1(E,G),N(`FileHistory: [Rewind] Restored ${E} from ${G}`),I.push(E)}catch(E){r(E),c("tengu_file_history_rewind_restore_file_failed",{dryRun:A})}return{filesChanged:I,insertions:D,deletions:B}}function v6D(H,$){let A=zH(),L=Yt($);try{let I=A.existsSync(H),D=A.existsSync(L);if(I!==D)return!0;else if(!I)return!1;let B=A.statSync(H),f=A.statSync(L);if(B.mode!==f.mode||B.size!==f.size)return!0;if(B.mtimeMs{if(X.added)L+=X.count||0;if(X.removed)I+=X.count||0})}catch(D){r(Error(`FileHistory: Error generating diffStats: ${D}`))}return{filesChanged:A,insertions:L,deletions:I}}function rA1(H,$){return`${j6D.createHash("sha256").update(H).digest("hex").slice(0,16)}@v${$}`}function Yt(H,$){let A=UL();return Xz.join(A,"file-history",$||j$(),H)}function dqA(H,$){let A=H!==null?rA1(H,$):null;if(H&&A){let L=zH(),I=Yt(A),D=Xz.dirname(I);if(!L.existsSync(D))L.mkdirSync(D);let B=L.readFileSync(H,{encoding:"utf-8"});iL(I,B,{encoding:"utf-8",flush:!0});let f=L.statSync(H),E=f.mode;cqA.chmodSync(I,E),c("tengu_file_history_backup_file_created",{version:$,fileSize:f.size})}return{backupFileName:A,version:$,backupTime:new Date}}function aA1(H,$){let A=zH(),L=Yt($);if(!A.existsSync(L)){c("tengu_file_history_rewind_restore_file_failed",{}),r(Error(`FileHistory: [Rewind] Backup file not found: ${L}`));return}let I=A.readFileSync(L,{encoding:"utf-8"}),D=Xz.dirname(H);if(!A.existsSync(D))A.mkdirSync(D);iL(H,I,{encoding:"utf-8",flush:!0});let B=A.statSync(L).mode;cqA.chmodSync(H,B)}function oA1(H,$){for(let A of $.snapshots){let L=A.trackedFileBackups[H];if(L!==void 0&&L.version===1)return L.backupFileName}return}function h6D(H){if(!Xz.isAbsolute(H))return H;let $=zL();if(H.startsWith($))return Xz.relative($,H);return H}function lqA(H){if(Xz.isAbsolute(H))return H;return Xz.join(zL(),H)}function hY$(H,$){if(!gE())return;let A=[],L=new Set;for(let I of H){let D={};for(let[B,f]of Object.entries(I.trackedFileBackups)){let E=h6D(B);L.add(E),D[E]=f}A.push({...I,trackedFileBackups:D})}$({snapshots:A,trackedFiles:L})}async function bY$(H){if(!gE())return;let $=H.fileHistorySnapshots;if(!$||H.messages.length===0)return;let L=H.messages[H.messages.length-1]?.sessionId;if(!L){r(Error("FileHistory: Failed to copy backups on restore (no previous session id)"));return}let I=j$();if(L===I){N(`FileHistory: No need to copy file history for resuming with same session id: ${I}`);return}try{for(let D of $){let B=!1;for(let[f,E]of Object.entries(D.trackedFileBackups)){if(!E.backupFileName)continue;let M=zH(),G=Yt(E.backupFileName,L),U=Yt(E.backupFileName,I);if(M.existsSync(U))continue;if(!M.existsSync(G)){r(Error(`FileHistory: Failed to copy backup ${E.backupFileName} on restore (backup file does not exist in ${L})`)),B=!0;break}let X=Xz.dirname(U);if(!M.existsSync(X))M.mkdirSync(X);try{M.linkSync(G,U)}catch{r(Error("FileHistory: Error hard linking backup file from previous session"));try{M.copyFileSync(G,U)}catch{B=!0,r(Error("FileHistory: Error copying over backup from previous session"))}}N(`FileHistory: Copied backup ${E.backupFileName} from session ${L} to ${I}`)}if(!B)OkH(D.messageId,D,!1).catch((f)=>{r(Error("FileHistory: Failed to record copy backup snapshot"))});else c("tengu_file_history_resume_copy_failed",{numSnapshots:$.length})}}catch(D){r(D)}}function tA1(H,$){let A=H.snapshots.at(-1),L=$.snapshots.at(-1);if(!L)return;let I=zH();for(let D of $.trackedFiles){let B=lqA(D),f=A?.trackedFileBackups[D],E=L.trackedFileBackups[D];if(f?.backupFileName===E?.backupFileName&&f?.version===E?.version)continue;let M=null;if(f?.backupFileName)try{let U=Yt(f.backupFileName);if(I.existsSync(U))M=I.readFileSync(U,{encoding:"utf-8"})}catch{}let G=null;if(E?.backupFileName)try{let U=Yt(E.backupFileName);if(I.existsSync(U))G=I.readFileSync(U,{encoding:"utf-8"})}catch{}else if(E?.backupFileName===null)G=null;if(M!==G)_t(B,M,G)}}function b6D(H){if(sA1)console.error(R6D.inspect(H,!1,5))}var j6D,Xz,R6D,cqA,sA1=!1;var AC=K(()=>{DL();Z$();E$();g$();Z$();_$();rB();NA();qFH();z$();vA();N6H();j6D=require("crypto"),Xz=require("path"),R6D=require("util"),cqA=require("fs")});function Jz(H,$){return H.flatMap((A,L)=>L?[$(L),A]:[A])}function u6D({patch:H,dim:$,width:A}){let[L]=_I(),I=k6D.useMemo(()=>IL1(H.lines,H.oldStart,A,$,L),[H.lines,H.oldStart,A,$,L]);return p7.createElement(x,{flexDirection:"column",flexGrow:1},I.map((D,B)=>p7.createElement(x,{key:B},D)))}function HL1(H){return H.map(($)=>{if($.startsWith("+"))return{code:$.slice(1),i:0,type:"add",originalCode:$.slice(1)};if($.startsWith("-"))return{code:$.slice(1),i:0,type:"remove",originalCode:$.slice(1)};return{code:$.slice(1),i:0,type:"nochange",originalCode:$.slice(1)}})}function $L1(H){let $=[],A=0;while(A0&&B.length>0){let f=Math.min(I.length,B.length);for(let E=0;EO.added||O.removed).reduce((O,j)=>O+j.value.length,0)/J>eA1||L)return null;let W=D==="add"?"+":"-",P=W.length,C=Math.max(1,$-A-1-P),Y=[],Z=[],q=0;if(X.forEach((O,j)=>{let u=!1,y;if(D==="add"){if(O.added)u=!0,y="diffAddedWord";else if(!O.removed)u=!0}else if(D==="remove"){if(O.removed)u=!0,y="diffRemovedWord";else if(!O.added)u=!0}if(!u)return;k2(O.value,C,"wrap").split(` ${D}`;return{filename:H,status:"added",additions:I,deletions:0,changes:I,patch:B}}catch{return null}}var M3D,G3D,qt,gY$=5000,HTA=50,XL1=1e6,JL1=400,FL1=500,eqA=3000;var jkH=K(()=>{PI();B0();t8();M3D=require("fs"),G3D=require("fs/promises"),qt=require("path")});function Tt(H,$){switch(H){case"policySettings":return KM.join(v_(),".claude",$);case"userSettings":return KM.join(UL(),$);case"projectSettings":return`.claude/${$}`;case"plugin":return"plugin";default:return""}}function R6H(H){let $=[H.name,H.description,H.whenToUse].filter(Boolean).join(" ");return JE($)}function CL1(H){try{return K3D.realpathSync(H)}catch{return null}}function pY$(H){return H===!0||H==="true"}function Q3D(H,$){if(!H.hooks)return;let A=oZ.safeParse(H.hooks);if(!A.success){N(`Invalid hooks in skill '${$}': ${A.error.message}`);return}return A.data}function W3D({skillName:H,displayName:$,description:A,hasUserSpecifiedDescription:L,markdownContent:I,allowedTools:D,argumentHint:B,argumentNames:f,whenToUse:E,version:M,model:G,disableModelInvocation:U,userInvocable:X,source:J,baseDir:F,loadedFrom:Q,hooks:W,executionContext:P,agent:C}){return{type:"prompt",name:H,description:A,hasUserSpecifiedDescription:L,allowedTools:D,argumentHint:B,argNames:f.length>0?f:void 0,whenToUse:E,version:M,model:G,disableModelInvocation:U,userInvocable:X,context:P,agent:C,contentLength:I.length,isEnabled:()=>!0,isHidden:!X,progressMessage:"running",userFacingName(){return $||H},source:J,loadedFrom:Q,hooks:W,skillRoot:F,async getPromptForCommand(Y,Z){let q=F?`Base directory for this skill: ${F} ${I}`:I;return q=sKH(q,Y,!0,f),q=q.replace(/\$\{CLAUDE_SESSION_ID\}/g,j$()),q=await Qa(q,{...Z,async getAppState(){let O=await Z.getAppState();return{...O,toolPermissionContext:{...O.toolPermissionContext,alwaysAllowRules:{...O.toolPermissionContext.alwaysAllowRules,command:D}}}}},`/${H}`),[{type:"text",text:q}]}}}async function RkH(H,$){let A=zH(),L=[];try{let I=A.readdirSync(H);for(let D of I)try{if(D.isDirectory()||D.isSymbolicLink()){let B=KM.join(H,D.name),f=KM.join(B,"SKILL.md");try{let E=A.readFileSync(f,{encoding:"utf-8"}),{frontmatter:M,content:G}=MK(E,f),U=D.name,X=M.description??Wm(G,"Skill"),J=xx(M["allowed-tools"]),F=M["user-invocable"]===void 0?!0:pY$(M["user-invocable"]),Q=pY$(M["disable-model-invocation"]),W=M.model==="inherit"?void 0:M.model?m8(M.model):void 0,P=Q3D(M,U),C=M.context==="fork"?"fork":void 0,Y=M.agent,Z=mRH(M.arguments);L.push({skill:W3D({skillName:U,displayName:M.name,description:X,hasUserSpecifiedDescription:!!M.description,markdownContent:G,allowedTools:J,argumentHint:M["argument-hint"],argumentNames:Z,whenToUse:M.when_to_use,version:M.version,model:W,disableModelInvocation:Q,userInvocable:F,source:$,baseDir:B,loadedFrom:"skills",hooks:P,executionContext:C,agent:Y}),filePath:f})}catch{}}}catch(B){r(B instanceof Error?B:Error(String(B)))}}catch(I){let D=I.code;if(D!=="ENOENT"&&D!=="EACCES"&&D!=="EPERM")r(I instanceof Error?I:Error(String(I)))}return L}function $TA(H){return/^skill\.md$/i.test(KM.basename(H))}function wL1(H){let $=new Map;for(let L of H){let I=KM.dirname(L.filePath),D=$.get(I)??[];D.push(L),$.set(I,D)}let A=[];for(let[L,I]of $){let D=I.filter((B)=>$TA(B.filePath));if(D.length>0){let B=D[0];if(D.length>1)N(`Multiple skill files found in ${L}, using ${KM.basename(B.filePath)}`);A.push(B)}else A.push(...I)}return A}function V3D(H,$){let A=$.endsWith(KM.sep)?$.slice(0,-1):$;if(H===A)return"";let L=H.slice(A.length+1);return L?L.split(KM.sep).join(":"):""}function ZL1(H,$){let A=KM.dirname(H),L=KM.dirname(A),I=KM.basename(A),D=V3D(L,$);return D?`${D}:${I}`:I}function qL1(H,$){let A=KM.basename(H),L=KM.dirname(H),I=A.replace(/\.md$/,""),D=V3D(L,$);return D?`${D}:${I}`:I}function TL1(H){return $TA(H.filePath)?ZL1(H.filePath,H.baseDir):qL1(H.filePath,H.baseDir)}async function zL1(H){try{let $=await Rm("commands",H),A=wL1($),L=[];for(let{baseDir:I,filePath:D,frontmatter:B,content:f,source:E}of A)try{let M=B.description??Wm(f,"Custom command"),G=xx(B["allowed-tools"]),U=B["user-invocable"]===void 0?!0:pY$(B["user-invocable"]),X=pY$(B["disable-model-invocation"]),J=B.model==="inherit"?void 0:B.model?m8(B.model):void 0,F=B.context==="fork"?"fork":void 0,Q=B.agent,P=$TA(D)?KM.dirname(D):void 0,C=TL1({baseDir:I,filePath:D,frontmatter:B,content:f,source:E}),Y=Q3D(B,C),Z=mRH(B.arguments);L.push({skill:W3D({skillName:C,displayName:void 0,description:M,hasUserSpecifiedDescription:!!B.description,markdownContent:f,allowedTools:G,argumentHint:B["argument-hint"],argumentNames:Z,whenToUse:B.when_to_use,version:B.version,model:J,disableModelInvocation:X,userInvocable:U,source:E,baseDir:P,loadedFrom:"commands_DEPRECATED",hooks:Y,executionContext:F,agent:Q}),filePath:D})}catch(M){r(M instanceof Error?M:Error(String(M)))}return L}catch($){return r($ instanceof Error?$:Error(String($))),[]}}function dY$(){ATA.cache?.clear?.(),Rm.cache?.clear?.()}function _3D(H){P3D.push(H)}function y6H(H,$){let A=zH(),L=$.endsWith(KM.sep)?$.slice(0,-1):$,I=[];for(let D of H){let B=KM.dirname(D);while(B.startsWith(L+KM.sep)){let f=KM.join(B,".claude","skills");if(!F3D.has(f))try{A.statSync(f),I.push(f),F3D.add(f)}catch{}let E=KM.dirname(B);if(E===B)break;B=E}}return I.sort((D,B)=>B.split(KM.sep).length-D.split(KM.sep).length)}async function v6H(H){if(H.length===0)return;let $=new Set(ykH.keys()),A=await Promise.all(H.map((I)=>RkH(I,"projectSettings")));for(let I=A.length-1;I>=0;I--)for(let{skill:D}of A[I]??[])if(D.type==="prompt")ykH.set(D.name,D);let L=A.flat().length;if(L>0){let I=[...ykH.keys()].filter((D)=>!$.has(D));if(N(`[skills] Dynamically discovered ${L} skills from ${H.length} directories`),I.length>0)c("tengu_dynamic_skills_changed",{source:"file_operation",previousCount:$.size,newCount:ykH.size,addedCount:I.length,directoryCount:H.length})}for(let I of P3D)try{I()}catch(D){r(D instanceof Error?D:Error(String(D)))}}function Y3D(){return Array.from(ykH.values())}var K3D,KM,ATA,F3D,ykH,P3D;var zt=K(()=>{tD();_$();E$();z$();qKH();Vm();DL();Vu();NA();y$H();W4();aI();bk();Aw();g$();pRH();K3D=require("fs"),KM=require("path");ATA=o$(async(H)=>{let $=KM.join(UL(),"skills"),A=KM.join(v_(),".claude","skills"),L=LTA("skills",H);N(`Loading skills from: managed=${A}, user=${$}, project=[${L.join(", ")}]`);let[I,D,B]=await Promise.all([RkH(A,"policySettings"),HF("userSettings")?RkH($,"userSettings"):Promise.resolve([]),HF("projectSettings")?Promise.all(L.map((F)=>RkH(F,"projectSettings"))):Promise.resolve([])]),f=CN(),E=HF("projectSettings")?await Promise.all(f.map((F)=>RkH(KM.join(F,".claude","skills"),"projectSettings"))):[],M=await zL1(H),G=[...I,...D,...B.flat(),...E.flat(),...M],U=new Map,X=[];for(let{skill:F,filePath:Q}of G){if(F.type!=="prompt")continue;let W=CL1(Q);if(W===null){X.push(F);continue}let P=U.get(W);if(P!==void 0){N(`Skipping duplicate skill '${F.name}' from ${F.source} (same file already loaded from ${P})`);continue}U.set(W,F.source),X.push(F)}let J=G.length-X.length;if(J>0)N(`Deduplicated ${J} skills (same file)`);return N(`Loaded ${X.length} unique skills (managed: ${I.length}, user: ${D.length}, project: ${B.flat().length}, additional: ${E.flat().length}, legacy commands: ${M.length})`),X});F3D=new Set,ykH=new Map,P3D=[]});var Nt,S3;var T9H=K(()=>{z$();e4$();rD();PI();g$();tg();bWD();JBH();BM();ZM();DL();F9H();Pt();NkH();_$();E$();s4$();N6D();AC();N6H();sqA();SD();jkH();zt();Nt=require("path"),S3={name:TB,maxResultSizeChars:1e5,strict:!0,async description(){return"A tool for editing files"},async prompt(){return hWD()},userFacingName:uY$,getToolUseSummary:tqA,getActivityDescription(H){let $=tqA(H);return $?`Editing ${$}`:"Editing file"},isEnabled(){return!0},inputSchema:t4$,outputSchema:FYI,isConcurrencySafe(){return!1},isReadOnly(){return!1},getPath(H){return H.file_path},async checkPermissions(H,$){let A=await $.getAppState();return z9H(S3,H,A.toolPermissionContext)},renderToolUseMessage:I3D,renderToolUseProgressMessage:D3D,renderToolResultMessage:B3D,renderToolUseRejectedMessage:f3D,renderToolUseErrorMessage:E3D,async validateInput({file_path:H,old_string:$,new_string:A,replace_all:L=!1},I){if($===A)return{result:!1,behavior:"ask",message:"No changes to make: old_string and new_string are exactly the same.",errorCode:1};let D=xD(H),B=await I.getAppState();if($W(D,B.toolPermissionContext,"edit","deny")!==null)return{result:!1,behavior:"ask",message:"File is in a directory that is denied by your permission settings.",errorCode:2};let E=zH();if(E.existsSync(D)&&$===""){if(E.readFileSync(D,{encoding:eJ(D)}).replaceAll(`\r String: ${$}`,meta:{isFilePathAbsolute:String(Nt.isAbsolute(H)),actualOldString:U},errorCode:9};let J=z6D(D,G,()=>{return L?G.replaceAll(U,A):G.replace(U,A)});if(J!==null)return J;return{result:!0,meta:{actualOldString:U}}},inputsEquivalent(H,$){return hRI({file_path:H.file_path,edits:[{old_string:H.old_string,new_string:H.new_string,replace_all:H.replace_all??!1}]},{file_path:$.file_path,edits:[{old_string:$.old_string,new_string:$.new_string,replace_all:$.replace_all??!1}]})},async call({file_path:H,old_string:$,new_string:A,replace_all:L=!1},{readFileState:I,userModified:D,updateFileHistoryState:B,dynamicSkillDirTriggers:f},E,M){let G=zH(),U=xD(H),X=C$(),J=y6H([U],X);if(J.length>0){for(let u of J)f?.add(u);v6H(J).catch(()=>{})}await bp.beforeFileEdited(U);let F=G.existsSync(U)?$J(U):"";if(G.existsSync(U)){let u=x3(U),y=I.get(U);if(!y||u>y.timestamp){if(!y&&NL("tengu_marble_kite",!1));else if(!(y&&y.offset===void 0&&y.limit===void 0&&F===y.content))throw Error(QzH)}}if(gE())await Ct(B,U,M.uuid);let Q=XBH(F,$)||$,{patch:W,updatedFile:P}=QF$({filePath:U,fileContents:F,oldString:Q,newString:A,replaceAll:L}),C=Nt.dirname(U);G.mkdirSync(C);let Y=G.existsSync(U)?kp(U):"LF",Z=G.existsSync(U)?eJ(U):"utf8";Ot(U,P,Z,Y);let q=hp();if(q)OY$(`file://${U}`),q.changeFile(U,P).catch((u)=>{N(`LSP: Failed to notify server of file change for ${U}: ${u.message}`),r(u)}),q.saveFile(U).catch((u)=>{N(`LSP: Failed to notify server of file save for ${U}: ${u.message}`),r(u)});if(_t(U,F,P),I.set(U,{content:P,timestamp:x3(U),offset:void 0,limit:void 0}),U.endsWith(`${Nt.sep}CLAUDE.md`))c("tengu_write_claudemd",{});tSH(W),Ex({operation:"edit",tool:"FileEditTool",filePath:U});let O;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"&&!0&&NL("tengu_quartz_lantern",!1)){let u=Date.now(),y=await mY$(U);if(y)O=y;c("tengu_tool_use_diff_computed",{isEditTool:!0,durationMs:Date.now()-u,hasDiff:!!y})}return{data:{filePath:H,oldString:Q,newString:A,originalFile:F,structuredPatch:W,userModified:D??!1,replaceAll:L,...O&&{gitDiff:O}}}},mapToolResultToToolResultBlockParam({filePath:H,oldString:$,newString:A,userModified:L,replaceAll:I},D){let B=L?". The user modified your proposed changes before accepting them. ":"";if(I)return{tool_use_id:D,type:"tool_result",content:`The file ${H} has been updated${B}. All occurrences of '${$}' were successfully replaced with '${A}'.`};return{tool_use_id:D,type:"tool_result",content:`The file ${H} has been updated successfully${B}.`}}}});var C3D="Replace the contents of a specific cell in a Jupyter notebook.",w3D="Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number.";function q3D({notebook_path:H,cell_id:$,new_source:A,cell_type:L,edit_mode:I="replace",verbose:D}){let B=I==="delete"?"delete":`${I} cell in`;return d7.createElement(HA,null,d7.createElement(x,{flexDirection:"column"},d7.createElement(x,{flexDirection:"row"},d7.createElement(V,{color:"subtle"},"User rejected ",B," "),d7.createElement(V,{bold:!0,color:"subtle"},D?H:Z3D.relative(C$(),H)),d7.createElement(V,{color:"subtle"}," at cell ",$)),I!=="delete"&&d7.createElement(x,{marginTop:1,flexDirection:"column"},d7.createElement(IC,{code:A,filePath:L==="markdown"?"file.md":"file.py",dim:!0}))))}var Z3D,d7;var T3D=K(()=>{xH();PI();iB();q9H();Z3D=require("path"),d7=b(s(),1)});function ITA(H){if(!H?.notebook_path)return null;return V9(H.notebook_path)}function z3D({notebook_path:H,cell_id:$,new_source:A,cell_type:L,edit_mode:I},{verbose:D}){if(!H||!A||!L)return null;let B=D?H:V9(H);if(D)return Q8.createElement(Q8.Fragment,null,Q8.createElement(yw,{filePath:H},B),`@${$}, content: ${A.slice(0,30)}\u2026, cell_type: ${L}, edit_mode: ${I??"replace"}`);return Q8.createElement(Q8.Fragment,null,Q8.createElement(yw,{filePath:H},B),`@${$}`)}function N3D(H,{verbose:$}){return Q8.createElement(q3D,{notebook_path:H.notebook_path,cell_id:H.cell_id,new_source:H.new_source,cell_type:H.cell_type,edit_mode:H.edit_mode,verbose:$})}function O3D(H,{verbose:$}){if(!$&&typeof H==="string"&&VD(H,"tool_use_error"))return Q8.createElement(HA,null,Q8.createElement(V,{color:"error"},"Error editing notebook"));return Q8.createElement(s9,{result:H,verbose:$})}function x3D(){return null}function S3D({cell_id:H,new_source:$,error:A}){if(A)return Q8.createElement(HA,null,Q8.createElement(V,{color:"error"},A));return Q8.createElement(HA,null,Q8.createElement(x,{flexDirection:"column"},Q8.createElement(V,null,"Updated cell ",Q8.createElement(V,{bold:!0},H),":"),Q8.createElement(x,{marginLeft:2},Q8.createElement(IC,{code:$,filePath:"notebook.py"}))))}var Q8;var j3D=K(()=>{xH();j6H();q9H();T3D();iB();j5();_L();rD();Q8=b(s(),1)});var xt,NL1,OL1,up;var hkH=K(()=>{mI();lY$();rD();nM();PI();BM();DL();AC();j3D();Z$();xt=require("path"),NL1=S.strictObject({notebook_path:S.string().describe("The absolute path to the Jupyter notebook file to edit (must be absolute, not relative)"),cell_id:S.string().optional().describe("The ID of the cell to edit. When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified."),new_source:S.string().describe("The new source for the cell"),cell_type:S.enum(["code","markdown"]).optional().describe("The type of the cell (code or markdown). If not specified, it defaults to the current cell type. If using edit_mode=insert, this is required."),edit_mode:S.enum(["replace","insert","delete"]).optional().describe("The type of edit to make (replace, insert, delete). Defaults to replace.")}),OL1=S.object({new_source:S.string().describe("The new source code that was written to the cell"),cell_id:S.string().optional().describe("The ID of the cell that was edited"),cell_type:S.enum(["code","markdown"]).describe("The type of the cell"),language:S.string().describe("The programming language of the notebook"),edit_mode:S.string().describe("The edit mode that was used"),error:S.string().optional().describe("Error message if the operation failed"),notebook_path:S.string().describe("The path to the notebook file"),original_file:S.string().describe("The original notebook content before modification"),updated_file:S.string().describe("The updated notebook content after modification")}),up={name:aW,maxResultSizeChars:1e5,shouldDefer:!0,async description(){return C3D},async prompt(){return w3D},userFacingName(){return"Edit Notebook"},getToolUseSummary:ITA,getActivityDescription(H){let $=ITA(H);return $?`Editing notebook ${$}`:"Editing notebook"},isEnabled(){return!0},inputSchema:NL1,outputSchema:OL1,isConcurrencySafe(){return!1},isReadOnly(){return!1},getPath(H){return H.notebook_path},async checkPermissions(H,$){let A=await $.getAppState();return z9H(up,H,A.toolPermissionContext)},mapToolResultToToolResultBlockParam({cell_id:H,edit_mode:$,new_source:A,error:L},I){if(L)return{tool_use_id:I,type:"tool_result",content:L,is_error:!0};switch($){case"replace":return{tool_use_id:I,type:"tool_result",content:`Updated cell ${H} with ${A}`};case"insert":return{tool_use_id:I,type:"tool_result",content:`Inserted cell ${H} with ${A}`};case"delete":return{tool_use_id:I,type:"tool_result",content:`Deleted cell ${H}`};default:return{tool_use_id:I,type:"tool_result",content:"Unknown edit mode"}}},renderToolUseMessage:z3D,renderToolUseRejectedMessage:N3D,renderToolUseErrorMessage:O3D,renderToolUseProgressMessage:x3D,renderToolResultMessage:S3D,async validateInput({notebook_path:H,cell_type:$,cell_id:A,edit_mode:L="replace"}){let I=xt.isAbsolute(H)?H:xt.resolve(C$(),H),D=zH();if(!D.existsSync(I))return{result:!1,message:"Notebook file does not exist.",errorCode:1};if(xt.extname(I)!==".ipynb")return{result:!1,message:"File must be a Jupyter notebook (.ipynb file). For editing other file types, use the FileEdit tool.",errorCode:2};if(L!=="replace"&&L!=="insert"&&L!=="delete")return{result:!1,message:"Edit mode must be replace, insert, or delete.",errorCode:4};if(L==="insert"&&!$)return{result:!1,message:"Cell type is required when using edit_mode=insert.",errorCode:5};let B=eJ(I),f=D.readFileSync(I,{encoding:B}),E=q1(f);if(!E)return{result:!1,message:"Notebook is not valid JSON.",errorCode:6};if(!A){if(L!=="insert")return{result:!1,message:"Cell ID must be specified when not inserting a new cell.",errorCode:7}}else if(E.cells.findIndex((G)=>G.id===A)===-1){let G=vkH(A);if(G!==void 0){if(!E.cells[G])return{result:!1,message:`Cell with index ${G} does not exist in notebook.`,errorCode:7}}else return{result:!1,message:`Cell with ID "${A}" not found in notebook.`,errorCode:8}}return{result:!0}},async call({notebook_path:H,new_source:$,cell_id:A,cell_type:L,edit_mode:I},{updateFileHistoryState:D},B,f){let E=xt.isAbsolute(H)?H:xt.resolve(C$(),H);if(gE())await Ct(D,E,f.uuid);try{let M=eJ(E),G=zH().readFileSync(E,{encoding:M}),U=DA(G),X;if(!A)X=0;else{if(X=U.cells.findIndex((Y)=>Y.id===A),X===-1){let Y=vkH(A);if(Y!==void 0)X=Y}if(I==="insert")X+=1}let J=I;if(J==="replace"&&X===U.cells.length){if(J="insert",!L)L="code"}let F=U.metadata.language_info?.name??"python",Q=void 0;if(U.nbformat>4||U.nbformat===4&&U.nbformat_minor>=5){if(J==="insert")Q=Math.random().toString(36).substring(2,15);else if(A!==null)Q=A}if(J==="delete")U.cells.splice(X,1);else if(J==="insert"){let Y;if(L==="markdown")Y={cell_type:"markdown",id:Q,source:$,metadata:{}};else Y={cell_type:"code",id:Q,source:$,metadata:{},execution_count:null,outputs:[]};U.cells.splice(X,0,Y)}else{let Y=U.cells[X];if(Y.source=$,Y.cell_type==="code")Y.execution_count=null,Y.outputs=[];if(L&&L!==Y.cell_type)Y.cell_type=L}let W=kp(E),P=yH(U,null,1);return Ot(E,P,M,W),{data:{new_source:$,cell_type:L??"code",language:F,edit_mode:J??"replace",cell_id:Q||void 0,error:"",notebook_path:E,original_file:G,updated_file:P}}}catch(M){if(M instanceof Error)return{data:{new_source:$,cell_type:L??"code",language:"python",edit_mode:"replace",error:M.message,cell_id:A,notebook_path:E,original_file:"",updated_file:""}};return{data:{new_source:$,cell_type:L??"code",language:"python",edit_mode:"replace",error:"Unknown error occurred while editing notebook",cell_id:A,notebook_path:E,original_file:"",updated_file:""}}}}}});var h6H=z((coE,R3D)=>{R3D.exports=N9H;N9H.CAPTURING_PHASE=1;N9H.AT_TARGET=2;N9H.BUBBLING_PHASE=3;function N9H(H,$){if(this.type="",this.target=null,this.currentTarget=null,this.eventPhase=N9H.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,H)this.type=H;if($)for(var A in $)this[A]=$[A]}N9H.prototype=Object.create(Object.prototype,{constructor:{value:N9H},stopPropagation:{value:function(){this._propagationStopped=!0}},stopImmediatePropagation:{value:function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0}},preventDefault:{value:function(){if(this.cancelable)this.defaultPrevented=!0}},initEvent:{value:function($,A,L){if(this._initialized=!0,this._dispatching)return;this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=$,this.bubbles=A,this.cancelable=L}}})});var BTA=z((loE,v3D)=>{var y3D=h6H();v3D.exports=DTA;function DTA(){y3D.call(this),this.view=null,this.detail=0}DTA.prototype=Object.create(y3D.prototype,{constructor:{value:DTA},initUIEvent:{value:function(H,$,A,L,I){this.initEvent(H,$,A),this.view=L,this.detail=I}}})});var ETA=z((ioE,b3D)=>{var h3D=BTA();b3D.exports=fTA;function fTA(){h3D.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}fTA.prototype=Object.create(h3D.prototype,{constructor:{value:fTA},initMouseEvent:{value:function(H,$,A,L,I,D,B,f,E,M,G,U,X,J,F){switch(this.initEvent(H,$,A,L,I),this.screenX=D,this.screenY=B,this.clientX=f,this.clientY=E,this.ctrlKey=M,this.altKey=G,this.shiftKey=U,this.metaKey=X,this.button=J,J){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break}this.relatedTarget=F}},getModifierState:{value:function(H){switch(H){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return!1}}}})});var rY$=z((noE,u3D)=>{u3D.exports=nY$;var xL1=1,SL1=3,jL1=4,RL1=5,yL1=7,vL1=8,hL1=9,bL1=11,kL1=12,uL1=13,gL1=14,mL1=15,pL1=17,dL1=18,cL1=19,lL1=20,iL1=21,nL1=22,rL1=23,aL1=24,oL1=25,tL1=[null,"INDEX_SIZE_ERR",null,"HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR",null,"NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INUSE_ATTRIBUTE_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR",null,"TYPE_MISMATCH_ERR","SECURITY_ERR","NETWORK_ERR","ABORT_ERR","URL_MISMATCH_ERR","QUOTA_EXCEEDED_ERR","TIMEOUT_ERR","INVALID_NODE_TYPE_ERR","DATA_CLONE_ERR"],sL1=[null,"INDEX_SIZE_ERR (1): the index is not in the allowed range",null,"HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model","WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required","INVALID_CHARACTER_ERR (5): the string contains invalid characters",null,"NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified","NOT_FOUND_ERR (8): the object can not be found here","NOT_SUPPORTED_ERR (9): this operation is not supported","INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute","INVALID_STATE_ERR (11): the object is in an invalid state","SYNTAX_ERR (12): the string did not match the expected pattern","INVALID_MODIFICATION_ERR (13): the object can not be modified in this way","NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML","INVALID_ACCESS_ERR (15): the object does not support the operation or argument",null,"TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type","SECURITY_ERR (18): the operation is insecure","NETWORK_ERR (19): a network error occurred","ABORT_ERR (20): the user aborted an operation","URL_MISMATCH_ERR (21): the given URL does not match another URL","QUOTA_EXCEEDED_ERR (22): the quota has been exceeded","TIMEOUT_ERR (23): a timeout occurred","INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation","DATA_CLONE_ERR (25): the object can not be cloned."],k3D={INDEX_SIZE_ERR:xL1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:SL1,WRONG_DOCUMENT_ERR:jL1,INVALID_CHARACTER_ERR:RL1,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:yL1,NOT_FOUND_ERR:vL1,NOT_SUPPORTED_ERR:hL1,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:bL1,SYNTAX_ERR:kL1,INVALID_MODIFICATION_ERR:uL1,NAMESPACE_ERR:gL1,INVALID_ACCESS_ERR:mL1,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:pL1,SECURITY_ERR:dL1,NETWORK_ERR:cL1,ABORT_ERR:lL1,URL_MISMATCH_ERR:iL1,QUOTA_EXCEEDED_ERR:nL1,TIMEOUT_ERR:rL1,INVALID_NODE_TYPE_ERR:aL1,DATA_CLONE_ERR:oL1};function nY$(H){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=H,this.message=sL1[H],this.name=tL1[H]}nY$.prototype.__proto__=Error.prototype;for(bkH in k3D)iY$={value:k3D[bkH]},Object.defineProperty(nY$,bkH,iY$),Object.defineProperty(nY$.prototype,bkH,iY$);var iY$,bkH});var aY$=z((g3D)=>{g3D.isApiWritable=!globalThis.__domino_frozen__});var SX=z((WE)=>{var xX=rY$(),zJ=xX,eL1=aY$().isApiWritable;WE.NAMESPACE={HTML:"http://www.w3.org/1999/xhtml",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};WE.IndexSizeError=function(){throw new xX(zJ.INDEX_SIZE_ERR)};WE.HierarchyRequestError=function(){throw new xX(zJ.HIERARCHY_REQUEST_ERR)};WE.WrongDocumentError=function(){throw new xX(zJ.WRONG_DOCUMENT_ERR)};WE.InvalidCharacterError=function(){throw new xX(zJ.INVALID_CHARACTER_ERR)};WE.NoModificationAllowedError=function(){throw new xX(zJ.NO_MODIFICATION_ALLOWED_ERR)};WE.NotFoundError=function(){throw new xX(zJ.NOT_FOUND_ERR)};WE.NotSupportedError=function(){throw new xX(zJ.NOT_SUPPORTED_ERR)};WE.InvalidStateError=function(){throw new xX(zJ.INVALID_STATE_ERR)};WE.SyntaxError=function(){throw new xX(zJ.SYNTAX_ERR)};WE.InvalidModificationError=function(){throw new xX(zJ.INVALID_MODIFICATION_ERR)};WE.NamespaceError=function(){throw new xX(zJ.NAMESPACE_ERR)};WE.InvalidAccessError=function(){throw new xX(zJ.INVALID_ACCESS_ERR)};WE.TypeMismatchError=function(){throw new xX(zJ.TYPE_MISMATCH_ERR)};WE.SecurityError=function(){throw new xX(zJ.SECURITY_ERR)};WE.NetworkError=function(){throw new xX(zJ.NETWORK_ERR)};WE.AbortError=function(){throw new xX(zJ.ABORT_ERR)};WE.UrlMismatchError=function(){throw new xX(zJ.URL_MISMATCH_ERR)};WE.QuotaExceededError=function(){throw new xX(zJ.QUOTA_EXCEEDED_ERR)};WE.TimeoutError=function(){throw new xX(zJ.TIMEOUT_ERR)};WE.InvalidNodeTypeError=function(){throw new xX(zJ.INVALID_NODE_TYPE_ERR)};WE.DataCloneError=function(){throw new xX(zJ.DATA_CLONE_ERR)};WE.nyi=function(){throw Error("NotYetImplemented")};WE.shouldOverride=function(){throw Error("Abstract function; should be overriding in subclass.")};WE.assert=function(H,$){if(!H)throw Error("Assertion failed: "+($||"")+` `,this.references=[];return $}};v3.emphasis={filter:["em","i"],replacement:function(H,$,A){if(!H.trim())return"";return A.emDelimiter+H+A.emDelimiter}};v3.strong={filter:["strong","b"],replacement:function(H,$,A){if(!H.trim())return"";return A.strongDelimiter+H+A.strongDelimiter}};v3.code={filter:function(H){var $=H.previousSibling||H.nextSibling,A=H.parentNode.nodeName==="PRE"&&!$;return H.nodeName==="CODE"&&!A},replacement:function(H){if(!H)return"";H=H.replace(/\r?\n|\r/g," ");var $=/^`|^ .*?[^ ].* $|`$/.test(H)?" ":"",A="`",L=H.match(/`+/gm)||[];while(L.indexOf(A)!==-1)A=A+"`";return A+$+H+$+A}};v3.image={filter:"img",replacement:function(H,$){var A=NC$($.getAttribute("alt")),L=$.getAttribute("src")||"",I=NC$($.getAttribute("title")),D=I?' "'+I+'"':"";return L?"!["+A+"]("+L+D+")":""}};c_D.prototype={add:function(H,$){this.array.unshift($)},keep:function(H){this._keep.unshift({filter:H,replacement:this.keepReplacement})},remove:function(H){this._remove.unshift({filter:H,replacement:function(){return""}})},forNode:function(H){if(H.isBlank)return this.blankRule;var $;if($=CzA(this.array,H,this.options))return $;if($=CzA(this._keep,H,this.options))return $;if($=CzA(this._remove,H,this.options))return $;return this.defaultRule},forEach:function(H){for(var $=0;$/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];OC$.prototype={turndown:function(H){if(!hB1(H))throw TypeError(H+" is not a string, or an element/document/fragment node.");if(H==="")return"";var $=i_D.call(this,new qB1(H,this.options));return yB1.call(this,$)},use:function(H){if(Array.isArray(H))for(var $=0;${xC$=new Set(["platform.claude.com","code.claude.com","modelcontextprotocol.io","github.com/anthropics","agentskills.io","docs.python.org","en.cppreference.com","docs.oracle.com","learn.microsoft.com","developer.mozilla.org","go.dev","pkg.go.dev","www.php.net","docs.swift.org","kotlinlang.org","ruby-doc.org","doc.rust-lang.org","www.typescriptlang.org","react.dev","angular.io","vuejs.org","nextjs.org","expressjs.com","nodejs.org","bun.sh","jquery.com","getbootstrap.com","tailwindcss.com","d3js.org","threejs.org","redux.js.org","webpack.js.org","jestjs.io","reactrouter.com","docs.djangoproject.com","flask.palletsprojects.com","fastapi.tiangolo.com","pandas.pydata.org","numpy.org","www.tensorflow.org","pytorch.org","scikit-learn.org","matplotlib.org","requests.readthedocs.io","jupyter.org","laravel.com","symfony.com","wordpress.org","docs.spring.io","hibernate.org","tomcat.apache.org","gradle.org","maven.apache.org","asp.net","dotnet.microsoft.com","nuget.org","blazor.net","reactnative.dev","docs.flutter.dev","developer.apple.com","developer.android.com","keras.io","spark.apache.org","huggingface.co","www.kaggle.com","www.mongodb.com","redis.io","www.postgresql.org","dev.mysql.com","www.sqlite.org","graphql.org","prisma.io","docs.aws.amazon.com","cloud.google.com","learn.microsoft.com","kubernetes.io","www.docker.com","www.terraform.io","www.ansible.com","vercel.com/docs","docs.netlify.com","devcenter.heroku.com/","cypress.io","selenium.dev","docs.unity.com","docs.unrealengine.com","git-scm.com","nginx.org","httpd.apache.org"])});function t_D(H){try{let $=new URL(H),A=$.hostname,L=$.pathname;for(let I of xC$)if(I.includes("/")){let[D,...B]=I.split("/"),f="/"+B.join("/");if(A===D&&L.startsWith(f))return!0}else if(A===I)return!0;return!1}catch{return!1}}function mB1(H){if(H.length>uB1)return!1;let $;try{$=new URL(H)}catch{return!1}if($.username||$.password)return!1;if($.hostname.split(".").length<2)return!1;return!0}async function pB1(H){try{let $=await nA.get(`https://api.anthropic.com/api/web/domain_info?domain=${encodeURIComponent(H)}`);if($.status===200)return $.data.can_fetch===!0?{status:"allowed"}:{status:"blocked"};return{status:"check_failed",error:Error(`Domain check returned status ${$.status}`)}}catch($){return r($),{status:"check_failed",error:$}}}function dB1(H,$){try{let A=new URL(H),L=new URL($);if(L.protocol!==A.protocol)return!1;if(L.port!==A.port)return!1;if(L.username||L.password)return!1;let I=(f)=>f.replace(/^www\./,""),D=I(A.hostname),B=I(L.hostname);return D===B}catch(A){return!1}}async function s_D(H,$,A){try{return await nA.get(H,{signal:$,maxRedirects:0,responseType:"arraybuffer",maxContentLength:gB1,headers:{Accept:"text/markdown, text/html, */*"}})}catch(L){if(nA.isAxiosError(L)&&L.response&&[301,302,307,308].includes(L.response.status)){let I=L.response.headers.location;if(!I)throw Error("Redirect missing Location header");let D=new URL(I,H).toString();if(A(H,D))return s_D(D,$,A);else return{type:"redirect",originalUrl:H,redirectUrl:D,statusCode:L.response.status}}throw L}}function cB1(H){return"type"in H&&H.type==="redirect"}async function e_D(H,$){if(!mB1(H))throw Error("Invalid URL");let A=o_D.get(H);if(A)return{bytes:A.bytes,code:A.code,codeText:A.codeText,content:A.content,contentType:A.contentType};let L,I=H;try{if(L=new URL(H),L.protocol==="http:")L.protocol="https:",I=L.toString();let G=L.hostname;if(!VL().skipWebFetchPreflight)switch((await pB1(G)).status){case"allowed":break;case"blocked":throw new OzA(G);case"check_failed":throw new xzA(G)}}catch(G){if(r(G),G instanceof OzA||G instanceof xzA)throw G}let D=await s_D(I,$.signal,dB1);if(cB1(D))return D;let B=Buffer.from(D.data).toString("utf-8"),f=D.headers["content-type"]??"",E=Buffer.byteLength(B),M;if(f.includes("text/html"))M=new r_D().turndown(B);else M=B;return o_D.set(H,{bytes:E,code:D.status,codeText:D.statusText,content:M,contentType:f}),{code:D.status,codeText:D.statusText,content:M,contentType:f,bytes:E}}async function HYD(H,$,A,L,I){let D=$.length>SC$?$.slice(0,SC$)+` [Content truncated due to length...]`:$,B=jaL(D,H,I),f=await OQ({systemPrompt:[],userPrompt:B,signal:A,options:{querySource:"web_fetch_apply",agents:[],isNonInteractiveSession:L,hasAppendSystemPrompt:!1,mcpTools:[]}});if(A.aborted)throw new HM;let{content:E}=f.message;if(E.length>0){let M=E[0];if("text"in M)return M.text}return"No response from model"}var OzA,xzA,bB1=900000,kB1=52428800,o_D,uB1=2000,gB1=10485760,SC$=1e5;var $YD=K(()=>{w1();CwH();a_D();dU();z$();lG();_$();mL();NzA();OzA=class OzA extends Error{constructor(H){super(`Claude Code is unable to fetch from ${H}`);this.name="DomainBlockedError"}};xzA=class xzA extends Error{constructor(H){super(`Unable to verify if domain ${H} is safe to fetch. This may be due to network restrictions or enterprise security policies blocking claude.ai.`);this.name="DomainCheckFailedError"}};o_D=new gN({maxSize:kB1,sizeCalculation:(H)=>Buffer.byteLength(H.content),ttl:bB1})});function AYD({url:H,prompt:$},{verbose:A}){if(!H)return null;if(A)return`url: "${H}"${A&&$?`, prompt: "${$}"`:""}`;return H}function LYD(){return fC.default.createElement(L8,null)}function IYD(H,{verbose:$}){return fC.default.createElement(s9,{result:H,verbose:$})}function DYD(){return fC.default.createElement(HA,{height:1},fC.default.createElement(V,{dimColor:!0},"Fetching\u2026"))}function BYD({bytes:H,code:$,codeText:A,result:L},I,{verbose:D}){let B=GM(H);if(D)return fC.default.createElement(x,{flexDirection:"column"},fC.default.createElement(HA,{height:1},fC.default.createElement(V,null,"Received ",fC.default.createElement(V,{bold:!0},B)," (",$," ",A,")")),fC.default.createElement(x,{flexDirection:"column"},fC.default.createElement(V,null,L)));return fC.default.createElement(HA,{height:1},fC.default.createElement(V,null,"Received ",fC.default.createElement(V,{bold:!0},B)," (",$," ",A,")"))}function SzA(H){if(!H?.url)return null;return e8(H.url,fx)}var fC;var fYD=K(()=>{xH();iB();_F();j5();rD();Q9();fC=b(s(),1)});function nB1(H){try{let $=IW.inputSchema.safeParse(H);if(!$.success)return`input:${H.toString()}`;let{url:A}=$.data;return`domain:${new URL(A).hostname}`}catch{return`input:${H.toString()}`}}function EYD(H){return[{type:"addRules",destination:"localSettings",rules:[{toolName:w4,ruleContent:H}],behavior:"allow"}]}var lB1,iB1,IW;var s6H=K(()=>{mI();ia();$YD();XJ();NzA();fYD();lB1=S.strictObject({url:S.string().url().describe("The URL to fetch content from"),prompt:S.string().describe("The prompt to run on the fetched content")}),iB1=S.object({bytes:S.number().describe("Size of the fetched content in bytes"),code:S.number().describe("HTTP response code"),codeText:S.string().describe("HTTP response code text"),result:S.string().describe("Processed result from applying the prompt to the content"),durationMs:S.number().describe("Time taken to fetch and process the content"),url:S.string().describe("The URL that was fetched")});IW={name:w4,maxResultSizeChars:1e5,async description(H){let{url:$}=H;try{return`Claude wants to fetch content from ${new URL($).hostname}`}catch{return"Claude wants to fetch content from this URL"}},userFacingName(){return"Fetch"},getToolUseSummary:SzA,getActivityDescription(H){let $=SzA(H);return $?`Fetching ${$}`:"Fetching web page"},isEnabled(){return!0},inputSchema:lB1,outputSchema:iB1,isConcurrencySafe(){return!0},isReadOnly(){return!0},async checkPermissions(H,$){let L=(await $.getAppState()).toolPermissionContext;try{let{url:E}=H,M=new URL(E),G=M.hostname,U=M.pathname;for(let X of xC$)if(X.includes("/")){let[J,...F]=X.split("/"),Q="/"+F.join("/");if(G===J&&U.startsWith(Q))return{behavior:"allow",updatedInput:H,decisionReason:{type:"other",reason:"Preapproved host and path"}}}else if(G===X)return{behavior:"allow",updatedInput:H,decisionReason:{type:"other",reason:"Preapproved host"}}}catch{}let I=nB1(H),D=RS(L,IW,"deny").get(I);if(D)return{behavior:"deny",message:`${IW.name} denied access to ${I}.`,decisionReason:{type:"rule",rule:D}};let B=RS(L,IW,"ask").get(I);if(B)return{behavior:"ask",message:`Claude requested permissions to use ${IW.name}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:B},suggestions:EYD(I)};let f=RS(L,IW,"allow").get(I);if(f)return{behavior:"allow",updatedInput:H,decisionReason:{type:"rule",rule:f}};return{behavior:"ask",message:`Claude requested permissions to use ${IW.name}, but you haven't granted it yet.`,suggestions:EYD(I)}},async prompt({tools:H}){if(H.some(($)=>$.name===C7))return`IMPORTANT: WebFetch WILL FAIL for authenticated or private URLs. Before using this tool, check if the URL points to an authenticated service (e.g. Google Docs, Confluence, Jira, GitHub). If so, you MUST use ${C7} first to find a specialized tool that provides authenticated access. `)}},renderToolUseMessage(H){let{block:$=!0}=H;if(!$)return"non-blocking";return""},renderToolUseTag(H){if(!H.task_id)return null;return f8.default.createElement(V,{dimColor:!0}," ",H.task_id)},renderToolUseProgressMessage(H){let A=H[H.length-1]?.data;return f8.default.createElement(x,{flexDirection:"column"},A?.taskDescription&&f8.default.createElement(V,null,"\xA0\xA0",A.taskDescription),f8.default.createElement(V,null,"\xA0\xA0\xA0\xA0\xA0Waiting for task"," ",f8.default.createElement(V,{dimColor:!0},"(esc to give additional instructions)")))},renderToolResultMessage(H,$,{verbose:A,theme:L}){return f8.default.createElement(H01,{content:H,verbose:A,theme:L})},renderToolUseRejectedMessage(){return f8.default.createElement(L8,null)},renderToolUseErrorMessage(H,{verbose:$}){return f8.default.createElement(s9,{result:H,verbose:$})}}});function $01(H){let $=0,A=0;for(let L of H)if(typeof L!=="string")$++,A+=L.content.length;return{searchCount:$,totalResultCount:A}}function WYD({query:H,allowed_domains:$,blocked_domains:A},{verbose:L}){if(!H)return null;let I="";if(H)I+=`"${H}"`;if(L){if($&&$.length>0)I+=`, only allowing domains: ${$.join(", ")}`;if(A&&A.length>0)I+=`, blocking domains: ${A.join(", ")}`}return I}function VYD(){return uh.default.createElement(L8,null)}function PYD(H,{verbose:$}){return uh.default.createElement(s9,{result:H,verbose:$})}function _YD(H){if(H.length===0)return null;let $=H[H.length-1];if(!$?.data)return null;let A=$.data;switch(A.type){case"query_update":return uh.default.createElement(HA,null,uh.default.createElement(V,{dimColor:!0},"Searching: ",A.query));case"search_results_received":return uh.default.createElement(HA,null,uh.default.createElement(V,{dimColor:!0},"Found ",A.resultCount,' results for "',A.query,'"'));default:return null}}function YYD(H){let{searchCount:$}=$01(H.results),A=H.durationSeconds>=1?`${Math.round(H.durationSeconds)}s`:`${Math.round(H.durationSeconds*1000)}ms`;return uh.default.createElement(x,{justifyContent:"space-between",width:"100%"},uh.default.createElement(HA,{height:1},uh.default.createElement(V,null,"Did ",$," search",$!==1?"es":""," in ",A)))}function hzA(H){if(!H?.query)return null;return e8(H.query,fx)}var uh;var CYD=K(()=>{xH();iB();_F();j5();Q9();uh=b(s(),1)});function f01(H,$,A){let L=[],I="",D=!0;for(let B of H){if(B.type==="server_tool_use"){if(D){if(D=!1,I.trim().length>0)L.push(I.trim());I=""}continue}if(B.type==="web_search_tool_result"){if(!Array.isArray(B.content)){let E=`Web search error: ${B.content.error_code}`;r(Error(E)),L.push(E);continue}let f=B.content.map((E)=>({title:E.title,url:E.url}));L.push({tool_use_id:B.tool_use_id,content:f})}if(B.type==="text")if(D)I+=B.text;else D=!0,I=B.text}if(I.length)L.push(I.trim());return{query:$,results:L,durationSeconds:A}}var A01,L01,I01,D01,B01=(H)=>{return{type:"web_search_20250305",name:"web_search",allowed_domains:H.allowed_domains,blocked_domains:H.blocked_domains,max_uses:8}},vC$;var bzA=K(()=>{mI();Mn();dU();_L();aI();SD();oM();_$();CYD();Z$();A01=S.strictObject({query:S.string().min(2).describe("The search query to use"),allowed_domains:S.array(S.string()).optional().describe("Only include search results from these domains"),blocked_domains:S.array(S.string()).optional().describe("Never include search results from these domains")}),L01=S.object({title:S.string().describe("The title of the search result"),url:S.string().describe("The URL of the search result")}),I01=S.object({tool_use_id:S.string().describe("ID of the tool use"),content:S.array(L01).describe("Array of search hits")}),D01=S.object({query:S.string().describe("The search query that was executed"),results:S.array(S.union([I01,S.string()])).describe("Search results and/or text commentary from the model"),durationSeconds:S.number().describe("Time taken to complete the search operation")});vC$={name:v2,maxResultSizeChars:1e5,async description(H){return`Claude wants to search the web for: ${H.query}`},userFacingName(){return"Web Search"},getToolUseSummary:hzA,getActivityDescription(H){let $=hzA(H);return $?`Searching for ${$}`:"Searching the web"},isEnabled(){let H=sI(),$=X1();if(H==="firstParty")return!0;if(H==="vertex")return $.includes("claude-opus-4")||$.includes("claude-sonnet-4")||$.includes("claude-haiku-4");if(H==="foundry")return!0;return!1},inputSchema:A01,outputSchema:D01,isConcurrencySafe(){return!0},isReadOnly(){return!0},async checkPermissions(H){return{behavior:"passthrough",message:"WebSearchTool requires permission."}},async prompt(){return $oL()},renderToolUseMessage:WYD,renderToolUseRejectedMessage:VYD,renderToolUseErrorMessage:PYD,renderToolUseProgressMessage:_YD,renderToolResultMessage:YYD,async validateInput(H){let{query:$,allowed_domains:A,blocked_domains:L}=H;if(!$.length)return{result:!1,message:"Error: Missing query",errorCode:1};if(A?.length&&L?.length)return{result:!1,message:"Error: Cannot specify both allowed_domains and blocked_domains in the same request",errorCode:2};return{result:!0}},async call(H,$,A,L,I){let D=performance.now(),{query:B}=H,f=R$({content:"Perform a web search for the query: "+B}),E=B01(H),M=NL("tengu_plum_vx3",!1),G=await $.getAppState(),U=e6H({messages:[f],systemPrompt:["You are an assistant for performing a web search tool use"],maxThinkingTokens:M?0:$.options.maxThinkingTokens,tools:[],signal:$.abortController.signal,options:{getToolPermissionContext:async()=>G.toolPermissionContext,model:M?LJ():$.options.mainLoopModel,toolChoice:M?{type:"tool",name:"web_search"}:void 0,isNonInteractiveSession:$.options.isNonInteractiveSession,hasAppendSystemPrompt:!!$.options.appendSystemPrompt,extraToolSchemas:[E],querySource:"web_search_tool",agents:$.options.agentDefinitions.activeAgents,mcpTools:[],agentId:$.agentId,effortValue:G.effortValue}}),X=[],J=null,F="",Q=0,W=new Map;for await(let O of U){if(X.push(O),O.type==="stream_event"&&O.event?.type==="content_block_start"){let j=O.event.content_block;if(j&&j.type==="server_tool_use"){J=j.id,F="";continue}}if(J&&O.type==="stream_event"&&O.event?.type==="content_block_delta"){let j=O.event.delta;if(j?.type==="input_json_delta"&&j.partial_json){F+=j.partial_json;try{let u=F.match(/"query"\s*:\s*"((?:[^"\\]|\\.)*)"/);if(u&&u[1]){let y=DA('"'+u[1]+'"');if(!W.has(J)||W.get(J)!==y){if(W.set(J,y),Q++,I)I({toolUseID:`search-progress-${Q}`,data:{type:"query_update",query:y}})}}}catch{}}}if(O.type==="stream_event"&&O.event?.type==="content_block_start"){let j=O.event.content_block;if(j&&j.type==="web_search_tool_result"){let u=j.tool_use_id,y=W.get(u)||B,g=j.content;if(Q++,I)I({toolUseID:u||`search-progress-${Q}`,data:{type:"search_results_received",resultCount:Array.isArray(g)?g.length:0,query:y}})}}}let C=X.filter((O)=>O.type==="assistant").flatMap((O)=>O.message.content),Z=(performance.now()-D)/1000;return{data:f01(C,B,Z)}},mapToolResultToToolResultBlockParam(H,$){let{query:A,results:L}=H,I=`Web search results for query: "${A}" `):"Unknown error";return lp.createElement(V,{color:"error"},$)}function SCD(){return null}function jCD(H){return null}function RCD(H){return lp.createElement(V,{dimColor:!0},"Loaded ",lp.createElement(V,{bold:!0},H)," ",H===1?"tool":"tools"," \xB7"," ","/context")}var lp;var yCD=K(()=>{xH();_F();lp=b(s(),1)});function k01(H){return H.map(($)=>$.name).sort().join(",")}function u01(H){let $=k01(H);if(vCD!==$)N("ToolSearchTool: cache invalidated - deferred tools changed"),nzA.cache.clear?.(),vCD=$}function izA(H,$,A){return{data:{matches:H,query:$,total_deferred_tools:A}}}function hCD(H){if(H.startsWith("mcp__")){let A=H.replace(/^mcp__/,"").toLowerCase();return{parts:A.split("__").flatMap((I)=>I.split("_")).filter(Boolean),full:A.replace(/__/g," ").replace(/_/g," "),isMcp:!0}}let $=H.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").toLowerCase().split(/\s+/).filter(Boolean);return{parts:$,full:$.join(" "),isMcp:!1}}function bCD(H,$){return new RegExp(`\\b${$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(H)}async function g01(H,$,A,L){let I=H.toLowerCase().trim(),D=$.find((X)=>X.name.toLowerCase()===I);if(D)return[D.name];if(I.startsWith("mcp__")&&I.length>5){let X=$.filter((J)=>J.name.toLowerCase().startsWith(I)).slice(0,L).map((J)=>J.name);if(X.length>0)return X}let B=I.split(/\s+/).filter((X)=>X.length>0),f=[],E=[];for(let X of B)if(X.startsWith("+")&&X.length>1)f.push(X.slice(1));else E.push(X);let M=$;if(f.length>0)M=(await Promise.all($.map(async(J)=>{let F=hCD(J.name),W=(await nzA(J.name,A)).toLowerCase();return f.every((C)=>F.parts.includes(C)||F.parts.some((Y)=>Y.includes(C))||bCD(W,C))?J:null}))).filter((J)=>J!==null);let G=f.length>0?[...f,...E]:B;return(await Promise.all(M.map(async(X)=>{let J=hCD(X.name),Q=(await nzA(X.name,A)).toLowerCase(),W=0;for(let P of G){if(J.parts.includes(P))W+=J.isMcp?12:10;else if(J.parts.some((C)=>C.includes(P)))W+=J.isMcp?6:5;if(J.full.includes(P)&&W===0)W+=3;if(bCD(Q,P))W+=2}return{name:X.name,score:W}}))).filter((X)=>X.score>0).sort((X,J)=>J.score-X.score).slice(0,L).map((X)=>X.name)}var h01,b01,vCD=null,nzA,pC$;var rzA=K(()=>{mI();ia();yCD();GT();E$();z$();tD();h01=S.object({query:S.string().describe('Query to find deferred tools. Use "select:" for direct selection, or keywords to search.'),max_results:S.number().optional().default(5).describe("Maximum number of results to return (default: 5)")}),b01=S.object({matches:S.array(S.string()),query:S.string(),total_deferred_tools:S.number()});nzA=o$(async(H,$)=>{let A=$.find((L)=>L.name===H);if(!A)return"";return A.prompt({getToolPermissionContext:async()=>({mode:"default",additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1}),tools:$,agents:[]})},(H)=>H);pC$={isEnabled(){return Sm()},isConcurrencySafe(){return!0},isReadOnly(){return!0},name:C7,maxResultSizeChars:1e5,async description(H,{tools:$}){return OF$($)},async prompt({tools:H}){return OF$(H)},inputSchema:h01,outputSchema:b01,async call(H,{options:{tools:$},addNotification:A}){let{query:L,max_results:I=5}=H,D=$.filter(U3);u01(D);function B(G){if(G.length===0)return;A?.({key:`tool-search-${Date.now()}`,jsx:RCD(G.length),priority:"immediate",timeoutMs:3000})}function f(G,U){c("tengu_tool_search_outcome",{query:L,queryType:U,matchCount:G.length,totalDeferredTools:D.length,maxResults:I,hasMatches:G.length>0})}let E=L.match(/^select:(.+)$/i);if(E){let G=E[1].trim(),U=D.find((X)=>X.name===G);if(!U)return N(`ToolSearchTool: select failed - tool not found: ${G}`),f([],"select"),izA([],L,D.length);return N(`ToolSearchTool: selected "${G}"`),f([U.name],"select"),B([U.name]),izA([U.name],L,D.length)}let M=await g01(L,D,$,I);return N(`ToolSearchTool: keyword search for "${L}", found ${M.length} matches`),f(M,"keyword"),B(M),izA(M,L,D.length)},async checkPermissions(H){return{behavior:"allow",updatedInput:H}},renderToolUseMessage:NCD,userFacingName:()=>"",renderToolUseRejectedMessage:OCD,renderToolUseErrorMessage:xCD,renderToolUseProgressMessage:SCD,renderToolResultMessage:jCD,mapToolResultToToolResultBlockParam(H,$){if(H.matches.length===0)return{type:"tool_result",tool_use_id:$,content:"No matching deferred tools found"};return{type:"tool_result",tool_use_id:$,content:H.matches.map((A)=>({type:"tool_reference",tool_name:A}))}}}});function kCD(){if(process.env.CLAUDE_CODE_PLAN_V2_AGENT_COUNT){let A=parseInt(process.env.CLAUDE_CODE_PLAN_V2_AGENT_COUNT,10);if(!isNaN(A)&&A>0&&A<=10)return A}let H=f0(),$=Ri();if(H==="max"&&$==="default_claude_max_20x")return 3;if(H==="enterprise"||H==="team")return 3;return 1}function uCD(){if(process.env.CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT){let H=parseInt(process.env.CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT,10);if(!isNaN(H)&&H>0&&H<=10)return H}return 3}function c5(){let H=process.env.CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE;if(A$(H))return!0;if(BE(H))return!1;return NL("tengu_plan_mode_interview_phase",!1)}var b9H=K(()=>{SD();EI();NA()});function p01(){let H=c5()?"":m01;return`Use this tool proactively when you're about to start a non-trivial implementation task. Getting user sign-off on your approach before writing code prevents wasted effort and ensures alignment. This tool transitions you into plan mode where you can explore the codebase and design an implementation approach for user approval. Remember: DO NOT write or edit any files yet. This is a read-only exploration and planning phase.`,tool_use_id:$}}}});var ozA,tzA,rCD;var szA=K(()=>{ozA=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","notifications_disabled"],tzA=["normal","vim"],rCD=["auto","tmux","in-process"]});function l01(H){let $=H.find((I)=>I.role==="user");if(!$)return"";let A=$.content;if(typeof A==="string")return A;let L=A.find((I)=>I.type==="text");return L?.type==="text"?L.text:""}async function k9H(H){let{model:$,system:A,messages:L,tools:I,tool_choice:D,output_format:B,max_tokens:f=1024,maxRetries:E=2,signal:M,skipSystemPromptPrefix:G,temperature:U,thinking:X}=H,J=await eO({maxRetries:E,model:$}),F=[...U2($)];if(B&&!F.includes(Oc))F.push(Oc);let Q=l01(L),W=IBA(Q,{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION),P=h9$(W),C=[P?{type:"text",text:P}:null,...G?[]:[{type:"text",text:v9$({isNonInteractive:!1,hasAppendSystemPrompt:!1})}],...Array.isArray(A)?A:A?[{type:"text",text:A}]:[]].filter((q)=>q!==null),Y=X?{type:"enabled",budget_tokens:X}:void 0;return await J.beta.messages.create({model:vu($),max_tokens:f,system:C,messages:L,...I&&{tools:I},...D&&{tool_choice:D},...B&&{output_config:{format:B}},...U!==void 0&&{temperature:U},...Y&&{thinking:Y},...F.length>0&&{betas:F},metadata:qr()},{signal:M})}var GuH=K(()=>{fSH();dU();$q();JHH();b9$();DBA();aI()});async function dC$(H){let $=H.trim();if(!$)return{valid:!1,error:"Model name cannot be empty"};let A=$.toLowerCase();if(V5H.includes(A))return{valid:!0};if(aCD.has($))return{valid:!0};try{return await k9H({model:$,max_tokens:1,maxRetries:0,messages:[{role:"user",content:[{type:"text",text:"Hi",cache_control:{type:"ephemeral"}}]}]}),aCD.set($,!0),{valid:!0}}catch(L){return i01(L,$)}}function i01(H,$){if(H instanceof yAH)return{valid:!1,error:`Model '${$}' not found`};if(H instanceof JD){if(H instanceof RAH)return{valid:!1,error:"Authentication failed. Please check your API credentials."};if(H instanceof k6)return{valid:!1,error:"Network error. Please check your internet connection."};let L=H.error;if(L&&typeof L==="object"&&"type"in L&&L.type==="not_found_error"&&"message"in L&&typeof L.message==="string"&&L.message.includes("model:"))return{valid:!1,error:`Model '${$}' not found`};return{valid:!1,error:`API error: ${H.message}`}}return{valid:!1,error:`Unable to validate model: ${H instanceof Error?H.message:String(H)}`}}var aCD;var ezA=K(()=>{aI();GuH();n_();aCD=new Map});var n01;var HNA=K(()=>{Ky();szA();ezA();aI();n01={theme:{source:"global",type:"string",description:"Color theme for the UI",options:asL},editorMode:{source:"global",type:"string",description:"Key binding mode",options:tzA},verbose:{source:"global",type:"boolean",description:"Show detailed debug output",appStateKey:"verbose"},preferredNotifChannel:{source:"global",type:"string",description:"Preferred notification channel",options:ozA},autoCompactEnabled:{source:"global",type:"boolean",description:"Auto-compact when context is full"},fileCheckpointingEnabled:{source:"global",type:"boolean",description:"Enable file checkpointing for code rewind"},showTurnDuration:{source:"global",type:"boolean",description:'Show turn duration message after responses (e.g., "Cooked for 1m 6s")'},todoFeatureEnabled:{source:"global",type:"boolean",description:"Enable todo/task tracking"},model:{source:"settings",type:"string",description:"Override the default model",appStateKey:"mainLoopModel",getOptions:()=>{try{return fLH().filter((H)=>H.value!==null).map((H)=>H.value)}catch{return["sonnet","opus","haiku"]}},validateOnWrite:(H)=>dC$(String(H)),formatOnRead:(H)=>H===null?"default":H},alwaysThinkingEnabled:{source:"settings",type:"boolean",description:"Enable extended thinking (false to disable)",appStateKey:"thinkingEnabled"},"permissions.defaultMode":{source:"settings",type:"string",description:"Default permission mode for tool usage",options:["default","plan","acceptEdits","dontAsk"]},language:{source:"settings",type:"string",description:'Preferred language for Claude responses (e.g., "japanese", "spanish")'},teammateMode:{source:"global",type:"string",description:'How to spawn teammates: "tmux" for traditional tmux, "in-process" for same process, "auto" to choose automatically',options:rCD},...{}}});var oCD=K(()=>{HNA();aI()});var a01;var tCD=K(()=>{xH();j5();iB();Z$();a01=b(s(),1)});var mAM,pAM;var sCD=K(()=>{mI();oCD();HNA();tCD();vA();mL();z$();_$();Z$();zF$();mAM=S.strictObject({setting:S.string().describe('The setting key (e.g., "theme", "model", "permissions.defaultMode")'),value:S.union([S.string(),S.boolean(),S.number()]).optional().describe("The new value. Omit to get current value.")}),pAM=S.object({success:S.boolean(),operation:S.enum(["get","set"]).optional(),setting:S.string().optional(),value:S.unknown().optional(),previousValue:S.unknown().optional(),newValue:S.unknown().optional(),error:S.string().optional()})});function H2D(){let H=dL()?" and potentially assigned to teammates":"",$=dL()?"- New tasks are created with status 'open' and no owner - use TaskUpdate with the `owner` parameter to assign them\n":"";return`Use this tool to create a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user. - **Custom agents** defined in \`.claude/agents/\` may have their own tool restrictions. Check their descriptions to understand what they can and cannot do. - A team file at \`~/.claude/teams/{team-name}.json\` - A corresponding task list directory at \`~/.claude/tasks/{team-name}/\` - **Team config location**: \`~/.claude/teams/{team-name}/config.json\` Use the Read tool to read ~/.claude/teams/{team-name}/config.json Teams share a task list that all teammates can access at \`~/.claude/tasks/{team-name}/\`. - Removes the team directory (\`~/.claude/teams/{team-name}/\`) - Removes the task directory (\`~/.claude/tasks/{team-name}/\`) `).map((M)=>M.trim()).filter(Boolean)}catch(B){return N(`File suggestion helper failed: ${B}`,{level:"error"}),[]}}async function x91({hook:H,messages:$,hookName:A,toolUseID:L,hookEvent:I,timeoutMs:D,signal:B}){let f=H.timeout??D,{signal:E,cleanup:M}=yT(AbortSignal.timeout(f),B);try{if(E.aborted)return M(),{outcome:"cancelled",hook:H};let G=await new Promise((U,X)=>{let J=()=>X(Error("Function hook cancelled"));E.addEventListener("abort",J),Promise.resolve(H.callback($,E)).then((F)=>{E.removeEventListener("abort",J),U(F)}).catch((F)=>{E.removeEventListener("abort",J),X(F)})});if(M(),G)return{outcome:"success",hook:H};return{blockingError:{blockingError:H.errorMessage,command:"function"},outcome:"blocking",hook:H}}catch(G){if(M(),G instanceof Error&&(G.message==="Function hook cancelled"||G.name==="AbortError"))return{outcome:"cancelled",hook:H};return r(G instanceof Error?G:Error(String(G))),{message:QB({type:"hook_error_during_execution",hookName:A,toolUseID:L,hookEvent:I,content:G instanceof Error?G.message:"Function hook execution error"}),outcome:"non_blocking_error",hook:H}}}async function S91({toolUseID:H,hook:$,hookEvent:A,hookInput:L,signal:I,hookIndex:D,toolUseContext:B}){let f=B?{getAppState:B.getAppState,setAppState:B.setAppState}:void 0,E=await $.callback(L,H,I,D,f);if(qBH(E))return{outcome:"success",hook:$};return{...xwD({json:E,command:"callback",hookName:`${A}:Callback`,toolUseID:H,hookEvent:A,expectedHookEvent:A,stdout:void 0,stderr:void 0,exitCode:void 0}),outcome:"success",hook:$}}function TwD(H){return H.map(({hook:$})=>{if($.type==="command")return{type:"command",command:$.command};else if($.type==="prompt")return{type:"prompt",prompt:$.prompt};else if($.type==="function")return{type:"function",name:"function"};else if($.type==="callback")return{type:"callback",name:"callback"};return{type:"unknown"}})}var zwD,EC,n7=600000;var _3=K(()=>{n7A();PI();r7A();iF$();Z9();g$();vA();XDH();rB();mL();z$();sa();UQ();Lo();n6A();r0();Av();E$();_$();RyH();gK$();uK$();J3();TBH();ahI();ZwD();pg();Z$();zwD=require("child_process"),EC=require("crypto")});async function r7(H,{sessionId:$,agentType:A,model:L,forceSyncExecution:I}={}){let D=[],B=[];if(dg())N("Skipping plugin hooks - allowManagedHooksOnly is enabled");else try{await da()}catch(E){let M=E instanceof Error?Error(`Failed to load plugin hooks during ${H}: ${E.message}`):Error(`Failed to load plugin hooks during ${H}: ${String(E)}`);if(E instanceof Error&&E.stack)M.stack=E.stack;r(M);let G=E instanceof Error?E.message:String(E),U="";if(G.includes("Failed to clone")||G.includes("network")||G.includes("ETIMEDOUT")||G.includes("ENOTFOUND"))U="This appears to be a network issue. Check your internet connection and try again.";else if(G.includes("Permission denied")||G.includes("EACCES")||G.includes("EPERM"))U="This appears to be a permissions issue. Check file permissions on ~/.claude/plugins/";else if(G.includes("Invalid")||G.includes("parse")||G.includes("JSON")||G.includes("schema"))U="This appears to be a configuration issue. Check your plugin settings in .claude/settings.json";else U="Please fix the plugin configuration or remove problematic plugins from your settings.";N(`Warning: Failed to load plugin hooks. SessionStart hooks from plugins will not execute. Error: ${G}. ${U}`,{level:"warn"})}let f=A??lYH();for await(let E of PNA(H,$,f,L,void 0,void 0,I)){if(E.message)D.push(E.message);if(E.additionalContexts&&E.additionalContexts.length>0)B.push(...E.additionalContexts)}if(B.length>0){let E=QB({type:"hook_additional_context",content:B,hookName:"SessionStart",toolUseID:"SessionStart",hookEvent:"SessionStart"});D.push(E)}return D}async function nC$(H,{forceSyncExecution:$}={}){let A=[],L=[];if(dg())N("Skipping plugin hooks - allowManagedHooksOnly is enabled");else try{await da()}catch(I){let D=I instanceof Error?I.message:String(I);N(`Warning: Failed to load plugin hooks. Setup hooks from plugins will not execute. Error: ${D}`,{level:"warn"})}for await(let I of _NA(H,void 0,void 0,$)){if(I.message)A.push(I.message);if(I.additionalContexts&&I.additionalContexts.length>0)L.push(...I.additionalContexts)}if(L.length>0){let I=QB({type:"hook_additional_context",content:L,hookName:"Setup",toolUseID:"Setup",hookEvent:"Setup"});A.push(I)}return A}var bt=K(()=>{_3();aRH();_$();E$();J3();XDH();g$()});function j91(H){if(H.type!=="attachment")return H;let $=H.attachment;if($.type==="new_file")return{...H,attachment:{...$,type:"file"}};if($.type==="new_directory")return{...H,attachment:{...$,type:"directory"}};return H}function QuH(H){try{let $=H.map(j91),A=new Set(qR);for(let f of $)if(f.type==="user"&&f.permissionMode!==void 0&&!A.has(f.permissionMode))f.permissionMode=void 0;let L=GY$($),I=_kH(L),D=PkH(I);if(D[D.length-1]?.type==="user")D.push(PT({content:LDH}));return D}catch($){throw r($),$}}function R91(H){for(let $ of H){if($.type!=="attachment")continue;if($.attachment.type!=="invoked_skills")continue;for(let A of $.attachment.skills)if(A.name&&A.path&&A.content)cYH(A.name,A.path,A.content)}}async function kt(H,$){try{let A=null,L=null,I;if(H===void 0)A=await TNA(0);else if($){L=[];for(let B of await G$H($)){if(B.type==="assistant"||B.type==="user"){let f=y91(B);if(f)L.push(f)}I=B.session_id}}else if(typeof H==="string")A=await qNA(H),I=H;else A=H;if(!A&&!L)return null;if(A){if(Qz(A))A=await cS(A);if(!I)I=mM(A);if(BF$(A),I)EF$(A,Z7(I));bY$(A),L=A.messages}R91(L),L=QuH(L);let D=await r7("resume",{sessionId:I});return L.push(...D),{messages:L,fileHistorySnapshots:A?.fileHistorySnapshots,attributionSnapshots:A?.attributionSnapshots,sessionId:I,agentName:A?.agentName,agentColor:A?.agentColor,agentSetting:A?.agentSetting,customTitle:A?.customTitle,tag:A?.tag,mode:A?.mode,fullPath:A?.fullPath}}catch(A){throw r(A),A}}function y91(H){if(H.type==="assistant")return{type:H.type,message:H.message,uuid:ZNA.randomUUID(),timestamp:new Date().toISOString(),requestId:void 0};else if(H.type==="user")return{type:H.type,message:H.message,uuid:ZNA.randomUUID(),timestamp:new Date().toISOString()};return}var ZNA;var I3H=K(()=>{_$();rB();_L();jv();gQ();Fd$();nM();bt();AC();g$();ZNA=require("crypto")});function jwD({onStashAndContinue:H,onCancel:$}){let[A,L]=u9H.useState(null),I=A!==null?[...A.tracked,...A.untracked]:[],[D,B]=u9H.useState(!0),[f,E]=u9H.useState(!1),[M,G]=u9H.useState(null);u9H.useEffect(()=>{(async()=>{try{let Q=await Zd$();L(Q)}catch(Q){let W=Q instanceof Error?Q.message:String(Q);N(`Error getting changed files: ${W}`,{level:"error"}),G("Failed to get changed files")}finally{B(!1)}})()},[]);let U=async()=>{E(!0);try{if(N("Stashing changes before teleport..."),await y9L("Teleport auto-stash"))N("Successfully stashed changes"),H();else G("Failed to stash changes")}catch(F){let Q=F instanceof Error?F.message:String(F);N(`Error stashing changes: ${Q}`,{level:"error"}),G("Failed to stash changes")}finally{E(!1)}},X=(F)=>{if(F==="stash")U();else $()};if(D)return RX.default.createElement(x,{flexDirection:"column",padding:1},RX.default.createElement(x,{marginBottom:1},RX.default.createElement(vD,null),RX.default.createElement(V,null," Checking git status",pH.ellipsis)));if(M)return RX.default.createElement(x,{flexDirection:"column",padding:1},RX.default.createElement(V,{bold:!0,color:"error"},"Error: ",M),RX.default.createElement(x,{marginTop:1},RX.default.createElement(V,{dimColor:!0},"Press "),RX.default.createElement(V,{bold:!0},"Escape"),RX.default.createElement(V,{dimColor:!0}," to cancel")));let J=I.length>8;return RX.default.createElement(BL,{title:"Working Directory Has Changes",onCancel:$,borderDimColor:!0},RX.default.createElement(V,null,"Teleport will switch git branches. The following changes were found:"),RX.default.createElement(x,{flexDirection:"column",paddingLeft:2},I.length>0?J?RX.default.createElement(V,null,I.length," files changed"):I.map((F,Q)=>RX.default.createElement(V,{key:Q},F)):RX.default.createElement(V,{dimColor:!0},"No changes detected")),RX.default.createElement(V,null,"Would you like to stash these changes and continue with teleport?"),f?RX.default.createElement(x,null,RX.default.createElement(vD,null),RX.default.createElement(V,null," Stashing changes...")):RX.default.createElement(QA,{options:[{label:"Stash changes and continue",value:"stash"},{label:"Exit",value:"exit"}],onChange:X}))}var RX,u9H;var RwD=K(()=>{xH();t8();E$();JM();l8();jI();bB();RX=b(s(),1),u9H=b(s(),1)});async function D3H(){let H=dD()?.accessToken;if(!H)throw Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let $=await jR();if(!$)throw Error("Unable to get organization UUID");let A=`${XD().BASE_API_URL}/v1/environment_providers`;try{let L={...xK(H),"x-organization-uuid":$},I=await nA.get(A,{headers:L,timeout:15000});if(I.status!==200)throw Error(`Failed to fetch environments: ${I.status} ${I.statusText}`);return I.data.environments}catch(L){let I=L instanceof Error?L:Error(String(L));throw r(I),Error(`Failed to fetch environments: ${I.message}`)}}var rC$=K(()=>{w1();qE();EI();Hq();_$();YS()});async function aC$(){if(!nL())return!1;return iW()}async function ywD(){return await R$H({ignoreUntracked:!0})}async function vwD(){try{return(await D3H()).length>0}catch(H){return N(`checkHasRemoteEnvironment failed: ${H instanceof Error?H.message:String(H)}`),!1}}async function hwD(){return await _S()!==null}async function bwD(H,$){try{let A=dD()?.accessToken;if(!A)return N("checkGithubAppInstalled: No access token found, assuming app not installed"),!1;let L=await jR();if(!L)return N("checkGithubAppInstalled: No org UUID found, assuming app not installed"),!1;let I=`${XD().BASE_API_URL}/api/oauth/organizations/${L}/code/repos/${H}/${$}`,D={...xK(A),"x-organization-uuid":L};N(`Checking GitHub app installation for ${H}/${$}`);let B=await nA.get(I,{headers:D,timeout:15000});if(B.status===200){if(B.data.status){let f=B.data.status.app_installed;return N(`GitHub app ${f?"is":"is not"} installed on ${H}/${$}`),f}return N(`GitHub app is not installed on ${H}/${$} (status is null)`),!1}return N(`checkGithubAppInstalled: Unexpected response status ${B.status}`),!1}catch(A){if(nA.isAxiosError(A)){let L=A.response?.status;if(L&&L>=400&&L<500)return N(`checkGithubAppInstalled: Got ${L} error, app likely not installed on ${H}/${$}`),!1}return N(`checkGithubAppInstalled error: ${A instanceof Error?A.message:String(A)}`),!1}}var zNA=K(()=>{t8();EI();I9H();rC$();Hq();qE();YS();w1();E$()});function oC$({onComplete:H,errorsToIgnore:$=new Set}){let[A,L]=bF.useState(null),[I,D]=bF.useState(!1),B=bF.useCallback(async()=>{let X=await NNA(),J=new Set(Array.from(X).filter((F)=>!$.has(F)));if(J.size===0){H();return}if(J.has("needsLogin"))L("needsLogin");else if(J.has("needsGitStash"))L("needsGitStash")},[H,$]);bF.useEffect(()=>{B()},[B]);let f=bF.useCallback(()=>{L9(0)},[]),E=bF.useCallback(()=>{D(!1),B()},[B]),M=bF.useCallback(()=>{D(!0)},[D]),G=bF.useCallback((X)=>{if(X==="login")M();else f()},[M,f]),U=bF.useCallback(()=>{B()},[B]);if(!A)return null;switch(A){case"needsGitStash":return bF.default.createElement(jwD,{onStashAndContinue:U,onCancel:f});case"needsLogin":{if(I)return bF.default.createElement(s0H,{onDone:E,mode:"login",forceLoginMethod:"claudeai"});return bF.default.createElement(BL,{title:"Log in to Claude",onCancel:f,borderDimColor:!0},bF.default.createElement(x,{flexDirection:"column"},bF.default.createElement(V,{dimColor:!0},"Teleport requires a Claude.ai account."),bF.default.createElement(V,{dimColor:!0},"Your Claude Pro/Max subscription will be used by Claude Code.")),bF.default.createElement(QA,{options:[{label:"Login with Claude account",value:"login"},{label:"Exit",value:"exit"}],onChange:G}))}}}async function NNA(){let H=new Set,[$,A]=await Promise.all([aC$(),ywD()]);if($)H.add("needsLogin");if(!A)H.add("needsGitStash");return H}var bF;var ONA=K(()=>{xH();bB();l8();SbH();RwD();UU();zNA();bF=b(s(),1)});function uwD(H){let $=kwD.get(H);if(!$)$=rR(async(A,L,I)=>await h91(H,A,L,I)),kwD.set(H,$);return $}async function h91(H,$,A,L){for(let I=1;I<=tC$;I++){try{let B=sC$.get(H),f={...L};if(B)f["Last-Uuid"]=B;let E=await nA.put(A,$,{headers:f,validateStatus:(M)=>M<500});if(E.status===200||E.status===201)return sC$.set(H,$.uuid),N(`Successfully persisted session log entry for session ${H}`),!0;if(E.status===409){if(E.headers["x-last-uuid"]===$.uuid)return sC$.set(H,$.uuid),N(`Session entry ${$.uuid} already present on server, recovering from stale state`),EL("info","session_persist_recovered_from_409"),!0;let U=E.data.error?.message||"Concurrent modification detected";return r(Error(`Session persistence conflict: UUID mismatch for session ${H}, entry ${$.uuid}. ${U}`)),EL("error","session_persist_fail_concurrent_modification"),!1}if(E.status===401)return N("Session token expired or invalid"),EL("error","session_persist_fail_bad_token"),!1;N(`Failed to persist session log: ${E.status} ${E.statusText}`),EL("error","session_persist_fail_status",{status:E.status,attempt:I})}catch(B){let f=B;r(Error(`Error persisting session log: ${f.message}`)),EL("error","session_persist_fail_status",{status:f.status,attempt:I})}if(I===tC$)return N(`Remote persistence failed after ${tC$} attempts`),EL("error","session_persist_error_retries_exhausted",{attempt:I}),!1;let D=Math.min(v91*Math.pow(2,I-1),8000);N(`Remote persistence attempt ${I}/${tC$} failed, retrying in ${D}ms\u2026`),await new Promise((B)=>setTimeout(B,D))}return!1}async function gwD(H,$,A){let L=wY();if(!L)return N("No session token available for session persistence"),EL("error","session_persist_fail_jwt_no_token"),!1;let I={Authorization:`Bearer ${L}`,"Content-Type":"application/json"};return await uwD(H)($,A,I)}async function mwD(H,$){try{let{accessToken:A,orgUUID:L}=await Zw(),I=`${XD().BASE_API_URL}/v1/session_ingress/session/${H}`,D={...xK(A),"x-organization-uuid":L};return await uwD(H)($,I,D)}catch(A){return N(`Failed to get OAuth credentials: ${A instanceof Error?A.message:String(A)}`),EL("error","session_persist_fail_oauth_no_token"),!1}}async function pwD(H,$){let A=wY();if(!A)return N("No session token available for fetching session logs"),EL("error","session_get_fail_no_token"),null;let L={Authorization:`Bearer ${A}`},I=await cwD(H,$,L);if(I&&I.length>0){let D=I[I.length-1];if(D&&"uuid"in D&&D.uuid)sC$.set(H,D.uuid)}return I}async function dwD(H,$,A){let L=`${XD().BASE_API_URL}/v1/session_ingress/session/${H}`;N(`[session-ingress] Fetching session logs from: ${L}`);let I={...xK($),"x-organization-uuid":A};return await cwD(H,L,I)}async function cwD(H,$,A){try{let L=await nA.get($,{headers:A,timeout:20000,validateStatus:(I)=>I<500});if(L.status===200){let I=L.data;if(!I||typeof I!=="object"||!Array.isArray(I.loglines))return r(Error(`Invalid session logs response format: ${yH(I)}`)),EL("error","session_get_fail_invalid_response"),null;let D=I.loglines;return N(`Fetched ${D.length} session logs for session ${H}`),D}if(L.status===404)return N(`No existing logs for session ${H}`),EL("warn","session_get_no_logs_for_session"),[];if(L.status===401)throw N("Auth token expired or invalid"),EL("error","session_get_fail_bad_token"),Error("Your session has expired. Please run /login to sign in again.");return N(`Failed to fetch session logs: ${L.status} ${L.statusText}`),EL("error","session_get_fail_status",{status:L.status}),null}catch(L){let I=L;return r(Error(`Error fetching session logs: ${I.message}`)),EL("error","session_get_fail_status",{status:I.status}),null}}var sC$,tC$=10,v91=500,kwD;var eC$=K(()=>{w1();_$();E$();Ga();qE();YS();Z6();Z$();sC$=new Map,kwD=new Map});function k91(H){if(H===null)return a7("Session resumed","suggestion");let $=H instanceof AK?H.formattedMessage:H.message;return a7(`Session resumed without branch: ${$}`,"warning")}function u91(){return R$({content:`This session is being continued from another machine. Application state may have changed. The updated working directory is ${zL()}`,isMeta:!0})}async function m91(H,$){let A=H.length>75?`${H.slice(0,75)}\u2026`:H,L="claude/task";try{let I=g91.replace("{description}",H),B=(await OQ({systemPrompt:[],userPrompt:I,outputFormat:{type:"json_schema",schema:{type:"object",properties:{title:{type:"string"},branch:{type:"string"}},required:["title","branch"],additionalProperties:!1}},signal:$,options:{querySource:"teleport_generate_title",agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content[0];if(B?.type!=="text")return{title:A,branchName:"claude/task"};let f=q1(B.text.trim()),E=S.object({title:S.string(),branch:S.string()}).safeParse(f);if(E.success)return{title:E.data.title||A,branchName:E.data.branch||"claude/task"};return{title:A,branchName:"claude/task"}}catch(I){return r(Error(`Error generating title and branch: ${I}`)),{title:A,branchName:"claude/task"}}}async function A2$(){if(!await R$H({ignoreUntracked:!0}))throw c("tengu_teleport_error_git_not_clean",{}),new AK("Git working directory is not clean. Please commit or stash your changes before using --teleport.",oH.red(`Error: Git working directory is not clean. Please commit or stash your changes before using --teleport. `));await d91(H)}async function H2$(){let{stdout:H}=await jA(cB(),["branch","--show-current"]);return H.trim()}function B3H(H,$){return[...QuH(H),u91(),k91($)]}async function f3H(H){try{let $=await H2$();if(N(`Current branch before teleport: '${$}'`),H){N(`Switching to branch '${H}'...`),await p91(H),await c91(H);let L=await H2$();N(`Branch after checkout: '${L}'`)}else N("No branch specified, staying on current branch");return{branchName:await H2$(),branchError:null}}catch($){let A=await H2$(),L=$ instanceof Error?$:Error(String($));return{branchName:A,branchError:L}}}async function xNA(H){let $=await _S(),A=H.session_context.sources.find((I)=>I.type==="git_repository");if(!A?.url)return N($?"Session has no associated repository, proceeding without validation":"Session has no repo requirement and not in git directory, proceeding"),{status:"no_repo_required"};let L=L9H(A.url);if(!L)return{status:"no_repo_required"};if(N(`Session is for repository: ${L}, current repo: ${$??"none"}`),!$)return{status:"not_in_repo",sessionRepo:L,currentRepo:null};if($.toLowerCase()===L.toLowerCase())return{status:"match",sessionRepo:L,currentRepo:$};return{status:"mismatch",sessionRepo:L,currentRepo:$}}async function ut(H,$){if(!PK("allow_remote_sessions"))throw Error("Remote sessions are disabled by your organization's policy.");N(`Resuming code session ID: ${H}`);try{let A=dD()?.accessToken;if(!A)throw c("tengu_teleport_resume_error",{error_type:"no_access_token"}),Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let L=await jR();if(!L)throw c("tengu_teleport_resume_error",{error_type:"no_org_uuid"}),Error("Unable to get organization UUID for constructing session URL");$?.("validating");let I=await gbH(H),D=await xNA(I);switch(D.status){case"match":case"no_repo_required":break;case"not_in_repo":throw c("tengu_teleport_error_repo_not_in_git_dir_sessions_api",{sessionId:H}),new AK(`You must run claude --teleport ${H} from a checkout of ${D.sessionRepo}.`,oH.red(`You must run claude --teleport ${H} from a checkout of ${oH.bold(D.sessionRepo)}. `));case"mismatch":throw c("tengu_teleport_error_repo_mismatch_sessions_api",{sessionId:H}),new AK(`You must run claude --teleport ${H} from a checkout of ${D.sessionRepo}. This repo is ${D.currentRepo}.`,oH.red(`You must run claude --teleport ${H} from a checkout of ${oH.bold(D.sessionRepo)}. You should keep it short and simple, ideally no more than 4 words. The branch should always start with "claude/" and should be all lower case, with words separated by dashes. Example 1: {"title": "Fix login button not working on mobile", "branch": "claude/fix-mobile-login-button"} Example 2: {"title": "Update README with installation instructions", "branch": "claude/update-readme"} Example 3: {"title": "Improve performance of data processing script", "branch": "claude/improve-data-processing"} Please generate a title and branch name for this session.`;var ip=K(()=>{B0();t8();I3H();r0();lG();E$();nM();mI();_$();xH();pL();sv();ONA();EI();Hq();w1();qE();EI();I9H();dU();aI();z$();_L();g$();XY();YS();rC$();mL();eC$();rB();Z$();AS();lwD=require("crypto"),$2$=b(s(),1)});async function rwD(){let H=[];if(!PK("allow_remote_sessions"))return H.push({type:"policy_blocked"}),H;let[$,A,L,I]=await Promise.all([aC$(),vwD(),hwD(),_S()]);if($)H.push({type:"not_logged_in"});if(!A)H.push({type:"no_remote_environment"});if(!L)H.push({type:"not_in_git_repo"});if(I){let[D,B]=I.split("/");if(D&&B){if(!await bwD(D,B))H.push({type:"github_app_not_installed"})}}return H}var awD=K(()=>{zNA();I9H();XY()});async function L2$(){let H=await rwD();if(H.length>0)return{eligible:!1,errors:H};return{eligible:!0}}function I2$(H){switch(H.type){case"not_logged_in":return"Please run /login and sign in with your Claude.ai account (not Console).";case"no_remote_environment":return"No environments available, please ensure you've gone through onboarding at claude.ai/code";case"not_in_git_repo":return"Background tasks require a git repository. Initialize git or run from a git repository.";case"github_app_not_installed":return`The Claude GitHub app must be installed on this repository first. https://github.com/apps/claude/installations/new`;case"policy_blocked":return"Remote sessions are disabled by your organization's policy."}}function n91(H,$,A,L){let I=A==="completed"?"completed successfully":A==="failed"?"failed":"was stopped",D=vM(H),B=`<${G5}> `)}if(d1(H,$.setAppState,(X)=>({...X,status:M==="starting"?"running":M,log:f.log,todoList:r91(f.log),deltaSummarySinceLastFlushToAttachment:U,endTime:E?Date.now():void 0})),E){let X=E.subtype==="success"?"completed":"failed";n91(H,B.title,X,$.setAppState);return}}catch(D){r(D instanceof Error?D:Error(String(D)))}if(A)setTimeout(I,L)};return I(),()=>{A=!1}}function m9H(H){return i4$(H,process.env.SESSION_INGRESS_URL)}function twD(H){return`claude --teleport ${H}`}var np,owD;var H3H=K(()=>{xH();KBH();_$();E$();CP();bx();YP();ip();dU();_L();q5H();awD();Z$();EE();np=b(s(),1);owD={name:"RemoteAgentTask",type:"remote_agent",async spawn(H,$){let{command:A,title:L}=H,{abortController:I}=$;N(`RemoteAgentTask spawning: ${L}`);let D=await g9H({initialMessage:A,description:L,signal:I.signal});if(!D)throw Error("Failed to create remote session");let{taskId:B,cleanup:f}=fuH({session:{id:D.id,title:D.title||L},command:A,context:$});return{taskId:B,cleanup:f}},async kill(H,$){d1(H,$.setAppState,(A)=>{if(A.status!=="running")return A;return{...A,status:"killed",endTime:Date.now()}}),N(`RemoteAgentTask ${H} marked as killed (local only)`)},renderStatus(H){let $=H,A=$.status,L=$.title;return np.createElement(x,null,np.createElement(V,{color:A==="running"?"warning":A==="completed"?"success":A==="failed"?"error":"inactive"},"[",A,"] ",L))},renderOutput(H){return np.createElement(x,null,np.createElement(V,null,H))},getProgressMessage(H){let A=H.deltaSummarySinceLastFlushToAttachment;if(!A)return null;return`Remote task ${H.id} progress: ${A}. Read ${H.outputFile} to see full output.`}}});function t91(){return[UQH,gF$,owD]}function IuH(H){return t91().find(($)=>$.type===H)}var RzA=K(()=>{_BH();oa();H3H()});function d1(H,$,A){$((L)=>{let I=L.tasks?.[H];if(!I)return L;return{...L,tasks:{...L.tasks,[H]:A(I)}}})}function qP(H,$){$((A)=>({...A,tasks:{...A.tasks,[H.id]:H}}))}function swD(H){if(H.type==="local_bash"){let $=H;return{...$,lastReportedStdoutLines:$.stdoutLineCount,lastReportedStderrLines:$.stderrLineCount}}if(H.type==="local_agent"){let $=H;return{...$,lastReportedToolCount:$.progress?.toolUseCount??0,lastReportedTokenCount:$.progress?.tokenCount??0}}return H}function ewD(H){let $=[],A=[],L={},I=H.tasks??{};for(let D of Object.values(I)){if(D.notified&&D.status!=="running")continue;let B=null;if(D.status==="running"){let f=y7A(D.id,D.outputOffset);if(f.content){let{content:G}=DuH(f.content,D.id);B=G,L[D.id]={...D,outputOffset:f.newOffset}}let M=IuH(D.type)?.getProgressMessage(D)??null;if(M)A.push({type:"task_progress",taskId:D.id,taskType:D.type,message:M})}if(D.status!=="running"&&D.status!=="pending"&&!D.notified){let f=y7A(D.id,D.outputOffset);if(f.content){let{content:E}=DuH(f.content,D.id);B=E}$.push({type:"task_status",taskId:D.id,taskType:D.type,status:D.status,description:D.description,deltaSummary:B}),L[D.id]={...L[D.id]??D,notified:!0,outputOffset:f.newOffset}}}return{attachments:$,progressAttachments:A,updatedTasks:L}}var bx=K(()=>{YP();CP();RzA();yzA();EE()});async function $ZD(H){try{let L=(await zH().stat(H)).size;if(L===0)return{success:!1,error:{reason:"empty",message:`PDF file is empty: ${H}`}};if(L>SJH)return{success:!1,error:{reason:"too_large",message:`PDF file exceeds maximum allowed size of ${GM(SJH)}.`}};let I=(await E3H.readFile(H)).toString("base64");return{success:!0,data:{type:"pdf",file:{filePath:H,base64:I,originalSize:L}}}}catch($){return{success:!1,error:{reason:"unknown",message:$ instanceof Error?$.message:String($)}}}}async function B2$(H){let{code:$,stdout:A}=await jA("pdfinfo",[H],{timeout:1e4,useCwd:!1});if($!==0)return null;let L=/^Pages:\s+(\d+)/m.exec(A);if(!L)return null;let I=parseInt(L[1],10);return isNaN(I)?null:I}async function s91(){if(D2$!==void 0)return D2$;let{code:H,stderr:$}=await jA("pdftoppm",["-v"],{timeout:5000,useCwd:!1});return D2$=H===0||$.length>0,D2$}async function jNA(H,$){try{let I=(await zH().stat(H)).size;if(I===0)return{success:!1,error:{reason:"empty",message:`PDF file is empty: ${H}`}};if(I>G4A)return{success:!1,error:{reason:"too_large",message:`PDF file exceeds maximum allowed size for text extraction (${GM(G4A)}).`}};if(!await s91())return{success:!1,error:{reason:"unavailable",message:"pdftoppm is not installed. Install poppler-utils (e.g. `brew install poppler` or `apt-get install poppler-utils`) to enable PDF page rendering."}};let B=HZD.randomUUID(),f=SNA.join(_KH(),`pdf-${B}`);await E3H.mkdir(f,{recursive:!0});let E=SNA.join(f,"page"),M=["-jpeg","-r","100"];if($?.firstPage)M.push("-f",String($.firstPage));if($?.lastPage&&$.lastPage!==1/0)M.push("-l",String($.lastPage));M.push(H,E);let{code:G,stderr:U}=await jA("pdftoppm",M,{timeout:120000,useCwd:!1});if(G!==0){if(/password/i.test(U))return{success:!1,error:{reason:"password_protected",message:"PDF is password-protected. Please provide an unprotected version."}};if(/damaged|corrupt|invalid/i.test(U))return{success:!1,error:{reason:"corrupted",message:"PDF file is corrupted or invalid."}};return{success:!1,error:{reason:"unknown",message:`pdftoppm failed: ${U}`}}}let J=(await E3H.readdir(f)).filter((W)=>W.endsWith(".jpg")).sort();if(J.length===0)return{success:!1,error:{reason:"corrupted",message:"pdftoppm produced no output pages. The PDF may be invalid."}};let Q=J.length;return{success:!0,data:{type:"parts",file:{filePath:H,originalSize:I,outputDir:f,count:Q}}}}catch(A){return{success:!1,error:{reason:"unknown",message:A instanceof Error?A.message:String(A)}}}}var HZD,SNA,E3H,D2$;var RNA=K(()=>{DL();rD();Bm();B0();aIH();HZD=require("crypto"),SNA=require("path"),E3H=require("fs/promises")});async function A11(H,$,A,L,I,D){if(A$(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS))return[];let B=nD();setTimeout(()=>{B.abort()},1000);let f={...$,abortController:B},E=!$.agentId,M=H?[xG("at_mentioned_files",()=>Q11(H,f)),xG("mcp_resources",()=>V11(H,f)),xG("agent_mentions",()=>Promise.resolve(W11(H,$.options.agentDefinitions.activeAgents)))]:[],G=await Promise.all(M),U=[xG("changed_files",()=>P11(f)),xG("nested_memory",()=>_11(f)),xG("dynamic_skill",()=>Y11(f)),xG("skill_listing",()=>C11(f)),xG("ultra_claude_md",async()=>X11(I)),xG("plan_mode",()=>B11(I,$)),xG("plan_mode_exit",()=>f11($)),xG("delegate_mode",()=>E11($)),xG("delegate_mode_exit",()=>Promise.resolve(M11())),xG("todo_reminders",()=>HU()?v11(I,$):R11(I,$)),...dL()?[...D==="session_memory"?[]:[xG("teammate_mailbox",async()=>u11($))],xG("team_context",async()=>g11(I??[]))]:[],xG("critical_system_reminder",()=>Promise.resolve(G11($)))],X=E?[xG("ide_selection",async()=>J11(A,$)),xG("ide_opened_file",async()=>K11(A,$)),xG("output_style",async()=>Promise.resolve(U11())),xG("diagnostics",async()=>O11($)),xG("lsp_diagnostics",async()=>x11($)),xG("unified_tasks",async()=>b11($,I)),xG("async_hook_responses",async()=>k11()),xG("token_usage",async()=>Promise.resolve(m11(I??[],$.options.mainLoopModel))),xG("budget_usd",async()=>Promise.resolve(p11($.options.maxBudgetUsd))),xG("verify_plan_reminder",async()=>c11(I,$)),xG("queued_commands",async()=>Promise.resolve(L11(L)))]:[],[J,F]=await Promise.all([Promise.all(U),Promise.all(X)]);return[...G.flat(),...J.flat(),...F.flat()]}async function xG(H,$){let A=Date.now();try{let L=await $(),I=Date.now()-A,D=L.reduce((B,f)=>{return B+yH(f).length},0);if(Math.random()<0.05)c("tengu_attachment_compute_duration",{label:H,duration_ms:I,attachment_size_bytes:D,attachment_count:L.length});return L}catch(L){let I=Date.now()-A;if(Math.random()<0.05)c("tengu_attachment_compute_duration",{label:H,duration_ms:I,error:!0});return r(L),pZ(`Attachment error in ${H}`,L),[]}}function L11(H){if(!H)return[];return H.filter(($)=>$.mode==="prompt").map(($)=>({type:"queued_command",prompt:$.value,source_uuid:$.uuid,imagePasteIds:$.imagePasteIds}))}function I11(H){let $=0,A=!1;for(let L=H.length-1;L>=0;L--){let I=H[L];if(I?.type==="assistant"){if(VuH(I))continue;$++}else if(I?.type==="attachment"&&(I.attachment.type==="plan_mode"||I.attachment.type==="plan_mode_reentry")){A=!0;break}}return{turnCount:$,foundPlanModeAttachment:A}}function D11(H){let $=0;for(let A=H.length-1;A>=0;A--){let L=H[A];if(L?.type==="attachment"){if(L.attachment.type==="plan_mode_exit")break;if(L.attachment.type==="plan_mode")$++}}return $}async function B11(H,$){if((await $.getAppState()).toolPermissionContext.mode!=="plan")return[];if(H&&H.length>0){let{turnCount:M,foundPlanModeAttachment:G}=I11(H);if(G&&M0)yD("at-mentions");let L=await $.getAppState();return(await Promise.all(A.map(async(D)=>{try{let{filename:B,lineStart:f,lineEnd:E}=T11(D),M=xD(B);if(M3H(M,L.toolPermissionContext))return null;try{if(zH().statSync(M).isDirectory())try{let U=await aD.call({command:`ls ${wI([M])}`,description:`Lists files in ${M}`},$);c("tengu_at_mention_extracting_directory_success",{});let X=U.data.stdout;return{type:"directory",path:M,content:X}}catch{return null}}catch{}return await hNA(M,$,"tengu_at_mention_extracting_filename_success","tengu_at_mention_extracting_filename_error","at-mention",{offset:f,limit:E&&f?E-f+1:void 0})}catch{c("tengu_at_mention_extracting_filename_error",{})}}))).filter(Boolean)}function W11(H,$){let A=q11(H);if(A.length===0)return[];return A.map((I)=>{let D=I.replace("agent-",""),B=$.find((f)=>f.agentType===D);if(!B)return c("tengu_at_mention_agent_not_found",{}),null;return c("tengu_at_mention_agent_success",{}),{type:"agent_mention",agentType:B.agentType}}).filter((I)=>I!==null)}async function V11(H,$){let A=Z11(H);if(A.length===0)return[];let L=$.options.mcpClients||[];return(await Promise.all(A.map(async(D)=>{try{let[B,...f]=D.split(":"),E=f.join(":");if(!B||!E)return c("tengu_at_mention_mcp_resource_error",{}),null;let M=L.find((X)=>X.name===B);if(!M||M.type!=="connected")return c("tengu_at_mention_mcp_resource_error",{}),null;let U=($.options.mcpResources?.[B]||[]).find((X)=>X.uri===E);if(!U)return c("tengu_at_mention_mcp_resource_error",{}),null;try{let X=await M.client.readResource({uri:E});return c("tengu_at_mention_mcp_resource_success",{}),{type:"mcp_resource",server:B,uri:E,name:U.name||E,description:U.description,content:X}}catch(X){return c("tengu_at_mention_mcp_resource_error",{}),r(X),null}}catch{return c("tengu_at_mention_mcp_resource_error",{}),null}}))).filter((D)=>D!==null)}async function P11(H){let $=await H.getAppState();return(await Promise.all(yx(H.readFileState).map(async(L)=>{let I=H.readFileState.get(L);if(!I)return null;if(I.offset!==void 0||I.limit!==void 0)return null;let D=xD(L);if(M3H(D,$.toolPermissionContext))return null;try{if(x3(D)<=I.timestamp)return null;let B={file_path:D};if(!(await k8.validateInput(B,H)).result)return null;let E=await k8.call(B,H),M=H.agentId??j$();if(D===ca(M)){if(!H.options.tools.some((U)=>U.name===hu))return null;let G=Sv(M);return{type:"todo",content:G,itemCount:G.length,context:"file-watch"}}if(E.data.type==="text"){if(S7A(I.content,E.data.file.content)==="")return null;return{type:"edited_text_file",filename:D,snippet:S7A(I.content,E.data.file.content)}}if(E.data.type==="image")try{let G=await bNA(D);return{type:"edited_image_file",filename:D,content:G}}catch(G){return r(G),c("tengu_watched_file_compression_failed",{file:D}),null}}catch{return c("tengu_watched_file_stat_error",{}),null}}))).filter((L)=>L!==null)}async function _11(H){let $=await H.getAppState(),A=[];if(H.nestedMemoryAttachmentTriggers&&H.nestedMemoryAttachmentTriggers.size>0){for(let L of H.nestedMemoryAttachmentTriggers){let I=IZD(L,H,$);A.push(...I)}H.nestedMemoryAttachmentTriggers.clear()}return A}async function Y11(H){let $=[];if(H.dynamicSkillDirTriggers&&H.dynamicSkillDirTriggers.size>0){let A=zH();for(let L of H.dynamicSkillDirTriggers){let I=[];try{let D=A.readdirSync(L);for(let B of D)if(B.isDirectory()||B.isSymbolicLink()){let f=Wz.resolve(L,B.name,"SKILL.md");try{A.statSync(f),I.push(B.name)}catch{}}}catch{}if(I.length>0)$.push({type:"dynamic_skill",skillDir:L,skillNames:I})}H.dynamicSkillDirTriggers.clear()}return $}function rp(){WuH.clear()}async function C11(H){let $=oJ(),L=(await Mw($)).filter((f)=>!WuH.has(f.name));if(L.length===0)return[];let I=WuH.size===0;for(let f of L)WuH.add(f.name);N(`Sending ${L.length} skills via attachment (${I?"initial":"dynamic"}, ${WuH.size} total sent)`);let D=JV(H.options.mainLoopModel,V6());return[{type:"skill_listing",content:rjI(L,D),skillCount:L.length,isInitial:I}]}function w11(H){let $=/(^|\s)@"([^"]+)"/g,A=/(^|\s)@([^\s]+)\b/g,L=[],I=[],D;while((D=$.exec(H))!==null)if(D[2]&&!D[2].endsWith(" (agent)"))L.push(D[2]);return(H.match(A)||[]).forEach((f)=>{let E=f.slice(f.indexOf("@")+1);if(!E.startsWith('"'))I.push(E)}),[...new Set([...L,...I])]}function Z11(H){let $=/(^|\s)@([^\s]+:[^\s]+)\b/g,A=H.match($)||[];return[...new Set(A.map((L)=>L.slice(L.indexOf("@")+1)))]}function q11(H){let $=[],A=/(^|\s)@"([\w:.@-]+) \(agent\)"/g,L;while((L=A.exec(H))!==null)if(L[2])$.push(L[2]);let I=/(^|\s)@(agent-[\w:.@-]+)/g,D=H.match(I)||[];for(let B of D)$.push(B.slice(B.indexOf("@")+1));return[...new Set($)]}function T11(H){let $=H.match(/^([^#]+)(?:#L(\d+)(?:-(\d+))?)?$/);if(!$)return{filename:H};let[,A,L,I]=$,D=L?parseInt(L,10):void 0,B=I?parseInt(I,10):D;return{filename:A??H,lineStart:D,lineEnd:B}}function z11(H){let $=0,A=!1;for(let L=H.length-1;L>=0;L--){let I=H[L];if(I?.type==="attachment"&&I.attachment.type==="ultramemory"){A=!0;break}if(I?.type==="assistant")$+=l5A(I)}return A?$:null}function N11(H){if(!H||H.length===0)return!0;let $=z11(H);if($===null)return!0;return $>=e91.TOKEN_COOLDOWN}async function O11(H){let $=await bp.getNewDiagnostics();if($.length===0)return[];return[{type:"diagnostics",files:$,isNew:!0}]}async function x11(H){N("LSP Diagnostics: getLSPDiagnosticAttachments called");try{let $=P6D();if($.length===0)return[];N(`LSP Diagnostics: Found ${$.length} pending diagnostic set(s)`);let A=$.map(({files:L})=>({type:"diagnostics",files:L,isNew:!0}));if($.length>0)_6D(),N(`LSP Diagnostics: Cleared ${$.length} delivered diagnostic(s) from registry`);return N(`LSP Diagnostics: Returning ${A.length} diagnostic attachment(s)`),A}catch($){let A=$ instanceof Error?$:Error(String($));return r(Error(`Failed to get LSP diagnostic attachments: ${A.message}`)),[]}}async function*I6H(H,$,A,L,I,D){let B=await A11(H,$,A,L,I,D);if(B.length===0)return;c("tengu_attachments",{attachment_types:B.map((f)=>f.type)});for(let f of B)yield QB(f)}async function S11(H){let $=Wz.parse(H).ext.toLowerCase();if(!sAH($))return null;try{let A=zH().statSync(H),L=await B2$(H),I=L??Math.ceil(A.size/102400);if(I>AU$)return c("tengu_pdf_reference_attachment",{pageCount:I,fileSize:A.size,hadPdfinfo:L!==null}),{type:"pdf_reference",filename:H,pageCount:I,fileSize:A.size}}catch{}return null}async function hNA(H,$,A,L,I,D){let{offset:B,limit:f}=D??{},E=await $.getAppState();if(M3H(H,E.toolPermissionContext))return null;if(I==="at-mention"&&!M2$(H)){let G=Wz.parse(H).ext.toLowerCase();if(!sAH(G))try{let U=zH().statSync(H);return c("tengu_attachment_file_too_large",{size_bytes:U.size,mode:I}),null}catch{}}if(I==="at-mention"){let G=await S11(H);if(G)return G}let M=$.readFileState.get(H);if(M&&I==="at-mention")try{let G=x3(H);if(M.timestamp<=G&&G===M.timestamp)return c(A,{}),{type:"already_read_file",filename:H,content:{type:"text",file:{filePath:H,content:M.content,numLines:M.content.split(` Technical details: ${M.message}`)}throw Error(`Failed to download marketplace from ${H}: ${M instanceof Error?M.message:String(M)}`)}Pz(L,"Validating marketplace data");let f=VGH.safeParse(B.data);if(!f.success)throw new S_(`Invalid marketplace schema from URL: ${f.error.issues.map((M)=>`${M.path.join(".")}: ${M.message}`).join(", ")}`,H,B.data);Pz(L,"Saving marketplace to cache");let E=yX.join($,"..");I.mkdirSync(E),iL($,yH(f.data,null,2),{encoding:"utf-8",flush:!0})}function A81(H){return H.source==="github"?H.repo.replace("/","-"):H.source==="npm"?H.package.replace("@","").replace("/","-"):H.source==="file"?yX.basename(H.path).replace(".json",""):H.source==="directory"?yX.basename(H.path):"temp_"+Date.now()}function MZD(H,$){let L=zH().readFileSync(H,{encoding:"utf-8"}),I=DA(L),D=$.safeParse(I);if(!D.success)throw new S_(`Invalid schema: ${D.error?.issues.map((B)=>`${B.path.join(".")}: ${B.message}`).join(", ")}`,H,I);return D.data}async function gNA(H,$){let A=zH(),L=BZD();A.mkdirSync(L);let I,D,B=!1,f=A81(H);try{switch(H.source){case"url":{I=yX.join(L,`${f}.json`),B=!0,await EZD(H.url,I,H.headers,$),D=I;break}case"github":{let U=`git@github.com:${H.repo}.git`,X=`https://github.com/${H.repo}.git`;I=yX.join(L,f),B=!0;let J=null;if(await s11()){Pz($,`Cloning via SSH: ${U}`);try{await U3H(U,I,H.ref,$)}catch(Q){if(J=Q instanceof Error?Q:Error(String(Q)),r(J),Pz($,`SSH clone failed, retrying with HTTPS: ${X}`),N(`SSH clone failed for ${H.repo} despite SSH being configured, falling back to HTTPS`,{level:"info"}),A.existsSync(I))A.rmSync(I,{recursive:!0,force:!0});try{await U3H(X,I,H.ref,$),J=null}catch(W){J=W instanceof Error?W:Error(String(W)),r(J)}}}else{Pz($,`SSH not configured, cloning via HTTPS: ${X}`),N(`SSH not configured for GitHub, using HTTPS for ${H.repo}`,{level:"info"});try{await U3H(X,I,H.ref,$)}catch(Q){if(J=Q instanceof Error?Q:Error(String(Q)),r(J),Pz($,`HTTPS clone failed, retrying with SSH: ${U}`),N(`HTTPS clone failed for ${H.repo} (${J.message}), falling back to SSH`,{level:"info"}),A.existsSync(I))A.rmSync(I,{recursive:!0,force:!0});try{await U3H(U,I,H.ref,$),J=null}catch(W){J=W instanceof Error?W:Error(String(W)),r(J)}}}if(J)throw J;D=yX.join(I,H.path||".claude-plugin/marketplace.json");break}case"git":{I=yX.join(L,f),B=!0,await U3H(H.url,I,H.ref,$),D=yX.join(I,H.path||".claude-plugin/marketplace.json");break}case"npm":throw Error("NPM marketplace sources not yet implemented");case"file":{D=H.path,I=yX.dirname(yX.dirname(H.path)),B=!1;break}case"directory":{D=yX.join(H.path,".claude-plugin","marketplace.json"),I=H.path,B=!1;break}default:throw Error("Unsupported marketplace source type")}if(!A.existsSync(D))throw Error(`Marketplace file not found at ${D}`);let E=MZD(D,VGH),M=yX.join(L,E.name),G=H.source==="file"||H.source==="directory";if(I!==M&&!G)try{if(A.existsSync(M)){try{$?.("Cleaning up old marketplace cache\u2026")}catch(U){N(`Progress callback error: ${U instanceof Error?U.message:String(U)}`,{level:"warn"})}A.rmSync(M,{recursive:!0,force:!0})}A.renameSync(I,M),I=M,B=!1}catch(U){let X=U instanceof Error?U.message:String(U);throw Error(`Failed to finalize marketplace cache. Please manually delete the directory at ${M} if it exists and try again. git@your-github-host.com:${H.repo}.git`;throw Error(M)}let{marketplace:A,cachePath:L}=await gNA(H,$),I=F9L(A.name,H);if(I)throw Error(I);let D=await l1();if(D[A.name])throw Error(`Marketplace '${A.name}' is already installed. Please remove it first using '/plugin marketplace remove ${A.name}' if you want to re-install it.`);return D[A.name]={source:H,installLocation:L,lastUpdated:new Date().toISOString()},await J3H(D),N(`Added marketplace source: ${A.name}`),{name:A.name}}async function F2$(H){let $=await l1();if(!$[H])throw Error(`Marketplace '${H}' not found`);delete $[H],await J3H($);let A=zH(),L=BZD(),I=yX.join(L,H);if(A.existsSync(I))A.rmSync(I,{recursive:!0,force:!0});let D=yX.join(L,`${H}.json`);if(A.existsSync(D))A.rmSync(D,{force:!0});let B=["userSettings","projectSettings","localSettings"];for(let E of B){let M=ZI(E);if(!M)continue;let G=!1,U={};if(M.extraKnownMarketplaces?.[H]){let X={...M.extraKnownMarketplaces};X[H]=void 0,U.extraKnownMarketplaces=X,G=!0}if(M.enabledPlugins){let X=`@${H}`,J={...M.enabledPlugins},F=!1;for(let Q in J)if(Q.endsWith(X))J[Q]=void 0,F=!0;if(F)U.enabledPlugins=J,G=!0}if(G){let X=II(E,U);if(X.error)r(X.error),N(`Failed to clean up marketplace '${H}' from ${E} settings: ${X.error.message}`);else N(`Cleaned up marketplace '${H}' from ${E} settings`)}}let f=OqI(H);for(let E of f)G3H(E);N(`Removed marketplace source: ${H}`)}function X2$(H){let $=zH();try{let A=H;if($.existsSync(H)&&$.statSync(H).isDirectory()){let L=yX.join(H,".claude-plugin","marketplace.json");if($.existsSync(L))A=L;else throw Error(`Invalid cached directory at ${H}: missing .claude-plugin/marketplace.json`)}if(!$.existsSync(A))throw Error(`Marketplace file not found at ${A}`);return MZD(A,VGH)}catch(A){if(A instanceof S_)throw A;throw A}}function L81(H){let $=zH(),A=J2$();if(!$.existsSync(A))return null;try{let L=$.readFileSync(A,{encoding:"utf-8"}),D=DA(L)[H];if(!D)return null;return X2$(D.installLocation)}catch{return null}}function mNA(H){let $=H.split("@");if($.length!==2)return null;let A=$[0],L=$[1],I=zH(),D=J2$();if(!I.existsSync(D))return null;try{let B=I.readFileSync(D,{encoding:"utf-8"}),E=DA(B)[L];if(!E)return null;let M=L81(L);if(!M)return null;let G=M.plugins.find((U)=>U.name===A);if(!G)return null;return{entry:G,marketplaceInstallLocation:E.installLocation}}catch{return null}}async function ZK(H){let $=mNA(H);if($)return $;let A=H.split("@");if(A.length!==2)return null;let L=A[0],I=A[1];try{let B=(await l1())[I];if(!B)return null;let E=(await GP(I)).plugins.find((M)=>M.name===L);if(!E)return null;return{entry:E,marketplaceInstallLocation:B.installLocation}}catch(D){return N(`Could not find plugin ${H}: ${D instanceof Error?D.message:String(D)}`,{level:"debug"}),null}}async function GZD(){let H=await l1();for(let[$,A]of Object.entries(H))try{await gNA(A.source),H[$].lastUpdated=new Date().toISOString()}catch(L){N(`Failed to refresh marketplace ${$}: ${L instanceof Error?L.message:String(L)}`,{level:"error"})}await J3H(H)}async function gt(H,$,A){let L=await l1(),I=L[H];if(!I)throw Error(`Marketplace '${H}' not found. Available marketplaces: ${Object.keys(L).join(", ")}`);GP.cache?.delete?.(H);try{let{installLocation:D,source:B}=I;if(B.source==="github"||B.source==="git"){let f=B.source==="github"?A$(process.env.CLAUDE_CODE_REMOTE)?`https://github.com/${B.repo}.git`:`git@github.com:${B.repo}.git`:B.url;await U3H(f,D,B.ref,$,A);try{X2$(D)}catch{let E=B.source==="github"?B.repo:B.url;throw Error(`The marketplace.json file is no longer present in this repository. ${H==="claude-code-plugins"?`We've deprecated "claude-code-plugins" in favor of "claude-plugins-official".`:"This marketplace may have been deprecated or moved to a new location."} You can remove this marketplace with: claude plugin marketplace remove "${H}"`)}}else if(B.source==="url")await EZD(B.url,D,B.headers,$);else if(B.source==="file"||B.source==="directory")Pz($,"Validating local marketplace"),X2$(D);else throw Error("Unsupported marketplace source type for refresh");L[H].lastUpdated=new Date().toISOString(),await J3H(L),N(`Successfully refreshed marketplace: ${H}`)}catch(D){let B=D instanceof Error?D.message:String(D);throw N(`Failed to refresh marketplace ${H}: ${B}`,{level:"error"}),Error(`Failed to refresh marketplace '${H}': ${B}`)}}async function UZD(H,$){let A=await l1(),L=A[H];if(!L)throw Error(`Marketplace '${H}' not found. Available marketplaces: ${Object.keys(A).join(", ")}`);if(L.autoUpdate===$)return;A[H]={...L,autoUpdate:$},await J3H(A),N(`Set autoUpdate=${$} for marketplace: ${H}`)}var yX,fZD,GP;var y4=K(()=>{w1();tD();NA();ejH();DL();Z$();E$();_$();B0();lG();mL();UQ();Ja();Z$();Q7();Vz();t8();yX=require("path");fZD={GIT_TERMINAL_PROMPT:"0",GIT_ASKPASS:""};GP=o$(async(H)=>{let $=await l1(),A=$[H];if(!A)throw Error(`Marketplace '${H}' not found in configuration. Available marketplaces: ${Object.keys($).join(", ")}`);try{return X2$(A.installLocation)}catch(I){N(`Cache corrupted or missing for marketplace ${H}, re-fetching from source: ${I instanceof Error?I.message:String(I)}`,{level:"warn"})}let{marketplace:L}=await gNA(A.source);return $[H].lastUpdated=new Date().toISOString(),await J3H($),L})});async function ap(H,$,A,L,I){if(A?.version)return N(`Using manifest version for ${H}: ${A.version}`),A.version;if(I)return N(`Using provided version for ${H}: ${I}`),I;if(L){let D=await I81(L);if(D){let B=D.substring(0,12);return N(`Using git SHA for ${H}: ${B}`),B}}return N(`No version found for ${H}, using 'unknown'`),"unknown"}async function I81(H){return KwH(H)}var K2$=K(()=>{B0();E$();j$H()});function JZD(){return new Date().toISOString()}function pNA(H,$){let A=gw.resolve(H,$),L=gw.resolve(H)+gw.sep;if(!A.startsWith(L)&&A!==gw.resolve(H))throw Error(`Path traversal detected: "${$}" would escape the base directory`);return A}async function mw(H,$,A="user",L,I){let D=typeof $.source==="string"&&I?I:$.source,B=await l9H(D,{manifest:$}),f=I||B.path,E=await dX$(f),M=JZD(),G=await ap(H,$.source,B.manifest,f,$.version),U=Pv(H,G),X=B.path;if(B.path!==U){if(c9H.mkdirSync(gw.dirname(U),{recursive:!0}),c9H.existsSync(U))c9H.rmSync(U,{recursive:!0,force:!0});let J=B.path.endsWith(gw.sep)?B.path:B.path+gw.sep;if(U.startsWith(J)){let Q=gw.join(XZD.tmpdir(),`claude-plugin-temp-${Date.now()}`);await Q2$.rename(B.path,Q),c9H.mkdirSync(gw.dirname(U),{recursive:!0}),await Q2$.rename(Q,U)}else await Q2$.rename(B.path,U);X=U}return nKA(H,{version:G,installedAt:M,lastUpdated:M,installPath:X,gitCommitSha:E},A,L),X}function FZD(H,$="user",A){let L=JZD();nKA(H.pluginId,{version:H.version||"unknown",installedAt:L,lastUpdated:L,installPath:H.installPath},$,A)}async function _uH({pluginId:H,entry:$,marketplaceName:A,scope:L="user"}){try{let I=Wv(L),D=L!=="user"?C$():void 0,B,{source:f}=$;if(NR(f)){let G=await ZK(H);if(G)B=pNA(G.marketplaceInstallLocation,f)}await mw(H,$,L,D,B);let M={...ZI(I)?.enabledPlugins,[H]:!0};return II(I,{enabledPlugins:M}),c("tengu_plugin_installed",{plugin_id:H,marketplace_name:A}),SG(),{success:!0,message:`\u2713 Installed ${$.name}. Restart Claude Code to load new plugins.`}}catch(I){let D=I instanceof Error?I.message:String(I);return r(I instanceof Error?I:Error(`Failed to install plugin: ${String(I)}`)),{success:!1,error:`Failed to install: ${D}`}}}var Q2$,c9H,gw,XZD;var op=K(()=>{UQ();Q7();_X();y4();hDH();mL();PI();Vz();z$();_$();K2$();Q2$=require("fs/promises"),c9H=require("fs"),gw=require("path"),XZD=require("os")});function Mm(){return G0.join(Dw(),"cache")}function Pv(H,$){let A=Mm(),[L,I]=H.split("@"),D=(I||"unknown").replace(/[^a-zA-Z0-9\-_]/g,"-"),B=(L||H).replace(/[^a-zA-Z0-9\-_]/g,"-"),f=$.replace(/[^a-zA-Z0-9\-_.]/g,"-");return G0.join(A,D,B,f)}function YuH(H,$){let A=zH();if(!A.existsSync($))A.mkdirSync($);let L=A.readdirSync(H);for(let I of L){let D=G0.join(H,I.name),B=G0.join($,I.name);if(I.isDirectory())YuH(D,B);else if(I.isFile())A.copyFileSync(D,B);else if(I.isSymbolicLink()){let f=A.readlinkSync(D),E;try{E=A.realpathSync(D)}catch{A.symlinkSync(f,B);continue}let M;try{M=A.realpathSync(H)}catch{M=H}let G=M.endsWith(G0.sep)?M:M+G0.sep;if(E.startsWith(G)||E===M){let U=G0.relative(M,E),X=G0.join($,U),J=G0.relative(G0.dirname(B),X);A.symlinkSync(J,B)}else A.symlinkSync(E,B)}}}async function W2$(H,$,A,L,I){let D=zH(),B=Pv($,A);if(D.existsSync(B)&&!D.isDirEmptySync(B))return N(`Plugin ${$} version ${A} already cached at ${B}`),B;if(D.existsSync(B)&&D.isDirEmptySync(B))N(`Removing empty cache directory for ${$} at ${B}`),D.rmdirSync(B);if(D.mkdirSync(G0.dirname(B)),L&&typeof L.source==="string"&&I){let E=pNA(I,L.source);if(D.existsSync(E))N(`Copying source directory ${L.source} for plugin ${$}`),YuH(E,B);else throw Error(`Plugin source directory not found: ${E} (from entry.source: ${L.source})`)}else N(`Copying plugin ${$} to versioned cache (fallback to full copy)`),YuH(H,B);let f=G0.join(B,".git");if(D.existsSync(f))D.rmSync(f,{recursive:!0,force:!0});if(D.isDirEmptySync(B))throw Error(`Failed to copy plugin ${$} to versioned cache: destination is empty after copy`);return N(`Successfully cached plugin ${$} at ${B}`),B}function D81(H){try{let $=new URL(H);if(!["https:","http:","file:"].includes($.protocol)){if(!/^git@[a-zA-Z0-9.-]+:/.test(H))throw Error(`Invalid git URL protocol: ${$.protocol}. Only HTTPS, HTTP, file:// and SSH (git@) URLs are supported.`)}return H}catch{if(/^git@[a-zA-Z0-9.-]+:/.test(H))return H;throw Error(`Invalid git URL: ${H}`)}}async function B81(H,$){let A=zH(),L=G0.join(Dw(),"npm-cache");A.mkdirSync(L);let I=G0.join(L,"node_modules",H);if(!A.existsSync(I)){N(`Installing npm package ${H} to cache`);let B=await jA("npm",["install",H,"--prefix",L],{useCwd:!1});if(B.code!==0)throw Error(`Failed to install npm package: ${B.stderr}`)}YuH(I,$),N(`Copied npm package ${H} from cache to ${$}`)}async function f81(H,$,A,L){let I=["clone","--depth","1","--recurse-submodules","--shallow-submodules"];if(A)I.push("--branch",A);if(L)I.push("--no-checkout");I.push(H,$);let D=await jA(cB(),I);if(D.code!==0)throw Error(`Failed to clone repository: ${D.stderr}`);if(L){if((await pD(cB(),["fetch","--depth","1","origin",L],{cwd:$})).code!==0){N(`Shallow fetch of SHA ${L} failed, falling back to unshallow fetch`);let E=await pD(cB(),["fetch","--unshallow"],{cwd:$});if(E.code!==0)throw Error(`Failed to fetch commit ${L}: ${E.stderr}`)}let f=await pD(cB(),["checkout",L],{cwd:$});if(f.code!==0)throw Error(`Failed to checkout commit ${L}: ${f.stderr}`)}}async function WZD(H,$,A,L){let I=D81(H);await f81(I,$,A,L);let D=A?` (ref: ${A})`:"";N(`Cloned repository from ${I}${D} to ${$}`)}async function E81(H,$,A,L){if(!/^[a-zA-Z0-9-_.]+\/[a-zA-Z0-9-_.]+$/.test(H))throw Error(`Invalid GitHub repository format: ${H}. Expected format: owner/repo`);let I=A$(process.env.CLAUDE_CODE_REMOTE)?`https://github.com/${H}.git`:`git@github.com:${H}.git`;return WZD(I,$,A,L)}async function M81(H,$){let A=zH();if(!A.existsSync(H))throw Error(`Source path does not exist: ${H}`);YuH(H,$);let L=G0.join($,".git");if(A.existsSync(L))A.rmSync(L,{recursive:!0,force:!0})}function G81(H){let $=Date.now(),A=Math.random().toString(36).substring(2,8),L;if(typeof H==="string")L="local";else switch(H.source){case"npm":L="npm";break;case"pip":L="pip";break;case"github":L="github";break;case"url":L="git";break;default:L="unknown"}return`temp_${L}_${$}_${A}`}async function l9H(H,$){let A=zH(),L=Mm();A.mkdirSync(L);let I=G81(H),D=G0.join(L,I),B=!1;try{if(N(`Caching plugin from source: ${yH(H)} to temporary path ${D}`),B=!0,typeof H==="string")await M81(H,D);else switch(H.source){case"npm":await B81(H.package,D);break;case"github":await E81(H.repo,D,H.ref,H.sha);break;case"url":await WZD(H.url,D,H.ref,H.sha);break;case"pip":throw Error("Python package plugins are not yet supported");default:throw Error("Unsupported plugin source type")}}catch(X){if(B&&A.existsSync(D)){N(`Cleaning up failed installation at ${D}`);try{A.rmSync(D,{recursive:!0,force:!0})}catch(J){N(`Failed to clean up installation: ${J}`,{level:"error"})}}throw X}let f=G0.join(D,".claude-plugin","plugin.json"),E=G0.join(D,"plugin.json"),M;if(A.existsSync(f))try{let X=A.readFileSync(f,{encoding:"utf-8"}),J=DA(X),F=S$H.safeParse(J);if(F.success)M=F.data;else{let Q=F.error.issues.map((W)=>`${W.path.join(".")}: ${W.message}`).join(", ");throw N(`Invalid manifest at ${f}: ${Q}`,{level:"error"}),Error(`Plugin has an invalid manifest file at ${f}. Validation errors: ${Q}`)}}catch(X){if(X instanceof Error&&X.message.includes("invalid manifest file"))throw X;let J=X instanceof Error?X.message:String(X);throw N(`Failed to parse manifest at ${f}: ${J}`,{level:"error"}),Error(`Plugin has a corrupt manifest file at ${f}. JSON parse error: ${J}`)}else if(A.existsSync(E))try{let X=A.readFileSync(E,{encoding:"utf-8"}),J=DA(X),F=S$H.safeParse(J);if(F.success)M=F.data;else{let Q=F.error.issues.map((W)=>`${W.path.join(".")}: ${W.message}`).join(", ");throw N(`Invalid legacy manifest at ${E}: ${Q}`,{level:"error"}),Error(`Plugin has an invalid manifest file at ${E}. Validation errors: ${Q}`)}}catch(X){if(X instanceof Error&&X.message.includes("invalid manifest file"))throw X;let J=X instanceof Error?X.message:String(X);throw N(`Failed to parse legacy manifest at ${E}: ${J}`,{level:"error"}),Error(`Plugin has a corrupt manifest file at ${E}. JSON parse error: ${J}`)}else M=$?.manifest||{name:I,description:`Plugin cached from ${typeof H==="string"?H:H.source}`};let G=M.name.replace(/[^a-zA-Z0-9-_]/g,"-"),U=G0.join(L,G);if(A.existsSync(U))N(`Removing old cached version at ${U}`),A.rmSync(U,{recursive:!0,force:!0});return A.renameSync(D,U),N(`Successfully cached plugin ${M.name} to ${U}`),{path:U,manifest:M}}function V2$(H,$,A){let L=zH();if(!L.existsSync(H))return{name:$,description:`Plugin from ${A}`};try{let I=L.readFileSync(H,{encoding:"utf-8"}),D=DA(I),B=S$H.safeParse(D);if(B.success)return B.data;let f=B.error.issues.map((E)=>`${E.path.join(".")}: ${E.message}`).join(", ");throw N(`Plugin ${$} has an invalid manifest file at ${H}. Validation errors: ${f}`,{level:"error"}),Error(`Plugin ${$} has an invalid manifest file at ${H}. Please check the file for syntax errors.`)}}function KZD(H,$){let A=zH();if(!A.existsSync(H))throw Error(`Hooks file not found at ${H} for plugin ${$}. If the manifest declares hooks, the file must exist.`);let L=A.readFileSync(H,{encoding:"utf-8"}),I=DA(L);return Q9L.parse(I).hooks}function VZD(H,$,A,L,I=!0){let D=zH(),B=[],f=G0.join(H,".claude-plugin","plugin.json"),E=V2$(f,L,$),M={name:E.name,manifest:E,path:H,source:$,repository:$,enabled:A},G=G0.join(H,"commands");if(!E.commands&&D.existsSync(G))M.commandsPath=G;if(E.commands){let P=Object.values(E.commands)[0];if(typeof E.commands==="object"&&!Array.isArray(E.commands)&&P&&typeof P==="object"&&(("source"in P)||("content"in P))){let C={},Y=[];for(let[Z,q]of Object.entries(E.commands)){if(!q||typeof q!=="object")continue;if(q.source){let O=G0.join(H,q.source);if(D.existsSync(O))Y.push(O),C[Z]=q;else N(`Command ${Z} path ${q.source} specified in manifest but not found at ${O} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${O} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:O,component:"commands"})}else if(q.content)C[Z]=q}if(Y.length>0)M.commandsPaths=Y;if(Object.keys(C).length>0)M.commandsMetadata=C}else{let C=Array.isArray(E.commands)?E.commands:[E.commands],Y=[];for(let Z of C){if(typeof Z!=="string"){N(`Unexpected command format in manifest for ${E.name}`,{level:"error"});continue}let q=G0.join(H,Z);if(D.existsSync(q))Y.push(q);else N(`Command path ${Z} specified in manifest but not found at ${q} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${q} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:q,component:"commands"})}if(Y.length>0)M.commandsPaths=Y}}let U=G0.join(H,"agents");if(!E.agents&&D.existsSync(U))M.agentsPath=U;if(E.agents){let P=Array.isArray(E.agents)?E.agents:[E.agents],C=[];for(let Y of P){let Z=G0.join(H,Y);if(D.existsSync(Z))C.push(Z);else N(`Agent path ${Y} specified in manifest but not found at ${Z} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Z} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Z,component:"agents"})}if(C.length>0)M.agentsPaths=C}let X=G0.join(H,"skills");if(!E.skills&&D.existsSync(X))M.skillsPath=X;if(E.skills){let P=Array.isArray(E.skills)?E.skills:[E.skills],C=[];for(let Y of P){let Z=G0.join(H,Y);if(D.existsSync(Z))C.push(Z);else N(`Skill path ${Y} specified in manifest but not found at ${Z} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Z} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Z,component:"skills"})}if(C.length>0)M.skillsPaths=C}let J=G0.join(H,"output-styles");if(!E.outputStyles&&D.existsSync(J))M.outputStylesPath=J;if(E.outputStyles){let P=Array.isArray(E.outputStyles)?E.outputStyles:[E.outputStyles],C=[];for(let Y of P){let Z=G0.join(H,Y);if(D.existsSync(Z))C.push(Z);else N(`Output style path ${Y} specified in manifest but not found at ${Z} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Z} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Z,component:"output-styles"})}if(C.length>0)M.outputStylesPaths=C}let F,Q=new Set,W=G0.join(H,"hooks","hooks.json");if(D.existsSync(W))try{F=KZD(W,E.name);try{Q.add(D.realpathSync(W))}catch{Q.add(W)}N(`Loaded hooks from standard location for plugin ${E.name}: ${W}`)}catch(P){let C=P instanceof Error?P.message:String(P);N(`Failed to load hooks for ${E.name}: ${C}`,{level:"error"}),r(P instanceof Error?P:Error(C)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:W,reason:C})}if(E.hooks){let P=Array.isArray(E.hooks)?E.hooks:[E.hooks];for(let C of P)if(typeof C==="string"){let Y=G0.join(H,C);if(!D.existsSync(Y)){N(`Hooks file ${C} specified in manifest but not found at ${Y} for ${E.name}`,{level:"error"}),r(Error(`Plugin component file not found: ${Y} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Y,component:"hooks"});continue}let Z;try{Z=D.realpathSync(Y)}catch{Z=Y}if(Q.has(Z)){if(N(`Skipping duplicate hooks file for plugin ${E.name}: ${C} (resolves to already-loaded file: ${Z})`),I){let q=`Duplicate hooks file detected: ${C} resolves to already-loaded file ${Z}. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.`;r(Error(q)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:Y,reason:q})}continue}try{let q=KZD(Y,E.name);try{F=QZD(F,q),Q.add(Z),N(`Loaded and merged hooks from manifest for plugin ${E.name}: ${C}`)}catch(O){let j=O instanceof Error?O.message:String(O);N(`Failed to merge hooks from ${C} for ${E.name}: ${j}`,{level:"error"}),r(O instanceof Error?O:Error(j)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:Y,reason:`Failed to merge: ${j}`})}}catch(q){let O=q instanceof Error?q.message:String(q);N(`Failed to load hooks from ${C} for ${E.name}: ${O}`,{level:"error"}),r(q instanceof Error?q:Error(O)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:Y,reason:O})}}else if(typeof C==="object")F=QZD(F,C)}if(F)M.hooksConfig=F;return{plugin:M,errors:B}}function QZD(H,$){if(!H)return $;let A={...H};for(let[L,I]of Object.entries($))if(!A[L])A[L]=I;else A[L]=[...A[L]||[],...I];return A}async function U81(){let $=VL().enabledPlugins||{},A=[],L=[],I=Object.entries($).filter(([B,f])=>{return x$H.safeParse(B).success&&f!==void 0}),D=await l1();for(let[B,f]of I)try{let[E,M]=B.split("@"),G=D[M];if(G&&!vDH(G.source)){let J=$RH(G.source),F=yDH()||[];L.push({type:"marketplace-blocked-by-policy",source:B,plugin:E,marketplace:M,blockedByBlocklist:J,allowedSources:J?[]:F.map((Q)=>ZKH(Q))});continue}let U=mNA(B);if(!U){L.push({type:"plugin-not-found",source:B,pluginId:E,marketplace:M});continue}let X=await X81(U.entry,U.marketplaceInstallLocation,B,f===!0,L);if(X)A.push(X)}catch(E){let M=E instanceof Error?E:Error(String(E));r(M),L.push({type:"generic-error",source:B,error:M.message})}return{plugins:A,errors:L}}async function X81(H,$,A,L,I){N(`Loading plugin ${H.name} from source: ${yH(H.source)}`);let D=zH(),B=[],f;if(typeof H.source==="string"){let X=D.statSync($).isDirectory()?$:G0.join($,".."),J=G0.join(X,H.source);if(!D.existsSync(J)){let F=Error(`Plugin path not found: ${J}`);return N(`Plugin path not found: ${J}`,{level:"error"}),r(F),I.push({type:"generic-error",source:A,error:`Plugin directory not found at path: ${J}. Check that the marketplace entry has the correct path.`}),null}try{let F=G0.join(J,".claude-plugin","plugin.json"),Q;try{Q=V2$(F,H.name,H.source)}catch{}let W=await ap(A,H.source,Q,X,H.version);f=await W2$(J,A,W,H,X),N(`Copied local plugin ${H.name} to versioned cache: ${f}`)}catch(F){let Q=F instanceof Error?F.message:String(F);N(`Failed to copy plugin ${H.name} to versioned cache: ${Q}. Using marketplace path.`,{level:"warn"}),f=J}}else try{let X=await ap(A,H.source,void 0,void 0,H.version),J=Pv(A,X);if(D.existsSync(J))N(`Using versioned cached plugin ${H.name} from ${J}`),f=J;else{let F=await l9H(H.source,{manifest:{name:H.name}}),Q=await ap(A,H.source,F.manifest,F.path,H.version);if(f=await W2$(F.path,A,Q,H,void 0),F.path!==f)D.rmSync(F.path,{recursive:!0,force:!0})}}catch(X){let J=X instanceof Error?X.message:String(X);return N(`Failed to cache plugin ${H.name}: ${J}`,{level:"error"}),r(X instanceof Error?X:Error(J)),I.push({type:"generic-error",source:A,error:`Failed to download/cache plugin ${H.name}: ${J}`}),null}let E=G0.join(f,".claude-plugin","plugin.json"),M=D.existsSync(E),{plugin:G,errors:U}=VZD(f,A,L,H.name,H.strict??!0);if(B.push(...U),typeof H.source==="object"&&"sha"in H.source&&H.source.sha)G.sha=H.source.sha;if(!M){if(G.manifest={...H,id:void 0,source:void 0,strict:void 0},G.name=G.manifest.name,H.commands){let X=Object.values(H.commands)[0];if(typeof H.commands==="object"&&!Array.isArray(H.commands)&&X&&typeof X==="object"&&(("source"in X)||("content"in X))){let J={},F=[];for(let[Q,W]of Object.entries(H.commands)){if(!W||typeof W!=="object"||!W.source)continue;let P=G0.join(f,W.source);if(D.existsSync(P))F.push(P),J[Q]=W;else N(`Command ${Q} path ${W.source} from marketplace entry not found at ${P} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${P} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:P,component:"commands"})}if(F.length>0)G.commandsPaths=F,G.commandsMetadata=J}else{let J=Array.isArray(H.commands)?H.commands:[H.commands],F=[];for(let Q of J){if(typeof Q!=="string"){N(`Unexpected command format in marketplace entry for ${H.name}`,{level:"error"});continue}let W=G0.join(f,Q);if(D.existsSync(W))F.push(W);else N(`Command path ${Q} from marketplace entry not found at ${W} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${W} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:W,component:"commands"})}if(F.length>0)G.commandsPaths=F}}if(H.agents){let X=Array.isArray(H.agents)?H.agents:[H.agents],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Agent path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"agents"})}if(J.length>0)G.agentsPaths=J}if(H.skills){N(`Processing ${Array.isArray(H.skills)?H.skills.length:1} skill paths for plugin ${H.name}`);let X=Array.isArray(H.skills)?H.skills:[H.skills],J=[];for(let F of X){let Q=G0.join(f,F);if(N(`Checking skill path: ${F} -> ${Q} (exists: ${D.existsSync(Q)})`),D.existsSync(Q))J.push(Q);else N(`Skill path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"skills"})}if(N(`Found ${J.length} valid skill paths for plugin ${H.name}, setting skillsPaths`),J.length>0)G.skillsPaths=J}else N(`Plugin ${H.name} has no entry.skills defined`);if(H.outputStyles){let X=Array.isArray(H.outputStyles)?H.outputStyles:[H.outputStyles],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Output style path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"output-styles"})}if(J.length>0)G.outputStylesPaths=J}if(H.hooks)G.hooksConfig=H.hooks}else if(!H.strict&&M&&(H.commands||H.agents||H.skills||H.hooks||H.outputStyles)){let X=Error(`Plugin ${H.name} has both plugin.json and marketplace manifest entries for commands/agents/skills/hooks/outputStyles. This is a conflict.`);return N(`Plugin ${H.name} has both plugin.json and marketplace manifest entries for commands/agents/skills/hooks/outputStyles. This is a conflict.`,{level:"error"}),r(X),I.push({type:"generic-error",source:A,error:`Plugin ${H.name} has conflicting manifests: both plugin.json and marketplace entry specify components. Set strict: true in marketplace entry or remove component specs from one location.`}),null}else if(M){if(H.commands){let X=Object.values(H.commands)[0];if(typeof H.commands==="object"&&!Array.isArray(H.commands)&&X&&typeof X==="object"&&(("source"in X)||("content"in X))){let J={...G.commandsMetadata||{}},F=[];for(let[Q,W]of Object.entries(H.commands)){if(!W||typeof W!=="object"||!W.source)continue;let P=G0.join(f,W.source);if(D.existsSync(P))F.push(P),J[Q]=W;else N(`Command ${Q} path ${W.source} from marketplace entry not found at ${P} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${P} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:P,component:"commands"})}if(F.length>0)G.commandsPaths=[...G.commandsPaths||[],...F],G.commandsMetadata=J}else{let J=Array.isArray(H.commands)?H.commands:[H.commands],F=[];for(let Q of J){if(typeof Q!=="string"){N(`Unexpected command format in marketplace entry for ${H.name}`,{level:"error"});continue}let W=G0.join(f,Q);if(D.existsSync(W))F.push(W);else N(`Command path ${Q} from marketplace entry not found at ${W} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${W} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:W,component:"commands"})}if(F.length>0)G.commandsPaths=[...G.commandsPaths||[],...F]}}if(H.agents){let X=Array.isArray(H.agents)?H.agents:[H.agents],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Agent path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"agents"})}if(J.length>0)G.agentsPaths=[...G.agentsPaths||[],...J]}if(H.skills){let X=Array.isArray(H.skills)?H.skills:[H.skills],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Skill path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"skills"})}if(J.length>0)G.skillsPaths=[...G.skillsPaths||[],...J]}if(H.outputStyles){let X=Array.isArray(H.outputStyles)?H.outputStyles:[H.outputStyles],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Output style path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"output-styles"})}if(J.length>0)G.outputStylesPaths=[...G.outputStylesPaths||[],...J]}if(H.hooks)G.hooksConfig={...G.hooksConfig||{},...H.hooks}}return I.push(...B),G}async function J81(H){if(H.length===0)return{plugins:[],errors:[]};let $=[],A=[],L=zH();for(let[I,D]of H.entries())try{let B=G0.resolve(D);if(!L.existsSync(B)){N(`Plugin path does not exist: ${B}, skipping`,{level:"warn"}),A.push({type:"path-not-found",source:`inline[${I}]`,path:B,component:"commands"});continue}let f=G0.basename(B),{plugin:E,errors:M}=VZD(B,`${f}@inline`,!0,f);E.source=`${E.name}@inline`,E.repository=`${E.name}@inline`,$.push(E),A.push(...M),N(`Loaded inline plugin from path: ${E.name}`)}catch(B){let f=B instanceof Error?B.message:String(B);N(`Failed to load session plugin from ${D}: ${f}`,{level:"warn"}),A.push({type:"generic-error",source:`inline[${I}]`,error:`Failed to load plugin: ${f}`})}if($.length>0)N(`Loaded ${$.length} session-only plugins from --plugin-dir`);return{plugins:$,errors:A}}function Sx(){xf.cache?.clear?.()}var G0,xf;var _X=K(()=>{tD();DL();g$();UQ();E$();_$();mL();y4();Ja();B0();NA();ejH();K2$();yE();op();Z$();t8();G0=require("path");xf=o$(async()=>{let H=await U81(),$=[...H.plugins],A=[...H.errors],L=YHH();if(L.length>0){let D=await J81(L);$.push(...D.plugins),A.push(...D.errors)}N(`Found ${$.length} plugins (${$.filter((D)=>D.enabled).length} enabled, ${$.filter((D)=>!D.enabled).length} disabled)`);let I=$.filter((D)=>D.enabled);if(I.length>0)yD("plugins");return{enabled:I,disabled:$.filter((D)=>!D.enabled),errors:A}})});function _ZD(){let H=oA(),$=mh.homedir(),A=[];for(let L of P2$){let I=CuH[L],D;switch(H){case"macos":D=I.macos.dataPath;break;case"linux":case"wsl":D=I.linux.dataPath;break;case"windows":{if(I.windows.dataPath.length>0){let B=I.windows.useRoaming?pw.join($,"AppData","Roaming"):pw.join($,"AppData","Local");A.push({browser:L,path:pw.join(B,...I.windows.dataPath)})}continue}}if(D&&D.length>0)A.push({browser:L,path:pw.join($,...D)})}return A}function YZD(){let H=oA(),$=mh.homedir(),A=[];for(let L of P2$){let I=CuH[L];switch(H){case"macos":if(I.macos.nativeMessagingPath.length>0)A.push({browser:L,path:pw.join($,...I.macos.nativeMessagingPath)});break;case"linux":case"wsl":if(I.linux.nativeMessagingPath.length>0)A.push({browser:L,path:pw.join($,...I.linux.nativeMessagingPath)});break;case"windows":break}}return A}function CZD(){let H=[];for(let $ of P2$){let A=CuH[$];if(A.windows.registryKey)H.push({browser:$,key:A.windows.registryKey})}return H}async function F81(){let H=oA();for(let $ of P2$){let A=CuH[$];switch(H){case"macos":{let L=`/Applications/${A.macos.appName}.app`;try{return await dNA.access(L),N(`[Claude in Chrome] Detected browser: ${A.name}`),$}catch{}break}case"linux":{for(let L of A.linux.binaries)if(await x_(L).catch(()=>null))return N(`[Claude in Chrome] Detected browser: ${A.name}`),$;break}case"windows":{let L=mh.homedir();if(A.windows.dataPath.length>0){let I=A.windows.useRoaming?pw.join(L,"AppData","Roaming"):pw.join(L,"AppData","Local"),D=pw.join(I,...A.windows.dataPath);try{return await dNA.access(D),N(`[Claude in Chrome] Detected browser: ${A.name}`),$}catch{}}break}}}return null}function F3H(H){return E1(H)===dw}function ZZD(H){wZD.add(H)}function qZD(H){return wZD.has(H)}async function _2$(H){let $=oA(),A=await F81();if(!A)return N("[Claude in Chrome] No compatible browser found"),!1;let L=CuH[A];switch($){case"macos":{let{code:I}=await jA("open",["-a",L.macos.appName,H]);return I===0}case"windows":{let{code:I}=await jA("rundll32",["url,OpenURL",H]);return I===0}case"linux":{for(let I of L.linux.binaries){let{code:D}=await jA(I,[H]);if(D===0)return!0}return!1}default:return!1}}function wuH(){return`/tmp/claude-mcp-browser-bridge-${cNA()}`}function Y2$(){if(mh.platform()==="win32")return`\\\\.\\pipe\\${K81()}`;return pw.join(wuH(),`${process.pid}.sock`)}function TZD(){let H=[],$=wuH();try{let D=PZD.readdirSync($);for(let B of D)if(B.endsWith(".sock"))H.push(pw.join($,B))}catch{}let A=`claude-mcp-browser-bridge-${cNA()}`,L=pw.join(mh.tmpdir(),A),I=`/tmp/${A}`;if(!H.includes(L))H.push(L);if(L!==I&&!H.includes(I))H.push(I);return H}function K81(){return`claude-mcp-browser-bridge-${cNA()}`}function cNA(){try{return mh.userInfo().username||"default"}catch{return process.env.USER||process.env.USERNAME||"default"}}var mh,pw,dNA,PZD,dw="claude-in-chrome",CuH,P2$,wZD;var nS=K(()=>{Z9();B0();E$();Zk();mh=require("os"),pw=require("path"),dNA=require("fs/promises"),PZD=require("fs"),CuH={chrome:{name:"Google Chrome",macos:{appName:"Google Chrome",dataPath:["Library","Application Support","Google","Chrome"],nativeMessagingPath:["Library","Application Support","Google","Chrome","NativeMessagingHosts"]},linux:{binaries:["google-chrome","google-chrome-stable"],dataPath:[".config","google-chrome"],nativeMessagingPath:[".config","google-chrome","NativeMessagingHosts"]},windows:{dataPath:["Google","Chrome","User Data"],registryKey:"HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts"}},brave:{name:"Brave",macos:{appName:"Brave Browser",dataPath:["Library","Application Support","BraveSoftware","Brave-Browser"],nativeMessagingPath:["Library","Application Support","BraveSoftware","Brave-Browser","NativeMessagingHosts"]},linux:{binaries:["brave-browser","brave"],dataPath:[".config","BraveSoftware","Brave-Browser"],nativeMessagingPath:[".config","BraveSoftware","Brave-Browser","NativeMessagingHosts"]},windows:{dataPath:["BraveSoftware","Brave-Browser","User Data"],registryKey:"HKCU\\Software\\BraveSoftware\\Brave-Browser\\NativeMessagingHosts"}},arc:{name:"Arc",macos:{appName:"Arc",dataPath:["Library","Application Support","Arc","User Data"],nativeMessagingPath:["Library","Application Support","Arc","User Data","NativeMessagingHosts"]},linux:{binaries:[],dataPath:[],nativeMessagingPath:[]},windows:{dataPath:["Arc","User Data"],registryKey:"HKCU\\Software\\ArcBrowser\\Arc\\NativeMessagingHosts"}},chromium:{name:"Chromium",macos:{appName:"Chromium",dataPath:["Library","Application Support","Chromium"],nativeMessagingPath:["Library","Application Support","Chromium","NativeMessagingHosts"]},linux:{binaries:["chromium","chromium-browser"],dataPath:[".config","chromium"],nativeMessagingPath:[".config","chromium","NativeMessagingHosts"]},windows:{dataPath:["Chromium","User Data"],registryKey:"HKCU\\Software\\Chromium\\NativeMessagingHosts"}},edge:{name:"Microsoft Edge",macos:{appName:"Microsoft Edge",dataPath:["Library","Application Support","Microsoft Edge"],nativeMessagingPath:["Library","Application Support","Microsoft Edge","NativeMessagingHosts"]},linux:{binaries:["microsoft-edge","microsoft-edge-stable"],dataPath:[".config","microsoft-edge"],nativeMessagingPath:[".config","microsoft-edge","NativeMessagingHosts"]},windows:{dataPath:["Microsoft","Edge","User Data"],registryKey:"HKCU\\Software\\Microsoft\\Edge\\NativeMessagingHosts"}},vivaldi:{name:"Vivaldi",macos:{appName:"Vivaldi",dataPath:["Library","Application Support","Vivaldi"],nativeMessagingPath:["Library","Application Support","Vivaldi","NativeMessagingHosts"]},linux:{binaries:["vivaldi","vivaldi-stable"],dataPath:[".config","vivaldi"],nativeMessagingPath:[".config","vivaldi","NativeMessagingHosts"]},windows:{dataPath:["Vivaldi","User Data"],registryKey:"HKCU\\Software\\Vivaldi\\NativeMessagingHosts"}},opera:{name:"Opera",macos:{appName:"Opera",dataPath:["Library","Application Support","com.operasoftware.Opera"],nativeMessagingPath:["Library","Application Support","com.operasoftware.Opera","NativeMessagingHosts"]},linux:{binaries:["opera"],dataPath:[".config","opera"],nativeMessagingPath:[".config","opera","NativeMessagingHosts"]},windows:{dataPath:["Opera Software","Opera Stable"],registryKey:"HKCU\\Software\\Opera Software\\Opera Stable\\NativeMessagingHosts",useRoaming:!0}}},P2$=["chrome","brave","arc","edge","chromium","vivaldi","opera"];wZD=new Set});function zZD(){ZuH.cache.clear?.()}var Q81="tengu_claudeai_mcp_connectors",W81=5000,V81="mcp-servers-2025-12-04",ZuH;var lNA=K(()=>{tD();w1();qE();z$();EI();E$();NA();SD();ZuH=o$(async()=>{try{N("[claudeai-mcp] Checking gate (cached)...");let H=cf(Q81);if(N(`[claudeai-mcp] Gate returned: ${H}`),!H)return N("[claudeai-mcp] Disabled via gate"),c("tengu_claudeai_mcp_eligibility",{state:"disabled_gate"}),{};if(BE(process.env.ENABLE_CLAUDEAI_MCP_SERVERS))return N("[claudeai-mcp] Disabled via env var"),c("tengu_claudeai_mcp_eligibility",{state:"disabled_env_var"}),{};let $=dD();if(!$?.accessToken)return N("[claudeai-mcp] No access token"),c("tengu_claudeai_mcp_eligibility",{state:"no_oauth_token"}),{};if(!$.scopes?.includes("user:mcp_servers"))return N(`[claudeai-mcp] Missing user:mcp_servers scope (scopes=${$.scopes?.join(",")||"none"})`),c("tengu_claudeai_mcp_eligibility",{state:"missing_scope"}),{};let L=`${XD().BASE_API_URL}/v1/mcp_servers?limit=1000`;N(`[claudeai-mcp] Fetching from ${L}`);let I=await nA.get(L,{headers:{Authorization:`Bearer ${$.accessToken}`,"Content-Type":"application/json","anthropic-beta":V81,"anthropic-version":"2023-06-01"},timeout:W81}),D={},B=new Set;for(let f of I.data.data){let E=`claude.ai ${f.display_name}`,M=E,G=E1(M),U=1;while(B.has(G))U++,M=`${E} (${U})`,G=E1(M);B.add(G),D[M]={type:"claudeai-proxy",url:f.url,id:f.id,scope:"claudeai"}}return N(`[claudeai-mcp] Fetched ${Object.keys(D).length} servers`),c("tengu_claudeai_mcp_eligibility",{state:"eligible"}),D}catch{return N("[claudeai-mcp] Fetch failed"),{}}})});function C2$(){return tp.join(v_(),"managed-mcp.json")}function quH(H,$){if(!H)return{};let A={};for(let[L,I]of Object.entries(H))A[L]={...I,scope:$};return A}function NZD(H){let $=tp.join(C$(),".mcp.json");d_($,yH(H,null,2),{encoding:"utf8"})}function OZD(H){if(H.type!==void 0&&H.type!=="stdio")return null;let $=H;return[$.command,...$.args]}function xZD(H,$){if(H.length!==$.length)return!1;return H.every((A,L)=>A===$[L])}function SZD(H){return"url"in H?H.url:null}function P81(H){let A=H.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${A}$`)}function jZD(H,$){return P81($).test(H)}function RZD(H,$){let A=GB();if(!A.deniedMcpServers)return!1;for(let L of A.deniedMcpServers)if(PGH(L)&&L.serverName===H)return!0;if($){let L=OZD($);if(L){for(let D of A.deniedMcpServers)if(lsH(D)&&xZD(D.serverCommand,L))return!0}let I=SZD($);if(I){for(let D of A.deniedMcpServers)if(isH(D)&&jZD(I,D.serverUrl))return!0}}return!1}function iNA(H,$){if(RZD(H,$))return!1;let A=GB();if(!A.allowedMcpServers)return!0;if(A.allowedMcpServers.length===0)return!1;let L=A.allowedMcpServers.some(lsH),I=A.allowedMcpServers.some(isH);if($){let D=OZD($),B=SZD($);if(D)if(L){for(let f of A.allowedMcpServers)if(lsH(f)&&xZD(f.serverCommand,D))return!0;return!1}else{for(let f of A.allowedMcpServers)if(PGH(f)&&f.serverName===H)return!0;return!1}else if(B)if(I){for(let f of A.allowedMcpServers)if(isH(f)&&jZD(B,f.serverUrl))return!0;return!1}else{for(let f of A.allowedMcpServers)if(PGH(f)&&f.serverName===H)return!0;return!1}else{for(let f of A.allowedMcpServers)if(PGH(f)&&f.serverName===H)return!0;return!1}}for(let D of A.allowedMcpServers)if(PGH(D)&&D.serverName===H)return!0;return!1}function _81(H){let $=[];function A(I){let{expanded:D,missingVars:B}=YKH(I);return $.push(...B),D}let L;switch(H.type){case void 0:case"stdio":{let I=H;L={...I,command:A(I.command),args:I.args.map(A),env:I.env?RHH(I.env,A):void 0};break}case"sse":case"http":case"ws":{let I=H;L={...I,url:A(I.url),headers:I.headers?RHH(I.headers,A):void 0};break}case"sse-ide":case"ws-ide":L=H;break;case"sdk":L=H;break;case"claudeai-proxy":L=H;break}return{expanded:L,missingVars:[...new Set($)]}}function mt(H,$,A){if(H.match(/[^a-zA-Z0-9_-]/))throw Error(`Invalid name ${H}. Names can only contain letters, numbers, hyphens, and underscores.`);if(F3H(H))throw Error(`Cannot add MCP server "${H}": this name is reserved.`);if(zuH())throw Error("Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers");let L=zR.safeParse($);if(!L.success){let D=L.error.issues.map((B)=>`${B.path.join(".")}: ${B.message}`).join(", ");throw Error(`Invalid configuration: ${D}`)}let I=L.data;if(RZD(H,I))throw Error(`Cannot add MCP server "${H}": server is explicitly blocked by enterprise policy`);if(!iNA(H,I))throw Error(`Cannot add MCP server "${H}": not allowed by enterprise policy`);switch(A){case"project":{let{servers:D}=nNA();if(D[H])throw Error(`MCP server ${H} already exists in .mcp.json`);break}case"user":{if(M$().mcpServers?.[H])throw Error(`MCP server ${H} already exists in user config`);break}case"local":{if(Mf().mcpServers?.[H])throw Error(`MCP server ${H} already exists in local config`);break}case"dynamic":throw Error("Cannot add MCP server to scope: dynamic");case"enterprise":throw Error("Cannot add MCP server to scope: enterprise");case"claudeai":throw Error("Cannot add MCP server to scope: claudeai")}switch(A){case"project":{let{servers:D}=nNA(),B={};for(let[E,M]of Object.entries(D)){let{scope:G,...U}=M;B[E]=U}B[H]=I;let f={mcpServers:B};try{NZD(f)}catch(E){throw Error(`Failed to write to .mcp.json: ${E}`)}break}case"user":{AA((D)=>({...D,mcpServers:{...D.mcpServers,[H]:I}}));break}case"local":{MM((D)=>({...D,mcpServers:{...D.mcpServers,[H]:I}}));break}default:throw Error(`Cannot add MCP server to scope: ${A}`)}}function rNA(H,$){switch($){case"project":{let{servers:A}=nNA();if(!A[H])throw Error(`No MCP server found with name: ${H} in .mcp.json`);let L={};for(let[D,B]of Object.entries(A))if(D!==H){let{scope:f,...E}=B;L[D]=E}let I={mcpServers:L};try{NZD(I)}catch(D){throw Error(`Failed to remove from .mcp.json: ${D}`)}break}case"user":{if(!M$().mcpServers?.[H])throw Error(`No user-scoped MCP server found with name: ${H}`);AA((L)=>{let{[H]:I,...D}=L.mcpServers??{};return{...L,mcpServers:D}});break}case"local":{if(!Mf().mcpServers?.[H])throw Error(`No project-local MCP server found with name: ${H}`);MM((L)=>{let{[H]:I,...D}=L.mcpServers??{};return{...L,mcpServers:D}});break}default:throw Error(`Cannot remove MCP server from scope: ${$}`)}}function nNA(){if(!HF("projectSettings"))return{servers:{},errors:[]};let H=zH(),$=tp.join(C$(),".mcp.json");if(!H.existsSync($))return{servers:{},errors:[]};let{config:A,errors:L}=K3H({filePath:$,expandVars:!0,scope:"project"});return{servers:A?.mcpServers?quH(A.mcpServers,"project"):{},errors:L||[]}}function OJ(H){let $={project:"projectSettings",user:"userSettings",local:"localSettings"};if(H in $&&!HF($[H]))return{servers:{},errors:[]};switch(H){case"project":{let A=zH(),L={},I=[],D=[],B=C$();while(B!==tp.parse(B).root)D.push(B),B=tp.dirname(B);for(let f of D.reverse()){let E=tp.join(f,".mcp.json");if(!A.existsSync(E))continue;let{config:M,errors:G}=K3H({filePath:E,expandVars:!0,scope:"project"});if(M?.mcpServers)Object.assign(L,quH(M.mcpServers,H));if(G.length>0)I.push(...G)}return{servers:L,errors:I}}case"user":{let A=M$().mcpServers;if(!A)return{servers:{},errors:[]};let{config:L,errors:I}=TuH({configObject:{mcpServers:A},expandVars:!0,scope:"user"});return{servers:quH(L?.mcpServers,H),errors:I}}case"local":{let A=Mf().mcpServers;if(!A)return{servers:{},errors:[]};let{config:L,errors:I}=TuH({configObject:{mcpServers:A},expandVars:!0,scope:"local"});return{servers:quH(L?.mcpServers,H),errors:I}}case"enterprise":{let A=C2$();if(!zH().existsSync(A))return{servers:{},errors:[]};let{config:I,errors:D}=K3H({filePath:A,expandVars:!0,scope:"enterprise"});return{servers:quH(I?.mcpServers,H),errors:D}}}}function Mz(H){let{servers:$}=OJ("enterprise"),{servers:A}=OJ("user"),{servers:L}=OJ("project"),{servers:I}=OJ("local");if($[H])return $[H];if(I[H])return I[H];if(L[H])return L[H];if(A[H])return A[H];return null}async function Q3H(){let{servers:H}=OJ("enterprise");if(zuH()){let G={};for(let[U,X]of Object.entries(H)){if(!iNA(U,X))continue;G[U]=X}return{servers:G,errors:[]}}let{servers:$}=OJ("user"),{servers:A}=OJ("project"),{servers:L}=OJ("local"),I={},D=await xf(),B=[];if(D.errors.length>0)for(let G of D.errors)if(G.type==="mcp-config-invalid"||G.type==="mcpb-download-failed"||G.type==="mcpb-extract-failed"||G.type==="mcpb-invalid-manifest"){let U=`Plugin MCP loading error - ${G.type}: ${UP(G)}`;r(Error(U))}else{let U=G.type;N(`Plugin not available for MCP: ${G.source} - error type: ${U}`)}for(let G of D.enabled){let U=await jjI(G,B);if(U)Object.assign(I,U)}if(B.length>0)for(let G of B){let U=`Plugin MCP server error - ${G.type}: ${UP(G)}`;r(Error(U))}let f={};for(let[G,U]of Object.entries(A))if(w2$(G)==="approved")f[G]=U;let E=Object.assign({},I,$,f,L),M={};for(let[G,U]of Object.entries(E)){if(!iNA(G,U))continue;M[G]=U}return{servers:M,errors:B}}async function ph(){let{servers:H,errors:$}=await Q3H();if(zuH())return{servers:H,errors:$};let A=await ZuH();return{servers:Object.assign({},A,H),errors:$}}function TuH(H){let{configObject:$,expandVars:A,scope:L,filePath:I}=H,D=G9L.safeParse($);if(!D.success)return{config:null,errors:D.error.issues.map((E)=>({...I&&{file:I},path:E.path.join("."),message:"Does not adhere to MCP server configuration schema",mcpErrorMetadata:{scope:L,severity:"fatal"}}))};let B=[],f={};for(let[E,M]of Object.entries(D.data.mcpServers)){let G=M;if(A){let{expanded:U,missingVars:X}=_81(M);if(X.length>0)B.push({...I&&{file:I},path:`mcpServers.${E}`,message:`Missing environment variables: ${X.join(", ")}`,suggestion:`Set the following environment variables: ${X.join(", ")}`,mcpErrorMetadata:{scope:L,serverName:E,severity:"warning"}});G=U}if(oA()==="windows"&&(!G.type||G.type==="stdio")&&(G.command==="npx"||G.command.endsWith("\\npx")||G.command.endsWith("/npx")))B.push({...I&&{file:I},path:`mcpServers.${E}`,message:"Windows requires 'cmd /c' wrapper to execute npx",suggestion:'Change command to "cmd" with args ["/c", "npx", ...]. See: https://code.claude.com/docs/en/mcp#configure-mcp-servers',mcpErrorMetadata:{scope:L,serverName:E,severity:"warning"}});f[E]=G}return{config:{mcpServers:f},errors:B}}function K3H(H){let{filePath:$,expandVars:A,scope:L}=H,I=zH();if(!I.existsSync($))return{config:null,errors:[{file:$,path:"",message:`MCP config file not found: ${$}`,suggestion:"Check that the file path is correct",mcpErrorMetadata:{scope:L,severity:"fatal"}}]};let D;try{D=I.readFileSync($,{encoding:"utf8"})}catch(f){return{config:null,errors:[{file:$,path:"",message:`Failed to read file: ${f}`,suggestion:"Check file permissions and ensure the file exists",mcpErrorMetadata:{scope:L,severity:"fatal"}}]}}let B=q1(D);if(!B)return{config:null,errors:[{file:$,path:"",message:"MCP config is not a valid JSON",suggestion:"Fix the JSON syntax errors in the file",mcpErrorMetadata:{scope:L,severity:"fatal"}}]};return TuH({configObject:B,expandVars:A,scope:L,filePath:$})}function zuH(){let{config:H}=K3H({filePath:C2$(),expandVars:!0,scope:"enterprise"});return H!==null}function yZD(H){return Object.values(H).every(($)=>$.type==="sdk"&&$.name==="claude-vscode")}function NuH(H){return(Mf().disabledMcpServers||[]).includes(H)}function W3H(H,$){MM((A)=>{let L=A.disabledMcpServers||[];if($)L=L.filter((I)=>I!==H);else if(!L.includes(H))L=[...L,H];return{...A,disabledMcpServers:L}})}var tp;var T3=K(()=>{vA();DL();nM();YiH();PI();rD();O$H();kF();Z9();y$H();mL();bk();W4();_$();E$();_X();nS();tJ$();lNA();Z$();tp=require("path")});function dh(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>L.name?.startsWith(A))}function Z2$(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>L.name?.startsWith(A))}function aNA(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>!L.name?.startsWith(A))}function oNA(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>!L.name?.startsWith(A))}function tNA(H,$){let A={...H};return delete A[$],A}function hZD(H,$){return eF(H)?.serverName===$}function cw(H){return H.name?.startsWith("mcp__")||H.isMcp===!0}function b3(H){let $=zH();switch(H){case"user":{let A=SW(),L=$.existsSync(A);return`${A}${L?"":" (file does not exist)"}`}case"project":{let A=vZD.join(C$(),".mcp.json"),L=$.existsSync(A);return`${A}${L?"":" (file does not exist)"}`}case"local":return`${SW()} [project: ${C$()}]`;case"dynamic":return"Dynamically configured";case"enterprise":{let A=C2$(),L=$.existsSync(A);return`${A}${L?"":" (file does not exist)"}`}case"claudeai":return"claude.ai";default:return H}}function OuH(H){switch(H){case"local":return"Local config (private to you in this project)";case"project":return"Project config (shared via .mcp.json)";case"user":return"User config (available in all your projects)";case"dynamic":return"Dynamic config (from command line)";case"enterprise":return"Enterprise config (managed by your organization)";case"claudeai":return"claude.ai config";default:return H}}function V3H(H){if(!H)return"local";if(!Wd$.options.includes(H))throw Error(`Invalid scope: ${H}. Must be one of: ${Wd$.options.join(", ")}`);return H}function bZD(H){if(!H)return"stdio";if(H!=="stdio"&&H!=="sse"&&H!=="http")throw Error(`Invalid transport type: ${H}. Must be one of: stdio, sse, http`);return H}function sNA(H){let $={};for(let A of H){let L=A.indexOf(":");if(L===-1)throw Error(`Invalid header format: "${A}". Expected format: "Header-Name: value"`);let I=A.substring(0,L).trim(),D=A.substring(L+1).trim();if(!I)throw Error(`Invalid header: "${A}". Header name cannot be empty.`);$[I]=D}return $}function w2$(H){let $=VL(),A=E1(H);if($?.disabledMcpjsonServers?.some((L)=>E1(L)===A))return"rejected";if($?.enabledMcpjsonServers?.some((L)=>E1(L)===A)||$?.enableAllProjectMcpServers)return"approved";if(M$().bypassPermissionsModeAccepted&&HF("projectSettings"))return"approved";if(tI()&&HF("projectSettings"))return"approved";return"pending"}function eNA(H){if(!cw({name:H}))return null;let $=eF(H);if(!$)return null;let A=Mz($.serverName);if(!A&&$.serverName.startsWith("claude_ai_"))return"claudeai";return A?.scope??null}function Y81(H){return H.type==="stdio"||H.type===void 0}function C81(H){return H.type==="sse"}function w81(H){return H.type==="http"}function Z81(H){return H.type==="ws"}function kZD(H){let $=new Map;for(let L of H){if(!L.mcpServers?.length)continue;for(let I of L.mcpServers){if(typeof I==="string")continue;let D=Object.entries(I);if(D.length!==1)continue;let[B,f]=D[0],E=$.get(B);if(E){if(!E.sourceAgents.includes(L.agentType))E.sourceAgents.push(L.agentType)}else $.set(B,{config:{...f,name:B},sourceAgents:[L.agentType]})}}let A=[];for(let[L,{config:I,sourceAgents:D}]of $)if(Y81(I))A.push({name:L,sourceAgents:D,transport:"stdio",command:I.command,needsAuth:!1});else if(C81(I))A.push({name:L,sourceAgents:D,transport:"sse",url:I.url,needsAuth:!0});else if(w81(I))A.push({name:L,sourceAgents:D,transport:"http",url:I.url,needsAuth:!0});else if(Z81(I))A.push({name:L,sourceAgents:D,transport:"ws",url:I.url,needsAuth:!1});return A.sort((L,I)=>L.name.localeCompare(I.name))}function vX(H){if(!("url"in H)||typeof H.url!=="string")return;try{let $=new URL(H.url);return $.search="",$.toString().replace(/\/$/,"")}catch{return}}var vZD;var kF=K(()=>{mL();O$H();Z1();PI();DL();T3();tC();W4();g$();vA();vZD=require("path")});function uZD(H){let $=H.trim(),A=$.split(/\s+/)[0]?.toLowerCase();if(!A)return;if(A==="npx"||A==="bunx"){let L=$.split(/\s+/)[1]?.toLowerCase();if(L&&L in HOA)return HOA[L]}return HOA[A]}function gZD(H){for(let{pattern:$,tool:A}of q81)if($.test(H))return A;return}var HOA,q81;var $OA=K(()=>{HOA={src:"sourcegraph",cody:"cody",aider:"aider",tabby:"tabby",tabnine:"tabnine",augment:"augment",pieces:"pieces",qodo:"qodo",aide:"aide",hound:"hound",seagoat:"seagoat",bloop:"bloop",gitloop:"gitloop",q:"amazon-q",gemini:"gemini"},q81=[{pattern:/^sourcegraph$/i,tool:"sourcegraph"},{pattern:/^cody$/i,tool:"cody"},{pattern:/^openctx$/i,tool:"openctx"},{pattern:/^aider$/i,tool:"aider"},{pattern:/^continue$/i,tool:"continue"},{pattern:/^github[-_]?copilot$/i,tool:"github-copilot"},{pattern:/^copilot$/i,tool:"github-copilot"},{pattern:/^cursor$/i,tool:"cursor"},{pattern:/^tabby$/i,tool:"tabby"},{pattern:/^codeium$/i,tool:"codeium"},{pattern:/^tabnine$/i,tool:"tabnine"},{pattern:/^augment[-_]?code$/i,tool:"augment"},{pattern:/^augment$/i,tool:"augment"},{pattern:/^windsurf$/i,tool:"windsurf"},{pattern:/^aide$/i,tool:"aide"},{pattern:/^codestory$/i,tool:"aide"},{pattern:/^pieces$/i,tool:"pieces"},{pattern:/^qodo$/i,tool:"qodo"},{pattern:/^amazon[-_]?q$/i,tool:"amazon-q"},{pattern:/^gemini[-_]?code[-_]?assist$/i,tool:"gemini"},{pattern:/^gemini$/i,tool:"gemini"},{pattern:/^hound$/i,tool:"hound"},{pattern:/^seagoat$/i,tool:"seagoat"},{pattern:/^bloop$/i,tool:"bloop"},{pattern:/^gitloop$/i,tool:"gitloop"},{pattern:/^claude[-_]?context$/i,tool:"claude-context"},{pattern:/^code[-_]?index[-_]?mcp$/i,tool:"code-index-mcp"},{pattern:/^code[-_]?index$/i,tool:"code-index-mcp"},{pattern:/^local[-_]?code[-_]?search$/i,tool:"local-code-search"},{pattern:/^codebase$/i,tool:"autodev-codebase"},{pattern:/^autodev[-_]?codebase$/i,tool:"autodev-codebase"},{pattern:/^code[-_]?context$/i,tool:"claude-context"}]});class T2${ws;started=!1;opened;isBun=typeof Bun<"u";constructor(H){this.ws=H;if(this.opened=new Promise(($,A)=>{if(this.ws.readyState===q2$)$();else if(this.isBun){let L=this.ws,I=()=>{L.removeEventListener("open",I),L.removeEventListener("error",D),$()},D=(B)=>{L.removeEventListener("open",I),L.removeEventListener("error",D),EL("error","mcp_websocket_connect_fail"),A(B)};L.addEventListener("open",I),L.addEventListener("error",D)}else{let L=this.ws;L.on("open",()=>{$()}),L.on("error",(I)=>{EL("error","mcp_websocket_connect_fail"),A(I)})}}),this.isBun){let $=this.ws;$.addEventListener("message",this.onBunMessage),$.addEventListener("error",this.onBunError),$.addEventListener("close",this.onBunClose)}else{let $=this.ws;$.on("message",this.onNodeMessage),$.on("error",this.onNodeError),$.on("close",this.onNodeClose)}}onclose;onerror;onmessage;onBunMessage=(H)=>{try{let $=typeof H.data==="string"?H.data:String(H.data),A=DA($),L=Mx.parse(A);this.onmessage?.(L)}catch($){this.handleError($)}};onBunError=()=>{this.handleError(Error("WebSocket error"))};onBunClose=()=>{this.handleCloseCleanup()};onNodeMessage=(H)=>{try{let $=DA(H.toString("utf-8")),A=Mx.parse($);this.onmessage?.(A)}catch($){this.handleError($)}};onNodeError=(H)=>{this.handleError(H)};onNodeClose=()=>{this.handleCloseCleanup()};handleError(H){EL("error","mcp_websocket_message_fail"),this.onerror?.(H instanceof Error?H:Error("Failed to process message"))}handleCloseCleanup(){if(this.onclose?.(),this.isBun){let H=this.ws;H.removeEventListener("message",this.onBunMessage),H.removeEventListener("error",this.onBunError),H.removeEventListener("close",this.onBunClose)}else{let H=this.ws;H.off("message",this.onNodeMessage),H.off("error",this.onNodeError),H.off("close",this.onNodeClose)}}async start(){if(this.started)throw Error("Start can only be called once per transport.");if(await this.opened,this.ws.readyState!==q2$)throw EL("error","mcp_websocket_start_not_opened"),Error("WebSocket is not open. Cannot start transport.");this.started=!0}async close(){if(this.ws.readyState===q2$||this.ws.readyState===T81)this.ws.close();this.handleCloseCleanup()}async send(H){if(this.ws.readyState!==q2$)throw EL("error","mcp_websocket_send_not_opened"),Error("WebSocket is not open. Cannot send message.");let $=yH(H);try{if(this.isBun)this.ws.send($);else await new Promise((A,L)=>{this.ws.send($,(I)=>{if(I)L(I);else A()})})}catch(A){throw this.handleError(A),A}}}var T81=0,q2$=1;var mZD=K(()=>{CK();Z6();Z$()});var pZD="",dZD="";function SuH({ratio:H,width:$,fillColor:A,emptyColor:L}){let I=Math.min(1,Math.max(0,H)),D=Math.floor(I*$),B=[xuH[xuH.length-1].repeat(D)];if(D<$){let f=I*$-D,E=Math.floor(f*xuH.length);B.push(xuH[E]);let M=$-D-1;if(M>0)B.push(xuH[0].repeat(M))}return cZD.default.createElement(V,{color:A,backgroundColor:L},B.join(""))}var cZD,xuH;var AOA=K(()=>{xH();cZD=b(s(),1),xuH=[" ","\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u2588"]});function lZD(H){if(Object.keys(H).length===0)return"";return Object.entries(H).map(([$,A])=>`${$}: ${yH(A)}`).join(", ")}function iZD(){return U0.createElement(L8,null)}function nZD(H,{verbose:$}){return U0.createElement(s9,{result:H,verbose:$})}function rZD(H){let $=H.at(-1);if(!$?.data)return U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},"Running\u2026"));let{progress:A,total:L,progressMessage:I}=$.data;if(A===void 0)return U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},"Running\u2026"));if(L!==void 0&&L>0){let D=Math.min(1,Math.max(0,A/L)),B=Math.round(D*100);return U0.createElement(HA,null,U0.createElement(x,{flexDirection:"column"},I&&U0.createElement(V,{dimColor:!0},I),U0.createElement(x,{flexDirection:"row",gap:1},U0.createElement(SuH,{ratio:D,width:20}),U0.createElement(V,{dimColor:!0},B,"%"))))}return U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},I??`Processing\u2026 ${A}`))}function z2$(H,$,{verbose:A}){let L=H,I=xKA(L),B=I>z81?`${pH.warning} Large MCP response (~${a0(I)} tokens), this can fill up context quickly`:null,f;if(Array.isArray(L)){let E=L.map((M,G)=>{if(M.type==="image")return U0.createElement(x,{key:G,justifyContent:"space-between",overflowX:"hidden",width:"100%"},U0.createElement(HA,{height:1},U0.createElement(V,null,"[Image]")));let U=M.type==="text"&&"text"in M&&M.text!==null&&M.text!==void 0?String(M.text):"";return U0.createElement(Dv,{key:G,content:U,verbose:A})});f=U0.createElement(x,{flexDirection:"column",width:"100%"},E)}else if(!L)f=U0.createElement(x,{justifyContent:"space-between",overflowX:"hidden",width:"100%"},U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},"(No content)")));else f=U0.createElement(Dv,{content:L,verbose:A});if(B)return U0.createElement(x,{flexDirection:"column"},U0.createElement(HA,{height:1},U0.createElement(V,{color:"warning"},B)),f);return f}var U0,z81=1e4;var LOA=K(()=>{xH();_F();j5();OFH();iB();Q9();jI();vX$();Z$();AOA();U0=b(s(),1)});var N81,O81,aZD;var oZD=K(()=>{mI();LOA();N81=S.object({}).passthrough(),O81=S.string().describe("MCP tool execution result"),aZD={isMcp:!0,isEnabled(){return!0},isConcurrencySafe(){return!1},isReadOnly(){return!1},isDestructive(){return!1},isOpenWorld(){return!1},name:"mcp",maxResultSizeChars:1e5,async description(){return dZD},async prompt(){return pZD},inputSchema:N81,outputSchema:O81,async call(){return{data:""}},async checkPermissions(){return{behavior:"passthrough",message:"MCPTool requires permission."}},renderToolUseMessage:lZD,userFacingName:()=>"mcp",renderToolUseRejectedMessage:iZD,renderToolUseErrorMessage:nZD,renderToolUseProgressMessage:rZD,renderToolResultMessage:z2$,mapToolResultToToolResultBlockParam(H,$){return{tool_use_id:$,type:"tool_result",content:H}}}});var IOA=z((P3H)=>{function tZD(){var H={};return H["align-content"]=!1,H["align-items"]=!1,H["align-self"]=!1,H["alignment-adjust"]=!1,H["alignment-baseline"]=!1,H.all=!1,H["anchor-point"]=!1,H.animation=!1,H["animation-delay"]=!1,H["animation-direction"]=!1,H["animation-duration"]=!1,H["animation-fill-mode"]=!1,H["animation-iteration-count"]=!1,H["animation-name"]=!1,H["animation-play-state"]=!1,H["animation-timing-function"]=!1,H.azimuth=!1,H["backface-visibility"]=!1,H.background=!0,H["background-attachment"]=!0,H["background-clip"]=!0,H["background-color"]=!0,H["background-image"]=!0,H["background-origin"]=!0,H["background-position"]=!0,H["background-repeat"]=!0,H["background-size"]=!0,H["baseline-shift"]=!1,H.binding=!1,H.bleed=!1,H["bookmark-label"]=!1,H["bookmark-level"]=!1,H["bookmark-state"]=!1,H.border=!0,H["border-bottom"]=!0,H["border-bottom-color"]=!0,H["border-bottom-left-radius"]=!0,H["border-bottom-right-radius"]=!0,H["border-bottom-style"]=!0,H["border-bottom-width"]=!0,H["border-collapse"]=!0,H["border-color"]=!0,H["border-image"]=!0,H["border-image-outset"]=!0,H["border-image-repeat"]=!0,H["border-image-slice"]=!0,H["border-image-source"]=!0,H["border-image-width"]=!0,H["border-left"]=!0,H["border-left-color"]=!0,H["border-left-style"]=!0,H["border-left-width"]=!0,H["border-radius"]=!0,H["border-right"]=!0,H["border-right-color"]=!0,H["border-right-style"]=!0,H["border-right-width"]=!0,H["border-spacing"]=!0,H["border-style"]=!0,H["border-top"]=!0,H["border-top-color"]=!0,H["border-top-left-radius"]=!0,H["border-top-right-radius"]=!0,H["border-top-style"]=!0,H["border-top-width"]=!0,H["border-width"]=!0,H.bottom=!1,H["box-decoration-break"]=!0,H["box-shadow"]=!0,H["box-sizing"]=!0,H["box-snap"]=!0,H["box-suppress"]=!0,H["break-after"]=!0,H["break-before"]=!0,H["break-inside"]=!0,H["caption-side"]=!1,H.chains=!1,H.clear=!0,H.clip=!1,H["clip-path"]=!1,H["clip-rule"]=!1,H.color=!0,H["color-interpolation-filters"]=!0,H["column-count"]=!1,H["column-fill"]=!1,H["column-gap"]=!1,H["column-rule"]=!1,H["column-rule-color"]=!1,H["column-rule-style"]=!1,H["column-rule-width"]=!1,H["column-span"]=!1,H["column-width"]=!1,H.columns=!1,H.contain=!1,H.content=!1,H["counter-increment"]=!1,H["counter-reset"]=!1,H["counter-set"]=!1,H.crop=!1,H.cue=!1,H["cue-after"]=!1,H["cue-before"]=!1,H.cursor=!1,H.direction=!1,H.display=!0,H["display-inside"]=!0,H["display-list"]=!0,H["display-outside"]=!0,H["dominant-baseline"]=!1,H.elevation=!1,H["empty-cells"]=!1,H.filter=!1,H.flex=!1,H["flex-basis"]=!1,H["flex-direction"]=!1,H["flex-flow"]=!1,H["flex-grow"]=!1,H["flex-shrink"]=!1,H["flex-wrap"]=!1,H.float=!1,H["float-offset"]=!1,H["flood-color"]=!1,H["flood-opacity"]=!1,H["flow-from"]=!1,H["flow-into"]=!1,H.font=!0,H["font-family"]=!0,H["font-feature-settings"]=!0,H["font-kerning"]=!0,H["font-language-override"]=!0,H["font-size"]=!0,H["font-size-adjust"]=!0,H["font-stretch"]=!0,H["font-style"]=!0,H["font-synthesis"]=!0,H["font-variant"]=!0,H["font-variant-alternates"]=!0,H["font-variant-caps"]=!0,H["font-variant-east-asian"]=!0,H["font-variant-ligatures"]=!0,H["font-variant-numeric"]=!0,H["font-variant-position"]=!0,H["font-weight"]=!0,H.grid=!1,H["grid-area"]=!1,H["grid-auto-columns"]=!1,H["grid-auto-flow"]=!1,H["grid-auto-rows"]=!1,H["grid-column"]=!1,H["grid-column-end"]=!1,H["grid-column-start"]=!1,H["grid-row"]=!1,H["grid-row-end"]=!1,H["grid-row-start"]=!1,H["grid-template"]=!1,H["grid-template-areas"]=!1,H["grid-template-columns"]=!1,H["grid-template-rows"]=!1,H["hanging-punctuation"]=!1,H.height=!0,H.hyphens=!1,H.icon=!1,H["image-orientation"]=!1,H["image-resolution"]=!1,H["ime-mode"]=!1,H["initial-letters"]=!1,H["inline-box-align"]=!1,H["justify-content"]=!1,H["justify-items"]=!1,H["justify-self"]=!1,H.left=!1,H["letter-spacing"]=!0,H["lighting-color"]=!0,H["line-box-contain"]=!1,H["line-break"]=!1,H["line-grid"]=!1,H["line-height"]=!1,H["line-snap"]=!1,H["line-stacking"]=!1,H["line-stacking-ruby"]=!1,H["line-stacking-shift"]=!1,H["line-stacking-strategy"]=!1,H["list-style"]=!0,H["list-style-image"]=!0,H["list-style-position"]=!0,H["list-style-type"]=!0,H.margin=!0,H["margin-bottom"]=!0,H["margin-left"]=!0,H["margin-right"]=!0,H["margin-top"]=!0,H["marker-offset"]=!1,H["marker-side"]=!1,H.marks=!1,H.mask=!1,H["mask-box"]=!1,H["mask-box-outset"]=!1,H["mask-box-repeat"]=!1,H["mask-box-slice"]=!1,H["mask-box-source"]=!1,H["mask-box-width"]=!1,H["mask-clip"]=!1,H["mask-image"]=!1,H["mask-origin"]=!1,H["mask-position"]=!1,H["mask-repeat"]=!1,H["mask-size"]=!1,H["mask-source-type"]=!1,H["mask-type"]=!1,H["max-height"]=!0,H["max-lines"]=!1,H["max-width"]=!0,H["min-height"]=!0,H["min-width"]=!0,H["move-to"]=!1,H["nav-down"]=!1,H["nav-index"]=!1,H["nav-left"]=!1,H["nav-right"]=!1,H["nav-up"]=!1,H["object-fit"]=!1,H["object-position"]=!1,H.opacity=!1,H.order=!1,H.orphans=!1,H.outline=!1,H["outline-color"]=!1,H["outline-offset"]=!1,H["outline-style"]=!1,H["outline-width"]=!1,H.overflow=!1,H["overflow-wrap"]=!1,H["overflow-x"]=!1,H["overflow-y"]=!1,H.padding=!0,H["padding-bottom"]=!0,H["padding-left"]=!0,H["padding-right"]=!0,H["padding-top"]=!0,H.page=!1,H["page-break-after"]=!1,H["page-break-before"]=!1,H["page-break-inside"]=!1,H["page-policy"]=!1,H.pause=!1,H["pause-after"]=!1,H["pause-before"]=!1,H.perspective=!1,H["perspective-origin"]=!1,H.pitch=!1,H["pitch-range"]=!1,H["play-during"]=!1,H.position=!1,H["presentation-level"]=!1,H.quotes=!1,H["region-fragment"]=!1,H.resize=!1,H.rest=!1,H["rest-after"]=!1,H["rest-before"]=!1,H.richness=!1,H.right=!1,H.rotation=!1,H["rotation-point"]=!1,H["ruby-align"]=!1,H["ruby-merge"]=!1,H["ruby-position"]=!1,H["shape-image-threshold"]=!1,H["shape-outside"]=!1,H["shape-margin"]=!1,H.size=!1,H.speak=!1,H["speak-as"]=!1,H["speak-header"]=!1,H["speak-numeral"]=!1,H["speak-punctuation"]=!1,H["speech-rate"]=!1,H.stress=!1,H["string-set"]=!1,H["tab-size"]=!1,H["table-layout"]=!1,H["text-align"]=!0,H["text-align-last"]=!0,H["text-combine-upright"]=!0,H["text-decoration"]=!0,H["text-decoration-color"]=!0,H["text-decoration-line"]=!0,H["text-decoration-skip"]=!0,H["text-decoration-style"]=!0,H["text-emphasis"]=!0,H["text-emphasis-color"]=!0,H["text-emphasis-position"]=!0,H["text-emphasis-style"]=!0,H["text-height"]=!0,H["text-indent"]=!0,H["text-justify"]=!0,H["text-orientation"]=!0,H["text-overflow"]=!0,H["text-shadow"]=!0,H["text-space-collapse"]=!0,H["text-transform"]=!0,H["text-underline-position"]=!0,H["text-wrap"]=!0,H.top=!1,H.transform=!1,H["transform-origin"]=!1,H["transform-style"]=!1,H.transition=!1,H["transition-delay"]=!1,H["transition-duration"]=!1,H["transition-property"]=!1,H["transition-timing-function"]=!1,H["unicode-bidi"]=!1,H["vertical-align"]=!1,H.visibility=!1,H["voice-balance"]=!1,H["voice-duration"]=!1,H["voice-family"]=!1,H["voice-pitch"]=!1,H["voice-range"]=!1,H["voice-rate"]=!1,H["voice-stress"]=!1,H["voice-volume"]=!1,H.volume=!1,H["white-space"]=!1,H.widows=!1,H.width=!0,H["will-change"]=!1,H["word-break"]=!0,H["word-spacing"]=!0,H["word-wrap"]=!0,H["wrap-flow"]=!1,H["wrap-through"]=!1,H["writing-mode"]=!1,H["z-index"]=!1,H}function x81(H,$,A){}function S81(H,$,A){}var j81=/javascript\s*\:/img;function R81(H,$){if(j81.test($))return"";return $}P3H.whiteList=tZD();P3H.getDefaultWhiteList=tZD;P3H.onAttr=x81;P3H.onIgnoreAttr=S81;P3H.safeAttrValue=R81});var DOA=z((QEM,sZD)=>{sZD.exports={indexOf:function(H,$){var A,L;if(Array.prototype.indexOf)return H.indexOf($);for(A=0,L=H.length;A{var juH=DOA();function y81(H,$){if(H=juH.trimRight(H),H[H.length-1]!==";")H+=";";var A=H.length,L=!1,I=0,D=0,B="";function f(){if(!L){var G=juH.trim(H.slice(I,D)),U=G.indexOf(":");if(U!==-1){var X=juH.trim(G.slice(0,U)),J=juH.trim(G.slice(U+1));if(X){var F=$(I,B.length,X,J,G);if(F)B+=F+"; "}}}I=D+1}for(;D{KeH();z$();JX$();ljH();GKA();F3();w1();_$();kF();Z9();Z$();k2$=require("http"),jqD=require("url"),GOA=b(OqD(),1),u2$=require("crypto"),Pf1=["state","nonce","code_challenge","code_verifier","code"];Y3H=class Y3H extends Error{constructor(){super("Authentication was cancelled");this.name="AuthenticationCancelledError"}};Yf1=oA()==="windows"?{min:39152,max:49151}:{min:49152,max:65535}});function Zf1(H){return H.scope==="project"||H.scope==="local"}async function qf1(H,$){if(!$.headersHelper)return null;if("scope"in $&&Zf1($)&&!tI()){if(!XG(!0)){let L=Error(`Security: headersHelper for MCP server '${H}' executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);return pZ("MCP headersHelper invoked before trust check",L),c("tengu_mcp_headersHelper_missing_trust",{}),null}}try{TA(H,"Executing headersHelper to get dynamic headers");let A=await pD($.headersHelper,[],{shell:!0,timeout:1e4});if(A.code!==0||!A.stdout)throw Error(`headersHelper for MCP server '${H}' did not return a valid value`);let L=A.stdout.trim(),I=DA(L);if(typeof I!=="object"||I===null||Array.isArray(I))throw Error(`headersHelper for MCP server '${H}' must return a JSON object with string key-value pairs`);for(let[D,B]of Object.entries(I))if(typeof B!=="string")throw Error(`headersHelper for MCP server '${H}' returned non-string value for key "${D}": ${typeof B}`);return TA(H,`Successfully retrieved ${Object.keys(I).length} headers from headersHelper`),I}catch(A){return ME(H,`Error getting headers from headersHelper: ${A instanceof Error?A.message:String(A)}`),r(Error(`Error getting MCP headers from headersHelper for server '${H}': ${A instanceof Error?A.message:String(A)}`)),null}}async function p2$(H,$){let A=$.headers||{},L=await qf1(H,$)||{};return{...A,...L}}var vqD=K(()=>{B0();vA();_$();E$();z$();g$();Z$()});class KOA{serverName;sendMcpMessage;isClosed=!1;onclose;onerror;onmessage;constructor(H,$){this.serverName=H;this.sendMcpMessage=$}async start(){}async send(H){if(this.isClosed)throw Error("Transport is closed");let $=await this.sendMcpMessage(this.serverName,H);if(this.onmessage)this.onmessage($)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function zf1(H,$,A){let L=H.tabId;if(typeof L==="number")ZZD(L);let I=[];switch($){case"navigate":if(typeof H.url==="string")try{let D=new URL(H.url);I.push(D.hostname)}catch{I.push(vuH(H.url,30))}break;case"find":if(typeof H.query==="string")I.push(`pattern: ${vuH(H.query,30)}`);break;case"computer":if(typeof H.action==="string"){let D=H.action;if(D==="left_click"||D==="right_click"||D==="double_click"||D==="middle_click")if(typeof H.ref==="string")I.push(`${D} on ${H.ref}`);else if(Array.isArray(H.coordinate))I.push(`${D} at (${H.coordinate.join(", ")})`);else I.push(D);else if(D==="type"&&typeof H.text==="string")I.push(`type "${vuH(H.text,15)}"`);else if(D==="key"&&typeof H.text==="string")I.push(`key ${H.text}`);else if(D==="scroll"&&typeof H.scroll_direction==="string")I.push(`scroll ${H.scroll_direction}`);else if(D==="wait"&&typeof H.duration==="number")I.push(`wait ${H.duration}s`);else if(D==="left_click_drag")I.push("drag");else I.push(D)}break;case"gif_creator":if(typeof H.action==="string")I.push(`${H.action}`);break;case"resize_window":if(typeof H.width==="number"&&typeof H.height==="number")I.push(`${H.width}x${H.height}`);break;case"read_console_messages":if(typeof H.pattern==="string")I.push(`pattern: ${vuH(H.pattern,20)}`);if(H.onlyErrors===!0)I.push("errors only");break;case"read_network_requests":if(typeof H.urlPattern==="string")I.push(`pattern: ${vuH(H.urlPattern,20)}`);break;case"shortcuts_execute":if(typeof H.shortcutId==="string")I.push(`shortcut_id: ${H.shortcutId}`);break;case"javascript_tool":if(A&&typeof H.text==="string")return H.text;return"";case"tabs_create_mcp":case"tabs_context_mcp":case"form_input":case"shortcuts_list":case"read_page":case"upload_image":case"get_page_text":case"update_plan":return""}return I.join(", ")||null}function Nf1(H){if(!e2())return null;if(typeof H!=="object"||H===null||!("tabId"in H))return null;let $=typeof H.tabId==="number"?H.tabId:typeof H.tabId==="string"?parseInt(H.tabId,10):NaN;if(isNaN($))return null;let A=`${Tf1}${$}`;return rS.createElement(V,null," ",rS.createElement(dI,{url:A},rS.createElement(V,{color:"subtle"},"[View Tab]")))}function Of1(H,$,A){if(A)return z2$(H,[],{verbose:A});let L=null;switch($){case"navigate":L="Navigation completed";break;case"tabs_create_mcp":L="Tab created";break;case"tabs_context_mcp":L="Tabs read";break;case"form_input":L="Input completed";break;case"computer":L="Action completed";break;case"resize_window":L="Window resized";break;case"find":L="Search completed";break;case"gif_creator":L="GIF action completed";break;case"read_console_messages":L="Console messages retrieved";break;case"read_network_requests":L="Network requests retrieved";break;case"shortcuts_list":L="Shortcuts retrieved";break;case"shortcuts_execute":L="Shortcut executed";break;case"javascript_tool":L="Script executed";break;case"read_page":L="Page read";break;case"upload_image":L="Image uploaded";break;case"get_page_text":L="Page text retrieved";break;case"update_plan":L="Plan updated";break}if(L)return rS.createElement(HA,{height:1},rS.createElement(V,{dimColor:!0},L));return null}function hqD(H){return{userFacingName($){return`Claude in Chrome[${H.replace(/_mcp$/,"")}]`},renderToolUseMessage($,{verbose:A}){return zf1($,H,A)},renderToolUseTag($){return Nf1($)},renderToolResultMessage($,A,{verbose:L}){if(!xf1($))return null;return Of1($,H,L)}}}function vuH(H,$){return H.length>$?H.slice(0,$)+"\u2026":H}function xf1(H){return typeof H==="object"&&H!==null}var rS,Tf1="https://clau.de/chrome/tab/";var bqD=K(()=>{xH();iB();jr();LOA();nS();rS=b(s(),1)});async function kqD(H,$){return new(await import("ws")).default(H,["mcp"],$)}function d2$(){return parseInt(process.env.MCP_TIMEOUT||"",10)||30000}function QOA(H){return async($,A)=>{if((A?.method??"GET").toUpperCase()==="GET")return H($,A);let I=AbortSignal.timeout(mqD);if(!A?.signal)return H($,{...A,signal:I});let D=new AbortController,B=()=>D.abort();A.signal.addEventListener("abort",B),I.addEventListener("abort",B);let f=()=>{A.signal?.removeEventListener("abort",B),I.removeEventListener("abort",B)};if(A.signal.aborted)D.abort();try{let E=await H($,{...A,signal:D.signal});return f(),E}catch(E){throw f(),E}}}function VOA(){return parseInt(process.env.MCP_SERVER_CONNECTION_BATCH_SIZE||"",10)||3}function jf1(){return parseInt(process.env.MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE||"",10)||20}function uqD(H){return!H.type||H.type==="stdio"||H.type==="sdk"}function yf1(H){return!H.name.startsWith("mcp__ide__")||Rf1.includes(H.name)}function WOA(H,$){return`${H}-${yH($)}`}async function lh(H,$){let A=WOA(H,$);try{let L=await Gz(H,$);if(L.type==="connected")await L.cleanup()}catch{}Gz.cache.delete(A)}async function A3H(H){if(H.config.type==="sdk")return H;let $=await Gz(H.name,H.config);if($.type!=="connected")throw new nZ(`MCP server "${H.name}" is not connected`,"MCP server not connected");return $}function pqD(H,$){if(H.type!==$.type)return!1;let{scope:A,...L}=H,{scope:I,...D}=$;return yH(L)===yH(D)}async function Vx(H,$,A){return(await cqD({client:A,tool:H,args:$,signal:nD().signal})).content}async function ih(H,$){try{await lh(H,$);let A=await Gz(H,$);if(A.type!=="connected")return{client:A,tools:[],commands:[]};let L=!!A.capabilities?.resources,[I,D,B]=await Promise.all([zS(A),buH(A),L?huH(A):Promise.resolve([])]),f=[];if(L){if(![dp,cp].some((M)=>I.some((G)=>G.name===M.name)))f.push(dp,cp)}return{client:A,tools:[...I,...f],commands:D,resources:B.length>0?B:void 0}}catch(A){return ME(H,`Error during reconnection: ${A instanceof Error?A.message:String(A)}`),{client:{name:H,type:"failed",config:$},tools:[],commands:[]}}}async function gqD(H,$,A){for(let L=0;LQ.type==="stdio").length,B=L.filter(([F,Q])=>Q.type==="sse").length,f=L.filter(([F,Q])=>Q.type==="http").length,E=L.filter(([F,Q])=>Q.type==="sse-ide").length,M=L.filter(([F,Q])=>Q.type==="ws-ide").length,G=L.filter(([F,Q])=>uqD(Q)),U=L.filter(([F,Q])=>!uqD(Q)),X={totalServers:I,stdioCount:D,sseCount:B,httpCount:f,sseIdeCount:E,wsIdeCount:M},J=async([F,Q])=>{try{if(NuH(F)){H({client:{name:F,type:"disabled",config:Q},tools:[],commands:[]});return}let W=await Gz(F,Q,X);if(W.type!=="connected"){H({client:W,tools:[],commands:[]});return}let P=!!W.capabilities?.resources,[C,Y,Z]=await Promise.all([zS(W),buH(W),P?huH(W):Promise.resolve([])]),q=[];if(P&&!A)A=!0,q.push(dp,cp);H({client:W,tools:[...C,...q],commands:Y,resources:Z.length>0?Z:void 0})}catch(W){ME(F,`Error fetching tools/commands/resources: ${W instanceof Error?W.message:String(W)}`),H({client:{name:F,type:"failed",config:Q},tools:[],commands:[]})}};await Promise.all([gqD(G,VOA(),J),gqD(U,jf1(),J)])}async function dqD(H,$){switch(H.type){case"text":return[{type:"text",text:H.text}];case"image":{let A=Buffer.from(String(H.data),"base64"),L=await $DH(A,void 0,H.mimeType);return[{type:"image",source:{data:L.base64,media_type:L.mediaType,type:"base64"}}]}case"resource":{let A=H.resource,L=`[Resource from ${$} at ${A.uri}] `;if("text"in A)return[{type:"text",text:`${L}${A.text}`}];else if("blob"in A)if(Sf1.has(A.mimeType??"")){let D=Buffer.from(A.blob,"base64"),B=await $DH(D,void 0,A.mimeType),f=[];if(L)f.push({type:"text",text:L});return f.push({type:"image",source:{data:B.base64,media_type:B.mediaType,type:"base64"}}),f}else return[{type:"text",text:`${L}Base64 data (${A.mimeType||"unknown type"}) ${A.blob}`}];return[]}case"resource_link":{let A=H,L=`[Resource link: ${A.name}] ${A.uri}`;if(A.description)L+=` (${A.description})`;return[{type:"text",text:L}]}default:return[]}}function c2$(H,$=2){if(H===null)return"null";if(Array.isArray(H)){if(H.length===0)return"[]";return`[${c2$(H[0],$-1)}]`}if(typeof H==="object"){if($<=0)return"{...}";let L=Object.entries(H).slice(0,10).map(([D,B])=>`${D}: ${c2$(B,$-1)}`),I=Object.keys(H).length>10?", ...":"";return`{${L.join(", ")}${I}}`}return typeof H}async function POA(H,$,A){if(H&&typeof H==="object"){if("toolResult"in H)return{content:String(H.toolResult),type:"toolResult"};if("structuredContent"in H&&H.structuredContent!==void 0)return{content:yH(H.structuredContent),type:"structuredContent",schema:c2$(H.structuredContent)};if("content"in H&&Array.isArray(H.content)){let I=(await Promise.all(H.content.map((D)=>dqD(D,A)))).flat();return{content:I,type:"contentArray",schema:c2$(I)}}}let L=`MCP server "${A}" tool "${$}": unexpected response format`;throw ME(A,L),new nZ(L,"MCP tool unexpected response format")}function vf1(H){if(!H||typeof H==="string")return!1;return H.some(($)=>$.type==="image")}async function hf1(H,$,A){let{content:L,type:I,schema:D}=await POA(H,$,A);if(A==="ide")return L;if(!await ojH(L))return L;if(BE(process.env.ENABLE_MCP_LARGE_OUTPUT_FILES))return await SKA(L);if(!L)return L;if(vf1(L))return await SKA(L);let B=Date.now(),f=`mcp-${E1(A)}-${E1($)}-${B}`,E=typeof L==="string"?L:yH(L,null,2),M=await jDH(E,f);if(RDH(M))return`Error: result (${E.length.toLocaleString()} characters) exceeds maximum allowed tokens. Failed to save output to file: ${M.error}. If this MCP server provides pagination or filtering tools, use them to retrieve specific portions of the data.`;let G=hX$(I,D);return bX$(M.filepath,M.originalSize,G)}async function cqD({client:{client:H,name:$},tool:A,args:L,meta:I,signal:D,onProgress:B}){let f=Date.now(),E,M;try{if(TA($,`Calling MCP tool: ${A}`),E=setInterval(()=>{let C=Date.now()-f,Z=`${Math.floor(C/1000)}s`;TA($,`Tool '${A}' still running (${Z} elapsed)`)},30000),DqI())M=setInterval(()=>{IqI()},50000);let G=dt(),U,X=new Promise((C,Y)=>{U=setTimeout(()=>{Y(new nZ(`MCP server "${$}" tool "${A}" timed out after ${Math.floor(G/1000)}s`,"MCP tool timeout"))},G)}),J=await Promise.race([H.callTool({name:A,arguments:L,_meta:I},fP,{signal:D,timeout:G,onprogress:B?(C)=>{B({type:"mcp_progress",status:"progress",serverName:$,toolName:A,progress:C.progress,total:C.total,progressMessage:C.message})}:void 0}),X]).finally(()=>{if(U)clearTimeout(U)});if("isError"in J&&J.isError){let C="Unknown error";if("content"in J&&Array.isArray(J.content)&&J.content.length>0){let Y=J.content[0];if(Y&&typeof Y==="object"&&"text"in Y)C=Y.text}else if("error"in J)C=String(J.error);throw ME($,C),new nZ(C,"MCP tool returned error")}let F=Date.now()-f,Q=F<1000?`${F}ms`:F<60000?`${Math.floor(F/1000)}s`:`${Math.floor(F/60000)}m ${Math.floor(F%60000/1000)}s`;TA($,`Tool '${A}' completed successfully in ${Q}`);let W=gZD($);if(W)c("tengu_code_indexing_tool_used",{tool:W,source:"mcp",success:!0});return{content:await hf1(J,A,$),_meta:J._meta,structuredContent:J.structuredContent}}catch(G){if(E!==void 0)clearInterval(E);if(M!==void 0)clearInterval(M);let U=Date.now()-f;if(G instanceof Error&&G.name!=="AbortError")TA($,`Tool '${A}' failed after ${Math.floor(U/1000)}s: ${G.message}`);if(G instanceof Error){if(("code"in G?G.code:void 0)===401||G instanceof xQ)throw TA($,"Tool call returned 401 Unauthorized - token may have expired"),c("tengu_mcp_tool_call_auth_error",{}),new l2$($,`MCP server "${$}" requires re-authorization (token expired)`)}if(!(G instanceof Error)||G.name!=="AbortError")throw G;return{content:void 0}}finally{if(E!==void 0)clearInterval(E);if(M!==void 0)clearInterval(M)}}function bf1(H){if(H.message.content[0]?.type!=="tool_use")return;return H.message.content[0].id}async function lqD(H,$){let A=[],L=[],I=await Promise.allSettled(Object.entries(H).map(async([D,B])=>{let f=new KOA(D,$),E=new fX$({name:"claude-code",version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION??"unknown"},{capabilities:{}});try{await E.connect(f);let M=E.getServerCapabilities(),G={type:"connected",name:D,capabilities:M||{},client:E,config:{...B,scope:"dynamic"},cleanup:async()=>{await E.close()}},U=[];if(M?.tools){let X=await zS(G);U.push(...X)}return{client:G,tools:U}}catch(M){return ME(D,`Failed to connect SDK MCP server: ${M}`),{client:{type:"failed",name:D,config:{...B,scope:"user"}},tools:[]}}}));for(let D of I)if(D.status==="fulfilled")A.push(D.value.client),L.push(...D.value.tools);return{clients:A,tools:L}}var l2$,Sf1,mqD=60000,Rf1,Gz,zS,huH,buH,n2$;var f3=K(()=>{tD();BZI();MZI();zZI();OZI();CK();HrA();_$();lG();_Q();z$();nU();g$();EI();qE();ZE();Ga();vX$();jKA();Bm();NA();kF();$OA();mZD();H4H();nR();eE();LT();oZD();gC$();mC$();n9H();T3();vqD();ljH();BW();nS();bqD();Z$();l2$=class l2$ extends Error{serverName;constructor(H,$){super($);this.name="McpAuthError",this.serverName=H}};Sf1=new Set(["image/jpeg","image/png","image/gif","image/webp"]);Rf1=["mcp__ide__executeCode","mcp__ide__getDiagnostics"];Gz=o$(async(H,$,A)=>{let L=Date.now();try{let I,D=wY();if($.type==="sse"){let y=new i9H(H,$),g=await p2$(H,$),h={authProvider:y,fetch:QOA(xDH()),requestInit:{headers:{"User-Agent":Un(),...g}}};h.eventSourceInit={fetch:async(p,d)=>{let k={},n=await y.tokens();if(n)k.Authorization=`Bearer ${n.access_token}`;let GH=_AH();return fetch(p,{...d,...GH,headers:{"User-Agent":Un(),...k,...d?.headers,...g,Accept:"text/event-stream"}})}},I=new ZX$(new URL($.url),h),TA(H,"SSE transport initialized, awaiting connection")}else if($.type==="sse-ide"){TA(H,`Setting up SSE-IDE transport to ${$.url}`);let y=_AH(),g=y.dispatcher?{eventSourceInit:{fetch:async(h,p)=>{return fetch(h,{...p,...y,headers:{"User-Agent":Un(),...p?.headers}})}}}:{};I=new ZX$(new URL($.url),Object.keys(g).length>0?g:void 0)}else if($.type==="ws-ide"){let y=k$A(),g={"User-Agent":Un(),...$.authToken&&{"X-Claude-Code-Ide-Authorization":$.authToken}},h;if(typeof Bun<"u")h=new globalThis.WebSocket($.url,{protocols:["mcp"],headers:g,proxy:PAH($.url),tls:y||void 0});else h=await kqD($.url,{headers:g,agent:VAH($.url),...y||{}});I=new T2$(h)}else if($.type==="ws"){TA(H,`Initializing WebSocket transport to ${$.url}`);let y=await p2$(H,$),g=k$A(),h={"User-Agent":Un(),...D&&{Authorization:`Bearer ${D}`},...y},p=Object.fromEntries(Object.entries(h).map(([k,n])=>k.toLowerCase()==="authorization"?[k,"[REDACTED]"]:[k,n]));TA(H,`WebSocket transport options: ${yH({url:$.url,headers:p,hasSessionAuth:!!D})}`);let d;if(typeof Bun<"u")d=new globalThis.WebSocket($.url,{protocols:["mcp"],headers:h,proxy:PAH($.url),tls:g||void 0});else d=await kqD($.url,{headers:h,agent:VAH($.url),...g||{}});I=new T2$(d)}else if($.type==="http"){TA(H,`Initializing HTTP transport to ${$.url}`),TA(H,`Node version: ${process.version}, Platform: linux`),TA(H,`Environment: ${yH({NODE_OPTIONS:process.env.NODE_OPTIONS||"not set",UV_THREADPOOL_SIZE:process.env.UV_THREADPOOL_SIZE||"default",HTTP_PROXY:process.env.HTTP_PROXY||"not set",HTTPS_PROXY:process.env.HTTPS_PROXY||"not set",NO_PROXY:process.env.NO_PROXY||"not set"})}`);let y=new i9H(H,$),g=await p2$(H,$),h=_AH();TA(H,`Proxy options: ${h.dispatcher?"custom dispatcher":"default"}`);let p={authProvider:y,fetch:QOA(xDH()),requestInit:{...h,headers:{"User-Agent":Un(),...D&&{Authorization:`Bearer ${D}`},...g}}},d=p.requestInit?.headers?Object.fromEntries(Object.entries(p.requestInit.headers).map(([k,n])=>k.toLowerCase()==="authorization"?[k,"[REDACTED]"]:[k,n])):void 0;TA(H,`HTTP transport options: ${yH({url:$.url,headers:d,hasAuthProvider:!!y,timeoutMs:mqD})}`),I=new qX$(new URL($.url),p),TA(H,"HTTP transport created successfully")}else if($.type==="sdk")throw Error("SDK servers should be handled in print.ts");else if($.type==="claudeai-proxy"){if(TA(H,`Initializing claude.ai proxy transport for server ${$.id}`),!dD())throw Error("No claude.ai OAuth token found");let g=XD(),h=`${g.MCP_PROXY_URL}${g.MCP_PROXY_PATH.replace("{server_id}",$.id)}`;TA(H,`Using claude.ai proxy at ${h}`);let p=async(n,GH)=>{await iW();let HH=dD();if(!HH)throw Error("No claude.ai OAuth token available");let BH=new Headers(GH?.headers);return BH.set("Authorization",`Bearer ${HH.accessToken}`),globalThis.fetch(n,{...GH,headers:BH})},d=_AH(),k={fetch:QOA(p),requestInit:{...d,headers:{"User-Agent":Un(),"X-Mcp-Client-Session-Id":j$()}}};I=new qX$(new URL(h),k),TA(H,"claude.ai proxy transport created successfully")}else if($.type==="stdio"||!$.type){let y=process.env.CLAUDE_CODE_SHELL_PREFIX||$.command,g=process.env.CLAUDE_CODE_SHELL_PREFIX?[[$.command,...$.args].join(" ")]:$.args;I=new nFA({command:y,args:g,env:{...process.env,...$.env},stderr:"pipe"})}else throw Error(`Unsupported server type: ${$.type}. claude.ai MCP servers require ENABLE_CLAUDEAI_MCP_SERVERS=true.`);let B,f="";if($.type==="stdio"||!$.type){let y=I;if(y.stderr)B=(g)=>{f+=g.toString()},y.stderr.on("data",B)}let E=new fX$({name:"claude-code",version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION??"unknown"},{capabilities:{roots:{},...{}}});if($.type==="http")TA(H,"Client created, setting up request handler");if(E.setRequestHandler(hXA,async()=>{return TA(H,"Received ListRoots request from server"),{roots:[{uri:`file://${zL()}`}]}}),TA(H,`Starting connection with timeout of ${d2$()}ms`),$.type==="http"){TA(H,`Testing basic HTTP connectivity to ${$.url}`);try{let y=new URL($.url);if(TA(H,`Parsed URL: host=${y.hostname}, port=${y.port||"default"}, protocol=${y.protocol}`),y.hostname==="127.0.0.1"||y.hostname==="localhost")TA(H,`Using loopback address: ${y.hostname}`)}catch(y){TA(H,`Failed to parse URL: ${y}`)}}let M=E.connect(I),G=new Promise((y,g)=>{let h=setTimeout(()=>{let p=Date.now()-L;TA(H,`Connection timeout triggered after ${p}ms (limit: ${d2$()}ms)`),I.close().catch(()=>{}),g(new nZ(`MCP server "${H}" connection timed out after ${d2$()}ms`,"MCP connection timeout"))},d2$());M.then(()=>{clearTimeout(h)},(p)=>{clearTimeout(h)})});try{if(await Promise.race([M,G]),f)ME(H,`Server stderr: ${f}`);let y=Date.now()-L;TA(H,`Successfully connected to ${$.type} server in ${y}ms`)}catch(y){let g=Date.now()-L;if($.type==="sse"&&y instanceof Error){if(TA(H,`SSE Connection failed after ${g}ms: ${yH({url:$.url,error:y.message,errorType:y.constructor.name,stack:y.stack})}`),ME(H,y),y instanceof xQ)return c("tengu_mcp_server_needs_auth",{transportType:"sse",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,"Authentication required for SSE server"),{name:H,type:"needs-auth",config:$}}else if($.type==="http"&&y instanceof Error){let h=y;if(TA(H,`HTTP Connection failed after ${g}ms: ${y.message} (code: ${h.code||"none"}, errno: ${h.errno||"none"})`),ME(H,y),y instanceof xQ)return c("tengu_mcp_server_needs_auth",{transportType:"http",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,"Authentication required for HTTP server"),{name:H,type:"needs-auth",config:$}}else if($.type==="claudeai-proxy"&&y instanceof Error){if(TA(H,`claude.ai proxy connection failed after ${g}ms: ${y.message}`),ME(H,y),y.code===401)return c("tengu_mcp_server_needs_auth",{transportType:"claudeai-proxy",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,"Authentication required for claude.ai proxy server"),{name:H,type:"needs-auth",config:$}}else if($.type==="sse-ide"||$.type==="ws-ide")c("tengu_mcp_ide_server_connection_failed",{connectionDurationMs:g});if(I.close().catch(()=>{}),f)ME(H,`Server stderr: ${f}`);throw y}let U=E.getServerCapabilities(),X=E.getServerVersion(),J=E.getInstructions();if(TA(H,`Connection established with capabilities: ${yH({hasTools:!!U?.tools,hasPrompts:!!U?.prompts,hasResources:!!U?.resources,serverVersion:X||"unknown"})}`),$.type==="sse-ide"||$.type==="ws-ide"){let y=Date.now()-L;c("tengu_mcp_ide_server_connection_succeeded",{connectionDurationMs:y,serverVersion:X});try{rZI(E)}catch(g){ME(H,`Failed to send ide_connected notification: ${g}`)}}let F=Date.now(),Q=!1,W=E.onerror,P=E.onclose,C=0,Y=3,Z=(y)=>{return y.includes("ECONNRESET")||y.includes("ETIMEDOUT")||y.includes("EPIPE")||y.includes("EHOSTUNREACH")||y.includes("ECONNREFUSED")||y.includes("Body Timeout Error")||y.includes("terminated")};E.onerror=(y)=>{let g=Date.now()-F;Q=!0;let h=$.type||"stdio";if(TA(H,`${h.toUpperCase()} connection dropped after ${Math.floor(g/1000)}s uptime`),y.message)if(y.message.includes("ECONNRESET"))TA(H,"Connection reset - server may have crashed or restarted");else if(y.message.includes("ETIMEDOUT"))TA(H,"Connection timeout - network issue or server unresponsive");else if(y.message.includes("ECONNREFUSED"))TA(H,"Connection refused - server may be down");else if(y.message.includes("EPIPE"))TA(H,"Broken pipe - server closed connection unexpectedly");else if(y.message.includes("EHOSTUNREACH"))TA(H,"Host unreachable - network connectivity issue");else if(y.message.includes("ESRCH"))TA(H,"Process not found - stdio server process terminated");else if(y.message.includes("spawn"))TA(H,"Failed to spawn process - check command and permissions");else TA(H,`Connection error: ${y.message}`);if(h==="sse"||h==="http"||h==="claudeai-proxy")if(Z(y.message)){if(C++,TA(H,`Terminal connection error ${C}/${Y}`),C>=Y)TA(H,"Max consecutive errors reached, triggering reconnection via onclose"),C=0,E.onclose?.()}else C=0;if(W)W(y)},E.onclose=()=>{let y=Date.now()-F,g=$.type??"unknown";TA(H,`${g.toUpperCase()} connection closed after ${Math.floor(y/1000)}s (${Q?"with errors":"cleanly"})`);let h=WOA(H,$);if(Gz.cache.delete(h),TA(H,"Cleared connection cache for reconnection"),P)P()};let q=async()=>{if(B&&($.type==="stdio"||!$.type))I.stderr?.off("data",B);if($.type==="stdio")try{let g=I.pid;if(g){TA(H,"Sending SIGINT to MCP server process");try{process.kill(g,"SIGINT")}catch(h){TA(H,`Error sending SIGINT: ${h}`);return}await new Promise(async(h)=>{let p=!1,d=setInterval(()=>{try{process.kill(g,0)}catch{if(!p)p=!0,clearInterval(d),clearTimeout(k),TA(H,"MCP server process exited cleanly"),h()}},50),k=setTimeout(()=>{if(!p)p=!0,clearInterval(d),TA(H,"Cleanup timeout reached, stopping process monitoring"),h()},600);try{if(await new Promise((n)=>setTimeout(n,100)),!p){try{process.kill(g,0),TA(H,"SIGINT failed, sending SIGTERM to MCP server process");try{process.kill(g,"SIGTERM")}catch(n){TA(H,`Error sending SIGTERM: ${n}`),p=!0,clearInterval(d),clearTimeout(k),h();return}}catch{p=!0,clearInterval(d),clearTimeout(k),h();return}if(await new Promise((n)=>setTimeout(n,400)),!p)try{process.kill(g,0),TA(H,"SIGTERM failed, sending SIGKILL to MCP server process");try{process.kill(g,"SIGKILL")}catch(n){TA(H,`Error sending SIGKILL: ${n}`)}}catch{p=!0,clearInterval(d),clearTimeout(k),h()}}if(!p)p=!0,clearInterval(d),clearTimeout(k),h()}catch{if(!p)p=!0,clearInterval(d),clearTimeout(k),h()}})}}catch(y){TA(H,`Error terminating process: ${y}`)}try{await E.close()}catch(y){TA(H,`Error closing client: ${y}`)}},O=PB(q),j=async()=>{O?.(),await q()},u=Date.now()-L;return c("tengu_mcp_server_connection_succeeded",{connectionDurationMs:u,transportType:$.type??"stdio",totalServers:A?.totalServers,stdioCount:A?.stdioCount,sseCount:A?.sseCount,httpCount:A?.httpCount,sseIdeCount:A?.sseIdeCount,wsIdeCount:A?.wsIdeCount,...vX($)?{mcpServerBaseUrl:vX($)}:{}}),{name:H,client:E,type:"connected",capabilities:U??{},serverInfo:X,instructions:J,config:$,cleanup:j}}catch(I){let D=Date.now()-L;return c("tengu_mcp_server_connection_failed",{connectionDurationMs:D,totalServers:A?.totalServers||1,stdioCount:A?.stdioCount||($.type==="stdio"?1:0),sseCount:A?.sseCount||($.type==="sse"?1:0),httpCount:A?.httpCount||($.type==="http"?1:0),sseIdeCount:A?.sseIdeCount||($.type==="sse-ide"?1:0),wsIdeCount:A?.wsIdeCount||($.type==="ws-ide"?1:0),transportType:$.type??"stdio",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,`Connection failed after ${D}ms: ${I instanceof Error?I.message:String(I)}`),ME(H,`Connection failed: ${I instanceof Error?I.message:String(I)}`),{name:H,type:"failed",config:$,error:I instanceof Error?I.message:String(I)}}},WOA);zS=o$(async(H)=>{if(H.type!=="connected")return[];try{if(!H.capabilities?.tools)return[];let $=await H.client.request({method:"tools/list"},fjH),A=Ua($.tools),L=H.config.type==="sdk"&&A$(process.env.CLAUDE_AGENT_SDK_MCP_NO_PREFIX);return A.map((I)=>({...aZD,name:L?I.name:`mcp__${E1(H.name)}__${E1(I.name)}`,originalMcpToolName:I.name,isMcp:!0,async description(){return I.description??""},async prompt(){return I.description??""},isConcurrencySafe(){return I.annotations?.readOnlyHint??!1},isReadOnly(){return I.annotations?.readOnlyHint??!1},isDestructive(){return I.annotations?.destructiveHint??!1},isOpenWorld(){return I.annotations?.openWorldHint??!1},inputJSONSchema:I.inputSchema,async checkPermissions(){return{behavior:"passthrough",message:"MCPTool requires permission.",suggestions:[{type:"addRules",rules:[{toolName:L?I.name:`mcp__${E1(H.name)}__${E1(I.name)}`,ruleContent:void 0}],behavior:"allow",destination:"localSettings"}]}},async call(D,B,f,E,M){let G=bf1(E),U=G?{"claudecode/toolUseId":G}:{};if(M&&G)M({toolUseID:G,data:{type:"mcp_progress",status:"started",serverName:H.name,toolName:I.name}});let X=Date.now();try{let J=await A3H(H),F=await cqD({client:J,tool:I.name,args:D,meta:U,signal:B.abortController.signal,onProgress:M&&G?(Q)=>{M({toolUseID:G,data:Q})}:void 0});if(M&&G)M({toolUseID:G,data:{type:"mcp_progress",status:"completed",serverName:H.name,toolName:I.name,elapsedTimeMs:Date.now()-X}});return{data:F.content,...F._meta||F.structuredContent?{mcpMeta:{...F._meta&&{_meta:F._meta},...F.structuredContent&&{structuredContent:F.structuredContent}}}:{}}}catch(J){if(M&&G)M({toolUseID:G,data:{type:"mcp_progress",status:"failed",serverName:H.name,toolName:I.name,elapsedTimeMs:Date.now()-X}});if(J instanceof Error&&!(J instanceof nZ)){let F=J.constructor.name;if(F==="Error")throw new nZ(J.message,J.message.slice(0,200));if(F==="McpError"&&"code"in J&&typeof J.code==="number")throw new nZ(J.message,`McpError ${J.code}`)}throw J}},userFacingName(){let D=I.annotations?.title||I.name;return`${H.name} - ${D} (MCP)`},...F3H(H.name)?hqD(I.name):{}})).filter(yf1)}catch($){return ME(H.name,`Failed to fetch tools: ${$ instanceof Error?$.message:String($)}`),[]}}),huH=o$(async(H)=>{if(H.type!=="connected")return[];try{if(!H.capabilities?.resources)return[];let $=await H.client.request({method:"resources/list"},PDH);if(!$.resources)return[];return $.resources.map((A)=>({...A,server:H.name}))}catch($){return ME(H.name,`Failed to fetch resources: ${$ instanceof Error?$.message:String($)}`),[]}}),buH=o$(async(H)=>{if(H.type!=="connected")return[];try{if(!H.capabilities?.prompts)return[];let $=await H.client.request({method:"prompts/list"},DjH);if(!$.prompts)return[];return Ua($.prompts).map((L)=>{let I=Object.values(L.arguments??{}).map((D)=>D.name);return{type:"prompt",name:"mcp__"+E1(H.name)+"__"+L.name,description:L.description??"",hasUserSpecifiedDescription:!!L.description,contentLength:0,isEnabled:()=>!0,isHidden:!1,isMcp:!0,progressMessage:"running",userFacingName(){return`${H.name}:${L.name} (MCP)`},argNames:I,source:"mcp",async getPromptForCommand(D){let B=D.split(" ");try{let f=await A3H(H),E=await f.client.getPrompt({name:L.name,arguments:enA(I,B)});return(await Promise.all(E.messages.map((G)=>dqD(G.content,f.name)))).flat()}catch(f){throw ME(H.name,`Error running command '${L.name}': ${f instanceof Error?f.message:String(f)}`),f}}}})}catch($){return ME(H.name,`Failed to fetch commands: ${$ instanceof Error?$.message:String($)}`),[]}});n2$=o$(async(H)=>{return new Promise(($)=>{let A=0,L=0;if(A=Object.keys(H).length,A===0){$({clients:[],tools:[],commands:[]});return}let I=[],D=[],B=[];i2$((f)=>{if(I.push(f.client),D.push(...f.tools),B.push(...f.commands),L++,L>=A){let E=B.reduce((M,G)=>{let U=G.name.length+(G.description??"").length+(G.argumentHint??"").length;return M+U},0);c("tengu_mcp_tools_commands_loaded",{tools_count:D.length,commands_count:B.length,commands_metadata_length:E}),$({clients:I,tools:D,commands:B})}},H).catch((f)=>{ME("prefetchAllMcpResources",`Failed to get MCP resources: ${f instanceof Error?f.message:String(f)}`),$({clients:[],tools:[],commands:[]})})})})});class wS{static instance;baseline=new Map;initialized=!1;mcpClient;lastProcessedTimestamps=new Map;rightFileDiagnosticsState=new Map;static getInstance(){if(!wS.instance)wS.instance=new wS;return wS.instance}initialize(H){if(this.initialized)return;this.mcpClient=H,this.initialized=!0}async shutdown(){this.initialized=!1,this.baseline.clear()}reset(){this.baseline.clear(),this.rightFileDiagnosticsState.clear()}normalizeFileUri(H){let $=["file://","_claude_fs_right:","_claude_fs_left:"],A=H;for(let L of $)if(H.startsWith(L)){A=H.slice(L.length);break}return r2$(A)}async ensureFileOpened(H){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return;try{await Vx("openFile",{filePath:H,preview:!1,startText:"",endText:"",selectToEndOfLine:!1,makeFrontmost:!1},this.mcpClient)}catch($){r($)}}async beforeFileEdited(H){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return;let $=Date.now();try{let A=await Vx("getDiagnostics",{uri:`file://${H}`},this.mcpClient),L=this.parseDiagnosticResult(A)[0];if(L){if(!rqD(this.normalizeFileUri(H),this.normalizeFileUri(L.uri))){r(new nqD(`Diagnostics file path mismatch: expected ${H}, got ${L.uri})`));return}let I=this.normalizeFileUri(H);this.baseline.set(I,L.diagnostics),this.lastProcessedTimestamps.set(I,$)}else{let I=this.normalizeFileUri(H);this.baseline.set(I,[]),this.lastProcessedTimestamps.set(I,$)}}catch(A){}}async getNewDiagnostics(){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return[];let H=[];try{let I=await Vx("getDiagnostics",{},this.mcpClient);H=this.parseDiagnosticResult(I)}catch(I){return[]}let $=H.filter((I)=>this.baseline.has(this.normalizeFileUri(I.uri))).filter((I)=>I.uri.startsWith("file://")),A=new Map;H.filter((I)=>this.baseline.has(this.normalizeFileUri(I.uri))).filter((I)=>I.uri.startsWith("_claude_fs_right:")).forEach((I)=>{A.set(this.normalizeFileUri(I.uri),I)});let L=[];for(let I of $){let D=this.normalizeFileUri(I.uri),B=this.baseline.get(D)||[],f=A.get(D),E=I;if(f){let G=this.rightFileDiagnosticsState.get(D);if(!G||!this.areDiagnosticArraysEqual(G,f.diagnostics))E=f;this.rightFileDiagnosticsState.set(D,f.diagnostics)}let M=E.diagnostics.filter((G)=>!B.some((U)=>this.areDiagnosticsEqual(G,U)));if(M.length>0)L.push({uri:I.uri,diagnostics:M});this.baseline.set(D,E.diagnostics)}return L}parseDiagnosticResult(H){if(Array.isArray(H)){let $=H.find((A)=>A.type==="text");if($&&"text"in $)return DA($.text)}return[]}areDiagnosticsEqual(H,$){return H.message===$.message&&H.severity===$.severity&&H.source===$.source&&H.code===$.code&&H.range.start.line===$.range.start.line&&H.range.start.character===$.range.start.character&&H.range.end.line===$.range.end.line&&H.range.end.character===$.range.end.character}areDiagnosticArraysEqual(H,$){if(H.length!==$.length)return!1;return H.every((A)=>$.some((L)=>this.areDiagnosticsEqual(A,L)))&&$.every((A)=>H.some((L)=>this.areDiagnosticsEqual(L,A)))}isLinterDiagnostic(H){let $=["eslint","eslint-plugin","tslint","prettier","stylelint","jshint","standardjs","xo","rome","biome","deno-lint","rubocop","pylint","flake8","black","ruff","clippy","rustfmt","golangci-lint","gofmt","swiftlint","detekt","ktlint","checkstyle","pmd","sonarqube","sonarjs"];if(!H.source)return!1;let A=H.source.toLowerCase();return $.some((L)=>A.includes(L))}async handleQueryStart(H){if(!this.initialized){let $=CY(H);if($)this.initialize($)}else this.reset()}static formatDiagnosticsSummary(H){let A=H.map((L)=>{let I=L.uri.split("/").pop()||L.uri,D=L.diagnostics.map((B)=>{return` ${wS.getSeveritySymbol(B.severity)} [Line ${B.range.start.line+1}:${B.range.start.character+1}] ${B.message}${B.code?` [${B.code}]`:""}${B.source?` (${B.source})`:""}`}).join(` `)!==Z.content)throw Error(QzH)}else throw Error(QzH)}let J=X?eJ(f):"utf-8",F=X?M.readFileSync(f,{encoding:J}):null;if(gE())await Ct(L,f,B.uuid);let Q=X?kp(f):await ITD();M.mkdirSync(E),Ot(f,$,J,Q);let W=hp();if(W)OY$(`file://${f}`),W.changeFile(f,$).catch((Y)=>{N(`LSP: Failed to notify server of file change for ${f}: ${Y.message}`),r(Y)}),W.saveFile(f).catch((Y)=>{N(`LSP: Failed to notify server of file save for ${f}: ${Y.message}`),r(Y)});if(_t(f,F,$),A.set(f,{content:$,timestamp:x3(f),offset:void 0,limit:void 0}),f.endsWith(`${a2$.sep}CLAUDE.md`))c("tengu_write_claudemd",{});let P;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"&&!0&&NL("tengu_quartz_lantern",!1)){let Y=Date.now(),Z=await mY$(f);if(Z)P=Z;c("tengu_tool_use_diff_computed",{isWriteTool:!0,durationMs:Date.now()-Y,hasDiff:!!Z})}if(F){let Y=Iw({filePath:H,fileContents:F,edits:[{old_string:F,new_string:$,replace_all:!1}]}),Z={type:"update",filePath:H,content:$,structuredPatch:Y,originalFile:F,...P&&{gitDiff:P}};return tSH(Y),Ex({operation:"write",tool:"FileWriteTool",filePath:f,type:"update"}),{data:Z}}let C={type:"create",filePath:H,content:$,structuredPatch:[],originalFile:null,...P&&{gitDiff:P}};return tSH([],$),Ex({operation:"write",tool:"FileWriteTool",filePath:f,type:"create"}),{data:C}},mapToolResultToToolResultBlockParam({filePath:H,content:$,type:A},L){switch(A){case"create":return{tool_use_id:L,type:"tool_result",content:`File created successfully at: ${H}`};case"update":{if(NL("tengu_file_write_optimization",!1))return{tool_use_id:L,type:"tool_result",content:`The file ${H} has been overwritten successfully.`};return{tool_use_id:L,type:"tool_result",content:`The file ${H} has been updated. Here's the result of running \`cat -n\` on a snippet of the edited file: - IMPORTANT: For temporary files, use \`/tmp/claude/\` as your temporary directory - The TMPDIR environment variable is automatically set to \`/tmp/claude\` when running in sandbox mode - Do NOT use \`/tmp\` directly - use \`/tmp/claude/\` or rely on TMPDIR instead - Most programs that respect TMPDIR will automatically use \`/tmp/claude/\``}function cf1(){if(A$(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS))return"";return"\n - You can use the `run_in_background` parameter to run the command in the background. Only use this if you don't need the result immediately and are OK being notified when the command completes later. You do not need to check the output right away - you'll be notified when it finishes. You do not need to use '&' at the end of the command when using this parameter."}function GTD(){return`Executes a given bash command with optional timeout. Working directory persists between commands; shell state (everything else) does not. The shell environment is initialized from the user's profile (bash or zsh). ${U}`);else N("No stdout output captured");if(X)N(`stderr output (${X.length} chars): ${X}`);else N("No stderr output captured");r(Error(`Failed to create shell snapshot: ${G.message}`));let F=J?.signal?Iw$.constants.signals[J.signal]:void 0;c("tengu_shell_snapshot_failed",{stderr_length:X?.length||0,has_error_code:!!J?.code,error_signal_number:F,error_killed:J?.killed}),A(void 0)}else if(Yz.existsSync(E)){let J=Yz.statSync(E).size;N(`Shell snapshot created successfully (${J} bytes)`),PB(async()=>{try{if(Yz.existsSync(E))zH().unlinkSync(E),N(`Cleaned up session snapshot: ${E}`)}catch(F){N(`Error cleaning up session snapshot: ${F}`)}}),A(E)}else{N(`Shell snapshot file not found after creation: ${E}`),N(`Checking if parent directory still exists: ${f}`);let J=Yz.existsSync(f);if(N(`Parent directory exists: ${J}`),J)try{let F=zH().readdirSync(f);N(`Directory contains ${F.length} files`)}catch(F){N(`Could not read directory contents: ${F}`)}c("tengu_shell_unknown_error",{}),A(void 0)}})}catch(L){if(N(`Unexpected error during snapshot creation: ${L}`),L instanceof Error)N(`Error stack trace: ${L.stack}`);r(L instanceof Error?L:Error(String(L))),c("tengu_shell_snapshot_error",{}),A(void 0)}})};var _TD=K(()=>{EX();O_();_$();z$();NA();ZE();DL();Z9();E$();CR();PI();iMH();BW();Yz=require("fs"),VTD=require("child_process"),Lw$=require("path"),Iw$=b(require("os"))});function YTD(){return null}function NOA(H){try{return wTD.accessSync(H,ct.constants.X_OK),!0}catch($){try{return Bw$.execFileSync(H,["--version"],{timeout:1000,stdio:"ignore"}),!0}catch{return!1}}}function IE1(H){if(process.env.CLAUDE_CODE_SHELL_PREFIX)return"{ shopt -u extglob || setopt NO_EXTENDED_GLOB; } >/dev/null 2>&1 || true";if(H.includes("bash"))return"shopt -u extglob 2>/dev/null || true";else if(H.includes("zsh"))return"setopt NO_EXTENDED_GLOB 2>/dev/null || true";return null}async function DE1(){let H=process.env.CLAUDE_CODE_SHELL;if(H)if((H.includes("bash")||H.includes("zsh"))&&NOA(H))return N(`Using shell override: ${H}`),H;else N(`CLAUDE_CODE_SHELL="${H}" is not a valid bash/zsh path, falling back to detection`);let $=process.env.SHELL,A=$&&($.includes("bash")||$.includes("zsh")),L=$?.includes("bash"),[I,D]=await Promise.all([x_("zsh"),x_("bash")]),B=["/bin","/usr/bin","/usr/local/bin","/opt/homebrew/bin"],E=(L?["bash","zsh"]:["zsh","bash"]).flatMap((G)=>B.map((U)=>`${U}/${G}`));if(L){if(D)E.unshift(D);if(I)E.push(I)}else{if(I)E.unshift(I);if(D)E.push(D)}if(A&&NOA($))E.unshift($);let M=E.find((G)=>G&&NOA(G));if(!M){let G="No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL environment variable set.";throw r(Error(G)),Error(G)}return M}async function BE1(){let H=await DE1(),$;try{$=await PTD(H)}catch(A){N(`Failed to create shell snapshot: ${A}`),$=void 0}return{binShell:H,snapshotFilePath:$}}async function Ew$(H,$,A,L,I,D,B,f){let E=A||LE1,{binShell:M,snapshotFilePath:G}=await OOA();if(L)M=L,G=void 0;let U=Math.floor(Math.random()*65536).toString(16).padStart(4,"0"),X=CTD.tmpdir();if(oA()==="windows")X=PR(X);let J=Dw$.join(process.env.CLAUDE_CODE_TMPDIR||"/tmp",xOA()),F=B?Dw$.join(J,`cwd-${U}`):Dw$.join(X,`claude-${U}-cwd`),Q=XTD(H),W=UTD(H,Q);if(!B&&H.includes("|")&&Q)W=KTD(H);let P=[];if(G){if(!ct.existsSync(G))N(`Snapshot file missing, recreating: ${G}`),OOA.cache?.clear?.(),G=(await OOA()).snapshotFilePath;if(G){let u=oA()==="windows"?PR(G):G;P.push(`source ${wI([u])}`)}}let C=ayI();if(C)P.push(C);let Y=IE1(M);if(Y)P.push(Y);P.push(`eval ${W}`),P.push(`pwd -P >| ${F}`);let Z=P.join(" && ");if(process.env.CLAUDE_CODE_SHELL_PREFIX)Z=cF$(process.env.CLAUDE_CODE_SHELL_PREFIX,Z);let q=GtH();if($.aborted)return lyI();if(B){Z=await vL.wrapWithSandbox(Z,M,void 0,$);try{zH().mkdirSync(J,{mode:448})}catch(u){N(`Failed to create ${J} directory: ${u}`)}}let O=A$(process.env.CLAUDE_BASH_NO_LOGIN)&&G!==void 0,j=["-c",...O?[]:["-l"],Z];if(O)N("Spawning shell without login (-l flag skipped)");try{let u=YTD(),y=Bw$.spawn(M,j,{env:{...process.env,SHELL:M,GIT_EDITOR:"true",CLAUDECODE:"1",...{},...B?{TMPDIR:J,CLAUDE_CODE_TMPDIR:J}:{},...u?{TMUX:u}:{}},cwd:q,detached:!0,windowsHide:!0}),g=dF$(y,$,E,I,f);return g.result.then(async(h)=>{if(h&&!D&&!h.backgroundTaskId)try{MC(ct.readFileSync(F,{encoding:"utf8"}).trim(),q)}catch{c("tengu_shell_set_cwd",{success:!1})}try{ct.unlinkSync(F)}catch{}}),g}catch(u){return N(`Shell exec error: ${u instanceof Error?u.message:String(u)}`),{status:"killed",background:()=>null,kill:()=>{},cleanup:()=>{},result:Promise.resolve({code:126,stdout:"",stderr:u instanceof Error?u.message:String(u),interrupted:!1})}}}function MC(H,$){let A=fw$.isAbsolute(H)?H:fw$.resolve($||zH().cwd(),H);if(!zH().existsSync(A))throw Error(`Path "${A}" does not exist`);let L=zH().realpathSync(A);hS$(L);try{c("tengu_shell_set_cwd",{success:!0})}catch(I){}}var ct,Bw$,fw$,Dw$,CTD,wTD,LE1=1800000,OOA;var nh=K(()=>{EX();r7A();JTD();Zk();_$();z$();n7A();DL();g$();iMH();Z9();E$();QTD();_TD();tD();PI();EM();iF$();BM();NA();ct=require("fs"),Bw$=require("child_process"),fw$=require("path"),Dw$=require("path/posix"),CTD=b(require("os")),wTD=require("fs");OOA=o$(BE1)});function SOA(H){let $=H.split(` Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file. `)}`)));else if(!D.headers.location)throw iw$({status:D.statusCode},`HTTP ${D.statusCode} redirect with no location header`);else{let B=nw$.resolve(H,D.headers.location);dOD(B,$,A).then(L,I)}else L(D.body||Buffer.alloc(0))}).catch((D)=>{I(new pOD(iw$(D,`Error downloading ${H.href}`),H.href))})})}function j41(H,$){return new Promise((A,L)=>{let D=(H.protocol==="https:"?S41:x41).get({hostname:H.hostname,port:H.port,path:H.path,auth:H.auth,protocol:H.protocol,headers:$.headers||{},withCredentials:$.withCredentials});if(typeof D.setTimeout==="function")D.setTimeout($.timeout);D.on("timeout",()=>{D.abort()}),D.on("error",L),D.once("response",(B)=>{B.body=Buffer.alloc(0),B.on("data",(f)=>{B.body=Buffer.concat([B.body,Buffer.from(f)])}),B.on("error",L),B.on("end",()=>{A(B)})})})}});var rOD=z((SFM,nOD)=>{var R41=PND(),y41=yOD(),v41=hOD(),h41=kOD(),b41=mOD(),k41=lOD();nOD.exports=dxA;function dxA(H){pxA(this,dxA.defaults),pxA(this,H)}dxA.defaults={parse:{json:R41,yaml:y41,text:v41,binary:h41},resolve:{file:b41,http:k41,external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1}};function pxA(H,$){if(iOD($)){let A=Object.keys($);for(let L=0;L{var aOD=rOD();oOD.exports=u41;function u41(H){let $,A,L,I;if(H=Array.prototype.slice.call(H),typeof H[H.length-1]==="function")I=H.pop();if(typeof H[0]==="string")if($=H[0],typeof H[2]==="object")A=H[1],L=H[2];else A=void 0,L=H[1];else $="",A=H[0],L=H[1];if(!(L instanceof aOD))L=new aOD(L);return{path:$,schema:A,options:L,callback:I}}});var $xD=z((RFM,HxD)=>{var sOD=R3H(),g41=nuH(),m41=BxA(),LgH=Cz(),{isHandledError:p41}=sS();HxD.exports=d41;function d41(H,$){if(!$.resolve.external)return Promise.resolve();try{let A=cxA(H.schema,H.$refs._root$Ref.path+"#",H.$refs,$);return Promise.all(A)}catch(A){return Promise.reject(A)}}function cxA(H,$,A,L,I){I=I||new Set;let D=[];if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!I.has(H))if(I.add(H),sOD.isExternal$Ref(H))D.push(eOD(H,$,A,L));else for(let B of Object.keys(H)){let f=g41.join($,B),E=H[B];if(sOD.isExternal$Ref(E))D.push(eOD(E,f,A,L));else D=D.concat(cxA(E,f,A,L,I))}return D}async function eOD(H,$,A,L){let I=LgH.resolve($,H.$ref),D=LgH.stripHash(I);if(H=A._$refs[D],H)return Promise.resolve(H.value);try{let B=await m41(I,A,L),f=cxA(B,D+"#",A,L);return Promise.all(f)}catch(B){if(!L.continueOnError||!p41(B))throw B;if(A._$refs[D])B.source=decodeURI(LgH.stripHash($)),B.path=LgH.safePointerToPath(LgH.getHash($));return[]}}});var IxD=z((yFM,LxD)=>{var rw$=R3H(),IgH=nuH(),lxA=Cz();LxD.exports=c41;function c41(H,$){let A=[];ixA(H,"schema",H.$refs._root$Ref.path+"#","#",0,A,H.$refs,$),l41(A)}function ixA(H,$,A,L,I,D,B,f){let E=$===null?H:H[$];if(E&&typeof E==="object"&&!ArrayBuffer.isView(E))if(rw$.isAllowed$Ref(E))AxD(H,$,A,L,I,D,B,f);else{let M=Object.keys(E).sort((G,U)=>{if(G==="definitions")return-1;else if(U==="definitions")return 1;else return G.length-U.length});for(let G of M){let U=IgH.join(A,G),X=IgH.join(L,G),J=E[G];if(rw$.isAllowed$Ref(J))AxD(E,G,A,X,I,D,B,f);else ixA(E,G,U,X,I,D,B,f)}}}function AxD(H,$,A,L,I,D,B,f){let E=$===null?H:H[$],M=lxA.resolve(A,E.$ref),G=B._resolve(M,L,f);if(G===null)return;let U=IgH.parse(L).length,X=lxA.stripHash(G.path),J=lxA.getHash(G.path),F=X!==B._root$Ref.path,Q=rw$.isExtended$Ref(E);I+=G.indirections;let W=i41(D,H,$);if(W)if(U{if(I.file!==D.file)return I.file{var nxA=R3H(),DxD=nuH(),{ono:r41}=it(),a41=Cz();ExD.exports=o41;function o41(H,$){let A=rxA(H.schema,H.$refs._root$Ref.path,"#",new Set,new Set,new Map,H.$refs,$);H.$refs.circular=A.circular,H.schema=A.value}function rxA(H,$,A,L,I,D,B,f){let E,M={value:H,circular:!1},G=f.dereference.excludedPathMatcher;if(f.dereference.circular==="ignore"||!I.has(H)){if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!G(A)){if(L.add(H),I.add(H),nxA.isAllowed$Ref(H,f))E=BxD(H,$,A,L,I,D,B,f),M.circular=E.circular,M.value=E.value;else for(let U of Object.keys(H)){let X=DxD.join($,U),J=DxD.join(A,U);if(G(J))continue;let F=H[U],Q=!1;if(nxA.isAllowed$Ref(F,f)){if(E=BxD(F,X,J,L,I,D,B,f),Q=E.circular,H[U]!==E.value)H[U]=E.value}else if(!L.has(F)){if(E=rxA(F,X,J,L,I,D,B,f),Q=E.circular,H[U]!==E.value)H[U]=E.value}else Q=fxD(X,B,f);M.circular=M.circular||Q}L.delete(H)}}return M}function BxD(H,$,A,L,I,D,B,f){let E=a41.resolve($,H.$ref),M=D.get(E);if(M){let Q=Object.keys(H);if(Q.length>1){let W={};for(let P of Q)if(P!=="$ref"&&!(P in M.value))W[P]=H[P];return{circular:M.circular,value:Object.assign({},M.value,W)}}return M}let G=B._resolve(E,$,f);if(G===null)return{circular:!1,value:null};let U=G.circular,X=U||L.has(G.value);X&&fxD($,B,f);let J=nxA.dereference(H,G.value);if(!X){let Q=rxA(J,G.path,A,L,I,D,B,f);X=Q.circular,J=Q.value}if(X&&!U&&f.dereference.circular==="ignore")J=H;if(U)J.$ref=A;let F={circular:X,value:J};if(Object.keys(H).length===1)D.set(E,F);return F}function fxD(H,$,A){if($.circular=!0,!A.dereference.circular)throw r41.reference(`Circular $ref pointer found at ${H}`);return!0}});var UxD=z((hFM,GxD)=>{function t41(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function($){setTimeout($,0)}}GxD.exports=t41()});var FxD=z((bFM,JxD)=>{var XxD=UxD();JxD.exports=function($,A){if($){A.then(function(L){XxD(function(){$(null,L)})},function(L){XxD(function(){$(L)})});return}else return A}});var VxD=z((kFM,eh)=>{var WxD=UND(),s41=BxA(),aw$=tOD(),e41=$xD(),H51=IxD(),$51=MxD(),g3H=Cz(),{JSONParserError:A51,InvalidPointerError:L51,MissingPointerError:I51,ResolverError:D51,ParserError:B51,UnmatchedParserError:f51,UnmatchedResolverError:E51,isHandledError:M51,JSONParserErrorGroup:KxD}=sS(),Hj=FxD(),{ono:QxD}=it();eh.exports=sh;eh.exports.default=sh;eh.exports.JSONParserError=A51;eh.exports.InvalidPointerError=L51;eh.exports.MissingPointerError=I51;eh.exports.ResolverError=D51;eh.exports.ParserError=B51;eh.exports.UnmatchedParserError=f51;eh.exports.UnmatchedResolverError=E51;function sh(){this.schema=null,this.$refs=new WxD}sh.parse=function($,A,L,I){let B=new this;return B.parse.apply(B,arguments)};sh.prototype.parse=async function($,A,L,I){let D=aw$(arguments),B;if(!D.path&&!D.schema){let M=QxD(`Expected a file path, URL, or object. Got ${D.path||D.schema}`);return Hj(D.callback,Promise.reject(M))}this.schema=null,this.$refs=new WxD;let f="http";if(g3H.isFileSystemPath(D.path))D.path=g3H.fromFileSystemPath(D.path),f="file";if(D.path=g3H.resolve(g3H.cwd(),D.path),D.schema&&typeof D.schema==="object"){let M=this.$refs._add(D.path);M.value=D.schema,M.pathType=f,B=Promise.resolve(D.schema)}else B=s41(D.path,this.$refs,D.options);let E=this;try{let M=await B;if(M!==null&&typeof M==="object"&&!Buffer.isBuffer(M))return E.schema=M,Hj(D.callback,Promise.resolve(E.schema));else if(D.options.continueOnError)return E.schema=null,Hj(D.callback,Promise.resolve(E.schema));else throw QxD.syntax(`"${E.$refs._root$Ref.path||M}" is not a valid JSON Schema`)}catch(M){if(!D.options.continueOnError||!M51(M))return Hj(D.callback,Promise.reject(M));if(this.$refs._$refs[g3H.stripHash(D.path)])this.$refs._$refs[g3H.stripHash(D.path)].addError(M);return Hj(D.callback,Promise.resolve(null))}};sh.resolve=function($,A,L,I){let B=new this;return B.resolve.apply(B,arguments)};sh.prototype.resolve=async function($,A,L,I){let D=this,B=aw$(arguments);try{return await this.parse(B.path,B.schema,B.options),await e41(D,B.options),axA(D),Hj(B.callback,Promise.resolve(D.$refs))}catch(f){return Hj(B.callback,Promise.reject(f))}};sh.bundle=function($,A,L,I){let B=new this;return B.bundle.apply(B,arguments)};sh.prototype.bundle=async function($,A,L,I){let D=this,B=aw$(arguments);try{return await this.resolve(B.path,B.schema,B.options),H51(D,B.options),axA(D),Hj(B.callback,Promise.resolve(D.schema))}catch(f){return Hj(B.callback,Promise.reject(f))}};sh.dereference=function($,A,L,I){let B=new this;return B.dereference.apply(B,arguments)};sh.prototype.dereference=async function($,A,L,I){let D=this,B=aw$(arguments);try{return await this.resolve(B.path,B.schema,B.options),$51(D,B.options),axA(D),Hj(B.callback,Promise.resolve(D.schema))}catch(f){return Hj(B.callback,Promise.reject(f))}};function axA(H){if(KxD.getParserErrors(H).length>0)throw new KxD(H)}});function A1H({mainThreadAgentDefinition:H,toolUseContext:$,customSystemPrompt:A,defaultSystemPrompt:L,appendSystemPrompt:I,overrideSystemPrompt:D}){if(D)return[D];let B=H?TK(H)?H.getSystemPrompt({toolUseContext:{options:$.options}}):H.getSystemPrompt():void 0;if(H?.memory)c("tengu_agent_memory_loaded",{...{},scope:H.memory,isMainLoopAgent:!0});return[...B?[B]:A?[A]:L,...I?[I]:[]]}var ow$=K(()=>{kT();z$();NA()});async function DgH(H,$){try{let A=await bSH(H,$);if(A!==null)return A;N(`countTokensWithFallback: API returned null, trying haiku fallback (${$.length} tools)`)}catch(A){N(`countTokensWithFallback: API failed: ${A instanceof Error?A.message:String(A)}`),r(A instanceof Error?A:Error(String(A)))}try{let A=await sPI(H,$);if(A===null)N(`countTokensWithFallback: haiku fallback also returned null (${$.length} tools)`);return A}catch(A){return N(`countTokensWithFallback: haiku fallback failed: ${A instanceof Error?A.message:String(A)}`),r(A instanceof Error?A:Error(String(A))),null}}async function $d(H,$,A,L){let I=await Promise.all(H.map((B)=>ew$(B,{getToolPermissionContext:$,tools:H,agents:A?.activeAgents??[],model:L}))),D=await DgH([],I);if(D===null||D===0){let B=H.map((f)=>f.name).join(", ");N(`countToolDefinitionTokens returned ${D} for ${H.length} tools: ${B.slice(0,100)}${B.length>100?"...":""}`)}return D??0}async function G51(H){let $=await k5(),A=[...H,...Object.values($)];if(A.length<1)return 0;return(await Promise.all(A.filter((I)=>I.length>0).map((I)=>DgH([{role:"user",content:I}],[])))).reduce((I,D)=>I+(D||0),0)}async function U51(){let H=QJ(),$=[],A=0;if(H.length<1)return{memoryFileDetails:[],claudeMdTokens:0};let L=await Promise.all(H.map(async(I)=>{let D=await DgH([{role:"user",content:I.content}],[]);return{file:I,tokens:D||0}}));for(let{file:I,tokens:D}of L)A+=D,$.push({path:I.path,type:I.type,tokens:D});return{claudeMdTokens:A,memoryFileDetails:$}}async function X51(H,$,A,L,I){let D=H.filter((Q)=>!Q.isMcp);if(D.length<1)return{builtInToolTokens:0,deferredBuiltinDetails:[],deferredBuiltinTokens:0};let{isToolSearchEnabled:B}=await Promise.resolve().then(() => (GT(),sxA)),{isDeferredTool:f}=await Promise.resolve().then(() => (ia(),IyI)),E=await B(L??"",H,$,A?.activeAgents??[],"analyzeBuiltIn"),M=D.filter((Q)=>!f(Q)),G=D.filter((Q)=>f(Q)),U=M.length>0?await $d(M,$,A,L):0,X=[],J=0,F=0;if(G.length>0&&E){let Q=new Set;if(I){let P=new Set(G.map((C)=>C.name));for(let C of I)if(C.type==="assistant"){for(let Y of C.message.content)if("type"in Y&&Y.type==="tool_use"&&"name"in Y&&typeof Y.name==="string"&&P.has(Y.name))Q.add(Y.name)}}let W=await Promise.all(G.map((P)=>$d([P],$,A,L)));for(let[P,C]of G.entries()){let Y=Math.max(0,(W[P]||0)-tw$),Z=Q.has(C.name);if(X.push({name:C.name,tokens:Y,isLoaded:Z}),F+=Y,Z)J+=Y}}else if(G.length>0){let Q=await $d(G,$,A,L);return{builtInToolTokens:U+Q,deferredBuiltinDetails:[],deferredBuiltinTokens:0}}return{builtInToolTokens:U+J,deferredBuiltinDetails:X,deferredBuiltinTokens:F-J}}function PxD(H){return H.find(($)=>$.name===WJ)}async function J51(H,$,A){let L=await ajI(C$()),I=PxD(H);if(!I)return{slashCommandTokens:0,commandInfo:{totalCommands:0,includedCommands:0}};return{slashCommandTokens:await $d([I],$,A),commandInfo:{totalCommands:L.totalCommands,includedCommands:L.includedCommands}}}async function F51(H,$,A){try{let L=await ojI(C$()),I=PxD(H);if(!I)return{skillTokens:0,skillInfo:{totalSkills:0,includedSkills:0,skillFrontmatter:[]}};let D=await $d([I],$,A),B=L.map((f)=>({name:f.userFacingName(),source:f.type==="prompt"?f.source:"plugin",tokens:R6H(f)}));return{skillTokens:D,skillInfo:{totalSkills:L.length,includedSkills:L.length,skillFrontmatter:B}}}catch(L){return r(L instanceof Error?L:Error("Failed to count skill tokens")),{skillTokens:0,skillInfo:{totalSkills:0,includedSkills:0,skillFrontmatter:[]}}}}async function BgH(H,$,A,L,I){let D=H.filter((Q)=>Q.isMcp),B=[],E=(await Promise.all(D.map((Q)=>$d([Q],$,A,L)))).map((Q)=>Math.max(0,(Q||0)-tw$)),M=E.reduce((Q,W)=>Q+W,0),{isToolSearchEnabled:G}=await Promise.resolve().then(() => (GT(),sxA)),U=await G(L,H,$,A?.activeAgents??[],"analyzeMcp"),X=new Set;if(U&&I){let Q=new Set(D.map((W)=>W.name));for(let W of I)if(W.type==="assistant"){for(let P of W.message.content)if("type"in P&&P.type==="tool_use"&&"name"in P&&typeof P.name==="string"&&Q.has(P.name))X.add(P.name)}}for(let[Q,W]of D.entries())B.push({name:W.name,serverName:W.name.split("__")[1]||"unknown",tokens:E[Q],isLoaded:X.has(W.name)});let J=0,F=0;for(let Q of B)if(Q.isLoaded)J+=Q.tokens;else if(U)F+=Q.tokens;return{mcpToolTokens:U?J:M,mcpToolDetails:B,deferredToolTokens:F,loadedMcpToolNames:X}}async function _xD(H,$,A){let L=H.filter((I)=>!I.isMcp);if(L.length===0)return 0;return $d(L,$,A)}async function K51(H){let $=H.activeAgents.filter((D)=>D.source!=="built-in"),A=[],L=0,I=await Promise.all($.map((D)=>DgH([{role:"user",content:[D.agentType,D.whenToUse].join(" ")}],[])));for(let[D,B]of $.entries()){let f=I[D]||0;L+=f||0,A.push({agentType:B.agentType,source:B.source,tokens:f||0})}return{agentTokens:L,agentDetails:A}}async function Q51(H){let $=await rh(H),A={totalTokens:0,toolCallTokens:0,toolResultTokens:0,attachmentTokens:0,assistantMessageTokens:0,userMessageTokens:0,toolCallsByType:new Map,toolResultsByType:new Map,attachmentsByType:new Map},L=await DgH(JJ($.messages).map((I)=>{if(I.type==="assistant")return{role:"assistant",content:I.message.content};return I.message}),[]);return A.totalTokens=L??0,A}async function sw$(H,$,A,L,I,D,B,f,E){let M=BLH({permissionMode:(await A()).mode,mainLoopModel:$}),G=JV(M,V6()),U=await HC(L,M),X=A1H({mainThreadAgentDefinition:f,toolUseContext:B??{options:{}},customSystemPrompt:B?.options.customSystemPrompt,defaultSystemPrompt:U,appendSystemPrompt:B?.options.appendSystemPrompt}),[J,{claudeMdTokens:F,memoryFileDetails:Q},{builtInToolTokens:W,deferredBuiltinDetails:P,deferredBuiltinTokens:C},{mcpToolTokens:Y,mcpToolDetails:Z,deferredToolTokens:q},{agentTokens:O,agentDetails:j},{slashCommandTokens:u,commandInfo:y},g]=await Promise.all([G51(X),U51(),X51(L,A,I,M,H),BgH(L,A,I,M,H),K51(I),J51(L,A,I),Q51(H)]),p=(await F51(L,A,I)).skillInfo,d=p.skillFrontmatter.reduce((vH,tH)=>vH+tH.tokens,0),k=g.totalTokens,n=ep(),GH=n?d9H($)-rOA:void 0,HH=[];if(J>0)HH.push({name:"System prompt",tokens:J,color:"promptBorder"});let BH=W-d;if(BH>0)HH.push({name:"System tools",tokens:BH,color:"inactive"});if(Y>0)HH.push({name:"MCP tools",tokens:Y,color:"cyan_FOR_SUBAGENTS_ONLY"});if(q>0)HH.push({name:"MCP tools (deferred)",tokens:q,color:"inactive",isDeferred:!0});if(C>0)HH.push({name:"System tools (deferred)",tokens:C,color:"inactive",isDeferred:!0});if(O>0)HH.push({name:"Custom agents",tokens:O,color:"permission"});if(F>0)HH.push({name:"Memory files",tokens:F,color:"claude"});if(d>0)HH.push({name:"Skills",tokens:d,color:"warning"});if(k!==null&&k>0)HH.push({name:"Messages",tokens:k,color:"purple_FOR_SUBAGENTS_ONLY"});let WH=HH.reduce((vH,tH)=>vH+(tH.isDeferred?0:tH.tokens),0),wH=0;if(n&&GH!==void 0)wH=G-GH,HH.push({name:oxA,tokens:wH,color:"inactive"});else if(!n)wH=aOA,HH.push({name:txA,tokens:wH,color:"inactive"});let QH=Math.max(0,G-WH-wH);HH.push({name:"Free space",tokens:QH,color:"promptBorder"});let TH=WH,t=v4$(E??H),KH=(t?t.input_tokens+t.cache_creation_input_tokens+t.cache_read_input_tokens:null)??TH,MH=D&&D<80,CH=G>=1e6?MH?5:20:MH?5:10,OH=G>=1e6?10:MH?5:10,LH=CH*OH,DH=HH.filter((vH)=>!vH.isDeferred).map((vH)=>({...vH,squares:vH.name==="Free space"?Math.round(vH.tokens/G*LH):Math.max(1,Math.round(vH.tokens/G*LH)),percentageOfTotal:Math.round(vH.tokens/G*100)}));function EH(vH){let tH=[],K$=vH.tokens/G*LH,KA=Math.floor(K$),UA=K$-KA;for(let U$=0;U$0)hA=UA;tH.push({color:vH.color,isFilled:!0,categoryName:vH.name,tokens:vH.tokens,percentage:vH.percentageOfTotal,squareFullness:hA})}return tH}let $H=[],FH=DH.find((vH)=>vH.name===oxA||vH.name===txA),YH=DH.filter((vH)=>vH.name!==oxA&&vH.name!==txA&&vH.name!=="Free space");for(let vH of YH){let tH=EH(vH);for(let K$ of tH)if($H.lengthvH.name==="Free space"),hH=LH-qH;while($H.length0?{totalCommands:y.totalCommands,includedCommands:y.includedCommands,tokens:u}:void 0,skills:d>0?{totalSkills:p.totalSkills,includedSkills:p.includedSkills,tokens:d,skillFrontmatter:p.skillFrontmatter}:void 0,autoCompactThreshold:GH,isAutoCompactEnabled:n,messageBreakdown:gH,apiUsage:t}}var oxA="Autocompact buffer",txA="Compact buffer",tw$=500;var m3H=K(()=>{nC();g$();bT();Aw();$3();Ow();ow$();mQ();lt();_L();$s();aI();oRH();PI();jp();_$();E$();zt();Z$()});function P51(H,$){let A=V51[H];if(!A||A.length===0)return $;let L={...$},I=L.properties;if(I&&typeof I==="object"){let D={...I};for(let B of A)delete D[B];L.properties=D}return L}async function ew$(H,$){let A=cf("tengu_tool_pear"),L="inputJSONSchema"in H&&H.inputJSONSchema?H.inputJSONSchema:t9H(H.inputSchema);if(!dL())L=P51(H.name,L);let I={name:H.name,description:await H.prompt({getToolPermissionContext:$.getToolPermissionContext,tools:$.tools,agents:$.agents,allowedAgentTypes:$.allowedAgentTypes}),input_schema:L};if(A&&H.strict===!0&&$.model&&Ac$($.model))I.strict=!0;if($.betas?.includes(vlH)&&H.input_examples)I.input_examples=H.input_examples;if($.deferLoading)I.defer_loading=!0;if($.cacheControl)I.cache_control=$.cacheControl;return I}function CxD(H){let[$]=exA(H),A=$?.text;c("tengu_sysprompt_block",{snippet:A?.slice(0,20),length:A?.length??0,hash:A?YxD.createHash("sha256").update(A).digest("hex"):""})}function exA(H,$){let A=sI()==="firstParty"&&(A$(process.env.CLAUDE_CODE_FORCE_GLOBAL_CACHE)||NL("tengu_system_prompt_global_cache",!1));if(A&&$?.skipGlobalCacheForSystemPrompt){c("tengu_sysprompt_using_tool_based_cache",{promptBlockCount:H.length});let E,M,G=[];for(let J of H){if(!J)continue;if(J===p3H)continue;if(J.startsWith("x-anthropic-billing-header"))E=J;else if(y9$.has(J))M=J;else G.push(J)}let U=[];if(E)U.push({text:E,cacheScope:null});if(M)U.push({text:M,cacheScope:null});let X=G.join(` `,isMeta:!0}),...H]}async function ZxD(H,$){if(NP())return;let[{tools:A},L,I,D]=await Promise.all([n2$(H),yK($),u5(),k5()]),B=D.gitStatus?.length??0,f=I.claudeMd?.length??0,E=B+f,M=nD();setTimeout(()=>M.abort(),1000);let G=C$(),U=jFH($),X=SFH(U,G),J=await btH(G,M.signal,X),F=0,Q=0,W=0,P=0,C=0,Y=L.filter((q)=>!q.isMcp);F=A.length,P=Y.length;let Z=new Set;for(let q of A){let O=q.name.split("__");if(O.length>=3&&O[1])Z.add(O[1])}Q=Z.size;try{let q=CwD($,A);if(A.length>0){let O=X1(),{mcpToolTokens:j}=await BgH(q,async()=>$,null,O);W=j}if(Y.length>0)C=await _xD(q,async()=>$,null)}catch{}c("tengu_context_size",{git_status_size:B,claude_md_size:f,total_context_size:E,project_file_count_rounded:J,mcp_tools_count:F,mcp_servers_count:Q,mcp_tools_tokens:W,non_mcp_tools_count:P,non_mcp_tools_tokens:C})}function qxD(H,$,A){switch(H.name){case xY:{let L=uQ(A);if(L)return{...$,plan:L};return $}case aD.name:{let L=aD.inputSchema.parse($),{command:I,timeout:D,description:B}=L,f=I.replace(`cd ${C$()} && `,"");if(f=f.replace(/\\\\;/g,"\\;"),/^echo\s+["']?[^|&;><]*["']?$/i.test(f.trim()))c("tengu_bash_tool_simple_echo",{});let E="run_in_background"in L?L.run_in_background:void 0;return{command:f,description:B,...D?{timeout:D}:{},...B?{description:B}:{},...E?{run_in_background:E}:{},..."dangerouslyDisableSandbox"in L&&L.dangerouslyDisableSandbox?{dangerouslyDisableSandbox:L.dangerouslyDisableSandbox}:{}}}case S3.name:{let L=S3.inputSchema.parse($),{file_path:I,edits:D}=vRI({file_path:L.file_path,edits:[{old_string:L.old_string,new_string:L.new_string,replace_all:L.replace_all}]});return{replace_all:D[0].replace_all,file_path:I,old_string:D[0].old_string,new_string:D[0].new_string}}case h3.name:{let L=h3.inputSchema.parse($);return{file_path:L.file_path,content:x7A(L.content)}}case fQH:{let L=$,I=L.task_id??L.agentId??L.bash_id,D=L.timeout??(typeof L.wait_up_to==="number"?L.wait_up_to*1000:void 0);return{task_id:I??"",block:L.block??!0,timeout:D??30000}}default:return $}}function TxD(H,$){switch(H.name){case xY:{if($&&typeof $==="object"&&"plan"in $){let{plan:A,...L}=$;return L}return $}default:return $}}var YxD,W51,V51;var $s=K(()=>{NA();Ow$();SD();b9$();z$();_L();CR();PI();BM();zQ();T9H();JBH();ht();eE();T8();gQ();Z$();E$();m3H();aI();oM();$q();JHH();f3();bT();g7();Fo();Ow();SD();YxD=require("crypto"),W51=b(VxD(),1),V51={[xY]:["launchSwarm","teammateCount"],[E0]:["name","team_name","mode"]}});function $Z$(){if(!HSA)HSA=require("perf_hooks").performance;return HSA}function Y51(){let H=$Z$(),$=H.getEntriesByType("mark");for(let A of $)if(A.name.startsWith(EgH))H.clearMarks(A.name)}function ASA(){if(!tI())return;if(!$SA)return;if(fgH++,Y51(),$Z$().mark(`${EgH}turn_start`),HZ$)N(`[headlessProfiler] Started turn ${fgH}`)}function L1H(H){if(!tI())return;if(!$SA)return;let $=$Z$();if($.mark(`${EgH}${H}`),HZ$)N(`[headlessProfiler] Checkpoint: ${H} at ${$.now().toFixed(1)}ms`)}function LSA(){if(!tI())return;if(!$SA)return;let A=$Z$().getEntriesByType("mark").filter((G)=>G.name.startsWith(EgH));if(A.length===0)return;let L=new Map;for(let G of A){let U=G.name.slice(EgH.length);L.set(U,G.startTime)}let I=L.get("turn_start");if(I===void 0)return;let D={turn_number:fgH},B=L.get("system_message_yielded");if(B!==void 0&&fgH===0)D.time_to_system_message_ms=Math.round(B);let f=L.get("query_started");if(f!==void 0)D.time_to_query_start_ms=Math.round(f-I);let E=L.get("first_chunk");if(E!==void 0)D.time_to_first_response_ms=Math.round(E-I);let M=L.get("api_request_sent");if(f!==void 0&&M!==void 0)D.query_overhead_ms=Math.round(M-f);if(D.checkpoint_count=A.length,process.env.CLAUDE_CODE_ENTRYPOINT)D.entrypoint=process.env.CLAUDE_CODE_ENTRYPOINT;if(zxD)c("tengu_headless_latency",D);if(HZ$)N(`[headlessProfiler] Turn ${fgH} metrics: ${yH(D)}`)}var HZ$,_51=0.05,zxD,$SA,HSA=null,EgH="headless_",fgH=-1;var MgH=K(()=>{E$();z$();g$();Z$();HZ$=process.env.CLAUDE_CODE_PROFILE_STARTUP==="1",zxD=Math.random()<_51,$SA=HZ$||zxD});function AZ$(H){NxD.push(H)}async function OxD(H,$,A,L,I,D){let B={messages:H,systemPrompt:$,userContext:A,systemContext:L,toolUseContext:I,querySource:D};for(let f of NxD)try{await f(B)}catch(E){r(E instanceof Error?E:Error(`Post-sampling hook failed: ${E}`))}}var NxD;var GgH=K(()=>{_$();NxD=[]});var UgH;var ISA=K(()=>{UgH=class UgH{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(H){this.returned=H}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((H,$)=>{this.readResolve=H,this.readReject=$})}enqueue(H){if(this.readResolve){let $=this.readResolve;this.readResolve=void 0,this.readReject=void 0,$({done:!1,value:H})}else this.queue.push(H)}done(){if(this.isDone=!0,this.readResolve){let H=this.readResolve;this.readResolve=void 0,this.readReject=void 0,H({done:!0,value:void 0})}}error(H){if(this.hasError=H,this.readReject){let $=this.readReject;this.readResolve=void 0,this.readReject=void 0,$(H)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}});function c3H(H){if(H instanceof HM)return H.message||yY;if(!(H instanceof Error))return String(H);let A=DSA(H).filter(Boolean).join(` `)}function lxD(){if(!FgH)return;N(N51())}var FgH,USA,pxD=0,GSA=null,MSA=null;var l3H=K(()=>{E$();FgH=process.env.CLAUDE_CODE_PROFILE_QUERY==="1",USA=new Map});function x51(){return parseInt(process.env.CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY||"",10)||10}async function*IZ$(H,$,A,L){let I=L;for(let{isConcurrencySafe:D,blocks:B}of S51(H,I))if(D){let f={};for await(let E of R51(B,$,A,I)){if(E.contextModifier){let{toolUseID:M,modifyContext:G}=E.contextModifier;if(!f[M])f[M]=[];f[M].push(G)}yield{message:E.message,newContext:I}}for(let E of B){let M=f[E.id];if(!M)continue;for(let G of M)I=G(I)}yield{newContext:I}}else for await(let f of j51(B,$,A,I)){if(f.newContext)I=f.newContext;yield{message:f.message,newContext:I}}}function S51(H,$){return H.reduce((A,L)=>{let I=$.options.tools.find((f)=>f.name===L.name),D=I?.inputSchema.safeParse(L.input),B=D?.success?(()=>{try{return Boolean(I?.isConcurrencySafe(D.data))}catch{return!1}})():!1;if(B&&A[A.length-1]?.isConcurrencySafe)A[A.length-1].blocks.push(L);else A.push({isConcurrencySafe:B,blocks:[L]});return A},[])}async function*j51(H,$,A,L){let I=L;for(let D of H){L.setInProgressToolUseIDs((B)=>new Set([...B,D.id]));for await(let B of XgH(D,$.find((f)=>f.message.content.some((E)=>E.type==="tool_use"&&E.id===D.id)),A,I)){if(B.contextModifier)I=B.contextModifier.modifyContext(I);yield{message:B.message,newContext:I}}ixD(L,D.id)}}async function*R51(H,$,A,L){yield*mK$(H.map(async function*(I){L.setInProgressToolUseIDs((D)=>new Set([...D,I.id])),yield*XgH(I,$.find((D)=>D.message.content.some((B)=>B.type==="tool_use"&&B.id===I.id)),A,L),ixD(L,I.id)}),x51())}function ixD(H,$){H.setInProgressToolUseIDs((A)=>new Set([...A].filter((L)=>L!==$)))}var JSA=K(()=>{TBH();fSA()});function DZ$(H){return async($)=>{try{if(!await H.shouldRun($))return;let L=nxD.randomUUID(),I=H.buildMessages($);$.queryMessageCount=I.length;let D=H.systemPrompt?[H.systemPrompt]:$.systemPrompt,f=H.useTools??!0?$.toolUseContext.options.tools:[],E=H.getModel(),M=await xm({messages:I,systemPrompt:D,maxThinkingTokens:0,tools:f,signal:nD().signal,options:{getToolPermissionContext:async()=>{return(await $.toolUseContext.getAppState()).toolPermissionContext},model:E,toolChoice:void 0,isNonInteractiveSession:$.toolUseContext.options.isNonInteractiveSession,hasAppendSystemPrompt:!!$.toolUseContext.options.appendSystemPrompt,temperatureOverride:0,agents:$.toolUseContext.options.agentDefinitions.activeAgents,querySource:H.name,mcpTools:[],agentId:$.toolUseContext.agentId}}),G=M.message.content.filter((U)=>U.type==="text").map((U)=>U.text).join("").trim();try{let U=H.parseResponse(G,$);H.logResult({type:"success",queryName:H.name,result:U,messageId:M.message.id,model:E,uuid:L},$)}catch(U){H.logResult({type:"error",queryName:H.name,error:U,uuid:L},$)}}catch(A){r(A instanceof Error?A:Error(`API query hook ${H.name} failed`))}}}var nxD;var FSA=K(()=>{dU();eE();_$();nxD=require("crypto")});async function rxD(){return}async function axD(H){if(KSA)await KSA(H)}var KSA=null;var QSA=K(()=>{FSA();_L();z$();SD();aI();w7();$s()});function oxD(){y51=[]}var y51;var txD=K(()=>{y51=[]});async function sxD(){return}function b51(){oxD(),h51="",AA((H)=>({...H,coachingTipsThisSession:0}))}function exD(){return M$().coachingMode??"off"}var v51=!1,h51="";var KgH=K(()=>{qS();_L();g$();vA();z$();_$();txD()});async function*HSD(H,$,A,L,I,D,B,f,E,M,G,U,X){let J=Date.now(),F={messages:[...H,...$],systemPrompt:A,userContext:L,systemContext:I,toolUseContext:B,querySource:f};if(axD(F),process.env.CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION!=="false")ASD(F);try{let Q=[],P=(await B.getAppState()).toolPermissionContext.mode,C=QNA(P,B.abortController.signal,void 0,G??!1,B.agentId,B,[...H,...$],B.agentType),Y="",Z=0,q=!1,O="",j=!1,u=[],y=[];for await(let g of C){if(g.message){if(yield g.message,g.message.type==="progress"&&g.message.toolUseID){Y=g.message.toolUseID,Z++;let h=g.message.data;if(h.command)y.push({command:h.command,promptText:h.promptText})}if(g.message.type==="attachment"){let h=g.message.attachment;if("hookEvent"in h&&(h.hookEvent==="Stop"||h.hookEvent==="SubagentStop")){if(h.type==="hook_non_blocking_error")u.push(h.stderr||`Exit code ${h.exitCode}`),j=!0;else if(h.type==="hook_error_during_execution")u.push(h.content),j=!0;else if(h.type==="hook_success"){if(h.stdout&&h.stdout.trim()||h.stderr&&h.stderr.trim())j=!0}}}}if(g.blockingError){let h=R$({content:MNA(g.blockingError),isMeta:!0});Q.push(h),yield h,j=!0,u.push(g.blockingError.blockingError)}if(g.preventContinuation)q=!0,O=g.stopReason||"Stop hook prevented continuation",yield QB({type:"hook_stopped_continuation",message:O,hookName:"Stop",toolUseID:Y,hookEvent:"Stop"});if(B.abortController.signal.aborted){c("tengu_pre_stop_hooks_cancelled",{queryChainId:B.queryTracking?.chainId,queryDepth:B.queryTracking?.depth}),yield n3H({toolUse:!1});return}}if(Z>0){if(yield LSD(Z,y,u,q,O,j,"suggestion",Y),u.length>0){let g=CQ("app:toggleTranscript","Global","ctrl+o");B.addNotification?.({key:"stop-hook-error",text:`Stop hook error occurred \xB7 ${g} to see`,priority:"immediate"})}}if(q)return;if(Q.length>0){yield*vP({messages:[...H,...$,...Q],systemPrompt:A,userContext:L,systemContext:I,canUseTool:D,toolUseContext:B,autoCompactTracking:E,fallbackModel:M,stopHookActive:!0,querySource:f,maxTurns:U,turnCount:X});return}if(tf()){let g=g1()??"",h=g9()??"",p=[],d=sW(),n=GF(d).filter((HH)=>HH.status==="in_progress"&&HH.owner===g);for(let HH of n){let BH=XuH(HH.id,HH.subject,HH.description,g,h,P,B.abortController.signal,void 0,B);for await(let WH of BH){if(WH.message)yield WH.message;if(WH.blockingError){let wH=R$({content:UuH(WH.blockingError),isMeta:!0});p.push(wH),yield wH}if(B.abortController.signal.aborted)return}}let GH=WNA(g,h,P,B.abortController.signal);for await(let HH of GH){if(HH.message)yield HH.message;if(HH.blockingError){let BH=R$({content:GNA(HH.blockingError),isMeta:!0});p.push(BH),yield BH}if(B.abortController.signal.aborted)return}if(p.length>0)yield*vP({messages:[...H,...$,...p],systemPrompt:A,userContext:L,systemContext:I,canUseTool:D,toolUseContext:B,autoCompactTracking:E,fallbackModel:M,stopHookActive:!0,querySource:f,maxTurns:U,turnCount:X})}}catch(Q){let W=Date.now()-J;c("tengu_stop_hook_error",{duration:W,queryChainId:B.queryTracking?.chainId,queryDepth:B.queryTracking?.depth}),yield a7(`Stop hook failed: ${Q instanceof Error?Q.message:String(Q)}`,"warning")}}var $SD=K(()=>{z$();_L();J3();_3();XE();JG();QSA();FG();i3H();KgH();W9H()});function*WSA(H,$){for(let A of H){let L=A.message.content.filter((I)=>I.type==="tool_use");for(let I of L)yield R$({content:[{type:"tool_result",content:$,is_error:!0,tool_use_id:I.id}],toolUseResult:$,sourceToolAssistantUUID:A.uuid})}}async function*vP({messages:H,systemPrompt:$,userContext:A,systemContext:L,canUseTool:I,toolUseContext:D,autoCompactTracking:B,fallbackModel:f,stopHookActive:E,querySource:M,maxOutputTokensOverride:G,maxOutputTokensRecoveryCount:U=0,maxTurns:X,turnCount:J=1,pendingToolUseSummary:F}){if(yield{type:"stream_request_start"},_9("query_fn_entry"),!D.agentId)L1H("query_started");let Q=D.queryTracking?{chainId:D.queryTracking.chainId,depth:D.queryTracking.depth+1}:{chainId:VSA.randomUUID(),depth:0},W=Q.chainId;D={...D,queryTracking:Q};let P=[...GC(H)],C=B;_9("query_microcompact_start");let Y=await rh(P,void 0,D);if(P=Y.messages,Y.compactionInfo?.boundaryMessage)yield Y.compactionInfo.boundaryMessage;_9("query_microcompact_end");let Z=wxD($,L);_9("query_autocompact_start");let{compactionResult:q}=await OzD(P,D,{systemPrompt:$,userContext:A,systemContext:L,toolUseContext:D,forkContextMessages:P},M);if(_9("query_autocompact_end"),q){let{preCompactTokenCount:MH,postCompactTokenCount:CH,compactionUsage:OH}=q;if(c("tengu_auto_compact_succeeded",{originalMessageCount:H.length,compactedMessageCount:q.summaryMessages.length+q.attachments.length+q.hookResults.length,preCompactTokenCount:MH,postCompactTokenCount:CH,compactionInputTokens:OH?.input_tokens,compactionOutputTokens:OH?.output_tokens,compactionCacheReadTokens:OH?.cache_read_input_tokens??0,compactionCacheCreationTokens:OH?.cache_creation_input_tokens??0,compactionTotalTokens:OH?OH.input_tokens+(OH.cache_creation_input_tokens??0)+(OH.cache_read_input_tokens??0)+OH.output_tokens:0,queryChainId:W,queryDepth:Q.depth}),!C?.compacted)C={compacted:!0,turnId:VSA.randomUUID(),turnCounter:0};let LH=Et(q);for(let e of LH)yield e;P=LH,ZzD()}D={...D,messages:P};let O=[],j=[];_9("query_setup_start");let y=cf("tengu_streaming_tool_execution2")?new JgH(D.options.tools,I,D):null,g=await D.getAppState(),h=g.toolPermissionContext.mode,p=BLH({permissionMode:h,mainLoopModel:D.options.mainLoopModel,exceeds200kTokens:h==="plan"&&h4$(P)});_9("query_setup_end");let d=void 0;if(!q){let{isAtBlockingLimit:MH}=sp(UT(P),D.options.mainLoopModel);if(MH){yield qf({content:jg,error:"invalid_request"});return}}let k=!0;_9("query_api_loop_start");try{while(k){k=!1;try{let MH=!1;_9("query_api_streaming_start");for await(let CH of e6H({messages:d3H(P,A),systemPrompt:Z,maxThinkingTokens:D.options.maxThinkingTokens,tools:D.options.tools,signal:D.abortController.signal,options:{async getToolPermissionContext(){return(await D.getAppState()).toolPermissionContext},model:p,...cD()?{fastMode:g.fastMode}:{},toolChoice:void 0,isNonInteractiveSession:D.options.isNonInteractiveSession,fallbackModel:f,onStreamingFallback:()=>{MH=!0},querySource:M,agents:D.options.agentDefinitions.activeAgents,allowedAgentTypes:D.options.agentDefinitions.allowedAgentTypes,hasAppendSystemPrompt:!!D.options.appendSystemPrompt,maxOutputTokensOverride:G,fetchOverride:d,mcpTools:g.mcp.tools,queryTracking:Q,effortValue:g.effortValue,agentId:D.agentId}})){if(MH){for(let OH of O)yield{type:"tombstone",message:OH};if(c("tengu_orphaned_messages_tombstoned",{orphanedMessageCount:O.length,queryChainId:W,queryDepth:Q.depth}),O.length=0,j.length=0,y)y.discard(),y=new JgH(D.options.tools,I,D)}if(yield CH,CH.type==="assistant"){if(O.push(CH),y&&!D.abortController.signal.aborted){let OH=CH.message.content.filter((LH)=>LH.type==="tool_use");for(let LH of OH)y.addTool(LH,CH)}}if(y&&!D.abortController.signal.aborted){for(let OH of y.getCompletedResults())if(OH.message)yield OH.message,j.push(...JJ([OH.message],D.options.tools).filter((LH)=>LH.type==="user"))}}_9("query_api_streaming_end")}catch(MH){if(MH instanceof jU$&&f){if(p=f,k=!0,yield*WSA(O,"Model fallback triggered"),O.length=0,j.length=0,y)y.discard(),y=new JgH(D.options.tools,I,D);D.options.mainLoopModel=f,c("tengu_model_fallback_triggered",{original_model:MH.originalModel,fallback_model:f,entrypoint:"cli",queryChainId:W,queryDepth:Q.depth}),yield a7(`Model fallback triggered: switching from ${MH.originalModel} to ${MH.fallbackModel}`,"info");continue}throw MH}}}catch(MH){r(MH instanceof Error?MH:Error(String(MH)));let CH=MH instanceof Error?MH.message:String(MH);if(c("tengu_query_error",{assistantMessages:O.length,toolUses:O.flatMap((OH)=>OH.message.content.filter((LH)=>LH.type==="tool_use")).length,queryChainId:W,queryDepth:Q.depth}),MH instanceof lJH||MH instanceof eIH){yield qf({content:MH.message});return}yield*WSA(O,CH),yield n3H({toolUse:!1}),pZ("Query error",MH);return}if(O.length>0)OxD([...P,...O],$,A,L,D,M);if(O.some((MH)=>MH.message.content.some((CH)=>CH.type==="text"&&hzD(CH.text))))c("tengu_model_response_keyword_detected",{is_overly_agreeable:!0,queryChainId:W,queryDepth:Q.depth});if(D.abortController.signal.aborted){if(y){for await(let MH of y.getRemainingResults())if(MH.message)yield MH.message}else yield*WSA(O,"Interrupted by user");yield n3H({toolUse:!1});return}let GH=O.flatMap((MH)=>MH.message.content.filter((CH)=>CH.type==="tool_use"));if(F){let MH=await F;if(MH)yield MH}if(!O.length||!GH.length){if(O[O.length-1]?.apiError==="max_output_tokens"&&UOH.type==="user"))}BH={...y.getUpdatedContext(),queryTracking:Q}}else{c("tengu_streaming_tool_execution_not_used",{tool_count:GH.length,queryChainId:W,queryDepth:Q.depth});for await(let MH of IZ$(GH,O,I,D)){if(MH.message){if(yield MH.message,MH.message.type==="attachment"&&MH.message.attachment.type==="hook_stopped_continuation")HH=!0;j.push(...JJ([MH.message],D.options.tools).filter((CH)=>CH.type==="user"))}if(MH.newContext)BH={...MH.newContext,queryTracking:Q}}}_9("query_tool_execution_end");let WH;if(A$(process.env.CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES)&&GH.length>0&&!D.abortController.signal.aborted){let MH=O[O.length-1],CH;if(MH){let e=MH.message.content.filter((DH)=>DH.type==="text");if(e.length>0){let DH=e[e.length-1];if(DH&&"text"in DH)CH=DH.text}}let OH=GH.map((e)=>e.id),LH=GH.map((e)=>{let DH=j.find(($H)=>$H.type==="user"&&Array.isArray($H.message.content)&&$H.message.content.some((FH)=>FH.type==="tool_result"&&FH.tool_use_id===e.id)),EH=DH?.type==="user"&&Array.isArray(DH.message.content)?DH.message.content.find(($H)=>$H.type==="tool_result"&&$H.tool_use_id===e.id):void 0;return{name:e.name,input:e.input,output:EH&&"content"in EH?EH.content:null}});WH=jzD({tools:LH,signal:D.abortController.signal,isNonInteractiveSession:D.options.isNonInteractiveSession,lastAssistantText:CH}).then((e)=>{if(e)return ISD(e,OH);return null}).catch(()=>null)}if(D.abortController.signal.aborted){yield n3H({toolUse:!0});let MH=J+1;if(X&&MH>X)yield QB({type:"max_turns_reached",maxTurns:X,turnCount:MH});return}if(HH)return;if(C?.compacted)C.turnCounter++,c("tengu_post_autocompact_turn",{turnId:C.turnId,turnCounter:C.turnCounter,queryChainId:W,queryDepth:Q.depth});c("tengu_query_before_attachments",{messagesForQueryCount:P.length,assistantMessagesCount:O.length,toolResultsCount:j.length,queryChainId:W,queryDepth:Q.depth});let QH=(await BH.getAppState()).queuedCommands;for await(let MH of I6H(null,BH,null,QH,[...P,...O,...j],M))yield MH,j.push(MH);let TH=QH.filter((MH)=>MH.mode==="prompt");if(TH.length>0)aRI(TH,BH.setAppState);let t=j.filter((MH)=>MH.type==="attachment"&&MH.attachment.type==="edited_text_file").length;c("tengu_query_after_attachments",{totalToolResultsCount:j.length,fileChangeAttachmentCount:t,queryChainId:W,queryDepth:Q.depth});let IH={...BH,queryTracking:Q},KH=J+1;if(X&&KH>X){yield QB({type:"max_turns_reached",maxTurns:X,turnCount:KH});return}_9("query_recursive_call"),yield*vP({messages:[...P,...O,...j],systemPrompt:$,userContext:A,systemContext:L,canUseTool:I,toolUseContext:IH,autoCompactTracking:C,fallbackModel:f,stopHookActive:E,querySource:M,maxTurns:X,turnCount:KH,pendingToolUseSummary:WH})}var VSA,k51=3;var W9H=K(()=>{dU();IDH();jp();lt();Cp();SD();z$();ZU$();LT();NA();_$();ry();E$();_L();RzD();$s();J3();CP();g$();MgH();aI();$3();GgH();TQH();gxD();l3H();JSA();$SD();AJ();VSA=require("crypto")});function u51(H){if(H instanceof JD){let $=H.error;if($?.error?.message)return $.error.message}return H instanceof Error?H.message:String(H)}function PSA(H){let $=new Set;H.forEach((A,L)=>$.add(L));for(let[A,L]of Object.entries(g51))if(L.prefixes?.some((I)=>Array.from($).some((D)=>D.startsWith(I))))return A;return}function _SA(){return{...process.env.ANTHROPIC_BASE_URL?{baseUrl:process.env.ANTHROPIC_BASE_URL}:{},...process.env.ANTHROPIC_MODEL?{envModel:process.env.ANTHROPIC_MODEL}:{},...process.env.ANTHROPIC_SMALL_FAST_MODEL?{envSmallFastModel:process.env.ANTHROPIC_SMALL_FAST_MODEL}:{}}}function DSD(){if(!{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.BUILD_TIME)return;let H=new Date({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.BUILD_TIME).getTime();if(isNaN(H))return;return Math.floor((Date.now()-H)/60000)}function BSD({model:H,messagesLength:$,temperature:A,betas:L,permissionMode:I,querySource:D,queryTracking:B,effortValue:f,fastMode:E}){c("tengu_api_query",{model:H,messagesLength:$,temperature:A,provider:SR(),buildAgeMins:DSD(),...L?.length?{betas:L.join(",")}:{},permissionMode:I,querySource:D,...B?{queryChainId:B.chainId,queryDepth:B.depth}:{},effortValue:f,fastMode:E,..._SA()})}function YSA({error:H,model:$,messageCount:A,messageTokens:L,durationMs:I,durationMsIncludingRetries:D,attempt:B,requestId:f,didFallBackToNonStreaming:E,promptCategory:M,headers:G,queryTracking:U,querySource:X,llmSpan:J,fastMode:F}){let Q=void 0;if(H instanceof JD&&H.headers)Q=PSA(H.headers);else if(G)Q=PSA(G);let W=u51(H),P=H instanceof JD?String(H.status):void 0,C=G3I(H),Y=MSH(H);if(Y){let q=Y.isSSLError?" (SSL error)":"";N(`Connection error details: code=${Y.code}${q}, message=${Y.message}`,{level:"error"})}r(H),c("tengu_api_error",{model:$,error:W,status:P,errorType:C,messageCount:A,messageTokens:L,durationMs:I,durationMsIncludingRetries:D,attempt:B,provider:SR(),requestId:f||void 0,didFallBackToNonStreaming:E,...M?{promptCategory:M}:{},...Q?{gateway:Q}:{},...U?{queryChainId:U.chainId,queryDepth:U.depth}:{},...X?{querySource:X}:{},fastMode:F,..._SA()}),pQ("api_error",{model:$,error:W,status_code:String(P),duration_ms:String(I),attempt:String(B)}),d6A(J,{success:!1,statusCode:P?parseInt(P):void 0,error:W,attempt:B});let Z=rlH();if(Z?.isTeleported&&!Z.hasLoggedFirstMessage)c("tengu_teleport_first_message_error",{session_id:Z.sessionId,error_type:C}),alH()}function m51({model:H,preNormalizedModel:$,messageCount:A,messageTokens:L,usage:I,durationMs:D,durationMsIncludingRetries:B,attempt:f,ttftMs:E,requestId:M,stopReason:G,costUSD:U,didFallBackToNonStreaming:X,querySource:J,gateway:F,queryTracking:Q,permissionMode:W,globalCacheStrategy:P,textContentLength:C,fastMode:Y}){let Z=tI(),q=process.argv.includes("-p")||process.argv.includes("--print");c("tengu_api_success",{model:H,...$!==H?{preNormalizedModel:$}:{},messageCount:A,messageTokens:L,inputTokens:I.input_tokens,outputTokens:I.output_tokens,cachedInputTokens:I.cache_read_input_tokens??0,uncachedInputTokens:I.cache_creation_input_tokens??0,durationMs:D,durationMsIncludingRetries:B,attempt:f,ttftMs:E??void 0,buildAgeMins:DSD(),provider:SR(),requestId:M??void 0,stop_reason:G??void 0,costUSD:U,didFallBackToNonStreaming:X,isNonInteractiveSession:Z,print:q,isTTY:process.stdout.isTTY??!1,querySource:J,...F?{gateway:F}:{},...Q?{queryChainId:Q.chainId,queryDepth:Q.depth}:{},permissionMode:W,...P?{globalCacheStrategy:P}:{},...C!==void 0?{textContentLength:C}:{},fastMode:Y,..._SA()})}function fSD({model:H,preNormalizedModel:$,start:A,startIncludingRetries:L,ttftMs:I,usage:D,attempt:B,messageCount:f,messageTokens:E,requestId:M,stopReason:G,didFallBackToNonStreaming:U,querySource:X,headers:J,costUSD:F,queryTracking:Q,permissionMode:W,newMessages:P,llmSpan:C,globalCacheStrategy:Y,fastMode:Z}){let q=J?PSA(J):void 0,O=P?P.reduce((d,k)=>d+k.message.content.reduce((n,GH)=>n+(GH.type==="text"?GH.text.length:0),0),0):void 0,j=Date.now()-A,u=Date.now()-L;kS$(u,j),m51({model:H,preNormalizedModel:$,messageCount:f,messageTokens:E,usage:D,durationMs:j,durationMsIncludingRetries:u,attempt:B,ttftMs:I,requestId:M,stopReason:G,costUSD:F,didFallBackToNonStreaming:U,querySource:X,gateway:q,queryTracking:Q,permissionMode:W,globalCacheStrategy:Y,textContentLength:O,fastMode:Z}),pQ("api_request",{model:H,input_tokens:String(D.input_tokens),output_tokens:String(D.output_tokens),cache_read_tokens:String(D.cache_read_input_tokens),cache_creation_tokens:String(D.cache_creation_input_tokens),cost_usd:String(F),duration_ms:String(j)});let y,g,h;if(zF()&&P)y=P.flatMap((d)=>d.message.content.filter((k)=>k.type==="text").map((k)=>k.text)).join(` `))return!0;let A=$.indexOf("#");if(A!==-1&&!(A>0&&$[A-1]==="s"))return!0;if(/^!/.test($)||/[/\d$]!/.test($))return!0;if(/\d\s*~\s*\d|,\s*~\s*\d|\$\s*~\s*\d/.test($))return!0;if(/^,/.test($))return!0;if(/,\s*[+-]/.test($))return!0;if(/s\\/.test($)||/\\[|#%@]/.test($))return!0;if(/\\\/.*[wW]/.test($))return!0;if(/\/[^/]*\s+[wWeE]/.test($))return!0;if(/^s\//.test($)&&!/^s\/[^/]*\/[^/]*\/[^/]*$/.test($))return!0;if(/^s./.test($)&&/[wWeE]$/.test($)){if(!/^s([^\\\n]).*?\1.*?\1[^wWeE]*$/.test($))return!0}if(/^[wW]\s*\S+/.test($)||/^\d+\s*[wW]\s*\S+/.test($)||/^\$\s*[wW]\s*\S+/.test($)||/^\/[^/]*\/[IMim]*\s*[wW]\s*\S+/.test($)||/^\d+,\d+\s*[wW]\s*\S+/.test($)||/^\d+,\$\s*[wW]\s*\S+/.test($)||/^\/[^/]*\/[IMim]*,\/[^/]*\/[IMim]*\s*[wW]\s*\S+/.test($))return!0;if(/^e/.test($)||/^\d+\s*e/.test($)||/^\$\s*e/.test($)||/^\/[^/]*\/[IMim]*\s*e/.test($)||/^\d+,\d+\s*e/.test($)||/^\d+,\$\s*e/.test($)||/^\/[^/]*\/[IMim]*,\/[^/]*\/[IMim]*\s*e/.test($))return!0;let L=$.match(/s([^\\\n]).*?\1.*?\1(.*?)$/);if(L){let D=L[2]||"";if(D.includes("w")||D.includes("W"))return!0;if(D.includes("e")||D.includes("E"))return!0}if($.match(/y([^\\\n])/)){if(/[wWeE]/.test($))return!0}return!1}function USD(H,$){let A=gF(H.command);for(let L of A){let I=L.trim();if(I.split(/\s+/)[0]!=="sed")continue;let B=$.mode==="acceptEdits";if(!WgH(I,{allowFileWrites:B}))return{behavior:"ask",message:"sed command requires approval (contains potentially dangerous operations)",decisionReason:{type:"other",reason:"sed command contains operations that require explicit approval (e.g., write commands, execute commands)"}}}return{behavior:"passthrough",message:"No dangerous sed operations detected"}}var EZ$=K(()=>{g3();EX()});function QX1(){return KX1}function JSD(H,$){switch($){case"none":return!1;case"number":return/^\d+$/.test(H);case"string":return!0;case"char":return H.length===1;case"{}":return H==="{}";case"EOF":return H==="EOF";default:return!1}}function VX1(H){let $=TE(H,(M)=>`$${M}`);if(!$.success)return!1;let A=$.tokens.map((M)=>{if(typeof M!=="string"){if(M=M,M.op==="glob")return M.pattern}return M});if(A.some((M)=>typeof M!=="string"))return!1;let I=A;if(I.length===0)return!1;let D,B=0,f=QX1();for(let[M]of Object.entries(f)){let G=M.split(" ");if(I.length>=G.length){let U=!0;for(let X=0;X1&&XSD.test(M)){let[G,...U]=M.split("="),X=U.join("=");if(!G)return!1;let J=D.safeFlags[G];if(!J){if(I[0]==="git"&&G.match(/^-\d+$/)){E++;continue}if((I[0]==="grep"||I[0]==="rg")&&G.startsWith("-")&&!G.startsWith("--")&&G.length>2){let F=G.substring(0,2),Q=G.substring(2);if(D.safeFlags[F]&&/^\d+$/.test(Q)){let W=D.safeFlags[F];if(W==="number"||W==="string")if(JSD(Q,W)){E++;continue}else return!1}}if(G.startsWith("-")&&!G.startsWith("--")&&G.length>2){for(let F=1;F=I.length||I[E+1]&&I[E+1].startsWith("-")&&I[E+1].length>1&&XSD.test(I[E+1]))return!1;F=I[E+1]||"",E+=2}if(J==="string"&&F.startsWith("-"))if(G==="--sort"&&I[0]==="git"&&F.match(/^-[a-zA-Z]/));else return!1;if(!JSD(F,J))return!1}}else E++}if(D.regex&&!D.regex.test(H))return!1;if(!D.regex&&/`/.test(H))return!1;if(!D.regex&&(I[0]==="rg"||I[0]==="grep")&&/[\n\r]/.test(H))return!1;if(D.additionalCommandIsDangerousCallback&&D.additionalCommandIsDangerousCallback(H))return!1;return!0}function PX1(H){return new RegExp(`^${H}(?:\\s|$)[^<>()$\`|{}&;\\n\\r]*$`)}function JZ$(H){if(oA()!=="windows")return!1;if(/\\\\[a-zA-Z0-9._\-:[\]%]+(?:@(?:\d+|ssl))?\\/i.test(H))return!0;if(/\/\/[a-zA-Z0-9._\-:[\]%]+(?:@(?:\d+|ssl))?\//i.test(H))return!0;if(/@SSL@\d+/i.test(H)||/@\d+@SSL/i.test(H))return!0;if(/DavWWWRoot/i.test(H))return!0;if(/^\\\\(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\\/]/.test(H)||/^\/\/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\\/]/.test(H))return!0;if(/^\\\\(\[[\da-fA-F:]+\])[\\/]/.test(H)||/^\/\/(\[[\da-fA-F:]+\])[\\/]/.test(H))return!0;return!1}function CX1(H){let $=!1,A=!1,L=!1;for(let I=0;I&1"))$=$.slice(0,-5).trim();if(JZ$($))return!1;if(CX1($))return!1;if(VX1($))return!0;for(let A of YX1)if(A.test($)){if($.includes("git")&&/\s-c[\s=]/.test($))return!1;if($.includes("git")&&/\s--exec-path[\s=]/.test($))return!1;if($.includes("git")&&/\s--config-env[\s=]/.test($))return!1;return!0}return!1}function ZX1(H){return/^git(?:\s|$)/.test(H)}function qX1(H){return gF(H).some(($)=>ZX1($.trim()))}function TX1(){let H=zH(),$=C$(),A=r3H.join($,".git");try{if(H.existsSync(A)){let B=H.statSync(A);if(B.isFile())return!1;if(B.isDirectory()){let f=r3H.join(A,"HEAD");if(H.existsSync(f))return!1}}}catch{}let L=r3H.join($,"HEAD"),I=r3H.join($,"objects"),D=r3H.join($,"refs");try{let B=H.existsSync(L),f=H.existsSync(I)&&H.statSync(I).isDirectory(),E=H.existsSync(D)&&H.statSync(D).isDirectory();return B||f||E}catch{return!1}}function FZ$(H,$){let{command:A}=H;if(!TE(A,(B)=>`$${B}`).success)return{behavior:"passthrough",message:"Command cannot be parsed, requires further permission checks"};if(Hb(A).behavior!=="passthrough")return{behavior:"passthrough",message:"Command is not read-only, requires further permission checks"};if(JZ$(A))return{behavior:"ask",message:"Command contains Windows UNC path that could be vulnerable to WebDAV attacks"};let I=qX1(A);if($&&I)return{behavior:"passthrough",message:"Compound commands with cd and git require permission checks for enhanced security"};if(I&&TX1())return{behavior:"passthrough",message:"Git commands in directories with bare repository structure require permission checks for enhanced security"};if(gF(A).every((B)=>{if(Hb(B).behavior!=="passthrough")return!1;return wX1(B)}))return{behavior:"allow",updatedInput:H};return{behavior:"passthrough",message:"Command is not read-only, requires further permission checks"}}var r3H,XSD,VgH,MZ$,GZ$,UZ$,XZ$,PgH,wSA,ZSA,KX1,WX1,_X1,YX1;var KZ$=K(()=>{g3();EX();fZ$();EZ$();Z9();PI();DL();r3H=require("path"),XSD=/^-[a-zA-Z0-9_-]/,VgH={"--all":"none","--branches":"none","--tags":"none","--remotes":"none"},MZ$={"--since":"string","--after":"string","--until":"string","--before":"string"},GZ$={"--oneline":"none","--graph":"none","--decorate":"none","--no-decorate":"none","--date":"string","--relative-date":"none"},UZ$={"--max-count":"number","-n":"number"},XZ$={"--stat":"none","--numstat":"none","--shortstat":"none","--name-only":"none","--name-status":"none"},PgH={"--color":"none","--no-color":"none"},wSA={"--patch":"none","-p":"none","--no-patch":"none","--no-ext-diff":"none","-s":"none"},ZSA={"--author":"string","--committer":"string","--grep":"string"},KX1={xargs:{safeFlags:{"-I":"{}","-i":"none","-n":"number","-P":"number","-L":"number","-s":"number","-E":"EOF","-e":"EOF","-0":"none","-t":"none","-r":"none","-x":"none","-d":"char"}},"git diff":{safeFlags:{...XZ$,...PgH,"--dirstat":"none","--summary":"none","--patch-with-stat":"none","--word-diff":"none","--word-diff-regex":"string","--color-words":"none","--no-renames":"none","--no-ext-diff":"none","--check":"none","--ws-error-highlight":"string","--full-index":"none","--binary":"none","--abbrev":"number","--break-rewrites":"none","--find-renames":"none","--find-copies":"none","--find-copies-harder":"none","--irreversible-delete":"none","--diff-algorithm":"string","--histogram":"none","--patience":"none","--minimal":"none","--ignore-space-at-eol":"none","--ignore-space-change":"none","--ignore-all-space":"none","--ignore-blank-lines":"none","--inter-hunk-context":"number","--function-context":"none","--exit-code":"none","--quiet":"none","--cached":"none","--staged":"none","--pickaxe-regex":"none","--pickaxe-all":"none","--no-index":"none","--relative":"string","--diff-filter":"string","-p":"none","-u":"none","-s":"none","-M":"none","-C":"none","-B":"none","-D":"none","-l":"none","-S":"none","-G":"none","-O":"none","-R":"none"}},"git log":{safeFlags:{...GZ$,...VgH,...MZ$,...UZ$,...XZ$,...PgH,...wSA,...ZSA,"--abbrev-commit":"none","--full-history":"none","--dense":"none","--sparse":"none","--simplify-merges":"none","--ancestry-path":"none","--source":"none","--first-parent":"none","--merges":"none","--no-merges":"none","--reverse":"none","--walk-reflogs":"none","--skip":"number","--max-age":"number","--min-age":"number","--no-min-parents":"none","--no-max-parents":"none","--follow":"none","--no-walk":"none","--left-right":"none","--cherry-mark":"none","--cherry-pick":"none","--boundary":"none","--topo-order":"none","--date-order":"none","--author-date-order":"none","--pretty":"string","--format":"string","--diff-filter":"string","-S":"string","-G":"string","--pickaxe-regex":"none","--pickaxe-all":"none"}},"git show":{safeFlags:{...GZ$,...XZ$,...PgH,...wSA,"--abbrev-commit":"none","--word-diff":"none","--word-diff-regex":"string","--color-words":"none","--pretty":"string","--format":"string","--first-parent":"none","--raw":"none","--diff-filter":"string","-m":"none","--quiet":"none"}},"git shortlog":{safeFlags:{...VgH,...MZ$,"-s":"none","--summary":"none","-n":"none","--numbered":"none","-e":"none","--email":"none","-c":"none","--committer":"none","--group":"string","--format":"string","--no-merges":"none","--author":"string"}},"git reflog":{safeFlags:{...GZ$,...VgH,...MZ$,...UZ$,...ZSA}},"git stash list":{safeFlags:{...GZ$,...VgH,...UZ$}},"git ls-remote":{safeFlags:{"--branches":"none","-b":"none","--tags":"none","-t":"none","--heads":"none","-h":"none","--refs":"none","--quiet":"none","-q":"none","--exit-code":"none","--get-url":"none","--symref":"none","--sort":"string","--server-option":"string","-o":"string"}},"git status":{safeFlags:{"--short":"none","-s":"none","--branch":"none","-b":"none","--porcelain":"none","--long":"none","--verbose":"none","-v":"none","--untracked-files":"string","-u":"string","--ignored":"none","--ignore-submodules":"string","--column":"none","--no-column":"none","--ahead-behind":"none","--no-ahead-behind":"none","--renames":"none","--no-renames":"none","--find-renames":"string","-M":"string"}},"git blame":{safeFlags:{...PgH,"-L":"string","--porcelain":"none","-p":"none","--line-porcelain":"none","--incremental":"none","--root":"none","--show-stats":"none","--show-name":"none","--show-number":"none","-n":"none","--show-email":"none","-e":"none","-f":"none","--date":"string","-w":"none","--ignore-rev":"string","--ignore-revs-file":"string","-M":"none","-C":"none","--score-debug":"none","--abbrev":"number","-s":"none","-l":"none","-t":"none"}},"git ls-files":{safeFlags:{"--cached":"none","-c":"none","--deleted":"none","-d":"none","--modified":"none","-m":"none","--others":"none","-o":"none","--ignored":"none","-i":"none","--stage":"none","-s":"none","--killed":"none","-k":"none","--unmerged":"none","-u":"none","--directory":"none","--no-empty-directory":"none","--eol":"none","--full-name":"none","--abbrev":"number","--debug":"none","-z":"none","-t":"none","-v":"none","-f":"none","--exclude":"string","-x":"string","--exclude-from":"string","-X":"string","--exclude-per-directory":"string","--exclude-standard":"none","--error-unmatch":"none","--recurse-submodules":"none"}},"git config --get":{safeFlags:{"--local":"none","--global":"none","--system":"none","--worktree":"none","--default":"string","--type":"string","--bool":"none","--int":"none","--bool-or-int":"none","--path":"none","--expiry-date":"none","-z":"none","--null":"none","--name-only":"none","--show-origin":"none","--show-scope":"none"}},"git remote show":{safeFlags:{"-n":"none"},regex:/^git remote show(?:\s+-n)?\s+[a-zA-Z0-9_-]+$/},"git remote":{safeFlags:{"-v":"none","--verbose":"none"},regex:/^git remote(?:\s+(?:-v|--verbose))?$/},"git merge-base":{safeFlags:{"--is-ancestor":"none","--fork-point":"none","--octopus":"none","--independent":"none","--all":"none"}},"git rev-parse":{safeFlags:{"--verify":"none","--short":"string","--abbrev-ref":"none","--symbolic":"none","--symbolic-full-name":"none","--show-toplevel":"none","--show-cdup":"none","--show-prefix":"none","--git-dir":"none","--git-common-dir":"none","--absolute-git-dir":"none","--show-superproject-working-tree":"none","--is-inside-work-tree":"none","--is-inside-git-dir":"none","--is-bare-repository":"none","--is-shallow-repository":"none","--is-shallow-update":"none","--path-prefix":"none"}},"git rev-list":{safeFlags:{...VgH,...MZ$,...UZ$,...ZSA,"--count":"none","--reverse":"none","--first-parent":"none","--ancestry-path":"none","--merges":"none","--no-merges":"none","--min-parents":"number","--max-parents":"number","--no-min-parents":"none","--no-max-parents":"none","--skip":"number","--max-age":"number","--min-age":"number","--walk-reflogs":"none","--oneline":"none","--abbrev-commit":"none","--pretty":"string","--format":"string","--abbrev":"number","--full-history":"none","--dense":"none","--sparse":"none","--source":"none","--graph":"none"}},"git describe":{safeFlags:{"--tags":"none","--match":"string","--exclude":"string","--long":"none","--abbrev":"number","--always":"none","--contains":"none","--first-match":"none","--exact-match":"none","--candidates":"number","--dirty":"none","--broken":"none"}},"git cat-file":{safeFlags:{"-t":"none","-s":"none","-p":"none","-e":"none","--batch-check":"none","--allow-undetermined-type":"none"}},"git for-each-ref":{safeFlags:{"--format":"string","--sort":"string","--count":"number","--contains":"string","--no-contains":"string","--merged":"string","--no-merged":"string","--points-at":"string"}},"git grep":{safeFlags:{"-e":"string","-E":"none","--extended-regexp":"none","-G":"none","--basic-regexp":"none","-F":"none","--fixed-strings":"none","-P":"none","--perl-regexp":"none","-i":"none","--ignore-case":"none","-v":"none","--invert-match":"none","-w":"none","--word-regexp":"none","-n":"none","--line-number":"none","-c":"none","--count":"none","-l":"none","--files-with-matches":"none","-L":"none","--files-without-match":"none","-h":"none","-H":"none","--heading":"none","--break":"none","--full-name":"none","--color":"none","--no-color":"none","-o":"none","--only-matching":"none","-A":"number","--after-context":"number","-B":"number","--before-context":"number","-C":"number","--context":"number","--and":"none","--or":"none","--not":"none","--max-depth":"number","--untracked":"none","--no-index":"none","--recurse-submodules":"none","--cached":"none","--threads":"number","-q":"none","--quiet":"none"}},"git stash show":{safeFlags:{...XZ$,...PgH,...wSA,"--word-diff":"none","--word-diff-regex":"string","--diff-filter":"string","--abbrev":"number"}},"git worktree list":{safeFlags:{"--porcelain":"none","-v":"none","--verbose":"none","--expire":"string"}},"git tag":{safeFlags:{"-l":"none","--list":"none","-n":"number","--contains":"string","--no-contains":"string","--merged":"string","--no-merged":"string","--sort":"string","--format":"string","--points-at":"string","--column":"none","--no-column":"none","-i":"none","--ignore-case":"none"}},"git branch":{safeFlags:{"-l":"none","--list":"none","-a":"none","--all":"none","-r":"none","--remotes":"none","-v":"none","-vv":"none","--verbose":"none","--color":"none","--no-color":"none","--column":"none","--no-column":"none","--abbrev":"number","--no-abbrev":"none","--contains":"string","--no-contains":"string","--merged":"none","--no-merged":"none","--points-at":"string","--sort":"string","--show-current":"none","-i":"none","--ignore-case":"none"},additionalCommandIsDangerousCallback:(H)=>{let $=H.split(/\s+/),A=new Set(["--contains","--no-contains","--points-at","--sort","--abbrev"]),L=new Set(["--merged","--no-merged"]),I=2,D="";while(I<$.length){let B=$[I];if(!B){I++;continue}if(B.startsWith("-"))if(B.includes("="))D=B.split("=")[0]||"",I++;else if(A.has(B))D=B,I+=2;else D=B,I++;else{let f=$.slice(2,I),E=f.includes("-l")||f.includes("--list"),M=L.has(D);if(!E&&!M)return!0;I++}}return!1}},file:{safeFlags:{"--brief":"none","-b":"none","--mime":"none","-i":"none","--mime-type":"none","--mime-encoding":"none","--apple":"none","--check-encoding":"none","-c":"none","--exclude":"string","--exclude-quiet":"string","--print0":"none","-0":"none","-f":"string","-F":"string","--separator":"string","--help":"none","--version":"none","-v":"none","--no-dereference":"none","-h":"none","--dereference":"none","-L":"none","--magic-file":"string","-m":"string","--keep-going":"none","-k":"none","--list":"none","-l":"none","--no-buffer":"none","-n":"none","--preserve-date":"none","-p":"none","--raw":"none","-r":"none","-s":"none","--special-files":"none","--uncompress":"none","-z":"none"}},sed:{safeFlags:{"--expression":"string","-e":"string","--quiet":"none","--silent":"none","-n":"none","--regexp-extended":"none","-r":"none","--posix":"none","-E":"none","--line-length":"number","-l":"number","--zero-terminated":"none","-z":"none","--separate":"none","-s":"none","--unbuffered":"none","-u":"none","--debug":"none","--help":"none","--version":"none"},additionalCommandIsDangerousCallback:(H)=>!WgH(H)},"pip list":{safeFlags:{"--outdated":"none","-o":"none","--uptodate":"none","-u":"none","--editable":"none","-e":"none","--local":"none","-l":"none","--user":"none","--pre":"none","--format":"string","--not-required":"none","--exclude-editable":"none","--include-editable":"none","--exclude":"string","--help":"none","-h":"none","--version":"none","-V":"none","--verbose":"none","-v":"none","--quiet":"none","-q":"none","--no-color":"none","--no-input":"none","--disable-pip-version-check":"none","--no-python-version-warning":"none"}},sort:{safeFlags:{"--ignore-leading-blanks":"none","-b":"none","--dictionary-order":"none","-d":"none","--ignore-case":"none","-f":"none","--general-numeric-sort":"none","-g":"none","--human-numeric-sort":"none","-h":"none","--ignore-nonprinting":"none","-i":"none","--month-sort":"none","-M":"none","--numeric-sort":"none","-n":"none","--random-sort":"none","-R":"none","--reverse":"none","-r":"none","--sort":"string","--stable":"none","-s":"none","--unique":"none","-u":"none","--version-sort":"none","-V":"none","--zero-terminated":"none","-z":"none","--key":"string","-k":"string","--field-separator":"string","-t":"string","--check":"none","-c":"none","--check-char-order":"none","-C":"none","--merge":"none","-m":"none","--buffer-size":"string","-S":"string","--parallel":"number","--batch-size":"number","--help":"none","--version":"none"}},man:{safeFlags:{"-a":"none","--all":"none","-d":"none","-f":"none","--whatis":"none","-h":"none","-k":"none","--apropos":"none","-l":"string","-w":"none","-S":"string","-s":"string"}},help:{safeFlags:{"-d":"none","-m":"none","-s":"none"}},"npm list":{safeFlags:{"--all":"none","-a":"none","--json":"none","--long":"none","-l":"none","--global":"none","-g":"none","--depth":"number","--omit":"string","--include":"string","--link":"none","--workspace":"string","-w":"string","--workspaces":"none","-ws":"none"}},"mcp-cli servers":{safeFlags:{"--json":"none"}},"mcp-cli tools":{safeFlags:{"--json":"none"}},"mcp-cli info":{safeFlags:{"--json":"none"}},"mcp-cli grep":{safeFlags:{"--json":"none","-i":"none","--ignore-case":"none"}},"mcp-cli resources":{safeFlags:{"--json":"none"}},"mcp-cli read":{safeFlags:{"--json":"none"}},netstat:{safeFlags:{"-a":"none","-L":"none","-l":"none","-n":"none","-f":"string","-g":"none","-i":"none","-I":"string","-s":"none","-r":"none","-m":"none","-v":"none"}},ps:{safeFlags:{"-e":"none","-A":"none","-a":"none","-d":"none","-N":"none","--deselect":"none","-f":"none","-F":"none","-l":"none","-j":"none","-y":"none","-w":"none","-ww":"none","--width":"number","-c":"none","-H":"none","--forest":"none","--headers":"none","--no-headers":"none","-n":"string","--sort":"string","-L":"none","-T":"none","-m":"none","-C":"string","-G":"string","-g":"string","-p":"string","--pid":"string","-q":"string","--quick-pid":"string","-s":"string","--sid":"string","-t":"string","--tty":"string","-U":"string","-u":"string","--user":"string","--help":"none","--info":"none","-V":"none","--version":"none"},additionalCommandIsDangerousCallback:(H)=>{return/\s[a-zA-Z]*e[a-zA-Z]*(?:\s|$)/.test(H)}},base64:{safeFlags:{"-d":"none","-D":"none","--decode":"none","-b":"number","--break":"number","-w":"number","--wrap":"number","-i":"string","--input":"string","--ignore-garbage":"none","-h":"none","--help":"none","--version":"none"}},grep:{safeFlags:{"-e":"string","--regexp":"string","-f":"string","--file":"string","-F":"none","--fixed-strings":"none","-G":"none","--basic-regexp":"none","-E":"none","--extended-regexp":"none","-P":"none","--perl-regexp":"none","-i":"none","--ignore-case":"none","--no-ignore-case":"none","-v":"none","--invert-match":"none","-w":"none","--word-regexp":"none","-x":"none","--line-regexp":"none","-c":"none","--count":"none","--color":"string","--colour":"string","-L":"none","--files-without-match":"none","-l":"none","--files-with-matches":"none","-m":"number","--max-count":"number","-o":"none","--only-matching":"none","-q":"none","--quiet":"none","--silent":"none","-s":"none","--no-messages":"none","-b":"none","--byte-offset":"none","-H":"none","--with-filename":"none","-h":"none","--no-filename":"none","--label":"string","-n":"none","--line-number":"none","-T":"none","--initial-tab":"none","-u":"none","--unix-byte-offsets":"none","-Z":"none","--null":"none","-z":"none","--null-data":"none","-A":"number","--after-context":"number","-B":"number","--before-context":"number","-C":"number","--context":"number","--group-separator":"string","--no-group-separator":"none","-a":"none","--text":"none","--binary-files":"string","-D":"string","--devices":"string","-d":"string","--directories":"string","--exclude":"string","--exclude-from":"string","--exclude-dir":"string","--include":"string","-r":"none","--recursive":"none","-R":"none","--dereference-recursive":"none","--line-buffered":"none","-U":"none","--binary":"none","--help":"none","-V":"none","--version":"none"}},rg:{safeFlags:{"-e":"string","--regexp":"string","-f":"string","-i":"none","--ignore-case":"none","-S":"none","--smart-case":"none","-F":"none","--fixed-strings":"none","-w":"none","--word-regexp":"none","-v":"none","--invert-match":"none","-c":"none","--count":"none","-l":"none","--files-with-matches":"none","--files-without-match":"none","-n":"none","--line-number":"none","-o":"none","--only-matching":"none","-A":"number","--after-context":"number","-B":"number","--before-context":"number","-C":"number","--context":"number","-H":"none","-h":"none","--heading":"none","--no-heading":"none","-q":"none","--quiet":"none","--column":"none","-g":"string","--glob":"string","-t":"string","--type":"string","-T":"string","--type-not":"string","--type-list":"none","--hidden":"none","--no-ignore":"none","-u":"none","-m":"number","--max-count":"number","-d":"number","--max-depth":"number","-a":"none","--text":"none","-z":"none","-L":"none","--follow":"none","--color":"string","--json":"none","--stats":"none","--help":"none","--version":"none","--debug":"none","--":"none"}},sha256sum:{safeFlags:{"-b":"none","--binary":"none","-t":"none","--text":"none","-c":"none","--check":"none","--ignore-missing":"none","--quiet":"none","--status":"none","--strict":"none","-w":"none","--warn":"none","--tag":"none","-z":"none","--zero":"none","--help":"none","--version":"none"}},sha1sum:{safeFlags:{"-b":"none","--binary":"none","-t":"none","--text":"none","-c":"none","--check":"none","--ignore-missing":"none","--quiet":"none","--status":"none","--strict":"none","-w":"none","--warn":"none","--tag":"none","-z":"none","--zero":"none","--help":"none","--version":"none"}},md5sum:{safeFlags:{"-b":"none","--binary":"none","-t":"none","--text":"none","-c":"none","--check":"none","--ignore-missing":"none","--quiet":"none","--status":"none","--strict":"none","-w":"none","--warn":"none","--tag":"none","-z":"none","--zero":"none","--help":"none","--version":"none"}},tree:{safeFlags:{"-a":"none","-d":"none","-l":"none","-f":"none","-x":"none","-L":"number","-R":"none","-P":"string","-I":"string","--gitignore":"none","--gitfile":"string","--ignore-case":"none","--matchdirs":"none","--metafirst":"none","--prune":"none","--info":"none","--infofile":"string","--noreport":"none","--charset":"string","--filelimit":"number","-q":"none","-N":"none","-Q":"none","-p":"none","-u":"none","-g":"none","-s":"none","-h":"none","--si":"none","--du":"none","-D":"none","--timefmt":"string","-F":"none","--inodes":"none","--device":"none","-v":"none","-t":"none","-c":"none","-U":"none","-r":"none","--dirsfirst":"none","--filesfirst":"none","--sort":"string","-i":"none","-A":"none","-S":"none","-n":"none","-C":"none","-X":"none","-J":"none","-H":"string","--nolinks":"none","--hintro":"string","--houtro":"string","-T":"string","--hyperlink":"none","--scheme":"string","--authority":"string","--fromfile":"none","--fromtabfile":"none","--fflinks":"none","--help":"none","--version":"none"}},date:{safeFlags:{"-d":"string","--date":"string","-r":"string","--reference":"string","-u":"none","--utc":"none","--universal":"none","-I":"none","--iso-8601":"string","-R":"none","--rfc-email":"none","--rfc-3339":"string","--debug":"none","--help":"none","--version":"none"},additionalCommandIsDangerousCallback:(H)=>{let $=TE(H,(D)=>`$${D}`);if(!$.success)return!0;let A=$.tokens.map((D)=>{if(typeof D==="string")return D;if("pattern"in D)return D.pattern;return}).filter((D)=>D!==void 0),L=new Set(["-d","--date","-r","--reference","--iso-8601","--rfc-3339"]),I=1;while(I{let $=TE(H,(L)=>`$${L}`);if(!$.success)return!0;return $.tokens.map((L)=>typeof L==="string"?L:("pattern"in L)?L.pattern:void 0).filter((L)=>L!==void 0).some((L)=>L==="--watch"||L==="-w")}},"docker compose ps":{safeFlags:{"--format":"string","--filter":"string","--quiet":"none","-q":"none","--services":"none","--status":"string","--all":"none","-a":"none","--no-trunc":"none","--orphans":"none"}},"docker compose logs":{safeFlags:{"--follow":"none","-f":"none","--tail":"string","-n":"string","--timestamps":"none","-t":"none","--no-color":"none","--no-log-prefix":"none","--since":"string","--until":"string"}},"docker compose top":{safeFlags:{}},"docker compose config":{safeFlags:{"--format":"string","--services":"none","--volumes":"none","--profiles":"none"}},"docker logs":{safeFlags:{"--follow":"none","-f":"none","--tail":"string","-n":"string","--timestamps":"none","-t":"none","--since":"string","--until":"string","--details":"none"}},"docker inspect":{safeFlags:{"--format":"string","-f":"string","--type":"string","--size":"none","-s":"none"}}};WX1=["echo","printf","wc","grep","head","tail"];_X1=["cal","uptime","cat","head","tail","wc","stat","strings","hexdump","od","nl","id","uname","free","df","du","locale","groups","nproc","docker ps","docker images","basename","dirname","realpath","cut","paste","tr","column","tac","rev","fold","expand","unexpand","readlink","diff","true","false","sleep","which","type"],YX1=new Set([..._X1.map(PX1),/^echo(?:\s+(?:'[^']*'|"[^"$<>\n\r]*"|[^|;&`$(){}><#\\!"'\s]+))*(?:\s+2>&1)?\s*$/,/^claude -h$/,/^claude --help$/,/^uniq(?:\s+(?:-[a-zA-Z]+|--[a-zA-Z-]+(?:=\S+)?|-[fsw]\s+\d+))*(?:\s|$)\s*$/,/^pwd$/,/^whoami$/,/^node -v$/,/^npm -v$/,/^python --version$/,/^python3 --version$/,/^history(?:\s+\d+)?\s*$/,/^alias$/,/^arch(?:\s+(?:--help|-h))?\s*$/,/^ip addr$/,/^ifconfig(?:\s+[a-zA-Z][a-zA-Z0-9_-]*)?\s*$/,/^jq(?!\s+.*(?:-f\b|--from-file|--rawfile|--slurpfile|--run-tests|-L\b|--library-path|\benv\b|\$ENV\b))(?:\s+(?:-[a-zA-Z]+|--[a-zA-Z-]+(?:=\S+)?))*(?:\s+'[^'`]*'|\s+"[^"`]*"|\s+[^-\s'"][^\s]*)+\s*$/,/^cd(?:\s+(?:'[^']*'|"[^"]*"|[^\s;|&`$(){}><#\\]+))?$/,/^ls(?:\s+[^<>()$`|{}&;\n\r]*)?$/,/^find(?:\s+(?:\\[()]|(?!-delete\b|-exec\b|-execdir\b|-ok\b|-okdir\b|-fprint0?\b|-fls\b|-fprintf\b)[^<>()$`|{}&;\n\r\s]|\s)+)?$/])});function FSD(H){if(!H)return!1;if(H.type==="assistant"){let $=_6(H.message.content);return $?.type==="text"||$?.type==="thinking"||$?.type==="redacted_thinking"}if(H.type==="user"){let $=H.message.content;if(!Array.isArray($)||$.length===0)return!1;return $.every((A)=>("type"in A)&&A.type==="tool_result")}return!1}function*qSA(H){switch(H.type){case"assistant":for(let $ of g5([H])){if(!Is($))continue;yield{type:"assistant",message:$.message,parent_tool_use_id:null,session_id:j$(),uuid:$.uuid,error:$.error}}return;case"progress":if(H.data.type==="agent_progress")for(let $ of g5([H.data.message]))switch($.type){case"assistant":if(!Is($))break;yield{type:"assistant",message:$.message,parent_tool_use_id:H.parentToolUseID,session_id:j$(),uuid:$.uuid,error:$.error};break;case"user":yield{type:"user",message:$.message,parent_tool_use_id:H.parentToolUseID,session_id:j$(),uuid:$.uuid,isSynthetic:$.isMeta||$.isVisibleInTranscriptOnly,tool_use_result:$.mcpMeta?{content:$.toolUseResult,...$.mcpMeta}:$.toolUseResult};break}else if(H.data.type==="bash_progress"){if(!A$(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_CONTAINER_ID)break;let $=H.parentToolUseID,A=Date.now(),L=_gH.get($)||0;if(A-L>=OX1){if(_gH.size>=NX1){let D=_gH.keys().next().value;if(D!==void 0)_gH.delete(D)}_gH.set($,A),yield{type:"tool_progress",tool_use_id:H.toolUseID,tool_name:"Bash",parent_tool_use_id:H.parentToolUseID,elapsed_time_seconds:H.data.elapsedTimeSeconds,session_id:j$(),uuid:H.uuid}}}break;case"user":for(let $ of g5([H]))yield{type:"user",message:$.message,parent_tool_use_id:null,session_id:j$(),uuid:$.uuid,isSynthetic:$.isMeta||$.isVisibleInTranscriptOnly,tool_use_result:$.mcpMeta?{content:$.toolUseResult,...$.mcpMeta}:$.toolUseResult};return;default:}}async function*KSD(H,$,A,L){let I=!uZ(),{permissionResult:D,assistantMessage:B}=H,{toolUseID:f}=D;if(!f)return;let E=B.message.content,M;if(Array.isArray(E)){for(let W of E)if(W.type==="tool_use"&&W.id===f){M=W;break}}if(!M)return;let{name:G,input:U}=M;if(!$.find((W)=>W.name===G))return;let J={...M,input:D.behavior==="allow"?D.updatedInput:U},F=async()=>({...D,decisionReason:{type:"mode",mode:"default"}});if(A.push(B),I)await $j(A);yield{...B,session_id:j$(),parent_tool_use_id:null};for await(let W of IZ$([J],[B],F,L))if(W.message){if(A.push(W.message),I)await $j(A);yield{...W.message,session_id:j$(),parent_tool_use_id:null}}}function D1H(H,$,A=zX1){let L=_m(A),I=new Map,D=new Map;for(let B of H)if(B.type==="assistant"&&Array.isArray(B.message.content)){for(let f of B.message.content)if(f.type==="tool_use"&&f.name===$B){let E=f.input;if(E?.file_path&&E?.offset===void 0&&E?.limit===void 0){let M=xD(E.file_path,$);I.set(f.id,M)}}else if(f.type==="tool_use"&&f.name===U1){let E=f.input;if(E?.file_path&&E?.content){let M=xD(E.file_path,$);D.set(f.id,{filePath:M,content:E.content})}}}for(let B of H)if(B.type==="user"&&Array.isArray(B.message.content)){for(let f of B.message.content)if(f.type==="tool_result"&&f.tool_use_id){let E=I.get(f.tool_use_id);if(E&&typeof f.content==="string"){let X=f.content.replace(/[\s\S]*?<\/system-reminder>/g,"").split(` `):"- (no user messages yet)";return iX1.replace("{human_messages}",A)}async function jSA(H,$,A,L){let I=L??Ls(H),D=A==="coordinator"?nX1(H.messages):rX1[A],B=async()=>({behavior:"deny",message:"No tools needed for suggestion",decisionReason:{type:"other",reason:"suggestion only"}}),f=await xw({promptMessages:[R$({content:D})],cacheSafeParams:I,canUseTool:B,querySource:"prompt_suggestion",forkLabel:"prompt_suggestion",overrides:{abortController:$},skipTranscript:!0}),E=f.messages.find((G)=>G.type==="assistant"),M=E?.type==="assistant"?E.requestId??null:null;for(let G of f.messages){if(G.type!=="assistant")continue;let U=G.message.content.find((X)=>X.type==="text");if(U?.type==="text"&&U.text.trim())return{suggestion:U.text.trim(),generationRequestId:M}}return{suggestion:null,generationRequestId:M}}function RSA(H,$){if(!H)return Aj("empty",void 0,$),!0;let A=H.toLowerCase(),L=H.trim().split(/\s+/).length,I=[["done",()=>A==="done"],["error_message",()=>A.startsWith("api error:")||A.startsWith("prompt is too long")||A.startsWith("request timed out")||A.startsWith("invalid api key")||A.startsWith("image was too large")],["prefixed_label",()=>/^\w+:\s/.test(H)],["too_few_words",()=>{if(L>=2)return!1;if(H.startsWith("/"))return!1;return!new Set(["yes","yeah","yep","yea","yup","sure","ok","okay","push","commit","deploy","stop","continue","check","exit","quit","no"]).has(A)}],["too_many_words",()=>L>12],["too_long",()=>H.length>=100],["multiple_sentences",()=>/[.!?]\s+[A-Z]/.test(H)],["has_formatting",()=>/[\n*]|\*\*/.test(H)],["evaluative",()=>/thanks|thank you|looks good|sounds good|that works|that worked|that's all|nice|great|perfect|makes sense|awesome|excellent/.test(A)],["claude_voice",()=>/^(let me|i'll|i've|i'm|i can|i would|i think|i notice|here's|here is|here are|that's|this is|this will|you can|you should|you could|sure,|of course|certainly)/i.test(H)]];for(let[D,B]of I)if(B())return Aj(D,H,$),!0;return!1}function Aj(H,$,A){let L=A??YZ$();c("tengu_prompt_suggestion",{outcome:"suppressed",reason:H,prompt_id:L,coordinator_mode:v8(),...!1})}var mX1="tengu_plank_river_frost",E1H=null,pX1=0.5,cX1=`[SUGGESTION MODE: Suggest what the user might naturally type next into Claude Code.] ${H}`,I=await xw({promptMessages:[R$({content:L})],cacheSafeParams:{...$,toolUseContext:A},canUseTool:async()=>({behavior:"deny",message:"Side questions cannot use tools",decisionReason:{type:"other",reason:"side_question"}}),querySource:"side_question",forkLabel:"side_question",maxTurns:1}),B=I.messages.find((E)=>E.type==="assistant")?.message?.content?.find((E)=>E.type==="text");return{response:B&&B.type==="text"?B.text.trim():null,usage:I.totalUsage}}var QJ1;var aSA=K(()=>{qS();_L();QJ1=/^\/btw\b/gi});var LjD={};XA(LjD,{call:()=>VJ1});function WJ1({question:H,context:$,onDone:A}){let[L,I]=IVH.useState(null),[D,B]=IVH.useState(null),[f,E]=IVH.useState(0);return VF(()=>E((M)=>M+1),L||D?null:80),WL((M,G)=>{if(G.escape||G.return||M===" ")A(void 0,{display:"skip"})}),IVH.useEffect(()=>{let M=nD();async function G(){try{let[U,X,J]=await Promise.all([HC($.options.tools,$.options.mainLoopModel,[],$.options.mcpClients),u5(),k5()]),F=await AjD({question:H,cacheSafeParams:{systemPrompt:U,userContext:X,systemContext:J,toolUseContext:$,forkContextMessages:$.messages}});if(!M.signal.aborted)if(F.response)I(F.response);else B("No response received")}catch(U){if(!M.signal.aborted)B(U.message||"Failed to get response")}}return G(),()=>{M.abort()}},[H,$]),jG.createElement(x,{flexDirection:"column",paddingLeft:2,marginTop:1},jG.createElement(x,null,jG.createElement(V,{color:"warning",bold:!0},"/btw"," "),jG.createElement(V,{dimColor:!0},H)),jG.createElement(x,{marginTop:1,marginLeft:2},D?jG.createElement(V,{color:"error"},D):L?jG.createElement(V,null,L):jG.createElement(x,null,jG.createElement(MbH,{frame:f,messageColor:"warning"}),jG.createElement(V,{color:"warning"},"Answering..."))),(L||D)&&jG.createElement(x,{marginTop:1},jG.createElement(V,{dimColor:!0},"Press Space, Enter, or Escape to dismiss")))}async function VJ1(H,$,A){let L=A?.trim();if(!L)return H("Usage: /btw ",{display:"system"}),null;return jG.createElement(WJ1,{question:L,context:$,onDone:H})}var jG,IVH;var IjD=K(()=>{xH();aSA();Ow();bT();k2A();s6();eE();jG=b(s(),1),IVH=b(s(),1)});var PJ1,oSA;var DjD=K(()=>{PJ1={type:"local-jsx",name:"btw",description:"Ask a quick side question without interrupting the main conversation",isEnabled:()=>process.env.ENABLE_BTW==="true",isHidden:!1,immediate:!0,argumentHint:"",load:()=>Promise.resolve().then(() => (IjD(),LjD)),userFacingName(){return"btw"}},oSA=PJ1});var BjD=()=>{};var fjD=()=>{};function DVH(H){let $=H;return $=$.replace(/"(sk-ant[^\s"']{24,})"/g,'"[REDACTED_API_KEY]"'),$=$.replace(/(?{let $={...H};if($&&typeof $.error==="string")$.error=DVH($.error);return $})}async function YJ1(){try{let H=v5();return await UjD.readFile(H,"utf-8")}catch{return null}}function XjD({abortSignal:H,messages:$,initialDescription:A,onDone:L,backgroundTasks:I={}}){let[D,B]=nw.useState("userInput"),[f,E]=nw.useState(0),[M,G]=nw.useState(A??""),[U,X]=nw.useState(null),[J,F]=nw.useState(null),[Q,W]=nw.useState({isGit:!1,gitState:null}),[P,C]=nw.useState(null),Y=QL().columns-4;nw.useEffect(()=>{async function O(){let j=await z6(),u=null;if(j)u=await v9L();W({isGit:j,gitState:u})}O()},[]);let Z=nw.useCallback(async()=>{B("submitting"),F(null),X(null);let O=MjD(),u=$C($)?.requestId??null,y=tSA($),g=sSA(I),h=[...new Set([...y,...g])],[p,d]=await Promise.all([HjA(h),YJ1()]),k=eSA(I),n={...p,...k},GH={latestAssistantMessageId:u,message_count:$.length,datetime:new Date().toISOString(),description:M,platform:OA.platform,gitRepo:Q.isGit,terminal:OA.terminal,version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,transcript:JJ($),errors:O,lastApiRequest:Mj$(),...Object.keys(n).length>0&&{subagentTranscripts:n},...d&&{rawTranscriptJsonl:d}},[HH,BH]=await Promise.all([ZJ1(GH,H),wJ1(M,H)]);if(C(BH),HH.success){if(HH.feedbackId)X(HH.feedbackId),c("tengu_bug_report_submitted",{feedback_id:HH.feedbackId,last_assistant_message_id:u});B("done")}else{if(HH.isZdrOrg)F("Feedback collection is not available for organizations with custom data retention policies.");else F("Could not submit feedback. Please try again later.");B("userInput")}},[M,Q.isGit,$]),q=nw.useCallback(()=>{if(D==="done"){if(J)L("Error submitting feedback / bug report",{display:"system"});else L("Feedback / bug report submitted",{display:"system"});return}L("Feedback / bug report cancelled",{display:"system"})},[D,J,L]);return BA("confirm:no",()=>{},{context:"Confirmation",isActive:D==="userInput"}),WL((O,j)=>{if(D==="done"){if(j.return&&P){let u=CJ1(U??"",P,M,MjD());HE(u)}if(J)L("Error submitting feedback / bug report",{display:"system"});else L("Feedback / bug report submitted",{display:"system"});return}if(J&&D!=="userInput"){L("Error submitting feedback / bug report",{display:"system"});return}if(D==="consent"&&(j.return||O===" "))Z()}),vI.createElement(BL,{title:"Submit Feedback / Bug Report",onCancel:q,inputGuide:(O)=>O.pending?vI.createElement(V,null,"Press ",O.keyName," again to exit"):D==="userInput"?vI.createElement(rA,null,vI.createElement(s$,{shortcut:"Enter",action:"continue"}),vI.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})):D==="consent"?vI.createElement(rA,null,vI.createElement(s$,{shortcut:"Enter",action:"submit"}),vI.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})):null},D==="userInput"&&vI.createElement(x,{flexDirection:"column",gap:1},vI.createElement(V,null,"Describe the issue below:"),vI.createElement(W9,{value:M,onChange:(O)=>{if(G(O),J)F(null)},columns:Y,onSubmit:()=>B("consent"),onExitMessage:()=>L("Feedback cancelled",{display:"system"}),cursorOffset:f,onChangeCursorOffset:E}),J&&vI.createElement(x,{flexDirection:"column",gap:1},vI.createElement(V,{color:"error"},J),vI.createElement(V,{dimColor:!0},"Edit and press Enter to retry, or Esc to cancel"))),D==="consent"&&vI.createElement(x,{flexDirection:"column"},vI.createElement(V,null,"This report will include:"),vI.createElement(x,{marginLeft:2,flexDirection:"column"},vI.createElement(V,null,"- Your feedback / bug description:"," ",vI.createElement(V,{dimColor:!0},M)),vI.createElement(V,null,"- Environment info:"," ",vI.createElement(V,{dimColor:!0},OA.platform,", ",OA.terminal,", v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)),Q.gitState&&vI.createElement(V,null,"- Git repo metadata:"," ",vI.createElement(V,{dimColor:!0},Q.gitState.branchName,Q.gitState.commitHash?`, ${Q.gitState.commitHash.slice(0,7)}`:"",Q.gitState.remoteUrl?` @ ${Q.gitState.remoteUrl}`:"",!Q.gitState.isHeadOnRemote&&", not synced",!Q.gitState.isClean&&", has local changes")),vI.createElement(V,null,"- Current session transcript")),vI.createElement(x,{marginTop:1},vI.createElement(V,{wrap:"wrap",dimColor:!0},"We will use your feedback to debug related issues or to improve"," ","Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future).")),vI.createElement(x,{marginTop:1},vI.createElement(V,null,"Press ",vI.createElement(V,{bold:!0},"Enter")," to confirm and submit."))),D==="submitting"&&vI.createElement(x,{flexDirection:"row",gap:1},vI.createElement(V,null,"Submitting report\u2026")),D==="done"&&vI.createElement(x,{flexDirection:"column"},J?vI.createElement(V,{color:"error"},J):vI.createElement(V,{color:"success"},"Thank you for your report!"),U&&vI.createElement(V,{dimColor:!0},"Feedback ID: ",U),vI.createElement(x,{marginTop:1},vI.createElement(V,null,"Press "),vI.createElement(V,{bold:!0},"Enter "),vI.createElement(V,null,"to open your browser and draft a GitHub issue, or any other key to close."))))}function CJ1(H,$,A,L){let I=DVH($),B=`**Bug Description** - Version: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION||"unknown"} `)[0]||"";if($.length<=60&&$.length>5)return $;let A=$.slice(0,60);if($.length>60){let L=A.lastIndexOf(" ");if(L>30)A=A.slice(0,L);A+="..."}return A.length<10?"Bug Report":A}function SZ$(H){if(H instanceof Error){let $=Error(DVH(H.message));if(H.stack)$.stack=DVH(H.stack);r($)}else{let $=DVH(String(H));r(Error($))}}async function ZJ1(H,$){try{await iW();let A=eG();if(A.error)return{success:!1};let L={"Content-Type":"application/json","User-Agent":Gn(),...A.headers},I=await nA.post("https://api.anthropic.com/api/claude_cli_feedback",{content:yH(H)},{headers:L,timeout:30000,signal:$});if(I.status===200){let D=I.data;if(D?.feedback_id)return{success:!0,feedbackId:D.feedback_id};return SZ$(Error("Failed to submit feedback: request did not return feedback_id")),{success:!1}}return SZ$(Error("Failed to submit feedback:"+I.status)),{success:!1}}catch(A){if(nA.isCancel(A))return{success:!1};if(nA.isAxiosError(A)&&A.response?.status===403){let L=A.response.data;if(L?.error?.type==="permission_error"&&L?.error?.message?.includes("Custom data retention settings"))return SZ$(Error("Cannot submit feedback because custom data retention settings are enabled")),{success:!1,isZdrOrg:!0}}return SZ$(A),{success:!1}}}var vI,nw,UjD,EjD=7250,_J1="https://github.com/anthropics/claude-code/issues";var JjD=K(()=>{xH();$I();S5();_$();Z1();t8();OB();_Q();EI();z$();dU();ry();F3();w1();_L();g$();rB();Z$();bB();lB();eB();j0();vI=b(s(),1),nw=b(s(),1),UjD=require("fs/promises")});var KjD={};XA(KjD,{renderFeedbackComponent:()=>FjD,call:()=>qJ1});function FjD(H,$,A,L="",I={}){return $jA.createElement(XjD,{abortSignal:$,messages:A,initialDescription:L,onDone:H,backgroundTasks:I})}async function qJ1(H,$,A){let L=A||"";return FjD(H,$.abortController.signal,$.messages,L)}var $jA;var QjD=K(()=>{JjD();$jA=b(s(),1)});var TJ1,AjA;var WjD=K(()=>{NA();XY();TJ1={aliases:["bug"],type:"local-jsx",name:"feedback",description:"Submit feedback about Claude Code",argumentHint:"[report]",isEnabled:()=>!(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.DISABLE_FEEDBACK_COMMAND||process.env.DISABLE_BUG_COMMAND||process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC||!1||!PK("allow_product_feedback")),isHidden:!1,load:()=>Promise.resolve().then(() => (QjD(),KjD)),userFacingName(){return"feedback"}},AjA=TJ1});function Ad(H){return!Array.isArray?qjD(H)==="[object Array]":Array.isArray(H)}function NJ1(H){if(typeof H=="string")return H;let $=H+"";return $=="0"&&1/H==-zJ1?"-0":$}function OJ1(H){return H==null?"":NJ1(H)}function Ab(H){return typeof H==="string"}function wjD(H){return typeof H==="number"}function xJ1(H){return H===!0||H===!1||SJ1(H)&&qjD(H)=="[object Boolean]"}function ZjD(H){return typeof H==="object"}function SJ1(H){return ZjD(H)&&H!==null}function rw(H){return H!==void 0&&H!==null}function LjA(H){return!H.trim().length}function qjD(H){return H==null?H===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(H)}class TjD{constructor(H){this._keys=[],this._keyMap={};let $=0;H.forEach((A)=>{let L=zjD(A);this._keys.push(L),this._keyMap[L.id]=L,$+=L.weight}),this._keys.forEach((A)=>{A.weight/=$})}get(H){return this._keyMap[H]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function zjD(H){let $=null,A=null,L=null,I=1,D=null;if(Ab(H)||Ad(H))L=H,$=PjD(H),A=IjA(H);else{if(!VjD.call(H,"name"))throw Error(vJ1("name"));let B=H.name;if(L=B,VjD.call(H,"weight")){if(I=H.weight,I<=0)throw Error(hJ1(B))}$=PjD(B),A=IjA(B),D=H.getFn}return{path:$,id:A,weight:I,src:L,getFn:D}}function PjD(H){return Ad(H)?H:H.split(".")}function IjA(H){return Ad(H)?H.join("."):H}function bJ1(H,$){let A=[],L=!1,I=(D,B,f)=>{if(!rw(D))return;if(!B[f])A.push(D);else{let E=B[f],M=D[E];if(!rw(M))return;if(f===B.length-1&&(Ab(M)||wjD(M)||xJ1(M)))A.push(OJ1(M));else if(Ad(M)){L=!0;for(let G=0,U=M.length;G{this._keysMap[$.id]=A})}create(){if(this.isCreated||!this.docs.length)return;if(this.isCreated=!0,Ab(this.docs[0]))this.docs.forEach((H,$)=>{this._addString(H,$)});else this.docs.forEach((H,$)=>{this._addObject(H,$)});this.norm.clear()}add(H){let $=this.size();if(Ab(H))this._addString(H,$);else this._addObject(H,$)}removeAt(H){this.records.splice(H,1);for(let $=H,A=this.size();${let D=L.getFn?L.getFn(H):this.getFn(H,L.path);if(!rw(D))return;if(Ad(D)){let B=[],f=[{nestedArrIndex:-1,value:D}];while(f.length){let{nestedArrIndex:E,value:M}=f.pop();if(!rw(M))continue;if(Ab(M)&&!LjA(M)){let G={v:M,i:E,n:this.norm.get(M)};B.push(G)}else if(Ad(M))M.forEach((G,U)=>{f.push({nestedArrIndex:U,value:G})})}A.$[I]=B}else if(Ab(D)&&!LjA(D)){let B={v:D,n:this.norm.get(D)};A.$[I]=B}}),this.records.push(A)}toJSON(){return{keys:this.keys,records:this.records}}}function NjD(H,$,{getFn:A=j9.getFn,fieldNormWeight:L=j9.fieldNormWeight}={}){let I=new yZ$({getFn:A,fieldNormWeight:L});return I.setKeys(H.map(zjD)),I.setSources($),I.create(),I}function cJ1(H,{getFn:$=j9.getFn,fieldNormWeight:A=j9.fieldNormWeight}={}){let{keys:L,records:I}=H,D=new yZ$({getFn:$,fieldNormWeight:A});return D.setKeys(L),D.setIndexRecords(I),D}function jZ$(H,{errors:$=0,currentLocation:A=0,expectedLocation:L=0,distance:I=j9.distance,ignoreLocation:D=j9.ignoreLocation}={}){let B=$/H.length;if(D)return B;let f=Math.abs(L-A);if(!I)return f?1:B;return B+f/I}function lJ1(H=[],$=j9.minMatchCharLength){let A=[],L=-1,I=-1,D=0;for(let B=H.length;D=$)A.push([L,I]);L=-1}}if(H[D-1]&&D-L>=$)A.push([L,D-1]);return A}function iJ1(H,$,A,{location:L=j9.location,distance:I=j9.distance,threshold:D=j9.threshold,findAllMatches:B=j9.findAllMatches,minMatchCharLength:f=j9.minMatchCharLength,includeMatches:E=j9.includeMatches,ignoreLocation:M=j9.ignoreLocation}={}){if($.length>G1H)throw Error(yJ1(G1H));let G=$.length,U=H.length,X=Math.max(0,Math.min(L,U)),J=D,F=X,Q=f>1||E,W=Q?Array(U):[],P;while((P=H.indexOf($,F))>-1){let j=jZ$($,{currentLocation:P,expectedLocation:X,distance:I,ignoreLocation:M});if(J=Math.min(j,J),F=P+G,Q){let u=0;while(u=g;k-=1){let n=k-1,GH=A[H.charAt(n)];if(Q)W[n]=+!!GH;if(p[k]=(p[k+1]<<1|1)&GH,j)p[k]|=(C[k+1]|C[k])<<1|1|C[k+1];if(p[k]&q){if(Y=jZ$($,{errors:j,currentLocation:n,expectedLocation:X,distance:I,ignoreLocation:M}),Y<=J){if(J=Y,F=n,F<=X)break;g=Math.max(1,2*X-F)}}}if(jZ$($,{errors:j+1,currentLocation:X,expectedLocation:X,distance:I,ignoreLocation:M})>J)break;C=p}let O={isMatch:F>=0,score:Math.max(0.001,Y)};if(Q){let j=lJ1(W,f);if(!j.length)O.isMatch=!1;else if(E)O.indices=j}return O}function nJ1(H){let $={};for(let A=0,L=H.length;A{this.chunks.push({pattern:U,alphabet:nJ1(U),startIndex:X})},G=this.pattern.length;if(G>G1H){let U=0,X=G%G1H,J=G-X;while(U{let{isMatch:W,score:P,indices:C}=iJ1(H,J,F,{location:L+Q,distance:I,threshold:D,findAllMatches:B,minMatchCharLength:f,includeMatches:A,ignoreLocation:E});if(W)U=!0;if(G+=P,W&&C)M=[...M,...C]});let X={isMatch:U,score:U?G/this.chunks.length:1};if(U&&A)X.indices=M;return X}}class Ld{constructor(H){this.pattern=H}static isMultiMatch(H){return _jD(H,this.multiRegex)}static isSingleMatch(H){return _jD(H,this.singleRegex)}search(){}}function _jD(H,$){let A=H.match($);return A?A[1]:null}function oJ1(H,$={}){return H.split(aJ1).map((A)=>{let L=A.trim().split(rJ1).filter((D)=>D&&!!D.trim()),I=[];for(let D=0,B=L.length;D{let D=Object.keys(I),B=eJ1(I);if(!B&&D.length>1&&!MjA(I))return L(CjD(I));if(HF1(I)){let E=B?I[EjA.PATH]:D[0],M=B?I[EjA.PATTERN]:I[E];if(!Ab(M))throw Error(RJ1(E));let G={keyId:IjA(E),pattern:M};if(A)G.searcher=fjA(M,$);return G}let f={children:[],operator:D[0]};return D.forEach((E)=>{let M=I[E];if(Ad(M))M.forEach((G)=>{f.children.push(L(G))})}),f};if(!MjA(H))H=CjD(H);return L(H)}function $F1(H,{ignoreFieldNorm:$=j9.ignoreFieldNorm}){H.forEach((A)=>{let L=1;A.matches.forEach(({key:I,norm:D,score:B})=>{let f=I?I.weight:null;L*=Math.pow(B===0&&f?Number.EPSILON:B,(f||1)*($?1:D))}),A.score=L})}function AF1(H,$){let A=H.matches;if($.matches=[],!rw(A))return;A.forEach((L)=>{if(!rw(L.indices)||!L.indices.length)return;let{indices:I,value:D}=L,B={indices:I,value:D};if(L.key)B.key=L.key.src;if(L.idx>-1)B.refIndex=L.idx;$.matches.push(B)})}function LF1(H,$){$.score=H.score}function IF1(H,$,{includeMatches:A=j9.includeMatches,includeScore:L=j9.includeScore}={}){let I=[];if(A)I.push(AF1);if(L)I.push(LF1);return H.map((D)=>{let{idx:B}=D,f={item:$[B],refIndex:B};if(I.length)I.forEach((E)=>{E(D,f)});return f})}class FC{constructor(H,$={},A){this.options={...j9,...$},this.options.useExtendedSearch,this._keyStore=new TjD(this.options.keys),this.setCollection(H,A)}setCollection(H,$){if(this._docs=H,$&&!($ instanceof yZ$))throw Error(jJ1);this._myIndex=$||NjD(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(H){if(!rw(H))return;this._docs.push(H),this._myIndex.add(H)}remove(H=()=>!1){let $=[];for(let A=0,L=this._docs.length;A-1)f=f.slice(0,$);return IF1(f,this._docs,{includeMatches:A,includeScore:L})}_searchStringList(H){let $=fjA(H,this.options),{records:A}=this._myIndex,L=[];return A.forEach(({v:I,i:D,n:B})=>{if(!rw(I))return;let{isMatch:f,score:E,indices:M}=$.searchIn(I);if(f)L.push({item:I,idx:D,matches:[{score:E,value:I,norm:B,indices:M}]})}),L}_searchLogical(H){let $=hjD(H,this.options),A=(B,f,E)=>{if(!B.children){let{keyId:G,searcher:U}=B,X=this._findMatches({key:this._keyStore.get(G),value:this._myIndex.getValueForItemAtKeyId(f,G),searcher:U});if(X&&X.length)return[{idx:E,item:f,matches:X}];return[]}let M=[];for(let G=0,U=B.children.length;G{if(rw(B)){let E=A($,B,f);if(E.length){if(!I[f])I[f]={idx:f,item:B,matches:[]},D.push(I[f]);E.forEach(({matches:M})=>{I[f].matches.push(...M)})}}}),D}_searchObjectList(H){let $=fjA(H,this.options),{keys:A,records:L}=this._myIndex,I=[];return L.forEach(({$:D,i:B})=>{if(!rw(D))return;let f=[];if(A.forEach((E,M)=>{f.push(...this._findMatches({key:E,value:D[M],searcher:$}))}),f.length)I.push({idx:B,item:D,matches:f})}),I}_findMatches({key:H,value:$,searcher:A}){if(!rw($))return[];let L=[];if(Ad($))$.forEach(({v:I,i:D,n:B})=>{if(!rw(I))return;let{isMatch:f,score:E,indices:M}=A.searchIn(I);if(f)L.push({score:E,key:H,value:I,idx:D,norm:B,indices:M})});else{let{v:I,n:D}=$,{isMatch:B,score:f,indices:E}=A.searchIn(I);if(B)L.push({score:f,key:H,value:I,norm:D,indices:E})}return L}}var zJ1=1/0,jJ1="Incorrect 'index' type",RJ1=(H)=>`Invalid value for key ${H}`,yJ1=(H)=>`Pattern length exceeds max of ${H}.`,vJ1=(H)=>`Missing ${H} property in key`,hJ1=(H)=>`Property 'weight' in key '${H}' must be a positive integer`,VjD,kJ1,uJ1,gJ1,mJ1,j9,pJ1,G1H=32,OjD,xjD,SjD,jjD,RjD,yjD,UjA,XjA,DjA,YjD,rJ1,aJ1="|",tJ1,BjA,RZ$,EjA,MjA=(H)=>!!(H[RZ$.AND]||H[RZ$.OR]),eJ1=(H)=>!!H[EjA.PATH],HF1=(H)=>!Ad(H)&&ZjD(H)&&!MjA(H),CjD=(H)=>({[RZ$.AND]:Object.keys(H).map(($)=>({[$]:H[$]}))});var zgH=K(()=>{VjD=Object.prototype.hasOwnProperty;kJ1={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},uJ1={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(H,$)=>H.score===$.score?H.idx<$.idx?-1:1:H.score<$.score?-1:1},gJ1={location:0,threshold:0.6,distance:100},mJ1={useExtendedSearch:!1,getFn:bJ1,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},j9={...uJ1,...kJ1,...gJ1,...mJ1},pJ1=/[^ ]+/g;OjD=class OjD extends Ld{constructor(H){super(H)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(H){let $=H===this.pattern;return{isMatch:$,score:$?0:1,indices:[0,this.pattern.length-1]}}};xjD=class xjD extends Ld{constructor(H){super(H)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(H){let A=H.indexOf(this.pattern)===-1;return{isMatch:A,score:A?0:1,indices:[0,H.length-1]}}};SjD=class SjD extends Ld{constructor(H){super(H)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(H){let $=H.startsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,this.pattern.length-1]}}};jjD=class jjD extends Ld{constructor(H){super(H)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(H){let $=!H.startsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,H.length-1]}}};RjD=class RjD extends Ld{constructor(H){super(H)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(H){let $=H.endsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[H.length-this.pattern.length,H.length-1]}}};yjD=class yjD extends Ld{constructor(H){super(H)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(H){let $=!H.endsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,H.length-1]}}};UjA=class UjA extends Ld{constructor(H,{location:$=j9.location,threshold:A=j9.threshold,distance:L=j9.distance,includeMatches:I=j9.includeMatches,findAllMatches:D=j9.findAllMatches,minMatchCharLength:B=j9.minMatchCharLength,isCaseSensitive:f=j9.isCaseSensitive,ignoreLocation:E=j9.ignoreLocation}={}){super(H);this._bitapSearch=new GjA(H,{location:$,threshold:A,distance:L,includeMatches:I,findAllMatches:D,minMatchCharLength:B,isCaseSensitive:f,ignoreLocation:E})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(H){return this._bitapSearch.searchIn(H)}};XjA=class XjA extends Ld{constructor(H){super(H)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(H){let $=0,A,L=[],I=this.pattern.length;while((A=H.indexOf(this.pattern,$))>-1)$=A+I,L.push([A,$-1]);let D=!!L.length;return{isMatch:D,score:D?0:1,indices:L}}};DjA=[OjD,XjA,SjD,jjD,yjD,RjD,xjD,UjA],YjD=DjA.length,rJ1=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;tJ1=new Set([UjA.type,XjA.type]);BjA=[];RZ$={AND:"$and",OR:"$or"},EjA={PATH:"$path",PATTERN:"$val"};FC.version="7.0.0";FC.createIndex=NjD;FC.parseIndex=cJ1;FC.config=j9;FC.parseQuery=hjD;sJ1(vjD)});var JjA={};XA(JjA,{default:()=>BF1,FileIndex:()=>DF1});var vZ$,DF1,BF1;var FjA=K(()=>{try{vZ$=pmA()}catch(H){vZ$=null}DF1=vZ$?.FileIndex,BF1=vZ$?.FileIndex});async function fF1(){if(hZ$)return null;if(NgH)return NgH;if(U8())try{return NgH=new(await Promise.resolve().then(() => (FjA(),JjA))).FileIndex,NgH}catch(H){return hZ$=!0,N(`[FileIndex] Rust module unavailable, falling back to Fuse.js: ${H instanceof Error?H.message:String(H)}`),r(H),null}else return hZ$=!0,N("[FileIndex] Not in bundled mode, using Fuse.js fallback"),null}function gjD(){NgH=null,hZ$=!1,EVH=null,MVH=[],U1H=null,_jA=0,OgH=null,QjA=null,bZ$=null,BVH=[],WjA=null,VjA=null}async function MF1(){let H=C$();if(QjA===H&&OgH!==null)return OgH;return OgH=XQ(H)!==null,QjA=H,OgH}function bjD(H,$,A){if(A===$)return H;return H.map((L)=>{let I=xJ.join($,L);return xJ.relative(A,I)})}function GF1(H){if(H.length===0)return;let $=PjA(H);if(EVH&&BVH.length>0){let A=PjA(BVH),L=[...BVH,...A,...H,...$];try{EVH.loadFromFileList(L),N(`[FileIndex] rebuilt Rust index with ${BVH.length} tracked + ${H.length} untracked files`)}catch(I){N(`[FileIndex] failed to rebuild Rust index: ${I}`)}}else{let A=[...H,...$],L=new Set(MVH);for(let I of A)if(!L.has(I))MVH.push(I);N(`[FileIndex] merged ${H.length} untracked files into JS cache`)}}function kjD(H,$){let A=`${H}:${$}`;if(VjA===A)return WjA;let L=zH(),I=[".ignore",".rgignore"],D=[...new Set([H,$])],B=ujD.default(),f=!1;for(let M of D)for(let G of I){let U=xJ.join(M,G);if(L.existsSync(U))try{let X=L.readFileSync(U,{encoding:"utf8"});B.add(X),f=!0,N(`[FileIndex] loaded ignore patterns from ${U}`)}catch{}}let E=f?B:null;return WjA=E,VjA=A,E}async function UF1(H,$){let A=Date.now();if(N("[FileIndex] getFilesUsingGit called"),!await MF1())return N("[FileIndex] not a git repo, returning null"),null;try{let L=XQ(C$());if(!L)return N("[FileIndex] git rev-parse --show-toplevel failed, falling back to ripgrep"),null;let I=C$(),D=Date.now(),B=await pD(cB(),["ls-files","--recurse-submodules"],{timeout:5000,abortSignal:H,cwd:L});if(N(`[FileIndex] git ls-files (tracked) took ${Date.now()-D}ms`),B.code!==0)return N(`[FileIndex] git ls-files failed (code=${B.code}, stderr=${B.stderr}), falling back to ripgrep`),null;let f=B.stdout.trim().split(` `))}}catch(D){if(A.signal.aborted)throw Error("Compaction canceled.");else if(D instanceof Error&&D.message===guH)throw Error(guH);else throw r(D instanceof Error?D:Error(String(D))),Error(`Error during compaction: ${D}`)}};var IRD=K(()=>{bT();mQ();Cp();Ow();mZ$();ow$();lt();Cw$();Nw$();q3H();_$();r0();dQ$();yE();FG()});var zF1,DRD;var BRD=K(()=>{NA();zF1={type:"local",name:"compact",description:"Clear conversation history but keep a summary in context. Optional: /compact [instructions for summarization]",isEnabled:()=>!A$(process.env.DISABLE_COMPACT),isHidden:!1,supportsNonInteractive:!0,argumentHint:"",load:()=>Promise.resolve().then(() => (IRD(),LRD)),userFacingName(){return"compact"}},DRD=zF1});function Zz({title:H,color:$,defaultTab:A,children:L,hidden:I,useFullWidth:D,selectedTab:B,onTabChange:f,banner:E,disableNavigation:M}){let{columns:G}=QL(),U=L.map((g)=>[g.props.id??g.props.title,g.props.title]),X=A?U.findIndex((g)=>A===g[0]):0,J=B!==void 0,[F,Q]=X1H.useState(X!==-1?X:0),W=J?U.findIndex((g)=>g[0]===B):-1,P=J?W!==-1?W:0:F,C=(g)=>{let h=(P+U.length+g)%U.length,p=U[h]?.[0];if(J&&f&&p)f(p);else Q(h)};bI({"tabs:next":()=>C(1),"tabs:previous":()=>C(-1)},{context:"Tabs",isActive:!I&&!M});let Y="(\u2190/\u2192 or tab to cycle)",Z=H?H.length+1:0,q=U.reduce((g,[,h])=>g+(h?.length??0)+2+1,0),O=Y.length,j=Z+q+O,u=D?Math.max(0,G-j-2):0,y=D?G-2:void 0;return ow.default.createElement(xjA.Provider,{value:{selectedTab:U[P][0],width:y}},ow.default.createElement(x,{flexDirection:"column"},!I&&ow.default.createElement(ow.default.Fragment,null,ow.default.createElement(V,{color:$},"\u2500".repeat(G-2)),ow.default.createElement(x,{flexDirection:"row",gap:1,paddingLeft:1},H!==void 0&&ow.default.createElement(V,{bold:!0,color:$},H),U.map(([g,h],p)=>ow.default.createElement(V,{key:g,backgroundColor:$&&P===p?$:void 0,color:$&&P===p?"inverseText":void 0,bold:P===p}," ",h," ")),ow.default.createElement(V,{dimColor:!0},"(\u2190/\u2192 or tab to cycle)"),u>0&&ow.default.createElement(V,null," ".repeat(u)))),E,ow.default.createElement(x,{width:y,paddingLeft:1,marginTop:I?0:1},L)))}function WU({title:H,id:$,children:A}){let{selectedTab:L,width:I}=X1H.useContext(xjA);if(L!==($??H))return null;return ow.default.createElement(x,{width:I},A)}function fRD(){let{width:H}=X1H.useContext(xjA);return H}var ow,X1H,xjA;var J1H=K(()=>{xH();$I();OB();ow=b(s(),1),X1H=b(s(),1),xjA=X1H.createContext({selectedTab:void 0,width:void 0})});function ERD({context:H,flat:$}={}){let A=QJ(),L=[];if(H?.readFileState)yx(H.readFileState).forEach((B)=>{let f=H.readFileState.get(B);if(f&&B.endsWith("/CLAUDE.md")&&!A.some((E)=>E.path===B))L.push({path:B,content:f.content,type:"Project",isNested:!0})});let I=[...A,...L];if(I.length===0)return null;if($)return SJ.createElement(x,{flexDirection:"row",columnGap:1,flexWrap:"wrap"},I.map((B,f)=>{let E=V9(B.path),M=B.isNested?"nested":kOA(B.type),G=f{let E=V9(B.path),M=B.isNested?"nested: ":`${kOA(B.type)}: `,G=B.parent?(D.get(B.parent)??0)+1:0;if(D.set(B.path,G),G===0)return SJ.createElement(V,{key:f},SJ.createElement(V,{dimColor:!0}," L "),`${M}${E}`);else{let U=" ".repeat(G-1);return SJ.createElement(V,{key:f}," ".repeat(M.length+2),U,SJ.createElement(V,{dimColor:!0}," L "),E)}}))}var SJ;var MRD=K(()=>{xH();mQ();rD();uOA();Y7();SJ=b(s(),1)});function cZ$(H){return{env:H?.env??process.env,home:H?.homedir??GRD.homedir()}}function lZ$(H){let{env:$,home:A}=cZ$(H);return $.XDG_STATE_HOME??SgH.join(A,".local","state")}function URD(H){let{env:$,home:A}=cZ$(H);return $.XDG_CACHE_HOME??SgH.join(A,".cache")}function XRD(H){let{env:$,home:A}=cZ$(H);return $.XDG_DATA_HOME??SgH.join(A,".local","share")}function JRD(H){let{home:$}=cZ$(H);return SgH.join($,".local","bin")}var GRD,SgH;var SjA=K(()=>{GRD=require("os"),SgH=require("path")});function QRD(){return(process.argv[1]||"").includes("/.claude/local/node_modules/")}async function NF1(){try{if(!zH().existsSync(Es))zH().mkdirSync(Es);if(!zH().existsSync(FRD))iL(FRD,yH({name:"claude-local",version:"0.0.1",private:!0},null,2),{encoding:"utf8",flush:!1});let H=GVH.join(Es,"claude");if(!zH().existsSync(H)){let $=`#!/bin/sh exec "${Es}/node_modules/.bin/claude" "$@"`;iL(H,$,{encoding:"utf8",flush:!1}),await jA("chmod",["+x",H])}return!0}catch(H){return r(H instanceof Error?H:Error(String(H))),!1}}async function jgH(H,$){try{if(!await NF1())return"install_failed";let A=$?$:H==="stable"?"stable":"latest",L=await pD("npm",["install",`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${A}`],{cwd:Es,maxBuffer:1e6});if(L.code!==0){let I=Error(`Failed to install Claude CLI package: ${L.stderr}`);return r(I),L.code===190?"in_progress":"install_failed"}return AA((I)=>({...I,installMethod:"local"})),"success"}catch(A){return r(A instanceof Error?A:Error(String(A))),"install_failed"}}function Ms(){return zH().existsSync(GVH.join(Es,"node_modules",".bin","claude"))}function UVH(){let H=process.env.SHELL||"";if(H.includes("zsh"))return"zsh";if(H.includes("bash"))return"bash";if(H.includes("fish"))return"fish";return"unknown"}var GVH,Es,FRD,KRD;var F1H=K(()=>{B0();_$();vA();DL();NA();Z$();Z$();GVH=require("path"),Es=GVH.join(UL(),"local"),FRD=GVH.join(Es,"package.json"),KRD=GVH.join(Es,"claude")});function Gs(){let H=process.env.ZDOTDIR||RgH.homedir();return{zsh:iZ$.join(H,".zshrc"),bash:iZ$.join(RgH.homedir(),".bashrc"),fish:iZ$.join(RgH.homedir(),".config/fish/config.fish")}}function nZ$(H){let $=!1;return{filtered:H.filter((L)=>{if(WRD.test(L)){let I=L.match(/alias\s+claude\s*=\s*["']([^"']+)["']/);if(!I)I=L.match(/alias\s+claude\s*=\s*([^#\n]+)/);if(I&&I[1]){if(I[1].trim()===KRD)return $=!0,!1}}return!0}),hadAlias:$}}function ygH(H){let $=zH();try{if(!$.existsSync(H))return null;return $.readFileSync(H,{encoding:"utf8"}).split(` `),{encoding:"utf8",flush:!0})}function jjA(){let H=Gs();for(let $ of Object.values(H)){let A=ygH($);if(!A)continue;for(let L of A)if(WRD.test(L)){let I=L.match(/alias\s+claude=["']?([^"'\s]+)/);if(I&&I[1])return I[1]}}return null}function VRD(){let H=jjA();if(!H)return null;let $=zH(),A=H.startsWith("~")?H.replace("~",RgH.homedir()):H;try{if($.existsSync(A)){let L=$.statSync(A);if(L.isFile()||L.isSymbolicLink())return H}}catch{}return null}var RgH,iZ$,WRD;var aZ$=K(()=>{DL();F1H();Z$();RgH=require("os"),iZ$=require("path"),WRD=/^\s*alias\s+claude\s*=/});async function CRD(){try{let H=await aS("tengu_version_config",{minVersion:"0.0.0"});if(H.minVersion&&sZ$.lt({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,H.minVersion))console.error(` It looks like your version of Claude Code (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}) needs an update. claude update `),L9(1)}catch(H){r(H)}}function JVH(H){let A=GB()?.minimumVersion;if(!A)return!1;let L=!sZ$.gte(H,A,{loose:!0});if(L)N(`Skipping update to ${H} - below minimumVersion ${A}`);return L}function K1H(){return _RD.join(UL(),".update.lock")}function SF1(){try{if(!zH().existsSync(UL()))zH().mkdirSync(UL());if(zH().existsSync(K1H())){let H=zH().statSync(K1H());if(Date.now()-H.mtimeMs$.abort(),5000);let A=H==="stable"?"stable":"latest",L=await pD("npm",["view",`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${A}`,"version","--prefer-online"],{abortSignal:$.signal,cwd:XVH.homedir()});if(L.code!==0){if(N(`npm view failed with code ${L.code}`),L.stderr)N(`npm stderr: ${L.stderr.trim()}`);else N("npm stderr: (empty)");if(L.stdout)N(`npm stdout: ${L.stdout.trim()}`);return null}return L.stdout.trim()}async function wRD(){let H=nD();setTimeout(()=>H.abort(),5000);let $=await pD("npm",["view",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL,"dist-tags","--json","--prefer-online"],{abortSignal:H.signal,cwd:XVH.homedir()});if($.code!==0)return N(`npm view dist-tags failed with code ${$.code}`),{latest:null,stable:null};try{let A=DA($.stdout.trim());return{latest:typeof A.latest==="string"?A.latest:null,stable:typeof A.stable==="string"?A.stable:null}}catch(A){return N(`Failed to parse dist-tags: ${A}`),{latest:null,stable:null}}}async function tZ$(H){try{return(await nA.get(`${OF1}/${H}`,{timeout:5000,responseType:"text"})).data.trim()}catch($){return N(`Failed to fetch ${H} from GCS: ${$}`),null}}async function ZRD(){let[H,$]=await Promise.all([tZ$("latest"),tZ$("stable")]);return{latest:H,stable:$}}async function vgH(H){if(!SF1())return r(new oZ$("Another process is currently installing an update")),c("tengu_auto_updater_lock_contention",{pid:process.pid,currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}),"in_progress";try{if(yF1(),!OA.isRunningWithBun()&&OA.isNpmFromWindowsPath())return r(Error("Windows NPM detected in WSL environment")),c("tengu_auto_updater_windows_npm_in_wsl",{currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}),console.error(` 3. Try updating again with 'claude update' `),"install_failed";let{hasPermissions:$}=await RjA();if(!$)return"no_permissions";let A=H?`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${H}`:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL,L=OA.isRunningWithBun()?"bun":"npm",I=await pD(L,["install","-g",A],{cwd:XVH.homedir()});if(I.code!==0){let D=new oZ$(`Failed to install new version of claude: ${I.stdout} ${I.stderr}`);return r(D),"install_failed"}return AA((D)=>({...D,installMethod:"global"})),"success"}finally{jF1()}}function yF1(){let H=Gs();for(let[,$]of Object.entries(H))try{let A=ygH($);if(!A)continue;let{filtered:L,hadAlias:I}=nZ$(A);if(I)rZ$($,L),N(`Removed claude alias from ${$}`)}catch(A){N(`Failed to remove alias from ${$}: ${A}`,{level:"error"})}}var PRD,_RD,sZ$,XVH,YRD,OF1="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases",oZ$,xF1=300000;var Us=K(()=>{z$();SD();eE();vA();E$();Z1();NA();lG();B0();Z$();DL();UU();_$();mL();aZ$();Z$();w1();PRD=require("fs"),_RD=require("path"),sZ$=b(OO(),1),XVH=require("os"),YRD=require("fs");oZ$=class oZ$ extends M2H{}});async function vF1(H="latest",$,A){let L=Date.now();try{let I=await nA.get(`${$}/${H}`,{timeout:30000,responseType:"text",...A}),D=Date.now()-L;return c("tengu_version_check_success",{latency_ms:D}),I.data.trim()}catch(I){let D=Date.now()-L,B=I instanceof Error?I.message:String(I),f;if(nA.isAxiosError(I)&&I.response)f=I.response.status;c("tengu_version_check_failure",{latency_ms:D,http_status:f,is_timeout:B.includes("timeout")});let E=Error(`Failed to fetch version from ${$}/${H}: ${B}`);throw r(E),E}}async function vjA(H){if(/^v?\d+\.\d+\.\d+(-\S+)?$/.test(H))return H.startsWith("v")?H.slice(1):H;let $=H;if($!=="stable"&&$!=="latest")throw Error(`Invalid channel: ${H}. Use 'stable' or 'latest'`);return vF1($,NRD)}async function bF1(H,$,A,L={}){let I;for(let D=1;D<=yjA;D++){let B=new AbortController,f,E=()=>{if(f)clearTimeout(f),f=void 0},M=()=>{E(),f=setTimeout(()=>{B.abort()},hF1)};try{M();let G=await nA.get(H,{timeout:300000,responseType:"arraybuffer",signal:B.signal,onDownloadProgress:()=>{M()},...L});E();let U=TRD.createHash("sha256");U.update(G.data);let X=U.digest("hex");if(X!==$)throw Error(`Checksum mismatch: expected ${$}, got ${X}`);(await import("fs")).writeFileSync(A,Buffer.from(G.data)),zRD.chmodSync(A,493);return}catch(G){E();let U=nA.isCancel(G);if(U)I=new ORD;else I=G instanceof Error?G:Error(String(G));if(U&&DsetTimeout(X,1000));continue}throw I}}throw I??Error("Download failed after all retries")}async function kF1(H,$,A,L){let I=zH();if(I.existsSync($))I.rmSync($,{recursive:!0,force:!0});let D=Bd(),B=Date.now();c("tengu_binary_download_attempt",{});let f;try{f=(await nA.get(`${A}/${H}/manifest.json`,{timeout:1e4,responseType:"json",...L})).data}catch(J){let F=Date.now()-B,Q=J instanceof Error?J.message:String(J),W;if(nA.isAxiosError(J)&&J.response)W=J.response.status;throw c("tengu_binary_manifest_fetch_failure",{latency_ms:F,http_status:W,is_timeout:Q.includes("timeout")}),r(Error(`Failed to fetch manifest from ${A}/${H}/manifest.json: ${Q}`)),J}let E=f.platforms[D];if(!E)throw c("tengu_binary_platform_not_found",{}),Error(`Platform ${D} not found in manifest for version ${H}`);let M=E.checksum,G=eZ$(D),U=`${A}/${H}/${D}/${G}`;I.mkdirSync($);let X=qRD.join($,G);try{await bF1(U,M,X,L||{});let J=Date.now()-B;c("tengu_binary_download_success",{latency_ms:J})}catch(J){let F=Date.now()-B,Q=J instanceof Error?J.message:String(J),W;if(nA.isAxiosError(J)&&J.response)W=J.response.status;throw c("tengu_binary_download_failure",{latency_ms:F,http_status:W,is_timeout:Q.includes("timeout"),is_checksum_mismatch:Q.includes("Checksum mismatch")}),r(Error(`Failed to download binary from ${U}: ${Q}`)),J}}async function xRD(H,$){return await kF1(H,$,NRD),"binary"}var qRD,TRD,zRD,NRD="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases",hF1=60000,yjA=3,ORD;var SRD=K(()=>{w1();DL();B0();E$();z$();hjA();_$();Z$();Z$();qRD=require("path"),TRD=require("crypto"),zRD=require("fs");ORD=class ORD extends Error{constructor(){super("Download stalled: no data received for 60 seconds");this.name="StallTimeoutError"}}});function $q$(H,$){return $.includes(H.id)||H.idLike.some((A)=>$.includes(A))}function Aq$(){let H=oA();if(H!=="macos"&&H!=="linux"&&H!=="wsl")return!1;let $=process.execPath||process.argv[0]||"";if($.includes("/Caskroom/"))return N(`Detected Homebrew cask installation: ${$}`),!0;return!1}function bjA(){if(oA()!=="windows")return!1;let $=process.execPath||process.argv[0]||"",A=[/Microsoft[/\\]WinGet[/\\]Packages/i,/Microsoft[/\\]WinGet[/\\]Links/i];for(let L of A)if(L.test($))return N(`Detected winget installation: ${$}`),!0;return!1}var jRD,Hq$,kjA,ujA,gjA,mjA,FVH;var Lq$=K(()=>{Z9();E$();B0();tD();jRD=require("fs/promises"),Hq$=o$(async()=>{try{let H=await jRD.readFile("/etc/os-release","utf8"),$=H.match(/^ID=["']?(\S+?)["']?\s*$/m),A=H.match(/^ID_LIKE=["']?(.+?)["']?\s*$/m);return{id:$?.[1]??"",idLike:A?.[1]?.split(" ")??[]}}catch{return null}});kjA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["arch"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("pacman",["-Qo",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected pacman installation: ${L.stdout.trim()}`),!0;return!1}),ujA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["debian"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("dpkg",["-S",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected deb installation: ${L.stdout.trim()}`),!0;return!1}),gjA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["fedora","rhel","suse"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("rpm",["-qf",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected rpm installation: ${L.stdout.trim()}`),!0;return!1}),mjA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["alpine"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("apk",["info","--who-owns",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected apk installation: ${L.stdout.trim()}`),!0;return!1}),FVH=o$(async()=>{if(Aq$())return"homebrew";if(bjA())return"winget";if(await kjA())return"pacman";if(await mjA())return"apk";if(await ujA())return"deb";if(await gjA())return"rpm";return"unknown"})});function uF1(){let H=process.argv[1]||"",$=process.execPath||process.argv[0]||"";if(oA()==="windows")H=H.split(H4.win32.sep).join(H4.posix.sep),$=$.split(H4.win32.sep).join(H4.posix.sep);return[H,$]}async function Lb(){let[H]=uF1();if(U8()){if(Aq$()||bjA()||await kjA()||await ujA()||await gjA()||await mjA())return"package-manager";return"native"}if(QRD())return"npm-local";if(["/usr/local/lib/node_modules","/usr/lib/node_modules","/opt/homebrew/lib/node_modules","/opt/homebrew/bin","/usr/local/bin","/.nvm/versions/node/"].some((I)=>H.includes(I)))return"npm-global";if(H.includes("/npm/")||H.includes("/nvm/"))return"npm-global";let A=await fE("npm config get prefix",{shell:!0,reject:!1}),L=A.exitCode===0?A.stdout.trim():null;if(L&&H.startsWith(L))return"npm-global";return"unknown"}async function gF1(){if(U8()){let H=zH();try{return H.realpathSync(process.execPath)}catch{}try{let $=await x_("claude");if($)return $}catch{}if(H.existsSync(H4.join(Xs.homedir(),".local/bin/claude")))return H4.join(Xs.homedir(),".local/bin/claude");return"native"}try{return process.argv[0]||"unknown"}catch{return"unknown"}}function hgH(){try{if(U8())return process.execPath||"unknown";return process.argv[1]||"unknown"}catch{return"unknown"}}async function mF1(){let H=zH(),$=[],A=H4.join(Xs.homedir(),".claude","local");if(Ms())$.push({type:"npm-local",path:A});let L=["@anthropic-ai/claude-code"];if({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL!=="@anthropic-ai/claude-code")L.push({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL);let I=await jA("npm",["-g","config","get","prefix"]);if(I.code===0&&I.stdout){let f=I.stdout.trim(),E=oA()==="windows",M=E?H4.join(f,"claude"):H4.join(f,"bin","claude");if(H.existsSync(M)){let G=!1;try{if(H.realpathSync(M).includes("/Caskroom/"))G=Aq$()}catch{}if(!G)$.push({type:"npm-global",path:M})}else for(let G of L){let U=E?H4.join(f,"node_modules",G):H4.join(f,"lib","node_modules",G);if(H.existsSync(U))$.push({type:"npm-global-orphan",path:U})}}let D=H4.join(Xs.homedir(),".local","bin","claude");if(H.existsSync(D))$.push({type:"native",path:D});if(M$().installMethod==="native"){let f=H4.join(Xs.homedir(),".local","share","claude");if(H.existsSync(f)&&!$.some((E)=>E.type==="native"))$.push({type:"native",path:f})}return $}async function pF1(H){let $=[],A=M$();if(H==="development")return $;if(H==="native"){let B=(process.env.PATH||"").split(H4.delimiter),f=Xs.homedir(),E=H4.join(f,".local","bin"),M=E;if(oA()==="windows")M=E.split(H4.win32.sep).join(H4.posix.sep);if(!B.some((U)=>{let X=U;if(oA()==="windows")X=U.split(H4.win32.sep).join(H4.posix.sep);let J=X.replace(/\/+$/,""),F=U.replace(/[/\\]+$/,"");return J===M||F==="~/.local/bin"||F==="$HOME/.local/bin"}))if(oA()==="windows"){let X=E.split(H4.posix.sep).join(H4.win32.sep);$.push({issue:`Native installation exists but ${X} is not in your PATH`,fix:"Add it by opening: System Properties \u2192 Environment Variables \u2192 Edit User PATH \u2192 New \u2192 Add the path above. Then restart your terminal."})}else{let X=UVH(),F=Gs()[X],Q=F?F.replace(Xs.homedir(),"~"):"your shell config file";$.push({issue:"Native installation exists but ~/.local/bin is not in your PATH",fix:`Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${Q} then open a new terminal or run: source ${Q}`})}}if(!A$(process.env.DISABLE_INSTALLATION_CHECKS)){if(H==="npm-local"&&A.installMethod!=="local")$.push({issue:`Running from local installation but config install method is '${A.installMethod}'`,fix:"Consider using native installation: claude install"});if(H==="native"&&A.installMethod!=="native")$.push({issue:`Running native installation but config install method is '${A.installMethod}'`,fix:"Run claude install to update configuration"})}if(H==="npm-global"&&Ms())$.push({issue:"Local installation exists but not being used",fix:"Consider using native installation: claude install"});let L=jjA(),I=VRD();if(H==="npm-local"){if(!await x_("claude")&&!I)if(L)$.push({issue:"Local installation not accessible",fix:`Alias exists but points to invalid target: ${L}. Update alias: alias claude="~/.claude/local/claude"`});else $.push({issue:"Local installation not accessible",fix:'Create alias: alias claude="~/.claude/local/claude"'})}return $}function dF1(){if(oA()!=="linux")return[];let H=[],$=vL.getLinuxGlobPatternWarnings();if($.length>0){let A=$.slice(0,3).join(", "),L=$.length-3,I=L>0?`${A} (${L} more)`:A;H.push({issue:"Glob patterns in sandbox permission rules are not fully supported on Linux",fix:`Found ${$.length} pattern(s): ${I}. On Linux, glob patterns in Edit/Read rules will be ignored.`})}return H}async function W1H(){let H=await Lb(),$={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION?{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION:"unknown",A=await gF1(),L=hgH(),I=await mF1(),D=await pF1(H);if(D.push(...dF1()),H==="native"){let J=I.filter((Q)=>Q.type==="npm-global"||Q.type==="npm-global-orphan"||Q.type==="npm-local"),F=oA()==="windows";for(let Q of J)if(Q.type==="npm-global"){let W="npm -g uninstall @anthropic-ai/claude-code";if({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL!=="@anthropic-ai/claude-code")W+=` && npm -g uninstall ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}`;D.push({issue:`Leftover npm global installation at ${Q.path}`,fix:`Run: ${W}`})}else if(Q.type==="npm-global-orphan")D.push({issue:`Orphaned npm global package at ${Q.path}`,fix:F?`Run: rmdir /s /q "${Q.path}"`:`Run: rm -rf ${Q.path}`});else if(Q.type==="npm-local")D.push({issue:`Leftover npm local installation at ${Q.path}`,fix:F?`Run: rmdir /s /q "${Q.path}"`:`Run: rm -rf ${Q.path}`})}let f=M$().installMethod||"not set",E=null;if(H==="npm-global"){if(E=(await RjA()).hasPermissions,!E&&!KVH())D.push({issue:"Insufficient permissions for auto-updates",fix:"Do one of: (1) Re-install node without sudo, or (2) Use `claude install` for native installation"})}let M=mDL(),G={working:M.working??!0,mode:M.mode,systemPath:M.mode==="system"?M.path:null},U=H==="package-manager"?await FVH():void 0;return{installationType:H,version:$,installationPath:A,invokedBinary:L,configInstallMethod:f,autoUpdates:(()=>{let J=KVH();return J?`disabled (${J})`:"enabled"})(),hasUpdatePermissions:E,multipleInstallations:I,warnings:D,packageManager:U,ripgrepStatus:G}}var Xs,H4;var Ib=K(()=>{DL();PI();F1H();vA();Us();aZ$();Z9();B0();O_();CR();EM();NA();Lq$();Zk();Xs=require("os"),H4=require("path")});function V1H(){if(A$(void 0))return!0;if(BE(void 0))return!1;return NL("tengu_pid_based_version_locking",!1)}function Iq$(H){if(H<=1)return!1;try{return process.kill(H,0),!0}catch{return!1}}function lF1(H,$){if(!Iq$(H))return!1;if(H===process.pid)return!0;try{let A=SZI(H);if(!A)return!0;let L=A.toLowerCase(),I=$.toLowerCase();return L.includes("claude")||L.includes(I)}catch{return!0}}function bgH(H){let $=zH();try{if(!$.existsSync(H))return null;let A=$.readFileSync(H,{encoding:"utf8"});if(!A||A.trim()==="")return null;let L=DA(A);if(typeof L.pid!=="number"||!L.version||!L.execPath)return null;return L}catch{return null}}function Dq$(H){let $=bgH(H);if(!$)return!1;let{pid:A,execPath:L}=$;if(!Iq$(A))return!1;if(!lF1(A,L))return N(`Lock PID ${A} is running but does not appear to be Claude - treating as stale`),!1;let I=zH();try{let D=I.statSync(H);if(Date.now()-D.mtimeMs>cF1){if(!Iq$(A))return!1}}catch{}return!0}function iF1(H,$){let A=zH(),L=`${H}.tmp.${process.pid}.${Date.now()}`;try{iL(L,yH($,null,2),{encoding:"utf8",flush:!0}),A.renameSync(L,H)}catch(I){try{if(A.existsSync(L))A.unlinkSync(L)}catch{}throw I}}async function RRD(H,$){let A=zH(),L=kgH.basename(H);if(Dq$($)){let D=bgH($);return N(`Cannot acquire lock for ${L} - held by PID ${D?.pid}`),null}let I={pid:process.pid,version:L,execPath:process.execPath,acquiredAt:Date.now()};try{if(iF1($,I),bgH($)?.pid!==process.pid)return null;return N(`Acquired PID lock for ${L} (PID ${process.pid})`),()=>{try{if(bgH($)?.pid===process.pid)A.unlinkSync($),N(`Released PID lock for ${L}`)}catch(B){N(`Failed to release lock for ${L}: ${B}`)}}}catch(D){return N(`Failed to acquire lock for ${L}: ${D}`),null}}async function yRD(H,$){let A=await RRD(H,$);if(!A)return!1;let L=()=>{try{A()}catch{}};return process.on("exit",L),process.on("SIGINT",L),process.on("SIGTERM",L),!0}async function vRD(H,$,A){let L=await RRD(H,$);if(!L)return!1;try{return await A(),!0}finally{L()}}function pjA(H){let $=zH(),A=[];if(!$.existsSync(H))return A;try{let L=$.readdirStringSync(H).filter((I)=>I.endsWith(".lock"));for(let I of L){let D=kgH.join(H,I),B=bgH(D);if(B)A.push({version:B.version,pid:B.pid,isProcessRunning:Iq$(B.pid),execPath:B.execPath,acquiredAt:new Date(B.acquiredAt),lockFilePath:D})}}catch(L){r(L instanceof Error?L:Error(`Failed to get lock info: ${L}`))}return A}function Bq$(H){let $=zH(),A=0;if(!$.existsSync(H))return 0;try{let L=$.readdirStringSync(H).filter((I)=>I.endsWith(".lock"));for(let I of L){let D=kgH.join(H,I);try{if($.lstatSync(D).isDirectory())$.rmSync(D,{recursive:!0,force:!0}),A++,N(`Cleaned up legacy directory lock: ${I}`);else if(!Dq$(D))$.unlinkSync(D),A++,N(`Cleaned up stale lock: ${I}`)}catch{}}}catch(L){r(L instanceof Error?L:Error(`Failed to cleanup stale locks: ${L}`))}return A}var kgH,cF1=7200000;var djA=K(()=>{DL();E$();_$();TX$();SD();NA();Z$();Z$();kgH=require("path")});function Bd(){let H=OA.platform,$="x64";if(H==="linux"&&YY.isMuslEnvironment())return"linux-x64-musl";return`${H}-x64`}function eZ$(H){return H.startsWith("win32")?"claude.exe":"claude"}function Fs(){let H=Bd(),$=eZ$(H);return{versions:B9.join(XRD(),"claude","versions"),staging:B9.join(URD(),"claude","staging"),locks:B9.join(lZ$(),"claude","locks"),executable:B9.join(JRD(),$)}}async function Js(H){try{let $=await $D.stat(H);if(!$.isFile()||$.size===0)return!1;return await $D.access(H,m3.constants.X_OK),!0}catch{return!1}}async function bRD(H){let $=Fs(),A=[$.versions,$.staging,$.locks];await Promise.all(A.map((D)=>$D.mkdir(D,{recursive:!0})));let L=B9.dirname($.executable);await $D.mkdir(L,{recursive:!0});let I=B9.join($.versions,H);try{await $D.stat(I)}catch{await $D.writeFile(I,"",{encoding:"utf8"})}return{stagingPath:B9.join($.staging,H),installPath:I}}async function nF1(H,$,A=0){let L=Fs(),I=njA(L,H);if(await $D.mkdir(L.locks,{recursive:!0}),V1H()){let B=0,f=A+1,E=A>0?1000:100,M=A>0?5000:500;while(B{try{await $()}catch(U){throw r(U instanceof Error?U:Error(String(U))),U}}))return c("tengu_version_lock_acquired",{is_pid_based:!0,is_lifetime_lock:!1,attempts:B+1}),!0;if(B++,BsetTimeout(X,U))}}return c("tengu_version_lock_failed",{is_pid_based:!0,is_lifetime_lock:!1,attempts:f}),fq$(H,Error("Lock held by another process")),!1}let D=null;try{try{D=await Eq$.default.lock(H,{stale:ijA,retries:{retries:A,minTimeout:A>0?1000:100,maxTimeout:A>0?5000:500},lockfilePath:I,onCompromised:(B)=>{N(`NON-FATAL: Version lock was compromised during operation: ${B.message}`,{level:"info"})}})}catch(B){return c("tengu_version_lock_failed",{is_pid_based:!1,is_lifetime_lock:!1}),fq$(H,B),!1}try{return await $(),c("tengu_version_lock_acquired",{is_pid_based:!1,is_lifetime_lock:!1}),!0}catch(B){throw r(B instanceof Error?B:Error(String(B))),B}}finally{if(D)await D()}}async function kRD(H,$){await $D.mkdir(B9.dirname($),{recursive:!0});let A=`${$}.tmp.${process.pid}.${Date.now()}`;try{await $D.copyFile(H,A),await $D.chmod(A,493),await $D.rename(A,$),N(`Atomically installed binary to ${$}`)}catch(L){try{await $D.unlink(A)}catch{}throw L}}async function rF1(H,$){try{let A=B9.join(H,"node_modules","@anthropic-ai"),I=(await $D.readdir(A)).find((B)=>B.startsWith("claude-cli-native-"));if(!I)throw c("tengu_native_install_package_failure",{stage_find_package:!0,error_package_not_found:!0}),Error("Could not find platform-specific native package");let D=B9.join(A,I,"cli");try{await $D.stat(D)}catch{throw c("tengu_native_install_package_failure",{stage_binary_exists:!0,error_binary_not_found:!0}),Error("Native binary not found in staged package")}await kRD(D,$),await $D.rm(H,{recursive:!0,force:!0}),c("tengu_native_install_package_success",{})}catch(A){let L=A instanceof Error?A.message:String(A);if(!L.includes("Could not find platform-specific")&&!L.includes("Native binary not found"))c("tengu_native_install_package_failure",{stage_atomic_move:!0,error_move_failed:!0});throw r(A instanceof Error?A:Error(L)),A}}async function aF1(H,$){try{let A=Bd(),L=eZ$(A),I=B9.join(H,L);try{await $D.stat(I)}catch{throw c("tengu_native_install_binary_failure",{stage_binary_exists:!0,error_binary_not_found:!0}),Error("Staged binary not found")}await kRD(I,$),await $D.rm(H,{recursive:!0,force:!0}),c("tengu_native_install_binary_success",{})}catch(A){let L=A instanceof Error?A.message:String(A);if(!L.includes("Staged binary not found"))c("tengu_native_install_binary_failure",{stage_atomic_move:!0,error_move_failed:!0});throw r(A instanceof Error?A:Error(L)),A}}async function oF1(H,$,A){if(A==="npm")await rF1(H,$);else await aF1(H,$)}async function tF1(H,$){let{stagingPath:A,installPath:L}=await bRD(H),{executable:I}=Fs(),D=`${A}.${process.pid}.${Date.now()}`,B=!await uRD(H)||$;if(B){N($?`Force reinstalling native installer version ${H}`:`Downloading native installer version ${H}`);let f=await xRD(H,D);await oF1(D,L,f)}else N(`Version ${H} already installed, updating symlink`);if(await eF1(I),await HK1(I,L),!await Js(I)){let f=!1;try{await $D.stat(L),f=!0}catch{}throw Error(`Failed to create executable at ${I}. Source file exists: ${f}. Check write permissions to ${I}.`)}return B}async function uRD(H){let{installPath:$}=await bRD(H);return Js($)}async function sF1(H,$=!1){let A=Date.now(),L=await vjA(H),{executable:I}=Fs();if(N(`Checking for native installer update to version ${L}`),!$&&L==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION&&await uRD(L)&&await Js(I))return N(`Found ${L} at ${I}, skipping install`),c("tengu_native_update_complete",{latency_ms:Date.now()-A,was_new_install:!1,was_force_reinstall:!1,was_already_running:!0}),{success:!0};if(!$&&JVH(L))return c("tengu_native_update_skipped_minimum_version",{latency_ms:Date.now()-A,target_version:L}),{success:!0};let D=!1,B;return D=await tF1(L,$),B=Date.now()-A,c("tengu_native_update_complete",{latency_ms:B,was_new_install:D,was_force_reinstall:$}),N(`Successfully updated to version ${L}`),{success:!0}}async function eF1(H){try{if((await $D.stat(H)).isDirectory()){if((await $D.readdir(H)).length===0)await $D.rmdir(H),N(`Removed empty directory at ${H}`)}}catch($){N(`Could not remove empty directory at ${H}: ${$}`)}}async function HK1(H,$){if(Bd().startsWith("win32"))try{let B=B9.dirname(H);await $D.mkdir(B,{recursive:!0});let f=!1;try{await $D.stat(H),f=!0}catch{}if(f){try{let M=await $D.stat(H),G=await $D.stat($);if(M.size===G.size)return!1}catch{}let E=`${H}.old.${Date.now()}`;await $D.rename(H,E);try{await $D.copyFile($,H);try{await $D.unlink(E)}catch{}}catch(M){try{await $D.rename(E,H)}catch(G){let U=Error(`Failed to restore old executable: ${G}`,{cause:M});throw r(U),U}throw M}}else{try{await $D.stat($)}catch{throw Error(`Source file does not exist: ${$}`)}await $D.copyFile($,H)}return!0}catch(B){return r(Error(`Failed to copy executable from ${$} to ${H}: ${B}`)),!1}let I=B9.dirname(H);try{await $D.mkdir(I,{recursive:!0}),N(`Created directory ${I} for symlink`)}catch(B){return r(Error(`Failed to create directory ${I}: ${B}`)),!1}try{let B=!1;try{await $D.stat(H),B=!0}catch{}if(B){try{let f=await $D.readlink(H),E=B9.resolve(B9.dirname(H),f),M=B9.resolve($);if(E===M)return!1}catch{}await $D.unlink(H)}}catch(B){r(Error(`Failed to check/remove existing symlink: ${B}`))}let D=`${H}.tmp.${process.pid}.${Date.now()}`;try{return await $D.symlink($,D),await $D.rename(D,H),N(`Atomically updated symlink ${H} -> ${$}`),!0}catch(B){try{await $D.unlink(D)}catch{}return r(Error(`Failed to create symlink from ${H} to ${$}: ${B}`)),!1}}async function Db(H=!1){if(A$(process.env.DISABLE_INSTALLATION_CHECKS))return[];let $=await Lb();if($==="development")return[];let A=M$();if(!(H||$==="native"||A.installMethod==="native"))return[];let I=Fs(),D=[],B=B9.dirname(I.executable),f=B9.resolve(B),M=Bd().startsWith("win32");if(!m3.existsSync(B))D.push({message:`installMethod is native, but directory ${B} does not exist`,userActionRequired:!0,type:"error"});if(!m3.existsSync(I.executable))D.push({message:`installMethod is native, but claude command not found at ${I.executable}`,userActionRequired:!0,type:"error"});else if(!M)try{let U=await $D.readlink(I.executable),X=B9.resolve(B9.dirname(I.executable),U);if(!m3.existsSync(X))D.push({message:`Claude symlink points to non-existent file: ${U}`,userActionRequired:!0,type:"error"});else if(!await Js(X))D.push({message:`Claude symlink points to invalid binary: ${U}`,userActionRequired:!0,type:"error"})}catch{if(!await Js(I.executable))D.push({message:`${I.executable} exists but is not a valid Claude binary`,userActionRequired:!0,type:"error"})}else if(!await Js(I.executable))D.push({message:`${I.executable} exists but is not a valid Claude binary`,userActionRequired:!0,type:"error"});if(!(process.env.PATH||"").split(B9.delimiter).some((U)=>{try{let X=B9.resolve(U);if(M)return X.toLowerCase()===f.toLowerCase();return X===f}catch{return!1}}))if(M){let U=B.replace(/\//g,"\\");D.push({message:`Native installation exists but ${U} is not in your PATH. Add it by opening: System Properties \u2192 Environment Variables \u2192 Edit User PATH \u2192 New \u2192 Add the path above. Then restart your terminal.`,userActionRequired:!0,type:"path"})}else{let U=UVH(),J=Gs()[U],F=J?J.replace(ljA.homedir(),"~"):"your shell config file";D.push({message:`Native installation exists but ~/.local/bin is not in your PATH. Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${F} && source ${F}`,userActionRequired:!0,type:"path"})}return D}async function fd(H,$=!1){let A=await vjA(H),L=await sF1(H,$);if(!L.success)return{latestVersion:null,wasUpdated:!1,lockFailed:L.lockFailed,lockHolderPid:L.lockHolderPid};if(A||L.success){if(M$().installMethod!=="native")AA((D)=>({...D,installMethod:"native",autoUpdates:!1,autoUpdatesProtectedForNative:!0})),N('Native installer: Set installMethod to "native" and disabled legacy auto-updater for protection')}return ugH(),{latestVersion:A,wasUpdated:L.success,lockFailed:!1}}async function $K1(H){try{if(m3.existsSync(H)){let $=await $D.readlink(H),A=B9.resolve(B9.dirname(H),$);if(m3.existsSync(A)&&await Js(A))return A}}catch{}return null}function njA(H,$){let A=B9.basename($);return B9.join(H.locks,`${A}.lock`)}async function rjA(){let H=Fs();if(!process.execPath.includes(H.versions))return;try{let $=B9.resolve(process.execPath),A=njA(H,$);if(await $D.mkdir(H.locks,{recursive:!0}),!m3.existsSync($)){N(`Cannot lock current version - file does not exist: ${$}`,{level:"info"});return}if(V1H()){if(!await yRD($,A)){c("tengu_version_lock_failed",{is_pid_based:!0,is_lifetime_lock:!0}),fq$($,Error("Lock already held by another process"));return}c("tengu_version_lock_acquired",{is_pid_based:!0,is_lifetime_lock:!0}),N(`Acquired PID lock on running version: ${$}`)}else{let L;try{L=await Eq$.default.lock($,{stale:ijA,retries:0,lockfilePath:A,onCompromised:(I)=>{N(`NON-FATAL: Lock on running version was compromised: ${I.message}`,{level:"info"})}}),c("tengu_version_lock_acquired",{is_pid_based:!1,is_lifetime_lock:!0}),N(`Acquired mtime-based lock on running version: ${$}`),PB(async()=>{try{await L?.()}catch{}})}catch(I){c("tengu_version_lock_failed",{is_pid_based:!1,is_lifetime_lock:!0}),fq$($,I);return}}}catch($){N(`NON-FATAL: Failed to lock current version during execution ${$ instanceof Error?$.message:String($)}`,{level:"info"})}}function fq$(H,$){let A=`NON-FATAL: Lock acquisition failed for ${H} (expected in multi-process scenarios)`,L=$ instanceof Error?Error(A,{cause:$}):Error(`${A}: ${$}`);r(L)}async function ugH(){await Promise.resolve();let H=Fs();if(Bd().startsWith("win32"))try{let A=B9.dirname(H.executable);if(m3.existsSync(A)){let I=(await $D.readdir(A)).filter((B)=>B.startsWith("claude.exe.old.")&&B.match(/claude\.exe\.old\.\d+$/)),D=0;for(let B of I)try{let f=B9.join(A,B);await $D.unlink(f),D++}catch{}if(D>0)N(`Cleaned up ${D} old Windows executables on startup`)}}catch(A){N(`Failed to clean up old Windows executables: ${A}`)}if(m3.existsSync(H.staging))try{let A=await $D.readdir(H.staging),L=Date.now()-3600000,I=0;for(let D of A){let B=B9.join(H.staging,D);try{if((await $D.stat(B)).mtime.getTime()0)N(`Cleaned up ${I} orphaned staging directories`),c("tengu_native_staging_cleanup",{cleaned_count:I})}catch(A){N(`Failed to clean up staging directories: ${A}`)}if(m3.existsSync(H.versions))try{let A=await $D.readdir(H.versions),L=Date.now()-3600000,I=0;for(let D of A)if(D.match(/\.tmp\.\d+\.\d+$/)){let B=B9.join(H.versions,D);try{if((await $D.stat(B)).mtime.getTime()0)N(`Cleaned up ${I} orphaned temp install files`),c("tengu_native_temp_files_cleanup",{cleaned_count:I})}catch(A){N(`Failed to clean up temp install files: ${A}`)}if(V1H()&&m3.existsSync(H.locks)){let A=Bq$(H.locks);if(A>0)N(`Cleaned up ${A} stale version locks`),c("tengu_native_stale_locks_cleanup",{cleaned_count:A})}if(!m3.existsSync(H.versions))return;try{let A=await $D.readdir(H.versions),L=[];for(let J of A){let F=B9.join(H.versions,J);try{let Q=await $D.stat(F);if(Q.isFile()&&(Q.size===0||await Js(F)))L.push(J)}catch{}}let I=process.execPath,D=I&&I.includes(H.versions)?B9.resolve(I):null,B=new Set([...D?[D]:[]]),f=await $K1(H.executable);if(f)B.add(f);for(let J of L){let F=B9.resolve(H.versions,J);if(B.has(F))continue;let Q=njA(H,F),W=!1;if(V1H())W=Dq$(Q);else try{W=await Eq$.default.check(F,{stale:ijA,lockfilePath:Q})}catch{W=!1}if(W)B.add(F),N(`Protecting locked version from cleanup: ${J}`)}let E=[];for(let J of L){let F=B9.resolve(H.versions,J);if(B.has(F))continue;try{let Q=await $D.stat(F);E.push({name:J,path:F,mtime:Q.mtime})}catch{}}E.sort((J,F)=>F.mtime.getTime()-J.mtime.getTime());let M=E.slice(cjA);if(M.length===0){c("tengu_native_version_cleanup",{total_count:L.length,deleted_count:0,protected_count:B.size,retained_count:cjA,lock_failed_count:0,error_count:0});return}let G=0,U=0,X=0;await Promise.all(M.map(async(J)=>{try{if(await nF1(J.path,async()=>{await $D.unlink(J.path)}))G++;else U++,N(`Skipping deletion of ${J.name} - locked by another process`)}catch(F){X++,r(Error(`Failed to delete version ${J.name}: ${F}`))}})),c("tengu_native_version_cleanup",{total_count:L.length,deleted_count:G,protected_count:B.size,retained_count:cjA,lock_failed_count:U,error_count:X})}catch(A){r(Error(`Version cleanup failed: ${A}`))}}async function AK1(H){let $=H;if((await $D.lstat(H)).isSymbolicLink())$=await $D.realpath(H);return $.endsWith(".js")||$.includes("node_modules")}async function ggH(){let H=Fs();try{if(!m3.existsSync(H.executable))return;if(await AK1(H.executable)){N(`Skipping removal of ${H.executable} - appears to be npm-managed`);return}await $D.unlink(H.executable),N(`Removed claude symlink at ${H.executable}`)}catch($){r(Error(`Failed to remove claude symlink: ${$}`))}}function mgH(){let H=[],$=Gs();for(let[A,L]of Object.entries($))try{let I=ygH(L);if(!I)continue;let{filtered:D,hadAlias:B}=nZ$(I);if(B)rZ$(L,D),H.push({message:`Removed claude alias from ${L}. Run: unalias claude`,userActionRequired:!0,type:"alias"}),N(`Cleaned up claude alias from ${A} config`)}catch(I){r(I instanceof Error?I:Error(String(I))),H.push({message:`Failed to clean up ${L}: ${I}`,userActionRequired:!1,type:"error"})}return H}async function LK1(H){try{let $=await pD("npm",["config","get","prefix"]);if($.code!==0||!$.stdout)return{success:!1,error:"Failed to get npm global prefix"};let A=$.stdout.trim(),L=!1;async function I(D,B){try{return await $D.stat(D),await $D.unlink(D),N(`Manually removed ${B}: ${D}`),!0}catch{return!1}}if(Bd()==="windows"){let D=B9.join(A,"claude.cmd"),B=B9.join(A,"claude.ps1"),f=B9.join(A,"claude");if(await I(D,"bin script"))L=!0;if(await I(B,"PowerShell script"))L=!0;if(await I(f,"bin executable"))L=!0}else{let D=B9.join(A,"bin","claude");if(await I(D,"bin symlink"))L=!0}if(L){N(`Successfully removed ${H} manually`);let D=Bd()==="windows"?B9.join(A,"node_modules",H):B9.join(A,"lib","node_modules",H);return{success:!0,warning:`${H} executables removed, but node_modules directory was left intact for safety. You may manually delete it later at: ${D}`}}else return{success:!1}}catch($){return N(`Manual removal failed: ${$}`,{level:"error"}),{success:!1,error:`Manual removal failed: ${$}`}}}async function hRD(H){let{code:$,stderr:A}=await pD("npm",["uninstall","-g",H],{cwd:process.cwd()});if($===0)return N(`Removed global npm installation of ${H}`),{success:!0};else if(A&&!A.includes("npm ERR! code E404")){if(A.includes("npm error code ENOTEMPTY")){N(`Failed to uninstall global npm package ${H}: ${A}`,{level:"error"}),N("Attempting manual removal due to ENOTEMPTY error");let L=await LK1(H);if(L.success)return{success:!0,warning:L.warning};else if(L.error)return{success:!1,error:`Failed to remove global npm installation of ${H}: ${A}. Manual removal also failed: ${L.error}`}}return N(`Failed to uninstall global npm package ${H}: ${A}`,{level:"error"}),{success:!1,error:`Failed to remove global npm installation of ${H}: ${A}`}}return{success:!1}}async function pgH(){let H=[],$=[],A=0,L=await hRD("@anthropic-ai/claude-code");if(L.success){if(A++,L.warning)$.push(L.warning)}else if(L.error)H.push(L.error);if({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL!=="@anthropic-ai/claude-code"){let D=await hRD({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL);if(D.success){if(A++,D.warning)$.push(D.warning)}else if(D.error)H.push(D.error)}let I=B9.join(ljA.homedir(),".claude","local");if(m3.existsSync(I))try{await $D.rm(I,{recursive:!0,force:!0}),A++,N(`Removed local installation at ${I}`)}catch(D){H.push(`Failed to remove ${I}: ${D}`),N(`Failed to remove local installation: ${D}`,{level:"error"})}return{removed:A,errors:H,warnings:$}}var B9,ljA,Eq$,m3,$D,cjA=2,ijA=604800000;var hjA=K(()=>{Z1();Ma();B0();_$();ZE();z$();E$();SjA();vA();aZ$();F1H();Us();SRD();Ib();NA();djA();B9=require("path"),ljA=require("os"),Eq$=b(zk(),1),m3=require("fs"),$D=require("fs/promises")});var Lj=K(()=>{hjA()});function Ed(){let H=ZAH(),A=["user","project","local"].flatMap((L)=>OJ(L).errors);return{settings:H.settings,errors:[...H.errors,...A]}}var dgH=K(()=>{mL();T3()});function gRD(){return[]}function mRD(H,$=null,A){let L=H?.find((I)=>I.name==="ide");if($){let I=PX($.ideType),D=Wx($.ideType)?"plugin":"extension";if($.error)return[{label:"IDE",value:P1H.createElement(V,null,ZL("error",A)(pH.cross)," Error installing ",I," ",D,": ",$.error,` `,"Please restart your IDE and try again.")}];if($.installed)if(L&&L.type==="connected")if($.installedVersion!==L.serverInfo?.version)return[{label:"IDE",value:`Connected to ${I} ${D} version ${$.installedVersion} (server version: ${L.serverInfo?.version})`}];else return[{label:"IDE",value:`Connected to ${I} ${D} version ${$.installedVersion}`}];else return[{label:"IDE",value:`Installed ${I} ${D}`}]}else if(L){let I=NKA(L)??"IDE";if(L.type==="connected")return[{label:"IDE",value:`Connected to ${I} extension`}];else return[{label:"IDE",value:`${ZL("error",A)(pH.cross)} Not connected to ${I}`}]}return[]}function pRD(H=[],$){let A=H.filter((L)=>L.name!=="ide");if(!A.length)return[];return[{label:"MCP servers",value:P1H.createElement(x,{flexDirection:"row",flexWrap:"wrap",columnGap:1,flexShrink:99},A.map((L,I)=>{let D="";if(L.type==="connected")D=ZL("success",$)(pH.tick);else if(L.type==="pending")D=ZL("inactive",$)(pH.radioOff);else if(L.type==="needs-auth")D=ZL("warning",$)(pH.triangleUpOutline);else if(L.type==="failed")D=ZL("error",$)(pH.cross);else D=ZL("error",$)(pH.cross);let B=I{let I=V9(L.path);A.push(`Large ${I} will impact performance (${a0(L.content.length)} chars > ${a0(Cm)})`)}),$&&$.content.length>HQH)A.push(`CLAUDE.md entries marked as IMPORTANT exceed ${a0(HQH)} characters (${a0($.content.length)} chars)`);return A}function cRD(){return[{label:"Setting sources",value:Pl().filter((L)=>{let I=ZI(L);return I!==null&&Object.keys(I).length>0}).map((L)=>{if(L==="policySettings"){let I=QmL();if(I===null)return null;return I==="remote"?"Enterprise managed settings (remote)":"Enterprise managed settings (local)"}return rDL(L)}).filter((L)=>L!==null)}]}async function lRD(){return(await Db()).map(($)=>$.message)}async function iRD(){let H=await W1H(),$=[],{errors:A}=Ed();if(A.length>0){let I=Array.from(new Set(A.map((D)=>D.file))).join(", ");$.push(`Found invalid settings files: ${I}. They will be ignored.`)}if(H.warnings.forEach((L)=>{$.push(L.issue)}),H.hasUpdatePermissions===!1)$.push("No write permissions for auto-updates (requires sudo)");return $}function nRD(){let H=RD$();if(!H)return[];let $=[];if(H.subscription)$.push({label:"Login method",value:`${H.subscription} Account`});if(H.tokenSource)$.push({label:"Auth token",value:H.tokenSource});if(H.apiKeySource)$.push({label:"API key",value:H.apiKeySource});if(H.organization&&!process.env.IS_DEMO)$.push({label:"Organization",value:H.organization});if(H.email&&!process.env.IS_DEMO)$.push({label:"Email",value:H.email});return $}function rRD(){let H=sI(),$=[];if(H!=="firstParty"){let I={bedrock:"AWS Bedrock",vertex:"Google Vertex AI",foundry:"Microsoft Foundry"}[H];$.push({label:"API provider",value:I})}if(H==="firstParty"){let I=process.env.ANTHROPIC_BASE_URL;if(I)$.push({label:"Anthropic base URL",value:I})}else if(H==="bedrock"){let I=process.env.BEDROCK_BASE_URL;if(I)$.push({label:"Bedrock base URL",value:I});if($.push({label:"AWS region",value:NHH()}),A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH))$.push({value:"AWS auth skipped"})}else if(H==="vertex"){let I=process.env.VERTEX_BASE_URL;if(I)$.push({label:"Vertex base URL",value:I});let D=process.env.ANTHROPIC_VERTEX_PROJECT_ID;if(D)$.push({label:"GCP project",value:D});if($.push({label:"Default region",value:wN()}),A$(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH))$.push({value:"GCP auth skipped"})}else if(H==="foundry"){let I=process.env.ANTHROPIC_FOUNDRY_BASE_URL;if(I)$.push({label:"Microsoft Foundry base URL",value:I});let D=process.env.ANTHROPIC_FOUNDRY_RESOURCE;if(D)$.push({label:"Microsoft Foundry resource",value:D});if(A$(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH))$.push({value:"Microsoft Foundry auth skipped"})}let A=Ku();if(A)$.push({label:"Proxy",value:A});let L=sN();if(process.env.NODE_EXTRA_CA_CERTS)$.push({label:"Additional CA cert(s)",value:process.env.NODE_EXTRA_CA_CERTS});if(L){if(L.cert&&process.env.CLAUDE_CODE_CLIENT_CERT)$.push({label:"mTLS client cert",value:process.env.CLAUDE_CODE_CLIENT_CERT});if(L.key&&process.env.CLAUDE_CODE_CLIENT_KEY)$.push({label:"mTLS client key",value:process.env.CLAUDE_CODE_CLIENT_KEY})}return $}function aRD(H){let $=_O(H);if(H===null&&nL()){let A=x9$();if(Wq())$=`${oH.bold("Default")} ${A}`;else $=`${oH.bold("Sonnet")} ${A}`}return $}var P1H;var oRD=K(()=>{xH();Lj();EI();nU();mQ();Q9();rD();oM();aI();r0();Ib();NA();nR();H4H();mL();dgH();EM();jI();EI();W4();P1H=b(s(),1)});function IK1(){let H=j$(),A=qvH(H)??Q1.createElement(V,{dimColor:!0},"/rename to add a name");return[{label:"Version",value:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION},{label:"Session name",value:A},{label:"Session ID",value:H},{label:"cwd",value:C$()},...nRD(),...rRD()]}function DK1({mainLoopModel:H,mcp:$,theme:A,context:L}){return[{label:"Model",value:aRD(H)},...mRD($.clients,L.options.ideInstallationStatus,A),...pRD($.clients,A),{label:"Memory",value:Q1.createElement(ERD,{context:L,flat:!0})},...gRD(),...cRD()]}async function BK1(){return[...await lRD(),...await iRD(),...dRD()]}function fK1({value:H}){if(Array.isArray(H))return Q1.createElement(x,{flexWrap:"wrap",columnGap:1,flexShrink:99},H.map(($,A)=>{return Q1.createElement(V,{key:A},$,AE.mainLoopModel),A=J$((E)=>E.mcp),[L,I]=Q1.useState([]),[D,B]=Q1.useState([]),[f]=_I();return Q1.useEffect(()=>{async function E(){let M=[IK1(),DK1({mainLoopModel:$,mcp:A,theme:f,context:H})],G=await BK1();I(M),B(G)}E()},[$,A,f,H]),Q1.createElement(x,{flexDirection:"column"},Q1.createElement(x,{flexDirection:"column",gap:1,marginTop:1},L.map((E,M)=>E.length>0&&Q1.createElement(x,{key:M,flexDirection:"column"},E.map(({label:G,value:U},X)=>Q1.createElement(x,{key:X,flexDirection:"row",gap:1,flexShrink:0},G!==void 0&&Q1.createElement(V,{bold:!0},G,":"),Q1.createElement(fK1,{value:U}))))),D.length>0&&Q1.createElement(x,{flexDirection:"column",paddingBottom:1},Q1.createElement(V,{bold:!0},"System Diagnostics"),D.map((E,M)=>Q1.createElement(x,{key:M,flexDirection:"row",gap:1,paddingX:1},Q1.createElement(V,{color:"error"},pH.warning),typeof E==="string"?Q1.createElement(V,{wrap:"wrap"},E):E)))),Q1.createElement(V,{dimColor:!0},Q1.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))}var Q1;var sRD=K(()=>{xH();jI();pL();g$();MRD();oRD();PI();rB();j0();Q1=b(s(),1)});function QVH({onThemeSelect:H,showIntroText:$=!1,helpText:A="",showHelpTextBelow:L=!1,hideEscToCancel:I=!1,skipExitHandling:D=!1,onCancel:B}){let[f]=_I(),{columns:E}=QL(),M=iqA(),G=M===null?a6D(f):null,{setPreviewTheme:U,savePreview:X,cancelPreview:J}=v0A(),F=J$((Z)=>Z.settings.syntaxHighlightingDisabled)??!1,Q=zI();D8$("ThemePicker");let W=C0("theme:toggleSyntaxHighlighting","ThemePicker","ctrl+t");BA("theme:toggleSyntaxHighlighting",()=>{if(M===null){let Z=!F;II("userSettings",{syntaxHighlightingDisabled:Z}),Q((q)=>({...q,settings:{...q.settings,syntaxHighlightingDisabled:Z}}))}},{context:"ThemePicker"});let P=zB(D?()=>{}:void 0),Y=P0.createElement(x,{flexDirection:"column",gap:1},P0.createElement(x,{flexDirection:"column",gap:1,marginX:1},$?P0.createElement(V,null,"Let's get started."):P0.createElement(V,{bold:!0,color:"permission"},"Theme"),P0.createElement(x,{flexDirection:"column"},P0.createElement(V,{bold:!0},"Choose the text style that looks best with your terminal"),A&&!L&&P0.createElement(V,{dimColor:!0},A)),P0.createElement(QA,{options:[{label:"Dark mode",value:"dark"},{label:"Light mode",value:"light"},{label:"Dark mode (colorblind-friendly)",value:"dark-daltonized"},{label:"Light mode (colorblind-friendly)",value:"light-daltonized"},{label:"Dark mode (ANSI colors only)",value:"dark-ansi"},{label:"Light mode (ANSI colors only)",value:"light-ansi"}],onFocus:(Z)=>{U(Z)},onChange:(Z)=>{X(),H(Z)},onCancel:D?()=>{J(),B?.()}:async()=>{J(),await w0(0)},visibleOptionCount:6,defaultValue:f,defaultFocusValue:f})),P0.createElement(x,{flexDirection:"column",width:"100%"},P0.createElement(x,{flexDirection:"column",borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:"dashed",borderColor:"subtle",borderDimColor:!0},P0.createElement(LC,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[" function greet() {",'- console.log("Hello, World!");','+ console.log("Hello, Claude!");'," }"]},dim:!1,filePath:"demo.js",firstLine:null,width:E})),P0.createElement(V,{dimColor:!0}," ",M==="env"?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:M==="build"?"Syntax highlighting available only in native build":F?`Syntax highlighting disabled (${W} to enable)`:G?`Syntax theme: ${G.theme}${G.source?` (from ${G.source})`:""} (${W} to disable)`:`Syntax highlighting enabled (${W} to disable)`)));if(!$)return P0.createElement(P0.Fragment,null,P0.createElement(x,{flexDirection:"column"},Y),P0.createElement(x,{marginX:1,marginTop:1},L&&A&&P0.createElement(x,{marginLeft:3},P0.createElement(V,{dimColor:!0},A)),!I&&P0.createElement(x,null,P0.createElement(V,{dimColor:!0,italic:!0},P.pending?P0.createElement(P0.Fragment,null,"Press ",P.keyName," again to exit"):P0.createElement(rA,null,P0.createElement(s$,{shortcut:"Enter",action:"select"}),P0.createElement(s$,{shortcut:"Esc",action:"cancel"}))))));return Y}var P0;var Mq$=K(()=>{xH();l8();Zt();UM();UU();xH();OB();lB();eB();Z9H();mL();pL();$I();FG();iu();P0=b(s(),1)});function Ks(){return NL("tengu_workout2",!1)}function cgH(H){return H.toLowerCase().includes("opus-4-6")}function eRD(H){if(H===void 0||H===null||H==="")return;let $=typeof H==="number"?H:parseInt(String(H),10);if(!isNaN($)&&MK1($))return $;if(typeof H==="string"&&EK1.includes(H))return H;return}function HyD(){let H=GB();return eRD(H.effortLevel)}function $yD(){return eRD(process.env.CLAUDE_CODE_EFFORT_LEVEL)}function MK1(H){return Number.isInteger(H)}function AyD(H){if(typeof H==="string")return H;return"high"}var EK1;var Gq$=K(()=>{SD();mL();EK1=["low","medium","high","max"]});function WVH({initial:H,sessionModel:$,onSelect:A,onCancel:L,isStandaloneCommand:I,showPenguinsNotice:D}){let B=zI(),f=H===null?Uq$:H,E=10,M=zB(),G=J$((k)=>cD()?k.fastMode:!1),U=J$((k)=>k.effortValue),X=KC.useRef(U!==void 0?AyD(U):"high"),[J,F]=KC.useState(X.current),[Q,W]=KC.useState(!1),[P,C]=KC.useState(f),Y=KC.useMemo(()=>fLH(G??!1),[G]),Z=KC.useMemo(()=>{if(H!==null&&!Y.some((k)=>k.value===H))return[...Y,{value:H,label:_O(H),description:"Current model"}];return Y},[Y,H]),q=KC.useMemo(()=>Z.map((k)=>({...k,value:k.value===null?Uq$:k.value})),[Z]),O=KC.useMemo(()=>q.some((k)=>k.value===f)?f:q[0]?.value??void 0,[q,f]),j=Math.min(10,q.length),u=Math.max(0,q.length-j),y=q.find((k)=>k.value===P)?.label,g=Ks()&&LyD(P),h=KC.useCallback(()=>{if(g)F((k)=>ByD(k,"left")),W(!0)},[g]),p=KC.useCallback(()=>{if(g)F((k)=>ByD(k,"right")),W(!0)},[g]);bI({"modelPicker:decreaseEffort":h,"modelPicker:increaseEffort":p},{context:"ModelPicker",isActive:Ks()});function d(k){if(Ks()){c("tengu_model_command_menu_effort",{effort:J});let GH=J==="high"?void 0:J;II("userSettings",{effortLevel:GH}),B((HH)=>({...HH,effortValue:GH}))}if(k===Uq$){A(null,void 0);return}let n=Ks()&&Q&&LyD(k)?J:void 0;A(k,n)}return cI.createElement(x,{flexDirection:"column",width:"100%"},I&&cI.createElement(Uf,{dividerColor:"permission",dividerDimColor:!1}),cI.createElement(x,{flexDirection:"column",paddingX:I?1:0},cI.createElement(x,{flexDirection:"column"},cI.createElement(x,{marginBottom:1,flexDirection:"column"},cI.createElement(V,{color:"remember",bold:!0},"Select model"),cI.createElement(V,{dimColor:!0},"Switch between Claude models. Applies to this session and future Claude Code sessions. For other/previous model names, specify with --model."),$&&cI.createElement(V,{dimColor:!0},"Currently using ",_O($)," for this session (set by plan mode). Selecting a model will undo this.")),cI.createElement(x,{flexDirection:"column",marginBottom:1},cI.createElement(x,{flexDirection:"column"},cI.createElement(QA,{defaultValue:f,defaultFocusValue:O,options:q,onChange:d,onFocus:C,onCancel:L??(()=>{}),visibleOptionCount:j})),u>0&&cI.createElement(x,{paddingLeft:3},cI.createElement(V,{dimColor:!0},"and ",u," more\u2026"))),Ks()&&cI.createElement(x,{marginBottom:1,flexDirection:"column"},g?cI.createElement(V,{dimColor:!0},cI.createElement(IyD,{effort:J})," ",Fk(J)," ","effort",J==="high"?" (default)":""," ",cI.createElement(V,{color:"subtle"},"\u2190 \u2192 to adjust")):cI.createElement(V,{color:"subtle"},cI.createElement(IyD,{effort:void 0})," Effort not supported",y?` for ${y}`:"")),cD()?D?cI.createElement(x,{marginBottom:1},cI.createElement(V,{dimColor:!0},"Fast mode is ",cI.createElement(V,{bold:!0},"ON")," and available with"," ",VO," only (/fast). Switching to other models turn off fast mode.",cI.createElement(DyD,null))):Z4()&&!zq()?cI.createElement(x,{marginBottom:1},cI.createElement(V,{dimColor:!0},"Use ",cI.createElement(V,{bold:!0},"/fast")," to turn on Fast mode (",VO," only).",cI.createElement(DyD,null))):null:null),I&&cI.createElement(V,{dimColor:!0,italic:!0},M.pending?cI.createElement(cI.Fragment,null,"Press ",M.keyName," again to exit"):cI.createElement(rA,null,cI.createElement(s$,{shortcut:"Enter",action:"confirm"}),cI.createElement(VA,{action:"select:cancel",context:"Select",fallback:"Esc",description:"exit"})))))}function LyD(H){if(!H)return!1;if(H===Uq$)return cgH(xq());return cgH(m8(H))}function IyD({effort:H}){let $=["low","medium","high"],A=H?$.indexOf(H)+1:0;return cI.createElement(cI.Fragment,null,$.map((L,I)=>cI.createElement(V,{key:I,color:I{xH();$I();eYH();aI();Gq$();mL();pL();l8();UM();e6();lB();j0();eB();z$();AJ();cI=b(s(),1),KC=b(s(),1)});function Jq$({onDone:H,isStandaloneDialog:$,externalIncludes:A}){Bb.default.useEffect(()=>{c("tengu_claude_md_includes_dialog_shown",{})},[]);let L=ajA.useCallback((D)=>{if(D==="no")c("tengu_claude_md_external_includes_dialog_declined",{}),MM((B)=>({...B,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!0}));else c("tengu_claude_md_external_includes_dialog_accepted",{}),MM((B)=>({...B,hasClaudeMdExternalIncludesApproved:!0,hasClaudeMdExternalIncludesWarningShown:!0}));H()},[H]),I=ajA.useCallback(()=>{L("no")},[L]);return Bb.default.createElement(BL,{title:"Allow external CLAUDE.md file imports?",color:"warning",onCancel:I,hideBorder:!$,hideInputGuide:!$},Bb.default.createElement(V,null,"This project's CLAUDE.md imports files outside the current working directory. Never allow this for third-party repositories."),A&&A.length>0&&Bb.default.createElement(x,{flexDirection:"column"},Bb.default.createElement(V,{dimColor:!0},"External imports:"),A.map((D,B)=>Bb.default.createElement(V,{key:B,dimColor:!0}," ",D.path))),Bb.default.createElement(V,{dimColor:!0},"Important: Only use Claude Code with files you trust. Accessing untrusted files may pose security risks"," ",Bb.default.createElement(dI,{url:"https://code.claude.com/docs/en/security"})," "),Bb.default.createElement(QA,{options:[{label:"Yes, allow external imports",value:"yes"},{label:"No, disable external imports",value:"no"}],onChange:(D)=>L(D)}))}var Bb,ajA;var ojA=K(()=>{xH();l8();vA();z$();xH();bB();Bb=b(s(),1),ajA=b(s(),1)});function fyD({currentVersion:H,onChoice:$}){function A(I){$(I)}function L(){$("cancel")}return lgH.default.createElement(BL,{title:"Switch to Stable Channel",onCancel:L,color:"permission",hideBorder:!0,hideInputGuide:!0},lgH.default.createElement(V,null,"The stable channel may have an older version than what you're currently running (",H,")."),lgH.default.createElement(V,{dimColor:!0},"How would you like to handle this?"),lgH.default.createElement(QA,{options:[{label:"Allow possible downgrade to stable version",value:"downgrade"},{label:`Stay on current version (${H}) until stable catches up`,value:"stay"}],onChange:A}))}var lgH;var EyD=K(()=>{xH();l8();bB();lgH=b(s(),1)});function MyD(H){return Object.entries(H).map(([$,A])=>({label:A?.name??GK1,value:$,description:A?.description??UK1}))}function Fq$({initialStyle:H,onComplete:$,onCancel:A,isStandaloneCommand:L}){let[I,D]=_1H.useState([]),[B,f]=_1H.useState(!0);_1H.useEffect(()=>{Y1H(C$()).then((M)=>{let G=MyD(M);D(G),f(!1)}).catch(()=>{let M=MyD(V9H);D(M),f(!1)})},[]);let E=_1H.useCallback((M)=>{$(M)},[$]);return tw.createElement(BL,{title:"Preferred output style",onCancel:A,borderDimColor:!0,hideInputGuide:!L,hideBorder:!L},tw.createElement(x,{flexDirection:"column",gap:1},tw.createElement(x,{marginTop:1},tw.createElement(V,{dimColor:!0},"This changes how Claude Code communicates with you")),B?tw.createElement(V,{dimColor:!0},"Loading output styles\u2026"):tw.createElement(QA,{options:I,onChange:E,visibleOptionCount:10,defaultValue:H})))}var tw,_1H,GK1="Default",UK1="Claude completes coding tasks efficiently and provides concise responses";var tjA=K(()=>{xH();N1();jh();PI();bB();tw=b(s(),1),_1H=b(s(),1)});function GyD({initialLanguage:H,onComplete:$,onCancel:A}){let[L,I]=sjA.useState(H),[D,B]=sjA.useState((H??"").length);BA("confirm:no",A,{context:"Settings"});function f(){let E=L?.trim();$(E||void 0)}return C1H.default.createElement(x,{flexDirection:"column",gap:1},C1H.default.createElement(V,null,"Enter your preferred response language:"),C1H.default.createElement(x,{flexDirection:"row",gap:1},C1H.default.createElement(V,null,pH.pointer),C1H.default.createElement(W9,{value:L??"",onChange:I,onSubmit:f,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, \u65E5\u672C\u8A9E, Espa\xF1ol${pH.ellipsis}`,columns:60,cursorOffset:D,onChangeCursorOffset:B})),C1H.default.createElement(V,{dimColor:!0},"Leave empty for default (English)"))}var C1H,sjA;var UyD=K(()=>{xH();S5();jI();$I();C1H=b(s(),1),sjA=b(s(),1)});function fb({query:H,placeholder:$="Search\u2026",isFocused:A,isTerminalFocused:L,prefix:I="\u2315",width:D,cursorOffset:B}){let f=B??H.length;return fW.default.createElement(x,{flexShrink:0,borderStyle:"round",borderColor:A?"suggestion":void 0,borderDimColor:!A,paddingX:1,width:D},fW.default.createElement(V,{dimColor:!A},I," ",A?fW.default.createElement(fW.default.Fragment,null,H?L?fW.default.createElement(fW.default.Fragment,null,fW.default.createElement(V,null,H.slice(0,f)),fW.default.createElement(V,{inverse:!0},f{xH();fW=b(s(),1)});function XK1(H,$){if(H.ctrl&&($==="k"||$==="u"||$==="w"))return!0;if(H.meta&&H.backspace)return!0;return!1}function JK1(H,$){return(H.ctrl||H.meta)&&$==="y"}function Eb({isActive:H,onExit:$,onExitUp:A,columns:L,passthroughCtrlKeys:I=[],initialQuery:D=""}){let{columns:B}=QL(),f=L??B,[E,M]=igH.useState(D),[G,U]=igH.useState(D.length),X=igH.useCallback((J)=>{M(J),U(J.length)},[]);return WL((J,F)=>{let Q=o0.fromText(E,f,G);if(F.ctrl&&I.includes(J.toLowerCase()))return;if(!XK1(F,J))zSH();if(!JK1(F,J))NSH();if(F.return||F.downArrow){$();return}if(F.upArrow){if(A)A();return}if(F.escape){if(E.length>0)M(""),U(0);else $();return}if(F.backspace){if(F.meta){let{cursor:P,killed:C}=Q.deleteWordBefore();bg(C,"prepend"),M(P.text),U(P.offset);return}if(E.length===0){$();return}let W=Q.backspace();M(W.text),U(W.offset);return}if(F.delete){let W=Q.del();M(W.text),U(W.offset);return}if(F.leftArrow&&(F.ctrl||F.meta||F.fn)){let W=Q.prevWord();U(W.offset);return}if(F.rightArrow&&(F.ctrl||F.meta||F.fn)){let W=Q.nextWord();U(W.offset);return}if(F.leftArrow){let W=Q.left();U(W.offset);return}if(F.rightArrow){let W=Q.right();U(W.offset);return}if(F.home){U(0);return}if(F.end){U(E.length);return}if(F.ctrl){switch(J.toLowerCase()){case"a":U(0);return;case"e":U(E.length);return;case"b":U(Q.left().offset);return;case"f":U(Q.right().offset);return;case"d":{let W=Q.del();M(W.text),U(W.offset);return}case"h":{if(E.length===0){$();return}let W=Q.backspace();M(W.text),U(W.offset);return}case"k":{let{cursor:W,killed:P}=Q.deleteToLineEnd();bg(P,"append"),M(W.text),U(W.offset);return}case"u":{let{cursor:W,killed:P}=Q.deleteToLineStart();bg(P,"prepend"),M(W.text),U(W.offset);return}case"w":{let{cursor:W,killed:P}=Q.deleteWordBefore();bg(P,"prepend"),M(W.text),U(W.offset);return}case"y":{let W=rU$();if(W.length>0){let P=Q.offset,C=Q.insert(W);aU$(P,W.length),M(C.text),U(C.offset)}return}}return}if(F.meta){switch(J.toLowerCase()){case"b":U(Q.prevWord().offset);return;case"f":U(Q.nextWord().offset);return;case"d":{let W=Q.deleteWordAfter();M(W.text),U(W.offset);return}case"y":{let W=oU$();if(W){let{text:P,start:C,length:Y}=W,Z=E.slice(0,C),q=E.slice(C+Y),O=Z+P+q,j=C+P.length;tU$(P.length),M(O),U(j)}return}}return}if(F.tab)return;if(J){let W=Q.insert(J);M(W.text),U(W.offset)}},{isActive:H}),{query:E,setQuery:X,cursorOffset:G}}var igH;var PVH=K(()=>{xH();eJH();OB();igH=b(s(),1)});function XyD({onClose:H,context:$,setTabsHidden:A,setIsWarning:L,setHideMargin:I,onSearchModeChange:D}){let[B,f]=_I(),[E,M]=pP.useState(M$()),[G,U]=pP.useState(exD()),X=p$.useRef(M$()),[J,F]=pP.useState(GB()),Q=p$.useRef(GB()),[W,P]=pP.useState(J?.outputStyle||HW),C=p$.useRef(W),[Y,Z]=pP.useState(J?.language),q=p$.useRef(Y),[O,j]=pP.useState(0),[u,y]=pP.useState(!0),g=pP.useCallback((PH)=>{y(PH),D?.(PH)},[D]),h=u,p=EJ(),d=J$((PH)=>PH.mainLoopModel),k=J$((PH)=>PH.verbose),n=J$((PH)=>PH.thinkingEnabled),GH=J$((PH)=>cD()?PH.fastMode:!1),HH=J$((PH)=>PH.promptSuggestionEnabled),BH=zI(),[WH,wH]=pP.useState({}),QH=p$.useRef(n),[TH,t]=pP.useState(!1),[IH,KH]=pP.useState(null),{query:MH,setQuery:CH,cursorOffset:OH}=Eb({isActive:h&&IH===null,onExit:()=>{g(!1)}}),LH=SX$($.options.mcpClients),e=!A$(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),DH=z7A(),EH=KVH();async function $H(PH){c("tengu_config_model_changed",{from_model:d,to_model:PH}),BH((vH)=>({...vH,mainLoopModel:PH})),wH((vH)=>{let tH=_O(PH);if("model"in vH){let{model:K$,...KA}=vH;return{...KA,model:tH}}return{...vH,model:tH}})}function FH(PH){AA((gH)=>({...gH,verbose:PH})),M({...M$(),verbose:PH}),BH((gH)=>({...gH,verbose:PH})),wH((gH)=>{if("verbose"in gH){let{verbose:vH,...tH}=gH;return tH}return{...gH,verbose:PH}})}let YH=[{id:"autoCompactEnabled",label:"Auto-compact",value:E.autoCompactEnabled,type:"boolean",onChange(PH){AA((gH)=>({...gH,autoCompactEnabled:PH})),M({...M$(),autoCompactEnabled:PH}),c("tengu_auto_compact_setting_changed",{enabled:PH})}},{id:"spinnerTipsEnabled",label:"Show tips",value:J?.spinnerTipsEnabled??!0,type:"boolean",onChange(PH){II("localSettings",{spinnerTipsEnabled:PH}),F((gH)=>({...gH,spinnerTipsEnabled:PH})),c("tengu_tips_setting_changed",{enabled:PH})}},{id:"prefersReducedMotion",label:"Reduce motion",value:J?.prefersReducedMotion??!1,type:"boolean",onChange(PH){II("localSettings",{prefersReducedMotion:PH}),F((gH)=>({...gH,prefersReducedMotion:PH})),c("tengu_reduce_motion_setting_changed",{enabled:PH})}},{id:"thinkingEnabled",label:"Thinking mode",value:n??!0,type:"boolean",onChange(PH){BH((gH)=>({...gH,thinkingEnabled:PH})),II("userSettings",{alwaysThinkingEnabled:PH?void 0:!1}),c("tengu_thinking_toggled",{enabled:PH})}},...cD()&&Z4()?[{id:"fastMode",label:`Fast mode (${VO} only)`,value:!!GH,type:"boolean",onChange(PH){if(eAH(),II("userSettings",{fastMode:PH?!0:void 0}),PH)BH((gH)=>({...gH,mainLoopModel:YzH,mainLoopModelForSession:null,fastMode:!0})),wH((gH)=>({...gH,model:YzH,"Fast mode":"ON"}));else BH((gH)=>({...gH,fastMode:!1})),wH((gH)=>({...gH,"Fast mode":"OFF"}))}}]:[],...NL("tengu_chomp_inflection",!0)?[{id:"promptSuggestionEnabled",label:"Prompt suggestions",value:HH,type:"boolean",onChange(PH){BH((gH)=>({...gH,promptSuggestionEnabled:PH})),II("userSettings",{promptSuggestionEnabled:PH?void 0:!1})}}]:[],...[],...e?[{id:"fileCheckpointingEnabled",label:"Rewind code (checkpoints)",value:E.fileCheckpointingEnabled,type:"boolean",onChange(PH){AA((gH)=>({...gH,fileCheckpointingEnabled:PH})),M({...M$(),fileCheckpointingEnabled:PH}),c("tengu_file_history_snapshots_setting_changed",{enabled:PH})}}]:[],{id:"verbose",label:"Verbose output",value:k,type:"boolean",onChange:FH},{id:"terminalProgressBarEnabled",label:"Terminal progress bar",value:E.terminalProgressBarEnabled,type:"boolean",onChange(PH){AA((gH)=>({...gH,terminalProgressBarEnabled:PH})),M({...M$(),terminalProgressBarEnabled:PH}),c("tengu_terminal_progress_bar_setting_changed",{enabled:PH})}},{id:"defaultPermissionMode",label:"Default permission mode",value:J?.permissions?.defaultMode||"default",options:(()=>{let PH=["default","plan"],gH=dL()?["bypassPermissions"]:["bypassPermissions","delegate"];return[...PH,...z$H.filter((vH)=>!PH.includes(vH)&&!gH.includes(vH))]})(),type:"enum",onChange(PH){let gH=N$H(hN(PH)),vH=II("userSettings",{permissions:{...J?.permissions,defaultMode:gH}});if(vH.error){r(vH.error);return}F((tH)=>({...tH,permissions:{...tH?.permissions,defaultMode:gH}})),wH((tH)=>({...tH,defaultPermissionMode:PH})),c("tengu_config_changed",{setting:"defaultPermissionMode",value:PH})}},{id:"respectGitignore",label:"Respect .gitignore in file picker",value:E.respectGitignore,type:"boolean",onChange(PH){AA((gH)=>({...gH,respectGitignore:PH})),M({...M$(),respectGitignore:PH}),c("tengu_respect_gitignore_setting_changed",{enabled:PH})}},EH?{id:"autoUpdatesChannel",label:"Auto-update channel",value:"disabled",type:"managedEnum",onChange(){}}:{id:"autoUpdatesChannel",label:"Auto-update channel",value:J?.autoUpdatesChannel??"latest",type:"managedEnum",onChange(){}},{id:"theme",label:"Theme",value:B,type:"managedEnum",onChange:f},{id:"notifChannel",label:"Notifications",value:E.preferredNotifChannel,options:["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"],type:"enum",onChange(PH){AA((gH)=>({...gH,preferredNotifChannel:PH})),M({...M$(),preferredNotifChannel:PH})}},{id:"outputStyle",label:"Output style",value:W,type:"managedEnum",onChange:()=>{}},{id:"language",label:"Language",value:Y??"Default (English)",type:"managedEnum",onChange:()=>{}},{id:"editorMode",label:"Editor mode",value:E.editorMode==="emacs"?"normal":E.editorMode||"normal",options:["normal","vim"],type:"enum",onChange(PH){AA((gH)=>({...gH,editorMode:PH})),M({...M$(),editorMode:PH}),c("tengu_editor_mode_changed",{mode:PH,source:"config_panel"})}},...[],...NL("tengu_code_diff_cli",!1)?[{id:"codeDiffFooterEnabled",label:"Show code diff footer",value:E.codeDiffFooterEnabled??!0,type:"boolean",onChange(PH){AA((gH)=>{if(gH.codeDiffFooterEnabled===PH)return gH;return{...gH,codeDiffFooterEnabled:PH}}),M({...M$(),codeDiffFooterEnabled:PH}),c("tengu_code_diff_footer_setting_changed",{enabled:PH})}}]:[],...NL("tengu_pr_status_cli",!1)?[{id:"prStatusFooterEnabled",label:"Show PR status footer",value:E.prStatusFooterEnabled??!0,type:"boolean",onChange(PH){AA((gH)=>{if(gH.prStatusFooterEnabled===PH)return gH;return{...gH,prStatusFooterEnabled:PH}}),M({...M$(),prStatusFooterEnabled:PH}),c("tengu_pr_status_footer_setting_changed",{enabled:PH})}}]:[],{id:"model",label:"Model",value:d===null?"Default (recommended)":d,type:"managedEnum",onChange:$H},...LH?[{id:"diffTool",label:"Diff tool",value:E.diffTool??"auto",options:["terminal","auto"],type:"enum",onChange(PH){AA((gH)=>({...gH,diffTool:PH})),M({...M$(),diffTool:PH}),c("tengu_diff_tool_changed",{tool:PH,source:"config_panel"})}}]:[],...!ZF()?[{id:"autoConnectIde",label:"Auto-connect to IDE (external terminal)",value:E.autoConnectIde??!1,type:"boolean",onChange(PH){AA((gH)=>({...gH,autoConnectIde:PH})),M({...M$(),autoConnectIde:PH}),c("tengu_auto_connect_ide_changed",{enabled:PH,source:"config_panel"})}}]:[],...ZF()?[{id:"autoInstallIdeExtension",label:"Auto-install IDE extension",value:E.autoInstallIdeExtension??!0,type:"boolean",onChange(PH){AA((gH)=>({...gH,autoInstallIdeExtension:PH})),M({...M$(),autoInstallIdeExtension:PH}),c("tengu_auto_install_ide_extension_changed",{enabled:PH,source:"config_panel"})}}]:[],{id:"claudeInChromeDefaultEnabled",label:"Claude in Chrome enabled by default",value:E.claudeInChromeDefaultEnabled??!0,type:"boolean",onChange(PH){AA((gH)=>({...gH,claudeInChromeDefaultEnabled:PH})),M({...M$(),claudeInChromeDefaultEnabled:PH}),c("tengu_claude_in_chrome_setting_changed",{enabled:PH})}},...dL()?(()=>{let PH=SZA();return[{id:"teammateMode",label:PH?`Teammate mode [overridden: ${PH}]`:"Teammate mode",value:E.teammateMode??"auto",options:["auto","tmux","in-process"],type:"enum",onChange(vH){if(vH!=="auto"&&vH!=="tmux"&&vH!=="in-process")return;jZA(vH),AA((tH)=>({...tH,teammateMode:vH})),M({...M$(),teammateMode:vH}),c("tengu_teammate_mode_changed",{mode:vH})}}]})():[],...DH?[{id:"showExternalIncludesDialog",label:"External CLAUDE.md includes",value:(()=>{if(Mf().hasClaudeMdExternalIncludesApproved)return"true";else return"false"})(),type:"managedEnum",onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY?[{id:"apiKey",label:p$.createElement(V,null,"Use custom API key:"," ",p$.createElement(V,{bold:!0},Z2(process.env.ANTHROPIC_API_KEY))),searchText:"Use custom API key",value:Boolean(process.env.ANTHROPIC_API_KEY&&E.customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY))),type:"boolean",onChange(PH){AA((gH)=>{let vH={...gH};if(!vH.customApiKeyResponses)vH.customApiKeyResponses={approved:[],rejected:[]};if(!vH.customApiKeyResponses.approved)vH.customApiKeyResponses={...vH.customApiKeyResponses,approved:[]};if(!vH.customApiKeyResponses.rejected)vH.customApiKeyResponses={...vH.customApiKeyResponses,rejected:[]};if(process.env.ANTHROPIC_API_KEY){let tH=Z2(process.env.ANTHROPIC_API_KEY);if(PH)vH.customApiKeyResponses={...vH.customApiKeyResponses,approved:[...(vH.customApiKeyResponses.approved??[]).filter((K$)=>K$!==tH),tH],rejected:(vH.customApiKeyResponses.rejected??[]).filter((K$)=>K$!==tH)};else vH.customApiKeyResponses={...vH.customApiKeyResponses,approved:(vH.customApiKeyResponses.approved??[]).filter((K$)=>K$!==tH),rejected:[...(vH.customApiKeyResponses.rejected??[]).filter((K$)=>K$!==tH),tH]}}return vH}),M(M$())}}]:[]],qH=p$.useMemo(()=>{if(!MH)return YH;let PH=MH.toLowerCase();return YH.filter((gH)=>{if(gH.id.toLowerCase().includes(PH))return!0;return("searchText"in gH?gH.searchText:gH.label).toLowerCase().includes(PH)})},[YH,MH]);p$.useEffect(()=>{if(O>=qH.length)j(Math.max(0,qH.length-1))},[qH.length,O]);let bH=pP.useCallback(()=>{if(IH!==null)return;let PH=Object.entries(WH).map(([tH,K$])=>{return c("tengu_config_changed",{key:tH,value:K$}),`Set ${tH} to ${oH.bold(K$)}`}),gH=Boolean(process.env.ANTHROPIC_API_KEY&&X.current.customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY))),vH=Boolean(process.env.ANTHROPIC_API_KEY&&E.customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY)));if(gH!==vH)PH.push(`${vH?"Enabled":"Disabled"} custom API key`),c("tengu_config_changed",{key:"env.ANTHROPIC_API_KEY",value:vH});if(E.theme!==X.current.theme)PH.push(`Set theme to ${oH.bold(E.theme)}`);if(E.preferredNotifChannel!==X.current.preferredNotifChannel)PH.push(`Set notifications to ${oH.bold(E.preferredNotifChannel)}`);if(W!==C.current)PH.push(`Set output style to ${oH.bold(W)}`);if(Y!==q.current)PH.push(`Set response language to ${oH.bold(Y??"Default (English)")}`);if(E.editorMode!==X.current.editorMode)PH.push(`Set editor mode to ${oH.bold(E.editorMode||"emacs")}`);if(E.diffTool!==X.current.diffTool)PH.push(`Set diff tool to ${oH.bold(E.diffTool)}`);if(E.autoConnectIde!==X.current.autoConnectIde)PH.push(`${E.autoConnectIde?"Enabled":"Disabled"} auto-connect to IDE`);if(E.autoInstallIdeExtension!==X.current.autoInstallIdeExtension)PH.push(`${E.autoInstallIdeExtension?"Enabled":"Disabled"} auto-install IDE extension`);if(E.autoCompactEnabled!==X.current.autoCompactEnabled)PH.push(`${E.autoCompactEnabled?"Enabled":"Disabled"} auto-compact`);if(E.respectGitignore!==X.current.respectGitignore)PH.push(`${E.respectGitignore?"Enabled":"Disabled"} respect .gitignore in file picker`);if(E.terminalProgressBarEnabled!==X.current.terminalProgressBarEnabled)PH.push(`${E.terminalProgressBarEnabled?"Enabled":"Disabled"} terminal progress bar`);if(J?.autoUpdatesChannel!==Q.current?.autoUpdatesChannel)PH.push(`Set auto-update channel to ${oH.bold(J?.autoUpdatesChannel??"latest")}`);if(PH.length>0)H(PH.join(` `));else H("Config dialog dismissed",{display:"system"})},[IH,WH,E,d,W,Y,J?.autoUpdatesChannel,cD()?J?.fastMode:void 0,H]);BA("confirm:no",bH,{context:"Settings",isActive:IH===null});let hH=pP.useCallback(()=>{let PH=qH[O];if(!PH||!PH.onChange)return;if(PH.type==="boolean"){if(PH.onChange(!PH.value),PH.id==="thinkingEnabled"){if(!PH.value===QH.current)t(!1);else if($.messages.some((tH)=>tH.type==="assistant"))t(!0)}return}if(PH.id==="theme"||PH.id==="model"||PH.id==="showExternalIncludesDialog"||PH.id==="outputStyle"||PH.id==="language")switch(PH.id){case"theme":KH(0),A(!0),I(!0);return;case"model":KH(1),A(!0);return;case"showExternalIncludesDialog":KH(2),A(!0),L(!0);return;case"outputStyle":KH(3),A(!0);return;case"language":KH(5),A(!0);return}if(PH.id==="autoUpdatesChannel"){if(EH){KH(6),A(!0);return}if((J?.autoUpdatesChannel??"latest")==="latest")KH(4),A(!0);else II("userSettings",{autoUpdatesChannel:"latest",minimumVersion:void 0}),F((vH)=>({...vH,autoUpdatesChannel:"latest",minimumVersion:void 0})),c("tengu_autoupdate_channel_changed",{channel:"latest"});return}if(PH.type==="enum"){let vH=(PH.options.indexOf(PH.value)+1)%PH.options.length;PH.onChange(PH.options[vH]);return}},[EH,qH,O,J?.autoUpdatesChannel,A,I,L]);return bI({"select:previous":()=>{if(t(!1),O===0)g(!0);else j((PH)=>Math.max(0,PH-1))},"select:next":()=>{t(!1),j((PH)=>Math.min(qH.length-1,PH+1))},"select:accept":hH,"settings:search":()=>{g(!0),CH("")}},{context:"Settings",isActive:IH===null&&!h}),WL((PH,gH)=>{if(gH.escape){if(MH.length>0)CH("");else g(!1);return}if(gH.return||gH.downArrow)g(!1),j(0)},{isActive:h&&IH===null}),WL((PH,gH)=>{if(!gH.ctrl&&!gH.meta&&PH.length>0&&!/^\s+$/.test(PH))g(!0),CH(PH)},{isActive:!h&&IH===null}),p$.createElement(x,{flexDirection:"column",width:"100%"},IH===0?p$.createElement(p$.Fragment,null,p$.createElement(QVH,{initialTheme:B,onThemeSelect:(PH)=>{f(PH),KH(null),I(!1),A(!1)},onCancel:()=>{KH(null),I(!1),A(!1)},hideEscToCancel:!0,skipExitHandling:!0}),p$.createElement(x,{marginLeft:1},p$.createElement(V,{dimColor:!0,italic:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"select"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))))):IH===1?p$.createElement(p$.Fragment,null,p$.createElement(WVH,{initial:d,onSelect:(PH,gH)=>{$H(PH),KH(null),A(!1)},onCancel:()=>{KH(null),A(!1)},showPenguinsNotice:cD()?GH&&UK(d)&&Z4():!1}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))):IH===2?p$.createElement(p$.Fragment,null,p$.createElement(Jq$,{onDone:()=>{KH(null),A(!1),L(!1)},externalIncludes:fyH()}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"disable external includes"})))):IH===3?p$.createElement(p$.Fragment,null,p$.createElement(Fq$,{initialStyle:W,onComplete:(PH)=>{P(PH??HW),KH(null),A(!1),II("localSettings",{outputStyle:PH}),c("tengu_output_style_changed",{style:PH??HW,source:"config_panel",settings_source:"localSettings"})},onCancel:()=>{KH(null),A(!1)}}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))):IH===5?p$.createElement(p$.Fragment,null,p$.createElement(GyD,{initialLanguage:Y,onComplete:(PH)=>{Z(PH),KH(null),A(!1),II("userSettings",{language:PH}),c("tengu_language_changed",{language:PH??"default",source:"config_panel"})},onCancel:()=>{KH(null),A(!1)}}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))):IH===6?p$.createElement(BL,{title:"Enable Auto-Updates",onCancel:()=>{KH(null),A(!1)},hideBorder:!0,hideInputGuide:!0},EH!=="config"?p$.createElement(p$.Fragment,null,p$.createElement(V,null,"Auto-updates are controlled by an environment variable and cannot be changed here."),p$.createElement(V,{dimColor:!0},"Unset"," ",EH?.includes("NONESSENTIAL")?"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC":"DISABLE_AUTOUPDATER"," ","to re-enable auto-updates.")):p$.createElement(QA,{options:[{label:"Enable with latest channel",value:"latest"},{label:"Enable with stable channel",value:"stable"}],onChange:(PH)=>{KH(null),A(!1),AA((gH)=>({...gH,autoUpdates:!0})),M({...M$(),autoUpdates:!0}),II("userSettings",{autoUpdatesChannel:PH,minimumVersion:void 0}),F((gH)=>({...gH,autoUpdatesChannel:PH,minimumVersion:void 0})),c("tengu_autoupdate_enabled",{channel:PH})}})):IH===4?p$.createElement(fyD,{currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,onChoice:(PH)=>{if(KH(null),A(!1),PH==="cancel")return;let gH={autoUpdatesChannel:"stable"};if(PH==="stay")gH.minimumVersion={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION;II("userSettings",gH),F((vH)=>({...vH,...gH})),c("tengu_autoupdate_channel_changed",{channel:"stable",minimum_version_set:PH==="stay"})}}):p$.createElement(x,{flexDirection:"column",marginY:1,gap:1},p$.createElement(V,null,"Configure Claude Code preferences"),p$.createElement(fb,{query:MH,isFocused:h,isTerminalFocused:p,cursorOffset:OH,placeholder:"Search settings..."}),p$.createElement(x,{flexDirection:"column"},qH.length===0?p$.createElement(V,{dimColor:!0,italic:!0},'No settings match "',MH,'"'):qH.map((PH,gH)=>{let vH=gH===O;return p$.createElement(p$.Fragment,{key:PH.id},p$.createElement(x,null,p$.createElement(x,{width:44},p$.createElement(V,{color:vH?"suggestion":void 0},vH?pH.pointer:" "," ",PH.label)),p$.createElement(x,{key:vH?"selected":"unselected"},PH.type==="boolean"?p$.createElement(p$.Fragment,null,p$.createElement(V,{color:vH?"suggestion":void 0},PH.value.toString()),TH&&PH.id==="thinkingEnabled"&&p$.createElement(V,{color:"warning"}," ","Changing thinking mode mid-conversation will increase latency and may reduce quality.")):PH.id==="theme"?p$.createElement(V,{color:vH?"suggestion":void 0},(()=>{return{dark:"Dark mode",light:"Light mode","dark-daltonized":"Dark mode (colorblind-friendly)","light-daltonized":"Light mode (colorblind-friendly)","dark-ansi":"Dark mode (ANSI colors only)","light-ansi":"Light mode (ANSI colors only)"}[PH.value.toString()]||PH.value.toString()})()):PH.id==="notifChannel"?p$.createElement(V,{color:vH?"suggestion":void 0},(()=>{switch(PH.value.toString()){case"auto":return"Auto";case"iterm2":return p$.createElement(p$.Fragment,null,"iTerm2 ",p$.createElement(V,{dimColor:!0},"(OSC 9)"));case"terminal_bell":return p$.createElement(p$.Fragment,null,"Terminal Bell ",p$.createElement(V,{dimColor:!0},"(\\a)"));case"kitty":return p$.createElement(p$.Fragment,null,"Kitty ",p$.createElement(V,{dimColor:!0},"(OSC 99)"));case"ghostty":return p$.createElement(p$.Fragment,null,"Ghostty ",p$.createElement(V,{dimColor:!0},"(OSC 777)"));case"iterm2_with_bell":return"iTerm2 w/ Bell";case"notifications_disabled":return"Disabled";default:return PH.value.toString()}})()):PH.id==="defaultPermissionMode"?p$.createElement(V,{color:vH?"suggestion":void 0},vk(PH.value)):PH.id==="autoUpdatesChannel"&&EH?p$.createElement(x,{flexDirection:"column"},p$.createElement(V,{color:vH?"suggestion":void 0},"disabled"),p$.createElement(V,{dimColor:!0},"(",EH,")")):p$.createElement(V,{color:vH?"suggestion":void 0},PH.value.toString()))))})),h?p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(V,null,"Type to filter"),p$.createElement(s$,{shortcut:"Enter/\u2193",action:"select"}),p$.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"clear"}))):p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(VA,{action:"select:accept",context:"Settings",fallback:"Enter/Space",description:"change"}),p$.createElement(VA,{action:"settings:search",context:"Settings",fallback:"/",description:"search"}),p$.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))))}var p$,pP;var JyD=K(()=>{xH();$I();jI();vA();ZqH();vA();r0();yW();_$();z$();Mq$();pL();Xq$();aI();ojA();EyD();bB();l8();tjA();UyD();mQ();lB();j0();eB();VVH();nU();mL();jh();NA();KgH();SD();T8();U6H();PVH();AJ();p$=b(s(),1),pP=b(s(),1)});async function FyD(){if(!nL())return{};let H=dD();if(H&&pk(H.expiresAt))return null;let $=eG();if($.error)throw Error(`Auth error: ${$.error}`);let A={"Content-Type":"application/json","User-Agent":sG(),...$.headers},L=`${XD().BASE_API_URL}/api/oauth/usage`;return(await nA.get(L,{headers:A,timeout:5000})).data}var KyD=K(()=>{w1();_Q();qE();EI();Hq()});function ngH(){if(!NL("tengu_copper_lantern",!1))return!1;if(!HO())return!1;let H=f0();if(H!=="pro"&&H!=="max")return!1;if(M$().hasVisitedExtraUsage)return!1;let A=T9();if(A?.subscriptionCreatedAt){let L=rm("tengu_copper_lantern_config",{meridian:"2026-02-05T07:59:00Z"});if(new Date(A.subscriptionCreatedAt)>=new Date(L.meridian))return!1}return!0}function KK1(){if((M$().opus46FeedSeenCount??0)>=FK1)return!1;return!0}function QK1(){if(!NL("tengu_silver_lantern",!1))return null;if(ngH())return cD()?"promo-copper":"promo";if(KK1())return"launch-only";return null}function Kq$(){let[H]=QyD.useState(()=>QK1());return H}function Qq$(){let $=(M$().opus46FeedSeenCount??0)+1;AA((A)=>({...A,opus46FeedSeenCount:$})),c("tengu_opus46_feed_shown",{seen_count:$})}function WK1(H){switch(H){case"promo-copper":return cD()&&Z4()?"Opus 4.6 is here \xB7 $50 free extra usage \xB7 Try fast mode or use it when you hit a limit /extra-usage to enable":"Opus 4.6 is here \xB7 $50 free extra usage \xB7 /extra-usage to enable";case"promo":return"Opus 4.6 is here \xB7 $50 free extra usage \xB7 /extra-usage to enable";case"launch-only":return"Opus 4.6 is here \xB7 Most capable for ambitious work"}}function VK1(H){switch(H){case"promo-copper":case"promo":return 39;case"launch-only":return 0}}function WyD({variant:H,maxWidth:$}){let A=WK1(H),L=$?e8(A,$):A,I=VK1(H);if(I>0&&I0)return Ij.createElement(V,{dimColor:!0},Ij.createElement(V,{color:"claude"},L));return Ij.createElement(V,{dimColor:!0},L)}var Ij,QyD,FK1=3;var rgH=K(()=>{xH();vA();EI();SD();z$();AJ();Q9();Ij=b(s(),1),QyD=b(s(),1)});function VyD({title:H,limit:$,maxWidth:A,showTimeInReset:L=!0,extraSubtext:I}){let{utilization:D,resets_at:B}=$;if(D===null)return null;let f=`${Math.floor(D)}% used`,E;if(B)E=`Resets ${WoL(B,!0,L)}`;if(I)if(E)E=`${I} \xB7 ${E}`;else E=I;let M=50;if(A>=M+12)return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,{bold:!0},H),KI.createElement(x,{flexDirection:"row",gap:1},KI.createElement(SuH,{ratio:D/100,width:M,fillColor:"rate_limit_fill",emptyColor:"rate_limit_empty"}),KI.createElement(V,null,f)),E&&KI.createElement(V,{dimColor:!0},E));else return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,null,KI.createElement(V,{bold:!0},H),E&&KI.createElement(KI.Fragment,null,KI.createElement(V,null," "),KI.createElement(V,{dimColor:!0},"\xB7 ",E))),KI.createElement(SuH,{ratio:D/100,width:A,fillColor:"rate_limit_fill",emptyColor:"rate_limit_empty"}),KI.createElement(V,null,f))}function PyD(){let[H,$]=_VH.useState(null),[A,L]=_VH.useState(null),[I,D]=_VH.useState(!0),{columns:B}=QL(),f=B-2,E=Math.min(f,80),M=KI.useCallback(async()=>{D(!0),L(null);try{let U=await FyD();$(U)}catch(U){r(U);let X=U,J=X.response?.data?yH(X.response.data):void 0;L(J?`Failed to load usage data: ${J}`:"Failed to load usage data")}finally{D(!1)}},[]);if(_VH.useEffect(()=>{M()},[M]),BA("settings:retry",()=>{M()},{context:"Settings",isActive:!!A&&!I}),A)return KI.createElement(x,{flexDirection:"column",marginTop:1,gap:1},KI.createElement(V,{color:"error"},"Error: ",A),KI.createElement(V,{dimColor:!0},KI.createElement(rA,null,KI.createElement(VA,{action:"settings:retry",context:"Settings",fallback:"r",description:"retry"}),KI.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"}))));if(!H)return KI.createElement(x,{flexDirection:"column",marginTop:1,gap:1},KI.createElement(V,{dimColor:!0},"Loading usage data\u2026"),KI.createElement(V,{dimColor:!0},KI.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})));let G=[{title:"Current session",limit:H.five_hour},{title:"Current week (all models)",limit:H.seven_day},{title:"Current week (Sonnet only)",limit:H.seven_day_sonnet}];return KI.createElement(x,{flexDirection:"column",marginTop:1,gap:1,width:"100%"},G.some(({limit:U})=>U)||KI.createElement(V,{dimColor:!0},"/usage is only available for subscription plans."),G.map(({title:U,limit:X})=>X&&KI.createElement(VyD,{key:U,title:U,limit:X,maxWidth:E})),H.extra_usage&&KI.createElement(PK1,{extraUsage:H.extra_usage,maxWidth:E}),ngH()?cD()&&Z4()?KI.createElement(V,{dimColor:!0},KI.createElement(V,{color:"claude"},"$50 free extra usage")," \xB7 for fast mode or when you hit limits /extra-usage to enable"):KI.createElement(V,{dimColor:!0},KI.createElement(V,{color:"claude"},"$50 free extra usage")," \xB7 /extra-usage to enable"):null,KI.createElement(V,{dimColor:!0},KI.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))}function PK1({extraUsage:H,maxWidth:$}){let A=f0();if(!(A==="pro"||A==="max"))return!1;if(!H.is_enabled){if(Lt.isEnabled())return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,{bold:!0},ejA),KI.createElement(V,{dimColor:!0},"Extra usage not enabled \u2022 /extra-usage to enable"));return null}if(H.monthly_limit===null)return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,{bold:!0},ejA),KI.createElement(V,{dimColor:!0},"Unlimited"));if(typeof H.used_credits!=="number"||typeof H.utilization!=="number")return null;let I=ZzH(H.used_credits/100,2),D=ZzH(H.monthly_limit/100,2),B=new Date,f=new Date(B.getFullYear(),B.getMonth()+1,1);return KI.createElement(VyD,{title:ejA,limit:{utilization:H.utilization,resets_at:f.toISOString()},showTimeInReset:!1,extraSubtext:`${I} / ${D} spent`,maxWidth:$})}var KI,_VH,ejA="Extra usage";var _yD=K(()=>{xH();OB();KyD();_$();AOA();j0();eB();$I();mbH();Nq();EI();Q9();Z$();rgH();AJ();KI=b(s(),1),_VH=b(s(),1)});function YVH({onClose:H,context:$,defaultTab:A}){let[L,I]=w1H.useState(!1),[D,B]=w1H.useState(!1),[f,E]=w1H.useState(!1),[M,G]=w1H.useState(A==="Config"),U=w1H.useCallback(()=>{if(L)return;H("Status dialog dismissed",{display:"system"})},[L,H]);return BA("confirm:no",U,{context:"Settings",isActive:!L}),jJ.createElement(x,{flexDirection:"column"},jJ.createElement(Uf,{dividerColor:D?"warning":"permission",dividerDimColor:!D}),jJ.createElement(x,{marginX:f?0:1},jJ.createElement(Zz,{title:"Settings:",color:"permission",defaultTab:A,hidden:L,disableNavigation:M},[jJ.createElement(WU,{key:"status",title:"Status"},jJ.createElement(tRD,{context:$})),jJ.createElement(WU,{key:"config",title:"Config"},jJ.createElement(XyD,{context:$,onClose:H,setTabsHidden:I,setIsWarning:B,setHideMargin:E,onSearchModeChange:G})),jJ.createElement(WU,{key:"usage",title:"Usage"},jJ.createElement(PyD,null))])))}var jJ,w1H;var Wq$=K(()=>{xH();$I();e6();J1H();sRD();JyD();_yD();jJ=b(s(),1),w1H=b(s(),1)});var YyD={};XA(YyD,{call:()=>_K1});var HRA,_K1=async(H,$)=>{return HRA.createElement(YVH,{onClose:H,context:$,defaultTab:"Config"})};var CyD=K(()=>{Wq$();HRA=b(s(),1)});var YK1,wyD;var ZyD=K(()=>{YK1={aliases:["settings"],type:"local-jsx",name:"config",description:"Open config panel",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (CyD(),YyD)),userFacingName(){return"config"}},wyD=YK1});function CK1(H){return`${Math.round(H/1000)}k`}function qyD(H){let $=new Map;for(let L of H){let I=ktH(L.source),D=$.get(I)||[];D.push(L),$.set(I,D)}for(let[L,I]of $.entries())$.set(L,I.sort((D,B)=>B.tokens-D.tokens));let A=new Map;for(let L of wK1){let I=$.get(L);if(I)A.set(L,I)}return A}function TyD({data:H}){let{categories:$,totalTokens:A,rawMaxTokens:L,percentage:I,gridRows:D,model:B,memoryFiles:f,mcpTools:E,deferredBuiltinTools:M,agents:G,skills:U,messageBreakdown:X}=H,J=$.filter((P)=>P.tokens>0&&P.name!=="Free space"&&P.name!==Vq$&&!P.isDeferred),F=$.some((P)=>P.isDeferred&&P.name.includes("MCP")),Q=M.length>0,W=$.find((P)=>P.name===Vq$);return JA.createElement(x,{flexDirection:"column",paddingLeft:1},JA.createElement(V,{bold:!0},"Context Usage"),JA.createElement(x,{flexDirection:"row",gap:2},JA.createElement(x,{flexDirection:"column",flexShrink:0},D.map((P,C)=>JA.createElement(x,{key:C,flexDirection:"row",marginLeft:-1},P.map((Y,Z)=>{if(Y.categoryName==="Free space")return JA.createElement(V,{key:Z,dimColor:!0},"\u26F6 ");if(Y.categoryName===Vq$)return JA.createElement(V,{key:Z,color:Y.color},"\u26DD ");return JA.createElement(V,{key:Z,color:Y.color},Y.squareFullness>=0.7?"\u26C1 ":"\u26C0 ")})))),JA.createElement(x,{flexDirection:"column",gap:0,flexShrink:0},JA.createElement(V,{dimColor:!0},B," \xB7 ",Math.round(A/1000),"k/",Math.round(L/1000),"k tokens (",I,"%)"),JA.createElement(V,null," "),JA.createElement(V,{dimColor:!0,italic:!0},"Estimated usage by category"),J.map((P,C)=>{let Y=XK(P.tokens),Z=P.isDeferred?"N/A":`${(P.tokens/L*100).toFixed(1)}%`,q=P.name===Vq$,O=P.name,j=P.isDeferred?" ":q?"\u26DD":"\u26C1";return JA.createElement(x,{key:C},JA.createElement(V,{color:P.color},j),JA.createElement(V,null," ",O,": "),JA.createElement(V,{dimColor:!0},Y," tokens (",Z,")"))}),($.find((P)=>P.name==="Free space")?.tokens??0)>0&&JA.createElement(x,null,JA.createElement(V,{dimColor:!0},"\u26F6"),JA.createElement(V,null," Free space: "),JA.createElement(V,{dimColor:!0},CK1($.find((P)=>P.name==="Free space")?.tokens||0)," ","(",(($.find((P)=>P.name==="Free space")?.tokens||0)/L*100).toFixed(1),"%)")),W&&W.tokens>0&&JA.createElement(x,null,JA.createElement(V,{color:W.color},"\u26DD"),JA.createElement(V,{dimColor:!0}," ",W.name,": "),JA.createElement(V,{dimColor:!0},XK(W.tokens)," tokens (",(W.tokens/L*100).toFixed(1),"%)")))),JA.createElement(x,{flexDirection:"column",marginLeft:-1},E.length>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"MCP tools"),JA.createElement(V,{dimColor:!0}," ","\xB7 /mcp",F?" (loaded on-demand)":"")),E.some((P)=>P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Loaded"),E.filter((P)=>P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",P.name,": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),F&&E.some((P)=>!P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Available"),E.filter((P)=>!P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,{dimColor:!0},"\u2514 ",P.name)))),!F&&E.map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",P.name,": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),Q&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Deferred system tools"),JA.createElement(V,{dimColor:!0}," (loaded on-demand)")),M.some((P)=>P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Loaded"),M.filter((P)=>P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",P.name,": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),M.some((P)=>!P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Available"),M.filter((P)=>!P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,{dimColor:!0},"\u2514 ",P.name))))),G.length>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Custom agents"),JA.createElement(V,{dimColor:!0}," \xB7 /agents")),Array.from(qyD(G).entries()).map(([P,C])=>JA.createElement(x,{key:P,flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},P),C.map((Y,Z)=>JA.createElement(x,{key:Z},JA.createElement(V,null,"\u2514 ",Y.agentType,": "),JA.createElement(V,{dimColor:!0},XK(Y.tokens)," tokens")))))),f.length>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Memory files"),JA.createElement(V,{dimColor:!0}," \xB7 /memory")),f.map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",V9(P.path),": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),U&&U.tokens>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Skills"),JA.createElement(V,{dimColor:!0}," \xB7 /skills")),Array.from(qyD(U.skillFrontmatter).entries()).map(([P,C])=>JA.createElement(x,{key:P,flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},P),C.map((Y,Z)=>JA.createElement(x,{key:Z},JA.createElement(V,null,"\u2514 ",Y.name,": "),JA.createElement(V,{dimColor:!0},XK(Y.tokens)," tokens")))))),X&&!1))}var JA,Vq$="Autocompact buffer",wK1;var zyD=K(()=>{xH();W4();rD();Q9();JA=b(s(),1);wK1=["Project","User","Managed","Plugin","Built-in"]});function ZK1({children:H}){let{exit:$}=wSH();return OyD.useLayoutEffect(()=>{let A=setTimeout($,0);return()=>clearTimeout(A)},[$]),Qs.createElement(Qs.Fragment,null,H)}function TK1(H){let $=H.indexOf(NyD);if($===-1)return H;let A=$+NyD.length,L=H.indexOf(qK1,A);if(L===-1)return H;return H.slice(A,L)}function $RA(H){return new Promise(async($)=>{let A="",L=new xyD.PassThrough;L.on("data",(D)=>{A+=D.toString()}),await(await A8(Qs.createElement(ZK1,null,H),{stdout:L,debug:!0})).waitUntilExit(),await $(TK1(A))})}async function CVH(H){let $=await $RA(H);return $U($)}var Qs,OyD,xyD,NyD="\x1B[?2026h",qK1="\x1B[?2026l";var agH=K(()=>{xH();yq();Qs=b(s(),1),OyD=b(s(),1),xyD=require("stream")});var SyD={};XA(SyD,{call:()=>zK1});async function zK1(H,$){let{messages:A,getAppState:L,options:{mainLoopModel:I,tools:D}}=$;yD("context");let B=GC(A),{messages:f}=await rh(B),E=process.stdout.columns||80,M=await L(),G=await sw$(f,I,async()=>M.toolPermissionContext,D,M.agentDefinitions,E,$,void 0,B),U=await $RA(ARA.createElement(TyD,{data:G}));return H(U),null}var ARA;var jyD=K(()=>{zyD();m3H();agH();lt();_L();yE();ARA=b(s(),1)});var RyD={};XA(RyD,{call:()=>NK1});async function NK1(H,$){let{messages:A,getAppState:L,options:{mainLoopModel:I,tools:D,agentDefinitions:B}}=$,f=GC(A),{messages:E}=await rh(f),M=await L(),G=await sw$(E,I,async()=>M.toolPermissionContext,D,B,void 0,$,void 0,f);return{type:"text",value:OK1(G)}}function OK1(H){let{categories:$,totalTokens:A,rawMaxTokens:L,percentage:I,model:D,memoryFiles:B,mcpTools:f,agents:E,skills:M,messageBreakdown:G}=H,U=`## Context Usage `)}var tgH;var lyD=K(()=>{jI();xH();tgH={branch:pH.lineUpDownRight,lastBranch:pH.lineUpRight,line:pH.lineVertical,empty:" "}});function jK1(H){let $={};return H.forEach((A)=>{if(!A.path){$[""]=A.message;return}let L=A.path.split("."),I=A.path;if(A.invalidValue!==null&&A.invalidValue!==void 0&&L.length>0){let D=[];for(let B=0;B{let B=D.file||"(file not specified)";if(!I[B])I[B]=[];return I[B].push(D),I},{}),L=Object.keys(A).sort();return hK.createElement(x,{flexDirection:"column"},L.map((I)=>{let D=A[I]||[];D.sort((M,G)=>{if(!M.path&&G.path)return-1;if(M.path&&!G.path)return 1;return(M.path||"").localeCompare(G.path||"")});let B=jK1(D),f=new Map;D.forEach((M)=>{if(M.suggestion||M.docLink){let G=`${M.suggestion||""}|${M.docLink||""}`;if(!f.has(G))f.set(G,{suggestion:M.suggestion,docLink:M.docLink})}});let E=cyD(B,{showValues:!0,themeName:$,treeCharColors:{treeChar:"inactive",key:"text",value:"inactive"}});return hK.createElement(x,{key:I,flexDirection:"column"},hK.createElement(V,null,I),hK.createElement(x,{marginLeft:1},hK.createElement(V,{dimColor:!0},E)),f.size>0&&hK.createElement(x,{flexDirection:"column",marginTop:1},Array.from(f.values()).map((M,G)=>hK.createElement(x,{key:`suggestion-pair-${G}`,flexDirection:"column",marginBottom:1},M.suggestion&&hK.createElement(V,{dimColor:!0,wrap:"wrap"},M.suggestion),M.docLink&&hK.createElement(V,{dimColor:!0,wrap:"wrap"},"Learn more: ",M.docLink)))))}))}var hK;var BRA=K(()=>{xH();inA();lyD();hK=b(s(),1)});function RK1({scope:H,parsingErrors:$,warnings:A}){let L=$.length>0,I=A.length>0;if(!L&&!I)return null;return $4.default.createElement(x,{flexDirection:"column",marginTop:1},$4.default.createElement(x,null,(L||I)&&$4.default.createElement(V,{color:L?"error":"warning"},"[",L?"Failed to parse":"Contains warnings","]"," "),$4.default.createElement(V,null,OuH(H))),$4.default.createElement(x,null,$4.default.createElement(V,{dimColor:!0},"Location: "),$4.default.createElement(V,{dimColor:!0},b3(H))),$4.default.createElement(x,{marginLeft:1,flexDirection:"column"},$.map((D,B)=>{let f=D.mcpErrorMetadata?.serverName;return $4.default.createElement(x,{key:`error-${B}`},$4.default.createElement(V,null,$4.default.createElement(V,{dimColor:!0},"\u2514 "),$4.default.createElement(V,{color:"error"},"[Error]"),$4.default.createElement(V,{dimColor:!0}," ",f&&`[${f}] `,D.path&&D.path!==""?`${D.path}: `:"",D.message)))}),A.map((D,B)=>{let f=D.mcpErrorMetadata?.serverName;return $4.default.createElement(x,{key:`warning-${B}`},$4.default.createElement(V,null,$4.default.createElement(V,{dimColor:!0},"\u2514 "),$4.default.createElement(V,{color:"warning"},"[Warning]"),$4.default.createElement(V,{dimColor:!0}," ",f&&`[${f}] `,D.path&&D.path!==""?`${D.path}: `:"",D.message)))})))}function wq$(){let H=OJ("user"),$=OJ("project"),A=OJ("local"),L=OJ("enterprise"),I=[{scope:"user",config:H},{scope:"project",config:$},{scope:"local",config:A},{scope:"enterprise",config:L}],D=I.some(({config:f})=>Cq$(f.errors,"fatal").length>0),B=I.some(({config:f})=>Cq$(f.errors,"warning").length>0);if(!D&&!B)return null;return $4.default.createElement(x,{flexDirection:"column",marginTop:1,marginBottom:1},$4.default.createElement(V,{bold:!0},"MCP Config Diagnostics"),$4.default.createElement(x,{marginTop:1},$4.default.createElement(V,{dimColor:!0},"For help configuring MCP servers, see:"," ",$4.default.createElement(dI,{url:"https://code.claude.com/docs/en/mcp"},"https://code.claude.com/docs/en/mcp"))),I.map(({scope:f,config:E})=>$4.default.createElement(RK1,{key:f,scope:f,parsingErrors:Cq$(E.errors,"fatal"),warnings:Cq$(E.errors,"warning")})))}function Cq$(H,$){return H.filter((A)=>A.mcpErrorMetadata?.severity===$)}var $4;var fRA=K(()=>{xH();T3();kF();xH();$4=b(s(),1)});function iyD(){if(!m2())return null;let H=bAI();if(H.length===0)return null;let $=H.filter((L)=>L.severity==="error"),A=H.filter((L)=>L.severity==="warning");return RJ.default.createElement(x,{flexDirection:"column",marginTop:1,marginBottom:1},RJ.default.createElement(V,{bold:!0,color:$.length>0?"error":"warning"},"Keybinding Configuration Issues"),RJ.default.createElement(x,null,RJ.default.createElement(V,{dimColor:!0},"Location: "),RJ.default.createElement(V,{dimColor:!0},OLH())),RJ.default.createElement(x,{marginLeft:1,flexDirection:"column",marginTop:1},$.map((L,I)=>RJ.default.createElement(x,{key:`error-${I}`,flexDirection:"column"},RJ.default.createElement(x,null,RJ.default.createElement(V,{dimColor:!0},"\u2514 "),RJ.default.createElement(V,{color:"error"},"[Error]"),RJ.default.createElement(V,{dimColor:!0}," ",L.message)),L.suggestion&&RJ.default.createElement(x,{marginLeft:3},RJ.default.createElement(V,{dimColor:!0},"\u2192 ",L.suggestion)))),A.map((L,I)=>RJ.default.createElement(x,{key:`warning-${I}`,flexDirection:"column"},RJ.default.createElement(x,null,RJ.default.createElement(V,{dimColor:!0},"\u2514 "),RJ.default.createElement(V,{color:"warning"},"[Warning]"),RJ.default.createElement(V,{dimColor:!0}," ",L.message)),L.suggestion&&RJ.default.createElement(x,{marginLeft:3},RJ.default.createElement(V,{dimColor:!0},"\u2192 ",L.suggestion))))))}var RJ;var nyD=K(()=>{xH();nu();RJ=b(s(),1)});function ryD(){return fj$().map(($)=>({name:$.name,value:process.env[$.name],...$.validate(process.env[$.name])})).filter(($)=>$.status!=="valid")}var ayD=K(()=>{g$()});function sgH(H){if(!H)return 0;return H.activeAgents.filter(($)=>$.source!=="built-in").reduce(($,A)=>{let L=`${A.agentType}: ${A.whenToUse}`;return $+JE(L)},0)}var Z1H=15000;var ERA=K(()=>{Aw()});async function yK1(){let H=MBH();if(H.length===0)return null;let $=H.sort((L,I)=>I.content.length-L.content.length).map((L)=>`${L.path}: ${L.content.length.toLocaleString()} chars`);return{type:"claudemd_files",severity:"warning",message:H.length===1?`Large CLAUDE.md file detected (${H[0].content.length.toLocaleString()} chars > ${Cm.toLocaleString()})`:`${H.length} large CLAUDE.md files detected (each > ${Cm.toLocaleString()} chars)`,details:$,currentValue:H.length,threshold:Cm}}async function vK1(H){if(!H)return null;let $=sgH(H);if($<=Z1H)return null;let A=H.activeAgents.filter((I)=>I.source!=="built-in").map((I)=>{let D=`${I.agentType}: ${I.whenToUse}`;return{name:I.agentType,tokens:JE(D)}}).sort((I,D)=>D.tokens-I.tokens),L=A.slice(0,5).map((I)=>`${I.name}: ~${I.tokens.toLocaleString()} tokens`);if(A.length>5)L.push(`(${A.length-5} more custom agents)`);return{type:"agent_descriptions",severity:"warning",message:`Large agent descriptions (~${$.toLocaleString()} tokens > ${Z1H.toLocaleString()})`,details:L,currentValue:$,threshold:Z1H}}async function hK1(H,$,A){let L=H.filter((I)=>I.isMcp);if(L.length===0)return null;if(eU())return null;try{let I=X1(),{mcpToolTokens:D,mcpToolDetails:B}=await BgH(H,$,A,I);if(D<=ZVH)return null;let f=new Map;for(let G of B){let X=G.name.split("__")[1]||"unknown",J=f.get(X)||{count:0,tokens:0};f.set(X,{count:J.count+1,tokens:J.tokens+G.tokens})}let E=Array.from(f.entries()).sort((G,U)=>U[1].tokens-G[1].tokens),M=E.slice(0,5).map(([G,U])=>`${G}: ${U.count} tools (~${U.tokens.toLocaleString()} tokens)`);if(E.length>5)M.push(`(${E.length-5} more servers)`);return{type:"mcp_tools",severity:"warning",message:`Large MCP tools context (~${D.toLocaleString()} tokens > ${ZVH.toLocaleString()})`,details:M,currentValue:D,threshold:ZVH}}catch(I){let D=L.reduce((B,f)=>{let E=(f.name?.length||0)+f.description.length;return B+JE(E.toString())},0);if(D<=ZVH)return null;return{type:"mcp_tools",severity:"warning",message:`Large MCP tools context (~${D.toLocaleString()} tokens estimated > ${ZVH.toLocaleString()})`,details:[`${L.length} MCP tools detected (token count estimated)`],currentValue:D,threshold:ZVH}}}async function bK1(H){let $=await H(),A=vL.isSandboxingEnabled()&&vL.isAutoAllowBashIfSandboxedEnabled(),L=XFH($,{sandboxAutoAllowEnabled:A});if(L.length===0)return null;let I=L.flatMap((D)=>[`${X8(D.rule.ruleValue)}: ${D.reason}`,` Fix: ${D.fix}`]);return{type:"unreachable_rules",severity:"warning",message:`${L.length} unreachable permission rule${L.length===1?"":"s"} detected`,details:I,currentValue:L.length,threshold:0}}async function oyD(H,$,A){let[L,I,D,B]=await Promise.all([yK1(),vK1($),hK1(H,A,$),bK1(A)]);return{claudeMdWarning:L,agentWarning:I,mcpWarning:D,unreachableRulesWarning:B}}var ZVH=25000;var tyD=K(()=>{mQ();ERA();m3H();Aw();BW();aI();Z4$();EM()});function syD(){if(!vL.isSupportedPlatform())return null;if(!vL.isSandboxEnabledInSettings())return null;let H=vL.checkDependencies(),$=H.errors.length>0,A=H.warnings.length>0;if(!$&&!A)return null;return Ws.default.createElement(x,{flexDirection:"column"},Ws.default.createElement(V,{bold:!0},"Sandbox"),Ws.default.createElement(V,null,"\u2514 Status: ",Ws.default.createElement(V,{color:$?"error":"warning"},$?"Missing dependencies":"Available (with warnings)")),H.errors.map((D,B)=>Ws.default.createElement(V,{key:B,color:"error"},"\u2514 ",D)),H.warnings.map((D,B)=>Ws.default.createElement(V,{key:B,color:"warning"},"\u2514 ",D)),$&&Ws.default.createElement(V,{dimColor:!0},"\u2514 Run /sandbox for install instructions"))}var Ws;var eyD=K(()=>{xH();EM();Ws=b(s(),1)});var HvD={};XA(HvD,{Doctor:()=>MRA});function kK1({promise:H}){let $=lL.use(H);if(!$.latest)return lL.default.createElement(V,{dimColor:!0},"\u2514 Failed to fetch versions");return lL.default.createElement(lL.default.Fragment,null,$.stable&&lL.default.createElement(V,null,"\u2514 Stable version: ",$.stable),lL.default.createElement(V,null,"\u2514 Latest version: ",$.latest))}function MRA({onDone:H}){let $=J$((Z)=>Z.agentDefinitions),A=J$((Z)=>Z.mcp.tools),L=J$((Z)=>Z.toolPermissionContext),I=J$((Z)=>Z.plugins.errors);zB();let D=Dj.useMemo(()=>{return A||[]},[A]),[B,f]=Dj.useState(null),[E,M]=Dj.useState(null),[G,U]=Dj.useState(null),[X,J]=Dj.useState(null),F=_q$(),Q=Dj.useMemo(()=>W1H().then((Z)=>{return(Z.installationType==="native"?ZRD:wRD)().catch(()=>({latest:null,stable:null}))}),[]),W=GB()?.autoUpdatesChannel??"latest",P=F.filter((Z)=>Z.mcpErrorMetadata===void 0),C=Dj.useMemo(()=>ryD(),[]);Dj.useEffect(()=>{W1H().then(f),(async()=>{let Z=zH(),q=Zq$.join(UL(),"agents"),O=Zq$.join(zL(),".claude","agents"),{activeAgents:j,allAgents:u,failedFiles:y}=$,g={activeAgents:j.map((p)=>({agentType:p.agentType,source:p.source})),userAgentsDir:q,projectAgentsDir:O,userDirExists:Z.existsSync(q),projectDirExists:Z.existsSync(O),failedFiles:y};M(g);let h=await oyD(D,{activeAgents:j,allAgents:u,failedFiles:y},async()=>L);if(U(h),V1H()){let p=Zq$.join(lZ$(),"claude","locks"),d=Bq$(p),k=pjA(p);J({enabled:!0,locks:k,locksDir:p,staleLocksCleaned:d})}else J({enabled:!1,locks:[],locksDir:"",staleLocksCleaned:0})})()},[L,D,$]);let Y=lL.useCallback(()=>{H("Claude Code diagnostics dismissed",{display:"system"})},[H]);if(bI({"confirm:yes":Y,"confirm:no":Y},{context:"Confirmation"}),!B)return lL.default.createElement(x,{paddingX:1,paddingTop:1},lL.default.createElement(V,{dimColor:!0},"Checking installation status\u2026"));return lL.default.createElement(x,{flexDirection:"column",gap:1,paddingX:1,paddingTop:1},lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Diagnostics"),lL.default.createElement(V,null,"\u2514 Currently running: ",B.installationType," (",B.version,")"),B.packageManager&&lL.default.createElement(V,null,"\u2514 Package manager: ",B.packageManager),lL.default.createElement(V,null,"\u2514 Path: ",B.installationPath),lL.default.createElement(V,null,"\u2514 Invoked: ",B.invokedBinary),lL.default.createElement(V,null,"\u2514 Config install method: ",B.configInstallMethod),lL.default.createElement(V,null,"\u2514 Search: ",B.ripgrepStatus.working?"OK":"Not working"," (",B.ripgrepStatus.mode==="builtin"?U8()?"bundled":"vendor":B.ripgrepStatus.systemPath||"system",")"),B.recommendation&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null),lL.default.createElement(V,{color:"warning"},"Recommendation: ",B.recommendation.split(` `)[1])),B.multipleInstallations.length>1&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null),lL.default.createElement(V,{color:"warning"},"Warning: Multiple installations found"),B.multipleInstallations.map((Z,q)=>lL.default.createElement(V,{key:q},"\u2514 ",Z.type," at ",Z.path))),B.warnings.length>0&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null),B.warnings.map((Z,q)=>lL.default.createElement(x,{key:q,flexDirection:"column"},lL.default.createElement(V,{color:"warning"},"Warning: ",Z.issue),lL.default.createElement(V,null,"Fix: ",Z.fix)))),P.length>0&&lL.default.createElement(x,{flexDirection:"column",marginTop:1,marginBottom:1},lL.default.createElement(V,{bold:!0},"Invalid Settings"),lL.default.createElement(Yq$,{errors:P}))),lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Updates"),lL.default.createElement(V,null,"\u2514 Auto-updates:"," ",B.packageManager?"Managed by package manager":B.autoUpdates),B.hasUpdatePermissions!==null&&lL.default.createElement(V,null,"\u2514 Update permissions:"," ",B.hasUpdatePermissions?"Yes":"No (requires sudo)"),lL.default.createElement(V,null,"\u2514 Auto-update channel: ",W),lL.default.createElement(lL.Suspense,{fallback:null},lL.default.createElement(kK1,{promise:Q}))),lL.default.createElement(syD,null),lL.default.createElement(wq$,null),lL.default.createElement(iyD,null),C.length>0&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Environment Variables"),C.map((Z,q)=>lL.default.createElement(V,{key:q},"\u2514 ",Z.name,":"," ",lL.default.createElement(V,{color:Z.status==="capped"?"warning":"error"},Z.message)))),X?.enabled&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Version Locks"),X.staleLocksCleaned>0&&lL.default.createElement(V,{dimColor:!0},"\u2514 Cleaned ",X.staleLocksCleaned," stale lock(s)"),X.locks.length===0?lL.default.createElement(V,{dimColor:!0},"\u2514 No active version locks"):X.locks.map((Z,q)=>lL.default.createElement(V,{key:q},"\u2514 ",Z.version,": PID ",Z.pid," ",Z.isProcessRunning?lL.default.createElement(V,null,"(running)"):lL.default.createElement(V,{color:"warning"},"(stale)")))),E?.failedFiles&&E.failedFiles.length>0&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0,color:"error"},"Agent Parse Errors"),lL.default.createElement(V,{color:"error"},"\u2514 Failed to parse ",E.failedFiles.length," agent file(s):"),E.failedFiles.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z.path,": ",Z.error))),I.length>0&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0,color:"error"},"Plugin Errors"),lL.default.createElement(V,{color:"error"},"\u2514 ",I.length," plugin error(s) detected:"),I.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z.source||"unknown","plugin"in Z&&Z.plugin?` [${Z.plugin}]`:"",":"," ",UP(Z)))),G?.unreachableRulesWarning&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0,color:"warning"},"Unreachable Permission Rules"),lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.unreachableRulesWarning.message)),G.unreachableRulesWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z))),G&&(G.claudeMdWarning||G.agentWarning||G.mcpWarning)&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Context Usage Warnings"),G.claudeMdWarning&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.claudeMdWarning.message)),lL.default.createElement(V,null," ","\u2514 Files:"),G.claudeMdWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z))),G.agentWarning&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.agentWarning.message)),lL.default.createElement(V,null," ","\u2514 Top contributors:"),G.agentWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z))),G.mcpWarning&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.mcpWarning.message)),lL.default.createElement(V,null," ","\u2514 MCP servers:"),G.mcpWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z)))),lL.default.createElement(x,null,lL.default.createElement(Pq$,null)))}var lL,Dj,Zq$;var GRA=K(()=>{xH();$I();UM();jI();Ib();Us();mL();IRA();DRA();BRA();fRA();nyD();g$();DL();NA();ayD();tyD();djA();SjA();pL();eyD();lL=b(s(),1),Dj=b(s(),1),Zq$=require("path")});var AvD={};XA(AvD,{call:()=>uK1});var $vD,uK1=(H,$,A)=>{return Promise.resolve($vD.default.createElement(MRA,{onDone:H}))};var LvD=K(()=>{GRA();$vD=b(s(),1)});var gK1,IvD;var DvD=K(()=>{gK1={name:"doctor",description:"Diagnose and verify your Claude Code installation and settings",isEnabled:()=>!process.env.DISABLE_DOCTOR_COMMAND,isHidden:!1,userFacingName(){return"doctor"},type:"local-jsx",load:()=>Promise.resolve().then(() => (LvD(),AvD))},IvD=gK1});var BvD=()=>{};function mK1(H){return!!EtH(H)}async function Mb(H){let $=Bj();if(!$)throw Error("No editor available");SN(`${$} "${H}"`,{stdio:"inherit"})}var Bj;var Gb=K(()=>{H2H();tD();Zk();Bj=o$(()=>{if(process.env.VISUAL?.trim())return process.env.VISUAL.trim();if(process.env.EDITOR?.trim())return process.env.EDITOR.trim();return["code","vi","nano"].find(($)=>mK1($))})});function fvD(H){return XQ(H)!==null}var EvD=K(()=>{DL();Td$();t8()});function GvD({onSelect:H,onCancel:$,title:A,renderDetails:L}){let I=QJ(),D=URA.join(UL(),"CLAUDE.md"),B=URA.join(zL(),"CLAUDE.md"),f=I.some((P)=>P.path===D),E=I.some((P)=>P.path===B),M=[...I.map((P)=>({...P,exists:!0})),...f?[]:[{path:D,type:"User",content:"",exists:!1}],...E?[]:[{path:B,type:"Project",content:"",exists:!1}]],G=new Map,U=M.map((P)=>{let C=V9(P.path),Y=P.exists?"":" (new)",Z=P.parent?(G.get(P.parent)??0)+1:0;G.set(P.path,Z);let q=Z>0?" ".repeat(Z-1):"",O;if(P.type==="User"&&!P.isNested&&P.path===D)O="User memory";else if(P.type==="Project"&&!P.isNested&&P.path===B)O="Project memory";else if(Z>0)O=`${q}L ${C}${Y}`;else O=`${C}`;let j,u=fvD(zL());if(P.type==="User"&&!P.isNested)j="Saved in ~/.claude/CLAUDE.md";else if(P.type==="Project"&&!P.isNested&&P.path===B)j=`${u?"Checked in at":"Saved in"} ./CLAUDE.md`;else if(P.type,P.type==="AutoMem")j=`${Pm()} entrypoint`;else if(P.parent)j="@-imported";else if(P.isNested)j="dynamically loaded";else j="";return{label:O,value:P.path,description:j}}),X=qq$&&U.some((P)=>P.value===qq$)?qq$:U[0]?.value||"",[J,F]=MvD.useState(X),W=M.find((P)=>P.path===J)?.type;return zB(),BA("confirm:no",$,{context:"Confirmation"}),sw.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:"remember",padding:1,width:"100%"},sw.createElement(x,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},sw.createElement(V,{color:"remember",bold:!0},A||"Select memory file to edit:")),sw.createElement(x,{flexDirection:"column",paddingX:1},sw.createElement(QA,{defaultFocusValue:X,options:U,onFocus:(P)=>F(P),onChange:(P)=>{qq$=P,H(P)},onCancel:$})),L&&sw.createElement(x,{marginTop:1,flexDirection:"column"},L(J,W)))}var sw,MvD,URA,qq$;var UvD=K(()=>{xH();l8();UM();$I();mQ();G3();rD();EvD();g$();NA();sw=b(s(),1),MvD=b(s(),1),URA=require("path")});function FvD(H){let $=XvD.homedir(),A=C$(),L=H.startsWith($)?"~"+H.slice($.length):null,I=H.startsWith(A)?"./"+JvD.relative(A,H):null;if(L&&I)return L.length<=I.length?L:I;return L||I||H}var XvD,JvD,pK1;var KvD=K(()=>{xH();PI();XvD=require("os"),JvD=require("path"),pK1=b(s(),1)});var QvD={};XA(QvD,{call:()=>cK1});function dK1({onDone:H}){XRA.useState(()=>{QJ.cache.clear?.()});let{columns:$}=QL(),A=async(E)=>{yD("memory-mode");try{if(E.includes(UL())){let J=UL();if(!zH().existsSync(J))zH().mkdirSync(J)}if(!zH().existsSync(E))iL(E,"",{encoding:"utf8",flush:!0});await Mb(E);let M="default",G="";if(process.env.VISUAL)M="$VISUAL",G=process.env.VISUAL;else if(process.env.EDITOR)M="$EDITOR",G=process.env.EDITOR;let U=M!=="default"?`Using ${M}="${G}".`:"",X=U?`> ${U} To change editor, set $EDITOR or $VISUAL environment variable.`:"> To use a different editor, set the $EDITOR or $VISUAL environment variable.";H(`Opened memory file at ${FvD(E)} ${X}`,{display:"system"})}catch(M){r(M instanceof Error?M:Error(String(M))),H(`Error opening memory file: ${M}`)}},L=()=>{H("Cancelled memory editing",{display:"system"})},D=[].length,[B,f]=XRA.useState(!1);return WL((E,M)=>{}),BA("confirm:no",()=>{f(!1)},{context:"Confirmation",isActive:!1}),ew.createElement(x,{flexDirection:"column"},ew.createElement(x,{marginTop:1,marginBottom:1},ew.createElement(V,{dimColor:!0},"Learn more: ",ew.createElement(dI,{url:"https://code.claude.com/docs/en/memory"}))),!1,!1,!1,!B&&ew.createElement(GvD,{title:"Select memory to edit:",onSelect:A,onCancel:L}))}var ew,XRA,cK1=async(H)=>{return ew.createElement(dK1,{onDone:H})};var WvD=K(()=>{NA();_$();Gb();DL();Z$();UvD();KvD();xH();$I();xH();mQ();yE();OB();ew=b(s(),1),XRA=b(s(),1)});var lK1,VvD;var PvD=K(()=>{lK1={type:"local-jsx",name:"memory",description:"Edit Claude memory files",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (WvD(),QvD)),userFacingName(){return this.name}},VvD=lK1});var iK1,nK1,q1H;var Tq$=K(()=>{Z1();iK1={ghostty:"Ghostty",kitty:"Kitty","iTerm.app":"iTerm2",WezTerm:"WezTerm"},nK1={type:"local-jsx",name:"terminal-setup",userFacingName(){return"terminal-setup"},description:OA.terminal==="Apple_Terminal"?"Enable Option+Enter key binding for newlines and visual bell":"Install Shift+Enter key binding for newlines",isEnabled:()=>!0,isHidden:OA.terminal!==null&&OA.terminal in iK1,load:()=>Promise.resolve().then(() => (BDH(),jVI))},q1H=nK1});function Vs(){return M$().editorMode==="vim"}function _vD(){if(OA.terminal,q1H.isEnabled()&&F5A())return"shift + \u23CE for newline";return K5A()?"\\\u23CE for newline":"backslash (\\) + return (\u23CE) for newline"}var qVH=K(()=>{Tq$();BDH();vA();Z1()});function Ps(H){return H.replace(/\+/g," + ")}function zq$(H){let{dimColor:$,fixedWidth:A,gap:L,paddingX:I}=H,D=Ps(C0("app:toggleTranscript","Global","ctrl+o")),B=Ps(C0("app:toggleTodos","Global","ctrl+t")),f=Ps(C0("chat:undo","Chat","ctrl+_")),E=Ps(C0("chat:stash","Chat","ctrl+s")),M=Ps(C0("chat:cycleMode","Chat","shift+tab")),G=Ps(C0("chat:modelPicker","Chat","alt+p")),U=Ps(C0("chat:externalEditor","Chat","ctrl+g")),X=Ps(C0("app:toggleTerminal","Global","meta+j")),J=null;return uI.createElement(x,{paddingX:I,flexDirection:"row",gap:L},uI.createElement(x,{flexDirection:"column",width:A?24:void 0},uI.createElement(x,null,uI.createElement(V,{dimColor:$},"! for bash mode")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},"/ for commands")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},"@ for file paths")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},"& for background")),process.env.ENABLE_BTW==="true"&&uI.createElement(x,null,uI.createElement(V,{dimColor:$},"/btw for side question"))),uI.createElement(x,{flexDirection:"column",width:A?35:void 0},uI.createElement(x,null,uI.createElement(V,{dimColor:$},"double tap esc to clear input")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},M," to auto-accept edits")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},D," for verbose output")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},B," to toggle tasks")),null,uI.createElement(x,null,uI.createElement(V,{dimColor:$},_vD()))),uI.createElement(x,{flexDirection:"column"},uI.createElement(x,null,uI.createElement(V,{dimColor:$},f," to undo")),rIL&&uI.createElement(x,null,uI.createElement(V,{dimColor:$},"ctrl + z to suspend")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},e3H.displayText.replace("+"," + ")," to paste images")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},G," to switch model")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},E," to stash prompt")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},U," to edit in $EDITOR")),m2()&&uI.createElement(x,null,uI.createElement(V,{dimColor:$},"/keybindings to customize"))))}var uI;var JRA=K(()=>{xH();ZgH();Z9();qVH();FG();nu();SD();uI=b(s(),1)});function YvD(){return dP.createElement(x,{flexDirection:"column",paddingY:1,gap:1},dP.createElement(x,null,dP.createElement(V,null,"Claude understands your codebase, makes edits with your permission, and executes commands \u2014 right from your terminal.")),dP.createElement(x,{flexDirection:"column"},dP.createElement(x,null,dP.createElement(V,{bold:!0},"Shortcuts")),dP.createElement(zq$,{gap:2,fixedWidth:!0})))}var dP;var CvD=K(()=>{xH();JRA();dP=b(s(),1)});function FRA({commands:H,maxHeight:$,title:A,onCancel:L,emptyMessage:I}){let D=Math.max(1,Math.floor(($-6)/2)),B=wvD.useMemo(()=>[...H].sort((f,E)=>f.name.localeCompare(E.name)).map((f)=>({label:`/${f.name}`,value:f.name,description:TVH(f)})),[H]);return p3.createElement(x,{flexDirection:"column",paddingY:1},H.length===0&&I?p3.createElement(V,{dimColor:!0},I):p3.createElement(p3.Fragment,null,p3.createElement(V,null,A),p3.createElement(x,{marginTop:1},p3.createElement(QA,{options:B,visibleOptionCount:D,onCancel:L,disableSelection:!0,hideIndexes:!0,layout:"compact-vertical"}))))}var p3,wvD;var ZvD=K(()=>{xH();h4();N1();p3=b(s(),1),wvD=b(s(),1)});function qvD({onClose:H,commands:$}){let{rows:A}=QL(),L=Math.floor(A/2),I=()=>H("Help dialog dismissed",{display:"system"});BA("help:dismiss",I,{context:"Help"});let D=zB(I),B=C0("help:dismiss","Help","esc"),f=Np(),E=$.filter((X)=>f.has(X.name)&&!X.isHidden),M=[],G=$.filter((X)=>!f.has(X.name)&&!X.isHidden),U=[W8.createElement(WU,{key:"general",title:"general"},W8.createElement(YvD,null))];return U.push(W8.createElement(WU,{key:"commands",title:"commands"},W8.createElement(FRA,{commands:E,maxHeight:L,title:"Browse default commands:",onCancel:I}))),U.push(W8.createElement(WU,{key:"custom",title:"custom-commands"},W8.createElement(FRA,{commands:G,maxHeight:L,title:"Browse custom commands:",emptyMessage:"No custom commands found",onCancel:I}))),W8.createElement(x,{flexDirection:"column",height:L},W8.createElement(Uf,{dividerColor:"professionalBlue"}),W8.createElement(x,{paddingX:1,flexDirection:"column"},W8.createElement(Zz,{title:`Claude Code v${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}`,color:"professionalBlue",defaultTab:"general"},U),W8.createElement(x,{marginTop:1},W8.createElement(V,null,"For more help:"," ",W8.createElement(dI,{url:"https://code.claude.com/docs/en/overview"}))),W8.createElement(x,{marginTop:1},W8.createElement(V,{dimColor:!0},D.pending?W8.createElement(W8.Fragment,null,"Press ",D.keyName," again to exit"):W8.createElement(V,{italic:!0},B," to cancel")))))}var W8;var TvD=K(()=>{xH();e6();J1H();CvD();ZvD();h4();OB();UM();$I();FG();xH();W8=b(s(),1)});var zvD={};XA(zvD,{call:()=>rK1});var KRA,rK1=async(H,{options:{commands:$}})=>{return KRA.createElement(qvD,{commands:$,onClose:H})};var NvD=K(()=>{TvD();KRA=b(s(),1)});var aK1,QRA;var OvD=K(()=>{aK1={type:"local-jsx",name:"help",description:"Show help and available commands",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (NvD(),zvD)),userFacingName(){return"help"}},QRA=aK1});function xvD({onComplete:H}){let $=Nq$.useCallback(async(L)=>{let I=L==="yes";AA((D)=>({...D,autoConnectIde:I,hasIdeAutoConnectDialogBeenShown:!0})),H()},[H]);return T1H.default.createElement(BL,{title:"Do you wish to enable auto-connect to IDE?",color:"ide",onCancel:H},T1H.default.createElement(QA,{options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}],onChange:$,defaultValue:"yes"}),T1H.default.createElement(V,{dimColor:!0},"You can also configure this in /config or with the --ide flag"))}function SvD(){let H=M$();return!ZF()&&H.autoConnectIde!==!0&&H.hasIdeAutoConnectDialogBeenShown!==!0}function jvD({onComplete:H}){let $=Nq$.useCallback((I)=>{let D=I==="yes";if(D)AA((B)=>({...B,autoConnectIde:!1}));H(D)},[H]),A=Nq$.useCallback(()=>{H(!1)},[H]);return T1H.default.createElement(BL,{title:"Do you wish to disable auto-connect to IDE?",color:"ide",onCancel:A},T1H.default.createElement(QA,{options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}],onChange:$,defaultValue:"yes"}),T1H.default.createElement(V,{dimColor:!0},"You can also configure this in /config"))}function RvD(){let H=M$();return!ZF()&&H.autoConnectIde===!0}var T1H,Nq$;var yvD=K(()=>{xH();vA();l8();nU();bB();T1H=b(s(),1),Nq$=b(s(),1)});async function vvD(){let{code:H}=await jA("tmux",["-V"]);return H===0}function hvD(){switch(oA()){case"macos":return"Install tmux with: brew install tmux";case"linux":case"wsl":return"Install tmux with: sudo apt install tmux (Debian/Ubuntu) or sudo dnf install tmux (Fedora/RHEL)";case"windows":return"tmux is not natively available on Windows. Consider using WSL or Cygwin.";default:return"Install tmux using your system package manager."}}var zVH=K(()=>{B0();PI();DL();t8();j$H();E$();vA();mL();Z9();yh()});var kvD={};XA(kvD,{formatWorkspaceFolders:()=>WRA,call:()=>eK1});function oK1({availableIDEs:H,unavailableIDEs:$,selectedIDE:A,onClose:L,onSelect:I}){let[D,B]=Ub.useState(A?.port?.toString()??"None"),[f,E]=Ub.useState(!1),[M,G]=Ub.useState(!1),U=Ub.useCallback((F)=>{if(F!=="None"&&SvD())E(!0);else if(F==="None"&&RvD())G(!0);else I(H.find((Q)=>Q.port===parseInt(F)))},[H,I]),X=H.reduce((F,Q)=>{return F[Q.name]=(F[Q.name]||0)+1,F},{}),J=H.map((F)=>{let W=(X[F.name]||0)>1&&F.workspaceFolders.length>0;return{label:F.name,value:F.port.toString(),description:W?WRA(F.workspaceFolders):void 0}}).concat([{label:"None",value:"None",description:void 0}]);if(f)return bK.default.createElement(xvD,{onComplete:()=>U(D)});if(M)return bK.default.createElement(jvD,{onComplete:()=>{I(void 0)}});return bK.default.createElement(BL,{title:"Select IDE",subtitle:"Connect to an IDE for integrated development features.",onCancel:L,color:"ide",borderDimColor:!1},bK.default.createElement(x,{flexDirection:"column"},H.length===0&&bK.default.createElement(V,{dimColor:!0},rjH()?`No available IDEs detected. Please install the plugin and restart your IDE: https://docs.claude.com/s/claude-code-jetbrains`:"No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running."),H.length!==0&&bK.default.createElement(QA,{defaultValue:D,defaultFocusValue:D,options:J,onChange:(F)=>{B(F),U(F)}}),H.length!==0&&!ZF()&&bK.default.createElement(x,{marginTop:1},bK.default.createElement(V,{dimColor:!0},"Tip: You can enable auto-connect to IDE in /config or with the --ide flag")),$.length>0&&bK.default.createElement(x,{flexDirection:"column",marginTop:1},bK.default.createElement(V,{dimColor:!0},"Found ",$.length," other running IDE(s). However, their workspace/project directories do not match the current cwd."),bK.default.createElement(x,{marginTop:1,flexDirection:"column"},$.map((F,Q)=>bK.default.createElement(x,{key:Q,paddingLeft:3},bK.default.createElement(V,{dimColor:!0},"\u2022 ",F.name,": ",WRA(F.workspaceFolders))))))))}async function tK1(H,$){let A=$?.ide;if(!A||A.type!=="sse-ide"&&A.type!=="ws-ide")return null;for(let L of H)if(L.url===A.url)return L;return null}function sK1({runningIDEs:H,onSelectIDE:$,onDone:A}){let[L,I]=Ub.useState(H[0]??""),D=Ub.useCallback((E)=>{$(E)},[$]),B=H.map((E)=>({label:PX(E),value:E}));function f(){A("IDE selection cancelled",{display:"system"})}return bK.default.createElement(BL,{title:"Select IDE to install extension",onCancel:f,color:"ide",borderDimColor:!1},bK.default.createElement(QA,{defaultFocusValue:L,options:B,onChange:(E)=>{I(E),D(E)}}))}async function eK1(H,$,A){c("tengu_ext_ide_command",{}),yD("ide-integration");let{options:{dynamicMcpConfig:L},onChangeDynamicMcpConfig:I}=$,D=await ajH(!0);if(D.length===0&&$.onInstallIDEExtension&&!ZF()){let G=await zKA(),U=(X)=>{if($.onInstallIDEExtension)if($.onInstallIDEExtension(X),Wx(X))H(`Installed plugin to ${oH.bold(PX(X))} This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. \`\`\``}]}},pvD=$Q1});var cvD=()=>{};function AQ1(H){let $=new Set(YNH.map((A)=>zLH(A.key)));return H.map((A)=>{let L={};for(let[I,D]of Object.entries(A.bindings))if(!$.has(zLH(I)))L[I]=D;return{context:A.context,bindings:L}}).filter((A)=>Object.keys(A.bindings).length>0)}function lvD(){let $={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:AQ1(HXH)};return yH($,null,2)+` `}var ivD=K(()=>{B8$();f8$();Z$()});var rvD={};XA(rvD,{call:()=>LQ1});async function LQ1(){if(!m2())return{type:"text",value:"Keybinding customization is not enabled. This feature is currently in preview."};let H=OLH(),$=!1;try{await NVH.stat(H),$=!0}catch{}if(!$){let A=lvD(),L=nvD.dirname(H);await NVH.mkdir(L,{recursive:!0}),await NVH.writeFile(H,A,"utf-8")}try{return await Mb(H),{type:"text",value:$?`Opened ${H} in your editor.`:`Created ${H} with template. Opened in your editor.`}}catch(A){return{type:"text",value:`${$?"Opened":"Created"} ${H}. Could not open in editor: ${A instanceof Error?A.message:String(A)}`}}}var NVH,nvD;var avD=K(()=>{nu();ivD();Gb();NVH=require("fs/promises"),nvD=require("path")});var IQ1,VRA;var ovD=K(()=>{nu();IQ1={name:"keybindings",description:"Open or create your keybindings configuration file",isEnabled:()=>m2(),isHidden:!1,supportsNonInteractive:!1,type:"local",load:()=>Promise.resolve().then(() => (avD(),rvD)),userFacingName:()=>"keybindings"},VRA=IQ1});var tvD=()=>({type:"local-jsx",name:"login",description:HmL()?"Switch Anthropic accounts":"Sign in with your Anthropic account",isEnabled:()=>!process.env.DISABLE_LOGIN_COMMAND,isHidden:!1,load:()=>Promise.resolve().then(() => (J_$(),_FD)),userFacingName(){return"login"}});var svD=K(()=>{EI()});var evD;var HhD=K(()=>{evD={type:"local-jsx",name:"logout",description:"Sign out from your Anthropic account",isEnabled:()=>!process.env.DISABLE_LOGOUT_COMMAND,isHidden:!1,load:()=>Promise.resolve().then(() => (QP$(),E4D)),userFacingName(){return"logout"}}});function AhD(){return $hD.default.createElement(V,null,"Checking GitHub CLI installation\u2026")}var $hD;var LhD=K(()=>{xH();$hD=b(s(),1)});function IhD({currentRepo:H,useCurrentRepo:$,repoUrl:A,onRepoUrlChange:L,onSubmit:I,onToggleUseCurrentRepo:D}){let[B,f]=hX.useState(0),[E,M]=hX.useState(!1),U=QL().columns,X=hX.useCallback(()=>{if(!($?H:A)?.trim()){M(!0);return}I()},[$,H,A,I]);return bI({"confirm:previous":()=>{D(!0),M(!1)},"confirm:next":()=>{D(!1),M(!1)},"confirm:yes":X},{context:"Confirmation"}),hX.default.createElement(hX.default.Fragment,null,hX.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},hX.default.createElement(x,{flexDirection:"column",marginBottom:1},hX.default.createElement(V,{bold:!0},"Install GitHub App"),hX.default.createElement(V,{dimColor:!0},"Select GitHub repository")),H&&hX.default.createElement(x,{marginBottom:1},hX.default.createElement(V,{bold:$,color:$?"permission":void 0},$?"> ":" ","Use current repository: ",H)),hX.default.createElement(x,{marginBottom:1},hX.default.createElement(V,{bold:!$||!H,color:!$||!H?"permission":void 0},!$||!H?"> ":" ",H?"Enter a different repository":"Enter repository")),(!$||!H)&&hX.default.createElement(x,{marginLeft:2,marginBottom:1},hX.default.createElement(W9,{value:A,onChange:(J)=>{L(J),M(!1)},onSubmit:X,focus:!0,placeholder:"Enter a repo as owner/repo or https://github.com/owner/repo\u2026",columns:U,cursorOffset:B,onChangeCursorOffset:f,showCursor:!0}))),E&&hX.default.createElement(x,{marginLeft:3,marginBottom:1},hX.default.createElement(V,{color:"error"},"Please enter a repository name to continue")),hX.default.createElement(x,{marginLeft:3},hX.default.createElement(V,{dimColor:!0},H?"\u2191/\u2193 to select \xB7 ":"","Enter to continue")))}var hX;var DhD=K(()=>{xH();$I();S5();OB();hX=b(s(),1)});var BhD="Add Claude Code GitHub Workflow",Xb="https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md",fhD=`name: Claude Code claude: (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) id: claude uses: anthropics/claude-code-action@v1 # Optional: Add claude_args to customize behavior and configuration # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options # claude_args: '--allowed-tools Bash(gh pr:*)' [Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with: Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment. - **@claude mentions won't work until after the merge is complete** There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action). After merging this PR, let's try mentioning @claude in a comment on any PR to get started!`,MhD=`name: Claude Code Review claude-review: id: claude-review uses: anthropics/claude-code-action@v1 plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options `;function GhD({repoUrl:H,onSubmit:$}){return BA("confirm:yes",$,{context:"Confirmation"}),mF.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},mF.default.createElement(x,{flexDirection:"column",marginBottom:1},mF.default.createElement(V,{bold:!0},"Install the Claude GitHub App")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,null,"Opening browser to install the Claude GitHub App\u2026")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,null,"If your browser doesn't open automatically, visit:")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,{underline:!0},"https://github.com/apps/claude")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,null,"Please install the app for repository: ",mF.default.createElement(V,{bold:!0},H))),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,{dimColor:!0},"Important: Make sure to grant access to this specific repository")),mF.default.createElement(x,null,mF.default.createElement(V,{bold:!0,color:"permission"},"Press Enter once you've installed the app",pH.ellipsis)),mF.default.createElement(x,{marginTop:1},mF.default.createElement(V,{dimColor:!0},"Having trouble? See manual setup instructions at:"," ",mF.default.createElement(V,{color:"claude"},Xb))))}var mF;var UhD=K(()=>{xH();$I();jI();mF=b(s(),1)});function XhD({useExistingSecret:H,secretName:$,onToggleUseExistingSecret:A,onSecretNameChange:L,onSubmit:I}){let[D,B]=c4.useState(0),f=QL(),[E]=_I();return bI({"confirm:previous":()=>A(!0),"confirm:next":()=>A(!1),"confirm:yes":I},{context:"Confirmation"}),c4.default.createElement(c4.default.Fragment,null,c4.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},c4.default.createElement(x,{flexDirection:"column",marginBottom:1},c4.default.createElement(V,{bold:!0},"Install GitHub App"),c4.default.createElement(V,{dimColor:!0},"Setup API key secret")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,{color:"warning"},"ANTHROPIC_API_KEY already exists in repository secrets!")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,"Would you like to:")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,H?ZL("success",E)("> "):" ","Use the existing API key")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,!H?ZL("success",E)("> "):" ","Create a new secret with a different name")),!H&&c4.default.createElement(c4.default.Fragment,null,c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,"Enter new secret name (alphanumeric with underscores):")),c4.default.createElement(W9,{value:$,onChange:L,onSubmit:I,focus:!0,placeholder:"e.g., CLAUDE_API_KEY",columns:f.columns,cursorOffset:D,onChangeCursorOffset:B,showCursor:!0}))),c4.default.createElement(x,{marginLeft:3},c4.default.createElement(V,{dimColor:!0},"\u2191/\u2193 to select \xB7 Enter to continue")))}var c4;var JhD=K(()=>{xH();$I();S5();OB();c4=b(s(),1)});function FhD({existingApiKey:H,apiKeyOrOAuthToken:$,onApiKeyChange:A,onSubmit:L,onToggleUseExistingKey:I,onCreateOAuthToken:D,selectedOption:B=H?"existing":D?"oauth":"new",onSelectOption:f}){let[E,M]=bX.useState(0),G=QL(),[U]=_I(),X=bX.useCallback(()=>{if(B==="new"&&D)f?.("oauth");else if(B==="oauth"&&H)f?.("existing"),I(!0)},[B,D,H,f,I]),J=bX.useCallback(()=>{if(B==="existing")f?.(D?"oauth":"new"),I(!1);else if(B==="oauth")f?.("new")},[B,D,f,I]),F=bX.useCallback(()=>{if(B==="oauth"&&D)D();else L()},[B,D,L]);return bI({"confirm:previous":X,"confirm:next":J,"confirm:yes":F},{context:"Confirmation"}),bX.default.createElement(bX.default.Fragment,null,bX.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},bX.default.createElement(x,{flexDirection:"column",marginBottom:1},bX.default.createElement(V,{bold:!0},"Install GitHub App"),bX.default.createElement(V,{dimColor:!0},"Choose API key")),H&&bX.default.createElement(x,{marginBottom:1},bX.default.createElement(V,null,B==="existing"?ZL("success",U)("> "):" ","Use your existing Claude Code API key")),D&&bX.default.createElement(x,{marginBottom:1},bX.default.createElement(V,null,B==="oauth"?ZL("success",U)("> "):" ","Create a long-lived token with your Claude subscription")),bX.default.createElement(x,{marginBottom:1},bX.default.createElement(V,null,B==="new"?ZL("success",U)("> "):" ","Enter a new API key")),B==="new"&&bX.default.createElement(W9,{value:$,onChange:A,onSubmit:L,onPaste:A,focus:!0,placeholder:"sk-ant\u2026 (Create a new key at https://platform.claude.com/settings/keys)",mask:"*",columns:G.columns,cursorOffset:E,onChangeCursorOffset:M,showCursor:!0})),bX.default.createElement(x,{marginLeft:3},bX.default.createElement(V,{dimColor:!0},"\u2191/\u2193 to select \xB7 Enter to continue")))}var bX;var KhD=K(()=>{xH();$I();S5();OB();bX=b(s(),1)});function QhD({currentWorkflowInstallStep:H,secretExists:$,useExistingSecret:A,secretName:L,skipWorkflow:I=!1,selectedWorkflows:D}){let B=I?["Getting repository information",$&&A?"Using existing API key secret":`Setting up ${L} secret`]:["Getting repository information","Creating branch",D.length>1?"Creating workflow files":"Creating workflow file",$&&A?"Using existing API key secret":`Setting up ${L} secret`,"Opening pull request page"];return Md.default.createElement(Md.default.Fragment,null,Md.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},Md.default.createElement(x,{flexDirection:"column",marginBottom:1},Md.default.createElement(V,{bold:!0},"Install GitHub App"),Md.default.createElement(V,{dimColor:!0},"Create GitHub Actions workflow")),B.map((f,E)=>{let M="pending";if(E{xH();Md=b(s(),1)});function VhD({secretExists:H,useExistingSecret:$,secretName:A,skipWorkflow:L=!1}){return VU.default.createElement(VU.default.Fragment,null,VU.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},VU.default.createElement(x,{flexDirection:"column",marginBottom:1},VU.default.createElement(V,{bold:!0},"Install GitHub App"),VU.default.createElement(V,{dimColor:!0},"Success")),!L&&VU.default.createElement(V,{color:"success"},"\u2713 GitHub Actions workflow created!"),H&&$&&VU.default.createElement(x,{marginTop:1},VU.default.createElement(V,{color:"success"},"\u2713 Using existing ANTHROPIC_API_KEY secret")),(!H||!$)&&VU.default.createElement(x,{marginTop:1},VU.default.createElement(V,{color:"success"},"\u2713 API key saved as ",A," secret")),VU.default.createElement(x,{marginTop:1},VU.default.createElement(V,null,"Next steps:")),L?VU.default.createElement(VU.default.Fragment,null,VU.default.createElement(V,null,"1. Install the Claude GitHub App if you haven't already"),VU.default.createElement(V,null,"2. Your workflow file was kept unchanged"),VU.default.createElement(V,null,"3. API key is configured and ready to use")):VU.default.createElement(VU.default.Fragment,null,VU.default.createElement(V,null,"1. A pre-filled PR page has been created"),VU.default.createElement(V,null,"2. Install the Claude GitHub App if you haven't already"),VU.default.createElement(V,null,"3. Merge the PR to enable Claude PR assistance"))),VU.default.createElement(x,{marginLeft:3},VU.default.createElement(V,{dimColor:!0},"Press any key to exit")))}var VU;var PhD=K(()=>{xH();VU=b(s(),1)});function _hD({error:H,errorReason:$,errorInstructions:A}){return kK.default.createElement(kK.default.Fragment,null,kK.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},kK.default.createElement(x,{flexDirection:"column",marginBottom:1},kK.default.createElement(V,{bold:!0},"Install GitHub App")),kK.default.createElement(V,{color:"error"},"Error: ",H),$&&kK.default.createElement(x,{marginTop:1},kK.default.createElement(V,{dimColor:!0},"Reason: ",$)),A&&A.length>0&&kK.default.createElement(x,{flexDirection:"column",marginTop:1},kK.default.createElement(V,{dimColor:!0},"How to fix:"),A.map((L,I)=>kK.default.createElement(x,{key:I,marginLeft:2},kK.default.createElement(V,{dimColor:!0},"\u2022 "),kK.default.createElement(V,null,L)))),kK.default.createElement(x,{marginTop:1},kK.default.createElement(V,{dimColor:!0},"For manual setup instructions, see:"," ",kK.default.createElement(V,{color:"claude"},Xb)))),kK.default.createElement(x,{marginLeft:3},kK.default.createElement(V,{dimColor:!0},"Press any key to exit")))}var kK;var YhD=K(()=>{xH();kK=b(s(),1)});function ChD({repoName:H,onSelectAction:$}){return QC.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},QC.default.createElement(x,{flexDirection:"column",marginBottom:1},QC.default.createElement(V,{bold:!0},"Existing Workflow Found"),QC.default.createElement(V,{dimColor:!0},"Repository: ",H)),QC.default.createElement(x,{flexDirection:"column",marginBottom:1},QC.default.createElement(V,null,"A Claude workflow file already exists at"," ",QC.default.createElement(V,{color:"claude"},".github/workflows/claude.yml")),QC.default.createElement(V,{dimColor:!0},"What would you like to do?")),QC.default.createElement(x,{flexDirection:"column"},QC.default.createElement(QA,{options:[{label:"Update workflow file with latest version",value:"update"},{label:"Skip workflow update (configure secrets only)",value:"skip"},{label:"Exit without making changes",value:"exit"}],onChange:(D)=>{$(D)},onCancel:()=>{$("exit")}})),QC.default.createElement(x,{marginTop:1},QC.default.createElement(V,{dimColor:!0},"View the latest workflow template at:"," ",QC.default.createElement(V,{color:"claude"},"https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml"))))}var QC;var whD=K(()=>{xH();l8();QC=b(s(),1)});function ZhD({warnings:H,onContinue:$}){return BA("confirm:yes",$,{context:"Confirmation"}),o7.default.createElement(o7.default.Fragment,null,o7.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},o7.default.createElement(x,{flexDirection:"column",marginBottom:1},o7.default.createElement(V,{bold:!0},pH.warning," Setup Warnings"),o7.default.createElement(V,{dimColor:!0},"We found some potential issues, but you can continue anyway")),H.map((A,L)=>o7.default.createElement(x,{key:L,flexDirection:"column",marginBottom:1},o7.default.createElement(V,{color:"warning",bold:!0},A.title),o7.default.createElement(V,null,A.message),A.instructions.length>0&&o7.default.createElement(x,{flexDirection:"column",marginLeft:2,marginTop:1},A.instructions.map((I,D)=>o7.default.createElement(V,{key:D,dimColor:!0},"\u2022 ",I))))),o7.default.createElement(x,{marginTop:1},o7.default.createElement(V,{bold:!0,color:"permission"},"Press Enter to continue anyway, or Ctrl+C to exit and fix issues")),o7.default.createElement(x,{marginTop:1},o7.default.createElement(V,{dimColor:!0},"You can also try the manual setup steps if needed:"," ",o7.default.createElement(V,{color:"claude"},Xb)))))}var o7;var qhD=K(()=>{xH();$I();jI();o7=b(s(),1)});function zhD({isFocused:H,isSelected:$,children:A}){return ThD.default.createElement(M4$,{isFocused:H,isSelected:$},A)}var ThD;var NhD=K(()=>{C5A();ThD=b(s(),1)});var Oq$;var OhD=K(()=>{Oq$=class Oq$ extends Map{first;last;constructor(H){let $=[],A,L,I,D=0;for(let B of H){let f={...B,previous:I,next:void 0,index:D};if(I)I.next=f;A||=f,L=f,$.push([B.value,f]),D++,I=f}super($);this.first=A,this.last=L}}});var PRA,HZ,DQ1=(H,$)=>{switch($.type){case"focus-next-option":{if(!H.focusedValue)return H;let A=H.optionMap.get(H.focusedValue);if(!A)return H;let L=A.next||H.optionMap.first;if(!L)return H;if(!A.next&&L===H.optionMap.first)return{...H,focusedValue:L.value,visibleFromIndex:0,visibleToIndex:H.visibleOptionCount};if(!(L.index>=H.visibleToIndex))return{...H,focusedValue:L.value};let D=Math.min(H.optionMap.size,H.visibleToIndex+1),B=D-H.visibleOptionCount;return{...H,focusedValue:L.value,visibleFromIndex:B,visibleToIndex:D}}case"focus-previous-option":{if(!H.focusedValue)return H;let A=H.optionMap.get(H.focusedValue);if(!A)return H;let L=A.previous||H.optionMap.last;if(!L)return H;if(!A.previous&&L===H.optionMap.last){let f=H.optionMap.size,E=Math.max(0,f-H.visibleOptionCount);return{...H,focusedValue:L.value,visibleFromIndex:E,visibleToIndex:f}}if(!(L.index<=H.visibleFromIndex))return{...H,focusedValue:L.value};let D=Math.max(0,H.visibleFromIndex-1),B=D+H.visibleOptionCount;return{...H,focusedValue:L.value,visibleFromIndex:D,visibleToIndex:B}}case"toggle-focused-option":{if(!H.focusedValue)return H;if(H.value.includes(H.focusedValue)){let A=new Set(H.value);return A.delete(H.focusedValue),{...H,previousValue:H.value,value:[...A]}}return{...H,previousValue:H.value,value:[...H.value,H.focusedValue]}}case"reset":return $.state}},xhD=({visibleOptionCount:H,defaultValue:$,options:A})=>{let L=typeof H==="number"?Math.min(H,A.length):A.length,I=new Oq$(A),D=$??[];return{optionMap:I,visibleOptionCount:L,focusedValue:I.first?.value,visibleFromIndex:0,visibleToIndex:L,previousValue:D,value:D}},ShD=({visibleOptionCount:H=5,options:$,defaultValue:A,onChange:L,onSubmit:I})=>{let[D,B]=HZ.useReducer(DQ1,{visibleOptionCount:H,defaultValue:A,options:$},xhD),[f,E]=HZ.useState($);if($!==f&&!PRA.isDeepStrictEqual($,f))B({type:"reset",state:xhD({visibleOptionCount:H,defaultValue:A,options:$})}),E($);let M=HZ.useCallback(()=>{B({type:"focus-next-option"})},[]),G=HZ.useCallback(()=>{B({type:"focus-previous-option"})},[]),U=HZ.useCallback(()=>{B({type:"toggle-focused-option"})},[]),X=HZ.useCallback(()=>{I?.(D.value)},[D.value,I]),J=HZ.useMemo(()=>{return $.map((F,Q)=>({...F,index:Q})).slice(D.visibleFromIndex,D.visibleToIndex)},[$,D.visibleFromIndex,D.visibleToIndex]);return HZ.useEffect(()=>{if(!PRA.isDeepStrictEqual(D.previousValue,D.value))L?.(D.value)},[D.previousValue,D.value,$,L]),{focusedValue:D.focusedValue,visibleFromIndex:D.visibleFromIndex,visibleToIndex:D.visibleToIndex,value:D.value,visibleOptions:J,focusNextOption:M,focusPreviousOption:G,toggleFocusedOption:U,submit:X}};var jhD=K(()=>{OhD();PRA=require("util"),HZ=b(s(),1)});var RhD=({isDisabled:H=!1,state:$})=>{WL((A,L)=>{if(L.downArrow||L.ctrl&&A==="n"||!L.ctrl&&!L.shift&&A==="j")$.focusNextOption();if(L.upArrow||L.ctrl&&A==="p"||!L.ctrl&&!L.shift&&A==="k")$.focusPreviousOption();if(A===" ")$.toggleFocusedOption();if(L.return)$.submit()},{isActive:!H})};var yhD=K(()=>{xH()});function xVH({isDisabled:H=!1,visibleOptionCount:$=5,highlightText:A,options:L,defaultValue:I,onChange:D,onSubmit:B}){let f=ShD({visibleOptionCount:$,options:L,defaultValue:I,onChange:D,onSubmit:B});return RhD({isDisabled:H,state:f}),OVH.default.createElement(x,{flexDirection:"column"},f.visibleOptions.map((E)=>{let M=E.label;if(A&&E.label.includes(A)){let G=E.label.indexOf(A);M=OVH.default.createElement(OVH.default.Fragment,null,E.label.slice(0,G),OVH.default.createElement(V,{bold:!0},A),E.label.slice(G+A.length))}return OVH.default.createElement(zhD,{key:E.value,isFocused:!H&&f.focusedValue===E.value,isSelected:f.value.includes(E.value)},M)}))}var OVH;var xq$=K(()=>{xH();NhD();jhD();yhD();OVH=b(s(),1)});function fQ1(H){if(H.pending)return WC.default.createElement(V,null,"Press ",H.keyName," again to exit");return WC.default.createElement(rA,null,WC.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),WC.default.createElement(s$,{shortcut:"Space",action:"toggle"}),WC.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),WC.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))}function vhD({onSubmit:H,defaultSelections:$}){let[A,L]=SVH.useState(!1),I=SVH.useCallback((f)=>{if(f.length===0){L(!0);return}L(!1),H(f)},[H]),D=SVH.useCallback(()=>{L(!1)},[]),B=SVH.useCallback(()=>{L(!0)},[]);return WC.default.createElement(BL,{title:"Select GitHub workflows to install",subtitle:"We'll create a workflow file in your repository for each one you select.",onCancel:B,inputGuide:fQ1},WC.default.createElement(x,null,WC.default.createElement(V,{dimColor:!0},"More workflow examples (issue triage, CI fixes, etc.) at:"," ",WC.default.createElement(dI,{url:"https://github.com/anthropics/claude-code-action/blob/main/examples/"},"https://github.com/anthropics/claude-code-action/blob/main/examples/"))),WC.default.createElement(xVH,{options:BQ1.map((f)=>({label:f.label,value:f.value})),defaultValue:$,onSubmit:I,onChange:D}),A&&WC.default.createElement(x,null,WC.default.createElement(V,{color:"error"},"You must select at least one workflow to continue")))}var WC,SVH,BQ1;var hhD=K(()=>{xH();bB();xq$();lB();j0();eB();WC=b(s(),1),SVH=b(s(),1),BQ1=[{value:"claude",label:"@Claude Code - Tag @claude in issues and PR comments"},{value:"claude-review",label:"Claude Code Review - Automated code review on new PRs"}]});async function EQ1(H,$,A,L,I,D,B){let f=await jA("gh",["api",`repos/${H}/contents/${A}`,"--jq",".sha"]),E=null;if(f.code===0)E=f.stdout.trim();let M=L;if(I==="CLAUDE_CODE_OAUTH_TOKEN")M=L.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,"claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}");else if(I!=="ANTHROPIC_API_KEY")M=L.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,`anthropic_api_key: \${{ secrets.${I} }}`);let G=Buffer.from(M).toString("base64"),U=["api","--method","PUT",`repos/${H}/contents/${A}`,"-f",`message=${E?`"Update ${D}"`:`"${D}"`}`,"-f",`content=${G}`,"-f",`branch=${$}`];if(E)U.push("-f",`sha=${E}`);let X=await jA("gh",U);if(X.code!==0){if(X.stderr.includes("422")&&X.stderr.includes("sha"))throw c("tengu_setup_github_actions_failed",{reason:"failed_to_create_workflow_file",exit_code:X.code,...B}),Error(`Failed to create workflow file ${A}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`);c("tengu_setup_github_actions_failed",{reason:"failed_to_create_workflow_file",exit_code:X.code,...B});let J=` `+"\u2022 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";throw Error(`Failed to create workflow file ${A}: ${X.stderr}${J}`)}}async function bhD(H,$,A,L,I=!1,D,B,f){try{c("tengu_setup_github_actions_started",{skip_workflow:I,has_api_key:!!$,using_default_secret_name:A==="ANTHROPIC_API_KEY",selected_claude_workflow:D.includes("claude"),selected_claude_review_workflow:D.includes("claude-review"),...f});let E=await jA("gh",["api",`repos/${H}`,"--jq",".id"]);if(E.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"repo_not_found",exit_code:E.code,...f}),Error(`Failed to access repository ${H}`);let M=await jA("gh",["api",`repos/${H}`,"--jq",".default_branch"]);if(M.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"failed_to_get_default_branch",exit_code:M.code,...f}),Error(`Failed to get default branch: ${M.stderr}`);let G=M.stdout.trim(),U=await jA("gh",["api",`repos/${H}/git/ref/heads/${G}`,"--jq",".object.sha"]);if(U.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"failed_to_get_branch_sha",exit_code:U.code,...f}),Error(`Failed to get branch SHA: ${U.stderr}`);let X=U.stdout.trim(),J=null;if(!I){L(),J=`add-claude-github-actions-${Date.now()}`;let F=await jA("gh",["api","--method","POST",`repos/${H}/git/refs`,"-f",`ref=refs/heads/${J}`,"-f",`sha=${X}`]);if(F.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"failed_to_create_branch",exit_code:F.code,...f}),Error(`Failed to create branch: ${F.stderr}`);L();let Q=[];if(D.includes("claude"))Q.push({path:".github/workflows/claude.yml",content:fhD,message:"Claude PR Assistant workflow"});if(D.includes("claude-review"))Q.push({path:".github/workflows/claude-code-review.yml",content:MhD,message:"Claude Code Review workflow"});for(let W of Q)await EQ1(H,J,W.path,W.content,A,W.message,f)}if(L(),$){let F=await jA("gh",["secret","set",A,"--body",$,"--repo",H]);if(F.code!==0){c("tengu_setup_github_actions_failed",{reason:"failed_to_set_api_key_secret",exit_code:F.code,...f});let Q=` `+"\u2022 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";throw Error(`Failed to set API key secret: ${F.stderr||"Unknown error"}${Q}`)}}if(!I&&J){L();let F=`https://github.com/${H}/compare/${G}...${J}?quick_pull=1&title=${encodeURIComponent(BhD)}&body=${encodeURIComponent(EhD)}`;await HE(F)}c("tengu_setup_github_actions_completed",{skip_workflow:I,has_api_key:!!$,auth_type:B,using_default_secret_name:A==="ANTHROPIC_API_KEY",selected_claude_workflow:D.includes("claude"),selected_claude_review_workflow:D.includes("claude-review"),...f}),AA((F)=>({...F,githubActionSetupCount:(F.githubActionSetupCount??0)+1}))}catch(E){if(!E||!(E instanceof Error)||!E.message.includes("Failed to"))c("tengu_setup_github_actions_failed",{reason:"unexpected_error",...f});if(E instanceof Error)r(E);throw E}}var khD=K(()=>{B0();F3();z$();_$();vA()});function ghD({onSuccess:H,onCancel:$}){let[A,L]=d3.useState({state:"starting"}),[I]=d3.useState(()=>new DbH),[D,B]=d3.useState(""),[f,E]=d3.useState(0),[M,G]=d3.useState(!1),[U,X]=d3.useState(!1),J=d3.useRef(new Set),F=QL(),Q=Math.max(50,F.columns-uhD.length-4);WL((Y,Z)=>{if(A.state==="error")if(Z.return&&A.toRetry)B(""),E(0),L({state:"about_to_retry",nextState:A.toRetry});else $()});async function W(Y,Z){try{let[q,O]=Y.split("#");if(!q||!O){L({state:"error",message:"Invalid code. Please make sure the full code was copied",toRetry:{state:"waiting_for_login",url:Z}});return}c("tengu_oauth_manual_entry",{}),I.handleManualAuthCodeInput({authorizationCode:q,state:O})}catch(q){r(q instanceof Error?q:Error(String(q))),L({state:"error",message:q.message,toRetry:{state:"waiting_for_login",url:Z}})}}let P=d3.useCallback(async()=>{J.current.forEach((Y)=>clearTimeout(Y)),J.current.clear();try{let Y=await I.startOAuthFlow(async(O)=>{L({state:"waiting_for_login",url:O});let j=setTimeout(()=>G(!0),3000);J.current.add(j)},{loginWithClaudeAi:!0,inferenceOnly:!0,expiresIn:31536000});L({state:"processing"});let Z=OqH(Y);if(Z.warning)c("tengu_oauth_storage_warning",{warning:Z.warning});let q=setTimeout(()=>{L({state:"success",token:Y.accessToken});let O=setTimeout(()=>{H(Y.accessToken)},1000);J.current.add(O)},100);J.current.add(q)}catch(Y){let Z=Y.message;L({state:"error",message:Z,toRetry:{state:"starting"}}),r(Y instanceof Error?Y:Error(String(Y))),c("tengu_oauth_error",{error:Z})}},[I,H]);d3.useEffect(()=>{if(A.state==="starting")P()},[A.state,P]),d3.useEffect(()=>{if(A.state==="about_to_retry"){let Y=setTimeout(()=>{if(A.nextState.state==="waiting_for_login")G(!0);else G(!1);L(A.nextState)},500);J.current.add(Y)}},[A]),d3.useEffect(()=>{if(D==="c"&&A.state==="waiting_for_login"&&M&&!U)K3(A.url).then((Y)=>{if(Y)X(!0),setTimeout(()=>X(!1),2000)}),B("")},[D,A,M,U]),d3.useEffect(()=>{let Y=J.current;return()=>{I.cleanup(),Y.forEach((Z)=>clearTimeout(Z)),Y.clear()}},[I]);function C(){switch(A.state){case"starting":return E8.default.createElement(x,null,E8.default.createElement(vD,null),E8.default.createElement(V,null,"Starting authentication\u2026"));case"waiting_for_login":return E8.default.createElement(x,{flexDirection:"column",gap:1},!M&&E8.default.createElement(x,null,E8.default.createElement(vD,null),E8.default.createElement(V,null,"Opening browser to sign in with your Claude account\u2026")),M&&E8.default.createElement(x,null,E8.default.createElement(V,null,uhD),E8.default.createElement(W9,{value:D,onChange:B,onSubmit:(Y)=>W(Y,A.url),cursorOffset:f,onChangeCursorOffset:E,columns:Q})));case"processing":return E8.default.createElement(x,null,E8.default.createElement(vD,null),E8.default.createElement(V,null,"Processing authentication\u2026"));case"success":return E8.default.createElement(x,{flexDirection:"column",gap:1},E8.default.createElement(V,{color:"success"},"\u2713 Authentication token created successfully!"),E8.default.createElement(V,{dimColor:!0},"Using token for GitHub Actions setup\u2026"));case"error":return E8.default.createElement(x,{flexDirection:"column",gap:1},E8.default.createElement(V,{color:"error"},"OAuth error: ",A.message),A.toRetry?E8.default.createElement(V,{dimColor:!0},"Press Enter to try again, or any other key to cancel"):E8.default.createElement(V,{dimColor:!0},"Press any key to return to API key selection"));case"about_to_retry":return E8.default.createElement(x,{flexDirection:"column",gap:1},E8.default.createElement(V,{color:"permission"},"Retrying\u2026"));default:return null}}return E8.default.createElement(x,{flexDirection:"column",gap:1},A.state==="starting"&&E8.default.createElement(x,{flexDirection:"column",gap:1,paddingBottom:1},E8.default.createElement(V,{bold:!0},"Create Authentication Token"),E8.default.createElement(V,{dimColor:!0},"Creating a long-lived token for GitHub Actions")),A.state!=="success"&&A.state!=="starting"&&A.state!=="processing"&&E8.default.createElement(x,{key:"header",flexDirection:"column",gap:1,paddingBottom:1},E8.default.createElement(V,{bold:!0},"Create Authentication Token"),E8.default.createElement(V,{dimColor:!0},"Creating a long-lived token for GitHub Actions")),A.state==="waiting_for_login"&&M&&E8.default.createElement(x,{flexDirection:"column",key:"urlToCopy",gap:1,paddingBottom:1},E8.default.createElement(x,{paddingX:1},E8.default.createElement(V,{dimColor:!0},"Browser didn't open? Use the url below to sign in"," "),U?E8.default.createElement(V,{color:"success"},"(Copied!)"):E8.default.createElement(V,{dimColor:!0},E8.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),E8.default.createElement(dI,{url:A.url},E8.default.createElement(V,{dimColor:!0},A.url))),E8.default.createElement(x,{paddingLeft:1,flexDirection:"column",gap:1},C()))}var E8,d3,uhD="Paste code here if prompted > ";var mhD=K(()=>{xH();pm();lB();S5();x2A();EI();z$();JM();_$();OB();E8=b(s(),1),d3=b(s(),1)});var phD={};XA(phD,{call:()=>UQ1});function GQ1(H){let[$]=A4.useState(()=>eZ()),[A,L]=A4.useState({...MQ1,useExistingKey:!!$,selectedApiKeyOption:$?"existing":p_()?"oauth":"new"});zB(),A4.default.useEffect(()=>{c("tengu_install_github_app_started",{})},[]);let I=A4.useCallback(async()=>{let O=[];if((await fE("gh --version",{shell:!0,reject:!1})).exitCode!==0)O.push({title:"GitHub CLI not found",message:"GitHub CLI (gh) does not appear to be installed or accessible.",instructions:["Install GitHub CLI from https://cli.github.com/","macOS: brew install gh","Windows: winget install --id GitHub.cli","Linux: See installation instructions at https://github.com/cli/cli#installation"]});let u=await fE("gh auth status -a",{shell:!0,reject:!1});if(u.exitCode!==0)O.push({title:"GitHub CLI not authenticated",message:"GitHub CLI does not appear to be authenticated.",instructions:["Run: gh auth login","Follow the prompts to authenticate with GitHub","Or set up authentication using environment variables or other methods"]});else{let g=u.stdout.match(/Token scopes:.*$/m);if(g){let h=g[0],p=[];if(!h.includes("repo"))p.push("repo");if(!h.includes("workflow"))p.push("workflow");if(p.length>0){L((d)=>({...d,step:"error",error:`GitHub CLI is missing required permissions: ${p.join(", ")}.`,errorReason:"Missing required scopes",errorInstructions:[`Your GitHub CLI authentication is missing the "${p.join('" and "')}" scope${p.length>1?"s":""} needed to manage GitHub Actions and secrets.`,"","To fix this, run:"," gh auth refresh -h github.com -s repo,workflow","","This will add the necessary permissions to manage workflows and secrets."]}));return}}}let y=await h9L()??"";c("tengu_install_github_app_step_completed",{step:"check-gh"}),L((g)=>({...g,warnings:O,currentRepo:y,selectedRepoName:y,useCurrentRepo:!!y,step:O.length>0?"warnings":"choose-repo"}))},[]);A4.default.useEffect(()=>{if(A.step==="check-gh")I()},[A.step,I]);let D=A4.useCallback(async(O,j)=>{L((u)=>({...u,step:"creating",currentWorkflowInstallStep:0}));try{await bhD(A.selectedRepoName,O,j,()=>{L((u)=>({...u,currentWorkflowInstallStep:u.currentWorkflowInstallStep+1}))},A.workflowAction==="skip",A.selectedWorkflows,A.authType,{useCurrentRepo:A.useCurrentRepo,workflowExists:A.workflowExists,secretExists:A.secretExists}),c("tengu_install_github_app_step_completed",{step:"creating"}),L((u)=>({...u,step:"success"}))}catch(u){let y=u instanceof Error?u.message:"Failed to set up GitHub Actions";if(y.includes("workflow file already exists"))c("tengu_install_github_app_error",{reason:"workflow_file_exists"}),L((g)=>({...g,step:"error",error:"A Claude workflow file already exists in this repository.",errorReason:"Workflow file conflict",errorInstructions:["The file .github/workflows/claude.yml already exists","You can either:"," 1. Delete the existing file and run this command again"," 2. Update the existing file manually using the template from:",` ${Xb}`]}));else c("tengu_install_github_app_error",{reason:"setup_github_actions_failed"}),L((g)=>({...g,step:"error",error:y,errorReason:"GitHub Actions setup failed",errorInstructions:[]}))}},[A.selectedRepoName,A.workflowAction,A.selectedWorkflows,A.useCurrentRepo,A.workflowExists,A.secretExists,A.authType]);async function B(){await HE("https://github.com/apps/claude")}async function f(O){try{let j=await jA("gh",["api",`repos/${O}`,"--jq",".permissions.admin"]);if(j.code===0)return{hasAccess:j.stdout.trim()==="true"};if(j.stderr.includes("404")||j.stderr.includes("Not Found"))return{hasAccess:!1,error:"repository_not_found"};return{hasAccess:!1}}catch{return{hasAccess:!1}}}async function E(O){return(await jA("gh",["api",`repos/${O}/contents/.github/workflows/claude.yml`,"--jq",".sha"])).code===0}async function M(){let O=await jA("gh",["secret","list","--app","actions","--repo",A.selectedRepoName]);if(O.code===0)if(O.stdout.split(` `).some((y)=>{return/^ANTHROPIC_API_KEY\s+/.test(y)}))L((y)=>({...y,secretExists:!0,step:"check-existing-secret"}));else if($)L((y)=>({...y,apiKeyOrOAuthToken:$,useExistingKey:!0})),await D($,A.secretName);else L((y)=>({...y,step:"api-key"}));else if($)L((j)=>({...j,apiKeyOrOAuthToken:$,useExistingKey:!0})),await D($,A.secretName);else L((j)=>({...j,step:"api-key"}))}let G=async()=>{if(A.step==="warnings")c("tengu_install_github_app_step_completed",{step:"warnings"}),L((O)=>({...O,step:"install-app"})),setTimeout(()=>{B()},0);else if(A.step==="choose-repo"){let O=A.useCurrentRepo?A.currentRepo:A.selectedRepoName;if(!O.trim())return;let j=[];if(O.includes("github.com")){let g=O.match(/github\.com[:/]([^/]+\/[^/]+)(\.git)?$/);if(!g)j.push({title:"Invalid GitHub URL format",message:"The repository URL format appears to be invalid.",instructions:["Use format: owner/repo or https://github.com/owner/repo","Example: anthropics/claude-cli"]});else O=g[1]?.replace(/\.git$/,"")||""}if(!O.includes("/"))j.push({title:"Repository format warning",message:'Repository should be in format "owner/repo"',instructions:["Use format: owner/repo","Example: anthropics/claude-cli"]});let u=await f(O);if(u.error==="repository_not_found")j.push({title:"Repository not found",message:`Repository ${O} was not found or you don't have access.`,instructions:[`Check that the repository name is correct: ${O}`,"Ensure you have access to this repository",'For private repositories, make sure your GitHub token has the "repo" scope',"You can add the repo scope with: gh auth refresh -h github.com -s repo,workflow"]});else if(!u.hasAccess)j.push({title:"Admin permissions required",message:`You might need admin permissions on ${O} to set up GitHub Actions.`,instructions:["Repository admins can install GitHub Apps and set secrets","Ask a repository admin to run this command if setup fails","Alternatively, you can use the manual setup instructions"]});let y=await E(O);if(j.length>0){let g=[...A.warnings,...j];L((h)=>({...h,selectedRepoName:O,workflowExists:y,warnings:g,step:"warnings"}))}else c("tengu_install_github_app_step_completed",{step:"choose-repo"}),L((g)=>({...g,selectedRepoName:O,workflowExists:y,step:"install-app"})),setTimeout(()=>{B()},0)}else if(A.step==="install-app")if(c("tengu_install_github_app_step_completed",{step:"install-app"}),A.workflowExists)L((O)=>({...O,step:"check-existing-workflow"}));else L((O)=>({...O,step:"select-workflows"}));else if(A.step==="check-existing-workflow")return;else if(A.step==="select-workflows")return;else if(A.step==="check-existing-secret")if(c("tengu_install_github_app_step_completed",{step:"check-existing-secret"}),A.useExistingSecret)await D(null,A.secretName);else await D(A.apiKeyOrOAuthToken,A.secretName);else if(A.step==="api-key"){if(A.selectedApiKeyOption==="oauth")return;let O=A.selectedApiKeyOption==="existing"?$:A.apiKeyOrOAuthToken;if(!O){c("tengu_install_github_app_error",{reason:"api_key_missing"}),L((u)=>({...u,step:"error",error:"API key is required"}));return}L((u)=>({...u,apiKeyOrOAuthToken:O,useExistingKey:A.selectedApiKeyOption==="existing"}));let j=await jA("gh",["secret","list","--app","actions","--repo",A.selectedRepoName]);if(j.code===0)if(j.stdout.split(` For manual setup instructions, see: ${Xb}`)}}),A.step){case"check-gh":return A4.default.createElement(AhD,null);case"warnings":return A4.default.createElement(ZhD,{warnings:A.warnings,onContinue:G});case"choose-repo":return A4.default.createElement(IhD,{currentRepo:A.currentRepo,useCurrentRepo:A.useCurrentRepo,repoUrl:A.selectedRepoName,onRepoUrlChange:U,onToggleUseCurrentRepo:C,onSubmit:G});case"install-app":return A4.default.createElement(GhD,{repoUrl:A.selectedRepoName,onSubmit:G});case"check-existing-workflow":return A4.default.createElement(ChD,{repoName:A.selectedRepoName,onSelectAction:q});case"check-existing-secret":return A4.default.createElement(XhD,{useExistingSecret:A.useExistingSecret,secretName:A.secretName,onToggleUseExistingSecret:Z,onSecretNameChange:P,onSubmit:G});case"api-key":return A4.default.createElement(FhD,{existingApiKey:$,useExistingKey:A.useExistingKey,apiKeyOrOAuthToken:A.apiKeyOrOAuthToken,onApiKeyChange:X,onToggleUseExistingKey:Y,onSubmit:G,onCreateOAuthToken:p_()?F:void 0,selectedOption:A.selectedApiKeyOption,onSelectOption:J});case"creating":return A4.default.createElement(QhD,{currentWorkflowInstallStep:A.currentWorkflowInstallStep,secretExists:A.secretExists,useExistingSecret:A.useExistingSecret,secretName:A.secretName,skipWorkflow:A.workflowAction==="skip",selectedWorkflows:A.selectedWorkflows});case"success":return A4.default.createElement(VhD,{secretExists:A.secretExists,useExistingSecret:A.useExistingSecret,secretName:A.secretName,skipWorkflow:A.workflowAction==="skip"});case"error":return A4.default.createElement(_hD,{error:A.error,errorReason:A.errorReason,errorInstructions:A.errorInstructions});case"select-workflows":return A4.default.createElement(vhD,{defaultSelections:A.selectedWorkflows,onSubmit:(O)=>{if(c("tengu_install_github_app_step_completed",{step:"select-workflows"}),L((j)=>({...j,selectedWorkflows:O})),$)M();else L((j)=>({...j,step:"api-key"}))}});case"oauth-flow":return A4.default.createElement(ghD,{onSuccess:Q,onCancel:W})}}async function UQ1(H){return yD("github-app"),A4.default.createElement(GQ1,{onDone:H})}var A4,MQ1;var dhD=K(()=>{xH();EI();UM();B0();O_();t8();F3();LhD();DhD();UhD();JhD();KhD();WhD();PhD();YhD();whD();qhD();hhD();khD();mhD();z$();yE();A4=b(s(),1),MQ1={step:"check-gh",selectedRepoName:"",currentRepo:"",useCurrentRepo:!1,apiKeyOrOAuthToken:"",useExistingKey:!0,currentWorkflowInstallStep:0,warnings:[],secretExists:!1,secretName:"ANTHROPIC_API_KEY",useExistingSecret:!0,workflowExists:!1,selectedWorkflows:["claude","claude-review"],selectedApiKeyOption:"new",authType:"api_key"}});var XQ1,chD;var lhD=K(()=>{EI();XQ1={type:"local-jsx",name:"install-github-app",description:"Set up Claude GitHub Actions for a repository",isEnabled:()=>!process.env.DISABLE_INSTALL_GITHUB_APP_COMMAND&&!$O(),isHidden:!1,load:()=>Promise.resolve().then(() => (dhD(),phD)),userFacingName(){return"install-github-app"}},chD=XQ1});var nhD={};XA(nhD,{call:()=>JQ1});async function JQ1(){if(yD("slack-app"),c("tengu_install_slack_app_clicked",{}),AA(($)=>({...$,slackAppInstallCount:($.slackAppInstallCount??0)+1})),await HE(ihD))return{type:"text",value:"Opening Slack app installation page in browser\u2026"};else return{type:"text",value:`Couldn't open browser. Visit: ${ihD}`}}var ihD="https://slack.com/marketplace/A08SF47R6P4-claude";var rhD=K(()=>{F3();vA();z$();yE()});var FQ1,ahD;var ohD=K(()=>{FQ1={type:"local",name:"install-slack-app",description:"Install the Claude Slack app",isEnabled:()=>!0,isHidden:!1,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (rhD(),nhD)),userFacingName(){return"install-slack-app"}},ahD=FQ1});var thD=()=>{};function ehD(H){switch(H){case"project":return{label:"Project MCPs",path:b3(H)};case"user":return{label:"User MCPs",path:b3(H)};case"local":return{label:"Local MCPs",path:b3(H)};case"enterprise":return{label:"Enterprise MCPs"};case"dynamic":return{label:"Built-in MCPs",path:"always available"};default:return{label:H}}}function KQ1(H){let $=new Map;for(let A of H){let L=A.scope;if(!$.has(L))$.set(L,[]);$.get(L).push(A)}for(let[,A]of $)A.sort((L,I)=>L.name.localeCompare(I.name));return $}function _RA({servers:H,agentServers:$=[],onSelectServer:A,onSelectAgentServer:L,onComplete:I}){let[D]=_I(),[B,f]=Z0.useState(0),E=Z0.default.useMemo(()=>{let O=H.filter((j)=>j.client.config.type!=="claudeai-proxy");return KQ1(O)},[H]),M=Z0.default.useMemo(()=>H.filter((O)=>O.client.config.type==="claudeai-proxy").sort((O,j)=>O.name.localeCompare(j.name)),[H]),G=Z0.default.useMemo(()=>(E.get("dynamic")??[]).sort((O,j)=>O.name.localeCompare(j.name)),[E]),U=ehD("dynamic"),X=Z0.default.useMemo(()=>{let O=[];for(let j of shD){let u=E.get(j)??[];for(let y of u)O.push({type:"server",server:y})}for(let j of M)O.push({type:"server",server:j});for(let j of $)O.push({type:"agent-server",agentServer:j});for(let j of G)O.push({type:"server",server:j});return O},[E,M,$,G]),J=Z0.useCallback(()=>{I("MCP dialog dismissed",{display:"system"})},[I]),F=Z0.useCallback(()=>{let O=X[B];if(!O)return;if(O.type==="server")A(O.server);else if(O.type==="agent-server"&&L)L(O.agentServer)},[X,B,A,L]);bI({"confirm:previous":()=>f((O)=>O===0?X.length-1:O-1),"confirm:next":()=>f((O)=>O===X.length-1?0:O+1),"confirm:yes":F,"confirm:no":J},{context:"Confirmation"});let Q=(O)=>{return X.findIndex((j)=>j.type==="server"&&j.server===O)},W=(O)=>{return X.findIndex((j)=>j.type==="agent-server"&&j.agentServer===O)},P=QEH(),C=H.some((O)=>O.client.type==="failed");if(H.length===0&&$.length===0)return null;let Y=(O)=>{let j=Q(O),u=B===j,y="",g="";if(O.client.type==="disabled")y=ZL("inactive",D)(pH.radioOff),g="disabled";else if(O.client.type==="connected")y=ZL("success",D)(pH.tick),g="connected";else if(O.client.type==="pending"){y=ZL("inactive",D)(pH.radioOff);let{reconnectAttempt:h,maxReconnectAttempts:p}=O.client;if(h&&p)g=`reconnecting (${h}/${p})\u2026`;else g="connecting\u2026"}else if(O.client.type==="needs-auth")y=ZL("warning",D)(pH.triangleUpOutline),g="needs authentication";else y=ZL("error",D)(pH.cross),g="failed";return Z0.default.createElement(x,{key:`${O.name}-${j}`},Z0.default.createElement(V,{color:u?"suggestion":void 0},u?`${pH.pointer} `:" "),Z0.default.createElement(V,{color:u?"suggestion":void 0},O.name),Z0.default.createElement(V,{dimColor:!u}," \xB7 ",y," "),Z0.default.createElement(V,{dimColor:!u},g))},Z=(O)=>{let j=W(O),u=B===j,y=O.needsAuth?ZL("warning",D)(pH.triangleUpOutline):ZL("inactive",D)(pH.radioOff),g=O.needsAuth?"may need auth":"agent-only";return Z0.default.createElement(x,{key:`agent-${O.name}-${j}`},Z0.default.createElement(V,{color:u?"suggestion":void 0},u?`${pH.pointer} `:" "),Z0.default.createElement(V,{color:u?"suggestion":void 0},O.name),Z0.default.createElement(V,{dimColor:!u}," \xB7 ",y," "),Z0.default.createElement(V,{dimColor:!u},g))},q=H.length+$.length;return Z0.default.createElement(x,{flexDirection:"column"},Z0.default.createElement(wq$,null),Z0.default.createElement(BL,{title:"Manage MCP servers",subtitle:`${q} server${q===1?"":"s"}`,onCancel:J,hideInputGuide:!0},Z0.default.createElement(x,{flexDirection:"column"},shD.map((O)=>{let j=E.get(O);if(!j||j.length===0)return null;let u=ehD(O);return Z0.default.createElement(x,{key:O,flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},u.label),u.path&&Z0.default.createElement(V,{dimColor:!0}," (",u.path,")")),j.map((y)=>Y(y)))}),M.length>0&&Z0.default.createElement(x,{flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},"claude.ai")),M.map((O)=>Y(O))),$.length>0&&Z0.default.createElement(x,{flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},"Agent MCPs")),[...new Set($.flatMap((O)=>O.sourceAgents))].map((O)=>Z0.default.createElement(x,{key:O,flexDirection:"column",marginTop:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{dimColor:!0},"@",O)),$.filter((j)=>j.sourceAgents.includes(O)).map((j)=>Z(j))))),G.length>0&&Z0.default.createElement(x,{flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},U.label),U.path&&Z0.default.createElement(V,{dimColor:!0}," (",U.path,")")),G.map((O)=>Y(O))),Z0.default.createElement(x,{flexDirection:"column"},C&&Z0.default.createElement(V,{dimColor:!0},P?"\u203B Error logs shown inline with --debug":"\u203B Run claude --debug to see error logs"),Z0.default.createElement(V,{dimColor:!0},Z0.default.createElement(dI,{url:"https://code.claude.com/docs/en/mcp"},"https://code.claude.com/docs/en/mcp")," ","for help")))),Z0.default.createElement(x,{paddingX:1},Z0.default.createElement(V,{dimColor:!0,italic:!0},Z0.default.createElement(rA,null,Z0.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),Z0.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),Z0.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}var Z0,shD;var YRA=K(()=>{xH();$I();E$();jI();fRA();bB();lB();j0();eB();kF();Z0=b(s(),1),shD=["project","local","user","enterprise"]});function Sq$({serverToolsCount:H,serverPromptsCount:$,serverResourcesCount:A}){let L=[];if(H>0)L.push("tools");if(A>0)L.push("resources");if($>0)L.push("prompts");return egH.default.createElement(x,null,egH.default.createElement(V,{bold:!0},"Capabilities: "),egH.default.createElement(V,{color:"text"},L.length>0?egH.default.createElement(rA,null,L):"none"))}var egH;var CRA=K(()=>{xH();eB();egH=b(s(),1)});var HbD=K(()=>{CK();_$();Z$()});function $bD(H){let $="plugin"in H?H.plugin:"no-plugin";return`${H.type}:${H.source}:${$}`}function AbD(H,$){if($.length===0)return;H((A)=>{let L=new Set(A.plugins.errors.map((D)=>$bD(D))),I=$.filter((D)=>!L.has($bD(D)));if(I.length===0)return A;return{...A,plugins:{...A.plugins,errors:[...A.plugins.errors,...I]}}})}function LbD(H,$=!1,A){let L=J$((F)=>F.mcp.clients),I=J$((F)=>F.mcp.tools),D=J$((F)=>F.mcp.resources),B=J$((F)=>F.authVersion),f=zI(),E=cP.useRef(new Map),M=cP.useCallback(({tools:F,commands:Q,resources:W,...P})=>{if(P.type==="disabled"||P.type==="failed")F=F??[],Q=Q??[],W=W??[];f((C)=>{let Y=bc(P.name),q=C.mcp.clients.findIndex((y)=>y.name===P.name)===-1?[...C.mcp.clients,P]:C.mcp.clients.map((y)=>y.name===P.name?P:y),O=F===void 0?C.mcp.tools:[...DR(C.mcp.tools,(y)=>y.name?.startsWith(Y)),...F],j=Q===void 0?C.mcp.commands:[...DR(C.mcp.commands,(y)=>y.name?.startsWith(Y)),...Q],u=W===void 0?C.mcp.resources:{...C.mcp.resources,...W.length>0?{[P.name]:W}:VEH(C.mcp.resources,P.name)};return{...C,mcp:{...C.mcp,clients:q,tools:O,commands:j,resources:u}}})},[f]),G=cP.useCallback(({client:F,tools:Q,commands:W,resources:P})=>{switch(M({...F,tools:Q,commands:W,resources:P}),F.type){case"connected":{if(F.client.onclose=()=>{let C=F.config.type??"stdio";if(lh(F.name,F.config).catch(()=>{N(`Failed to invalidate the server cache: ${F.name}`)}),NuH(F.name)){TA(F.name,"Server is disabled, skipping automatic reconnection");return}if(C!=="stdio"&&C!=="sdk"){let Y=VQ1(C);TA(F.name,`${Y} transport closed/disconnected, attempting automatic reconnection`);let Z=E.current.get(F.name);if(Z)clearTimeout(Z),E.current.delete(F.name);(async()=>{for(let O=1;O<=jVH;O++){if(NuH(F.name)){TA(F.name,"Server disabled during reconnection, stopping retry"),E.current.delete(F.name);return}M({...F,type:"pending",reconnectAttempt:O,maxReconnectAttempts:jVH});let j=Date.now();try{let y=await ih(F.name,F.config),g=Date.now()-j;if(y.client.type==="connected"){TA(F.name,`${Y} reconnection successful after ${g}ms (attempt ${O})`),E.current.delete(F.name),G(y);return}if(TA(F.name,`${Y} reconnection attempt ${O} completed with status: ${y.client.type}`),O===jVH){TA(F.name,`Max reconnection attempts (${jVH}) reached, giving up`),E.current.delete(F.name),G(y);return}}catch(y){let g=Date.now()-j;if(ME(F.name,`${Y} reconnection attempt ${O} failed after ${g}ms: ${y}`),O===jVH){TA(F.name,`Max reconnection attempts (${jVH}) reached, giving up`),E.current.delete(F.name),M({...F,type:"failed"});return}}let u=Math.min(QQ1*Math.pow(2,O-1),WQ1);TA(F.name,`Scheduling reconnection attempt ${O+1} in ${u}ms`),await new Promise((y)=>{let g=setTimeout(y,u);E.current.set(F.name,g)})}})()}else M({...F,type:"failed"})},F.capabilities?.tools?.listChanged)F.client.setNotificationHandler(SXA,async()=>{TA(F.name,"Received tools/list_changed notification, refreshing tools");try{let C=zS.cache.get(F);zS.cache.delete(F);let Y=await zS(F),Z=Y.length;if(C)C.then((q)=>{c("tengu_mcp_list_changed",{type:"tools",previousCount:q.length,newCount:Z})},()=>{c("tengu_mcp_list_changed",{type:"tools",newCount:Z})});else c("tengu_mcp_list_changed",{type:"tools",newCount:Z});M({...F,tools:Y})}catch(C){ME(F.name,`Failed to refresh tools after list_changed notification: ${C instanceof Error?C.message:String(C)}`)}});if(F.capabilities?.prompts?.listChanged)F.client.setNotificationHandler(xXA,async()=>{TA(F.name,"Received prompts/list_changed notification, refreshing prompts"),c("tengu_mcp_list_changed",{type:"prompts"});try{buH.cache.delete(F);let C=await buH(F);M({...F,commands:C})}catch(C){ME(F.name,`Failed to refresh prompts after list_changed notification: ${C instanceof Error?C.message:String(C)}`)}});if(F.capabilities?.resources?.listChanged)F.client.setNotificationHandler(ZXA,async()=>{TA(F.name,"Received resources/list_changed notification, refreshing resources"),c("tengu_mcp_list_changed",{type:"resources"});try{huH.cache.delete(F);let C=await huH(F);M({...F,resources:C})}catch(C){ME(F.name,`Failed to refresh resources after list_changed notification: ${C instanceof Error?C.message:String(C)}`)}});break}case"needs-auth":case"failed":case"pending":case"disabled":case"proxy":break}},[M]),U=j$();cP.useEffect(()=>{async function F(){let{servers:Q,errors:W}=$?{servers:{},errors:[]}:await Q3H(),P={...Q,...H};AbD(f,W),f((C)=>{let Y=new Set(C.mcp.clients.map((q)=>q.name)),Z=Object.entries(P).filter(([q])=>!Y.has(q)).map(([q,O])=>({name:q,type:"pending",config:O}));if(Z.length===0)return C;return{...C,mcp:{...C.mcp,clients:[...C.mcp.clients,...Z]}}})}F().catch((Q)=>{ME("useManageMCPConnections",`Failed to initialize servers as pending: ${Q instanceof Error?Q.message:String(Q)}`)})},[$,H,f,U]),cP.useEffect(()=>{let F=!1;async function Q(){zZD();let{servers:W,errors:P}=$?{servers:{},errors:[]}:await Q3H();if(F)return;AbD(f,P);let C={...W,...H};i2$(G,C).catch((O)=>{ME("useManageMcpConnections",`Failed to get MCP resources: ${O instanceof Error?O.message:String(O)}`)});let Y={};if(!$){if(Y=await ZuH(),F)return;if(Object.keys(Y).length>0)f((O)=>{let j=new Set(O.mcp.clients.map((y)=>y.name)),u=Object.entries(Y).filter(([y])=>!j.has(y)).map(([y,g])=>({name:y,type:"pending",config:g}));if(u.length===0)return O;return{...O,mcp:{...O.mcp,clients:[...O.mcp.clients,...u]}}}),i2$(G,Y).catch((O)=>{ME("useManageMcpConnections",`Failed to get claude.ai MCP resources: ${O instanceof Error?O.message:String(O)}`)})}let Z={...C,...Y},q={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0};for(let O of Object.values(Z))if(O.scope==="enterprise")q.enterprise++;else if(O.scope==="user")q.global++;else if(O.scope==="project")q.project++;else if(O.scope==="local")q.user++;else if(O.scope==="dynamic")q.plugin++;else if(O.scope==="claudeai")q.claudeai++;c("tengu_mcp_servers",q)}return Q(),()=>{F=!0}},[$,H,G,U,B,f]),cP.useEffect(()=>{let F=E.current;return()=>{for(let Q of F.values())clearTimeout(Q);F.clear()}},[]),cP.useEffect(()=>{},[L,f]),cP.useEffect(()=>A?.updateClients(L),[A,L]),cP.useEffect(()=>A?.updateTools(I),[A,I]),cP.useEffect(()=>A?.updateResources(D),[A,D]);let X=cP.useCallback(async(F)=>{let Q=L.find((C)=>C.name===F);if(!Q)throw Error(`MCP server ${F} not found`);let W=E.current.get(F);if(W)clearTimeout(W),E.current.delete(F);let P=await ih(F,Q.config);return G(P),P},[L,G,f]),J=cP.useCallback(async(F)=>{let Q=L.find((P)=>P.name===F);if(!Q)throw Error(`MCP server ${F} not found`);if(Q.type!=="disabled"){let P=E.current.get(F);if(P)clearTimeout(P),E.current.delete(F);if(W3H(F,!1),Q.type==="connected")await lh(F,Q.config);M({name:F,type:"disabled",config:Q.config})}else{W3H(F,!0),M({name:F,type:"pending",config:Q.config});let P=await ih(F,Q.config);G(P)}},[L,M,G,f]);return{reconnectMcpServer:X,toggleMcpServer:J}}function VQ1(H){switch(H){case"http":return"HTTP";case"ws":case"ws-ide":return"WebSocket";default:return"SSE"}}var cP,jVH=5,QQ1=1000,WQ1=30000;var IbD=K(()=>{g$();f3();_$();CK();pL();UR$();XR$();T3();lNA();tC();E$();z$();HbD();cP=b(s(),1)});function RVH(){let H=Gd.useContext(wRA);if(!H)throw Error("useMcpReconnect must be used within MCPConnectionManager");return H.reconnectMcpServer}function _s(){let H=Gd.useContext(wRA);if(!H)throw Error("useMcpToggleEnabled must be used within MCPConnectionManager");return H.toggleMcpServer}function jq$({children:H,dynamicMcpConfig:$,isStrictMcpConfig:A,mcpCliEndpoint:L}){let{reconnectMcpServer:I,toggleMcpServer:D}=LbD($,A,L),B=Gd.useMemo(()=>({reconnectMcpServer:I,toggleMcpServer:D}),[I,D]);return Gd.default.createElement(wRA.Provider,{value:B},H)}var Gd,wRA;var Ys=K(()=>{IbD();Gd=b(s(),1),wRA=Gd.createContext(null)});function Rq$(H,$){switch(H.client.type){case"connected":return{message:`Reconnected to ${$}.`,success:!0};case"needs-auth":return{message:`${$} requires authentication. Use the 'Authenticate' option.`,success:!1};case"failed":return{message:`Failed to reconnect to ${$}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${$}.`,success:!1}}}function HmH(H,$){let A=H instanceof Error?H.message:String(H);return`Error reconnecting to ${$}: ${A}`}function $mH({server:H,serverToolsCount:$,onViewTools:A,onCancel:L,onComplete:I,borderless:D=!1}){let[B]=_I(),f=zB(),E=J$((P)=>P.mcp),M=RVH(),G=_s(),[U,X]=s0.useState(!1),J=s0.default.useCallback(async()=>{let P=H.client.type!=="disabled";try{await G(H.name),L()}catch(C){I(`Failed to ${P?"disable":"enable"} MCP server '${H.name}': ${C instanceof Error?C.message:String(C)}`)}},[H.client.type,H.name,G,L,I]),F=String(H.name).charAt(0).toUpperCase()+String(H.name).slice(1),Q=Z2$(E.commands,H.name).length,W=[];if(H.client.type!=="disabled"&&$>0)W.push({label:"View tools",value:"tools"});if(H.client.type!=="disabled")W.push({label:"Reconnect",value:"reconnectMcpServer"});if(W.push({label:H.client.type!=="disabled"?"Disable":"Enable",value:"toggle-enabled"}),W.length===0)W.push({label:"Back",value:"back"});if(U)return s0.default.createElement(x,{flexDirection:"column",gap:1,padding:1},s0.default.createElement(V,{color:"text"},"Reconnecting to ",s0.default.createElement(V,{bold:!0},H.name)),s0.default.createElement(x,null,s0.default.createElement(vD,null),s0.default.createElement(V,null," Restarting MCP server process")),s0.default.createElement(V,{dimColor:!0},"This may take a few moments."));return s0.default.createElement(x,{flexDirection:"column"},s0.default.createElement(x,{flexDirection:"column",paddingX:1,borderStyle:D?void 0:"round"},s0.default.createElement(x,{marginBottom:1},s0.default.createElement(V,{bold:!0},F," MCP Server")),s0.default.createElement(x,{flexDirection:"column",gap:0},s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Status: "),H.client.type==="disabled"?s0.default.createElement(V,null,ZL("inactive",B)(pH.radioOff)," disabled"):H.client.type==="connected"?s0.default.createElement(V,null,ZL("success",B)(pH.tick)," connected"):H.client.type==="pending"?s0.default.createElement(s0.default.Fragment,null,s0.default.createElement(V,{dimColor:!0},pH.radioOff),s0.default.createElement(V,null," connecting\u2026")):s0.default.createElement(V,null,ZL("error",B)(pH.cross)," failed")),s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Command: "),s0.default.createElement(V,{dimColor:!0},H.config.command)),H.config.args&&H.config.args.length>0&&s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Args: "),s0.default.createElement(V,{dimColor:!0},H.config.args.join(" "))),s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Config location: "),s0.default.createElement(V,{dimColor:!0},b3(Mz(H.name)?.scope??"dynamic"))),H.client.type==="connected"&&s0.default.createElement(Sq$,{serverToolsCount:$,serverPromptsCount:Q,serverResourcesCount:E.resources[H.name]?.length||0}),H.client.type==="connected"&&$>0&&s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Tools: "),s0.default.createElement(V,{dimColor:!0},$," tools"))),W.length>0&&s0.default.createElement(x,{marginTop:1},s0.default.createElement(QA,{options:W,onChange:async(P)=>{if(P==="tools")A();else if(P==="reconnectMcpServer"){X(!0);try{let C=await M(H.name),{message:Y}=Rq$(C,H.name);I?.(Y)}catch(C){I?.(HmH(C,H.name))}finally{X(!1)}}else if(P==="toggle-enabled")await J();else if(P==="back")L()},onCancel:L}))),s0.default.createElement(x,{marginTop:1},s0.default.createElement(V,{dimColor:!0,italic:!0},f.pending?s0.default.createElement(s0.default.Fragment,null,"Press ",f.keyName," again to exit"):s0.default.createElement(rA,null,s0.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),s0.default.createElement(s$,{shortcut:"Enter",action:"select"}),s0.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}var s0;var yq$=K(()=>{xH();l8();UM();eB();lB();j0();jI();pL();kF();T3();CRA();Ys();JM();s0=b(s(),1)});function z1H({server:H,serverToolsCount:$,onViewTools:A,onCancel:L,onComplete:I,borderless:D=!1}){let[B]=_I(),f=zB(),[E,M]=LL.default.useState(!1),[G,U]=LL.default.useState(null),X=J$((LH)=>LH.mcp),J=zI(),[F,Q]=LL.default.useState(null),[W,P]=LL.useState(!1),[C,Y]=LL.useState(null),[Z,q]=LL.useState(!1),[O,j]=LL.useState(null),[u,y]=LL.useState(!1),[g,h]=LL.useState(null),[p,d]=LL.useState(!1),[k,n]=LL.useState(!1),GH=H.isAuthenticated||H.client.type==="connected"&&$>0,HH=RVH(),BH=LL.default.useCallback(async()=>{q(!1),j(null),P(!0);try{let LH=await HH(H.name),e=LH.client.type==="connected";if(c("tengu_claudeai_mcp_auth_completed",{success:e}),e)I?.(`Authentication successful. Connected to ${H.name}.`);else if(LH.client.type==="needs-auth")I?.("Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.");else I?.("Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.")}catch(LH){c("tengu_claudeai_mcp_auth_completed",{success:!1}),I?.(HmH(LH,H.name))}finally{P(!1)}},[HH,H.name,I]),WH=LL.default.useCallback(async()=>{await lh(H.name,{...H.config,scope:H.scope}),J((LH)=>{let e=LH.mcp.clients.map((FH)=>FH.name===H.name?{...FH,type:"needs-auth"}:FH),DH=aNA(LH.mcp.tools,H.name),EH=oNA(LH.mcp.commands,H.name),$H=tNA(LH.mcp.resources,H.name);return{...LH,mcp:{clients:e,tools:DH,commands:EH,resources:$H}}}),c("tengu_claudeai_mcp_clear_auth_completed",{}),I?.(`Disconnected from ${H.name}.`),y(!1),h(null),d(!1)},[H.name,H.config,H.scope,J,I]);BA("confirm:no",()=>{if(C)C.abort();M(!1),Q(null),Y(null)},{context:"Confirmation",isActive:E}),BA("confirm:no",()=>{q(!1),j(null)},{context:"Confirmation",isActive:Z}),BA("confirm:no",()=>{y(!1),h(null),d(!1)},{context:"Confirmation",isActive:u}),WL((LH,e)=>{if(e.return&&Z)BH();if(e.return&&u)if(p)WH();else{let DH=XD(),$H=`${new URL(DH.CLAUDE_AI_AUTHORIZE_URL).origin}/settings/connectors`;h($H),d(!0),HE($H)}if(LH==="c"&&!k){let DH=F||O||g;if(DH)K3(DH).then((EH)=>{if(EH)n(!0),setTimeout(()=>n(!1),2000)})}});let wH=String(H.name).charAt(0).toUpperCase()+String(H.name).slice(1),QH=Z2$(X.commands,H.name).length,TH=_s(),t=LL.default.useCallback(async()=>{let LH=XD(),e=new URL(LH.CLAUDE_AI_AUTHORIZE_URL).origin,EH=T9()?.organizationUuid,$H;if(EH&&H.config.type==="claudeai-proxy"&&H.config.id){let FH=H.config.id.startsWith("mcprs")?"mcpsrv"+H.config.id.slice(5):H.config.id;$H=`${e}/api/organizations/${EH}/mcp/start-auth/${FH}`}else $H=`${e}/settings/connectors`;j($H),q(!0),c("tengu_claudeai_mcp_auth_started",{}),await HE($H)},[H.config]),IH=LL.default.useCallback(()=>{y(!0),c("tengu_claudeai_mcp_clear_auth_started",{})},[]),KH=LL.default.useCallback(async()=>{let LH=H.client.type!=="disabled";try{if(await TH(H.name),H.config.type==="claudeai-proxy")c("tengu_claudeai_mcp_toggle",{new_state:LH?"disabled":"enabled"});L()}catch(e){I?.(`Failed to ${LH?"disable":"enable"} MCP server '${H.name}': ${e instanceof Error?e.message:String(e)}`)}},[H.client.type,H.config.type,H.name,TH,L,I]),MH=LL.default.useCallback(async()=>{if(H.config.type==="claudeai-proxy")return;M(!0),U(null);let LH=new AbortController;Y(LH);try{if(H.isAuthenticated&&H.config)await JOA(H.name,H.config);if(H.config){await m2$(H.name,H.config,Q,LH.signal),c("tengu_mcp_auth_config_authenticate",{wasAuthenticated:H.isAuthenticated});let e=await HH(H.name);if(e.client.type==="connected"){let DH=GH?`Authentication successful. Reconnected to ${H.name}.`:`Authentication successful. Connected to ${H.name}.`;I?.(DH)}else if(e.client.type==="needs-auth")I?.("Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.");else TA(H.name,"Reconnection failed after authentication"),I?.("Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.")}}catch(e){if(e instanceof Error&&!(e instanceof Y3H))U(e.message)}finally{M(!1),Y(null)}},[H.isAuthenticated,H.config,H.name,I,HH,GH]),CH=async()=>{if(H.config.type==="claudeai-proxy")return;if(H.config)await JOA(H.name,H.config),c("tengu_mcp_auth_config_clear",{}),await lh(H.name,{...H.config,scope:H.scope}),J((LH)=>{let e=LH.mcp.clients.map((FH)=>FH.name===H.name?{...FH,type:"failed"}:FH),DH=aNA(LH.mcp.tools,H.name),EH=oNA(LH.mcp.commands,H.name),$H=tNA(LH.mcp.resources,H.name);return{...LH,mcp:{clients:e,tools:DH,commands:EH,resources:$H}}}),I?.(`Authentication cleared for ${H.name}.`)};if(E)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"claude"},"Authenticating with ",H.name,"\u2026"),LL.default.createElement(x,null,LL.default.createElement(vD,null),LL.default.createElement(V,null," A browser window will open for authentication")),F&&LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,null,LL.default.createElement(V,{dimColor:!0},"If your browser doesn't open automatically, copy this URL manually"," "),k?LL.default.createElement(V,{color:"success"},"(Copied!)"):LL.default.createElement(V,{dimColor:!0},LL.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),LL.default.createElement(dI,{url:F})),LL.default.createElement(x,{marginLeft:3},LL.default.createElement(V,{dimColor:!0},"Return here after authenticating in your browser. Press Esc to go back.")));if(Z)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"claude"},"Authenticating with ",H.name,"\u2026"),LL.default.createElement(x,null,LL.default.createElement(vD,null),LL.default.createElement(V,null," A browser window will open for authentication")),O&&LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,null,LL.default.createElement(V,{dimColor:!0},"If your browser doesn't open automatically, copy this URL manually"," "),k?LL.default.createElement(V,{color:"success"},"(Copied!)"):LL.default.createElement(V,{dimColor:!0},LL.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),LL.default.createElement(dI,{url:O})),LL.default.createElement(x,{marginLeft:3,flexDirection:"column"},LL.default.createElement(V,{color:"permission"},"Press ",LL.default.createElement(V,{bold:!0},"Enter")," after authenticating in your browser."),LL.default.createElement(V,{dimColor:!0,italic:!0},LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))));if(u)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"claude"},"Clear authentication for ",H.name),p?LL.default.createElement(LL.default.Fragment,null,LL.default.createElement(V,null,'Find the MCP server in the browser and click "Disconnect".'),g&&LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,null,LL.default.createElement(V,{dimColor:!0},"If your browser didn't open automatically, copy this URL manually"," "),k?LL.default.createElement(V,{color:"success"},"(Copied!)"):LL.default.createElement(V,{dimColor:!0},LL.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),LL.default.createElement(dI,{url:g})),LL.default.createElement(x,{marginLeft:3,flexDirection:"column"},LL.default.createElement(V,{color:"permission"},"Press ",LL.default.createElement(V,{bold:!0},"Enter")," when done."),LL.default.createElement(V,{dimColor:!0,italic:!0},LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))):LL.default.createElement(LL.default.Fragment,null,LL.default.createElement(V,null,'This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".'),LL.default.createElement(x,{marginLeft:3,flexDirection:"column"},LL.default.createElement(V,{color:"permission"},"Press ",LL.default.createElement(V,{bold:!0},"Enter")," to open the browser."),LL.default.createElement(V,{dimColor:!0,italic:!0},LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))));if(W)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"text"},"Connecting to ",LL.default.createElement(V,{bold:!0},H.name),"\u2026"),LL.default.createElement(x,null,LL.default.createElement(vD,null),LL.default.createElement(V,null," Establishing connection to MCP server")),LL.default.createElement(V,{dimColor:!0},"This may take a few moments."));let OH=[];if(H.client.type==="disabled")OH.push({label:"Enable",value:"toggle-enabled"});if(H.client.type==="connected"&&$>0)OH.push({label:"View tools",value:"tools"});if(H.config.type==="claudeai-proxy"){if(H.client.type==="connected")OH.push({label:"Clear authentication",value:"claudeai-clear-auth"});else if(H.client.type!=="disabled")OH.push({label:"Authenticate",value:"claudeai-auth"})}else{if(GH)OH.push({label:"Re-authenticate",value:"reauth"}),OH.push({label:"Clear authentication",value:"clear-auth"});if(!GH)OH.push({label:"Authenticate",value:"auth"})}if(H.client.type!=="disabled"){if(H.client.type!=="needs-auth")OH.push({label:"Reconnect",value:"reconnectMcpServer"});OH.push({label:"Disable",value:"toggle-enabled"})}if(OH.length===0)OH.push({label:"Back",value:"back"});return LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,{flexDirection:"column",paddingX:1,borderStyle:D?void 0:"round"},LL.default.createElement(x,{marginBottom:1},LL.default.createElement(V,{bold:!0},wH," MCP Server")),LL.default.createElement(x,{flexDirection:"column",gap:0},LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Status: "),H.client.type==="disabled"?LL.default.createElement(V,null,ZL("inactive",B)(pH.radioOff)," disabled"):H.client.type==="connected"?LL.default.createElement(V,null,ZL("success",B)(pH.tick)," connected"):H.client.type==="pending"?LL.default.createElement(LL.default.Fragment,null,LL.default.createElement(V,{dimColor:!0},pH.radioOff),LL.default.createElement(V,null," connecting\u2026")):H.client.type==="needs-auth"?LL.default.createElement(V,null,ZL("warning",B)(pH.triangleUpOutline)," needs authentication"):LL.default.createElement(V,null,ZL("error",B)(pH.cross)," failed")),H.transport!=="claudeai-proxy"&&LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Auth: "),GH?LL.default.createElement(V,null,ZL("success",B)(pH.tick)," authenticated"):LL.default.createElement(V,null,ZL("error",B)(pH.cross)," not authenticated")),LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"URL: "),LL.default.createElement(V,{dimColor:!0},H.config.url)),LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Config location: "),LL.default.createElement(V,{dimColor:!0},b3(H.scope))),H.client.type==="connected"&&LL.default.createElement(Sq$,{serverToolsCount:$,serverPromptsCount:QH,serverResourcesCount:X.resources[H.name]?.length||0}),H.client.type==="connected"&&$>0&&LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Tools: "),LL.default.createElement(V,{dimColor:!0},$," tools"))),G&&LL.default.createElement(x,{marginTop:1},LL.default.createElement(V,{color:"error"},"Error: ",G)),OH.length>0&&LL.default.createElement(x,{marginTop:1},LL.default.createElement(QA,{options:OH,onChange:async(LH)=>{switch(LH){case"tools":A();break;case"auth":case"reauth":await MH();break;case"clear-auth":await CH();break;case"claudeai-auth":await t();break;case"claudeai-clear-auth":IH();break;case"reconnectMcpServer":P(!0);try{let e=await HH(H.name);if(H.config.type==="claudeai-proxy")c("tengu_claudeai_mcp_reconnect",{success:e.client.type==="connected"});let{message:DH}=Rq$(e,H.name);I?.(DH)}catch(e){if(H.config.type==="claudeai-proxy")c("tengu_claudeai_mcp_reconnect",{success:!1});I?.(HmH(e,H.name))}finally{P(!1)}break;case"toggle-enabled":await KH();break;case"back":L();break}},onCancel:L}))),LL.default.createElement(x,{marginTop:1},LL.default.createElement(V,{dimColor:!0,italic:!0},f.pending?LL.default.createElement(LL.default.Fragment,null,"Press ",f.keyName," again to exit"):LL.default.createElement(rA,null,LL.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),LL.default.createElement(s$,{shortcut:"Enter",action:"select"}),LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}var LL;var vq$=K(()=>{xH();$I();l8();z$();UM();eB();lB();j0();jI();n9H();JM();f3();pL();_$();kF();CRA();xH();pm();Ys();F3();qE();EI();LL=b(s(),1)});function AmH({server:H,onSelectTool:$,onBack:A}){let L=J$((B)=>B.mcp.tools),I=Jb.default.useMemo(()=>{if(H.client.type!=="connected")return[];return dh(L,H.name)},[H,L]),D=I.map((B,f)=>{let E=UiH(B.name,H.name),M=B.userFacingName?B.userFacingName({}):E,G=XiH(M),U=B.isReadOnly?.({})??!1,X=B.isDestructive?.({})??!1,J=B.isOpenWorld?.({})??!1,F=[];if(U)F.push("read-only");if(X)F.push("destructive");if(J)F.push("open-world");return{label:G,value:f.toString(),description:F.length>0?F.join(", "):void 0,descriptionColor:X?"error":U?"success":void 0}});return Jb.default.createElement(BL,{title:`Tools for ${H.name}`,subtitle:`${I.length} tool${I.length===1?"":"s"}`,onCancel:A,inputGuide:(B)=>B.pending?Jb.default.createElement(V,null,"Press ",B.keyName," again to exit"):Jb.default.createElement(rA,null,Jb.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),Jb.default.createElement(s$,{shortcut:"Enter",action:"select"}),Jb.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))},I.length===0?Jb.default.createElement(V,{dimColor:!0},"No tools available"):Jb.default.createElement(QA,{options:D,onChange:(B)=>{let f=parseInt(B),E=I[f];if(E)$(E,f)},onCancel:A}))}var Jb;var hq$=K(()=>{xH();l8();kF();tC();pL();bB();eB();lB();j0();Jb=b(s(),1)});function LmH({tool:H,server:$,onBack:A}){let[L,I]=pM.default.useState(""),D=UiH(H.name,$.name),B=H.userFacingName?H.userFacingName({}):D,f=XiH(B),E=H.isReadOnly?.({})??!1,M=H.isDestructive?.({})??!1,G=H.isOpenWorld?.({})??!1;return pM.default.useEffect(()=>{async function X(){try{let J=await H.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:"default",additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]});I(J)}catch{I("Failed to load description")}}X()},[H]),pM.default.createElement(BL,{title:pM.default.createElement(pM.default.Fragment,null,f,E&&pM.default.createElement(V,{color:"success"}," [read-only]"),M&&pM.default.createElement(V,{color:"error"}," [destructive]"),G&&pM.default.createElement(V,{dimColor:!0}," [open-world]")),subtitle:$.name,onCancel:A,inputGuide:(X)=>X.pending?pM.default.createElement(V,null,"Press ",X.keyName," again to exit"):pM.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})},pM.default.createElement(x,{flexDirection:"column"},pM.default.createElement(x,null,pM.default.createElement(V,{bold:!0},"Tool name: "),pM.default.createElement(V,{dimColor:!0},D)),pM.default.createElement(x,null,pM.default.createElement(V,{bold:!0},"Full name: "),pM.default.createElement(V,{dimColor:!0},H.name)),L&&pM.default.createElement(x,{flexDirection:"column",marginTop:1},pM.default.createElement(V,{bold:!0},"Description:"),pM.default.createElement(V,{wrap:"wrap"},L)),H.inputJSONSchema&&H.inputJSONSchema.properties&&Object.keys(H.inputJSONSchema.properties).length>0&&pM.default.createElement(x,{flexDirection:"column",marginTop:1},pM.default.createElement(V,{bold:!0},"Parameters:"),pM.default.createElement(x,{marginLeft:2,flexDirection:"column"},Object.entries(H.inputJSONSchema.properties).map(([X,J])=>{let Q=H.inputJSONSchema?.required?.includes(X);return pM.default.createElement(V,{key:X},"\u2022 ",X,Q&&pM.default.createElement(V,{dimColor:!0}," (required)"),":"," ",pM.default.createElement(V,{dimColor:!0},typeof J==="object"&&J&&"type"in J?String(J.type):"unknown"),typeof J==="object"&&J&&"description"in J&&pM.default.createElement(V,{dimColor:!0}," - ",String(J.description)))})))))}var pM;var bq$=K(()=>{xH();tC();bB();j0();pM=b(s(),1)});function ZRA({agentServer:H,onCancel:$,onComplete:A}){let[L]=_I(),[I,D]=Cs.useState(!1),[B,f]=Cs.useState(null),[E,M]=Cs.useState(null),[G,U]=Cs.useState(null),X=Cs.useCallback(()=>{if(I){if(G)G.abort();D(!1),M(null),U(null)}},[I,G]);BA("confirm:no",X,{context:"Confirmation",isActive:I});let J=Cs.useCallback(async()=>{if(!H.needsAuth||!H.url)return;D(!0),f(null);let W=new AbortController;U(W);try{let P={type:H.transport,url:H.url};await m2$(H.name,P,M,W.signal),A?.(`Authentication successful for ${H.name}. The server will connect when the agent runs.`)}catch(P){if(P instanceof Error&&!(P instanceof Y3H))f(P.message)}finally{D(!1),U(null)}},[H,A]),F=String(H.name).charAt(0).toUpperCase()+String(H.name).slice(1);if(I)return p9.default.createElement(x,{flexDirection:"column",gap:1,padding:1},p9.default.createElement(V,{color:"claude"},"Authenticating with ",H.name,"\u2026"),p9.default.createElement(x,null,p9.default.createElement(vD,null),p9.default.createElement(V,null," A browser window will open for authentication")),E&&p9.default.createElement(x,{flexDirection:"column"},p9.default.createElement(V,{dimColor:!0},"If your browser doesn't open automatically, copy this URL manually:"),p9.default.createElement(dI,{url:E})),p9.default.createElement(x,{marginLeft:3},p9.default.createElement(V,{dimColor:!0},"Return here after authenticating in your browser."," ",p9.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))));let Q=[];if(H.needsAuth)Q.push({label:H.isAuthenticated?"Re-authenticate":"Authenticate",value:"auth"});return Q.push({label:"Back",value:"back"}),p9.default.createElement(BL,{title:`${F} MCP Server`,subtitle:"agent-only",onCancel:$,inputGuide:(W)=>W.pending?p9.default.createElement(V,null,"Press ",W.keyName," again to exit"):p9.default.createElement(rA,null,p9.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),p9.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),p9.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},p9.default.createElement(x,{flexDirection:"column",gap:0},p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Type: "),p9.default.createElement(V,{dimColor:!0},H.transport)),H.url&&p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"URL: "),p9.default.createElement(V,{dimColor:!0},H.url)),H.command&&p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Command: "),p9.default.createElement(V,{dimColor:!0},H.command)),p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Used by: "),p9.default.createElement(V,{dimColor:!0},H.sourceAgents.join(", "))),p9.default.createElement(x,{marginTop:1},p9.default.createElement(V,{bold:!0},"Status: "),p9.default.createElement(V,null,ZL("inactive",L)(pH.radioOff)," not connected (agent-only)")),H.needsAuth&&p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Auth: "),H.isAuthenticated?p9.default.createElement(V,null,ZL("success",L)(pH.tick)," authenticated"):p9.default.createElement(V,null,ZL("warning",L)(pH.triangleUpOutline)," may need authentication"))),p9.default.createElement(x,null,p9.default.createElement(V,{dimColor:!0},"This server connects only when running the agent.")),B&&p9.default.createElement(x,null,p9.default.createElement(V,{color:"error"},"Error: ",B)),p9.default.createElement(x,null,p9.default.createElement(QA,{options:Q,onChange:async(W)=>{switch(W){case"auth":await J();break;case"back":$();break}},onCancel:$})))}var p9,Cs;var qRA=K(()=>{xH();$I();j0();l8();jI();n9H();JM();bB();lB();eB();p9=b(s(),1),Cs=b(s(),1)});function kq$({onComplete:H}){let $=J$((G)=>G.mcp),A=J$((G)=>G.agentDefinitions),L=$.clients,[I,D]=lP.default.useState({type:"list"}),[B,f]=lP.default.useState([]),E=lP.useMemo(()=>kZD(A.allAgents),[A.allAgents]),M=lP.default.useMemo(()=>L.filter((G)=>G.name!=="ide").sort((G,U)=>G.name.localeCompare(U.name)),[L]);switch(lP.default.useEffect(()=>{async function G(){let U=await Promise.all(M.map(async(X)=>{let J=X.config.scope,F=X.config.type==="sse",Q=X.config.type==="http",W=X.config.type==="claudeai-proxy",P=void 0;if(F||Q){let Z=await new i9H(X.name,X.config).tokens(),q=wY()!==null&&X.type==="connected",O=X.type==="connected"&&dh($.tools,X.name).length>0;P=Boolean(Z)||q||O}let C={name:X.name,client:X,scope:J};if(W)return{...C,transport:"claudeai-proxy",isAuthenticated:!1,config:X.config};else if(F)return{...C,transport:"sse",isAuthenticated:P,config:X.config};else if(Q)return{...C,transport:"http",isAuthenticated:P,config:X.config};else return{...C,transport:"stdio",config:X.config}}));f(U)}G()},[M,$.tools]),lP.useEffect(()=>{if(B.length===0&&M.length>0)return;if(B.length===0&&E.length===0)H("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.")},[B.length,M.length,E.length,H]),I.type){case"list":return lP.default.createElement(_RA,{servers:B,agentServers:E,onSelectServer:(G)=>D({type:"server-menu",server:G}),onSelectAgentServer:(G)=>D({type:"agent-server-menu",agentServer:G}),onComplete:H,defaultTab:I.defaultTab});case"server-menu":{let G=dh($.tools,I.server.name),U=I.server.transport==="claudeai-proxy"?"claude.ai":"Claude Code";if(I.server.transport==="stdio")return lP.default.createElement($mH,{server:I.server,serverToolsCount:G.length,onViewTools:()=>D({type:"server-tools",server:I.server}),onCancel:()=>D({type:"list",defaultTab:U}),onComplete:H});else return lP.default.createElement(z1H,{server:I.server,serverToolsCount:G.length,onViewTools:()=>D({type:"server-tools",server:I.server}),onCancel:()=>D({type:"list",defaultTab:U}),onComplete:H})}case"server-tools":return lP.default.createElement(AmH,{server:I.server,onSelectTool:(G,U)=>D({type:"server-tool-detail",server:I.server,toolIndex:U}),onBack:()=>D({type:"server-menu",server:I.server})});case"server-tool-detail":{let U=dh($.tools,I.server.name)[I.toolIndex];if(!U)return D({type:"server-tools",server:I.server}),null;return lP.default.createElement(LmH,{tool:U,server:I.server,onBack:()=>D({type:"server-tools",server:I.server})})}case"agent-server-menu":return lP.default.createElement(ZRA,{agentServer:I.agentServer,onCancel:()=>D({type:"list",defaultTab:"Agents"}),onComplete:H})}}var lP;var DbD=K(()=>{n9H();Ga();pL();kF();YRA();yq$();vq$();hq$();bq$();qRA();lP=b(s(),1)});function TRA({serverName:H,onComplete:$}){let[A]=_I(),L=J$((M)=>M.mcp.clients),I=RVH(),[D,B]=ImH.useState(!0),[f,E]=ImH.useState(null);if(ImH.useEffect(()=>{async function M(){try{if(!L.find((X)=>X.name===H)){E(`MCP server "${H}" not found`),B(!1);return}switch((await I(H)).client.type){case"connected":$(`Successfully reconnected to ${H}`);break;case"needs-auth":E(`${H} requires authentication`),B(!1),$(`${H} requires authentication. Use /mcp to authenticate.`);break;case"pending":case"failed":case"disabled":E(`Failed to reconnect to ${H}`),B(!1),$(`Failed to reconnect to ${H}`);break;case"proxy":$(`${H} is a proxy server and does not require reconnection`);break}}catch(G){let U=G instanceof Error?G.message:String(G);E(U),B(!1),$(`Error: ${U}`)}}M()},[H,I,L,$]),D)return qz.default.createElement(x,{flexDirection:"column",gap:1,padding:1},qz.default.createElement(V,{color:"text"},"Reconnecting to ",qz.default.createElement(V,{bold:!0},H)),qz.default.createElement(x,null,qz.default.createElement(vD,null),qz.default.createElement(V,null," Establishing connection to MCP server")));if(f)return qz.default.createElement(x,{flexDirection:"column",gap:1,padding:1},qz.default.createElement(x,null,qz.default.createElement(V,null,ZL("error",A)(pH.cross)," "),qz.default.createElement(V,{color:"error"},"Failed to reconnect to ",H)),qz.default.createElement(V,{dimColor:!0},"Error: ",f));return null}var qz,ImH;var zRA=K(()=>{xH();JM();Ys();pL();xH();jI();qz=b(s(),1),ImH=b(s(),1)});var BbD=K(()=>{DbD();YRA();yq$();vq$();qRA();hq$();bq$();zRA()});function uq$(H){let $=H.trim(),A=zH(),L=$.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(L?.[1]){let I=L[1],D=L[3];return D?{source:"git",url:I,ref:D}:{source:"git",url:I}}if($.startsWith("http://")||$.startsWith("https://")){let I=$.match(/^([^#]+)(#(.+))?$/),D=I?.[1]||$,B=I?.[3];if(D.endsWith(".git"))return B?{source:"git",url:D,ref:B}:{source:"git",url:D};let f;try{f=new URL(D)}catch(E){return{source:"url",url:D}}if(f.hostname==="github.com"||f.hostname==="www.github.com"){if(f.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let M=D.endsWith(".git")?D:`${D}.git`;return B?{source:"git",url:M,ref:B}:{source:"git",url:M}}}return{source:"url",url:D}}if($.startsWith("./")||$.startsWith("../")||$.startsWith("/")||$.startsWith("~")){let I=fbD.resolve($.startsWith("~")?$.replace(/^~/,EbD.homedir()):$);if(!A.existsSync(I))return{error:`Path does not exist: ${I}`};let D=A.statSync(I);if(D.isFile())if(I.endsWith(".json"))return{source:"file",path:I};else return{error:`File path must point to a .json file (marketplace.json), but got: ${I}`};else if(D.isDirectory())return{source:"directory",path:I};else return{error:`Path is neither a file nor a directory: ${I}`}}if($.includes("/")&&!$.startsWith("@")){if($.includes(":"))return null;let I=$.match(/^([^#]+)(#(.+))?$/),D=I?.[1]||$,B=I?.[3];return B?{source:"github",repo:D,ref:B}:{source:"github",repo:D}}return null}var fbD,EbD;var NRA=K(()=>{DL();fbD=require("path"),EbD=require("os")});function MbD({inputValue:H,setInputValue:$,cursorOffset:A,setCursorOffset:L,error:I,setError:D,result:B,setResult:f,setViewState:E,onAddComplete:M,cliMode:G=!1}){let U=N1H.useRef(!1),[X,J]=N1H.useState(!1),[F,Q]=N1H.useState(""),W=async()=>{let P=H.trim();if(!P){D("Please enter a marketplace source");return}let C=uq$(P);if(!C){D("Invalid marketplace source format. Try: owner/repo, https://..., or ./path");return}if("error"in C){D(C.error);return}D(null);try{J(!0),Q("");let{name:Y}=await uw(C,(q)=>{Q(q)});SG();let Z=C.source;if(C.source==="github")Z=C.repo;if(c("tengu_marketplace_added",{source_type:Z}),M)await M();if(Q(""),J(!1),G)f(`Successfully added marketplace: ${Y}`);else E({type:"browse-marketplace",targetMarketplace:Y})}catch(Y){let Z=Y instanceof Error?Y:Error(String(Y));if(r(Z),D(Z.message),Q(""),J(!1),G)f(`Error: ${Z.message}`);else f(null)}};return N1H.useEffect(()=>{if(H&&!U.current&&!I&&!B)U.current=!0,W()},[]),q0.createElement(x,{flexDirection:"column"},q0.createElement(x,{flexDirection:"column",paddingX:1,borderStyle:"round"},q0.createElement(x,{marginBottom:1},q0.createElement(V,{bold:!0},"Add Marketplace")),q0.createElement(x,{flexDirection:"column"},q0.createElement(V,null,"Enter marketplace source:"),q0.createElement(V,{dimColor:!0},"Examples:"),q0.createElement(V,{dimColor:!0}," \u2022 owner/repo (GitHub)"),q0.createElement(V,{dimColor:!0}," \u2022 git@github.com:owner/repo.git (SSH)"),q0.createElement(V,{dimColor:!0}," \u2022 https://example.com/marketplace.json"),q0.createElement(V,{dimColor:!0}," \u2022 ./path/to/marketplace"),q0.createElement(x,{marginTop:1},q0.createElement(W9,{value:H,onChange:$,onSubmit:W,columns:80,cursorOffset:A,onChangeCursorOffset:L,focus:!0,showCursor:!0}))),X&&q0.createElement(x,{marginTop:1},q0.createElement(vD,null),q0.createElement(V,null,F||"Adding marketplace to configuration\u2026")),I&&q0.createElement(x,{marginTop:1},q0.createElement(V,{color:"error"},I)),B&&q0.createElement(x,{marginTop:1},q0.createElement(V,null,B))),q0.createElement(x,{marginLeft:3},q0.createElement(V,{dimColor:!0,italic:!0},q0.createElement(rA,null,q0.createElement(s$,{shortcut:"Enter",action:"add"}),q0.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))))}var q0,N1H;var GbD=K(()=>{xH();S5();eB();lB();j0();y4();Vz();z$();NRA();JM();_$();q0=b(s(),1),N1H=b(s(),1)});function UbD({setViewState:H,error:$,setError:A,setResult:L,exitState:I,onManageComplete:D,targetMarketplace:B,action:f}){let[E,M]=iP.useState([]),[G,U]=iP.useState(!0),[X,J]=iP.useState(0),[F,Q]=iP.useState(!1),[W,P]=iP.useState(null),[C,Y]=iP.useState(null),[Z,q]=iP.useState(null),[O,j]=iP.useState("list"),[u,y]=iP.useState(null),[g,h]=iP.useState(0),p=iP.useRef(!1);iP.useEffect(()=>{async function QH(){try{let TH=await l1(),{enabled:t,disabled:IH}=await xf(),KH=[...t,...IH],{marketplaces:MH,failures:CH}=await fm(TH),OH=[];for(let{name:DH,config:EH,data:$H}of MH){let FH=KH.filter((YH)=>YH.source.endsWith(`@${DH}`));OH.push({name:DH,source:HRH(EH.source),lastUpdated:EH.lastUpdated,pluginCount:$H?.plugins.length,installedPlugins:FH,pendingUpdate:!1,pendingRemove:!1,autoUpdate:EwH(DH,EH)})}OH.sort((DH,EH)=>{if(DH.name==="claude-plugin-directory")return-1;if(EH.name==="claude-plugin-directory")return 1;return DH.name.localeCompare(EH.name)}),M(OH);let LH=MH.filter((DH)=>DH.data!==null).length,e=wKH(CH,LH);if(e)if(e.type==="warning")P(e.message);else throw Error(e.message);if(B&&!p.current&&!$){p.current=!0;let DH=OH.findIndex((EH)=>EH.name===B);if(DH>=0){let EH=OH[DH];if(f){J(DH+1);let $H=[...OH];if(f==="update")$H[DH].pendingUpdate=!0;else if(f==="remove")$H[DH].pendingRemove=!0;M($H),setTimeout(()=>{n($H)},100)}else if(EH)J(DH+1),y(EH),j("details")}else if(A)A(`Marketplace not found: ${B}`)}}catch(TH){if(A)A(TH instanceof Error?TH.message:"Failed to load marketplaces");P(TH instanceof Error?TH.message:"Failed to load marketplaces")}finally{U(!1)}}QH()},[B,f,$]);let d=()=>{return E.some((QH)=>QH.pendingUpdate||QH.pendingRemove)},k=()=>{let QH=E.filter((t)=>t.pendingUpdate).length,TH=E.filter((t)=>t.pendingRemove).length;return{updateCount:QH,removeCount:TH}},n=async(QH)=>{let TH=QH||E,t=O==="details";Q(!0),P(null),Y(null),q(null);try{let IH=ZI("userSettings"),KH=0,MH=0;for(let FH of TH){if(FH.pendingRemove){if(FH.installedPlugins&&FH.installedPlugins.length>0){let YH={...IH?.enabledPlugins};for(let qH of FH.installedPlugins){let bH=Qv(qH.name,FH.name);YH[bH]=!1}II("userSettings",{enabledPlugins:YH})}await F2$(FH.name),MH++,c("tengu_marketplace_removed",{marketplace_name:FH.name,plugins_uninstalled:FH.installedPlugins?.length||0});continue}if(FH.pendingUpdate)await gt(FH.name,(YH)=>{q(YH)}),KH++,c("tengu_marketplace_updated",{marketplace_name:FH.name})}if(SG(),D)await D();let CH=await l1(),{enabled:OH,disabled:LH}=await xf(),e=[...OH,...LH],{marketplaces:DH}=await fm(CH),EH=[];for(let{name:FH,config:YH,data:qH}of DH){let bH=e.filter((hH)=>hH.source.endsWith(`@${FH}`));EH.push({name:FH,source:HRH(YH.source),lastUpdated:YH.lastUpdated,pluginCount:qH?.plugins.length,installedPlugins:bH,pendingUpdate:!1,pendingRemove:!1,autoUpdate:EwH(FH,YH)})}if(EH.sort((FH,YH)=>{if(FH.name==="claude-plugin-directory")return-1;if(YH.name==="claude-plugin-directory")return 1;return FH.name.localeCompare(YH.name)}),M(EH),t&&u){let FH=EH.find((YH)=>YH.name===u.name);if(FH)y(FH)}let $H=[];if(KH>0)$H.push(`Updated ${KH} marketplace${KH>1?"s":""}`);if(MH>0)$H.push(`Removed ${MH} marketplace${MH>1?"s":""}`);if($H.length>0){let FH=`${pH.tick} ${$H.join(", ")}`;if(t)Y(FH);else L(FH),setTimeout(()=>{H({type:"menu"})},2000)}else if(!t)H({type:"menu"})}catch(IH){let KH=IH instanceof Error?IH.message:String(IH);if(P(KH),A)A(KH)}finally{Q(!1),q(null)}},GH=async()=>{if(!u)return;let QH=E.map((TH)=>TH.name===u.name?{...TH,pendingRemove:!0}:TH);M(QH),await n(QH)},HH=(QH)=>{if(!QH)return[];let TH=[{label:`Browse plugins (${QH.pluginCount??0})`,value:"browse"},{label:"Update marketplace",secondaryLabel:QH.lastUpdated?`(last updated ${new Date(QH.lastUpdated).toLocaleDateString()})`:void 0,value:"update"}];if(!DmH())TH.push({label:QH.autoUpdate?"Disable auto-update":"Enable auto-update",value:"toggle-auto-update"});return TH.push({label:"Remove marketplace",value:"remove"}),TH},BH=async(QH)=>{let TH=!QH.autoUpdate;try{await UZD(QH.name,TH),M((t)=>t.map((IH)=>IH.name===QH.name?{...IH,autoUpdate:TH}:IH)),y((t)=>t?{...t,autoUpdate:TH}:t)}catch(t){P(t instanceof Error?t.message:"Failed to update setting")}};if(BA("confirm:no",()=>{j("list"),h(0)},{context:"Confirmation",isActive:!F&&(O==="details"||O==="confirm-remove")}),BA("confirm:no",()=>{M((QH)=>QH.map((TH)=>({...TH,pendingUpdate:!1,pendingRemove:!1}))),J(0)},{context:"Confirmation",isActive:!F&&O==="list"&&d()}),BA("confirm:no",()=>{H({type:"menu"})},{context:"Confirmation",isActive:!F&&O==="list"&&!d()}),bI({"select:previous":()=>J((QH)=>Math.max(0,QH-1)),"select:next":()=>{let QH=E.length+1;J((TH)=>Math.min(QH-1,TH+1))},"select:accept":()=>{let QH=X-1;if(X===0)H({type:"add-marketplace"});else if(d())n();else{let TH=E[QH];if(TH)y(TH),j("details"),h(0)}}},{context:"Select",isActive:!F&&O==="list"}),WL((QH)=>{let TH=X-1;if((QH==="u"||QH==="U")&&TH>=0)M((t)=>t.map((IH,KH)=>KH===TH?{...IH,pendingUpdate:!IH.pendingUpdate,pendingRemove:IH.pendingUpdate?IH.pendingRemove:!1}:IH));else if((QH==="r"||QH==="R")&&TH>=0){let t=E[TH];if(t)y(t),j("confirm-remove")}},{isActive:!F&&O==="list"}),bI({"select:previous":()=>h((QH)=>Math.max(0,QH-1)),"select:next":()=>{let QH=HH(u);h((TH)=>Math.min(QH.length-1,TH+1))},"select:accept":()=>{if(!u)return;let TH=HH(u)[g];if(TH?.value==="browse")H({type:"browse-marketplace",targetMarketplace:u.name});else if(TH?.value==="update"){let t=E.map((IH)=>IH.name===u.name?{...IH,pendingUpdate:!0}:IH);M(t),n(t)}else if(TH?.value==="toggle-auto-update")BH(u);else if(TH?.value==="remove")j("confirm-remove")}},{context:"Select",isActive:!F&&O==="details"}),WL((QH)=>{if(QH==="y"||QH==="Y")GH();else if(QH==="n"||QH==="N")j("list"),y(null)},{isActive:!F&&O==="confirm-remove"}),G)return T$.createElement(V,null,"Loading marketplaces\u2026");if(E.length===0)return T$.createElement(x,{flexDirection:"column"},T$.createElement(x,{marginBottom:1},T$.createElement(V,{bold:!0},"Manage marketplaces")),T$.createElement(x,{flexDirection:"row",gap:1},T$.createElement(V,{color:"suggestion"},pH.pointer," +"),T$.createElement(V,{bold:!0,color:"suggestion"},"Add Marketplace")),T$.createElement(x,{marginLeft:3},T$.createElement(V,{dimColor:!0,italic:!0},I.pending?T$.createElement(T$.Fragment,null,"Press ",I.keyName," again to go back"):T$.createElement(rA,null,T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),T$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})))));if(O==="confirm-remove"&&u){let QH=u.installedPlugins?.length||0;return T$.createElement(x,{flexDirection:"column"},T$.createElement(V,{bold:!0,color:"warning"},"Remove marketplace ",T$.createElement(V,{italic:!0},u.name),"?"),T$.createElement(x,{flexDirection:"column"},QH>0&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"warning"},"This will also uninstall ",QH," plugin",QH!==1?"s":""," from this marketplace:")),u.installedPlugins&&u.installedPlugins.length>0&&T$.createElement(x,{flexDirection:"column",marginTop:1,marginLeft:2},u.installedPlugins.map((TH)=>T$.createElement(V,{key:TH.name,dimColor:!0},"\u2022 ",TH.name))),T$.createElement(x,{marginTop:1},T$.createElement(V,null,"Press ",T$.createElement(V,{bold:!0},"y")," to confirm or ",T$.createElement(V,{bold:!0},"n")," to cancel"))))}if(O==="details"&&u){let QH=u.pendingUpdate||F,TH=HH(u);return T$.createElement(x,{flexDirection:"column"},T$.createElement(V,{bold:!0},u.name),T$.createElement(V,{dimColor:!0},u.source),T$.createElement(x,{marginTop:1},T$.createElement(V,null,u.pluginCount||0," available plugin",u.pluginCount!==1?"s":"")),u.installedPlugins&&u.installedPlugins.length>0&&T$.createElement(x,{flexDirection:"column",marginTop:1},T$.createElement(V,{bold:!0},"Installed plugins (",u.installedPlugins.length,"):"),T$.createElement(x,{flexDirection:"column",marginLeft:1},u.installedPlugins.map((t)=>T$.createElement(x,{key:t.name,flexDirection:"row",gap:1},T$.createElement(V,null,pH.bullet),T$.createElement(x,{flexDirection:"column"},T$.createElement(V,null,t.name),T$.createElement(V,{dimColor:!0},t.manifest.description)))))),QH&&T$.createElement(x,{marginTop:1,flexDirection:"column"},T$.createElement(V,{color:"claude"},"Updating marketplace\u2026"),Z&&T$.createElement(V,{dimColor:!0},Z)),!QH&&C&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"claude"},C)),!QH&&W&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"error"},W)),!QH&&T$.createElement(x,{flexDirection:"column",marginTop:1},TH.map((t,IH)=>{if(!t)return null;let KH=IH===g;return T$.createElement(x,{key:t.value},T$.createElement(V,{color:KH?"suggestion":void 0},KH?pH.pointer:" "," ",t.label),t.secondaryLabel&&T$.createElement(V,{dimColor:!0}," ",t.secondaryLabel))})),!QH&&!DmH()&&u.autoUpdate&&T$.createElement(x,{marginTop:1},T$.createElement(V,{dimColor:!0},"Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins.")),T$.createElement(x,{marginLeft:3},T$.createElement(V,{dimColor:!0,italic:!0},QH?T$.createElement(T$.Fragment,null,"Please wait\u2026"):T$.createElement(rA,null,T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),T$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})))))}let{updateCount:WH,removeCount:wH}=k();return T$.createElement(x,{flexDirection:"column"},T$.createElement(x,{marginBottom:1},T$.createElement(V,{bold:!0},"Manage marketplaces")),T$.createElement(x,{flexDirection:"row",gap:1,marginBottom:1},T$.createElement(V,{color:X===0?"suggestion":void 0},X===0?pH.pointer:" "," +"),T$.createElement(V,{bold:!0,color:X===0?"suggestion":void 0},"Add Marketplace")),T$.createElement(x,{flexDirection:"column"},E.map((QH,TH)=>{let t=TH+1===X,IH=[];if(QH.pendingUpdate)IH.push("UPDATE");if(QH.pendingRemove)IH.push("REMOVE");return T$.createElement(x,{key:QH.name,flexDirection:"row",gap:1,marginBottom:1},T$.createElement(V,{color:t?"suggestion":void 0},t?pH.pointer:" "," ",QH.pendingRemove?pH.cross:pH.bullet),T$.createElement(x,{flexDirection:"column",flexGrow:1},T$.createElement(x,{flexDirection:"row",gap:1},T$.createElement(V,{bold:!0,strikethrough:QH.pendingRemove,dimColor:QH.pendingRemove},QH.name==="claude-plugins-official"&&T$.createElement(V,{color:"claude"},"\u273B "),QH.name,QH.name==="claude-plugins-official"&&T$.createElement(V,{color:"claude"}," \u273B")),IH.length>0&&T$.createElement(V,{color:"warning"},"[",IH.join(", "),"]")),T$.createElement(V,{dimColor:!0},QH.source),T$.createElement(V,{dimColor:!0},QH.pluginCount!==void 0&&T$.createElement(T$.Fragment,null,QH.pluginCount," available"),QH.installedPlugins&&QH.installedPlugins.length>0&&T$.createElement(T$.Fragment,null," \u2022 ",QH.installedPlugins.length," installed"),QH.lastUpdated&&T$.createElement(T$.Fragment,null," ","\u2022 Updated"," ",new Date(QH.lastUpdated).toLocaleDateString()))))})),d()&&T$.createElement(x,{marginTop:1,flexDirection:"column"},T$.createElement(V,null,T$.createElement(V,{bold:!0},"Pending changes:")," ",T$.createElement(V,{dimColor:!0},"Enter to apply")),WH>0&&T$.createElement(V,null,"\u2022 Update ",WH," marketplace",WH>1?"s":""),wH>0&&T$.createElement(V,{color:"warning"},"\u2022 Remove ",wH," marketplace",wH>1?"s":"")),F&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"claude"},"Processing changes\u2026")),W&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"error"},W)),T$.createElement(PQ1,{exitState:I,hasPendingActions:d()}))}function PQ1({exitState:H,hasPendingActions:$}){if(H.pending)return T$.createElement(x,{marginTop:1},T$.createElement(V,{dimColor:!0,italic:!0},"Press ",H.keyName," again to go back"));return T$.createElement(x,{marginTop:1},T$.createElement(V,{dimColor:!0,italic:!0},T$.createElement(rA,null,$&&T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"apply changes"}),!$&&T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),!$&&T$.createElement(s$,{shortcut:"u",action:"update"}),!$&&T$.createElement(s$,{shortcut:"r",action:"remove"}),T$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:$?"cancel":"go back"}))))}var T$,iP;var XbD=K(()=>{xH();xH();$I();jI();eB();lB();j0();y4();Vz();z$();_X();Ja();UQ();vA();mL();T$=b(s(),1),iP=b(s(),1)});function O1H({totalItems:H,maxVisible:$=_Q1,selectedIndex:A=0}){let L=H>$,I=$Z.useRef(0),D=$Z.useMemo(()=>{if(!L)return 0;let C=I.current;if(A=C+$){let q=A-$+1;return I.current=q,q}let Y=Math.max(0,H-$),Z=Math.min(C,Y);return I.current=Z,Z},[A,$,L,H]),B=D,f=Math.min(D+$,H),E=$Z.useCallback((C)=>{if(!L)return C;return C.slice(B,f)},[L,B,f]),M=$Z.useCallback((C)=>{return B+C},[B]),G=$Z.useCallback((C)=>{return C>=B&&C{},[]),X=$Z.useCallback(()=>{},[]),J=$Z.useCallback(()=>{},[]),F=$Z.useCallback((C,Y)=>{let Z=Math.max(0,Math.min(C,H-1));Y(Z)},[H]),Q=$Z.useCallback((C,Y)=>{return!1},[]),W=Math.max(1,Math.ceil(H/$));return{currentPage:Math.floor(D/$),totalPages:W,startIndex:B,endIndex:f,needsPagination:L,pageSize:$,getVisibleItems:E,toActualIndex:M,isOnCurrentPage:G,goToPage:U,nextPage:X,prevPage:J,handleSelectionChange:F,handlePageNavigation:Q,scrollPosition:{current:A+1,total:H,canScrollUp:D>0,canScrollDown:D+${$Z=b(s(),1)});function ws(H){if(H.entry.source&&typeof H.entry.source==="object"&&"source"in H.entry.source&&H.entry.source.source==="github"&&typeof H.entry.source==="object"&&"repo"in H.entry.source)return H.entry.source.repo;return null}function yVH(H,$){let A=[{label:"Install for you (user scope)",action:"install-user"},{label:"Install for all collaborators on this repository (project scope)",action:"install-project"},{label:"Install for you, in this repo only (local scope)",action:"install-local"}];if(H)A.push({label:"Open homepage",action:"homepage"});if($)A.push({label:"View on GitHub",action:"github"});return A.push({label:"Back to plugin list",action:"back"}),A}function JbD({hasSelection:H}){return nP.createElement(x,{marginTop:1},nP.createElement(V,{dimColor:!0,italic:!0},nP.createElement(rA,null,H&&nP.createElement(VA,{action:"plugin:install",context:"Plugin",fallback:"i",description:"install",bold:!0}),nP.createElement(VA,{action:"plugin:toggle",context:"Plugin",fallback:"Space",description:"toggle"}),nP.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"details"}),nP.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))))}var nP;var ORA=K(()=>{xH();eB();j0();nP=b(s(),1)});function WbD(){return KbD.join(Dw(),YQ1)}function wQ1(){let H=zH(),$=WbD();try{if(!H.existsSync($))return N("Install counts cache does not exist"),null;let A=H.readFileSync($,{encoding:"utf-8"}),L=DA(A);if(typeof L!=="object"||L===null||!("version"in L)||!("fetchedAt"in L)||!("counts"in L))return N("Install counts cache has invalid structure"),null;let I=L;if(I.version!==xRA)return N(`Install counts cache version mismatch (got ${I.version}, expected ${xRA})`),null;if(typeof I.fetchedAt!=="string"||!Array.isArray(I.counts))return N("Install counts cache has invalid structure"),null;let D=new Date(I.fetchedAt).getTime();if(Number.isNaN(D))return N("Install counts cache has invalid fetchedAt timestamp"),null;if(!I.counts.every((E)=>typeof E==="object"&&E!==null&&typeof E.plugin==="string"&&typeof E.unique_installs==="number"))return N("Install counts cache has malformed entries"),null;if(Date.now()-D>CQ1)return N("Install counts cache is stale (>24h old)"),null;return{version:I.version,fetchedAt:I.fetchedAt,counts:I.counts}}catch(A){return N(`Failed to load install counts cache: ${A instanceof Error?A.message:String(A)}`),null}}function ZQ1(H){let $=zH(),A=WbD(),L=`${A}.${QbD.randomBytes(8).toString("hex")}.tmp`;try{let I=Dw();$.mkdirSync(I);let D=yH(H,null,2);iL(L,D,{encoding:"utf-8",mode:384,flush:!0}),$.renameSync(L,A),N("Install counts cache saved successfully")}catch(I){r(I instanceof Error?I:Error(String(I)));try{if($.existsSync(L))$.unlinkSync(L)}catch{}}}async function qQ1(){N(`Fetching install counts from ${FbD}`);let H=await nA.get(FbD,{timeout:1e4});if(!H.data?.plugins||!Array.isArray(H.data.plugins))throw Error("Invalid response format from install counts API");return H.data.plugins}async function vVH(){let H=wQ1();if(H){N("Using cached install counts");let $=new Map;for(let A of H.counts)$.set(A.plugin,A.unique_installs);return $}try{let $=await qQ1(),A={version:xRA,fetchedAt:new Date().toISOString(),counts:$};ZQ1(A);let L=new Map;for(let I of $)L.set(I.plugin,I.unique_installs);return L}catch($){return r($ instanceof Error?$:Error(String($))),N(`Failed to fetch install counts: ${$ instanceof Error?$.message:String($)}`),null}}function gq$(H){if(H<1000)return String(H);if(H<1e6){let I=(H/1000).toFixed(1);return I.endsWith(".0")?`${I.slice(0,-2)}K`:`${I}K`}let A=(H/1e6).toFixed(1);return A.endsWith(".0")?`${A.slice(0,-2)}M`:`${A}M`}var KbD,QbD,xRA=1,YQ1="install-counts-cache.json",FbD="https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json",CQ1=86400000;var mq$=K(()=>{w1();ejH();DL();Z$();E$();_$();Z$();KbD=require("path"),QbD=require("crypto")});function VbD({error:H,setError:$,result:A,setResult:L,setViewState:I,onInstallComplete:D,targetMarketplace:B,targetPlugin:f}){let[E,M]=uK.useState("marketplace-list"),[G,U]=uK.useState(null),[X,J]=uK.useState(null),[F,Q]=uK.useState([]),[W,P]=uK.useState([]),[C,Y]=uK.useState(!0),[Z,q]=uK.useState(null),[O,j]=uK.useState(0),[u,y]=uK.useState(new Set),[g,h]=uK.useState(new Set),p=O1H({totalItems:W.length,selectedIndex:O}),[d,k]=uK.useState(0),[n,GH]=uK.useState(!1),[HH,BH]=uK.useState(null),[WH,wH]=uK.useState(null),QH=r$.useCallback(()=>{if(E==="plugin-list")if(B)I({type:"manage-marketplaces",targetMarketplace:B});else if(F.length===1)I({type:"menu"});else M("marketplace-list"),U(null),y(new Set);else if(E==="plugin-details")M("plugin-list"),J(null);else I({type:"menu"})},[E,B,I,F.length]);BA("confirm:no",QH,{context:"Confirmation"}),uK.useEffect(()=>{async function MH(){try{let CH=await l1(),{marketplaces:OH,failures:LH}=await fm(CH),e=[];for(let{name:$H,config:FH,data:YH}of OH)if(YH){let qH=YH.plugins.filter((bH)=>K7(Qv(bH.name,$H))).length;e.push({name:$H,totalPlugins:YH.plugins.length,installedCount:qH,source:HRH(FH.source)})}e.sort(($H,FH)=>{if($H.name==="claude-plugin-directory")return-1;if(FH.name==="claude-plugin-directory")return 1;return 0}),Q(e);let DH=OH.filter(($H)=>$H.data!==null).length,EH=wKH(LH,DH);if(EH)if(EH.type==="warning")wH(EH.message+". Showing available marketplaces.");else throw Error(EH.message);if(e.length===1&&!B&&!f){let $H=e[0];if($H)U($H.name),M("plugin-list")}if(f){let $H=null,FH=null;for(let[YH]of Object.entries(CH)){let qH=await GP(YH);if(qH){let bH=qH.plugins.find((hH)=>hH.name===f);if(bH){let hH=Qv(bH.name,YH);$H={entry:bH,marketplaceName:YH,pluginId:hH,isInstalled:K7(hH)},FH=YH;break}}}if($H&&FH){let YH=$H.pluginId;if(K7(YH))$(`Plugin '${YH}' is already installed. Use '/plugin' to manage existing plugins.`);else U(FH),J($H),M("plugin-details")}else $(`Plugin "${f}" not found in any marketplace`)}else if(B)if(e.some((FH)=>FH.name===B))U(B),M("plugin-list");else $(`Marketplace "${B}" not found`)}catch(CH){$(CH instanceof Error?CH.message:"Failed to load marketplaces")}finally{Y(!1)}}MH()},[$,B,f]),uK.useEffect(()=>{if(!G)return;async function MH(CH){Y(!0);try{let OH=await GP(CH);if(!OH)throw Error(`Failed to load marketplace: ${CH}`);let LH=[];for(let e of OH.plugins){let DH=Qv(e.name,CH);LH.push({entry:e,marketplaceName:CH,pluginId:DH,isInstalled:K7(DH)})}try{let e=await vVH();if(q(e),e)LH.sort((DH,EH)=>{let $H=e.get(DH.pluginId)??0,FH=e.get(EH.pluginId)??0;if($H!==FH)return FH-$H;return DH.entry.name.localeCompare(EH.entry.name)});else LH.sort((DH,EH)=>DH.entry.name.localeCompare(EH.entry.name))}catch(e){N(`Failed to fetch install counts: ${e instanceof Error?e.message:String(e)}`),LH.sort((DH,EH)=>DH.entry.name.localeCompare(EH.entry.name))}P(LH),j(0),y(new Set)}catch(OH){$(OH instanceof Error?OH.message:"Failed to load plugins")}finally{Y(!1)}}MH(G)},[G,$]);let TH=async()=>{if(u.size===0)return;let MH=W.filter((e)=>u.has(e.pluginId));h(new Set(MH.map((e)=>e.pluginId)));let CH=0,OH=0,LH=[];for(let e of MH){let DH=await _uH({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:"user"});if(DH.success)CH++;else OH++,LH.push({name:e.entry.name,reason:DH.error})}if(h(new Set),y(new Set),SG(),OH===0){let e=`\u2713 Installed ${CH} plugin${CH!==1?"s":""}. Restart Claude Code to load new plugins.`;L(e)}else if(CH===0)$(`Failed to install: ${CKH(LH,!0)}`);else{let e=`\u2713 Installed ${CH} of ${CH+OH} plugins. Failed: ${CKH(LH,!1)}. Restart Claude Code to load successfully installed plugins.`;L(e)}if(CH>0){if(D)await D()}I({type:"menu"})},t=async(MH,CH="user")=>{GH(!0),BH(null);let OH=await _uH({pluginId:MH.pluginId,entry:MH.entry,marketplaceName:MH.marketplaceName,scope:CH});if(OH.success){if(L(OH.message),D)await D();I({type:"menu"})}else GH(!1),BH(OH.error)};uK.useEffect(()=>{if(H)L(H)},[H,L]),bI({"select:previous":()=>{if(O>0)j(O-1)},"select:next":()=>{if(O{let MH=F[O];if(MH)U(MH.name),M("plugin-list")}},{context:"Select",isActive:E==="marketplace-list"}),bI({"select:previous":()=>{if(O>0)p.handleSelectionChange(O-1,j)},"select:next":()=>{if(O{if(O===W.length&&u.size>0)TH();else if(O{if(O{if(u.size>0)TH()}},{context:"Plugin",isActive:E==="plugin-list"});let IH=r$.useMemo(()=>{if(!X)return[];let MH=X.entry.homepage,CH=ws(X);return yVH(MH,CH)},[X]);if(bI({"select:previous":()=>{if(d>0)k(d-1)},"select:next":()=>{if(d{if(!X)return;let MH=IH[d]?.action,CH=X.entry.homepage,OH=ws(X);if(MH==="install-user")t(X,"user");else if(MH==="install-project")t(X,"project");else if(MH==="install-local")t(X,"local");else if(MH==="homepage"&&CH)HE(CH);else if(MH==="github"&&OH)HE(`https://github.com/${OH}`);else if(MH==="back")M("plugin-list"),J(null)}},{context:"Select",isActive:E==="plugin-details"&&!!X}),C)return r$.createElement(V,null,"Loading\u2026");if(H)return r$.createElement(V,{color:"error"},H);if(E==="marketplace-list"){if(F.length===0)return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Select marketplace")),r$.createElement(V,null,"No marketplaces configured."),r$.createElement(V,{dimColor:!0},"Add a marketplace first using ","'Add marketplace'","."),r$.createElement(x,{marginTop:1,paddingLeft:1},r$.createElement(V,{dimColor:!0},r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))));return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Select marketplace")),WH&&r$.createElement(x,{marginBottom:1,flexDirection:"column"},r$.createElement(V,{color:"warning"},pH.warning," ",WH)),F.map((MH,CH)=>r$.createElement(x,{key:MH.name,flexDirection:"column",marginBottom:CH0&&` \xB7 ${MH.installedCount} already installed`,MH.source&&` \xB7 ${MH.source}`)))),r$.createElement(x,{marginTop:1},r$.createElement(V,{dimColor:!0,italic:!0},r$.createElement(rA,null,r$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})))))}if(E==="plugin-details"&&X){let MH=X.entry.homepage,CH=ws(X),OH=yVH(MH,CH);return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Plugin Details")),r$.createElement(x,{flexDirection:"column",marginBottom:1},r$.createElement(V,{bold:!0},X.entry.name),X.entry.version&&r$.createElement(V,{dimColor:!0},"Version: ",X.entry.version),X.entry.description&&r$.createElement(x,{marginTop:1},r$.createElement(V,null,X.entry.description)),X.entry.author&&r$.createElement(x,{marginTop:1},r$.createElement(V,{dimColor:!0},"By:"," ",typeof X.entry.author==="string"?X.entry.author:X.entry.author.name))),r$.createElement(x,{flexDirection:"column",marginBottom:1},r$.createElement(V,{bold:!0},"Will install:"),X.entry.commands&&r$.createElement(V,{dimColor:!0},"\u2022 Commands:"," ",Array.isArray(X.entry.commands)?X.entry.commands.join(", "):Object.keys(X.entry.commands).join(", ")),X.entry.agents&&r$.createElement(V,{dimColor:!0},"\u2022 Agents:"," ",Array.isArray(X.entry.agents)?X.entry.agents.join(", "):Object.keys(X.entry.agents).join(", ")),X.entry.hooks&&r$.createElement(V,{dimColor:!0},"\u2022 Hooks: ",Object.keys(X.entry.hooks).join(", ")),X.entry.mcpServers&&r$.createElement(V,{dimColor:!0},"\u2022 MCP Servers:"," ",Array.isArray(X.entry.mcpServers)?X.entry.mcpServers.join(", "):typeof X.entry.mcpServers==="object"?Object.keys(X.entry.mcpServers).join(", "):"configured"),!X.entry.commands&&!X.entry.agents&&!X.entry.hooks&&!X.entry.mcpServers&&r$.createElement(r$.Fragment,null,typeof X.entry.source==="object"&&"source"in X.entry.source&&(X.entry.source.source==="github"||X.entry.source.source==="url"||X.entry.source.source==="npm"||X.entry.source.source==="pip")?r$.createElement(V,{dimColor:!0},"\u2022 Component summary not available for remote plugin"):r$.createElement(V,{dimColor:!0},"\u2022 Components will be discovered at installation"))),r$.createElement(x,{marginBottom:1},r$.createElement(V,{color:"claude"},pH.warning," "),r$.createElement(V,{dimColor:!0,italic:!0},"Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.")),HH&&r$.createElement(x,{marginBottom:1},r$.createElement(V,{color:"error"},"Error: ",HH)),r$.createElement(x,{flexDirection:"column"},OH.map((LH,e)=>r$.createElement(x,{key:LH.action},d===e&&r$.createElement(V,null,"> "),d!==e&&r$.createElement(V,null," "),r$.createElement(V,{bold:d===e},n&&LH.action==="install"?"Installing\u2026":LH.label)))),r$.createElement(x,{marginTop:1,paddingLeft:1},r$.createElement(V,{dimColor:!0},r$.createElement(rA,null,r$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}if(W.length===0)return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Install plugins")),r$.createElement(V,{dimColor:!0},"No new plugins available to install."),r$.createElement(V,{dimColor:!0},"All plugins from this marketplace are already installed."),r$.createElement(x,{marginLeft:3},r$.createElement(V,{dimColor:!0,italic:!0},r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))));let KH=p.getVisibleItems(W);return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Install Plugins")),p.scrollPosition.canScrollUp&&r$.createElement(x,null,r$.createElement(V,{dimColor:!0}," ",pH.arrowUp," more above")),KH.map((MH,CH)=>{let OH=p.toActualIndex(CH),LH=O===OH,e=u.has(MH.pluginId),DH=g.has(MH.pluginId),EH=CH===KH.length-1;return r$.createElement(x,{key:MH.pluginId,flexDirection:"column",marginBottom:EH&&!H?0:1},r$.createElement(x,null,r$.createElement(V,{color:LH?"suggestion":void 0},LH?pH.pointer:" "," "),r$.createElement(V,{color:MH.isInstalled?"success":void 0},MH.isInstalled?pH.tick:DH?pH.ellipsis:e?pH.radioOn:pH.radioOff," ",MH.entry.name,MH.entry.category&&r$.createElement(V,{dimColor:!0}," [",MH.entry.category,"]"),MH.entry.tags?.includes("community-managed")&&r$.createElement(V,{dimColor:!0}," [Community Managed]"),MH.isInstalled&&r$.createElement(V,{dimColor:!0}," (installed)"),Z&&r$.createElement(V,{dimColor:!0}," \xB7 ",gq$(Z.get(MH.pluginId)??0)," ","installs"))),MH.entry.description&&r$.createElement(x,{marginLeft:4},r$.createElement(V,{dimColor:!0},MH.entry.description.length>60?MH.entry.description.substring(0,57)+"...":MH.entry.description),MH.entry.version&&r$.createElement(V,{dimColor:!0}," \xB7 v",MH.entry.version)))}),p.scrollPosition.canScrollDown&&r$.createElement(x,null,r$.createElement(V,{dimColor:!0}," ",pH.arrowDown," more below")),H&&r$.createElement(x,{marginTop:1},r$.createElement(V,{color:"error"},pH.cross," ",H)),r$.createElement(JbD,{hasSelection:u.size>0}))}var r$,uK;var PbD=K(()=>{xH();jI();eB();j0();$I();y4();Ja();Vz();E$();F3();op();Q7();BmH();ORA();mq$();r$=b(s(),1),uK=b(s(),1)});function YbD({error:H,setError:$,result:A,setResult:L,setViewState:I,onInstallComplete:D,onSearchModeChange:B,targetPlugin:f}){let[E,M]=i5.useState("plugin-list"),[G,U]=i5.useState(null),[X,J]=i5.useState([]),[F,Q]=i5.useState(!0),[W,P]=i5.useState(null),[C,Y]=i5.useState(!1),Z=i5.useCallback((EH)=>{Y(EH),B?.(EH)},[B]),{query:q,setQuery:O,cursorOffset:j}=Eb({isActive:E==="plugin-list"&&C&&!F,onExit:()=>{Z(!1)}}),u=EJ(),{columns:y}=QL(),g=i5.useMemo(()=>{if(!q)return X;let EH=q.toLowerCase();return X.filter(($H)=>$H.entry.name.toLowerCase().includes(EH)||$H.entry.description?.toLowerCase().includes(EH)||$H.marketplaceName.toLowerCase().includes(EH))},[X,q]),[h,p]=i5.useState(0),[d,k]=i5.useState(new Set),[n,GH]=i5.useState(new Set),HH=O1H({totalItems:g.length,selectedIndex:h});i5.useEffect(()=>{p(0)},[q]);let[BH,WH]=i5.useState(0),[wH,QH]=i5.useState(!1),[TH,t]=i5.useState(null),[IH,KH]=i5.useState(null),[MH,CH]=i5.useState(null);i5.useEffect(()=>{async function EH(){try{let $H=await l1(),{marketplaces:FH,failures:YH}=await fm($H),qH=[];for(let{name:vH,data:tH}of FH)if(tH)for(let K$ of tH.plugins){let KA=Qv(K$.name,vH);qH.push({entry:K$,marketplaceName:vH,pluginId:KA,isInstalled:K7(KA)})}let bH=qH.filter((vH)=>!vH.isInstalled);try{let vH=await vVH();if(P(vH),vH)bH.sort((tH,K$)=>{let KA=vH.get(tH.pluginId)??0,UA=vH.get(K$.pluginId)??0;if(KA!==UA)return UA-KA;return tH.entry.name.localeCompare(K$.entry.name)});else bH.sort((tH,K$)=>tH.entry.name.localeCompare(K$.entry.name))}catch(vH){N(`Failed to fetch install counts: ${vH instanceof Error?vH.message:String(vH)}`),bH.sort((tH,K$)=>tH.entry.name.localeCompare(K$.entry.name))}J(bH);let hH=Object.keys($H).length;if(bH.length===0){let vH=await wqI({configuredMarketplaceCount:hH,failedMarketplaceCount:YH.length});CH(vH)}let PH=FH.filter((vH)=>vH.data!==null).length,gH=wKH(YH,PH);if(gH)if(gH.type==="warning")KH(gH.message+". Showing available plugins.");else throw Error(gH.message);if(f){let vH=qH.find((tH)=>tH.entry.name===f);if(vH)if(vH.isInstalled)$(`Plugin '${vH.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`);else U(vH),M("plugin-details");else $(`Plugin "${f}" not found in any marketplace`)}}catch($H){$($H instanceof Error?$H.message:"Failed to load plugins")}finally{Q(!1)}}EH()},[$,f]);let OH=async()=>{if(d.size===0)return;let EH=X.filter((qH)=>d.has(qH.pluginId));GH(new Set(EH.map((qH)=>qH.pluginId)));let $H=0,FH=0,YH=[];for(let qH of EH)try{let bH;if(typeof qH.entry.source==="string"&&qH.entry.source.startsWith("./")){let gH=await ZK(qH.pluginId);if(gH)bH=_bD.join(gH.marketplaceInstallLocation,qH.entry.source)}await mw(qH.pluginId,qH.entry,"user",void 0,bH);let PH={...ZI("userSettings")?.enabledPlugins,[qH.pluginId]:!0};II("userSettings",{enabledPlugins:PH}),$H++,c("tengu_plugin_installed",{plugin_id:qH.pluginId,marketplace_name:qH.marketplaceName})}catch(bH){FH++;let hH=bH instanceof Error?bH.message:String(bH);YH.push({name:qH.entry.name,reason:hH}),r(bH instanceof Error?bH:Error(`Failed to install ${qH.entry.name}: ${bH}`))}if(GH(new Set),k(new Set),SG(),FH===0){let qH=`\u2713 Installed ${$H} plugin${$H!==1?"s":""}. Restart Claude Code to load new plugins.`;L(qH)}else if($H===0)$(`Failed to install: ${CKH(YH,!0)}`);else{let qH=`\u2713 Installed ${$H} of ${$H+FH} plugins. Failed: ${CKH(YH,!1)}. Restart Claude Code to load successfully installed plugins.`;L(qH)}if($H>0){if(D)await D()}I({type:"menu"})},LH=async(EH,$H="user")=>{QH(!0),t(null);let FH=await _uH({pluginId:EH.pluginId,entry:EH.entry,marketplaceName:EH.marketplaceName,scope:$H});if(FH.success){if(L(FH.message),D)await D();I({type:"menu"})}else QH(!1),t(FH.error)};i5.useEffect(()=>{if(H)L(H)},[H,L]),BA("confirm:no",()=>{M("plugin-list"),U(null)},{context:"Confirmation",isActive:E==="plugin-details"}),BA("confirm:no",()=>{I({type:"menu"})},{context:"Confirmation",isActive:E==="plugin-list"&&!C}),WL((EH,$H)=>{let FH=!$H.ctrl&&!$H.meta;if(!C){if(EH==="/"&&FH)Z(!0),O("");else if(FH&&EH.length>0&&!/^\s+$/.test(EH)&&EH!=="j"&&EH!=="k"&&EH!=="i")Z(!0),O(EH)}},{isActive:E==="plugin-list"&&!F}),bI({"select:previous":()=>{if(h===0)Z(!0);else HH.handleSelectionChange(h-1,p)},"select:next":()=>{if(h{if(h===g.length&&d.size>0)OH();else if(h{if(h{if(d.size>0)OH()}},{context:"Plugin",isActive:E==="plugin-list"&&!C});let e=l$.useMemo(()=>{if(!G)return[];let EH=G.entry.homepage,$H=ws(G);return yVH(EH,$H)},[G]);if(bI({"select:previous":()=>{if(BH>0)WH(BH-1)},"select:next":()=>{if(BH{if(!G)return;let EH=e[BH]?.action,$H=G.entry.homepage,FH=ws(G);if(EH==="install-user")LH(G,"user");else if(EH==="install-project")LH(G,"project");else if(EH==="install-local")LH(G,"local");else if(EH==="homepage"&&$H)HE($H);else if(EH==="github"&&FH)HE(`https://github.com/${FH}`);else if(EH==="back")M("plugin-list"),U(null)}},{context:"Select",isActive:E==="plugin-details"&&!!G}),F)return l$.createElement(V,null,"Loading\u2026");if(H)return l$.createElement(V,{color:"error"},H);if(E==="plugin-details"&&G){let EH=G.entry.homepage,$H=ws(G),FH=yVH(EH,$H);return l$.createElement(x,{flexDirection:"column"},l$.createElement(x,{marginBottom:1},l$.createElement(V,{bold:!0},"Plugin details")),l$.createElement(x,{flexDirection:"column",marginBottom:1},l$.createElement(V,{bold:!0},G.entry.name),l$.createElement(V,{dimColor:!0},"from ",G.marketplaceName),G.entry.version&&l$.createElement(V,{dimColor:!0},"Version: ",G.entry.version),G.entry.description&&l$.createElement(x,{marginTop:1},l$.createElement(V,null,G.entry.description)),G.entry.author&&l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0},"By:"," ",typeof G.entry.author==="string"?G.entry.author:G.entry.author.name))),l$.createElement(x,{marginBottom:1},l$.createElement(V,{color:"claude"},pH.warning," "),l$.createElement(V,{dimColor:!0,italic:!0},"Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.")),TH&&l$.createElement(x,{marginBottom:1},l$.createElement(V,{color:"error"},"Error: ",TH)),l$.createElement(x,{flexDirection:"column"},FH.map((YH,qH)=>l$.createElement(x,{key:YH.action},BH===qH&&l$.createElement(V,null,"> "),BH!==qH&&l$.createElement(V,null," "),l$.createElement(V,{bold:BH===qH},wH&&YH.action.startsWith("install-")?"Installing\u2026":YH.label)))),l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0},l$.createElement(rA,null,l$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),l$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}if(X.length===0)return l$.createElement(x,{flexDirection:"column"},l$.createElement(x,{marginBottom:1},l$.createElement(V,{bold:!0},"Discover plugins")),l$.createElement(zQ1,{reason:MH}),l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0,italic:!0},"Esc to go back")));let DH=HH.getVisibleItems(g);return l$.createElement(x,{flexDirection:"column"},l$.createElement(x,null,l$.createElement(V,{bold:!0},"Discover plugins"),HH.needsPagination&&l$.createElement(V,{dimColor:!0}," ","(",HH.scrollPosition.current,"/",HH.scrollPosition.total,")")),l$.createElement(x,{marginBottom:1},l$.createElement(fb,{query:q,isFocused:C,isTerminalFocused:u,width:y-4,cursorOffset:j})),IH&&l$.createElement(x,{marginBottom:1},l$.createElement(V,{color:"warning"},pH.warning," ",IH)),g.length===0&&q&&l$.createElement(x,{marginBottom:1},l$.createElement(V,{dimColor:!0},'No plugins match "',q,'"')),HH.scrollPosition.canScrollUp&&l$.createElement(x,null,l$.createElement(V,{dimColor:!0}," ",pH.arrowUp," more above")),DH.map((EH,$H)=>{let FH=HH.toActualIndex($H),YH=h===FH,qH=d.has(EH.pluginId),bH=n.has(EH.pluginId),hH=$H===DH.length-1;return l$.createElement(x,{key:`${HH.startIndex}-${EH.pluginId}`,flexDirection:"column",marginBottom:hH&&!H?0:1},l$.createElement(x,null,l$.createElement(V,{color:YH&&!C?"suggestion":void 0},YH&&!C?pH.pointer:" "," "),l$.createElement(V,null,bH?pH.ellipsis:qH?pH.radioOn:pH.radioOff," ",EH.entry.name,l$.createElement(V,{dimColor:!0}," \xB7 ",EH.marketplaceName),EH.entry.tags?.includes("community-managed")&&l$.createElement(V,{dimColor:!0}," [Community Managed]"),W&&l$.createElement(V,{dimColor:!0}," \xB7 ",gq$(W.get(EH.pluginId)??0)," ","installs"))),EH.entry.description&&l$.createElement(x,{marginLeft:4},l$.createElement(V,{dimColor:!0},EH.entry.description.length>60?EH.entry.description.substring(0,57)+"...":EH.entry.description)))}),HH.scrollPosition.canScrollDown&&l$.createElement(x,null,l$.createElement(V,{dimColor:!0}," ",pH.arrowDown," more below")),H&&l$.createElement(x,{marginTop:1},l$.createElement(V,{color:"error"},pH.cross," ",H)),l$.createElement(TQ1,{hasSelection:d.size>0}))}function TQ1({hasSelection:H}){return l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0,italic:!0},l$.createElement(rA,null,H&&l$.createElement(VA,{action:"plugin:install",context:"Plugin",fallback:"i",description:"install",bold:!0}),l$.createElement(V,null,"type to search"),l$.createElement(VA,{action:"plugin:toggle",context:"Plugin",fallback:"Space",description:"toggle"}),l$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"details"}),l$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))))}function zQ1({reason:H}){switch(H){case"git-not-installed":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Git is required to install marketplaces."),l$.createElement(V,{dimColor:!0},"Please install git and restart Claude Code."));case"all-blocked-by-policy":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Your organization policy does not allow any external marketplaces."),l$.createElement(V,{dimColor:!0},"Contact your administrator."));case"policy-restricts-sources":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Your organization restricts which marketplaces can be added."),l$.createElement(V,{dimColor:!0},"Switch to the Marketplaces tab to view allowed sources."));case"all-marketplaces-failed":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Failed to load marketplace data."),l$.createElement(V,{dimColor:!0},"Check your network connection."));case"all-plugins-installed":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"All available plugins are already installed."),l$.createElement(V,{dimColor:!0},"Check for new plugins later or add more marketplaces."));case"no-marketplaces-configured":default:return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"No plugins available."),l$.createElement(V,{dimColor:!0},"Add a marketplace first using the Marketplaces tab."))}}var l$,i5,_bD;var CbD=K(()=>{xH();$I();jI();OB();VVH();PVH();y4();Ja();mL();Vz();z$();_$();E$();F3();op();Q7();BmH();ORA();mq$();eB();j0();l$=b(s(),1),i5=b(s(),1),_bD=require("path")});var wbD={};XA(wbD,{settingSourceToScope:()=>OQ1,isPluginActuallyInstalled:()=>xQ1,isPersistableScope:()=>NQ1,installSelectedPlugins:()=>jRA,getInstalledPlugins:()=>kVH,getEnabledPluginsWithScopes:()=>bVH,findMissingPlugins:()=>SRA,filterSkippedPlugins:()=>SQ1,checkPluginErrors:()=>jQ1,checkEnabledPlugins:()=>hVH});async function hVH(){let H=VL(),$=[];if(H.enabledPlugins){for(let[A,L]of Object.entries(H.enabledPlugins))if(A.includes("@")&&L)$.push(A)}return $}function bVH(){let H=new Map,$=[{scope:"managed",source:"policySettings"},{scope:"user",source:"userSettings"},{scope:"project",source:"projectSettings"},{scope:"local",source:"localSettings"},{scope:"flag",source:"flagSettings"}];for(let{scope:A,source:L}of $){let I=ZI(L);if(!I?.enabledPlugins)continue;for(let[D,B]of Object.entries(I.enabledPlugins)){if(!D.includes("@"))continue;if(B===!0)H.set(D,A);else if(B===!1)H.delete(D)}}return N(`Found ${H.size} enabled plugins with scopes: ${Array.from(H.entries()).map(([A,L])=>`${A}(${L})`).join(", ")}`),H}function NQ1(H){return H!=="flag"}function OQ1(H){return gKA[H]}async function kVH(){rKA().catch((A)=>{r(A instanceof Error?A:Error(String(A)))});let H=lKA(),$=Object.keys(H.plugins);return N(`Found ${$.length} installed plugins (V2 format)`),$}function xQ1(H){let{entry:$,marketplaceInstallLocation:A}=H;try{let L=zH();if(typeof $.source==="string"){if(!A)return!1;let f=L.statSync(A).isDirectory()?A:fmH.join(A,".."),E=fmH.join(f,$.source);return L.existsSync(E)}let I=Mm(),D=$.name.replace(/[^a-zA-Z0-9-_]/g,"-"),B=fmH.join(I,D);return L.existsSync(B)}catch(L){return r(L instanceof Error?L:Error(String(L))),N(`Unexpected error checking if plugin ${H.entry.name} is installed: ${L}`),!1}}async function SRA(H){try{let $=await kVH(),A=[];for(let L of H)if(!$.includes(L))try{if(await ZK(L))A.push(L)}catch(I){N(`Failed to check plugin ${L} in marketplace: ${I}`)}return A}catch($){return r($ instanceof Error?$:Error(String($))),[]}}function SQ1(H){let A=VL().skippedPlugins||[];return H.filter((L)=>!A.includes(L))}async function jRA(H,$,A="user"){let L=A!=="user"?C$():void 0,I=Wv(A),D=ZI(I),B={...D?.enabledPlugins},f=[],E=[];for(let M=0;M{mL();y4();_$();E$();_X();mL();DL();UQ();op();hDH();PI();Q7();fmH=require("path")});function pq$(H){if(!t7.includes(H))throw Error(`Invalid scope "${H}". Must be one of: ${t7.join(", ")}`)}function j1H(H){return t7.includes(H)}function Zs(H){return H==="project"||H==="local"?zL():void 0}function RQ1(H,$,A){let L="";if(Object.keys(A?.enabledPlugins||{}).forEach((I)=>{if(I===H||I===$.name||I.startsWith(`${$.name}@`))L=I}),!L)L=H.includes("@")?H:$.name;return L}function yQ1(H,$){let{name:A,marketplace:L}=Fa(H);return $.find((I)=>{if(I.name===H||I.name===A)return!0;if(L&&I.source)return I.name===A&&I.source.includes(`@${L}`);return!1})}function vQ1(H){let{name:$}=Fa(H),A=F7();if(A.plugins[H]?.length)return{pluginId:H,pluginName:$};let L=Object.keys(A.plugins).find((I)=>{let{name:D}=Fa(I);return D===$&&(A.plugins[I]?.length??0)>0});if(L)return{pluginId:L,pluginName:$};return null}function x1H(H){let A=F7().plugins[H];if(!A||A.length===0)return{scope:"user"};let L=zL(),I=A.find((f)=>f.scope==="local"&&f.projectPath===L);if(I)return{scope:I.scope,projectPath:I.projectPath};let D=A.find((f)=>f.scope==="project"&&f.projectPath===L);if(D)return{scope:D.scope,projectPath:D.projectPath};let B=A.find((f)=>f.scope==="user");if(B)return{scope:B.scope};return{scope:A[0].scope,projectPath:A[0].projectPath}}async function ZbD(H,$="user"){pq$($);let{name:A,marketplace:L}=Fa(H),I,D,B;if(L){let W=await ZK(H);if(W)I=W.entry,D=L,B=W.marketplaceInstallLocation}else{let W=await l1();for(let[P,C]of Object.entries(W))try{let Z=(await GP(P)).plugins.find((q)=>q.name===A);if(Z){I=Z,D=P,B=C.installLocation;break}}catch(Y){r(Y instanceof Error?Y:Error(`Failed to load marketplace "${P}": ${Y}`));continue}}if(!I||!D){let W=L?`marketplace "${L}"`:"any configured marketplace";return{success:!1,message:`Plugin "${A}" not found in ${W}`}}let f=I,E=`${f.name}@${D}`,M=Zs($),G,{source:U}=f;if(NR(U)){if(!B)return{success:!1,message:`Cannot install local plugin "${A}" without marketplace install location`};G=gVH.join(B,U)}await mw(E,f,$,M,G);let X=Wv($),F={...ZI(X)?.enabledPlugins,[E]:!0},{error:Q}=II(X,{enabledPlugins:F});if(Q)return{success:!1,message:`Failed to update settings: ${Q.message}`};return SG(),{success:!0,message:`Successfully installed plugin: ${E} (scope: ${$})`,pluginId:E,pluginName:f.name,scope:$}}async function dq$(H,$="user"){pq$($);let{enabled:A,disabled:L}=await xf(),I=[...A,...L],D=yQ1(H,I),B=Wv($),f=ZI(B),E,M;if(D)E=RQ1(H,D,f),M=D.name;else{let C=vQ1(H);if(!C)return{success:!1,message:`Plugin "${H}" not found in installed plugins`};E=C.pluginId,M=C.pluginName}let G=Zs($),X=F7().plugins[E],J=X?.find((C)=>C.scope===$&&C.projectPath===G);if(!J){let{scope:C}=x1H(E);if(C!==$&&X&&X.length>0)return{success:!1,message:`Plugin "${H}" is installed in ${C} scope, not ${$}. Use --scope ${C} to uninstall.`};return{success:!1,message:`Plugin "${H}" is not installed in ${$} scope. Use --scope to specify the correct scope.`}}let F=J.installPath,Q={...f?.enabledPlugins};Q[E]=void 0,II(B,{enabledPlugins:Q}),SG(),zqI(E,$,G);let P=F7().plugins[E];if((!P||P.length===0)&&F)G3H(F);return{success:!0,message:`Successfully uninstalled plugin: ${M} (scope: ${$})`,pluginId:E,pluginName:M,scope:$}}async function RRA(H,$,A){let L=$?"enable":"disable";if(A)pq$(A);let I=F7(),D=bVH(),B=H.includes("@")?H:null,E=Object.keys(I.plugins).find((X)=>{if(B)return X===B;return X.startsWith(`${H}@`)});if(!E)return{success:!1,message:`Plugin "${H}" is not installed`};let M=D.has(E);if($&&M)return{success:!1,message:`Plugin "${H}" is already enabled`};if(!$&&!M)return{success:!1,message:`Plugin "${H}" is already disabled`};let[G]=E.split("@"),U;if(A){let X=Zs(A);U={scope:A,projectPath:X};let J=x1H(E);if(J.scope!==A)return{success:!1,message:`Plugin "${H}" is installed at ${J.scope} scope, not ${A}. Use --scope ${J.scope} or omit --scope to auto-detect.`}}else U=x1H(E);if(!j1H(U.scope))return{success:!1,message:`Managed plugins cannot be ${L}d. They can only be updated.`};try{let X=Wv(U.scope),F=(ZI(X)||{}).enabledPlugins||{},{error:Q}=II(X,{enabledPlugins:{...F,[E]:$}});if(Q)throw Q;SG()}catch(X){return r(X instanceof Error?X:Error(`Failed to ${L} plugin`)),{success:!1,message:X instanceof Error?X.message:`Failed to ${L} plugin`}}return{success:!0,message:`Successfully ${L}d plugin: ${G} (scope: ${U.scope})`,pluginId:E,pluginName:G,scope:U.scope}}async function R1H(H,$){return RRA(H,!0,$)}async function EmH(H,$){return RRA(H,!1,$)}async function qbD(){let H=bVH();if(H.size===0)return{success:!0,message:"No enabled plugins to disable"};let $=[],A=[];for(let[L]of H){let I=await RRA(L,!1);if(I.success)$.push(L);else A.push(`${L}: ${I.message}`)}if(A.length>0)return{success:!1,message:`Disabled ${$.length} plugin${$.length===1?"":"s"}, ${A.length} failed: `)}`};return{success:!0,message:`Disabled ${$.length} plugin${$.length===1?"":"s"}`}}async function mVH(H,$){let{name:A,marketplace:L}=Fa(H),I=L?`${A}@${L}`:H,D=await ZK(H);if(!D)return{success:!1,message:`Plugin "${A}" not found`,pluginId:I,scope:$};let{entry:B,marketplaceInstallLocation:f}=D,M=Ka().plugins[I];if(!M||M.length===0)return{success:!1,message:`Plugin "${A}" is not installed`,pluginId:I,scope:$};let G=Zs($),U=M.find((X)=>X.scope===$&&X.projectPath===G);if(!U){let X=G?`${$} (${G})`:$;return{success:!1,message:`Plugin "${A}" is not installed at scope ${X}`,pluginId:I,scope:$}}return hQ1({pluginId:I,pluginName:A,entry:B,marketplaceInstallLocation:f,installation:U,scope:$,projectPath:G})}async function hQ1({pluginId:H,pluginName:$,entry:A,marketplaceInstallLocation:L,installation:I,scope:D,projectPath:B}){let f=zH(),E=I.version,M,G,U=!1;if(typeof A.source!=="string"){let X=await l9H(A.source,{manifest:{name:A.name}});M=X.path,U=!0,G=await ap(H,A.source,X.manifest,X.path,A.version)}else{if(!f.existsSync(L))return{success:!1,message:`Marketplace directory not found at ${L}`,pluginId:H,scope:D};let X=f.statSync(L).isDirectory()?L:gVH.dirname(L);if(M=gVH.join(X,A.source),!f.existsSync(M))return{success:!1,message:`Plugin source not found at ${M}`,pluginId:H,scope:D};let J,F=gVH.join(M,".claude-plugin","plugin.json");try{J=V2$(F,A.name,A.source)}catch{}G=await ap(H,A.source,J,M,A.version)}try{let X=Pv(H,G);if(I.version===G||I.installPath===X)return{success:!0,message:`${$} is already at the latest version (${G}).`,pluginId:H,newVersion:G,oldVersion:E,alreadyUpToDate:!0,scope:D};if(!f.existsSync(X))await W2$(M,H,G,A);let F=I.installPath;if(NqI(H,D,B,X,G),F&&F!==X){let P=Ka();if(!Object.values(P.plugins).some((Y)=>Y.some((Z)=>Z.installPath===F))&&f.existsSync(F))G3H(F)}let Q=B?`${D} (${B})`:D;return{success:!0,message:`Plugin "${$}" updated from ${E||"unknown"} to ${G} for scope ${Q}. Restart to apply changes.`,pluginId:H,newVersion:G,oldVersion:E,scope:D}}finally{if(U&&M!==Pv(H,G))f.rmSync(M,{recursive:!0,force:!0})}}var gVH,t7,S1H;var pVH=K(()=>{_X();Q7();op();y4();UQ();mL();Vz();hDH();g$();K2$();DL();_$();uVH();gVH=require("path"),t7=["user","project","local"],S1H=["user","project","local","managed"]});function TbD({pluginName:H,serverName:$,configSchema:A,onSave:L,onCancel:I}){let D=Object.keys(A),[B,f]=y1H.useState(0),[E,M]=y1H.useState({}),[G,U]=y1H.useState(""),X=D[B],J=X?A[X]:null;BA("confirm:no",I,{context:"Settings"});let F=y1H.useCallback(()=>{if(B({...Y,[X]:G})),f((Y)=>Y+1),U("")},[B,D.length,X,G]),Q=y1H.useCallback(()=>{if(!X)return;let Y={...E,[X]:G};if(B===D.length-1){let Z={};for(let q of D){let O=Y[q]||"",j=A[q];if(j?.type==="number"){let u=Number(O);Z[q]=isNaN(u)?O:u}else if(j?.type==="boolean")Z[q]=A$(O);else Z[q]=O}L(Z)}else M(Y),f((Z)=>Z+1),U("")},[X,E,G,B,D,A,L]);if(bI({"confirm:nextField":F,"confirm:yes":Q},{context:"Confirmation"}),WL((Y,Z)=>{if(Z.backspace||Z.delete){U((q)=>q.slice(0,-1));return}if(Y&&!Z.ctrl&&!Z.meta&&!Z.tab&&!Z.return)U((q)=>q+Y)}),!J||!X)return null;let W=J.sensitive===!0,P=J.required===!0,C=W?"*".repeat(G.length):G;return VC.default.createElement(BL,{title:`Configure ${$}`,subtitle:`Plugin: ${H}`,onCancel:I,isCancelActive:!1},VC.default.createElement(x,{flexDirection:"column"},VC.default.createElement(V,{bold:!0},J.title||X,P&&VC.default.createElement(V,{color:"error"}," *")),J.description&&VC.default.createElement(V,{dimColor:!0},J.description),VC.default.createElement(x,{marginTop:1},VC.default.createElement(V,null,pH.pointerSmall," "),VC.default.createElement(V,null,C),VC.default.createElement(V,null,"\u2588"))),VC.default.createElement(x,{flexDirection:"column"},VC.default.createElement(V,{dimColor:!0},"Field ",B+1," of ",D.length),B{xH();$I();bB();jI();NA();VC=b(s(),1),y1H=b(s(),1)});function NbD({item:H,isSelected:$}){let[A]=_I();if(H.type==="plugin"){let D,B;if(H.pendingToggle)D=ZL("suggestion",A)(pH.arrowRight),B=H.pendingToggle==="will-enable"?"will enable":"will disable";else if(H.errorCount>0)D=ZL("error",A)(pH.cross),B=`${H.errorCount} error${H.errorCount!==1?"s":""}`;else if(!H.isEnabled)D=ZL("inactive",A)(pH.radioOff),B="disabled";else D=ZL("success",A)(pH.tick),B="enabled";return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"Plugin")),oD.createElement(V,{dimColor:!0}," \xB7 ",H.marketplace),oD.createElement(V,{dimColor:!$}," \xB7 ",D," "),oD.createElement(V,{dimColor:!$},B))}if(H.type==="failed-plugin"){let D=ZL("error",A)(pH.cross),B=`failed to load \xB7 ${H.errorCount} error${H.errorCount!==1?"s":""}`;return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"Plugin")),oD.createElement(V,{dimColor:!0}," \xB7 ",H.marketplace),oD.createElement(V,{dimColor:!$}," \xB7 ",D," "),oD.createElement(V,{dimColor:!$},B))}let L,I;if(H.status==="connected")L=ZL("success",A)(pH.tick),I="connected";else if(H.status==="disabled")L=ZL("inactive",A)(pH.radioOff),I="disabled";else if(H.status==="pending")L=ZL("inactive",A)(pH.radioOff),I="connecting\u2026";else if(H.status==="needs-auth")L=ZL("warning",A)(pH.triangleUpOutline),I="needs auth";else L=ZL("error",A)(pH.cross),I="failed";if(H.indented)return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{dimColor:!$},"\u2514 "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"MCP")),oD.createElement(V,{dimColor:!$}," \xB7 ",L," "),oD.createElement(V,{dimColor:!$},I));return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"MCP")),oD.createElement(V,{dimColor:!$}," \xB7 ",L," "),oD.createElement(V,{dimColor:!$},I))}var oD;var ObD=K(()=>{xH();jI();oD=b(s(),1)});function jbD(H){switch(H.type){case"path-not-found":return`${H.component} path not found: ${H.path}`;case"git-auth-failed":return`Git ${H.authType.toUpperCase()} authentication failed for ${H.gitUrl}`;case"git-timeout":return`Git ${H.operation} timed out for ${H.gitUrl}`;case"network-error":return`Network error accessing ${H.url}${H.details?`: ${H.details}`:""}`;case"manifest-parse-error":return`Failed to parse manifest at ${H.manifestPath}: ${H.parseError}`;case"manifest-validation-error":return`Invalid manifest at ${H.manifestPath}: ${H.validationErrors.join(", ")}`;case"plugin-not-found":return`Plugin '${H.pluginId}' not found in marketplace '${H.marketplace}'`;case"marketplace-not-found":return`Marketplace '${H.marketplace}' not found`;case"marketplace-load-failed":return`Failed to load marketplace '${H.marketplace}': ${H.reason}`;case"repository-scan-failed":return`Failed to scan repository at ${H.repositoryPath}: ${H.reason}`;case"mcp-config-invalid":return`Invalid MCP server config for '${H.serverName}': ${H.validationError}`;case"hook-load-failed":return`Failed to load hooks from ${H.hookPath}: ${H.reason}`;case"component-load-failed":return`Failed to load ${H.component} from ${H.path}: ${H.reason}`;case"mcpb-download-failed":return`Failed to download MCPB from ${H.url}: ${H.reason}`;case"mcpb-extract-failed":return`Failed to extract MCPB ${H.mcpbPath}: ${H.reason}`;case"mcpb-invalid-manifest":return`MCPB manifest invalid at ${H.mcpbPath}: ${H.validationError}`;case"marketplace-blocked-by-policy":return H.blockedByBlocklist?`Marketplace '${H.marketplace}' is blocked by enterprise policy`:`Marketplace '${H.marketplace}' is not in the allowed marketplace list`;case"generic-error":return H.error;default:return"Unknown error"}}function RbD(H){switch(H.type){case"path-not-found":return"Check that the path in your manifest or marketplace config is correct";case"git-auth-failed":return H.authType==="ssh"?"Configure SSH keys or use HTTPS URL instead":"Configure credentials or use SSH URL instead";case"git-timeout":case"network-error":return"Check your internet connection and try again";case"manifest-parse-error":return"Check manifest file syntax in the plugin directory";case"manifest-validation-error":return"Check manifest file follows the required schema";case"plugin-not-found":return`Plugin may not exist in marketplace '${H.marketplace}'`;case"marketplace-not-found":return H.availableMarketplaces.length>0?`Available marketplaces: ${H.availableMarketplaces.join(", ")}`:"Add the marketplace first using /plugin marketplace add";case"mcp-config-invalid":return"Check MCP server configuration in .mcp.json or manifest";case"hook-load-failed":return"Check hooks.json file syntax and structure";case"component-load-failed":return`Check ${H.component} directory structure and file permissions`;case"mcpb-download-failed":return"Check your internet connection and URL accessibility";case"mcpb-extract-failed":return"Verify the MCPB file is valid and not corrupted";case"mcpb-invalid-manifest":return"Contact the plugin author about the invalid manifest";case"marketplace-blocked-by-policy":if(H.blockedByBlocklist)return"This marketplace source is explicitly blocked by your administrator";return H.allowedSources.length>0?`Allowed sources: ${H.allowedSources.join(", ")}`:"Contact your administrator to configure allowed marketplace sources";case"repository-scan-failed":case"marketplace-load-failed":case"generic-error":return null;default:return null}}var xbD,SbD;var ybD=K(()=>{xH();$I();pL();BmH();j0();xbD=b(s(),1),SbD=b(s(),1)});async function vbD(H){try{return(await h1H.readdir(H,{withFileTypes:!0})).filter((A)=>A.isFile()&&A.name.endsWith(".md")).map((A)=>{return v1H.basename(A.name,".md")})}catch($){let A=$ instanceof Error?$.message:String($);return N(`Failed to read plugin components from ${H}: ${A}`,{level:"error"}),r($ instanceof Error?$:Error(`Failed to read plugin components: ${A}`)),[]}}async function bQ1(H){try{let $=await h1H.readdir(H,{withFileTypes:!0}),A=[];for(let L of $)if(L.isDirectory()||L.isSymbolicLink()){let I=v1H.join(H,L.name,"SKILL.md");try{await h1H.access(I),A.push(L.name)}catch{}}return A}catch($){let A=$ instanceof Error?$.message:String($);return N(`Failed to read skill directories from ${H}: ${A}`,{level:"error"}),r($ instanceof Error?$:Error(`Failed to read skill directories: ${A}`)),[]}}function kQ1({plugin:H,marketplace:$}){let[A,L]=QM.useState(null),[I,D]=QM.useState(!0),[B,f]=QM.useState(null);if(QM.useEffect(()=>{async function M(){try{let U=(await GP($)).plugins.find((X)=>X.name===H.name);if(U){let X=[];if(H.commandsPath)X.push(H.commandsPath);if(H.commandsPaths)X.push(...H.commandsPaths);let J=[];for(let Z of X)if(typeof Z==="string"){let q=await vbD(Z);J.push(...q)}let F=[];if(H.agentsPath)F.push(H.agentsPath);if(H.agentsPaths)F.push(...H.agentsPaths);let Q=[];for(let Z of F)if(typeof Z==="string"){let q=await vbD(Z);Q.push(...q)}let W=[];if(H.skillsPath)W.push(H.skillsPath);if(H.skillsPaths)W.push(...H.skillsPaths);let P=[];for(let Z of W)if(typeof Z==="string"){let q=await bQ1(Z);P.push(...q)}let C=[];if(H.hooksConfig)C.push(Object.keys(H.hooksConfig));if(U.hooks)C.push(U.hooks);let Y=[];if(H.mcpServers)Y.push(Object.keys(H.mcpServers));if(U.mcpServers)Y.push(U.mcpServers);L({commands:J.length>0?J:null,agents:Q.length>0?Q:null,skills:P.length>0?P:null,hooks:C.length>0?C:null,mcpServers:Y.length>0?Y:null})}else f(`Plugin ${H.name} not found in marketplace`)}catch(G){f(G instanceof Error?G.message:"Failed to load components")}finally{D(!1)}}M()},[H.name,H.commandsPath,H.commandsPaths,H.agentsPath,H.agentsPaths,H.skillsPath,H.skillsPaths,H.hooksConfig,H.mcpServers,$]),I)return null;if(B)return a$.createElement(x,{flexDirection:"column",marginBottom:1},a$.createElement(V,{bold:!0},"Components:"),a$.createElement(V,{dimColor:!0},"Error: ",B));if(!A)return null;if(!(A.commands||A.agents||A.skills||A.hooks||A.mcpServers))return null;return a$.createElement(x,{flexDirection:"column",marginBottom:1},a$.createElement(V,{bold:!0},"Installed components:"),A.commands?a$.createElement(V,{dimColor:!0},"\u2022 Commands:"," ",typeof A.commands==="string"?A.commands:Array.isArray(A.commands)?A.commands.join(", "):Object.keys(A.commands).join(", ")):null,A.agents?a$.createElement(V,{dimColor:!0},"\u2022 Agents:"," ",typeof A.agents==="string"?A.agents:Array.isArray(A.agents)?A.agents.join(", "):Object.keys(A.agents).join(", ")):null,A.skills?a$.createElement(V,{dimColor:!0},"\u2022 Skills:"," ",typeof A.skills==="string"?A.skills:Array.isArray(A.skills)?A.skills.join(", "):Object.keys(A.skills).join(", ")):null,A.hooks?a$.createElement(V,{dimColor:!0},"\u2022 Hooks:"," ",typeof A.hooks==="string"?A.hooks:Array.isArray(A.hooks)?A.hooks.map(String).join(", "):typeof A.hooks==="object"&&A.hooks!==null?Object.keys(A.hooks).join(", "):String(A.hooks)):null,A.mcpServers?a$.createElement(V,{dimColor:!0},"\u2022 MCP Servers:"," ",typeof A.mcpServers==="string"?A.mcpServers:Array.isArray(A.mcpServers)?A.mcpServers.map(String).join(", "):typeof A.mcpServers==="object"&&A.mcpServers!==null?Object.keys(A.mcpServers).join(", "):String(A.mcpServers)):null)}async function uQ1(H,$){let L=(await GP($))?.plugins.find((I)=>I.name===H);if(L&&typeof L.source==="string")return`Local plugins cannot be updated remotely. To update, modify the source at: ${L.source}`;return null}function hbD({setViewState:H,setResult:$,onManageComplete:A,onSearchModeChange:L,targetPlugin:I,targetMarketplace:D,action:B}){let f=J$((vH)=>vH.mcp.clients),E=J$((vH)=>vH.mcp.tools),M=J$((vH)=>vH.plugins.errors),[G,U]=QM.useState(!1),X=QM.useCallback((vH)=>{U(vH),L?.(vH)},[L]),J=EJ(),{columns:F}=QL(),[Q,W]=QM.useState("plugin-list"),{query:P,setQuery:C,cursorOffset:Y}=Eb({isActive:Q==="plugin-list"&&G,onExit:()=>{X(!1)}}),[Z,q]=QM.useState(null),[O,j]=QM.useState([]),[u,y]=QM.useState([]),[g,h]=QM.useState(!0),[p,d]=QM.useState(!1),[k,n]=QM.useState(new Map),GH=_s(),HH=a$.useCallback(()=>{if(Q==="plugin-details")W("plugin-list"),q(null),LH(null);else if(Q==="configuring")W("plugin-details"),DH(null);else if(typeof Q==="object"&&Q.type==="mcp-detail")W("plugin-list"),LH(null);else if(typeof Q==="object"&&Q.type==="mcp-tools")W({type:"mcp-detail",client:Q.client});else if(typeof Q==="object"&&Q.type==="mcp-tool-detail")W({type:"mcp-tools",client:Q.client});else H({type:"menu"})},[Q,H]);BA("confirm:no",HH,{context:"Confirmation",isActive:Q!=="plugin-list"||!G});let BH=(vH)=>{if(vH.type==="connected")return"connected";if(vH.type==="disabled")return"disabled";if(vH.type==="pending")return"pending";if(vH.type==="needs-auth")return"needs-auth";if(vH.type==="proxy")return"connected";return"failed"},WH=QM.useMemo(()=>{let vH=VL(),tH=new Map;for(let n$ of f)if(n$.name.startsWith("plugin:")){let fA=n$.name.split(":");if(fA.length>=3){let UH=fA[1],_H=fA.slice(2).join(":"),aH=tH.get(UH)||[];aH.push({displayName:_H,client:n$}),tH.set(UH,aH)}}let K$=[];for(let n$ of u){let fA=`${n$.plugin.name}@${n$.marketplace}`,UH=vH?.enabledPlugins?.[fA]!==!1,_H=M.filter((aH)=>("plugin"in aH)&&aH.plugin===n$.plugin.name||aH.source===fA||aH.source.startsWith(`${n$.plugin.name}@`));K$.push({item:{type:"plugin",id:fA,name:n$.plugin.name,description:n$.plugin.manifest.description,marketplace:n$.marketplace,scope:n$.scope||"user",isEnabled:UH,errorCount:_H.length,errors:_H,plugin:n$.plugin,pendingEnable:n$.pendingEnable,pendingUpdate:n$.pendingUpdate,pendingToggle:k.get(fA)},childMcps:tH.get(n$.plugin.name)||[]})}let KA=new Set(K$.map(({item:n$})=>n$.id)),UA=new Set(K$.map(({item:n$})=>n$.name)),U$=new Map;for(let n$ of M){if(KA.has(n$.source)||"plugin"in n$&&typeof n$.plugin==="string"&&UA.has(n$.plugin))continue;let fA=U$.get(n$.source)||[];fA.push(n$),U$.set(n$.source,fA)}let hA=[];for(let[n$,fA]of U$){let UH=n$.split("@"),_H=UH[0]||n$,aH=UH[1]||"unknown";hA.push({type:"failed-plugin",id:n$,name:_H,marketplace:aH,scope:"user",errorCount:fA.length,errors:fA})}let iA=[];for(let n$ of f){if(n$.name==="ide")continue;if(n$.name.startsWith("plugin:"))continue;iA.push({type:"mcp",id:`mcp:${n$.name}`,name:n$.name,description:void 0,scope:n$.config.scope,status:BH(n$),client:n$})}let rH={project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5},G$=[],b$=new Map;for(let{item:n$,childMcps:fA}of K$){let UH=n$.scope;if(!b$.has(UH))b$.set(UH,[]);b$.get(UH).push(n$);for(let{displayName:_H,client:aH}of fA){let f$=n$.scope;if(!b$.has(f$))b$.set(f$,[]);b$.get(f$).push({type:"mcp",id:`mcp:${aH.name}`,name:_H,description:void 0,scope:f$,status:BH(aH),client:aH,indented:!0})}}for(let n$ of iA){let fA=n$.scope;if(!b$.has(fA))b$.set(fA,[]);b$.get(fA).push(n$)}for(let n$ of hA){let fA=n$.scope;if(!b$.has(fA))b$.set(fA,[]);b$.get(fA).push(n$)}let ZA=[...b$.keys()].sort((n$,fA)=>(rH[n$]??99)-(rH[fA]??99));for(let n$ of ZA){let fA=b$.get(n$),UH=[],_H=[],aH=0;while(aHf$[0].name.localeCompare(I$[0].name)),_H.sort((f$,I$)=>f$.name.localeCompare(I$.name));for(let f$ of UH)G$.push(...f$);G$.push(..._H)}return G$},[u,f,M,k]),wH=QM.useMemo(()=>{if(!P)return WH;let vH=P.toLowerCase();return WH.filter((tH)=>tH.name.toLowerCase().includes(vH)||tH.description?.toLowerCase().includes(vH))},[WH,P]),[QH,TH]=QM.useState(0),t=O1H({totalItems:wH.length,selectedIndex:QH,maxVisible:8}),[IH,KH]=QM.useState(0),[MH,CH]=QM.useState(!1),[OH,LH]=QM.useState(null),[e,DH]=QM.useState(null),[EH,$H]=QM.useState(!1),[FH,YH]=QM.useState(!1);QM.useEffect(()=>{if(!Z){YH(!1);return}async function vH(){let tH=Z.plugin.manifest.mcpServers,K$=!1;if(tH)K$=typeof tH==="string"&&OT(tH)||Array.isArray(tH)&&tH.some((KA)=>typeof KA==="string"&&OT(KA));if(!K$)try{let KA=v1H.join(Z.plugin.path,".."),UA=v1H.join(KA,".claude-plugin","marketplace.json"),U$=await h1H.readFile(UA,"utf-8"),iA=DA(U$).plugins?.find((rH)=>rH.name===Z.plugin.name);if(iA?.mcpServers){let rH=iA.mcpServers;K$=typeof rH==="string"&&OT(rH)||Array.isArray(rH)&&rH.some((G$)=>typeof G$==="string"&&OT(G$))}}catch(KA){N(`Failed to read raw marketplace.json: ${KA}`)}YH(K$)}vH()},[Z]),QM.useEffect(()=>{async function vH(){h(!0);try{let{enabled:tH,disabled:K$}=await xf(),KA=[...tH,...K$],UA=VL(),U$={};for(let rH of KA){let G$=rH.source.split("@")[1]||"local";if(!U$[G$])U$[G$]=[];U$[G$].push(rH)}let hA=[];for(let[rH,G$]of Object.entries(U$)){let b$=G$.filter((n$)=>{let fA=`${n$.name}@${rH}`;return UA?.enabledPlugins?.[fA]!==!1}).length,ZA=G$.length-b$;hA.push({name:rH,installedPlugins:G$,enabledCount:b$,disabledCount:ZA})}hA.sort((rH,G$)=>{if(rH.name==="claude-plugin-directory")return-1;if(G$.name==="claude-plugin-directory")return 1;return rH.name.localeCompare(G$.name)}),j(hA);let iA=[];for(let rH of hA)for(let G$ of rH.installedPlugins){let b$=`${G$.name}@${rH.name}`,{scope:ZA}=x1H(b$);iA.push({plugin:G$,marketplace:rH.name,scope:ZA,pendingEnable:void 0,pendingUpdate:!1})}y(iA),TH(0)}finally{h(!1)}}vH()},[]),QM.useEffect(()=>{if(I&&O.length>0&&!g){let vH=D?O.filter((tH)=>tH.name===D):O;for(let tH of vH){let K$=tH.installedPlugins.find((KA)=>KA.name===I);if(K$){let KA=`${K$.name}@${tH.name}`,{scope:UA}=x1H(KA),U$={plugin:K$,marketplace:tH.name,scope:UA,pendingEnable:void 0,pendingUpdate:!1};q(U$),W("plugin-details");break}}}},[I,D,O,g]);let qH=async(vH)=>{if(!Z)return;let tH=Z.scope||"user";if(!j1H(tH)&&vH!=="update"){LH("Managed plugins can only be updated, not enabled, disabled, or uninstalled.");return}CH(!0),LH(null);try{let K$=`${Z.plugin.name}@${Z.marketplace}`,KA=Zs(tH);switch(vH){case"enable":{if(!j1H(tH))break;if(!K7(K$)){let iA=await ZK(K$);if(iA){let{entry:rH,marketplaceInstallLocation:G$}=iA,b$=NR(rH.source)?v1H.join(G$,rH.source):void 0;await mw(K$,rH,tH,KA,b$)}}let hA=await R1H(K$,tH);if(!hA.success)throw Error(hA.message);break}case"disable":{if(!j1H(tH))break;let hA=await EmH(K$,tH);if(!hA.success)throw Error(hA.message);break}case"uninstall":{if(!j1H(tH))break;let hA=await dq$(K$,tH);if(!hA.success)throw Error(hA.message);break}case"update":{let hA=await mVH(K$,tH);if(!hA.success)throw Error(hA.message);if(hA.alreadyUpToDate){if($(`${Z.plugin.name} is already at the latest version (${hA.newVersion}).`),A)await A();H({type:"menu"});return}break}}SG();let U$=`\u2713 ${vH==="enable"?"Enabled":vH==="disable"?"Disabled":vH==="update"?"Updated":"Uninstalled"} ${Z.plugin.name}. Restart Claude Code to apply changes.`;if($(U$),A)await A();H({type:"menu"})}catch(K$){CH(!1);let KA=K$ instanceof Error?K$.message:String(K$);LH(`Failed to ${vH}: ${KA}`),r(K$ instanceof Error?K$:Error(`Failed to ${vH} plugin: ${String(K$)}`))}},bH=a$.useCallback(()=>{if(QH>=wH.length)return;let vH=wH[QH];if(vH?.type==="plugin"){let tH=`${vH.plugin.name}@${vH.marketplace}`,K$=VL(),KA=k.get(tH),UA=K$?.enabledPlugins?.[tH]!==!1,U$=vH.scope||"user";if(j1H(U$)){let hA=new Map(k);if(KA)hA.delete(tH);else hA.set(tH,UA?"will-disable":"will-enable"),(async()=>{try{if(UA)await EmH(tH,U$);else await R1H(tH,U$);SG(),d(!0)}catch(iA){r(iA instanceof Error?iA:Error(String(iA)))}})();n(hA)}}else if(vH?.type==="mcp")GH(vH.client.name)},[QH,wH,k,u,GH]),hH=a$.useCallback(()=>{if(QH>=wH.length)return;let vH=wH[QH];if(vH?.type==="plugin"){let tH=u.find((K$)=>K$.plugin.name===vH.plugin.name&&K$.marketplace===vH.marketplace);if(tH)q(tH),W("plugin-details"),KH(0),LH(null)}else if(vH?.type==="mcp")W({type:"mcp-detail",client:vH.client}),LH(null)},[QH,wH,u]);bI({"select:previous":()=>{if(QH===0)X(!0);else t.handleSelectionChange(QH-1,TH)},"select:next":()=>{if(QH{if(Q!=="plugin-details"||!Z)return[];let vH=VL(),tH=`${Z.plugin.name}@${Z.marketplace}`,K$=vH?.enabledPlugins?.[tH]!==!1,KA=[];if(KA.push({label:K$?"Disable plugin":"Enable plugin",action:()=>void qH(K$?"disable":"enable")}),KA.push({label:Z.pendingUpdate?"Unmark for update":"Mark for update",action:async()=>{try{let UA=await uQ1(Z.plugin.name,Z.marketplace);if(UA){LH(UA);return}let U$=[...u],hA=U$.findIndex((iA)=>iA.plugin.name===Z.plugin.name&&iA.marketplace===Z.marketplace);if(hA!==-1)U$[hA].pendingUpdate=!Z.pendingUpdate,y(U$),q({...Z,pendingUpdate:!Z.pendingUpdate})}catch(UA){LH(UA instanceof Error?UA.message:"Failed to check plugin update availability")}}}),FH)KA.push({label:"Configure",action:async()=>{$H(!0);try{let UA=Z.plugin.manifest.mcpServers,U$=null;if(typeof UA==="string"&&OT(UA))U$=UA;else if(Array.isArray(UA)){for(let rH of UA)if(typeof rH==="string"&&OT(rH)){U$=rH;break}}if(!U$){LH("No MCPB file found in plugin"),$H(!1);return}let hA=`${Z.plugin.name}@${Z.marketplace}`,iA=await uRH(U$,Z.plugin.path,hA,void 0,void 0,!0);if("status"in iA&&iA.status==="needs-config")DH(iA),W("configuring");else LH("Failed to load MCPB for configuration")}catch(UA){let U$=UA instanceof Error?UA.message:String(UA);LH(`Failed to load configuration: ${U$}`)}finally{$H(!1)}}});if(KA.push({label:"Update now",action:()=>void qH("update")}),KA.push({label:"Uninstall",action:()=>void qH("uninstall")}),Z.plugin.manifest.homepage)KA.push({label:"Open homepage",action:()=>void HE(Z.plugin.manifest.homepage)});if(Z.plugin.manifest.repository)KA.push({label:"View on GitHub",action:()=>void HE(Z.plugin.manifest.repository)});return KA.push({label:"Back to plugin list",action:()=>{W("plugin-list"),q(null),LH(null)}}),KA},[Q,Z,FH,u]);if(bI({"select:previous":()=>{if(IH>0)KH(IH-1)},"select:next":()=>{if(IH{if(PH[IH])PH[IH].action()}},{context:"Select",isActive:Q==="plugin-details"&&!!Z}),a$.useEffect(()=>{TH(0)},[P]),WL((vH,tH)=>{let K$=!tH.ctrl&&!tH.meta;if(G)return;if(vH==="/"&&K$)X(!0),C(""),TH(0);else if(K$&&vH.length>0&&!/^\s+$/.test(vH)&&vH!=="j"&&vH!=="k"&&vH!==" ")X(!0),C(vH),TH(0)},{isActive:Q==="plugin-list"}),g)return a$.createElement(V,null,"Loading installed plugins\u2026");if(WH.length===0)return a$.createElement(x,{flexDirection:"column"},a$.createElement(x,{marginBottom:1},a$.createElement(V,{bold:!0},"Manage plugins")),a$.createElement(V,null,"No plugins or MCP servers installed."),a$.createElement(x,{marginTop:1},a$.createElement(V,{dimColor:!0},"Esc to go back")));if(Q==="configuring"&&e&&Z){let K$=function(){DH(null),W("plugin-details")},vH=`${Z.plugin.name}@${Z.marketplace}`;async function tH(KA){if(!e||!Z)return;try{let UA=Z.plugin.manifest.mcpServers,U$=null;if(typeof UA==="string"&&OT(UA))U$=UA;else if(Array.isArray(UA)){for(let hA of UA)if(typeof hA==="string"&&OT(hA)){U$=hA;break}}if(!U$){LH("No MCPB file found"),W("plugin-details");return}await uRH(U$,Z.plugin.path,vH,void 0,KA),LH(null),DH(null),W("plugin-details"),$("Configuration saved. Restart Claude Code for changes to take effect.")}catch(UA){let U$=UA instanceof Error?UA.message:String(UA);LH(`Failed to save configuration: ${U$}`),W("plugin-details")}}return a$.createElement(TbD,{pluginName:Z.plugin.name,serverName:e.manifest.name,configSchema:e.configSchema,onSave:tH,onCancel:K$})}if(Q==="plugin-details"&&Z){let vH=VL(),tH=`${Z.plugin.name}@${Z.marketplace}`,K$=vH?.enabledPlugins?.[tH]!==!1,KA=M.filter((U$)=>("plugin"in U$)&&U$.plugin===Z.plugin.name||U$.source===tH||U$.source.startsWith(`${Z.plugin.name}@`)),UA=KA.length===0?null:a$.createElement(x,{flexDirection:"column",marginBottom:1},a$.createElement(V,{bold:!0,color:"error"},KA.length," error",KA.length!==1?"s":"",":"),KA.map((U$,hA)=>{let iA=RbD(U$);return a$.createElement(x,{key:hA,flexDirection:"column",marginLeft:2},a$.createElement(V,{color:"error"},jbD(U$)),iA&&a$.createElement(V,{dimColor:!0,italic:!0},pH.arrowRight," ",iA))}));return a$.createElement(x,{flexDirection:"column"},a$.createElement(x,null,a$.createElement(V,{bold:!0},Z.plugin.name," @ ",Z.marketplace)),a$.createElement(x,null,a$.createElement(V,{dimColor:!0},"Scope: "),a$.createElement(V,null,Z.scope||"user")),Z.plugin.manifest.version&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0},"Version: "),a$.createElement(V,null,Z.plugin.manifest.version)),Z.plugin.manifest.description&&a$.createElement(x,{marginBottom:1},a$.createElement(V,null,Z.plugin.manifest.description)),Z.plugin.manifest.author&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0},"Author: "),a$.createElement(V,null,Z.plugin.manifest.author.name)),a$.createElement(x,{marginBottom:1},a$.createElement(V,{dimColor:!0},"Status: "),a$.createElement(V,{color:K$?"success":"warning"},K$?"Enabled":"Disabled"),Z.pendingUpdate&&a$.createElement(V,{color:"suggestion"}," \xB7 Marked for update")),a$.createElement(kQ1,{plugin:Z.plugin,marketplace:Z.marketplace}),UA,a$.createElement(x,{marginTop:1,flexDirection:"column"},PH.map((U$,hA)=>{let iA=hA===IH;return a$.createElement(x,{key:hA},iA&&a$.createElement(V,null,pH.pointer," "),!iA&&a$.createElement(V,null," "),a$.createElement(V,{bold:iA,color:U$.label.includes("Uninstall")?"error":U$.label.includes("Update")?"suggestion":void 0},U$.label))})),MH&&a$.createElement(x,{marginTop:1},a$.createElement(V,null,"Processing\u2026")),OH&&a$.createElement(x,{marginTop:1},a$.createElement(V,{color:"error"},OH)),a$.createElement(x,{marginTop:1},a$.createElement(V,{dimColor:!0,italic:!0},a$.createElement(rA,null,a$.createElement(VA,{action:"select:previous",context:"Select",fallback:"\u2191",description:"navigate"}),a$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),a$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}if(typeof Q==="object"&&Q.type==="mcp-detail"){let vH=Q.client,tH=dh(E,vH.name).length,K$=()=>{W({type:"mcp-tools",client:vH})},KA=()=>{W("plugin-list")},UA=(iA)=>{if(iA)$(iA);W("plugin-list")},U$=vH.config.scope,hA=vH.config.type;if(hA==="stdio"){let iA={name:vH.name,client:vH,scope:U$,transport:"stdio",config:vH.config};return a$.createElement($mH,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}else if(hA==="sse"){let iA={name:vH.name,client:vH,scope:U$,transport:"sse",isAuthenticated:void 0,config:vH.config};return a$.createElement(z1H,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}else if(hA==="http"){let iA={name:vH.name,client:vH,scope:U$,transport:"http",isAuthenticated:void 0,config:vH.config};return a$.createElement(z1H,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}else if(hA==="claudeai-proxy"){let iA={name:vH.name,client:vH,scope:U$,transport:"claudeai-proxy",isAuthenticated:void 0,config:vH.config};return a$.createElement(z1H,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}return W("plugin-list"),null}if(typeof Q==="object"&&Q.type==="mcp-tools"){let vH=Q.client,tH=vH.config.scope,K$=vH.config.type,KA;if(K$==="stdio")KA={name:vH.name,client:vH,scope:tH,transport:"stdio",config:vH.config};else if(K$==="sse")KA={name:vH.name,client:vH,scope:tH,transport:"sse",isAuthenticated:void 0,config:vH.config};else if(K$==="http")KA={name:vH.name,client:vH,scope:tH,transport:"http",isAuthenticated:void 0,config:vH.config};else KA={name:vH.name,client:vH,scope:tH,transport:"claudeai-proxy",isAuthenticated:void 0,config:vH.config};return a$.createElement(AmH,{server:KA,onSelectTool:(UA)=>{W({type:"mcp-tool-detail",client:vH,tool:UA})},onBack:()=>W({type:"mcp-detail",client:vH})})}if(typeof Q==="object"&&Q.type==="mcp-tool-detail"){let{client:vH,tool:tH}=Q,K$=vH.config.scope,KA=vH.config.type,UA;if(KA==="stdio")UA={name:vH.name,client:vH,scope:K$,transport:"stdio",config:vH.config};else if(KA==="sse")UA={name:vH.name,client:vH,scope:K$,transport:"sse",isAuthenticated:void 0,config:vH.config};else if(KA==="http")UA={name:vH.name,client:vH,scope:K$,transport:"http",isAuthenticated:void 0,config:vH.config};else UA={name:vH.name,client:vH,scope:K$,transport:"claudeai-proxy",isAuthenticated:void 0,config:vH.config};return a$.createElement(LmH,{tool:tH,server:UA,onBack:()=>W({type:"mcp-tools",client:vH})})}let gH=t.getVisibleItems(wH);return a$.createElement(x,{flexDirection:"column"},a$.createElement(x,{marginBottom:1},a$.createElement(fb,{query:P,isFocused:G,isTerminalFocused:J,width:F-4,cursorOffset:Y})),wH.length===0&&P&&a$.createElement(x,{marginBottom:1},a$.createElement(V,{dimColor:!0},'No items match "',P,'"')),t.scrollPosition.canScrollUp&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0}," ",pH.arrowUp," more above")),gH.map((vH,tH)=>{let KA=t.toActualIndex(tH)===QH&&!G,UA=tH>0?gH[tH-1]:null,U$=!UA||UA.scope!==vH.scope,hA=(iA)=>{switch(iA){case"project":return"Project";case"local":return"Local";case"user":return"User";case"enterprise":return"Enterprise";case"managed":return"Managed";case"dynamic":return"Built-in";default:return iA}};return a$.createElement(a$.Fragment,{key:vH.id},U$&&a$.createElement(x,{marginTop:tH>0?1:0,paddingLeft:2},a$.createElement(V,{dimColor:!0},hA(vH.scope))),a$.createElement(NbD,{item:vH,isSelected:KA}))}),t.scrollPosition.canScrollDown&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0}," ",pH.arrowDown," more below")),a$.createElement(x,{marginTop:1,marginLeft:1},a$.createElement(V,{dimColor:!0,italic:!0},a$.createElement(rA,null,a$.createElement(V,null,"type to search"),a$.createElement(VA,{action:"plugin:toggle",context:"Plugin",fallback:"Space",description:"toggle"}),a$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"details"}),a$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))),p&&a$.createElement(x,{marginLeft:1},a$.createElement(V,{dimColor:!0,italic:!0},"Restart to apply plugin changes")))}var a$,QM,h1H,v1H;var bbD=K(()=>{xH();VVH();PVH();OB();jI();_X();y4();UQ();mL();Vz();F3();_$();E$();Q7();op();pVH();zbD();oWA();BmH();Z$();pL();ObD();yq$();vq$();hq$();bq$();kF();ybD();Ys();eB();j0();$I();a$=b(s(),1),QM=b(s(),1),h1H=b(require("fs/promises")),v1H=b(require("path"))});async function cq$(){let H=VL(),$=new Map;if(H.extraKnownMarketplaces)for(let[A,L]of Object.entries(H.extraKnownMarketplaces))$.set(A,L);return $}async function lq$(H){try{let $=await l1(),A=[];for(let[L]of H)if(!$[L])A.push(L);return A}catch($){return r($ instanceof Error?$:Error(String($))),[]}}var yRA=K(()=>{mL();y4();_$();Z$()});function vRA(H,$,A,L){H((I)=>({...I,plugins:{...I.plugins,installationStatus:{...I.plugins.installationStatus,marketplaces:I.plugins.installationStatus.marketplaces.map((D)=>D.name===$?{...D,status:A,error:L}:D)}}}))}function hRA(H,$,A,L){H((I)=>({...I,plugins:{...I.plugins,installationStatus:{...I.plugins.installationStatus,plugins:I.plugins.installationStatus.plugins.map((D)=>D.id===$?{...D,status:A,error:L}:D)}}}))}async function gQ1(H,$,A){let L=[],I=[];for(let D of H){let B=$.get(D);if(!B)continue;vRA(A,D,"installing");try{await uw(B.source),L.push(D),vRA(A,D,"installed"),X3H(),Sx(),await mQ1(D,A)}catch(f){let E=f instanceof Error?f.message:String(f);I.push({name:D,error:E}),vRA(A,D,"failed",E),r(f instanceof Error?f:Error(String(f)))}}return{installed:L,failed:I}}async function mQ1(H,$){try{let L=(await hVH()).filter((I)=>I.endsWith(`@${H}`));if(L.length>0){let I=await SRA(L);if(I.length>0)N(`Installing ${I.length} plugins from newly installed marketplace ${H}`),await iq$(I,$)}}catch(A){r(A instanceof Error?A:Error(String(A)))}}async function iq$(H,$){let A=[],L=[],I=bVH(),D=new Map;for(let B of H){hRA($,B,"installing");try{let f=await ZK(B);if(!f)throw Error("Plugin not found in any marketplace");let E=I.get(B),{entry:M,marketplaceInstallLocation:G}=f,U=NR(M.source)?kbD.join(G,M.source):void 0;if(E==="flag"){let X=U??M.source;await l9H(X,{manifest:M})}else{let X=E||"user",J=Zs(X);if(await mw(B,M,X,J,U),X!=="managed"){if(VL().enabledPlugins?.[B]!==!0){let W=D.get(X)??{};W[B]=!0,D.set(X,W)}}}A.push(B),hRA($,B,"installed")}catch(f){let E=f instanceof Error?f.message:String(f);L.push({name:B,error:E}),hRA($,B,"failed",E),r(f instanceof Error?f:Error(String(f)))}}for(let[B,f]of D)if(Object.keys(f).length>0){let E=Wv(B),M=ZI(E);II(E,{...M,enabledPlugins:{...M?.enabledPlugins,...f}})}return{installed:A,failed:L}}async function nq$(H){N("performBackgroundPluginInstallations called");try{let $=[],A=[],L=await l1(),I=await cq$();if(I.size>0){N(`Found ${I.size} extra marketplaces in settings`);let f=await lq$(I);if(f.length>0){N(`Installing ${f.length} marketplaces automatically`);for(let E of f){let M=I.get(E);if(M)$.push({name:E,marketplace:M})}}}let D=await hVH(),B=[];if(D.length>0){N(`Found ${D.length} enabled plugins`);let f=await kVH(),E=D.filter((G)=>!f.includes(G));N(`Found ${E.length} missing plugins (not installed): ${E.join(", ")}`);let M=[];for(let G of E){let[,U]=G.split("@");if(!U)M.push(G);else if(U in L||I.has(U)||$.some((X)=>X.name===U))M.push(G);else B.push(G)}if(B.length>0){let G=[...new Set(B.map((U)=>U.split("@")[1]))];N(`Cannot install ${B.length} plugins because their marketplaces are not installed or configured: ${G.join(", ")}`),N(`Uninstallable plugins: ${B.join(", ")}`)}if(M.length>0)N(`Installing ${M.length} plugins automatically`),A.push(...M)}if(N(`Setting installation status: ${$.length} marketplaces, ${A.length} installable plugins, ${B.length} uninstallable plugins`),H((f)=>({...f,plugins:{...f.plugins,installationStatus:{marketplaces:$.map(({name:E})=>({name:E,status:"pending"})),plugins:[...A.map((E)=>{let[M]=E.split("@");return{id:E,name:M||E,status:"pending"}}),...B.map((E)=>{let[M,G]=E.split("@");return{id:E,name:M||E,status:"failed",error:`Marketplace '${G}' is not installed or configured`}})]}}})),$.length>0)gQ1($.map((f)=>f.name),I,H).catch((f)=>{r(f instanceof Error?f:Error(String(f)))});if(A.length>0){let f=A.filter((E)=>{let[,M]=E.split("@");return!$.some((G)=>G.name===M)});if(f.length>0)iq$(f,H).catch((E)=>{r(E instanceof Error?E:Error(String(E)))})}}catch($){r($ instanceof Error?$:Error(String($)))}}var kbD;var rq$=K(()=>{E$();_$();yRA();uVH();hDH();pVH();y4();y4();_X();op();UQ();mL();kbD=require("path")});function AZ({status:H,withSpace:$=!1}){let A=pQ1[H];return ubD.default.createElement(V,{color:A.color,dimColor:!A.color},A.icon,$&&" ")}var ubD,pQ1;var aq$=K(()=>{jI();xH();ubD=b(s(),1),pQ1={success:{icon:pH.tick,color:"success"},error:{icon:pH.cross,color:"error"},warning:{icon:pH.warning,color:"warning"},info:{icon:pH.info,color:"suggestion"},pending:{icon:pH.circle,color:void 0},loading:{icon:"\u2026",color:void 0}}});function dQ1(H){switch(H.type){case"path-not-found":return`${H.component} path not found: ${H.path}`;case"git-auth-failed":return`Git ${H.authType.toUpperCase()} authentication failed for ${H.gitUrl}`;case"git-timeout":return`Git ${H.operation} timed out for ${H.gitUrl}`;case"network-error":return`Network error accessing ${H.url}${H.details?`: ${H.details}`:""}`;case"manifest-parse-error":return`Failed to parse manifest at ${H.manifestPath}: ${H.parseError}`;case"manifest-validation-error":return`Invalid manifest at ${H.manifestPath}: ${H.validationErrors.join(", ")}`;case"plugin-not-found":return`Plugin '${H.pluginId}' not found in marketplace '${H.marketplace}'`;case"marketplace-not-found":return`Marketplace '${H.marketplace}' not found`;case"marketplace-load-failed":return`Failed to load marketplace '${H.marketplace}': ${H.reason}`;case"repository-scan-failed":return`Failed to scan repository at ${H.repositoryPath}: ${H.reason}`;case"mcp-config-invalid":return`Invalid MCP server config for '${H.serverName}': ${H.validationError}`;case"hook-load-failed":return`Failed to load hooks from ${H.hookPath}: ${H.reason}`;case"component-load-failed":return`Failed to load ${H.component} from ${H.path}: ${H.reason}`;case"mcpb-download-failed":return`Failed to download MCPB from ${H.url}: ${H.reason}`;case"mcpb-extract-failed":return`Failed to extract MCPB ${H.mcpbPath}: ${H.reason}`;case"mcpb-invalid-manifest":return`MCPB manifest invalid at ${H.mcpbPath}: ${H.validationError}`;case"marketplace-blocked-by-policy":return H.blockedByBlocklist?`Marketplace '${H.marketplace}' is blocked by enterprise policy`:`Marketplace '${H.marketplace}' is not in the allowed marketplace list`;case"generic-error":return H.error;default:return"Unknown error"}}function gbD(H){switch(H.type){case"path-not-found":return"\u2192 Check that the path in your manifest or marketplace config is correct";case"git-auth-failed":return H.authType==="ssh"?"\u2192 Configure SSH keys or use HTTPS URL instead":"\u2192 Configure credentials or use SSH URL instead";case"git-timeout":case"network-error":return"\u2192 Check your internet connection and try again";case"manifest-parse-error":return"\u2192 Check manifest file syntax in the plugin directory";case"manifest-validation-error":return"\u2192 Check manifest file follows the required schema";case"plugin-not-found":return`\u2192 Plugin may not exist in marketplace '${H.marketplace}'`;case"marketplace-not-found":return H.availableMarketplaces.length>0?`\u2192 Available marketplaces: ${H.availableMarketplaces.join(", ")}`:"\u2192 Add the marketplace first using /plugin marketplace add";case"mcp-config-invalid":return"\u2192 Check MCP server configuration in .mcp.json or manifest";case"hook-load-failed":return"\u2192 Check hooks.json file syntax and structure";case"component-load-failed":return`\u2192 Check ${H.component} directory structure and file permissions`;case"mcpb-download-failed":return"\u2192 Check your internet connection and URL accessibility";case"mcpb-extract-failed":return"\u2192 Verify the MCPB file is valid and not corrupted";case"mcpb-invalid-manifest":return"\u2192 Contact the plugin author about the invalid manifest";case"marketplace-blocked-by-policy":if(H.blockedByBlocklist)return"\u2192 This marketplace source is explicitly blocked by your administrator";return H.allowedSources.length>0?`\u2192 Allowed sources: ${H.allowedSources.join(", ")}`:"\u2192 Contact your administrator to configure allowed marketplace sources";case"repository-scan-failed":case"marketplace-load-failed":case"generic-error":return null;default:return null}}function pbD({onComplete:H}){let $=J$((G)=>G.plugins.installationStatus),A=J$((G)=>G.plugins.errors),L=zI();zB();let I=mbD.useCallback(()=>{L((G)=>({...G,plugins:{...G.plugins,installationStatus:{marketplaces:G.plugins.installationStatus.marketplaces.map((U)=>U.status==="failed"?{...U,status:"pending"}:U),plugins:G.plugins.installationStatus.plugins.map((U)=>U.status==="failed"?{...U,status:"pending"}:U)}}})),nq$(L)},[L]);BA("confirm:no",H,{context:"Confirmation"}),WL((G)=>{if(G==="r"||G==="R")I()});let D={pending:$.marketplaces.filter((G)=>G.status==="pending").length,installing:$.marketplaces.filter((G)=>G.status==="installing").length,installed:$.marketplaces.filter((G)=>G.status==="installed").length,failed:$.marketplaces.filter((G)=>G.status==="failed").length},B={pending:$.plugins.filter((G)=>G.status==="pending").length,installing:$.plugins.filter((G)=>G.status==="installing").length,installed:$.plugins.filter((G)=>G.status==="installed").length,failed:$.plugins.filter((G)=>G.status==="failed").length},f=D.installing>0||B.installing>0||D.pending>0||B.pending>0,E=A.length>0,M=$.marketplaces.length>0||$.plugins.length>0;return wA.createElement(x,{flexDirection:"column"},wA.createElement(x,{marginBottom:1},wA.createElement(V,{bold:!0},E&&!M?"Plugin Loading Errors":"Plugin Status")),$.marketplaces.length>0&&wA.createElement(wA.Fragment,null,wA.createElement(x,{marginBottom:1},wA.createElement(V,{dimColor:!0},"Marketplaces:")),$.marketplaces.map((G)=>wA.createElement(x,{key:G.name,marginLeft:2},G.status==="installing"&&wA.createElement(wA.Fragment,null,wA.createElement(vD,null),wA.createElement(x,{marginLeft:1},wA.createElement(V,null,G.name),wA.createElement(V,{dimColor:!0}," \xB7 Installing\u2026"))),G.status==="pending"&&wA.createElement(V,null,wA.createElement(AZ,{status:"pending",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Pending")),G.status==="installed"&&wA.createElement(V,null,wA.createElement(AZ,{status:"success",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Installed")),G.status==="failed"&&wA.createElement(x,{flexDirection:"column"},wA.createElement(V,null,wA.createElement(AZ,{status:"error",withSpace:!0}),G.name,wA.createElement(V,{color:"error"}," \xB7 Failed")),G.error&&wA.createElement(x,{marginLeft:3},wA.createElement(V,{color:"error",dimColor:!0},G.error)))))),$.plugins.length>0&&wA.createElement(wA.Fragment,null,wA.createElement(x,{marginTop:1,marginBottom:1},wA.createElement(V,{dimColor:!0},"Plugins:")),$.plugins.map((G)=>wA.createElement(x,{key:G.id,marginLeft:2},G.status==="installing"&&wA.createElement(wA.Fragment,null,wA.createElement(vD,null),wA.createElement(x,{marginLeft:1},wA.createElement(V,null,G.name),wA.createElement(V,{dimColor:!0}," \xB7 Installing\u2026"))),G.status==="pending"&&wA.createElement(V,null,wA.createElement(AZ,{status:"pending",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Pending")),G.status==="installed"&&wA.createElement(V,null,wA.createElement(AZ,{status:"success",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Installed")),G.status==="failed"&&wA.createElement(x,{flexDirection:"column"},wA.createElement(V,null,wA.createElement(AZ,{status:"error",withSpace:!0}),G.name,wA.createElement(V,{color:"error"}," \xB7 Failed")),G.error&&wA.createElement(x,{marginLeft:3},wA.createElement(V,{color:"error",dimColor:!0},G.error)))))),$.marketplaces.length===0&&$.plugins.length===0&&A.length===0&&wA.createElement(x,{marginTop:1},wA.createElement(V,{dimColor:!0},"No pending installations or errors")),A.length>0&&wA.createElement(wA.Fragment,null,wA.createElement(x,{marginTop:1,marginBottom:1},wA.createElement(V,{dimColor:!0},"Plugin Loading Errors:")),A.map((G,U)=>{let X="plugin"in G?G.plugin:void 0;return wA.createElement(x,{key:U,marginLeft:2,flexDirection:"column"},wA.createElement(V,null,wA.createElement(AZ,{status:"error",withSpace:!0}),X?wA.createElement(wA.Fragment,null,"Plugin ",wA.createElement(V,{bold:!0},X)," from"," ",wA.createElement(V,{dimColor:!0},G.source)):wA.createElement(V,{dimColor:!0},G.source)),wA.createElement(x,{marginLeft:3},wA.createElement(V,{color:"error",dimColor:!0},dQ1(G))),gbD(G)&&wA.createElement(x,{marginLeft:3,marginTop:1},wA.createElement(V,{dimColor:!0,italic:!0},gbD(G))))})),wA.createElement(x,{marginTop:2},wA.createElement(V,{dimColor:!0},f?"Installing\u2026":wA.createElement(wA.Fragment,null,"Press"," ",D.failed>0||B.failed>0?wA.createElement(wA.Fragment,null,wA.createElement(V,{bold:!0},"r")," to retry failed installations \xB7"," "):null,wA.createElement(V,{bold:!0},"Esc")," to return"))))}var wA,mbD;var dbD=K(()=>{xH();$I();UM();pL();rq$();JM();aq$();wA=b(s(),1),mbD=b(s(),1)});function cQ1(H){let $=Tz.basename(H),A=Tz.basename(Tz.dirname(H));if($==="plugin.json")return"plugin";if($==="marketplace.json")return"marketplace";if(A===".claude-plugin")return"plugin";return"unknown"}function cbD(H){return H.issues.map(($)=>({path:$.path.join(".")||"root",message:$.message,code:$.code}))}function MmH(H,$,A){if(H.includes(".."))A.push({path:$,message:`Path contains ".." which could be a path traversal attempt: ${H}`})}function bRA(H){let $=[],A=[],L=Tz.resolve(H);if(!rP.existsSync(L))return{success:!1,errors:[{path:"file",message:`File not found: ${L}`}],warnings:[],filePath:L,fileType:"plugin"};if(!rP.statSync(L).isFile())return{success:!1,errors:[{path:"file",message:`Path is not a file: ${L}`}],warnings:[],filePath:L,fileType:"plugin"};let D;try{D=rP.readFileSync(L,{encoding:"utf-8"})}catch(E){return{success:!1,errors:[{path:"file",message:`Failed to read file: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"plugin"}}let B;try{B=DA(D)}catch(E){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"plugin"}}if(B&&typeof B==="object"){let E=B;if(E.commands)(Array.isArray(E.commands)?E.commands:[E.commands]).forEach((G,U)=>{if(typeof G==="string")MmH(G,`commands[${U}]`,$)});if(E.agents)(Array.isArray(E.agents)?E.agents:[E.agents]).forEach((G,U)=>{if(typeof G==="string")MmH(G,`agents[${U}]`,$)});if(E.skills)(Array.isArray(E.skills)?E.skills:[E.skills]).forEach((G,U)=>{if(typeof G==="string")MmH(G,`skills[${U}]`,$)})}let f=S$H.safeParse(B);if(!f.success)$.push(...cbD(f.error));if(f.success){let E=f.data;if(!E.version)A.push({path:"version",message:'No version specified. Consider adding a version following semver (e.g., "1.0.0")'});if(!E.description)A.push({path:"description",message:"No description provided. Adding a description helps users understand what your plugin does"});if(!E.author)A.push({path:"author",message:"No author information provided. Consider adding author details for plugin attribution"})}return{success:$.length===0,errors:$,warnings:A,filePath:L,fileType:"plugin"}}function kRA(H){let $=[],A=[],L=Tz.resolve(H);if(!rP.existsSync(L))return{success:!1,errors:[{path:"file",message:`File not found: ${L}`}],warnings:[],filePath:L,fileType:"marketplace"};if(!rP.statSync(L).isFile())return{success:!1,errors:[{path:"file",message:`Path is not a file: ${L}`}],warnings:[],filePath:L,fileType:"marketplace"};let D;try{D=rP.readFileSync(L,{encoding:"utf-8"})}catch(E){return{success:!1,errors:[{path:"file",message:`Failed to read file: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"marketplace"}}let B;try{B=DA(D)}catch(E){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"marketplace"}}if(B&&typeof B==="object"){let E=B;if(Array.isArray(E.plugins))E.plugins.forEach((M,G)=>{if(M&&typeof M==="object"&&"source"in M){let U=M.source;if(typeof U==="string")MmH(U,`plugins[${G}].source`,$);if(U&&typeof U==="object"&&"path"in U&&typeof U.path==="string")MmH(U.path,`plugins[${G}].source.path`,$)}})}let f=VGH.safeParse(B);if(!f.success)$.push(...cbD(f.error));if(f.success){let E=f.data;if(!E.plugins||E.plugins.length===0)A.push({path:"plugins",message:"Marketplace has no plugins defined"});if(E.plugins)E.plugins.forEach((M,G)=>{if(typeof M.source==="object"&&M.source.source==="npm")A.push({path:`plugins[${G}].source`,message:`Plugin "${M.name}" uses npm source which is not yet fully implemented`});if(E.plugins.filter((X)=>X.name===M.name).length>1)$.push({path:`plugins[${G}].name`,message:`Duplicate plugin name "${M.name}" found in marketplace`})});if(!E.metadata?.description)A.push({path:"metadata.description",message:"No marketplace description provided. Adding a description helps users understand what this marketplace offers"})}return{success:$.length===0,errors:$,warnings:A,filePath:L,fileType:"marketplace"}}function oq$(H){let $=Tz.resolve(H);if(rP.existsSync($)&&rP.statSync($).isDirectory()){let L=Tz.join($,".claude-plugin","marketplace.json"),I=Tz.join($,".claude-plugin","plugin.json");if(rP.existsSync(L))return kRA(L);else if(rP.existsSync(I))return bRA(I);else return{success:!1,errors:[{path:"directory",message:"No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json"}],warnings:[],filePath:$,fileType:"plugin"}}switch(cQ1(H)){case"plugin":return bRA(H);case"marketplace":return kRA(H);case"unknown":{if(!rP.existsSync($))return{success:!1,errors:[{path:"file",message:`File not found: ${$}`}],warnings:[],filePath:$,fileType:"plugin"};try{let L=rP.readFileSync($,{encoding:"utf-8"}),I=DA(L);if(Array.isArray(I.plugins))return kRA(H)}catch{}return bRA(H)}}}var rP,Tz;var uRA=K(()=>{UQ();Z$();rP=b(require("fs")),Tz=b(require("path"))});function ibD({onComplete:H,path:$}){return lbD.useEffect(()=>{async function A(){if(!$){H(`Usage: /plugin validate /plugin validate .claude-plugin/plugin.json When given a directory, automatically validates .claude-plugin/marketplace.json or .claude-plugin/plugin.json (prefers marketplace if both exist). claude plugin validate `);return}try{let L=oq$($),I="";if(I+=`Validating ${L.fileType} manifest: ${L.filePath} `).filter((M)=>M.length>0);return yJ.createElement(x,{flexDirection:"column",paddingX:2},E.map((M,G)=>yJ.createElement(V,{key:G},M)),yJ.createElement(x,{flexDirection:"row",gap:2,marginBottom:1},yJ.createElement(V,null,yJ.createElement(V,{bold:$==="ios",underline:$==="ios"},"iOS"),yJ.createElement(V,{dimColor:!0}," / "),yJ.createElement(V,{bold:$==="android",underline:$==="android"},"Android")),yJ.createElement(V,{dimColor:!0},"(tab to switch, esc to close)")),yJ.createElement(V,{dimColor:!0},D))}async function G61(H){return yJ.createElement(M61,{onDone:H})}var yJ,p1H,SyA,xyA;var DgD=K(()=>{xH();$I();yJ=b(s(),1),p1H=b(s(),1),SyA=b(OyA(),1),xyA={ios:{url:"https://apps.apple.com/app/claude-by-anthropic/id6473753684"},android:{url:"https://play.google.com/store/apps/details?id=com.anthropic.claude"}}});var U61,jyA;var BgD=K(()=>{U61={type:"local-jsx",name:"mobile",aliases:["ios","android"],description:"Show QR code to download the Claude mobile app",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (DgD(),IgD)),userFacingName(){return"mobile"}},jyA=U61});var fgD=()=>{};var EgD=()=>{};function tVH({name:H,description:$,progressMessage:A,pluginName:L,pluginCommand:I,getPromptWhileMarketplaceIsPrivate:D}){return{type:"prompt",name:H,description:$,progressMessage:A,contentLength:0,isEnabled:()=>!0,isHidden:!1,userFacingName(){return H},source:"builtin",async getPromptForCommand(B,f){return D(B,f)}}}var MgD;var GgD=K(()=>{MgD=tVH({name:"pr-comments",description:"Get comments from a GitHub pull request",progressMessage:"fetching PR comments",pluginName:"pr-comments",pluginCommand:"pr-comments",async getPromptWhileMarketplaceIsPrivate(H){return[{type:"text",text:`You are an AI assistant integrated into a git-based version control system. Your task is to fetch and display comments from a GitHub pull request. `);if(I.length===0)continue;let D=I[0];if(!D)continue;let B=D.split(" - ")[0]?.trim()||"";if(!B)continue;let f=I.slice(1).filter((E)=>E.trim().startsWith("- ")).map((E)=>E.trim().substring(2).trim()).filter(Boolean);if(f.length>0)$[B]=f}return $}catch($){return r($ instanceof Error?$:Error("Failed to parse changelog")),{}}}function F61(H,$,A=d1H()){try{let L=XT$(A),I=js.coerce(H),D=$?js.coerce($):null;if(!D||I&&js.gt(I,D,{loose:!0}))return Object.entries(L).filter(([B])=>!D||js.gt(B,D,{loose:!0})).sort(([B],[f])=>js.gt(B,f,{loose:!0})?-1:1).flatMap(([B,f])=>f).filter(Boolean).slice(0,X61)}catch(L){return r(L instanceof Error?L:Error("Failed to get release notes")),[]}return[]}function vyA(H=d1H()){try{let $=XT$(H);return Object.keys($).sort((L,I)=>js.gt(L,I,{loose:!0})?1:-1).map((L)=>{let I=$[L];if(!I||I.length===0)return null;let D=I.filter(Boolean);if(D.length===0)return null;return[L,D]}).filter((L)=>L!==null)}catch($){return r($ instanceof Error?$:Error("Failed to get release notes")),[]}}function JT$(H,$={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION){if(H!==$||!d1H())yyA().catch((I)=>r(I instanceof Error?I:Error("Failed to fetch changelog")));let A=F61($,H);return{hasReleaseNotes:A.length>0,releaseNotes:A}}var js,ZmH,UgD,sVH,X61=5,XgD="https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md",J61="https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md";var eVH=K(()=>{_$();w1();vA();g$();NA();js=b(OO(),1),ZmH=require("path"),UgD=require("fs"),sVH=require("fs/promises")});var KgD={};XA(KgD,{call:()=>K61});function FgD(H){return H.map(([$,A])=>{let L=`Version ${$}:`,I=A.map((D)=>`\u2022 ${D}`).join(` `).filter((E)=>E.startsWith("worktree ")).map((E)=>E.slice(9));c("tengu_worktree_detection",{duration_ms:I,worktree_count:D.length,success:!0});let B=D.find((E)=>H===E||H.startsWith(E+qgD.sep)),f=D.filter((E)=>E!==B).sort((E,M)=>E.localeCompare(M));return B?[B,...f]:f}var qgD;var qmH=K(()=>{B0();z$();t8();qgD=require("path")});function byA(H){if(H.type==="assistant"&&H.message.content[0]?.type==="tool_use"){let $=H.message.content[0];return{messageId:H.message.id,toolUseId:$.id,toolName:$.name}}return null}function TgD(H,$,A=!1){if(A)return{messages:H};let L=new Set($.filter((G)=>G.renderGroupedToolUse).map((G)=>G.name)),I=new Map;for(let G of H){let U=byA(G);if(U&&L.has(U.toolName)){let X=`${U.messageId}:${U.toolName}`,J=I.get(X)??[];J.push(G),I.set(X,J)}}let D=new Map,B=new Set;for(let[G,U]of I)if(U.length>=2){D.set(G,U);for(let X of U){let J=byA(X);if(J)B.add(J.toolUseId)}}let f=new Map;for(let G of H)if(G.type==="user"){for(let U of G.message.content)if(U.type==="tool_result"&&B.has(U.tool_use_id))f.set(U.tool_use_id,G)}let E=[],M=new Set;for(let G of H){let U=byA(G);if(U){let X=`${U.messageId}:${U.toolName}`,J=D.get(X);if(J){if(!M.has(X)){M.add(X);let F=J[0],Q=[];for(let P of J){let C=P.message.content[0].id,Y=f.get(C);if(Y)Q.push(Y)}let W={type:"grouped_tool_use",toolName:U.toolName,messages:J,results:Q,displayMessage:F,uuid:`grouped-${F.uuid}`,timestamp:F.timestamp,messageId:U.messageId};E.push(W)}continue}}if(G.type==="user"){let X=G.message.content.filter((J)=>J.type==="tool_result");if(X.length>0){if(X.every((F)=>B.has(F.tool_use_id)))continue}}E.push(G)}return{messages:E}}function zgD(H){return H.type==="attachment"&&H.attachment.type==="task_status"&&H.attachment.taskType==="in_process_teammate"&&H.attachment.status==="completed"}function NgD(H){let $=[],A=0;while(A=77;return!1}if(A===15&&D!==null){if(L===6&&I===0)return D<58;return!0}if(A===16&&D!==null){if(L===1&&I===0)return D<12;return L===0}if(A>=17)return!1;let B=`${A}.${L}`,f=OgD[B];if(f===void 0){let E=Object.keys(OgD).filter((G)=>G.startsWith(`${A}.`)).map((G)=>parseInt(G.split(".")[1],10)),M=Math.max(...E,0);return L<=M}return I({...$,reactVulnerabilityCache:{detected:H.detected,package:H.package,packageName:H.packageName,version:H.version,packageManager:H.packageManager}})),H}var TmH,zmH,NmH,FT$,OgD;var uyA=K(()=>{PI();nM();vA();TmH=require("path"),zmH=require("fs/promises"),NmH=["19.0.0","19.1.0","19.1.1","19.2.0"],FT$=["react-server-dom-webpack","react-server-dom-parcel","react-server-dom-turbopack"],OgD={"15.0":5,"15.1":9,"15.2":6,"15.3":6,"15.4":8,"15.5":7,"16.0":7}});function vgD(H){return h61.filter(($)=>$.isActive(H))}var YI,ygD,Z61,q61,T61,z61,N61,O61,x61,S61,j61,R61=3,y61="tengu_react_vulnerability_warning",v61,h61;var hgD=K(()=>{xH();mQ();jI();PI();Q9();EI();oM();aI();ERA();nU();PKA();SD();uyA();vA();YI=b(s(),1),ygD=require("path"),Z61={id:"large-memory-files",type:"warning",isActive:()=>{return MBH().length>0},render:()=>{let H=MBH();return YI.createElement(YI.Fragment,null,H.map(($)=>{let A=$.path.startsWith(C$())?ygD.relative(C$(),$.path):$.path;return YI.createElement(x,{key:$.path,flexDirection:"row"},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Large ",YI.createElement(V,{bold:!0},A)," will impact performance (",a0($.content.length)," chars >"," ",a0(Cm),")",YI.createElement(V,{dimColor:!0}," \u2022 /memory to edit")))}))}},q61={id:"ultra-claude-md",type:"warning",isActive:()=>{let H=GBH();return H!==null&&H.content.length>HQH},render:()=>{let H=GBH();if(!H)return null;let $=H.content.length;return YI.createElement(x,{flexDirection:"row",gap:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"CLAUDE.md entries marked as IMPORTANT exceed"," ",HQH," chars (",$," chars)",YI.createElement(V,{dimColor:!0}," \u2022 /memory to edit")))}},T61={id:"claude-ai-external-token",type:"warning",isActive:()=>{let H=ji();return nL()&&(H.source==="ANTHROPIC_AUTH_TOKEN"||H.source==="apiKeyHelper")},render:()=>{let H=ji();return YI.createElement(x,{flexDirection:"row",marginTop:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Auth conflict: Using ",H.source," instead of Claude account subscription token. Either unset ",H.source,", or run `claude /logout`."))}},z61={id:"api-key-conflict",type:"warning",isActive:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return!!NqH()&&(H==="ANTHROPIC_API_KEY"||H==="apiKeyHelper")},render:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return YI.createElement(x,{flexDirection:"row",marginTop:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Auth conflict: Using ",H," instead of Anthropic Console key. Either unset ",H,", or run `claude /logout`."))}},N61={id:"both-auth-methods",type:"warning",isActive:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0}),$=ji();return H!=="none"&&$.source!=="none"&&!(H==="apiKeyHelper"&&$.source==="apiKeyHelper")},render:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0}),$=ji();return YI.createElement(x,{flexDirection:"column",marginTop:1},YI.createElement(x,{flexDirection:"row"},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Auth conflict: Both a token (",$.source,") and an API key (",H,") are set. This may lead to unexpected behavior.")),YI.createElement(x,{flexDirection:"column",marginLeft:3},YI.createElement(V,{color:"warning"},"\u2022 Trying to use"," ",$.source==="claude.ai"?"claude.ai":$.source,"?"," ",H==="ANTHROPIC_API_KEY"?'Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.':H==="apiKeyHelper"?"Unset the apiKeyHelper setting.":"claude /logout"),YI.createElement(V,{color:"warning"},"\u2022 Trying to use ",H,"?"," ",$.source==="claude.ai"?"claude /logout to sign out of claude.ai.":`Unset the ${$.source} environment variable.`)))}},O61={id:"sonnet-1m-welcome",type:"info",isActive:(H)=>H.showSonnet1MNotice===!0,render:()=>{return YI.createElement(x,{flexDirection:"column",marginTop:1},YI.createElement(V,{bold:!0},"You now have access to Sonnet 4.5 with 1M context (uses more rate limits than Sonnet on long requests) \u2022 Update in /model"))}},x61={id:"opus-4.6-available",type:"info",isActive:(H)=>H.showOpus46Notice===!0,render:()=>{let $=sI()!=="firstParty",A=f0(),L=A==="max",I=A==="team",D=A==="pro",B=X1().toLowerCase().includes("opus-4-6"),f;if(L||I||D||B)f=YI.createElement(V,{dimColor:!0},"Welcome to Opus 4.6");else if($)f=YI.createElement(V,{dimColor:!0},"/model to try Opus 4.6. Note: you may need to request access from your cloud provider");else f=YI.createElement(V,{dimColor:!0},"/model to try Opus 4.6");return YI.createElement(x,{marginLeft:1},f)}},S61={id:"large-agent-descriptions",type:"warning",isActive:(H)=>{return sgH(H.agentDefinitions)>Z1H},render:(H)=>{let $=sgH(H.agentDefinitions);return YI.createElement(x,{flexDirection:"row"},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Large cumulative agent descriptions will impact performance (~",a0($)," tokens >"," ",a0(Z1H),")",YI.createElement(V,{dimColor:!0}," \u2022 /agents to manage")))}},j61={id:"jetbrains-plugin-install",type:"info",isActive:(H)=>{if(!rjH())return!1;if(!(H.config.autoInstallIdeExtension??!0))return!1;let A=FKH();return A!==null&&!vZI(A)},render:()=>{let H=FKH(),$=PX(H);return YI.createElement(x,{flexDirection:"row",gap:1,marginLeft:1},YI.createElement(V,{color:"ide"},pH.arrowUp),YI.createElement(V,null,"Install the ",YI.createElement(V,{color:"ide"},$)," plugin from the JetBrains Marketplace:"," ",YI.createElement(V,{bold:!0},"https://docs.claude.com/s/claude-code-jetbrains")))}},v61={id:"react-vulnerability",type:"warning",isActive:()=>{if(!cf(y61))return!1;if((Mf().reactVulnerabilityWarningCount??0)>=R61)return!1;return kyA()?.detected===!0},render:()=>{let H=kyA();if(!H?.detected||!H.packageManager||!H.packageName)return null;let $=jgD(H.packageManager,H.packageName),A=H.package==="next",L=A?"CVE-2025-66478":"CVE-2025-55182",I=A?`Next.js ${H.version}`:`${H.packageName}@${H.version}`;return YI.createElement(x,{flexDirection:"row",gap:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},I," has a critical vulnerability (",L,") that could allow attackers to execute arbitrary code on your server. Run `",$,"` to update."))}},h61=[v61,Z61,q61,S61,T61,z61,N61,O61,x61,j61]});function bgD({agentDefinitions:H}={}){let $=Oz.useRef(!1),A=M$(),L=T9()?.organizationUuid,D=(L?A.s1mAccessCache?.[L]:void 0)?.hasAccessNotAsDefault,B=L&&A.hasShownS1MWelcomeV2?.[L],f=nL()&&D&&!B,M=!(L&&A.hasShownOpus46Notice?.[L]),G={config:A,showSonnet1MNotice:f,showOpus46Notice:M,agentDefinitions:H},U=vgD(G);if(Oz.useEffect(()=>{if(!L)return;let X=U.some((F)=>F.id==="sonnet-1m-welcome"),J=U.some((F)=>F.id==="opus-4.6-available");if(X)c("tengu_sonnet_1m_notice_shown",{});if(J)c("tengu_opus_46_notice_shown",{});if(X||J)AA((F)=>({...F,...X&&{hasShownS1MWelcomeV2:{...F.hasShownS1MWelcomeV2,[L]:!0}},...J&&{hasShownOpus46Notice:{...F.hasShownOpus46Notice,[L]:!0}}}))},[U,A,L]),Oz.useEffect(()=>{if($.current)return;if(U.some((J)=>J.id==="react-vulnerability"))$.current=!0,c("tengu_react_vulnerability_notice_shown",{}),MM((J)=>({...J,reactVulnerabilityWarningCount:(J.reactVulnerabilityWarningCount??0)+1}))},[U]),U.length===0)return null;return Oz.createElement(x,{flexDirection:"column",paddingLeft:1},U.map((X)=>Oz.createElement(Oz.Fragment,{key:X.id},X.render(G))))}var Oz;var kgD=K(()=>{xH();vA();hgD();z$();EI();Oz=b(s(),1)});function ugD(H,$){for(let A of H)if(!$.has(A))return!1;return!0}function ggD(H,$=!1){let[A,L]=HPH.useState(1),[I,D]=HPH.useState(-1);return WL((B,f)=>{if(f.escape&&I===-1&&!$)D(0)},{isActive:H}),HPH.useEffect(()=>{if(!H){D(-1),L(0);return}},[H]),HPH.useEffect(()=>{if(I===-1)return;let B=[1,0,1,2,2,1,0,0,0,1,2,2,1];if(I>=B.length){D(-1),L(1);return}L(B[I]);let f=setTimeout(()=>{D((E)=>E+1)},60);return()=>clearTimeout(f)},[I]),A}var HPH;var mgD=K(()=>{xH();HPH=b(s(),1)});function cgD(H){if(H>=70)return"horizontal";return"compact"}function lgD(H,$,A){if($==="horizontal"){let I=A,D=gyA+WT$+QT$+I,B=H-D,f=Math.max(30,B),E=Math.min(I+f+QT$+WT$,H-gyA);if(Eb61)return"Welcome back!";return`Welcome back ${H}!`}function xmH(H,$){if(H.length<=$)return H;let A="/",L="\u2026",I=H.split(A),D=I[0]||"",B=I[I.length-1]||"";if(I.length===1)return H.substring(0,$-L.length)+L;if(D===""&&L.length+A.length+B.length>=$)return`${A}${B.substring(0,$-L.length-A.length)}${L}`;if(D!==""&&L.length*2+A.length+B.length>=$)return`${L}${A}${B.substring(0,$-L.length*2-A.length)}${L}`;if(I.length===2)return`${D.substring(0,$-L.length-A.length-B.length)}${L}${A}${B}`;let f=$-D.length-B.length-L.length-2*A.length;if(f<=0)return`${D.substring(0,Math.max(0,$-B.length-L.length-2*A.length))}${A}${L}${A}${B}`;let E=[];for(let M=I.length-2;M>0;M--){let G=I[M];if(G&&G.length+A.length<=f)E.unshift(G),f-=G.length+A.length;else break}if(E.length===0)return`${D}${A}${L}${A}${B}`;return`${D}${A}${L}${A}${E.join(A)}${A}${B}`}async function ngD(){if(VT$)return VT$;let H=j$();return VT$=CT$(10).then(($)=>{return OmH=$.filter((A)=>{if(A.isSidechain)return!1;if(A.sessionId===H)return!1;if(A.summary?.includes("I apologize"))return!1;let L=A.summary&&A.summary!=="No prompt",I=A.firstPrompt&&A.firstPrompt!=="No prompt";return L||I}).slice(0,3),OmH}).catch(()=>{return OmH=[],OmH}),VT$}function rgD(){return OmH}function _T$(){let H=process.env.DEMO_VERSION??{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,$=bS$(),A=process.env.DEMO_VERSION?"/code/claude":V9(C$()),L=$?`${A} in ${$.replace(/^https?:\/\//,"")}`:A,I=X1(),D=xoL(I),B=nL()?t$A():"API Usage Billing",f=GB().agent;return{version:H,cwd:L,modelDisplayName:D,billingType:B,agentName:f}}function agD(H,$,A){if(H.length+3+$.length>A)return{shouldSplit:!0,truncatedModel:e8(H,A),truncatedBilling:e8($,A)};return{shouldSplit:!1,truncatedModel:e8(H,Math.max(A-$.length-3,10)),truncatedBilling:$}}function ogD(H){let $=d1H();if(!$)return[];let A;try{A=XT$($)}catch{return[]}let L=[],I=Object.keys(A).sort((D,B)=>pgD.gt(D,B,{loose:!0})?-1:1).slice(0,3);for(let D of I){let B=A[D];if(B)L.push(...B)}return L.slice(0,H)}var pgD,dgD=50,b61=20,gyA=4,QT$=1,WT$=2,OmH,VT$=null;var YT$=K(()=>{eVH();Q9();rB();g$();PI();rD();EI();aI();mL();pgD=b(OO(),1);OmH=[]});function myA(){if(OA.terminal==="Apple_Terminal")return u8.createElement(k61,null);return u8.createElement(x,{flexDirection:"column"},u8.createElement(V,null,u8.createElement(V,{color:"clawd_body"}," \u2590"),u8.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u259B\u2588\u2588\u2588\u259C"),u8.createElement(V,{color:"clawd_body"},"\u258C")),u8.createElement(V,null,u8.createElement(V,{color:"clawd_body"},"\u259D\u259C"),u8.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u2588\u2588\u2588\u2588\u2588"),u8.createElement(V,{color:"clawd_body"},"\u259B\u2598")),u8.createElement(V,{color:"clawd_body"}," ","\u2598\u2598 \u259D\u259D"," "))}function k61(){return u8.createElement(x,{flexDirection:"column",alignItems:"center"},u8.createElement(V,null,u8.createElement(V,{color:"clawd_body"},"\u2597"),u8.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),u8.createElement(V,{color:"clawd_body"},"\u2596")),u8.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(7)),u8.createElement(V,{color:"clawd_body"},"\u2598\u2598 \u259D\u259D"))}var u8;var tgD=K(()=>{xH();Z1();u8=b(s(),1)});function sgD(H){let{title:$,lines:A,footer:L,emptyMessage:I,customContent:D}=H,B=$.length;if(D!==void 0)B=Math.max(B,D.width);else if(A.length===0&&I)B=Math.max(B,I.length);else{let E=Math.max(0,...A.map((M)=>M.timestamp?M.timestamp.length:0));for(let M of A){let G=E>0?E:0,U=M.text.length+(G>0?G+2:0);B=Math.max(B,U)}}if(L)B=Math.max(B,L.length);return B}function egD({config:H,actualWidth:$}){let{title:A,lines:L,footer:I,emptyMessage:D,customContent:B}=H,f=" ",E=Math.max(0,...L.map((M)=>M.timestamp?M.timestamp.length:0));return cE.createElement(x,{flexDirection:"column",width:$},cE.createElement(V,{bold:!0,color:"claude"},A),B?cE.createElement(cE.Fragment,null,B.content,I&&cE.createElement(V,{dimColor:!0,italic:!0},e8(I,$))):L.length===0&&D?cE.createElement(V,{dimColor:!0},e8(D,$)):cE.createElement(cE.Fragment,null,L.map((M,G)=>{let U=Math.max(10,$-(E>0?E+2:0));return cE.createElement(V,{key:G},E>0&&cE.createElement(cE.Fragment,null,cE.createElement(V,{dimColor:!0},(M.timestamp||"").padEnd(E))," "),cE.createElement(V,null,e8(M.text,U)))}),I&&cE.createElement(V,{dimColor:!0,italic:!0},e8(I,$))))}var cE;var HmD=K(()=>{xH();Q9();cE=b(s(),1)});function $mD({feeds:H,maxWidth:$}){let A=H.map((D)=>sgD(D)),L=Math.max(...A),I=Math.min(L,$);return Ej.createElement(x,{flexDirection:"column"},H.map((D,B)=>Ej.createElement(Ej.Fragment,{key:B},Ej.createElement(egD,{config:D,actualWidth:I}),B{xH();HmD();e6();Ej=b(s(),1)});async function u61(H="claude_code_guest_pass"){let{accessToken:$,orgUUID:A}=await Zw(),L={...xK($),"x-organization-uuid":A},I=`${XD().BASE_API_URL}/api/oauth/organizations/${A}/referral/eligibility`;return(await nA.get(I,{headers:L,params:{campaign:H},timeout:5000})).data}async function DmD(H="claude_code_guest_pass"){let{accessToken:$,orgUUID:A}=await Zw(),L={...xK($),"x-organization-uuid":A},I=`${XD().BASE_API_URL}/api/oauth/organizations/${A}/referral/redemptions`;return(await nA.get(I,{headers:L,params:{campaign:H},timeout:1e4})).data}function BmD(){return!!(T9()?.organizationUuid&&nL()&&f0()==="max")}function wT$(){if(!BmD())return{eligible:!1,needsRefresh:!1,hasCache:!1};let H=T9()?.organizationUuid;if(!H)return{eligible:!1,needsRefresh:!1,hasCache:!1};let A=M$().passesEligibilityCache?.[H];if(!A)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:L,timestamp:I}=A,B=Date.now()-I>ImD;return{eligible:L,needsRefresh:B,hasCache:!0}}function Rs(H){let $=g61[H.currency]??`${H.currency} `,A=H.amount_minor_units/100,L=A%1===0?A.toString():A.toFixed(2);return`${$}${L}`}function ys(){let H=T9()?.organizationUuid;if(!H)return null;return M$().passesEligibilityCache?.[H]?.referrer_reward??null}function ZT$(){let H=T9()?.organizationUuid;if(!H)return null;return M$().passesEligibilityCache?.[H]?.remaining_passes??null}async function LmD(){if(SmH)return N("Passes: Reusing in-flight eligibility fetch"),SmH;let H=T9()?.organizationUuid;if(!H)return null;return SmH=(async()=>{try{let $=await u61(),A={...$,timestamp:Date.now()};return AA((L)=>({...L,passesEligibilityCache:{...L.passesEligibilityCache,[H]:A}})),N(`Passes eligibility cached for org ${H}: ${$.eligible}`),$}catch($){return N("Failed to fetch and cache passes eligibility"),r($),null}finally{SmH=null}})(),SmH}async function jmH(){if(!BmD())return null;let H=T9()?.organizationUuid;if(!H)return null;let A=M$().passesEligibilityCache?.[H],L=Date.now();if(!A)return N("Passes: No cache, fetching eligibility in background (command unavailable this session)"),LmD(),null;if(L-A.timestamp>ImD){N("Passes: Cache stale, returning cached data and refreshing in background"),LmD();let{timestamp:B,...f}=A;return f}N("Passes: Using fresh cached eligibility data");let{timestamp:I,...D}=A;return D}async function fmD(){jmH()}var ImD=3600000,SmH=null,g61;var Jd=K(()=>{w1();qE();YS();vA();EI();E$();_$();g61={USD:"$",EUR:"\u20AC",GBP:"\xA3",BRL:"R$",CAD:"CA$",AUD:"A$",NZD:"NZ$",SGD:"S$"}});function RmH(H){let $=H.map((A)=>{let L=HLH(A.modified);return{text:(A.summary&&A.summary!=="No prompt"?A.summary:A.firstPrompt)||"",timestamp:L}});return{title:"Recent activity",lines:$,footer:$.length>0?"/resume for more":void 0,emptyMessage:"No recent activity"}}function MmD(H){let $=H.map((L)=>{return{text:L}}),A="Check the Claude Code changelog for updates";return{title:"What's new",lines:$,footer:$.length>0?"/release-notes for more":void 0,emptyMessage:"Check the Claude Code changelog for updates"}}function GmD(H){let A=H.filter(({isEnabled:I})=>I).sort((I,D)=>Number(I.isComplete)-Number(D.isComplete)).map(({text:I,isComplete:D})=>{return{text:`${D?`${pH.tick} `:""}${I}`}}),L=C$()===EmD.homedir()?"Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.":void 0;if(L)A.push({text:L});return{title:"Tips for getting started",lines:A}}function UmD(){let H=ys(),$=H?`Share Claude Code and earn ${Rs(H)} of extra usage`:"Share Claude Code with friends";return{title:"3 guest passes",lines:[],customContent:{content:l4.createElement(l4.Fragment,null,l4.createElement(x,{marginY:1},l4.createElement(V,{color:"claude"},"[\u273B] [\u273B] [\u273B]")),l4.createElement(V,{dimColor:!0},$)),width:48},footer:"/passes"}}function XmD(H){switch(H){case"promo-copper":return{title:cD()&&Z4()?"Opus 4.6 is here \xB7 Try fast mode":"Opus 4.6 is here",lines:[],customContent:{content:l4.createElement(x,{marginY:1},l4.createElement(V,{bold:!0,color:"claude"},"$50 free extra usage")),width:48},footer:"/extra-usage to enable"};case"promo":return{title:"Opus 4.6 is here",lines:[],customContent:{content:l4.createElement(x,{marginY:1},l4.createElement(V,{bold:!0,color:"claude"},"$50 free extra usage")),width:48},footer:"/extra-usage to enable"};case"launch-only":return{title:"Opus 4.6 is here",lines:[],customContent:{content:l4.createElement(x,{marginY:1},l4.createElement(V,null,"Most capable for ambitious work")),width:48},footer:"/model to switch"}}}var l4,EmD;var JmD=K(()=>{Q9();jI();PI();xH();AJ();Jd();l4=b(s(),1),EmD=require("os")});function m61(){let H=ZT$();if(H==null||H<=0)return;let A=M$().passesLastSeenRemaining??0;if(H>A)AA((L)=>({...L,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:H}))}function p61(){let{eligible:H,hasCache:$}=wT$();if(!H||!$)return!1;m61();let A=M$();if((A.passesUpsellSeenCount??0)>=3)return!1;if(A.hasVisitedPasses)return!1;return!0}function qT$(){let[H]=FmD.useState(()=>p61());return H}function TT$(){let $=(M$().passesUpsellSeenCount??0)+1;AA((A)=>({...A,passesUpsellSeenCount:$})),c("tengu_guest_passes_upsell_shown",{seen_count:$})}function KmD(){let H=ys();return Fd.createElement(V,{dimColor:!0},Fd.createElement(V,{color:"claude"},"[\u273B]")," ",Fd.createElement(V,{color:"claude"},"[\u273B]")," ",Fd.createElement(V,{color:"claude"},"[\u273B]")," \xB7"," ",H?`Share Claude Code and earn ${Rs(H)} of extra usage \xB7 /passes`:"3 guest passes at /passes")}var Fd,FmD;var pyA=K(()=>{xH();vA();Jd();z$();Fd=b(s(),1),FmD=b(s(),1)});function d61(){if(OA.terminal==="Apple_Terminal")return lD.createElement(x,{flexDirection:"column",alignItems:"center"},lD.createElement(V,null,lD.createElement(V,{color:"clawd_body"},"\u2597"),lD.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),lD.createElement(V,{color:"clawd_body"},"\u2596")),lD.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(7)),lD.createElement(V,{color:"clawd_body"},"\u2598\u2598 \u259D\u259D"));return lD.createElement(x,{flexDirection:"column"},lD.createElement(V,null,lD.createElement(V,{color:"clawd_body"}," \u2590"),lD.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u259B\u2588\u2588\u2588\u259C"),lD.createElement(V,{color:"clawd_body"},"\u258C")),lD.createElement(V,null,lD.createElement(V,{color:"clawd_body"},"\u259D\u259C"),lD.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u2588\u2588\u2588\u2588\u2588"),lD.createElement(V,{color:"clawd_body"},"\u259B\u2598")),lD.createElement(V,{color:"clawd_body"}," ","\u2598\u2598 \u259D\u259D"," "))}function QmD(){let{columns:H}=QL(),$=J$((u)=>u.agent),[A,{isVisible:L}]=vg(),I=_T$(),D=ymH.useRef(I);if(L)D.current=I;let{version:B,cwd:f,modelDisplayName:E,billingType:M,agentName:G}=D.current,U=$??G,X=qT$(),J=Kq$();ymH.useEffect(()=>{if(X)TT$()},[X]),ymH.useEffect(()=>{if(J&&!X)Qq$()},[J,X]);let F=Math.max(H-15,20),W=e8(B,Math.max(F-"Claude Code v".length,6)),{shouldSplit:P,truncatedModel:C,truncatedBilling:Y}=agD(E,M,F),Z=" \xB7 ",O=U?F-1-U.length-Z.length:F,j=xmH(f,Math.max(O,10));return lD.createElement(x,{ref:A,flexDirection:"row",gap:2,alignItems:"center"},lD.createElement(d61,null),lD.createElement(x,{flexDirection:"column"},lD.createElement(V,null,lD.createElement(V,{bold:!0},"Claude Code")," ",lD.createElement(V,{dimColor:!0},"v",W)),P?lD.createElement(lD.Fragment,null,lD.createElement(V,{dimColor:!0},C),lD.createElement(V,{dimColor:!0},Y)):lD.createElement(V,{dimColor:!0},C," \xB7 ",Y),lD.createElement(V,{dimColor:!0},U?`@${U} \xB7 ${j}`:j),X&&lD.createElement(KmD,null),!X&&J&&lD.createElement(WyD,{variant:J,maxWidth:F})))}var lD,ymH;var WmD=K(()=>{xH();Z1();OB();Q9();YT$();pyA();rgH();pL();lD=b(s(),1),ymH=b(s(),1)});function dyA(){let H=hmH.useMemo(i61,[]),$=hmH.useMemo(()=>M$().lastShownEmergencyTip,[]),A=H.tip&&H.tip!==$;if(hmH.useEffect(()=>{if(A)AA((L)=>{if(L.lastShownEmergencyTip===H.tip)return L;return{...L,lastShownEmergencyTip:H.tip}})},[A,H.tip]),!A)return null;return vmH.createElement(x,{paddingLeft:2,flexDirection:"column"},vmH.createElement(V,{...H.color==="warning"?{color:"warning"}:H.color==="error"?{color:"error"}:{dimColor:!0}},H.tip))}function i61(){return rm(c61,l61)}var vmH,hmH,c61="tengu-top-of-feed-tip",l61;var VmD=K(()=>{xH();SD();vA();vmH=b(s(),1),hmH=b(s(),1);l61={tip:"",color:"dim"}});function PmD({isBeforeFirstMessage:H}){let $=lQ(),A=$.prefersReducedMotion??!1,L=ggD(H,A),I=rgD(),D=M$().oauthAccount?.displayName??"",{columns:B}=QL(),f=wVI(),E=vL.isSandboxingEnabled(),M=qT$(),G=Kq$(),U=J$((MH)=>MH.agent),X=M$(),J;try{J=ogD(3)}catch{J=[]}let F=$.companyAnnouncements,[Q]=vs.useState(()=>F&&F.length>0?X.numStartups===1?F[0]:F[Math.floor(Math.random()*F.length)]:void 0),{hasReleaseNotes:W}=JT$(X.lastReleaseNotesSeen);vs.useEffect(()=>{if(M$().lastReleaseNotesSeen==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)return;if(AA((CH)=>{if(CH.lastReleaseNotesSeen==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)return CH;return{...CH,lastReleaseNotesSeen:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}}),f)ZVI()},[X,f]),vs.useEffect(()=>{if(M&&!f)TT$()},[M,f]),vs.useEffect(()=>{if(G&&!f&&!M)Qq$()},[G,f,M]);let[P,{isVisible:C}]=vg(),Y=_T$(),Z=vs.useRef(Y);if(C)Z.current=Y;let{version:q,cwd:O,modelDisplayName:j,billingType:u,agentName:y}=Z.current,g=U??y,h=e8(j,cyA-20);if(!W&&!f&&!A$(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return PL.createElement(PL.Fragment,null,PL.createElement(x,null),PL.createElement(QmD,null),QEH()&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Debug mode enabled"),PL.createElement(V,{dimColor:!0},"Logging to: ",IR()?"stderr":xHH())),PL.createElement(dyA,null),process.env.CLAUDE_CODE_TMUX_SESSION&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{dimColor:!0},"tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION),PL.createElement(V,{dimColor:!0},process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`)),Q&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},!process.env.IS_DEMO&&X.oauthAccount?.organizationName&&PL.createElement(V,{dimColor:!0},"Message from ",X.oauthAccount.organizationName,":"),PL.createElement(V,null,Q)),!1,!1);let p=cgD(B),d=M$().theme,k=` ${ZL("claude",d)("Claude Code")} ${ZL("inactive",d)(`v${q}`)} `,n=ZL("claude",d)(" Claude Code ");if(p==="compact"){let CH=PT$(D);if(GI(CH)>B-4)CH=PT$(null);let OH=" \xB7 ",LH="@",e=g?B-4-LH.length-g.length-OH.length:B-4,DH=xmH(O,Math.max(e,10));return PL.createElement(PL.Fragment,null,PL.createElement(x,{ref:P,flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:n,position:"top",align:"start",offset:1},paddingX:1,paddingY:1,alignItems:"center",width:B},PL.createElement(V,{bold:!0},CH),PL.createElement(x,{marginY:1},PL.createElement(x,{height:5,flexDirection:"column",justifyContent:"flex-end"},PL.createElement(x,{marginBottom:L},PL.createElement(myA,null)))),PL.createElement(V,{dimColor:!0},h),PL.createElement(V,{dimColor:!0},u),PL.createElement(V,{dimColor:!0},g?`@${g} \xB7 ${DH}`:DH)),E&&PL.createElement(x,{marginTop:1,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Your bash commands will be sandboxed. Disable with /sandbox.")))}let GH=PT$(D),HH=!process.env.IS_DEMO&&X.oauthAccount?.organizationName?`${h} \xB7 ${u} \xB7 ${X.oauthAccount.organizationName}`:`${h} \xB7 ${u}`,BH=" \xB7 ",wH=g?cyA-1-g.length-BH.length:cyA,QH=xmH(O,Math.max(wH,10)),TH=g?`@${g} \xB7 ${QH}`:QH,t=igD(GH,TH,HH),{leftWidth:IH,rightWidth:KH}=lgD(B,p,t);return PL.createElement(PL.Fragment,null,PL.createElement(x,null),PL.createElement(x,{ref:P,flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:k,position:"top",align:"start",offset:3}},PL.createElement(x,{flexDirection:p==="horizontal"?"row":"column",paddingX:1,gap:1},PL.createElement(x,{flexDirection:"column",width:IH,justifyContent:"space-between",alignItems:"center",minHeight:9},PL.createElement(x,{marginTop:1},PL.createElement(V,{bold:!0},GH)),PL.createElement(x,{height:5,flexDirection:"column",justifyContent:"flex-end"},PL.createElement(x,{marginBottom:L},PL.createElement(myA,null))),PL.createElement(x,{flexDirection:"column",alignItems:"center"},PL.createElement(V,{dimColor:!0},HH),PL.createElement(V,{dimColor:!0},TH))),p==="horizontal"&&PL.createElement(Uf,{orientation:"vertical",dividerColor:"claude"}),p==="horizontal"&&PL.createElement($mD,{feeds:f?[GmD(f5A()),RmH(I)]:M?[RmH(I),UmD()]:G?[RmH(I),XmD(G)]:[RmH(I),MmD(J)],maxWidth:KH}))),QEH()&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Debug mode enabled"),PL.createElement(V,{dimColor:!0},"Logging to: ",IR()?"stderr":xHH())),PL.createElement(dyA,null),process.env.CLAUDE_CODE_TMUX_SESSION&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{dimColor:!0},"tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION),PL.createElement(V,{dimColor:!0},process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`)),Q&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},!process.env.IS_DEMO&&X.oauthAccount?.organizationName&&PL.createElement(V,{dimColor:!0},"Message from ",X.oauthAccount.organizationName,":"),PL.createElement(V,null,Q)),E&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Your bash commands will be sandboxed. Disable with /sandbox.")),!1,!1)}var PL,vs,cyA=50;var _mD=K(()=>{xH();OB();DJ();mgD();YT$();Q9();rD();tgD();AmD();JmD();e6();vA();um();E$();xSH();WmD();eVH();TQH();NA();hc();VmD();EM();pyA();rgH();pL();PL=b(s(),1),vs=b(s(),1)});function YmD({message:H,isTranscriptMode:$}){if(!($&&H.timestamp&&H.type==="assistant"&&H.message.content.some((I)=>I.type==="text")))return null;let L=new Date(H.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0});return lyA.default.createElement(x,{marginTop:1,minWidth:L.length},lyA.default.createElement(V,{dimColor:!0},L))}var lyA;var CmD=K(()=>{xH();lyA=b(s(),1)});function wmD({message:H,isTranscriptMode:$}){if(!($&&H.type==="assistant"&&H.message.model&&H.message.content.some((L)=>L.type==="text")))return null;return iyA.default.createElement(x,{marginTop:1,marginLeft:1,minWidth:H.message.model.length+8},iyA.default.createElement(V,{dimColor:!0},H.message.model))}var iyA;var ZmD=K(()=>{xH();iyA=b(s(),1)});function n61(H,$){for(let A=$+1;A0?A[$-1]:null,j=H.type==="user"&&O?.type==="user",u=Y?H.displayMessage:Z?FyI(H):H,y=Y||Z?[]:OmD(H,P),g=Y||Z?new Set:NmD(H,P),h=zmD(H,f,B,g,E,P),p=!1;if(M)if(Y)p=H.messages.some((d)=>{let k=d.message.content[0];return k?.type==="tool_use"&&B.has(k.id)});else if(Z)p=JyI(H,B);else{let d=hs(H);p=!d||B.has(d)}return Mj.createElement(x,{key:`${H.uuid}-${J}-${F}`,width:Q,flexDirection:"row",flexWrap:"nowrap",alignItems:"flex-start",justifyContent:"space-between",gap:1},Mj.createElement(Bz,{message:H,lookups:P,addMargin:!0,tools:L,commands:I,verbose:D,inProgressToolUseIDs:B,progressMessagesForMessage:y,shouldAnimate:p,shouldShowDot:!0,isTranscriptMode:C,isStatic:h,onOpenRateLimitOptions:G,isActiveCollapsedGroup:q,isUserContinuation:j,lastThinkingBlockId:U,latestBashOutputUUID:X}),Mj.createElement(YmD,{message:u,isTranscriptMode:C}),Mj.createElement(wmD,{message:u,isTranscriptMode:C}))}function a61(H,$){if(H.type==="grouped_tool_use")return H.messages.some((L)=>{let I=L.message.content[0];return I?.type==="tool_use"&&$.has(I.id)});if(H.type==="collapsed_read_search")return MQH(H).some((I)=>$.has(I));let A=hs(H);return!!A&&$.has(A)}function o61(H,$){if(H.type==="grouped_tool_use")return H.messages.every((L)=>{let I=L.message.content[0];return I?.type==="tool_use"&&$.has(I.id)});if(H.type==="collapsed_read_search")return MQH(H).every((I)=>$.has(I));let A=hs(H);return!A||$.has(A)}function t61(H,$){if(H.message!==$.message)return!1;if(H.screen!==$.screen)return!1;if(H.message.type==="collapsed_read_search"&&$.screen!=="transcript")return!1;if(H.columns!==$.columns)return!1;let A=H.latestBashOutputUUID===H.message.uuid,L=$.latestBashOutputUUID===$.message.uuid;if(A!==L)return!1;if(H.lastThinkingBlockId!==$.lastThinkingBlockId)return!1;let I=a61(H.message,H.streamingToolUseIDs),D=o61(H.message,H.lookups.resolvedToolUseIDs);if(I||!D)return!1;return!0}var Mj,qmD;var TmD=K(()=>{xH();_L();hx();A6H();CmD();ZmD();bmH();Mj=b(s(),1);qmD=Mj.memo(r61,t61)});function H31(H,$){if(H.size!==$.size)return!1;for(let A of H)if(!$.has(A))return!1;return!0}function zmD(H,$,A,L,I,D){if(I==="transcript")return!0;switch(H.type){case"attachment":case"user":case"assistant":{let B=hs(H);if(!B)return!0;if($.has(B))return!1;if(A.has(B))return!1;if(jmD(B,"PostToolUse",D))return!1;return ugD(L,D.resolvedToolUseIDs)}case"system":return H.subtype!=="api_error";case"grouped_tool_use":return H.messages.every((f)=>{let E=f.message.content[0];return E?.type==="tool_use"&&D.resolvedToolUseIDs.has(E.id)});case"collapsed_read_search":return!1}}var i4,PC,s61=null,kmH=10,e61=({messages:H,normalizedMessageHistory:$,tools:A,commands:L,verbose:I,toolJSX:D,toolUseConfirmQueue:B,inProgressToolUseIDs:f,isMessageSelectorVisible:E,conversationId:M,screen:G,screenToggleId:U,streamingToolUses:X,showAllInTranscript:J=!1,agentDefinitions:F,onOpenRateLimitOptions:Q,hideLogo:W=!1,isLoading:P,hidePastThinking:C=!1,streamingThinking:Y})=>{let{columns:Z}=QL(),q=C0("transcript:toggleShowAll","Transcript","Ctrl+E"),O=PC.useMemo(()=>[...$,...g5(H).filter(Is)],[H,$]),j=PC.useMemo(()=>{if(!Y)return!1;if(Y.isStreaming)return!0;if(Y.streamingEndedAt)return Date.now()-Y.streamingEndedAt<30000;return!1},[Y]),u=PC.useMemo(()=>{if(!C)return null;if(j)return"streaming";for(let t=O.length-1;t>=0;t--){let IH=O[t];if(IH?.type==="assistant"){let KH=IH.message.content;for(let MH=KH.length-1;MH>=0;MH--)if(KH[MH]?.type==="thinking")return`${IH.uuid}:${MH}`}else if(IH?.type==="user"){if(!IH.message.content.some((MH)=>MH.type==="tool_result"))return"no-thinking"}}return null},[O,C,j]),y=PC.useMemo(()=>{for(let t=O.length-1;t>=0;t--){let IH=O[t];if(IH?.type==="user"){let KH=IH.message.content;for(let MH of KH)if(MH.type==="text"){let CH=MH.text;if(CH.startsWith("X.filter((t)=>{if(f.has(t.contentBlock.id))return!1;if(O.some((IH)=>IH.type==="assistant"&&IH.message.content[0].type==="tool_use"&&IH.message.content[0].id===t.contentBlock.id))return!1;return!0}),[X,f,O]),h=PC.useMemo(()=>g.flatMap((t)=>g5([PT({content:[t.contentBlock]})])),[g]),p=G==="transcript",d=p&&!J,{renderableMessages:k,lookups:n,hasTruncatedMessages:GH}=PC.useMemo(()=>{let t=I?O:GC(O),IH=xmD(t.filter((e)=>e.type!=="progress").filter((e)=>RmD(e,p)),h),KH=d?IH.slice(-kmH):IH,MH=d&&IH.length>kmH,{messages:CH}=TgD(KH,A,I),OH=NgD(KyI(CH,A)),LH=SmD(O,KH);return{renderableMessages:OH,lookups:LH,hasTruncatedMessages:MH}},[I,O,p,h,d,A]),HH=PC.useMemo(()=>new Set(X.map((t)=>t.contentBlock.id)),[X]),BH=(!D||!!D.shouldContinueAnimation)&&!B.length&&!E,WH=f.size>0,{progress:wH}=Vy(),QH=PC.useRef(null),TH=M$().terminalProgressBarEnabled&&!(s61?.isProactiveActive()??!1);return PC.useEffect(()=>{let t=TH?WH?"indeterminate":"completed":null;if(QH.current===t)return;QH.current=t,wH(t)},[wH,TH,WH]),PC.useEffect(()=>{return()=>wH(null)},[wH]),i4.createElement(i4.Fragment,null,!W&&i4.createElement(x,{flexDirection:"column",gap:1,key:`logo-${M}-${U}`},i4.createElement(PmD,{isBeforeFirstMessage:!1}),i4.createElement(bgD,{agentDefinitions:F})),GH&&i4.createElement(Uf,{key:`truncation-indicator-${M}-${U}`,dividerChar:"\u2500",title:`${q} to show ${oH.bold(n.normalizedMessageCount-kmH)} previous messages`,width:Z}),p&&J&&n.normalizedMessageCount>kmH&&i4.createElement(Uf,{key:`hide-indicator-${M}-${U}`,dividerChar:"\u2500",title:`${q} to hide ${oH.bold(n.normalizedMessageCount-kmH)} previous messages`,width:Z}),k.map((t,IH)=>i4.createElement(qmD,{key:`${t.uuid}-${M}-${U}`,message:t,index:IH,renderableMessages:k,tools:A,commands:L,verbose:I,inProgressToolUseIDs:f,streamingToolUseIDs:HH,screen:G,canAnimate:BH,onOpenRateLimitOptions:Q,lastThinkingBlockId:u,latestBashOutputUUID:y,conversationId:M,screenToggleId:U,columns:Z,isLoading:P,lookups:n})),j&&Y&&i4.createElement(x,{marginTop:1},i4.createElement(R_$,{param:{type:"thinking",thinking:Y.thinking},addMargin:!1,isTranscriptMode:!0,hideInTranscript:!1})))},l1H;var bmH=K(()=>{xH();_L();hx();kgD();OB();e6();r0();_mD();UZA();FG();TLH();vA();TmD();i4=b(s(),1),PC=b(s(),1);l1H=i4.memo(e61,(H,$)=>{let A=Object.keys(H);for(let L of A){if(L==="onOpenRateLimitOptions")continue;if(H[L]!==$[L]){if(L==="streamingToolUses"){let I=H.streamingToolUses,D=$.streamingToolUses;if(I.length===D.length&&I.every((B,f)=>B.contentBlock===D[f]?.contentBlock))continue}if(L==="inProgressToolUseIDs"){if(H31(H.inProgressToolUseIDs,$.inProgressToolUseIDs))continue}if(L==="tools"){let I=H.tools,D=$.tools;if(I.length===D.length&&I.every((B,f)=>B.name===D[f]?.name))continue}return!1}}return!0})});function umH({message:H,bold:$=!1,dimColor:A=!1,subtitle:L}){return $PH.default.createElement(x,{flexDirection:"column"},$PH.default.createElement(x,{flexDirection:"row"},$PH.default.createElement(vD,null),$PH.default.createElement(V,{bold:$,dimColor:A}," ",H)),L&&$PH.default.createElement(V,{dimColor:!0},L))}var $PH;var nyA=K(()=>{xH();JM();$PH=b(s(),1)});function vmD({log:H,onExit:$,onSelect:A}){let[L,I]=s7.default.useState(null),[D,B]=s7.default.useState(!1);s7.default.useEffect(()=>{if(Qz(H))B(!0),cS(H).then((U)=>{I(U),B(!1)});else I(H)},[H]);let f=L??H,E=mM(f)||"",M=vt();BA("confirm:no",$,{context:"Confirmation"});let G=ymD.useCallback(()=>{A(L??H)},[A,L,H]);if(BA("confirm:yes",G,{context:"Confirmation"}),D)return s7.default.createElement(x,{flexDirection:"column",padding:1},s7.default.createElement(umH,{message:"Loading session\u2026"}),s7.default.createElement(V,{dimColor:!0},s7.default.createElement(rA,null,s7.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))));return s7.default.createElement(x,{flexDirection:"column"},s7.default.createElement(l1H,{messages:f.messages,normalizedMessageHistory:[],tools:M,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:E,screen:"transcript",screenToggleId:1,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),s7.default.createElement(x,{flexShrink:0,flexDirection:"column",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",paddingLeft:2},s7.default.createElement(V,null,HLH(f.modified)," \xB7"," ",f.messageCount," messages",f.gitBranch?` \xB7 ${f.gitBranch}`:""),s7.default.createElement(V,{dimColor:!0},s7.default.createElement(rA,null,s7.default.createElement(s$,{shortcut:"Enter",action:"resume"}),s7.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}var s7,ymD;var hmD=K(()=>{xH();Q9();bmH();g7();lB();j0();eB();nyA();rB();$I();s7=b(s(),1),ymD=b(s(),1)});function I31(H,$){if(H===ryA)return ryA.length+gmH;let A=$?Math.min(H.length,$-gmH-ayA):H.length;return Math.max(0,A)+gmH+ayA}function D31(H,$){let A=$-gmH-ayA;if(H.length<=A)return H;if(A<=1)return H.charAt(0);return H.slice(0,A-1)+"\u2026"}function pmD({tabs:H,selectedIndex:$,availableWidth:A,showAllProjects:L=!1}){let I=L?"Resume (All Projects)":"Resume",D=I.length+1,B=Math.max(A31,L31),f=A-D-B-2,E=Math.max(0,Math.min($,H.length-1)),M=Math.max(20,Math.floor(f/2)),G=H.map((C)=>I31(C,M)),U=0,X=H.length;if(G.reduce((C,Y,Z)=>C+Y+(Zf){let C=f-$31,Y=G[E]??0;U=E,X=E+1;while(U>0||X0,q=XU+Y);return i1H.default.createElement(x,{flexDirection:"row",gap:1},i1H.default.createElement(V,{color:"suggestion"},I),F>0&&i1H.default.createElement(V,{dimColor:!0},bmD,F),W.map((C,Y)=>{let q=P[Y]===E,O=C===ryA?C:`#${D31(C,M-gmH)}`;return i1H.default.createElement(V,{key:C,backgroundColor:q?"suggestion":void 0,color:q?"inverseText":void 0,bold:q}," ",O," ")}),Q>0?i1H.default.createElement(V,{dimColor:!0},kmD,Q,umD):i1H.default.createElement(V,{dimColor:!0},gmD))}var i1H,ryA="All",gmH=2,ayA=1,bmD="\u2190 ",kmD="\u2192",umD=" (tab to cycle)",gmD="(tab to cycle)",mmD=2,$31,A31,L31;var dmD=K(()=>{xH();i1H=b(s(),1),$31=bmD.length+mmD+1,A31=kmD.length+mmD+umD.length,L31=gmD.length});function imD(H,$){let A=H.replace(/\s+/g," ").trim();if(A.length<=$)return A;return A.slice(0,$).trim()+"\u2026"}function oyA({before:H,match:$,after:A},L){return oH.dim(H)+L($)+oH.dim(A)}function X31(H,$,A){let L=H.toLowerCase().indexOf($.toLowerCase());if(L===-1)return null;let I=L+$.length,D=Math.max(0,L-A),B=Math.min(H.length,I+A),f=H.slice(D,L),E=H.slice(L,I),M=H.slice(I,B);return{before:(D>0?"\u2026":"")+f.replace(/\s+/g," ").trimStart(),match:E.trim(),after:M.replace(/\s+/g," ").trimEnd()+(B0?B31:I?f31:0,f=L&&D>0?` (+${D} other ${D===1?"session":"sessions"})`:"",E=H.isSidechain?" (sidechain)":"",M=$-B-E.length-f.length;return`${imD(Fl(H),M)}${E}${f}`}function syA(H,$){let{isChild:A=!1,showProjectPath:L=!1}=$||{},I=A?" ":"",D=CzH(H),B=L&&H.projectPath?` \xB7 ${H.projectPath}`:"";return I+D+B}function zT$({logs:H,maxHeight:$=1/0,forceWidth:A,onCancel:L,onSelect:I,onLogsChanged:D,onLoadMore:B,initialSearchQuery:f,showAllProjects:E=!1,onToggleAllProjects:M,onAgenticSearch:G}){let U=QL(),X=A===void 0?U.columns:A,J=zB(L),F=EJ(),Q=Kd(),W=!1,[P]=_I(),C=c6(P),Y=YL.default.useMemo(()=>(IL)=>du(IL,C.warning),[C.warning]),Z=!1,[q,O]=YL.default.useState(null),[j,u]=YL.default.useState(!1),[y,g]=YL.default.useState(!1),[h,p]=YL.default.useState(!1),d=YL.default.useMemo(()=>zL(),[]),[k,n]=YL.default.useState(""),[GH,HH]=YL.default.useState(0),[BH,WH]=YL.default.useState(new Set),[wH,QH]=YL.default.useState(null),[TH,t]=YL.default.useState(1),[IH,KH]=YL.default.useState("list"),[MH,CH]=YL.default.useState(null),OH=YL.default.useRef(null),[LH,e]=YL.default.useState(0),[DH,EH]=YL.default.useState({status:"idle"}),[$H,FH]=YL.default.useState(!1),YH=YL.default.useRef(null),{query:qH,setQuery:bH,cursorOffset:hH}=Eb({isActive:IH==="search"&&DH.status!=="searching",onExit:()=>{KH("list"),c("tengu_session_search_toggled",{enabled:!1})},onExitUp:()=>{KH("list"),c("tengu_session_search_toggled",{enabled:!1})},passthroughCtrlKeys:["n"],initialQuery:f||""}),PH=YL.default.useDeferredValue(qH),[gH,vH]=YL.default.useState("");YL.default.useEffect(()=>{if(!PH){vH("");return}let IL=setTimeout(()=>{vH(PH)},300);return()=>clearTimeout(IL)},[PH]);let[tH,K$]=YL.default.useState(null),[KA,UA]=YL.default.useState(!1);YL.default.useEffect(()=>{vW().then((IL)=>O(IL)),Xd(d).then((IL)=>{p(IL.length>1)})},[d]);let U$=YL.default.useMemo(()=>new Map(H.map((IL)=>[IL,F31(IL)])),[H]),hA=YL.default.useMemo(()=>{return null},[H,U$,!1]),iA=YL.default.useMemo(()=>Q31(H),[H]),rH=iA.length>0,G$=YL.default.useMemo(()=>rH?["All",...iA]:[],[rH,iA]);YL.default.useEffect(()=>{if(G$.length>0&&LH>=G$.length)e(0)},[G$.length,LH]);let b$=G$[LH],ZA=b$==="All"?void 0:b$,n$=rH?1:0,fA=YL.default.useMemo(()=>{let IL=H;if(Q)IL=H.filter((qA)=>{let BB=j$(),WB=mM(qA);if(BB&&WB===BB)return!0;if(qA.customTitle)return!0;if(NT$(qA.messages))return!0;if(qA.firstPrompt||qA.customTitle)return!0;return!1});if(ZA!==void 0)IL=IL.filter((qA)=>qA.tag===ZA);if(j&&q)IL=IL.filter((qA)=>qA.gitBranch===q);if(h&&!y)IL=IL.filter((qA)=>qA.projectPath===d);return IL},[H,Q,ZA,j,q,h,y,d]),UH=YL.default.useMemo(()=>{if(!qH)return fA;let IL=qH.toLowerCase();return fA.filter((qA)=>{let BB=Fl(qA).toLowerCase(),WB=(qA.gitBranch||"").toLowerCase(),GD=(qA.tag||"").toLowerCase(),C9=qA.prNumber?`pr #${qA.prNumber} ${qA.prRepository||""}`.toLowerCase():"";return BB.includes(IL)||WB.includes(IL)||GD.includes(IL)||C9.includes(IL)})},[fA,qH]);YL.default.useEffect(()=>{},[PH,gH,!1]),YL.default.useEffect(()=>{K$(null),UA(!1);return},[gH,hA,!1]);let{filteredLogs:_H,snippets:aH}=YL.default.useMemo(()=>{let IL=new Map,qA=UH;if(tH&&gH&&tH.query===gH){for(let GD of tH.results)if(GD.searchableText){let C9=X31(GD.searchableText,gH,U31);if(C9)IL.set(GD.log,C9)}let BB=new Set(qA.map((GD)=>GD.messages[0]?.uuid)),WB=tH.results.map((GD)=>GD.log).filter((GD)=>!BB.has(GD.messages[0]?.uuid));qA=[...qA,...WB]}return{filteredLogs:qA,snippets:IL}},[UH,tH,gH]),f$=YL.default.useMemo(()=>{if(DH.status==="results"&&DH.results.length>0)return DH.results;return _H},[DH,_H]),I$=Math.max(30,X-4),$$=YL.default.useMemo(()=>{if(!Q)return[];let IL=K31(f$);return Array.from(IL.entries()).map(([qA,BB])=>{let WB=BB[0],GD=f$.indexOf(WB),C9=aH.get(WB),V1=C9?oyA(C9,Y):null;if(BB.length===1){let n8=syA(WB,{showProjectPath:E});return{id:`log:${qA}:0`,value:{log:WB,indexInFiltered:GD},label:tyA(WB,I$),description:V1?`${n8} ${nE}`:C9+V1,dimDescription:!0,value:qA.toString()}})},[Q,f$,Y,I$,E,aH]),x$=wH?.value.log??null,zA=()=>{if(!Q||!x$)return"";let IL=mM(x$);if(!IL)return"";let qA=f$.filter((C9)=>mM(C9)===IL);if(!(qA.length>1))return"";let WB=BH.has(IL);if(qA.indexOf(x$)>0)return"\u2190 to collapse";return WB?"\u2190 to collapse":"\u2192 to expand"},gA=YL.default.useCallback(async()=>{let IL=x$?mM(x$):void 0;if(!x$||!IL){KH("list"),n("");return}if(k.trim()){if(await c1H(IL,k.trim(),x$.fullPath),Q&&D)D()}KH("list"),n("")},[x$,k,D,Q]),HI=YL.default.useCallback(()=>{KH("list"),c("tengu_session_search_toggled",{enabled:!1})},[]),AI=YL.default.useCallback(()=>{KH("search"),c("tengu_session_search_toggled",{enabled:!0})},[]),qB=YL.default.useCallback(async()=>{qH.trim();return},[qH,G,!1,H]);YL.default.useEffect(()=>{if(DH.status!=="idle"&&DH.status!=="searching"){if(DH.status==="results"&&DH.query!==qH||DH.status==="error")EH({status:"idle"})}},[qH,DH]),YL.default.useEffect(()=>{return()=>{YH.current?.abort()}},[]);let RB=YL.default.useRef(DH.status);YL.default.useEffect(()=>{let IL=RB.current;if(RB.current=DH.status,IL==="searching"&&DH.status==="results"){if(Q&&$$.length>0)QH($$[0]);else if(!Q&&f$.length>0){let qA=f$[0];QH({id:"0",value:{log:qA,indexInFiltered:0},label:""})}}},[DH.status,Q,$$,f$]);let sA=YL.default.useCallback((IL)=>{let qA=parseInt(IL,10),BB=f$[qA];if(!BB||OH.current===qA.toString())return;OH.current=qA.toString(),QH({id:qA.toString(),value:{log:BB,indexInFiltered:qA},label:""}),t(qA+1)},[f$]),_D=YL.default.useCallback((IL)=>{QH(IL);let qA=f$.findIndex((BB)=>mM(BB)===mM(IL.value.log));if(qA>=0)t(qA+1)},[f$]);BA("confirm:no",()=>{YH.current?.abort(),EH({status:"idle"}),c("tengu_agentic_search_cancelled",{})},{context:"Confirmation",isActive:IH!=="preview"&&DH.status==="searching"}),BA("confirm:no",()=>{KH("list"),n("")},{context:"Settings",isActive:IH==="rename"&&DH.status!=="searching"}),BA("confirm:no",()=>{bH(""),FH(!1),L?.()},{context:"Confirmation",isActive:IH!=="preview"&&IH!=="rename"&&IH!=="search"&&$H&&DH.status!=="searching"}),WL((IL,qA)=>{if(IH==="preview")return;if(DH.status==="searching")return;if(IH==="rename");else if(IH==="search"){if(IL.toLowerCase()==="n"&&qA.ctrl)HI();else if(qA.return||qA.downArrow)qH.trim()}else{if($H){if(qA.return){qB(),FH(!1);return}else if(qA.downArrow){FH(!1);return}else if(qA.upArrow){KH("search"),FH(!1);return}}if(rH&&qA.tab){let GD=qA.shift?-1:1;e((C9)=>{let V1=(C9+G$.length+GD)%G$.length,G8=G$[V1];return c("tengu_session_tag_filter_changed",{is_all:G8==="All",tag_count:iA.length}),V1});return}let BB=!qA.ctrl&&!qA.meta,WB=IL.toLowerCase();if(WB==="a"&&qA.ctrl&&M)M(),c("tengu_session_all_projects_toggled",{enabled:!E});else if(WB==="b"&&qA.ctrl){let GD=!j;u(GD),c("tengu_session_branch_filter_toggled",{enabled:GD})}else if(WB==="w"&&qA.ctrl&&h){let GD=!y;g(GD),c("tengu_session_worktree_filter_toggled",{enabled:GD})}else if(WB==="/"&&BB)KH("search"),c("tengu_session_search_toggled",{enabled:!0});else if(WB==="r"&&qA.ctrl&&x$)KH("rename"),n(""),c("tengu_session_rename_started",{});else if(WB==="v"&&qA.ctrl&&x$)CH(x$),KH("preview"),c("tengu_session_preview_opened",{messageCount:x$.messageCount});else if(x$&&BB&&IL.length>0&&!/^\s+$/.test(IL))KH("search"),bH(IL),c("tengu_session_search_toggled",{enabled:!0})}},{isActive:!0});let M9=[];if(j&&q)M9.push(q);if(h&&!y)M9.push("current worktree");let QI=8+(M9.length>0&&IH!=="search"?1:0)+n$,DB=2,G9=Math.max(1,Math.floor(($-QI-DB)/3));if(YL.default.useEffect(()=>{if(!B)return;let IL=G9*2;if(TH+IL>=f$.length)B(G9*3)},[TH,G9,f$.length,B]),H.length===0)return null;if(IH==="preview"&&MH&&Q)return YL.default.createElement(vmD,{log:MH,onExit:()=>{KH("list"),CH(null)},onSelect:I});return YL.default.createElement(x,{flexDirection:"column",height:$-1},YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,{color:"suggestion"},"\u2500".repeat(X))),YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,null," ")),rH?YL.default.createElement(pmD,{tabs:G$,selectedIndex:LH,availableWidth:X,showAllProjects:E}):YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,{bold:!0,color:"suggestion"},"Resume Session",IH==="list"&&f$.length>G9&&YL.default.createElement(V,{dimColor:!0}," ","(",TH," of ",f$.length,")"))),YL.default.createElement(fb,{query:qH,isFocused:IH==="search",isTerminalFocused:F,cursorOffset:hH}),M9.length>0&&IH!=="search"&&YL.default.createElement(x,{flexShrink:0,paddingLeft:2},YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,M9))),YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,null," ")),DH.status==="searching"&&YL.default.createElement(x,{paddingLeft:1,flexShrink:0},YL.default.createElement(vD,null),YL.default.createElement(V,null," Searching\u2026")),DH.status==="results"&&DH.results.length>0&&YL.default.createElement(x,{paddingLeft:1,marginBottom:1,flexShrink:0},YL.default.createElement(V,{dimColor:!0,italic:!0},"Claude found these results:")),DH.status==="results"&&DH.results.length===0&&_H.length===0&&YL.default.createElement(x,{paddingLeft:1,marginBottom:1,flexShrink:0},YL.default.createElement(V,{dimColor:!0,italic:!0},"No matching sessions found.")),DH.status==="error"&&_H.length===0&&YL.default.createElement(x,{paddingLeft:1,marginBottom:1,flexShrink:0},YL.default.createElement(V,{dimColor:!0,italic:!0},"No matching sessions found.")),Boolean(qH.trim())&&G&&!1,DH.status==="searching"?null:IH==="rename"&&x$?YL.default.createElement(x,{paddingLeft:2,flexDirection:"column"},YL.default.createElement(V,{bold:!0},"Rename session:"),YL.default.createElement(x,{paddingTop:1},YL.default.createElement(W9,{value:k,onChange:n,onSubmit:gA,placeholder:Fl(x$,"Enter new session name"),columns:X,cursorOffset:GH,onChangeCursorOffset:HH,showCursor:!0}))):Q?YL.default.createElement(wgD,{nodes:$$,onSelect:(IL)=>{I(IL.value.log)},onFocus:_D,onCancel:L,focusNodeId:wH?.id,visibleOptionCount:G9,layout:"expanded",isDisabled:IH==="search"||$H,hideIndexes:!1,isNodeExpanded:(IL)=>{if(IH==="search"||j)return!0;let qA=typeof IL==="string"&&IL.startsWith("group:")?IL.substring(6):null;return qA?BH.has(qA):!1},onExpand:(IL)=>{let qA=typeof IL==="string"&&IL.startsWith("group:")?IL.substring(6):null;if(qA)WH((BB)=>new Set([...BB,qA])),c("tengu_session_group_expanded",{})},onCollapse:(IL)=>{let qA=typeof IL==="string"&&IL.startsWith("group:")?IL.substring(6):null;if(qA)WH((BB)=>{let WB=new Set(BB);return WB.delete(qA),WB})},onUpFromFirstItem:AI}):YL.default.createElement(QA,{options:e$,onChange:(IL)=>{let qA=parseInt(IL,10),BB=f$[qA];if(BB)I(BB)},visibleOptionCount:G9,onCancel:L,onFocus:sA,defaultFocusValue:wH?.id.toString(),layout:"expanded",isDisabled:IH==="search"||$H,onUpFromFirstItem:AI}),YL.default.createElement(x,{paddingLeft:2},J.pending?YL.default.createElement(V,{dimColor:!0},"Press ",J.keyName," again to exit"):IH==="rename"?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(s$,{shortcut:"Enter",action:"save"}),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))):DH.status==="searching"?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(V,null,"Searching with Claude\u2026"),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))):$H?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(s$,{shortcut:"Enter",action:"search"}),YL.default.createElement(s$,{shortcut:"\u2193",action:"skip"}),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))):IH==="search"?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(V,null,"Type to Search"),YL.default.createElement(s$,{shortcut:"Enter",action:"select"}),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"clear"}))):YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,M&&YL.default.createElement(s$,{shortcut:"Ctrl+A",action:`show ${E?"current dir":"all projects"}`}),q&&YL.default.createElement(s$,{shortcut:"Ctrl+B",action:"toggle branch"}),h&&YL.default.createElement(s$,{shortcut:"Ctrl+W",action:`show ${y?"current worktree":"all worktrees"}`}),YL.default.createElement(s$,{shortcut:"Ctrl+V",action:"preview"}),YL.default.createElement(s$,{shortcut:"Ctrl+R",action:"rename"}),YL.default.createElement(V,null,"Type to search"),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}),zA()&&YL.default.createElement(V,null,zA())))))}function J31(H){if(H.type!=="user"&&H.type!=="assistant")return"";let $="message"in H?H.message?.content:void 0;if(!$)return"";if(typeof $==="string")return $;if(Array.isArray($))return $.map((A)=>{if(typeof A==="string")return A;if("text"in A&&typeof A.text==="string")return A.text;return""}).filter(Boolean).join(" ");return""}function F31(H){let A=(H.messages.length<=E31?H.messages:[...H.messages.slice(0,cmD),...H.messages.slice(-cmD)]).map(J31).filter(Boolean).join(" "),I=`${[H.customTitle,H.summary,H.firstPrompt,H.gitBranch,H.tag,H.prNumber?`PR #${H.prNumber}`:void 0,H.prRepository].filter(Boolean).join(" ")} ${A}`.trim();return I.length>lmD?I.slice(0,lmD):I}function K31(H){let $=new Map;for(let A of H){let L=mM(A);if(L){let I=$.get(L);if(I)I.push(A);else $.set(L,[A])}}return $.forEach((A)=>A.sort((L,I)=>new Date(I.modified).getTime()-new Date(L.modified).getTime())),$}function Q31(H){let $=new Set;for(let A of H)if(A.tag)$.add(A.tag);return Array.from($).sort((A,L)=>A.localeCompare(L))}var YL,B31=2,f31=4,E31=2000,cmD=1000,lmD=50000,M31=0.3,G31=60000,U31=50;var eyA=K(()=>{zgH();r0();xH();$I();Ky();Cn();JM();OB();rB();Q9();N1();ZgD();UM();t8();qmH();g$();S5();rB();g$();z$();hmD();_$();eB();lB();j0();dmD();VVH();PVH();YL=b(s(),1)});function OT$(H,$,A){let L=zL();if(!$||!H.projectPath||H.projectPath===L)return{isCrossProject:!1};{let f=mM(H);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${wI([H.projectPath])} && claude --resume ${f}`,projectPath:H.projectPath}}if(A.some((f)=>H.projectPath===f||H.projectPath.startsWith(f+"/")))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:H.projectPath};let D=mM(H);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${wI([H.projectPath])} && claude --resume ${D}`,projectPath:H.projectPath}}var HvA=K(()=>{g$();rB();EX()});function V31(H){if(H.type!=="user"&&H.type!=="assistant")return"";let $="message"in H?H.message?.content:void 0;if(!$)return"";if(typeof $==="string")return $;if(Array.isArray($))return $.map((A)=>{if(typeof A==="string")return A;if("text"in A&&typeof A.text==="string")return A.text;return""}).filter(Boolean).join(" ");return""}function amD(H){if(H.length===0)return"";let A=(H.length<=$vA?H:[...H.slice(0,$vA/2),...H.slice(-$vA/2)]).map(V31).filter(Boolean).join(" ").replace(/\s+/g," ").trim();return A.length>nmD?A.slice(0,nmD)+"\u2026":A}function rmD(H,$){if(Fl(H).toLowerCase().includes($))return!0;if(H.customTitle?.toLowerCase().includes($))return!0;if(H.tag?.toLowerCase().includes($))return!0;if(H.gitBranch?.toLowerCase().includes($))return!0;if(H.summary?.toLowerCase().includes($))return!0;if(H.firstPrompt?.toLowerCase().includes($))return!0;if(H.messages&&H.messages.length>0){if(amD(H.messages).toLowerCase().includes($))return!0}return!1}async function xT$(H,$,A){if(!H.trim()||$.length===0)return[];let L=H.toLowerCase(),I=$.filter((G)=>rmD(G,L)),D;if(I.length>=AvA)D=I.slice(0,AvA);else{let G=$.filter((X)=>!rmD(X,L)),U=AvA-I.length;D=[...I,...G.slice(0,U)]}N(`Agentic search: ${D.length}/${$.length} logs, query="${H}", matching: ${I.length}, with messages: ${D.filter((G)=>G.messages?.length>0).length}`);let B=D.map(async(G)=>{if(Qz(G))try{return await cS(G)}catch(U){return r(U),G}return G}),f=await Promise.all(B);N(`Agentic search: loaded ${f.filter((G)=>G.messages?.length>0).length}/${D.length} logs with transcripts`);let M=`Sessions: `}]}})});var ApD={};XA(ApD,{call:()=>w31});function C31({onDone:H}){let $=J$((B)=>B.remoteSessionUrl),[A,L]=RT$.useState("");if(RT$.useEffect(()=>{if(!$)return;let B=$;async function f(){let E=await $pD.toString(B,{type:"utf8",errorCorrectionLevel:"L"});L(E)}f().catch((E)=>{N("QR code generation failed",E)})},[$]),BA("confirm:no",H,{context:"Confirmation"}),!$)return WM.createElement(x,{flexDirection:"column",paddingX:2},WM.createElement(V,{color:"warning"},"Not in remote mode. Start with `claude --remote` to use this command."),WM.createElement(V,{dimColor:!0},"(press esc to close)"));let I=A.split(` `).filter((B)=>B.length>0),D=I.length===0;return WM.createElement(x,{flexDirection:"column",paddingX:2},WM.createElement(x,{marginBottom:1},WM.createElement(V,{bold:!0},"Remote session")),D?WM.createElement(V,{dimColor:!0},"Generating QR code\u2026"):I.map((B,f)=>WM.createElement(V,{key:f},B)),WM.createElement(x,{marginTop:1},WM.createElement(V,{dimColor:!0},"Open in browser: "),WM.createElement(V,{color:"ide"},$)),WM.createElement(x,{marginTop:1},WM.createElement(V,{dimColor:!0},"(press esc to close)")))}var WM,RT$,$pD,w31=async(H)=>{return WM.createElement(C31,{onDone:H})};var LpD=K(()=>{xH();pL();E$();$I();WM=b(s(),1),RT$=b(s(),1),$pD=b(OyA(),1)});var Z31,BvA;var IpD=K(()=>{g$();Z31={type:"local-jsx",name:"session",aliases:["remote"],description:"Show remote session URL and QR code",isEnabled:()=>ZHH(),get isHidden(){return!ZHH()},load:()=>Promise.resolve().then(() => (LpD(),ApD)),userFacingName(){return"session"}},BvA=Z31});var DpD=()=>{};function q31(H){if(H==="plugin")return"Plugin skills";return`${Fk(Vl(H))} skills`}function BpD({onExit:H,commands:$}){let A=fvA.useMemo(()=>{return $.filter((f)=>f.type==="prompt"&&(f.loadedFrom==="skills"||f.loadedFrom==="commands_DEPRECATED"||f.loadedFrom==="plugin"))},[$]),L=fvA.useMemo(()=>{let f={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[]};for(let E of A){let M=E.source;if(M in f)f[M].push(E)}for(let E of Object.values(f))E.sort((M,G)=>R6H(G)-R6H(M));return f},[A]),I=()=>{H("Skills dialog dismissed",{display:"system"})};if(A.length===0)return PE.createElement(BL,{title:"Skills",subtitle:"No skills found",onCancel:I,hideInputGuide:!0},PE.createElement(V,{dimColor:!0},"Create skills in .claude/skills/ or ~/.claude/skills/"),PE.createElement(V,{dimColor:!0,italic:!0},PE.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"close"})));let D=(f)=>{let E=R6H(f),M=H_I(E),G=f.source==="plugin"?f.pluginInfo?.pluginManifest.name:void 0;return PE.createElement(x,{key:`${f.name}-${f.source}`},PE.createElement(V,null,f.userFacingName()),PE.createElement(V,{dimColor:!0},G?` \xB7 ${G}`:""," \xB7 ",M," description tokens"))},B=(f)=>{let E=L[f];if(E.length===0)return null;let M=q31(f),G=V9(Tt(f,"skills")),U=V9(Tt(f,"commands")),X=E.some((J)=>J.loadedFrom==="commands_DEPRECATED");return PE.createElement(x,{flexDirection:"column",key:f},PE.createElement(x,null,PE.createElement(V,{bold:!0,dimColor:!0},M),G&&PE.createElement(V,{dimColor:!0}," ","(",G,X&&U?`, ${U}`:"",")")),E.map((J)=>D(J)))};return PE.createElement(BL,{title:"Skills",subtitle:`${A.length} skill${A.length===1?"":"s"}`,onCancel:I,hideInputGuide:!0},PE.createElement(x,{flexDirection:"column",gap:1},B("projectSettings"),B("userSettings"),B("policySettings"),B("plugin")),PE.createElement(V,{dimColor:!0,italic:!0},PE.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"close"})))}var PE,fvA;var fpD=K(()=>{xH();eYH();bB();j0();W4();$3();rD();zt();PE=b(s(),1),fvA=b(s(),1)});var EpD={};XA(EpD,{call:()=>T31});async function T31(H,$){return EvA.createElement(BpD,{onExit:H,commands:$.options.commands})}var EvA;var MpD=K(()=>{fpD();EvA=b(s(),1)});var z31,GpD;var UpD=K(()=>{z31={type:"local-jsx",name:"skills",description:"List available skills",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (MpD(),EpD)),userFacingName(){return"skills"}},GpD=z31});var XpD={};XA(XpD,{call:()=>N31});async function N31(H,$){return MvA.createElement(YVH,{onClose:H,context:$,defaultTab:"Status"})}var MvA;var JpD=K(()=>{Wq$();MvA=b(s(),1)});var O31,FpD;var KpD=K(()=>{O31={type:"local-jsx",name:"status",description:"Show Claude Code status including version, model, account, API connectivity, and tool statuses",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (JpD(),XpD)),userFacingName(){return"status"}},FpD=O31});function QpD({shell:H,onDone:$,onKillShell:A,onBack:L}){let{columns:I}=QL(),[D,B]=pmH.useState(0),[f,E]=pmH.useState({stdout:"",stdoutLines:0}),M=()=>$("Shell details dismissed",{display:"system"});bI({"confirm:yes":M},{context:"Confirmation"}),WL((X,J)=>{if(X===" ")$("Shell details dismissed",{display:"system"});else if(J.leftArrow&&L)L();else if(X==="k"&&H.status==="running"&&A)A()});let G=(X)=>{let J=Math.floor((Date.now()-X)/1000),F=Math.floor(J/3600),Q=Math.floor((J-F*3600)/60),W=J-F*3600-Q*60;return`${F>0?`${F}h `:""}${Q>0||F>0?`${Q}m `:""}${W}s`};pmH.useEffect(()=>{let X=WF$(H.id),{totalLines:J,truncatedContent:F}=Mw$(X);if(E({stdout:F,stdoutLines:J}),H.status==="running"){let Q=setTimeout(()=>{B((W)=>W+1)},1000);return()=>clearTimeout(Q)}},[H.id,H.status,D]);let U=H.command.length>280?H.command.substring(0,277)+"\u2026":H.command;return L4.default.createElement(BL,{title:"Shell details",onCancel:M,color:"background",borderDimColor:!1,inputGuide:(X)=>X.pending?L4.default.createElement(V,null,"Press ",X.keyName," again to exit"):L4.default.createElement(rA,null,L&&L4.default.createElement(s$,{shortcut:"\u2190",action:"go back"}),L4.default.createElement(s$,{shortcut:"Esc/Enter/Space",action:"close"}),H.status==="running"&&A&&L4.default.createElement(s$,{shortcut:"k",action:"kill"}))},L4.default.createElement(x,{flexDirection:"column"},L4.default.createElement(V,null,L4.default.createElement(V,{bold:!0},"Status:")," ",H.status==="running"?L4.default.createElement(V,{color:"background"},H.status,H.result?.code!==void 0&&` (exit code: ${H.result.code})`):H.status==="completed"?L4.default.createElement(V,{color:"success"},H.status,H.result?.code!==void 0&&` (exit code: ${H.result.code})`):L4.default.createElement(V,{color:"error"},H.status,H.result?.code!==void 0&&` (exit code: ${H.result.code})`)),L4.default.createElement(V,null,L4.default.createElement(V,{bold:!0},"Runtime:")," ",G(H.startTime)),L4.default.createElement(V,{wrap:"wrap"},L4.default.createElement(V,{bold:!0},"Command:")," ",U)),L4.default.createElement(x,{flexDirection:"column"},L4.default.createElement(V,{bold:!0},"Output:"),f.stdout?L4.default.createElement(L4.default.Fragment,null,L4.default.createElement(x,{borderStyle:"round",borderDimColor:!0,paddingX:1,flexDirection:"column",height:12,maxWidth:I-6},f.stdout.split(` Your final reply must contain the markdown report and nothing else.`,mpD;var ppD=K(()=>{qKH();Vu();Vm();yE();mpD=tVH({name:"security-review",description:"Complete a security review of the pending changes on the current branch",progressMessage:"analyzing code changes for security risks",pluginName:"security-review",pluginCommand:"security-review",async getPromptWhileMarketplaceIsPrivate(H,$){yD("security-review");let A=MK(d31),L=xx(A.frontmatter["allowed-tools"]);return[{type:"text",text:await Qa(A.content,{...$,async getAppState(){let D=await $.getAppState();return{...D,toolPermissionContext:{...D.toolPermissionContext,alwaysAllowRules:{...D.toolPermissionContext.alwaysAllowRules,command:L}}}}},"security-review")}]}})});var dpD={};XA(dpD,{call:()=>c31});var FvA,c31=async(H,$)=>{return FvA.createElement(YVH,{onClose:H,context:$,defaultTab:"Usage"})};var cpD=K(()=>{Wq$();FvA=b(s(),1)});var KvA;var lpD=K(()=>{KvA={type:"local-jsx",name:"usage",description:"Show plan usage limits",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (cpD(),dpD)),userFacingName(){return"usage"}}});var ipD={};XA(ipD,{call:()=>i31});function l31({onDone:H}){let[$,A]=_I();return Wd.createElement(x,{flexDirection:"column"},Wd.createElement(Uf,{dividerColor:"permission",dividerDimColor:!0}),Wd.createElement(QVH,{initialTheme:$,onThemeSelect:(L)=>{A(L),H(`Theme set to ${L}`)},onCancel:()=>{H("Theme picker dismissed",{display:"system"})},skipExitHandling:!0}))}var Wd,i31=async(H,$)=>{return Wd.createElement(l31,{onDone:H})};var npD=K(()=>{xH();Mq$();e6();Wd=b(s(),1)});var n31,QvA;var rpD=K(()=>{n31={type:"local-jsx",name:"theme",description:"Change the theme",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (npD(),ipD)),userFacingName(){return"theme"}},QvA=n31});var apD={};XA(apD,{call:()=>r31});var r31=async()=>{yD("vim-mode");let $=M$().editorMode||"normal";if($==="emacs")$="normal";let A=$==="normal"?"vim":"normal";return AA((L)=>({...L,editorMode:A})),c("tengu_editor_mode_changed",{mode:A,source:"command"}),{type:"text",value:`Editor mode set to ${A}. ${A==="vim"?"Use Escape key to toggle between INSERT and NORMAL modes.":"Using standard (readline) keyboard bindings."}`}};var opD=K(()=>{vA();z$();yE()});var a31,WvA;var tpD=K(()=>{a31={name:"vim",description:"Toggle between Vim and Normal editing modes",isEnabled:()=>!0,isHidden:!1,supportsNonInteractive:!1,type:"local",userFacingName:()=>"vim",load:()=>Promise.resolve().then(() => (opD(),apD))},WvA=a31});var VvA,r1H="claude-plugins-official";var hT$=K(()=>{VvA={source:"github",repo:"anthropics/claude-plugins-official"}});var $dD={};XA($dD,{playAnimation:()=>bT$,call:()=>fV1});function epD(){return r1H}function t31(){return o31}function HdD(){return`thinkback@${epD()}`}async function e31(){let{enabled:H}=await xf(),$=H.find((L)=>L.name==="thinkback"||L.source&&L.source.includes(HdD()));if(!$)return null;let A=IPH.join($.path,"skills",s31);if(DPH.existsSync(A))return A;return null}async function HV1(){return e31()}function bT$(H){let $=IPH.join(H,"player.js");if(!DPH.existsSync($))return{success:!1,message:"Player script not found. The player.js file is missing from the thinkback skill."};let A=qO.get(process.stdout);if(!A)return{success:!1,message:"Failed to access terminal instance"};try{A.pause(),A.suspendStdin(),process.stdout.write("\x1B[?1049h\x1B[?1004l\x1B[0m\x1B[?25l\x1B[2J\x1B[H"),spD.execFileSync("node",[$],{stdio:"inherit",cwd:H})}catch{}finally{process.stdout.write("\x1B[?1049l\x1B[?1004h\x1B[?25l"),A.resumeStdin(),A.resume()}let L=IPH.join(H,"year_in_review.html");if(DPH.existsSync(L)){let I=oA();jA(I==="macos"?"open":I==="windows"?"start":"xdg-open",[L])}return{success:!0,message:"Year in review animation complete!"}}function $V1({onReady:H,onError:$}){let[A,L]=_C.useState({phase:"checking"}),[I,D]=_C.useState("");if(_C.useEffect(()=>{async function f(){try{let E=await l1(),M=epD(),G=t31(),U=HdD(),X=M in E,J=K7(U);if(!X)L({phase:"installing-marketplace"}),N(`Installing marketplace ${G}`),await uw({source:"github",repo:G},(F)=>{D(F)}),SG(),N(`Marketplace ${M} installed`);else if(!J)L({phase:"installing-marketplace"}),D("Updating marketplace\u2026"),N(`Refreshing marketplace ${M}`),await gt(M,(F)=>{D(F)}),X3H(),SG(),N(`Marketplace ${M} refreshed`);if(!J){L({phase:"installing-plugin"}),N(`Installing plugin ${U}`);let F=await jRA([U]);if(F.failed.length>0){let Q=F.failed.map((W)=>`${W.name}: ${W.error}`).join(", ");throw Error(`Failed to install plugin: ${Q}`)}SG(),N(`Plugin ${U} installed`)}else{let{disabled:F}=await xf();if(F.some((W)=>W.name==="thinkback"||W.source?.includes(U))){L({phase:"enabling-plugin"}),N(`Enabling plugin ${U}`);let W=await R1H(U);if(!W.success)throw Error(`Failed to enable plugin: ${W.message}`);SG(),N(`Plugin ${U} enabled`)}}L({phase:"ready"}),H()}catch(E){let M=E instanceof Error?E:Error(String(E));r(M),L({phase:"error",message:M.message}),$(M.message)}}f()},[H,$]),A.phase==="error")return L1.createElement(x,{flexDirection:"column"},L1.createElement(V,{color:"error"},"Error: ",A.message));if(A.phase==="ready")return null;let B=A.phase==="checking"?"Checking thinkback installation\u2026":A.phase==="installing-marketplace"?"Installing marketplace\u2026":A.phase==="enabling-plugin"?"Enabling thinkback plugin\u2026":"Installing thinkback plugin\u2026";return L1.createElement(x,{flexDirection:"column"},L1.createElement(x,null,L1.createElement(vD,null),L1.createElement(V,null,I||B)))}function AV1({onDone:H,onAction:$,skillDir:A}){let[L,I]=_C.useState(!1),D=IPH.join(A,"year_in_review.js"),B=DPH.existsSync(D),f=B?[{label:"Play animation",value:"play",description:"Watch your year in review"},{label:"Edit content",value:"edit",description:"Modify the animation"},{label:"Fix errors",value:"fix",description:"Fix validation or rendering issues"},{label:"Regenerate",value:"regenerate",description:"Create a new animation from scratch"}]:[{label:"Let's go!",value:"regenerate",description:"Generate your personalized animation"}];function E(G){if(I(!0),G==="play")bT$(A),H(void 0,{display:"skip"});else $(G)}function M(){H(void 0,{display:"skip"})}if(L)return null;return L1.createElement(BL,{title:"Think Back on 2025 with Claude Code",subtitle:"Generate your 2025 Claude Code Think Back (takes a few minutes to run)",onCancel:M,color:"claude",borderDimColor:!1},L1.createElement(x,{flexDirection:"column",gap:1},!B&&L1.createElement(x,{flexDirection:"column"},L1.createElement(V,null,"Relive your year of coding with Claude."),L1.createElement(V,{dimColor:!0},"We'll create a personalized ASCII animation celebrating your journey.")),L1.createElement(QA,{options:f,onChange:E,visibleOptionCount:5})))}function BV1({onDone:H}){let[$,A]=_C.useState(!1),[L,I]=_C.useState(null),[D,B]=_C.useState(null),[f,E]=_C.useState(null);function M(){A(!0)}let G=_C.useCallback((X)=>{I(X),H(`Error with thinkback: ${X}. Try running /plugin to manually install the think-back plugin.`,{display:"system"})},[H]);_C.useEffect(()=>{if($&&!D&&!L)HV1().then((X)=>{if(X)N(`Thinkback skill directory: ${X}`),B(X);else G("Could not find thinkback skill directory")})},[$,D,L,G]),_C.useEffect(()=>{if(!D)return;let X=IPH.join(D,"year_in_review.js"),J=DPH.existsSync(X);N(`Checking for ${X}: ${J?"found":"not found"}`),E(J)},[D]);function U(X){H({edit:LV1,fix:IV1,regenerate:DV1}[X],{display:"user",shouldQuery:!0})}if(L)return L1.createElement(x,{flexDirection:"column"},L1.createElement(V,{color:"error"},"Error: ",L),L1.createElement(V,{dimColor:!0},"Try running /plugin to manually install the think-back plugin."));if(!$)return L1.createElement($V1,{onReady:M,onError:G});if(!D||f===null)return L1.createElement(x,null,L1.createElement(vD,null),L1.createElement(V,null,"Loading thinkback skill\u2026"));return L1.createElement(AV1,{onDone:H,onAction:U,skillDir:D})}async function fV1(H){return L1.createElement(BV1,{onDone:H})}var L1,_C,spD,IPH,DPH,o31="anthropics/claude-plugins-official",s31="thinkback",LV1='Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Claude Code year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.',IV1='Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Claude Code year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.',DV1='Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Claude Code year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.';var PvA=K(()=>{xH();bB();d5H();Z9();B0();N1();y4();Q7();uVH();_X();pVH();Vz();JM();E$();_$();hT$();L1=b(s(),1),_C=b(s(),1),spD=require("child_process"),IPH=require("path"),DPH=require("fs")});var EV1,AdD;var LdD=K(()=>{SD();EV1={type:"local-jsx",name:"think-back",description:"Your 2025 Claude Code Year in Review",isEnabled:()=>cf("tengu_thinkback"),isHidden:!1,load:()=>Promise.resolve().then(() => (PvA(),$dD)),userFacingName(){return"think-back"}},AdD=EV1});var DdD={};XA(DdD,{call:()=>UV1});function GV1(){return`thinkback@${r1H}`}async function UV1(){let H=F7(),$=GV1(),A=H.plugins[$];if(!A||A.length===0)return{type:"text",value:"Thinkback plugin not installed. Run /think-back first to install it."};let L=A[0];if(!L?.installPath)return{type:"text",value:"Thinkback plugin installation path not found."};let I=_vA.join(L.installPath,"skills",MV1),D=_vA.join(I,"year_in_review.js");if(!IdD.existsSync(D))return{type:"text",value:"No animation found. Run /think-back first to generate one."};return{type:"text",value:bT$(I).message}}var _vA,IdD,MV1="thinkback";var BdD=K(()=>{PvA();Q7();hT$();_vA=require("path"),IdD=require("fs")});var XV1,fdD;var EdD=K(()=>{SD();XV1={type:"local",name:"thinkback-play",description:"Play the thinkback animation",isEnabled:()=>cf("tengu_thinkback"),isHidden:!0,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (BdD(),DdD)),userFacingName(){return"thinkback-play"}},fdD=XV1});function MdD({onCancel:H,onSubmit:$,ruleBehavior:A}){let[L,I]=YvA.useState(""),[D,B]=YvA.useState(0),f=zB();BA("confirm:no",H,{context:"Settings"});let{columns:E}=QL(),M=E-6,G=(U)=>{let X=U.trim();if(X.length===0)return;let J=T6(X);$(J,A)};return IE.createElement(IE.Fragment,null,IE.createElement(x,{flexDirection:"column",gap:1,borderStyle:"round",paddingLeft:1,paddingRight:1,borderColor:"permission"},IE.createElement(V,{bold:!0,color:"permission"},"Add ",A," permission rule"),IE.createElement(x,{flexDirection:"column"},IE.createElement(V,null,"Permission rules are a tool name, optionally followed by a specifier in parentheses.",IE.createElement(_K,null),"e.g.,"," ",IE.createElement(V,{bold:!0},X8({toolName:IW.name})),IE.createElement(V,{bold:!1}," or "),IE.createElement(V,{bold:!0},X8({toolName:aD.name,ruleContent:"ls:*"}))),IE.createElement(x,{borderDimColor:!0,borderStyle:"round",marginY:1,paddingLeft:1},IE.createElement(W9,{showCursor:!0,value:L,onChange:I,onSubmit:G,placeholder:`Enter permission rule${pH.ellipsis}`,columns:M,cursorOffset:D,onChangeCursorOffset:B})))),IE.createElement(x,{marginLeft:3},f.pending?IE.createElement(V,{dimColor:!0},"Press ",f.keyName," again to exit"):IE.createElement(V,{dimColor:!0},"Enter to submit \xB7 Esc to cancel")))}var IE,YvA;var GdD=K(()=>{xH();$I();UM();OB();s6H();zQ();S5();jI();IE=b(s(),1),YvA=b(s(),1)});function XdD({onExit:H,getToolPermissionContext:$,onRequestAddDirectory:A,onRequestRemoveDirectory:L}){let I=$(),D=YC.useMemo(()=>{return Array.from(I.additionalWorkingDirectories.keys()).map((E)=>({path:E,isCurrent:!1,isDeletable:!0}))},[I.additionalWorkingDirectories]),B=UdD.useCallback((E)=>{if(E==="add-directory"){A();return}let M=D.find((G)=>G.path===E);if(M&&M.isDeletable)L(M.path)},[D,A,L]),f=YC.useMemo(()=>{let E=D.map((M)=>({label:M.path,value:M.path}));return E.push({label:`Add directory${pH.ellipsis}`,value:"add-directory"}),E},[D]);return YC.createElement(x,{flexDirection:"column",marginBottom:1},YC.createElement(x,{flexDirection:"row",marginTop:1,marginLeft:2,gap:1},YC.createElement(V,null,`- ${zL()}`),YC.createElement(V,{dimColor:!0},"(Original working directory)")),YC.createElement(QA,{options:f,onChange:B,onCancel:()=>H("Workspace dialog dismissed",{display:"system"}),visibleOptionCount:Math.min(10,f.length)}))}var YC,UdD;var JdD=K(()=>{xH();N1();jI();g$();YC=b(s(),1),UdD=b(s(),1)});function FdD({directoryPath:H,onRemove:$,onCancel:A,permissionContext:L,setPermissionContext:I}){let D=zB();BA("confirm:no",A,{context:"Confirmation"});let B=CvA.useCallback(()=>{let E=OM(L,{type:"removeDirectories",directories:[H],destination:"session"});I(E),$()},[H,L,I,$]),f=CvA.useCallback((E)=>{if(E==="yes")B();else A()},[B,A]);return _U.createElement(_U.Fragment,null,_U.createElement(x,{flexDirection:"column",borderStyle:"round",paddingLeft:1,paddingRight:1,borderColor:"error"},_U.createElement(V,{bold:!0,color:"error"},"Remove directory from workspace?"),_U.createElement(x,{marginY:1,marginX:2,flexDirection:"column"},_U.createElement(V,{bold:!0},H)),_U.createElement(V,null,"Claude Code will no longer have access to files in this directory."),_U.createElement(x,{marginY:1},_U.createElement(QA,{onChange:f,onCancel:A,options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]}))),_U.createElement(x,{marginLeft:3},D.pending?_U.createElement(V,{dimColor:!0},"Press ",D.keyName," again to exit"):_U.createElement(V,{dimColor:!0},"\u2191/\u2193 to select \xB7 Enter to confirm \xB7 Esc to cancel")))}var _U,CvA;var KdD=K(()=>{xH();UM();$I();N1();C5();_U=b(s(),1),CvA=b(s(),1)});function JV1({rule:H}){return bL.createElement(V,{dimColor:!0},`From ${vSH(H.source)}`)}function FV1(H){switch(H){case"allow":return"allowed";case"deny":return"denied";case"ask":return"ask"}}function KV1({rule:H,onDelete:$,onCancel:A}){let L=zB();BA("confirm:no",A,{context:"Confirmation"});let I=bL.createElement(x,{flexDirection:"column",marginX:2},bL.createElement(V,{bold:!0},X8(H.ruleValue)),bL.createElement(C4$,{ruleValue:H.ruleValue}),bL.createElement(JV1,{rule:H})),D=bL.createElement(x,{marginLeft:3},L.pending?bL.createElement(V,{dimColor:!0},"Press ",L.keyName," again to exit"):bL.createElement(V,{dimColor:!0},"Esc to cancel"));if(H.source==="policySettings")return bL.createElement(bL.Fragment,null,bL.createElement(x,{flexDirection:"column",gap:1,borderStyle:"round",paddingLeft:1,paddingRight:1,borderColor:"permission"},bL.createElement(V,{bold:!0,color:"permission"},"Rule details"),I,bL.createElement(V,{italic:!0},"This rule is configured by managed settings and cannot be modified.",` `));else H("Permissions dialog dismissed",{display:"system"})},lastFocusedRuleKey:M,onUpFromFirstItem:()=>Z(!0),cursorOffset:d})}return bL.createElement(x,{flexDirection:"column",flexShrink:0},bL.createElement(Zz,{title:"Permissions:",color:"permission",defaultTab:$,hidden:!!f||!!U||!!J||Q||!!P,disableNavigation:Y},bL.createElement(WU,{id:"allow",title:"Allow"},bL.createElement(x,{flexDirection:"column",flexShrink:0},bL.createElement(V,null,wH("allow")),QH("allow"))),bL.createElement(WU,{id:"ask",title:"Ask"},bL.createElement(x,{flexDirection:"column"},bL.createElement(V,null,wH("ask")),QH("ask"))),bL.createElement(WU,{id:"deny",title:"Deny"},bL.createElement(x,{flexDirection:"column"},bL.createElement(V,null,wH("deny")),QH("deny"))),bL.createElement(WU,{id:"workspace",title:"Workspace"},bL.createElement(x,{flexDirection:"column"},bL.createElement(V,null,wH("workspace")),QH("workspace")))),bL.createElement(x,{marginTop:1,paddingLeft:1},bL.createElement(V,{dimColor:!0},y.pending?bL.createElement(bL.Fragment,null,"Press ",y.keyName," again to exit"):bL.createElement(bL.Fragment,null,"Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Type to search \xB7 Esc to cancel"))))}var bL,dF;var WdD=K(()=>{xH();$I();N1();UM();XJ();jI();S5A();q4$();GdD();r0();JdD();rSA();KdD();C5();pL();J1H();VVH();PVH();Z$();bL=b(s(),1),dF=b(s(),1)});var PdD={};XA(PdD,{call:()=>WV1});var wvA,WV1=async(H)=>{return wvA.createElement(QdD,{onExit:H})};var _dD=K(()=>{WdD();wvA=b(s(),1)});var VV1,YdD;var CdD=K(()=>{VV1={type:"local-jsx",name:"permissions",aliases:["allowed-tools"],description:"Manage allow & deny tool permission rules",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (_dD(),PdD)),userFacingName(){return"permissions"}},YdD=VV1});var wdD={};XA(wdD,{call:()=>_V1});function PV1({planContent:H,planPath:$,editorName:A}){return vJ.createElement(x,{flexDirection:"column"},vJ.createElement(V,{bold:!0},"Current Plan"),vJ.createElement(V,{dimColor:!0},$),vJ.createElement(x,{marginTop:1},vJ.createElement(V,null,H)),A&&vJ.createElement(x,{marginTop:1},vJ.createElement(V,{dimColor:!0},'"/plan open"'),vJ.createElement(V,{dimColor:!0}," to edit this plan in "),vJ.createElement(V,{bold:!0,dimColor:!0},A)))}async function _V1(H,$,A){let{getAppState:L,setAppState:I}=$,B=(await L()).toolPermissionContext.mode;if(B!=="plan")return _N(B,"plan"),I((F)=>({...F,toolPermissionContext:OM(F.toolPermissionContext,{type:"setMode",mode:"plan",destination:"session"})})),H("Enabled plan mode"),null;let f=uQ(),E=VP();if(!f)return H("Already in plan mode. No plan written yet."),null;if(A.trim().split(/\s+/)[0]==="open")try{return await Mb(E),H(`Opened plan in editor: ${E}`),null}catch(F){return H(`Failed to open plan in editor: ${F}`),null}let G=Bj(),U=G?PX(G):void 0,J=await CVH(vJ.createElement(PV1,{planContent:f,planPath:E,editorName:U}));return H(J),null}var vJ;var ZdD=K(()=>{xH();gQ();Gb();nU();agH();C5();g$();vJ=b(s(),1)});var YV1,ZvA;var qdD=K(()=>{YV1={type:"local-jsx",name:"plan",description:"Enable plan mode or view the current session plan",argumentHint:"[open]",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (ZdD(),wdD)),userFacingName(){return"plan"}},ZvA=YV1});function TdD({cooldown:H}){if(H)return nmH.createElement(V,{color:"promptBorder",dimColor:!0},Ey);return nmH.createElement(V,{color:"penguin"},Ey)}function a1H(H=!0,$=!1){if(!H)return Ey;let A=M$().theme;if($)return oH.dim(ZL("promptBorder",A)(Ey));return ZL("penguin",A)(Ey)}var nmH;var qvA=K(()=>{r0();xH();Cn();vA();p6();nmH=b(s(),1)});var OdD={};XA(OdD,{call:()=>ZV1});function NdD(H,$){if(eAH(),II("userSettings",{fastMode:H?!0:void 0}),H)$((A)=>{let L=!UK(A.mainLoopModel);return{...A,...L?{mainLoopModel:YzH,mainLoopModelForSession:null}:{},fastMode:!0}});else $((A)=>({...A,fastMode:!1}))}function CV1({onDone:H,unavailableReason:$}){let A=J$((Y)=>Y.mainLoopModel),L=J$((Y)=>Y.fastMode),I=zI(),[D,B]=zdD.useState(L??!1),f=hDA(),E=f.status==="cooldown",M=$!==null,G=UK(A)&&(A??"").includes("[1m]"),U=o_(ALH(G,!0)),X=WO(),J=X?o_(G?rDA:nDA):null,F=X?` (${X.discountPercent}% off through ${X.endDate})`:"";function Q(){if(M)return;if(NdD(D,I),D){let Y=a1H(D),Z=!UK(A)?` \xB7 model set to ${VO}`:"";H(`${Y} Fast mode ON${Z} \xB7 ${U}${F}`)}else I((Y)=>({...Y,fastMode:!1})),H("Fast mode OFF")}function W(){let Y=L?`${a1H()} Kept Fast mode ON`:"Kept Fast mode OFF";H(Y,{display:"system"})}function P(){if(M)return;B((Y)=>!Y)}return bI({"confirm:yes":Q,"confirm:nextField":P,"confirm:next":P,"confirm:previous":P,"confirm:cycleMode":P,"confirm:toggle":P},{context:"Confirmation"}),h0.createElement(BL,{title:h0.createElement(V,null,h0.createElement(TdD,{cooldown:E})," Fast mode (research preview)"),subtitle:`High-speed mode for ${VO}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:W,color:"penguin",borderDimColor:!1,inputGuide:(Y)=>Y.pending?h0.createElement(V,null,"Press ",Y.keyName," again to exit"):M?h0.createElement(V,null,"Esc to cancel"):h0.createElement(V,null,"Tab to toggle \xB7 Enter to confirm \xB7 Esc to cancel")},$?h0.createElement(x,{marginLeft:2},h0.createElement(V,{color:"error"},$)):h0.createElement(h0.Fragment,null,h0.createElement(x,{flexDirection:"column",gap:0,marginLeft:2},h0.createElement(x,{flexDirection:"row",gap:2},h0.createElement(V,{bold:!0},"Fast mode"),h0.createElement(V,{color:D?"penguin":void 0,bold:D},D?"ON ":"OFF"),J?h0.createElement(h0.Fragment,null,h0.createElement(V,{dimColor:!0,strikethrough:!0},J),h0.createElement(V,{dimColor:!0},U,F)):h0.createElement(V,{dimColor:!0},U))),E&&f.status==="cooldown"&&h0.createElement(x,{marginLeft:2},h0.createElement(V,{color:"warning"},"You've hit your fast limit"," \xB7 resets in"," ",of(f.resetAt-Date.now(),{hideTrailingZeros:!0})))),h0.createElement(V,{dimColor:!0},"Learn more:"," ",h0.createElement(dI,{url:"https://code.claude.com/docs/en/fast-mode"},"https://code.claude.com/docs/en/fast-mode")))}async function wV1(H,$,A){let L=W9$();if(L)return`Fast mode unavailable: ${L}`;let{mainLoopModel:I}=await $();if(NdD(H,A),H){let D=a1H(!0),B=!UK(I)?` \xB7 model set to ${VO}`:"",f=UK(I)&&(I??"").includes("[1m]"),E=WO(),M=o_(ALH(f,!0)),G=E?` (${E.discountPercent}% off through ${E.endDate})`:"";return`${D} Fast mode ON${B} \xB7 ${M}${G}`}else return"Fast mode OFF"}async function ZV1(H,$,A){if(!cD())return null;let L=300;if(await Promise.race([V9$().then(()=>!1),new Promise((f)=>setTimeout(()=>f(!0),L))]))c("tengu_fast_mode_prefetch_timeout",{});let D=A?.trim().toLowerCase();if(D==="on"||D==="off"){let f=await wV1(D==="on",$.getAppState,$.setAppState);return H(f),null}let B=W9$();return h0.createElement(CV1,{onDone:H,unavailableReason:B})}var h0,zdD;var xdD=K(()=>{xH();pL();AJ();Q9();z$();qvA();bB();mL();$I();W5H();h0=b(s(),1),zdD=b(s(),1)});var qV1,SdD;var jdD=K(()=>{AJ();qV1={type:"local-jsx",name:"fast",get description(){return`Toggle fast mode (${VO} only)`},isEnabled:()=>cD(),get isHidden(){return!cD()},argumentHint:"[on|off]",userFacingName:()=>"fast",load:()=>Promise.resolve().then(() => (xdD(),OdD))},SdD=qV1});function RdD({onDone:H}){let[$,A]=Wb.useState(!0),[L,I]=Wb.useState([]),[D,B]=Wb.useState(!1),[f,E]=Wb.useState(null),[M,G]=Wb.useState(void 0),U=zB(()=>H("Guest passes dialog dismissed",{display:"system"})),X=Wb.useCallback(()=>{H("Guest passes dialog dismissed",{display:"system"})},[H]);if(BA("confirm:no",X,{context:"Confirmation"}),WL((W,P)=>{if(P.return&&f)(async()=>{if(await K3(f))c("tengu_guest_passes_link_copied",{}),H("Referral link copied to clipboard!");else H(dQH(),{display:"system"})})()}),Wb.useEffect(()=>{async function W(){try{let P=await jmH();if(!P||!P.eligible){B(!1),A(!1);return}if(B(!0),P.referral_code_details?.referral_link)E(P.referral_code_details.referral_link);G(P.referrer_reward);let C=P.referral_code_details?.campaign??"claude_code_guest_pass",Y;try{Y=await DmD(C)}catch(j){r(j),B(!1),A(!1);return}let Z=Y.redemptions||[],q=Y.limit||3,O=[];for(let j=0;jW.isAvailable).length,F=[...L].sort((W,P)=>+P.isAvailable-+W.isAvailable),Q=(W)=>{if(!W.isAvailable)return lI.createElement(x,{key:W.passNumber,flexDirection:"column",marginRight:1},lI.createElement(V,{dimColor:!0},"\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2571"),lI.createElement(V,{dimColor:!0}," ) CC \u273B \u250A\u2571"),lI.createElement(V,{dimColor:!0},"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2571"));return lI.createElement(x,{key:W.passNumber,flexDirection:"column",marginRight:1},lI.createElement(V,null,"\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),lI.createElement(V,null," ) CC ",lI.createElement(V,{color:"claude"},"\u273B")," \u250A ( "),lI.createElement(V,null,"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"))};return lI.createElement(x,{flexDirection:"column",marginTop:1,gap:1},lI.createElement(V,{color:"permission"},"Guest passes \xB7 ",J," left"),lI.createElement(x,{flexDirection:"row",marginLeft:2},F.slice(0,3).map((W)=>Q(W))),f&&lI.createElement(x,{marginLeft:2},lI.createElement(V,null,f)),lI.createElement(x,{flexDirection:"column",marginLeft:2},lI.createElement(V,{dimColor:!0},M?`Share a free week of Claude Code with friends. If they love it and subscribe, you'll get ${Rs(M)} of extra usage to keep building. `:"Share a free week of Claude Code with friends. ",lI.createElement(dI,{url:M?"https://support.claude.com/en/articles/13456702-claude-code-guest-passes":"https://support.claude.com/en/articles/12875061-claude-code-guest-passes"},"Terms apply."))),lI.createElement(x,null,lI.createElement(V,{dimColor:!0,italic:!0},U.pending?lI.createElement(lI.Fragment,null,"Press ",U.keyName," again to exit"):lI.createElement(lI.Fragment,null,"Enter to copy link \xB7 Esc to cancel"))))}var lI,Wb;var ydD=K(()=>{xH();$I();Jd();_$();z$();pm();UM();lI=b(s(),1),Wb=b(s(),1)});var vdD={};XA(vdD,{call:()=>TV1});async function TV1(H){let A=!M$().hasVisitedPasses;if(A){let L=ZT$();AA((I)=>({...I,hasVisitedPasses:!0,passesLastSeenRemaining:L??I.passesLastSeenRemaining}))}return c("tengu_guest_passes_visited",{is_first_visit:A}),TvA.createElement(RdD,{onDone:H})}var TvA;var hdD=K(()=>{ydD();vA();z$();Jd();TvA=b(s(),1)});var bdD;var kdD=K(()=>{Jd();bdD={type:"local-jsx",name:"passes",get description(){if(ys())return"Share a free week of Claude Code with friends and earn extra usage";return"Share a free week of Claude Code with friends"},isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (hdD(),vdD)),userFacingName(){return"passes"}}});function udD(H,$,A){if(!H.success||!$.success)return!1;let L=H.data,I=$.data;if(L.grove_enabled!==null)return!1;if(A)return!0;if(!I.notice_is_grace_period)return!0;let B=I.notice_reminder_frequency;if(B!==null&&L.grove_notice_viewed_at)return Math.floor((Date.now()-new Date(L.grove_notice_viewed_at).getTime())/86400000)>=B;else{let f=L.grove_notice_viewed_at;return f===null||f===void 0}}function NV1(){return iI.default.createElement(iI.default.Fragment,null,iI.default.createElement(V,null,"An update to our Consumer Terms and Privacy Policy will take effect on"," ",iI.default.createElement(V,{bold:!0},"October 8, 2025"),". You can accept the updated terms today."),iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,null,"What's changing?"),iI.default.createElement(x,{paddingLeft:1},iI.default.createElement(V,null,iI.default.createElement(V,null,"\u2022 "),iI.default.createElement(V,{bold:!0},"You can help improve Claude "),iI.default.createElement(V,null,"\u2014 Allow the use of your chats and coding sessions to train and improve Anthropic AI models. Change anytime in your Privacy Settings (",iI.default.createElement(dI,{url:"https://claude.ai/settings/data-privacy-controls"}),")."))),iI.default.createElement(x,{paddingLeft:1},iI.default.createElement(V,null,iI.default.createElement(V,null,"\u2022 "),iI.default.createElement(V,{bold:!0},"Updates to data retention "),iI.default.createElement(V,null,"\u2014 To help us improve our AI models and safety protections, we're extending data retention to 5 years.")))),iI.default.createElement(V,null,"Learn more (",iI.default.createElement(dI,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),") or read the updated Consumer Terms (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/terms"}),") and Privacy Policy (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/privacy"}),")"))}function OV1(){return iI.default.createElement(iI.default.Fragment,null,iI.default.createElement(V,null,"We've updated our Consumer Terms and Privacy Policy."),iI.default.createElement(x,{flexDirection:"column",gap:1},iI.default.createElement(V,null,"What's changing?"),iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,{bold:!0},"Help improve Claude"),iI.default.createElement(V,null,"Allow the use of your chats and coding sessions to train and improve Anthropic AI models. You can change this anytime in Privacy Settings"),iI.default.createElement(dI,{url:"https://claude.ai/settings/data-privacy-controls"})),iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,{bold:!0},"How this affects data retention"),iI.default.createElement(V,null,"Turning ON the improve Claude setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime."))),iI.default.createElement(V,null,"Learn more (",iI.default.createElement(dI,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),") or read the updated Consumer Terms (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/terms"}),") and Privacy Policy (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/privacy"}),")"))}function kT$({showIfAlreadyViewed:H,location:$,onDone:A}){let[L,I]=iI.useState(null),[D,B]=iI.useState(null);if(iI.useEffect(()=>{async function G(){let[U,X]=await Promise.all([LWH(),Wo()]),J=X.success?X.data:null;B(J);let F=udD(U,X,H);if(I(F),!F){A("skip_rendering");return}WPA(),c("tengu_grove_policy_viewed",{location:$,dismissable:J?.notice_is_grace_period})}G()},[H,$,A]),L===null)return null;if(!L)return null;async function f(G){switch(G){case"accept_opt_in":{await D7$(!0),c("tengu_grove_policy_submitted",{state:!0,dismissable:D?.notice_is_grace_period});break}case"accept_opt_out":{await D7$(!1),c("tengu_grove_policy_submitted",{state:!1,dismissable:D?.notice_is_grace_period});break}case"defer":c("tengu_grove_policy_dismissed",{state:!0});break;case"escape":c("tengu_grove_policy_escaped",{});break}A(G)}let E=D?.domain_excluded?[{label:"Accept terms \u2022 Help improve Claude: OFF (for emails with your domain)",value:"accept_opt_out"}]:[{label:"Accept terms \u2022 Help improve Claude: ON",value:"accept_opt_in"},{label:"Accept terms \u2022 Help improve Claude: OFF",value:"accept_opt_out"}];function M(){if(D?.notice_is_grace_period){f("defer");return}f("escape")}return iI.default.createElement(BL,{title:"Updates to Consumer Terms and Policies",color:"professionalBlue",borderDimColor:!1,onCancel:M,inputGuide:(G)=>G.pending?iI.default.createElement(V,null,"Press ",G.keyName," again to exit"):iI.default.createElement(rA,null,iI.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),iI.default.createElement(s$,{shortcut:"Esc",action:"cancel"}))},iI.default.createElement(x,{flexDirection:"row"},iI.default.createElement(x,{flexDirection:"column",gap:1,flexGrow:1},D?.notice_is_grace_period?iI.default.createElement(NV1,null):iI.default.createElement(OV1,null)),iI.default.createElement(x,{flexShrink:0},iI.default.createElement(V,{color:"professionalBlue"},zV1))),iI.default.createElement(x,{flexDirection:"column",gap:1},iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,{bold:!0},"Please select how you'd like to continue"),iI.default.createElement(V,null,"Your choice takes effect immediately upon confirmation.")),iI.default.createElement(QA,{options:[...E,...D?.notice_is_grace_period?[{label:"Not now",value:"defer"}]:[]],onChange:(G)=>f(G),onCancel:M})))}function gdD({settings:H,domainExcluded:$,onDone:A}){let[L,I]=iI.useState(H.grove_enabled);iI.default.useEffect(()=>{c("tengu_grove_privacy_settings_viewed",{})},[]),WL(async(B,f)=>{if(!$&&(f.tab||f.return||B===" ")){let E=!L;I(E),await D7$(E)}});let D=iI.default.createElement(V,{color:"error"},"false");if($)D=iI.default.createElement(V,{color:"error"},"false (for emails with your domain)");else if(L)D=iI.default.createElement(V,{color:"success"},"true");return iI.default.createElement(BL,{title:"Data Privacy",color:"professionalBlue",borderDimColor:!1,onCancel:A,inputGuide:(B)=>B.pending?iI.default.createElement(V,null,"Press ",B.keyName," again to exit"):$?iI.default.createElement(s$,{shortcut:"Esc",action:"cancel"}):iI.default.createElement(rA,null,iI.default.createElement(s$,{shortcut:"Enter/Tab/Space",action:"toggle"}),iI.default.createElement(s$,{shortcut:"Esc",action:"cancel"}))},iI.default.createElement(V,null,"Review and manage your privacy settings at"," ",iI.default.createElement(dI,{url:"https://claude.ai/settings/data-privacy-controls"})),iI.default.createElement(x,null,iI.default.createElement(x,{width:44},iI.default.createElement(V,{bold:!0},"Help improve Claude")),iI.default.createElement(x,null,D)))}async function mdD(){let[H,$]=await Promise.all([LWH(),Wo()]);if(udD(H,$,!1)){let L=$.success?$.data:null;if(c("tengu_grove_print_viewed",{dismissable:L?.notice_is_grace_period}),L===null||L.notice_is_grace_period)Tc(` An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms. [ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run \`claude\` to review the updated terms. |______________|`;var uT$=K(()=>{xH();l8();z$();DWH();UU();xH();bB();lB();eB();iI=b(s(),1)});var ddD={};XA(ddD,{call:()=>xV1});async function xV1(H){if(!await IWH())return H(pdD),null;let[A,L]=await Promise.all([LWH(),Wo()]);if(!A.success)return H(pdD),null;let I=A.data,D=L.success?L.data:null;async function B(E){if(E==="escape"||E==="defer"){H("Privacy settings dialog dismissed",{display:"system"});return}await f()}async function f(){let E=await LWH();if(!E.success){H("Unable to retrieve updated privacy settings",{display:"system"});return}let M=E.data,G=M.grove_enabled?"true":"false";if(H(`"Help improve Claude" set to ${G}.`),I.grove_enabled!==null&&I.grove_enabled!==M.grove_enabled)c("tengu_grove_policy_toggled",{state:M.grove_enabled,location:"settings"})}if(I.grove_enabled!==null)return rmH.createElement(gdD,{settings:I,domainExcluded:D?.domain_excluded,onDone:f});return rmH.createElement(kT$,{showIfAlreadyViewed:!0,onDone:B,location:"settings"})}var rmH,pdD="Review and manage your privacy settings at https://claude.ai/settings/data-privacy-controls";var cdD=K(()=>{uT$();DWH();z$();rmH=b(s(),1)});var SV1,ldD;var idD=K(()=>{EI();SV1={type:"local-jsx",name:"privacy-settings",description:"View and update your privacy settings",isEnabled:()=>{return jD$()},isHidden:!1,load:()=>Promise.resolve().then(() => (cdD(),ddD)),userFacingName(){return"privacy-settings"}},ldD=SV1});function ndD({event:H,eventSummary:$,config:A,matcher:L,onSuccess:I,onCancel:D}){let[B,f]=zvA.useState(!1),[E,M]=zvA.useState(null),G=KFH.map(j5A),U=async(X)=>{f(!0),M(null);try{await xPI(H,A,L,X),c("tengu_hook_created",{event:H,source:X,has_matcher:L?1:0}),I()}catch(J){M(J instanceof Error?J.message:"Failed to add hook"),f(!1)}};if(B)return hf.createElement(x,{flexDirection:"column",gap:1},hf.createElement(x,{flexDirection:"row",gap:1},hf.createElement(vD,null),hf.createElement(V,null,"Adding hook configuration\u2026")));if(E)return hf.createElement(BL,{title:"Failed to add hook",onCancel:D,color:"error",borderDimColor:!1},hf.createElement(x,{flexDirection:"column",gap:1},hf.createElement(V,null,E),hf.createElement(QA,{options:[{label:"OK",value:"ok"}],onChange:D})));return hf.createElement(BL,{title:"Save hook configuration",onCancel:D,borderDimColor:!1},hf.createElement(x,{flexDirection:"column",gap:1},hf.createElement(x,{flexDirection:"column",marginX:2},hf.createElement(V,null,"Event: ",H," - ",$),hf.createElement(V,null,"Matcher: ",L),hf.createElement(V,null,A.type==="command"?"Command":"Prompt",":"," ",IP(A))),hf.createElement(V,null,"Where should this hook be saved?"),hf.createElement(QA,{options:G,onChange:(X)=>U(X),visibleOptionCount:3})))}var hf,zvA;var rdD=K(()=>{xH();Av();N1();JM();q4$();bB();z$();hf=b(s(),1),zvA=b(s(),1)});function adD({hookEventMetadata:H,totalHooksCount:$,configDifference:A,restrictedByPolicy:L,onSelectEvent:I,onCancel:D}){let B=`${$} hook${$!==1?"s":""}`;return I4.createElement(BL,{title:"Hooks",subtitle:B,onCancel:D,borderDimColor:!1},I4.createElement(x,{flexDirection:"column",gap:1},L&&I4.createElement(x,{flexDirection:"column"},I4.createElement(V,{color:"suggestion"},pH.info," Hooks Restricted by Policy"),I4.createElement(V,{dimColor:!0},"Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked.")),A&&I4.createElement(x,{flexDirection:"column"},I4.createElement(V,{color:"warning"},pH.warning," Settings Changed"),I4.createElement(V,{dimColor:!0},"Hook settings have been modified outside of this menu. Review the following changes carefully:"),I4.createElement(V,{dimColor:!0},A)),I4.createElement(x,{flexDirection:"column"},I4.createElement(QA,{onChange:(f)=>{if(f==="disable-all")I("disable-all");else I(f)},onCancel:D,options:[...Object.entries(H).map(([f,E])=>({label:`${f} - ${E.summary}`,value:f})),{label:I4.createElement(V,{dimColor:!0},"Disable all hooks"),value:"disable-all"}]}))))}var I4;var odD=K(()=>{xH();N1();jI();bB();I4=b(s(),1)});function tdD({selectedEvent:H,matchersForSelectedEvent:$,hooksByEventAndMatcher:A,eventDescription:L,onSelect:I,onCancel:D}){let B=LZ.useMemo(()=>{return $.map((f)=>{let E=A[H]?.[f]||[],M=Array.from(new Set(E.map((G)=>G.source)));return{matcher:f,sources:M,hookCount:E.length}})},[$,A,H]);return LZ.createElement(BL,{title:`${H} - Tool Matchers`,subtitle:L,onCancel:D,borderDimColor:!1},LZ.createElement(x,{flexDirection:"column"},LZ.createElement(QA,{options:[{label:`+ Add new matcher${pH.ellipsis}`,value:"add-new"},{label:"+ Match all (no filter)",value:"match-all"},...B.map((f)=>{return{label:`[${f.sources.map(RPI).join(", ")}] ${f.matcher}`,value:f.matcher,description:`${f.hookCount} hook${f.hookCount!==1?"s":""}`}})],onChange:(f)=>{if(f==="add-new")I(null);else if(f==="match-all")I("");else I(f)},onCancel:D}),$.length===0&&LZ.createElement(x,{marginLeft:2},LZ.createElement(V,{dimColor:!0},"No matchers configured yet"))))}var LZ;var sdD=K(()=>{xH();jI();Av();N1();bB();LZ=b(s(),1)});function edD({selectedEvent:H,newMatcher:$,onChangeNewMatcher:A,eventDescription:L,matcherMetadata:I,onCancel:D}){let[B,f]=D4.useState($.length);return D4.createElement(BL,{title:`Add new matcher for ${H}`,subtitle:L,onCancel:D,borderDimColor:!1},D4.createElement(x,{flexDirection:"column",gap:1},D4.createElement(x,{flexDirection:"column",gap:1},D4.createElement(V,null,"Possible matcher values for field ",I.fieldToMatch,":"),D4.createElement(V,{dimColor:!0},I.values.join(", "))),D4.createElement(x,{flexDirection:"column"},D4.createElement(V,null,"Matcher:"),D4.createElement(x,{borderStyle:"round",borderDimColor:!0,paddingLeft:1,paddingRight:1},D4.createElement(W9,{value:$,onChange:A,columns:78,showCursor:!0,cursorOffset:B,onChangeCursorOffset:f}))),D4.createElement(x,{flexDirection:"column",gap:1},D4.createElement(V,{dimColor:!0},"Example Matchers:",` `,"\u2022 Web.* (regex pattern)"))))}var D4;var HcD=K(()=>{xH();S5();bB();D4=b(s(),1)});function $cD({selectedEvent:H,selectedMatcher:$,eventDescription:A,fullDescription:L,supportsMatcher:I,command:D,onChangeCommand:B,onCancel:f}){let[E,M]=f9.useState(D.length),{columns:G}=QL(),U=D.trim().split(/\s+/)[0]||"",X=U&&!U.startsWith("/")&&!U.startsWith("~")&&U.includes("/"),J=/\bsudo\b/.test(D);return f9.createElement(BL,{title:"Add new hook",onCancel:f,borderDimColor:!1},f9.createElement(x,{flexDirection:"column",gap:1},f9.createElement(x,{flexDirection:"column"},f9.createElement(V,{dimColor:!0},pH.info," Hooks execute shell commands with your full user permissions. Only use hooks from trusted sources."," ",f9.createElement(dI,{url:"https://code.claude.com/docs/en/hooks"},"Learn more"))),f9.createElement(V,null,"Event: ",f9.createElement(V,{bold:!0},H)," - ",A),L&&f9.createElement(x,null,f9.createElement(V,{dimColor:!0},L)),I&&f9.createElement(V,null,"Matcher: ",f9.createElement(V,{bold:!0},$)),f9.createElement(V,null,"Command:"),f9.createElement(x,{borderStyle:"round",borderDimColor:!0,paddingLeft:1,paddingRight:1},f9.createElement(W9,{value:D,onChange:B,columns:G-8,showCursor:!0,cursorOffset:E,onChangeCursorOffset:M,multiline:!0})),(X||J)&&f9.createElement(x,{flexDirection:"column",gap:0},X&&f9.createElement(V,{color:"warning"},pH.warning," Using a relative path for the executable may be insecure. Consider using an absolute path instead."),J&&f9.createElement(V,{color:"warning"},pH.warning," Using sudo in hooks can be dangerous and may expose your system to security risks.")),f9.createElement(V,{dimColor:!0},"Examples:",f9.createElement(_K,null),`\u2022 jq -r '.tool_input.file_path | select(endswith(".go"))' | xargs -r gofmt -w`,f9.createElement(_K,null),`\u2022 jq -r '"\\(.tool_input.command) - \\(.tool_input.description // "No description")"' >> ~/.claude/bash-command-log.txt`,f9.createElement(_K,null),"\u2022 /usr/local/bin/security_check.sh",f9.createElement(_K,null),"\u2022 python3 ~/hooks/validate_changes.py")))}var f9;var AcD=K(()=>{xH();S5();jI();xH();OB();bB();f9=b(s(),1)});function LcD({selectedMatcher:H,selectedEvent:$,onDelete:A,onCancel:L}){return oP.createElement(BL,{title:"Delete matcher?",onCancel:L,borderDimColor:!1},oP.createElement(x,{flexDirection:"column",gap:1},oP.createElement(x,{flexDirection:"column",marginX:2},oP.createElement(V,{bold:!0},H),oP.createElement(V,{dimColor:!0},"Event: ",$)),oP.createElement(V,null,"This matcher has no hooks configured. Delete it?"),oP.createElement(QA,{onChange:(I)=>I==="yes"?A():L(),onCancel:L,options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]})))}var oP;var IcD=K(()=>{xH();N1();bB();oP=b(s(),1)});function DcD({selectedEvent:H,selectedMatcher:$,hooksForSelectedMatcher:A,hookEventMetadata:L,onSelect:I,onCancel:D}){let B=L.matcherMetadata!==void 0?`${H} - Matcher: ${$}`:H;return Uj.createElement(BL,{title:B,subtitle:L.description,onCancel:D,borderDimColor:!1},Uj.createElement(x,{flexDirection:"column"},Uj.createElement(QA,{options:[{label:`+ Add new hook${pH.ellipsis}`,value:"add-new"},...A.map((f,E)=>({label:f.source==="pluginHook"?`${IP(f.config)} (read-only)`:IP(f.config),value:E.toString(),description:f.source==="pluginHook"?`${R5A(f.source)} - disable ${f.pluginName?f.pluginName:"plugin"} to remove`:R5A(f.source),disabled:f.source==="pluginHook"}))],onChange:(f)=>{if(f==="add-new")I(null);else{let E=parseInt(f,10),M=A[E];if(M)I(M)}},onCancel:D}),A.length===0&&Uj.createElement(x,{marginLeft:2},Uj.createElement(V,{dimColor:!0},"No hooks configured yet"))))}var Uj;var BcD=K(()=>{jI();xH();Av();N1();bB();Uj=b(s(),1)});function fcD({selectedHook:H,eventSupportsMatcher:$,onDelete:A,onCancel:L}){return pK.createElement(BL,{title:"Delete hook?",onCancel:L,borderDimColor:!1},pK.createElement(x,{flexDirection:"column",gap:1},pK.createElement(x,{flexDirection:"column",marginX:2},pK.createElement(V,{bold:!0},IP(H.config)),pK.createElement(V,{dimColor:!0},"Event: ",H.event),$&&pK.createElement(V,{dimColor:!0},"Matcher: ",H.matcher),pK.createElement(V,{dimColor:!0},jPI(H.source))),pK.createElement(V,null,"This will remove the hook configuration from your settings."),pK.createElement(QA,{onChange:(I)=>I==="yes"?A():L(),onCancel:L,options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]})))}var pK;var EcD=K(()=>{xH();Av();N1();bB();pK=b(s(),1)});function gT$(H,$){let A={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCompleted:{}},L=amH($);OPI(H).forEach((D)=>{let B=A[D.event];if(B){let f=L[D.event].matcherMetadata!==void 0?D.matcher||"":"";if(!B[f])B[f]=[];B[f].push(D)}});let I=pYH();if(I)for(let[D,B]of Object.entries(I)){let f=D,E=A[f];if(!E)continue;for(let M of B){let G=M.matcher||"";for(let U of M.hooks)if(U.type==="callback"){if(!E[G])E[G]=[];E[G].push({event:f,config:{type:"command",command:"[Plugin Hook]"},matcher:M.matcher,source:"pluginHook",pluginName:M.pluginName})}else{if(!E[G])E[G]=[];E[G].push({event:f,config:U,matcher:M.matcher,source:"pluginHook",pluginName:M.pluginName})}}}return A}function McD(H,$){let A=Object.keys(H[$]||{});return yPI(A,H,$)}function GcD(H,$,A){let L=A??"";return H[$]?.[L]??[]}function ks(H,$){return amH($)[H].matcherMetadata}function UcD(H,$){return amH($)[H].summary}var amH;var XcD=K(()=>{tD();Av();g$();amH=o$(function(H){return{PreToolUse:{summary:"Before tool execution",description:`Input to command is JSON of tool call arguments. To resume the original: claude -r ${I}`,P=`Forked conversation${Q}. You are now in the fork.${W}`;if($.resume)await $.resume(D,F,"fork"),H(P,{display:"system"});else H(`Forked conversation${Q}. Resume with: /resume ${D}`);return null}catch(D){let B=D instanceof Error?D.message:"Unknown error occurred";return H(`Failed to fork conversation: ${B}`),null}}var ZcD,BPH;var TcD=K(()=>{rB();g$();Z$();nM();yE();z$();ZcD=require("crypto"),BPH=require("fs/promises")});var gV1,zcD;var NcD=K(()=>{gV1={type:"local-jsx",name:"fork",description:"Create a fork of the current conversation at this point",argumentHint:"[name]",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (TcD(),qcD)),userFacingName(){return"fork"}},zcD=gV1});var Vb;var OcD=K(()=>{Vb={FOLDER_NAME:".claude",AGENTS_DIR:"agents"}});function xcD(H,$,A,L,I,D,B){let f=$.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\\\n"),M=A===void 0||A.length===1&&A[0]==="*"?"":` `}function mT$(H){switch(H){case"flagSettings":throw Error(`Cannot get directory path for ${H} agents`);case"userSettings":return Pb.join(UL(),Vb.AGENTS_DIR);case"projectSettings":return Pb.join(C$(),Vb.FOLDER_NAME,Vb.AGENTS_DIR);case"policySettings":return Pb.join(v_(),Vb.FOLDER_NAME,Vb.AGENTS_DIR);case"localSettings":return Pb.join(C$(),Vb.FOLDER_NAME,Vb.AGENTS_DIR)}}function ScD(H){switch(H){case"projectSettings":return Pb.join(".",Vb.FOLDER_NAME,Vb.AGENTS_DIR);default:return mT$(H)}}function OvA(H){let $=mT$(H.source);return Pb.join($,`${H.agentType}.md`)}function pT$(H){if(H.source==="built-in")return"Built-in";if(H.source==="plugin")throw Error("Cannot get file path for plugin agents");let $=mT$(H.source),A=H.filename||H.agentType;return Pb.join($,`${A}.md`)}function jcD(H){if(H.source==="built-in")return"Built-in";let $=ScD(H.source);return Pb.join($,`${H.agentType}.md`)}function RcD(H){if(TK(H))return"Built-in";if(aK$(H))return`Plugin: ${H.plugin||"Unknown"}`;let $=ScD(H.source),A=H.filename||H.agentType;return Pb.join($,`${A}.md`)}function mV1(H){let $=mT$(H),A=zH();if(!A.existsSync($))A.mkdirSync($);return $}async function ycD(H,$,A,L,I,D=!0,B,f,E){if(H==="built-in")throw Error("Cannot save built-in agents");mV1(H);let M=OvA({source:H,agentType:$}),G=zH();if(D&&G.existsSync(M))throw Error(`Agent file already exists: ${M}`);let U=xcD($,A,L,I,B,f,E);iL(M,U,{encoding:"utf-8",flush:!0})}async function vcD(H,$,A,L,I,D,B){if(H.source==="built-in")throw Error("Cannot update built-in agents");let f=pT$(H),E=xcD(H.agentType,$,A,L,I,D,B);iL(f,E,{encoding:"utf-8",flush:!0})}async function hcD(H){if(H.source==="built-in")throw Error("Cannot delete built-in agents");let $=zH(),A=pT$(H);if($.existsSync(A))$.unlinkSync(A)}var Pb;var fPH=K(()=>{DL();PI();Z$();NA();kT();OcD();y$H();Pb=require("path")});function dT$({title:H,titleColor:$="text",subtitle:A,borderColor:L="suggestion",borderDimColor:I=!1,children:D,footer:B,titleSuffix:f}){return us.default.createElement(us.default.Fragment,null,us.default.createElement(x,{borderStyle:"round",borderColor:L,borderDimColor:I,flexDirection:"column"},H&&us.default.createElement(x,{flexDirection:"column",paddingX:1},us.default.createElement(V,{bold:!0,color:$},H,f),A&&us.default.createElement(V,{dimColor:!0},A)),us.default.createElement(x,{paddingX:1,flexDirection:"column"},D)),B)}var us;var xvA=K(()=>{xH();us=b(s(),1)});function gs({title:H,titleColor:$="text",borderColor:A="suggestion",children:L,subtitle:I}){return SvA.createElement(dT$,{title:H,titleColor:$,borderColor:A,subtitle:I},L)}var SvA;var jvA=K(()=>{xvA();SvA=b(s(),1)});function EPH(H){if(H==="all")return"Agents";if(H==="built-in")return"Built-in agents";if(H==="plugin")return"Plugin agents";return Fk(Vl(H))}var cT$=K(()=>{eYH();W4()});function bcD({source:H,agents:$,onBack:A,onSelect:L,onCreateNew:I,changes:D}){let[B,f]=sL.useState(null),[E,M]=sL.useState(!0),G=(C)=>{return{isOverridden:!!C.overriddenBy,overriddenBy:C.overriddenBy||null}},U=()=>{return sL.createElement(x,null,sL.createElement(V,{color:E?"suggestion":void 0},E?`${pH.pointer} `:" "),sL.createElement(V,{color:E?"suggestion":void 0},"Create new agent"))},X=(C)=>{let Y=C.source==="built-in",Z=!Y&&!E&&B?.agentType===C.agentType&&B?.source===C.source,{isOverridden:q,overriddenBy:O}=G(C),j=Y||q,u=!Y&&Z?"suggestion":void 0,y=C.model||z9$();return sL.createElement(x,{key:`${C.agentType}-${C.source}`},sL.createElement(V,{dimColor:j&&!Z,color:u},Y?"":Z?`${pH.pointer} `:" "),sL.createElement(V,{dimColor:j&&!Z,color:u},C.agentType),y&&sL.createElement(V,{dimColor:!0,color:u}," \xB7 ",y==="inherit"?"inherit":y),O&&sL.createElement(V,{dimColor:!Z,color:Z?"warning":void 0}," ",pH.warning," overridden by ",O))},J=sL.useMemo(()=>{let C=$.filter((Y)=>Y.source!=="built-in");if(H==="all")return[...C.filter((Y)=>Y.source==="userSettings"),...C.filter((Y)=>Y.source==="projectSettings"),...C.filter((Y)=>Y.source==="policySettings")];return C},[$,H]);sL.useEffect(()=>{if(!B&&!E&&J.length>0)if(I)M(!0);else f(J[0]||null)},[J,B,E,I]),BA("confirm:no",A,{context:"Confirmation"}),WL((C,Y)=>{if(Y.return){if(E&&I)I();else if(B)L(B);return}if(!Y.upArrow&&!Y.downArrow)return;let Z=!!I,q=J.length+(Z?1:0);if(q===0)return;let O=0;if(!E&&B){let u=J.findIndex((y)=>y.agentType===B.agentType&&y.source===B.source);if(u>=0)O=Z?u+1:u}let j=Y.upArrow?O===0?q-1:O-1:O===q-1?0:O+1;if(Z&&j===0)M(!0),f(null);else{let u=Z?j-1:j,y=J[u];if(y)M(!1),f(y)}});let F=(C="Built-in (always available):")=>{let Y=$.filter((Z)=>Z.source==="built-in");return sL.createElement(x,{flexDirection:"column",marginBottom:1,paddingLeft:2},sL.createElement(V,{bold:!0,dimColor:!0},C),Y.map(X))},Q=(C,Y)=>{if(!Y.length)return null;let Z=Y[0]?.baseDir;return sL.createElement(x,{flexDirection:"column",marginBottom:1},sL.createElement(x,{paddingLeft:2},sL.createElement(V,{bold:!0,dimColor:!0},C),Z&&sL.createElement(V,{dimColor:!0}," (",Z,")")),Y.map((q)=>X(q)))},W=EPH(H);if(!$.length||H!=="built-in"&&!$.some((C)=>C.source!=="built-in"))return sL.createElement(gs,{title:W,subtitle:"No agents found"},I&&sL.createElement(x,{marginY:1},U()),sL.createElement(V,{dimColor:!0},"No agents found. Create specialized subagents that Claude can delegate to."),sL.createElement(V,{dimColor:!0},"Each subagent has its own context window, custom system prompt, and specific tools."),sL.createElement(V,{dimColor:!0},"Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer."),H!=="built-in"&&$.some((C)=>C.source==="built-in")&&sL.createElement(sL.Fragment,null,sL.createElement(x,{marginTop:1},sL.createElement(Uf,null)),F()));return sL.createElement(gs,{title:W,subtitle:`${$.filter((C)=>!C.overriddenBy).length} agents`},D&&D.length>0&&sL.createElement(x,{marginTop:1},sL.createElement(V,{dimColor:!0},D[D.length-1])),sL.createElement(x,{flexDirection:"column",marginTop:1},I&&sL.createElement(x,{marginBottom:1},U()),H==="all"?sL.createElement(sL.Fragment,null,Q("User agents",$.filter((C)=>C.source==="userSettings")),Q("Project agents",$.filter((C)=>C.source==="projectSettings")),Q("Managed agents",$.filter((C)=>C.source==="policySettings")),Q("Plugin agents",$.filter((C)=>C.source==="plugin")),Q("CLI arg agents",$.filter((C)=>C.source==="flagSettings")),(()=>{let C=$.filter((Y)=>Y.source==="built-in");return C.length>0?sL.createElement(x,{flexDirection:"column",marginBottom:1,paddingLeft:2},sL.createElement(V,{dimColor:!0},sL.createElement(V,{bold:!0},"Built-in agents")," (always available)"),C.map(X)):null})()):H==="built-in"?sL.createElement(sL.Fragment,null,sL.createElement(V,{dimColor:!0,italic:!0},"Built-in agents are provided by default and cannot be modified."),sL.createElement(x,{marginTop:1,flexDirection:"column"},$.map((C)=>X(C)))):sL.createElement(sL.Fragment,null,$.filter((C)=>C.source!=="built-in").map((C)=>X(C)),$.some((C)=>C.source==="built-in")&&sL.createElement(sL.Fragment,null,sL.createElement(x,{marginTop:1},sL.createElement(Uf,null)),F()))))}var sL;var kcD=K(()=>{xH();xH();jI();e6();jvA();aI();cT$();$I();sL=b(s(),1)});function yvA({steps:H,initialData:$={},onComplete:A,onCancel:L,children:I,title:D,showStepCounter:B=!0}){let[f,E]=cF.useState(0),[M,G]=cF.useState($),[U,X]=cF.useState(!1),[J,F]=cF.useState([]);zB(),cF.useEffect(()=>{if(U)F([]),A(M)},[U,M,A]);let Q=cF.useCallback(()=>{if(f0)F((O)=>[...O,f]);E((O)=>O+1)}else X(!0)},[f,H.length,J]),W=cF.useCallback(()=>{if(J.length>0){let O=J[J.length-1];if(O!==void 0)F((j)=>j.slice(0,-1)),E(O)}else if(f>0)E((O)=>O-1);else if(L)L()},[f,J,L]),P=cF.useCallback((O)=>{if(O>=0&&O[...j,f]),E(O)},[f,H.length]),C=cF.useCallback(()=>{if(F([]),L)L()},[L]),Y=cF.useCallback((O)=>{G((j)=>({...j,...O}))},[]),Z=cF.useMemo(()=>({currentStepIndex:f,totalSteps:H.length,wizardData:M,setWizardData:G,updateWizardData:Y,goNext:Q,goBack:W,goToStep:P,cancel:C,title:D,showStepCounter:B}),[f,H.length,M,Y,Q,W,P,C,D,B]),q=H[f];if(!q||U)return null;return cF.default.createElement(RvA.Provider,{value:Z},I||cF.default.createElement(q,null))}var cF,RvA;var vvA=K(()=>{UM();cF=b(s(),1),RvA=cF.createContext(null)});function RG(){let H=ucD.useContext(RvA);if(!H)throw Error("useWizard must be used within a WizardProvider");return H}var ucD;var hvA=K(()=>{vvA();ucD=b(s(),1)});function bvA({instructions:H=o1H.default.createElement(rA,null,o1H.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),o1H.default.createElement(s$,{shortcut:"Enter",action:"select"}),o1H.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))}){let $=zB();return o1H.default.createElement(x,{marginLeft:3},o1H.default.createElement(V,{dimColor:!0},$.pending?`Press ${$.keyName} again to exit`:H))}var o1H;var kvA=K(()=>{xH();UM();lB();j0();eB();o1H=b(s(),1)});function n4({title:H,titleColor:$="text",borderColor:A="suggestion",children:L,subtitle:I,footerText:D}){let{currentStepIndex:B,totalSteps:f,title:E,showStepCounter:M}=RG();return uvA.default.createElement(dT$,{title:H||E||"Wizard",titleColor:$,borderColor:A,subtitle:I,titleSuffix:M!==!1?` (${B+1}/${f})`:void 0,footer:uvA.default.createElement(bvA,{instructions:D})},L)}var uvA;var IZ=K(()=>{hvA();kvA();xvA();uvA=b(s(),1)});var CC=K(()=>{vvA();hvA();IZ();kvA()});function gcD(){let{goNext:H,updateWizardData:$,cancel:A}=RG();return ms.default.createElement(n4,{subtitle:"Choose location",footerText:ms.default.createElement(rA,null,ms.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),ms.default.createElement(s$,{shortcut:"Enter",action:"select"}),ms.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))},ms.default.createElement(x,{marginTop:1},ms.default.createElement(QA,{key:"location-select",options:[{label:"Project (.claude/agents/)",value:"projectSettings"},{label:"Personal (~/.claude/agents/)",value:"userSettings"}],onChange:(I)=>{$({location:I}),H()},onCancel:()=>A()})))}var ms;var mcD=K(()=>{xH();N1();IZ();CC();lB();j0();eB();ms=b(s(),1)});function pcD(){let{goNext:H,goBack:$,updateWizardData:A,goToStep:L}=RG();return ps.default.createElement(n4,{subtitle:"Creation method",footerText:ps.default.createElement(rA,null,ps.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),ps.default.createElement(s$,{shortcut:"Enter",action:"select"}),ps.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},ps.default.createElement(x,{marginTop:1},ps.default.createElement(QA,{key:"method-select",options:[{label:"Generate with Claude (recommended)",value:"generate"},{label:"Manual configuration",value:"manual"}],onChange:(D)=>{let B=D;if(A({method:B,wasGenerated:B==="generate"}),B==="generate")H();else L(3)},onCancel:()=>$()})))}var ps;var dcD=K(()=>{xH();N1();IZ();CC();lB();j0();eB();ps=b(s(),1)});async function lcD(H,$,A,L){let I=A.length>0?` `});function ncD(){let{updateWizardData:H,goBack:$,goToStep:A,wizardData:L}=RG(),[I,D]=r4.useState(L.generationPrompt||""),[B,f]=r4.useState(!1),[E,M]=r4.useState(null),[G,U]=r4.useState(I.length),X=Ht(),J=r4.useRef(null),F=r4.useCallback(()=>{if(J.current)J.current.abort(),J.current=null,f(!1),M("Generation cancelled")},[]);BA("confirm:no",F,{context:"Settings",isActive:B});let Q=r4.useCallback(()=>{H({generationPrompt:"",agentType:"",systemPrompt:"",whenToUse:"",generatedAgent:void 0,wasGenerated:!1}),D(""),M(null),$()},[H,$]);BA("confirm:no",Q,{context:"Settings",isActive:!B});let W=async()=>{let C=I.trim();if(!C){M("Please describe what the agent should do");return}M(null),f(!0),H({generationPrompt:C,isGenerating:!0});let Y=nD();J.current=Y;try{let Z=await lcD(C,X,[],Y.signal);H({agentType:Z.identifier,whenToUse:Z.whenToUse,systemPrompt:Z.systemPrompt,generatedAgent:Z,isGenerating:!1,wasGenerated:!0}),A(6)}catch(Z){if(Z instanceof rf);else if(Z instanceof Error&&!Z.message.includes("No assistant message found"))M(Z.message||"Failed to generate agent");H({isGenerating:!1})}finally{f(!1),J.current=null}},P="Describe what this agent should do and when it should be used (be comprehensive for best results)";if(B)return r4.default.createElement(n4,{subtitle:P,footerText:r4.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})},r4.default.createElement(x,{marginTop:1,flexDirection:"row",alignItems:"center"},r4.default.createElement(vD,null),r4.default.createElement(V,{color:"suggestion"}," Generating agent from description...")));return r4.default.createElement(n4,{subtitle:P,footerText:r4.default.createElement(rA,null,r4.default.createElement(VA,{action:"confirm:yes",context:"Confirmation",fallback:"Enter",description:"submit"}),r4.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},r4.default.createElement(x,{flexDirection:"column",marginTop:1},E&&r4.default.createElement(x,{marginBottom:1},r4.default.createElement(V,{color:"error"},E)),r4.default.createElement(W9,{value:I,onChange:D,onSubmit:W,placeholder:"e.g., Help me write unit tests for my code...",columns:80,cursorOffset:G,onChangeCursorOffset:U,focus:!0,showCursor:!0})))}var r4;var rcD=K(()=>{xH();$I();S5();IZ();CC();JM();icD();jbH();eE();j0();eB();n_();r4=b(s(),1)});function gvA(H){if(!H)return"Agent type is required";if(!/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(H))return"Agent type must start and end with alphanumeric characters and contain only letters, numbers, and hyphens";if(H.length<3)return"Agent type must be at least 3 characters long";if(H.length>50)return"Agent type must be less than 50 characters";return null}function acD(H,$,A){let L=[],I=[];if(!H.agentType)L.push("Agent type is required");else{let B=gvA(H.agentType);if(B)L.push(B);let f=A.find((E)=>E.agentType===H.agentType&&E.source!==H.source);if(f)L.push(`Agent type "${H.agentType}" already exists in ${EPH(f.source)}`)}if(!H.whenToUse)L.push("Description (description) is required");else if(H.whenToUse.length<10)I.push("Description should be more descriptive (at least 10 characters)");else if(H.whenToUse.length>5000)I.push("Description is very long (over 5000 characters)");if(H.tools!==void 0&&!Array.isArray(H.tools))L.push("Tools must be an array");else{if(H.tools===void 0)I.push("Agent has access to all tools");else if(H.tools.length===0)I.push("No tools selected - agent will have very limited capabilities");let B=Io(H,$,!1);if(B.invalidTools.length>0)L.push(`Invalid tools: ${B.invalidTools.join(", ")}`)}let D=H.getSystemPrompt();if(!D)L.push("System prompt is required");else if(D.length<20)L.push("System prompt is too short (minimum 20 characters)");else if(D.length>1e4)I.push("System prompt is very long (over 10,000 characters)");return{isValid:L.length===0,errors:L,warnings:I}}var mvA=K(()=>{OBH();cT$()});function ocD(H){let{goNext:$,goBack:A,updateWizardData:L,wizardData:I}=RG(),[D,B]=i3.useState(I.agentType||""),[f,E]=i3.useState(null),[M,G]=i3.useState(D.length);return BA("confirm:no",A,{context:"Settings"}),i3.default.createElement(n4,{subtitle:"Agent type (identifier)",footerText:i3.default.createElement(rA,null,i3.default.createElement(s$,{shortcut:"Type",action:"enter text"}),i3.default.createElement(s$,{shortcut:"Enter",action:"continue"}),i3.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},i3.default.createElement(x,{flexDirection:"column",marginTop:1},i3.default.createElement(V,null,"Enter a unique identifier for your agent:"),i3.default.createElement(x,{marginTop:1},i3.default.createElement(W9,{value:D,onChange:B,onSubmit:(X)=>{let J=X.trim(),F=gvA(J);if(F){E(F);return}E(null),L({agentType:J}),$()},placeholder:"e.g., test-runner, tech-lead, etc",columns:60,cursorOffset:M,onChangeCursorOffset:G,focus:!0,showCursor:!0})),f&&i3.default.createElement(x,{marginTop:1},i3.default.createElement(V,{color:"error"},f))))}var i3;var tcD=K(()=>{xH();S5();IZ();CC();mvA();lB();j0();eB();$I();i3=b(s(),1)});function scD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG(),[I,D]=e7.useState(L.systemPrompt||""),[B,f]=e7.useState(I.length),[E,M]=e7.useState(null);return BA("confirm:no",$,{context:"Settings"}),e7.default.createElement(n4,{subtitle:"System prompt",footerText:e7.default.createElement(rA,null,e7.default.createElement(s$,{shortcut:"Type",action:"enter text"}),e7.default.createElement(s$,{shortcut:"Enter",action:"continue"}),e7.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},e7.default.createElement(x,{flexDirection:"column",marginTop:1},e7.default.createElement(V,null,"Enter the system prompt for your agent:"),e7.default.createElement(V,{dimColor:!0},"Be comprehensive for best results"),e7.default.createElement(x,{marginTop:1},e7.default.createElement(W9,{value:I,onChange:D,onSubmit:()=>{let U=I.trim();if(!U){M("System prompt is required");return}M(null),A({systemPrompt:U}),H()},placeholder:"You are a helpful code reviewer who...",columns:80,cursorOffset:B,onChangeCursorOffset:f,focus:!0,showCursor:!0})),E&&e7.default.createElement(x,{marginTop:1},e7.default.createElement(V,{color:"error"},E))))}var e7;var ecD=K(()=>{xH();S5();IZ();CC();lB();j0();eB();$I();e7=b(s(),1)});function HlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG(),[I,D]=n3.useState(L.whenToUse||""),[B,f]=n3.useState(I.length),[E,M]=n3.useState(null);return BA("confirm:no",$,{context:"Settings"}),n3.default.createElement(n4,{subtitle:"Description (tell Claude when to use this agent)",footerText:n3.default.createElement(rA,null,n3.default.createElement(s$,{shortcut:"Type",action:"enter text"}),n3.default.createElement(s$,{shortcut:"Enter",action:"continue"}),n3.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},n3.default.createElement(x,{flexDirection:"column",marginTop:1},n3.default.createElement(V,null,"When should Claude use this agent?"),n3.default.createElement(x,{marginTop:1},n3.default.createElement(W9,{value:I,onChange:D,onSubmit:(U)=>{let X=U.trim();if(!X){M("Description is required");return}M(null),A({whenToUse:X}),H()},placeholder:"e.g., use this agent after you're done writing code...",columns:80,cursorOffset:B,onChangeCursorOffset:f,focus:!0,showCursor:!0})),E&&n3.default.createElement(x,{marginTop:1},n3.default.createElement(V,{color:"error"},E))))}var n3;var $lD=K(()=>{xH();S5();IZ();CC();lB();j0();eB();$I();n3=b(s(),1)});function ds({width:H,color:$,char:A="\u2500",padding:L=0}){let{columns:I}=QL(),D=Math.max(0,(H??I)-L);return AlD.default.createElement(V,{color:$,dimColor:!$},A.repeat(D))}var AlD;var pvA=K(()=>{xH();OB();AlD=b(s(),1)});function dV1(H){let $=new Map;return H.forEach((A)=>{if(cw(A)){let L=eF(A.name);if(L?.serverName){let I=$.get(L.serverName)||[];I.push(A),$.set(L.serverName,I)}}}),Array.from($.entries()).map(([A,L])=>({serverName:A,tools:L})).sort((A,L)=>A.serverName.localeCompare(L.serverName))}function lT$({tools:H,initialTools:$,onComplete:A,onCancel:L}){let I=kX.useMemo(()=>A3A({tools:H,isBuiltIn:!1,isAsync:!1}),[H]),D=!$||$.includes("*")?I.map((g)=>g.name):$,[B,f]=kX.useState(D),[E,M]=kX.useState(0),[G,U]=kX.useState(!1),X=kX.useMemo(()=>{let g=new Set(I.map((h)=>h.name));return B.filter((h)=>g.has(h))},[B,I]),J=new Set(X),F=X.length===I.length&&I.length>0,Q=(g)=>{if(!g)return;f((h)=>h.includes(g)?h.filter((p)=>p!==g):[...h,g])},W=(g,h)=>{f((p)=>{if(h){let d=g.filter((k)=>!p.includes(k));return[...p,...d]}else return p.filter((d)=>!g.includes(d))})},P=()=>{let g=I.map((d)=>d.name),p=X.length===g.length&&g.every((d)=>X.includes(d))?void 0:X;A(p)},C=kX.useMemo(()=>{let g=LlD(),h={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return I.forEach((p)=>{if(cw(p))h.mcp.push(p);else if(g.READ_ONLY.toolNames.has(p.name))h.readOnly.push(p);else if(g.EDIT.toolNames.has(p.name))h.edit.push(p);else if(g.EXECUTION.toolNames.has(p.name))h.execution.push(p);else if(p.name!==E0)h.other.push(p)}),h},[I]),Y=(g)=>{let p=g.filter((d)=>J.has(d.name)).length{let d=g.map((k)=>k.name);W(d,p)}},Z=[];Z.push({id:"continue",label:"Continue",action:P,isContinue:!0}),Z.push({id:"bucket-all",label:`${F?pH.checkboxOn:pH.checkboxOff} All tools`,action:()=>{let g=I.map((h)=>h.name);W(g,!F)}});let q=LlD();[{id:"bucket-readonly",name:q.READ_ONLY.name,tools:C.readOnly},{id:"bucket-edit",name:q.EDIT.name,tools:C.edit},{id:"bucket-execution",name:q.EXECUTION.name,tools:C.execution},{id:"bucket-mcp",name:q.MCP.name,tools:C.mcp},{id:"bucket-other",name:q.OTHER.name,tools:C.other}].forEach(({id:g,name:h,tools:p})=>{if(p.length===0)return;let k=p.filter((n)=>J.has(n.name)).length===p.length;Z.push({id:g,label:`${k?pH.checkboxOn:pH.checkboxOff} ${h}`,action:Y(p)})});let j=Z.length;Z.push({id:"toggle-individual",label:G?"Hide advanced options":"Show advanced options",action:()=>{if(U(!G),G&&E>j)M(j)},isToggle:!0});let u=kX.useMemo(()=>dV1(I),[I]);if(G){if(u.length>0)Z.push({id:"mcp-servers-header",label:"MCP Servers:",action:()=>{},isHeader:!0}),u.forEach(({serverName:g,tools:h})=>{let d=h.filter((k)=>J.has(k.name)).length===h.length;Z.push({id:`mcp-server-${g}`,label:`${d?pH.checkboxOn:pH.checkboxOff} ${g} (${h.length} tool${h.length===1?"":"s"})`,action:()=>{let k=h.map((n)=>n.name);W(k,!d)}})}),Z.push({id:"tools-header",label:"Individual Tools:",action:()=>{},isHeader:!0});I.forEach((g)=>{let h=g.name;if(g.name.startsWith("mcp__")){let p=eF(g.name);h=p?`${p.toolName} (${p.serverName})`:g.name}Z.push({id:`tool-${g.name}`,label:`${J.has(g.name)?pH.checkboxOn:pH.checkboxOff} ${h}`,action:()=>Q(g.name)})})}let y=kX.useCallback(()=>{if(L)L();else A($)},[L,A,$]);return BA("confirm:no",y,{context:"Confirmation"}),WL((g,h)=>{if(h.return){let p=Z[E];if(p&&!p.isHeader)p.action()}else if(h.upArrow){let p=E-1;while(p>0&&Z[p]?.isHeader)p--;M(Math.max(0,p))}else if(h.downArrow){let p=E+1;while(p{let p=h+1===E,d=g.isToggle,k=g.isHeader;return kX.default.createElement(kX.default.Fragment,{key:g.id},d&&kX.default.createElement(ds,{width:40}),k&&h>0&&kX.default.createElement(x,{marginTop:1}),kX.default.createElement(V,{color:k?void 0:p?"suggestion":void 0,dimColor:k,bold:d&&p},k?"":p?`${pH.pointer} `:" ",d?`[ ${g.label} ]`:g.label))}),kX.default.createElement(x,{marginTop:1,flexDirection:"column"},kX.default.createElement(V,{dimColor:!0},F?"All tools selected":`${J.size} of ${I.length} tools selected`)))}var kX,LlD=()=>({READ_ONLY:{name:"Read-only tools",toolNames:new Set([rr.name,og.name,DW.name,k8.name,IW.name,T5.name,vC$.name,jC$.name,yC$.name,dp.name,cp.name])},EDIT:{name:"Edit tools",toolNames:new Set([S3.name,h3.name,up.name])},EXECUTION:{name:"Execution tools",toolNames:new Set([aD.name,void 0].filter(Boolean))},MCP:{name:"MCP tools",toolNames:new Set,isMcp:!0},OTHER:{name:"Other tools",toolNames:new Set}});var dvA=K(()=>{xH();xH();$I();jI();pvA();tC();kF();aSH();xFH();BuH();bw();s6H();q5H();bzA();jzA();vzA();gC$();mC$();T9H();ht();hkH();zQ();OBH();kX=b(s(),1)});function IlD({tools:H}){let{goNext:$,goBack:A,updateWizardData:L,wizardData:I}=RG(),D=(f)=>{L({selectedTools:f}),$()},B=I.selectedTools;return t1H.default.createElement(n4,{subtitle:"Select tools",footerText:t1H.default.createElement(rA,null,t1H.default.createElement(s$,{shortcut:"Enter",action:"toggle selection"}),t1H.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),t1H.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},t1H.default.createElement(lT$,{tools:H,initialTools:B,onComplete:D,onCancel:A}))}var t1H;var DlD=K(()=>{dvA();IZ();CC();lB();j0();eB();t1H=b(s(),1)});function iT$({initialModel:H,onComplete:$,onCancel:A}){let L=xz.useMemo(()=>hoL(),[]),I=xz.useMemo(()=>{if(H&&L.some((D)=>D.value===H))return H;return"sonnet"},[H,L]);return xz.createElement(x,{flexDirection:"column"},xz.createElement(x,{marginBottom:1},xz.createElement(V,{dimColor:!0},"Model determines the agent's reasoning capabilities and speed.")),xz.createElement(QA,{options:L,defaultValue:I,onChange:(D)=>{$(D)},onCancel:()=>A?A():$(H)}))}var xz;var cvA=K(()=>{xH();N1();aI();xz=b(s(),1)});function BlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG(),I=(D)=>{A({selectedModel:D}),H()};return s1H.default.createElement(n4,{subtitle:"Select model",footerText:s1H.default.createElement(rA,null,s1H.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),s1H.default.createElement(s$,{shortcut:"Enter",action:"select"}),s1H.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},s1H.default.createElement(iT$,{initialModel:L.selectedModel,onComplete:I,onCancel:$}))}var s1H;var flD=K(()=>{cvA();IZ();CC();lB();j0();eB();s1H=b(s(),1)});function nT$({agentName:H,currentColor:$="automatic",onConfirm:A}){let[L,I]=ElD.useState(Math.max(0,MPH.findIndex((B)=>B===$)));WL((B,f)=>{if(f.upArrow)I((E)=>E>0?E-1:MPH.length-1);else if(f.downArrow)I((E)=>E{let E=f===L;return DZ.default.createElement(x,{key:B,flexDirection:"row",gap:1},DZ.default.createElement(V,{color:E?"suggestion":void 0},E?pH.pointer:" "),B==="automatic"?DZ.default.createElement(V,{bold:E},"Automatic color"):DZ.default.createElement(x,{gap:1},DZ.default.createElement(V,{backgroundColor:b5[B],color:"inverseText"}," "),DZ.default.createElement(V,{bold:E},B.charAt(0).toUpperCase()+B.slice(1))))})),DZ.default.createElement(x,{marginTop:1},DZ.default.createElement(V,null,"Preview: "),D===void 0||D==="automatic"?DZ.default.createElement(V,{inverse:!0,bold:!0}," ","@",H," "):DZ.default.createElement(V,{backgroundColor:b5[D],color:"inverseText",bold:!0}," ","@",H," ")))}var DZ,ElD,MPH;var lvA=K(()=>{xH();q7();jI();DZ=b(s(),1),ElD=b(s(),1),MPH=["automatic",...h5]});function MlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG();BA("confirm:no",$,{context:"Confirmation"});let I=(D)=>{A({selectedColor:D,finalAgent:{agentType:L.agentType,whenToUse:L.whenToUse,getSystemPrompt:()=>L.systemPrompt,tools:L.selectedTools,...L.selectedModel?{model:L.selectedModel}:{},...D?{color:D}:{},source:L.location}}),H()};return cs.default.createElement(n4,{subtitle:"Choose background color",footerText:cs.default.createElement(rA,null,cs.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),cs.default.createElement(s$,{shortcut:"Enter",action:"select"}),cs.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},cs.default.createElement(x,{marginTop:1},cs.default.createElement(nT$,{agentName:L.agentType||"agent",currentColor:"automatic",onConfirm:I})))}var cs;var GlD=K(()=>{xH();lvA();IZ();CC();lB();j0();eB();$I();cs=b(s(),1)});function UlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG();BA("confirm:no",$,{context:"Confirmation"});let D=L.location==="userSettings"?[{label:"Enable (~/.claude/agent-memory/) (Recommended)",value:"user"},{label:"None (no persistent memory)",value:"none"},{label:"Project scope (.claude/agent-memory/)",value:"project"},{label:"Local scope (.claude/agent-memory-local/)",value:"local"}]:[{label:"Enable (.claude/agent-memory/) (Recommended)",value:"project"},{label:"None (no persistent memory)",value:"none"},{label:"User scope (~/.claude/agent-memory/)",value:"user"},{label:"Local scope (.claude/agent-memory-local/)",value:"local"}];return ls.default.createElement(n4,{subtitle:"Configure agent memory",footerText:ls.default.createElement(rA,null,ls.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),ls.default.createElement(s$,{shortcut:"Enter",action:"select"}),ls.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},ls.default.createElement(x,{marginTop:1},ls.default.createElement(QA,{key:"memory-select",options:D,onChange:(f)=>{let E=f==="none"?void 0:f,M=L.finalAgent?.agentType;A({selectedMemory:E,finalAgent:L.finalAgent?{...L.finalAgent,memory:E,getSystemPrompt:PG()&&E&&M?()=>L.systemPrompt+` `)}`:void 0;$(Y??"Agents dialog dismissed",{display:G.length===0?"system":void 0})},onSelect:(Y)=>L({mode:"agent-menu",agent:Y,previousMode:A}),onCreateNew:()=>L({mode:"create-agent"}),changes:G}),zD.createElement(GPH,null))}case"create-agent":return zD.createElement(WlD,{tools:X,existingAgents:M,onComplete:F,onCancel:()=>L({mode:"list-agents",source:"all"})});case"agent-menu":{let P=E.find((q)=>q.agentType===A.agent.agentType&&q.source===A.agent.source)||A.agent,C=P.source==="built-in",Y=[{label:"View agent",value:"view"},...!C?[{label:"Edit agent",value:"edit"},{label:"Delete agent",value:"delete"}]:[],{label:"Back",value:"back"}],Z=(q)=>{switch(q){case"view":L({mode:"view-agent",agent:P,previousMode:A.previousMode});break;case"edit":L({mode:"edit-agent",agent:P,previousMode:A});break;case"delete":L({mode:"delete-confirm",agent:P,previousMode:A});break;case"back":L(A.previousMode);break}};return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:A.agent.agentType},zD.createElement(x,{flexDirection:"column",marginTop:1},zD.createElement(QA,{options:Y,onChange:Z,onCancel:()=>L(A.previousMode)}),G.length>0&&zD.createElement(x,{marginTop:1},zD.createElement(V,{dimColor:!0},G[G.length-1])))),zD.createElement(GPH,null))}case"view-agent":{let P=E.find((C)=>C.agentType===A.agent.agentType&&C.source===A.agent.source)||A.agent;return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:P.agentType},zD.createElement(YlD,{agent:P,tools:X,allAgents:E,onBack:()=>L({mode:"agent-menu",agent:P,previousMode:A.previousMode})})),zD.createElement(GPH,{instructions:"Press Enter or Esc to go back"}))}case"delete-confirm":{let W=[{label:"Yes, delete",value:"yes"},{label:"No, cancel",value:"no"}];return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:"Delete agent",titleColor:"error",borderColor:"error"},zD.createElement(V,null,"Are you sure you want to delete the agent"," ",zD.createElement(V,{bold:!0},A.agent.agentType),"?"),zD.createElement(x,{marginTop:1},zD.createElement(V,{dimColor:!0},"Source: ",A.agent.source)),zD.createElement(x,{marginTop:1},zD.createElement(QA,{options:W,onChange:(P)=>{if(P==="yes")Q(A.agent);else if("previousMode"in A)L(A.previousMode)},onCancel:()=>{if("previousMode"in A)L(A.previousMode)}}))),zD.createElement(GPH,{instructions:"Press \u2191\u2193 to navigate, Enter to select, Esc to cancel"}))}case"edit-agent":{let P=E.find((C)=>C.agentType===A.agent.agentType&&C.source===A.agent.source)||A.agent;return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:`Edit agent: ${P.agentType}`},zD.createElement(PlD,{agent:P,tools:X,onSaved:(C)=>{F(C),L(A.previousMode)},onBack:()=>L(A.previousMode)})),zD.createElement(GPH,null))}default:return null}}var zD,ns;var TlD=K(()=>{xH();$I();r0();UM();kT();fPH();N1();kcD();VlD();_lD();ClD();_$();wlD();jvA();pL();ivA();zD=b(s(),1),ns=b(s(),1)});var zlD={};XA(zlD,{call:()=>cV1});async function cV1(H,$){let L=(await $.getAppState()).toolPermissionContext,I=yK(L);return nvA.createElement(qlD,{tools:I,onExit:H})}var nvA;var NlD=K(()=>{TlD();g7();nvA=b(s(),1)});var lV1,OlD;var xlD=K(()=>{lV1={type:"local-jsx",name:"agents",description:"Manage agent configurations",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (NlD(),zlD)),userFacingName(){return"agents"}},OlD=lV1});var SlD={};XA(SlD,{call:()=>iV1});async function iV1(H,$,A){return rvA.createElement(abD,{onComplete:H,args:A})}var rvA;var jlD=K(()=>{gRA();rvA=b(s(),1)});var nV1,RlD;var ylD=K(()=>{nV1={type:"local-jsx",name:"plugin",aliases:["plugins","marketplace"],description:"Manage Claude Code plugins",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (jlD(),SlD)),userFacingName(){return"plugin"}},RlD=nV1});var vlD={};XA(vlD,{call:()=>rV1});async function rV1(H,$){if(yD("rewind"),$.openMessageSelector)$.openMessageSelector();return{type:"skip"}}var hlD=K(()=>{yE()});var aV1,blD;var klD=K(()=>{aV1={description:"Restore the code and/or conversation to a previous point",name:"rewind",aliases:["checkpoint"],userFacingName:()=>"rewind",argumentHint:"",isEnabled:()=>!0,type:"local",isHidden:!1,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (hlD(),vlD))},blD=aV1});var ulD=()=>{};var glD=()=>{};var mlD=()=>{};var plD=K(()=>{g$()});var dlD=()=>{};function clD(){let H=vL.isSandboxingEnabled(),$=vL.checkDependencies(),A=$.warnings.length>0?T0.createElement(x,{marginTop:1,flexDirection:"column"},$.warnings.map((M,G)=>T0.createElement(V,{key:G,dimColor:!0},M))):null;if(!H)return T0.createElement(x,{flexDirection:"column",paddingY:1},T0.createElement(V,{color:"subtle"},"Sandbox is not enabled"),A);let L=vL.getFsReadConfig(),I=vL.getFsWriteConfig(),D=vL.getNetworkRestrictionConfig(),B=vL.getAllowUnixSockets(),f=vL.getExcludedCommands(),E=vL.getLinuxGlobPatternWarnings();return T0.createElement(x,{flexDirection:"column",paddingY:1},T0.createElement(x,{flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Excluded Commands:"),T0.createElement(V,{dimColor:!0},f.length>0?f.join(", "):"None")),L.denyOnly.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Filesystem Read Restrictions:"),T0.createElement(V,{dimColor:!0},"Denied: ",L.denyOnly.join(", "))),I.allowOnly.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Filesystem Write Restrictions:"),T0.createElement(V,{dimColor:!0},"Allowed: ",I.allowOnly.join(", ")),I.denyWithinAllow.length>0&&T0.createElement(V,{dimColor:!0},"Denied within allowed: ",I.denyWithinAllow.join(", "))),(D.allowedHosts&&D.allowedHosts.length>0||D.deniedHosts&&D.deniedHosts.length>0)&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Network Restrictions",PzH()?" (Managed)":"",":"),D.allowedHosts&&D.allowedHosts.length>0&&T0.createElement(V,{dimColor:!0},"Allowed: ",D.allowedHosts.join(", ")),D.deniedHosts&&D.deniedHosts.length>0&&T0.createElement(V,{dimColor:!0},"Denied: ",D.deniedHosts.join(", "))),B&&B.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Allowed Unix Sockets:"),T0.createElement(V,{dimColor:!0},B.join(", "))),E.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"warning"},"\u26A0 Warning: Glob patterns not fully supported on Linux"),T0.createElement(V,{dimColor:!0},"The following patterns will be ignored:"," ",E.slice(0,3).join(", "),E.length>3&&` (${E.length-3} more)`)),A)}var T0;var llD=K(()=>{xH();EM();T0=b(s(),1)});function ilD({onComplete:H}){let[$]=_I(),A=vL.isSandboxingEnabled(),L=vL.areUnsandboxedCommandsAllowed(),I=vL.areSandboxSettingsLockedByPolicy(),D=L?"open":"closed",B=ZL("success",$)("(current)"),f=[{label:D==="open"?`Allow unsandboxed fallback ${B}`:"Allow unsandboxed fallback",value:"open"},{label:D==="closed"?`Strict sandbox mode ${B}`:"Strict sandbox mode",value:"closed"}];async function E(M){let G=M;await vL.setSandboxSettings({allowUnsandboxedCommands:G==="open"}),H(G==="open"?"\u2713 Unsandboxed fallback allowed - commands can run outside sandbox when necessary":"\u2713 Strict sandbox mode - all commands must run in sandbox or be excluded via the `excludedCommands` option")}if(!A)return GW.default.createElement(x,{flexDirection:"column",paddingY:1},GW.default.createElement(V,{color:"subtle"},"Sandbox is not enabled. Enable sandbox to configure override settings."));if(I)return GW.default.createElement(x,{flexDirection:"column",paddingY:1},GW.default.createElement(V,{color:"subtle"},"Override settings are managed by a higher-priority configuration and cannot be changed locally."),GW.default.createElement(x,{marginTop:1},GW.default.createElement(V,{dimColor:!0},"Current setting:"," ",D==="closed"?"Strict sandbox mode":"Allow unsandboxed fallback")));return GW.default.createElement(x,{flexDirection:"column",paddingY:1},GW.default.createElement(x,{marginBottom:1},GW.default.createElement(V,{bold:!0},"Configure Overrides:")),GW.default.createElement(QA,{options:f,onChange:E,onCancel:()=>H(void 0,{display:"skip"})}),GW.default.createElement(x,{flexDirection:"column",marginTop:1,gap:1},GW.default.createElement(V,{dimColor:!0},GW.default.createElement(V,{bold:!0,dimColor:!0},"Allow unsandboxed fallback:")," ","When a command fails due to sandbox restrictions, Claude can retry with dangerouslyDisableSandbox to run outside the sandbox (falling back to default permissions)."),GW.default.createElement(V,{dimColor:!0},GW.default.createElement(V,{bold:!0,dimColor:!0},"Strict sandbox mode:")," ","All bash commands invoked by the model must run in the sandbox unless they are explicitly listed in excludedCommands."),GW.default.createElement(V,{dimColor:!0},"Learn more:"," ",GW.default.createElement(dI,{url:"https://code.claude.com/docs/en/sandboxing#configure-sandboxing"},"code.claude.com/docs/en/sandboxing#configure-sandboxing"))))}var GW;var nlD=K(()=>{xH();N1();EM();xH();GW=b(s(),1)});function avA({depCheck:H}){let $=H.errors.some((I)=>I.includes("bwrap")),A=H.errors.some((I)=>I.includes("socat")),L=H.warnings.length>0;return hJ.default.createElement(x,{flexDirection:"column",paddingY:1,gap:1},hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,null,"bubblewrap (bwrap):"," ",$?hJ.default.createElement(V,{color:"error"},"not installed"):hJ.default.createElement(V,{color:"success"},"installed")),$&&hJ.default.createElement(V,{dimColor:!0}," ","\xB7 apt install bubblewrap")),hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,null,"socat:"," ",A?hJ.default.createElement(V,{color:"error"},"not installed"):hJ.default.createElement(V,{color:"success"},"installed")),A&&hJ.default.createElement(V,{dimColor:!0}," ","\xB7 apt install socat")),hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,null,"seccomp filter:"," ",L?hJ.default.createElement(V,{color:"warning"},"not installed"):hJ.default.createElement(V,{color:"success"},"installed"),L&&hJ.default.createElement(V,{dimColor:!0}," (required to block unix domain sockets)")),L&&hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,{dimColor:!0}," ","\xB7 npm install -g @anthropic-ai/sandbox-runtime"),hJ.default.createElement(V,{dimColor:!0}," ","\xB7 or copy vendor/seccomp/* from sandbox-runtime and set"),hJ.default.createElement(V,{dimColor:!0}," ","sandbox.seccomp.bpfPath and applyPath in settings.json"))))}var hJ;var rlD=K(()=>{xH();hJ=b(s(),1)});function alD({onComplete:H,depCheck:$}){let[A]=_I(),L=vL.isSandboxingEnabled(),I=vL.isAutoAllowBashIfSandboxedEnabled(),D=$.warnings.length>0,f=VL().sandbox?.network?.allowAllUnixSockets,E=D&&!f,G=(()=>{if(!L)return"disabled";if(I)return"auto-allow";return"regular"})(),U=ZL("success",A)("(current)"),X=[{label:G==="auto-allow"?`Sandbox BashTool, with auto-allow ${U}`:"Sandbox BashTool, with auto-allow",value:"auto-allow"},{label:G==="regular"?`Sandbox BashTool, with regular permissions ${U}`:"Sandbox BashTool, with regular permissions",value:"regular"},{label:G==="disabled"?`No Sandbox ${U}`:"No Sandbox",value:"disabled"}];async function J(Y){switch(Y){case"auto-allow":await vL.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!0}),H("\u2713 Sandbox enabled with auto-allow for bash commands");break;case"regular":await vL.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!1}),H("\u2713 Sandbox enabled with regular bash permissions");break;case"disabled":await vL.setSandboxSettings({enabled:!1,autoAllowBashIfSandboxed:!1}),H("\u25CB Sandbox disabled");break}}bI({"confirm:no":()=>H(void 0,{display:"skip"})},{context:"Settings"});let F=yG.default.createElement(WU,{key:"mode",title:"Mode"},yG.default.createElement(x,{flexDirection:"column",paddingY:1},E&&yG.default.createElement(x,{marginBottom:1},yG.default.createElement(V,{color:"warning"},"Cannot block unix domain sockets (see Dependencies tab)")),yG.default.createElement(x,{marginBottom:1},yG.default.createElement(V,{bold:!0},"Configure Mode:")),yG.default.createElement(QA,{options:X,onChange:J,onCancel:()=>H(void 0,{display:"skip"})}),yG.default.createElement(x,{flexDirection:"column",marginTop:1,gap:1},yG.default.createElement(V,{dimColor:!0},yG.default.createElement(V,{bold:!0,dimColor:!0},"Auto-allow mode:")," ","Commands will try to run in the sandbox automatically, and attempts to run outside of the sandbox fallback to regular permissions. Explicit ask/deny rules are always respected."),yG.default.createElement(V,{dimColor:!0},"Learn more:"," ",yG.default.createElement(dI,{url:"https://code.claude.com/docs/en/sandboxing"},"code.claude.com/docs/en/sandboxing"))))),Q=yG.default.createElement(WU,{key:"overrides",title:"Overrides"},yG.default.createElement(ilD,{onComplete:H})),W=yG.default.createElement(WU,{key:"config",title:"Config"},yG.default.createElement(clD,null)),C=$.errors.length>0?[yG.default.createElement(WU,{key:"dependencies",title:"Dependencies"},yG.default.createElement(avA,{depCheck:$}))]:[F,...D?[yG.default.createElement(WU,{key:"dependencies",title:"Dependencies"},yG.default.createElement(avA,{depCheck:$}))]:[],Q,W];return yG.default.createElement(x,{flexDirection:"column"},yG.default.createElement(Zz,{title:"Sandbox:",color:"permission",defaultTab:"Mode"},C))}var yG;var olD=K(()=>{xH();N1();EM();J1H();xH();llD();nlD();rlD();$I();mL();yG=b(s(),1)});var elD={};XA(elD,{call:()=>oV1});async function oV1(H,$,A){let I=VL().theme||"light",D=oA();if(!vL.isSupportedPlatform()){let E=D==="wsl"?"Error: Sandboxing requires WSL2. WSL1 is not supported.":"Error: Sandboxing is currently only supported on macOS, Linux, and WSL2.",M=ZL("error",I)(E);return H(M),null}let B=vL.checkDependencies();if(!vL.isPlatformInEnabledList()){let E=ZL("error",I)(`Error: Sandboxing is disabled for this platform (${D}) via the enabledPlatforms setting.`);return H(E),null}if(vL.areSandboxSettingsLockedByPolicy()){let E=ZL("error",I)("Error: Sandbox settings are overridden by a higher-priority configuration and cannot be changed locally.");return H(E),null}let f=A?.trim()||"";if(!f)return slD.default.createElement(alD,{onComplete:H,depCheck:B});if(f){let M=f.split(" ")[0];if(M==="exclude"){let G=f.slice(8).trim();if(!G){let Q=ZL("error",I)('Error: Please provide a command pattern to exclude (e.g., /sandbox exclude "npm run test:*")');return H(Q),null}let U=G.replace(/^["']|["']$/g,"");maL(U);let X=aM("localSettings"),J=X?tlD.relative(HR(),X):".claude/settings.local.json",F=ZL("success",I)(`Added "${U}" to excluded commands in ${J}`);return H(F),null}else{let G=ZL("error",I)(`Error: Unknown subcommand "${M}". Available subcommand: exclude`);return H(G),null}}return null}var tlD,slD;var HiD=K(()=>{EM();xH();mL();g$();olD();Z9();tlD=b(require("path")),slD=b(s(),1)});var tV1,$iD;var AiD=K(()=>{EM();jI();tV1={name:"sandbox",get description(){let H=vL.isSandboxingEnabled(),$=vL.isAutoAllowBashIfSandboxedEnabled(),A=vL.areUnsandboxedCommandsAllowed(),L=vL.areSandboxSettingsLockedByPolicy(),I=vL.checkDependencies().errors.length===0,D;if(!I)D=pH.warning;else D=H?pH.tick:pH.circle;let B="sandbox disabled";if(H)B=$?"sandbox enabled (auto-allow)":"sandbox enabled",B+=A?", fallback allowed":"";if(L)B+=" (managed)";return`${D} ${B} (\u23CE to configure)`},argumentHint:'exclude "command pattern"',isEnabled:()=>!0,isHidden:!vL.isSupportedPlatform()||!vL.isPlatformInEnabledList(),immediate:!0,type:"local-jsx",userFacingName:()=>"sandbox",load:()=>Promise.resolve().then(() => (HiD(),elD))},$iD=tV1});class ovA{ws=null;connected=!1;authenticated=!1;connecting=!1;reconnectTimer=null;reconnectAttempts=0;pendingCalls=new Map;notificationHandler=null;context;permissionMode="ask";allowedDomains;tabsContextCollectionTimeoutMs=2000;toolCallTimeoutMs=120000;constructor(H){if(this.context=H,H.initialPermissionMode)this.permissionMode=H.initialPermissionMode}async ensureConnected(){let{logger:H,serverName:$}=this.context;if(H.info(`[${$}] ensureConnected called, connected=${this.connected}, authenticated=${this.authenticated}, wsState=${this.ws?.readyState}`),this.connected&&this.authenticated&&this.ws?.readyState===smH.default.OPEN)return H.info(`[${$}] Already connected and authenticated`),!0;if(!this.connecting)H.info(`[${$}] Not connecting, starting connection...`),await this.connect();else H.info(`[${$}] Already connecting, waiting...`);return new Promise((A)=>{let L=setTimeout(()=>{H.info(`[${$}] Connection timeout, connected=${this.connected}, authenticated=${this.authenticated}`),A(!1)},1e4),I=()=>{if(this.connected&&this.authenticated)H.info(`[${$}] Connection successful`),clearTimeout(L),A(!0);else if(!this.connecting)H.info(`[${$}] No longer connecting, giving up`),clearTimeout(L),A(!1);else setTimeout(I,200)};I()})}async callTool(H,$){let{logger:A,serverName:L}=this.context;if(!this.ws||this.ws.readyState!==smH.default.OPEN)throw Error(`[${L}] Bridge not connected`);let I=crypto.randomUUID(),D=H==="tabs_context_mcp";return new Promise((B,f)=>{let E=setTimeout(()=>{let G=this.pendingCalls.get(I);if(G)if(this.pendingCalls.delete(I),D&&G.results.length>0)B(this.mergeTabsResults(G.results));else f(Error(`[${L}] Tool call timed out: ${H}`))},D?this.tabsContextCollectionTimeoutMs:this.toolCallTimeoutMs);this.pendingCalls.set(I,{resolve:B,reject:f,timer:E,results:[],isTabsContext:D});let M={type:"tool_call",tool_use_id:I,client_type:this.context.clientTypeId,tool:H,args:$,permission_mode:this.permissionMode};if(this.allowedDomains?.length)M.allowed_domains=this.allowedDomains;A.debug(`[${L}] Sending tool_call: ${H} (${I.slice(0,8)})`),this.ws.send(JSON.stringify(M))})}isConnected(){return this.connected&&this.authenticated&&this.ws?.readyState===smH.default.OPEN}disconnect(){this.cleanup()}setNotificationHandler(H){this.notificationHandler=H}async setPermissionMode(H,$){this.permissionMode=H,this.allowedDomains=$}async connect(){let{logger:H,serverName:$,bridgeConfig:A}=this.context;if(!A){H.error(`[${$}] No bridge config provided`);return}if(this.connecting)return;this.connecting=!0,this.authenticated=!1,this.closeSocket();let L,I;if(A.devUserId)L=A.devUserId;else{let B=await A.getUserId();if(!B){H.error(`[${$}] No user ID available`),this.connecting=!1,this.context.onAuthenticationError?.();return}if(L=B,I=await A.getOAuthToken(),!I){H.error(`[${$}] No OAuth token available`),this.connecting=!1,this.context.onAuthenticationError?.();return}}let D=`${A.url}/chrome/${L}`;H.info(`[${$}] Connecting to bridge: ${D}`);try{this.ws=new smH.default(D)}catch(B){this.connecting=!1,H.error(`[${$}] Failed to create WebSocket:`,B),this.scheduleReconnect();return}this.ws.on("open",()=>{H.info(`[${$}] WebSocket connected, sending connect`);let B={type:"connect",client_type:this.context.clientTypeId};if(A.devUserId)B.dev_user_id=A.devUserId;else B.oauth_token=I;this.ws?.send(JSON.stringify(B))}),this.ws.on("message",(B)=>{try{let f=JSON.parse(B.toString());H.debug(`[${$}] Bridge received: ${JSON.stringify(f)}`),this.handleMessage(f)}catch(f){H.error(`[${$}] Failed to parse message:`,f)}}),this.ws.on("close",(B)=>{H.info(`[${$}] Bridge connection closed (code: ${B})`),this.connected=!1,this.authenticated=!1,this.connecting=!1,this.scheduleReconnect()}),this.ws.on("error",(B)=>{H.error(`[${$}] Bridge WebSocket error: ${B.message}`),this.connected=!1,this.authenticated=!1,this.connecting=!1})}handleMessage(H){let{logger:$,serverName:A}=this.context;switch(H.type){case"paired":$.info(`[${A}] Paired with Chrome extension`),this.connected=!0,this.authenticated=!0,this.connecting=!1,this.reconnectAttempts=0;break;case"waiting":$.info(`[${A}] Waiting for Chrome extension to connect`),this.connected=!0,this.authenticated=!0,this.connecting=!1,this.reconnectAttempts=0;break;case"peer_connected":$.info(`[${A}] Chrome extension connected`);break;case"peer_disconnected":$.info(`[${A}] Chrome extension disconnected`);break;case"ping":this.ws?.send(JSON.stringify({type:"pong"}));break;case"pong":break;case"tool_result":this.handleToolResult(H);break;case"notification":if(this.notificationHandler)this.notificationHandler({method:H.method,params:H.params});break;case"error":$.error(`[${A}] Bridge error: ${H.error}`);break;default:$.debug(`[${A}] Unknown bridge message type: ${H.type}`)}}handleToolResult(H){let $=H.tool_use_id;if(!$)return;let A=this.pendingCalls.get($);if(!A)return;let L=this.normalizeBridgeResponse(H);if(A.isTabsContext)A.results.push(L);else clearTimeout(A.timer),this.pendingCalls.delete($),A.resolve(L)}normalizeBridgeResponse(H){if(H.result||H.error)return H;if(H.content){if(H.is_error)return{error:{content:H.content}};return{result:{content:H.content}}}return H}mergeTabsResults(H){let $=[];for(let A of H){let D=A.result?.content;if(!D||!Array.isArray(D))continue;for(let B of D)if(B.type==="text"&&B.text)try{let f=JSON.parse(B.text);if(Array.isArray(f))$.push(...f);else if(f?.availableTabs&&Array.isArray(f.availableTabs))$.push(...f.availableTabs)}catch{}}if($.length>0){let A=$.map((L)=>{let I=L;return` \u2022 tabId ${I.tabId}: "${I.title}" (${I.url})`}).join(` * Make sure to click any buttons, links, icons, etc with the cursor tip in the center of the element. Don't click boxes on their edges unless asked.`,inputSchema:{type:"object",properties:{action:{type:"string",enum:["left_click","right_click","type","screenshot","wait","scroll","key","left_click_drag","double_click","triple_click","zoom","scroll_to","hover"],description:"The action to perform:\n* `left_click`: Click the left mouse button at the specified coordinates.\n* `right_click`: Click the right mouse button at the specified coordinates to open context menus.\n* `double_click`: Double-click the left mouse button at the specified coordinates.\n* `triple_click`: Triple-click the left mouse button at the specified coordinates.\n* `type`: Type a string of text.\n* `screenshot`: Take a screenshot of the screen.\n* `wait`: Wait for a specified number of seconds.\n* `scroll`: Scroll up, down, left, or right at the specified coordinates.\n* `key`: Press a specific keyboard key.\n* `left_click_drag`: Drag from start_coordinate to coordinate.\n* `zoom`: Take a screenshot of a specific region for closer inspection.\n* `scroll_to`: Scroll an element into view using its element reference ID from read_page or find tools.\n* `hover`: Move the mouse cursor to the specified coordinates or element without clicking. Useful for revealing tooltips, dropdown menus, or triggering hover states."},coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates. Required for `left_click`, `right_click`, `double_click`, `triple_click`, and `scroll`. For `left_click_drag`, this is the end position."},text:{type:"string",description:'The text to type (for `type` action) or the key(s) to press (for `key` action). For `key` action: Provide space-separated keys (e.g., "Backspace Backspace Delete"). Supports keyboard shortcuts using the platform\'s modifier key (use "cmd" on Mac, "ctrl" on Windows/Linux, e.g., "cmd+a" or "ctrl+a" for select all).'},duration:{type:"number",minimum:0,maximum:30,description:"The number of seconds to wait. Required for `wait`. Maximum 30 seconds."},scroll_direction:{type:"string",enum:["up","down","left","right"],description:"The direction to scroll. Required for `scroll`."},scroll_amount:{type:"number",minimum:1,maximum:10,description:"The number of scroll wheel ticks. Optional for `scroll`, defaults to 3."},start_coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y): The starting coordinates for `left_click_drag`."},region:{type:"array",items:{type:"number"},minItems:4,maxItems:4,description:"(x0, y0, x1, y1): The rectangular region to capture for `zoom`. Coordinates define a rectangle from top-left (x0, y0) to bottom-right (x1, y1) in pixels from the viewport origin. Required for `zoom` action. Useful for inspecting small UI elements like icons, buttons, or text."},repeat:{type:"number",minimum:1,maximum:100,description:"Number of times to repeat the key sequence. Only applicable for `key` action. Must be a positive integer between 1 and 100. Default is 1. Useful for navigation tasks like pressing arrow keys multiple times."},ref:{type:"string",description:'Element reference ID from read_page or find tools (e.g., "ref_1", "ref_2"). Required for `scroll_to` action. Can be used as alternative to `coordinate` for click actions.'},modifiers:{type:"string",description:'Modifier keys for click actions. Supports: "ctrl", "shift", "alt", "cmd" (or "meta"), "win" (or "windows"). Can be combined with "+" (e.g., "ctrl+shift", "cmd+alt"). Optional.'},tabId:{type:"number",description:"Tab ID to execute the action on. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["action","tabId"]}},{name:"navigate",description:"Navigate to a URL, or go forward/back in browser history. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{url:{type:"string",description:'The URL to navigate to. Can be provided with or without protocol (defaults to https://). Use "forward" to go forward in history or "back" to go back in history.'},tabId:{type:"number",description:"Tab ID to navigate. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["url","tabId"]}},{name:"resize_window",description:"Resize the current browser window to specified dimensions. Useful for testing responsive designs or setting up specific screen sizes. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{width:{type:"number",description:"Target window width in pixels"},height:{type:"number",description:"Target window height in pixels"},tabId:{type:"number",description:"Tab ID to get the window for. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["width","height","tabId"]}},{name:"gif_creator",description:"Manage GIF recording and export for browser automation sessions. Control when to start/stop recording browser actions (clicks, scrolls, navigation), then export as an animated GIF with visual overlays (click indicators, action labels, progress bar, watermark). All operations are scoped to the tab's group. When starting recording, take a screenshot immediately after to capture the initial state as the first frame. When stopping recording, take a screenshot immediately before to capture the final state as the last frame. For export, either provide 'coordinate' to drag/drop upload to a page element, or set 'download: true' to download the GIF.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["start_recording","stop_recording","export","clear"],description:"Action to perform: 'start_recording' (begin capturing), 'stop_recording' (stop capturing but keep frames), 'export' (generate and export GIF), 'clear' (discard frames)"},tabId:{type:"number",description:"Tab ID to identify which tab group this operation applies to"},download:{type:"boolean",description:"Always set this to true for the 'export' action only. This causes the gif to be downloaded in the browser."},filename:{type:"string",description:"Optional filename for exported GIF (default: 'recording-[timestamp].gif'). For 'export' action only."},options:{type:"object",description:"Optional GIF enhancement options for 'export' action. Properties: showClickIndicators (bool), showDragPaths (bool), showActionLabels (bool), showProgressBar (bool), showWatermark (bool), quality (number 1-30). All default to true except quality (default: 10).",properties:{showClickIndicators:{type:"boolean",description:"Show orange circles at click locations (default: true)"},showDragPaths:{type:"boolean",description:"Show red arrows for drag actions (default: true)"},showActionLabels:{type:"boolean",description:"Show black labels describing actions (default: true)"},showProgressBar:{type:"boolean",description:"Show orange progress bar at bottom (default: true)"},showWatermark:{type:"boolean",description:"Show Claude logo watermark (default: true)"},quality:{type:"number",description:"GIF compression quality, 1-30 (lower = better quality, slower encoding). Default: 10"}}}},required:["action","tabId"]}},{name:"upload_image",description:"Upload a previously captured screenshot or user-uploaded image to a file input or drag & drop target. Supports two approaches: (1) ref - for targeting specific elements, especially hidden file inputs, (2) coordinate - for drag & drop to visible locations like Google Docs. Provide either ref or coordinate, not both.",inputSchema:{type:"object",properties:{imageId:{type:"string",description:"ID of a previously captured screenshot (from the computer tool's screenshot action) or a user-uploaded image"},ref:{type:"string",description:'Element reference ID from read_page or find tools (e.g., "ref_1", "ref_2"). Use this for file inputs (especially hidden ones) or specific elements. Provide either ref or coordinate, not both.'},coordinate:{type:"array",items:{type:"number"},description:"Viewport coordinates [x, y] for drag & drop to a visible location. Use this for drag & drop targets like Google Docs. Provide either ref or coordinate, not both."},tabId:{type:"number",description:"Tab ID where the target element is located. This is where the image will be uploaded to."},filename:{type:"string",description:'Optional filename for the uploaded file (default: "image.png")'}},required:["imageId","tabId"]}},{name:"get_page_text",description:"Extract raw text content from the page, prioritizing article content. Ideal for reading articles, blog posts, or other text-heavy pages. Returns plain text without HTML formatting. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to extract text from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["tabId"]}},{name:"tabs_context_mcp",title:"Tabs Context",description:"Get context information about the current MCP tab group. Returns all tab IDs inside the group if it exists. CRITICAL: You must get the context at least once before using other browser automation tools so you know what tabs exist. Each new conversation should create its own new tab (using tabs_create_mcp) rather than reusing existing tabs, unless the user explicitly asks to use an existing tab.",inputSchema:{type:"object",properties:{createIfEmpty:{type:"boolean",description:"Creates a new MCP tab group if none exists, creates a new Window with a new tab group containing an empty tab (which can be used for this conversation). If a MCP tab group already exists, this parameter has no effect."}},required:[]}},{name:"tabs_create_mcp",title:"Tabs Create",description:"Creates a new empty tab in the MCP tab group. CRITICAL: You must get the context using tabs_context_mcp at least once before using other browser automation tools so you know what tabs exist.",inputSchema:{type:"object",properties:{},required:[]}},{name:"update_plan",description:"Present a plan to the user for approval before taking actions. The user will see the domains you intend to visit and your approach. Once approved, you can proceed with actions on the approved domains without additional permission prompts.",inputSchema:{type:"object",properties:{domains:{type:"array",items:{type:"string"},description:"List of domains you will visit (e.g., ['github.com', 'stackoverflow.com']). These domains will be approved for the session when the user accepts the plan."},approach:{type:"array",items:{type:"string"},description:"High-level description of what you will do. Focus on outcomes and key actions, not implementation details. Be concise - aim for 3-7 items."}},required:["domains","approach"]}},{name:"read_console_messages",description:"Read browser console messages (console.log, console.error, console.warn, etc.) from a specific tab. Useful for debugging JavaScript errors, viewing application logs, or understanding what's happening in the browser console. Returns console messages from the current domain only. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs. IMPORTANT: Always provide a pattern to filter messages - without a pattern, you may get too many irrelevant messages.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to read console messages from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."},onlyErrors:{type:"boolean",description:"If true, only return error and exception messages. Default is false (return all message types)."},clear:{type:"boolean",description:"If true, clear the console messages after reading to avoid duplicates on subsequent calls. Default is false."},pattern:{type:"string",description:"Regex pattern to filter console messages. Only messages matching this pattern will be returned (e.g., 'error|warning' to find errors and warnings, 'MyApp' to filter app-specific logs). You should always provide a pattern to avoid getting too many irrelevant messages."},limit:{type:"number",description:"Maximum number of messages to return. Defaults to 100. Increase only if you need more results."}},required:["tabId"]}},{name:"read_network_requests",description:"Read HTTP network requests (XHR, Fetch, documents, images, etc.) from a specific tab. Useful for debugging API calls, monitoring network activity, or understanding what requests a page is making. Returns all network requests made by the current page, including cross-origin requests. Requests are automatically cleared when the page navigates to a different domain. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to read network requests from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."},urlPattern:{type:"string",description:"Optional URL pattern to filter requests. Only requests whose URL contains this string will be returned (e.g., '/api/' to filter API calls, 'example.com' to filter by domain)."},clear:{type:"boolean",description:"If true, clear the network requests after reading to avoid duplicates on subsequent calls. Default is false."},limit:{type:"number",description:"Maximum number of requests to return. Defaults to 100. Increase only if you need more results."}},required:["tabId"]}},{name:"shortcuts_list",description:"List all available shortcuts and workflows (shortcuts and workflows are interchangeable). Returns shortcuts with their commands, descriptions, and whether they are workflows. Use shortcuts_execute to run a shortcut or workflow.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to list shortcuts from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["tabId"]}},{name:"shortcuts_execute",description:"Execute a shortcut or workflow by running it in a new sidepanel window using the current tab (shortcuts and workflows are interchangeable). Use shortcuts_list first to see available shortcuts. This starts the execution and returns immediately - it does not wait for completion.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to execute the shortcut on. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."},shortcutId:{type:"string",description:"The ID of the shortcut to execute"},command:{type:"string",description:"The command name of the shortcut to execute (e.g., 'debug', 'summarize'). Do not include the leading slash."}},required:["tabId"]}}]});class HhA{constructor(H){this._server=H}requestStream(H,$,A){return this._server.requestStream(H,$,A)}async getTask(H,$){return this._server.getTask({taskId:H},$)}async getTaskResult(H,$,A){return this._server.getTaskResult({taskId:H},$,A)}async listTasks(H,$){return this._server.listTasks(H?{cursor:H}:void 0,$)}async cancelTask(H,$){return this._server.cancelTask({taskId:H},$)}}var emH;var $hA=K(()=>{MJA();CK();cFA();sSH();emH=class emH extends UjH{constructor(H,$){var A,L;super($);if(this._serverInfo=H,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(EjH.options.map((I,D)=>[I,D])),this.isMessageIgnored=(I,D)=>{let B=this._loggingLevels.get(D);return B?this.LOG_LEVEL_SEVERITY.get(I)this._oninitialize(I)),this.setNotificationHandler(D5$,()=>{var I;return(I=this.oninitialized)===null||I===void 0?void 0:I.call(this)}),this._capabilities.logging)this.setRequestHandler(jXA,async(I,D)=>{var B;let f=D.sessionId||((B=D.requestInfo)===null||B===void 0?void 0:B.headers["mcp-session-id"])||void 0,{level:E}=I.params,M=EjH.safeParse(E);if(M.success)this._loggingLevels.set(f,M.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new HhA(this)};return this._experimental}registerCapabilities(H){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=P5$(this._capabilities,H)}setRequestHandler(H,$){var A,L,I;let D=yFH(H),B=D===null||D===void 0?void 0:D.method;if(!B)throw Error("Schema is missing a method literal");let f;if(ar(B)){let M=B,G=(A=M._zod)===null||A===void 0?void 0:A.def;f=(L=G===null||G===void 0?void 0:G.value)!==null&&L!==void 0?L:M.value}else{let M=B,G=M._def;f=(I=G===null||G===void 0?void 0:G.value)!==null&&I!==void 0?I:M.value}if(typeof f!=="string")throw Error("Schema method literal must be a string");if(f==="tools/call"){let M=async(G,U)=>{let X=BP(YDH,G);if(!X.success){let W=X.error instanceof Error?X.error.message:String(X.error);throw new KB(V0.InvalidParams,`Invalid tools/call request: ${W}`)}let{params:J}=X.data,F=await Promise.resolve($(G,U));if(J.task){let W=BP(eg,F);if(!W.success){let P=W.error instanceof Error?W.error.message:String(W.error);throw new KB(V0.InvalidParams,`Invalid task creation result: ${P}`)}return W.data}let Q=BP(fP,F);if(!Q.success){let W=Q.error instanceof Error?Q.error.message:String(Q.error);throw new KB(V0.InvalidParams,`Invalid tools/call result: ${W}`)}return Q.data};return super.setRequestHandler(H,M)}return super.setRequestHandler(H,$)}assertCapabilityForMethod(H){var $,A,L;switch(H){case"sampling/createMessage":if(!(($=this._clientCapabilities)===null||$===void 0?void 0:$.sampling))throw Error(`Client does not support sampling (required for ${H})`);break;case"elicitation/create":if(!((A=this._clientCapabilities)===null||A===void 0?void 0:A.elicitation))throw Error(`Client does not support elicitation (required for ${H})`);break;case"roots/list":if(!((L=this._clientCapabilities)===null||L===void 0?void 0:L.roots))throw Error(`Client does not support listing roots (required for ${H})`);break;case"ping":break}}assertNotificationCapability(H){var $,A;switch(H){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${H})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${H})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${H})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${H})`);break;case"notifications/elicitation/complete":if(!((A=($=this._clientCapabilities)===null||$===void 0?void 0:$.elicitation)===null||A===void 0?void 0:A.url))throw Error(`Client does not support URL elicitation (required for ${H})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(H){if(!this._capabilities)return;switch(H){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${H})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${H})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${H})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${H})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${H})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${H})`);break;case"ping":case"initialize":break}}assertTaskCapability(H){var $,A;DX$((A=($=this._clientCapabilities)===null||$===void 0?void 0:$.tasks)===null||A===void 0?void 0:A.requests,H,"Client")}assertTaskHandlerCapability(H){var $;if(!this._capabilities)return;IX$(($=this._capabilities.tasks)===null||$===void 0?void 0:$.requests,H,"Server")}async _oninitialize(H){let $=H.params.protocolVersion;return this._clientCapabilities=H.params.capabilities,this._clientVersion=H.params.clientInfo,{protocolVersion:$5$.includes($)?$:or,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},sg)}async createMessage(H,$){var A,L;if(H.tools||H.toolChoice){if(!((L=(A=this._clientCapabilities)===null||A===void 0?void 0:A.sampling)===null||L===void 0?void 0:L.tools))throw Error("Client does not support sampling tools capability.")}if(H.messages.length>0){let I=H.messages[H.messages.length-1],D=Array.isArray(I.content)?I.content:[I.content],B=D.some((G)=>G.type==="tool_result"),f=H.messages.length>1?H.messages[H.messages.length-2]:void 0,E=f?Array.isArray(f.content)?f.content:[f.content]:[],M=E.some((G)=>G.type==="tool_use");if(B){if(D.some((G)=>G.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!M)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(M){let G=new Set(E.filter((X)=>X.type==="tool_use").map((X)=>X.id)),U=new Set(D.filter((X)=>X.type==="tool_result").map((X)=>X.toolUseId));if(G.size!==U.size||![...G].every((X)=>U.has(X)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(H.tools)return this.request({method:"sampling/createMessage",params:H},yXA,$);return this.request({method:"sampling/createMessage",params:H},MjH,$)}async elicitInput(H,$){var A,L,I,D,B;switch((A=H.mode)!==null&&A!==void 0?A:"form"){case"url":{if(!((I=(L=this._clientCapabilities)===null||L===void 0?void 0:L.elicitation)===null||I===void 0?void 0:I.url))throw Error("Client does not support url elicitation.");let E=H;return this.request({method:"elicitation/create",params:E},bFH,$)}case"form":{if(!((B=(D=this._clientCapabilities)===null||D===void 0?void 0:D.elicitation)===null||B===void 0?void 0:B.form))throw Error("Client does not support form elicitation.");let E=H.mode==="form"?H:{...H,mode:"form"},M=await this.request({method:"elicitation/create",params:E},bFH,$);if(M.action==="accept"&&M.content&&E.requestedSchema)try{let U=this._jsonSchemaValidator.getValidator(E.requestedSchema)(M.content);if(!U.valid)throw new KB(V0.InvalidParams,`Elicitation response content does not match requested schema: ${U.errorMessage}`)}catch(G){if(G instanceof KB)throw G;throw new KB(V0.InternalError,`Error validating elicitation response: ${G instanceof Error?G.message:String(G)}`)}return M}}}createElicitationCompletionNotifier(H,$){var A,L;if(!((L=(A=this._clientCapabilities)===null||A===void 0?void 0:A.elicitation)===null||L===void 0?void 0:L.url))throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:H}},$)}async listRoots(H,$){return this.request({method:"roots/list",params:H},bXA,$)}async sendLoggingMessage(H,$){if(this._capabilities.logging){if(!this.isMessageIgnored(H.level,$))return this.notification({method:"notifications/message",params:H})}}async sendResourceUpdated(H){return this.notification({method:"notifications/resources/updated",params:H})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function sV1(H){return"result"in H||"error"in H}function eV1(H){return"method"in H&&typeof H.method==="string"}class BiD{socket=null;connected=!1;connecting=!1;responseCallback=null;notificationHandler=null;responseBuffer=Buffer.alloc(0);reconnectAttempts=0;maxReconnectAttempts=10;reconnectDelay=1000;reconnectTimer=null;context;disableAutoReconnect=!1;constructor(H){this.context=H}async connect(){let{serverName:H,logger:$}=this.context;if(this.connecting){$.info(`[${H}] Already connecting, skipping duplicate attempt`);return}this.closeSocket(),this.connecting=!0;let A=this.context.getSocketPath?.()??this.context.socketPath;$.info(`[${H}] Attempting to connect to: ${A}`);try{await this.validateSocketSecurity(A)}catch(I){this.connecting=!1,$.info(`[${H}] Security validation failed:`,I);return}this.socket=LiD.createConnection(A);let L=setTimeout(()=>{if(!this.connected)$.info(`[${H}] Connection attempt timed out after 5000ms`),this.closeSocket(),this.scheduleReconnect()},5000);this.socket.on("connect",()=>{clearTimeout(L),this.connected=!0,this.connecting=!1,this.reconnectAttempts=0,$.info(`[${H}] Successfully connected to bridge server`)}),this.socket.on("data",(I)=>{this.responseBuffer=Buffer.concat([this.responseBuffer,I]);while(this.responseBuffer.length>=4){let D=this.responseBuffer.readUInt32LE(0);if(this.responseBuffer.length<4+D)break;let B=this.responseBuffer.slice(4,4+D);this.responseBuffer=this.responseBuffer.slice(4+D);try{let f=JSON.parse(B.toString("utf-8"));if(eV1(f)){if($.info(`[${H}] Received notification: ${f.method}`),this.notificationHandler)this.notificationHandler(f)}else if(sV1(f))$.info(`[${H}] Received tool response: ${f}`),this.handleResponse(f);else $.info(`[${H}] Received unknown message: ${f}`)}catch(f){$.info(`[${H}] Failed to parse message:`,f)}}}),this.socket.on("error",(I)=>{if(clearTimeout(L),$.info(`[${H}] Socket error (code: ${I.code}):`,I),this.connected=!1,this.connecting=!1,I.code&&["ECONNREFUSED","ECONNRESET","EPIPE","ENOENT","EOPNOTSUPP","ECONNABORTED"].includes(I.code))this.scheduleReconnect()}),this.socket.on("close",()=>{clearTimeout(L),this.connected=!1,this.connecting=!1,this.scheduleReconnect()})}scheduleReconnect(){let{serverName:H,logger:$}=this.context;if(this.disableAutoReconnect)return;if(this.reconnectTimer){$.info(`[${H}] Reconnect already scheduled, skipping`);return}this.reconnectAttempts++;let A=100;if(this.reconnectAttempts>A){$.info(`[${H}] Giving up after ${A} attempts. Will retry on next tool call.`),this.reconnectAttempts=0;return}let L=Math.min(this.reconnectDelay*Math.pow(1.5,this.reconnectAttempts-1),30000);if(this.reconnectAttempts<=this.maxReconnectAttempts)$.info(`[${H}] Reconnecting in ${Math.round(L)}ms (attempt ${this.reconnectAttempts})`);else if(this.reconnectAttempts%10===0)$.info(`[${H}] Still polling for native host (attempt ${this.reconnectAttempts})`);this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},L)}handleResponse(H){if(this.responseCallback){let $=this.responseCallback;this.responseCallback=null,$(H)}}setNotificationHandler(H){this.notificationHandler=H}async ensureConnected(){let{serverName:H}=this.context;if(this.connected&&this.socket)return!0;if(!this.socket&&!this.connecting)await this.connect();return new Promise(($,A)=>{let L=null,I=setTimeout(()=>{if(L)clearTimeout(L);A(new Xj(`[${H}] Connection attempt timed out after 5000ms`))},5000),D=()=>{if(this.connected)clearTimeout(I),$(!0);else L=setTimeout(D,500)};D()})}async sendRequest(H,$=30000){let{serverName:A}=this.context;if(!this.socket)throw new Xj(`[${A}] Cannot send request: not connected`);let L=this.socket;return new Promise((I,D)=>{let B=setTimeout(()=>{this.responseCallback=null,D(new Xj(`[${A}] Tool request timed out after ${$}ms`))},$);this.responseCallback=(U)=>{clearTimeout(B),I(U)};let f=JSON.stringify(H),E=Buffer.from(f,"utf-8"),M=Buffer.allocUnsafe(4);M.writeUInt32LE(E.length,0);let G=Buffer.concat([M,E]);L.write(G)})}async callTool(H,$){let A={method:"execute_tool",params:{client_id:this.context.clientTypeId,tool:H,args:$}};return this.sendRequestWithRetry(A)}async sendRequestWithRetry(H){let{serverName:$,logger:A}=this.context;try{return await this.sendRequest(H)}catch(L){if(!(L instanceof Xj))throw L;return A.info(`[${$}] Connection error, forcing reconnect and retrying: ${L.message}`),this.closeSocket(),await this.ensureConnected(),await this.sendRequest(H)}}async setPermissionMode(H,$){}isConnected(){return this.connected}closeSocket(){if(this.socket)this.socket.removeAllListeners(),this.socket.end(),this.socket.destroy(),this.socket=null;this.connected=!1,this.connecting=!1}cleanup(){if(this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;this.closeSocket(),this.reconnectAttempts=0,this.responseBuffer=Buffer.alloc(0),this.responseCallback=null}disconnect(){this.cleanup()}async validateSocketSecurity(H){let{serverName:$,logger:A}=this.context;if(IiD.platform()==="win32")return;try{let L=DiD.dirname(H);if((L.split("/").pop()||"").startsWith("claude-mcp-browser-bridge-"))try{let M=await AhA.promises.stat(L);if(M.isDirectory()){let G=M.mode&511;if(G!==448)throw Error(`[${$}] Insecure socket directory permissions: ${G.toString(8)} (expected 0700). Directory may have been tampered with.`);let U=process.getuid?.();if(U!==void 0&&M.uid!==U)throw Error(`Socket directory not owned by current user (uid: ${U}, dir uid: ${M.uid}). Potential security risk.`)}}catch(M){if(M.code!=="ENOENT")throw M}let B=await AhA.promises.stat(H);if(!B.isSocket())throw Error(`[${$}] Path exists but it's not a socket: ${H}`);let f=B.mode&511;if(f!==384)throw Error(`[${$}] Insecure socket permissions: ${f.toString(8)} (expected 0600). Socket may have been tampered with.`);let E=process.getuid?.();if(E!==void 0&&B.uid!==E)throw Error(`Socket not owned by current user (uid: ${E}, socket uid: ${B.uid}). Potential security risk.`);A.info(`[${$}] Socket security validation passed`)}catch(L){if(L.code==="ENOENT"){A.info(`[${$}] Socket not found, will be created by server`);return}throw L}}}function aT$(H){return new BiD(H)}var AhA,LiD,IiD,DiD,Xj;var oT$=K(()=>{AhA=require("fs"),LiD=require("net"),IiD=require("os"),DiD=require("path");Xj=class Xj extends Error{constructor(H){super(H);this.name="SocketConnectionError"}}});class fiD{clients=new Map;tabRoutes=new Map;context;notificationHandler=null;constructor(H){this.context=H}setNotificationHandler(H){this.notificationHandler=H;for(let $ of this.clients.values())$.setNotificationHandler(H)}async ensureConnected(){let{logger:H,serverName:$}=this.context;this.refreshClients();let A=[];for(let I of this.clients.values())if(!I.isConnected())A.push(I.ensureConnected().catch(()=>!1));if(A.length>0)await Promise.all(A);let L=this.getConnectedClients().length;if(L===0)return H.info(`[${$}] No connected sockets in pool`),!1;return H.info(`[${$}] Socket pool: ${L} connected`),!0}async callTool(H,$){if(H==="tabs_context_mcp")return this.callTabsContext($);let A=$.tabId;if(A!==void 0){let I=this.tabRoutes.get(A);if(I){let D=this.clients.get(I);if(D?.isConnected())return D.callTool(H,$)}}let L=this.getConnectedClients();if(L.length===0)throw new Xj(`[${this.context.serverName}] No connected sockets available`);return L[0].callTool(H,$)}async setPermissionMode(H,$){let A=this.getConnectedClients();await Promise.all(A.map((L)=>L.setPermissionMode(H,$)))}isConnected(){return this.getConnectedClients().length>0}disconnect(){for(let H of this.clients.values())H.disconnect();this.clients.clear(),this.tabRoutes.clear()}getConnectedClients(){return[...this.clients.values()].filter((H)=>H.isConnected())}async callTabsContext(H){let{logger:$,serverName:A}=this.context,L=this.getConnectedClients();if(L.length===0)throw new Xj(`[${A}] No connected sockets available`);if(L.length===1){let B=await L[0].callTool("tabs_context_mcp",H);return this.updateTabRoutes(B,this.getSocketPathForClient(L[0])),B}let I=await Promise.allSettled(L.map(async(B)=>{let f=await B.callTool("tabs_context_mcp",H),E=this.getSocketPathForClient(B);return{result:f,socketPath:E}})),D=[];this.tabRoutes.clear();for(let B of I){if(B.status!=="fulfilled"){$.info(`[${A}] tabs_context_mcp failed on one socket: ${B.reason}`);continue}let{result:f,socketPath:E}=B.value;this.updateTabRoutes(f,E);let M=this.extractTabs(f);if(M)D.push(...M)}if(D.length>0){let B=D.map((f)=>{let E=f;return` \u2022 tabId ${E.tabId}: "${E.title}" (${E.url})`}).join(` You have access to browser automation tools (mcp__claude-in-chrome__*) for interacting with web pages in Chrome. Follow these guidelines for effective browser automation. When performing multi-step browser interactions that the user may want to review or share, use mcp__claude-in-chrome__gif_creator to record them. You can use mcp__claude-in-chrome__read_console_messages to read console output. Console output may be verbose. If you are looking for specific log entries, use the 'pattern' parameter with a regex-compatible pattern. This filters results efficiently and avoids overwhelming output. For example, use pattern: "[MyApp]" to filter for application-specific logs rather than reading all console output. IMPORTANT: Do not trigger JavaScript alerts, confirms, prompts, or browser modal dialogs through your actions. These browser dialogs block all further browser events and will prevent the extension from receiving any subsequent commands. Instead, when possible, use console.log for debugging and then use the mcp__claude-in-chrome__read_console_messages tool to read those log messages. If a page has dialog-triggering elements: 3. Use mcp__claude-in-chrome__javascript_tool to check for and dismiss any existing dialogs before proceeding IMPORTANT: At the start of each browser automation session, call mcp__claude-in-chrome__tabs_context_mcp first to get information about the user's current browser tabs. Use this context to understand what the user might want to work with before creating new tabs. 2. Otherwise, create a new tab with mcp__claude-in-chrome__tabs_create_mcp You have access to browser automation tools (mcp__claude-in-chrome__*) for interacting with web pages in Chrome. Follow these guidelines for effective browser automation. When performing multi-step browser interactions that the user may want to review or share, use mcp__claude-in-chrome__gif_creator to record them. You can use mcp__claude-in-chrome__read_console_messages to read console output. Console output may be verbose. If you are looking for specific log entries, use the 'pattern' parameter with a regex-compatible pattern. This filters results efficiently and avoids overwhelming output. For example, use pattern: "[MyApp]" to filter for application-specific logs rather than reading all console output. IMPORTANT: Do not trigger JavaScript alerts, confirms, prompts, or browser modal dialogs through your actions. These browser dialogs block all further browser events and will prevent the extension from receiving any subsequent commands. Instead, when possible, use console.log for debugging and then use the mcp__claude-in-chrome__read_console_messages tool to read those log messages. If a page has dialog-triggering elements: 3. Use mcp__claude-in-chrome__javascript_tool to check for and dismiss any existing dialogs before proceeding IMPORTANT: At the start of each browser automation session, call mcp__claude-in-chrome__tabs_context_mcp first to get information about the user's current browser tabs. Use this context to understand what the user might want to work with before creating new tabs. 2. Otherwise, create a new tab with mcp__claude-in-chrome__tabs_create_mcp Chrome browser tools are MCP tools that require loading before use. Before calling any mcp__claude-in-chrome__* tool: 1. Use ToolSearch with \`select:mcp__claude-in-chrome__\` to load the specific tool 1. First: ToolSearch with query "select:mcp__claude-in-chrome__tabs_context_mcp" 2. Then: Call mcp__claude-in-chrome__tabs_context_mcp`,DhA='**Browser Automation**: Chrome browser tools are available via the "claude-in-chrome" skill. CRITICAL: Before using any mcp__claude-in-chrome__* tools, invoke the skill by calling the Skill tool with skill: "claude-in-chrome". The skill provides browser automation instructions and enables the tools.';function IP1(){return[LP1]}async function ViD(H,$){if(H.length===0)return $?.("[Claude in Chrome] No browser paths to check"),{isInstalled:!1,browser:null};let A=IP1();for(let{browser:L,path:I}of H){let D=[];try{D=await BhA.readdir(I,{withFileTypes:!0})}catch(f){let E=f.code;if(E==="ENOENT"||E==="EACCES"||E==="EPERM")continue;throw f}let B=D.filter((f)=>f.isDirectory()).filter((f)=>f.name==="Default"||f.name.startsWith("Profile ")).map((f)=>f.name);if(B.length>0)$?.(`[Claude in Chrome] Found ${L} profiles: ${B.join(", ")}`);for(let f of B)for(let E of A){let M=WiD.join(I,f,"Extensions",E);try{return await BhA.readdir(M),$?.(`[Claude in Chrome] Extension ${E} found in ${L} ${f}`),{isInstalled:!0,browser:L}}catch{}}}return $?.("[Claude in Chrome] Extension not found in any browser"),{isInstalled:!1,browser:null}}async function PiD(H,$){return(await ViD(H,$)).isInstalled}var BhA,WiD,LP1="fcoeoabgfenejglbffodgkkbkcdhcgfn";var _iD=K(()=>{BhA=require("fs/promises"),WiD=require("path")});function eT$(H){if(tI()&&H!==!0)return!1;if(H===!0)return!0;if(H===!1)return!1;if(A$(process.env.CLAUDE_CODE_ENABLE_CFC))return!0;if(BE(process.env.CLAUDE_CODE_ENABLE_CFC))return!1;let $=M$();if($.claudeInChromeDefaultEnabled!==void 0)return $.claudeInChromeDefaultEnabled;return!1}function UPH(){if(sT$!==void 0)return sT$;return sT$=Mk()&&EP1()&&NL("tengu_chrome_auto_enable",!1),sT$}function EhA(){let H=U8(),$=e1H.map((I)=>`mcp__claude-in-chrome__${I.name}`),A={};if(Gk())A.CLAUDE_CHROME_PERMISSION_MODE="skip_all_permission_checks";let L=Object.keys(A).length>0;if(H){let I=`"${process.execPath}" --chrome-native-host`;return wiD(I).then((D)=>CiD(D)),{mcpConfig:{[dw]:{type:"stdio",command:process.execPath,args:["--claude-in-chrome-mcp"],scope:"dynamic",...L&&{env:A}}},allowedTools:$,systemPrompt:IhA()}}else{let I=qiD.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/claudeInChrome/setup.ts"),D=_b.join(I,".."),B=_b.join(D,"cli.js");return wiD(`"${process.execPath}" "${B}" --chrome-native-host`).then((E)=>CiD(E)),{mcpConfig:{[dw]:{type:"stdio",command:process.execPath,args:[`${B}`,"--claude-in-chrome-mcp"],scope:"dynamic",...L&&{env:A}}},allowedTools:$,systemPrompt:IhA()}}}function BP1(){if(oA()==="windows"){let $=ZiD.homedir(),A=process.env.APPDATA||_b.join($,"AppData","Local");return[_b.join(A,"Claude Code","ChromeNativeHost")]}return YZD().map(({path:$})=>$)}async function CiD(H){let $=BP1();if($.length===0)throw Error("Claude in Chrome Native Host not supported on this platform");let A={name:fhA,description:"Claude Code Browser Extension Native Host",path:H,type:"stdio",allowed_origins:["chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/",...[]]},L=yH(A,null,2),I=!1;for(let D of $){let B=_b.join(D,YiD);if(await Jj.readFile(B,"utf-8").catch(()=>null)===L)continue;try{await Jj.mkdir(D,{recursive:!0}),await Jj.writeFile(B,L),N(`[Claude in Chrome] Installed native host manifest at: ${B}`),I=!0}catch(E){N(`[Claude in Chrome] Failed to install manifest at ${B}: ${E}`)}}if(oA()==="windows"){let D=_b.join($[0],YiD);fP1(D)}if(I)Vd().then((D)=>{if(D)N("[Claude in Chrome] First-time install detected, opening reconnect page in browser"),_2$(DP1);else N("[Claude in Chrome] First-time install detected, but extension not installed, skipping reconnect")})}function fP1(H){let $=CZD();for(let{browser:A,key:L}of $){let I=`${L}\\${fhA}`;pD("reg",["add",I,"/ve","/t","REG_SZ","/d",H,"/f"]).then((D)=>{if(D.code===0)N(`[Claude in Chrome] Registered native host for ${A} in Windows registry: ${I}`);else N(`[Claude in Chrome] Failed to register native host for ${A} in Windows registry: ${D.stderr}`)})}}async function wiD(H){let $=oA(),A=_b.join(UL(),"chrome"),L=$==="windows"?_b.join(A,"chrome-native-host.bat"):_b.join(A,"chrome-native-host"),I=$==="windows"?`@echo off `;if(await Jj.readFile(L,"utf-8").catch(()=>null)===I)return L;if(await Jj.mkdir(A,{recursive:!0}),await Jj.writeFile(L,I),$!=="windows")await Jj.chmod(L,493);return N(`[Claude in Chrome] Created Chrome native host wrapper script: ${L}`),L}function EP1(){return Vd().then(($)=>{if(M$().cachedChromeExtensionInstalled!==$)AA((L)=>({...L,cachedChromeExtensionInstalled:$}))}),M$().cachedChromeExtensionInstalled??!1}async function Vd(){let H=_ZD();if(H.length===0)return N(`[Claude in Chrome] Unsupported platform for extension detection: ${oA()}`),!1;return PiD(H,N)}var Jj,ZiD,_b,qiD,DP1="https://clau.de/chrome/reconnect",fhA="com.anthropic.claude_code_browser_extension",YiD,sT$=void 0;var H8H=K(()=>{Z9();E$();B0();NA();g$();tT$();nS();vA();Z$();SD();_iD();Jj=require("fs/promises"),ZiD=require("os"),_b=require("path"),qiD=require("url"),YiD=`${fhA}.json`});var TiD={};XA(TiD,{call:()=>JP1});function XP1({onDone:H,isExtensionInstalled:$,configEnabled:A,isClaudeAISubscriber:L,isWSL:I}){let D=J$((O)=>O.mcp.clients),[B,f]=HpH.useState(0),[E,M]=HpH.useState(A??!1),[G,U]=HpH.useState(!1),[X,J]=HpH.useState($),F=!1,W=D.find((O)=>O.name===dw)?.type==="connected";function P(O){_2$(O)}function C(O){switch(O){case"install-extension":f((j)=>j+1),U(!0),P(MP1);break;case"reconnect":f((j)=>j+1),Vd().then((j)=>{if(J(j),j)U(!1)}),P(UP1);break;case"manage-permissions":f((j)=>j+1),P(GP1);break;case"toggle-default":{let j=!E;AA((u)=>({...u,claudeInChromeDefaultEnabled:j})),M(j);break}}}let Y=[],Z=X?"":" (requires extension)";if(!X)Y.push({label:"Install Chrome extension",value:"install-extension"});return Y.push({label:bf.default.createElement(bf.default.Fragment,null,bf.default.createElement(V,null,"Manage permissions"),bf.default.createElement(V,{dimColor:!0},Z)),value:"manage-permissions"},{label:bf.default.createElement(bf.default.Fragment,null,bf.default.createElement(V,null,"Reconnect extension"),bf.default.createElement(V,{dimColor:!0},Z)),value:"reconnect"},{label:`Enabled by default: ${E?"Yes":"No"}`,value:"toggle-default"}),bf.default.createElement(BL,{title:"Claude in Chrome (Beta)",onCancel:()=>H(),color:"chromeYellow"},bf.default.createElement(x,{flexDirection:"column",gap:1},bf.default.createElement(V,null,"Claude in Chrome works with the Chrome extension to let you control your browser directly from Claude Code. Navigate websites, fill forms, capture screenshots, record GIFs, and debug with console logs and network requests."),I&&bf.default.createElement(V,{color:"error"},"Claude in Chrome is not supported in WSL at this time."),!L&&bf.default.createElement(V,{color:"error"},"Claude in Chrome requires a claude.ai subscription."),!(I||!L)&&bf.default.createElement(bf.default.Fragment,null,bf.default.createElement(x,{flexDirection:"column"},bf.default.createElement(V,null,"Status:"," ",W?bf.default.createElement(V,{color:"success"},"Enabled"):bf.default.createElement(V,{color:"inactive"},"Disabled")),bf.default.createElement(V,null,"Extension:"," ",X?bf.default.createElement(V,{color:"success"},"Installed"):bf.default.createElement(V,{color:"warning"},"Not detected"))),bf.default.createElement(QA,{key:B,options:Y,onChange:C,hideIndexes:!0}),G&&bf.default.createElement(V,{color:"warning"},"Once installed, select ",'"Reconnect extension"'," to connect."),bf.default.createElement(V,null,bf.default.createElement(V,{dimColor:!0},"Usage: "),bf.default.createElement(V,null,"claude --chrome"),bf.default.createElement(V,{dimColor:!0}," or "),bf.default.createElement(V,null,"claude --no-chrome")),bf.default.createElement(V,{dimColor:!0},"Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on.")),bf.default.createElement(V,{dimColor:!0},"Learn more: https://code.claude.com/docs/en/chrome")))}async function JP1(H){let $=await Vd(),A=M$(),L=nL(),I=OA.isWslEnvironment();return bf.default.createElement(XP1,{onDone:H,isExtensionInstalled:$,configEnabled:A.claudeInChromeDefaultEnabled,isClaudeAISubscriber:L,isWSL:I})}var bf,HpH,MP1="https://claude.ai/chrome",GP1="https://clau.de/chrome/permissions",UP1="https://clau.de/chrome/reconnect";var ziD=K(()=>{xH();H8H();nS();vA();bB();N1();pL();EI();Z1();F3();NA();bf=b(s(),1),HpH=b(s(),1)});var FP1,NiD;var OiD=K(()=>{g$();FP1={name:"chrome",description:"Claude in Chrome (Beta) settings",isEnabled:()=>!tI(),isHidden:!1,type:"local-jsx",load:()=>Promise.resolve().then(() => (ziD(),TiD)),userFacingName:()=>"chrome"},NiD=FP1});var xiD={};XA(xiD,{call:()=>KP1});async function KP1(){if(await HE("https://www.stickermule.com/claudecode"))return{type:"text",value:"Opening sticker page in browser\u2026"};else return{type:"text",value:"Failed to open browser. Visit: https://www.stickermule.com/claudecode"}}var SiD=K(()=>{F3()});var QP1,MhA;var jiD=K(()=>{QP1={type:"local",name:"stickers",description:"Order Claude Code stickers",isEnabled:()=>!0,isHidden:!1,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (SiD(),xiD)),userFacingName(){return"stickers"}},MhA=QP1});function UW(H){let $={type:"prompt",name:H.name,description:H.description,hasUserSpecifiedDescription:!0,allowedTools:H.allowedTools??[],argumentHint:H.argumentHint,whenToUse:H.whenToUse,model:H.model,disableModelInvocation:H.disableModelInvocation??!1,userInvocable:H.userInvocable??!0,contentLength:0,source:"bundled",loadedFrom:"bundled",hooks:H.hooks,context:H.context,agent:H.agent,isEnabled:H.isEnabled??(()=>!0),isHidden:!(H.userInvocable??!0),progressMessage:"running",userFacingName:()=>H.name,getPromptForCommand:H.getPromptForCommand};RiD.push($)}function yiD(){return[...RiD]}var RiD;var Fj=K(()=>{RiD=[]});var WP1,viD;var hiD=K(()=>{xH();N1();zVH();JM();nh();B0();z$();bB();WP1=b(s(),1),viD=b(s(),1)});var OAG;var biD=K(()=>{hiD();UU();OAG=b(s(),1)});var kiD={};XA(kiD,{call:()=>YP1});function _P1(){return QV(PP1)??"Goodbye!"}async function YP1(H){return H(_P1()),await w0(0,"prompt_input_exit"),null}var VP1,PP1;var uiD=K(()=>{yHH();UU();zVH();biD();VP1=b(s(),1),PP1=["Goodbye!","See ya!","Bye!","Catch you later!"]});var CP1,$pH;var GhA=K(()=>{CP1={type:"local-jsx",name:"exit",aliases:["quit"],description:"Exit the REPL",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (uiD(),kiD)),userFacingName(){return"exit"}},$pH=CP1});function miD({content:H,defaultFilename:$,onDone:A}){let[,L]=rs.useState(null),[I,D]=rs.useState($),[B,f]=rs.useState($.length),[E,M]=rs.useState(!1),{columns:G}=QL(),U=rs.useCallback(()=>{M(!1),L(null)},[]),X=async(P)=>{if(P==="clipboard")if(await K3(H))A({success:!0,message:"Conversation copied to clipboard"});else A({success:!1,message:dQH()});else if(P==="file")L("file"),M(!0)},J=()=>{let P=I.endsWith(".txt")?I:I.replace(/\.[^.]+$/,"")+".txt",C=giD.join(C$(),P);try{iL(C,H,{encoding:"utf-8",flush:!0}),A({success:!0,message:`Conversation exported to: ${P}`})}catch(Y){A({success:!1,message:`Failed to export conversation: ${Y instanceof Error?Y.message:"Unknown error"}`})}},F=rs.useCallback(()=>{if(E)U();else A({success:!1,message:"Export cancelled"})},[E,U,A]),Q=[{label:"Copy to clipboard",value:"clipboard",description:"Copy the conversation to your system clipboard"},{label:"Save to file",value:"file",description:"Save the conversation to a file in the current directory"}];function W(P){if(E)return BZ.default.createElement(rA,null,BZ.default.createElement(s$,{shortcut:"Enter",action:"save"}),BZ.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}));if(P.pending)return BZ.default.createElement(V,null,"Press ",P.keyName," again to exit");return BZ.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})}return BZ.default.createElement(BL,{title:"Export Conversation",subtitle:"Select export method:",color:"permission",onCancel:F,inputGuide:W},!E?BZ.default.createElement(QA,{options:Q,onChange:X,onCancel:F}):BZ.default.createElement(x,{flexDirection:"column"},BZ.default.createElement(V,null,"Enter filename:"),BZ.default.createElement(x,{flexDirection:"row",gap:1,marginTop:1},BZ.default.createElement(V,null,">"),BZ.default.createElement(W9,{value:I,onChange:D,onSubmit:J,focus:!0,showCursor:!0,columns:G,cursorOffset:B,onChangeCursorOffset:f}))))}var BZ,rs,giD;var piD=K(()=>{xH();N1();S5();PI();Z$();pm();lB();j0();eB();OB();bB();BZ=b(s(),1),rs=b(s(),1),giD=require("path")});function wP1({children:H}){let{bindings:$}=wNH(),A=Yb.useRef(null),L=Yb.useRef(new Map),I=Yb.useRef(new Set).current;return Yb.default.createElement(I8$,{bindings:$,pendingChordRef:A,pendingChord:null,setPendingChord:()=>{},activeContexts:I,registerActiveContext:()=>{},unregisterActiveContext:()=>{},handlerRegistryRef:L},H)}async function diD(H,$=[]){return CVH(Yb.default.createElement(()=>Yb.default.createElement(i8,null,Yb.default.createElement(wP1,null,Yb.default.createElement(l1H,{messages:H,normalizedMessageHistory:[],tools:$,commands:[],verbose:!1,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:"export",screen:"prompt",screenToggleId:0,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}))),null))}var Yb;var ciD=K(()=>{agH();bmH();pL();iu();nu();Yb=b(s(),1)});var aiD={};XA(aiD,{sanitizeFilename:()=>riD,extractFirstPrompt:()=>niD,call:()=>TP1});function ZP1(H){let $=H.getFullYear(),A=String(H.getMonth()+1).padStart(2,"0"),L=String(H.getDate()).padStart(2,"0"),I=String(H.getHours()).padStart(2,"0"),D=String(H.getMinutes()).padStart(2,"0"),B=String(H.getSeconds()).padStart(2,"0");return`${$}-${A}-${L}-${I}${D}${B}`}function niD(H){let $=H.find((I)=>I.type==="user");if(!$||$.type!=="user")return"";let A=$.message?.content,L="";if(typeof A==="string")L=A.trim();else if(Array.isArray(A)){let I=A.find((D)=>D.type==="text");if(I&&"text"in I)L=I.text.trim()}if(L=L.split(` /tag wip`,{display:"system"})},[H]),null}async function hP1(H,$,A){if(A=A?.trim()||"",kMH.includes(A)||bMH.includes(A))return r5.createElement(LnD,{onDone:H});if(!A)return r5.createElement(LnD,{onDone:H});return r5.createElement(vP1,{tagName:A,onDone:H})}var r5;var DnD=K(()=>{xH();g$();rB();r0();EE();N1();bB();z$();r5=b(s(),1)});var bP1,BnD;var fnD=K(()=>{bP1={type:"local-jsx",name:"tag",userFacingName(){return"tag"},description:"Toggle a searchable tag on the current session",isEnabled:()=>!1,isHidden:!1,argumentHint:"",load:()=>Promise.resolve().then(() => (DnD(),InD))},BnD=bP1});var MnD={};XA(MnD,{call:()=>pP1});function kP1({onDone:H}){let A=lQ().outputStyle??HW,L=EnD.useCallback(()=>{c("tengu_output_style_command_menu",{action:"cancel"}),H(`Kept output style as ${oH.bold(A)}`,{display:"system"})},[A,H]);BA("confirm:no",L,{context:"Confirmation"});function I(B){c("tengu_output_style_command_menu",{action:B,from_style:A,to_style:B}),II("localSettings",{outputStyle:B}),H(`Set output style to ${oH.bold(B)}`)}function D(){H(`Kept output style as ${oH.bold(A)}`,{display:"system"})}return Pd.createElement(Fq$,{initialStyle:A,onComplete:I,onCancel:D,isStandaloneCommand:!0})}function uP1(H,$){if(H in $)return H;let A=H.toLowerCase();for(let L of Object.keys($))if(L.toLowerCase()===A)return L;return null}function gP1({args:H,onDone:$}){return Y1H(C$()).then((A)=>{let L=uP1(H,A);if(!L){$(`Invalid output style: ${H}`);return}II("localSettings",{outputStyle:L}),$(`Set output style to ${oH.bold(L)}`)}),null}function mP1({onDone:H}){let $=lQ();return H(`Current output style: ${$.outputStyle??HW}`),null}async function pP1(H,$,A){if(A=A?.trim()||"",kMH.includes(A))return c("tengu_output_style_command_inline_help",{args:A}),Pd.createElement(mP1,{onDone:H});if(bMH.includes(A)){H("Run /output-style to open the output style selection menu, or /output-style [styleName] to set the output style.",{display:"system"});return}if(A)return c("tengu_output_style_command_inline",{args:A}),Pd.createElement(gP1,{args:A,onDone:H});return Pd.createElement(kP1,{onDone:H})}var Pd,EnD;var GnD=K(()=>{tjA();$I();z$();r0();mL();um();jh();PI();EE();Pd=b(s(),1),EnD=b(s(),1)});var dP1,UnD;var XnD=K(()=>{dP1={type:"local-jsx",name:"output-style",userFacingName(){return"output-style"},description:"Set the output style directly or from a selection menu",isEnabled:()=>!0,isHidden:!1,argumentHint:"[style]",load:()=>Promise.resolve().then(() => (GnD(),MnD))},UnD=dP1});async function JnD(){let H=await D3H();if(H.length===0)return{availableEnvironments:[],selectedEnvironment:null,selectedEnvironmentSource:null};let A=VL()?.remote?.defaultEnvironmentId,L=H[0],I=null;if(A){let D=H.find((B)=>B.environment_id===A);if(D){L=D;for(let B=j_.length-1;B>=0;B--){let f=j_[B];if(!f||f==="flagSettings")continue;if(ZI(f)?.remote?.defaultEnvironmentId===A){I=f;break}}}}return{availableEnvironments:H,selectedEnvironment:L,selectedEnvironmentSource:I}}var FnD=K(()=>{mL();W4();rC$()});function KnD({onDone:H}){let[$,A]=as.useState("loading"),[L,I]=as.useState([]),[D,B]=as.useState(null),[f,E]=as.useState(null),[M,G]=as.useState(null);as.useEffect(()=>{async function X(){try{let J=await JnD();I(J.availableEnvironments),B(J.selectedEnvironment),E(J.selectedEnvironmentSource),A(null)}catch(J){let F=J instanceof Error?J.message:String(J);r(J instanceof Error?J:Error(F)),G(F),A(null)}}X()},[]);function U(X){if(X==="cancel"){H();return}A("updating");let J=L.find((F)=>F.environment_id===X);if(!J){H("Error: Selected environment not found");return}II("localSettings",{remote:{defaultEnvironmentId:J.environment_id}}),H(`Set default remote environment to ${oH.bold(J.name)} (${J.environment_id})`)}if($==="loading")return z0.createElement(BL,{title:ApH,onCancel:H,hideInputGuide:!0},z0.createElement(umH,{message:"Loading environments\u2026"}));if(M)return z0.createElement(BL,{title:ApH,onCancel:H},z0.createElement(V,{color:"error"},"Error: ",M));if(!D)return z0.createElement(BL,{title:ApH,subtitle:XhA,onCancel:H},z0.createElement(V,null,"No remote environments available."));if(L.length===1)return z0.createElement(lP1,{environment:D,onDone:H});return z0.createElement(iP1,{environments:L,selectedEnvironment:D,selectedEnvironmentSource:f,loadingState:$,onSelect:U,onCancel:H})}function cP1({environment:H}){return z0.createElement(V,null,pH.tick," Using ",z0.createElement(V,{bold:!0},H.name)," ",z0.createElement(V,{dimColor:!0},"(",H.environment_id,")"))}function lP1({environment:H,onDone:$}){return BA("confirm:yes",$,{context:"Confirmation"}),z0.createElement(BL,{title:ApH,subtitle:XhA,onCancel:$},z0.createElement(cP1,{environment:H}))}function iP1({environments:H,selectedEnvironment:$,selectedEnvironmentSource:A,loadingState:L,onSelect:I,onCancel:D}){let B=A&&A!=="localSettings"?` (from ${Vl(A)} settings)`:"",f=z0.createElement(V,null,"Currently using: ",z0.createElement(V,{bold:!0},$.name),B);return z0.createElement(BL,{title:ApH,subtitle:f,onCancel:D,hideInputGuide:!0},z0.createElement(V,{dimColor:!0},XhA),L==="updating"?z0.createElement(umH,{message:"Updating\u2026"}):z0.createElement(QA,{options:H.map((E)=>({label:z0.createElement(V,null,E.name," ",z0.createElement(V,{dimColor:!0},"(",E.environment_id,")")),value:E.environment_id})),defaultValue:$.environment_id,onChange:I,onCancel:()=>I("cancel"),layout:"compact-vertical"}),z0.createElement(V,{dimColor:!0},z0.createElement(rA,null,z0.createElement(s$,{shortcut:"Enter",action:"select"}),z0.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))))}var z0,as,ApH="Select Remote Environment",XhA="Configure environments at: https://claude.ai/code";var QnD=K(()=>{xH();$I();bB();N1();jI();nyA();FnD();mL();_$();r0();W4();lB();j0();eB();z0=b(s(),1),as=b(s(),1)});var WnD={};XA(WnD,{call:()=>nP1});async function nP1(H){return JhA.createElement(KnD,{onDone:H})}var JhA;var VnD=K(()=>{QnD();JhA=b(s(),1)});var PnD;var _nD=K(()=>{EI();XY();PnD={type:"local-jsx",name:"remote-env",userFacingName(){return"remote-env"},description:"Configure the default remote environment for teleport sessions",isEnabled:()=>nL()&&PK("allow_remote_sessions"),get isHidden(){return!nL()||!PK("allow_remote_sessions")},load:()=>Promise.resolve().then(() => (VnD(),WnD))}});var YnD={};XA(YnD,{call:()=>KhA});async function KhA(H,$){try{if(nL()){let L=dD(),I=!1;if(L?.subscriptionType&&L?.rateLimitTier)I=L.subscriptionType==="max"&&L.rateLimitTier==="default_claude_max_20x";else if(L?.accessToken){let D=await SGH(L.accessToken);I=D?.organization?.organization_type==="claude_max"&&D?.organization?.rate_limit_tier==="default_claude_max_20x"}if(I)return setTimeout(()=>{H("You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account.")},0),null}return await HE("https://claude.ai/upgrade/max"),FhA.createElement(i7H,{startingMessage:"Starting new login following /upgrade. Exit with Ctrl-C to use existing account.",onDone:(L)=>{$.onChangeAPIKey(),H(L?"Login successful":"Login interrupted")}})}catch(A){r(A),setTimeout(()=>{H("Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.")},0)}return null}var FhA;var QhA=K(()=>{_$();EI();F3();J_$();zwH();FhA=b(s(),1)});var rP1,$z$;var WhA=K(()=>{EI();rP1={type:"local-jsx",name:"upgrade",description:"Upgrade to Max for higher rate limits and more Opus",isEnabled:()=>!process.env.DISABLE_UPGRADE_COMMAND&&!$O()&&f0()!=="enterprise",isHidden:!1,load:()=>Promise.resolve().then(() => (QhA(),YnD)),userFacingName(){return"upgrade"}},$z$=rP1});var CnD={};XA(CnD,{call:()=>oP1});function aP1({onDone:H,context:$}){let[A,L]=Lz$.useState(null),I=Zr(),D=f0(),B=Ri(),f=T9()?.hasExtraUsageEnabled===!0,M=D==="max"&&B==="default_claude_max_20x",G=D==="team"||D==="enterprise",U=Lz$.useMemo(()=>{let F=[{label:"Stop and wait for limit to reset",value:"cancel"}];if(Lt.isEnabled()){let Q=my(),W=G&&!Q,P=I.overageDisabledReason==="out_of_credits"||I.overageDisabledReason==="org_level_disabled_until"||I.overageDisabledReason==="org_service_zero_credit_limit";if(W&&P);else{let C=I.overageStatus==="rejected"||I.overageStatus==="allowed_warning",Y;if(W)Y=C?"Request more":"Request extra usage";else Y=f?"Add funds to continue with extra usage":"Switch to extra usage";F.push({label:Y,value:"extra-usage"})}}if(!M&&!G&&$z$.isEnabled())F.push({label:"Upgrade your plan",value:"upgrade"});return F},[M,G,f,I.overageStatus,I.overageDisabledReason]);function X(){c("tengu_rate_limit_options_menu_cancel",{}),H(void 0,{display:"skip"})}function J(F){if(F==="upgrade")c("tengu_rate_limit_options_menu_select_upgrade",{}),KhA(H,$).then((Q)=>{if(Q)L(Q)});else if(F==="extra-usage")c("tengu_rate_limit_options_menu_select_extra_usage",{}),pwA(H,$).then((Q)=>{if(Q)L(Q)});else if(F==="cancel")X()}if(A)return A;return Az$.default.createElement(BL,{title:"What do you want to do?",onCancel:X,color:"suggestion",borderDimColor:!1},Az$.default.createElement(QA,{options:U,onChange:J,visibleOptionCount:U.length}))}async function oP1(H,$){return Az$.default.createElement(aP1,{onDone:H,context:$})}var Az$,Lz$;var wnD=K(()=>{N1();bB();z$();EI();WhA();QhA();mbH();dwA();vA();py();Az$=b(s(),1),Lz$=b(s(),1)});var tP1,ZnD;var qnD=K(()=>{EI();vA();tP1={type:"local-jsx",name:"rate-limit-options",userFacingName(){return"rate-limit-options"},description:"Show options when rate limit is reached",isEnabled:()=>{if(!nL())return!1;if($T())return!0;let H=f0();return H==="pro"||H==="max"},isHidden:!0,load:()=>Promise.resolve().then(() => (wnD(),CnD))},ZnD=tP1});var sP1,VhA;var TnD=K(()=>{sP1={type:"prompt",description:"Set up Claude Code's status line UI",contentLength:0,aliases:[],isEnabled:()=>!0,isHidden:!1,name:"statusline",progressMessage:"setting up statusLine",allowedTools:["Task","Read(~/**)","Edit(~/.claude/settings.json)"],source:"builtin",disableNonInteractive:!0,async getPromptForCommand(H){return[{type:"text",text:`Create a Task with subagent_type "statusline-setup" and the prompt "${H.trim()||"Configure my statusLine from my shell PS1 configuration"}"`}]},userFacingName(){return"statusline"}},VhA=sP1});var znD=()=>{};var NnD=z((Iz$)=>{(function(H){H.black="\x1B[30m",H.red="\x1B[31m",H.green="\x1B[32m",H.yellow="\x1B[33m",H.blue="\x1B[34m",H.magenta="\x1B[35m",H.cyan="\x1B[36m",H.lightgray="\x1B[37m",H.default="\x1B[39m",H.darkgray="\x1B[90m",H.lightred="\x1B[91m",H.lightgreen="\x1B[92m",H.lightyellow="\x1B[93m",H.lightblue="\x1B[94m",H.lightmagenta="\x1B[95m",H.lightcyan="\x1B[96m",H.white="\x1B[97m",H.reset="\x1B[0m";function $(A,L){return L===void 0?A:L+A+H.reset}H.colored=$,H.plot=function(A,L=void 0){if(typeof A[0]=="number")A=[A];L=typeof L<"u"?L:{};let I=typeof L.min<"u"?L.min:A[0][0],D=typeof L.max<"u"?L.max:A[0][0];for(let Z=0;Z0?D-(Z-J)*f/Q:Z,Z-J);Y[Z-J][Math.max(E-q.length,0)]=q,Y[Z-J][E-1]=Z==0?P[0]:P[1]}for(let Z=0;Zy?P[5]:P[6],q),Y[Q-u][j+E]=$(u>y?P[7]:P[8],q);let g=Math.min(u,y),h=Math.max(u,y);for(let p=g+1;p{cnD={30:{r:0,g:0,b:0},31:{r:205,g:49,b:49},32:{r:13,g:188,b:121},33:{r:229,g:229,b:16},34:{r:36,g:114,b:200},35:{r:188,g:63,b:188},36:{r:17,g:168,b:205},37:{r:229,g:229,b:229},90:{r:102,g:102,b:102},91:{r:241,g:76,b:76},92:{r:35,g:209,b:139},93:{r:245,g:245,b:67},94:{r:59,g:142,b:234},95:{r:214,g:112,b:214},96:{r:41,g:184,b:219},97:{r:255,g:255,b:255}},L8H={r:229,g:229,b:229},jhA={r:30,g:30,b:30}});function w_1(){let H=I8H.dirname(rnD.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/screenshotClipboard.ts"));return I8H.join(I8H.dirname(hgH()),"resvg.wasm")}function Z_1(){if(!U8()||typeof Bun>"u"||!Bun.embeddedFiles)return null;for(let H of Bun.embeddedFiles){let $=H.name;if($&&$.endsWith("resvg.wasm"))return H}return null}async function q_1(){if(RhA)return;if(U8()){let A=Z_1();if(A){let L=await A.arrayBuffer();await ShA(new Uint8Array(L)),RhA=!0;return}}let H=w_1();if(!Qj.existsSync(H))throw Error(`resvg WASM file not found at: ${H}`);let $=Qj.readFileSync(H);await ShA($),RhA=!0}async function T_1(){if(Xz$)return[Xz$];let H=oA(),$=[];if(H==="macos")$.push("/System/Library/Fonts/Menlo.ttc","/System/Library/Fonts/Monaco.dfont","/Library/Fonts/Courier New.ttf");else if(H==="linux")$.push("/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf","/usr/share/fonts/TTF/DejaVuSansMono.ttf","/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf","/usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf");else if(H==="windows")$.push("C:\\Windows\\Fonts\\consola.ttf","C:\\Windows\\Fonts\\cour.ttf");for(let A of $)try{if(Qj.existsSync(A))return Xz$=Qj.readFileSync(A),[Xz$]}catch{}return[]}async function anD(H,$){if(!U8())return{success:!1,message:"Screenshot copying is not available in this build"};try{await q_1();let A=I8H.join(nnD.tmpdir(),"claude-code-screenshots");if(!Qj.existsSync(A))Qj.mkdirSync(A,{recursive:!0});let L=Date.now(),I=lnD(H,$),D=I8H.join(A,`screenshot-${L}.png`),B=await T_1(),M=new pnD(I,{fitTo:{mode:"zoom",value:4},font:{fontBuffers:B,defaultFontFamily:"Menlo",monospaceFamily:"Menlo"}}).render().asPng();iL(D,M);let G=await z_1(D);try{Qj.unlinkSync(D)}catch{}return G}catch(A){return r(A instanceof Error?A:Error(String(A))),{success:!1,message:`Failed to copy screenshot: ${A instanceof Error?A.message:"Unknown error"}`}}}async function z_1(H){let $=oA();if($==="macos"){let L=`set the clipboard to (read (POSIX file "${H.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}") as \xABclass PNGf\xBB)`,I=await pD("osascript",["-e",L],{timeout:5000});if(I.code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:`Failed to copy to clipboard: ${I.stderr}`}}if($==="linux"){if((await pD("xclip",["-selection","clipboard","-t","image/png","-i",H],{timeout:5000})).code===0)return{success:!0,message:"Screenshot copied to clipboard"};if((await pD("xsel",["--clipboard","--input","--type","image/png"],{timeout:5000})).code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:"Failed to copy to clipboard. Please install xclip or xsel: sudo apt install xclip"}}if($==="windows"){let A=`Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::SetImage([System.Drawing.Image]::FromFile('${H.replace(/'/g,"''")}'))`,L=await pD("powershell",["-NoProfile","-Command",A],{timeout:5000});if(L.code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:`Failed to copy to clipboard: ${L.stderr}`}}return{success:!1,message:`Screenshot to clipboard is not supported on ${$}`}}var Qj,I8H,nnD,rnD,RhA=!1,Xz$=null;var onD=K(()=>{Z$();dnD();Z9();inD();_$();B0();Ib();Qj=require("fs"),I8H=require("path"),nnD=require("os"),rnD=require("url")});function O_1(H){return new Date(H).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function x_1(H){let $=Jz$.indexOf(H);return Jz$[($+1)%Jz$.length]}function S_1(){return ZhA("all").then((H)=>{if(!H||H.totalSessions===0)return{type:"empty"};return{type:"success",data:H}}).catch((H)=>{return{type:"error",message:H instanceof Error?H.message:"Failed to load stats"}})}function $rD({onClose:H}){let $=JW.useMemo(()=>S_1(),[]);return JL.default.createElement(JW.Suspense,{fallback:JL.default.createElement(x,{marginTop:1},JL.default.createElement(vD,null),JL.default.createElement(V,null," Loading your Claude Code stats\u2026"))},JL.default.createElement(j_1,{allTimePromise:$,onClose:H}))}function j_1({allTimePromise:H,onClose:$}){let A=JW.use(H),[L,I]=JW.useState("all"),[D,B]=JW.useState({}),[f,E]=JW.useState(!1),[M,G]=JW.useState("Overview"),[U,X]=JW.useState(null);JW.useEffect(()=>{if(L==="all")return;if(D[L])return;let W=!1;return E(!0),ZhA(L).then((P)=>{if(!W)B((C)=>({...C,[L]:P})),E(!1)}).catch(()=>{if(!W)E(!1)}),()=>{W=!0}},[L,D]);let J=L==="all"?A.type==="success"?A.data:null:D[L]??(A.type==="success"?A.data:null),F=A.type==="success"?A.data:null,Q=JW.useCallback(()=>{$("Stats dialog dismissed",{display:"system"})},[$]);if(BA("confirm:no",Q,{context:"Confirmation"}),WL((W,P)=>{if(P.ctrl&&(W==="c"||W==="d"))$("Stats dialog dismissed",{display:"system"});if(P.tab)G((C)=>C==="Overview"?"Models":"Overview");if(W==="r"&&!P.ctrl&&!P.meta)I(x_1(L));if(U8()&&P.ctrl&&W==="s"&&J)k_1(J,M,X)}),A.type==="error")return JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"error"},"Failed to load stats: ",A.message));if(A.type==="empty")return JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"warning"},"No stats available yet. Start using Claude Code!"));if(!J||!F)return JL.default.createElement(x,{marginTop:1},JL.default.createElement(vD,null),JL.default.createElement(V,null," Loading stats\u2026"));return JL.default.createElement(x,{flexDirection:"column",marginX:1,marginTop:1},JL.default.createElement(x,{flexDirection:"row",gap:1,marginBottom:1},JL.default.createElement(Zz,{title:"",color:"claude",defaultTab:"Overview"},JL.default.createElement(WU,{title:"Overview"},JL.default.createElement(R_1,{stats:J,allTimeStats:F,dateRange:L,isLoading:f})),JL.default.createElement(WU,{title:"Models"},JL.default.createElement(h_1,{stats:J,dateRange:L,isLoading:f})))),JL.default.createElement(x,{paddingLeft:1},JL.default.createElement(V,{dimColor:!0},"Esc to cancel \xB7 r to cycle dates",U8()&&JL.default.createElement(JL.default.Fragment,null," \xB7 ctrl+s to copy",U?` \xB7 ${U}`:""))))}function ArD({dateRange:H,isLoading:$}){return JL.default.createElement(x,{marginBottom:1,gap:1},JL.default.createElement(x,null,Jz$.map((A,L)=>JL.default.createElement(V,{key:A},L>0&&JL.default.createElement(V,{dimColor:!0}," \xB7 "),A===H?JL.default.createElement(V,{bold:!0,color:"claude"},tnD[A]):JL.default.createElement(V,{dimColor:!0},tnD[A])))),$&&JL.default.createElement(vD,null))}function R_1({stats:H,allTimeStats:$,dateRange:A,isLoading:L}){let{columns:I}=QL(),D=Object.entries(H.modelUsage).sort(([,U],[,X])=>X.inputTokens+X.outputTokens-(U.inputTokens+U.outputTokens)),B=D[0],f=D.reduce((U,[,X])=>U+X.inputTokens+X.outputTokens,0),E=JW.useMemo(()=>LrD(H,f),[H,f]),M=A==="7d"?7:A==="30d"?30:H.totalDays,G=null;return JL.default.createElement(x,{flexDirection:"column",marginTop:1},$.dailyActivity.length>0&&JL.default.createElement(x,{flexDirection:"column",marginBottom:1},JL.default.createElement(m9,null,ThA($.dailyActivity,{terminalWidth:I}))),JL.default.createElement(ArD,{dateRange:A,isLoading:L}),JL.default.createElement(x,{flexDirection:"row",gap:4,marginBottom:1},JL.default.createElement(x,{flexDirection:"column",width:28},B&&JL.default.createElement(V,{wrap:"truncate"},"Favorite model:"," ",JL.default.createElement(V,{color:"claude",bold:!0},hV(B[0])))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Total tokens:"," ",JL.default.createElement(V,{color:"claude"},a0(f))))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Sessions:"," ",JL.default.createElement(V,{color:"claude"},a0(H.totalSessions)))),JL.default.createElement(x,{flexDirection:"column",width:28},H.longestSession&&JL.default.createElement(V,{wrap:"truncate"},"Longest session:"," ",JL.default.createElement(V,{color:"claude"},of(H.longestSession.duration))))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Active days: ",JL.default.createElement(V,{color:"claude"},H.activeDays),JL.default.createElement(V,{color:"subtle"},"/",M))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Longest streak:"," ",JL.default.createElement(V,{color:"claude",bold:!0},H.streaks.longestStreak)," ",H.streaks.longestStreak===1?"day":"days"))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},H.peakActivityDay&&JL.default.createElement(V,{wrap:"truncate"},"Most active day:"," ",JL.default.createElement(V,{color:"claude"},O_1(H.peakActivityDay)))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Current streak:"," ",JL.default.createElement(V,{color:"claude",bold:!0},$.streaks.currentStreak)," ",$.streaks.currentStreak===1?"day":"days"))),!1,G&&JL.default.createElement(JL.default.Fragment,null,JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,null,"Shot distribution")),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[0].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[0].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[0].pct,"%)"))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[1].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[1].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[1].pct,"%)")))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[2].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[2].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[2].pct,"%)"))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[3].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[3].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[3].pct,"%)")))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Avg/session:"," ",JL.default.createElement(V,{color:"claude"},G.avgShots))))),E&&JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"suggestion"},E)))}function LrD(H,$){let A=[];if($>0){let I=y_1.filter((D)=>$>=D.tokens);for(let D of I){let B=$/D.tokens;if(B>=2)A.push(`You've used ~${Math.floor(B)}x more tokens than ${D.name}`);else A.push(`You've used the same number of tokens as ${D.name}`)}}if(H.longestSession){let I=H.longestSession.duration/60000;for(let D of v_1){let B=I/D.minutes;if(B>=2)A.push(`Your longest session is ~${Math.floor(B)}x longer than ${D.name}`)}}if(A.length===0)return"";let L=Math.floor(Math.random()*A.length);return A[L]}function h_1({stats:H,dateRange:$,isLoading:A}){let[L,I]=JW.useState(0),{columns:D}=QL(),B=4,f=Object.entries(H.modelUsage).sort(([,P],[,C])=>C.inputTokens+C.outputTokens-(P.inputTokens+P.outputTokens));if(WL((P,C)=>{if(C.downArrow&&LMath.min(Y+2,f.length-4));if(C.upArrow&&L>0)I((Y)=>Math.max(Y-2,0))}),f.length===0)return JL.default.createElement(x,null,JL.default.createElement(V,{color:"subtle"},"No model usage data available"));let E=f.reduce((P,[,C])=>P+C.inputTokens+C.outputTokens,0),M=IrD(H.dailyModelTokens,f.map(([P])=>P),D),G=f.slice(L,L+4),U=Math.ceil(G.length/2),X=G.slice(0,U),J=G.slice(U),F=L>0,Q=L4;return JL.default.createElement(x,{flexDirection:"column",marginTop:1},M&&JL.default.createElement(x,{flexDirection:"column",marginBottom:1},JL.default.createElement(V,{bold:!0},"Tokens per Day"),JL.default.createElement(m9,null,M.chart),JL.default.createElement(V,{color:"subtle"},M.xAxisLabels),JL.default.createElement(x,null,M.legend.map((P,C)=>JL.default.createElement(V,{key:P.model},C>0?" \xB7 ":"",JL.default.createElement(m9,null,P.coloredBullet)," ",P.model)))),JL.default.createElement(ArD,{dateRange:$,isLoading:A}),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:36},X.map(([P,C])=>JL.default.createElement(snD,{key:P,model:P,usage:C,totalTokens:E}))),JL.default.createElement(x,{flexDirection:"column",width:36},J.map(([P,C])=>JL.default.createElement(snD,{key:P,model:P,usage:C,totalTokens:E})))),W&&JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"subtle"},F?pH.arrowUp:" "," ",Q?pH.arrowDown:" "," ",L+1,"-",Math.min(L+4,f.length)," of"," ",f.length," models (\u2191\u2193 to scroll)")))}function snD({model:H,usage:$,totalTokens:A}){let I=(($.inputTokens+$.outputTokens)/A*100).toFixed(1);return JL.default.createElement(x,{flexDirection:"column"},JL.default.createElement(V,null,pH.bullet," ",JL.default.createElement(V,{bold:!0},hV(H))," ",JL.default.createElement(V,{color:"subtle"},"(",I,"%)")),JL.default.createElement(V,{color:"subtle"}," ","In: ",a0($.inputTokens)," \xB7 Out:"," ",a0($.outputTokens)))}function IrD(H,$,A){if(H.length<2||$.length===0)return null;let L=7,I=A-L,D=Math.min(52,Math.max(20,I)),B;if(H.length>=D)B=H.slice(-D);else{let F=Math.floor(D/H.length);B=[];for(let Q of H)for(let W=0;WP.tokensByModel[Q]||0);if(W.some((P)=>P>0)){M.push(W);let P=[f.suggestion,f.success,f.warning];G.push({model:hV(Q),coloredBullet:du(pH.bullet,P[F%P.length])})}}if(M.length===0)return null;let X=HrD.plot(M,{height:8,colors:E.slice(0,M.length),format:(F)=>{let Q;if(F>=1e6)Q=(F/1e6).toFixed(1)+"M";else if(F>=1000)Q=(F/1000).toFixed(0)+"k";else Q=F.toFixed(0);return Q.padStart(6)}}),J=b_1(B,B.length,L);return{chart:X,legend:G,xAxisLabels:J}}function b_1(H,$,A){if(H.length===0)return"";let L=Math.min(4,Math.max(2,Math.floor(H.length/8))),I=H.length-6,D=Math.floor(I/(L-1))||1,B=[];for(let M=0;MA(null),2000)}function u_1(H,$){let A=[];if($==="Overview")A.push(...g_1(H));else A.push(...m_1(H));while(A.length>0&&enD(A[A.length-1]).trim()==="")A.pop();if(A.length>0){let L=A[A.length-1],I=enD(L).length,D=$==="Overview"?70:80,B="/stats",f=Math.max(2,D-I-6);A[A.length-1]=L+" ".repeat(f)+oH.gray("/stats")}return A.join(` `)}function enD(H){return H.replace(/\x1b\[[0-9;]*m/g,"")}function g_1(H){let $=[],A=c6(M$().theme),L=(W)=>du(W,A.claude),I=18,D=40,B=18,f=(W,P,C,Y)=>{let Z=(W+":").padEnd(18),q=Z.length+P.length,O=Math.max(2,40-q),j=(C+":").padEnd(18);return Z+L(P)+" ".repeat(O)+j+L(Y)};if(H.dailyActivity.length>0)$.push(ThA(H.dailyActivity,{terminalWidth:56})),$.push("");let E=Object.entries(H.modelUsage).sort(([,W],[,P])=>P.inputTokens+P.outputTokens-(W.inputTokens+W.outputTokens)),M=E[0],G=E.reduce((W,[,P])=>W+P.inputTokens+P.outputTokens,0);if(M)$.push(f("Favorite model",hV(M[0]),"Total tokens",a0(G)));$.push(""),$.push(f("Sessions",a0(H.totalSessions),"Longest session",H.longestSession?of(H.longestSession.duration):"N/A"));let U=`${H.streaks.currentStreak} ${H.streaks.currentStreak===1?"day":"days"}`,X=`${H.streaks.longestStreak} ${H.streaks.longestStreak===1?"day":"days"}`;$.push(f("Current streak",U,"Longest streak",X));let J=`${H.activeDays}/${H.totalDays}`,F=H.peakActivityHour!==null?`${H.peakActivityHour}:00-${H.peakActivityHour+1}:00`:"N/A";$.push(f("Active days",J,"Peak hour",F)),$.push("");let Q=LrD(H,G);return $.push(L(Q)),$.push(oH.gray(`Stats from the last ${H.totalDays} days`)),$}function m_1(H){let $=[],A=Object.entries(H.modelUsage).sort(([,f],[,E])=>E.inputTokens+E.outputTokens-(f.inputTokens+f.outputTokens));if(A.length===0)return $.push(oH.gray("No model usage data available")),$;let L=A[0],I=A.reduce((f,[,E])=>f+E.inputTokens+E.outputTokens,0),D=IrD(H.dailyModelTokens,A.map(([f])=>f),80);if(D){$.push(oH.bold("Tokens per Day")),$.push(D.chart),$.push(oH.gray(D.xAxisLabels));let f=D.legend.map((E)=>`${E.coloredBullet} ${E.model}`).join(" \xB7 ");$.push(f),$.push("")}$.push(`${pH.star} Favorite: ${oH.magenta.bold(hV(L?.[0]||""))} \xB7 ${pH.circle} Total: ${oH.magenta(a0(I))} tokens`),$.push("");let B=A.slice(0,3);for(let[f,E]of B){let G=((E.inputTokens+E.outputTokens)/I*100).toFixed(1);$.push(`${pH.bullet} ${oH.bold(hV(f))} ${oH.gray(`(${G}%)`)}`),$.push(oH.dim(` In: ${a0(E.inputTokens)} \xB7 Out: ${a0(E.outputTokens)}`))}return $}var JL,JW,HrD,tnD,Jz$,y_1,v_1;var DrD=K(()=>{xH();$I();JM();J1H();jI();r0();qhA();bnD();Q9();onD();aI();vA();Ky();Cn();OB();JL=b(s(),1),JW=b(s(),1),HrD=b(NnD(),1);tnD={"7d":"Last 7 days","30d":"Last 30 days",all:"All time"},Jz$=["all","7d","30d"];y_1=[{name:"The Little Prince",tokens:22000},{name:"The Old Man and the Sea",tokens:35000},{name:"A Christmas Carol",tokens:37000},{name:"Animal Farm",tokens:39000},{name:"Fahrenheit 451",tokens:60000},{name:"The Great Gatsby",tokens:62000},{name:"Slaughterhouse-Five",tokens:64000},{name:"Brave New World",tokens:83000},{name:"The Catcher in the Rye",tokens:95000},{name:"Harry Potter and the Philosopher's Stone",tokens:103000},{name:"The Hobbit",tokens:123000},{name:"1984",tokens:123000},{name:"To Kill a Mockingbird",tokens:130000},{name:"Pride and Prejudice",tokens:156000},{name:"Dune",tokens:244000},{name:"Moby-Dick",tokens:268000},{name:"Crime and Punishment",tokens:274000},{name:"A Game of Thrones",tokens:381000},{name:"Anna Karenina",tokens:468000},{name:"Don Quixote",tokens:520000},{name:"The Lord of the Rings",tokens:576000},{name:"The Count of Monte Cristo",tokens:603000},{name:"Les Mis\xE9rables",tokens:689000},{name:"War and Peace",tokens:730000}],v_1=[{name:"a TED talk",minutes:18},{name:"an episode of The Office",minutes:22},{name:"listening to Abbey Road",minutes:47},{name:"a yoga class",minutes:60},{name:"a World Cup soccer match",minutes:90},{name:"a half marathon (average time)",minutes:120},{name:"the movie Inception",minutes:148},{name:"watching Titanic",minutes:195},{name:"a transatlantic flight",minutes:420},{name:"a full night of sleep",minutes:480}]});var BrD={};XA(BrD,{call:()=>p_1});var yhA,p_1=async(H)=>{return yhA.createElement($rD,{onClose:H})};var frD=K(()=>{DrD();yhA=b(s(),1)});var d_1,ErD;var MrD=K(()=>{d_1={type:"local-jsx",name:"stats",description:"Show your Claude Code usage statistics and activity",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (frD(),BrD)),userFacingName(){return"stats"}},ErD=d_1});function UrD(){return My()}function c_1(){return My()}function r_1(H){let $=wb.extname(H).toLowerCase();return l_1[$]||null}function a_1(H){let $={},A={},L=0,I=0,D=0,B=0,f=0,E=[],M=0,G={},U=!1,X=0,J=0,F=new Set,Q=[],W=[],P=!1,C=!1,Y=!1,Z=null;for(let q of H.messages){let O=q.timestamp;if(q.type==="assistant"&&q.message){if(O)Z=O;let j=q.message.usage;if(j)D+=j.input_tokens||0,B+=j.output_tokens||0;let u=q.message.content;if(Array.isArray(u)){for(let y of u)if(y.type==="tool_use"&&"name"in y){let g=y.name;if($[g]=($[g]||0)+1,g==="Task")U=!0;if(g.startsWith("mcp__"))P=!0;if(g==="WebSearch")C=!0;if(g==="WebFetch")Y=!0;let h=y.input;if(h){let p=h.file_path||"";if(p){let k=r_1(p);if(k)A[k]=(A[k]||0)+1;if(g==="Edit"||g==="Write")F.add(p)}if(g==="Edit"){let k=h.old_string||"",n=h.new_string||"",GH=k?k.split(` "claude_helpfulness": "unhelpful|slightly_helpful|moderately_helpful|very_helpful|essential", }`,B=(await Qz$({systemPrompt:[],userPrompt:L,signal:new AbortController().signal,options:{model:UrD(),querySource:"insights",agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:4096}})).message.content.filter((E)=>E.type==="text").map((E)=>E.text).join("").match(/\{[\s\S]*\}/);if(!B)return null;let f=DA(B[0]);return f.session_id=$,f}catch(A){return r(A instanceof Error?A:Error("Facet extraction failed")),null}}function DY1(H,$){let A={total_sessions:H.length,sessions_with_facets:$.size,date_range:{start:"",end:""},total_messages:0,total_duration_hours:0,total_input_tokens:0,total_output_tokens:0,tool_counts:{},languages:{},git_commits:0,git_pushes:0,projects:{},goal_categories:{},outcomes:{},satisfaction:{},helpfulness:{},session_types:{},friction:{},success:{},session_summaries:[],total_interruptions:0,total_tool_errors:0,tool_error_categories:{},user_response_times:[],median_response_time:0,avg_response_time:0,sessions_using_task_agent:0,sessions_using_mcp:0,sessions_using_web_search:0,sessions_using_web_fetch:0,total_lines_added:0,total_lines_removed:0,total_files_modified:0,days_active:0,messages_per_day:0,message_hours:[],multi_clauding:{overlap_events:0,sessions_involved:0,user_messages_during:0}},L=[],I=[],D=[];for(let X of H){L.push(X.start_time),A.total_messages+=X.user_message_count,A.total_duration_hours+=X.duration_minutes/60,A.total_input_tokens+=X.input_tokens,A.total_output_tokens+=X.output_tokens,A.git_commits+=X.git_commits,A.git_pushes+=X.git_pushes,A.total_interruptions+=X.user_interruptions,A.total_tool_errors+=X.tool_errors;for(let[F,Q]of Object.entries(X.tool_error_categories))A.tool_error_categories[F]=(A.tool_error_categories[F]||0)+Q;if(I.push(...X.user_response_times),X.uses_task_agent)A.sessions_using_task_agent++;if(X.uses_mcp)A.sessions_using_mcp++;if(X.uses_web_search)A.sessions_using_web_search++;if(X.uses_web_fetch)A.sessions_using_web_fetch++;A.total_lines_added+=X.lines_added,A.total_lines_removed+=X.lines_removed,A.total_files_modified+=X.files_modified,D.push(...X.message_hours);for(let[F,Q]of Object.entries(X.tool_counts))A.tool_counts[F]=(A.tool_counts[F]||0)+Q;for(let[F,Q]of Object.entries(X.languages))A.languages[F]=(A.languages[F]||0)+Q;if(X.project_path)A.projects[X.project_path]=(A.projects[X.project_path]||0)+1;let J=$.get(X.session_id);if(J){for(let[F,Q]of Object.entries(J.goal_categories))if(Q>0)A.goal_categories[F]=(A.goal_categories[F]||0)+Q;A.outcomes[J.outcome]=(A.outcomes[J.outcome]||0)+1;for(let[F,Q]of Object.entries(J.user_satisfaction_counts))if(Q>0)A.satisfaction[F]=(A.satisfaction[F]||0)+Q;A.helpfulness[J.claude_helpfulness]=(A.helpfulness[J.claude_helpfulness]||0)+1,A.session_types[J.session_type]=(A.session_types[J.session_type]||0)+1;for(let[F,Q]of Object.entries(J.friction_counts))if(Q>0)A.friction[F]=(A.friction[F]||0)+Q;if(J.primary_success!=="none")A.success[J.primary_success]=(A.success[J.primary_success]||0)+1}if(A.session_summaries.length<50)A.session_summaries.push({id:X.session_id.slice(0,8),date:X.start_time.split("T")[0]||"",summary:X.summary||X.first_prompt.slice(0,100),goal:J?.underlying_goal})}if(L.sort(),A.date_range.start=L[0]?.split("T")[0]||"",A.date_range.end=L[L.length-1]?.split("T")[0]||"",A.user_response_times=I,I.length>0){let X=[...I].sort((J,F)=>J-F);A.median_response_time=X[Math.floor(X.length/2)]||0,A.avg_response_time=I.reduce((J,F)=>J+F,0)/I.length}let B=new Set(L.map((X)=>X.split("T")[0]));A.days_active=B.size,A.messages_per_day=A.days_active>0?Math.round(A.total_messages/A.days_active*10)/10:0,A.message_hours=D;let f=30,E=[];for(let X of H)for(let J of X.user_message_timestamps)try{let F=new Date(J).getTime();E.push({ts:F,sessionId:X.session_id})}catch{}E.sort((X,J)=>X.ts-J.ts);let M=new Set,G=new Set;for(let X=0;Xf)break;if(Q.sessionId!==J.sessionId)for(let P=F+1;Pf)break;if(C.sessionId===J.sessionId){let Z=[J.sessionId,Q.sessionId].sort().join(":");M.add(Z),G.add(`${J.ts}:${J.sessionId}`),G.add(`${Q.ts}:${Q.sessionId}`),G.add(`${C.ts}:${C.sessionId}`);break}}}}let U=new Set;for(let X of M){let[J,F]=X.split(":");if(J)U.add(J);if(F)U.add(F)}return A.multi_clauding={overlap_events:M.size,sessions_involved:U.size,user_messages_during:G.size},A}async function GrD(H,$){try{let L=(await Qz$({systemPrompt:[],userPrompt:H.prompt+` `+$,signal:new AbortController().signal,options:{model:c_1(),querySource:"insights",agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:H.maxTokens}})).message.content.filter((I)=>I.type==="text").map((I)=>I.text).join("");if(L){let I=L.match(/\{[\s\S]*\}/);if(I)try{return{name:H.name,result:DA(I[0])}}catch{return{name:H.name,result:null}}}return{name:H.name,result:null}}catch(A){return r(A instanceof Error?A:Error(`${H.name} failed`)),{name:H.name,result:null}}}async function fY1(H,$){let A=Array.from($.values()).slice(0,50).map((C)=>`- ${C.brief_summary} (${C.outcome}, ${C.claude_helpfulness})`).join(` `),I=Array.from($.values()).flatMap((C)=>C.user_instructions_to_claude||[]).slice(0,15).map((C)=>`- ${C}`).join(` ${J.claude_md_additions&&J.claude_md_additions.length>0?`
${J.claude_md_additions.map((y,g)=>`
.claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; } .claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; } .claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe; } .claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; } .claude-md-item:last-child { border-bottom: none; } .claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; } .claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; } .claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe; } .claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; } .claude-md-item:last-child { border-bottom: none; } `,BY1,EY1,MY1,KY1,XrD;var JrD=K(()=>{rB();aI();DL();Z$();NA();_$();dU();Z$();wb=require("path");l_1={".ts":"TypeScript",".tsx":"TypeScript",".js":"JavaScript",".jsx":"JavaScript",".py":"Python",".rb":"Ruby",".go":"Go",".rs":"Rust",".java":"Java",".md":"Markdown",".json":"JSON",".yaml":"YAML",".yml":"YAML",".sh":"Shell",".css":"CSS",".html":"HTML"},i_1={debug_investigate:"Debug/Investigate",implement_feature:"Implement Feature",fix_bug:"Fix Bug",write_script_tool:"Write Script/Tool",refactor_code:"Refactor Code",configure_system:"Configure System",create_pr_commit:"Create PR/Commit",analyze_data:"Analyze Data",understand_codebase:"Understand Codebase",write_tests:"Write Tests",write_docs:"Write Docs",deploy_infra:"Deploy/Infra",warmup_minimal:"Cache Warmup",fast_accurate_search:"Fast/Accurate Search",correct_code_edits:"Correct Code Edits",good_explanations:"Good Explanations",proactive_help:"Proactive Help",multi_file_changes:"Multi-file Changes",handled_complexity:"Multi-file Changes",good_debugging:"Good Debugging",misunderstood_request:"Misunderstood Request",wrong_approach:"Wrong Approach",buggy_code:"Buggy Code",user_rejected_action:"User Rejected Action",claude_got_blocked:"Claude Got Blocked",user_stopped_early:"User Stopped Early",wrong_file_or_location:"Wrong File/Location",excessive_changes:"Excessive Changes",slow_or_verbose:"Slow/Verbose",tool_failed:"Tool Failed",user_unclear:"User Unclear",external_issue:"External Issue",frustrated:"Frustrated",dissatisfied:"Dissatisfied",likely_satisfied:"Likely Satisfied",satisfied:"Satisfied",happy:"Happy",unsure:"Unsure",neutral:"Neutral",delighted:"Delighted",single_task:"Single Task",multi_task:"Multi Task",iterative_refinement:"Iterative Refinement",exploration:"Exploration",quick_question:"Quick Question",fully_achieved:"Fully Achieved",mostly_achieved:"Mostly Achieved",partially_achieved:"Partially Achieved",not_achieved:"Not Achieved",unclear_from_transcript:"Unclear",unhelpful:"Unhelpful",slightly_helpful:"Slightly Helpful",moderately_helpful:"Moderately Helpful",very_helpful:"Very Helpful",essential:"Essential"},vhA=wb.join(UL(),"usage-data"),Kz$=wb.join(vhA,"facets");BY1=[{name:"project_areas",prompt:`Analyze this Claude Code usage data and identify project areas. - How to use: Run \`claude mcp add -- \` - How to use: Create \`.claude/skills/commit/SKILL.md\` with instructions. Then type \`/commit\` to run it. - How to use: Add to \`.claude/settings.json\` under "hooks" key. - How to use: \`claude -p "fix lint errors" --allowedTools "Edit,Read,Bash"\` "claude_md_additions": [ IMPORTANT for claude_md_additions: PRIORITIZE instructions that appear MULTIPLE TIMES in the user data. If user told Claude the same thing in 2+ sessions (e.g., 'always run tests', 'use TypeScript'), that's a PRIME candidate - they shouldn't have to repeat themselves. Each wake-up costs an API call, but the prompt cache expires after 5 minutes of inactivity \u2014 balance accordingly.`});async function PY1(){if(!nL())return null;let H=`${XD().BASE_API_URL}/api/oauth/claude_cli/client_data`,$=dD()?.accessToken??null,A=()=>{let L=eG();if(L.error)throw Error(`Auth error: ${L.error}`);let I={"Content-Type":"application/json","User-Agent":sG(),...L.headers};return nA.get(H,{headers:I,timeout:5000}).then((D)=>D.data.client_data??null)};try{return await A()}catch(L){if(nA.isAxiosError(L)&&L.response?.status===401&&$){if(await A4H($))return await A()}throw L}}async function YY1(){try{let H=await _Y1(),$={data:H,timestamp:Date.now()};return AA((A)=>({...A,clientDataCache:$})),H}catch(H){return r(H),null}}function CY1(H){if(!H)return null;let $=H.system_prompt_variant;return typeof $==="string"?$:null}function WrD(){YY1();try{let H=M$().clientDataCache;return H?CY1(H.data):null}catch{return null}}var VY1=3600000,_Y1;var VrD=K(()=>{w1();wwH();_Q();_$();vA();qE();EI();_Y1=zGH(PY1,VY1)});var Wz$="IMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.";function qY1(H){return` - To give feedback, users should ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.ISSUES_EXPLAINER}`}function TY1(H){if(H!==null)return null;return`# Tone and style You have access to past session data that may contain valuable context. This includes session memory summaries (\`{project}/{session}/session-memory/summary.md\`) and full transcript logs (\`{project}/{sessionId}.jsonl\`), stored under \`~/.claude/projects/\`. `)}function hY1(){let H=[`Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.`,"Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.","Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task\u2014three similar lines of code is better than a premature abstraction."],$=["/help: Get help with using Claude Code",`To give feedback, users should ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.ISSUES_EXPLAINER}`],A=['The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change "methodName" to snake case, do not reply with just "method_name", instead find the method in the code and modify the code.',"You are highly capable and often allow users to complete ambitious tasks that would otherwise be too complex or take too long. You should defer to user judgement about whether a task is too large to attempt.","In general, do not propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications","Do not create files unless they're absolutely necessary for achieving your goal. Generally prefer editing an existing file to creating a new one, as this prevents file bloat and builds on existing work more effectively.","Avoid giving time estimates or predictions for how long tasks will take, whether for your own work or for users planning projects. Focus on what needs to be done, not how long it might take.",`If your approach is blocked, do not attempt to brute force your way to the outcome. For example, if an API call or test fails, do not wait and retry the same action repeatedly. Instead, consider alternative approaches or other ways you might unblock yourself, or consider using the ${EU} to align with the user on the right path forward.`,"Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it. Prioritize writing safe, secure, and correct code.","Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.",H,"Avoid backwards-compatibility hacks like renaming unused _vars, re-exporting types, adding // removed comments for removed code, etc. If you are certain that something is unused, you can delete it completely.","If the user asks for help or wants to give feedback inform them of the following:",$];return["# Doing tasks",...C3H(A)].join(` `,G=` `)}function NrD(H){if(H.includes("claude-opus-4-6"))return"May 2025";else if(H.includes("claude-opus-4-5"))return"May 2025";else if(H.includes("claude-haiku-4"))return"February 2025";else if(H.includes("claude-opus-4")||H.includes("claude-sonnet-4-5")||H.includes("claude-sonnet-4"))return"January 2025";return null}async function IkH(H,$,A){let I=await chA($,A);return[...H,`Notes: The scratchpad directory is session-specific, isolated from the user's project, and can be used freely without permission prompts.`}var wY1=null,p3H="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",dhA="Claude Opus 4.6",ZY1="claude-opus-4-6",phA,OrD,GQD="You are an agent for Claude Code, Anthropic's official CLI for Claude. Given the user's message, you should use the tools available to complete the task. Do what has been asked; nothing more, nothing less. When you complete the task simply respond with a detailed writeup.";var Ow=K(()=>{Z1();t8();PI();mL();GK();tG();q5H();B0();$4H();h4();BW();jh();vV();hyH();BM();rB();g$();NA();tD();aI();SD();mZ$();mhA();EE();E$();I7A();VrD();phA={opus:"claude-opus-4-6",sonnet:"claude-sonnet-4-5-20250929",haiku:"claude-haiku-4-5-20251001"};OrD=o$(async function(){try{let{stdout:H}=await jA("uname",["-sr"],{preserveOutputOnError:!1});return H.trim()}catch{return"unknown"}})});function y4$(H){let $={},A=process.env.CLAUDE_CODE_EXTRA_BODY,L={};if(A)try{let D=q1(A);if(D&&typeof D==="object"&&!Array.isArray(D))L=D;else N(`CLAUDE_CODE_EXTRA_BODY env var must be a JSON object, but was given ${A}`,{level:"error"})}catch(D){N(`Error parsing CLAUDE_CODE_EXTRA_BODY: ${D instanceof Error?D.message:String(D)}`,{level:"error"})}let I={...$,...L};if(H&&H.length>0)if(I.anthropic_beta&&Array.isArray(I.anthropic_beta)){let D=I.anthropic_beta,B=H.filter((f)=>!D.includes(f));I.anthropic_beta=[...D,...B]}else I.anthropic_beta=H;return I}function SrD(H){if(A$(process.env.DISABLE_PROMPT_CACHING))return!1;if(A$(process.env.DISABLE_PROMPT_CACHING_HAIKU)){let $=LJ();if(H===$)return!1}if(A$(process.env.DISABLE_PROMPT_CACHING_SONNET)){let $=Oq();if(H===$)return!1}if(A$(process.env.DISABLE_PROMPT_CACHING_OPUS)){let $=My();if(H===$)return!1}return!0}function KPH(H){return{type:"ephemeral",...nL()&&!a2.isUsingOverage?{ttl:"1h"}:{},...H==="global"?{scope:H}:{}}}function mY1(H,$,A,L,I){if(!Ks()||!cgH(I)||"effort"in $)return;if(H===void 0)L.push(ZS$);else if(typeof H==="string")$.effort=H,L.push(ZS$)}function qr(){let H=ux(),$=T9()?.accountUuid??"",A=j$();return{user_id:`user_${H}_account_${$}_session_${A}`}}async function RrD(H,$){if($)return!0;try{let A=LJ(),L=U2(A);return await chI(RU$(()=>eO({apiKey:H,maxRetries:3,model:A}),async(I)=>{let D=[{role:"user",content:"test"}];return await I.beta.messages.create({model:A,max_tokens:1,messages:D,temperature:1,...L.length>0?{betas:L}:{},metadata:qr(),...y4$()}),!0},{maxRetries:2,model:A}))}catch(A){let L=A;if(A instanceof ay)L=A.originalError;if(r(L),L instanceof Error&&L.message.includes('{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}'))return!1;throw L}}function pY1(H,$=!1,A){if($)if(typeof H.message.content==="string")return{role:"user",content:[{type:"text",text:H.message.content,...A?{cache_control:KPH()}:{}}]};else return{role:"user",content:H.message.content.map((L,I)=>({...L,...I===H.message.content.length-1?A?{cache_control:KPH()}:{}:{}}))};return{role:"user",content:H.message.content}}function dY1(H,$=!1,A){if($)if(typeof H.message.content==="string")return{role:"assistant",content:[{type:"text",text:H.message.content,...A?{cache_control:KPH()}:{}}]};else return{role:"assistant",content:H.message.content.map((L,I)=>({...L,...I===H.message.content.length-1&&L.type!=="thinking"&&L.type!=="redacted_thinking"?A?{cache_control:KPH()}:{}:{}}))};return{role:"assistant",content:H.message.content}}async function xm({messages:H,systemPrompt:$,maxThinkingTokens:A,tools:L,signal:I,options:D}){let B;for await(let f of m5A(H,async function*(){yield*yrD(H,$,A,L,I,D)}))if(f.type==="assistant")B=f;if(!B){if(I.aborted)throw new rf;throw Error("No assistant message found")}return B}async function*e6H({messages:H,systemPrompt:$,maxThinkingTokens:A,tools:L,signal:I,options:D}){return yield*m5A(H,async function*(){yield*yrD(H,$,A,L,I,D)})}function cY1(H){if(!("isLsp"in H)||!H.isLsp)return!1;let $=w9H();return $.status==="pending"||$.status==="not-started"}async function*jrD(H,$,A,L,I){let D=RU$(()=>eO({maxRetries:0,model:H.model,fetchOverride:H.fetchOverride}),async(f,E,M)=>{let G=Date.now(),U=A(M);I(U),L(E,G,U.max_tokens);let X=rY1(U,nY1);return await f.beta.messages.create({...X,model:vu(X.model)})},{model:$.model,fallbackModel:$.fallbackModel,maxThinkingTokens:$.maxThinkingTokens,...cD()?{fastMode:$.fastMode}:{},signal:$.signal}),B;do if(B=await D.next(),!B.done&&B.value.type==="system")yield B.value;while(!B.done);return B.value}async function*yrD(H,$,A,L,I,D){if(!nL()&&(await aS("tengu-off-switch",{activated:!1})).activated&&_5H(D.model)){c("tengu_off_switch_query",{}),yield SU$(Error(ADH),D.model);return}let B=sI()==="bedrock"&&D.model.includes("application-inference-profile")?await zD$(D.model)??D.model:D.model;_9("query_tool_schema_build_start");let f=YeH(D.model),E=await puH(D.model,L,D.getToolPermissionContext,D.agents,"query");if(E&&!L.some(U3))N("Tool search disabled: no deferred tools available to search"),E=!1;let M;if(E){let e=rhA(H);M=L.filter((DH)=>{if(!U3(DH))return!0;if(DH.name===C7)return!0;return e.has(DH.name)})}else M=L.filter((e)=>e.name!==C7);let G=E?A8L():null;if(G&&sI()!=="bedrock"){if(!f.includes(G))f.push(G)}let U=L.some((e)=>e.isMcp===!0),X=M.some((e)=>e.name===C7),J=_eH()&&(A$(process.env.CLAUDE_CODE_FORCE_GLOBAL_CACHE)||NL("tengu_system_prompt_global_cache",!1)),F=J&&(U||X);if(J&&!f.includes(NYH))f.push(NYH);let Q;if(F){let e=M.findIndex((DH)=>DH.isMcp===!0);if(e>0)Q=M[e-1];else if(e===-1)Q=M.findLast((DH)=>DH.name!==C7);else if(e===0)N("All tools are MCP tools (firstMcpIndex === 0), no stable tool for cache marker")}let W="none";if(F&&Q)W="tool_based",N(`Using tool-based global cache marker on ${Q.name}`);else if(F&&!Q)W="system_prompt",N("No stable tool found for cache marker, falling back to system prompt caching"),c("tengu_sysprompt_no_stable_tool_for_cache",{hasMcpTools:U,hasMcpSearchTool:X,filteredToolsCount:M.length});else if(J)W="system_prompt";let P=await Promise.all(M.map((e)=>ew$(e,{getToolPermissionContext:D.getToolPermissionContext,tools:L,agents:D.agents,allowedAgentTypes:D.allowedAgentTypes,model:D.model,betas:f,deferLoading:E&&(U3(e)||cY1(e)),cacheControl:Q&&e===Q?KPH("global"):void 0})));if(E){let e=L.filter(U3).length,DH=M.filter(U3).length;N(`Dynamic tool loading: ${DH}/${e} deferred tools included`)}_9("query_tool_schema_build_end"),c("tengu_api_before_normalize",{preNormalizedMessageCount:H.length}),_9("query_message_normalization_start");let C=JJ(H,M);if(_9("query_message_normalization_end"),!E)C=C.map((e)=>{switch(e.type){case"user":return nhA(e);case"assistant":return vrD(e);default:return e}});C=hrD(C),c("tengu_api_after_normalize",{postNormalizedMessageCount:C.length});let Y=goL(C);if(E&&NF$()){let e=L.filter(U3).map((DH)=>DH.name).sort().join(` ${JSON.stringify(I,null,2)}`),Error("Language.load failed: no language function found in WASM file");let B=L[D]();return new H(He,B)}},uC1=(()=>{var _scriptName="file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js";return async function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((H,$)=>{readyPromiseResolve=H,readyPromiseReject=$}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){let{createRequire:H}=await import("module");var require=H("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js")}Module.currentQueryProgressCallback=null,Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null;var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=GA((H,$)=>{throw $},"quit_"),scriptDirectory="";function locateFile(H){if(Module.locateFile)return Module.locateFile(H,scriptDirectory);return scriptDirectory+H}GA(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");if(!"file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js".startsWith("data:"))scriptDirectory=nodePath.dirname(require("url").fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js"))+"/";if(readBinary=GA((H)=>{H=isFileURI(H)?new URL(H):H;var $=fs.readFileSync(H);return $},"readBinary"),readAsync=GA(async(H,$=!0)=>{H=isFileURI(H)?new URL(H):H;var A=fs.readFileSync(H,$?void 0:"utf8");return A},"readAsync"),!Module.thisProgram&&process.argv.length>1)thisProgram=process.argv[1].replace(/\\/g,"/");arguments_=process.argv.slice(2),quit_=GA((H,$)=>{throw process.exitCode=H,$},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER)scriptDirectory=self.location.href;else if(typeof document<"u"&&document.currentScript)scriptDirectory=document.currentScript.src;if(_scriptName)scriptDirectory=_scriptName;if(scriptDirectory.startsWith("blob:"))scriptDirectory="";else scriptDirectory=scriptDirectory.slice(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);{if(ENVIRONMENT_IS_WORKER)readBinary=GA((H)=>{var $=new XMLHttpRequest;return $.open("GET",H,!1),$.responseType="arraybuffer",$.send(null),new Uint8Array($.response)},"readBinary");readAsync=GA(async(H)=>{if(isFileURI(H))return new Promise((A,L)=>{var I=new XMLHttpRequest;I.open("GET",H,!0),I.responseType="arraybuffer",I.onload=()=>{if(I.status==200||I.status==0&&I.response){A(I.response);return}L(I.status)},I.onerror=L,I.send(null)});var $=await fetch(H,{credentials:"same-origin"});if($.ok)return $.arrayBuffer();throw Error($.status+" : "+$.url)},"readAsync")}}var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);if(Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments)arguments_=Module.arguments;if(Module.thisProgram)thisProgram=Module.thisProgram;var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(H,$){if(!H)abort($)}GA(assert,"assert");var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPU64,HEAPF64,HEAP_DATA_VIEW,runtimeInitialized=!1,isFileURI=GA((H)=>H.startsWith("file://"),"isFileURI");function updateMemoryViews(){var H=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(H),Module.HEAP8=HEAP8=new Int8Array(H),Module.HEAP16=HEAP16=new Int16Array(H),Module.HEAPU8=HEAPU8=new Uint8Array(H),Module.HEAPU16=HEAPU16=new Uint16Array(H),Module.HEAP32=HEAP32=new Int32Array(H),Module.HEAPU32=HEAPU32=new Uint32Array(H),Module.HEAPF32=HEAPF32=new Float32Array(H),Module.HEAPF64=HEAPF64=new Float64Array(H),Module.HEAP64=HEAP64=new BigInt64Array(H),Module.HEAPU64=HEAPU64=new BigUint64Array(H)}if(GA(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun){if(typeof Module.preRun=="function")Module.preRun=[Module.preRun];while(Module.preRun.length)addOnPreRun(Module.preRun.shift())}callRuntimeCallbacks(onPreRuns)}GA(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}GA(initRuntime,"initRuntime");function preMain(){}GA(preMain,"preMain");function postRun(){if(Module.postRun){if(typeof Module.postRun=="function")Module.postRun=[Module.postRun];while(Module.postRun.length)addOnPostRun(Module.postRun.shift())}callRuntimeCallbacks(onPostRuns)}GA(postRun,"postRun");var runDependencies=0,dependenciesFulfilled=null;function getUniqueRunDependency(H){return H}GA(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(H){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}GA(addRunDependency,"addRunDependency");function removeRunDependency(H){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0){if(dependenciesFulfilled){var $=dependenciesFulfilled;dependenciesFulfilled=null,$()}}}GA(removeRunDependency,"removeRunDependency");function abort(H){Module.onAbort?.(H),H="Aborted("+H+")",err(H),ABORT=!0,H+=". Build with -sASSERTIONS for more info.";var $=new WebAssembly.RuntimeError(H);throw readyPromiseReject($),$}GA(abort,"abort");var wasmBinaryFile;function findWasmBinary(){if(Module.locateFile)return locateFile("tree-sitter.wasm");return new URL("tree-sitter.wasm","file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js").href}GA(findWasmBinary,"findWasmBinary");function getBinarySync(H){if(H==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(H);throw"both async and sync fetching of the wasm failed"}GA(getBinarySync,"getBinarySync");async function getWasmBinary(H){if(!wasmBinary)try{var $=await readAsync(H);return new Uint8Array($)}catch{}return getBinarySync(H)}GA(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(H,$){try{var A=await getWasmBinary(H),L=await WebAssembly.instantiate(A,$);return L}catch(I){err(`failed to asynchronously prepare wasm: ${I}`),abort(I)}}GA(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(H,$,A){if(!H&&typeof WebAssembly.instantiateStreaming=="function"&&!isFileURI($)&&!ENVIRONMENT_IS_NODE)try{var L=fetch($,{credentials:"same-origin"}),I=await WebAssembly.instantiateStreaming(L,A);return I}catch(D){err(`wasm streaming compile failed: ${D}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer($,A)}GA(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}GA(getWasmImports,"getWasmImports");async function createWasm(){function H(D,B){wasmExports=D.exports,wasmExports=relocateExports(wasmExports,1024);var f=getDylinkMetadata(B);if(f.neededDynlibs)dynamicLibraries=f.neededDynlibs.concat(dynamicLibraries);return mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}GA(H,"receiveInstance"),addRunDependency("wasm-instantiate");function $(D){return H(D.instance,D.module)}GA($,"receiveInstantiationResult");var A=getWasmImports();if(Module.instantiateWasm)return new Promise((D,B)=>{Module.instantiateWasm(A,(f,E)=>{H(f,E),D(f.exports)})});wasmBinaryFile??=findWasmBinary();try{var L=await instantiateAsync(wasmBinary,wasmBinaryFile,A),I=$(L);return I}catch(D){return readyPromiseReject(D),Promise.reject(D)}}GA(createWasm,"createWasm");var ASM_CONSTS={};class ExitStatus{static{GA(this,"ExitStatus")}name="ExitStatus";constructor(H){this.message=`Program terminated with exit(${H})`,this.status=H}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(H,$){var A=GOT[$];if(!A)A=GOT[$]=new WebAssembly.Global({value:"i32",mutable:!0});if(!currentModuleWeakSymbols.has($))A.required=!0;return A}},LE_HEAP_LOAD_F32=GA((H)=>HEAP_DATA_VIEW.getFloat32(H,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=GA((H)=>HEAP_DATA_VIEW.getFloat64(H,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=GA((H)=>HEAP_DATA_VIEW.getInt16(H,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=GA((H)=>HEAP_DATA_VIEW.getInt32(H,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U16=GA((H)=>HEAP_DATA_VIEW.getUint16(H,!0),"LE_HEAP_LOAD_U16"),LE_HEAP_LOAD_U32=GA((H)=>HEAP_DATA_VIEW.getUint32(H,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=GA((H,$)=>HEAP_DATA_VIEW.setFloat32(H,$,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=GA((H,$)=>HEAP_DATA_VIEW.setFloat64(H,$,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=GA((H,$)=>HEAP_DATA_VIEW.setInt16(H,$,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=GA((H,$)=>HEAP_DATA_VIEW.setInt32(H,$,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U16=GA((H,$)=>HEAP_DATA_VIEW.setUint16(H,$,!0),"LE_HEAP_STORE_U16"),LE_HEAP_STORE_U32=GA((H,$)=>HEAP_DATA_VIEW.setUint32(H,$,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=GA((H)=>{while(H.length>0)H.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=GA((H)=>onPostRuns.unshift(H),"addOnPostRun"),onPreRuns=[],addOnPreRun=GA((H)=>onPreRuns.unshift(H),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=GA((H,$=0,A=NaN)=>{var L=$+A,I=$;while(H[I]&&!(I>=L))++I;if(I-$>16&&H.buffer&&UTF8Decoder)return UTF8Decoder.decode(H.subarray($,I));var D="";while($>10,56320|M&1023)}}return D},"UTF8ArrayToString"),getDylinkMetadata=GA((H)=>{var $=0,A=0;function L(){return H[$++]}GA(L,"getU8");function I(){var d=0,k=1;while(!0){var n=H[$++];if(d+=(n&127)*k,k*=128,!(n&128))break}return d}GA(I,"getLEB");function D(){var d=I();return $+=d,UTF8ArrayToString(H,$-d,d)}GA(D,"getString");function B(d,k){if(d)throw Error(k)}GA(B,"failIf");var f="dylink.0";if(H instanceof WebAssembly.Module){var E=WebAssembly.Module.customSections(H,f);if(E.length===0)f="dylink",E=WebAssembly.Module.customSections(H,f);B(E.length===0,"need dylink section"),H=new Uint8Array(E[0]),A=H.length}else{var M=new Uint32Array(new Uint8Array(H.subarray(0,24)).buffer),G=M[0]==1836278016||M[0]==6386541;B(!G,"need to see wasm magic number"),B(H[8]!==0,"need the dylink section to be first"),$=9;var U=I();A=$+U,f=D()}var X={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(f=="dylink"){X.memorySize=I(),X.memoryAlign=I(),X.tableSize=I(),X.tableAlign=I();var J=I();for(var F=0;F>1)*2);case"i32":return LE_HEAP_LOAD_I32((H>>2)*4);case"i64":return HEAP64[H>>3];case"float":return LE_HEAP_LOAD_F32((H>>2)*4);case"double":return LE_HEAP_LOAD_F64((H>>3)*8);case"*":return LE_HEAP_LOAD_U32((H>>2)*4);default:abort(`invalid type for getValue: ${$}`)}}GA(getValue,"getValue");var newDSO=GA((H,$,A)=>{var L={refcount:1/0,name:H,exports:A,global:!0};if(LDSO.loadedLibsByName[H]=L,$!=null)LDSO.loadedLibsByHandle[$]=L;return L},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78224,alignMemory=GA((H,$)=>Math.ceil(H/$)*$,"alignMemory"),getMemory=GA((H)=>{if(runtimeInitialized)return _calloc(H,1);var $=___heap_base,A=$+alignMemory(H,16);return ___heap_base=A,GOT.__heap_base.value=A,$},"getMemory"),isInternalSym=GA((H)=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(H)||H.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=GA((H,$)=>{if(H<128)$.push(H);else $.push(H%128|128,H>>7)},"uleb128Encode"),sigToWasmTypes=GA((H)=>{var $={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},A={parameters:[],results:H[0]=="v"?[]:[$[H[0]]]};for(var L=1;L{var A=H.slice(0,1),L=H.slice(1),I={i:127,p:127,j:126,f:125,d:124,e:111};$.push(96),uleb128Encode(L.length,$);for(var D=0;D{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes($),H);var A=[1];generateFuncType($,A);var L=[0,97,115,109,1,0,0,0,1];uleb128Encode(A.length,L),L.push(...A),L.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var I=new WebAssembly.Module(new Uint8Array(L)),D=new WebAssembly.Instance(I,{e:{f:H}}),B=D.exports.f;return B},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:31,element:"anyfunc"}),getWasmTableEntry=GA((H)=>{var $=wasmTableMirror[H];if(!$){if(H>=wasmTableMirror.length)wasmTableMirror.length=H+1;wasmTableMirror[H]=$=wasmTable.get(H)}return $},"getWasmTableEntry"),updateTableMap=GA((H,$)=>{if(functionsInTableMap)for(var A=H;A{if(!functionsInTableMap)functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length);return functionsInTableMap.get(H)||0},"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=GA(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(H){if(!(H instanceof RangeError))throw H;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=GA((H,$)=>{wasmTable.set(H,$),wasmTableMirror[H]=wasmTable.get(H)},"setWasmTableEntry"),addFunction=GA((H,$)=>{var A=getFunctionAddress(H);if(A)return A;var L=getEmptyTableSlot();try{setWasmTableEntry(L,H)}catch(D){if(!(D instanceof TypeError))throw D;var I=convertJsFunctionToWasm(H,$);setWasmTableEntry(L,I)}return functionsInTableMap.set(H,L),L},"addFunction"),updateGOT=GA((H,$)=>{for(var A in H){if(isInternalSym(A))continue;var L=H[A];if(GOT[A]||=new WebAssembly.Global({value:"i32",mutable:!0}),$||GOT[A].value==0)if(typeof L=="function")GOT[A].value=addFunction(L);else if(typeof L=="number")GOT[A].value=L;else err(`unhandled export type for '${A}': ${typeof L}`)}},"updateGOT"),relocateExports=GA((H,$,A)=>{var L={};for(var I in H){var D=H[I];if(typeof D=="object")D=D.value;if(typeof D=="number")D+=$;L[I]=D}return updateGOT(L,A),L},"relocateExports"),isSymbolDefined=GA((H)=>{var $=wasmImports[H];if(!$||$.stub)return!1;return!0},"isSymbolDefined"),dynCall=GA((H,$,A=[])=>{var L=getWasmTableEntry($)(...A);return L},"dynCall"),stackSave=GA(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=GA((H)=>__emscripten_stack_restore(H),"stackRestore"),createInvokeFunction=GA((H)=>($,...A)=>{var L=stackSave();try{return dynCall(H,$,A)}catch(I){if(stackRestore(L),I!==I+0)throw I;if(_setThrew(1,0),H[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=GA((H,$=!1)=>{var A;if(isSymbolDefined(H))A=wasmImports[H];else if(H.startsWith("invoke_"))A=wasmImports[H]=createInvokeFunction(H.split("_")[1]);return{sym:A,name:H}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=GA((H)=>onPostCtors.unshift(H),"addOnPostCtor"),UTF8ToString=GA((H,$)=>H?UTF8ArrayToString(HEAPU8,H,$):"","UTF8ToString"),loadWebAssemblyModule=GA((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;if(handle)HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize);if(metadata.tableSize)wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(H){var $=resolveGlobalSymbol(H).sym;if(!$&&localScope)$=localScope[H];if(!$)$=moduleExports[H];return $}GA(resolveSymbol,"resolveSymbol");var proxyHandler={get(H,$){switch($){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if($ in wasmImports&&!wasmImports[$].stub){var A=wasmImports[$];return A}if(!($ in H)){var L;H[$]=(...I)=>{return L||=resolveSymbol($),L(...I)}}return H[$]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),!flags.allowUndefined)reportUndefinedSymbols();function addEmAsm(addr,body){var args=[],arity=0;for(;arity<16;arity++)if(body.indexOf("$"+arity)!=-1)args.push("$"+arity);else break;args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(GA(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports){var{__start_em_asm:start,__stop_em_asm:stop}=moduleExports;while(start ${body};`;moduleExports[name]=eval(func)}GA(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;if(applyRelocs)if(runtimeInitialized)applyRelocs();else __RELOC_FUNCS__.push(applyRelocs);var init=moduleExports.__wasm_call_ctors;if(init)if(runtimeInitialized)init();else addOnPostCtor(init);return moduleExports}if(GA(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then((H)=>postInstantiation(H.module,H.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}if(GA(loadModule,"loadModule"),flags.loadAsync)return metadata.neededDynlibs.reduce((H,$)=>H.then(()=>loadDynamicLibrary($,flags,localScope)),Promise.resolve()).then(loadModule);return metadata.neededDynlibs.forEach((H)=>loadDynamicLibrary(H,flags,localScope)),loadModule()},"loadWebAssemblyModule"),mergeLibSymbols=GA((H,$)=>{for(var[A,L]of Object.entries(H)){let I=GA((B)=>{if(!isSymbolDefined(B))wasmImports[B]=L},"setImport");I(A);let D="__main_argc_argv";if(A=="main")I(D);if(A==D)I("main")}},"mergeLibSymbols"),asyncLoad=GA(async(H)=>{var $=await readAsync(H);return new Uint8Array($)},"asyncLoad");function loadDynamicLibrary(H,$={global:!0,nodelete:!0},A,L){var I=LDSO.loadedLibsByName[H];if(I){if(!$.global){if(A)Object.assign(A,I.exports)}else if(!I.global)I.global=!0,mergeLibSymbols(I.exports,H);if($.nodelete&&I.refcount!==1/0)I.refcount=1/0;if(I.refcount++,L)LDSO.loadedLibsByHandle[L]=I;return $.loadAsync?Promise.resolve(!0):!0}I=newDSO(H,L,"loading"),I.refcount=$.nodelete?1/0:1,I.global=$.global;function D(){if(L){var E=LE_HEAP_LOAD_U32((L+28>>2)*4),M=LE_HEAP_LOAD_U32((L+32>>2)*4);if(E&&M){var G=HEAP8.slice(E,E+M);return $.loadAsync?Promise.resolve(G):G}}var U=locateFile(H);if($.loadAsync)return asyncLoad(U);if(!readBinary)throw Error(`${U}: file not found, and synchronous loading of external files is not available`);return readBinary(U)}GA(D,"loadLibData");function B(){if($.loadAsync)return D().then((E)=>loadWebAssemblyModule(E,$,H,A,L));return loadWebAssemblyModule(D(),$,H,A,L)}GA(B,"getExports");function f(E){if(I.global)mergeLibSymbols(E,H);else if(A)Object.assign(A,E);I.exports=E}if(GA(f,"moduleLoaded"),$.loadAsync)return B().then((E)=>{return f(E),!0});return f(B()),!0}GA(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=GA(()=>{for(var[H,$]of Object.entries(GOT))if($.value==0){var A=resolveGlobalSymbol(H,!0).sym;if(!A&&!$.required)continue;if(typeof A=="function")$.value=addFunction(A,A.sig);else if(typeof A=="number")$.value=A;else throw Error(`bad export type for '${H}': ${typeof A}`)}},"reportUndefinedSymbols"),loadDylibs=GA(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((H,$)=>H.then(()=>loadDynamicLibrary($,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(H,$,A="i8"){if(A.endsWith("*"))A="*";switch(A){case"i1":HEAP8[H]=$;break;case"i8":HEAP8[H]=$;break;case"i16":LE_HEAP_STORE_I16((H>>1)*2,$);break;case"i32":LE_HEAP_STORE_I32((H>>2)*4,$);break;case"i64":HEAP64[H>>3]=BigInt($);break;case"float":LE_HEAP_STORE_F32((H>>2)*4,$);break;case"double":LE_HEAP_STORE_F64((H>>3)*8,$);break;case"*":LE_HEAP_STORE_U32((H>>2)*4,$);break;default:abort(`invalid type for setValue: ${A}`)}}GA(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78224),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=GA(()=>abort(""),"__abort_js");__abort_js.sig="v";var _emscripten_get_now=GA(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var _emscripten_date_now=GA(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var nowIsMonotonic=1,checkWasiClock=GA((H)=>H>=0&&H<=3,"checkWasiClock"),INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=GA((H)=>HINT53_MAX?NaN:Number(H),"bigintToI53Checked");function _clock_time_get(H,$,A){if($=bigintToI53Checked($),!checkWasiClock(H))return 28;var L;if(H===0)L=_emscripten_date_now();else if(nowIsMonotonic)L=_emscripten_get_now();else return 52;var I=Math.round(L*1000*1000);return HEAP64[A>>3]=BigInt(I),0}GA(_clock_time_get,"_clock_time_get"),_clock_time_get.sig="iijp";var getHeapMax=GA(()=>2147483648,"getHeapMax"),growMemory=GA((H)=>{var $=wasmMemory.buffer,A=(H-$.byteLength+65535)/65536|0;try{return wasmMemory.grow(A),updateMemoryViews(),1}catch(L){}},"growMemory"),_emscripten_resize_heap=GA((H)=>{var $=HEAPU8.length;H>>>=0;var A=getHeapMax();if(H>A)return!1;for(var L=1;L<=4;L*=2){var I=$*(1+0.2/L);I=Math.min(I,H+100663296);var D=Math.min(A,alignMemory(Math.max(H,I),65536)),B=growMemory(D);if(B)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=GA((H)=>52,"_fd_close");_fd_close.sig="ii";function _fd_seek(H,$,A,L){return $=bigintToI53Checked($),70}GA(_fd_seek,"_fd_seek"),_fd_seek.sig="iijip";var printCharBuffers=[null,[],[]],printChar=GA((H,$)=>{var A=printCharBuffers[H];if($===0||$===10)(H===1?out:err)(UTF8ArrayToString(A)),A.length=0;else A.push($)},"printChar"),flush_NO_FILESYSTEM=GA(()=>{if(printCharBuffers[1].length)printChar(1,10);if(printCharBuffers[2].length)printChar(2,10)},"flush_NO_FILESYSTEM"),SYSCALLS={varargs:void 0,getStr(H){var $=UTF8ToString(H);return $}},_fd_write=GA((H,$,A,L)=>{var I=0;for(var D=0;D>2)*4),f=LE_HEAP_LOAD_U32(($+4>>2)*4);$+=8;for(var E=0;E>2)*4,I),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(H,$){if(Module.currentLogCallback){let A=UTF8ToString($);Module.currentLogCallback(A,H!==0)}}GA(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(H,$,A,L,I){let B=Module.currentParseCallback($,{row:A,column:L});if(typeof B==="string")setValue(I,B.length,"i32"),stringToUTF16(B,H,10240);else setValue(I,0,"i32")}GA(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(H,$){if(Module.currentProgressCallback)return Module.currentProgressCallback({currentOffset:H,hasError:$});return!1}GA(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");function _tree_sitter_query_progress_callback(H){if(Module.currentQueryProgressCallback)return Module.currentQueryProgressCallback({currentOffset:H});return!1}GA(_tree_sitter_query_progress_callback,"_tree_sitter_query_progress_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=GA(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=GA((H)=>{if(EXITSTATUS=H,!keepRuntimeAlive())Module.onExit?.(H),ABORT=!0;quit_(H,new ExitStatus(H))},"_proc_exit");_proc_exit.sig="vi";var exitJS=GA((H,$)=>{EXITSTATUS=H,_proc_exit(H)},"exitJS"),handleException=GA((H)=>{if(H instanceof ExitStatus||H=="unwind")return EXITSTATUS;quit_(1,H)},"handleException"),lengthBytesUTF8=GA((H)=>{var $=0;for(var A=0;A=55296&&L<=57343)$+=4,++A;else $+=3}return $},"lengthBytesUTF8"),stringToUTF8Array=GA((H,$,A,L)=>{if(!(L>0))return 0;var I=A,D=A+L-1;for(var B=0;B=55296&&f<=57343){var E=H.charCodeAt(++B);f=65536+((f&1023)<<10)|E&1023}if(f<=127){if(A>=D)break;$[A++]=f}else if(f<=2047){if(A+1>=D)break;$[A++]=192|f>>6,$[A++]=128|f&63}else if(f<=65535){if(A+2>=D)break;$[A++]=224|f>>12,$[A++]=128|f>>6&63,$[A++]=128|f&63}else{if(A+3>=D)break;$[A++]=240|f>>18,$[A++]=128|f>>12&63,$[A++]=128|f>>6&63,$[A++]=128|f&63}}return $[A]=0,A-I},"stringToUTF8Array"),stringToUTF8=GA((H,$,A)=>stringToUTF8Array(H,HEAPU8,$,A),"stringToUTF8"),stackAlloc=GA((H)=>__emscripten_stack_alloc(H),"stackAlloc"),stringToUTF8OnStack=GA((H)=>{var $=lengthBytesUTF8(H)+1,A=stackAlloc($);return stringToUTF8(H,A,$),A},"stringToUTF8OnStack"),AsciiToString=GA((H)=>{var $="";while(!0){var A=HEAPU8[H++];if(!A)return $;$+=String.fromCharCode(A)}},"AsciiToString"),stringToUTF16=GA((H,$,A)=>{if(A??=2147483647,A<2)return 0;A-=2;var L=$,I=A>1)*2,B),$+=2}return LE_HEAP_STORE_I16(($>>1)*2,0),$-L},"stringToUTF16"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,clock_time_get:_clock_time_get,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback,tree_sitter_query_progress_callback:_tree_sitter_query_progress_callback},wasmExports=await createWasm(),___wasm_call_ctors=wasmExports.__wasm_call_ctors,_malloc=Module._malloc=wasmExports.malloc,_calloc=Module._calloc=wasmExports.calloc,_realloc=Module._realloc=wasmExports.realloc,_free=Module._free=wasmExports.free,_memcmp=Module._memcmp=wasmExports.memcmp,_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count,_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count,_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version,_ts_language_abi_version=Module._ts_language_abi_version=wasmExports.ts_language_abi_version,_ts_language_metadata=Module._ts_language_metadata=wasmExports.ts_language_metadata,_ts_language_name=Module._ts_language_name=wasmExports.ts_language_name,_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count,_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state,_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name,_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name,_strncmp=Module._strncmp=wasmExports.strncmp,_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type,_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id,_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new,_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset,_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol,_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete,_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset,_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language,_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros,_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros,_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges,_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new,_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete,_iswspace=Module._iswspace=wasmExports.iswspace,_iswalnum=Module._iswalnum=wasmExports.iswalnum,_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count,_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count,_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count,_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id,_ts_query_capture_quantifier_for_id=Module._ts_query_capture_quantifier_for_id=wasmExports.ts_query_capture_quantifier_for_id,_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id,_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern,_ts_query_start_byte_for_pattern=Module._ts_query_start_byte_for_pattern=wasmExports.ts_query_start_byte_for_pattern,_ts_query_end_byte_for_pattern=Module._ts_query_end_byte_for_pattern=wasmExports.ts_query_end_byte_for_pattern,_ts_query_is_pattern_rooted=Module._ts_query_is_pattern_rooted=wasmExports.ts_query_is_pattern_rooted,_ts_query_is_pattern_non_local=Module._ts_query_is_pattern_non_local=wasmExports.ts_query_is_pattern_non_local,_ts_query_is_pattern_guaranteed_at_step=Module._ts_query_is_pattern_guaranteed_at_step=wasmExports.ts_query_is_pattern_guaranteed_at_step,_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture,_ts_query_disable_pattern=Module._ts_query_disable_pattern=wasmExports.ts_query_disable_pattern,_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy,_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete,_ts_init=Module._ts_init=wasmExports.ts_init,_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm,_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm,_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm,_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm,_ts_language_supertypes_wasm=Module._ts_language_supertypes_wasm=wasmExports.ts_language_supertypes_wasm,_ts_language_subtypes_wasm=Module._ts_language_subtypes_wasm=wasmExports.ts_language_subtypes_wasm,_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm,_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm=Module._ts_tree_cursor_copy_wasm=wasmExports.ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm,_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm,_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm,_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm,_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm,_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm,_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm=Module._ts_node_field_name_for_named_child_wasm=wasmExports.ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm,_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm,_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm,_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm,_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm,_ts_node_child_with_descendant_wasm=Module._ts_node_child_with_descendant_wasm=wasmExports.ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm,_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm,_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm,_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm,_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm,_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm,_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm,_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm,_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm,_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm,_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm,_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm,_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm,_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm,_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm,_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm,_memset=Module._memset=wasmExports.memset,_memcpy=Module._memcpy=wasmExports.memcpy,_memmove=Module._memmove=wasmExports.memmove,_iswalpha=Module._iswalpha=wasmExports.iswalpha,_iswblank=Module._iswblank=wasmExports.iswblank,_iswdigit=Module._iswdigit=wasmExports.iswdigit,_iswlower=Module._iswlower=wasmExports.iswlower,_iswupper=Module._iswupper=wasmExports.iswupper,_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit,_memchr=Module._memchr=wasmExports.memchr,_strlen=Module._strlen=wasmExports.strlen,_strcmp=Module._strcmp=wasmExports.strcmp,_strncat=Module._strncat=wasmExports.strncat,_strncpy=Module._strncpy=wasmExports.strncpy,_towlower=Module._towlower=wasmExports.towlower,_towupper=Module._towupper=wasmExports.towupper,_setThrew=wasmExports.setThrew,__emscripten_stack_restore=wasmExports._emscripten_stack_restore,__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc,_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current,___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs;Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,Module.loadWebAssemblyModule=loadWebAssemblyModule;function callMain(H=[]){var $=resolveGlobalSymbol("main").sym;if(!$)return;H.unshift(thisProgram);var A=H.length,L=stackAlloc((A+1)*4),I=L;H.forEach((B)=>{LE_HEAP_STORE_U32((I>>2)*4,stringToUTF8OnStack(B)),I+=4}),LE_HEAP_STORE_U32((I>>2)*4,0);try{var D=$(A,L);return exitJS(D,!0),D}catch(B){return handleException(B)}}GA(callMain,"callMain");function run(H=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function $(){if(Module.calledRun=!0,ABORT)return;initRuntime(),preMain(),readyPromiseResolve(Module),Module.onRuntimeInitialized?.();var A=Module.noInitialRun;if(!A)callMain(H);postRun()}if(GA($,"doRun"),Module.setStatus)Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),$()},1);else $()}if(GA(run,"run"),Module.preInit){if(typeof Module.preInit=="function")Module.preInit=[Module.preInit];while(Module.preInit.length>0)Module.preInit.pop()()}return run(),moduleRtn=readyPromise,moduleRtn}})(),gC1=uC1;GA(UaD,"initializeBinding");GA(XaD,"checkModule");WpH=class{static{GA(this,"Parser")}[0]=0;[1]=0;logCallback=null;language=null;static async init(H){$aD(await UaD(H)),kD=D$._ts_init(),HbA=D$.getValue(kD,"i32"),$bA=D$.getValue(kD+IB,"i32")}constructor(){this.initialize()}initialize(){if(!XaD())throw Error("cannot construct a Parser before calling `init()`");D$._ts_parser_new_wasm(),this[0]=D$.getValue(kD,"i32"),this[1]=D$.getValue(kD+IB,"i32")}delete(){D$._ts_parser_delete(this[0]),D$._free(this[1]),this[0]=0,this[1]=0}setLanguage(H){let $;if(!H)$=0,this.language=null;else if(H.constructor===qz$){$=H[0];let A=D$._ts_language_version($);if(A<$bA||HbAH.slice(f);else if(typeof H==="function")D$.currentParseCallback=H;else throw Error("Argument must be a string or a function");if(A?.progressCallback)D$.currentProgressCallback=A.progressCallback;else D$.currentProgressCallback=null;if(this.logCallback)D$.currentLogCallback=this.logCallback,D$._ts_parser_enable_logger_wasm(this[0],1);else D$.currentLogCallback=null,D$._ts_parser_enable_logger_wasm(this[0],0);let L=0,I=0;if(A?.includedRanges){L=A.includedRanges.length,I=D$._calloc(L,QpH);let f=I;for(let E=0;E0){let L=$;for(let I=0;IrC1,extractCommandArguments:()=>oC1,ensureInitialized:()=>QaD});function lC1(){let H=$e.dirname(KaD.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/bash/parser.ts"));return $e.dirname(hgH())}function iC1(H){if(!U8()||typeof Bun>"u"||!Bun.embeddedFiles)return null;for(let $ of Bun.embeddedFiles){let A=$.name;if(A&&A.endsWith(H))return $}return null}async function FaD(H){let $=iC1(H);if(!$)return null;let A=await $.arrayBuffer();return new Uint8Array(A)}async function nC1(){let H=zH();if(U8()){let B=await FaD("tree-sitter.wasm"),f=await FaD("tree-sitter-bash.wasm");if(B&&f){await WpH.init({wasmBinary:B}),PPH=new WpH,VpH=await qz$.load(f),PPH.setLanguage(VpH),N("tree-sitter: loaded from embedded"),c("tengu_tree_sitter_load",{success:!0,from_embedded:!0});return}}let A=lC1(),L=!1,I=L?$e.join(A,"web-tree-sitter","tree-sitter.wasm"):$e.join(A,"tree-sitter.wasm"),D=L?$e.join(A,"tree-sitter-bash","tree-sitter-bash.wasm"):$e.join(A,"tree-sitter-bash.wasm");if(!H.existsSync(I)||!H.existsSync(D)){N("tree-sitter: WASM files not found"),c("tengu_tree_sitter_load",{success:!1});return}await WpH.init({locateFile:(B)=>B.endsWith("tree-sitter.wasm")?I:B}),PPH=new WpH,VpH=await qz$.load(H.readFileBytesSync(D)),PPH.setLanguage(VpH),N("tree-sitter: loaded from disk"),c("tengu_tree_sitter_load",{success:!0,from_embedded:!1})}async function QaD(){if(!BbA)BbA=nC1();await BbA}async function rC1(H){if(await QaD(),!H||H.length>mC1||!PPH||!VpH)return null;try{let $=PPH.parse(H),A=$?.rootNode;if(!A)return null;let L=WaD(A),I=aC1(L);return{tree:$,rootNode:A,envVars:I,commandNode:L,originalCommand:H}}catch{return null}}function WaD(H){let{type:$,children:A,parent:L}=H;if(DbA.has($))return H;if($==="variable_assignment"&&L)return L.children.find((I)=>I&&DbA.has(I.type)&&I.startIndex>H.startIndex)??null;if($==="pipeline"||$==="redirected_statement")return A.find((I)=>I&&DbA.has(I.type))??null;for(let I of A){let D=I&&WaD(I);if(D)return D}return null}function aC1(H){if(!H||H.type!=="command")return[];let $=[];for(let A of H.children){if(!A)continue;if(A.type==="variable_assignment")$.push(A.text);else if(A.type==="command_name"||A.type==="word")break}return $}function oC1(H){if(H.type==="declaration_command"){let L=H.children[0];return L&&pC1.has(L.text)?[L.text]:[]}let $=[],A=!1;for(let L of H.children){if(!L||L.type==="variable_assignment")continue;if(L.type==="command_name"||!A&&L.type==="word"){A=!0,$.push(L.text);continue}if(dC1.has(L.type))$.push(tC1(L.text));else if(cC1.has(L.type))break}return $}function tC1(H){return H.length>=2&&(H[0]==='"'&&H.at(-1)==='"'||H[0]==="'"&&H.at(-1)==="'")?H.slice(1,-1):H}var KaD,$e,mC1=1e4,pC1,dC1,cC1,DbA,PPH=null,VpH=null,BbA=null;var EbA=K(()=>{JaD();DL();Ib();z$();E$();KaD=require("url"),$e=require("path"),pC1=new Set(["export","declare","typeset","readonly","local","unset","unsetenv"]),dC1=new Set(["word","string","raw_string","number"]),cC1=new Set(["command_substitution","process_substitution"]),DbA=new Set(["command","declaration_command"])});class VaD{originalCommand;constructor(H){this.originalCommand=H}toString(){return this.originalCommand}getPipeSegments(){try{let H=UpH(this.originalCommand),$=[],A=[];for(let L of H)if(L==="|"){if(A.length>0)$.push(A.join(" ")),A=[]}else A.push(L);if(A.length>0)$.push(A.join(" "));return $.length>0?$:[this.originalCommand]}catch{return[this.originalCommand]}}withoutOutputRedirections(){if(!this.originalCommand.includes(">"))return this.originalCommand;let{commandWithoutRedirections:H,redirections:$}=Wj(this.originalCommand);return $.length>0?H:this.originalCommand}getOutputRedirections(){let{redirections:H}=Wj(this.originalCommand);return H}}function MbA(H,$){let A=H;$(A);for(let L of A.children)if(L)MbA(L,$)}function sC1(H){let $=[];return MbA(H,(A)=>{if(A.type==="pipeline"){for(let L of A.children)if(L&&L.type==="|")$.push(L.startIndex)}}),$}function eC1(H){let $=[];return MbA(H,(A)=>{if(A.type==="file_redirect"){let L=A.children,I=L.find((B)=>B&&(B.type===">"||B.type===">>")),D=L.find((B)=>B&&B.type==="word");if(I&&D)$.push({startIndex:A.startIndex,endIndex:A.endIndex,target:D.text,operator:I.type})}}),$}class PaD{originalCommand;pipePositions;redirectionNodes;constructor(H,$,A){this.originalCommand=H,this.pipePositions=$,this.redirectionNodes=A}toString(){return this.originalCommand}getPipeSegments(){if(this.pipePositions.length===0)return[this.originalCommand];let H=[],$=0;for(let L of this.pipePositions){let I=this.originalCommand.slice($,L).trim();if(I)H.push(I);$=L+1}let A=this.originalCommand.slice($).trim();if(A)H.push(A);return H}withoutOutputRedirections(){if(this.redirectionNodes.length===0)return this.originalCommand;let H=[...this.redirectionNodes].sort((A,L)=>L.startIndex-A.startIndex),$=this.originalCommand;for(let A of H)$=$.slice(0,A.startIndex)+$.slice(A.endIndex);return $.trim().replace(/\s+/g," ")}getOutputRedirections(){return this.redirectionNodes.map(({target:H,operator:$})=>({target:H,operator:$}))}}var H21,Tz$;var _aD=K(()=>{tD();g3();H21=o$(async()=>{try{let{parseCommand:H}=await Promise.resolve().then(() => (EbA(),fbA)),$=await H("echo test");if(!$)return!1;return $.tree.delete(),!0}catch{return!1}}),Tz$={async parse(H){if(!H)return null;if(await H21())try{let{parseCommand:A}=await Promise.resolve().then(() => (EbA(),fbA)),L=await A(H);if(L){let I=sC1(L.rootNode),D=eC1(L.rootNode);return L.tree.delete(),new PaD(H,I,D)}}catch{}return new VaD(H)}}});async function $21(H,$,A){if($.filter((M)=>{let G=M.trim();return GpH.test(G)}).length>1){let M={type:"other",reason:"Multiple directory changes in one command require approval for clarity"};return{behavior:"ask",decisionReason:M,message:gX(aD.name,M)}}let I=new Map;for(let M of $){let G=M.trim();if(!G)continue;let U=await A({...H,command:G});I.set(G,U)}let D=Array.from(I.entries()).find(([,M])=>M.behavior==="deny");if(D){let[M,G]=D;return{behavior:"deny",message:G.behavior==="deny"?G.message:`Permission denied for: ${M}`,decisionReason:{type:"subcommandResults",reasons:I}}}if(Array.from(I.values()).every((M)=>M.behavior==="allow"))return{behavior:"allow",updatedInput:H,decisionReason:{type:"subcommandResults",reasons:I}};let f=[];for(let[,M]of I)if(M.behavior!=="allow"&&"suggestions"in M&&M.suggestions)f.push(...M.suggestions);let E={type:"subcommandResults",reasons:I};return{behavior:"ask",message:gX(aD.name,E),decisionReason:E,suggestions:f.length>0?f:void 0}}async function A21(H){if(!H.includes(">"))return H;return(await Tz$.parse(H))?.withoutOutputRedirections()??H}async function YaD(H,$){if(lrD(H.command)){let D=Hb(H.command),B={type:"other",reason:D.behavior==="ask"&&D.message?D.message:"This command uses shell operators that require approval for safety"};return{behavior:"ask",message:gX(aD.name,B),decisionReason:B}}let A=await Tz$.parse(H.command);if(!A)return{behavior:"passthrough",message:"Failed to parse command"};let L=A.getPipeSegments();if(L.length<=1)return{behavior:"passthrough",message:"No pipes found in command"};let I=await Promise.all(L.map((D)=>A21(D)));return $21(H,I,$)}var CaD=K(()=>{zQ();g3();XJ();fZ$();_aD()});function qaD(H){let $=H.length;if($<=GbA)return H.map((L)=>`'${L}'`).join(", ");return`${H.slice(0,GbA).map((L)=>`'${L}'`).join(", ")}, and ${$-GbA} more`}function L21(H){let $=H.match(ZaD);if(!$||$.index===void 0)return H;let A=H.substring(0,$.index),L=A.lastIndexOf("/");if(L===-1)return".";return A.substring(0,L)||"/"}function UbA(H,$,A){let L=A==="read"?"read":"edit",I=$W(H,$,L,"deny");if(I!==null)return{allowed:!1,decisionReason:{type:"rule",rule:I}};if(A!=="read"){let B=FbA(H);if(!B.safe)return{allowed:!1,decisionReason:{type:"other",reason:B.message}}}if(iS(H,$)){if(A==="read"||$.mode==="acceptEdits")return{allowed:!0}}if(A==="read"){let B=QbA(H,{});if(B.behavior==="allow")return{allowed:!0,decisionReason:B.decisionReason}}if(A!=="read"){let B=KbA(H,{});if(B.behavior==="allow")return{allowed:!0,decisionReason:B.decisionReason}}let D=$W(H,$,L,"allow");if(D!==null)return{allowed:!0,decisionReason:{type:"rule",rule:D}};return{allowed:!1}}function I21(H,$,A,L){if(nMH(H)){let E=yz.isAbsolute(H)?H:yz.resolve($,H),{resolvedPath:M}=OU(zH(),E),G=UbA(M,A,L);return{allowed:G.allowed,resolvedPath:M,decisionReason:G.decisionReason}}let I=L21(H),D=yz.isAbsolute(I)?I:yz.resolve($,I),{resolvedPath:B}=OU(zH(),D),f=UbA(B,A,L);return{allowed:f.allowed,resolvedPath:B,decisionReason:f.decisionReason}}function TaD(H){if(H==="~"||H.startsWith("~/"))return zz$.homedir()+H.slice(1);return H}function D21(H){if(H==="*"||H.endsWith("/*"))return!0;let $=H==="/"?H:H.replace(/\/$/,"");if($==="/")return!0;let A=zz$.homedir();if($===A)return!0;if(yz.dirname($)==="/")return!0;return!1}function zaD(H,$,A,L){let I=TaD(H.replace(/^['"]|['"]$/g,""));if(I.includes("$")||I.includes("%"))return{allowed:!1,resolvedPath:I,decisionReason:{type:"other",reason:"Shell expansion syntax in paths requires manual approval"}};if(ZaD.test(I)){if(L==="write"||L==="create")return{allowed:!1,resolvedPath:I,decisionReason:{type:"other",reason:"Glob patterns are not allowed in write operations. Please specify an exact file path."}};return I21(I,$,A,L)}let D=yz.isAbsolute(I)?I:yz.resolve($,I),{resolvedPath:B}=OU(zH(),D),f=UbA(B,A,L);return{allowed:f.allowed,resolvedPath:B,decisionReason:f.decisionReason}}function B21(H,$,A){let L=XbA[H],I=L($);for(let D of I){let B=TaD(D.replace(/^['"]|['"]$/g,"")),f=yz.isAbsolute(B)?B:yz.resolve(A,B);if(D21(f))return{behavior:"ask",message:`Dangerous ${H} operation detected: '${f}' `);for(let L of A){let I=L.trim();if(I){let B=I.match(/^#+\s+(.+)$/)?.[1]??I;return B.length>100?B.substring(0,97)+"...":B}}return $}function $oD(H){if(H===void 0||H===null)return null;if(!H)return[];let $=[];if(typeof H==="string")$=[H];else if(Array.isArray(H))$=H.filter((L)=>typeof L==="string");if($.length===0)return[];let A=xp($);if(A.includes("*"))return["*"];return A}function LBH(H){let $=$oD(H);if($===null)return H===void 0?void 0:[];if($.includes("*"))return;return $}function xx(H){let $=$oD(H);if($===null)return[];return $}async function N21(H){try{let $=await Pj.lstat(H,{bigint:!0});return`${$.dev}:${$.ino}`}catch{return null}}function LTA(H,$){let A=Tb.resolve(HoD.homedir()),L=XQ($),I=Tb.resolve($),D=[];if(!jz$.existsSync(I))return D;while(!0){if(I===A)break;let B=Tb.join(I,".claude",H);if(jz$.existsSync(B))D.push(B);if(L&&I===L)break;let f=Tb.dirname(I);if(f===I)break;I=f}return D}async function O21(H,$){let A=[],L=new Set;async function I(D){if($.aborted)return;try{let B=await Pj.stat(D,{bigint:!0});if(B.isDirectory()){let f=B.dev!==void 0&&B.ino!==void 0?`${B.dev}:${B.ino}`:await Pj.realpath(D);if(L.has(f)){N(`Skipping already visited directory (circular symlink): ${D}`);return}L.add(f)}}catch(B){let f=B instanceof Error?B.message:String(B);N(`Failed to stat directory ${D}: ${f}`);return}try{let B=await Pj.readdir(D,{withFileTypes:!0});for(let f of B){if($.aborted)break;let E=Tb.join(D,f.name);try{if(f.isSymbolicLink())try{let M=await Pj.stat(E);if(M.isDirectory())await I(E);else if(M.isFile()&&f.name.endsWith(".md"))A.push(E)}catch(M){let G=M instanceof Error?M.message:String(M);N(`Failed to follow symlink ${E}: ${G}`)}else if(f.isDirectory())await I(E);else if(f.isFile()&&f.name.endsWith(".md"))A.push(E)}catch(M){let G=M instanceof Error?M.message:String(M);N(`Failed to access ${E}: ${G}`)}}}catch(B){let f=B instanceof Error?B.message:String(B);N(`Failed to read directory ${D}: ${f}`)}}return await I(H),A}async function SbA(H){let $=nD(),A=setTimeout(()=>$.abort(),3000);try{if(!jz$.existsSync(H))return[];let I=A$("true")?await O21(H,$.signal):await YR(["--files","--hidden","--follow","--no-ignore","--glob","*.md"],H,$.signal);return(await Promise.all(I.map(async(B)=>{try{let f=await Pj.readFile(B,{encoding:"utf-8"}),{frontmatter:E,content:M}=MK(f,B);return{filePath:B,frontmatter:E,content:M}}catch(f){let E=f instanceof Error?f.message:String(f);return N(`Failed to read/parse markdown file: ${B}: ${E}`),null}}))).filter((B)=>B!==null)}finally{clearTimeout(A)}}var Tb,Pj,jz$,HoD,djD,Rm;var Vm=K(()=>{CR();Vu();cg();E$();eE();NA();y$H();z$();W4();tD();t8();Tb=require("path"),Pj=require("fs/promises"),jz$=require("fs"),HoD=require("os"),djD=["commands","agents","output-styles","skills"];Rm=o$(async function(H,$){let A=Date.now(),L=Tb.join(UL(),H),I=Tb.join(v_(),".claude",H),D=LTA(H,$),[B,f,E]=await Promise.all([SbA(I).then((Q)=>Q.map((W)=>({...W,baseDir:I,source:"policySettings"}))),HF("userSettings")?SbA(L).then((Q)=>Q.map((W)=>({...W,baseDir:L,source:"userSettings"}))):Promise.resolve([]),HF("projectSettings")?Promise.all(D.map((Q)=>SbA(Q).then((W)=>W.map((P)=>({...P,baseDir:Q,source:"projectSettings"}))))):Promise.resolve([])]),M=E.flat(),G=[...B,...f,...M],U=await Promise.all(G.map((Q)=>N21(Q.filePath))),X=new Map,J=[];for(let[Q,W]of G.entries()){let P=U[Q]??null;if(P===null){J.push(W);continue}let C=X.get(P);if(C!==void 0){N(`Skipping duplicate file '${W.filePath}' from ${W.source} (same inode already loaded from ${C})`);continue}X.set(P,W.source),J.push(W)}let F=G.length-J.length;if(F>0)N(`Deduplicated ${F} files in ${H} (same inode via symlinks or hard links)`);return c("tengu_dir_search",{durationMs:Date.now()-A,managedFilesFound:B.length,userFilesFound:f.length,projectFilesFound:M.length,projectDirsSearched:D.length,subdir:H}),J},(H,$)=>`${H}:${$}`)});var AoD,LoD;var IoD=K(()=>{tD();_$();Vm();IF$();E$();AoD=require("path"),LoD=o$(async(H)=>{try{return(await Rm("output-styles",H)).map(({filePath:L,frontmatter:I,content:D,source:B})=>{try{let E=AoD.basename(L).replace(/\.md$/,""),M=I.name||E,G=I.description||Wm(D,`Custom ${E} output style`),U=I["keep-coding-instructions"],X=U===!0||U==="true"?!0:U===!1||U==="false"?!1:void 0;if(I["force-for-plugin"]!==void 0)N(`Output style "${M}" has force-for-plugin set, but this option only applies to plugin output styles. Ignoring.`,{level:"warn"});return{name:M,description:G,prompt:D.trim(),source:B,keepCodingInstructions:X}}catch(f){return r(f instanceof Error?f:Error(String(f))),null}}).filter((L)=>L!==null)}catch($){return r($ instanceof Error?$:Error(String($))),[]}})});async function Y1H(H){let $=await LoD(H),A=await E7A(),L={...V9H},I=$.filter((E)=>E.source==="policySettings"),D=$.filter((E)=>E.source==="userSettings"),B=$.filter((E)=>E.source==="projectSettings"),f=[A,D,B,I];for(let E of f)for(let M of E)L[M.name]={name:M.name,description:M.description,prompt:M.prompt,source:M.source,keepCodingInstructions:M.keepCodingInstructions,forceForPlugin:M.forceForPlugin};return L}async function lhA(){let H=await Y1H(C$()),$=Object.values(H).filter((D)=>D!==null&&D.source==="plugin"&&D.forceForPlugin===!0),A=$[0];if(A){if($.length>1)N(`Multiple plugins have forced output styles: ${$.map((D)=>D.name).join(", ")}. Using: ${A.name}`,{level:"warn"});return N(`Using forced plugin output style: ${A.name}`),A}let I=VL()?.outputStyle||HW;return H[I]??null}var DoD,HW="default",V9H;var jh=K(()=>{jI();mL();IoD();IF$();PI();E$();DoD=` `,$),D=I>=0?H.slice($,I):H.slice($);if($=I>=0?I+1:H.length,!D.includes('"type":"user"')&&!D.includes('"type": "user"'))continue;if(D.includes('"tool_result"'))continue;if(D.includes('"isMeta":true')||D.includes('"isMeta": true'))continue;try{let B=DA(D);if(B.type!=="user")continue;let f=B.message;if(!f)continue;let E=f.content,M="";if(typeof E==="string")M=E;else if(Array.isArray(E)){let X=E.find((J)=>J.type==="text");if(X?.text&&typeof X.text==="string")M=X.text}if(!M)continue;let G=M.replace(/\n/g," ").trim(),U=VD(G,WV);if(U){let X=U.replace(/^\//,""),J=VD(G,"command-args")?.trim()||"";if(Np().has(X)||!J){if(!L)L=U;continue}return J?`${U} ${J}`:U}if(JoD.test(G))continue;if(G.length>200)G=G.slice(0,200).trim()+"\u2026";return G}catch{continue}}if(L)return L;return""}function yz$(H,$){let A=[`"${$}":"`,`"${$}": "`];for(let L of A){let I=H.indexOf(L);if(I<0)continue;let D=I+L.length,B=D;while(Bf[1].mtime-B[1].mtime);if($&&I.length>$)I=I.slice(0,$);let D=[];for(let[B,f]of I)D.push({date:new Date(f.mtime).toISOString(),messages:[],isLite:!0,fullPath:f.path,value:0,created:new Date(f.ctime),modified:new Date(f.mtime),firstPrompt:"",messageCount:0,fileSize:f.size,isSidechain:!1,sessionId:B,projectPath:A});return f$H(D).map((B,f)=>({...B,value:f}))}async function Kw1(H,$){if(!H.isLite||!H.fullPath)return H;let A=await Jw1(H.fullPath,H.fileSize??0,$),L={...H,isLite:!1,firstPrompt:A.firstPrompt,gitBranch:A.gitBranch,isSidechain:A.isSidechain,teamName:A.teamName,customTitle:A.customTitle,tag:A.tag,agentSetting:A.agentSetting,prNumber:A.prNumber,prUrl:A.prUrl,prRepository:A.prRepository,projectPath:A.projectPath??H.projectPath};if(!L.firstPrompt&&!L.customTitle)return null;if(L.isSidechain||L.teamName)return null;return L}async function E8H(H,$,A){let L=[],I=Buffer.alloc(vz$),D=$;while(D{_L();nM();g$();NA();PI();ZM();Z$();DL();mL();tD();t8();qmH();eC$();E$();_$();dx();h4();EE();z$();ZE();Z6();Z$();UU();a3=require("path"),vz=require("fs/promises"),t21={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,CPH=C$(),JoD=new RegExp(`^(?:||<${jN}>|\\s*[\\s\\S]*\\s*$|\\s*[\\s\\S]*\\s*$)`);cbA=o$(async(H)=>{let{messages:$}=await dbA(H);return new Set($.keys())},(H)=>H)});function Td(){return process.env.USE_MCP_CLI_DIR||nbA.join(_oD.tmpdir(),"claude-code-mcp-cli")}function wPH(){if(eU()){let H=process.env.CLAUDE_CODE_SESSION_ID;if(H)return H}return j$()}function YoD(){if(!eU())return;PB(async()=>{try{let H=uz$();await qd.rm(H,{force:!0});let $=Td();if((await qd.readdir($)).length===0)await qd.rm($,{recursive:!0,force:!0})}catch{}})}function uz$(){let H=wPH();return nbA.join(Td(),`${H}.json`)}function Qw1(H){let $={name:H.name,type:H.type};if(H.type==="connected")return{...$,capabilities:H.capabilities};return $}async function Ww1(H){let $="";try{$=await H.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:"default",additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]})}catch{}return{name:H.name,description:$,inputJSONSchema:H.inputJSONSchema,isMcp:H.isMcp,originalToolName:H.originalMcpToolName}}async function CoD(H,$,A){if(!eU())return;try{await qd.mkdir(Td(),{recursive:!0});let L=await Promise.all($.filter((E)=>E.isMcp).map(Ww1)),I={},D={};for(let E of H){I[E.name]=E.config;let M=E1(E.name);if(D[M]&&D[M]!==E.name)console.warn(`Warning: MCP server name collision detected. Both "${D[M]}" and "${E.name}" normalize to "${M}". Only "${E.name}" will be accessible via normalized lookup.`);D[M]=E.name}let B={clients:H.map(Qw1),configs:I,tools:L,resources:A,normalizedNames:D},f=uz$();await qd.writeFile(f,yH(B,null,2))}catch{}}var nbA,_oD,qd;var ZPH=K(()=>{g$();ZE();BW();Z$();nbA=require("path"),_oD=require("os"),qd=require("fs/promises")});function qC(H){return H.toLowerCase()}function ZoD(H,$){if(oA()==="windows"){let A=PR(H),L=PR($);return E9.posix.relative(A,L)}return E9.posix.relative(H,$)}function vB$(H){if(oA()==="windows")return PR(H);return H}function _w1(){return j_.map((H)=>aM(H)).filter((H)=>H!==void 0)}function pqA(H){let $=xD(H),A=qC($);if(A.endsWith(`${E9.sep}.claude${E9.sep}settings.json`)||A.endsWith(`${E9.sep}.claude${E9.sep}settings.local.json`))return!0;return _w1().some((L)=>qC(L)===A)}function Yw1(H){if(pqA(H))return!0;let $=E9.join(zL(),".claude","commands"),A=E9.join(zL(),".claude","agents"),L=E9.join(zL(),".claude","skills");return wm(H,$)||wm(H,A)||wm(H,L)}function Cw1(H){if(!Td())return!1;let $=xD(H);return wm($,Td())}function qoD(H){let $=E9.join(_7(),sRH()),A=E9.normalize(H);return A.startsWith($)&&A.endsWith(".md")}function mz$(){return E9.join(rU(C$()),j$(),"session-memory")+E9.sep}function T3H(){return E9.join(mz$(),"summary.md")}function ww1(H){return E9.normalize(H).startsWith(mz$())}function Zw1(H){let $=rU(C$()),A=E9.normalize(H);return A===$||A.startsWith($+E9.sep)}function FPH(){return cf("tengu_scratch")}function xOA(){if(oA()==="windows")return"claude";return`claude-${process.getuid?.()??0}`}function _zH(){let H=process.env.CLAUDE_CODE_TMPDIR||(oA()==="windows"?gz$.tmpdir():"/tmp"),$=zH(),A=H;try{A=$.realpathSync(H)}catch{}return E9.join(A,xOA())+E9.sep}function VF$(){return E9.join(_zH(),f2H(zL()))+E9.sep}function Pz$(){return E9.join(VF$(),j$(),"scratchpad")}function ToD(){if(!FPH())throw Error("Scratchpad directory feature is not enabled");let H=zH(),$=Pz$();return H.mkdirSync($,{mode:448}),$}function zoD(H){if(!FPH())return!1;let $=Pz$(),A=E9.normalize(H);return A===$||A.startsWith($+E9.sep)}function qw1(H){let A=xD(H).split(E9.sep),L=A[A.length-1];if(H.startsWith("\\\\")||H.startsWith("//"))return!0;for(let I=0;IqC(D)===I))return!0}return!1}function NoD(H){if(H.indexOf(":",2)!==-1)return!0;if(/~\d/.test(H))return!0;if(H.startsWith("\\\\?\\")||H.startsWith("\\\\.\\")||H.startsWith("//?/")||H.startsWith("//./"))return!0;if(/[.\s]+$/.test(H))return!0;if(/\.(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(H))return!0;if(/(^|\/|\\)\.{3,}(\/|\\|$)/.test(H))return!0;if(JZ$(H))return!0;return!1}function FbA(H){let $=zHH(H);for(let A of $)if(NoD(A))return{safe:!1,message:`Claude requested permissions to write to ${H}, which contains a suspicious Windows path pattern that requires manual approval.`};for(let A of $)if(Yw1(A))return{safe:!1,message:`Claude requested permissions to write to ${H}, but you haven't granted it yet.`};for(let A of $)if(Cw1(A));for(let A of $)if(qw1(A))return{safe:!1,message:`Claude requested permissions to edit ${H} which is a sensitive file.`};return{safe:!0}}function LVH(H){return new Set([zL(),...H.additionalWorkingDirectories.keys()])}function iS(H,$){return zHH(H).every((L)=>Array.from(LVH($)).some((I)=>wm(L,I)))}function wm(H,$){let A=xD(H),L=xD($),I=A.replace(/^\/private\/var\//,"/var/").replace(/^\/private\/tmp(\/|$)/,"/tmp$1"),D=L.replace(/^\/private\/var\//,"/var/").replace(/^\/private\/tmp(\/|$)/,"/tmp$1"),B=qC(I),f=qC(D),E=ZoD(f,B);if(E==="")return!0;if(nMH(E))return!1;return!E9.posix.isAbsolute(E)}function Tw1(H){switch(H){case"cliArg":case"command":case"session":return xD(zL());case"userSettings":case"policySettings":case"projectSettings":case"localSettings":case"flagSettings":return D4H(H)}}function rbA(H){return E9.posix.join(sP,H)}function zw1({patternRoot:H,pattern:$,rootPath:A}){let L=E9.posix.join(H,$);if(H===A)return rbA($);else if(L.startsWith(`${A}${sP}`)){let I=L.slice(A.length);return rbA(I)}else{let I=E9.posix.relative(A,H);if(!I||I.startsWith(`..${sP}`)||I==="..")return null;else{let D=E9.posix.join(I,$);return rbA(D)}}}function SFH(H,$){let A=new Set(H.get(null)??[]);for(let[L,I]of H.entries()){if(L===null)continue;for(let D of I){let B=zw1({patternRoot:L,pattern:D,rootPath:$});if(B)A.add(B)}}return Array.from(A)}function jFH(H){let $=OoD(H,"read","deny"),A=new Map;for(let[L,I]of $.entries())A.set(L,Array.from(I.keys()));return A}function Nw1(H,$){if(H.startsWith(`${sP}${sP}`)){let L=H.slice(1);if(oA()==="windows"&&L.match(/^\/[a-z]\//i)){let I=L[1]?.toUpperCase()??"C",D=L.slice(2),B=`${I}:\\`;return{relativePattern:D.startsWith("/")?D.slice(1):D,root:B}}return{relativePattern:L,root:sP}}else if(H.startsWith(`~${sP}`))return{relativePattern:H.slice(1),root:gz$.homedir()};else if(H.startsWith(sP))return{relativePattern:H,root:Tw1($)};let A=H;if(H.startsWith(`.${sP}`))A=H.slice(2);return{relativePattern:A,root:null}}function OoD(H,$,A){let L=(()=>{switch($){case"edit":return TB;case"read":return $B}})(),I=ObA(H,L,A),D=new Map;for(let[B,f]of I.entries()){let{relativePattern:E,root:M}=Nw1(B,f.source),G=D.get(M);if(G===void 0)G=new Map,D.set(M,G);G.set(E,f)}return D}function $W(H,$,A,L){let I=xD(H);if(oA()==="windows"&&I.includes("\\"))I=PR(I);let D=OoD($,A,L);for(let[B,f]of D.entries()){let E=Array.from(f.keys()).map((X)=>{let J=X;if(B===sP&&X.startsWith(sP))J=X.slice(1);if(J.endsWith("/**"))J=J.slice(0,-3);return J}),M=woD.default().add(E),G=ZoD(B??C$(),I??C$());if(G.startsWith(`..${sP}`))continue;if(!G)continue;let U=M.test(G);if(U.ignored&&U.rule){let X=U.rule.pattern,J=X+"/**";if(f.has(J))return f.get(J)??null;if(B===sP&&!X.startsWith(sP)){X=sP+X;let F=X+"/**";if(f.has(F))return f.get(F)??null}return f.get(X)??null}}return null}function nr(H,$,A){if(typeof H.getPath!=="function")return{behavior:"ask",message:`Claude requested permissions to use ${H.name}, but you haven't granted it yet.`};let L=H.getPath($),I=zHH(L);for(let G of I)if(G.startsWith("\\\\")||G.startsWith("//"))return{behavior:"ask",message:`Claude requested permissions to read from ${L}, which appears to be a UNC path that could access network resources.`,decisionReason:{type:"other",reason:"UNC path detected (defense-in-depth check)"}};for(let G of I)if(NoD(G))return{behavior:"ask",message:`Claude requested permissions to read from ${L}, which contains a suspicious Windows path pattern that requires manual approval.`,decisionReason:{type:"other",reason:"Path contains suspicious Windows-specific patterns (alternate data streams, short names, long path prefixes, or three or more consecutive dots) that require manual verification"}};for(let G of I){let U=$W(G,A,"read","deny");if(U)return{behavior:"deny",message:`Permission to read ${L} has been denied.`,decisionReason:{type:"rule",rule:U}}}for(let G of I){let U=$W(G,A,"read","ask");if(U)return{behavior:"ask",message:`Claude requested permissions to read from ${L}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:U}}}let D=z9H(H,$,A);if(D.behavior==="allow")return D;if(iS(L,A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"mode",mode:"default"}};let f=xD(L),E=QbA(f,$);if(E.behavior!=="passthrough")return E;let M=$W(L,A,"read","allow");if(M)return{behavior:"allow",updatedInput:$,decisionReason:{type:"rule",rule:M}};return{behavior:"ask",message:`Claude requested permissions to read from ${L}, but you haven't granted it yet.`,suggestions:pz$(L,"read",A),decisionReason:{type:"workingDir",reason:"Path is outside allowed working directories"}}}function z9H(H,$,A){if(typeof H.getPath!=="function")return{behavior:"ask",message:`Claude requested permissions to use ${H.name}, but you haven't granted it yet.`};let L=H.getPath($),I=zHH(L);for(let U of I){let X=$W(U,A,"edit","deny");if(X)return{behavior:"deny",message:`Permission to edit ${L} has been denied.`,decisionReason:{type:"rule",rule:X}}}let D=xD(L),B=KbA(D,$);if(B.behavior!=="passthrough")return B;let f=$W(L,A,"edit","allow");if(f&&f.source==="session"){let U=f.ruleValue.ruleContent;if(U===M9$||U===G9$)return{behavior:"allow",updatedInput:$,decisionReason:{type:"rule",rule:f}}}let E=FbA(L);if(!E.safe)return{behavior:"ask",message:E.message,decisionReason:{type:"other",reason:E.message}};for(let U of I){let X=$W(U,A,"edit","ask");if(X)return{behavior:"ask",message:`Claude requested permissions to write to ${L}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:X}}}let M=iS(L,A);if(A.mode==="acceptEdits"&&M)return{behavior:"allow",updatedInput:$,decisionReason:{type:"mode",mode:A.mode}};let G=$W(L,A,"edit","allow");if(G)return{behavior:"allow",updatedInput:$,decisionReason:{type:"rule",rule:G}};return{behavior:"ask",message:`Claude requested permissions to write to ${L}, but you haven't granted it yet.`,suggestions:pz$(L,"write",A),decisionReason:!M?{type:"workingDir",reason:"Path is outside allowed working directories"}:void 0}}function pz$(H,$,A){let L=!iS(H,A);if($==="read"&&L){let I=qk(H);return zHH(I).map((f)=>yB$(f,"session")).filter((f)=>f!==void 0)}if($==="write"||$==="create"){let I=[{type:"setMode",mode:"acceptEdits",destination:"session"}];if(L){let D=qk(H),B=zHH(D);I.push({type:"addDirectories",directories:B,destination:"session"})}return I}return[{type:"setMode",mode:"acceptEdits",destination:"session"}]}function KbA(H,$){let A=E9.normalize(H);if(qoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Plan files for current session are allowed for writing"}};if(zoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Scratchpad files for current session are allowed for writing"}};if(nRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Agent memory files are allowed for writing"}};if(lRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:`${Pm()} files are allowed for writing`}};let L=E9.join(UL(),"teams")+E9.sep;if(A===L.slice(0,-1)||A.startsWith(L))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Team files are allowed for writing"}};let I=E9.join(UL(),"tasks")+E9.sep;if(A===I.slice(0,-1)||A.startsWith(I))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Task files are allowed for writing"}};return{behavior:"passthrough",message:""}}function QbA(H,$){let A=E9.normalize(H);if(ww1(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Session memory files are allowed for reading"}};if(Zw1(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Project directory files are allowed for reading"}};if(qoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Plan files for current session are allowed for reading"}};let L=_KH(),I=L.endsWith(E9.sep)?L:L+E9.sep;if(A===L||A.startsWith(I))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Tool result files are allowed for reading"}};if(zoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Scratchpad files for current session are allowed for reading"}};let D=VF$();if(A.startsWith(D))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Project temp directory files are allowed for reading"}};if(nRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Agent memory files are allowed for reading"}};if(lRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:`${Pm()} files are allowed for reading`}};let B=E9.join(UL(),"tasks")+E9.sep;if(A===B.slice(0,-1)||A.startsWith(B))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Task files are allowed for reading"}};let f=E9.join(UL(),"teams")+E9.sep;if(A===f.slice(0,-1)||A.startsWith(f))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Team files are allowed for reading"}};return{behavior:"passthrough",message:""}}var E9,woD,gz$,Vw1,Pw1,sP;var BM=K(()=>{g$();SD();PI();ZM();iMH();rB();Z9();ZM();C5();XJ();tG();mL();W4();DL();ZPH();KZ$();gQ();Bm();$BH();G3();NA();E9=require("path"),woD=b(fRH(),1),gz$=require("os"),Vw1=[".gitconfig",".gitmodules",".bashrc",".bash_profile",".zshrc",".zprofile",".profile",".ripgreprc",".mcp.json",".claude.json"],Pw1=[".git",".vscode",".idea",".claude"];sP=E9.posix.sep});function Ow1(H){let $=/[*?[{]/,A=H.match($);if(!A||A.index===void 0){let f=PM.dirname(H),E=PM.basename(H);return{baseDir:f,relativePattern:E}}let L=H.slice(0,A.index),I=Math.max(L.lastIndexOf("/"),L.lastIndexOf(PM.sep));if(I===-1)return{baseDir:"",relativePattern:H};let D=L.slice(0,I),B=H.slice(I+1);if(D===""&&I===0)D="/";if(oA()==="windows"&&/^[A-Za-z]:$/.test(D))D=D+PM.sep;return{baseDir:D,relativePattern:B}}async function JYI(H,$,{limit:A,offset:L},I,D){let B=$,f=H;if(PM.isAbsolute(H)){let{baseDir:W,relativePattern:P}=Ow1(H);if(W)B=W,f=P}let E=SFH(jFH(D),B),M=A$(process.env.CLAUDE_CODE_GLOB_NO_IGNORE||"true"),G=A$(process.env.CLAUDE_CODE_GLOB_HIDDEN||"true"),U=["--files","--glob",f,"--sort=modified",...M?["--no-ignore"]:[],...G?["--hidden"]:[]];for(let W of E)U.push("--glob",`!${W}`);let J=(await YR(U,B,I)).map((W)=>PM.isAbsolute(W)?W:PM.join(B,W)),F=J.length>L+A;return{files:J.slice(L,L+A),truncated:F}}function joD(H){try{return zH().readFileSync(H,{encoding:"utf8"})}catch($){return r($),null}}function x3(H){let $=zH();return Math.floor($.statSync(H).mtimeMs)}function uTD(H,$=0,A){let D=zH().readFileSync(H,{encoding:"utf8"}).split(/\r?\n/),B=A!==void 0&&D.length-$>A?D.slice($,$+A):D.slice($);return{content:B.join(` `)}return THH($)}}function Mf(){let H=tbA(),$=De(SW(),hz);if(!$.projects)return OpH;let A=$.projects[H]??OpH;if(typeof A.allowedTools==="string")A.allowedTools=q1(A.allowedTools)??[];return A}function MM(H){let $=tbA();try{koD(SW(),hz,(A)=>{let L=A.projects?.[$]??OpH,I=H(L);if(I===L)return A;return{...A,projects:{...A.projects,[$]:I}}})}catch(A){N(`Failed to save config with lock: ${A}`,{level:"error"});let L=De(SW(),hz),I=L.projects?.[$]??OpH,D=H(I);if(D===I)return;boD(SW(),{...L,projects:{...L.projects,[$]:D}},hz)}}function Nd(){return KVH()!==null}function DmH(){return Nd()&&!A$(process.env.FORCE_AUTOUPDATE_PLUGINS)}function KVH(){if(A$(process.env.DISABLE_AUTOUPDATER))return"DISABLE_AUTOUPDATER set";if(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC set";let H=M$();if(H.autoUpdates===!1&&(H.installMethod!=="native"||H.autoUpdatesProtectedForNative!==!0))return"config";return null}function Y9$(){if(A$(process.env.DISABLE_COST_WARNINGS))return!1;if(nL())return!1;let $=ji(),A=eZ()!==null;if(!$.hasToken&&!A)return!1;let L=M$(),I=L.oauthAccount?.organizationRole,D=L.oauthAccount?.workspaceRole;if(!I||!D)return!1;return["admin","billing"].includes(I)||["workspace_admin","workspace_billing"].includes(D)}function my(){if(voD!==null)return voD;if(!nL())return!1;let H=f0();if(H==="max"||H==="pro")return!0;let A=M$().oauthAccount?.organizationRole;return!!A&&["admin","billing","owner","primary_owner"].includes(A)}function $T(){return cf("tengu_c4w_usage_limit_notifications_enabled")}function ux(){let H=M$();if(H.userID)return H.userID;let $=cz$.randomBytes(32).toString("hex");return AA((A)=>({...A,userID:$})),$}function uwA(){let H=M$();if(H.anonymousId)return H.anonymousId;let $=`claudecode.v1.${cz$.randomUUID()}`;return AA((A)=>({...A,anonymousId:$})),$}function uoD(){if(!M$().firstStartTime){let $=new Date().toISOString();AA((A)=>({...A,firstStartTime:A.firstStartTime??$}))}}function yv(H){let $=zL();if(H==="ExperimentalUltraClaudeMd")return yv("User");switch(H){case"User":return o4.join(UL(),"CLAUDE.md");case"Local":return o4.join($,"CLAUDE.local.md");case"Project":return o4.join($,"CLAUDE.md");case"Managed":return o4.join(v_(),"CLAUDE.md");case"ExperimentalUltraClaudeMd":return o4.join(UL(),"ULTRACLAUDE.md");case"AutoMem":return HF$()}}function N7A(){return o4.join(v_(),".claude","rules")}function O7A(){return o4.join(UL(),"rules")}var o4,cz$,hoD,OpH,hz,S4G,j4G,zd,M8H=null,NpH=0,dz$=0,obA=!1,tbA,voD=null;var vA=K(()=>{Z$();tD();Z1();NA();PI();nM();ZM();lG();g$();DL();rD();EI();E$();Z6();_$();t8();z$();ZE();y$H();G3();SD();Z$();szA();o4=require("path"),cz$=require("crypto"),hoD=b(zk(),1),OpH={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},hz={numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:"dark",preferredNotifChannel:"auto",verbose:!1,editorMode:"normal",autoCompactEnabled:!0,showTurnDuration:!0,hasSeenTasksHint:!1,hasUsedStash:!1,queuedCommandUpHintCount:0,diffTool:"auto",customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:60000,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},cachedGrowthBookFeatures:{},respectGitignore:!0};S4G={...hz,autoUpdates:!1},j4G={...OpH};zd={config:null,mtime:0};PB(async()=>{jw1()});tbA=o$(()=>{let H=zL(),$=XQ(H);if($)return E2H($);return E2H(o4.resolve(H))})});async function goD(){if(nz$===null&&!iz$)iz$=yw1(),nz$=await iz$,iz$=null,nm.cache.clear?.()}function moD(){return nm(!0)}function Rw1(){if(nz$!==null)return nz$;return}async function yw1(){return}var nz$=null,iz$=null,nm;var ELH=K(()=>{vA();tD();g$();EI();O_();Z1();nm=o$((H)=>{let $=ux(),A=M$(),L,I,D;if(H){if(L=f0()??void 0,I=Ri()??void 0,L&&A.claudeCodeFirstTokenDate){let M=new Date(A.claudeCodeFirstTokenDate).getTime();if(!isNaN(M))D=M}}let B=T9(),f=B?.organizationUuid,E=B?.accountUuid;return{deviceId:$,sessionId:j$(),email:Rw1(),appVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,platform:OA.platform,organizationUuid:f,accountUuid:E,userType:"external",subscriptionType:L,rateLimitTier:I,firstTokenTime:D,...process.env.GITHUB_ACTIONS==="true"&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}})});function az$(H){let $=jpH.get(H);if($)UPA({experimentId:$.experimentId,variationId:$.variationId,userAttributes:poD(),experimentMetadata:{feature_id:H}})}function Be(){return AWH()}function poD(){let H=moD(),$=H.email;return{id:H.deviceId,sessionId:H.sessionId,deviceID:H.deviceId,platform:H.platform,...H.organizationUuid&&{organizationUUID:H.organizationUuid},...H.accountUuid&&{accountUUID:H.accountUuid},...H.userType&&{userType:H.userType},...H.subscriptionType&&{subscriptionType:H.subscriptionType},...H.rateLimitTier&&{rateLimitTier:H.rateLimitTier},...H.firstTokenTime&&{firstTokenTime:H.firstTokenTime},...$&&{email:$},...H.appVersion&&{appVersion:H.appVersion},...H.githubActionsMetadata&&{githubActionsMetadata:H.githubActionsMetadata}}}async function doD(H,$,A){if(!Be())return $;let L=await xPH();if(!L)return $;let I;if(rz$.has(H))I=rz$.get(H);else I=L.getFeatureValue(H,$);if(A)az$(H);return I}async function HkA(H,$){return doD(H,$,!0)}function NL(H,$){if(!Be())return $;if(zPH(H,$),jpH.has(H))az$(H);else xpH.add(H);try{let A=M$().cachedGrowthBookFeatures?.[H];return A!==void 0?A:$}catch{return $}}function cf(H){if(!Be())return!1;if(zPH(H,!1),jpH.has(H))az$(H);else xpH.add(H);let $=M$(),A=$.cachedGrowthBookFeatures?.[H];if(A!==void 0)return Boolean(A);return $.cachedStatsigGates?.[H]??!1}async function eaD(H){if(!Be())return!1;if(SpH)await SpH;let $=M$(),A=$.cachedStatsigGates?.[H];if(A!==void 0)return zPH(H,!1),Boolean(A);let L=$.cachedGrowthBookFeatures?.[H];if(L!==void 0)return zPH(H,!1),Boolean(L);return zPH(H,!1),!1}function M4D(){if(!Be())return;try{oz$(),SpH=xPH().finally(()=>{SpH=null})}catch(H){r(H instanceof Error?H:Error(`GrowthBook: Auth change refresh failed: ${H}`))}}function oz$(){coD(),TPH?.destroy(),TPH=null,ebA=!1,SpH=null,jpH.clear(),xpH.clear(),rz$.clear(),sbA.cache?.clear?.(),xPH.cache?.clear?.(),zPH.cache?.clear?.()}async function hw1(){if(!Be())return;try{let H=await xPH();if(!H)return;await H.refreshFeatures();let $=M$().cachedGrowthBookFeatures;if($){let A={...$},L=!1;for(let I of Object.keys($)){let D=H.getFeatureValue(I,void 0);if(D!==void 0&&!jHH(D,$[I]))A[I]=D,L=!0}if(L)AA((I)=>({...I,cachedGrowthBookFeatures:A}))}}catch(H){r(H instanceof Error?H:Error(`GrowthBook: Light refresh failed: ${H}`))}}function bw1(){if(!Be())return;if(NPH)clearInterval(NPH);if(NPH=setInterval(()=>{hw1()},vw1),!OPH)OPH=()=>{coD()},process.on("beforeExit",OPH)}function coD(){if(NPH)clearInterval(NPH),NPH=null;if(OPH)process.removeListener("beforeExit",OPH),OPH=null}async function aS(H,$){return HkA(H,$)}function rm(H,$){return NL(H,$)}var TPH=null,ebA=!1,jpH,rz$,xpH,SpH=null,sbA,xPH,zPH,vw1=21600000,NPH=null,OPH=null;var SD=K(()=>{wiH();prA();crA();ELH();E$();_$();YvH();vA();_Q();g$();Z$();jpH=new Map,rz$=new Map,xpH=new Set;sbA=o$(()=>{if(!Be())return null;let H=poD(),$="https://api.anthropic.com/",L=XG(!0)||tI()?eG():{headers:{},error:"trust not established"};ebA=!L.error;let D=new piH({apiHost:$,clientKey:drA,attributes:H,remoteEval:!0,cacheKeyAttributes:["id","organizationUUID"],...L.error?{}:{apiHostRequestHeaders:L.headers},...{}});TPH=D;let B=D.init({timeout:5000}).then(async(f)=>{if(TPH!==D)return;let E=D.getPayload();if(E?.features){let M={};for(let[G,U]of Object.entries(E.features)){let X=U;if("value"in X&&!("defaultValue"in X))M[G]={...X,defaultValue:X.value};else M[G]=X;if(X.source==="experiment"&&X.experimentResult){let{experimentResult:J,experiment:F}=X;if(F?.key&&J.variationId!==void 0)jpH.set(G,{experimentId:F.key,variationId:J.variationId})}}await D.setPayload({...E,features:M});for(let[G,U]of Object.entries(M))if("value"in U)rz$.set(G,U.value);for(let G of xpH)az$(G);xpH.clear()}}).catch((f)=>{});return process.on("beforeExit",()=>TPH?.destroy()),process.on("exit",()=>TPH?.destroy()),{client:D,initialized:B}}),xPH=o$(async()=>{let H=sbA();if(!H)return null;if(!ebA){if(XG(!0)||tI()){if(!eG().error){if(oz$(),H=sbA(),!H)return null}}}return await H.initialized,bw1(),H.client});zPH=o$(async(H,$)=>{let A=await doD(H,$,!1),L=M$();if(jHH(L.cachedGrowthBookFeatures?.[H],A))return;AA((I)=>({...I,cachedGrowthBookFeatures:{...I.cachedGrowthBookFeatures??{},[H]:A}}))})});var sxA={};XA(sxA,{modelSupportsToolReference:()=>aoD,isToolSearchToolAvailable:()=>ooD,isToolSearchEnabledOptimistic:()=>Sm,isToolSearchEnabled:()=>puH,isToolReferenceBlock:()=>ng,getMcpMode:()=>gw1,getExternalMcpMode:()=>M1H,getAutoToolSearchCharThreshold:()=>roD,extractDiscoveredToolNames:()=>rhA});function LkA(H){if(!H.startsWith("auto:"))return null;let $=H.slice(5),A=parseInt($,10);if(isNaN(A))return N(`Invalid ENABLE_TOOL_SEARCH value "${H}": expected auto:N where N is a number.`),null;return Math.max(0,Math.min(100,A))}function ioD(H){if(!H)return!1;return H==="auto"||H.startsWith("auto:")}function AkA(){let H=process.env.ENABLE_TOOL_SEARCH;if(!H)return $kA;if(H==="auto")return $kA;let $=LkA(H);if($!==null)return $;return $kA}function noD(H){let $=YeH(H),A=JV(H,$),L=AkA()/100;return Math.floor(A*L)}function roD(H){return Math.floor(noD(H)*kw1)}function gw1(){let H=process.env.ENABLE_TOOL_SEARCH,$=H?LkA(H):null;if($===0)return"tst";if($===100){if(A$(process.env.ENABLE_MCP_CLI))return"mcp-cli";return"standard"}if(ioD(H))return"tst-auto";if(A$(H))return"tst";if(A$(process.env.ENABLE_MCP_CLI))return"mcp-cli";if(BE(process.env.ENABLE_MCP_CLI))return"standard";if(BE(process.env.ENABLE_TOOL_SEARCH))return"standard";return"tst-auto"}function M1H(){let H=process.env.ENABLE_TOOL_SEARCH,$=H?LkA(H):null;if($===0)return"tst";if($===100);else if(ioD(H))return"tst-auto";if(A$(H))return"tst";if(A$(process.env.ENABLE_EXPERIMENTAL_MCP_CLI))return"mcp-cli";if($===100)return"standard";if(BE(H))return"standard";if(BE(process.env.ENABLE_EXPERIMENTAL_MCP_CLI))return"standard";if(!NP())try{if(NL("tengu_mcp_tool_search",!0)===!1)return"standard"}catch{}return"tst-auto"}function pw1(){try{let H=NL("tengu_tool_search_unsupported_models",null);if(H&&Array.isArray(H)&&H.length>0)return H}catch{}return mw1}function aoD(H){let $=H.toLowerCase(),A=pw1();for(let L of A)if($.includes(L.toLowerCase()))return!1;return!0}function Sm(){let H=M1H(),$=H==="tst"||H==="tst-auto";if(!loD)loD=!0,N(`[ToolSearch:optimistic] mode=${H}, ENABLE_TOOL_SEARCH=${process.env.ENABLE_TOOL_SEARCH}, result=${$}`);switch(H){case"tst":case"tst-auto":return!0;case"mcp-cli":case"standard":return!1}}function ooD(H){return H.some(($)=>$.name===C7)}async function dw1(H,$,A){let L=H.filter((D)=>U3(D));if(L.length===0)return 0;return(await Promise.all(L.map(async(D)=>{let B=await D.prompt({getToolPermissionContext:$,tools:H,agents:A}),f=D.inputJSONSchema?yH(D.inputJSONSchema):D.inputSchema?yH(t9H(D.inputSchema)):"";return D.name.length+B.length+f.length}))).reduce((D,B)=>D+B,0)}async function puH(H,$,A,L,I){let D=$.filter((E)=>E.isMcp).length;function B(E,M,G,U){c("tengu_tool_search_mode_decision",{enabled:E,mode:M,reason:G,checkedModel:H,mcpToolCount:D,userType:"external",...U})}if(!aoD(H))return N(`Tool search disabled for model '${H}': model does not support tool_reference blocks. This feature is only available on Claude Sonnet 4+, Opus 4+, and newer models.`),B(!1,"standard","model_unsupported"),!1;if(!ooD($))return N("Tool search disabled: ToolSearchTool is not available (may have been disallowed via disallowedTools)."),B(!1,"standard","mcp_search_unavailable"),!1;let f=M1H();switch(f){case"tst":return B(!0,f,"tst_enabled"),!0;case"tst-auto":{let{enabled:E,debugDescription:M,metrics:G}=await iw1($,A,L,H);if(E)return N(`Auto tool search enabled: ${M}`+(I?` [source: ${I}]`:"")),B(!0,f,"auto_above_threshold",G),!0;if($.some((U)=>U3(U))&&!NP())try{let U=NL("tengu_tst_kx7",!1);return N(`Tool search ${U?"enabled":"disabled"} via experiment (tengu_tst_kx7): below threshold, deferred tools present`+(I?` [source: ${I}]`:"")),B(U,f,"experiment_enable_tst"),U}catch(U){N(`tengu_tst_kx7: GrowthBook not ready, skipping: ${U}`)}return N(`Auto tool search disabled: ${M}`+(I?` [source: ${I}]`:"")),B(!1,f,"auto_below_threshold",G),!1}case"mcp-cli":return B(!1,f,"mcp_cli_mode"),!1;case"standard":return B(!1,f,"standard_mode"),!1}}function ng(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="tool_reference"}function cw1(H){return ng(H)&&"tool_name"in H&&typeof H.tool_name==="string"}function lw1(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="tool_result"&&"content"in H&&Array.isArray(H.content)}function rhA(H){let $=new Set;for(let A of H){if(A.type!=="user")continue;let L=A.message?.content;if(!Array.isArray(L))continue;for(let I of L)if(lw1(I)){for(let D of I.content)if(cw1(D))$.add(D.tool_name)}}if($.size>0)N(`Dynamic tool loading: found ${$.size} discovered tools in message history`);return $}async function iw1(H,$,A,L){let I=await uw1(H,$,A,L);if(I!==null){let f=noD(L);return{enabled:I>=f,debugDescription:`${I} tokens (threshold: ${f}, ${AkA()}% of context)`,metrics:{deferredToolTokens:I,threshold:f}}}let D=await dw1(H,$,A),B=roD(L);return{enabled:D>=B,debugDescription:`${D} chars (threshold: ${B}, ${AkA()}% of context) (char fallback)`,metrics:{deferredToolDescriptionChars:D,charThreshold:B}}}var $kA=10,kw1=2.5,uw1,mw1,loD=!1;var GT=K(()=>{SD();Fo();z$();tD();NA();Z$();Ow$();m3H();E$();ia();nC();$q();uw1=o$(async(H,$,A,L)=>{let I=H.filter((D)=>U3(D));if(I.length===0)return 0;try{let D=await $d(I,$,{activeAgents:A,allAgents:A},L);if(D===0)return null;return Math.max(0,D-tw$)}catch{return null}},(H)=>H.filter(($)=>U3($)).map(($)=>$.name).join(","));mw1=["haiku"]});var soD={};XA(soD,{parseMcpCliCall:()=>ss,isMcpCliEndpointEnabled:()=>Od,isMcpCliEnabled:()=>eU,isMcpCliCall:()=>aw1,getMcpToolTimeoutMs:()=>dt,convertMcpToolNameForCli:()=>ihA});function dt(){return parseInt(process.env.MCP_TOOL_TIMEOUT||"",10)||nw1}function rw1(){if(A$(process.env.ENABLE_TOOL_SEARCH)&&A$(process.env.ENABLE_EXPERIMENTAL_MCP_CLI)&&!toD)toD=!0,console.warn(oH.yellow(`Warning: Both ENABLE_TOOL_SEARCH and ENABLE_EXPERIMENTAL_MCP_CLI are set to true. `,()=>X())}),!GZ())await vc("tengu_mcp_cli_command_executed",{command:"call",tool_name:nB(B),success:!0,duration_ms:Date.now()-f});process.exit(0)}catch(E){console.error(oH.red("Error calling tool:"),String(E));let M=Date.now()-f,G=String(E).slice(0,2000);if(!GZ())await vc("tengu_tool_use_error",{toolName:nB(B),isMcp:!0,error:G,durationMs:M}),await vc("tengu_mcp_cli_command_executed",{command:"call",tool_name:nB(B),success:!1,error_type:E instanceof vpH?"connection_failed":"tool_execution_failed",duration_ms:Date.now()-f});process.exit(1)}});Ee.command("grep").description("Search tool names and descriptions using regex patterns").argument("","Regex pattern to search for").option("--json","Output in JSON format").option("-i, --ignore-case","Case insensitive search (default: true)",!0).action(async(H,$)=>{let A=await hpH("grep",async()=>{try{new RegExp(H,$.ignoreCase?"i":"")}catch(D){throw Error(`Invalid regex pattern: ${D instanceof Error?D.message:String(D)}`)}let I={pattern:H,ignoreCase:$.ignoreCase};return GZ()?await U8H(CtD,{command:"grep",params:I}):AN$(fe().tools,I)},(I)=>({match_count:I.length}));if(!A.success)process.exit(1);let L=A.data;if($.json)console.log(yH(L));else if(L.length===0)console.log(oH.yellow("No tools found matching pattern"));else L.forEach((I)=>{if(console.log(oH.bold(`${I.server}/${I.name}`)),I.description){let D=I.description.length>100?I.description.slice(0,100)+"...":I.description;console.log(oH.dim(` ${D}`))}console.log()})});Ee.command("resources").description("List MCP resources").argument("[server]","Filter by server name").option("--json","Output in JSON format").action(async(H,$)=>{let A={server:H},L=await hpH("resources",async()=>{if(GZ())return await U8H(wtD,{command:"resources",params:A});else{let D=fe();return LN$(D.resources,A,D.normalizedNames)}},(D)=>({resource_count:D.length,filtered:!!H}));if(!L.success)process.exit(1);let I=L.data;if($.json)console.log(yH(I));else I.forEach((D)=>{console.log(`${D.server}/${D.name||D.uri}`)})});Ee.command("read").description("Read an MCP resource").argument("","Resource identifier in format / or ").argument("[uri]","Optional: Direct resource URI (file://, https://, etc.)").option("--json","Output in JSON format").option("--timeout ","Timeout in milliseconds (default: MCP_TOOL_TIMEOUT env var or effectively infinite)").option("--debug","Show debug output").action(async(H,$,A)=>{let L,I,D;if($)L=H,D=$;else{let E=ZkA(H);L=E.server,I=E.tool}let B;if(D){if(B=D,A.debug)console.log(`Using direct URI: ${B}`)}else{let E=fe(),G=VZ1(E,L).find((U)=>U.name===I||U.uri===I);if(!G)console.error(oH.red(`Error: Resource '${I}' not found on server '${L}'`)),process.exit(1);B=G.uri}let f=Date.now();try{let E=parseInt(A.timeout||"",10)||dt(),M={server:L,uri:B,timeoutMs:E},G=GZ()?await U8H(_DH,{command:"read",params:M},E):await _Z1(L,B,A);if(A.json)console.log(yH(G));else if(G.contents&&Array.isArray(G.contents))G.contents.forEach((U)=>{if(U&&typeof U==="object"){if("text"in U)console.log(U.text);else if("blob"in U){console.log(oH.yellow("[Binary blob content]"));let X="mimeType"in U?U.mimeType:void 0;console.log(oH.dim(`MIME type: ${X||"unknown"}`))}}});else console.log(yH(G,null,2));if(!GZ())await vc("tengu_mcp_cli_command_executed",{command:"read",success:!0,duration_ms:Date.now()-f});process.exit(0)}catch(E){if(console.error(oH.red("Error reading resource:"),String(E)),!GZ())await vc("tengu_mcp_cli_command_executed",{command:"read",success:!1,error_type:E instanceof vpH?"connection_failed":"read_failed",duration_ms:Date.now()-f});process.exit(1)}})});var RtD={};XA(RtD,{ripgrepMain:()=>CZ1});function CZ1(H){if(process.env.RIPGREP_EMBEDDED==="true")return jtD.spawnSync(process.execPath,["--no-config",...H],{argv0:"rg",stdio:"inherit"}).status??1;let $;return $=dmA().ripgrepMain,$(["--no-config",...H])}var jtD;var ytD=K(()=>{jtD=require("child_process")});class bpH{constructor(H=qkA.default.stdin,$=qkA.default.stdout){this._stdin=H,this._stdout=$,this._readBuffer=new kjH,this._started=!1,this._ondata=(A)=>{this._readBuffer.append(A),this.processReadBuffer()},this._onerror=(A)=>{var L;(L=this.onerror)===null||L===void 0||L.call(this,A)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var H,$;while(!0)try{let A=this._readBuffer.readMessage();if(A===null)break;(H=this.onmessage)===null||H===void 0||H.call(this,A)}catch(A){($=this.onerror)===null||$===void 0||$.call(this,A)}}async close(){var H;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),(H=this.onclose)===null||H===void 0||H.call(this)}send(H){return new Promise(($)=>{let A=EX$(H);if(this._stdout.write(A))$();else this._stdout.once("drain",$)})}}var qkA;var TkA=K(()=>{iFA();qkA=b(require("process"))});var htD={};XA(htD,{runClaudeInChromeMcpServer:()=>zZ1});function qZ1(){return}function TZ1(){return A$(process.env.USE_LOCAL_OAUTH)||A$(process.env.LOCAL_BRIDGE)}async function zZ1(){qPH();let H=new vtD,$=qZ1();H.info(`Bridge URL: ${$??"none (using native socket)"}`);let A={serverName:"Claude in Chrome",logger:H,socketPath:Y2$(),getSocketPaths:TZD,clientTypeId:"claude-code",onAuthenticationError:()=>{H.warn("Authentication error occurred. Please ensure you are logged into the Claude browser extension with the same claude.ai account as Claude Code.")},onToolCallDisconnected:()=>{return`Browser extension is not connected. Please ensure the Claude browser extension is installed and running (${wZ1}), and that you are logged into claude.ai with the same account as Claude Code. If this is your first time connecting to Chrome, you may need to restart Chrome for the installation to take effect. If you continue to experience issues, please report a bug: ${ZZ1}`},...$&&{bridgeConfig:{url:$,getUserId:async()=>{return M$().oauthAccount?.accountUuid},getOAuthToken:async()=>{return dD()?.accessToken??""},...TZ1()&&{devUserId:"dev_user_local"}}},...process.env.CLAUDE_CHROME_PERMISSION_MODE&&{initialPermissionMode:process.env.CLAUDE_CHROME_PERMISSION_MODE}},L=LhA(A),I=new bpH;process.stdin.on("end",()=>process.exit(0)),process.stdin.on("error",()=>process.exit(0)),N("[Claude in Chrome] Starting MCP server"),await L.connect(I),N("[Claude in Chrome] MCP server started")}class vtD{silly(H,...$){N(RPH.format(H,...$),{level:"debug"})}debug(H,...$){N(RPH.format(H,...$),{level:"debug"})}info(H,...$){N(RPH.format(H,...$),{level:"info"})}warn(H,...$){N(RPH.format(H,...$),{level:"warn"})}error(H,...$){N(RPH.format(H,...$),{level:"error"})}}var RPH,wZ1="https://claude.ai/chrome",ZZ1="https://github.com/anthropics/claude-code/issues/new?labels=bug,claude-in-chrome";var btD=K(()=>{E$();TkA();tT$();EI();vA();NA();nS();RPH=require("util")});var dtD={};XA(dtD,{sendChromeMessage:()=>X8H,runChromeNativeHost:()=>OZ1});function a5(H,...$){if(ktD){let A=new Date().toISOString(),L=$.length>0?" "+yH($):"",I=`[${A}] [Claude Chrome Native Host] ${H}${L} `;try{lF.appendFileSync(ktD,I)}catch{}}console.error(`[Claude Chrome Native Host] ${H}`,...$)}function X8H(H){let $=Buffer.from(H,"utf-8"),A=Buffer.alloc(4);A.writeUInt32LE($.length,0),process.stdout.write(A),process.stdout.write($)}async function OZ1(){a5("Initializing...");let H=new mtD,$=new ptD;await H.start();while(!0){let A=await $.read();if(A===null)break;await H.handleMessage(A)}await H.stop()}class mtD{mcpClients=new Map;nextClientId=1;server=null;running=!1;socketPath=null;async start(){if(this.running)return;if(this.socketPath=Y2$(),fN$.platform()!=="win32"){let H=wuH();try{if(!lF.statSync(H).isDirectory())lF.unlinkSync(H)}catch{}lF.mkdirSync(H,{recursive:!0,mode:448});try{lF.chmodSync(H,448)}catch{}try{let $=lF.readdirSync(H);for(let A of $){if(!A.endsWith(".sock"))continue;let L=parseInt(A.replace(".sock",""),10);if(isNaN(L))continue;try{process.kill(L,0)}catch{try{lF.unlinkSync(gtD.join(H,A)),a5(`Removed stale socket for PID ${L}`)}catch{}}}}catch{}}a5(`Creating socket listener: ${this.socketPath}`),this.server=utD.createServer((H)=>this.handleMcpClient(H)),await new Promise((H,$)=>{this.server.listen(this.socketPath,()=>{if(a5("Socket server listening for connections"),fN$.platform()!=="win32")try{lF.chmodSync(this.socketPath,384),a5("Socket permissions set to 0600")}catch(A){a5("Failed to set socket permissions:",A)}this.running=!0,H()}),this.server.on("error",(A)=>{a5("Socket server error:",A),$(A)})})}async stop(){if(!this.running)return;for(let[,H]of this.mcpClients)H.socket.destroy();if(this.mcpClients.clear(),this.server)await new Promise((H)=>{this.server.close(()=>H())}),this.server=null;if(fN$.platform()!=="win32"&&this.socketPath&&lF.existsSync(this.socketPath)){try{lF.unlinkSync(this.socketPath),a5("Cleaned up socket file")}catch{}try{let H=wuH();if(lF.readdirSync(H).length===0)lF.rmdirSync(H),a5("Removed empty socket directory")}catch{}}this.running=!1}async isRunning(){return this.running}async getClientCount(){return this.mcpClients.size}async handleMessage(H){let $=DA(H);switch(a5(`Handling Chrome message type: ${$.type}`),$.type){case"ping":a5("Responding to ping"),X8H(yH({type:"pong",timestamp:Date.now()}));break;case"get_status":X8H(yH({type:"status_response",native_host_version:NZ1}));break;case"tool_response":{if(this.mcpClients.size>0){a5(`Forwarding tool response to ${this.mcpClients.size} MCP clients`);let{type:A,...L}=$,I=Buffer.from(yH(L),"utf-8"),D=Buffer.alloc(4);D.writeUInt32LE(I.length,0);let B=Buffer.concat([D,I]);for(let[f,E]of this.mcpClients)try{E.socket.write(B)}catch(M){a5(`Failed to send to MCP client ${f}:`,M)}}break}case"notification":{if(this.mcpClients.size>0){a5(`Forwarding notification to ${this.mcpClients.size} MCP clients`);let{type:A,...L}=$,I=Buffer.from(yH(L),"utf-8"),D=Buffer.alloc(4);D.writeUInt32LE(I.length,0);let B=Buffer.concat([D,I]);for(let[f,E]of this.mcpClients)try{E.socket.write(B)}catch(M){a5(`Failed to send notification to MCP client ${f}:`,M)}}break}default:a5(`Unknown message type: ${$.type}`),X8H(yH({type:"error",error:`Unknown message type: ${$.type}`}))}}handleMcpClient(H){let $=this.nextClientId++,A={id:$,socket:H,buffer:Buffer.alloc(0)};this.mcpClients.set($,A),a5(`MCP client ${$} connected. Total clients: ${this.mcpClients.size}`),X8H(yH({type:"mcp_connected"})),H.on("data",(L)=>{A.buffer=Buffer.concat([A.buffer,L]);while(A.buffer.length>=4){let I=A.buffer.readUInt32LE(0);if(I===0||I>zkA){a5(`Invalid message length from MCP client ${$}: ${I}`),H.destroy();return}if(A.buffer.length<4+I)break;let D=A.buffer.slice(4,4+I);A.buffer=A.buffer.slice(4+I);try{let B=DA(D.toString("utf-8"));a5(`Forwarding tool request from MCP client ${$}: ${B.method}`),X8H(yH({type:"tool_request",method:B.method,params:B.params}))}catch(B){a5(`Failed to parse tool request from MCP client ${$}:`,B)}}}),H.on("error",(L)=>{a5(`MCP client ${$} error: ${L}`)}),H.on("close",()=>{a5(`MCP client ${$} disconnected. Remaining clients: ${this.mcpClients.size-1}`),this.mcpClients.delete($),X8H(yH({type:"mcp_disconnected"}))})}}class ptD{buffer=Buffer.alloc(0);pendingResolve=null;closed=!1;constructor(){process.stdin.on("data",(H)=>{this.buffer=Buffer.concat([this.buffer,H]),this.tryProcessMessage()}),process.stdin.on("end",()=>{if(this.closed=!0,this.pendingResolve)this.pendingResolve(null),this.pendingResolve=null}),process.stdin.on("error",()=>{if(this.closed=!0,this.pendingResolve)this.pendingResolve(null),this.pendingResolve=null})}tryProcessMessage(){if(!this.pendingResolve)return;if(this.buffer.length<4)return;let H=this.buffer.readUInt32LE(0);if(H===0||H>zkA){a5(`Invalid message length: ${H}`),this.pendingResolve(null),this.pendingResolve=null;return}if(this.buffer.length<4+H)return;let $=this.buffer.subarray(4,4+H);this.buffer=this.buffer.subarray(4+H);let A=$.toString("utf-8");this.pendingResolve(A),this.pendingResolve=null}async read(){if(this.closed)return null;if(this.buffer.length>=4){let H=this.buffer.readUInt32LE(0);if(H>0&&H<=zkA&&this.buffer.length>=4+H){let $=this.buffer.subarray(4,4+H);return this.buffer=this.buffer.subarray(4+H),$.toString("utf-8")}}return new Promise((H)=>{this.pendingResolve=H,this.tryProcessMessage()})}}var utD,fN$,gtD,lF,NZ1="1.0.0",zkA=1048576,ktD=void 0;var ctD=K(()=>{nS();Z$();utD=require("net"),fN$=require("os"),gtD=require("path"),lF=require("fs")});function xZ1(){let H=process.argv[1]||"",$=process.execPath||process.argv[0]||"";if(oA()==="windows")H=H.split(yPH.win32.sep).join(yPH.posix.sep),$=$.split(yPH.win32.sep).join(yPH.posix.sep);let A=[H,$],L=["/build-ant/","/build-external/","/build-external-native/","/build-ant-native/"];return A.some((I)=>L.some((D)=>I.includes(D)))}function jZ1(H){let $=`${H.name}: ${H.message}`;return SZ1.some((A)=>A.test($))}function itD(){let H=process.listeners("warning");if(EN$&&H.includes(EN$))return;if(!xZ1())process.removeAllListeners("warning");EN$=(A)=>{try{let L=`${A.name}: ${A.message.slice(0,50)}`,I=ltD.get(L)||0;ltD.set(L,I+1);let D=jZ1(A);if(c("tengu_node_warning",{is_internal:D?1:0,occurrence_count:I+1,classname:A.name,...!1}),process.env.CLAUDE_DEBUG==="true")N(`${D?"[Internal Warning]":"[Warning]"} ${A.toString()}`,{level:"warn"})}catch{}},process.on("warning",EN$)}var yPH,ltD,SZ1,EN$=null;var ntD=K(()=>{z$();E$();Z9();yPH=require("path"),ltD=new Map;SZ1=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/]});function rtD(){}function atD(){let H=VL()||{},$=M$().env||{},A=H.env||{};for(let[L,I]of Object.entries($))if(D0H.has(L.toUpperCase()))process.env[L]=I;for(let[L,I]of Object.entries(A))if(D0H.has(L.toUpperCase()))process.env[L]=I;rtD()}function Me(){let H=VL()||{};Object.assign(process.env,M$().env),Object.assign(process.env,H.env),rtD(),TD$()}var kpH=K(()=>{vA();nR();mL();f7$()});var otD={};XA(otD,{showInvalidConfigDialog:()=>vZ1});function RZ1({filePath:H,errorDescription:$,onExit:A,onReset:L}){return kz.default.createElement(BL,{title:"Configuration Error",color:"error",onCancel:A},kz.default.createElement(x,{flexDirection:"column",gap:1},kz.default.createElement(V,null,"The configuration file at ",kz.default.createElement(V,{bold:!0},H)," contains invalid JSON."),kz.default.createElement(V,null,$)),kz.default.createElement(x,{flexDirection:"column"},kz.default.createElement(V,{bold:!0},"Choose an option:"),kz.default.createElement(QA,{options:[{label:"Exit and fix manually",value:"exit"},{label:"Reset with default configuration",value:"reset"}],onChange:(D)=>{if(D==="exit")A();else L()},onCancel:A})))}async function vZ1({error:H}){let $={...ZG(!1),theme:yZ1};await new Promise(async(A)=>{let{unmount:L}=await A8(kz.default.createElement(i8,null,kz.default.createElement(hE,null,kz.default.createElement(RZ1,{filePath:H.filePath,errorDescription:H.message,onExit:()=>{L(),A(),process.exit(1)},onReset:()=>{iL(H.filePath,yH(H.defaultConfig,null,2),{flush:!1,encoding:"utf8"}),L(),A(),process.exit(0)}}))),$)})}var kz,yZ1="dark";var ttD=K(()=>{xH();l8();xH();Z$();pL();AS();Z$();sv();bB();kz=b(s(),1)});function OkA(){if(YPA()){if(tI()&&zF())NkA();RID().then(async()=>{Me(),await NkA()})}else NkA()}async function NkA(){if(stD)return;stD=!0,await hZ1()}async function hZ1(){let{initializeTelemetry:H}=await Promise.resolve().then(() => (N2A(),z2A)),$=H();if($)rS$($,(L,I)=>{let D=$?.createCounter(L,I);return{add(B,f={}){let M={...XQH(),...f};D?.add(B,M)}}})}var stD=!1,etD;var HsD=K(()=>{hc();g$();vA();vA();kpH();lG();UU();ZE();tD();g$();nF$();nR();H4H();iMH();zvH();XY();kpH();g$();OK$();Hq();ZPH();BW();Pt();BM();E$();Z6();Ma();etD=o$(()=>{let H=Date.now();EL("info","init_started"),_0("init_function_start");try{let $=Date.now();qPH(),EL("info","init_configs_enabled",{duration_ms:Date.now()-$}),_0("init_configs_enabled");let A=Date.now();if(atD(),EL("info","init_safe_env_vars_applied",{duration_ms:Date.now()-A}),_0("init_safe_env_vars_applied"),XID(),_0("init_after_graceful_shutdown"),Promise.resolve().then(() => (YvH(),EID)).then((D)=>{D.initialize1PEventLogging()}),_0("init_after_1p_event_logging"),n1L(),_0("init_after_oauth_populate"),_KA(),_0("init_after_jetbrains_detection"),YPA())jID();if(oy())_3I();_0("init_after_remote_settings_check"),uoD();let L=Date.now();N("[init] configureGlobalMTLS starting"),ggL(),EL("info","init_mtls_configured",{duration_ms:Date.now()-L}),N("[init] configureGlobalMTLS complete");let I=Date.now();if(N("[init] configureGlobalAgents starting"),TD$(),EL("info","init_proxy_configured",{duration_ms:Date.now()-I}),N("[init] configureGlobalAgents complete"),_0("init_network_configured"),DDL(),PB(T6D),eU())process.env.CLAUDE_CODE_SESSION_ID=j$(),YoD();if(FPH()){let D=Date.now();ToD(),EL("info","init_scratchpad_created",{duration_ms:Date.now()-D})}EL("info","init_completed",{duration_ms:Date.now()-H}),_0("init_function_end")}catch($){if($ instanceof S_)return Promise.resolve().then(() => (ttD(),otD)).then((A)=>A.showInvalidConfigDialog({error:$}));else throw $}})});async function uZ1(){if(SkA||RkA)return;if(SkA=!0,!$sD)$sD=!0,_3D(()=>{khA(),vPH.forEach(($)=>$())});let H=await mZ1();if(H.length===0)return;N(`Watching for changes in skill/command directories: ${H.join(", ")}...`),zb=YGH.watch(H,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:jkA?.stabilityThreshold??bZ1,pollInterval:jkA?.pollInterval??kZ1},ignored:($,A)=>{if(A&&!A.isFile()&&!A.isDirectory())return!0;return $.split(J8H.sep).some((L)=>L===".git")},ignorePermissionErrors:!0,usePolling:!1,atomic:!0}),zb.on("add",xkA),zb.on("change",xkA),zb.on("unlink",xkA),PB(async()=>AsD())}function AsD(){if(RkA=!0,zb)zb.close(),zb=null;vPH.clear()}function gZ1(H){return vPH.add(H),()=>{vPH.delete(H)}}async function mZ1(){let H=zH(),$=[],A=Tt("userSettings","skills");if(A)try{await H.stat(A),$.push(A)}catch{}let L=Tt("userSettings","commands");if(L)try{await H.stat(L),$.push(L)}catch{}let I=Tt("projectSettings","skills");if(I)try{let B=J8H.resolve(I);await H.stat(B),$.push(B)}catch{}let D=Tt("projectSettings","commands");if(D)try{let B=J8H.resolve(D);await H.stat(B),$.push(B)}catch{}for(let B of CN()){let f=J8H.join(B,".claude","skills");try{await H.stat(f),$.push(f)}catch{}}return $}function xkA(H){N(`Detected skill change: ${H}`),c("tengu_skill_file_changed",{source:"chokidar"}),dY$(),gh(),rp(),vPH.forEach(($)=>$())}function pZ1(H){if(zb)zb.close(),zb=null;vPH.clear(),SkA=!1,RkA=!1,jkA=H??null}var J8H,bZ1=1000,kZ1=500,zb=null,SkA=!1,RkA=!1,$sD=!1,vPH,jkA=null,hPH;var MN$=K(()=>{EeH();E$();ZE();zt();h4();J3();DL();g$();z$();J8H=b(require("path")),vPH=new Set;hPH={initialize:uZ1,dispose:AsD,subscribe:gZ1,resetForTesting:pZ1}});function LsD({onDone:H}){return bPH.default.createElement(BL,{title:"You've spent $5 on the Anthropic API this session.",onCancel:H},bPH.default.createElement(x,{flexDirection:"column"},bPH.default.createElement(V,null,"Learn more about how to monitor your spending:"),bPH.default.createElement(dI,{url:"https://code.claude.com/docs/en/costs"})),bPH.default.createElement(QA,{options:[{value:"ok",label:"Got it, thanks!"}],onChange:H}))}var bPH;var IsD=K(()=>{xH();l8();xH();bB();bPH=b(s(),1)});function fsD(){if(F8H++,F8H===1)GsD(),iZ1()}function EsD(){if(F8H>0)F8H--;if(F8H===0)MsD(),ykA()}function lZ1(){F8H=0,MsD(),ykA()}function iZ1(){return}function MsD(){if(kPH!==null)clearInterval(kPH),kPH=null}function GsD(){return}function ykA(){if(Cj!==null){try{Cj.kill(),N("Stopped caffeinate, allowing sleep")}catch{}Cj=null}}var BsD,dZ1=300,cZ1=240000,Cj=null,kPH=null,F8H=0,DsD=!1;var UsD=K(()=>{E$();ZE();BsD=require("child_process")});function XsD({name:H,color:$}){let A=v7($);return K8H.createElement(x,{flexDirection:"row",gap:1},K8H.createElement(V,{color:A},Zf," ",K8H.createElement(V,{bold:!0},"@",H)))}var K8H;var JsD=K(()=>{xH();p6();Wp();K8H=b(s(),1)});function vkA({toolName:H,description:$}){let A=g9(),L=g1(),I=q4();return _M.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:"warning",paddingX:1},_M.createElement(x,{marginBottom:1},_M.createElement(vD,null),_M.createElement(V,{color:"warning",bold:!0}," ","Waiting for team lead approval")),L&&I&&_M.createElement(x,{marginBottom:1},_M.createElement(XsD,{name:L,color:I})),_M.createElement(x,null,_M.createElement(V,{dimColor:!0},"Tool: "),_M.createElement(V,null,H)),_M.createElement(x,null,_M.createElement(V,{dimColor:!0},"Action: "),_M.createElement(V,null,$)),A&&_M.createElement(x,{marginTop:1},_M.createElement(V,{dimColor:!0},"Permission request sent to team ",'"',A,'"'," leader")))}var _M;var FsD=K(()=>{xH();JM();JsD();sU();XE();_M=b(s(),1)});function QsD(H,$=!1){let A=J$((L)=>L.teamContext);KsD.useEffect(()=>{if(!$)$j(H,{...dL()?{teamName:A?.teamName,agentName:A?.selfAgentName}:{}})},[H,$,A?.teamName,A?.selfAgentName])}var KsD;var WsD=K(()=>{rB();pL();T8();KsD=b(s(),1)});function _sD(H){return H.type==="text"}function YsD({messages:H,onPreRestore:$,onRestoreMessage:A,onRestoreCode:L,onSummarize:I,onClose:D}){let B=J$((KH)=>KH.fileHistory),[f,E]=o5.useState(void 0),M=gE(),G=o5.useMemo(PsD.randomUUID,[]),U=o5.useMemo(()=>[...H.filter(upH),{...R$({content:""}),uuid:G}],[H,G]),[X,J]=o5.useState(U.length-1),F=Math.max(0,Math.min(X-Math.floor(hkA/2),U.length-hkA)),Q=U.length>1,[W,P]=o5.useState(void 0),[C,Y]=o5.useState(void 0),[Z,q]=o5.useState(!1),[O,j]=o5.useState(null),[u,y]=o5.useState("both"),[g,h]=o5.useState("");function p(KH){let MH=KH?[{value:"both",label:"Restore code and conversation"},{value:"conversation",label:"Restore conversation"},{value:"code",label:"Restore code"}]:[{value:"conversation",label:"Restore conversation"}];return MH.push({value:"summarize",label:"Summarize from here",type:"input",placeholder:"add context (optional)",initialValue:"",onChange:h,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:": "}),MH.push({value:"nevermind",label:"Never mind"}),MH}o5.useEffect(()=>{c("tengu_message_selector_opened",{})},[]);async function d(KH){let MH=H.indexOf(KH),CH=H.length-1-MH;if(c("tengu_message_selector_selected",{index_from_end:CH,message_type:KH.type,is_current_prompt:!1}),!H.includes(KH)){D();return}if(M){P(KH);let OH=vY$(B,KH.uuid);Y(OH)}else{$(),q(!0);try{await A(KH),q(!1),D()}catch(OH){r(OH),q(!1),E(`Failed to restore the conversation: `)[0]??null;return Sd.createElement(x,{flexDirection:"column"},Sd.createElement(x,{borderDimColor:!0,borderColor:"subtle",borderStyle:"dashed",flexDirection:"column",borderLeft:!1,borderRight:!1},Jz(D.map((f)=>Sd.createElement(LC,{key:f.newStart,patch:f,dim:!1,filePath:H,firstLine:B,fileContent:L,width:A})),(f)=>Sd.createElement(V,{dimColor:!0,key:`ellipsis-${f}`},"..."))))}var Sd,UN$;var bkA=K(()=>{Zt();xH();tg();rD();DL();JBH();OB();Sd=b(s(),1),UN$=b(s(),1)});function pX(H){c("tengu_unary_event",{event:H.event,completion_type:H.completion_type,language_name:H.metadata.language_name,message_id:H.metadata.message_id,platform:H.metadata.platform,...H.metadata.hasFeedback!==void 0&&{hasFeedback:H.metadata.hasFeedback}})}var Q8H=K(()=>{z$()});function uz(H,$){let A=zI();TsD.useEffect(()=>{A((I)=>({...I,attribution:{...I.attribution,permissionPromptCount:I.attribution.permissionPromptCount+1}})),c("tengu_tool_use_show_permission_request",{messageID:H.assistantMessage.message.id,toolName:nB(H.tool.name),isMcp:H.tool.isMcp??!1,decisionReasonType:H.permissionResult.decisionReason?.type,sandboxEnabled:vL.isSandboxingEnabled()}),Promise.resolve($.language_name).then((I)=>{pX({completion_type:$.completion_type,event:"response",metadata:{language_name:I,message_id:H.assistantMessage.message.id,platform:OA.platform}})})},[H,$,A])}var TsD;var W8H=K(()=>{z$();R4();g3();zQ();C5();Z1();Q8H();EM();Z$();pL();TsD=b(s(),1)});function oZ1(H){let $=xD(H),A=xD(`${zL()}/.claude`),L=qC($),I=qC(A);return L.startsWith(I+gpH.sep.toLowerCase())||L.startsWith(I+"/")}function tZ1(H){let $=xD(H),A=`${zsD.homedir()}/.claude`,L=qC($),I=qC(A);return L.startsWith(I+gpH.sep.toLowerCase())||L.startsWith(I+"/")}function NsD({filePath:H,toolPermissionContext:$,operationType:A="write",onRejectFeedbackChange:L,onAcceptFeedbackChange:I,yesInputMode:D=!1,noInputMode:B=!1}){let f=[],E=CQ("chat:cycleMode","Chat","shift+tab");if(D&&I)f.push({type:"input",label:"Yes",value:"yes",placeholder:"and tell Claude what to do next",onChange:I,allowEmptySubmitToCancel:!0,option:{type:"accept-once"}});else f.push({label:"Yes",value:"yes",option:{type:"accept-once"}});let M=iS(H,$),G=oZ1(H),U=tZ1(H);if((G||U)&&A!=="read")f.push({label:"Yes, and allow Claude to edit its own settings for this session",value:"yes-claude-folder",option:{type:"accept-session",scope:U?"global-claude-folder":"claude-folder"}});else{let X;if(M)if(A==="read")X="Yes, during this session";else X=Ge.default.createElement(V,null,"Yes, allow all edits during this session"," ",Ge.default.createElement(V,{bold:!0},"(",E,")"));else{let J=qk(H),F=gpH.basename(J)||"this directory";if(A==="read")X=Ge.default.createElement(V,null,"Yes, allow reading from ",Ge.default.createElement(V,{bold:!0},F,"/")," during this session");else X=Ge.default.createElement(V,null,"Yes, allow all edits in ",Ge.default.createElement(V,{bold:!0},F,"/")," during this session ",Ge.default.createElement(V,{bold:!0},"(",E,")"))}f.push({label:X,value:"yes-session",option:{type:"accept-session"}})}if(B&&L)f.push({type:"input",label:"No",value:"no",placeholder:"and tell Claude what to do differently",onChange:L,allowEmptySubmitToCancel:!0,option:{type:"reject"}});else f.push({label:"No",value:"no",option:{type:"reject"}});return f}var Ge,gpH,zsD;var OsD=K(()=>{xH();BM();FG();ZM();g$();Ge=b(s(),1),gpH=require("path"),zsD=require("os")});function kkA(H,$,A,L,I){pX({completion_type:$,event:H,metadata:{language_name:A,message_id:L,platform:OA.platform,hasFeedback:I??!1}})}function sZ1(H,$){let{messageId:A,toolUseConfirm:L,onDone:I,completionType:D,languageName:B}=H;kkA("accept",D,B,A),c("tengu_accept_submitted",{toolName:nB(L.tool.name),isMcp:L.tool.isMcp??!1,has_instructions:!!$?.feedback,instructions_length:$?.feedback?.length??0,entered_feedback_mode:$?.enteredFeedbackMode??!1}),I(),L.onAllow(L.input,[],$?.feedback)}function eZ1(H,$){let{messageId:A,path:L,toolUseConfirm:I,toolPermissionContext:D,onDone:B,completionType:f,languageName:E,operationType:M}=H;if(kkA("accept",f,E,A),$?.scope==="claude-folder"||$?.scope==="global-claude-folder"){let U=$.scope==="global-claude-folder"?G9$:M9$,X=[{type:"addRules",rules:[{toolName:TB,ruleContent:U}],behavior:"allow",destination:"session"}];B(),I.onAllow(I.input,X);return}let G=L?pz$(L,M,D):[];B(),I.onAllow(I.input,G)}function Hq1(H,$){let{messageId:A,toolUseConfirm:L,onDone:I,onReject:D,completionType:B,languageName:f}=H;kkA("reject",B,f,A,$?.hasFeedback),c("tengu_reject_submitted",{toolName:nB(L.tool.name),isMcp:L.tool.isMcp??!1,has_instructions:!!$?.feedback,instructions_length:$?.feedback?.length??0,entered_feedback_mode:$?.enteredFeedbackMode??!1}),I(),D(),L.onReject($?.feedback)}var xsD;var SsD=K(()=>{Q8H();Z1();BM();z$();R4();xsD={"accept-once":sZ1,"accept-session":eZ1,reject:Hq1}});function jsD({filePath:H,completionType:$,languageName:A,toolUseConfirm:L,onDone:I,onReject:D,parseInput:B,operationType:f="write"}){let E=J$((p)=>p.toolPermissionContext),[M,G]=eP.useState(""),[U,X]=eP.useState(""),[J,F]=eP.useState("yes"),[Q,W]=eP.useState(!1),[P,C]=eP.useState(!1),[Y,Z]=eP.useState(!1),[q,O]=eP.useState(!1),j=eP.useMemo(()=>NsD({filePath:H,toolPermissionContext:E,operationType:f,onRejectFeedbackChange:X,onAcceptFeedbackChange:G,yesInputMode:Q,noInputMode:P}),[H,E,f,Q,P]),u=eP.useCallback((p,d,k)=>{let n={messageId:L.assistantMessage.message.id,path:H,toolUseConfirm:L,toolPermissionContext:E,onDone:I,onReject:D,completionType:$,languageName:A,operationType:f},GH=L.onAllow;L.onAllow=(BH,WH,wH)=>{GH(d,WH,wH)};let HH=xsD[p.type];HH(n,{feedback:k,hasFeedback:!!k,enteredFeedbackMode:p.type==="accept-once"?Y:q,scope:p.type==="accept-session"?p.scope:void 0})},[H,$,A,L,E,I,D,f,Y,q]),y=eP.useCallback(()=>{let p=j.find((d)=>d.option.type==="accept-session");if(p){let d=B(L.input);u(p.option,d)}},[j,B,L.input,u]);bI({"confirm:cycleMode":y},{context:"Confirmation"});let g=eP.useCallback((p)=>{if(p!=="yes"&&Q&&!M.trim())W(!1);if(p!=="no"&&P&&!U.trim())C(!1);F(p)},[Q,P,M,U]),h=eP.useCallback((p)=>{let d={toolName:nB(L.tool.name),isMcp:L.tool.isMcp??!1};if(p==="yes")if(Q)W(!1),c("tengu_accept_feedback_mode_collapsed",d);else W(!0),Z(!0),c("tengu_accept_feedback_mode_entered",d);else if(p==="no")if(P)C(!1),c("tengu_reject_feedback_mode_collapsed",d);else C(!0),O(!0),c("tengu_reject_feedback_mode_entered",d)},[Q,P,L]);return{options:j,onChange:u,acceptFeedback:M,rejectFeedback:U,focusedOption:J,setFocusedOption:g,handleInputModeToggle:h,yesInputMode:Q,noInputMode:P}}var eP;var RsD=K(()=>{$I();OsD();SsD();pL();z$();R4();eP=b(s(),1)});function hsD({onChange:H,toolUseContext:$,filePath:A,edits:L,editMode:I}){let D=jd.useRef(!1),[B,f]=jd.useState(!1),E=jd.useMemo(()=>ysD.randomUUID().slice(0,6),[]),M=jd.useMemo(()=>`\u273B [Claude Code] ${vsD.basename(A)} (${E}) \u29C9`,[A,E]),G=SX$($.options.mcpClients)&&M$().diffTool==="auto"&&!A.endsWith(".ipynb"),U=jX$($.options.mcpClients)??"IDE";async function X(){if(!G)return;try{c("tengu_ext_will_show_diff",{});let{oldContent:J,newContent:F}=await Aq1(A,L,$,M);if(D.current)return;c("tengu_ext_diff_accepted",{});let Q=$q1(A,J,F,I);if(Q.length===0){c("tengu_ext_diff_rejected",{});let W=CY($.options.mcpClients);if(W)await ukA(M,W);H({type:"reject"},{file_path:A,edits:L});return}H({type:"accept-once"},{file_path:A,edits:Q})}catch(J){r(J),f(!0)}}return jd.useEffect(()=>{return X(),()=>{D.current=!0}},[]),{closeTabInIDE(){let J=CY($.options.mcpClients);if(!J)return Promise.resolve();return ukA(M,J)},showingDiffInIDE:G&&!B,ideName:U,hasError:B}}function $q1(H,$,A,L){let I=L==="single",D=PYI({filePath:H,oldContent:$,newContent:A,singleHunk:I});if(D.length===0)return[];if(I&&D.length>1)r(Error(`Unexpected number of hunks: ${D.length}. Expected 1 hunk.`));return yRI(D)}async function Aq1(H,$,A,L){let I=!1,D=zH(),B=xD(H),f=D.existsSync(B)?$J(B):"";async function E(){if(I)return;I=!0;try{await ukA(L,M)}catch(G){r(G)}process.off("beforeExit",E),A.abortController.signal.removeEventListener("abort",E)}A.abortController.signal.addEventListener("abort",E),process.on("beforeExit",E);let M=CY(A.options.mcpClients);try{let{updatedFile:G}=EyH({filePath:B,fileContents:f,edits:$});if(!M||M.type!=="connected")throw Error("IDE client not available");let U=B,X=M.config.ideRunningInWindows===!0;if(oA()==="wsl"&&X&&process.env.WSL_DISTRO_NAME)U=new KKH(process.env.WSL_DISTRO_NAME).toIDEPath(B);let J=await Vx("openDiff",{old_file_path:U,new_file_path:U,new_file_contents:G,tab_name:L},M),F=Array.isArray(J)?J:[J];if(Dq1(F))return E(),{oldContent:f,newContent:F[1].text};else if(Lq1(F))return E(),{oldContent:f,newContent:G};else if(Iq1(F))return E(),{oldContent:f,newContent:f};throw Error("Not accepted")}catch(G){throw r(G),E(),G}}async function ukA(H,$){try{if(!$||$.type!=="connected")throw Error("IDE client not available");await Vx("close_tab",{tab_name:H},$)}catch(A){r(A)}}function Lq1(H){return Array.isArray(H)&&typeof H[0]==="object"&&H[0]!==null&&"type"in H[0]&&H[0].type==="text"&&"text"in H[0]&&H[0].text==="TAB_CLOSED"}function Iq1(H){return Array.isArray(H)&&typeof H[0]==="object"&&H[0]!==null&&"type"in H[0]&&H[0].type==="text"&&"text"in H[0]&&H[0].text==="DIFF_REJECTED"}function Dq1(H){return Array.isArray(H)&&H[0]?.type==="text"&&H[0].text==="FILE_SAVED"&&typeof H[1].text==="string"}var ysD,vsD,jd;var bsD=K(()=>{DL();JBH();tg();_$();vA();nU();z$();nU();ZM();wKA();Z9();rD();ysD=require("crypto"),vsD=require("path"),jd=b(s(),1)});function ksD({onChange:H,options:$,input:A,filePath:L,ideName:I,symlinkTarget:D,rejectFeedback:B,acceptFeedback:f,setFocusedOption:E,onInputModeToggle:M,focusedOption:G,yesInputMode:U,noInputMode:X}){return UZ.default.createElement(x,{flexDirection:"column"},UZ.default.createElement(Uf,{dividerColor:"permission"}),UZ.default.createElement(x,{marginX:1,flexDirection:"column",gap:1},UZ.default.createElement(V,{bold:!0,color:"permission"},"Opened changes in ",I," \u29C9"),D&&UZ.default.createElement(V,{color:"warning"},JN$.relative(C$(),D).startsWith("..")?`This will modify ${D} (outside working directory) via a symlink`:`Symlink target: ${D}`),njH()&&UZ.default.createElement(V,{dimColor:!0},"Save file to continue\u2026"),UZ.default.createElement(x,{flexDirection:"column"},UZ.default.createElement(V,null,"Do you want to make this edit to"," ",UZ.default.createElement(V,{bold:!0},JN$.basename(L)),"?"),UZ.default.createElement(QA,{options:$,inlineDescriptions:!0,onChange:(J)=>{let F=$.find((Q)=>Q.value===J);if(F){if(F.option.type==="reject"){let Q=B.trim();H(F.option,A,Q||void 0);return}if(F.option.type==="accept-once"){let Q=f.trim();H(F.option,A,Q||void 0);return}H(F.option,A)}},onCancel:()=>H({type:"reject"},A),onFocus:(J)=>E(J),onInputModeToggle:M})),UZ.default.createElement(x,{marginTop:1},UZ.default.createElement(V,{dimColor:!0},"Esc to cancel",(G==="yes"&&!U||G==="no"&&!X)&&" \xB7 Tab to amend"))))}var UZ,JN$;var usD=K(()=>{xH();l8();nU();e6();PI();UZ=b(s(),1),JN$=require("path")});function Nb({toolUseConfirm:H,toolUseContext:$,onDone:A,onReject:L,title:I,subtitle:D,question:B="Do you want to proceed?",content:f,completionType:E="tool_use_single",languageName:M="none",path:G,parseInput:U,operationType:X="write",ideDiffSupport:J,workerBadge:F}){let Q=gkA.useMemo(()=>({completion_type:E,language_name:M}),[E,M]);uz(H,Q);let W=gkA.useMemo(()=>{if(!G||X==="read")return null;let WH=xD(G),wH=zH(),{resolvedPath:QH,isSymlink:TH}=OU(wH,WH);if(TH)return QH;return null},[G,X]),P=jsD({filePath:G||"",completionType:E,languageName:M,toolUseConfirm:H,onDone:A,onReject:L,parseInput:U,operationType:X}),{options:C,acceptFeedback:Y,rejectFeedback:Z,setFocusedOption:q,handleInputModeToggle:O,focusedOption:j,yesInputMode:u,noInputMode:y}=P,g=U(H.input),h=J?J.getConfig(g):null,p=h?{onChange:(WH,wH)=>{let QH=J.applyChanges(g,wH.edits);P.onChange(WH,QH)},toolUseContext:$,filePath:h.filePath,edits:(h.edits||[]).map((WH)=>({old_string:WH.old_string,new_string:WH.new_string,replace_all:WH.replace_all||!1})),editMode:h.editMode||"single"}:{onChange:()=>{},toolUseContext:$,filePath:"",edits:[],editMode:"single"},{closeTabInIDE:d,showingDiffInIDE:k,ideName:n}=hsD(p),GH=(WH,wH)=>{d?.(),P.onChange(WH,g,wH?.trim())};if(k&&h&&G)return gz.default.createElement(ksD,{onChange:(WH,wH,QH)=>GH(WH,QH),options:C,filePath:G,input:g,ideName:n,symlinkTarget:W,rejectFeedback:Z,acceptFeedback:Y,setFocusedOption:q,onInputModeToggle:O,focusedOption:j,yesInputMode:u,noInputMode:y});let HH=W!=null&&gsD.relative(C$(),W).startsWith(".."),BH=W?gz.default.createElement(x,{paddingX:1,marginBottom:1},gz.default.createElement(V,{color:"warning"},HH?`This will modify ${W} (outside working directory) via a symlink`:`Symlink target: ${W}`)):null;return gz.default.createElement(gz.default.Fragment,null,gz.default.createElement(wG,{title:I,subtitle:D,innerPaddingX:0,workerBadge:F},BH,f,gz.default.createElement(x,{flexDirection:"column",paddingX:1},typeof B==="string"?gz.default.createElement(V,null,B):B,gz.default.createElement(QA,{options:C,inlineDescriptions:!0,onChange:(WH)=>{let wH=C.find((QH)=>QH.value===WH);if(wH){if(wH.option.type==="reject"){let QH=Z.trim();GH(wH.option,QH||void 0);return}if(wH.option.type==="accept-once"){let QH=Y.trim();GH(wH.option,QH||void 0);return}GH(wH.option)}},onCancel:()=>GH({type:"reject"}),onFocus:(WH)=>q(WH),onInputModeToggle:O}))),gz.default.createElement(x,{paddingX:1,marginTop:1},gz.default.createElement(V,{dimColor:!0},"Esc to cancel",(j==="yes"&&!u||j==="no"&&!y)&&" \xB7 Tab to amend")))}var gsD,gz,gkA;var gPH=K(()=>{xH();l8();Xw();W8H();RsD();bsD();usD();DL();PI();ZM();gsD=require("path"),gz=b(s(),1),gkA=b(s(),1)});function FN$(H,$,A,L){return{filePath:H,edits:[{old_string:$,new_string:A,replace_all:L}],editMode:"single"}}function dsD(H){let $=(f)=>{return S3.inputSchema.parse(f)},A=$(H.toolUseConfirm.input),{file_path:L,old_string:I,new_string:D,replace_all:B}=A;return mpH.default.createElement(Nb,{toolUseConfirm:H.toolUseConfirm,toolUseContext:H.toolUseContext,onDone:H.onDone,onReject:H.onReject,workerBadge:H.workerBadge,title:"Edit file",subtitle:psD.relative(C$(),L),question:mpH.default.createElement(V,null,"Do you want to make this edit to"," ",mpH.default.createElement(V,{bold:!0},msD.basename(L)),"?"),content:mpH.default.createElement(XN$,{file_path:L,edits:[{old_string:I,new_string:D,replace_all:B||!1}]}),path:L,completionType:"str_replace_single",languageName:Ie(L),parseInput:$,ideDiffSupport:Bq1})}var msD,mpH,psD,Bq1;var csD=K(()=>{xH();T9H();bkA();rD();gPH();PI();msD=require("path"),mpH=b(s(),1),psD=require("path"),Bq1={getConfig:(H)=>FN$(H.file_path,H.old_string,H.new_string,H.replace_all),applyChanges:(H,$)=>{let A=$[0];if(A)return{...H,old_string:A.old_string,new_string:A.new_string,replace_all:A.replace_all};return H}}});function Ue(H,{assistantMessage:{message:{id:$}}},A,L){pX({completion_type:H,event:A,metadata:{language_name:"none",message_id:$,platform:OA.platform,hasFeedback:L??!1}})}var mkA=K(()=>{Z1();Q8H()});function fq1(H){switch(H.length){case 0:return"";case 1:return hG.default.createElement(V,{bold:!0},H[0]);case 2:return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},H[0])," and ",hG.default.createElement(V,{bold:!0},H[1]));default:return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},H.slice(0,-1).join(", ")),", and"," ",hG.default.createElement(V,{bold:!0},H.slice(-1)[0]))}}function pkA(H){if(H.join(", ").length>50)return"similar";return fq1(H)}function ppH(H){if(H.length===0)return"";let $=H.map((A)=>A.split("/").pop()||A);if($.length===1)return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},$[0]),Xe.sep);if($.length===2)return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},$[0]),Xe.sep," and ",hG.default.createElement(V,{bold:!0},$[1]),Xe.sep);return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},$[0]),Xe.sep,", ",hG.default.createElement(V,{bold:!0},$[1]),Xe.sep," and ",H.length-2," more")}function Eq1(H){let $=H.filter((G)=>G.type==="addRules").flatMap((G)=>G.rules||[]),A=$.filter((G)=>G.toolName==="Read"),L=$.filter((G)=>G.toolName==="Bash"),I=H.filter((G)=>G.type==="addDirectories").flatMap((G)=>G.directories||[]),D=A.map((G)=>G.ruleContent?.replace("/**","")||"").filter((G)=>G),B=[...new Set(L.flatMap((G)=>{if(!G.ruleContent)return[];let U=PbA(G.ruleContent)??G.ruleContent,{commandWithoutRedirections:X,redirections:J}=Wj(U);return J.length>0?X:U}))],f=I.length>0,E=D.length>0,M=B.length>0;if(E&&!f&&!M){if(D.length===1){let G=D[0],U=G.split("/").pop()||G;return hG.default.createElement(V,null,"Yes, allow reading from ",hG.default.createElement(V,{bold:!0},U),Xe.sep," from this project")}return hG.default.createElement(V,null,"Yes, allow reading from ",ppH(D)," from this project")}if(f&&!E&&!M){if(I.length===1){let G=I[0],U=G.split("/").pop()||G;return hG.default.createElement(V,null,"Yes, and always allow access to ",hG.default.createElement(V,{bold:!0},U),Xe.sep," from this project")}return hG.default.createElement(V,null,"Yes, and always allow access to ",ppH(I)," from this project")}if(M&&!f&&!E)return hG.default.createElement(V,null,"Yes, and don't ask again for ",pkA(B)," commands in"," ",hG.default.createElement(V,{bold:!0},zL()));if((f||E)&&!M){let G=[...I,...D];if(f&&E)return hG.default.createElement(V,null,"Yes, and always allow access to ",ppH(G)," from this project")}if((f||E)&&M){let G=[...I,...D];if(G.length===1&&B.length===1)return hG.default.createElement(V,null,"Yes, and allow access to ",ppH(G)," and"," ",pkA(B)," commands");return hG.default.createElement(V,null,"Yes, and allow ",ppH(G)," access and"," ",pkA(B)," commands")}return null}function lsD({suggestions:H=[],decisionReason:$,onRejectFeedbackChange:A,onAcceptFeedbackChange:L,onClassifierDescriptionChange:I,classifierDescription:D,initialClassifierDescriptionEmpty:B=!1,existingAllowDescriptions:f=[],yesInputMode:E=!1,noInputMode:M=!1}){let G=[];if(E)G.push({type:"input",label:"Yes",value:"yes",placeholder:"and tell Claude what to do next",onChange:L,allowEmptySubmitToCancel:!0});else G.push({label:"Yes",value:"yes"});if(sR()){if(H.length>0){let U=Eq1(H);if(U)G.push({label:U,value:"yes-apply-suggestions"})}}if(M)G.push({type:"input",label:"No",value:"no",placeholder:"and tell Claude what to do differently",onChange:A,allowEmptySubmitToCancel:!0});else G.push({label:"No",value:"no"});return G}var hG,Xe;var isD=K(()=>{xH();g$();Rh();g3();_q();hG=b(s(),1),Xe=b(require("path"))});function nsD(H){switch(H.type){case"rule":return`${oH.bold(X8(H.rule.ruleValue))} rule from ${utH(H.rule.source)}`;case"mode":return`${vk(H.mode)} mode`;case"sandboxOverride":return"Requires permission to bypass sandbox";case"workingDir":return H.reason;case"other":return H.reason;case"permissionPromptTool":return`${oH.bold(H.permissionPromptToolName)} permission prompt tool`;case"hook":return H.reason?`${oH.bold(H.hookName)} hook: ${H.reason}`:`${oH.bold(H.hookName)} hook`;case"asyncAgent":return H.reason}}function Mq1({title:H,decisionReason:$}){let[A]=_I();function L(){switch($.type){case"subcommandResults":return JB.default.createElement(x,{flexDirection:"column"},Array.from($.reasons.entries()).map(([I,D])=>{let B=D.behavior==="allow"?ZL("success",A)(pH.tick):ZL("error",A)(pH.cross);return JB.default.createElement(x,{flexDirection:"column",key:I},JB.default.createElement(V,null,B," ",I),D.decisionReason!==void 0&&D.decisionReason.type!=="subcommandResults"&&JB.default.createElement(V,null," ","\u23BF"," ",JB.default.createElement(m9,null,nsD(D.decisionReason))),D.behavior==="ask"&&(()=>{let f=jAH(D.suggestions);return f.length>0?JB.default.createElement(V,null," ","\u23BF"," ","Suggested rules:"," ",JB.default.createElement(m9,null,f.map((E)=>oH.bold(X8(E))).join(", "))):null})())}));default:return JB.default.createElement(V,null,JB.default.createElement(m9,null,nsD($)))}}return JB.default.createElement(x,{flexDirection:"column"},H&&JB.default.createElement(V,null,H),L())}function Gq1(H){if(!H)return[];return H.flatMap(($)=>{switch($.type){case"addDirectories":return $.directories;default:return[]}})}function Uq1(H){if(!H)return;for(let $=H.length-1;$>=0;$--){let A=H[$];if(A?.type==="setMode")return A.mode}return}function Xq1({suggestions:H,width:$}){if(!H||H.length===0)return JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0},"Suggestions ")),JB.default.createElement(V,null,"None"));let A=jAH(H),L=Gq1(H),I=Uq1(H);if(A.length===0&&L.length===0&&!I)return JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0},"Suggestion ")),JB.default.createElement(V,null,"None"));return JB.default.createElement(x,{flexDirection:"column"},JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0},"Suggestions ")),JB.default.createElement(V,null," ")),A.length>0&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0}," Rules ")),JB.default.createElement(x,{flexDirection:"column"},A.map((D,B)=>JB.default.createElement(V,{key:B},pH.bullet," ",X8(D))))),L.length>0&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0}," Directories ")),JB.default.createElement(x,{flexDirection:"column"},L.map((D,B)=>JB.default.createElement(V,{key:B},pH.bullet," ",D)))),I&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0}," Mode ")),JB.default.createElement(V,null,vk(I))))}function asD({permissionResult:H,toolName:$}){let A=J$((f)=>f.toolPermissionContext),L=H.decisionReason,I="suggestions"in H?H.suggestions:void 0,D=rsD.useMemo(()=>{let f=vL.isSandboxingEnabled()&&vL.isAutoAllowBashIfSandboxedEnabled(),E=XFH(A,{sandboxAutoAllowEnabled:f}),M=jAH(I);if(M.length>0)return E.filter((G)=>M.some((U)=>U.toolName===G.rule.ruleValue.toolName&&U.ruleContent===G.rule.ruleValue.ruleContent));if($)return E.filter((G)=>G.rule.ruleValue.toolName===$);return E},[A,$,I]),B=10;return JB.default.createElement(x,{flexDirection:"column"},JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:10},JB.default.createElement(V,{dimColor:!0},"Behavior ")),JB.default.createElement(V,null,H.behavior)),H.behavior!=="allow"&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:10},JB.default.createElement(V,{dimColor:!0},"Message ")),JB.default.createElement(V,null,H.message)),JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:10},JB.default.createElement(V,{dimColor:!0},"Reason ")),L===void 0?JB.default.createElement(V,null,"undefined"):JB.default.createElement(Mq1,{decisionReason:L})),JB.default.createElement(Xq1,{suggestions:I,width:10}),D.length>0&&JB.default.createElement(x,{flexDirection:"column",marginTop:1},JB.default.createElement(V,{color:"warning"},pH.warning," Unreachable Rules (",D.length,")"),D.map((f,E)=>JB.default.createElement(x,{key:E,flexDirection:"column",marginLeft:2},JB.default.createElement(V,{color:"warning"},X8(f.rule.ruleValue)),JB.default.createElement(V,{dimColor:!0}," ",f.reason),JB.default.createElement(V,{dimColor:!0}," ","Fix: ",f.fix)))))}var JB,rsD;var osD=K(()=>{xH();r0();jI();yW();C5();W4();pL();Z4$();EM();JB=b(s(),1),rsD=b(s(),1)});function Jq1(H,$){if(!H)return null;switch(H.type){case"rule":return{reasonString:`Permission rule ${oH.bold(X8(H.rule.ruleValue))} requires confirmation for this ${$}.`,configString:H.rule.source==="policySettings"?void 0:"/permissions to update rules"};case"hook":{let A=H.reason?`: `)[0]??null,fileContent:M})),(X)=>B4.createElement(V,{dimColor:!0,key:`ellipsis-${X}`},"...")):B4.createElement(IC,{code:A,filePath:L==="markdown"?"file.md":H})))}var B4,rpH,PeD;var YeD=K(()=>{Zt();xH();PI();q9H();tg();rD();nM();DL();lY$();B4=b(s(),1),rpH=b(s(),1),PeD=require("path")});function weD(H){let $=(E)=>{let M=up.inputSchema.safeParse(E);if(!M.success)return r(Error(`Failed to parse notebook edit input: ${M.error.message}`)),{notebook_path:"",new_source:"",cell_id:""};return M.data},A=$(H.toolUseConfirm.input),{notebook_path:L,edit_mode:I,cell_type:D}=A,B=D==="markdown"?"markdown":"python",f=I==="insert"?"insert this cell into":I==="delete"?"delete this cell from":"make this edit to";return apH.default.createElement(Nb,{toolUseConfirm:H.toolUseConfirm,toolUseContext:H.toolUseContext,onDone:H.onDone,onReject:H.onReject,workerBadge:H.workerBadge,title:"Edit notebook",question:apH.default.createElement(V,null,"Do you want to ",f," ",apH.default.createElement(V,{bold:!0},CeD.basename(L)),"?"),content:apH.default.createElement(_eD,{notebook_path:A.notebook_path,cell_id:A.cell_id,new_source:A.new_source,cell_type:A.cell_type,edit_mode:A.edit_mode,verbose:H.verbose,width:H.verbose?120:80}),path:L,completionType:"tool_use_single",languageName:B,parseInput:$})}var CeD,apH;var ZeD=K(()=>{xH();hkH();YeD();gPH();_$();CeD=require("path"),apH=b(s(),1)});function YN$(H="claude-prompt",$=".md"){let A=zeD.randomUUID();return qeD.join(TeD.tmpdir(),`${H}-${A}${$}`)}var qeD,TeD,zeD;var rkA=K(()=>{qeD=require("path"),TeD=require("os"),zeD=require("crypto")});function kq1(H){let $=H.split(" ")[0]??"";return bq1.some((A)=>$.includes(A))}function akA(H){let $=zH(),A=qO.get(process.stdout);if(!A)throw Error("Ink instance not found - cannot pause rendering");let L=Bj();if(!L)return{content:null};if(!$.existsSync(H))return{content:null};let I=!kq1(L);try{if(A.pause(),A.suspendStdin(),I)process.stdout.write("\x1B[?1049h\x1B[?1004l\x1B[0m\x1B[?25h\x1B[2J\x1B[H");let D=hq1[L]??L;return SN(`${D} "${H}"`,{stdio:"inherit"}),{content:$.readFileSync(H,{encoding:"utf-8"})}}catch(D){if(typeof D==="object"&&D!==null&&"status"in D&&typeof D.status==="number"){let B=D.status;if(B!==0)return{content:null,error:`${PX(L)} exited with code ${B}`}}return{content:null}}finally{if(I)process.stdout.write("\x1B[?1049l\x1B[?1004h\x1B[?25l");A.resumeStdin(),A.resume()}}function uq1(H,$){let A=IFH(H),L=H;for(let I=A.length-1;I>=0;I--){let D=A[I],B=$[D.id];if(B&&B.type==="text"){let f=L.lastIndexOf(D.match);if(f!==-1)L=L.slice(0,f)+B.content+L.slice(f+D.match.length)}}return L}function gq1(H,$,A){let L=H;for(let[I,D]of Object.entries(A))if(D.type==="text"){let B=parseInt(I),f=D.content,E=L.indexOf(f);if(E!==-1){let M=LFH(f),G=D4$(B,M);L=L.slice(0,E)+G+L.slice(E+f.length)}}return L}function dPH(H,$){let A=zH(),L=YN$();try{let I=$?uq1(H,$):H;iL(L,I,{encoding:"utf-8",flush:!0});let D=akA(L);if(D.content===null)return D;let B=D.content;if(B.endsWith(` `)}`;if(D)c("tengu_ask_user_question_respond_to_claude",{source:D,questionCount:I.length,isInPlanMode:J,interviewPhaseEnabled:J&&c5()});let QH=await ekA(U);$(),H.onReject(wH,QH&&QH.length>0?QH:void 0)},[I,P,$,H,D,J,U]),n=qj.useCallback(async()=>{let wH=`The user has indicated they have provided enough answers for the plan interview. `)}`;if(D)c("tengu_ask_user_question_finish_plan_interview",{source:D,questionCount:I.length,isInPlanMode:J,interviewPhaseEnabled:J&&c5()});let QH=await ekA(U);$(),H.onReject(wH,QH&&QH.length>0?QH:void 0)},[I,P,$,H,D,J,U]),GH=qj.useCallback(async(WH)=>{if(D)c("tengu_ask_user_question_accepted",{source:D,questionCount:I.length,answerCount:Object.keys(WH).length,isInPlanMode:J,interviewPhaseEnabled:J&&c5()});let wH={...H.input,answers:WH},QH=await ekA(U);$(),H.onAllow(wH,[],void 0,QH&&QH.length>0?QH:void 0)},[H,$,D,I.length,J,U]),HH=qj.useCallback((WH,wH,QH,TH=!0)=>{let t,IH=Array.isArray(wH);if(IH)t=wH.join(", ");else if(QH)t=Object.values(B[WH]??{}).filter((CH)=>CH.type==="image").length>0?`${QH} (Image attached)`:QH;else if(wH==="__other__")t=Object.values(B[WH]??{}).filter((CH)=>CH.type==="image").length>0?"(Image attached)":wH;else t=wH;let KH=I.length===1;if(!IH&&KH&&TH){let MH={...P,[WH]:t};GH(MH).catch(r);return}j(WH,t,TH)},[j,I.length,P,GH,B]);function BH(WH){if(WH==="cancel"){d();return}if(WH==="submit")GH(P).catch(r)}if(WL((WH,wH)=>{if(Y&&!g)return;if((wH.leftArrow||wH.shift&&wH.tab)&&W>0)q();let QH=p?(I?.length||1)-1:I?.length||0;if((wH.rightArrow||wH.tab&&!wH.shift)&&WM(y.question,WH,wH,QH,TH,t),pastedContents:B[y.question]??{},onRemoveImage:(WH)=>G(y.question,WH)});if(g)return HuA.default.createElement(keD,{questions:I,currentQuestionIndex:W,answers:P,allQuestionsAnswered:h,permissionResult:H.permissionResult,onFinalResponse:BH});return null}async function ekA(H){if(H.length===0)return;return Promise.all(H.map(async($)=>{let A={type:"image",source:{type:"base64",media_type:$.mediaType||"image/png",data:$.content}};return(await HDH(A)).block}))}var HuA,qj;var meD=K(()=>{xH();bC$();yeD();beD();ueD();z$();pL();gQ();b9H();LT();gr();_$();HuA=b(s(),1),qj=b(s(),1)});function cq1(H){switch(H){case S3:return dsD;case h3:return JeD;case aD:return feD;case IW:return WeD;case up:return weD;case DW:return NeD;case MuH:return OeD;case Xt:return SeD;case hC$:return geD;case rr:case og:case k8:return KeD;default:return WN$}}function lq1(H){let $=H.tool.userFacingName(H.input);if(H.tool===DW)return"Claude Code needs your approval for the plan";if(H.tool===MuH)return"Claude Code wants to enter plan mode";if(!$||$.trim()==="")return"Claude Code needs your attention";return`Claude needs your permission to use ${$}`}function peD({toolUseConfirm:H,toolUseContext:$,onDone:A,onReject:L,verbose:I,workerBadge:D}){BA("app:interrupt",()=>{A(),L(),H.onReject()},{context:"Confirmation"});let B=lq1(H);VN$(B,"permission_prompt");let f=cq1(H.tool);return $uA.createElement(f,{toolUseContext:$,toolUseConfirm:H,onDone:A,onReject:L,verbose:I,workerBadge:D})}var $uA;var deD=K(()=>{$I();T9H();ht();zQ();csD();EeD();ckA();ikA();FeD();QeD();hkH();aSH();xFH();bw();s6H();VeD();ZeD();BuH();tkA();azA();xeD();XY$();jeD();bC$();meD();$uA=b(s(),1)});function ZN$(H){if("oneOf"in H)return H.oneOf.map(($)=>$.const);if("enum"in H)return H.enum;return[]}function AuA(H){if("oneOf"in H)return H.oneOf.map(($)=>$.title);if("enum"in H)return("enumNames"in H?H.enumNames:void 0)??H.enum;return[]}function ceD(H,$){let A=ZN$(H).indexOf($);return A>=0?AuA(H)[A]??$:$}function nq1(H){if(cPH(H)){let[$,...A]=ZN$(H);if(!$)return S.never();return S.enum([$,...A])}if(H.type==="string"){let $=S.string();if(H.minLength!==void 0)$=$.min(H.minLength,{message:`Must be at least ${H.minLength} character${H.minLength===1?"":"s"}`});if(H.maxLength!==void 0)$=$.max(H.maxLength,{message:`Must be at most ${H.maxLength} character${H.maxLength===1?"":"s"}`});switch(H.format){case"email":$=$.email({message:"Please enter a valid email address"});break;case"uri":$=$.url({message:"Please enter a valid URI"});break;case"date":$=$.date("Please enter a valid date (YYYY-MM-DD)");break;case"date-time":$=$.datetime({offset:!0,message:"Please enter a valid date-time (YYYY-MM-DDTHH:MM:SSZ)"});break;default:break}return $}if(H.type==="number"||H.type==="integer"){let $=S.coerce.number();if(H.type==="integer")$=$.int();if(H.minimum!==void 0)$=$.min(H.minimum,{message:`Must be at least ${H.minimum}`});if(H.maximum!==void 0)$=$.max(H.maximum,{message:`Must be at most ${H.maximum}`});return $}if(H.type==="boolean")return S.coerce.boolean();throw Error(`Unsupported schema: ${yH(H)}`)}function LuA(H,$){let L=nq1($).safeParse(H);if(L.success)return{value:L.data,isValid:!0};return{isValid:!1,error:L.error.issues.map((I)=>I.message).join("; ")}}function leD(H){if(H.type==="string"){if(!rq1(H))return;let{description:$,example:A}=iq1[H.format]||{};return`${$}, e.g. ${A}`}if(H.type==="number"||H.type==="integer"){let $=H.type==="integer",A=(L)=>Number.isInteger(L)&&!$?`${L}.0`:String(L);if(H.minimum!==void 0&&H.maximum!==void 0)return`(${H.type} between ${A(H.minimum)} and ${A(H.maximum)})`;else if(H.minimum!==void 0)return`(${H.type} >= ${A(H.minimum)})`;else if(H.maximum!==void 0)return`(${H.type} <= ${A(H.maximum)})`;else{let L=H.type==="integer"?"42":"3.14";return`(${H.type}, e.g. ${L})`}}return}var iq1,cPH=(H)=>{return H.type==="string"&&(("enum"in H)||("oneOf"in H))},rq1=(H)=>{return H.type==="string"&&"format"in H&&typeof H.format==="string"};var ieD=K(()=>{mI();Z$();iq1={email:{description:"email address",example:"user@example.com"},uri:{description:"URI",example:"https://example.com"},date:{description:"date",example:"2024-03-15"},"date-time":{description:"date-time",example:"2024-03-15T14:30:00Z"}}});function qN$(){return Y9.default.createElement(V,{italic:!0,dimColor:!0},"")}function reD({serverName:H,request:$,onResponse:A,signal:L}){let{message:I,requestedSchema:D}=$,[B,f]=dz.useState(null),[E,M]=dz.useState(()=>{let QH={};if(D.properties){for(let[TH,t]of Object.entries(D.properties))if(typeof t==="object"&&t!==null){if(t.default!==void 0)QH[TH]=t.default}}return QH}),[G,U]=dz.useState(()=>{let QH={};for(let[TH,t]of Object.entries(D.properties))if(neD(t)&&t?.default!==void 0){let IH=LuA(String(t.default),t);if(!IH.isValid&&IH.error)QH[TH]=IH.error}return QH});dz.useEffect(()=>{if(!L)return;let QH=()=>{A("cancel")};if(L.aborted){QH();return}return L.addEventListener("abort",QH),()=>{L.removeEventListener("abort",QH)}},[L,A]);let X=dz.useMemo(()=>{let QH=D.required??[];return Object.entries(D.properties).map(([TH,t])=>({name:TH,schema:t,isRequired:QH.includes(TH)}))},[D]),[J,F]=dz.useState(0),[Q,W]=dz.useState(),[P,C]=dz.useState(""),[Y,Z]=dz.useState(0),{columns:q}=QL(),O=J!==void 0?X[J]:void 0,j=O&&neD(O.schema);FY("elicitation"),VN$("Claude Code needs your input","elicitation_dialog");function u(QH){let TH=X.length+2,t=J??(B==="accept"?X.length:B==="decline"?X.length+1:void 0),IH=t!==void 0?(t+(QH==="up"?TH-1:1))%TH:0;if(IH{let IH={...t};if(TH===void 0)delete IH[QH];else IH[QH]=TH;return IH})}function g(QH,TH){U((t)=>{let IH={...t};if(TH)IH[QH]=TH;else delete IH[QH];return IH})}function h(QH){if(!QH)return;y(QH,void 0),g(QH),W(void 0),C(""),Z(0)}function p(QH){if(!O)return;if(QH.trim()===""&&(O.schema.type!=="string"||("format"in O.schema)&&O.schema.format!==void 0)){h(O.name),u("down");return}let t=LuA(QH,O.schema);y(O.name,t.isValid?t.value:QH),g(O.name,t.isValid?void 0:t.error),W(void 0),C(""),Z(0),u("down")}function d(){if(!O)return;W(void 0),C(""),Z(0)}let k=O!==void 0&&Q===O.name,n=k&&j&&!cPH(O?.schema);BA("confirm:no",()=>{d()},{context:"Settings",isActive:n}),WL((QH,TH)=>{if(k&&cPH(O?.schema))return;if(k&&j)return;if(TH.return&&B==="accept"){if(GH()&&Object.keys(G).length===0)A("accept",E);return}if(TH.return&&B==="decline"){A("decline");return}if(TH.upArrow||TH.downArrow){u(TH.upArrow?"up":"down");return}if(O){let{schema:t,name:IH,isRequired:KH}=O,MH=E[IH];if(TH.backspace&&!KH){h(O.name);return}if(TH.return){if(t.type==="boolean"){y(IH,!(MH??!1)),u("down");return}if(W(IH),j){let CH=MH!==void 0?String(MH):"";C(CH),Z(CH.length)}}}},{isActive:!0});let GH=()=>{let QH=D.required||[];for(let TH of QH){let t=E[TH];if(t===void 0||t===null||t==="")return!1}return!0},HH=()=>{if(!X.length)return null;return Y9.default.createElement(x,{flexDirection:"column",gap:1},X.map((QH,TH)=>{let{name:t,schema:IH,isRequired:KH}=QH,MH=TH===J&&!B,CH=E[t],OH=(()=>{if(!MH||Q!==void 0)return null;let e=IH.type==="boolean"?"toggle":cPH(IH)?"select":"edit",DH=CH===void 0||KH?`(Press Enter to ${e})`:`(Press Enter to ${e}, Backspace to unset)`;return Y9.default.createElement(V,{dimColor:!0}," ",DH)})(),LH=(e,DH)=>{return Y9.default.createElement(x,{key:t,flexDirection:"column"},Y9.default.createElement(x,{gap:1,paddingLeft:MH?0:2},MH&&Y9.default.createElement(V,{color:"success"},pH.pointer),Y9.default.createElement(x,{flexGrow:1,flexDirection:"column"},e,IH.description&&Y9.default.createElement(x,{marginLeft:2},Y9.default.createElement(V,{dimColor:!0},IH.description)),DH&&Y9.default.createElement(x,{marginLeft:2},Y9.default.createElement(V,{color:"error",bold:!0},pH.warning," ",DH)))))};if(cPH(IH)){let e=ZN$(IH),DH=AuA(IH),EH=e.map(($H,FH)=>({label:DH[FH]??$H,value:$H}));if(MH&&Q===t)return Y9.default.createElement(x,{key:t,flexDirection:"column"},Y9.default.createElement(V,{color:"success"},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),IH.description&&Y9.default.createElement(V,{dimColor:!0}," - ",IH.description)),Y9.default.createElement(QA,{options:EH,defaultValue:CH!==void 0?CH:IH.default??e[0],onChange:($H)=>{y(t,$H),W(void 0),u("down")},onCancel:()=>{W(void 0)}}));else{let $H=CH!==void 0?ceD(IH,CH):Y9.default.createElement(qN$,null);return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),": ",$H,OH))}}else if(IH.type==="boolean")return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":"," ",CH!==void 0?CH?`${pH.tick} Yes`:`${pH.cross} No`:Y9.default.createElement(qN$,null),OH));else if(j){let e=G[t];if(MH&&Q===t){let DH=leD(IH);return LH(Y9.default.createElement(x,{flexDirection:"column"},Y9.default.createElement(V,{color:"success"},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":",DH&&Y9.default.createElement(V,{dimColor:!0},` ${DH}`)),Y9.default.createElement(x,{marginLeft:2},Y9.default.createElement(W9,{value:P,onChange:C,onSubmit:p,onExit:d,placeholder:`Enter ${IH.type}\u2026`,columns:Math.min(q-6,80),cursorOffset:Y,onChangeCursorOffset:Z,focus:!0,showCursor:!0,multiline:IH.type==="string"}))))}return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":"," ",CH===void 0?Y9.default.createElement(qN$,null):String(CH),OH),e)}else return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":"," ",CH===void 0?Y9.default.createElement(qN$,null):String(CH),OH))}))},BH=(QH)=>{return D.properties[QH]?.title??QH},WH=Object.keys(G),wH=(D.required||[]).filter((QH)=>E[QH]===void 0);return Y9.default.createElement(BL,{title:`MCP Server "${H}" requests your input`,subtitle:I,color:"permission",onCancel:()=>A("cancel"),isCancelActive:!n,hideInputGuide:!0},HH(),X.length>0&&Y9.default.createElement(x,{flexDirection:"column",gap:1},wH.length>0&&Y9.default.createElement(V,{color:"error"},pH.warning," Missing required fields:"," ",wH.map(BH).join(", ")),WH.length>0&&Y9.default.createElement(V,{color:"error"},pH.warning," Validation errors in:"," ",WH.map(BH).join(", ")),Y9.default.createElement(V,{bold:!0,color:B==="accept"?"success":void 0,inverse:B==="accept"},"Accept"),Y9.default.createElement(V,{bold:!0,color:B==="decline"?"error":void 0,inverse:B==="decline"},"Decline"),Y9.default.createElement(V,{dimColor:!0},Y9.default.createElement(rA,null,Y9.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),Y9.default.createElement(s$,{shortcut:"Enter",action:"edit"}),Y9.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel / go back"})))))}var Y9,dz,neD=(H)=>["string","number","integer"].includes(H.type);var aeD=K(()=>{xH();$I();jI();ikA();N1();eB();bB();lB();j0();ieD();S5();OB();Dx();Y9=b(s(),1),dz=b(s(),1)});function oeD(H){return`${lPH.major(H,{loose:!0})}.${lPH.minor(H,{loose:!0})}.${lPH.patch(H,{loose:!0})}`}function TN$(H,$={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION){let[A,L]=teD.useState(()=>oeD($));if(!H)return null;let I=oeD(H);if(I!==A)return L(I),I;return null}var teD,lPH;var IuA=K(()=>{teD=b(s(),1),lPH=b(OO(),1)});function eeD({isUpdating:H,onChangeIsUpdating:$,onAutoUpdaterResult:A,autoUpdaterResult:L,showSuccessMessage:I,verbose:D}){let[B,f]=zN$.useState({}),E=TN$(L?.version),M=_f.useCallback(async()=>{if(H)return;let G={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,U=GB()?.autoUpdatesChannel??"latest",X=await Q1H(U),J=Nd();if(f({global:G,latest:X}),!J&&G&&X&&!seD.gte(G,X,{loose:!0})&&!JVH(X)){let F=Date.now();$(!0);let Q=M$();if(Q.installMethod!=="native")await ggH();let W=await Lb();if(N(`AutoUpdater: Detected installation type: ${W}`),W==="development"){N("AutoUpdater: Cannot auto-update development build"),$(!1);return}let P,C;if(W==="npm-local")N("AutoUpdater: Using local update method"),C="local",P=await jgH(U);else if(W==="npm-global")N("AutoUpdater: Using global update method"),C="global",P=await vgH();else if(W==="native"){N("AutoUpdater: Unexpected native installation in non-native updater"),$(!1);return}else{N("AutoUpdater: Unknown installation type, falling back to config");let Y=Q.installMethod==="local";if(C=Y?"local":"global",Y)P=await jgH(U);else P=await vgH()}if($(!1),P==="success")c("tengu_auto_updater_success",{fromVersion:G,toVersion:X,durationMs:Date.now()-F,wasMigrated:C==="local",installationType:W});else c("tengu_auto_updater_fail",{fromVersion:G,attemptedVersion:X,status:P,durationMs:Date.now()-F,wasMigrated:C==="local",installationType:W});A({version:X,status:P})}},[A]);if(zN$.useEffect(()=>{M()},[M]),VF(M,1800000),!L?.version&&(!B.global||!B.latest))return null;if(!L?.version&&!H)return null;return _f.createElement(x,{flexDirection:"row",gap:1},D&&_f.createElement(V,{dimColor:!0},"globalVersion: ",B.global," \xB7 latestVersion:"," ",B.latest),H?_f.createElement(_f.Fragment,null,_f.createElement(x,null,_f.createElement(V,{color:"text",dimColor:!0,wrap:"end"},"Auto-updating\u2026"))):L?.status==="success"&&I&&E&&_f.createElement(V,{color:"success"},"\u2713 Update installed \xB7 Restart to apply"),(L?.status==="install_failed"||L?.status==="no_permissions")&&_f.createElement(V,{color:"error"},"\u2717 Auto-update failed \xB7 Try ",_f.createElement(V,{bold:!0},"claude doctor"),!Ms()&&_f.createElement(_f.Fragment,null," ","or ",_f.createElement(V,{bold:!0},"npm i -g ",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL)),Ms()&&_f.createElement(_f.Fragment,null," ","or"," ",_f.createElement(V,{bold:!0},"cd ~/.claude/local && npm update ",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL))))}var _f,seD,zN$;var HHB=K(()=>{xH();vA();Us();F1H();Lj();s6();z$();IuA();Ib();E$();mL();_f=b(s(),1),seD=b(OO(),1),zN$=b(s(),1)});function aq1(H){if(H.includes("timeout"))return"timeout";if(H.includes("Checksum mismatch"))return"checksum_mismatch";if(H.includes("ENOENT")||H.includes("not found"))return"not_found";if(H.includes("EACCES")||H.includes("permission"))return"permission_denied";if(H.includes("ENOSPC"))return"disk_full";if(H.includes("npm"))return"npm_error";if(H.includes("network")||H.includes("ECONNREFUSED")||H.includes("ENOTFOUND"))return"network_error";return"unknown"}function $HB({isUpdating:H,onChangeIsUpdating:$,onAutoUpdaterResult:A,autoUpdaterResult:L,showSuccessMessage:I,verbose:D}){let[B,f]=NN$.useState({}),E=TN$(L?.version),M=cK.useRef(!1),G=GB()?.autoUpdatesChannel??"latest",U=cK.useCallback(async()=>{if(H||Nd())return;$(!0);let X=Date.now();c("tengu_native_auto_updater_start",{});try{let J=await fd(G),F={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,Q=Date.now()-X;if(J.lockFailed){c("tengu_native_auto_updater_lock_contention",{latency_ms:Q});return}if(f({current:F,latest:J.latestVersion}),J.wasUpdated)c("tengu_native_auto_updater_success",{latency_ms:Q}),A({version:J.latestVersion,status:"success"});else c("tengu_native_auto_updater_up_to_date",{latency_ms:Q})}catch(J){let F=Date.now()-X,Q=J instanceof Error?J.message:String(J);r(J instanceof Error?J:Error(String(J)));let W=aq1(Q);c("tengu_native_auto_updater_fail",{latency_ms:F,error_timeout:W==="timeout",error_checksum:W==="checksum_mismatch",error_not_found:W==="not_found",error_permission:W==="permission_denied",error_disk_full:W==="disk_full",error_npm:W==="npm_error",error_network:W==="network_error"}),A({version:null,status:"install_failed"})}finally{$(!1)}},[H,$,A]);if(NN$.useEffect(()=>{if(!M.current)M.current=!0,U()}),VF(U,1800000),!L?.version&&(!B.current||!B.latest))return null;if(!L?.version&&!H)return null;return cK.createElement(x,{flexDirection:"row",gap:1},D&&cK.createElement(V,{dimColor:!0},"current: ",B.current," \xB7 ",G,": ",B.latest),H?cK.createElement(x,null,cK.createElement(V,{dimColor:!0,wrap:"end"},"Checking for updates")):L?.status==="success"&&I&&E&&cK.createElement(V,{color:"success"},"\u2713 Update installed \xB7 Restart to update"),L?.status==="install_failed"&&cK.createElement(V,{color:"error"},"\u2717 Auto-update failed \xB7 Try ",cK.createElement(V,{bold:!0},"/status")))}var cK,NN$;var AHB=K(()=>{xH();vA();Lj();s6();z$();_$();IuA();mL();cK=b(s(),1),NN$=b(s(),1)});function IHB({verbose:H}){let[$,A]=DuA.useState(!1),[L,I]=DuA.useState("unknown"),D=o3.useCallback(async()=>{if(Nd())return;let[f,E]=await Promise.all([Promise.resolve(GB()?.autoUpdatesChannel??"latest"),FVH()]);I(E);let M=await tZ$(f),G=M&&!LHB.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,M,{loose:!0})&&!JVH(M);if(A(!!G),G)N(`PackageManagerAutoUpdater: Update available ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} -> ${M}`)},[]);if(o3.useEffect(()=>{D()},[D]),VF(D,1800000),!$)return null;let B=L==="homebrew"?"brew upgrade claude-code":L==="winget"?"winget upgrade Anthropic.ClaudeCode":L==="apk"?"apk upgrade claude-code":"your package manager update command";return o3.createElement(o3.Fragment,null,H&&o3.createElement(V,{dimColor:!0},"currentVersion: ",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION),o3.createElement(V,{color:"warning"},"Update available! Run: ",o3.createElement(V,{bold:!0},B)))}var o3,LHB,DuA;var DHB=K(()=>{xH();Us();s6();E$();Lq$();vA();mL();o3=b(s(),1),LHB=b(OO(),1),DuA=b(s(),1)});async function ON$(){let H=process.argv.includes("-p")||process.argv.includes("--print");if(!await HkA("auto_migrate_to_native",!1))return!1;if(A$(!1)||!1||H||A$(process.env.DISABLE_AUTO_MIGRATE_TO_NATIVE))return!1;if(M$().installMethod==="native")return!1;return!0}async function BHB(){c("tengu_auto_migrate_to_native_attempt",{});try{let H=GB()?.autoUpdatesChannel??"latest",$=await fd(H),A=[];if($.latestVersion){c("tengu_auto_migrate_to_native_success",{}),N("\u2705 Upgraded to native installation. Future sessions will use the native version.");let{removed:I,errors:D,warnings:B}=await pgH(),f=[];if(D.length>0)D.forEach((G)=>{f.push({message:G,userActionRequired:!1,type:"error"})});if(B.length>0)B.forEach((G)=>{f.push({message:G,userActionRequired:!1,type:"info"})});if(I>0)f.push({message:`Cleaned up ${I} old npm installation(s)`,userActionRequired:!1,type:"info"});let E=mgH();A=[...await Db(!0),...E,...f]}else c("tengu_auto_migrate_to_native_partial",{}),N("\u26A0\uFE0F Native installation setup encountered issues but cleanup completed."),A=await Db(!0);let L=[];if(A.length>0){let I=A.filter((D)=>D.userActionRequired);if(I.length>0){let D=["\u26A0\uFE0F Manual action required after migration to native installer:",...I.map((B)=>`\u2022 ${B.message}`)].join(` `)D.setOffset(F-1);$.current={mode:"NORMAL",command:{type:"idle"}},L("NORMAL"),B?.("NORMAL")},[B,D,H.value]);function M(J,F=!1){return{cursor:J,text:H.value,setText:(Q)=>H.onChange(Q),setOffset:(Q)=>D.setOffset(Q),enterInsert:(Q)=>f(Q),getRegister:()=>I.current.register,setRegister:(Q,W)=>{I.current.register=Q,I.current.registerIsLinewise=W},getLastFind:()=>I.current.lastFind,setLastFind:(Q,W)=>{I.current.lastFind={type:Q,char:W}},recordChange:F?()=>{}:(Q)=>{I.current.lastChange=Q}}}function G(){let J=I.current.lastChange;if(!J)return;let F=o0.fromText(H.value,H.columns,D.offset),Q=M(F,!0);switch(J.type){case"insert":if(J.text){let W=F.insert(J.text);H.onChange(W.text),D.setOffset(W.offset)}break;case"x":mN$(J.count,Q);break;case"replace":pN$(J.char,J.count,Q);break;case"toggleCase":dN$(J.count,Q);break;case"indent":lN$(J.dir,J.count,Q);break;case"join":cN$(J.count,Q);break;case"openLine":AdH(J.direction,Q);break;case"operator":aPH(J.op,J.motion,J.count,Q);break;case"operatorFind":uN$(J.op,J.find,J.char,J.count,Q);break;case"operatorTextObj":gN$(J.op,J.scope,J.objType,J.count,Q);break}}function U(J,F){let Q=o0.fromText(H.value,H.columns,D.offset),W=$.current;if(F.ctrl){D.onInput(J,F);return}if(F.escape&&W.mode==="INSERT"){E();return}if(F.return){D.onInput(J,F);return}if(W.mode==="INSERT"){if(F.backspace||F.delete){if(W.insertedText.length>0)$.current={mode:"INSERT",insertedText:W.insertedText.slice(0,-1)}}else $.current={mode:"INSERT",insertedText:W.insertedText+J};D.onInput(J,F);return}if(W.mode!=="NORMAL")return;if(W.command.type==="idle"&&(F.upArrow||F.downArrow||F.leftArrow||F.rightArrow)){D.onInput(J,F);return}let P={...M(Q,!1),onUndo:H.onUndo,onDotRepeat:G},C=J;if(F.leftArrow)C="h";else if(F.rightArrow)C="l";else if(F.upArrow)C="k";else if(F.downArrow)C="j";let Y=G$B(W.command,C,P);if(Y.execute)Y.execute();if($.current.mode==="NORMAL"){if(Y.next)$.current={mode:"NORMAL",command:Y.next};else if(Y.execute)$.current={mode:"NORMAL",command:{type:"idle"}}}if(J==="?"&&W.mode==="NORMAL"&&W.command.type==="idle")H.onChange("?")}let X=hd.useCallback((J)=>{if(J==="INSERT")$.current={mode:"INSERT",insertedText:""};else $.current={mode:"NORMAL",command:{type:"idle"}};L(J),B?.(J)},[B]);return{...D,onInput:U,mode:A,setMode:X}}var hd;var K$B=K(()=>{gSA();eJH();wuA();J$B();TuA();hd=b(s(),1)});function zuA(H){let[$]=_I(),A=EJ();NZ$(A,!!H.onImagePaste);let L=F$B({value:H.value,onChange:H.onChange,onSubmit:H.onSubmit,onExit:H.onExit,onExitMessage:H.onExitMessage,onHistoryReset:H.onHistoryReset,onHistoryUp:H.onHistoryUp,onHistoryDown:H.onHistoryDown,onClearInput:H.onClearInput,focus:H.focus,mask:H.mask,multiline:H.multiline,cursorChar:H.showCursor?" ":"",highlightPastedText:H.highlightPastedText,invert:A?oH.inverse:(B)=>B,themeText:ZL("text",$),columns:H.columns,onImagePaste:H.onImagePaste,disableCursorMovementForUpDownKeys:H.disableCursorMovementForUpDownKeys,externalOffset:H.cursorOffset,onOffsetChange:H.onChangeCursorOffset,onModeChange:H.onModeChange,isMessageLoading:H.isLoading,onUndo:H.onUndo}),{mode:I,setMode:D}=L;return nN$.default.useEffect(()=>{if(H.initialMode&&H.initialMode!==I)D(H.initialMode)},[H.initialMode,I,D]),nN$.default.createElement(x,{flexDirection:"column"},nN$.default.createElement(zZ$,{inputState:L,terminalFocus:A,highlights:H.highlights,...H}))}var nN$;var Q$B=K(()=>{xH();r0();K$B();mSA();cSA();nN$=b(s(),1)});function oPH(H,$){let A=dL()&&$&&tW($);switch(H.mode){case"default":return"acceptEdits";case"acceptEdits":return"plan";case"plan":if(A)return"delegate";if(H.isBypassPermissionsModeAvailable)return"bypassPermissions";return"default";case"delegate":if(H.isBypassPermissionsModeAvailable)return"bypassPermissions";return"default";case"bypassPermissions":return"default";case"dontAsk":return"default"}}function W$B(H,$){return{nextMode:oPH(H,$),context:H}}var NuA=K(()=>{T8();XE()});function V$B(H,$,A,L,I=!0){let D=H.length;if(D===0)return{startIndex:0,endIndex:0,showLeftArrow:!1,showRightArrow:!1};let B=Math.max(0,Math.min(L,D-1));if(H.reduce((J,F)=>J+F,0)<=$)return{startIndex:0,endIndex:D,showLeftArrow:!1,showRightArrow:!1};let E=[0];for(let J=0;J0)return Q-1;return Q}function G(J,F){let Q=$;if(J>0)Q-=A;if(F=U&&B0,showRightArrow:X=X){X=B+1,U=B;while(U>0&&M(U-1,X)<=G(U-1,X))U--}else{U=B,X=B+1;while(X0,showRightArrow:X{xH();w7();yT1=b(s(),1)});function OuA({tasksSelected:H,showHint:$,isViewingTeammate:A,teammateFooterIndex:L=0,isLeaderIdle:I=!1}){let{columns:D}=QL(),B=tPH.useMemo(()=>M$().hasSeenTasksHint,[]),f=J$((P)=>P.tasks),E=J$((P)=>P.viewingAgentTaskId),M=tPH.useMemo(()=>Object.values(f??{}).filter((P)=>Dz(P)&&!(v8()&&P.type==="local_agent")),[f]),U=J$((P)=>P.expandedView)==="teammates",X=!U&&M.length>0&&M.every((P)=>P.type==="in_process_teammate"),J=tPH.useMemo(()=>M.filter((P)=>P.type==="in_process_teammate").sort((P,C)=>P.identity.agentName.localeCompare(C.identity.agentName)),[M]),F=tPH.useMemo(()=>{let P={name:"main",color:void 0,isIdle:I},C=J.map((Z)=>({name:Z.identity.agentName,color:hT1(Z.identity.color),isIdle:Z.isIdle}));if(!H)C.sort((Z,q)=>{if(Z.isIdle!==q.isIdle)return Z.isIdle?1:-1;return 0});return[P,...C].map((Z,q)=>({...Z,idx:q}))},[J,I,H]),Q=tPH.useMemo(()=>F.map((P,C)=>{let Y=`@${P.name}`;return GI(Y)+(C>0?1:0)}),[F]);if(X||!U&&A){let P=H?L:-1,C=E?J.findIndex((d)=>d.id===E)+1:0,Y=$&&!B&&!H?uD.createElement(uD.Fragment,null,uD.createElement(V,{dimColor:!0}," \xB7 "),uD.createElement(V,{dimColor:!0},uD.createElement(s$,{shortcut:"\u2193",action:"view"}))):null,Z=2,q=Y?15:0,O=4,j=Math.max(20,D-q-4),{startIndex:u,endIndex:y,showLeftArrow:g,showRightArrow:h}=V$B(Q,j,2,P>=0?P:0),p=F.slice(u,y);return uD.createElement(uD.Fragment,null,g&&uD.createElement(V,{dimColor:!0},pH.arrowLeft," "),p.map((d,k)=>{let n=k>0;return uD.createElement(uD.Fragment,{key:d.name},n&&uD.createElement(V,null," "),uD.createElement(vT1,{name:d.name,color:d.color,isSelected:P===d.idx,isViewed:C===d.idx,isIdle:d.isIdle}))}),h&&uD.createElement(V,{dimColor:!0}," ",pH.arrowRight),Y,uD.createElement(V,{dimColor:!0}," \xB7 shift+\u2191 to expand"))}if(Qe(f??{},U))return null;let W=$&&(H||!B)?uD.createElement(uD.Fragment,null,uD.createElement(V,{dimColor:!0}," \xB7 "),uD.createElement(V,{dimColor:!0},H?uD.createElement(s$,{shortcut:"Enter",action:"view tasks"}):uD.createElement(s$,{shortcut:"\u2193",action:"view"}))):null;if(M.length===0)return null;if(M.length===1&&D>=150){let P=M[0],C=bT1(P);return uD.createElement(uD.Fragment,null,uD.createElement(V,{color:"background",inverse:H},e8(C,40,!0)," ",uD.createElement(V,{dimColor:!0},"(",P.status,")")),W)}if(M.length>=1){let P=kT1(M);return uD.createElement(uD.Fragment,null,uD.createElement(V,{color:"background",inverse:H},P),W)}return null}function vT1({name:H,color:$,isSelected:A,isViewed:L,isIdle:I}){if(A)return $?uD.createElement(V,{backgroundColor:$,color:"inverseText",bold:L},"@",H):uD.createElement(V,{color:"background",inverse:!0,bold:L},"@",H);if(I)return uD.createElement(V,{dimColor:!0,bold:L},"@",H);if(L)return uD.createElement(V,{color:$,bold:!0},"@",H);return uD.createElement(V,{color:$,dimColor:!$},"@",H)}function hT1(H){if(!H)return;if(h5.includes(H))return b5[H];return}function bT1(H){switch(H.type){case"local_bash":return H.command;case"local_agent":return H.description;case"remote_agent":return H.title;case"in_process_teammate":return`@${H.identity.agentName}`}}function kT1(H){let $=H.length;if(H.every((L)=>L.type===H[0].type))switch(H[0].type){case"local_bash":return $===1?"1 bash":`${$} bashes`;case"in_process_teammate":{let L=new Set(H.map((I)=>I.type==="in_process_teammate"?I.identity.teamName:"")).size;return L===1?"1 team":`${L} teams`}case"local_agent":return $===1?"1 local agent":`${$} local agents`;case"remote_agent":return $===1?"1 remote session":`${$} remote sessions`}return`${$} background ${$===1?"task":"tasks"}`}var uD,tPH;var P$B=K(()=>{xH();jI();vA();pL();lB();OB();Q9();DJ();w7();q7();IdH();uD=b(s(),1),tPH=b(s(),1)});function _$B({teamsSelected:H,showHint:$}){let A=J$((B)=>B.teamContext),L=A?Object.values(A.teammates).filter((B)=>B.name!=="team-lead").length:0;if(L===0)return null;let I=$&&H?WW.createElement(WW.Fragment,null,WW.createElement(V,{dimColor:!0},"\xB7 "),WW.createElement(V,{dimColor:!0},"Enter to view")):null,D=`${L} ${L===1?"teammate":"teammates"}`;return WW.createElement(WW.Fragment,null,WW.createElement(V,{key:H?"selected":"normal",color:"background",inverse:H},D),I?WW.createElement(V,null," ",I):null)}var WW;var Y$B=K(()=>{xH();pL();WW=b(s(),1)});function uT1({value:H,onChange:$,historyFailedMatch:A}){return w8H.createElement(x,{gap:1},w8H.createElement(V,{dimColor:!0},A?"no matching prompt:":"search prompts:"),w8H.createElement(W9,{value:H,onChange:$,cursorOffset:H.length,onChangeCursorOffset:()=>{},columns:GI(H)+1,focus:!0,showCursor:!0,multiline:!1,dimColor:!0}))}var w8H,C$B;var w$B=K(()=>{xH();S5();DJ();w8H=b(s(),1);C$B=uT1});function pT1(H,$){if(H===$)return!0;if(!H||!$)return!1;return H.filesCount===$.filesCount&&H.linesAdded===$.linesAdded&&H.linesRemoved===$.linesRemoved}function dT1(H,$){if(H.size!==$.size)return!1;for(let[A,L]of H){let I=$.get(A);if(!I)return!1;if(L.added!==I.added||L.removed!==I.removed||L.isBinary!==I.isBinary)return!1}return!0}function cT1(H,$,A){let L=A?.stats??null,I=A?.perFileStats??new Map;if(!pT1(H,L))return!0;if(!dT1($,I))return!0;return!1}function Z$B(){let H=J$((f)=>f.fileHistory.trackedFiles),$=J$((f)=>f.gitDiff),A=zI(),L=bd.useRef(null),I=bd.useRef(!1),D=H.size>0,B=bd.useCallback(async()=>{if(!NL("tengu_code_diff_cli",!1))return;let f=await U3D();A((E)=>{if(!cT1(E.gitDiff.stats,E.gitDiff.perFileStats,f))return E;return{...E,gitDiff:{...E.gitDiff,stats:f?.stats??null,perFileStats:f?.perFileStats??new Map,hunks:f?.hunks??new Map,lastUpdated:Date.now()}}})},[A]);return bd.useEffect(()=>{if(!D)return;let f=!1,E=!0;async function M(){let G=Date.now();await B();let U=Date.now()-G;if(E&&U>mT1){I.current=!0;return}if(E=!1,!f)L.current=setTimeout(()=>void M(),gT1)}return M(),()=>{if(f=!0,L.current)clearTimeout(L.current),L.current=null}},[D,B]),bd.useMemo(()=>{if(I.current)return null;if(!D)return null;if(!$.stats)return null;return{stats:$.stats,perFileStats:$.perFileStats,hunks:$.hunks}},[D,$.stats,$.perFileStats,$.hunks])}var bd,gT1=20000,mT1=2000;var q$B=K(()=>{pL();jkH();SD();bd=b(s(),1)});function iT1(H,$){if(H)return"draft";switch($){case"APPROVED":return"approved";case"CHANGES_REQUESTED":return"changes_requested";default:return"pending"}}async function T$B(){if(!await z6())return null;let[$,A]=await Promise.all([vW(),N6()]);if($===A)return null;let{stdout:L,code:I}=await jA("gh",["pr","view","--json","number,url,reviewDecision,isDraft,headRefName,state"],{timeout:lT1,preserveOutputOnError:!1});if(I!==0||!L.trim())return null;try{let D=DA(L),B=await N6();if(D.headRefName===B||D.headRefName==="main"||D.headRefName==="master")return null;return{number:D.number,url:D.url,reviewState:D.state==="MERGED"?"merged":iT1(D.isDraft,D.reviewDecision)}}catch{return null}}var lT1=5000;var z$B=K(()=>{B0();t8();Z$()});function N$B(){let H=zI(),$=sPH.useRef(null),A=sPH.useCallback(async()=>{let L=await T$B();H((I)=>{let D=L?.number??null,B=L?.reviewState??null;if(I.prStatus.number===D&&I.prStatus.reviewState===B)return I;return{...I,prStatus:{number:D,url:L?.url??null,reviewState:B,lastUpdated:Date.now()}}})},[H]);sPH.useEffect(()=>{let L=!1;async function I(){let D=Date.now();if(await A(),Date.now()-D>rT1)return;if(!L)$.current=setTimeout(()=>void I(),nT1)}return I(),()=>{if(L=!0,$.current)clearTimeout($.current),$.current=null}},[A])}var sPH,nT1=60000,rT1=4000;var O$B=K(()=>{pL();z$B();sPH=b(s(),1)});function j$B({exitMessage:H,vimMode:$,mode:A,toolPermissionContext:L,suppressHint:I,isLoading:D,tasksSelected:B,teamsSelected:f,diffSelected:E,teammateFooterIndex:M,isPasting:G,isSearching:U,historyQuery:X,setHistoryQuery:J,historyFailedMatch:F}){if(H.show)return hI.createElement(V,{dimColor:!0,key:"exit-message"},"Press ",H.key," again to exit");if(G)return hI.createElement(V,{dimColor:!0,key:"pasting-message"},"Pasting text\u2026");let Q=Vs()&&$==="INSERT"&&!U;return hI.createElement(x,{justifyContent:"flex-start",gap:1},R$B()&&hI.createElement(eT1,null),U&&hI.createElement(C$B,{value:X,onChange:J,historyFailedMatch:F}),Q?hI.createElement(V,{dimColor:!0,key:"vim-insert"},"-- INSERT --"):null,hI.createElement(oT1,{mode:A,toolPermissionContext:L,showHint:!I&&!Q,isLoading:D,tasksSelected:B,teamsSelected:f,diffSelected:E,teammateFooterIndex:M}))}function oT1({mode:H,toolPermissionContext:$,showHint:A,isLoading:L,tasksSelected:I,teamsSelected:D,diffSelected:B,teammateFooterIndex:f}){let{columns:E}=QL(),M=C0("chat:cycleMode","Chat","shift+tab"),G=J$((DH)=>DH.tasks),U=J$((DH)=>DH.teamContext),X=J$((DH)=>DH.remoteSessionUrl),J=J$((DH)=>DH.viewSelectionMode),F=J$((DH)=>DH.viewingAgentTaskId),Q=J$((DH)=>DH.expandedView),W=Q==="teammates",P=J$((DH)=>DH.prStatus),Y=ePH.useSyncExternalStore(x$B?.subscribeToProactiveChanges??aT1,x$B?.getNextTickAt??S$B,S$B)!==null,Z=!1,q=!1,O=ePH.useMemo(()=>Object.values(G).filter((DH)=>Dz(DH)&&!0).length,[G,!1]),j=O>0,u=C0("chat:cancel","Chat","esc").toLowerCase(),y=C0("app:toggleTodos","Global","ctrl+t"),g=Z$B(),h=NL("tengu_code_diff_cli",!1)?g?.stats??null:null,p=dL()&&!vh()&&U!==void 0&&Object.values(U.teammates).filter((DH)=>DH.name!=="team-lead").length>0;if(H==="bash")return hI.createElement(V,{color:"bashBorder"},"! for bash mode");if(H==="background")return hI.createElement(V,{color:"background"},"& to background");let d=$?.mode,k=!s0L(d),n=J==="viewing-agent",GH=F?G[F]:void 0,HH=n&&GH!=null&&GH.status!=="running",BH=O>0||n,WH=(k?1:0)+(BH?1:0)+(p?1:0),TH=(M$().codeDiffFooterEnabled??!0)&&h&&h.filesCount>0&&WH<2&&(WH===0||E>=100),t=R$B()&&P.number!==null&&P.reviewState!==null&&P.url!==null&&WH<2&&(WH===0||E>=100),IH=WH<2&&!0,MH=!W&&BH&&Object.values(G).some((DH)=>DH.type==="in_process_teammate")||!W&&n,CH=[...X?[hI.createElement(V,{color:"ide",key:"remote"},pH.circleDouble," remote")]:[],...d&&k?[hI.createElement(V,{color:q6(d),key:"mode"},fwH(d)," ",!1,vk(d).toLowerCase()," on",IH&&hI.createElement(V,{dimColor:!0}," ",hI.createElement(s$,{shortcut:M,action:"cycle",parens:!0})))]:[],...BH&&!MH&&!Qe(G,W)?[hI.createElement(OuA,{key:"tasks",tasksSelected:I,showHint:A&&!p,isViewingTeammate:n,teammateFooterIndex:f,isLeaderIdle:!L})]:[],...dL()&&p?[hI.createElement(_$B,{key:"teams",teamsSelected:D,showHint:A&&!BH})]:[],...TH?[hI.createElement(V,{key:"code-changes",dimColor:!B,inverse:B,color:B?"background":void 0},h.filesCount," ",h.filesCount===1?"file":"files"," ",hI.createElement(V,{color:"diffAddedWord"},"+",h.linesAdded)," ",hI.createElement(V,{color:"diffRemovedWord"},"-",h.linesRemoved),B&&A&&hI.createElement(V,{dimColor:!0}," \xB7 Enter to view"))]:[],...t?[hI.createElement(V,{key:"pr-status",dimColor:!0},hI.createElement(V,{color:sT1(P.reviewState)},"PR")," ",hI.createElement(dI,{url:P.url},hI.createElement(V,{underline:!0},"#",P.number)))]:[]],OH=Object.values(G).some((DH)=>DH.type==="in_process_teammate"&&DH.status==="running"),LH=A?tT1(L,u,y,j,Q,OH):[];if(HH)CH.push(hI.createElement(V,{dimColor:!0,key:"esc-return"},hI.createElement(s$,{shortcut:u,action:"return to team lead"})));else if(!MH&&A)CH.push(...LH);if(MH){let DH=HH?CH:[...CH,...LH];return hI.createElement(x,{flexDirection:"column"},hI.createElement(x,null,hI.createElement(OuA,{tasksSelected:I,showHint:!1,isViewingTeammate:n,teammateFooterIndex:f,isLeaderIdle:!L})),DH.length>0&&hI.createElement(x,null,hI.createElement(rA,null,DH)))}let e=!1;if(CH.length===0&&A)CH.push(hI.createElement(V,{dimColor:!0,key:"shortcuts-hint"},"? for shortcuts"));if(e&&A)CH.push(hI.createElement(V,{dimColor:!0,key:"manage-tasks"},hI.createElement(s$,{shortcut:"\u2193",action:"manage tasks"})));if(CH.length===0)return null;return hI.createElement(x,null,hI.createElement(rA,null,CH))}function tT1(H,$,A,L,I,D){let B;if(D)switch(I){case"none":B="show tasks";break;case"tasks":B="show teammates";break;case"teammates":B="hide";break}else B=I==="tasks"?"hide tasks":"show tasks";let f=L||I!=="none";return[...H?[hI.createElement(V,{dimColor:!0,key:"esc"},hI.createElement(s$,{shortcut:$,action:"interrupt"}))]:[],...f?[hI.createElement(V,{dimColor:!0,key:"toggle-tasks"},hI.createElement(s$,{shortcut:A,action:B}))]:[]]}function sT1(H){switch(H){case"approved":return"success";case"changes_requested":return"error";case"pending":return"warning";case"merged":return"merged";case"draft":return}}function eT1(){return N$B(),null}function R$B(){return NL("tengu_pr_status_cli",!1)&&(M$().prStatusFooterEnabled??!0)}var hI,ePH,x$B=null,aT1=(H)=>()=>{},S$B=()=>null;var y$B=K(()=>{xH();jI();qVH();FG();yW();P$B();IdH();T8();Y$B();jS();pL();w$B();q$B();O$B();lB();eB();OB();Q9();SD();vA();hI=b(s(),1),ePH=b(s(),1)});function SuA(H){return H?.statusLine!==void 0}function Hz1(H,$,A,L,I){let D=lYH(),B=BLH({permissionMode:H,mainLoopModel:X1(),exceeds200kTokens:$}),f=A?.outputStyle||HW,E=v4$(L),M=JV(B,V6()),G=xcA(E,M);return{...hF(),model:{id:B,display_name:hV(B)},workspace:{current_dir:C$(),project_dir:zL()},version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,output_style:{name:f},cost:{total_cost_usd:BQ(),total_duration_ms:EEH(),total_api_duration_ms:rC(),total_lines_added:KHH(),total_lines_removed:QHH()},context_window:{total_input_tokens:xYH(),total_output_tokens:SYH(),context_window_size:M,current_usage:E,used_percentage:G.used,remaining_percentage:G.remaining},exceeds_200k_tokens:$,...Vs()&&{vim:{mode:I??"INSERT"}},...D&&{agent:{name:D}}}}function v$B({messages:H,vimMode:$}){let A=kd.useRef(void 0),L=J$((U)=>U.toolPermissionContext),I=J$((U)=>U.statusLineText),D=zI(),B=lQ(),f=kd.useRef({messageId:null,exceeds200kTokens:!1,permissionMode:L.mode,vimMode:$}),E=kd.useCallback(async(U)=>{A.current?.abort();let X=new AbortController;A.current=X;try{let J=f.current.exceeds200kTokens;if(U!==void 0){let W=U.filter((Y)=>Y.type==="assistant"),P=W[W.length-1],C=P?.uuid||P?.message?.id||null;if(C!==f.current.messageId)J=h4$(U),f.current.messageId=C,f.current.exceeds200kTokens=J}let F=Hz1(f.current.permissionMode,J,B,U??[],$),Q=await CNA(F,X.signal);if(!X.signal.aborted)D((W)=>({...W,statusLineText:Q}))}catch{}},[D,B,$]),M=Rr(()=>E(H),300);kd.useEffect(()=>{let U=H.filter((F)=>F.type==="assistant"),X=U[U.length-1],J=X?.uuid||X?.message?.id||null;if(J!==f.current.messageId||L.mode!==f.current.permissionMode||$!==f.current.vimMode)f.current.messageId=J,f.current.permissionMode=L.mode,f.current.vimMode=$,M()},[H,L.mode,$,M]),kd.useEffect(()=>{let U=B?.statusLine;if(U){if(c("tengu_status_line_mount",{command_length:U.command.length,padding:U.padding}),B.disableAllHooks===!0)N("Status line is configured but disableAllHooks is true",{level:"warn"})}},[]),kd.useEffect(()=>{return E(),()=>{A.current?.abort()}},[]);let G=B?.statusLine?.padding??0;return Z8H.createElement(x,{paddingX:G,gap:2},I&&Z8H.createElement(V,{dimColor:!0},Z8H.createElement(m9,null,I)))}var Z8H,kd;var h$B=K(()=>{xH();_3();g$();PI();um();aI();s6();_3();z$();E$();pL();jh();Nq();nC();$3();qVH();Z8H=b(s(),1),kd=b(s(),1)});function b$B({selectedIndex:H}){let $=J$((M)=>M.tasks),A=kJ.useRef([]),[,L]=kJ.useState(0);kJ.useEffect(()=>{let M=setInterval(()=>{L((G)=>G+1)},1000);return()=>clearInterval(M)},[]);let I=kJ.useMemo(()=>{let M=new Map;for(let G of Object.values($))if(G.type==="local_agent")M.set(G.id,G);return M},[$]),D=new Set(A.current),B=[...I.keys()].filter((M)=>!D.has(M)).sort((M,G)=>{let U=I.get(M),X=I.get(G);if(!U||!X)return 0;return U.startTime-X.startTime});if(B.length>0)A.current=[...A.current,...B];if(!v8())return null;let f=3000,E=[];for(let M of A.current){let G=I.get(M);if(!G)continue;if(!rN$(G.status))E.push(G);else if(G.status==="killed"&&G.endTime){if(Date.now()-G.endTimekJ.createElement($z1,{key:M.id,task:M,isSelected:H===G})))}function k$B(){let H=J$(($)=>$.tasks);return kJ.useMemo(()=>{if(!v8())return 0;let $=3000,A=Date.now(),L=Object.values(H).filter((D)=>D.type==="local_agent"),I=0;for(let D of L)if(!rN$(D.status))I++;else if(D.status==="killed"&&D.endTime&&A-D.endTime<$)I++;return I},[H])}function $z1({task:H,isSelected:$}){let{columns:A}=QL(),L=!rN$(H.status),I=L?Date.now()-H.startTime:(H.endTime??H.startTime)-H.startTime,D=of(I),B=H.progress?.tokenCount,f=H.progress?.lastActivity,E=f?pH.arrowDown:pH.arrowUp,M=B!==void 0&&B>0?` \xB7 ${E} ${a0(B)} tokens`:"",G=H.progress?.summary,U=G||H.description;kJ.useEffect(()=>{N(`[CoordinatorAgentStatus] Summary updated for task ${H.id}: ${G??"(none)"}`)},[G,H.id]);let X=G?void 0:(H.progress?.recentActivities&&kv(H.progress.recentActivities))??f?.activityDescription,J=X?` \xB7 ${X}`:"",F=$?pH.pointer+" ":" ",Q=` \xB7 ${D}${M}${J}`,W=A-GI(F)-GI(Q),P=k2(U,Math.max(0,W),"truncate-end");if(!L)return kJ.createElement(V,{dimColor:!$},F,P," \xB7 ",D,M,kJ.createElement(V,{color:"warning"}," \xB7 ",pH.cross," Stopped"));return kJ.createElement(V,{dimColor:!$},F,P," \xB7 ",D,M,J)}var kJ;var juA=K(()=>{xH();pL();w7();jI();Q9();IdH();hx();DJ();OB();E$();kJ=b(s(),1)});function Az1({apiKeyStatus:H,debug:$,exitMessage:A,vimMode:L,mode:I,autoUpdaterResult:D,isAutoUpdating:B,verbose:f,onAutoUpdaterResult:E,onChangeIsUpdating:M,suggestions:G,selectedSuggestion:U,maxColumnWidth:X,toolPermissionContext:J,helpOpen:F,suppressHint:Q,isLoading:W,tasksSelected:P,teamsSelected:C,diffSelected:Y,teammateFooterIndex:Z,coordinatorTaskIndex:q,ideSelection:O,mcpClients:j,isPasting:u=!1,isInputWrapped:y=!1,messages:g,isSearching:h,historyQuery:p,setHistoryQuery:d,historyFailedMatch:k}){let n=lQ(),GH=Q||SuA(n)||h;if(G.length)return t4.createElement(x,{paddingX:2,paddingY:0},t4.createElement(qgH,{suggestions:G,selectedSuggestion:U,maxColumnWidth:X}));if(F)return t4.createElement(zq$,{dimColor:!0,fixedWidth:!0,paddingX:2});return t4.createElement(t4.Fragment,null,t4.createElement(x,{flexDirection:"row",justifyContent:"space-between",paddingX:2,gap:1},t4.createElement(x,{flexDirection:"column",flexShrink:0},I==="prompt"&&!A.show&&!u&&SuA(n)&&t4.createElement(v$B,{messages:g,vimMode:L}),t4.createElement(j$B,{exitMessage:A,vimMode:L,mode:I,toolPermissionContext:J,suppressHint:GH,isLoading:W,tasksSelected:P,teamsSelected:C,diffSelected:Y,teammateFooterIndex:Z,isPasting:u,isSearching:h,historyQuery:p,setHistoryQuery:d,historyFailedMatch:k})),t4.createElement(THB,{apiKeyStatus:H,autoUpdaterResult:D,debug:$,isAutoUpdating:B,verbose:f,messages:g,onAutoUpdaterResult:E,onChangeIsUpdating:M,ideSelection:O,mcpClients:j,isInputWrapped:y})),t4.createElement(b$B,{selectedIndex:P?q:void 0}))}var t4,u$B,g$B;var m$B=K(()=>{xH();y$B();yN$();h$B();um();nSA();JRA();juA();t4=b(s(),1),u$B=b(s(),1);g$B=u$B.memo(Az1)});function p$B(H,$){let A=aN$.useRef(void 0);aN$.useEffect(()=>{let L=CY(H);if(A.current!==L)A.current=L;if(L)L.client.setNotificationHandler(Iz1,(I)=>{if(A.current!==L)return;try{let D=I.params,B=D.lineStart!==void 0?D.lineStart+1:void 0,f=D.lineEnd!==void 0?D.lineEnd+1:void 0;$({filePath:D.filePath,lineStart:B,lineEnd:f})}catch(D){r(D)}})},[H,$])}var aN$,Lz1="at_mentioned",Iz1;var d$B=K(()=>{mI();nU();_$();aN$=b(s(),1),Iz1=S.object({method:S.literal(Lz1),params:S.object({filePath:S.string(),lineStart:S.number().optional(),lineEnd:S.number().optional()})})});function c$B({maxBufferSize:H,debounceMs:$}){let[A,L]=xb.useState([]),[I,D]=xb.useState(-1),B=xb.useRef(0),f=xb.useRef(null),E=xb.useCallback((X,J,F={})=>{let Q=Date.now();if(f.current)clearTimeout(f.current),f.current=null;if(Q-B.current<$){f.current=setTimeout(()=>{E(X,J,F)},$);return}B.current=Q,L((W)=>{let P=I>=0?W.slice(0,I+1):W,C=P[P.length-1];if(C&&C.text===X)return P;let Y=[...P,{text:X,cursorOffset:J,pastedContents:F,timestamp:Q}];if(Y.length>H)return Y.slice(-H);return Y}),D((W)=>{let P=W>=0?W+1:A.length;return Math.min(P,H-1)})},[$,H,I,A.length]),M=xb.useCallback(()=>{if(I<0||A.length===0)return;let X=Math.max(0,I-1),J=A[X];if(J)return D(X),J;return},[A,I]),G=xb.useCallback(()=>{if(L([]),D(-1),B.current=0,f.current)clearTimeout(f.current),f.current=null},[B,f]),U=I>0&&A.length>1;return{pushToBuffer:E,undo:M,canUndo:U,clearBuffer:G}}var xb;var l$B=K(()=>{xb=b(s(),1)});function i$B(H){return H==="tmux"||H==="iterm2"}function n$B(H){let $=yF(H);if(!$)return[];let A=[];for(let L of $.members){if(L.name==="team-lead")continue;let D=L.isActive!==!1?"running":"idle";A.push({name:L.name,agentId:L.agentId,agentType:L.agentType,model:L.model,prompt:L.prompt,status:D,color:L.color,tmuxPaneId:L.tmuxPaneId,cwd:L.cwd,worktreePath:L.worktreePath,isHidden:Z4D(H,L.tmuxPaneId),backendType:L.backendType&&i$B(L.backendType)?L.backendType:void 0,mode:L.mode})}return A}var r$B=K(()=>{g$();NA();aY();E$()});function o$B({initialTeams:H,onDone:$}){FY("teams-dialog");let A=zI(),L=H?.[0]?.name??"",[I,D]=Tj.useState({type:"teammateList",teamName:L}),[B,f]=Tj.useState(0),[E,M]=Tj.useState(0),G=Tj.useMemo(()=>{return n$B(I.teamName)},[I.teamName,E]);VF(()=>{M((W)=>W+1)},1000);let U=Tj.useMemo(()=>{if(I.type!=="teammateDetail")return null;return G.find((W)=>W.name===I.memberName)??null},[I,G]),X=J$((W)=>W.toolPermissionContext.isBypassPermissionsModeAvailable),J=()=>{D({type:"teammateList",teamName:I.teamName}),f(0)},F=Tj.useCallback(()=>{if(I.type==="teammateDetail"&&U)Uz1(U,I.teamName,X),M((W)=>W+1);else if(I.type==="teammateList"&&G.length>0)Xz1(G,I.teamName,X),M((W)=>W+1)},[I,U,G,X]);bI({"confirm:cycleMode":F},{context:"Confirmation"}),WL((W,P)=>{if(P.leftArrow){if(I.type==="teammateDetail")J();return}if(P.upArrow||P.downArrow){let C=Q();if(P.upArrow)f((Y)=>Math.max(0,Y-1));else f((Y)=>Math.min(C,Y+1));return}if(P.return){if(I.type==="teammateList"&&G[B])D({type:"teammateDetail",teamName:I.teamName,memberName:G[B].name});else if(I.type==="teammateDetail"&&U)Ez1(U.tmuxPaneId),$();return}if(W==="k"){if(I.type==="teammateList"&&G[B])RuA(G[B].tmuxPaneId,I.teamName,G[B].agentId,G[B].name,A).then(()=>{M((C)=>C+1),f((C)=>Math.max(0,Math.min(C,G.length-2)))});else if(I.type==="teammateDetail"&&U)RuA(U.tmuxPaneId,I.teamName,U.agentId,U.name,A),J();return}if(W==="s"){if(I.type==="teammateList"&&G[B]){let C=G[B];Y_$(C.name,I.teamName,"Graceful shutdown requested by team lead")}else if(I.type==="teammateDetail"&&U)Y_$(U.name,I.teamName,"Graceful shutdown requested by team lead"),J();return}if(W==="h"){let C=F6H(),Y=I.type==="teammateList"?G[B]:I.type==="teammateDetail"?U:null;if(Y&&C?.supportsHideShow){if(Mz1(Y,I.teamName).then(()=>{M((Z)=>Z+1)}),I.type==="teammateDetail")J()}return}if(W==="H"&&I.type==="teammateList"){if(F6H()?.supportsHideShow&&G.length>0){let Y=G.some((Z)=>!Z.isHidden);Promise.all(G.map((Z)=>Y?s$B(Z,I.teamName):e$B(Z,I.teamName))).then(()=>{M((Z)=>Z+1)})}return}if(W==="p"&&I.type==="teammateList"){let C=G.filter((Y)=>Y.status==="idle");if(C.length>0)Promise.all(C.map((Y)=>RuA(Y.tmuxPaneId,I.teamName,Y.agentId,Y.name,A))).then(()=>{M((Y)=>Y+1),f((Y)=>Math.max(0,Math.min(Y,G.length-C.length-1)))});return}});function Q(){if(I.type==="teammateList")return Math.max(0,G.length-1);return 0}if(I.type==="teammateList")return iD.createElement(Dz1,{teamName:I.teamName,teammates:G,selectedIndex:B,onCancel:$});if(I.type==="teammateDetail"&&U)return iD.createElement(fz1,{teammate:U,teamName:I.teamName,onCancel:J});return null}function Dz1({teamName:H,teammates:$,selectedIndex:A,onCancel:L}){let I=`${$.length} ${$.length===1?"teammate":"teammates"}`,D=F6H()?.supportsHideShow??!1,B=C0("confirm:cycleMode","Confirmation","shift+tab");return iD.createElement(iD.Fragment,null,iD.createElement(BL,{title:`Team ${H}`,subtitle:I,onCancel:L,color:"background",hideInputGuide:!0},$.length===0?iD.createElement(V,{dimColor:!0},"No teammates"):iD.createElement(x,{flexDirection:"column"},$.map((f,E)=>iD.createElement(Bz1,{key:f.agentId,teammate:f,isSelected:E===A})))),iD.createElement(x,{marginLeft:1},iD.createElement(V,{dimColor:!0},pH.arrowUp,"/",pH.arrowDown," select \xB7 Enter view \xB7 k kill \xB7 s shutdown \xB7 p prune idle",D&&" \xB7 h hide/show \xB7 H hide/show all"," \xB7 ",B," sync cycle modes for all \xB7 Esc close")))}function Bz1({teammate:H,isSelected:$}){let A=H.status==="idle",L=A&&!$,I=H.mode?hN(H.mode):"default",D=fwH(I),B=q6(I);return iD.createElement(V,{color:$?"suggestion":void 0,dimColor:L},$?pH.pointer+" ":" ",H.isHidden&&iD.createElement(V,{dimColor:!0},"[hidden] "),A&&iD.createElement(V,{dimColor:!0},"[idle] "),D&&iD.createElement(V,{color:B},D," "),"@",H.name,H.model&&iD.createElement(V,{dimColor:!0}," (",H.model,")"))}function fz1({teammate:H,teamName:$,onCancel:A}){let[L,I]=Tj.useState(!1),D=C0("confirm:cycleMode","Confirmation","shift+tab"),B=H.color?b5[H.color]:void 0,f=Tj.useMemo(()=>{return GF($).filter((W)=>W.owner===H.agentId||W.owner===H.name)},[$,H.agentId,H.name]);WL((Q)=>{if(Q==="p")I((W)=>!W)});let E=H.worktreePath||H.cwd,M=[];if(H.model)M.push(H.model);if(E)M.push(H.worktreePath?`worktree: ${E}`:E);let G=M.join(" \xB7 ")||void 0,U=H.mode?hN(H.mode):"default",X=fwH(U),J=q6(U),F=iD.createElement(iD.Fragment,null,X&&iD.createElement(V,{color:J},X," "),B?iD.createElement(V,{color:B},`@${H.name}`):`@${H.name}`);return iD.createElement(iD.Fragment,null,iD.createElement(BL,{title:F,subtitle:G,onCancel:A,color:"background",hideInputGuide:!0},f.length>0&&iD.createElement(x,{flexDirection:"column"},iD.createElement(V,{bold:!0},"Tasks"),f.map((Q)=>iD.createElement(V,{key:Q.id,color:Q.status==="completed"?"success":void 0},Q.status==="completed"?pH.tick:"\u25FC"," ",Q.subject))),H.prompt&&iD.createElement(x,{flexDirection:"column"},iD.createElement(V,{bold:!0},"Prompt"),iD.createElement(V,null,L?H.prompt:H.prompt.length>80?H.prompt.slice(0,80)+"\u2026":H.prompt,H.prompt.length>80&&!L&&iD.createElement(V,{dimColor:!0}," (p to expand)")))),iD.createElement(x,{marginLeft:1},iD.createElement(V,{dimColor:!0},pH.arrowLeft," back \xB7 Esc close \xB7 k kill \xB7 s shutdown",F6H()?.supportsHideShow&&" \xB7 h hide/show"," \xB7 ",D," cycle mode")))}function t$B(H){return!H.startsWith("%")}async function RuA(H,$,A,L,I){if(t$B(H))await jA("it2",["session","close",H]);else await jA("tmux",["kill-pane","-t",H]);q4D($,H);let{notificationMessage:D}=Jn($,A,L,"terminated");I((B)=>{if(!B.teamContext?.teammates)return B;if(!(A in B.teamContext.teammates))return B;let{[A]:f,...E}=B.teamContext.teammates;return{...B,teamContext:{...B.teamContext,teammates:E},inbox:{messages:[...B.inbox.messages,{id:a$B.randomUUID(),from:"system",text:yH({type:"teammate_terminated",message:D}),timestamp:new Date().toISOString(),status:"pending"}]}}}),N(`[TeamsDialog] Removed ${A} from teamContext`)}async function Ez1(H){if(t$B(H))await jA("it2",["session","focus",H]);else await jA("tmux",["select-pane","-t",H])}async function Mz1(H,$){if(H.isHidden)await e$B(H,$);else await s$B(H,$)}async function s$B(H,$){}async function e$B(H,$){}function Gz1(H,$,A){XbH($,H,A);let L=T_$({mode:A,from:"team-lead"});K8(H,{from:"team-lead",text:yH(L),timestamp:new Date().toISOString()},$),N(`[TeamsDialog] Sent mode change to ${H}: ${A}`)}function Uz1(H,$,A){let L=H.mode?hN(H.mode):"default",I={...YK(),mode:L,isBypassPermissionsModeAvailable:A},D=oPH(I);Gz1(H.name,$,D)}function Xz1(H,$,A){if(H.length===0)return;let L=H.map((f)=>f.mode?hN(f.mode):"default"),D=!L.every((f)=>f===L[0])?"default":oPH({...YK(),mode:L[0]??"default",isBypassPermissionsModeAvailable:A}),B=H.map((f)=>({memberName:f.name,mode:D}));N4D($,B);for(let f of H){let E=T_$({mode:D,from:"team-lead"});K8(f.name,{from:"team-lead",text:yH(E),timestamp:new Date().toISOString()},$)}N(`[TeamsDialog] Sent mode change to all ${H.length} teammates: ${D}`)}var iD,Tj,a$B;var HAB=K(()=>{xH();$I();FG();s6();jI();r$B();B0();E$();q7();BNH();JG();bB();aY();jS();sU();NuA();yW();pL();Z$();Dx();iD=b(s(),1),Tj=b(s(),1),a$B=require("crypto")});function $AB(H){let $=H.match(/^@([\w-]+)\s+(.+)$/s);if(!$)return null;let[,A,L]=$;if(!A||!L)return null;let I=L.trim();if(!I)return null;return{recipientName:A,message:I}}function AAB(H,$,A,L){if(!A||!L)return{success:!1,error:"no_team_context"};if(!Object.values(A.teammates??{}).find((D)=>D.name===H))return{success:!1,error:"unknown_recipient",recipientName:H};return L(H,{from:"user",text:$,timestamp:new Date().toISOString()},A.teamName),{success:!0,recipientName:H}}function LAB(){let H=J$((L)=>L.gitDiff),[$,A]=H_H.useState(new Map);return H_H.useEffect(()=>{let L=!1;return X3D().then((I)=>{if(!L)A(I)}),()=>{L=!0}},[H.lastUpdated]),H_H.useMemo(()=>{let{stats:L,perFileStats:I}=H,D=[];for(let[B,f]of I){let E=$.get(B),M=f.isUntracked??!1,G=!f.isBinary&&!M&&!E,U=f.added+f.removed,X=!G&&!f.isBinary&&U>Jz1;D.push({path:B,linesAdded:f.added,linesRemoved:f.removed,isBinary:f.isBinary,isLargeFile:G,isTruncated:X,isUntracked:M})}return D.sort((B,f)=>B.path.localeCompare(f.path)),{stats:L,files:D,hunks:$}},[H,$])}var H_H,Jz1=400;var IAB=K(()=>{pL();jkH();H_H=b(s(),1)});function Fz1(H){if(!H||typeof H!=="object")return!1;let $=H,A=typeof $.filePath==="string",L=Array.isArray($.structuredPatch)&&$.structuredPatch.length>0,I=$.type==="create"&&typeof $.content==="string";return A&&(L||I)}function Kz1(H){return"type"in H&&(H.type==="create"||H.type==="update")}function Qz1(H){let $=0,A=0;for(let L of H)for(let I of L.lines)if(I.startsWith("+"))$++;else if(I.startsWith("-"))A++;return{added:$,removed:A}}function Wz1(H){if(H.type!=="user")return"";let $=H.message.content,A=typeof $==="string"?$:"";if(A.length<=30)return A;return A.slice(0,29)+"\u2026"}function DAB(H){let $=0,A=0;for(let L of H.files.values())$+=L.linesAdded,A+=L.linesRemoved;H.stats={filesChanged:H.files.size,linesAdded:$,linesRemoved:A}}function BAB(H){let $=oN$.useRef({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return oN$.useMemo(()=>{let A=$.current;if(H.length0)DAB(A.currentTurn),A.completedTurns.push(A.currentTurn);A.lastTurnIndex++,A.currentTurn={turnIndex:A.lastTurnIndex,userPromptPreview:Wz1(D),timestamp:D.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}}}else if(A.currentTurn&&D.toolUseResult){let f=D.toolUseResult;if(Fz1(f)){let{filePath:E,structuredPatch:M}=f,G="type"in f&&f.type==="create",U=A.currentTurn.files.get(E);if(!U)U={filePath:E,hunks:[],isNewFile:G,linesAdded:0,linesRemoved:0},A.currentTurn.files.set(E,U);if(G&&M.length===0&&Kz1(f)){let J=f.content.split(` Or, resume it later with: ${Z}`})],shouldQuery:!1}}catch(E){let M=E instanceof Error?E.message:String(E);return{messages:[k7(),f,...A,R$({content:`Failed to create background session: ${M}. Try running /login and signing in with a claude.ai account (not Console).`})],shouldQuery:!1}}finally{I(null)}}var YM;var FIB=K(()=>{z$();_L();xH();rwA();iB();ip();YS();H3H();eC$();E$();rB();nM();dU();bw();aI();nC();t8();okA();YM=b(s(),1)});function LgA({input:H,progress:$,verbose:A}){return GO$.default.createElement(x,{flexDirection:"column",marginTop:1},GO$.default.createElement(Q_$,{addMargin:!1,param:{text:`${H}`,type:"text"}}),$?GO$.default.createElement(c_$,{fullOutput:$.fullOutput,output:$.output,elapsedTimeSeconds:$.elapsedTimeSeconds,totalLines:$.totalLines,verbose:A}):aD.renderToolUseProgressMessage([],{verbose:A,tools:[],terminalSize:void 0}))}var GO$;var KIB=K(()=>{xH();cwA();CZA();zQ();GO$=b(s(),1)});async function QIB(H,$,A,L,I,D){yD("bash-mode"),c("tengu_input_bash",{}),D(!0);let B=R$({content:yP({inputString:`${H}`,precedingInputBlocks:$})}),f;I({jsx:jb.createElement(LgA,{input:H,progress:null,verbose:L.options.verbose}),shouldHidePromptInput:!1});try{let E={...L,setToolJSX:(J)=>{f=J?.jsx}},G=(await aD.call({command:H,dangerouslyDisableSandbox:!0},E,void 0,void 0,(J)=>{I({jsx:jb.createElement(jb.Fragment,null,jb.createElement(LgA,{input:H,progress:J.data,verbose:L.options.verbose}),f),shouldHidePromptInput:!1,showSpinner:!1})})).data;if(!G)throw Error("No result received from bash command");let U=G.stderr,X=await L.getAppState();if(Uw$(X.toolPermissionContext))U=Gw$(U);return{messages:[k7(),B,...A,R$({content:`${G.stdout}${U}`})],shouldQuery:!1}}catch(E){if(E instanceof yN){if(E.interrupted)return{messages:[k7(),B,R$({content:Bt}),...A],shouldQuery:!1};return{messages:[k7(),B,...A,R$({content:`${E.stdout}${E.stderr}`})],shouldQuery:!1}}return{messages:[k7(),B,...A,R$({content:`Command failed: ${E instanceof Error?E.message:String(E)}`})],shouldQuery:!1}}finally{I(null)}}var jb;var WIB=K(()=>{z$();_L();_L();KIB();zQ();w3H();w3H();lG();yE();jb=b(s(),1)});function VIB(H,$,A,L,I,D,B,f,E,M){I(!0);let G=typeof H==="string"?H:H.find((F)=>F.type==="text")?.text||"";zhI(G);let U={};if(typeof H==="string"){let F=yzD(H),Q=vzD(H);U={is_negative:F,is_keep_going:Q},pQ("user_prompt",{prompt_length:String(H.length),prompt:rF$(H)})}if(c("tengu_input_prompt",U),$.length>0){let F=typeof H==="string"?H.trim()?[{type:"text",text:H}]:[]:H,Q=R$({content:[...F,...$],uuid:D,thinkingMetadata:B,todos:E,imagePasteIds:A.length>0?A:void 0,permissionMode:M}),W=lg([Q],f??void 0);return{messages:[Q,...L],shouldQuery:!0,maxThinkingTokens:W}}let X=R$({content:H,uuid:D,thinkingMetadata:B,todos:E,permissionMode:M}),J=lg([X],f??void 0);return{messages:[X,...L],shouldQuery:!0,maxThinkingTokens:J}}var PIB=K(()=>{z$();sa();Lo();_L();ig()});async function _IB(){return}async function XO$({input:H,mode:$,setIsLoading:A,setToolJSX:L,context:I,pastedContents:D,ideSelection:B,messages:f,setUserInputOnProcessing:E,uuid:M,isAlreadyProcessing:G,thinkingMetadata:U,manualThinkingTokens:X,querySource:J,canUseTool:F}){let Q=typeof H==="string"?H:null;if($==="prompt"&&Q!==null)E?.(Q);try{_9("query_process_user_input_base_start");let W=await I.getAppState(),P=await RN1(H,$,A,L,I,D,B,f,M,G,U,X,J,W.todos[I.agentId??j$()],F,W.toolPermissionContext.mode);if(_9("query_process_user_input_base_end"),!P.shouldQuery)return P;_9("query_hooks_start");let C=K9H(H)||"";_IB(C,f??[],W);for await(let Y of VNA(C,W.toolPermissionContext.mode,I)){if(Y.message?.type==="progress")continue;if(Y.blockingError){let Z=UNA(Y.blockingError);return{messages:[a7(`${Z} `);if(I(Z)){let O=new Set(W.map((j)=>j.id));B((j)=>({...j,inbox:{messages:j.inbox.messages.filter((u)=>!O.has(u.id))}}))}else N("[InboxPoller] Submission rejected, keeping messages queued")},[H,$,A,I,B,f,D]);let U=H&&!!WO$(D.getState());VF(G,U?dN1:null);let X=Ve.useRef(!1);Ve.useEffect(()=>{if(!H)return;if(X.current)return;if(WO$(D.getState()))X.current=!0,G()},[H,G,D])}var Ve,EgA,dN1=1000;var dIB=K(()=>{s6();sU();XE();h2();EE();C5();yW();aY();E$();pL();xbH();TLH();f6H();Z$();GkH();g7();_L();jS();yh();JG();Ve=b(s(),1),EgA=require("crypto")});var MgA;var cIB=K(()=>{JG();E$();MgA=b(s(),1)});function iIB({autoConnectIdeFlag:H,ideToInstallExtension:$,setDynamicMcpConfig:A,setShowIdeOnboarding:L,setIDEInstallationState:I}){lIB.useEffect(()=>{function D(B){if(!B)return;if(!((M$().autoConnectIde||H||ZF()||$||A$(process.env.CLAUDE_CODE_AUTO_CONNECT_IDE))&&!BE(process.env.CLAUDE_CODE_AUTO_CONNECT_IDE)))return;A((M)=>{if(M?.ide)return M;return{...M,ide:{type:B.url.startsWith("ws:")?"ws-ide":"sse-ide",url:B.url,ideName:B.name,authToken:B.authToken,ideRunningInWindows:B.ideRunningInWindows,scope:"dynamic"}}})}$qI(D,$,()=>L(!0),(B)=>I(B))},[H,$,A,L,I])}var lIB;var nIB=K(()=>{vA();nU();NA();lIB=b(s(),1)});function rIB({onBackgroundSession:H,isLoading:$}){let A=zI(),L=OX(),[I,D]=VO$.useState(!1),B=Lx(D,H,()=>{}),f=VO$.useCallback(()=>{if(A$(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS))return;let G=L.getState();if(OyI(G))pF$(()=>L.getState(),A);else if(process.env.ENABLE_SESSION_BACKGROUNDING==="true"&&$)B()},[A,L,$,B]);BA("task:background",f,{context:"Task"});let E=C0("task:background","Task","ctrl+b"),M=OA.terminal==="tmux"&&E==="ctrl+b"?"ctrl+b ctrl+b":E;if(!$||!I)return null;return O8H.createElement(x,{paddingLeft:2},O8H.createElement(V,{dimColor:!0},O8H.createElement(s$,{shortcut:M,action:"background"})))}var O8H,VO$;var aIB=K(()=>{xH();qSH();pL();_BH();lB();Z1();NA();$I();FG();O8H=b(s(),1),VO$=b(s(),1)});function oIB({setMessages:H,setIsLoading:$,resetLoadingState:A,setAbortController:L}){let I=J$((X)=>X.foregroundedTaskId),D=J$((X)=>X.tasks),B=zI(),f=Pe.useRef(null),E=Pe.useRef(0),M=Pe.useCallback(()=>{if(I){B((X)=>{let J=X.foregroundedTaskId;if(!J)return X;let F=X.tasks[J];if(!F)return{...X,foregroundedTaskId:void 0};return{...X,foregroundedTaskId:void 0,tasks:{...X.tasks,[J]:{...F,isBackgrounded:!0}}}}),H([]),A(),L(null);return}f.current?.resolve()},[I,B,H,A,L]),G=Pe.useCallback((X)=>{f.current?.resolve(),qyI(X,B)},[B]),U=I?D[I]:void 0;return Pe.useEffect(()=>{if(!I){E.current=0;return}if(!U||U.type!=="local_agent"){B((J)=>({...J,foregroundedTaskId:void 0})),A(),E.current=0;return}let X=U.messages??[];if(X.length!==E.current)E.current=X.length,H([...X]);if(U.status==="running"){let J=U.abortController;if(J?.signal.aborted){B((F)=>{if(!F.foregroundedTaskId)return F;let Q=F.tasks[F.foregroundedTaskId];if(!Q)return{...F,foregroundedTaskId:void 0};return{...F,foregroundedTaskId:void 0,tasks:{...F.tasks,[F.foregroundedTaskId]:{...Q,isBackgrounded:!0}}}}),A(),L(null),E.current=0;return}if($(!0),J)L(J)}else B((J)=>{let F=J.foregroundedTaskId;if(!F)return J;let Q=J.tasks[F];if(!Q)return{...J,foregroundedTaskId:void 0};return{...J,foregroundedTaskId:void 0,tasks:{...J.tasks,[F]:{...Q,isBackgrounded:!0}}}}),A(),L(null),E.current=0},[I,U,B,H,$,A,L]),{backgroundSignalRef:f,handleBackgroundSession:M,handleForegroundTask:G}}var Pe;var tIB=K(()=>{pL();mF$();Pe=b(s(),1)});function sIB(H,$){let[A,L]=GgA.default.useState($);return GgA.default.useEffect(()=>{aS(H,$).then(L)},[H,$]),A}var GgA;var eIB=K(()=>{SD();GgA=b(s(),1)});function PO$({hideThanksAfterMs:H,onOpen:$,onSelect:A}){let[L,I]=_e.useState("closed"),D=_e.useRef(UgA.randomUUID()),B=_e.useCallback(()=>{I("thanks"),setTimeout(()=>I("closed"),H)},[H]),f=_e.useCallback(()=>{if(L!=="closed")return;I("open"),D.current=UgA.randomUUID(),$(D.current)},[L,$]),E=_e.useCallback((M)=>{if(M==="dismissed")I("closed");else B();A(D.current,M)},[B,A]);return{state:L,open:f,handleSelect:E}}var UgA,_e;var XgA=K(()=>{UgA=require("crypto"),_e=b(s(),1)});function HDB(H,$,A,L="session",I=!1){let D=OC.useRef("unknown");D.current=$C(H)?.message?.id||"unknown";let B=J$((q)=>q.feedbackSurvey),f=zI(),E=sIB("tengu_feedback_survey_config",cN1),M=OC.useRef(Date.now()),G=OC.useRef(A),U=OC.useRef(A);U.current=A;let X=OC.useCallback((q,O)=>{f((j)=>({...j,feedbackSurvey:{timeLastShown:q,submitCountAtLastAppearance:O}}))},[f]),J=OC.useCallback((q)=>{X(Date.now(),U.current),c("tengu_feedback_survey_event",{event_type:"appeared",appearance_id:q,last_assistant_message_id:D.current,survey_type:L})},[X,L]),F=OC.useCallback((q,O)=>{X(Date.now(),U.current),c("tengu_feedback_survey_event",{event_type:"responded",appearance_id:q,response:O,last_assistant_message_id:D.current,survey_type:L})},[X,L]),{state:Q,open:W,handleSelect:P}=PO$({hideThanksAfterMs:E.hideThanksAfterMs,onOpen:J,onSelect:F}),C=X1(),Y=OC.useMemo(()=>{if(E.onForModels.length===0)return!1;if(E.onForModels.includes("*"))return!0;return E.onForModels.includes(C)},[E.onForModels,C]),Z=OC.useMemo(()=>{if(Q!=="closed")return!1;if($)return!1;if(I)return!1;if(process.env.CLAUDE_FORCE_DISPLAY_SURVEY&&!B.timeLastShown)return!0;if(!Y)return!1;if(A$(process.env.CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY))return!1;if(NP())return!1;if(!PK("allow_product_feedback"))return!1;if(B.timeLastShown){if(B.submitCountAtLastAppearance!==null&&AE.probability)return!1;let q=M$().feedbackSurveyState;if(q?.lastShownTime){if(Date.now()-q.lastShownTime{if(Z)W()},[Z,W]),{state:Q,handleSelect:P}}var OC,cN1;var $DB=K(()=>{eIB();z$();Fo();XY();vA();aI();NA();pL();_L();XgA();OC=b(s(),1),cN1={minTimeBeforeFeedbackMs:600000,minTimeBetweenGlobalFeedbackMs:1e8,minUserTurnsBeforeFeedback:5,minUserTurnsBetweenFeedback:10,hideThanksAfterMs:3000,onForModels:["*"],probability:0.005}});function rN1(H,$){let A=H.findIndex((L)=>L.uuid===$);if(A===-1)return!1;for(let L=A+1;L{let F=Tw$();c("tengu_post_compact_survey_event",{event_type:"appeared",appearance_id:J,session_memory_compaction_enabled:F})},[]),E=QZ.useCallback((J,F)=>{let Q=Tw$();c("tengu_post_compact_survey_event",{event_type:"responded",appearance_id:J,response:F,session_memory_compaction_enabled:Q})},[]),{state:M,open:G,handleSelect:U}=PO$({hideThanksAfterMs:lN1,onOpen:f,onSelect:E});QZ.useEffect(()=>{I(cf(iN1))},[]);let X=QZ.useMemo(()=>new Set(H.filter((J)=>Ez(J)).map((J)=>J.uuid)),[H]);return QZ.useEffect(()=>{if(M!=="closed"||$)return;if(A)return;if(L!==!0)return;if(NP())return;if(A$(process.env.CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY))return;if(B.current!==null){if(rN1(H,B.current)){if(B.current=null,Math.random()!D.current.has(F));if(J.length>0)D.current=new Set(X),B.current=J[J.length-1]},[X,M,$,A,L,H,G]),{state:M,handleSelect:U}}var QZ,lN1=3000,iN1="tengu_post_compact_survey",nN1=0.2;var LDB=K(()=>{SD();z$();Fo();NA();_L();XgA();Nw$();QZ=b(s(),1)});function IDB({onSelect:H,inputValue:$,setInputValue:A,message:L=tN1}){let I=_O$.useRef($);return _O$.useEffect(()=>{if($!==I.current){let D=fFH($.slice(-1));if(JgA(D))A($.slice(0,-1)),H(oN1[D])}},[$,H,A]),VW.default.createElement(x,{flexDirection:"column",marginTop:1},VW.default.createElement(x,null,VW.default.createElement(V,{color:"ansi:cyan"},"\u25CF "),VW.default.createElement(V,{bold:!0},L)),VW.default.createElement(x,{marginLeft:2},VW.default.createElement(x,{width:10},VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"1"),": Bad")),VW.default.createElement(x,{width:10},VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"2"),": Fine")),VW.default.createElement(x,{width:10},VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"3"),": Good")),VW.default.createElement(x,null,VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"0"),": Dismiss"))))}var VW,_O$,aN1,oN1,JgA=(H)=>aN1.includes(H),tN1="How is Claude doing this session? (optional)";var DDB=K(()=>{xH();VW=b(s(),1),_O$=b(s(),1),aN1=["0","1","2","3"],oN1={"0":"dismissed","1":"bad","2":"fine","3":"good"}});function FgA({state:H,handleSelect:$,inputValue:A,setInputValue:L,message:I}){if(H==="closed")return null;if(H==="thanks")return KdH.default.createElement(x,{marginTop:1,flexDirection:"column"},KdH.default.createElement(V,{color:"success"},"\u2713 Thanks for helping make Claude better!"),KdH.default.createElement(V,{dimColor:!0},"Use ","/feedback"," to share detailed feedback or file a bug."));if(A&&!JgA(A))return null;return KdH.default.createElement(IDB,{onSelect:$,inputValue:A,setInputValue:L,message:I})}var KdH;var BDB=K(()=>{xH();DDB();KdH=b(s(),1)});function EDB(){let{addNotification:H}=wB();fDB.useEffect(()=>{Db().then(($)=>{$.forEach((A,L)=>{let I="low";if(A.type==="error"||A.userActionRequired)I="high";else if(A.type==="path"||A.type==="alias")I="medium";H({key:`install-message-${L}-${A.type}`,text:A.message,priority:I,color:A.type==="error"?"error":"warning"})})})},[H])}var fDB;var MDB=K(()=>{bE();Lj();fDB=b(s(),1)});function sN1(){if(process.argv.includes("--chrome"))return!0;if(process.argv.includes("--no-chrome"))return!1;return}function GDB(){let{addNotification:H}=wB();lz.useEffect(()=>{let $=sN1();if(!eT$($))return;if(!nL()){H({key:"chrome-requires-subscription",jsx:lz.createElement(V,{color:"error"},"Claude in Chrome requires a claude.ai subscription"),priority:"immediate",timeoutMs:5000});return}Vd().then((A)=>{if(!A&&!plA())H({key:"chrome-extension-not-detected",jsx:lz.createElement(lz.Fragment,null,lz.createElement(V,{color:"warning"},"Chrome extension not detected \xB7 https://claude.ai/chrome to install")),priority:"immediate",timeoutMs:3000});else if($===void 0)H({key:"claude-in-chrome-default-enabled",text:"Claude in Chrome enabled \xB7 /chrome",priority:"low"})}).catch((A)=>{r(A)})},[H])}var lz;var UDB=K(()=>{xH();H8H();bE();_$();EI();NA();lz=b(s(),1)});function eN1(){return A$(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)}function XDB(H){let $=YO$.INITIAL_DELAY_MS*Math.pow(YO$.BACKOFF_MULTIPLIER,H);return Math.min($,YO$.MAX_DELAY_MS)}function HO1(H){if(!H.officialMarketplaceAutoInstallAttempted)return!0;if(H.officialMarketplaceAutoInstalled)return!1;let $=H.officialMarketplaceAutoInstallFailReason,A=H.officialMarketplaceAutoInstallRetryCount||0,L=H.officialMarketplaceAutoInstallNextRetryTime,I=Date.now();if(A>=YO$.MAX_ATTEMPTS)return!1;if($==="policy_blocked")return!1;if(L&&I({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"policy_blocked"})),c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,policy_blocked:!0}),{installed:!1,skipped:!0,reason:"policy_blocked"};if((await l1())[r1H])return N(`Official marketplace '${r1H}' already installed, skipping`),AA((I)=>({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!0})),{installed:!1,skipped:!0,reason:"already_installed"};if(!vDH(VvA))return N("Official marketplace blocked by enterprise policy, skipping"),AA((I)=>({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"policy_blocked"})),c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,policy_blocked:!0}),{installed:!1,skipped:!0,reason:"policy_blocked"};if(!await pX$()){N("Git not available, skipping official marketplace auto-install");let I=(H.officialMarketplaceAutoInstallRetryCount||0)+1,D=Date.now(),B=XDB(I),f=D+B,E=!1;try{AA((M)=>({...M,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"git_unavailable",officialMarketplaceAutoInstallRetryCount:I,officialMarketplaceAutoInstallLastAttemptTime:D,officialMarketplaceAutoInstallNextRetryTime:f}))}catch(M){E=!0;let G=M instanceof Error?M:Error(`Failed to save marketplace auto-install git_unavailable state: ${M}`);r(G),N(`Failed to save marketplace auto-install git_unavailable state: ${M}`,{level:"error"})}return c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,git_unavailable:!0,retry_count:I}),{installed:!1,skipped:!0,reason:"git_unavailable",configSaveFailed:E}}N("Attempting to auto-install official marketplace"),await uw(VvA),N("Successfully auto-installed official marketplace");let L=H.officialMarketplaceAutoInstallRetryCount||0;return AA((I)=>({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!0,officialMarketplaceAutoInstallFailReason:void 0,officialMarketplaceAutoInstallRetryCount:void 0,officialMarketplaceAutoInstallLastAttemptTime:void 0,officialMarketplaceAutoInstallNextRetryTime:void 0})),c("tengu_official_marketplace_auto_install",{installed:!0,skipped:!1,retry_count:L}),{installed:!0,skipped:!1}}catch($){let A=$ instanceof Error?$.message:String($);N(`Failed to auto-install official marketplace: ${A}`,{level:"error"}),r($ instanceof Error?$:Error(`Official marketplace auto-install failed: ${A}`));let L=(H.officialMarketplaceAutoInstallRetryCount||0)+1,I=Date.now(),D=XDB(L),B=I+D,f=!1;try{AA((E)=>({...E,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"unknown",officialMarketplaceAutoInstallRetryCount:L,officialMarketplaceAutoInstallLastAttemptTime:I,officialMarketplaceAutoInstallNextRetryTime:B}))}catch(E){f=!0;let M=E instanceof Error?E:Error(`Failed to save marketplace auto-install failure state: ${E}`);r(M),N(`Failed to save marketplace auto-install failure state: ${E}`,{level:"error"})}return c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,failed:!0,retry_count:L}),{installed:!1,skipped:!0,reason:"unknown",configSaveFailed:f}}}var YO$;var KgA=K(()=>{hT$();kKA();Ja();y4();vA();E$();_$();z$();NA();YO$={MAX_ATTEMPTS:10,INITIAL_DELAY_MS:3600000,BACKOFF_MULTIPLIER:2,MAX_DELAY_MS:604800000}});function JDB(){let{addNotification:H}=wB(),$=WZ.useRef(!1);WZ.useEffect(()=>{if($.current)return;$.current=!0,CO$().then((A)=>{if(A.configSaveFailed)N("Showing marketplace config save failure notification"),H({key:"marketplace-config-save-failed",jsx:WZ.createElement(V,{color:"error"},"Failed to save marketplace retry info \xB7 Check ~/.claude.json permissions"),priority:"immediate",timeoutMs:1e4});if(A.installed)N("Showing marketplace installation success notification"),H({key:"marketplace-installed",jsx:WZ.createElement(V,{color:"success"},"\u2713 Anthropic marketplace installed \xB7 /plugin to see available plugins"),priority:"immediate",timeoutMs:7000});else if(A.skipped&&A.reason==="unknown")N("Showing marketplace installation failure notification"),H({key:"marketplace-install-failed",jsx:WZ.createElement(V,{color:"warning"},"Failed to install Anthropic marketplace \xB7 Will retry on next startup"),priority:"immediate",timeoutMs:8000});else if(A.skipped&&A.reason==="git_unavailable")N("Showing marketplace git unavailable notification"),H({key:"marketplace-git-unavailable",jsx:WZ.createElement(V,{color:"warning"},"Anthropic marketplace requires git \xB7 Install git and restart"),priority:"immediate",timeoutMs:8000})}).catch((A)=>{r(A instanceof Error?A:Error(String(A)))})},[H])}var WZ;var FDB=K(()=>{xH();bE();KgA();_$();E$();WZ=b(s(),1)});function KDB(H,$,A){let L=QdH.useRef(void 0);QdH.useEffect(()=>{return},[H,$]),QdH.useEffect(()=>{let I=H.find((B)=>B.type==="connected"&&B.name===dw);if(!I)return;Vx("set_permission_mode",{mode:A==="bypassPermissions"?"skip_all_permission_checks":"ask"},I)},[H,A])}var QdH,$O1;var QDB=K(()=>{mI();_$();CP();nS();f3();QdH=b(s(),1),$O1=S.object({method:S.literal("notifications/message"),params:S.object({prompt:S.string(),image:S.object({type:S.literal("base64"),media_type:S.enum(["image/jpeg","image/png","image/gif","image/webp"]),data:S.string()}).optional(),tabId:S.number().optional()})})});function WDB(){return M$().tipsHistory||{}}function AO1(H){AA(($)=>{if($.tipsHistory===H)return $;return{...$,tipsHistory:H}})}function VDB(H){let $=WDB(),A=M$().numStartups;$[H]=A,AO1($)}function LO1(H){return WDB()[H]||0}function wO$(H){let $=LO1(H);if($===0)return 1/0;return M$().numStartups-$}var QgA=K(()=>{vA()});async function DO1(){return"claude-code-plugins"in await l1()}async function ZO$(H){let $=[...BO1,...fO1],A=await Promise.all($.map((L)=>L.isRelevant(H)));return $.filter((L,I)=>A[I]).filter((L)=>wO$(L.id)>=L.cooldownSessions)}var BO1,fO1;var WgA=K(()=>{r0();vA();t8();Q7();y4();aI();Tq$();BDH();Z1();nU();Z9();ZgH();FG();mL();QgA();rB();AC();E$();Cn();Y7();Jd();rgH();AJ();BO1=[{id:"new-user-warmup",content:async()=>"Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits",cooldownSessions:3,async isRelevant(){return M$().numStartups<10}},{id:"plan-mode-for-complex-tasks",content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${CQ("chat:cycleMode","Chat","shift+tab")} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let H=M$();return(H.lastPlanModeUse?(Date.now()-H.lastPlanModeUse)/86400000:1/0)>7}},{id:"default-permission-mode-config",content:async()=>"Use /config to change your default permission mode (including Plan Mode)",cooldownSessions:10,isRelevant:async()=>{try{let H=M$(),$=VL(),A=Boolean(H.lastPlanModeUse),L=Boolean($?.permissions?.defaultMode);return A&&!L}catch(H){return N(`Failed to check default-permission-mode-config tip relevance: ${H}`,{level:"warn"}),!1}}},{id:"git-worktrees",content:async()=>"Use git worktrees to run multiple Claude sessions in parallel.",cooldownSessions:10,isRelevant:async()=>{try{let H=M$();return await VwH()<=1&&H.numStartups>50}catch(H){return!1}}},{id:"terminal-setup",content:async()=>OA.terminal==="Apple_Terminal"?"Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more":"Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more",cooldownSessions:10,async isRelevant(){let H=M$();if(OA.terminal==="Apple_Terminal")return q1H.isEnabled()&&!H.optionAsMetaKeyInstalled;return q1H.isEnabled()&&!H.shiftEnterKeyBindingInstalled}},{id:"shift-enter",content:async()=>OA.terminal==="Apple_Terminal"?"Press Option+Enter to send a multi-line message":"Press Shift+Enter to send a multi-line message",cooldownSessions:10,async isRelevant(){let H=M$();return Boolean((OA.terminal==="Apple_Terminal"?H.optionAsMetaKeyInstalled:H.shiftEnterKeyBindingInstalled)&&H.numStartups>3)}},{id:"shift-enter-setup",content:async()=>OA.terminal==="Apple_Terminal"?"Run /terminal-setup to enable Option+Enter for new lines":"Run /terminal-setup to enable Shift+Enter for new lines",cooldownSessions:10,async isRelevant(){if(!AFH())return!1;let H=M$();return!(OA.terminal==="Apple_Terminal"?H.optionAsMetaKeyInstalled:H.shiftEnterKeyBindingInstalled)}},{id:"memory-command",content:async()=>"Use /memory to view and manage Claude memory",cooldownSessions:15,async isRelevant(){return M$().memoryUsageCount<=0}},{id:"theme-command",content:async()=>"Use /theme to change the color theme",cooldownSessions:20,isRelevant:async()=>!0},{id:"colorterm-truecolor",content:async()=>"Try setting environment variable COLORTERM=truecolor for richer colors",cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&oH.level<3},{id:"status-line",content:async()=>"Use /statusline to set up a custom status line that will display beneath the input box",cooldownSessions:25,isRelevant:async()=>VL().statusLine===void 0},{id:"prompt-queue",content:async()=>"Hit Enter to queue up additional messages while Claude is working.",cooldownSessions:5,async isRelevant(){return M$().promptQueueUseCount<=3}},{id:"enter-to-steer-in-relatime",content:async()=>"Send messages to Claude while it works to steer Claude in real-time",cooldownSessions:20,isRelevant:async()=>!0},{id:"todo-list",content:async()=>"Ask Claude to create a todo list when working on complex tasks to track progress and remain on track",cooldownSessions:20,isRelevant:async()=>!0},{id:"vscode-command-install",content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${OA.terminal==="vscode"?"code":OA.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!njH())return!1;if(oA()!=="macos")return!1;switch(OA.terminal){case"vscode":return!await sZI();case"cursor":return!await oZI();case"windsurf":return!await tZI();default:return!1}}},{id:"ide-upsell-external-terminal",content:async()=>"Connect Claude to your IDE \xB7 /ide",cooldownSessions:4,async isRelevant(){if(ZF())return!1;if(xX$().length!==0)return!1;return(await eZI()).length>0}},{id:"install-github-app",content:async()=>"Run /install-github-app to tag @claude right from your Github issues and PRs",cooldownSessions:10,isRelevant:async()=>!M$().githubActionSetupCount},{id:"install-slack-app",content:async()=>"Run /install-slack-app to use Claude in Slack",cooldownSessions:10,isRelevant:async()=>!M$().slackAppInstallCount},{id:"permissions",content:async()=>"Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools",cooldownSessions:10,async isRelevant(){return M$().numStartups>10}},{id:"drag-and-drop-images",content:async()=>"Did you know you can drag and drop image files into your terminal?",cooldownSessions:10,isRelevant:async()=>!OA.isSSH()},{id:"paste-images-mac",content:async()=>"Paste images into Claude Code using control+v (not cmd+v!)",cooldownSessions:10,isRelevant:async()=>oA()==="macos"},{id:"double-esc",content:async()=>"Double-tap esc to rewind the conversation to a previous point in time",cooldownSessions:10,isRelevant:async()=>!gE()},{id:"double-esc-code-restore",content:async()=>"Double-tap esc to rewind the code and/or conversation to a previous point in time",cooldownSessions:10,isRelevant:async()=>gE()},{id:"continue",content:async()=>"Run claude --continue or claude --resume to resume a conversation",cooldownSessions:10,isRelevant:async()=>!0},{id:"rename-conversation",content:async()=>"Name your conversations with /rename to find them easily in /resume later",cooldownSessions:15,isRelevant:async()=>Kd()&&M$().numStartups>10},{id:"custom-commands",content:async()=>"Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project",cooldownSessions:15,async isRelevant(){return M$().numStartups>10}},{id:"shift-tab",content:async()=>`Hit ${CQ("chat:cycleMode","Chat","shift+tab")} to cycle between default mode, auto-accept edit mode, and plan mode`,cooldownSessions:10,isRelevant:async()=>!0},{id:"image-paste",content:async()=>`Use ${e3H.displayText} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:"custom-agents",content:async()=>"Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer",cooldownSessions:15,async isRelevant(){return M$().numStartups>5}},{id:"agent-flag",content:async()=>"Use --agent to directly start a conversation with a subagent",cooldownSessions:15,async isRelevant(){return M$().numStartups>5}},{id:"desktop-app",content:async()=>"Run Claude Code locally or remotely using the Claude desktop app: clau.de/desktop",cooldownSessions:15,isRelevant:async()=>oA()!=="linux"},{id:"web-app",content:async()=>"Use Claude Code on the web: clau.de/web",cooldownSessions:15,isRelevant:async()=>!0},{id:"mobile-app",content:async()=>"Use /mobile to get Claude on your phone",cooldownSessions:15,isRelevant:async()=>!0},{id:"opusplan-mode-reminder",content:async()=>`Your default model setting is Opus Plan Mode. Press ${CQ("chat:cycleMode","Chat","shift+tab")} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){let H=M$(),A=DLH()==="opusplan",L=H.lastPlanModeUse?(Date.now()-H.lastPlanModeUse)/86400000:1/0;return A&&L>3}},{id:"frontend-design-plugin",content:async(H)=>{let $=await DO1(),A=ZL("suggestion",H.theme);if(!$)return`Working with HTML/CSS? Add the frontend-design plugin: ${A("/plugin marketplace add anthropics/claude-code")} ${A("/plugin install frontend-design@claude-code-plugins")}`;return`Working with HTML/CSS? Install the frontend-design plugin: ${A("/plugin install frontend-design@claude-code-plugins")}`},cooldownSessions:3,async isRelevant(H){if(K7("frontend-design@claude-code-plugins"))return!1;if(!H?.readFileState)return!1;return yx(H.readFileState).some((A)=>/\.(html|css|htm)$/i.test(A))}},{id:"guest-passes",content:async(H)=>{let $=ZL("claude",H.theme),A=ys();return A?`Share Claude Code and earn ${$(Rs(A))} of extra usage \xB7 ${$("/passes")}`:`You have free guest passes to share \xB7 ${$("/passes")}`},cooldownSessions:3,isRelevant:async()=>{if(M$().hasVisitedPasses)return!1;let{eligible:$}=wT$();return $}},{id:"overage-promo",content:async(H)=>{let $=ZL("claude",H.theme);if(cD()&&Z4())return`${$("$50 free extra usage")} to try fast mode /extra-usage to enable`;return`${$("$50 free extra usage")} \xB7 /extra-usage to enable`},cooldownSessions:3,isRelevant:async()=>ngH()}],fO1=[]});function EO1(H){if(H.length===0)return;if(H.length===1)return H[0];let $=H.map((A)=>({tip:A,sessions:wO$(A.id)}));return $.sort((A,L)=>L.sessions-A.sessions),$[0]?.tip}async function PDB(H){if(VL().spinnerTipsEnabled===!1)return;let $=await ZO$(H);if($.length===0)return;return EO1($)}function _DB(H){VDB(H.id),c("tengu_tip_shown",{tipIdLength:H.id,cooldownSessions:H.cooldownSessions})}var YDB=K(()=>{QgA();z$();mL();WgA()});function wDB(){let H=J$((A)=>A.toolPermissionContext),$=zI();CDB.useEffect(()=>{VgA(H,$)},[])}var CDB,VgA;var ZDB=K(()=>{tD();pL();cg();CDB=b(s(),1),VgA=o$(async(H,$)=>{if(!H.isBypassPermissionsModeAvailable)return;if(!await xbA())return;$((L)=>{return{...L,toolPermissionContext:PFH(L.toolPermissionContext)}})})});function qDB(H,$,A){let L=qO$.useRef(!1);qO$.useEffect(()=>{if(!gE()||L.current)return;if(L.current=!0,H)hY$(H,A)},[$,H,A])}var qO$;var TDB=K(()=>{AC();qO$=b(s(),1)});function PgA({hostPattern:{host:H},onUserResponse:$}){function A(D){switch(D){case"yes":$({allow:!0,persistToSettings:!1});break;case"yes-dont-ask-again":$({allow:!0,persistToSettings:!0});break;case"no":$({allow:!1,persistToSettings:!1});break}}let L=PzH(),I=[{label:"Yes",value:"yes"},...!L?[{label:kG.createElement(V,null,"Yes, and don't ask again for ",kG.createElement(V,{bold:!0},H)),value:"yes-dont-ask-again"}]:[],{label:kG.createElement(V,null,"No, and tell Claude what to do differently ",kG.createElement(V,{bold:!0},"(esc)")),value:"no"}];return kG.createElement(wG,{title:"Network request outside of sandbox"},kG.createElement(x,{flexDirection:"column",paddingX:2,paddingY:1},kG.createElement(x,null,kG.createElement(V,{dimColor:!0},"Host:"),kG.createElement(V,null," ",H)),kG.createElement(x,{marginTop:1},kG.createElement(V,null,"Do you want to allow this connection?")),kG.createElement(x,null,kG.createElement(QA,{options:I,onChange:A,onCancel:()=>{$({allow:!1,persistToSettings:!1})}}))))}var kG;var zDB=K(()=>{xH();EM();N1();Xw();z$();kG=b(s(),1)});var MO1,KhG,TO$=604800000,NDB=86400000,_gA;var WdH=K(()=>{MO1=Math.pow(10,8)*24*60*60*1000,KhG=-MO1,_gA=Symbol.for("constructDateFrom")});function xC(H,$){if(typeof H==="function")return H($);if(H&&typeof H==="object"&&_gA in H)return H[_gA]($);if(H instanceof Date)return new H.constructor($);return new Date($)}var Ye=K(()=>{WdH()});function cX(H,$){return xC($||H,H)}var VZ=K(()=>{Ye()});var ODB=()=>{};var xDB=()=>{};var SDB=()=>{};var jDB=()=>{};var RDB=()=>{};var yDB=()=>{};var vDB=()=>{};var hDB=()=>{};var bDB=()=>{};function Ce(){return GO1}var GO1;var VdH=K(()=>{GO1={}});function gd(H,$){let A=Ce(),L=$?.weekStartsOn??$?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,I=cX(H,$?.in),D=I.getDay(),B=(D{VdH();VZ()});function x8H(H,$){return gd(H,{...$,weekStartsOn:1})}var PdH=K(()=>{I_H()});function zO$(H,$){let A=cX(H,$?.in),L=A.getFullYear(),I=xC(A,0);I.setFullYear(L+1,0,4),I.setHours(0,0,0,0);let D=x8H(I),B=xC(A,0);B.setFullYear(L,0,4),B.setHours(0,0,0,0);let f=x8H(B);if(A.getTime()>=D.getTime())return L+1;else if(A.getTime()>=f.getTime())return L;else return L-1}var NO$=K(()=>{Ye();PdH();VZ()});function YgA(H){let $=cX(H),A=new Date(Date.UTC($.getFullYear(),$.getMonth(),$.getDate(),$.getHours(),$.getMinutes(),$.getSeconds(),$.getMilliseconds()));return A.setUTCFullYear($.getFullYear()),+H-+A}var kDB=K(()=>{VZ()});function uDB(H,...$){let A=xC.bind(null,H||$.find((L)=>typeof L==="object"));return $.map(A)}var gDB=K(()=>{Ye()});function CgA(H,$){let A=cX(H,$?.in);return A.setHours(0,0,0,0),A}var wgA=K(()=>{VZ()});function mDB(H,$,A){let[L,I]=uDB(A?.in,H,$),D=CgA(L),B=CgA(I),f=+D-YgA(D),E=+B-YgA(B);return Math.round((f-E)/NDB)}var ZgA=K(()=>{kDB();gDB();WdH();wgA()});function pDB(H,$){let A=zO$(H,$),L=xC($?.in||H,0);return L.setFullYear(A,0,4),L.setHours(0,0,0,0),x8H(L)}var qgA=K(()=>{Ye();NO$();PdH()});var dDB=()=>{};var cDB=()=>{};var lDB=()=>{};var iDB=()=>{};var nDB=()=>{};var rDB=()=>{};var aDB=()=>{};var oDB=()=>{};var tDB=()=>{};var sDB=()=>{};var eDB=()=>{};var HBB=()=>{};var $BB=()=>{};var ABB=()=>{};var LBB=()=>{};var IBB=()=>{};var DBB=()=>{};var BBB=()=>{};function fBB(H){return H instanceof Date||typeof H==="object"&&Object.prototype.toString.call(H)==="[object Date]"}var TgA=()=>{};function EBB(H){return!(!fBB(H)&&typeof H!=="number"||isNaN(+cX(H)))}var zgA=K(()=>{TgA();VZ()});var MBB=()=>{};var GBB=()=>{};var UBB=()=>{};var XBB=()=>{};var JBB=()=>{};var FBB=()=>{};var KBB=()=>{};var QBB=()=>{};var WBB=()=>{};var VBB=()=>{};var PBB=()=>{};var _BB=()=>{};var YBB=()=>{};var CBB=()=>{};var wBB=()=>{};var ZBB=()=>{};var qBB=()=>{};var TBB=()=>{};var zBB=()=>{};var NBB=()=>{};var OBB=()=>{};var xBB=()=>{};var SBB=()=>{};var jBB=()=>{};var RBB=()=>{};var yBB=()=>{};var vBB=()=>{};var hBB=()=>{};var bBB=()=>{};var kBB=()=>{};var uBB=()=>{};var gBB=()=>{};var mBB=()=>{};function pBB(H,$){let A=cX(H,$?.in);return A.setFullYear(A.getFullYear(),0,1),A.setHours(0,0,0,0),A}var NgA=K(()=>{VZ()});var dBB=()=>{};var cBB=()=>{};var lBB=()=>{};var iBB=()=>{};var nBB=()=>{};var rBB=()=>{};var aBB=()=>{};var oBB=()=>{};var tBB=()=>{};var sBB=()=>{};var eBB=()=>{};var H0B=()=>{};var $0B=()=>{};var UO1,A0B=(H,$,A)=>{let L,I=UO1[H];if(typeof I==="string")L=I;else if($===1)L=I.one;else L=I.other.replace("{{count}}",$.toString());if(A?.addSuffix)if(A.comparison&&A.comparison>0)return"in "+L;else return L+" ago";return L};var L0B=K(()=>{UO1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}}});function OO$(H){return($={})=>{let A=$.width?String($.width):H.defaultWidth;return H.formats[A]||H.formats[H.defaultWidth]}}var XO1,JO1,FO1,I0B;var D0B=K(()=>{XO1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},JO1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FO1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},I0B={date:OO$({formats:XO1,defaultWidth:"full"}),time:OO$({formats:JO1,defaultWidth:"full"}),dateTime:OO$({formats:FO1,defaultWidth:"full"})}});var KO1,B0B=(H,$,A,L)=>KO1[H];var f0B=K(()=>{KO1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"}});function D_H(H){return($,A)=>{let L=A?.context?String(A.context):"standalone",I;if(L==="formatting"&&H.formattingValues){let B=H.defaultFormattingWidth||H.defaultWidth,f=A?.width?String(A.width):B;I=H.formattingValues[f]||H.formattingValues[B]}else{let B=H.defaultWidth,f=A?.width?String(A.width):H.defaultWidth;I=H.values[f]||H.values[B]}let D=H.argumentCallback?H.argumentCallback($):$;return I[D]}}var QO1,WO1,VO1,PO1,_O1,YO1,CO1=(H,$)=>{let A=Number(H),L=A%100;if(L>20||L<10)switch(L%10){case 1:return A+"st";case 2:return A+"nd";case 3:return A+"rd"}return A+"th"},E0B;var M0B=K(()=>{QO1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},WO1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},VO1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},PO1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_O1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},YO1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},E0B={ordinalNumber:CO1,era:D_H({values:QO1,defaultWidth:"wide"}),quarter:D_H({values:WO1,defaultWidth:"wide",argumentCallback:(H)=>H-1}),month:D_H({values:VO1,defaultWidth:"wide"}),day:D_H({values:PO1,defaultWidth:"wide"}),dayPeriod:D_H({values:_O1,defaultWidth:"wide",formattingValues:YO1,defaultFormattingWidth:"wide"})}});function B_H(H){return($,A={})=>{let L=A.width,I=L&&H.matchPatterns[L]||H.matchPatterns[H.defaultMatchWidth],D=$.match(I);if(!D)return null;let B=D[0],f=L&&H.parsePatterns[L]||H.parsePatterns[H.defaultParseWidth],E=Array.isArray(f)?ZO1(f,(U)=>U.test(B)):wO1(f,(U)=>U.test(B)),M;M=H.valueCallback?H.valueCallback(E):E,M=A.valueCallback?A.valueCallback(M):M;let G=$.slice(B.length);return{value:M,rest:G}}}function wO1(H,$){for(let A in H)if(Object.prototype.hasOwnProperty.call(H,A)&&$(H[A]))return A;return}function ZO1(H,$){for(let A=0;A{let L=$.match(H.matchPattern);if(!L)return null;let I=L[0],D=$.match(H.parsePattern);if(!D)return null;let B=H.valueCallback?H.valueCallback(D[0]):D[0];B=A.valueCallback?A.valueCallback(B):B;let f=$.slice(I.length);return{value:B,rest:f}}}var qO1,TO1,zO1,NO1,OO1,xO1,SO1,jO1,RO1,yO1,vO1,hO1,U0B;var X0B=K(()=>{qO1=/^(\d+)(th|st|nd|rd)?/i,TO1=/\d+/i,zO1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},NO1={any:[/^b/i,/^(a|c)/i]},OO1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xO1={any:[/1/i,/2/i,/3/i,/4/i]},SO1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jO1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},RO1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},yO1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vO1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hO1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},U0B={ordinalNumber:G0B({matchPattern:qO1,parsePattern:TO1,valueCallback:(H)=>parseInt(H,10)}),era:B_H({matchPatterns:zO1,defaultMatchWidth:"wide",parsePatterns:NO1,defaultParseWidth:"any"}),quarter:B_H({matchPatterns:OO1,defaultMatchWidth:"wide",parsePatterns:xO1,defaultParseWidth:"any",valueCallback:(H)=>H+1}),month:B_H({matchPatterns:SO1,defaultMatchWidth:"wide",parsePatterns:jO1,defaultParseWidth:"any"}),day:B_H({matchPatterns:RO1,defaultMatchWidth:"wide",parsePatterns:yO1,defaultParseWidth:"any"}),dayPeriod:B_H({matchPatterns:vO1,defaultMatchWidth:"any",parsePatterns:hO1,defaultParseWidth:"any"})}});var OgA;var J0B=K(()=>{L0B();D0B();f0B();M0B();X0B();OgA={code:"en-US",formatDistance:A0B,formatLong:I0B,formatRelative:B0B,localize:E0B,match:U0B,options:{weekStartsOn:0,firstWeekContainsDate:1}}});var F0B=K(()=>{J0B()});function K0B(H,$){let A=cX(H,$?.in);return mDB(A,pBB(A))+1}var xgA=K(()=>{ZgA();NgA();VZ()});function Q0B(H,$){let A=cX(H,$?.in),L=+x8H(A)-+pDB(A);return Math.round(L/TO$)+1}var SgA=K(()=>{WdH();PdH();qgA();VZ()});function xO$(H,$){let A=cX(H,$?.in),L=A.getFullYear(),I=Ce(),D=$?.firstWeekContainsDate??$?.locale?.options?.firstWeekContainsDate??I.firstWeekContainsDate??I.locale?.options?.firstWeekContainsDate??1,B=xC($?.in||H,0);B.setFullYear(L+1,0,D),B.setHours(0,0,0,0);let f=gd(B,$),E=xC($?.in||H,0);E.setFullYear(L,0,D),E.setHours(0,0,0,0);let M=gd(E,$);if(+A>=+f)return L+1;else if(+A>=+M)return L;else return L-1}var SO$=K(()=>{VdH();Ye();I_H();VZ()});function W0B(H,$){let A=Ce(),L=$?.firstWeekContainsDate??$?.locale?.options?.firstWeekContainsDate??A.firstWeekContainsDate??A.locale?.options?.firstWeekContainsDate??1,I=xO$(H,$),D=xC($?.in||H,0);return D.setFullYear(I,0,L),D.setHours(0,0,0,0),gd(D,$)}var jgA=K(()=>{VdH();Ye();SO$();I_H()});function V0B(H,$){let A=cX(H,$?.in),L=+gd(A,$)-+W0B(A,$);return Math.round(L/TO$)+1}var RgA=K(()=>{WdH();I_H();jgA();VZ()});function _E(H,$){let A=H<0?"-":"",L=Math.abs(H).toString().padStart($,"0");return A+L}var md;var P0B=K(()=>{md={y(H,$){let A=H.getFullYear(),L=A>0?A:1-A;return _E($==="yy"?L%100:L,$.length)},M(H,$){let A=H.getMonth();return $==="M"?String(A+1):_E(A+1,2)},d(H,$){return _E(H.getDate(),$.length)},a(H,$){let A=H.getHours()/12>=1?"pm":"am";switch($){case"a":case"aa":return A.toUpperCase();case"aaa":return A;case"aaaaa":return A[0];case"aaaa":default:return A==="am"?"a.m.":"p.m."}},h(H,$){return _E(H.getHours()%12||12,$.length)},H(H,$){return _E(H.getHours(),$.length)},m(H,$){return _E(H.getMinutes(),$.length)},s(H,$){return _E(H.getSeconds(),$.length)},S(H,$){let A=$.length,L=H.getMilliseconds(),I=Math.trunc(L*Math.pow(10,A-3));return _E(I,$.length)}}});function _0B(H,$=""){let A=H>0?"-":"+",L=Math.abs(H),I=Math.trunc(L/60),D=L%60;if(D===0)return A+String(I);return A+String(I)+$+_E(D,2)}function Y0B(H,$){if(H%60===0)return(H>0?"-":"+")+_E(Math.abs(H)/60,2);return S8H(H,$)}function S8H(H,$=""){let A=H>0?"-":"+",L=Math.abs(H),I=_E(Math.trunc(L/60),2),D=_E(L%60,2);return A+I+$+D}var f_H,ygA;var C0B=K(()=>{xgA();SgA();NO$();RgA();SO$();P0B();f_H={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ygA={G:function(H,$,A){let L=H.getFullYear()>0?1:0;switch($){case"G":case"GG":case"GGG":return A.era(L,{width:"abbreviated"});case"GGGGG":return A.era(L,{width:"narrow"});case"GGGG":default:return A.era(L,{width:"wide"})}},y:function(H,$,A){if($==="yo"){let L=H.getFullYear(),I=L>0?L:1-L;return A.ordinalNumber(I,{unit:"year"})}return md.y(H,$)},Y:function(H,$,A,L){let I=xO$(H,L),D=I>0?I:1-I;if($==="YY"){let B=D%100;return _E(B,2)}if($==="Yo")return A.ordinalNumber(D,{unit:"year"});return _E(D,$.length)},R:function(H,$){let A=zO$(H);return _E(A,$.length)},u:function(H,$){let A=H.getFullYear();return _E(A,$.length)},Q:function(H,$,A){let L=Math.ceil((H.getMonth()+1)/3);switch($){case"Q":return String(L);case"QQ":return _E(L,2);case"Qo":return A.ordinalNumber(L,{unit:"quarter"});case"QQQ":return A.quarter(L,{width:"abbreviated",context:"formatting"});case"QQQQQ":return A.quarter(L,{width:"narrow",context:"formatting"});case"QQQQ":default:return A.quarter(L,{width:"wide",context:"formatting"})}},q:function(H,$,A){let L=Math.ceil((H.getMonth()+1)/3);switch($){case"q":return String(L);case"qq":return _E(L,2);case"qo":return A.ordinalNumber(L,{unit:"quarter"});case"qqq":return A.quarter(L,{width:"abbreviated",context:"standalone"});case"qqqqq":return A.quarter(L,{width:"narrow",context:"standalone"});case"qqqq":default:return A.quarter(L,{width:"wide",context:"standalone"})}},M:function(H,$,A){let L=H.getMonth();switch($){case"M":case"MM":return md.M(H,$);case"Mo":return A.ordinalNumber(L+1,{unit:"month"});case"MMM":return A.month(L,{width:"abbreviated",context:"formatting"});case"MMMMM":return A.month(L,{width:"narrow",context:"formatting"});case"MMMM":default:return A.month(L,{width:"wide",context:"formatting"})}},L:function(H,$,A){let L=H.getMonth();switch($){case"L":return String(L+1);case"LL":return _E(L+1,2);case"Lo":return A.ordinalNumber(L+1,{unit:"month"});case"LLL":return A.month(L,{width:"abbreviated",context:"standalone"});case"LLLLL":return A.month(L,{width:"narrow",context:"standalone"});case"LLLL":default:return A.month(L,{width:"wide",context:"standalone"})}},w:function(H,$,A,L){let I=V0B(H,L);if($==="wo")return A.ordinalNumber(I,{unit:"week"});return _E(I,$.length)},I:function(H,$,A){let L=Q0B(H);if($==="Io")return A.ordinalNumber(L,{unit:"week"});return _E(L,$.length)},d:function(H,$,A){if($==="do")return A.ordinalNumber(H.getDate(),{unit:"date"});return md.d(H,$)},D:function(H,$,A){let L=K0B(H);if($==="Do")return A.ordinalNumber(L,{unit:"dayOfYear"});return _E(L,$.length)},E:function(H,$,A){let L=H.getDay();switch($){case"E":case"EE":case"EEE":return A.day(L,{width:"abbreviated",context:"formatting"});case"EEEEE":return A.day(L,{width:"narrow",context:"formatting"});case"EEEEEE":return A.day(L,{width:"short",context:"formatting"});case"EEEE":default:return A.day(L,{width:"wide",context:"formatting"})}},e:function(H,$,A,L){let I=H.getDay(),D=(I-L.weekStartsOn+8)%7||7;switch($){case"e":return String(D);case"ee":return _E(D,2);case"eo":return A.ordinalNumber(D,{unit:"day"});case"eee":return A.day(I,{width:"abbreviated",context:"formatting"});case"eeeee":return A.day(I,{width:"narrow",context:"formatting"});case"eeeeee":return A.day(I,{width:"short",context:"formatting"});case"eeee":default:return A.day(I,{width:"wide",context:"formatting"})}},c:function(H,$,A,L){let I=H.getDay(),D=(I-L.weekStartsOn+8)%7||7;switch($){case"c":return String(D);case"cc":return _E(D,$.length);case"co":return A.ordinalNumber(D,{unit:"day"});case"ccc":return A.day(I,{width:"abbreviated",context:"standalone"});case"ccccc":return A.day(I,{width:"narrow",context:"standalone"});case"cccccc":return A.day(I,{width:"short",context:"standalone"});case"cccc":default:return A.day(I,{width:"wide",context:"standalone"})}},i:function(H,$,A){let L=H.getDay(),I=L===0?7:L;switch($){case"i":return String(I);case"ii":return _E(I,$.length);case"io":return A.ordinalNumber(I,{unit:"day"});case"iii":return A.day(L,{width:"abbreviated",context:"formatting"});case"iiiii":return A.day(L,{width:"narrow",context:"formatting"});case"iiiiii":return A.day(L,{width:"short",context:"formatting"});case"iiii":default:return A.day(L,{width:"wide",context:"formatting"})}},a:function(H,$,A){let I=H.getHours()/12>=1?"pm":"am";switch($){case"a":case"aa":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"});case"aaa":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return A.dayPeriod(I,{width:"narrow",context:"formatting"});case"aaaa":default:return A.dayPeriod(I,{width:"wide",context:"formatting"})}},b:function(H,$,A){let L=H.getHours(),I;if(L===12)I=f_H.noon;else if(L===0)I=f_H.midnight;else I=L/12>=1?"pm":"am";switch($){case"b":case"bb":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"});case"bbb":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return A.dayPeriod(I,{width:"narrow",context:"formatting"});case"bbbb":default:return A.dayPeriod(I,{width:"wide",context:"formatting"})}},B:function(H,$,A){let L=H.getHours(),I;if(L>=17)I=f_H.evening;else if(L>=12)I=f_H.afternoon;else if(L>=4)I=f_H.morning;else I=f_H.night;switch($){case"B":case"BB":case"BBB":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"});case"BBBBB":return A.dayPeriod(I,{width:"narrow",context:"formatting"});case"BBBB":default:return A.dayPeriod(I,{width:"wide",context:"formatting"})}},h:function(H,$,A){if($==="ho"){let L=H.getHours()%12;if(L===0)L=12;return A.ordinalNumber(L,{unit:"hour"})}return md.h(H,$)},H:function(H,$,A){if($==="Ho")return A.ordinalNumber(H.getHours(),{unit:"hour"});return md.H(H,$)},K:function(H,$,A){let L=H.getHours()%12;if($==="Ko")return A.ordinalNumber(L,{unit:"hour"});return _E(L,$.length)},k:function(H,$,A){let L=H.getHours();if(L===0)L=24;if($==="ko")return A.ordinalNumber(L,{unit:"hour"});return _E(L,$.length)},m:function(H,$,A){if($==="mo")return A.ordinalNumber(H.getMinutes(),{unit:"minute"});return md.m(H,$)},s:function(H,$,A){if($==="so")return A.ordinalNumber(H.getSeconds(),{unit:"second"});return md.s(H,$)},S:function(H,$){return md.S(H,$)},X:function(H,$,A){let L=H.getTimezoneOffset();if(L===0)return"Z";switch($){case"X":return Y0B(L);case"XXXX":case"XX":return S8H(L);case"XXXXX":case"XXX":default:return S8H(L,":")}},x:function(H,$,A){let L=H.getTimezoneOffset();switch($){case"x":return Y0B(L);case"xxxx":case"xx":return S8H(L);case"xxxxx":case"xxx":default:return S8H(L,":")}},O:function(H,$,A){let L=H.getTimezoneOffset();switch($){case"O":case"OO":case"OOO":return"GMT"+_0B(L,":");case"OOOO":default:return"GMT"+S8H(L,":")}},z:function(H,$,A){let L=H.getTimezoneOffset();switch($){case"z":case"zz":case"zzz":return"GMT"+_0B(L,":");case"zzzz":default:return"GMT"+S8H(L,":")}},t:function(H,$,A){let L=Math.trunc(+H/1000);return _E(L,$.length)},T:function(H,$,A){return _E(+H,$.length)}}});var w0B=(H,$)=>{switch(H){case"P":return $.date({width:"short"});case"PP":return $.date({width:"medium"});case"PPP":return $.date({width:"long"});case"PPPP":default:return $.date({width:"full"})}},Z0B=(H,$)=>{switch(H){case"p":return $.time({width:"short"});case"pp":return $.time({width:"medium"});case"ppp":return $.time({width:"long"});case"pppp":default:return $.time({width:"full"})}},bO1=(H,$)=>{let A=H.match(/(P+)(p+)?/)||[],L=A[1],I=A[2];if(!I)return w0B(H,$);let D;switch(L){case"P":D=$.dateTime({width:"short"});break;case"PP":D=$.dateTime({width:"medium"});break;case"PPP":D=$.dateTime({width:"long"});break;case"PPPP":default:D=$.dateTime({width:"full"});break}return D.replace("{{date}}",w0B(L,$)).replace("{{time}}",Z0B(I,$))},q0B;var T0B=K(()=>{q0B={p:Z0B,P:bO1}});function z0B(H){return kO1.test(H)}function N0B(H){return uO1.test(H)}function O0B(H,$,A){let L=mO1(H,$,A);if(console.warn(L),gO1.includes(H))throw RangeError(L)}function mO1(H,$,A){let L=H[0]==="Y"?"years":"days of the month";return`Use \`${H.toLowerCase()}\` instead of \`${H}\` (in \`${$}\`) for formatting ${L} to the input \`${A}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var kO1,uO1,gO1;var x0B=K(()=>{kO1=/^D+$/,uO1=/^Y+$/,gO1=["D","DD","YY","YYYY"]});function S0B(H,$,A){let L=Ce(),I=A?.locale??L.locale??OgA,D=A?.firstWeekContainsDate??A?.locale?.options?.firstWeekContainsDate??L.firstWeekContainsDate??L.locale?.options?.firstWeekContainsDate??1,B=A?.weekStartsOn??A?.locale?.options?.weekStartsOn??L.weekStartsOn??L.locale?.options?.weekStartsOn??0,f=cX(H,A?.in);if(!EBB(f))throw RangeError("Invalid time value");let E=$.match(dO1).map((G)=>{let U=G[0];if(U==="p"||U==="P"){let X=q0B[U];return X(G,I.formatLong)}return G}).join("").match(pO1).map((G)=>{if(G==="''")return{isToken:!1,value:"'"};let U=G[0];if(U==="'")return{isToken:!1,value:nO1(G)};if(ygA[U])return{isToken:!0,value:G};if(U.match(iO1))throw RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return{isToken:!1,value:G}});if(I.localize.preprocessor)E=I.localize.preprocessor(f,E);let M={firstWeekContainsDate:D,weekStartsOn:B,locale:I};return E.map((G)=>{if(!G.isToken)return G.value;let U=G.value;if(!A?.useAdditionalWeekYearTokens&&N0B(U)||!A?.useAdditionalDayOfYearTokens&&z0B(U))O0B(U,$,String(H));let X=ygA[U[0]];return X(f,U,I.localize,M)}).join("")}function nO1(H){let $=H.match(cO1);if(!$)return H;return $[1].replace(lO1,"'")}var pO1,dO1,cO1,lO1,iO1;var j0B=K(()=>{F0B();VdH();C0B();T0B();x0B();zgA();VZ();pO1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dO1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cO1=/^'([^]*?)'?$/,lO1=/''/g,iO1=/[a-zA-Z]/});var R0B=()=>{};var y0B=()=>{};var v0B=()=>{};var h0B=()=>{};var b0B=()=>{};var k0B=()=>{};var u0B=()=>{};var g0B=()=>{};var m0B=()=>{};var p0B=()=>{};var d0B=()=>{};var c0B=()=>{};var l0B=()=>{};var i0B=()=>{};var n0B=()=>{};var r0B=()=>{};var a0B=()=>{};var o0B=()=>{};var t0B=()=>{};var s0B=()=>{};var e0B=()=>{};var H9B=()=>{};var $9B=()=>{};var A9B=()=>{};var L9B=()=>{};var I9B=()=>{};var D9B=()=>{};var B9B=()=>{};var f9B=()=>{};var E9B=()=>{};var M9B=()=>{};var G9B=()=>{};var U9B=()=>{};var X9B=()=>{};var J9B=()=>{};var F9B=()=>{};var K9B=()=>{};var Q9B=()=>{};var W9B=()=>{};var V9B=()=>{};var P9B=()=>{};var _9B=()=>{};var Y9B=()=>{};var C9B=()=>{};var w9B=()=>{};var Z9B=()=>{};var q9B=()=>{};var T9B=()=>{};var z9B=()=>{};var N9B=()=>{};var O9B=()=>{};var x9B=()=>{};var S9B=()=>{};var j9B=()=>{};var R9B=()=>{};var y9B=()=>{};var v9B=()=>{};var h9B=()=>{};var b9B=()=>{};var k9B=()=>{};var u9B=()=>{};var g9B=()=>{};var m9B=()=>{};var p9B=()=>{};var d9B=()=>{};var c9B=()=>{};var l9B=()=>{};var i9B=()=>{};var n9B=()=>{};var r9B=()=>{};var a9B=()=>{};var o9B=()=>{};var t9B=()=>{};var s9B=()=>{};var e9B=()=>{};var H1B=()=>{};var $1B=()=>{};var A1B=()=>{};var L1B=()=>{};var I1B=()=>{};var D1B=()=>{};var B1B=()=>{};var f1B=()=>{};var E1B=()=>{};var M1B=()=>{};var G1B=()=>{};var U1B=()=>{};var X1B=()=>{};var J1B=()=>{};var F1B=()=>{};var K1B=()=>{};var Q1B=()=>{};var W1B=()=>{};var V1B=()=>{};var P1B=()=>{};var _1B=()=>{};var Y1B=()=>{};var C1B=()=>{};var w1B=()=>{};var Z1B=()=>{};var q1B=()=>{};var T1B=()=>{};var z1B=()=>{};var N1B=()=>{};var O1B=()=>{};var x1B=()=>{};var S1B=()=>{};var j1B=()=>{};var R1B=()=>{};var y1B=()=>{};var v1B=()=>{};var h1B=()=>{};var b1B=()=>{};var k1B=()=>{};var u1B=()=>{};var g1B=()=>{};var m1B=()=>{};var p1B=()=>{};var d1B=()=>{};var c1B=()=>{};var l1B=()=>{};var i1B=()=>{};var n1B=()=>{};var r1B=()=>{};var a1B=()=>{};var o1B=()=>{};var t1B=()=>{};var s1B=()=>{};var e1B=()=>{};var H8B=()=>{};var $8B=()=>{};var A8B=()=>{};var L8B=()=>{};var I8B=()=>{};var D8B=()=>{};var B8B=()=>{};var f8B=()=>{};var E8B=()=>{};var M8B=()=>{};var G8B=()=>{};var U8B=()=>{};var X8B=()=>{};var J8B=()=>{};var F8B=()=>{};var K8B=()=>{};var Q8B=()=>{};var W8B=()=>{};var V8B=()=>{};var P8B=()=>{};var _8B=()=>{};var Y8B=()=>{};var C8B=()=>{};var w8B=()=>{};var Z8B=()=>{};var q8B=()=>{};var T8B=K(()=>{SDB();vDB();ODB();bDB();cDB();hDB();lDB();xDB();iDB();nDB();rDB();aDB();oDB();eDB();HBB();$BB();ABB();LBB();Ye();IBB();DBB();MBB();ZgA();GBB();UBB();XBB();FBB();KBB();QBB();WBB();VBB();_BB();YBB();CBB();TBB();zBB();NBB();OBB();xBB();SBB();jBB();RBB();yBB();hBB();bBB();kBB();gBB();dBB();cBB();wBB();lBB();iBB();rBB();aBB();oBB();ZBB();tBB();sBB();eBB();H0B();nBB();mBB();$0B();j0B();R0B();y0B();v0B();h0B();b0B();k0B();u0B();g0B();m0B();p0B();d0B();c0B();l0B();i0B();xgA();n0B();a0B();o0B();t0B();s0B();e0B();SgA();NO$();H9B();$9B();A9B();L9B();I9B();JBB();D9B();B9B();f9B();RgA();E9B();SO$();G9B();U9B();X9B();J9B();F9B();K9B();Q9B();W9B();V9B();P9B();_9B();TgA();Y9B();C9B();w9B();Z9B();q9B();qBB();r0B();j9B();R9B();y9B();BBB();h9B();k9B();u9B();m9B();p9B();d9B();l9B();b9B();i9B();jDB();RDB();n9B();r9B();a9B();o9B();t9B();s9B();e9B();H1B();$1B();A1B();L1B();I1B();zgA();D1B();yDB();B1B();E1B();M1B();U1B();X1B();M9B();J1B();G1B();F1B();K1B();tDB();Q1B();W1B();V1B();P1B();sDB();_1B();Y1B();C1B();w1B();Z1B();q1B();T1B();z1B();N1B();O1B();x1B();S1B();j1B();S9B();R1B();y1B();v1B();h1B();b1B();k1B();u1B();g1B();m1B();p1B();d1B();c1B();l1B();i1B();n1B();r1B();a1B();t1B();s1B();O9B();e1B();H8B();$8B();x9B();N9B();dDB();A8B();L8B();o1B();I8B();D8B();z9B();B8B();f8B();wgA();E8B();v9B();PdH();qgA();g9B();uBB();vBB();c9B();M8B();G8B();I_H();jgA();NgA();U8B();J8B();F8B();f1B();K8B();PBB();Q8B();W8B();X8B();V8B();P8B();_8B();Y8B();VZ();T9B();C8B();w8B();Z8B();q8B()});function z8B(){let[H,$]=_dH.useState([]),[A,L]=_dH.useState(0);if(_dH.useEffect(()=>{let I=vL.getSandboxViolationStore();return I.subscribe((B)=>{$(B.slice(-10)),L(I.getTotalCount())})},[]),!vL.isSandboxingEnabled()||oA()==="linux")return null;if(A===0)return null;return $_.createElement(x,{flexDirection:"column",marginTop:1},$_.createElement(x,{marginLeft:0},$_.createElement(V,{color:"permission"},"\u29C8 Sandbox blocked ",A," total"," ",A===1?"operation":"operations")),H.map((I,D)=>$_.createElement(x,{key:`${I.timestamp.getTime()}-${D}`,paddingLeft:2},$_.createElement(V,{dimColor:!0},S0B(I.timestamp,"h:mm:ssa"),I.command?` ${I.command}:`:""," ",I.line))),$_.createElement(x,{paddingLeft:2},$_.createElement(V,{dimColor:!0},"\u2026 showing last ",Math.min(10,H.length)," of ",A)))}var $_,_dH;var N8B=K(()=>{xH();EM();T8B();Z9();$_=b(s(),1),_dH=b(s(),1)});function x8B({mcpClients:H=[]}){let{addNotification:$}=wB();O8B.useEffect(()=>{let A=H.filter((I)=>I.type==="failed"&&I.config.type!=="sse-ide"&&I.config.type!=="ws-ide"&&I.config.type!=="claudeai-proxy"),L=H.filter((I)=>I.type==="needs-auth"&&I.config.type!=="claudeai-proxy");if(A.length===0&&L.length===0)return;if(A.length>0)$({key:"mcp-failed",jsx:PW.createElement(PW.Fragment,null,PW.createElement(V,{color:"error"},A.length," MCP"," ",A.length===1?"server":"servers"," failed"),PW.createElement(V,{dimColor:!0}," \xB7 /mcp")),priority:"medium"});if(L.length)$({key:"mcp-needs-auth",jsx:PW.createElement(PW.Fragment,null,PW.createElement(V,{color:"warning"},L.length," MCP"," ",L.length===1?"server needs":"servers need"," ","auth"),PW.createElement(V,{dimColor:!0}," \xB7 /mcp")),priority:"medium"})},[$,H])}var PW,O8B;var S8B=K(()=>{xH();bE();PW=b(s(),1),O8B=b(s(),1)});function j8B(){let{addNotification:H}=wB(),$=zI(),[A,L]=lK.useState(!!process.env.ENABLE_LSP_TOOL),I=lK.useRef(new Set),D=lK.useCallback((f,E)=>{let M=`${f}:${E}`;if(I.current.has(M))return;I.current.add(M),N(`LSP error: ${f} - ${E}`),$((U)=>{let X=new Set(U.plugins.errors.map((F)=>{if(F.type==="generic-error")return`generic-error:${F.source}:${F.error}`;return`${F.type}:${F.source}`})),J=`generic-error:${f}:${E}`;if(X.has(J))return U;return{...U,plugins:{...U.plugins,errors:[...U.plugins.errors,{type:"generic-error",source:f,error:E}]}}});let G=f.startsWith("plugin:")?f.split(":")[1]??f:f;H({key:`lsp-error-${f}`,jsx:lK.createElement(lK.Fragment,null,lK.createElement(V,{color:"error"},"LSP for ",G," failed"),lK.createElement(V,{dimColor:!0}," \xB7 /plugin for details")),priority:"medium",timeoutMs:8000})},[H,$]),B=lK.useCallback(()=>{if(!process.env.ENABLE_LSP_TOOL){L(!1);return}let f=w9H();if(f.status==="failed"){D("lsp-manager",f.error.message),L(!1);return}if(f.status==="pending"||f.status==="not-started")return;let E=hp();if(E){let M=E.getAllServers();for(let[G,U]of M)if(U.state==="error"&&U.lastError)D(G,U.lastError.message)}},[D]);VF(B,A?rO1:null),lK.useEffect(()=>{if(process.env.ENABLE_LSP_TOOL)B()},[B])}var lK,rO1=5000;var R8B=K(()=>{xH();bE();pL();s6();Pt();E$();lK=b(s(),1)});async function v8B(H){if(!H||!H.trim())return N("[binaryCheck] Empty command provided, returning false"),!1;let $=H.trim(),A=y8B.get($);if(A!==void 0)return N(`[binaryCheck] Cache hit for '${$}': ${A}`),A;let L=!1;if(await x_($).catch(()=>null))L=!0;return y8B.set($,L),N(`[binaryCheck] Binary '${$}' ${L?"found":"not found"}`),L}var y8B;var h8B=K(()=>{E$();Zk();y8B=new Map});function oO1(H){return M2.has(H.toLowerCase())}function tO1(H){if(!H)return null;if(typeof H==="string")return N("[lspRecommendation] Skipping string path lspServers (not readable from marketplace)"),null;if(Array.isArray(H)){for(let $ of H){if(typeof $==="string")continue;let A=k8B($);if(A)return A}return null}return k8B(H)}function b8B(H){return typeof H==="object"&&H!==null}function k8B(H){let $=new Set,A=null;for(let[L,I]of Object.entries(H)){if(!b8B(I))continue;if(!A&&typeof I.command==="string")A=I.command;let D=I.extensionToLanguage;if(b8B(D))for(let B of Object.keys(D))$.add(B.toLowerCase())}if(!A||$.size===0)return null;return{extensions:$,command:A}}async function sO1(){let H=new Map;try{let $=await l1();for(let A of Object.keys($))try{let L=await GP(A),I=oO1(A);for(let D of L.plugins){if(!D.lspServers)continue;let B=tO1(D.lspServers);if(!B)continue;let f=`${D.name}@${A}`;H.set(f,{entry:D,marketplaceName:A,extensions:B.extensions,command:B.command,isOfficial:I})}}catch(L){N(`[lspRecommendation] Failed to load marketplace ${A}: ${L}`)}}catch($){N(`[lspRecommendation] Failed to load marketplaces config: ${$}`)}return H}async function g8B(H){if(eO1())return N("[lspRecommendation] Recommendations are disabled"),[];let $=u8B.extname(H).toLowerCase();if(!$)return N("[lspRecommendation] No file extension found"),[];N(`[lspRecommendation] Looking for LSP plugins for ${$}`);let A=await sO1(),I=M$().lspRecommendationNeverPlugins??[],D=[];for(let[f,E]of A){if(!E.extensions.has($))continue;if(I.includes(f)){N(`[lspRecommendation] Skipping ${f} (in never suggest list)`);continue}if(K7(f)){N(`[lspRecommendation] Skipping ${f} (already installed)`);continue}D.push({info:E,pluginId:f})}let B=[];for(let{info:f,pluginId:E}of D)if(await v8B(f.command))B.push({info:f,pluginId:E}),N(`[lspRecommendation] Binary '${f.command}' found for ${E}`);else N(`[lspRecommendation] Skipping ${E} (binary '${f.command}' not found)`);return B.sort((f,E)=>{if(f.info.isOfficial&&!E.info.isOfficial)return-1;if(!f.info.isOfficial&&E.info.isOfficial)return 1;return 0}),B.map(({info:f,pluginId:E})=>({pluginId:E,pluginName:f.entry.name,marketplaceName:f.marketplaceName,description:f.entry.description,isOfficial:f.isOfficial,extensions:Array.from(f.extensions),command:f.command}))}function m8B(H){AA(($)=>{let A=$.lspRecommendationNeverPlugins??[];if(A.includes(H))return $;return{...$,lspRecommendationNeverPlugins:[...A,H]}}),N(`[lspRecommendation] Added ${H} to never suggest`)}function p8B(){AA((H)=>{let $=(H.lspRecommendationIgnoredCount??0)+1;return{...H,lspRecommendationIgnoredCount:$}}),N("[lspRecommendation] Incremented ignored count")}function eO1(){let H=M$();return H.lspRecommendationDisabled===!0||(H.lspRecommendationIgnoredCount??0)>=aO1}var u8B,aO1=5;var d8B=K(()=>{y4();UQ();Q7();h8B();vA();E$();u8B=require("path")});function c8B(){let H=J$((f)=>f.fileHistory.trackedFiles),{addNotification:$}=wB(),[A,L]=SC.useState(null),I=SC.useRef(new Set),D=SC.useRef(!1);SC.useEffect(()=>{if(A)return;if(D.current)return;if(Yj$())return;let f=[];for(let M of H)if(!I.current.has(M))I.current.add(M),f.push(M);if(f.length===0)return;D.current=!0,E(f).finally(()=>{D.current=!1});async function E(M){for(let G of M)try{let X=(await g8B(G))[0];if(X){N(`[useLspPluginRecommendation] Found match: ${X.pluginName} for ${G}`),L({pluginId:X.pluginId,pluginName:X.pluginName,pluginDescription:X.description,fileExtension:jO$.extname(G),shownAt:Date.now()}),Cj$(!0);return}}catch(U){r(U instanceof Error?U:Error(String(U)))}}},[H,A]);let B=SC.useCallback((f)=>{if(!A)return;let{pluginId:E,pluginName:M,shownAt:G}=A;switch(N(`[useLspPluginRecommendation] User response: ${f} for ${M}`),f){case"yes":$x1(E,M,$);break;case"no":{let U=Date.now()-G;if(U>=Hx1)N(`[useLspPluginRecommendation] Timeout detected (${U}ms), incrementing ignored count`),p8B();break}case"never":m8B(E);break;case"disable":AA((U)=>{if(U.lspRecommendationDisabled)return U;return{...U,lspRecommendationDisabled:!0}});break}L(null)},[A,$]);return{recommendation:A,handleResponse:B}}async function $x1(H,$,A){try{N(`[useLspPluginRecommendation] Installing plugin: ${H}`);let L=await ZK(H);if(!L)throw Error(`Plugin ${H} not found in marketplace`);let I=typeof L.entry.source==="string"?jO$.join(L.marketplaceInstallLocation,L.entry.source):void 0;await mw(H,L.entry,"user",void 0,I);let D=ZI("userSettings");II("userSettings",{enabledPlugins:{...D?.enabledPlugins,[H]:!0}}),N(`[useLspPluginRecommendation] Plugin installed: ${H}`),A({key:"lsp-plugin-installed",jsx:SC.createElement(V,{color:"success"},pH.tick," ",$," installed \xB7 restart to apply"),priority:"immediate",timeoutMs:5000})}catch(L){r(L instanceof Error?L:Error(String(L))),A({key:"lsp-plugin-install-failed",jsx:SC.createElement(V,{color:"error"},"Failed to install ",$),priority:"immediate",timeoutMs:5000})}}var SC,jO$,Hx1=28000;var l8B=K(()=>{jI();xH();pL();bE();vA();g$();_$();E$();d8B();op();y4();mL();SC=b(s(),1),jO$=require("path")});function i8B(){}function n8B({pluginName:H,pluginDescription:$,fileExtension:A,onResponse:L}){let I=y9.useRef(L);I.current=L,y9.useEffect(()=>{let f=setTimeout(()=>{I.current("no")},Ax1);return()=>clearTimeout(f)},[]);function D(f){switch(f){case"yes":L("yes");break;case"no":L("no");break;case"never":L("never");break;case"disable":L("disable");break}}return y9.createElement(wG,{title:"LSP Plugin Recommendation"},y9.createElement(x,{flexDirection:"column",paddingX:2,paddingY:1},y9.createElement(x,{marginBottom:1},y9.createElement(V,{dimColor:!0},"LSP provides code intelligence like go-to-definition and error checking")),y9.createElement(x,null,y9.createElement(V,{dimColor:!0},"Plugin:"),y9.createElement(V,null," ",H)),$&&y9.createElement(x,null,y9.createElement(V,{dimColor:!0},$)),y9.createElement(x,null,y9.createElement(V,{dimColor:!0},"Triggered by:"),y9.createElement(V,null," ",A," files")),y9.createElement(x,{marginTop:1},y9.createElement(V,null,"Would you like to install this LSP plugin?")),y9.createElement(x,null,y9.createElement(QA,{options:[{label:y9.createElement(V,null,"Yes, install ",y9.createElement(V,{bold:!0},H)),value:"yes"},{label:"No, not now",value:"no"},{label:y9.createElement(V,null,"Never for ",y9.createElement(V,{bold:!0},H)),value:"never"},{label:"Disable all LSP recommendations",value:"disable"}],onChange:D,onCancel:()=>L("no")}))))}var y9,Ax1=30000;var r8B=K(()=>{xH();N1();Xw();y9=b(s(),1)});function a8B(){let{addNotification:H}=wB(),$=J$((D)=>D.plugins.installationStatus),{totalFailed:A,failedMarketplacesCount:L,failedPluginsCount:I}=RO$.useMemo(()=>{if(!$)return{totalFailed:0,failedMarketplacesCount:0,failedPluginsCount:0};let D=$.marketplaces.filter((f)=>f.status==="failed"),B=$.plugins.filter((f)=>f.status==="failed");return{totalFailed:D.length+B.length,failedMarketplacesCount:D.length,failedPluginsCount:B.length}},[$]);RO$.useEffect(()=>{if(!$){N("No installation status to monitor");return}if(A===0)return;if(N(`Plugin installation status: ${L} failed marketplaces, ${I} failed plugins`),A===0)return;N(`Adding notification for ${A} failed installations`),H({key:"plugin-install-failed",jsx:Rb.createElement(Rb.Fragment,null,Rb.createElement(V,{color:"error"},A," plugin",A===1?"":"s"," failed to install"),Rb.createElement(V,{dimColor:!0}," \xB7 /plugin for details")),priority:"medium"})},[H,A,L,I])}var Rb,RO$;var o8B=K(()=>{xH();bE();pL();E$();Rb=b(s(),1),RO$=b(s(),1)});function t8B(){let{addNotification:H}=wB(),[$,A]=YdH.useState([]);YdH.useEffect(()=>{return NLB((I)=>{N(`Plugin autoupdate notification: ${I.length} plugin(s) updated`),A(I)})},[]),YdH.useEffect(()=>{if($.length===0)return;let L=$.map((D)=>{let B=D.indexOf("@");return B>0?D.substring(0,B):D}),I=L.length<=2?L.join(" and "):`${L.length} plugins`;H({key:"plugin-autoupdate-restart",jsx:yb.createElement(yb.Fragment,null,yb.createElement(V,{color:"success"},L.length===1?"Plugin":"Plugins"," updated:"," ",I),yb.createElement(V,{dimColor:!0}," \xB7 Restart to apply")),priority:"low",timeoutMs:1e4}),N(`Showing plugin autoupdate notification for: ${L.join(", ")}`)},[$,H])}var yb,YdH;var s8B=K(()=>{xH();bE();luA();E$();yb=b(s(),1),YdH=b(s(),1)});async function e8B(H){if(N("performStartupChecks called"),!XG(!0)){N("Trust not accepted for current directory - skipping plugin installations");return}try{N("Starting background plugin installations"),await nq$(H)}catch($){N(`Error initiating background plugin installations: ${$}`)}}var HfB=K(()=>{E$();rq$();vA()});function $fB(H){let{addNotification:$}=wB(),A=Zr(),L=I4A(A,H),I=D4A(A),D=j8H.useRef(null),B=$T(),f=f0(),E=my(),M=f==="team"||f==="enterprise",[G,U]=j8H.useState(!1);j8H.useEffect(()=>{if(A.isUsingOverage&&!G&&(!B||!M||E))$({key:"limit-reached",text:I,priority:"immediate"}),U(!0);else if(!A.isUsingOverage&&G)U(!1)},[A.isUsingOverage,I,G,$,B,E,M]),j8H.useEffect(()=>{if(L&&L!==D.current)D.current=L,$({key:"rate-limit-warning",jsx:CdH.createElement(V,null,CdH.createElement(V,{color:"warning"},L)),priority:"high"})},[L,$])}var CdH,j8H;var AfB=K(()=>{bE();py();xH();vA();EI();CdH=b(s(),1),j8H=b(s(),1)});function LfB(){}function Ix1(H){let $=H.toLowerCase(),A=sI();for(let[L,I]of Object.entries(Lx1)){let D=I.retirementDates[A];if(!$.includes(L)||!D)continue;return{isDeprecated:!0,modelName:I.modelName,retirementDate:D}}return{isDeprecated:!1}}function yO$(H){if(!H)return null;let $=Ix1(H);if(!$.isDeprecated)return null;return`\u26A0 ${$.modelName} will be retired on ${$.retirementDate}. Consider switching to a newer model.`}var Lx1;var vgA=K(()=>{oM();Lx1={"claude-3-opus":{modelName:"Claude 3 Opus",retirementDates:{firstParty:"January 5, 2026",bedrock:"January 15, 2026",vertex:"January 5, 2026",foundry:"January 5, 2026"}},"claude-3-7-sonnet":{modelName:"Claude 3.7 Sonnet",retirementDates:{firstParty:"February 19, 2026",bedrock:"April 28, 2026",vertex:"May 11, 2026",foundry:"February 19, 2026"}},"claude-3-5-haiku":{modelName:"Claude 3.5 Haiku",retirementDates:{firstParty:"February 19, 2026",bedrock:null,vertex:null,foundry:null}}}});function IfB(H){let{addNotification:$}=wB(),A=vO$.useRef(null);vO$.useEffect(()=>{let L=yO$(H);if(L&&L!==A.current)A.current=L,$({key:"model-deprecation-warning",text:L,color:"warning",priority:"high"});if(!L)A.current=null},[H,$])}var vO$;var DfB=K(()=>{bE();vgA();vO$=b(s(),1)});function BfB(){let{addNotification:H}=wB(),$=hO$.useRef(!1);hO$.useEffect(()=>{if($.current||U8()||A$(process.env.DISABLE_INSTALLATION_CHECKS))return;Lb().then((A)=>{if($.current||A==="development")return;$.current=!0,H({timeoutMs:15000,key:"npm-deprecation-warning",text:Dx1,color:"warning",priority:"high"})})},[H])}var hO$,Dx1="Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.";var ffB=K(()=>{bE();Ib();NA();hO$=b(s(),1)});function EfB(){let{addNotification:H}=wB(),$=bO$.useRef(!1);bO$.useEffect(()=>{if($.current)return;if(JmL())$.current=!0,H({timeoutMs:15000,key:"programdata-deprecation-warning",text:Bx1,color:"warning",priority:"high"})},[H])}var bO$,Bx1="This device contains a C:\\ProgramData\\ClaudeCode\\managed-settings.json file. In a future version of Claude Code, managed settings at this location will no longer be applied. Contact your administrator to migrate this file to C:\\Program Files\\ClaudeCode\\managed-settings.json";var MfB=K(()=>{bE();mL();bO$=b(s(),1)});function GfB({ideSelection:H,mcpClients:$,ideInstallationStatus:A}){let{addNotification:L}=wB(),I=iPH($),D=A?Wx(A?.ideType):!1,B=A?.error||D,f=I==="connected"&&(H?.filePath||H?.text&&H.lineCount>0),E=I==="connected"&&!f,M=B&&!D&&!E&&!f,G=B&&D&&!E&&!f;wdH.useEffect(()=>{if(ZF()||I!==null||G)return;ajH(!0).then((U)=>{let X=U[0]?.name;if(X)L({key:"ide-status-hint",text:`${pH.circle} /ide for ${X}`,priority:"low"})})},[L,I,G]),wdH.useEffect(()=>{if(M||G||I!=="disconnected")return;L({key:"ide-status-disconnected",text:`${pH.circle} IDE disconnected`,color:"error",priority:"medium"})},[L,I,M,G]),wdH.useEffect(()=>{if(!G)return;L({key:"ide-status-jetbrains-disconnected",text:"IDE plugin not connected \xB7 /status for info",priority:"medium"})},[L,G]),wdH.useEffect(()=>{if(!M)return;L({key:"ide-status-install-error",text:"IDE extension install failed (see /status for info)",color:"error",priority:"medium"})},[L,M])}var wdH;var UfB=K(()=>{bE();nU();SN$();jI();wdH=b(s(),1)});function JfB(){let{addNotification:H}=wB();XfB.useEffect(()=>{let A=M$().sonnet45MigrationTimestamp;if(A){if(Date.now()-A<3000)H({key:"sonnet-4.5-update",text:"Model updated to Sonnet 4.5",color:"suggestion",priority:"high",timeoutMs:3000})}},[H])}var XfB;var FfB=K(()=>{bE();vA();XfB=b(s(),1)});function QfB(){let{addNotification:H}=wB();KfB.useEffect(()=>{let A=M$().opusProMigrationTimestamp;if(A){if(Date.now()-A<3000)H({key:"opus-pro-update",text:"Model updated to Opus 4.5",color:"suggestion",priority:"high",timeoutMs:3000})}},[H])}var KfB;var WfB=K(()=>{bE();vA();KfB=b(s(),1)});function fx1(H){let $=H.toLowerCase();if($.includes("opus-4-6"))return null;if($.includes("opus-4-5"))return"Opus 4.5";if($.includes("opus-4-1"))return"Opus 4.1";if($.includes("opus-4"))return"Opus 4";return null}function PfB(){let{addNotification:H}=wB();VfB.useEffect(()=>{if(sI()!=="firstParty")return;let A=X1(),L=fx1(A);if(!L)return;c("tengu_opus46_upgrade_nudge_shown",{currentModel:A}),H({key:"opus-46-upgrade-nudge",jsx:ZdH.createElement(V,{color:"suggestion"},"Currently using ",L,". Opus 4.6 is our best model for coding",ZdH.createElement(V,{color:"text",dimColor:!0}," ","\xB7 /model to upgrade")),priority:"medium",timeoutMs:1e4})},[H])}var ZdH,VfB;var _fB=K(()=>{xH();bE();oM();aI();z$();ZdH=b(s(),1),VfB=b(s(),1)});function CfB(){let{addNotification:H}=wB();YfB.useEffect(()=>{if(M$().subscriptionNoticeCount??0>=Ex1)return;Mx1().then(($)=>{if($===null)return;AA((A)=>({...A,subscriptionNoticeCount:(A.subscriptionNoticeCount??0)+1})),c("tengu_switch_to_subscription_notice_shown",{}),H({key:"switch-to-subscription",jsx:qdH.createElement(V,{color:"suggestion"},"Use your existing Claude ",$," plan with Claude Code",qdH.createElement(V,{color:"text",dimColor:!0}," ","\xB7 /login to activate")),priority:"low"})})},[H])}async function Mx1(){if(nL())return null;let H=await WeH();if(!H)return null;if(H.account.has_claude_max)return"Max";if(H.account.has_claude_pro)return"Pro";return null}var qdH,YfB,Ex1=3;var wfB=K(()=>{xH();zwH();vA();z$();EI();bE();qdH=b(s(),1),YfB=b(s(),1)});function ZfB(){let H=kO$.useRef(!1);kO$.useEffect(()=>{if(H.current)return;H.current=!0,RgD()},[])}var kO$;var qfB=K(()=>{uyA();kO$=b(s(),1)});function TfB(H){if(!("text"in H))return 1;let $=H.text.match(/^(\d+)/);return $?.[1]?parseInt($[1],10):1}function Gx1(H,$){return zfB(TfB(H)+1)}function zfB(H){return{key:"teammate-spawn",text:H===1?"1 agent spawned":`${H} agents spawned`,priority:"low",timeoutMs:5000,fold:Gx1}}function Ux1(H,$){return NfB(TfB(H)+1)}function NfB(H){return{key:"teammate-shutdown",text:H===1?"1 agent shut down":`${H} agents shut down`,priority:"low",timeoutMs:5000,fold:Ux1}}function OfB(){let H=J$((I)=>I.tasks),{addNotification:$}=wB(),A=TdH.useRef(new Set),L=TdH.useRef(new Set);TdH.useEffect(()=>{for(let[I,D]of Object.entries(H)){if(!b4(D))continue;if(D.status==="running"&&!A.current.has(I))A.current.add(I),$(zfB(1));if(D.status==="completed"&&!L.current.has(I))L.current.add(I),$(NfB(1))}},[H,$])}var TdH;var xfB=K(()=>{pL();bE();TdH=b(s(),1)});function yfB(){let{addNotification:H}=wB(),$=J$((L)=>L.fastMode),A=zI();uO$.useEffect(()=>{if(!cD())return;if(ZHH())return;return JoL((L)=>{if(L)H({key:RfB,color:"penguin",priority:"immediate",text:"Fast mode is now available \xB7 /fast to turn on"});else if($)A((I)=>({...I,fastMode:!1})),H({key:RfB,color:"warning",priority:"immediate",text:"Fast mode has been disabled by your organization"})})},[H,$,A]),uO$.useEffect(()=>{if(ZHH())return;if(!cD())return;return UoL((L)=>{A((I)=>({...I,fastMode:!1})),H({key:Xx1,color:"warning",priority:"immediate",text:L})})},[H,A]),uO$.useEffect(()=>{if(!$)return;return EoL({onCooldownTriggered(L){let I=of(L-Date.now(),{hideTrailingZeros:!0});H({key:SfB,invalidates:[jfB],text:`Fast limit reached and temporarily disabled \xB7 resets in ${I}`,color:"warning",priority:"immediate"})},onCooldownExpired(){H({key:jfB,invalidates:[SfB],color:"penguin",text:"Fast limit reset \xB7 now using fast mode",priority:"immediate"})}})},[H,$])}var uO$,SfB="fast-mode-cooldown-started",jfB="fast-mode-cooldown-expired",RfB="fast-mode-org-changed",Xx1="fast-mode-overage-rejected";var vfB=K(()=>{g$();bE();AJ();pL();Q9();uO$=b(s(),1)});function hfB({onRun:H,onCancel:$,reason:A}){let L=gO$.useRef(!1);return BA("confirm:no",$,{context:"Confirmation"}),gO$.useEffect(()=>{if(!L.current)L.current=!0,H()},[H]),A6.createElement(x,{flexDirection:"column",marginTop:1},A6.createElement(x,null,A6.createElement(V,{bold:!0},"Running feedback capture...")),A6.createElement(x,null,A6.createElement(V,{dimColor:!0},"Press ",A6.createElement(s$,{shortcut:"Esc",action:"cancel"})," anytime")),A6.createElement(x,null,A6.createElement(V,{dimColor:!0},"Reason: ",A)))}function hgA(H){return!1;switch(H){case"feedback_survey_bad":return!0;case"feedback_survey_good":return!1;default:return!1}}function bfB(H){return"/issue"}function kfB(H){switch(H){case"feedback_survey_bad":return'You responded "Bad" to the feedback survey';case"feedback_survey_good":return'You responded "Good" to the feedback survey';default:return"Unknown reason"}}var A6,gO$;var ufB=K(()=>{xH();$I();lB();A6=b(s(),1),gO$=b(s(),1)});var gfB,Jx1;var mfB=K(()=>{xH();g$();gfB=b(s(),1),Jx1=b(s(),1)});function Qx1({showAllInTranscript:H}){let $=C0("app:toggleTranscript","Global","ctrl+o"),A=C0("transcript:toggleShowAll","Transcript","ctrl+e");return CI.createElement(x,{alignItems:"center",alignSelf:"center",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginTop:1,paddingLeft:2,width:"100%"},CI.createElement(V,{dimColor:!0},"Showing detailed transcript \xB7 ",$," to toggle \xB7"," ",A," to ",H?"collapse":"show all"))}function R8H({commands:H,debug:$,initialTools:A,initialMessages:L,initialFileHistorySnapshots:I,initialAgentName:D,initialAgentColor:B,mcpClients:f,dynamicMcpConfig:E,mcpCliEndpoint:M,autoConnectIdeFlag:G,strictMcpConfig:U=!1,systemPrompt:X,appendSystemPrompt:J,onBeforeQuery:F,onTurnComplete:Q,disabled:W=!1,mainThreadAgentDefinition:P,disableSlashCommands:C=!1,taskListId:Y,remoteSessionConfig:Z,directConnectConfig:q}){lA.useEffect(()=>{return N(`[REPL:mount] REPL mounted, disabled=${W}`),g_I(),()=>N("[REPL:unmount] REPL unmounting")},[W]);let[O,j]=lA.useState(P),u=J$((F$)=>F$.toolPermissionContext),y=J$((F$)=>F$.verbose),g=J$((F$)=>F$.mcp),h=J$((F$)=>F$.plugins),p=J$((F$)=>F$.agentDefinitions),d=J$((F$)=>F$.fileHistory),k=J$((F$)=>F$.todos),n=J$((F$)=>F$.thinkingEnabled),GH=J$((F$)=>F$.initialMessage),HH=J$((F$)=>F$.queuedCommands),BH=void 0,WH=!1,wH=void 0,QH=J$((F$)=>F$.spinnerTip),TH=J$((F$)=>F$.expandedView)==="tasks",t=J$((F$)=>F$.pendingWorkerRequest),IH=J$((F$)=>F$.pendingSandboxRequest),KH=J$((F$)=>F$.teamContext),MH=J$((F$)=>F$.tasks),CH=J$((F$)=>F$.workerSandboxPermissions),OH=J$((F$)=>F$.elicitation),LH=J$((F$)=>F$.viewingAgentTaskId),e=zI(),DH=OX(),EH=Vy(),$H=Ht(),[FH,YH]=lA.useState(H);vIB(oJ(),YH);let[qH,bH]=lA.useState(mO$?.isProactiveActive()??!1);lA.useEffect(()=>{if(!mO$)return;return mO$.subscribeToProactiveChanges(()=>{bH(mO$.isProactiveActive())})},[]);let hH=lA.useMemo(()=>yK(u),[u,qH]);wDB();let[PH,gH]=lA.useState(E),vH=lA.useCallback((F$)=>{gH(F$)},[gH]),[tH,K$]=lA.useState("prompt"),[KA,UA]=lA.useState(1),[U$,hA]=lA.useState(!1),{addNotification:iA}=wB(),rH=SIB(f,g.clients),[G$,b$]=lA.useState(void 0),[ZA,n$]=lA.useState(null),[fA,UH]=lA.useState(null),[_H,aH]=lA.useState(!1),[f$,I$]=lA.useState(()=>{return!1});JfB(),QfB(),PfB(),CfB(),GfB({ideSelection:G$,mcpClients:rH,ideInstallationStatus:fA}),x8B({mcpClients:rH}),a8B(),t8B(),_q$(),$fB($H),yfB(),LfB(),IfB($H),BfB(),EfB(),EDB(),GDB(),JDB(),j8B(),OfB();let{recommendation:$$,handleResponse:e$}=c8B();i8B();let x$=lA.useMemo(()=>{return[...hH,...A]},[hH,A]);QO$();let zA=wP$();lA.useEffect(()=>{e8B(e)},[e]),KDB(rH,e,u.mode),aLB(e,L);let gA=rT$(x$,g.tools,u),{tools:HI,allowedAgentTypes:AI}=lA.useMemo(()=>{if(!O)return{tools:gA,allowedAgentTypes:void 0};let F$=Io(O,gA,!1);return{tools:F$.resolvedTools,allowedAgentTypes:F$.allowedAgentTypes}},[O,gA]),qB=BgA(FH,h.commands),RB=BgA(qB,g.commands),sA=lA.useMemo(()=>C?[]:RB,[C,RB]);ZsD(g.clients),uIB(g.clients,b$);let[_D,M9]=lA.useState("responding"),[g8,v9]=lA.useState([]),[QI,DB]=lA.useState(null);lA.useEffect(()=>{if(QI&&!QI.isStreaming&&QI.streamingEndedAt){let FL=30000-(Date.now()-QI.streamingEndedAt);if(FL>0){let jL=setTimeout(()=>{DB(null)},FL);return()=>clearTimeout(jL)}else DB(null)}},[QI]);let[G9,IL]=lA.useState(null),[qA,BB]=lA.useState(Z?.hasInitialPrompt??!1),[WB,GD]=lA.useState(void 0),C9=lA.useRef(0),V1=lA.useRef(0),G8=lA.useRef(null),nE=lA.useRef(null),f4=lA.useRef(void 0),n8=1500,[e4,dM]=lA.useState(!1),y1=lA.useCallback((F$)=>{if(BB(F$),F$)C9.current=Date.now(),V1.current=0,G8.current=null},[]),[gG,pA]=lA.useState(null);lA.useEffect(()=>{if(gG?.notifications)gG.notifications.forEach((F$)=>{iA({key:"auto-updater-notification",text:F$,priority:"low"})})},[gG,iA]);let[qL,dB]=lA.useState(null),tB=lA.useRef(null),gD=lA.useCallback((F$)=>{if(F$?.isLocalJSXCommand){let{clearLocalJSX:FL,...jL}=F$;tB.current={...jL,isLocalJSXCommand:!0},dB(jL);return}if(tB.current){if(F$?.clearLocalJSX){tB.current=null,dB(null);return}return}if(F$?.clearLocalJSX){dB(null);return}dB(F$)},[]),[c9,b0]=lA.useState([]),[U9,uf]=lA.useState([]),k0=c9.length>0||t||IH,DE=qL?.isLocalJSXCommand===!0;lA.useEffect(()=>{if(qA&&!k0&&!DE)c_I();else lSH();return()=>lSH()},[qA,k0,DE]),lA.useEffect(()=>{if(qA&&!k0&&!DE)return fsD(),()=>EsD()},[qA,k0,DE]),lA.useEffect(()=>{return yQD(b0),()=>vQD()},[b0]);let[aL,RH]=lA.useState(L??[]),kH=lA.useRef(aL),eH=lA.useCallback((F$)=>{if(typeof F$==="function")RH((FL)=>{let jL=F$(FL);return kH.current=jL,jL});else kH.current=F$,RH(F$)},[]),W$=lA.useDeferredValue(aL),O$=aL.length-W$.length;if(O$>0)N(`[useDeferredValue] Messages deferred by ${O$} (${W$.length}\u2192${aL.length})`);let[YA,aA]=lA.useState(null);ZfB();let[eA,kL]=lA.useState([]),[AL,ML]=lA.useState(()=>c0A()),DI=lA.useRef(AL);DI.current=AL,lA.useEffect(()=>{if(AL.trim().length===0){dM(!1);return}dM(!0);let F$=setTimeout(()=>{dM(!1)},n8);return()=>clearTimeout(F$)},[AL]);let[yB,h9]=lA.useState("prompt"),[F0,Yf]=lA.useState(),{tip:wU,dismissTip:H5}=ALB({inputValue:AL,isAssistantResponding:qA}),E4=lA.useCallback((F$)=>{let FL=new Set(F$);YH((jL)=>jL.filter((D0)=>FL.has(D0.name)||uhA.has(D0)))},[YH]),[M4,iK]=lA.useState(new Set),D6=MLB({config:Z,setMessages:eH,setIsLoading:y1,onInit:E4,setToolUseConfirmQueue:b0,tools:x$,setStreamingToolUses:v9,setStreamMode:M9,setInProgressToolUseIDs:iK}),B6=XLB({config:q,setMessages:eH,setIsLoading:y1,setToolUseConfirmQueue:b0,tools:x$}),nF=B6.isRemoteMode?B6:D6,[nK,ZU]=lA.useState({}),[uJ,L_]=lA.useState(0),YW=lA.useRef(0),RC=lA.useCallback((F$)=>{YW.current=F$(YW.current)},[]),[I_,oz]=lA.useState(0),[tz,rK]=lA.useState(null),[r8,l9]=lA.useState(null),[f6,D_]=lA.useState(null),[e5,yC]=lA.useState(!1),[B_,CZ]=lA.useState(!1),[HX,gJ]=lA.useState(zdH.randomUUID()),[rE,vC]=lA.useState(M$().hasAcknowledgedCostThreshold),[mJ,sz]=lA.useState("INSERT"),[f_,G4]=lA.useState(!1),[aK,wZ]=lA.useState(!1),[E_,e3]=lA.useState(!1),[Cf,ZZ]=lA.useState(!1),[qU,eD]=lA.useState(!1),[aE,$5]=lA.useState(!1),y$=EJ(),CL=lA.useRef(y$);CL.current=y$;let SI=lA.useRef(!1),mD=lA.useRef(null),[hD]=_I(),b9=lA.useCallback(()=>{PDB({theme:hD,readFileState:Q0.current}).then(async(F$)=>{if(F$){let FL=await F$.content({theme:hD});e((jL)=>({...jL,spinnerTip:FL})),_DB(F$)}else e((FL)=>({...FL,spinnerTip:void 0}))})},[e,hD]),K0=lA.useCallback(()=>{y1(!1),GD(void 0),YW.current=0,v9([]),rK(null),l9(null),D_(null),b9(),jyH()},[y1,b9]),{backgroundSignalRef:mG,handleBackgroundSession:rF,handleForegroundTask:CW}=oIB({setMessages:eH,setIsLoading:y1,resetLoadingState:K0,setAbortController:IL}),qZ=Yw(MH).some((F$)=>F$.status==="running");lA.useEffect(()=>{if(!qZ&&nE.current!==null){let F$=Date.now()-nE.current;nE.current=null,eH((FL)=>[...FL,RbA(F$)])}},[qZ,eH]);let vb=aL.findLast((F$)=>F$.type==="assistant"),hb=vb?.type==="assistant"?vb.message.content.filter((F$)=>F$.type==="tool_use"&&M4.has(F$.id)):[],pG=hb.length>0&&hb.every((F$)=>F$.type==="tool_use"&&F$.name===ghA),E6=(!qL||qL.showSpinner===!0)&&c9.length===0&&(qA||WB||qZ||lRI()>0)&&!t&&!pG,VH=c9.length>0||U9.length>0||OH.queue.length>0||CH.queue.length>0,ZH=HDB(aL,qA,uJ,"session",VH),B$=lA.useMemo(()=>({...ZH,handleSelect:(F$)=>{if(ZH.handleSelect(F$),F$==="bad"&&hgA("feedback_survey_bad")||F$==="good"&&hgA("feedback_survey_good"))oK(F$==="bad"?"feedback_survey_bad":"feedback_survey_good")}}),[ZH]),IA=ADB(aL,qA,VH);iIB({autoConnectIdeFlag:G,ideToInstallExtension:ZA,setDynamicMcpConfig:gH,setShowIdeOnboarding:aH,setIDEInstallationState:UH}),qDB(I,d,(F$)=>e((FL)=>({...FL,fileHistory:F$})));let bA=lA.useCallback(async(F$,FL,jL)=>{c("tengu_session_resumed",{entrypoint:jL});let D0=QuH(FL.messages),RD=await r7("resume",{sessionId:F$,agentType:O?.agentType,model:$H});if(D0.push(...RD),BF$(FL),EF$(FL,Z7(F$)),XdH(FL,e),FL.fileHistorySnapshots)bY$(FL);if(!P){let JI=FL.agentSetting?p?.activeAgents.find((v1)=>v1.agentType===FL.agentSetting):void 0;if(j(JI),YN(JI?.agentType),e((v1)=>({...v1,agent:JI?.agentType})),JI&&!C_()&&JI.model&&JI.model!=="inherit")KV(m8(JI.model))}if(dL())e((JI)=>({...JI,standaloneAgentContext:FL.agentName||FL.agentColor?{name:FL.agentName??"",color:FL.agentColor}:void 0}));lOA(D0),a8(D0,FL.projectPath??zL()),K0(),IL(null),gJ(F$);let fD=cDA(F$);if(lDA(),MEH(),FV(Z7(F$)),await aw(),fD)yYH(fD);eH(()=>D0),gD(null),ML(""),kL([])},[K0,e]),WI=j$(),VB=lA.useMemo(()=>ca(j$()),[]),Q0=lA.useRef((()=>{let F$=_m(fBH);return F$.set(VB,{content:yH(k[WI]||[]),timestamp:0,offset:void 0,limit:void 0}),F$})()),a8=lA.useCallback((F$,FL)=>{let jL=D1H(F$,FL,fBH);Q0.current=eKH(Q0.current,jL)},[]);lA.useEffect(()=>{if(L&&L.length>0)lOA(L),a8(L,zL())},[]);let{status:TU,reverify:$X}=hLB(),[If,oK]=lA.useState(null),[lX,M_]=lA.useState(null),[Oj,Te]=lA.useState(!1),bb=!qA&&B_;function ze(){if(Oj||lX)return;if(e5)return"message-selector";if(e4)return;if(U9[0])return"sandbox-permission";let F$=!qL||qL.shouldContinueAnimation;if(F$&&c9[0])return"tool-permission";if(F$&&CH.queue[0])return"worker-sandbox-permission";if(F$&&OH.queue[0])return"elicitation";if(F$&&bb)return"cost";if(F$&&_H)return"ide-onboarding";if(F$&&$$)return"lsp-recommendation";return}let iX=ze(),Ne=e4&&(U9[0]||c9[0]||CH.queue[0]||OH.queue[0]||bb);f4.current=iX,lA.useEffect(()=>{if(!qA)return;let F$=iX==="tool-permission",FL=Date.now();if(F$&&G8.current===null)G8.current=FL;else if(!F$&&G8.current!==null)V1.current+=FL-G8.current,G8.current=null},[iX,qA]);function TZ(){if(iX==="elicitation")return;if(N(`[onCancel] focusedInputDialog=${iX} streamMode=${_D}`),SI.current=!1,K0(),iX==="tool-permission")c9[0]?.onAbort(),b0([]);else if(nF.isRemoteMode)nF.cancelRequest();else G9?.abort();if(v8())QyI(MH,e),rRI(),e((F$)=>{if(F$.queuedCommands.length===0)return F$;return{...F$,queuedCommands:[]}})}let G_=lA.useCallback(async()=>{let F$=await ZF$(AL,0,async()=>new Promise((FL)=>e((jL)=>{return FL(jL),jL})),e);if(!F$)return;if(ML(F$.text),h9("prompt"),F$.images.length>0)ZU((FL)=>{let jL={...FL};for(let D0 of F$.images)jL[D0.id]=D0;return jL})},[e,ML,h9,AL,ZU]),id={setToolUseConfirmQueue:b0,onCancel:TZ,isMessageSelectorVisible:e5||f_||aK,screen:tH,abortSignal:G9?.signal,popCommandFromQueue:G_,vimMode:mJ,isLocalJSXCommand:qL?.isLocalJSXCommand,isSearchingHistory:qU,isHelpOpen:aE,inputMode:yB,inputValue:AL};lA.useEffect(()=>{if(BQ()>=5&&!B_&&!rE){if(c("tengu_cost_threshold_reached",{}),Y9$())CZ(!0)}},[aL,B_,rE]);let Oe=lA.useCallback(async(F$)=>{if(dL()&&EkH())return new Promise((FL)=>{let jL=TQD();if(!zQD(F$.host,jL)){uf((RD)=>[...RD,{hostPattern:F$,resolvePromise:FL}]);return}SQD({requestId:jL,host:F$.host,resolve:FL}),e((RD)=>({...RD,pendingSandboxRequest:{requestId:jL,host:F$.host}}))});return new Promise((FL)=>{uf((jL)=>[...jL,{hostPattern:F$,resolvePromise:FL}])})},[e]);if(vL.isSandboxingEnabled())vL.initialize(Oe).catch((F$)=>{process.stderr.write(` `),L9(1,"other")});let xj=lA.useCallback((F$,FL)=>{e((jL)=>({...jL,toolPermissionContext:{...F$,mode:FL?.preserveMode?jL.toolPermissionContext.mode:F$.mode}})),setImmediate(()=>{b0((jL)=>{return jL.forEach((D0)=>{D0.recheckPermission()}),jL})})},[e,b0]);lA.useEffect(()=>{return hQD(xj),()=>kQD()},[xj]);let cM=UIB(b0,xj),pJ=lA.useCallback((F$,FL,jL,D0,RD,fD)=>{return{abortController:jL,options:{commands:sA,tools:HI,debug:$,verbose:y,mainLoopModel:fD,maxThinkingTokens:RD??(n===!0?lg(FL,void 0):n===!1?0:void 0),mcpClients:rH,mcpResources:g.resources,ideInstallationStatus:fA,isNonInteractiveSession:!1,dynamicMcpConfig:PH,theme:hD,agentDefinitions:AI?{...p,allowedAgentTypes:AI}:p,customSystemPrompt:X,appendSystemPrompt:J},getAppState(){return DH.setState((JI)=>({...JI,toolPermissionContext:{...JI.toolPermissionContext,alwaysAllowRules:{...JI.toolPermissionContext.alwaysAllowRules,command:D0}}})),Promise.resolve(DH.getState())},setAppState:e,messages:F$,setMessages:eH,updateFileHistoryState(JI){e((v1)=>({...v1,fileHistory:JI(v1.fileHistory)}))},updateAttributionState(JI){e((v1)=>({...v1,attribution:JI(v1.attribution)}))},openMessageSelector:()=>{if(!W)yC(!0)},onChangeAPIKey:$X,onForegroundTask:CW,readFileState:Q0.current,setToolJSX:gD,addNotification:iA,onChangeDynamicMcpConfig:vH,onInstallIDEExtension:n$,nestedMemoryAttachmentTriggers:new Set,dynamicSkillDirTriggers:new Set,setResponseLength:RC,setStreamMode:M9,onCompactProgress:(JI)=>{switch(JI.type){case"hooks_start":l9("claudeBlue_FOR_SYSTEM_SPINNER"),D_("claudeBlueShimmer_FOR_SYSTEM_SPINNER"),rK(JI.hookType==="pre_compact"?"Running PreCompact hooks\u2026":"Running SessionStart hooks\u2026");break;case"compact_start":rK("Compacting conversation");break;case"compact_end":rK(null),l9(null),D_(null);break}},setInProgressToolUseIDs:iK,resume:bA,setConversationId:gJ}},[sA,HI,$,y,rH,g.resources,fA,PH,hD,p,AI,DH,e,$X,iA,vH,CW,bA,n,W,X,J,gJ]),xe=lA.useCallback(async(F$,FL,jL,D0,RD,fD,JI)=>{let v1=FL.filter((rX)=>rX.type==="user"||rX.type==="assistant").pop();if(D0){bp.handleQueryStart(rH);let rX=CY(rH);if(rX)HqI(rX)}if(HFH(),v1?.type==="user"&&typeof v1.message.content==="string")l_I(v1.message.content);if(!D0){K0(),IL(null);return}let vB=pJ(F$,FL,jL,RD,JI,fD);_9("query_context_loading_start");let[,,X9,P1,nX]=await Promise.all([VgA(u,e),void 0,HC(HI,fD,Array.from(u.additionalWorkingDirectories.keys()),rH),u5(),k5()]),cJ={...P1,...Kx1(rH),...{}};_9("query_context_loading_end");let NZ=A1H({mainThreadAgentDefinition:O,toolUseContext:vB,customSystemPrompt:X,defaultSystemPrompt:X9,appendSystemPrompt:J});_9("query_query_start");let sK,lM=new Promise((rX)=>{sK=rX});mG.current={promise:lM,resolve:sK};let U_=vP({messages:F$,systemPrompt:NZ,userContext:cJ,systemContext:nX,canUseTool:cM,toolUseContext:vB,querySource:d_$()})[Symbol.asyncIterator](),hC=!1,$V=!1;while(!$V){let rX=await Promise.race([U_.next().then((lJ)=>({type:"message",result:lJ})),lM.then(()=>({type:"background"}))]);if(rX.type==="background"){hC=!0,$V=!0;let lJ=m_I()||"Background session",{taskId:AV,abortSignal:bC}=ZyI(lJ,e,O,jL);zyI(U_,AV,e,($N)=>void $j($N),aL,bC);let{clearConversation:p8H}=await Promise.resolve().then(() => (dZ$(),qjA));await p8H({setMessages:eH,readFileState:Q0.current,getAppState:async()=>new Promise(($N)=>{e((Se)=>{return $N(Se),Se})}),setAppState:e,setConversationId:gJ})}else if(rX.result.done)$V=!0;else L3H(rX.result.value,(lJ)=>{if(Ez(lJ))eH(()=>[lJ]);else eH((AV)=>[...AV,lJ])},(lJ)=>RC((AV)=>AV+lJ.length),M9,v9,(lJ)=>{eH((AV)=>AV.filter((bC)=>bC!==lJ)),bbA(lJ.uuid)},DB)}if(mG.current=null,_9("query_end"),hC){K0();return}K0(),lxD(),Q?.()},[rH,K0,pJ,u,e,HI,X,Q,J,cM,O]),HV=lA.useCallback(async(F$,FL,jL,D0,RD,fD,JI,v1)=>{if(dL()){let vB=g9(),X9=g1();if(vB&&X9)zP$(vB,X9,!0)}if(SI.current){c("tengu_concurrent_onquery_detected",{}),F$.filter((vB)=>vB.type==="user").map((vB)=>K9H(vB.message.content)).filter((vB)=>vB!==null).forEach((vB,X9)=>{if(ZX({value:vB,mode:"prompt"},e),X9===0)c("tengu_concurrent_onquery_enqueued",{})}),y1(!1);return}SI.current=!0,mD.current=F$;try{y1(!0),eH((X9)=>[...X9,...F$]),GD(void 0),YW.current=0,v9([]);let vB=await new Promise((X9)=>{eH((P1)=>{return X9(P1),P1})});if(JI&&v1){let X9=[...vB,...F$];if(!await JI(v1,X9))return}await xe(vB,F$,FL,jL,D0,RD,fD)}finally{SI.current=!1,oz(Date.now()),K0();let vB=Date.now()-C9.current-V1.current;if(vB>30000&&!FL.signal.aborted&&!qH)if(Yw(DH.getState().tasks).some((P1)=>P1.status==="running")){if(nE.current===null)nE.current=C9.current}else eH((P1)=>[...P1,RbA(vB)])}},[xe,y1,e,K0]),nd=lA.useRef(!1);lA.useEffect(()=>{let F$=GH;if(!F$||qA||nd.current)return;nd.current=!0;async function FL(jL){if(jL.clearContext){let fD=jL.message.planContent?sRH():void 0,{clearConversation:JI}=await Promise.resolve().then(() => (dZ$(),qjA));if(await JI({setMessages:eH,readFileState:Q0.current,getAppState:async()=>new Promise((v1)=>{e((vB)=>{return v1(vB),vB})}),setAppState:e,setConversationId:gJ}),fD)K7A(j$(),fD)}let D0=jL.message.planContent&&!1;if(e((fD)=>{let JI=jL.mode?T2(fD.toolPermissionContext,tpH(jL.mode,jL.allowedPrompts)):fD.toolPermissionContext;return{...fD,initialMessage:null,toolPermissionContext:JI,...D0&&{pendingPlanVerification:{plan:jL.message.planContent,verificationStarted:!1,verificationCompleted:!1}}}}),gE())O6H((fD)=>{e((JI)=>({...JI,fileHistory:fD(JI.fileHistory)}))},jL.message.uuid);let RD=jL.message.message.content;if(typeof RD==="string"&&!jL.message.planContent)tK(RD,{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}});else{let fD=nD();IL(fD),HV([jL.message],fD,!0,[],$H,void 0)}setTimeout(()=>{nd.current=!1},100)}FL(F$)},[GH,qA,eH,e,HV,$H,HI]);let tK=lA.useCallback(async(F$,FL,jL,D0)=>{if(!jL&&F$.trim().startsWith("/")){let RD=F$.trim(),fD=RD.indexOf(" "),JI=fD===-1?RD.slice(1):RD.slice(1,fD),v1=fD===-1?"":RD.slice(fD+1).trim(),vB=sA.find((P1)=>P1.isEnabled()&&(P1.name===JI||P1.aliases?.includes(JI)||P1.userFacingName()===JI)),X9=vB?.immediate||D0?.fromKeybinding;if(vB&&X9&&vB.type==="local-jsx"){if(F$.trim()===DI.current.trim())ML(""),FL.setCursorOffset(0),FL.clearBuffer();(async()=>{let nX=(lM,U_)=>{if(gD({jsx:null,shouldHidePromptInput:!1,clearLocalJSX:!0}),lM&&U_?.display!=="skip")iA({key:`immediate-${vB.name}`,text:lM,priority:"low"});if(U_?.metaMessages?.length){let hC=U_.metaMessages.map(($V)=>R$({content:$V,isMeta:!0}));eH(($V)=>[...$V,...hC])}},cJ=pJ(aL,[],nD(),[],void 0,$H),sK=await(await vB.load()).call(nX,cJ,v1);if(sK)gD({jsx:sK,shouldHidePromptInput:!0,isLocalJSXCommand:!0})})();return}}if(nF.isRemoteMode&&!F$.trim())return;if(!D0?.fromKeybinding)fDH({display:jL?F$:lVI(F$,yB),pastedContents:jL?{}:nK});if(F0!==void 0)ML(F0.text),FL.setCursorOffset(F0.cursorOffset),ZU(F0.pastedContents),Yf(void 0);else if(!qA||jL){if(!D0?.fromKeybinding)ML(""),FL.setCursorOffset(0);ZU({})}if(!qA||jL)h9("prompt"),b$(void 0),L_((RD)=>RD+1),FL.clearBuffer();if(jL){let{queryRequired:RD}=await VSD(jL.state,jL.speculationSessionTimeSavedMs,jL.setAppState,F$,{setMessages:eH,readFileState:Q0,cwd:zL()});if(RD){let fD=nD();IL(fD),HV([],fD,!0,[],$H,void 0)}return}if(nF.isRemoteMode){let RD=R$({content:F$.trim()});eH((fD)=>[...fD,RD]),await nF.sendMessage(F$.trim());return}await JO$({input:F$,helpers:FL,isLoading:qA,mode:yB,commands:sA,onInputChange:ML,setPastedContents:ZU,setIsLoading:y1,setToolJSX:gD,getToolUseContext:pJ,messages:aL,mainLoopModel:$H,pastedContents:nK,ideSelection:G$,setUserInputOnProcessing:GD,setAbortController:IL,abortController:G9,onQuery:HV,resetLoadingState:K0,thinkingEnabled:n,setAppState:e,querySource:d_$(),onBeforeQuery:F,canUseTool:cM,addNotification:iA,streamMode:_D})},[qA,yB,sA,ML,h9,ZU,L_,b$,y1,gD,pJ,aL,$H,nK,G$,GD,IL,iA,HV,K0,F0,Yf,n,e,F,cM,D6,eH,iA,_D]),wW=lA.useCallback(async(F$,FL,jL)=>{m2A(FL.id,F$,e),ML(""),jL.setCursorOffset(0),jL.clearBuffer()},[e,ML]),rd=lA.useCallback(()=>{let F$=If?bfB(If):"/issue";oK(null),tK(F$,{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}}).catch((FL)=>{N(`Auto-run ${F$} failed: ${FL instanceof Error?FL.message:String(FL)}`)})},[tK,If]),u8H=lA.useCallback(()=>{oK(null)},[]),kb=lA.useCallback(()=>{tK("/rate-limit-options",{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}})},[tK]),ub=lA.useCallback(async()=>{Te(!0);let FL=await(await $pH.load()).call(()=>{});M_(FL)},[]),oE=lA.useCallback(()=>{yC((F$)=>!F$)},[]);async function J_H(){$X();let F$=QJ();for(let FL of F$)Q0.current.set(FL.path,{content:FL.content,timestamp:Date.now(),offset:void 0,limit:void 0})}PoL(jLB()),QsD(aL,aL.length===L?.length),yLB(),lA.useEffect(()=>{if(HH.length<1)return;AA((F$)=>({...F$,promptQueueUseCount:(F$.promptQueueUseCount??0)+1}))},[HH.length]);let zZ=lA.useCallback(()=>new Promise((F$)=>e((FL)=>{return F$(FL),FL})),[e]),d$=lA.useCallback(async(F$,FL)=>{await JO$({input:F$,helpers:{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}},isLoading:qA,mode:"prompt",commands:sA,onInputChange:()=>{},setPastedContents:()=>{},setIsLoading:y1,setToolJSX:gD,getToolUseContext:pJ,messages:aL,mainLoopModel:$H,pastedContents:FL,ideSelection:G$,setUserInputOnProcessing:GD,setAbortController:IL,onQuery:HV,resetLoadingState:K0,thinkingEnabled:n,setAppState:e,querySource:d_$(),onBeforeQuery:F,canUseTool:cM,addNotification:iA})},[qA,sA,y1,gD,pJ,aL,$H,G$,GD,cM,IL,HV,K0,n,iA,e,F]);TIB({isLoading:qA,queuedCommandsLength:HH.length,lastQueryCompletionTime:I_,getAppState:zZ,setAppState:e,executeQueuedInput:d$,hasActiveLocalJsxUI:qL?.isLocalJSXCommand??!1,setIsLoading:y1}),lA.useEffect(()=>{BbH.recordUserActivity(),FHH()},[AL,uJ]);let mA=lA.useRef(new Set);lA.useEffect(()=>{let F$=new Set(aL.filter((jL)=>Ez(jL)).map((jL)=>jL.uuid));if(Array.from(F$).some((jL)=>!mA.current.has(jL)))mA.current=F$,gJ(zdH.randomUUID())},[aL]),lA.useEffect(()=>{if(uJ===1)iuA()},[uJ]),lA.useEffect(()=>{if(qA)return;if(uJ===0)return;if(I_===0)return;let F$=setTimeout(()=>{if(jYH()>I_)return;let jL=Date.now()-I_;if(!qA&&!qL&&f4.current===void 0&&jL>=M$().messageIdleNotifThresholdMs)xh({message:"Claude is waiting for your input",notificationType:"idle_prompt"},EH)},M$().messageIdleNotifThresholdMs);return()=>clearTimeout(F$)},[qA,qL,uJ,I_,EH]);let _A=lA.useCallback((F$,FL)=>{if(SI.current)return!1;let jL=nD();IL(jL);let D0=R$({content:F$,isMeta:FL?.isMeta?!0:void 0});return HV([D0],jL,!0,[],$H,void 0),!0},[HV,$H]);pIB({enabled:dL(),isLoading:qA,focusedInputDialog:iX,onSubmitMessage:_A}),NIB({isLoading:qA,onSubmitMessage:_A}),lA.useEffect(()=>{return J_H(),()=>{bp.shutdown()}},[]);let{internal_eventEmitter:gI}=oJH(),[u0,n1]=lA.useState(0);lA.useEffect(()=>{let F$=()=>{process.stdout.write(` `),!A.alreadyUpToDate)c("tengu_plugin_updated_cli",{plugin_id:H,old_version:A.oldVersion||"unknown",new_version:A.newVersion||"unknown"});await w0(0)}catch(A){E_H(A,`update plugin "${H}"`)}}var mgA=K(()=>{jI();_$();z$();UU();pVH()});function cO$(){return pgA.default.createElement(V,null,"MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the"," ",pgA.default.createElement(dI,{url:"https://code.claude.com/docs/en/mcp"},"MCP documentation"),".")}var pgA;var dgA=K(()=>{xH();xH();pgA=b(s(),1)});function HEB({serverNames:H,onDone:$}){function A(I){let D=VL()||{},B=D.enabledMcpjsonServers||[],f=D.disabledMcpjsonServers||[],[E,M]=unA(H,(G)=>I.includes(G));if(c("tengu_mcp_multidialog_choice",{approved:E.length,rejected:M.length}),E.length>0){let G=[...new Set([...B,...E])];II("localSettings",{enabledMcpjsonServers:G})}if(M.length>0){let G=[...new Set([...f,...M])];II("localSettings",{disabledMcpjsonServers:G})}$()}let L=efB.useCallback(()=>{let D=(VL()||{}).disabledMcpjsonServers||[],B=[...new Set([...D,...H])];II("localSettings",{disabledMcpjsonServers:B}),$()},[H,$]);return iz.default.createElement(iz.default.Fragment,null,iz.default.createElement(BL,{title:`${H.length} new MCP servers found in .mcp.json`,subtitle:"Select any you wish to enable.",color:"warning",onCancel:L,hideInputGuide:!0},iz.default.createElement(cO$,null),iz.default.createElement(xVH,{options:H.map((I)=>({label:I,value:I})),defaultValue:H,onSubmit:A})),iz.default.createElement(x,{paddingX:1},iz.default.createElement(V,{dimColor:!0,italic:!0},iz.default.createElement(rA,null,iz.default.createElement(s$,{shortcut:"Space",action:"select"}),iz.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),iz.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"reject all"})))))}var iz,efB;var $EB=K(()=>{xH();xq$();mL();gnA();dgA();z$();lB();j0();eB();bB();iz=b(s(),1),efB=b(s(),1)});function AEB({serverName:H,onDone:$}){function A(L){switch(c("tengu_mcp_dialog_choice",{choice:L}),L){case"yes":case"yes_all":{let D=(VL()||{}).enabledMcpjsonServers||[];if(!D.includes(H))II("localSettings",{enabledMcpjsonServers:[...D,H]});if(L==="yes_all")II("localSettings",{enableAllProjectMcpServers:!0});$();break}case"no":{let D=(VL()||{}).disabledMcpjsonServers||[];if(!D.includes(H))II("localSettings",{disabledMcpjsonServers:[...D,H]});$();break}}}return lO$.default.createElement(BL,{title:`New MCP server found in .mcp.json: ${H}`,color:"warning",onCancel:()=>A("no")},lO$.default.createElement(cO$,null),lO$.default.createElement(QA,{options:[{label:"Use this and all future MCP servers in this project",value:"yes_all"},{label:"Use this MCP server",value:"yes"},{label:"Continue without using this MCP server",value:"no"}],onChange:(L)=>A(L),onCancel:()=>A("no")}))}var lO$;var LEB=K(()=>{l8();mL();dgA();z$();bB();lO$=b(s(),1)});async function IEB(){let{servers:H}=OJ("project"),$=Object.keys(H).filter((A)=>w2$(A)==="pending");if($.length===0)return;await new Promise(async(A)=>{let L=()=>{process.stdout.write("\x1B[2J\x1B[3J\x1B[H",()=>{A()})};if($.length===1&&$[0]!==void 0){let I=await A8(v8H.default.createElement(i8,null,v8H.default.createElement(hE,null,v8H.default.createElement(AEB,{serverName:$[0],onDone:()=>{I.unmount?.(),L()}}))),ZG(!1))}else{let I=await A8(v8H.default.createElement(i8,null,v8H.default.createElement(hE,null,v8H.default.createElement(HEB,{serverNames:$,onDone:()=>{I.unmount?.(),L()}}))),ZG(!1))}})}var v8H;var DEB=K(()=>{xH();$EB();LEB();pL();T3();kF();sv();AS();v8H=b(s(),1)});function EEB(){if(cgA!==void 0)return cgA;try{return cf(BEB)}catch{return!1}}function MEB(){if(lgA!==void 0)return lgA;try{return cf(fEB)}catch{return!1}}function Nx1(H,$){let A=sW$(H);if(A===0)return;let L=A!==null?{...$,sample_rate:A}:$;if(EEB())bwA(H,L);if(MEB())JPA(H,L);H7$(H,L)}async function Ox1(H,$){let A=sW$(H);if(A===0)return;let L=A!==null?{...$,sample_rate:A}:$;if(EEB())await bwA(H,L);if(MEB())JPA(H,L);H7$(H,L)}async function GEB(){cgA=cf(BEB),lgA=cf(fEB)}function UEB(){nlA({logEvent:Nx1,logEventAsync:Ox1})}var BEB="tengu_log_segment_events",fEB="tengu_log_datadog_events",cgA=void 0,lgA=void 0;var igA=K(()=>{SD();kwA();FPA();YvH();z$()});async function XEB(H){let $=await Mw(H);for(let A of $){if(A.type!=="prompt")continue;c("tengu_skill_loaded",{skill_name:A.name,skill_source:A.source,skill_loaded_from:A.loadedFrom})}}var JEB=K(()=>{z$();h4()});function KEB({onAccept:H}){dd.default.useEffect(()=>{c("tengu_bypass_permissions_mode_dialog_shown",{})},[]);function $(L){switch(L){case"accept":{c("tengu_bypass_permissions_mode_dialog_accept",{}),AA((I)=>{if(I.bypassPermissionsModeAccepted===!0)return I;return{...I,bypassPermissionsModeAccepted:!0}}),H();break}case"decline":{L9(1);break}}}let A=FEB.useCallback(()=>{L9(0)},[]);return dd.default.createElement(BL,{title:"WARNING: Claude Code running in Bypass Permissions mode",color:"error",onCancel:A},dd.default.createElement(x,{flexDirection:"column",gap:1},dd.default.createElement(V,null,"In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands.",dd.default.createElement(_K,null),"This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged."),dd.default.createElement(V,null,"By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode."),dd.default.createElement(dI,{url:"https://code.claude.com/docs/en/security"})),dd.default.createElement(QA,{options:[{label:"No, exit",value:"decline"},{label:"Yes, I accept",value:"accept"}],onChange:(L)=>$(L)}))}var dd,FEB;var QEB=K(()=>{xH();l8();vA();z$();xH();UU();bB();dd=b(s(),1),FEB=b(s(),1)});function WEB({onDone:H}){let[$,A]=_W.default.useState(!1);return _W.default.useEffect(()=>{c("tengu_claude_in_chrome_onboarding_shown",{}),Vd().then(A),AA((L)=>{return{...L,hasCompletedClaudeInChromeOnboarding:!0}})},[]),WL((L,I)=>{if(I.return)H()}),_W.default.createElement(BL,{title:"Claude in Chrome (Beta)",onCancel:H,color:"chromeYellow"},_W.default.createElement(x,{flexDirection:"column",gap:1},_W.default.createElement(V,null,"Claude in Chrome works with the Chrome extension to let you control your browser directly from Claude Code. You can navigate websites, fill forms, capture screenshots, record GIFs, and debug with console logs and network requests.",!$&&_W.default.createElement(_W.default.Fragment,null,_W.default.createElement(_K,null),_W.default.createElement(_K,null),"Requires the Chrome extension. Get started at"," ",_W.default.createElement(dI,{url:xx1}))),_W.default.createElement(V,{dimColor:!0},"Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on",$&&_W.default.createElement(_W.default.Fragment,null," ","(",_W.default.createElement(dI,{url:Sx1}),")"),"."),_W.default.createElement(V,{dimColor:!0},"For more info, use"," ",_W.default.createElement(V,{bold:!0,color:"chromeYellow"},"/chrome")," ","or visit ",_W.default.createElement(dI,{url:"https://code.claude.com/docs/en/chrome"}))))}var _W,xx1="https://claude.ai/chrome",Sx1="https://clau.de/chrome/permissions";var VEB=K(()=>{xH();xH();vA();z$();H8H();bB();_W=b(s(),1)});class ngA{frameDurations=[];firstRenderTime;lastRenderTime;record(H){let $=performance.now();if(this.firstRenderTime===void 0)this.firstRenderTime=$;this.lastRenderTime=$,this.frameDurations.push(H)}getMetrics(){if(this.frameDurations.length===0||this.firstRenderTime===void 0||this.lastRenderTime===void 0)return;let H=this.lastRenderTime-this.firstRenderTime;if(H<=0)return;let A=this.frameDurations.length/(H/1000),L=[...this.frameDurations].sort((f,E)=>E-f),I=Math.max(0,Math.ceil(L.length*0.01)-1),D=L[I],B=D>0?1000/D:0;return{averageFps:Math.round(A*100)/100,low1PctFps:Math.round(B*100)/100}}}function Nj({newState:H,oldState:$}){if(H.mainLoopModel!==$.mainLoopModel&&H.mainLoopModel===null)II("userSettings",{model:void 0}),KV(null);if(H.mainLoopModel!==$.mainLoopModel&&H.mainLoopModel!==null)II("userSettings",{model:H.mainLoopModel}),KV(H.mainLoopModel);if(H.expandedView!==$.expandedView){let A=H.expandedView==="tasks",L=H.expandedView==="teammates";if(M$().showExpandedTodos!==A||M$().showSpinnerTree!==L)AA((I)=>({...I,showExpandedTodos:A,showSpinnerTree:L}))}if($!==null&&H.todos!==$.todos)for(let A in H.todos)IBH(H.todos[A],A);if(H.verbose!==$.verbose&&M$().verbose!==H.verbose){let A=H.verbose;AA((L)=>({...L,verbose:A}))}if(H.feedbackSurvey.timeLastShown!==$.feedbackSurvey.timeLastShown&&H.feedbackSurvey.timeLastShown!==null){let A=H.feedbackSurvey.timeLastShown;AA((L)=>({...L,feedbackSurveyState:{lastShownTime:A}}))}if(eU()&&H.mcp!==$.mcp){if(CoD(H.mcp.clients,H.mcp.tools,H.mcp.resources),Od())SPH()}if(H.queuedCommands!==$.queuedCommands)jj$(H.queuedCommands.length);if(H.settings!==$.settings)try{if(xD$(),SD$(),H.settings.env!==$.settings.env)Me()}catch(A){r(A instanceof Error?A:Error(`Failed to apply settings changes: ${A}`))}}var rgA=K(()=>{vA();vA();g$();mL();jv();ZPH();BW();ypH();EI();_$();kpH()});function PEB(){let H=M$();if(H.autoUpdates!==!1||H.autoUpdatesProtectedForNative===!0)return;try{let $=ZI("userSettings")||{};II("userSettings",{...$,env:{...$.env,DISABLE_AUTOUPDATER:"1"}}),c("tengu_migrate_autoupdates_to_settings",{was_user_preference:!0,already_had_env_var:!!$.env?.DISABLE_AUTOUPDATER}),process.env.DISABLE_AUTOUPDATER="1",AA((A)=>{let{autoUpdates:L,autoUpdatesProtectedForNative:I,...D}=A;return D})}catch($){r(Error(`Failed to migrate auto-updates: ${$}`)),c("tengu_migrate_autoupdates_error",{has_error:!0})}}var _EB=K(()=>{vA();mL();z$();_$()});function YEB(){let H=Mf(),$=H.enableAllProjectMcpServers!==void 0,A=H.enabledMcpjsonServers&&H.enabledMcpjsonServers.length>0,L=H.disabledMcpjsonServers&&H.disabledMcpjsonServers.length>0;if(!$&&!A&&!L)return;try{let I=ZI("localSettings")||{},D={},B=[];if($&&I.enableAllProjectMcpServers===void 0)D.enableAllProjectMcpServers=H.enableAllProjectMcpServers,B.push("enableAllProjectMcpServers");else if($)B.push("enableAllProjectMcpServers");if(A&&H.enabledMcpjsonServers){let f=I.enabledMcpjsonServers||[];D.enabledMcpjsonServers=[...new Set([...f,...H.enabledMcpjsonServers])],B.push("enabledMcpjsonServers")}if(L&&H.disabledMcpjsonServers){let f=I.disabledMcpjsonServers||[];D.disabledMcpjsonServers=[...new Set([...f,...H.disabledMcpjsonServers])],B.push("disabledMcpjsonServers")}if(Object.keys(D).length>0)II("localSettings",D);if(B.includes("enableAllProjectMcpServers")||B.includes("enabledMcpjsonServers")||B.includes("disabledMcpjsonServers"))MM((f)=>{let{enableAllProjectMcpServers:E,enabledMcpjsonServers:M,disabledMcpjsonServers:G,...U}=f;return U});c("tengu_migrate_mcp_approval_fields_success",{migratedCount:B.length})}catch{c("tengu_migrate_mcp_approval_fields_error",{})}}var CEB=K(()=>{vA();mL();z$()});function ZEB(){let $=Mf().ignorePatterns;if(!$||!Array.isArray($)||$.length===0)return;let A=[];for(let D of $){let B=vB$(D);if(wEB.posix.isAbsolute(B)&&!B.startsWith("//"))B="/"+B;A.push({toolName:"Read",ruleContent:B},{toolName:"Edit",ruleContent:B})}if(RB$({ruleValues:A,ruleBehavior:"deny"},"localSettings"))try{MM((D)=>{let{ignorePatterns:B,...f}=D;return f}),c("tengu_migrate_ignore_patterns_success",{ignore_patterns_count:$.length})}catch(D){r(Error(`Failed to remove ignorePatterns from config: ${D instanceof Error?D.message:String(D)}`)),c("tengu_migrate_ignore_patterns_config_cleanup_error",{ignore_patterns_count:$.length})}else r(Error("Failed to migrate ignorePatterns to settings permissions")),c("tengu_migrate_ignore_patterns_error",{ignore_patterns_count:$.length})}var wEB;var qEB=K(()=>{vA();z$();_$();BM();_q();wEB=require("path")});function TEB(){if(M$().sonnet45MigrationComplete)return;if(sI()!=="firstParty"){AA((L)=>({...L,sonnet45MigrationComplete:!0}));return}if(VL()?.model!==void 0){II("userSettings",{model:void 0});let L=Date.now();AA((I)=>({...I,sonnet45MigrationComplete:!0,sonnet45MigrationTimestamp:L}))}else AA((L)=>({...L,sonnet45MigrationComplete:!0}))}var zEB=K(()=>{vA();mL();oM()});function NEB(){if(M$().opus45MigrationComplete)return;let $=sI(),A=TzH()||zzH();if($!=="firstParty"||!A){AA((I)=>({...I,opus45MigrationComplete:!0}));return}if(VL()?.model!==void 0)II("userSettings",{model:void 0});AA((I)=>({...I,opus45MigrationComplete:!0}))}var OEB=K(()=>{vA();mL();oM();aI()});function xEB(){if(M$().opusProMigrationComplete)return;if(sI()!=="firstParty"||!NzH()){AA((L)=>({...L,opusProMigrationComplete:!0}));return}if(VL()?.model===void 0){let L=Date.now();AA((I)=>({...I,opusProMigrationComplete:!0,opusProMigrationTimestamp:L}))}else AA((L)=>({...L,opusProMigrationComplete:!0}))}var SEB=K(()=>{vA();mL();oM();aI()});function jEB(){if(M$().thinkingMigrationComplete)return;if(VL().alwaysThinkingEnabled!==!1){AA((A)=>({...A,thinkingMigrationComplete:!0}));return}II("userSettings",{alwaysThinkingEnabled:void 0}),AA((A)=>({...A,thinkingMigrationComplete:!0}))}var REB=K(()=>{vA();mL();mL()});var yEB=K(()=>{mL()});var jx1,vEB,OdH;var hEB=K(()=>{KzH();jx1=$9.object({entries:$9.record($9.string(),$9.string())}),vEB=$9.object({userId:$9.string(),version:$9.number(),lastModified:$9.string(),checksum:$9.string(),content:jx1}),OdH={USER_SETTINGS:"~/.claude/settings.json",USER_MEMORY:"~/.claude/CLAUDE.md",projectSettings:(H)=>`projects/${H}/.claude/settings.local.json`,projectMemory:(H)=>`projects/${H}/CLAUDE.local.md`}});async function uEB(){try{if(!yx1())return EL("info","settings_sync_download_skipped"),c("tengu_settings_sync_download_skipped",{}),!1;EL("info","settings_sync_download_starting");let H=await kx1();if(!H.success)return EL("warn","settings_sync_download_fetch_failed"),c("tengu_settings_sync_download_fetch_failed",{}),!1;if(H.isEmpty)return EL("info","settings_sync_download_empty"),c("tengu_settings_sync_download_empty",{}),!1;let $=H.data.content.entries,A=await osH();return EL("info","settings_sync_download_applying",{entryCount:Object.keys($).length}),ux1($,A),c("tengu_settings_sync_download_success",{entryCount:Object.keys($).length}),!0}catch{return EL("error","settings_sync_download_error"),c("tengu_settings_sync_download_error",{}),!1}}function yx1(){if(sI()!=="firstParty"||!ZGH())return!1;let H=dD();return Boolean(H?.accessToken&&H.scopes?.includes(VR))}function vx1(){return`${XD().BASE_API_URL}/api/claude_code/user_settings`}function hx1(){let H=dD();if(H?.accessToken)return{headers:{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}};return{headers:{},error:"No OAuth token available"}}async function bx1(){try{await iW();let H=hx1();if(H.error)return{success:!1,error:H.error,skipRetry:!0};let $={...H.headers,"User-Agent":sG()},A=vx1(),L=await nA.get(A,{headers:$,timeout:Rx1,validateStatus:(D)=>D===200||D===404});if(L.status===404)return EL("info","settings_sync_fetch_empty"),{success:!0,isEmpty:!0};let I=vEB.safeParse(L.data);if(!I.success)return EL("warn","settings_sync_fetch_invalid_format"),{success:!1,error:"Invalid settings sync response format"};return EL("info","settings_sync_fetch_success"),{success:!0,data:I.data,isEmpty:!1}}catch(H){if(nA.isAxiosError(H)){if(H.response?.status===401||H.response?.status===403)return{success:!1,error:"Not authorized for settings sync",skipRetry:!0};if(H.code==="ECONNABORTED")return{success:!1,error:"Settings sync request timeout"};if(H.code==="ECONNREFUSED"||H.code==="ENOTFOUND")return{success:!1,error:"Cannot connect to server"}}return{success:!1,error:H instanceof Error?H.message:"Unknown error"}}}async function kx1(){let H=null;for(let $=1;$<=agA+1;$++){if(H=await bx1(),H.success)return H;if(H.skipRetry)return H;if($>agA)return H;let A=Rg($);EL("info","settings_sync_retry",{attempt:$,maxRetries:agA,delayMs:A}),await $x(A)}return H}function iO$(H,$){try{let A=kEB.dirname(H);if(A)xdH.mkdirSync(A,{recursive:!0});return xdH.writeFileSync(H,$,"utf8"),EL("info","settings_sync_file_written"),!0}catch{return EL("warn","settings_sync_file_write_failed"),!1}}function ux1(H,$){let A=0,L=!1,I=!1,D=(E,M)=>{let G=Buffer.byteLength(E,"utf8");if(G>bEB)return EL("info","settings_sync_file_too_large",{sizeBytes:G,maxBytes:bEB}),!0;return!1},B=H[OdH.USER_SETTINGS];if(B){let E=aM("userSettings");if(E&&!D(B,E)){if(AF.markInternalWrite("userSettings"),iO$(E,B))A++,L=!0}}let f=H[OdH.USER_MEMORY];if(f){let E=yv("User");if(!D(f,E)){if(iO$(E,f))A++,I=!0}}if($){let E=OdH.projectSettings($),M=H[E];if(M){let X=aM("localSettings");if(X&&!D(M,X)){if(AF.markInternalWrite("localSettings"),iO$(X,M))A++,L=!0}}let G=OdH.projectMemory($),U=H[G];if(U){let X=yv("Local");if(!D(U,X)){if(iO$(X,U))A++,I=!0}}}if(L)E5();if(I)QJ.cache.clear?.();EL("info","settings_sync_applied",{appliedCount:A})}var xdH,kEB,Rx1=1e4,agA=3,bEB=512000;var gEB=K(()=>{w1();SD();_Q();Z6();z$();qE();EI();oM();t8();mL();gk();vA();mQ();rD();hEB();IDH();Ng();g$();xdH=require("fs"),kEB=require("path")});function SdH(H,$,A,L){let I={type:"permissionPromptTool",permissionPromptToolName:$.name,toolResult:H};if(H.behavior==="allow"){let D=H.updatedPermissions;if(D)L.setAppState((B)=>({...B,toolPermissionContext:T2(B.toolPermissionContext,D)})),Pu(D);return{...H,decisionReason:I}}else if(H.behavior==="deny"&&H.interrupt)N(`SDK permission prompt deny+interrupt: tool=${$.name} message=${H.message}`),L.abortController.abort();return{...H,decisionReason:I}}var Q$U,gx1,mx1,nO$;var ogA=K(()=>{mI();i6A();C5();E$();Q$U=QD.object({tool_name:QD.string().describe("The name of the tool requesting permission"),input:QD.record(QD.string(),QD.unknown()).describe("The input for the tool"),tool_use_id:QD.string().optional().describe("The unique tool use request ID")}),gx1=QD.object({behavior:QD.literal("allow"),updatedInput:QD.record(QD.string(),QD.unknown()),updatedPermissions:QD.array(vK$).optional(),toolUseID:QD.string().optional()}),mx1=QD.object({behavior:QD.literal("deny"),message:QD.string(),interrupt:QD.boolean().optional(),toolUseID:QD.string().optional()}),nO$=QD.union([gx1,mx1])});function px1(H){if(!H)return;switch(H.type){case"rule":case"mode":case"subcommandResults":case"permissionPromptTool":return;case"hook":case"asyncAgent":case"sandboxOverride":case"classifier":case"workingDir":case"other":return H.reason}}class jdH{input;replayUserMessages;structuredInput;pendingRequests=new Map;inputClosed=!1;unexpectedResponseCallback;constructor(H,$){this.input=H;this.replayUserMessages=$;this.input=H,this.structuredInput=this.read()}async*read(){let H="";for await(let $ of this.input){H+=$;let A;while((A=H.indexOf(` `)})()}}async write(H){await this.transport.write(H)}close(){this.transport.close(),this.inputStream.end()}}});var aEB=K(()=>{vV();Mn();tG();GK()});class oEB{config;mutableMessages;abortController;permissionDenials;totalUsage;hasHandledOrphanedPermission=!1;constructor(H){this.config=H,this.mutableMessages=H.initialMessages??[],this.abortController=H.abortController??nD(),this.permissionDenials=[],this.totalUsage=JC}async*submitMessage(H,$){let{cwd:A,commands:L,tools:I,mcpClients:D,verbose:B=!1,maxThinkingTokens:f,maxTurns:E,maxBudgetUsd:M,canUseTool:G,customSystemPrompt:U,appendSystemPrompt:X,userSpecifiedModel:J,fallbackModel:F,jsonSchema:Q,getAppState:W,setAppState:P,replayUserMessages:C=!1,includePartialMessages:Y=!1,agents:Z=[],setSDKStatus:q,orphanedPermission:O}=this.config;MC(A);let j=!uZ(),u=Date.now(),y=async(U$,hA,iA,rH,G$,b$)=>{let ZA=await G(U$,hA,iA,rH,G$,b$);if(ZA.behavior!=="allow")this.permissionDenials.push({tool_name:U$.name,tool_use_id:G$,tool_input:hA});return ZA},g=await W(),h=J?m8(J):X1(),[p,d,k]=await Promise.all([HC(I,h,Array.from(g.toolPermissionContext.additionalWorkingDirectories.keys()),D),u5(),typeof U==="string"?Promise.resolve({}):k5()]),n={...d,...tx1(D)},GH=[...typeof U==="string"?[U]:p,...X?[X]:[]],HH=I.some((U$)=>U$.name===qK);if(Q&&HH)cK$(P,j$());let BH={messages:this.mutableMessages,setMessages:()=>{},onChangeAPIKey:()=>{},options:{commands:L,debug:!1,tools:I,verbose:B,mainLoopModel:h,maxThinkingTokens:f??0,mcpClients:D,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:U,appendSystemPrompt:X,agentDefinitions:{activeAgents:Z,allAgents:[]},theme:M$().theme,maxBudgetUsd:M},getAppState:W,setAppState:P,abortController:this.abortController,readFileState:D1H(this.mutableMessages,A),setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:(U$)=>{P((hA)=>({...hA,fileHistory:U$(hA.fileHistory)}))},updateAttributionState:(U$)=>{P((hA)=>({...hA,attribution:U$(hA.attribution)}))},setSDKStatus:q};if(O&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let U$ of KSD(O,I,this.mutableMessages,BH))yield U$}let{messages:WH,shouldQuery:wH,allowedTools:QH,maxThinkingTokens:TH,model:t,resultText:IH}=await XO$({input:H,mode:"prompt",setIsLoading:()=>{},setToolJSX:()=>{},context:{...BH,messages:this.mutableMessages},messages:this.mutableMessages,uuid:$?.uuid,querySource:"sdk"});this.mutableMessages.push(...WH);let KH=f??TH??0,MH=[...this.mutableMessages],CH=WH.filter((U$)=>U$.type==="user"&&!U$.isMeta&&!U$.toolUseResult||U$.type==="system"&&U$.subtype==="compact_boundary"),OH=C?CH:[];P((U$)=>({...U$,toolPermissionContext:{...U$.toolPermissionContext,alwaysAllowRules:{...U$.toolPermissionContext.alwaysAllowRules,command:QH}}}));let LH=t??h,e=D1H(MH,A),DH=eKH(e,BH.readFileState);BH={messages:MH,setMessages:()=>{},onChangeAPIKey:()=>{},options:{commands:L,debug:!1,tools:I,verbose:B,mainLoopModel:LH,maxThinkingTokens:KH,mcpClients:D,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:U,appendSystemPrompt:X,theme:M$().theme,agentDefinitions:{activeAgents:Z,allAgents:[]},maxBudgetUsd:M},getAppState:W,setAppState:P,abortController:this.abortController,readFileState:DH,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:BH.updateFileHistoryState,updateAttributionState:BH.updateAttributionState,setSDKStatus:q};let $H=VL()?.outputStyle??HW,[FH,{enabled:YH}]=await Promise.all([DF$(C$()),xf()]),qH={type:"system",subtype:"init",cwd:A,session_id:j$(),tools:I.map((U$)=>U$.name),mcp_servers:D.map((U$)=>({name:U$.name,status:U$.type})),model:LH,permissionMode:g.toolPermissionContext.mode,slash_commands:L.map((U$)=>U$.name),apiKeySource:Y5().source,betas:V6(),claude_code_version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,output_style:$H,agents:Z.map((U$)=>U$.agentType),skills:FH.map((U$)=>U$.name),plugins:YH.map((U$)=>({name:U$.name,path:U$.path})),uuid:cd.randomUUID()};if(cD()&&g.fastMode&&!zq())qH.fast_mode=!0;if(yield qH,L1H("system_message_yielded"),!wH){for(let U$ of CH){if(U$.type==="user"&&typeof U$.message.content==="string"&&(U$.message.content.includes(`<${hMH}>`)||U$.message.content.includes(`<${FtH}>`)||U$.isCompactSummary))MH.push(U$),yield{type:"user",message:{...U$.message,content:$U(U$.message.content)},session_id:j$(),parent_tool_use_id:null,uuid:U$.uuid,isReplay:!U$.isCompactSummary};if(U$.type==="system"&&U$.subtype==="compact_boundary")MH.push(U$),yield{type:"system",subtype:"compact_boundary",session_id:j$(),uuid:U$.uuid,compact_metadata:{trigger:U$.compactMetadata.trigger,pre_tokens:U$.compactMetadata.preTokens}}}if(j){if(await $j(MH),A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"success",is_error:!1,duration_ms:Date.now()-u,duration_api_ms:rC(),num_turns:MH.length-1,result:IH??"",stop_reason:null,session_id:j$(),total_cost_usd:BQ(),usage:JC,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID()};return}if(gE()&&j)WH.filter(upH).forEach((U$)=>{O6H((hA)=>{P((iA)=>({...iA,fileHistory:hA(iA.fileHistory)}))},U$.uuid)});let bH=JC,hH=1,PH=!1,gH,vH=null,tH=Q?ybA(this.mutableMessages,qK):0;for await(let U$ of vP({messages:MH,systemPrompt:GH,userContext:n,systemContext:k,canUseTool:y,toolUseContext:BH,fallbackModel:F,querySource:"sdk",maxTurns:E})){if(U$.type==="assistant"||U$.type==="user"||U$.type==="system"&&U$.subtype==="compact_boundary"){if(MH.push(U$),j)await $j(MH);if(!PH&&OH.length>0){PH=!0;for(let hA of OH)if(hA.type==="user")yield{type:"user",message:hA.message,session_id:j$(),parent_tool_use_id:null,uuid:hA.uuid,isReplay:!0}}}if(U$.type==="user")hH++;switch(U$.type){case"tombstone":break;case"assistant":vH=U$.message.stop_reason,this.mutableMessages.push(U$),yield*qSA(U$);break;case"progress":case"user":this.mutableMessages.push(U$),yield*qSA(U$);break;case"stream_event":if(U$.event.type==="message_start")bH=JC,bH=I1H(bH,U$.event.message.usage);if(U$.event.type==="message_delta")bH=I1H(bH,U$.event.usage);if(U$.event.type==="message_stop")this.totalUsage=BZ$(this.totalUsage,bH);if(Y)yield{type:"stream_event",event:U$.event,session_id:j$(),parent_tool_use_id:null,uuid:cd.randomUUID()};break;case"attachment":if(this.mutableMessages.push(U$),U$.attachment.type==="structured_output")gH=U$.attachment.data;else if(U$.attachment.type==="max_turns_reached"){if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"error_max_turns",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!1,num_turns:U$.attachment.turnCount,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:[]};return}else if(C&&U$.attachment.type==="queued_command")yield{type:"user",message:{role:"user",content:U$.attachment.prompt},session_id:j$(),parent_tool_use_id:null,uuid:U$.attachment.source_uuid||U$.uuid,isReplay:!0};break;case"stream_request_start":break;case"system":if(this.mutableMessages.push(U$),U$.subtype==="compact_boundary"&&U$.compactMetadata)yield{type:"system",subtype:"compact_boundary",session_id:j$(),uuid:U$.uuid,compact_metadata:{trigger:U$.compactMetadata.trigger,pre_tokens:U$.compactMetadata.preTokens}};break;case"tool_use_summary":yield{type:"tool_use_summary",summary:U$.summary,preceding_tool_use_ids:U$.precedingToolUseIds,session_id:j$(),uuid:U$.uuid};break}if(M!==void 0&&BQ()>=M){if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"error_max_budget_usd",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!1,num_turns:hH,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:[]};return}if(U$.type==="user"&&Q){let iA=ybA(this.mutableMessages,qK)-tH,rH=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||"5",10);if(iA>=rH){if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"error_max_structured_output_retries",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!0,num_turns:hH,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:[`Failed to provide valid structured output after ${rH} attempts`]};return}}}let K$=_6(MH);if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}if(!FSD(K$)){yield{type:"result",subtype:"error_during_execution",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!1,num_turns:hH,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:gMH().map((U$)=>U$.error)};return}let KA="",UA=!1;if(K$.type==="assistant"){let U$=_6(K$.message.content);if(U$?.type==="text")KA=U$.text;UA=Boolean(K$.isApiErrorMessage)}yield{type:"result",subtype:"success",is_error:UA,duration_ms:Date.now()-u,duration_api_ms:rC(),num_turns:hH,result:KA,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,structured_output:gH,uuid:cd.randomUUID()}}interrupt(){this.abortController.abort()}getMessages(){return this.mutableMessages}getSessionId(){return j$()}setModel(H){this.config.userSpecifiedModel=H}}async function*tEB({commands:H,prompt:$,promptUuid:A,cwd:L,tools:I,mcpClients:D,verbose:B=!1,maxThinkingTokens:f,maxTurns:E,maxBudgetUsd:M,canUseTool:G,mutableMessages:U=[],customSystemPrompt:X,appendSystemPrompt:J,userSpecifiedModel:F,fallbackModel:Q,jsonSchema:W,getAppState:P,setAppState:C,abortController:Y,replayUserMessages:Z=!1,includePartialMessages:q=!1,agents:O=[],setSDKStatus:j,orphanedPermission:u}){yield*new oEB({cwd:L,tools:I,commands:H,mcpClients:D,agents:O,canUseTool:G,getAppState:P,setAppState:C,initialMessages:U,customSystemPrompt:X,appendSystemPrompt:J,userSpecifiedModel:F,fallbackModel:Q,maxThinkingTokens:f,maxTurns:E,maxBudgetUsd:M,jsonSchema:W,verbose:B,replayUserMessages:Z,includePartialMessages:q,setSDKStatus:j,abortController:Y,orphanedPermission:u}).submitMessage($,{uuid:A})}var cd,tx1=()=>({});var sEB=K(()=>{SHH();AJ();h4();PI();Ow();bT();Nq();W9H();Y7();nh();rB();NA();_L();hv();DgA();g$();aI();lK$();yq();EE();EI();MgH();QgH();dU();vA();eE();jh();mL();_X();_$();AC();GN$();QZ$();cd=require("crypto")});var eEB=K(()=>{E$()});var HMB=K(()=>{_$();ugA();PI();eEB();z$();Ga()});function $MB(H){let $=process.env.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY,A=$?parseInt($,10):null,L=A&&!isNaN(A)&&A>0,I=null,D=0;return{start(){if(I)clearTimeout(I),I=null;if(L)D=Date.now(),I=setTimeout(()=>{let B=Date.now()-D;if(H()&&B>=A)N(`Exiting after ${A}ms of idle time`),L9()},A)},stop(){if(I)clearTimeout(I),I=null}}}var AMB=K(()=>{E$();UU()});function LMB(H){try{let $=new URL(H);return{sessionId:AmA.randomUUID(),ingressUrl:$.href,isUrl:!0,jsonlFile:null,isJsonlFile:!1}}catch{if(Gw(H))return{sessionId:H,ingressUrl:null,isUrl:!1,jsonlFile:null,isJsonlFile:!1};if(H.endsWith(".jsonl"))return{sessionId:AmA.randomUUID(),ingressUrl:null,isUrl:!1,jsonlFile:H,isJsonlFile:!0}}return null}var AmA;var IMB=K(()=>{dx();AmA=require("crypto")});async function DMB(){N("installPluginsForHeadless: starting");try{let[,H,$,A]=await Promise.all([CO$(),cq$(),hVH(),kVH()]),L=[];if(H.size>0){let M=await lq$(H);for(let G of M){let U=H.get(G);if(!U)continue;try{await uw(U.source),L.push(G),N(`installPluginsForHeadless: installed extra marketplace ${G}`)}catch(X){r(X instanceof Error?X:Error(String(X))),N(`installPluginsForHeadless: failed to install extra marketplace ${G}`)}}if(L.length>0)X3H(),Sx()}let I=await l1(),D=$.filter((M)=>!A.includes(M)),B=[],f=[];for(let M of D){let[,G]=M.split("@");if(!G||G in I)B.push(M);else f.push(M)}if(f.length>0)N(`installPluginsForHeadless: skipping ${f.length} plugins from unknown marketplaces: ${f.join(", ")}`);if(B.length===0)return N("installPluginsForHeadless: no plugins to install"),!1;let E=await iq$(B,()=>{});if(E.installed.length>0)Sx();return N(`installPluginsForHeadless: ${E.installed.length} installed, ${E.failed.length} failed`),E.installed.length>0}catch(H){return r(H instanceof Error?H:Error(String(H))),!1}}var BMB=K(()=>{KgA();uVH();yRA();y4();rq$();_X();E$();_$()});async function MMB(H,$,A,L,I,D,B,f){if(AF.subscribe((q)=>{if(O4$(q,A),cD())A((O)=>({...O,fastMode:O.settings.fastMode===!0}))}),ASA(),await IWH())await mdD();if(vL.isSandboxingEnabled())try{await vL.initialize()}catch(q){process.stderr.write(` `);ZX({mode:"prompt",value:$H,uuid:jC.randomUUID()},E),HH();return}if(X&&!J){J=!0,N("[print.ts] Input closed with active teammates, injecting shutdown prompt"),ZX({mode:"prompt",value:fMB,uuid:jC.randomUUID()},E),HH();return}await new Promise((EH)=>setTimeout(EH,500))}}if(X)if(await(async()=>{let MH=await f();if(EBA(MH))await MBA(E,MH);let CH=await f(),OH=CH.teamContext;return OH&&Object.keys(OH.teammates).length>0||g9$(CH)})())ZX({mode:"prompt",value:fMB,uuid:jC.randomUUID()},E),HH();else await s6A(),GH(),Q.done()},BH=function(wH,QH){Q.enqueue({type:"control_response",response:{subtype:"success",request_id:wH.request_id,response:QH}})},WH=function(wH,QH){Q.enqueue({type:"control_response",response:{subtype:"error",request_id:wH.request_id,error:QH}})};return H.setUnexpectedResponseCallback(async(wH)=>{await DS1({message:wH,setAppState:E,onEnqueued:()=>{HH()}})}),(async()=>{let wH=!1;for await(let QH of H.structuredInput){if(QH.type==="control_request"){if(QH.request.subtype==="interrupt"){if(F)F.abort();BH(QH)}else if(QH.request.subtype==="initialize"){if(QH.request.sdkMcpServers&&QH.request.sdkMcpServers.length>0)for(let TH of QH.request.sdkMcpServers)B[TH]={type:"sdk",name:TH};await $S1(QH.request,QH.request_id,wH,Q,A,Z,H,!!G.enableAuthStatus,G,M,f),wH=!0}else if(QH.request.subtype==="set_permission_mode"){let TH=QH.request;E((t)=>({...t,toolPermissionContext:AS1(TH,QH.request_id,t.toolPermissionContext,Q)})),BH(QH)}else if(QH.request.subtype==="set_model"){let TH=QH.request.model==="default"?xq():QH.request.model;q=TH,KV(TH),BH(QH)}else if(QH.request.subtype==="set_max_thinking_tokens"){if(QH.request.max_thinking_tokens===null)G.maxThinkingTokens=void 0;else G.maxThinkingTokens=QH.request.max_thinking_tokens;BH(QH)}else if(QH.request.subtype==="mcp_status"){let TH=await f(),t=TH.mcp.clients,IH=[...TH.mcp.tools,...y.tools],KH=[...t,...O,...y.clients].map((MH)=>{let CH;if(MH.config.type==="sse"||MH.config.type==="http")CH={type:MH.config.type,url:MH.config.url};else if(MH.config.type==="claudeai-proxy")CH={type:"claudeai-proxy",url:MH.config.url,id:MH.config.id};else if(MH.config.type==="stdio")CH={type:"stdio",command:MH.config.command,args:MH.config.args};let OH=MH.type==="connected"?dh(IH,MH.name).map((LH)=>({name:LH.originalMcpToolName??LH.name,annotations:{readOnly:LH.isReadOnly({})||void 0,destructive:LH.isDestructive?.({})||void 0,openWorld:LH.isOpenWorld?.({})||void 0}})):void 0;return{name:MH.name,status:MH.type,serverInfo:MH.type==="connected"?MH.serverInfo:void 0,error:MH.type==="failed"?MH.error:void 0,config:CH,scope:MH.config.scope,tools:OH}});BH(QH,{mcpServers:KH})}else if(QH.request.subtype==="mcp_message"){let TH=QH.request,t=O.find((IH)=>IH.name===TH.server_name);if(t&&t.type==="connected"&&t.client?.transport?.onmessage)t.client.transport.onmessage(TH.message);BH(QH)}else if(QH.request.subtype==="rewind_files"){let TH=await f(),t=await GMB(QH.request.user_message_id,TH,E,QH.request.dry_run??!1);if(t.canRewind||QH.request.dry_run)BH(QH,t);else WH(QH,t.error??"Unexpected error")}else if(QH.request.subtype==="mcp_set_servers"){let{response:TH,sdkServersChanged:t}=await p(QH.request.servers);if(BH(QH,TH),t)u()}else if(QH.request.subtype==="mcp_reconnect"){let{serverName:TH}=QH.request,t=Mz(TH)??$.find((IH)=>IH.name===TH)?.config??null;if(!t)WH(QH,`Server not found: ${TH}`);else{let IH=await ih(TH,t),KH=bc(TH);if(E((MH)=>({...MH,mcp:{...MH.mcp,clients:MH.mcp.clients.map((CH)=>CH.name===TH?IH.client:CH),tools:[...DR(MH.mcp.tools,(CH)=>CH.name?.startsWith(KH)),...IH.tools],commands:[...DR(MH.mcp.commands,(CH)=>CH.name?.startsWith(KH)),...IH.commands],resources:IH.resources&&IH.resources.length>0?{...MH.mcp.resources,[TH]:IH.resources}:VEH(MH.mcp.resources,TH)}})),IH.client.type==="connected")BH(QH);else{let MH=IH.client.type==="failed"?IH.client.error??"Connection failed":`Server status: ${IH.client.type}`;WH(QH,MH)}}}else if(QH.request.subtype==="mcp_toggle"){let{serverName:TH,enabled:t}=QH.request,IH=Mz(TH)??$.find((KH)=>KH.name===TH)?.config??null;if(!IH)WH(QH,`Server not found: ${TH}`);else if(!t){W3H(TH,!1);let KH=[...$,...O,...y.clients].find((CH)=>CH.name===TH);if(KH&&KH.type==="connected")await lh(TH,IH);let MH=bc(TH);E((CH)=>({...CH,mcp:{...CH.mcp,clients:CH.mcp.clients.map((OH)=>OH.name===TH?{name:TH,type:"disabled",config:IH}:OH),tools:DR(CH.mcp.tools,(OH)=>OH.name?.startsWith(MH)),commands:DR(CH.mcp.commands,(OH)=>OH.name?.startsWith(MH)),resources:VEH(CH.mcp.resources,TH)}})),BH(QH)}else{W3H(TH,!0);let KH=await ih(TH,IH),MH=bc(TH);if(E((CH)=>({...CH,mcp:{...CH.mcp,clients:CH.mcp.clients.map((OH)=>OH.name===TH?KH.client:OH),tools:[...DR(CH.mcp.tools,(OH)=>OH.name?.startsWith(MH)),...KH.tools],commands:[...DR(CH.mcp.commands,(OH)=>OH.name?.startsWith(MH)),...KH.commands],resources:KH.resources&&KH.resources.length>0?{...CH.mcp.resources,[TH]:KH.resources}:VEH(CH.mcp.resources,TH)}})),KH.client.type==="connected")BH(QH);else{let CH=KH.client.type==="failed"?KH.client.error??"Connection failed":`Server status: ${KH.client.type}`;WH(QH,CH)}}}continue}else if(QH.type==="control_response"){if(G.replayUserMessages)Q.enqueue(QH);continue}else if(QH.type==="keep_alive")continue;else if(QH.type==="update_environment_variables")continue;if(wH=!0,QH.uuid){let TH=j$();if(await lbA(TH,QH.uuid)||EMB.has(QH.uuid)){if(N(`Skipping duplicate user message: ${QH.uuid}`),G.replayUserMessages)N(`Sending acknowledgment for duplicate user message: ${QH.uuid}`),Q.enqueue({type:"user",message:QH.message,session_id:TH,parent_tool_use_id:null,uuid:QH.uuid,isReplay:!0});continue}EMB.add(QH.uuid)}E((TH)=>{return{...TH,queuedCommands:[...TH.queuedCommands,{mode:"prompt",value:QH.message.content,uuid:QH.uuid}]}}),HH()}if(X=!0,!U)await s6A(),GH(),Q.done()})(),Q}function ex1(H){let $=async(A,L,I,D,B)=>{let f=await qF(A,L,I,D,B);if(f.behavior==="allow"||f.behavior==="deny")return f;let{signal:E,cleanup:M}=yT(I.abortController.signal);if(E.aborted)return M(),{behavior:"deny",message:"Permission prompt was aborted.",decisionReason:{type:"permissionPromptTool",permissionPromptToolName:A.name,toolResult:void 0}};let G=new Promise((Q)=>{E.addEventListener("abort",()=>Q("aborted"),{once:!0})}),U=H.call({tool_name:A.name,input:L,tool_use_id:B},I,$,D),X=await Promise.race([U,G]);if(M(),X==="aborted"||E.aborted)return{behavior:"deny",message:"Permission prompt was aborted.",decisionReason:{type:"permissionPromptTool",permissionPromptToolName:A.name,toolResult:void 0}};let J=X,F=H.mapToolResultToToolResultBlockParam(J.data,"1");if(!F.content||!Array.isArray(F.content)||!F.content[0]||F.content[0].type!=="text"||typeof F.content[0].text!=="string")throw Error('Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.');return SdH(nO$.parse(q1(F.content[0].text)),H,L,I)};return $}function HS1(H,$,A,L){if(H==="stdio")return $.createCanUseTool(L);else if(H){let I=A.find((D)=>D.name===H);if(!I){let D=`Error: MCP tool ${H} (passed via --permission-prompt-tool) not found. Available MCP tools: ${A.map((B)=>B.name).join(", ")||"none"}`;throw process.stderr.write(`${D} `)}async function LS1(H,$){let A=!uZ();if($.continue)try{c("tengu_continue_print",{});let L=await kt(void 0,void 0);if(L){if(!$.forkSession){if(L.sessionId){if(FV(Z7(L.sessionId)),A)await aw()}}return XdH(L,H),L.messages}}catch(L){return r(L instanceof Error?L:Error(String(L))),L9(1),[]}if($.teleport)try{if(!PK("allow_remote_sessions"))throw Error("Remote sessions are disabled by your organization's policy.");if(c("tengu_teleport_print",{}),typeof $.teleport!=="string")throw Error("No session ID provided for teleport");await A2$();let L=await ut($.teleport),{branchError:I}=await f3H(L.branch);return B3H(L.log,I)}catch(L){return r(L instanceof Error?L:Error(String(L))),L9(1),[]}if($.resume)try{c("tengu_resume_print",{});let L=LMB(typeof $.resume==="string"?$.resume:"");if(!L){let D="Error: --resume requires a valid session ID when used with --print. Usage: claude -p --resume ";if(typeof $.resume==="string")D+=`. Session IDs must be in UUID format (e.g., 550e8400-e29b-41d4-a716-446655440000). Provided value "${$.resume}" is not a valid UUID`;return rO$(D,$.outputFormat),L9(1),[]}if(L.isUrl&&L.ingressUrl)await kbA(L.sessionId,L.ingressUrl);let I=await kt(L.sessionId,L.jsonlFile||void 0);if(!I)if(L.isUrl)return await r7("startup");else return rO$(`No conversation found with session ID: ${L.sessionId}`,$.outputFormat),L9(1),[];if($.resumeSessionAt){let D=I.messages.findIndex((B)=>B.uuid===$.resumeSessionAt);if(D<0)return rO$(`No message found with message.uuid of: ${$.resumeSessionAt}`,$.outputFormat),L9(1),[];I.messages=D>=0?I.messages.slice(0,D+1):[]}if(!$.forkSession&&I.sessionId){if(FV(Z7(I.sessionId)),A)await aw()}return XdH(I,H),I.messages}catch(L){r(L instanceof Error?L:Error(String(L)));let I=L instanceof Error?`Failed to resume session: ${L.message}`:"Failed to resume session with --print mode";return rO$(I,$.outputFormat),L9(1),[]}return await r7("startup")}function IS1(H,$){let A;if(typeof H==="string")if(H.trim()!=="")A=e6A([yH({type:"user",session_id:"",message:{role:"user",content:H},parent_tool_use_id:null})]);else A=e6A([]);else A=H;return $.sdkUrl?new $mA($.sdkUrl,A,$.replayUserMessages):new jdH(A,$.replayUserMessages)}async function DS1({message:H,setAppState:$,onEnqueued:A}){if(H.response.subtype==="success"&&H.response.response?.toolUseID&&typeof H.response.response.toolUseID==="string"){let L=H.response.response,{toolUseID:I}=L;if(!I)return!1;let D=await ibA(I);if(D)return $((B)=>({...B,queuedCommands:[...B.queuedCommands,{mode:"orphaned-permission",value:[],orphanedPermission:{permissionResult:L,assistantMessage:D}}]})),A?.(),!0}return!1}function LmA(H){return{...H,scope:"dynamic"}}async function BS1(H,$,A,L){let I={},D={};for(let[F,Q]of Object.entries(H))if(Q.type==="sdk")I[F]=Q;else D[F]=Q;let B=new Set(Object.keys($.configs)),f=new Set(Object.keys(I)),E=[],M=[],G={...$.configs},U=[...$.clients],X=[...$.tools];for(let F of B)if(!f.has(F)){let Q=U.find((P)=>P.name===F);if(Q&&Q.type==="connected")await Q.cleanup();U=U.filter((P)=>P.name!==F);let W=`mcp__${F}__`;X=X.filter((P)=>!P.name.startsWith(W)),delete G[F],M.push(F)}for(let[F,Q]of Object.entries(I))if(!B.has(F)){G[F]=Q;let W={type:"pending",name:F,config:{...Q,scope:"dynamic"}};U=[...U,W],E.push(F)}let J=await fS1(D,A,L);return{response:{added:[...E,...J.response.added],removed:[...M,...J.response.removed],errors:J.response.errors},newSdkState:{configs:G,clients:U,tools:X},newDynamicState:J.newState,sdkServersChanged:E.length>0||M.length>0}}async function fS1(H,$,A){let L=new Set(Object.keys($.configs)),I=new Set(Object.keys(H)),D=[...L].filter((W)=>!I.has(W)),B=[...I].filter((W)=>!L.has(W)),E=[...L].filter((W)=>I.has(W)).filter((W)=>{let P=$.configs[W],C=H[W];if(!P||!C)return!0;let Y=LmA(C);return!pqD(P,Y)}),M=[],G=[],U={},X=[...$.clients],J=[...$.tools];for(let W of[...D,...E]){let P=X.find((Z)=>Z.name===W),C=$.configs[W];if(P&&C){if(P.type==="connected")try{await P.cleanup()}catch(Z){r(Z instanceof Error?Z:Error(String(Z)))}await lh(W,C)}let Y=`mcp__${W}__`;if(J=J.filter((Z)=>!Z.name.startsWith(Y)),X=X.filter((Z)=>Z.name!==W),D.includes(W))M.push(W)}for(let W of[...B,...E]){let P=H[W];if(!P)continue;let C=LmA(P);if(P.type==="sdk"){G.push(W);continue}try{let Y=await Gz(W,C);if(X.push(Y),Y.type==="connected"){let Z=await zS(Y);J.push(...Z)}else if(Y.type==="failed")U[W]=Y.error||"Connection failed";G.push(W)}catch(Y){let Z=Y instanceof Error?Y.message:String(Y);U[W]=Z,r(Y instanceof Error?Y:Error(Z))}}let F={};for(let W of I){let P=H[W];if(P)F[W]=LmA(P)}let Q={clients:X,tools:J,configs:F};return A((W)=>{let P=new Set([...Object.keys($.configs),...Object.keys(F)]),C=W.mcp.tools.filter((Z)=>{for(let q of P)if(Z.name.startsWith(`mcp__${q}__`))return!1;return!0}),Y=W.mcp.clients.filter((Z)=>{return!P.has(Z.name)});return{...W,mcp:{...W.mcp,tools:[...C,...J],clients:[...Y,...X]}}}),{response:{added:G,removed:M,errors:U},newState:Q}}var ImA,jC,fMB=` Shut down your team and prepare your final response for the user.`,EMB;var UMB=K(()=>{gEB();sgA();rEB();h4();aEB();g7();z$();E$();kT();CP();_$();ISA();QgH();I3H();dx();TBH();sEB();uK$();HMB();gK$();UU();AMB();PI();SHH();UR$();XR$();ip();XY();XJ();nM();ogA();eE();RyH();bt();jh();EE();mL();gk();b5A();AJ();cg();EI();g$();hv();IMB();rB();JDH();f3();T3();tC();kF();N6H();T3();BW();DWH();uT$();UvA();aI();ND$();g$();AC();FdH();EM();MgH();Z$();MN$();h4();NA();BMB();XE();sU();aY();JG();ImA=require("process"),jC=require("crypto"),EMB=new Set});async function XMB(){try{let H=await _S();if(!H){N("Not in a GitHub repository, skipping path mapping update");return}let $;try{$=aO$.realpathSync(zL())}catch{$=zL()}let A=H.toLowerCase(),I=M$().githubRepoPaths?.[A]??[];if(I.includes($)){N(`Path ${$} already tracked for repo ${A}`);return}let D=[$,...I];AA((B)=>({...B,githubRepoPaths:{...B.githubRepoPaths,[A]:D}})),N(`Added ${$} to tracked paths for repo ${A}`)}catch(H){N(`Error updating repo path mapping: ${H}`)}}function JMB(H){let $=M$(),A=H.toLowerCase();return $.githubRepoPaths?.[A]??[]}function FMB(H){return H.filter(($)=>aO$.existsSync($))}async function KMB(H,$){try{let A=await asH(H);if(!A)return!1;let L=L9H(A);if(!L)return!1;return L.toLowerCase()===$.toLowerCase()}catch{return!1}}function QMB(H,$){let A=M$(),L=H.toLowerCase(),I=A.githubRepoPaths?.[L]??[],D=I.filter((f)=>f!==$);if(D.length===I.length)return;let B={...A.githubRepoPaths};if(D.length===0)delete B[L];else B[L]=D;AA((f)=>({...f,githubRepoPaths:B})),N(`Removed ${$} from tracked paths for repo ${L}`)}var aO$;var DmA=K(()=>{I9H();vA();g$();E$();j$H();aO$=require("fs")});function WMB({targetRepo:H,initialPaths:$,onSelectPath:A,onCancel:L}){let[I,D]=M_H.useState($),[B,f]=M_H.useState(null),[E,M]=M_H.useState(!1),G=M_H.useCallback(async(X)=>{if(X==="cancel"){L();return}if(M(!0),f(null),await KMB(X,H)){A(X);return}QMB(H,X);let F=I.filter((Q)=>Q!==X);D(F),M(!1),f(`${V9(X)} no longer contains the correct repository. Select another path.`)},[H,I,A,L]),U=[...I.map((X)=>({label:I6.default.createElement(V,null,"Use ",I6.default.createElement(V,{bold:!0},V9(X))),value:X})),{label:"Cancel",value:"cancel"}];return I6.default.createElement(BL,{title:"Teleport to Repo",onCancel:L,color:"background",borderDimColor:!0},I.length>0?I6.default.createElement(I6.default.Fragment,null,I6.default.createElement(x,{flexDirection:"column",gap:1},B&&I6.default.createElement(V,{color:"error"},B),I6.default.createElement(V,null,"Open Claude Code in ",I6.default.createElement(V,{bold:!0},H),":")),E?I6.default.createElement(x,null,I6.default.createElement(vD,null),I6.default.createElement(V,null," Validating repository\u2026")):I6.default.createElement(QA,{options:U,onChange:(X)=>void G(X)})):I6.default.createElement(x,{flexDirection:"column",gap:1},B&&I6.default.createElement(V,{color:"error"},B),I6.default.createElement(V,{dimColor:!0},"Run claude --teleport from a checkout of ",H)))}var I6,M_H;var VMB=K(()=>{xH();bB();l8();JM();rD();DmA();I6=b(s(),1),M_H=b(s(),1)});function ES1({currentStep:H,sessionId:$}){let[A,L]=DT(100),I=Math.floor(L/100)%BmA.length,D=PMB.findIndex((B)=>B.key===H);return uG.createElement(x,{ref:A,flexDirection:"column",paddingX:1,paddingY:1},uG.createElement(x,{marginBottom:1},uG.createElement(V,{bold:!0,color:"claude"},BmA[I]," Teleporting session\u2026")),$&&uG.createElement(x,{marginBottom:1},uG.createElement(V,{dimColor:!0},$)),uG.createElement(x,{flexDirection:"column",marginLeft:2},PMB.map((B,f)=>{let E=fD,U,X;if(E)U=pH.tick,X="green";else if(M)U=BmA[I],X="claude";else U=pH.circle,X=void 0;return uG.createElement(x,{key:B.key,flexDirection:"row"},uG.createElement(x,{width:2},uG.createElement(V,{color:X,dimColor:G},U)),uG.createElement(V,{dimColor:G,bold:M},B.label))})))}async function YMB(H){let $=()=>{};function A(){let[I,D]=_MB.useState("validating");return $=D,uG.createElement(ES1,{currentStep:I,sessionId:H})}let{unmount:L}=await A8(uG.createElement(i8,null,uG.createElement(A,null)),ZG(!1));try{let I=await ut(H,$);$("checking_out");let{branchName:D,branchError:B}=await f3H(I.branch);return{messages:B3H(I.log,B),branchName:D}}finally{L()}}var uG,_MB,BmA,PMB;var CMB=K(()=>{xH();jI();pL();ip();sv();uG=b(s(),1),_MB=b(s(),1),BmA=["\u25D0","\u25D3","\u25D1","\u25D2"],PMB=[{key:"validating",label:"Validating session"},{key:"fetching_logs",label:"Fetching session logs"},{key:"fetching_branch",label:"Getting branch info"},{key:"checking_out",label:"Checking out branch"}]});function ZMB({onSelect:H,onCancel:$,isEmbedded:A=!1}){let{rows:L}=QL(),[I,D]=J0.useState([]),[B,f]=J0.useState(null),[E,M]=J0.useState(!0),[G,U]=J0.useState(null),[X,J]=J0.useState(!1),[F,Q]=J0.useState(!1),[W,P]=J0.useState(1),C=C0("confirm:no","Confirmation","Esc"),Y=J0.useCallback(async()=>{try{M(!0),U(null);let d=await _S();f(d),N(`Current repository: ${d||"not detected"}`);let k=await ZFD(),n=k;if(d)n=k.filter((HH)=>{if(!HH.repo)return!1;return`${HH.repo.owner.login}/${HH.repo.name}`===d}),N(`Filtered ${n.length} sessions for repo ${d} from ${k.length} total`);let GH=[...n].sort((HH,BH)=>{let WH=new Date(HH.updated_at);return new Date(BH.updated_at).getTime()-WH.getTime()});D(GH)}catch(d){let k=d instanceof Error?d.message:String(d);N(`Error loading code sessions: ${k}`),U(GS1(k))}finally{M(!1),J(!1)}},[]),Z=()=>{J(!0),Y()};BA("confirm:no",$,{context:"Confirmation"}),WL((d,k)=>{if(k.ctrl&&d==="c"){$();return}if(k.ctrl&&d==="r"&&G){Z();return}if(G!==null&&k.return){$();return}});let q=J0.useCallback(()=>{Q(!0),Y()},[Q,Y]);if(!F)return J0.default.createElement(oC$,{onComplete:q});if(E)return J0.default.createElement(x,{flexDirection:"column",padding:1},J0.default.createElement(x,{flexDirection:"row"},J0.default.createElement(vD,null),J0.default.createElement(V,{bold:!0},"Loading Claude Code sessions\u2026")),J0.default.createElement(V,{dimColor:!0},X?"Retrying\u2026":"Fetching your Claude Code sessions\u2026"));if(G)return J0.default.createElement(x,{flexDirection:"column",padding:1},J0.default.createElement(V,{bold:!0,color:"error"},"Error loading Claude Code sessions"),US1(G),J0.default.createElement(V,{dimColor:!0},"Press ",J0.default.createElement(V,{bold:!0},"Ctrl+R")," to retry \xB7 Press"," ",J0.default.createElement(V,{bold:!0},C)," to cancel"));if(I.length===0)return J0.default.createElement(x,{flexDirection:"column",padding:1},J0.default.createElement(V,{bold:!0},"No Claude Code sessions found",B&&J0.default.createElement(V,null," for ",B)),J0.default.createElement(x,{marginTop:1},J0.default.createElement(V,{dimColor:!0},"Press ",J0.default.createElement(V,{bold:!0},C)," to cancel")));let O=I.map((d)=>({...d,timeString:P9$(new Date(d.updated_at))})),j=Math.max(wMB.length,...O.map((d)=>d.timeString.length)),u=O.map(({timeString:d,title:k,id:n})=>{return{label:`${d.padEnd(j," ")} ${k}`,value:n}}),y=7,g=Math.max(1,A?Math.min(I.length,5,L-6-y):Math.min(I.length,L-1-y)),h=g+y,p=I.length>g;return J0.default.createElement(x,{flexDirection:"column",padding:1,height:h},J0.default.createElement(V,{bold:!0},"Select a session to resume",p&&J0.default.createElement(V,{dimColor:!0}," ","(",W," of ",I.length,")"),B&&J0.default.createElement(V,{dimColor:!0}," (",B,")"),":"),J0.default.createElement(x,{flexDirection:"column",marginTop:1,flexGrow:1},J0.default.createElement(x,{marginLeft:2},J0.default.createElement(V,{bold:!0},wMB.padEnd(j," "),MS1,"Session Title")),J0.default.createElement(QA,{visibleOptionCount:g,options:u,onChange:(d)=>{let k=I.find((n)=>n.id===d);if(k)H(k)},onFocus:(d)=>{let k=u.findIndex((n)=>n.value===d);if(k>=0)P(k+1)}})),J0.default.createElement(x,{flexDirection:"row"},J0.default.createElement(V,{dimColor:!0},J0.default.createElement(rA,null,J0.default.createElement(s$,{shortcut:"\u2191/\u2193",action:"select"}),J0.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),J0.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}function GS1(H){let $=H.toLowerCase();if($.includes("fetch")||$.includes("network")||$.includes("timeout"))return"network";if($.includes("auth")||$.includes("token")||$.includes("permission")||$.includes("oauth")||$.includes("not authenticated")||$.includes("/login")||$.includes("console account")||$.includes("403"))return"auth";if($.includes("api")||$.includes("rate limit")||$.includes("500")||$.includes("529"))return"api";return"other"}function US1(H){switch(H){case"network":return J0.default.createElement(x,{marginY:1,flexDirection:"column"},J0.default.createElement(V,{dimColor:!0},"Check your internet connection"));case"auth":return J0.default.createElement(x,{marginY:1,flexDirection:"column"},J0.default.createElement(V,{dimColor:!0},"Teleport requires a Claude account"),J0.default.createElement(V,{dimColor:!0},"Run ",J0.default.createElement(V,{bold:!0},"/login"),' and select "Claude account with subscription"'));case"api":return J0.default.createElement(x,{marginY:1,flexDirection:"column"},J0.default.createElement(V,{dimColor:!0},"Sorry, Claude encountered an error"));case"other":return J0.default.createElement(x,{marginY:1,flexDirection:"row"},J0.default.createElement(V,{dimColor:!0},"Sorry, Claude Code encountered an error"))}}var J0,wMB="Updated",MS1=" ";var qMB=K(()=>{xH();$I();l8();JM();OB();E$();ONA();Q9();I9H();YS();lB();j0();FG();eB();J0=b(s(),1)});function TMB(H){let[$,A]=h8H.useState(!1),[L,I]=h8H.useState(null),[D,B]=h8H.useState(null),f=h8H.useCallback(async(M)=>{A(!0),I(null),B(M),c("tengu_teleport_resume_session",{source:H,session_id:M.id});try{let G=await ut(M.id);return dYH({sessionId:M.id}),A(!1),G}catch(G){let U={message:G instanceof AK?G.message:G instanceof Error?G.message:String(G),formattedMessage:G instanceof AK?G.formattedMessage:void 0,isOperationError:G instanceof AK};return I(U),A(!1),null}},[H]),E=h8H.useCallback(()=>{I(null)},[]);return{resumeSession:f,isResuming:$,error:L,selectedSession:D,clearError:E}}var h8H;var zMB=K(()=>{ip();lG();z$();g$();h8H=b(s(),1)});function XS1({onComplete:H,onCancel:$,onError:A,isEmbedded:L=!1,source:I}){let{resumeSession:D,isResuming:B,error:f,selectedSession:E}=TMB(I);NMB.useEffect(()=>{c("tengu_teleport_started",{source:I})},[I]);let M=async(U)=>{let X=await D(U);if(X)H(X);else if(f){if(A)A(f.message,f.formattedMessage)}},G=()=>{c("tengu_teleport_cancelled",{}),$()};if(B&&E)return s3.default.createElement(x,{flexDirection:"column",padding:1},s3.default.createElement(x,{flexDirection:"row"},s3.default.createElement(vD,null),s3.default.createElement(V,{bold:!0},"Resuming session\u2026")),s3.default.createElement(V,{dimColor:!0},'Loading "',E.title,'"\u2026'));if(f&&!A)return s3.default.createElement(x,{flexDirection:"column",padding:1},s3.default.createElement(V,{bold:!0,color:"error"},"Failed to resume session"),s3.default.createElement(V,{dimColor:!0},f.message),s3.default.createElement(x,{marginTop:1},s3.default.createElement(V,{dimColor:!0},"Press ",s3.default.createElement(V,{bold:!0},"Esc")," to cancel")));return s3.default.createElement(ZMB,{onSelect:M,onCancel:G,isEmbedded:L})}async function OMB(){return N("selectAndResumeTeleportTask: Starting teleport flow..."),new Promise(async(H)=>{let{unmount:$}=await A8(s3.default.createElement(i8,null,s3.default.createElement(hE,null,s3.default.createElement(XS1,{onComplete:(A)=>{$(),H(A)},onCancel:()=>{$(),H(null)},onError:(A,L)=>{process.stderr.write(L?L+` claude mcp add --transport http sentry https://mcp.sentry.dev/mcp claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..." claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server claude mcp add my-server -- my-command --some-flag arg1`).option("-s, --scope ","Configuration scope (local, user, or project)","local").option("-t, --transport ","Transport type (stdio, sse, http). Defaults to stdio if not specified.").option("-e, --env ","Set environment variables (e.g. -e KEY=value)").option("-H, --header ",'Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")').option("--client-id ","OAuth client ID for HTTP/SSE servers").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").option("--callback-port ","Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)").helpOption("-h, --help","Display help for command").action(async($,A,L,I)=>{let D=A,B=L;if(!$)console.error("Error: Server name is required."),console.error("Usage: claude mcp add [args...]"),process.exit(1);else if(!D)console.error("Error: Command is required when server name is provided."),console.error("Usage: claude mcp add [args...]"),process.exit(1);try{let f=V3H(I.scope),E=bZD(I.transport),M=I.transport!==void 0,G=D.startsWith("http://")||D.startsWith("https://")||D.startsWith("localhost")||D.endsWith("/sse")||D.endsWith("/mcp");if(c("tengu_mcp_add",{type:E,scope:f,source:"command",transport:E,transportExplicit:M,looksLikeUrl:G}),E==="sse"){if(!D)console.error("Error: URL is required for SSE transport."),process.exit(1);let U=I.header?sNA(I.header):void 0,X=I.callbackPort?parseInt(I.callbackPort,10):void 0,J=I.clientId?{clientId:I.clientId,...X?{callbackPort:X}:{}}:void 0,F=I.clientSecret&&I.clientId?await RuH():void 0,Q={type:"sse",url:D,headers:U,oauth:J};if(mt($,Q,f),F)yuH($,Q,F);if(process.stdout.write(`Added SSE MCP server ${$} with URL: ${D} to ${f} config `),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${$} ${D} `),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${$} ${D} `),process.exit(0)}catch(f){console.error(f.message),process.exit(1)}})}var jMB=K(()=>{T3();kF();NA();Z$();z$();n9H()});function fmA(H,$=process.argv){for(let A=0;A<$.length;A++){let L=$[A];if(L?.startsWith(`${H}=`))return L.slice(H.length+1);if(L===H&&A+1<$.length)return $[A+1]}return}class MmA{server=null;secret;port=null;mcpClients;availableTools;resources;constructor(H,$){this.mcpClients=H,this.availableTools=$||[],this.resources={},this.secret=oO$.randomBytes(32).toString("hex")}async start(){if(this.server)throw Error("MCP CLI endpoint already started");return new Promise((H,$)=>{this.server=RMB.createServer((A,L)=>{this.handleRequest(A,L)}),this.server.on("error",(A)=>{r(A),$(A)}),this.server.listen(0,"127.0.0.1",()=>{let A=this.server.address();if(!A||typeof A==="string"){$(Error("Failed to get server address"));return}this.port=A.port;let L=`http://127.0.0.1:${this.port}`;N(`[MCP CLI Endpoint] Started on ${L}`),H({port:this.port,url:L})})})}getSecret(){return this.secret}async handleRequest(H,$){if(H.setTimeout(30000),H.on("timeout",()=>{N("[MCP CLI Endpoint] Request timeout"),$.writeHead(408,{"Content-Type":"application/json"}),$.end(yH({error:"Request Timeout"}))}),H.method!=="POST"||H.url!=="/mcp"){$.writeHead(404,{"Content-Type":"application/json"}),$.end(yH({error:"Not Found"}));return}let A=H.headers.authorization;if(!A?.startsWith("Bearer ")){$.writeHead(403,{"Content-Type":"application/json"}),$.end(yH({error:"Forbidden"}));return}let L=A.slice(7);if(!this.validateSecret(L)){$.writeHead(403,{"Content-Type":"application/json"}),$.end(yH({error:"Forbidden"}));return}let I=10485760,D=0,B="";H.on("data",(f)=>{if(D+=f.length,D>I){N(`[MCP CLI Endpoint] Request too large: ${D} bytes`),$.writeHead(413,{"Content-Type":"application/json"}),$.end(yH({error:"Payload Too Large"})),H.destroy();return}B+=f.toString()}),H.on("end",async()=>{try{let f=DA(B),E=ZtD.parse(f),M=await this.handleCommand(E);$.writeHead(200,{"Content-Type":"application/json"}),$.end(yH(M))}catch(f){let E=500;if(f instanceof SyntaxError)E=400;else if(f&&typeof f==="object"&&"name"in f){if(f.name==="ZodError")E=400}$.writeHead(E,{"Content-Type":"application/json"}),$.end(yH({error:f instanceof Error?f.message:"Unknown error",type:f instanceof Error?f.constructor.name:"Error"})),r(f instanceof Error?f:Error(String(f)))}}),H.on("error",(f)=>{if(r(f),!$.headersSent)$.writeHead(500,{"Content-Type":"application/json"}),$.end(yH({error:"Internal Server Error"}))})}validateSecret(H){try{let $=Buffer.from(H),A=Buffer.from(this.secret);if($.length!==A.length)return!1;return oO$.timingSafeEqual($,A)}catch{return!1}}async handleCommand(H){let $=Date.now(),A=H.command==="call"?`mcp__${H.params.server}__${H.params.tool}`:void 0,L,I;if(H.command==="call"){let D=jPH(this.mcpClients,H.params.server,this.getNormalizedNames());if(D?.type==="connected")L=vX(D.config),I=D.config.type??"stdio"}try{let{data:D,metadata:B}=await this.executeCommand(H),f=Date.now()-$;if(H.command==="call")c("tengu_tool_use_success",{toolName:nB(A??""),isMcp:!0,durationMs:f,...I?{mcpServerType:I}:{},...L?{mcpServerBaseUrl:L}:{}});return c("tengu_mcp_cli_command_executed",{command:H.command,success:!0,duration_ms:f,...B}),D}catch(D){let B=D instanceof Error?D:Error(String(D)),f=Date.now()-$,E=String(D).slice(0,2000);if(H.command==="call")c("tengu_tool_use_error",{toolName:nB(A??""),isMcp:!0,error:E,durationMs:f,...I?{mcpServerType:I}:{},...L?{mcpServerBaseUrl:L}:{}});throw c("tengu_mcp_cli_command_executed",{command:H.command,success:!1,error_type:H.command==="call"?"tool_execution_failed":B.constructor,duration_ms:Date.now()-$}),D}}async executeCommand(H){switch(H.command){case"servers":{let $=ez$(this.mcpClients);return{data:$,metadata:{server_count:$.length}}}case"tools":{let $=HN$(this.availableTools,H.params);return{data:$,metadata:{tool_count:$.length,filtered:!!H.params?.server}}}case"info":{let $=await $N$(this.availableTools,H.params);if(!$){let A=jPH(this.mcpClients,H.params.server,this.getNormalizedNames()),L=G8H(H.params.server,A?.type);if(L)throw L;throw new EmA(`Tool '${H.params.toolName}' not found on server '${H.params.server}'`)}return{data:$,metadata:{tool_found:!0}}}case"grep":{let $=AN$(this.availableTools,H.params);return{data:$,metadata:{match_count:$.length}}}case"resources":{let $=LN$(this.resources,H.params,this.getNormalizedNames());return{data:$,metadata:{resource_count:$.length,filtered:!!H.params?.server}}}case"call":{let{server:$,tool:A}=H.params;return{data:await this.callTool(H.params),metadata:{tool_name:`mcp__${$}__${A}`}}}case"read":return{data:await this.readResource(H.params),metadata:{server:H.params.server}};default:{let $=H;throw Error("Unknown command")}}}getConnectedClient(H){let $=jPH(this.mcpClients,H,this.getNormalizedNames()),A=G8H(H,$?.type);if(A)throw A;return $}async callTool({server:H,tool:$,args:A,timeoutMs:L}){let I=this.getConnectedClient(H),D=`mcp__${H}__${$}`,B=this.availableTools.find((M)=>M.name===D);if(this.availableTools.length>0&&!B)throw new EmA(`Tool '${$}' not found on server '${H}'`);let f=B?.originalMcpToolName||$;return await I.client.request({method:"tools/call",params:{name:f,arguments:A}},fP,L?{signal:AbortSignal.timeout(L)}:void 0)}async readResource({server:H,uri:$,timeoutMs:A}){return await this.getConnectedClient(H).client.readResource({uri:$},A?{signal:AbortSignal.timeout(A)}:void 0)}async stop(){if(!this.server)return;return new Promise((H,$)=>{this.server.close((A)=>{if(A)$(A);else N("[MCP CLI Endpoint] Stopped"),this.server=null,this.port=null,H()})})}updateClients(H){this.mcpClients=H}updateTools(H){this.availableTools=H}updateResources(H){this.resources=H}getNormalizedNames(){let H={};for(let $ of this.mcpClients)H[E1($.name)]=$.name;return H}}var RMB,oO$,EmA;var yMB=K(()=>{CK();QkA();WkA();VkA();PkA();_kA();kF();E$();_$();z$();R4();YkA();Z$();RMB=require("http"),oO$=require("crypto");EmA=class EmA extends Error{constructor(H){super(H);this.name="ToolNotFoundError"}}});function vMB(H,$){let[A,L]=tO$.useState(!1);return tO$.useEffect(()=>{L(!1);let I=setTimeout(()=>{L(!0)},H);return()=>clearTimeout(I)},[H,$]),A}var tO$;var hMB=K(()=>{tO$=b(s(),1)});async function JS1(){try{let H=["https://api.anthropic.com/api/hello","https://platform.claude.com/v1/oauth/hello"],$=async(I)=>{try{let D=await nA.get(I,{headers:{"User-Agent":Gn()}});if(D.status!==200)return{success:!1,error:`Failed to connect to ${new URL(I).hostname}: Status ${D.status}`};return{success:!0}}catch(D){return{success:!1,error:`Failed to connect to ${new URL(I).hostname}: ${D instanceof Error?D.code||D.message:String(D)}`}}},L=(await Promise.all(H.map($))).find((I)=>!I.success);if(L)c("tengu_preflight_check_failed",{isConnectivityError:!1,hasErrorMessage:!!L.error});return L||{success:!0}}catch(H){return r(H),c("tengu_preflight_check_failed",{isConnectivityError:!0}),{success:!1,error:`Connectivity check error: ${H instanceof Error?H.code||H.message:String(H)}`}}}function bMB({onSuccess:H}){let[$,A]=G_H.useState(null),[L,I]=G_H.useState(!0),D=vMB(1000)&&L;return G_H.useEffect(()=>{async function B(){let f=await JS1();A(f),I(!1)}B()},[]),G_H.useEffect(()=>{if($?.success)H();else if($&&!$.success){let B=setTimeout(()=>process.exit(1),100);return()=>clearTimeout(B)}},[$,H]),nz.default.createElement(x,{flexDirection:"column",gap:1,paddingLeft:1},L&&D?nz.default.createElement(x,{paddingLeft:1},nz.default.createElement(vD,null),nz.default.createElement(V,null,"Checking connectivity...")):!$?.success&&!L&&nz.default.createElement(x,{flexDirection:"column",gap:1},nz.default.createElement(V,{color:"error"},"Unable to connect to Anthropic services"),nz.default.createElement(V,{color:"error"},$?.error),nz.default.createElement(x,{flexDirection:"column",gap:1},nz.default.createElement(V,null,"Please check your internet connection and network settings."),nz.default.createElement(V,null,"Note: Claude Code might not be available in your country. Check supported countries at"," ",nz.default.createElement(V,{color:"suggestion"},"https://anthropic.com/supported-countries")))))}var nz,G_H;var kMB=K(()=>{xH();_Q();_$();JM();hMB();z$();w1();nz=b(s(),1),G_H=b(s(),1)});function eO$(){let[H]=_I(),$="Welcome to Claude Code";if(OA.terminal==="Apple_Terminal")return uA.default.createElement(FS1,{theme:H,welcomeMessage:"Welcome to Claude Code"});if(["light","light-daltonized","light-ansi"].includes(H))return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},"Welcome to Claude Code"," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," "),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588 ")),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588\u2592\u2592\u2588\u2588 ")),uA.default.createElement(V,null," \u2592\u2592 \u2588\u2588 \u2592"),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," \u2592\u2592\u2591\u2591\u2592\u2592 \u2592 \u2592\u2592"),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588")," \u2592\u2592 \u2592\u2592 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," \u2591 \u2592 "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{color:"clawd_body"},"\u2588 \u2588 \u2588 \u2588"),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2591\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2592\u2026\u2026\u2026\u2026")));return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},"Welcome to Claude Code"," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2593\u2591 \u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null,uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," \u2588\u2588\u2593\u2591\u2591 \u2593 ")),uA.default.createElement(V,null," \u2591\u2593\u2593\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,{dimColor:!0}," * \u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," ",uA.default.createElement(V,{dimColor:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"},"\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588"),uA.default.createElement(V,null," "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," * "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{color:"clawd_body"},"\u2588 \u2588 \u2588 \u2588"),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026")))}function FS1({theme:H,welcomeMessage:$}){if(["light","light-daltonized","light-ansi"].includes(H))return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},$," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," "),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588 ")),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588\u2592\u2592\u2588\u2588 ")),uA.default.createElement(V,null," \u2592\u2592 \u2588\u2588 \u2592"),uA.default.createElement(V,null," \u2592\u2592\u2591\u2591\u2592\u2592 \u2592 \u2592\u2592"),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"},"\u2597"),uA.default.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),uA.default.createElement(V,{color:"clawd_body"},"\u2596")," \u2592\u2592 \u2592\u2592 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(9))," \u2591 \u2592 "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2591\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2592\u2026\u2026\u2026\u2026")));return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},$," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2593\u2591 \u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null,uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," \u2588\u2588\u2593\u2591\u2591 \u2593 ")),uA.default.createElement(V,null," \u2591\u2593\u2593\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,{dimColor:!0}," * \u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{dimColor:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"},"\u2597"),uA.default.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),uA.default.createElement(V,{color:"clawd_body"},"\u2596"),uA.default.createElement(V,null," "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(9))," * "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026")))}var uA,sO$=58;var GmA=K(()=>{xH();Z1();uA=b(s(),1)});var uMB={};XA(uMB,{Onboarding:()=>KS1});function KS1({onDone:H}){let[$,A]=U_H.useState(0),L=p_(),[I,D]=_I();U_H.useEffect(()=>{c("tengu_began_setup",{oauthEnabled:L})},[L]);function B(){if(${if(!process.env.ANTHROPIC_API_KEY)return"";let P=Z2(process.env.ANTHROPIC_API_KEY);if(lz$(P)==="new")return P},[]),J=[];if(L)J.push({id:"preflight",component:U});if(J.push({id:"theme",component:M}),L)J.push({id:"oauth",component:M8.default.createElement(s0H,{onDone:B})});if(X)J.push({id:"api-key",component:M8.default.createElement(dO$,{customApiKeyTruncated:X,onDone:B})});if(J.push({id:"security",component:G}),AFH())J.push({id:"terminal-setup",component:M8.default.createElement(x,{flexDirection:"column",gap:1,paddingLeft:1},M8.default.createElement(V,{bold:!0},"Use Claude Code's terminal setup?"),M8.default.createElement(x,{flexDirection:"column",width:70,gap:1},M8.default.createElement(V,null,"For the optimal coding experience, enable the recommended settings",M8.default.createElement(_K,null),"for your terminal:"," ",OA.terminal==="Apple_Terminal"?"Option+Enter for newlines and visual bell":"Shift+Enter for newlines"),M8.default.createElement(QA,{options:[{label:"Yes, use recommended settings",value:"install"},{label:"No, maybe later with /terminal-setup",value:"no"}],onChange:(P)=>{if(P==="install")A4$(I).catch(()=>{}).finally(B);else B()},onCancel:()=>B()}),M8.default.createElement(V,{dimColor:!0},E.pending?M8.default.createElement(M8.default.Fragment,null,"Press ",E.keyName," again to exit"):M8.default.createElement(M8.default.Fragment,null,"Enter to confirm \xB7 Esc to skip"))))});let F=J[$],Q=M8.useCallback(()=>{if($===J.length-1)H();else B()},[$,J.length,L,H]),W=M8.useCallback(()=>{B()},[$,J.length,L,H]);return bI({"confirm:yes":Q},{context:"Confirmation",isActive:F?.id==="security"}),bI({"confirm:no":W},{context:"Confirmation",isActive:F?.id==="terminal-setup"}),M8.default.createElement(x,{flexDirection:"column"},M8.default.createElement(eO$,null),M8.default.createElement(x,{flexDirection:"column",marginTop:1},F?.component,E.pending&&M8.default.createElement(x,{padding:1},M8.default.createElement(V,{dimColor:!0},"Press ",E.keyName," again to exit"))))}var M8,U_H;var gMB=K(()=>{xH();$I();vA();ZqH();B5A();UM();SbH();ggA();EI();xH();IRA();kMB();Mq$();z$();Z1();N1();BDH();GmA();M8=b(s(),1),U_H=b(s(),1)});function mMB(H){if(H===null||H.disableAllHooks)return!1;if(H.statusLine)return!0;if(H.fileSuggestion)return!0;if(!H.hooks)return!1;for(let $ of Object.values(H.hooks))if($.length>0)return!0;return!1}function nMB(){let H=[],$=ZI("projectSettings");if(mMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(mMB(A))H.push(".claude/settings.local.json");return H}function pMB(H){return H.some(($)=>$.ruleBehavior==="allow"&&($.ruleValue.toolName===WD||$.ruleValue.toolName.startsWith(WD+"(")))}function rMB(){let H=[],$=BTH("projectSettings");if(pMB($))H.push(".claude/settings.json");let A=BTH("localSettings");if(pMB(A))H.push(".claude/settings.local.json");return H}function dMB(H){return!!H?.otelHeadersHelper}function aMB(){let H=[],$=ZI("projectSettings");if(dMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(dMB(A))H.push(".claude/settings.local.json");return H}function cMB(H){return!!H?.apiKeyHelper}function oMB(){let H=[],$=ZI("projectSettings");if(cMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(cMB(A))H.push(".claude/settings.local.json");return H}function lMB(H){return!!(H?.awsAuthRefresh||H?.awsCredentialExport)}function tMB(){let H=[],$=ZI("projectSettings");if(lMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(lMB(A))H.push(".claude/settings.local.json");return H}function iMB(H){if(!H?.env)return!1;return Object.keys(H.env).some(($)=>!D0H.has($.toUpperCase()))}function sMB(){let H=[],$=ZI("projectSettings");if(iMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(iMB(A))H.push(".claude/settings.local.json");return H}var eMB=K(()=>{_q();mL();f7$()});var HGB={};XA(HGB,{TrustDialog:()=>QS1});function QS1({onDone:H,commands:$}){let{servers:A}=OJ("project"),L=Object.keys(A).length>0,D=nMB().length>0,B=rMB(),E=oMB().length>0,G=tMB().length>0,X=aMB().length>0,F=sMB().length>0,Q=$?.some((j)=>j.type==="prompt"&&j.loadedFrom==="commands_DEPRECATED"&&(j.source==="projectSettings"||j.source==="localSettings")&&j.allowedTools?.some((u)=>u===WD||u.startsWith(WD+"(")))??!1,W=$?.some((j)=>j.type==="prompt"&&(j.loadedFrom==="skills"||j.loadedFrom==="plugin")&&(j.source==="projectSettings"||j.source==="localSettings"||j.source==="plugin")&&j.allowedTools?.some((u)=>u===WD||u.startsWith(WD+"(")))??!1,P=B.length>0||Q||W,C=XG(D||P||E||G||X||F),Z=[{name:"MCP servers",shouldShowWarning:()=>L,onChange:()=>{let j={enabledMcpjsonServers:Object.keys(A),enableAllProjectMcpServers:!0};II("localSettings",j)}},{name:"hooks",shouldShowWarning:()=>D},{name:"bash commands",shouldShowWarning:()=>P},{name:"OpenTelemetry headers helper commands",shouldShowWarning:()=>X},{name:"dangerous environment variables",shouldShowWarning:()=>F}].filter((j)=>j.shouldShowWarning());A_.default.useEffect(()=>{let j=UmA.homedir()===C$();c("tengu_trust_dialog_shown",{isHomeDir:j,hasMcpServers:L,hasHooks:D,hasBashExecution:P,hasApiKeyHelper:E,hasAwsCommands:G,hasOtelHeadersHelper:X,hasDangerousEnvVars:F})},[L,D,P,E,G,X,F]);function q(j){if(j==="exit"){L9(1);return}let u=UmA.homedir()===C$();if(c("tengu_trust_dialog_accept",{isHomeDir:u,hasMcpServers:L,hasHooks:D,hasBashExecution:P,hasApiKeyHelper:E,hasAwsCommands:G,hasOtelHeadersHelper:X,hasDangerousEnvVars:F,enableMcp:!0}),u)Fj$(!0);else MM((y)=>({...y,hasTrustDialogAccepted:!0}));Z.forEach((y)=>{if(y.onChange!==void 0)y.onChange()}),H()}let O=zB();if(BA("confirm:no",()=>{L9(0)},{context:"Confirmation"}),C)return setTimeout(H),null;return A_.default.createElement(wG,{color:"warning",titleColor:"warning",title:"Accessing workspace:"},A_.default.createElement(x,{flexDirection:"column",gap:1,paddingTop:1},A_.default.createElement(V,{bold:!0},zH().cwd()),A_.default.createElement(V,null,"Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what","'","s in this folder first."),A_.default.createElement(V,null,"Claude Code","'","ll be able to read, edit, and execute files here."),A_.default.createElement(V,{dimColor:!0},A_.default.createElement(dI,{url:"https://code.claude.com/docs/en/security"},"Security guide")),A_.default.createElement(QA,{options:[{label:"Yes, I trust this folder",value:"enable_all"},{label:"No, exit",value:"exit"}],onChange:(j)=>q(j),onCancel:()=>q("exit")}),A_.default.createElement(V,{dimColor:!0},O.pending?A_.default.createElement(A_.default.Fragment,null,"Press ",O.keyName," again to exit"):A_.default.createElement(A_.default.Fragment,null,"Enter to confirm \xB7 Esc to cancel"))))}var A_,UmA;var $GB=K(()=>{xH();$I();l8();vA();T3();mL();z$();UM();PI();g$();xH();DL();UU();eMB();Xw();A_=b(s(),1),UmA=require("os")});function WS1(){return NL("tengu_session_memory",!1)}function VS1(){return rm("tengu_sm_config",{})}function PS1(H,$){let A=0,L=$===null||$===void 0;for(let I of H){if(!L){if(I.uuid===$)L=!0;continue}if(I.type==="assistant"){let B=I.message.content;if(Array.isArray(B))A+=B.filter((f)=>f.type==="tool_use").length}}return A}function _S1(H){let $=UT(H);if(!UzD()){if(!JzD($))return!1;XzD()}let A=FzD($),I=PS1(H,AGB)>=KzD(),D=ZpH(H);if(A&&I||A&&!D){let f=H[H.length-1];if(f?.uuid)AGB=f.uuid;return!0}return!1}async function YS1(H){let $=zH(),A=mz$();if(!$.existsSync(A))$.mkdirSync(A,{mode:448});let L=T3H();if(!$.existsSync(L)){let f=await mOA();iL(L,f,{encoding:"utf-8",flush:!1,mode:384})}let I=await k8.call({file_path:L},H),D="",B=I.data;if(B.type==="text")D=B.file.content;return c("tengu_session_memory_file_read",{content_length:D.length}),{memoryPath:L,currentMemory:D}}function LGB(){if(!ep())return;AZ$(wS1)}function ZS1(H){return async($,A)=>{if($.name===TB&&typeof A==="object"&&A!==null&&"file_path"in A){if(A.file_path===H)return{behavior:"allow",updatedInput:A}}return{behavior:"deny",message:`only ${TB} on ${H} is allowed`,decisionReason:{type:"other",reason:`only ${TB} on ${H} is allowed`}}}}function qS1(H){if(!ZpH(H)){let $=H[H.length-1];if($?.uuid)o9H($.uuid)}}var AGB,CS1,wS1;var IGB=K(()=>{BM();tD();DL();Z$();bw();pOA();qS();GgH();z$();jp();_L();q3H();$3();Ow();bT();SD();CS1=o$(()=>{let H=VS1(),$={minimumMessageTokensToInit:H.minimumMessageTokensToInit&&H.minimumMessageTokensToInit>0?H.minimumMessageTokensToInit:duH.minimumMessageTokensToInit,minimumTokensBetweenUpdate:H.minimumTokensBetweenUpdate&&H.minimumTokensBetweenUpdate>0?H.minimumTokensBetweenUpdate:duH.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:H.toolCallsBetweenUpdates&&H.toolCallsBetweenUpdates>0?H.toolCallsBetweenUpdates:duH.toolCallsBetweenUpdates};EzD($)}),wS1=rR(async function(H){let{messages:$,toolUseContext:A,querySource:L}=H;if(L!=="repl_main_thread")return;if(!WS1())return;if(CS1(),!_S1($))return;DzD();let I=BkH(A),{memoryPath:D,currentMemory:B}=await YS1(I),f=await PzD(B,D);await xw({promptMessages:[R$({content:f})],cacheSafeParams:Ls(H),canUseTool:ZS1(D),querySource:"session_memory",forkLabel:"session_memory",overrides:{readFileState:I.readFileState}});let E=$[$.length-1],M=E?rg(E):void 0,G=MzD();c("tengu_session_memory_extraction",{input_tokens:M?.input_tokens,output_tokens:M?.output_tokens,cache_read_input_tokens:M?.cache_read_input_tokens??void 0,cache_creation_input_tokens:M?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:G.minimumMessageTokensToInit,config_min_tokens_between_update:G.minimumTokensBetweenUpdate,config_tool_calls_between_updates:G.toolCallsBetweenUpdates}),GzD(UT($)),qS1($),BzD()})});function TS1(H){let $=rU(C$()),A=zH(),L=H?new Date(H).getTime():0;try{let I=A.readdirSync($),D=[];for(let B of I){if(!B.isDirectory())continue;let f=DGB.join($,B.name,"session-memory","summary.md");try{let E=A.statSync(f);if(E.mtimeMs>L)D.push({id:B.name,mtime:E.mtimeMs,path:f})}catch{}}return D.sort((B,f)=>f.mtime-B.mtime),D.map((B)=>B.path)}catch{return[]}}function BGB(){return}var DGB,zS1=`# Remember Skill - **Session memories**: \`~/.claude/projects/{sanitized-project-path}/{session-id}/session-memory/summary.md\` `;var fGB=K(()=>{Fj();vA();rB();PI();DL();DGB=require("path")});function EGB(){UW({name:"claude-in-chrome",description:"Automates your Chrome browser to interact with web pages - clicking elements, filling forms, capturing screenshots, reading console logs, and navigating sites. Opens pages in new tabs within your existing Chrome session. Requires site-level permissions before executing (configured in the extension).",whenToUse:"When the user wants to interact with web pages, automate browser tasks, capture screenshots, read console logs, or perform any browser-based actions. Always invoke BEFORE attempting to use any mcp__claude-in-chrome__* tools.",allowedTools:NS1,userInvocable:!0,isEnabled:()=>UPH(),async getPromptForCommand(H){let $=`${KiD} Now that this skill is invoked, you have access to Chrome browser automation tools. You can now use the mcp__claude-in-chrome__* tools to interact with web pages. IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs. `;var MGB=K(()=>{Fj();tT$();H8H();NS1=e1H.map((H)=>`mcp__claude-in-chrome__${H.name}`)});function xS1(){let H=Rk(tZ,{io:"input"});return yH(H,null,2)}function GGB(){return}var SS1=`## Settings File Locations | \`~/.claude/settings.json\` | Global | N/A | Personal preferences for all projects | | \`.claude/settings.json\` | Project | Commit | Team-wide hooks, permissions, plugins | | \`.claude/settings.local.json\` | Project | Gitignore | Personal overrides for this project | "allow": ["Bash(npm:*)", "Edit(.claude)", "Read"], Plugin syntax: \`plugin-name@source\` where source is \`claude-code-marketplace\`, \`claude-plugins-official\`, or \`builtin\`. "command": "jq -r '.tool_input.command' >> ~/.claude/bash-log.txt" "Edit(.claude)", // existing 2. **Read**: \`.claude/settings.json\` (or create if missing) 1. **Check the settings file** - Read ~/.claude/settings.json or .claude/settings.json 6. **Use --debug** - Run \`claude --debug\` to see hook execution logs `)}function FGB(){UW({name:"keybindings-help",description:'Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".',allowedTools:["Read"],userInvocable:!1,isEnabled:m2,async getPromptForCommand(H){let $=vS1(),A=hS1(),L=kS1(),I=[dS1,cS1,lS1,iS1,nS1,rS1,aS1,oS1,`## Reserved Shortcuts `)}var uS1,gS1,mS1,pS1,dS1,cS1,lS1,iS1,nS1,rS1,aS1,oS1;var KGB=K(()=>{Fj();JGB();B8$();f8$();nu();Z$();uS1={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:[{context:"Chat",bindings:{"ctrl+e":"chat:externalEditor"}}]},gS1={context:"Chat",bindings:{"ctrl+s":null}},mS1={context:"Chat",bindings:{"ctrl+g":null,"ctrl+e":"chat:externalEditor"}},pS1={context:"Global",bindings:{"ctrl+k ctrl+t":"app:toggleTodos"}},dS1=["# Keybindings Skill","","Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.","","## CRITICAL: Read Before Write","","**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings \u2014 never replace the entire file.","","- Use **Edit** tool for modifications to existing files","- Use **Write** tool only if the file does not exist yet"].join(` `),oS1=["## Validation with /doctor","",'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',"","### Common Issues and Fixes","",FmA(["Issue","Cause","Fix"],[['`keybindings.json must have a "bindings" array`',"Missing wrapper object",'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',"Typo or invalid context name","Use exact context names from the Available Contexts table"],['`Duplicate key "X" in Y bindings`',"Same key defined twice in one context","Remove the duplicate; JSON uses only the last value"],['`"X" may not work: ...`',"Key conflicts with terminal/OS reserved shortcut","Choose a different key (see Reserved Shortcuts section)"],['`Could not parse keystroke "X"`',"Invalid key syntax","Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',"Action value is not a string or null",'Actions must be strings like `"app:help"` or `null` to unbind']]),"","### Example /doctor Output","","```","Keybinding Configuration Issues","Location: ~/.claude/keybindings.json",' \u2514 [Error] Unknown context "chat"'," \u2192 Valid contexts: Global, Chat, Autocomplete, ...",' \u2514 [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)',"```","","**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work."].join(` - Plans are stored in \`~/.claude/plans/.md\` - args: "Execute the verification plan at ~/.claude/plans/.md" - args: "Execute the verification plan at ~/.claude/plans/.md for files: src/components/Button.tsx" - args: "Execute the verification plan at ~/.claude/plans/.md for files: src/routes/users.ts" - args: "Execute the verification plan at ~/.claude/plans/.md for files: frontend/src/components/Button.tsx" - args: "Execute the verification plan at ~/.claude/plans/.md for files: backend/src/routes/users.ts" **Plan File**: ~/.claude/plans/.md Create the skill directory and file at \`.claude/skills/{{skillName}}/SKILL.md\`. No servers were imported.`);A(),w0()},[E,$,A]),G=b8H.useCallback(()=>{M(0)},[M]);return _Z.default.createElement(_Z.default.Fragment,null,_Z.default.createElement(BL,{title:"Import MCP Servers from Claude Desktop",subtitle:`Found ${L.length} MCP server${L.length!==1?"s":""} in Claude Desktop.`,color:"success",onCancel:G,hideInputGuide:!0},B.length>0&&_Z.default.createElement(V,{color:"warning"},"Note: Some servers already exist with the same name. If selected, they will be imported with a numbered suffix."),_Z.default.createElement(V,null,"Please select the servers you want to import:"),_Z.default.createElement(xVH,{options:L.map((U)=>({label:`${U}${B.includes(U)?" (already exists)":""}`,value:U})),defaultValue:L.filter((U)=>!B.includes(U)),onSubmit:f})),_Z.default.createElement(x,{paddingX:1},_Z.default.createElement(V,{dimColor:!0,italic:!0},_Z.default.createElement(rA,null,_Z.default.createElement(s$,{shortcut:"Space",action:"select"}),_Z.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),_Z.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}var _Z,b8H;var lGB=K(()=>{xH();xq$();T3();UU();bB();lB();j0();eB();_Z=b(s(),1),b8H=b(s(),1)});var nGB={};XA(nGB,{startMCPServer:()=>Fj1});async function Fj1(H,$,A){let I=_m(100);MC(H);let D=new emH({name:"claude/tengu",version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION},{capabilities:{tools:{}}});D.setRequestHandler(BjH,async()=>{let f=YK(),E=yK(f);return{tools:await Promise.all(E.map(async(M)=>{let G;if(M.outputSchema){let U=t9H(M.outputSchema);if(typeof U==="object"&&U!==null&&"type"in U&&U.type==="object")G=U}return{...M,description:await M.prompt({getToolPermissionContext:async()=>f,tools:E,agents:[]}),inputSchema:t9H(M.inputSchema),outputSchema:G}}))}}),D.setRequestHandler(YDH,async({params:{name:f,arguments:E}})=>{let M=YK(),G=yK(M),U=G.find((X)=>X.name===f);if(!U)throw Error(`Tool ${f} not found`);try{if(!U.isEnabled())throw Error(`Tool ${f} is not enabled`);let X=X1(),J=await U.validateInput?.(E??{},{abortController:nD(),options:{commands:iGB,tools:G,mainLoopModel:X,maxThinkingTokens:0,mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:$,verbose:A,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:async()=>t3H(),setAppState:()=>{},messages:[],setMessages:()=>{},readFileState:I,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}});if(J&&!J.result)throw Error(`Tool ${f} input is invalid: ${J.message}`);let F=await U.call(E??{},{abortController:nD(),options:{commands:iGB,tools:G,mainLoopModel:X1(),maxThinkingTokens:0,mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:$,verbose:A,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:async()=>t3H(),setAppState:()=>{},messages:[],setMessages:()=>{},readFileState:I,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},qF,PT({content:[]}));return{content:[{type:"text",text:typeof F==="string"?F:yH(F.data)}]}}catch(X){return r(X instanceof Error?X:Error(String(X))),{isError:!0,content:[{type:"text",text:(X instanceof Error?DSA(X):[String(X)]).filter(Boolean).join(` `).trim()||"Error"}]}}});async function B(){let f=new bpH;await D.connect(f)}return await B()}var iGB;var rGB=K(()=>{$hA();TkA();CK();Ow$();XJ();nh();aI();_$();Y7();LZ$();DvA();_L();g7();eE();pL();Z$();iGB=[jT$]});var tGB={};XA(tGB,{readClaudeDesktopMcpServers:()=>Kj1,getClaudeDesktopConfigPath:()=>oGB});function oGB(){let H=oA();if(!Mk$.includes(H))throw Error(`Unsupported platform: ${H} - Claude Desktop integration only works on macOS and WSL.`);if(H==="macos")return PmA.join(aGB.homedir(),"Library","Application Support","Claude","claude_desktop_config.json");let $=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,"/"):null;if($){let L=`/mnt/c${$.replace(/^[A-Z]:/,"")}/AppData/Roaming/Claude/claude_desktop_config.json`;if(zH().existsSync(L))return L}try{if(zH().existsSync("/mnt/c/Users")){let L=zH().readdirSync("/mnt/c/Users");for(let I of L){if(I.name==="Public"||I.name==="Default"||I.name==="Default User"||I.name==="All Users")continue;let D=PmA.join("/mnt/c/Users",I.name,"AppData","Roaming","Claude","claude_desktop_config.json");if(zH().existsSync(D))return D}}}catch(A){r(A instanceof Error?A:Error(String(A)))}throw Error("Could not find Claude Desktop config file in Windows. Make sure Claude Desktop is installed on Windows.")}function Kj1(){if(!Mk$.includes(oA()))throw Error("Unsupported platform - Claude Desktop integration only works on macOS and WSL.");try{let H=oGB();if(!zH().existsSync(H))return{};let $=zH().readFileSync(H,{encoding:"utf8"}),A=q1($);if(!A||typeof A!=="object")return{};let L=A.mcpServers;if(!L||typeof L!=="object")return{};let I={};for(let[D,B]of Object.entries(L)){if(!B||typeof B!=="object")continue;let f=Vd$.safeParse(B);if(f.success)I[D]=f.data}return I}catch(H){return r(H instanceof Error?H:Error(String(H))),{}}}var PmA,aGB;var sGB=K(()=>{nM();_$();O$H();Z9();DL();PmA=b(require("path")),aGB=b(require("os"))});var Ze={};XA(Ze,{mcpServeHandler:()=>Qj1,mcpResetChoicesHandler:()=>Cj1,mcpRemoveHandler:()=>Wj1,mcpListHandler:()=>Vj1,mcpGetHandler:()=>Pj1,mcpAddJsonHandler:()=>_j1,mcpAddFromDesktopHandler:()=>Yj1});async function $UB(H,$){try{let A=await Gz(H,$);if(A.type==="connected")return"\u2713 Connected";else if(A.type==="needs-auth")return"! Needs authentication";else return"\u2717 Failed to connect"}catch(A){return"\u2717 Connection error"}}async function Qj1({debug:H,verbose:$}){let A=eGB.cwd();if(c("tengu_mcp_start",{}),!HUB.existsSync(A))console.error(`Error: Directory ${A} does not exist`),process.exit(1);try{let{setup:L}=await Promise.resolve().then(() => (Ax$(),$x$));await L(A,"default",!1,!1,void 0,!1);let{startMCPServer:I}=await Promise.resolve().then(() => (rGB(),nGB));await I(A,H??!1,$??!1)}catch(L){console.error("Error: Failed to start MCP server:",L),process.exit(1)}}async function Wj1(H,$){let A=Mz(H),L=()=>{if(A&&(A.type==="sse"||A.type==="http"))g2$(H,A),yqD(H,A)};try{if($.scope){let M=V3H($.scope);c("tengu_mcp_delete",{name:H,scope:M}),rNA(H,M),L(),process.stdout.write(`Removed MCP server ${H} from ${M} config `),E.forEach((M)=>{process.stderr.write(` claude mcp remove "${H}" -s ${M} `),process.exit(1)}}async function Vj1(){c("tengu_mcp_list",{});let{servers:H}=await ph();if(Object.keys(H).length===0)console.log("No MCP servers configured. Use `claude mcp add` to add a server.");else{console.log(`Checking MCP server health... `);let $=Object.entries(H),A=await VmA($,async([L,I])=>({name:L,server:I,status:await $UB(L,I)}),{concurrency:VOA()});for(let{name:L,server:I,status:D}of A)if(I.type==="sse")console.log(`${L}: ${I.url} (SSE) - ${D}`);else if(I.type==="http")console.log(`${L}: ${I.url} (HTTP) - ${D}`);else if(I.type==="claudeai-proxy")console.log(`${L}: ${I.url} - ${D}`);else if(!I.type||I.type==="stdio"){let B=Array.isArray(I.args)?I.args:[];console.log(`${L}: ${I.command} ${B.join(" ")} - ${D}`)}}await w0(0)}async function Pj1(H){c("tengu_mcp_get",{name:H});let $=Mz(H);if(!$)console.error(`No MCP server found with name: ${H}`),process.exit(1);console.log(`${H}:`),console.log(` Scope: ${OuH($.scope)}`);let A=await $UB(H,$);if(console.log(` Status: ${A}`),$.type==="sse"){if(console.log(" Type: sse"),console.log(` URL: ${$.url}`),$.headers){console.log(" Headers:");for(let[L,I]of Object.entries($.headers))console.log(` ${L}: ${I}`)}if($.oauth?.clientId){let I=!!FOA(H,$)?.clientSecret,D=["client_id configured"];if(I)D.push("client_secret configured");if($.oauth.callbackPort)D.push(`callback_port ${$.oauth.callbackPort}`);console.log(` OAuth: ${D.join(", ")}`)}}else if($.type==="http"){if(console.log(" Type: http"),console.log(` URL: ${$.url}`),$.headers){console.log(" Headers:");for(let[L,I]of Object.entries($.headers))console.log(` ${L}: ${I}`)}if($.oauth?.clientId){let I=!!FOA(H,$)?.clientSecret,D=["client_id configured"];if(I)D.push("client_secret configured");if($.oauth.callbackPort)D.push(`callback_port ${$.oauth.callbackPort}`);console.log(` OAuth: ${D.join(", ")}`)}}else if($.type==="stdio"){console.log(" Type: stdio"),console.log(` Command: ${$.command}`);let L=Array.isArray($.args)?$.args:[];if(console.log(` Args: ${L.join(" ")}`),$.env){console.log(" Environment:");for(let[I,D]of Object.entries($.env))console.log(` ${I}=${D}`)}}console.log(` To remove this server, run: claude mcp remove "${H}" -s ${$.scope}`),await w0(0)}async function _j1(H,$,A){try{let L=V3H(A.scope),I=q1($),B=A.clientSecret&&I&&typeof I==="object"&&"type"in I&&(I.type==="sse"||I.type==="http")&&"url"in I&&typeof I.url==="string"&&"oauth"in I&&I.oauth&&typeof I.oauth==="object"&&"clientId"in I.oauth?await RuH():void 0;mt(H,I,L);let f=I&&typeof I==="object"&&"type"in I?String(I.type||"stdio"):"stdio";if(B&&I&&typeof I==="object"&&"type"in I&&(I.type==="sse"||I.type==="http")&&"url"in I&&typeof I.url==="string")yuH(H,{type:I.type,url:I.url},B);c("tengu_mcp_add",{scope:L,source:"json",type:f}),console.log(`Added ${f} MCP server ${H} to ${L} config`),process.exit(0)}catch(L){console.error(L.message),process.exit(1)}}async function Yj1(H){try{let $=V3H(H.scope),A=oA();c("tengu_mcp_add",{scope:$,platform:A,source:"desktop"});let{readClaudeDesktopMcpServers:L}=await Promise.resolve().then(() => (sGB(),tGB)),I=L();if(Object.keys(I).length===0)console.log("No MCP servers found in Claude Desktop configuration or configuration file does not exist."),process.exit(0);let{unmount:D}=await A8(Lx$.default.createElement(i8,null,Lx$.default.createElement(hE,null,Lx$.default.createElement(cGB,{servers:I,scope:$,onDone:()=>{D()}}))),{exitOnCtrlC:!0})}catch($){console.error($.message),process.exit(1)}}async function Cj1(){c("tengu_mcp_reset_mcpjson_choices",{}),MM((H)=>({...H,enabledMcpjsonServers:[],disabledMcpjsonServers:[],enableAllProjectMcpServers:!1})),console.log("All project-scoped (.mcp.json) server approvals and rejections have been reset."),console.log("You will be prompted for approval next time you start Claude Code."),process.exit(0)}var Lx$,eGB,HUB;var qe=K(()=>{dGB();xH();pL();AS();lGB();z$();T3();kF();n9H();f3();vA();Z9();nM();UU();Lx$=b(s(),1),eGB=require("process"),HUB=require("fs")});var rz={};XA(rz,{pluginValidateHandler:()=>wj1,pluginUpdateHandler:()=>Rj1,pluginUninstallHandler:()=>xj1,pluginListHandler:()=>Zj1,pluginInstallHandler:()=>Oj1,pluginEnableHandler:()=>Sj1,pluginDisableHandler:()=>jj1,marketplaceUpdateHandler:()=>Nj1,marketplaceRemoveHandler:()=>zj1,marketplaceListHandler:()=>Tj1,marketplaceAddHandler:()=>qj1,handleMarketplaceError:()=>hdH,VALID_UPDATE_SCOPES:()=>S1H,VALID_INSTALLABLE_SCOPES:()=>t7});function hdH(H,$){r(H instanceof Error?H:Error(String(H))),console.error(`${pH.cross} Failed to ${$}: ${H instanceof Error?H.message:String(H)}`),process.exit(1)}function wj1(H,$){if($.cowork)aC(!0);try{let A=oq$(H);if(console.log(`Validating ${A.fileType} manifest: ${A.filePath} `),A.warnings.forEach((L)=>{console.log(` ${pH.pointer} ${L.path}: ${L.message}`)}),console.log("");if(A.success){if(A.warnings.length>0)console.log(`${pH.tick} Validation passed with warnings`);else console.log(`${pH.tick} Validation passed`);process.exit(0)}else console.log(`${pH.cross} Validation failed`),process.exit(1)}catch(A){r(A instanceof Error?A:Error(String(A))),console.error(`${pH.cross} Unexpected error during validation: ${A instanceof Error?A.message:String(A)}`),process.exit(2)}}async function Zj1(H){if(H.cowork)aC(!0);c("tengu_plugin_list_command",{});let $=F7(),{getEnabledPluginsWithScopes:A}=await Promise.resolve().then(() => (uVH(),wbD)),L=A(),I=Object.keys($.plugins);if(H.json){let{enabled:B,disabled:f,errors:E}=await xf(),M=[...B,...f],G=new Map(M.map((X)=>[X.source,X])),U=[];for(let X of I.sort()){let J=$.plugins[X];if(!J||J.length===0)continue;let F=X.split("@")[0],Q=E.filter((W)=>W.source===X||("plugin"in W)&&W.plugin===F).map(UP);for(let W of J){let P=G.get(X),C;if(P){let Y=P.mcpServers||await sWA(P);if(Y&&Object.keys(Y).length>0)C=Y}U.push({id:X,version:W.version||"unknown",scope:W.scope,enabled:L.has(X),installPath:W.installPath,installedAt:W.installedAt,lastUpdated:W.lastUpdated,projectPath:W.projectPath,mcpServers:C,errors:Q.length>0?Q:void 0})}}if(H.available){let X=[];try{let[J,F]=await Promise.all([l1(),vVH()]),{marketplaces:Q}=await fm(J);for(let{name:W,data:P}of Q)if(P)for(let C of P.plugins){let Y=Qv(C.name,W);if(!K7(Y))X.push({pluginId:Y,name:C.name,description:C.description,marketplaceName:W,version:C.version,source:C.source,installCount:F?.get(Y)})}}catch{}console.log(yH({installed:U,available:X},null,2))}else console.log(yH(U,null,2));process.exit(0)}if(I.length===0)console.log("No plugins installed. Use `claude plugin install` to install a plugin."),process.exit(0);let{errors:D}=await xf();console.log(`Installed plugins: `),process.exit(1);A=$.scope}if($.cowork&&A!=="user")console.error("--cowork can only be used with user scope"),process.exit(1);await sfB(H,A)}var az=K(()=>{jI();Z$();z$();_$();uRA();y4();Ja();Q7();Vz();mq$();NRA();mgA();Q7();_X();tJ$();g$()});var DUB={};XA(DUB,{install:()=>hj1});function yj1(){let H=OA.platform==="win32",$=LUB.homedir();if(H)return IUB.join($,".local","bin","claude.exe").replace(/\//g,"\\");return"~/.local/bin/claude"}function AUB({messages:H}){if(H.length===0)return null;return Y8.default.createElement(x,{flexDirection:"column",gap:0,marginBottom:1},Y8.default.createElement(x,null,Y8.default.createElement(V,{color:"warning"},Y8.default.createElement(AZ,{status:"warning",withSpace:!0}),"Setup notes:")),H.map(($,A)=>Y8.default.createElement(x,{key:A,marginLeft:2},Y8.default.createElement(V,{dimColor:!0},"\u2022 ",$))))}function vj1({onDone:H,force:$,target:A}){let[L,I]=bdH.useState({type:"checking"});return bdH.useEffect(()=>{async function D(){try{N(`Install: Starting installation process (force=${$}, target=${A})`);let B=A||GB()?.autoUpdatesChannel||"latest";I({type:"installing",version:B}),N(`Install: Calling installLatest(channelOrVersion=${B}, forceReinstall=${$})`);let f=await fd(B,$);if(N(`Install: installLatest returned version=${f.latestVersion}, wasUpdated=${f.wasUpdated}, lockFailed=${f.lockFailed}`),f.lockFailed)throw Error("Could not install - another process is currently installing Claude. Please try again in a moment.");if(!f.latestVersion)N("Install: Failed to retrieve version information during install",{level:"error"});if(!f.wasUpdated)N("Install: Already up to date");I({type:"setting-up"});let E=await Db(!0);if(N(`Install: Setup launcher completed with ${E.length} messages`),E.length>0)E.forEach((F)=>N(`Install: Setup message: ${F.message}`));N("Install: Cleaning up npm installations after successful install");let{removed:M,errors:G,warnings:U}=await pgH();if(M>0)N(`Cleaned up ${M} npm installation(s)`);if(G.length>0)N(`Cleanup errors: ${G.join(", ")}`);let X=mgH();if(X.length>0)N(`Shell alias cleanup: ${X.map((F)=>F.message).join("; ")}`);if(c("tengu_claude_install_command",{has_version:f.latestVersion?1:0,forced:$?1:0}),A==="latest"||A==="stable")II("userSettings",{autoUpdatesChannel:A}),N(`Install: Saved autoUpdatesChannel=${A} to user settings`);let J=[...U,...X.map((F)=>F.message)];if(E.length>0)I({type:"set-up",messages:E.map((F)=>F.message)}),setTimeout(()=>{I({type:"success",version:f.latestVersion||"current",setupMessages:[...E.map((F)=>F.message),...J]})},2000);else N("Install: Shell PATH already configured"),I({type:"success",version:f.latestVersion||"current",setupMessages:J.length>0?J:void 0})}catch(B){N(`Install command failed: ${B}`,{level:"error"}),I({type:"error",message:B instanceof Error?B.message:String(B)})}}D()},[$,A]),bdH.useEffect(()=>{if(L.type==="success")setTimeout(()=>{H("Claude Code installation completed successfully",{display:"system"})},2000);else if(L.type==="error")setTimeout(()=>{H("Claude Code installation failed",{display:"system"})},3000)},[L,H]),Y8.default.createElement(x,{flexDirection:"column",marginTop:1},L.type==="checking"&&Y8.default.createElement(V,{color:"claude"},"Checking installation status..."),L.type==="cleaning-npm"&&Y8.default.createElement(V,{color:"warning"},"Cleaning up old npm installations..."),L.type==="installing"&&Y8.default.createElement(V,{color:"claude"},"Installing Claude Code native build ",L.version,"..."),L.type==="setting-up"&&Y8.default.createElement(V,{color:"claude"},"Setting up launcher and shell integration..."),L.type==="set-up"&&Y8.default.createElement(AUB,{messages:L.messages}),L.type==="success"&&Y8.default.createElement(x,{flexDirection:"column",gap:1},Y8.default.createElement(x,null,Y8.default.createElement(AZ,{status:"success",withSpace:!0}),Y8.default.createElement(V,{color:"success",bold:!0},"Claude Code successfully installed!")),Y8.default.createElement(x,{marginLeft:2,flexDirection:"column",gap:1},L.version!=="current"&&Y8.default.createElement(x,null,Y8.default.createElement(V,{dimColor:!0},"Version: "),Y8.default.createElement(V,{color:"claude"},L.version)),Y8.default.createElement(x,null,Y8.default.createElement(V,{dimColor:!0},"Location: "),Y8.default.createElement(V,{color:"text"},yj1()))),Y8.default.createElement(x,{marginLeft:2,flexDirection:"column",gap:1},Y8.default.createElement(x,{marginTop:1},Y8.default.createElement(V,{dimColor:!0},"Next: Run "),Y8.default.createElement(V,{color:"claude",bold:!0},"claude --help"),Y8.default.createElement(V,{dimColor:!0}," to get started"))),L.setupMessages&&Y8.default.createElement(AUB,{messages:L.setupMessages})),L.type==="error"&&Y8.default.createElement(x,{flexDirection:"column",gap:1},Y8.default.createElement(x,null,Y8.default.createElement(AZ,{status:"error",withSpace:!0}),Y8.default.createElement(V,{color:"error"},"Installation failed")),Y8.default.createElement(V,{color:"error"},L.message),Y8.default.createElement(x,{marginTop:1},Y8.default.createElement(V,{dimColor:!0},"Try running with --force to override checks"))))}var Y8,bdH,LUB,IUB,hj1;var BUB=K(()=>{xH();xH();Lj();E$();z$();mL();aq$();Z1();Y8=b(s(),1),bdH=b(s(),1),LUB=require("os"),IUB=require("path");hj1={type:"local-jsx",name:"install",description:"Install Claude Code native build",argumentHint:"[options]",async call(H,$,A){let L=A.includes("--force"),D=A.filter((f)=>!f.startsWith("--"))[0],{unmount:B}=await A8(Y8.default.createElement(vj1,{onDone:(f,E)=>{B(),H(f,E)},force:L,target:D}))}}});var Ix$={};XA(Ix$,{setupTokenHandler:()=>bj1,installHandler:()=>mj1,doctorHandler:()=>gj1});async function bj1(){if(c("tengu_setup_token_command",{}),await ir(),!p_())process.stderr.write(oH.yellow(`Warning: You already have authentication configured via environment variable or API key helper. `));let{ConsoleOAuthFlow:H}=await Promise.resolve().then(() => (SbH(),KJD));await new Promise(async($)=>{let{unmount:A}=await A8(YZ.default.createElement(i8,{onChangeAppState:Nj},YZ.default.createElement(x,{flexDirection:"column",gap:1},YZ.default.createElement(eO$,null),YZ.default.createElement(H,{onDone:()=>{A(),$()},mode:"setup-token",startingMessage:"This will guide you through long-lived (1-year) auth token setup for your Claude account. Claude subscription required."}))))}),process.exit(0)}function uj1({onDone:H}){return QO$(),YZ.default.createElement(YZ.default.Suspense,{fallback:null},YZ.default.createElement(kj1,{onDone:H}))}async function gj1(){c("tengu_doctor_command",{}),await new Promise(async(H)=>{let{unmount:$}=await A8(YZ.default.createElement(i8,null,YZ.default.createElement(hE,null,YZ.default.createElement(jq$,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1},YZ.default.createElement(uj1,{onDone:()=>{$(),H()}})))),ZG(!1))}),process.exit(0)}async function mj1(H,$){let{setup:A}=await Promise.resolve().then(() => (Ax$(),$x$));await A(fUB.cwd(),"default",!1,!1,void 0,!1);let{install:L}=await Promise.resolve().then(() => (BUB(),DUB));await new Promise((I)=>{let D=[];if(H)D.push(H);if($.force)D.push("--force");L.call((B)=>{I(),process.exit(B.includes("failed")?1:0)},{},D)})}var YZ,fUB,kj1;var Dx$=K(()=>{r0();xH();sv();pL();AS();Ys();GmA();rgA();fgA();z$();EI();KDH();YZ=b(s(),1),fUB=require("process");kj1=YZ.default.lazy(()=>Promise.resolve().then(() => (GRA(),HvD)).then((H)=>({default:H.Doctor})))});var EUB={};XA(EUB,{update:()=>pj1});async function pj1(){c("tengu_update_check",{}),OD(`Current version: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} `);let G=await Q1H(H);if(G&&!Bx$.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,G,{loose:!0}))OD(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} \u2192 ${G} `),OD(oH.bold(" brew upgrade claude-code")+` `);let G=await Q1H(H);if(G&&!Bx$.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,G,{loose:!0}))OD(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} \u2192 ${G} `);let G=await Q1H(H);if(G&&!Bx$.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,G,{loose:!0}))OD(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} \u2192 ${G} `),OD(oH.bold(" apk upgrade claude-code")+` `),await w0(1);if(M.latestVersion==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)OD(oH.green(`Claude Code is up to date (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION})`)+` `);else OD(oH.green(`Successfully updated from ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} to version ${M.latestVersion}`)+` `),process.stderr.write(`Try running "claude doctor" for diagnostics `),await w0(1)}}if(A.installMethod!=="native")await ggH();N("update: Checking npm registry for latest version"),N(`update: Package URL: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}`);let L=H==="stable"?"stable":"latest",I=`npm view ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${L} version`;N(`update: Running: ${I}`);let D=await Q1H(H);if(N(`update: Latest version from npm: ${D||"FAILED"}`),!D){if(N("update: Failed to get latest version from npm registry"),process.stderr.write(oH.red("Failed to check for updates")+` `),{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&!{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL.startsWith("@anthropic"))process.stderr.write(` \u2022 Internal/development build not published to npm `);let M={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL||"@anthropic-ai/claude-code";process.stderr.write(` \u2022 Manually check: npm view ${M} version `),await w0(1)}if(D==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)OD(oH.green(`Claude Code is up to date (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION})`)+` `),await w0(0);OD(`New version available: ${D} (current: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}) `),N(`update: Update method determined: ${f}`),N(`update: useLocalUpdate: ${B}`);let E;if(B)N("update: Calling installOrUpdateClaudePackage() for local update"),E=await jgH(H);else N("update: Calling installGlobalPackage() for global update"),E=await vgH();switch(N(`update: Installation status: ${E}`),E){case"success":OD(oH.green(`Successfully updated from ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} to version ${D}`)+` `),process.stderr.write(` cd ~/.claude/local && npm update ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL} `),process.stderr.write(`Or consider using native installation with: claude install `),process.stderr.write(` cd ~/.claude/local && npm update ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL} `);else process.stderr.write(`Or consider using native installation with: claude install `),await w0(1);break}await w0(0)}var Bx$;var MUB=K(()=>{z$();Us();Lq$();vA();F1H();Lj();Ib();r0();E$();UU();mL();U5A();Bx$=b(OO(),1)});var FUB={};XA(FUB,{startDeferredPrefetches:()=>k8H,showSetupScreens:()=>JUB,main:()=>IR1,completeOnboarding:()=>XUB});function lj1(){try{let H=ZI("policySettings");if(H){let $=WmL(H);c("tengu_managed_settings_loaded",{keyCount:$.length,keys:$.join(",")})}}catch{}}function ij1(){if(process.env.ENABLE_TOOL_SEARCH!==void 0)return"external_tool_search_env_var";if(process.env.ENABLE_EXPERIMENTAL_MCP_CLI!==void 0)return"external_mcp_cli_env_var";return"external_default"}function nj1(){try{let H=eU(),$=ij1(),A=!1;c("tengu_mcp_cli_status",{enabled:H,source:$,legacy_env_var_set:!1})}catch{}}function rj1(){let H=xMH(),$=process.execArgv.some((L)=>{if(H)return/--inspect(-brk)?/.test(L);else return/--inspect(-brk)?|--debug(-brk)?/.test(L)}),A=process.env.NODE_OPTIONS&&/--inspect(-brk)?|--debug(-brk)?/.test(process.env.NODE_OPTIONS);try{return!!global.require("inspector").url()||$||A}catch{return $||A}}function XUB(){AA((H)=>({...H,hasCompletedOnboarding:!0,lastOnboardingVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}))}async function JUB(H,$,A,L){if(A$(!1)||process.env.IS_DEMO)return!1;let I=M$(),D=!1;if(!I.theme||!I.hasCompletedOnboarding){D=!0;let[,,{Onboarding:B}]=await Promise.all([ir(),wt(),Promise.resolve().then(() => (gMB(),uMB))]);await new Promise(async(f)=>{let{unmount:E}=await A8(R1.default.createElement(i8,{onChangeAppState:Nj},R1.default.createElement(hE,null,R1.default.createElement(B,{onDone:async()=>{XUB(),E(),await ir(),f()}}))),ZG(!1))})}if(H!=="bypassPermissions"&&!A$(process.env.CLAUBBIT)){let B=XG(!1),{TrustDialog:f}=await Promise.resolve().then(() => ($GB(),HGB));await new Promise(async(M)=>{let{unmount:G}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(f,{commands:A,onDone:async()=>{if(G(),!B)await ir();M()}}))),ZG(!1))}),oz$(),xPH(),k5();let{errors:E}=Ed();if(E.length===0)await IEB();if(await ORI()){let M=fyH();await new Promise(async(G)=>{let{unmount:U}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(Jq$,{onDone:()=>{U(),G()},isStandaloneDialog:!0,externalIncludes:M}))),ZG(!1))})}}if(XMB(),Me(),OkA(),await IWH())await new Promise(async(B)=>{let{unmount:f}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(kT$,{showIfAlreadyViewed:!1,location:D?"onboarding":"policy_update_modal",onDone:async(E)=>{if(E==="escape"){c("tengu_grove_policy_exited",{}),L9(0);return}if(f(),E!=="skip_rendering")await ir();B()}}))),ZG(!1))});if(process.env.ANTHROPIC_API_KEY){let B=Z2(process.env.ANTHROPIC_API_KEY);if(lz$(B)==="new")await new Promise(async(E)=>{let{unmount:M}=await A8(R1.default.createElement(i8,{onChangeAppState:Nj},R1.default.createElement(hE,null,R1.default.createElement(dO$,{customApiKeyTruncated:B,onDone:async()=>{M(),await ir(),E()}}))),ZG(!1))})}if((H==="bypassPermissions"||$)&&!M$().bypassPermissionsModeAccepted)await new Promise(async(B)=>{let{unmount:f}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(KEB,{onAccept:()=>{f(),B()}}))),ZG(!1))});if(L&&!M$().hasCompletedClaudeInChromeOnboarding)await new Promise(async(B)=>{let{unmount:f}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(WEB,{onDone:()=>{f(),B()}}))),ZG(!1))});return D}function aj1(){AA((H)=>({...H,numStartups:(H.numStartups??0)+1})),tj1(),XEB(C$()),aS$()?.add(1)}function oj1(){let H={};if(process.env.NODE_EXTRA_CA_CERTS)H.has_node_extra_ca_certs=!0;if(process.env.CLAUDE_CODE_CLIENT_CERT)H.has_client_cert=!0;if(cj$("--use-system-ca"))H.has_use_system_ca=!0;if(cj$("--use-openssl-ca"))H.has_use_openssl_ca=!0;return H}async function tj1(){let[H,$]=await Promise.all([z6(),VwH()]);c("tengu_startup_telemetry",{is_git:H,worktree_count:$,sandbox_enabled:vL.isSandboxingEnabled(),are_unsandboxed_commands_allowed:vL.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:vL.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:Nd(),prefers_reduced_motion:GB().prefersReducedMotion??!1,...oj1()})}function sj1(){PEB(),YEB(),TEB(),NEB(),xEB(),ZEB(),jEB(),JgD().catch(()=>{})}function ej1(){if(tI()){EL("info","prefetch_system_context_non_interactive"),k5();return}if(XG(!0))EL("info","prefetch_system_context_has_trust"),k5();else EL("info","prefetch_system_context_skipped_no_trust")}function k8H(){if(A$(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER))return;if(goD(),u5(),ej1(),ZO$(),A$(process.env.CLAUDE_CODE_USE_BEDROCK)&&!A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH))DmL();let H=nD();setTimeout(()=>H.abort(),3000),btH(C$(),H.signal,[]),GEB(),AF.initialize(),hPH.initialize()}function HR1(H){try{let $=H.trim(),A=$.startsWith("{")&&$.endsWith("}"),L;if(A){if(!q1($))process.stderr.write(oH.red(`Error: Invalid JSON provided to --settings `)),process.exit(1);L=YN$("claude-settings",".json"),iL(L,$,"utf8")}else{let{resolvedPath:I}=OU(zH(),H);if(!X_H.existsSync(I))process.stderr.write(oH.red(`Error: Settings file not found: ${I} `)),process.exit(1)}}function AR1(){_0("eagerLoadSettings_start");let H=fmA("--settings");if(H)HR1(H);let $=fmA("--setting-sources");if($!==void 0)$R1($);_0("eagerLoadSettings_end")}function LR1(H){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let $=process.argv.slice(2),A=$.indexOf("mcp");if(A!==-1&&$[A+1]==="serve"){process.env.CLAUDE_CODE_ENTRYPOINT="mcp";return}if(A$(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT="claude-code-github-action";return}process.env.CLAUDE_CODE_ENTRYPOINT=H?"sdk-cli":"cli"}async function IR1(){_0("main_function_start"),process.env.NoDefaultCurrentDirectoryInExePath="1",itD(),process.on("exit",()=>{MR1()}),process.on("SIGINT",()=>{process.exit(0)}),_0("main_warning_handler_initialized");let H=process.argv.slice(2),$=H.includes("-p")||H.includes("--print"),A=H.includes("--init-only"),L=H.some((f)=>f.startsWith("--sdk-url")),I=$||A||L||!process.stdout.isTTY;if(I)On();$j$(!I),LR1(I);let B=(()=>{if(process.env.GITHUB_ACTIONS==="true")return"github-action";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-ts")return"sdk-typescript";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-py")return"sdk-python";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-cli")return"sdk-cli";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-vscode")return"claude-vscode";if(process.env.CLAUDE_CODE_ENTRYPOINT==="local-agent")return"local-agent";let f=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"||f)return"remote";return"cli"})();Aj$(B),_0("main_client_type_determined"),AR1(),_0("main_before_run"),process.title="claude",await fR1(),_0("main_after_run")}function DR1(H){let $=0,A=ZG(H);if(A.stdin)c("tengu_stdin_interactive",{});let L=new ngA;return{getFpsMetrics:()=>L.getMetrics(),renderOptions:{...A,onFrame:(I)=>{if(L.record(I.durationMs),WAI())return;for(let D of I.flickers){if(D.reason==="resize")continue;let B=Date.now();if(B-$<1000)c("tengu_flicker",{desiredHeight:D.desiredHeight,actualHeight:D.availableHeight,reason:D.reason});$=B}}}}}async function BR1(H,$){if(!process.stdin.isTTY&&!process.argv.includes("mcp")){if($==="stream-json")return process.stdin;process.stdin.setEncoding("utf8");let A="";return process.stdin.on("data",(L)=>{A+=L}),await new Promise((L)=>{process.stdin.on("end",L)}),[H,A].filter(Boolean).join(` `)}return H}async function fR1(){_0("run_function_start");function H(){let D=(B)=>B.long?.replace(/^--/,"")??B.short?.replace(/^-/,"")??"";return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(B,f)=>D(B).localeCompare(D(f))})}let $=new sz$().configureHelp(H()).enablePositionalOptions();_0("run_commander_initialized"),$.hook("preAction",async()=>{_0("preAction_start");let D=etD();if(D instanceof Promise)await D;_0("preAction_after_init"),uRI(),sj1(),_0("preAction_after_migrations"),yID(),C3I(),_0("preAction_after_remote_settings"),_0("preAction_after_settings_sync")}),$.name("claude").description("Claude Code - starts an interactive session by default, use -p/--print for non-interactive output").argument("[prompt]","Your prompt",String).helpOption("-h, --help","Display help for command").option("-d, --debug [filter]",'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")',(D)=>{return!0}).addOption(new W1("-d2e, --debug-to-stderr","Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file ","Write debug logs to a specific file path (implicitly enables debug mode)",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).option("-p, --print","Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.",()=>!0).addOption(new W1("--init","Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new W1("--init-only","Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new W1("--maintenance","Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new W1("--output-format ",'Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)').choices(["text","json","stream-json"])).addOption(new W1("--json-schema ",'JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-partial-messages","Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)",()=>!0).addOption(new W1("--input-format ",'Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)').choices(["text","stream-json"])).option("--mcp-debug","[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)",()=>!0).option("--dangerously-skip-permissions","Bypass all permission checks. Recommended only for sandboxes with no internet access.",()=>!0).option("--allow-dangerously-skip-permissions","Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.",()=>!0).addOption(new W1("--max-thinking-tokens ","Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new W1("--max-turns ","Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new W1("--max-budget-usd ","Maximum dollar amount to spend on API calls (only works with --print)").argParser((D)=>{let B=Number(D);if(isNaN(B)||B<=0)throw Error("--max-budget-usd must be a positive number greater than 0");return B})).option("--replay-user-messages","Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)",()=>!0).addOption(new W1("--enable-auth-status","Enable auth status messages in SDK mode").default(!1).hideHelp()).option("--allowedTools, --allowed-tools ",'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools ",'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools ",'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--mcp-config ","Load MCP servers from JSON files or strings (space-separated)").addOption(new W1("--permission-prompt-tool ","MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new W1("--system-prompt ","System prompt to use for the session").argParser(String)).addOption(new W1("--system-prompt-file ","Read system prompt from a file").argParser(String).hideHelp()).addOption(new W1("--append-system-prompt ","Append a system prompt to the default system prompt").argParser(String)).addOption(new W1("--append-system-prompt-file ","Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new W1("--permission-mode ","Permission mode to use for the session").argParser(String).choices(qR)).option("-c, --continue","Continue the most recent conversation in the current directory",()=>!0).option("-r, --resume [value]","Resume a conversation by session ID, or open interactive picker with optional search term",(D)=>D||!0).option("--fork-session","When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)",()=>!0).option("--from-pr [value]","Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term",(D)=>D||!0).option("--no-session-persistence","Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new W1("--resume-session-at ","When resuming, only messages up to and including the assistant message with (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new W1("--rewind-files ","Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model ","Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-5-20250929').").option("--agent ","Agent for the current session. Overrides the 'agent' setting.").option("--betas ","Beta headers to include in API requests (API key users only)").option("--fallback-model ","Enable automatic fallback to specified model when default model is overloaded (only works with --print)").option("--settings ","Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir ","Additional directories to allow tool access to").option("--ide","Automatically connect to IDE on startup if exactly one valid IDE is available",()=>!0).option("--strict-mcp-config","Only use MCP servers from --mcp-config, ignoring all other MCP configurations",()=>!0).option("--session-id ","Use a specific session ID for the conversation (must be a valid UUID)").option("--agents ",`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources ","Comma-separated list of setting sources to load (user, project, local).").option("--plugin-dir ","Load plugins from directories for this session only (repeatable)").option("--disable-slash-commands","Disable all skills",()=>!0).option("--chrome","Enable Claude in Chrome integration").option("--no-chrome","Disable Claude in Chrome integration").option("--file ","File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)").action(async(D,B)=>{if(_0("action_handler_start"),D==="code")c("tengu_code_prompt_ignored",{}),console.warn(oH.yellow("Tip: You can launch Claude Code with just `claude`")),D=void 0;if(D&&typeof D==="string"&&!/\s/.test(D)&&D.length>0)c("tengu_single_word_prompt",{length:D.length});let{debug:f=!1,debugToStderr:E=!1,dangerouslySkipPermissions:M,allowDangerouslySkipPermissions:G=!1,tools:U=[],allowedTools:X=[],disallowedTools:J=[],mcpConfig:F=[],permissionMode:Q,addDir:W=[],fallbackModel:P,betas:C=[],ide:Y=!1,sessionId:Z,includePartialMessages:q,pluginDir:O=[]}=B,j,u=B.agents,y=B.agent;if(O.length>0)Xj$(O),Sx();let{outputFormat:g,inputFormat:h}=B,p=B.verbose??M$().verbose,d=B.print,k=B.init??!1,n=B.initOnly??!1,GH=B.maintenance??!1,HH=B.disableSlashCommands||!1,BH=!1,WH=BH?typeof BH==="string"?BH:QBA:void 0,wH=void 0,QH=typeof wH==="string"?wH:void 0,TH=wH!==void 0,t=!1;if(t){if(!TH)process.stderr.write(oH.red(`Error: --tmux requires --worktree ${tB}`)}if(Object.keys(qL).length>0){if(Object.keys(qL).some(F3H))throw Error(`Invalid MCP configuration: "${dw}" is a reserved MCP name.`);let tB=RHH(qL,(gD)=>({...gD,scope:"dynamic"}));bH={...bH,...tB}}}let PH=eT$(B.chrome)&&nL(),gH=!PH&&UPH();if(PH){let pA=oA();try{c("tengu_claude_in_chrome_setup",{platform:pA});let{mcpConfig:qL,allowedTools:dB,systemPrompt:tB}=EhA();if(bH={...bH,...qL},X.push(...dB),tB)$H=$H?`${tB} ${$H}`:tB}catch(qL){c("tengu_claude_in_chrome_setup_failed",{platform:pA}),N(`[Claude in Chrome] Error: ${qL}`),r(qL instanceof Error?qL:Error(String(qL))),console.error("Error: Failed to run with Claude in Chrome."),process.exit(1)}}else if(gH)try{let{mcpConfig:pA}=EhA();bH={...bH,...pA},$H=$H?`${$H} Usage: claude --remote "your task description" `),process.stdout.write(`View: https://claude.ai/code/${eH.id}?m=0 `),process.stdout.write(`Resume with: claude --teleport ${eH.id} `)),await w0(1),process.exit(1)}let O$=fLB(eH.id,W$.accessToken,W$.orgUUID,aL),YA=`https://claude.ai/code/${eH.id}?m=0`,aA=a7(`Remote session: ${eH.title} Use /session for QR code and link to open on claude.ai`,"info"),eA=aL?R$({content:LH}):null,kL={...y1,remoteSessionUrl:YA},AL=QrD(f$);await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:kL,onChangeAppState:Nj},R1.default.createElement(R8H,{debug:f||E,commands:AL,initialTools:[],initialMessages:eA?[aA,eA]:[aA],mcpClients:[],autoConnectIdeFlag:Y,mainThreadAgentDefinition:gA,disableSlashCommands:HH,remoteSessionConfig:O$}))),V1),k8H();return}else if(CH){if(await i4A(),!PK("allow_remote_sessions"))process.stderr.write(oH.red(`Error: Remote sessions are disabled by your organization's policy. `)),await w0(1),process.exit(1);if(CH===!0||CH===""){c("tengu_teleport_interactive_mode",{});let aL=await OMB();if(!aL)await w0(0),process.exit(0);let{branchError:RH}=await f3H(aL.branch);qL=B3H(aL.log,RH)}else if(typeof CH==="string"){c("tengu_teleport_resume_session",{mode:"direct"});try{let aL=await gbH(CH),RH=await xNA(aL);if(RH.status==="mismatch"||RH.status==="not_in_repo"){let eH=RH.sessionRepo;if(eH){let W$=JMB(eH),O$=FMB(W$);if(O$.length>0){let YA=await new Promise(async(aA)=>{let{unmount:eA}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(WMB,{targetRepo:eH,initialPaths:O$,onSelectPath:(kL)=>{eA(),aA(kL)},onCancel:()=>{eA(),aA(null)}}))),ZG(!1))});if(YA)process.chdir(YA),MC(YA),yS$(YA);else await w0(0)}else throw new AK(`You must run claude --teleport ${CH} from a checkout of ${eH}.`,oH.red(`You must run claude --teleport ${CH} from a checkout of ${oH.bold(eH)}. `)),process.exit(1)}if(Array.isArray(qL)){if(nqA(qL))wt();let aL;if(!gA&&c9){let O$=x$.activeAgents.find((YA)=>YA.agentType===c9);if(O$){if(gA=O$,YN(O$.agentType),aL=O$.agentType,!C_()&&O$.model&&O$.model!=="inherit")KV(m8(O$.model))}else N(`Resumed session had agent "${c9}" but it is no longer available. Using default behavior.`)}let RH=JdH(tB,gD),eH={...y1,...aL&&{agent:aL},...RH&&{standaloneAgentContext:RH},agentDefinitions:x$};_mA(B);let{waitUntilExit:W$}=await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:eH,onChangeAppState:Nj},R1.default.createElement(R8H,{debug:f||E,commands:[...f$,...WB],initialTools:gG,initialMessages:qL,initialFileHistorySnapshots:dB,initialAgentName:tB,initialAgentColor:gD,mcpClients:qA,dynamicMcpConfig:bH,mcpCliEndpoint:GD,autoConnectIdeFlag:Y,strictMcpConfig:vH,systemPrompt:EH,appendSystemPrompt:$H,mainThreadAgentDefinition:gA,disableSlashCommands:HH,taskListId:WH}))),V1);k8H(),await W$(),await w0(0)}else{let[aL,{ResumeConversation:RH}]=await Promise.all([Xd(zL()),Promise.resolve().then(() => (mGB(),gGB))]);await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:y1,onChangeAppState:Nj},R1.default.createElement(hE,null,R1.default.createElement(RH,{commands:[...f$,...WB],debug:f||E,mainThreadAgentDefinition:gA,worktreePaths:aL,initialTools:gG,mcpClients:qA,dynamicMcpConfig:bH,mcpCliEndpoint:GD,strictMcpConfig:vH,systemPrompt:EH,appendSystemPrompt:$H,initialSearchQuery:uf,disableSlashCommands:HH,forkSession:B.forkSession,taskListId:WH,filterByPr:DE})))),V1),k8H()}}else{if(v9&&IL.length===0)IL=await v9;_0("action_after_hooks"),_mA(B);let{waitUntilExit:pA}=await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:y1,onChangeAppState:Nj},R1.default.createElement(R8H,{debug:f||E,commands:[...f$,...WB],initialTools:gG,initialMessages:IL,mcpClients:qA,dynamicMcpConfig:bH,autoConnectIdeFlag:Y,strictMcpConfig:vH,systemPrompt:EH,appendSystemPrompt:$H,mcpCliEndpoint:GD,mainThreadAgentDefinition:gA,disableSlashCommands:HH,taskListId:WH}))),V1);k8H(),await pA(),await w0(0)}}).version(`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} (Claude Code)`,"-v, --version","Output the version number"),$.addOption(new W1("--agent-id ","Teammate agent ID").hideHelp()),$.addOption(new W1("--agent-name ","Teammate display name").hideHelp()),$.addOption(new W1("--team-name ","Team name for swarm coordination").hideHelp()),$.addOption(new W1("--agent-color ","Teammate UI color").hideHelp()),$.addOption(new W1("--plan-mode-required","Require plan mode before implementation").hideHelp()),$.addOption(new W1("--parent-session-id ","Parent session ID for analytics correlation").hideHelp()),$.addOption(new W1("--teammate-mode ",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),$.addOption(new W1("--agent-type ","Custom agent type for this teammate").hideHelp()),$.addOption(new W1("--sdk-url ","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),$.addOption(new W1("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),$.addOption(new W1("--remote [description]","Create a remote session with the given description").hideHelp());let A=$.command("mcp").description("Configure and manage MCP servers").helpOption("-h, --help","Display help for command").configureHelp(H()).enablePositionalOptions();A.command("serve").description("Start the Claude Code MCP server").helpOption("-h, --help","Display help for command").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:D,verbose:B})=>{let{mcpServeHandler:f}=await Promise.resolve().then(() => (qe(),Ze));await f({debug:D,verbose:B})}),SMB(A),A.command("remove ").description("Remove an MCP server").option("-s, --scope ","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{mcpRemoveHandler:f}=await Promise.resolve().then(() => (qe(),Ze));await f(D,B)}),A.command("list").description("List configured MCP servers").helpOption("-h, --help","Display help for command").action(async()=>{let{mcpListHandler:D}=await Promise.resolve().then(() => (qe(),Ze));await D()}),A.command("get ").description("Get details about an MCP server").helpOption("-h, --help","Display help for command").action(async(D)=>{let{mcpGetHandler:B}=await Promise.resolve().then(() => (qe(),Ze));await B(D)}),A.command("add-json ").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope ","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").helpOption("-h, --help","Display help for command").action(async(D,B,f)=>{let{mcpAddJsonHandler:E}=await Promise.resolve().then(() => (qe(),Ze));await E(D,B,f)}),A.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope ","Configuration scope (local, user, or project)","local").helpOption("-h, --help","Display help for command").action(async(D)=>{let{mcpAddFromDesktopHandler:B}=await Promise.resolve().then(() => (qe(),Ze));await B(D)}),A.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").helpOption("-h, --help","Display help for command").action(async()=>{let{mcpResetChoicesHandler:D}=await Promise.resolve().then(() => (qe(),Ze));await D()});let L=$.command("plugin").description("Manage Claude Code plugins").helpOption("-h, --help","Display help for command").configureHelp(H());L.command("validate ").description("Validate a plugin or marketplace manifest").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginValidateHandler:f}=await Promise.resolve().then(() => (az(),rz));f(D,B)}),L.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D)=>{let{pluginListHandler:B}=await Promise.resolve().then(() => (az(),rz));await B(D)});let I=L.command("marketplace").description("Manage Claude Code marketplaces").helpOption("-h, --help","Display help for command").configureHelp(H());return I.command("add ").description("Add a marketplace from a URL, path, or GitHub repo").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{marketplaceAddHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),I.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D)=>{let{marketplaceListHandler:B}=await Promise.resolve().then(() => (az(),rz));await B(D)}),I.command("remove ").alias("rm").description("Remove a configured marketplace").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{marketplaceRemoveHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),I.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{marketplaceUpdateHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("install ").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope ","Installation scope: user, project, or local","user").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginInstallHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("uninstall ").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope ","Uninstall from scope: user, project, or local","user").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginUninstallHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("enable ").description("Enable a disabled plugin").option("-s, --scope ",`Installation scope: ${t7.join(", ")} (default: user)`).addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginEnableHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope ",`Installation scope: ${t7.join(", ")} (default: user)`).addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginDisableHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("update ").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope ",`Installation scope: ${S1H.join(", ")} (default: user)`).addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginUpdateHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),$.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").helpOption("-h, --help","Display help for command").action(async()=>{let{setupTokenHandler:D}=await Promise.resolve().then(() => (Dx$(),Ix$));await D()}),$.command("doctor").description("Check the health of your Claude Code auto-updater").helpOption("-h, --help","Display help for command").action(async()=>{let{doctorHandler:D}=await Promise.resolve().then(() => (Dx$(),Ix$));await D()}),$.command("update").alias("upgrade").description("Check for updates and install if available").helpOption("-h, --help","Display help for command").action(async()=>{let{update:D}=await Promise.resolve().then(() => (MUB(),EUB));await D()}),$.command("install [target]").description("Install Claude Code native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{installHandler:f}=await Promise.resolve().then(() => (Dx$(),Ix$));await f(D,B)}),_0("run_before_parse"),await $.parseAsync(process.argv),_0("run_after_parse"),_0("main_after_run"),tj$(),$}async function ER1({hasInitialPrompt:H,hasStdin:$,verbose:A,debug:L,debugToStderr:I,print:D,outputFormat:B,inputFormat:f,numAllowedTools:E,numDisallowedTools:M,mcpClientCount:G,worktreeEnabled:U,skipWebFetchPreflight:X,githubActionInputs:J,dangerouslySkipPermissionsPassed:F,permissionMode:Q,modeIsBypass:W,allowDangerouslySkipPermissionsPassed:P,systemPromptFlag:C,appendSystemPromptFlag:Y}){try{let Z=await osH();c("tengu_init",{entrypoint:"claude",hasInitialPrompt:H,hasStdin:$,verbose:A,debug:L,debugToStderr:I,print:D,outputFormat:B,inputFormat:f,numAllowedTools:E,numDisallowedTools:M,mcpClientCount:G,worktree:U,skipWebFetchPreflight:X,...J&&{githubActionInputs:J},dangerouslySkipPermissionsPassed:F,permissionMode:Q,modeIsBypass:W,allowDangerouslySkipPermissionsPassed:P,...C&&{systemPromptFlag:C},...Y&&{appendSystemPromptFlag:Y},...Z&&{rh:Z},is_coordinator:void 0})}catch(Z){r(Z instanceof Error?Z:Error(String(Z)))}}function _mA(H){}function MR1(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(TO)}function GR1(H){if(typeof H!=="object"||H===null)return{};let $=H,A=$.teammateMode;return{agentId:typeof $.agentId==="string"?$.agentId:void 0,agentName:typeof $.agentName==="string"?$.agentName:void 0,teamName:typeof $.teamName==="string"?$.teamName:void 0,agentColor:typeof $.agentColor==="string"?$.agentColor:void 0,planModeRequired:typeof $.planModeRequired==="boolean"?$.planModeRequired:void 0,parentSessionId:typeof $.parentSessionId==="string"?$.parentSessionId:void 0,teammateMode:A==="auto"||A==="tmux"||A==="in-process"?A:void 0,agentType:typeof $.agentType==="string"?$.agentType:void 0}}var R1,X_H,UUB,kdH,GUB=()=>(XE(),WN(GBA)),dj1=()=>WN(wQD),cj1=()=>(U6H(),WN(RZA));var KUB=K(()=>{hc();Z$();_L();Ix();ntD();HsD();gk();MN$();SD();kpH();YP();YiH();Z$();sv();xH();s1$();bgA();bT();KkA();g7();hv();r0();q9$();ugA();qE();zvH();XY();Jd();Z9();vA();EI();ZqH();Ga();DWH();T8();Gq$();AJ();$gA();_$();py();rB();AS();ggA();ojA();ifB();mQ();aI();vgA();mL();dgH();NA();h4();kT();mgA();Q7();Vz();H8H();t8();qmH();g$();nM();dx();rkA();rB();eE();Z9H();DEB();SD();igA();z$();yuA();JEB();CLH();Us();KDH();JG();yW();QEB();VEB();f3();cg();CR();I3H();bt();Nq();ruA();ELH();g$();pL();rgA();jv();g$();$q();_X();Pt();E$();_EB();CEB();qEB();zEB();OEB();SEB();REB();yEB();eVH();UMB();zVH();ip();YS();muA();DmA();VMB();CMB();xMB();ig();i3H();UU();ZE();lG();T3();jMB();nS();bOA();DL();nh();PI();uT$();WgA();JDH();FdH();W4();$s();EM();yMB();BW();ypH();Z6();R1=b(s(),1),X_H=require("fs"),UUB=require("process"),kdH=require("path");_0("main_tsx_entry");_0("main_tsx_imports_loaded");if(rj1())process.exit(1)});process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CLAUDE_CODE_REMOTE==="true"){let H=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=H?`${H} --max-old-space-size=8192`:"--max-old-space-size=8192"}async function XR1(){let H=process.argv.slice(2);if(H.length===1&&(H[0]==="--version"||H[0]==="-v"||H[0]==="-V")){console.log(`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} (Claude Code)`);return}let{profileCheckpoint:$}=await Promise.resolve().then(() => (hc(),HiA));if($("cli_entry"),H[0]==="--mcp-cli"){let{isMcpCliEnabled:D}=await Promise.resolve().then(() => (BW(),soD));if(D()){let B=H.slice(1),{mcpCliMain:f}=await Promise.resolve().then(() => (StD(),xtD));process.exit(await f(B))}}if(H[0]==="--ripgrep"){$("cli_ripgrep_path");let D=H.slice(1),{ripgrepMain:B}=await Promise.resolve().then(() => (ytD(),RtD));process.exitCode=B(D);return}if(process.argv[2]==="--claude-in-chrome-mcp"){$("cli_claude_in_chrome_mcp_path");let{runClaudeInChromeMcpServer:D}=await Promise.resolve().then(() => (btD(),htD));await D();return}else if(process.argv[2]==="--chrome-native-host"){$("cli_chrome_native_host_path");let{runChromeNativeHost:D}=await Promise.resolve().then(() => (ctD(),dtD));await D();return}let A=H.includes("--tmux")||H.includes("--tmux=classic");if(H.length===1&&(H[0]==="--update"||H[0]==="--upgrade"))process.argv=[process.argv[0],process.argv[1],"update"];let{startCapturingEarlyInput:L}=await Promise.resolve().then(() => YHI);L(),$("cli_before_main_import");let{main:I}=await Promise.resolve().then(() => (KUB(),FUB));$("cli_after_main_import"),await I(),$("cli_after_main_complete")}XR1();}) claude-code-20250219 https://json.schemastore.org/claude-code-settings.json /.claude/** ~/.claude/** https://claude.com/claude-code claude-code-jetbrains-plugin anthropic.claude-code claude-code https://code.claude.com/docs/en/claude_code_docs_map.md https://platform.claude.com/llms.txt claude-code-guide claude-swarm claude-hidden You should keep it short and simple, ideally no more than 4 words. The branch should always start with "claude/" and should be all lower case, with words separated by dashes. Example 1: {"title": "Fix login button not working on mobile", "branch": "claude/fix-mobile-login-button"} Example 2: {"title": "Update README with installation instructions", "branch": "claude/update-readme"} Example 3: {"title": "Improve performance of data processing script", "branch": "claude/improve-data-processing"} claude-in-chrome tengu_claudeai_mcp_connectors https://github.com/anthropics/claude-code/issues https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md claude: (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) id: claude uses: anthropics/claude-code-action@v1 # Optional: Add claude_args to customize behavior and configuration # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options # claude_args: '--allowed-tools Bash(gh pr:*)' claude-review: id: claude-review uses: anthropics/claude-code-action@v1 plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options https://slack.com/marketplace/A08SF47R6P4-claude https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md claude-plugins-official anthropics/claude-plugins-official Review and manage your privacy settings at https://claude.ai/settings/data-privacy-controls You have access to browser automation tools (mcp__claude-in-chrome__*) for interacting with web pages in Chrome. Follow these guidelines for effective browser automation. When performing multi-step browser interactions that the user may want to review or share, use mcp__claude-in-chrome__gif_creator to record them. You can use mcp__claude-in-chrome__read_console_messages to read console output. Console output may be verbose. If you are looking for specific log entries, use the 'pattern' parameter with a regex-compatible pattern. This filters results efficiently and avoids overwhelming output. For example, use pattern: "[MyApp]" to filter for application-specific logs rather than reading all console output. IMPORTANT: Do not trigger JavaScript alerts, confirms, prompts, or browser modal dialogs through your actions. These browser dialogs block all further browser events and will prevent the extension from receiving any subsequent commands. Instead, when possible, use console.log for debugging and then use the mcp__claude-in-chrome__read_console_messages tool to read those log messages. If a page has dialog-triggering elements: 3. Use mcp__claude-in-chrome__javascript_tool to check for and dismiss any existing dialogs before proceeding IMPORTANT: At the start of each browser automation session, call mcp__claude-in-chrome__tabs_context_mcp first to get information about the user's current browser tabs. Use this context to understand what the user might want to work with before creating new tabs. 2. Otherwise, create a new tab with mcp__claude-in-chrome__tabs_create_mcp Chrome browser tools are MCP tools that require loading before use. Before calling any mcp__claude-in-chrome__* tool: 1. Use ToolSearch with `select:mcp__claude-in-chrome__` to load the specific tool 1. First: ToolSearch with query "select:mcp__claude-in-chrome__tabs_context_mcp" 2. Then: Call mcp__claude-in-chrome__tabs_context_mcp **Browser Automation**: Chrome browser tools are available via the "claude-in-chrome" skill. CRITICAL: Before using any mcp__claude-in-chrome__* tools, invoke the skill by calling the Skill tool with skill: "claude-in-chrome". The skill provides browser automation instructions and enables the tools. com.anthropic.claude_code_browser_extension https://claude.ai/chrome Configure environments at: https://claude.ai/code claude-opus-4-6 https://github.com/anthropics/claude-code/issues/new?labels=bug,claude-in-chrome Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options. - **Session memories**: `~/.claude/projects/{sanitized-project-path}/{session-id}/session-memory/summary.md` Now that this skill is invoked, you have access to Chrome browser automation tools. You can now use the mcp__claude-in-chrome__* tools to interact with web pages. IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs. "command": "jq -r '.tool_input.command' >> ~/.claude/bash-log.txt" Create the skill directory and file at `.claude/skills/{{skillName}}/SKILL.md`. claude-sonnet-4 claude-3-opus claude-3-sonnet claude-3-haiku claude_code.session.count claude_code.lines_of_code.count claude_code.pull_request.count claude_code.commit.count claude_code.cost.usage claude_code.token.usage claude_code.code_edit_tool.decision claude_code.active_time.total claude-vscode .claude claude-haiku-4-5 claude-3-5-haiku claude-3-5-sonnet claude-3-7-sonnet claude-opus-4-1 claude-opus-4 claude-sonnet-4-5 claude-sonnet-4 claude.ai /api/oauth/claude_cli/create_api_key /api/oauth/claude_cli/roles /oauth/code/success?app=claude-code .claude /api/claude_cli_profile claude_enterprise claude_team claude_max claude_pro claude-3- claude-opus-4 claude-sonnet-4 claude-opus-4 claude-sonnet-4 claude-haiku-4 claude-3- claude-opus-4 claude-sonnet-4 claude-haiku-4 claude-sonnet-4-5 claude-opus-4-1 claude-opus-4-5 claude-opus-4-6 claude-haiku-4-5 claude-opus-4-6[1m] claude-opus-4-6 claude-opus-4-5 claude-opus-4-1 claude-opus-4 claude-sonnet-4-5[1m] claude-sonnet-4-5 claude-sonnet-4[1m] claude-sonnet-4 claude-3-7-sonnet claude-3-5-sonnet claude-haiku-4-5 claude-3-5-haiku claude-3-5-haiku-20241022 claude-haiku-4-5-20251001 claude-3-5-sonnet-20241022 claude-3-7-sonnet-20250219 claude-sonnet-4-20250514 claude-sonnet-4-5-20250929 claude-opus-4-20250514 claude-opus-4-1-20250805 claude-opus-4-5-20251101 claude-opus-4-6 claude.ai report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues Error running awsAuthRefresh (in settings or ~/.claude.json): report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues Error getting AWS credentials from awsCredentialExport (in settings or ~/.claude.json): tengu_oauth_tokens_not_claude_ai claudeAiOauth claude.ai .claude .claude/commands .claude/agents /tmp/claude /private/tmp/claude .claude/debug /tmp/claude file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js claude-http- claude-socks- .claude Install from: https://claude.com/product/claude-code /api/claude_code_penguin_mode claude-cli/ report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-code/ report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-code/ report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues /claude_code_sonnet_1m_access claude-opus-4-6 claude-opus-4-5 claude-opus-4-1 claude-opus-4 claude-sonnet-4-5 claude-sonnet-4 claude-haiku-4-5 (claude-(\d+-\d+-)?\w+) /api/organization/claude_code_first_token_date claudeCodeFirstTokenDate claude-opus-4-6[1m] report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues x-claude-remote-container-id x-claude-remote-session-id tengu_claudeai_limits_status_changed claude-sonnet-4-20250514 If you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models. /api/claude_code/policy_limits claudemd .claude claude claude_cli_latest_screenshot.png Saved in at ~/.claude/settings.json User settings (~/.claude/settings.json) Project settings (.claude/settings.json) Local settings (.claude/settings.local.json) Plugin hooks (~/.claude/plugins/*/hooks/hooks.json) claude-3- /tmp/claude/cache-break- /tmp/claude https://staging.claude.ai https://claude.ai claude .claude anthropic.claude-code anthropic.claude-code report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues anthropic.claude-code is_claude_code_remote is_claude_code_action is_claude_ai_auth claudeCodeContainerId claude_code_container_id claudeCodeRemoteSessionId claude_code_remote_session_id .claude-plugin claudeai-proxy .claude .claude User (~/.claude/agent-memory/) Project (.claude/agent-memory/) Local (.claude/agent-memory-local/) tengu_claude_md_permission_error tengu_claude_rules_md_permission_error .claude .claude .claude .claude/rules/ report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude_code. com.anthropic.claude_code.tracing claude_code.interaction claude_code.llm_request claude_code.tool claude_code.tool.blocked_on_user claude_code.tool.execution claude_code.hook report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-code report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues com.anthropic.claude_code.events claude-code claude --resume /api/claude_code/settings https://api.anthropic.com/api/claude_code/organizations/metrics_enabled com.anthropic.claude_code.events report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-code report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues com.anthropic.claude_code com.anthropic.claude_code.events claude claude claudeShimmer https://api.anthropic.com/api/claude_code/link_vcs_account claudeai claudeai https://code.claude.com/docs/en/amazon-bedrock https://code.claude.com/docs/en/microsoft-foundry https://code.claude.com/docs/en/google-vertex-ai claudeai tengu_oauth_claudeai_selected claudeai claudeai claudeai tengu_oauth_claudeai_forced https://claude.ai/admin-settings/usage https://claude.ai/settings/usage default_claude_max_20x Add funds: https://platform.claude.com/settings/billing claude-swarm- _claude_fs_right: (claude_fs_right) Then start a tmux session with: tmux new-session -s claude Then start a tmux session with: tmux new-session -s claude Then start a tmux session with: tmux new-session -s claude Then start a tmux session with: tmux new-session -s claude claude-vscode .claude .claude/ .claude default_claude_max_20x report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues - Removes the team directory (`~/.claude/teams/{team-name}/`) - Removes the task directory (`~/.claude/tasks/{team-name}/`) This appears to be a permissions issue. Check file permissions on ~/.claude/plugins/ This appears to be a configuration issue. Check your plugin settings in .claude/settings.json claudeai claude/task You must run claude --teleport No environments available, please ensure you've gone through onboarding at claude.ai/code https://github.com/apps/claude/installations/new claude --teleport ultra_claude_md .claude-plugin/marketplace.json .claude-plugin .claude-plugin : missing .claude-plugin/marketplace.json claude-code-plugins We've deprecated "claude-code-plugins" in favor of "claude-plugins-official". You can remove this marketplace with: claude plugin marketplace remove " claude-plugin-temp- .claude-plugin .claude-plugin .claude-plugin /tmp/claude-mcp-browser-bridge- claude-mcp-browser-bridge- claude-mcp-browser-bridge- claudeai-proxy claudeai Cannot add MCP server to scope: claudeai Change command to "cmd" with args ["/c", "npx", ...]. See: https://code.claude.com/docs/en/mcp#configure-mcp-servers claude-vscode claude.ai claude.ai config claude_ai_ claudeai report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-code report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues - IMPORTANT: For temporary files, use `/tmp/claude/` as your temporary directory - The TMPDIR environment variable is automatically set to `/tmp/claude` when running in sandbox mode - Do NOT use `/tmp` directly - use `/tmp/claude/` or rely on TMPDIR instead - Most programs that respect TMPDIR will automatically use `/tmp/claude/` claude- Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file. claudeMdTokens Cannot destructure property 'claudeMdTokens' from null or undefined value claude claudeMd claude_md_size report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude_voice report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues https://api.anthropic.com/api/claude_cli_feedback /.claude/local/node_modules/ claude-local claude /node_modules/.bin/claude" "$@" report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude alias\s+claude\s*=\s*["']([^"']+)["'] alias\s+claude\s*=\s*([^#\n]+) alias\s+claude=["']?([^"'\s]+) report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude update report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues 3. Try updating again with 'claude update' Failed to install new version of claude: Removed claude alias from claude .local/bin/claude .claude @anthropic-ai/claude-code @anthropic-ai/claude-code report the issue at https://github.com/anthropics/claude-code/issues https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude Consider using native installation: claude install Run claude install to update configuration claude . Update alias: alias claude="~/.claude/local/claude" Create alias: alias claude="~/.claude/local/claude" report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues npm -g uninstall @anthropic-ai/claude-code Do one of: (1) Re-install node without sudo, or (2) Use `claude install` for native installation claude claude.exe claude claude claude-cli-native- report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues installMethod is native, but claude command not found at claude.exe.old. claude\.exe\.old\.\d+$ Removed claude symlink at Failed to remove claude symlink: Removed claude alias from . Run: unalias claude Cleaned up claude alias from claude.cmd claude.ps1 claude @anthropic-ai/claude-code report the issue at https://github.com/anthropics/claude-code/issues https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues .claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude https://code.claude.com/docs/en/security tengu_claude_md_includes_dialog_shown tengu_claude_md_external_includes_dialog_declined tengu_claude_md_external_includes_dialog_accepted claudeInChromeDefaultEnabled report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claudeInChromeDefaultEnabled tengu_claude_in_chrome_setting_changed report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude claude https://code.claude.com/docs/en/mcp claudemd_files claudeMdWarning .claude claude Saved in ~/.claude/CLAUDE.md https://code.claude.com/docs/en/memory report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues https://docs.claude.com/s/claude-code-jetbrains https://www.schemastore.org/claude-code-keybindings.json https://code.claude.com/docs/en/keybindings https://github.com/apps/claude claude claude claude .github/workflows/claude.yml https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml claude https://github.com/anthropics/claude-code-action/blob/main/examples/ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} claude claude-review add-claude-github-actions- .github/workflows/claude.yml .github/workflows/claude-code-review.yml selected_claude_workflow selected_claude_review_workflow https://github.com/apps/claude /contents/.github/workflows/claude.yml The file .github/workflows/claude.yml already exists Example: anthropics/claude-cli Example: anthropics/claude-cli Example: anthropics/claude-cli claude.ai https://code.claude.com/docs/en/mcp claudeai-proxy claudeai-proxy claudeai Failed to get claude.ai MCP resources: claude This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect". claudeai-proxy claudeai-clear-auth claudeai-auth tengu_claudeai_mcp_auth_completed tengu_claudeai_mcp_clear_auth_completed claudeai-proxy tengu_claudeai_mcp_auth_started tengu_claudeai_mcp_clear_auth_started claudeai-proxy tengu_claudeai_mcp_toggle claudeai-proxy claudeai-proxy claudeai-auth claudeai-clear-auth claudeai-proxy tengu_claudeai_mcp_reconnect claude claudeai-proxy claude.ai claudeai-proxy No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more. claude claude-plugin-directory claude-plugin-directory claude-plugins-official claude claude claude-plugin-directory claude .claude-plugin claudeai-proxy .claude-plugin claude-plugin-directory .claude-plugin .claude-plugin No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json /plugin validate .claude-plugin/plugin.json When given a directory, automatically validates .claude-plugin/marketplace.json or .claude-plugin/plugin.json (prefers marketplace if both exist). claude plugin validate report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues /code/claude claude claude claude_code_guest_pass claude_code_guest_pass Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead. claude claude claude claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues && claude --resume Not in remote mode. Start with `claude --remote` to use this command. Create skills in .claude/skills/ or ~/.claude/skills/ claude https://code.claude.com/docs/en/fast-mode https://support.claude.com/en/articles/13456702-claude-code-guest-passes https://support.claude.com/en/articles/12875061-claude-code-guest-passes claude_code_guest_pass claude https://claude.ai/settings/data-privacy-controls https://claude.ai/settings/data-privacy-controls https://claude.ai/settings/data-privacy-controls, An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run `claude` to review the updated terms. [ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run `claude` to review the updated terms. Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked. https://code.claude.com/docs/en/hooks To resume the original: claude -r Project (.claude/agents/) Personal (~/.claude/agents/) Enable (~/.claude/agent-memory/) (Recommended) Project scope (.claude/agent-memory/) Local scope (.claude/agent-memory-local/) Enable (.claude/agent-memory/) (Recommended) User scope (~/.claude/agent-memory/) https://code.claude.com/docs/en/sandboxing#configure-sandboxing code.claude.com/docs/en/sandboxing#configure-sandboxing https://code.claude.com/docs/en/sandboxing code.claude.com/docs/en/sandboxing .claude/settings.local.json You have access to browser automation tools (mcp__claude-in-chrome__*) for interacting with web pages in Chrome. Follow these guidelines for effective browser automation. When performing multi-step browser interactions that the user may want to review or share, use mcp__claude-in-chrome__gif_creator to record them. You can use mcp__claude-in-chrome__read_console_messages to read console output. Console output may be verbose. If you are looking for specific log entries, use the 'pattern' parameter with a regex-compatible pattern. This filters results efficiently and avoids overwhelming output. For example, use pattern: "[MyApp]" to filter for application-specific logs rather than reading all console output. IMPORTANT: Do not trigger JavaScript alerts, confirms, prompts, or browser modal dialogs through your actions. These browser dialogs block all further browser events and will prevent the extension from receiving any subsequent commands. Instead, when possible, use console.log for debugging and then use the mcp__claude-in-chrome__read_console_messages tool to read those log messages. If a page has dialog-triggering elements: 3. Use mcp__claude-in-chrome__javascript_tool to check for and dismiss any existing dialogs before proceeding IMPORTANT: At the start of each browser automation session, call mcp__claude-in-chrome__tabs_context_mcp first to get information about the user's current browser tabs. Use this context to understand what the user might want to work with before creating new tabs. 2. Otherwise, create a new tab with mcp__claude-in-chrome__tabs_create_mcp --claude-in-chrome-mcp --claude-in-chrome-mcp file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/claudeInChrome/setup.ts mcp__claude-in-chrome__ Claude in Chrome requires a claude.ai subscription. claude --chrome claude --no-chrome Learn more: https://code.claude.com/docs/en/chrome https://www.stickermule.com/claudecode Failed to open browser. Visit: https://www.stickermule.com/claudecode default_claude_max_20x claude_max https://claude.ai/upgrade/max Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade. default_claude_max_20x file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/screenshotClipboard.ts claude-code-screenshots claude claude claude claude "claude_helpfulness": "unhelpful|slightly_helpful|moderately_helpful|very_helpful|essential", claude_helpfulness user_instructions_to_claude
.claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; } .claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; } .claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe; } .claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; } .claude-md-item:last-child { border-bottom: none; } .claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; } .claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; } .claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe; } .claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; } .claude-md-item:last-child { border-bottom: none; } claude_md_additions
/api/oauth/claude_cli/client_data report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues You have access to past session data that may contain valuable context. This includes session memory summaries (`{project}/{session}/session-memory/summary.md`) and full transcript logs (`{project}/{sessionId}.jsonl`), stored under `~/.claude/projects/`. report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-opus-4-6 claude-opus-4-5 claude-haiku-4 claude-opus-4 claude-sonnet-4-5 claude-sonnet-4 file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/bash/parser.ts .claude claude-code-mcp-cli .claude .claude claude claude- .claude claudecode.v1. .claude claude-code Authentication error occurred. Please ensure you are logged into the Claude browser extension with the same claude.ai account as Claude Code. ), and that you are logged into claude.ai with the same account as Claude Code. If this is your first time connecting to Chrome, you may need to restart Chrome for the installation to take effect. If you continue to experience issues, please report a bug: .claude https://code.claude.com/docs/en/costs /.claude /.claude yes-claude-folder global-claude-folder claude-folder claude-folder global-claude-folder claude-prompt tengu_ask_user_question_respond_to_claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude doctor report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues cd ~/.claude/local && npm update report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues brew upgrade claude-code apk upgrade claude-code report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues . Try running /login and signing in with a claude.ai account (not Console). Claude in Chrome requires a claude.ai subscription https://claude.ai/chrome to install claude-in-chrome-default-enabled Check ~/.claude.json permissions claude-code-plugins claudeai-proxy claudeai-proxy has_claude_max has_claude_pro claudeBlue_FOR_SYSTEM_SPINNER claudeBlueShimmer_FOR_SYSTEM_SPINNER https://code.claude.com/docs/en/mcp https://code.claude.com/docs/en/security https://code.claude.com/docs/en/chrome tengu_claude_in_chrome_onboarding_shown /api/claude_code/user_settings claudeai-proxy Error: --resume requires a valid session ID when used with --print. Usage: claude -p --resume Run claude --teleport from a checkout of claude claude claude mcp add --transport http sentry https://mcp.sentry.dev/mcp claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..." claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server claude mcp add my-server -- my-command --some-flag arg1 Usage: claude mcp add [args...] If this is an HTTP server, use: claude mcp add --transport http If this is an SSE server, use: claude mcp add --transport sse https://platform.claude.com/v1/oauth/hello https://platform.claude.com/v1/oauth/hello claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues https://code.claude.com/docs/en/security .claude/settings.json .claude/settings.local.json .claude/settings.json .claude/settings.local.json .claude/settings.json .claude/settings.local.json .claude/settings.json .claude/settings.local.json .claude/settings.json .claude/settings.local.json .claude/settings.json .claude/settings.local.json https://code.claude.com/docs/en/security claude-in-chrome When the user wants to interact with web pages, automate browser tasks, capture screenshots, read console logs, or perform any browser-based actions. Always invoke BEFORE attempting to use any mcp__claude-in-chrome__* tools. Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings". claude/tengu report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude_desktop_config.json /AppData/Roaming/Claude/claude_desktop_config.json claude mcp remove " No MCP servers configured. Use `claude mcp add` to add a server. claudeai-proxy To remove this server, run: claude mcp remove " No plugins installed. Use `claude plugin install` to install a plugin. claude.exe ~/.local/bin/claude claude claude --help tengu_claude_install_command report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues brew upgrade claude-code apk upgrade claude-code Try running "claude doctor" for diagnostics cd ~/.claude/local && npm update Or consider using native installation with: claude install report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-settings claude-code-github-action claude claude-vscode claude Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-5-20250929'). report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues add-from-claude-desktop Tip: You can launch Claude Code with just `claude` tengu_claude_in_chrome_setup tengu_claude_in_chrome_setup_failed Usage: claude --remote "your task description" View: https://claude.ai/code/ Resume with: claude --teleport https://claude.ai/code/ Use /session for QR code and link to open on claude.ai You must run claude --teleport claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues --claude-in-chrome-mcp cli_claude_in_chrome_mcp_path claude-code-20250219 claude-code-20250219 /home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/spawn-rx/lib/src user:sessions:claude_code https://platform.claude.com/oauth/authorize https://claude.ai/oauth/authorize https://platform.claude.com/v1/oauth/token https://api.anthropic.com/api/oauth/claude_cli/create_api_key https://api.anthropic.com/api/oauth/claude_cli/roles https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code https://platform.claude.com/oauth/code/success?app=claude-code https://platform.claude.com/oauth/code/callback http://localhost:3000/api/oauth/claude_cli/create_api_key http://localhost:3000/api/oauth/claude_cli/roles http://localhost:3000/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code http://localhost:3000/oauth/code/success?app=claude-code https://beacon.claude-ai.staging.ant.dev https://claude.fedstart.com https://claude-staging.fedstart.com https://beacon.claude-ai.staging.ant.dev https://claude.fedstart.com https://claude-staging.fedstart.com claude-cli file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/ripgrep.ts WebSearch(claude ai) WebSearch(claude ai) Model to use for this prompt hook (e.g., "claude-sonnet-4-5-20250929"). If not specified, uses the default small fast model. Model to use for this agent hook (e.g., "claude-sonnet-4-5-20250929"). If not specified, uses Haiku. claudeai claudeai claudeai-proxy claude-code-marketplace claude-code-plugins claude-plugins-official claude-code-marketplace claude-code-plugins claude-plugins-official (?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official)) Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json) Local directory containing .claude-plugin/marketplace.json Marketplace name cannot impersonate official Anthropic/Claude marketplaces. Names containing "official", "anthropic", or "claude" in official-sounding combinations are reserved. Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources. claudeai claudeai Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/ https://code.claude.com/docs/en/iam#permission-modes https://code.claude.com/docs/en/settings#environment-variables https://code.claude.com/docs/en/settings https://code.claude.com/docs/en/iam#working-directories https://code.claude.com/docs/en/iam#configuring-permissions https://code.claude.com/docs/en/hooks /etc/claude-code claude-3-7-sonnet-20250219 us.anthropic.claude-3-7-sonnet-20250219-v1:0 claude-3-7-sonnet@20250219 claude-3-7-sonnet claude-3-5-sonnet-20241022 anthropic.claude-3-5-sonnet-20241022-v2:0 claude-3-5-sonnet-v2@20241022 claude-3-5-sonnet claude-3-5-haiku-20241022 us.anthropic.claude-3-5-haiku-20241022-v1:0 claude-3-5-haiku@20241022 claude-3-5-haiku claude-haiku-4-5-20251001 us.anthropic.claude-haiku-4-5-20251001-v1:0 claude-haiku-4-5@20251001 claude-haiku-4-5 claude-sonnet-4-20250514 us.anthropic.claude-sonnet-4-20250514-v1:0 claude-sonnet-4@20250514 claude-sonnet-4 claude-sonnet-4-5-20250929 us.anthropic.claude-sonnet-4-5-20250929-v1:0 claude-sonnet-4-5@20250929 claude-sonnet-4-5 claude-opus-4-20250514 us.anthropic.claude-opus-4-20250514-v1:0 claude-opus-4@20250514 claude-opus-4 claude-opus-4-1-20250805 us.anthropic.claude-opus-4-1-20250805-v1:0 claude-opus-4-1@20250805 claude-opus-4-1 claude-opus-4-5-20251101 us.anthropic.claude-opus-4-5-20251101-v1:0 claude-opus-4-5@20251101 claude-opus-4-5 claude-opus-4-6 us.anthropic.claude-opus-4-6-v1 report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues Error getting API key from apiKeyHelper (in settings or ~/.claude.json): claude-opus-4-20250514 claude-opus-4-0 claude-4-opus-20250514 anthropic.claude-opus-4-20250514-v1:0 claude-opus-4@20250514 claude-opus-4-1-20250805 anthropic.claude-opus-4-1-20250805-v1:0 claude-opus-4-1@20250805 claude-1.3 claude-1.3-100k claude-instant-1.1 claude-instant-1.1-100k claude-instant-1.2 claude-3-sonnet-20240229 claude-3-opus-20240229 claude-2.1 claude-2.0 claude-3-7-sonnet-latest claude-3-7-sonnet-20250219 The ripgrep command to execute (e.g., "rg", "claude") file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f38AYAJ+fwF/YAN/fX0BfWABfAF8YAN/fHwAYAR/f319AGAHf39/fX19fQF9YA1/fX99f31/fX19fX1/AX9gC39/f39/f399fX19AX9gCH9/f39/f319AGAEf39+fgBgB39/f39/f38Bf2ACfH8BfGAFf398fH8AYAN/f38BfGAEf39/fABgA39/fQBgBn9/fX99fwF/ArUBHgFhAWEAHwFhAWIAAwFhAWMACQFhAWQAFgFhAWUAEQFhAWYAIAFhAWcAAAFhAWgAIQFhAWkAAwFhAWoAAAFhAWsAFwFhAWwACgFhAW0ABQFhAW4AAwFhAW8AAQFhAXAAFwFhAXEABgFhAXIAAAFhAXMAIgFhAXQACgFhAXUADQFhAXYAFgFhAXcAAgFhAXgAAwFhAXkAGAFhAXoAAgFhAUEAAQFhAUIAEQFhAUMAAQFhAUQAAAOiAqACAgMSBwcACRkDAAoRBgYKEwAPDxMBBiMTCgcHGgMUASQFJRQHAwMKCgMmAQYYDxobFAAKBw8KBwMDAgkCAAAFGwACBwIHBgIDAQMIDAABKAkHBQURACkZASoAAAIrLAIALQcHBy4HLwkFCgMCMA0xAgMJAgACAQYKAQIBBQEACQIFAQEABQAODQ0GFQIBHBUGAgkCEAAAAAUyDzMMBQYINAUCAwUODg41AgMCAgIDBgICNgIBDAwMAQsLCwsLCx0CAAIAAAABABABBQICAQMCEgMMCwEBAQEBAQsLAQICAwICAgICAgIDAgIICAEICAgEBAQEBAQEBAQABAQABAQEBAAEBAQBAQEICAEBAQEBAQEBCAgBAQEAAg4CAgUBAR4DBAcBcAHUAdQBBQcBAYACgIACBg0CfwFBkMQEC38BQQALByQIAUUCAAFGAG0BRwCwAQFIAK8BAUkAYQFKAQABSwAjAUwApgEJjQMBAEEBC9MBqwGqAaUB5QHiAZwB0AFazwHOAVlZWpsBmgGZAc0BzAHLAcoBWpgByQFZWVqbAZoBmQHIAccBxgGjAZcBpAGWAaMBvQKVAbwCxQG7Ajq6Ajq5ApQBuAI+twI+xAFqwwFqwgFqaWjBAcABvwGhAZcBtgK+AbUClgGhAbQCmAGzAjqxAjqwAr0BrwKuAq0CrAKrAqoCqAKnAqYCpQKkAqMCogKhArwBoAKfAp4CnQKcApsCmgKZApgClwKWApUClAKTApICkQKQAo8CjgKyAo0CjAKLAooCiAKHAqkChQI+hAK7AYMCggKBAoAC/gH9AfwB+QG6AfgBuQH3AfYB9QH0AfMB8gHxAYYC8AHvAbgB+wH6Ae4B7QG3AesBlQHqATrpAT7oAT7nAZQB0QE67AE+iQLmATrkAeMBOuEB4AHfAT7eAd0B3AG2AdsB2gHZAdgB1wHWAdUBtQHUAdMB0gH/AWloaWiPAZABsgGxAZEBhQGSAbQBswGRAa4BrQGsAakBqAGnAYUBCtj+A6ACMwEBfyAAQQEgABshAAJAA0AgABBhIgENAUGIxAAoAgAiAQRAIAERCQAMAQsLEAIACyABC+0BAgJ9A39DAADAfyEEAkACQAJAAkAgAkEHcSIGDgUCAQEBAAELQQMhBQwBCyAGQQFrQQJPDQEgAkHw/wNxQQR2IQcCfSACQQhxBEAgASAHEJ4BvgwBC0EAIAdB/w9xIgFrIAEgAsFBAEgbsgshAyAGQQFGBEAgAyADXA0BQwAAwH8gAyADQwAAgH9bIANDAACA/1tyIgEbIQQgAUUhBQwBCyADIANcDQBBAEECIANDAACAf1sgA0MAAID/W3IiARshBUMAAMB/IAMgARshBAsgACAFOgAEIAAgBDgCAA8LQfQNQakYQTpB+RYQCwALZwIBfQF/QwAAwH8hAgJAAkACQCABQQdxDgQCAAABAAtBxBJBqRhByQBBuhIQCwALIAFB8P8DcUEEdiEDIAFBCHEEQCAAIAMQngG+DwtBACADQf8PcSIAayAAIAHBQQBIG7IhAgsgAgt4AgF/AX0jAEEQayIEJAAgBEEIaiAAQQMgAkECR0EBdCABQf4BcUECRxsgAhAoQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAAAgBSAFWxsLeAIBfwF9IwBBEGsiBCQAIARBCGogAEEBIAJBAkZBAXQgAUH+AXFBAkcbIAIQKEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAIAUgBVsbC8wCAQV/IAAEQCAAQQRrIgEoAgAiBSEDIAEhAiAAQQhrKAIAIgAgAEF+cSIERwRAIAEgBGsiAigCBCIAIAIoAgg2AgggAigCCCAANgIEIAQgBWohAwsgASAFaiIEKAIAIgEgASAEakEEaygCAEcEQCAEKAIEIgAgBCgCCDYCCCAEKAIIIAA2AgQgASADaiEDCyACIAM2AgAgA0F8cSACakEEayADQQFyNgIAIAICfyACKAIAQQhrIgFB/wBNBEAgAUEDdkEBawwBCyABQR0gAWciAGt2QQRzIABBAnRrQe4AaiABQf8fTQ0AGkE/IAFBHiAAa3ZBAnMgAEEBdGtBxwBqIgAgAEE/TxsLIgFBBHQiAEHgMmo2AgQgAiAAQegyaiIAKAIANgIIIAAgAjYCACACKAIIIAI2AgRB6DpB6DopAwBCASABrYaENwMACwsOAEHYMigCABEJABBYAAunAQIBfQJ/IABBFGoiByACIAFBAkkiCCAEIAUQNSEGAkAgByACIAggBCAFEC0iBEMAAAAAYCADIARecQ0AIAZDAAAAAGBFBEAgAyEEDAELIAYgAyADIAZdGyEECyAAQRRqIgAgASACIAUQOCAAIAEgAhAwkiAAIAEgAiAFEDcgACABIAIQL5KSIgMgBCADIAReGyADIAQgBCAEXBsgBCAEWyADIANbcRsLvwEBA38gAC0AAEEgcUUEQAJAIAEhAwJAIAIgACIBKAIQIgAEfyAABSABEJ0BDQEgASgCEAsgASgCFCIFa0sEQCABIAMgAiABKAIkEQYAGgwCCwJAIAEoAlBBAEgNACACIQADQCAAIgRFDQEgAyAEQQFrIgBqLQAAQQpHDQALIAEgAyAEIAEoAiQRBgAgBEkNASADIARqIQMgAiAEayECIAEoAhQhBQsgBSADIAIQKxogASABKAIUIAJqNgIUCwsLCwYAIAAQIwtQAAJAAkACQAJAAkAgAg4EBAABAgMLIAAgASABQQxqEEMPCyAAIAEgAUEMaiADEEQPCyAAIAEgAUEMahBCDwsQJAALIAAgASABQQxqIAMQRQttAQF/IwBBgAJrIgUkACAEQYDABHEgAiADTHJFBEAgBSABQf8BcSACIANrIgNBgAIgA0GAAkkiARsQKhogAUUEQANAIAAgBUGAAhAmIANBgAJrIgNB/wFLDQALCyAAIAUgAxAmCyAFQYACaiQAC/ICAgJ/AX4CQCACRQ0AIAAgAToAACAAIAJqIgNBAWsgAToAACACQQNJDQAgACABOgACIAAgAToAASADQQNrIAE6AAAgA0ECayABOgAAIAJBB0kNACAAIAE6AAMgA0EEayABOgAAIAJBCUkNACAAQQAgAGtBA3EiBGoiAyABQf8BcUGBgoQIbCIBNgIAIAMgAiAEa0F8cSIEaiICQQRrIAE2AgAgBEEJSQ0AIAMgATYCCCADIAE2AgQgAkEIayABNgIAIAJBDGsgATYCACAEQRlJDQAgAyABNgIYIAMgATYCFCADIAE2AhAgAyABNgIMIAJBEGsgATYCACACQRRrIAE2AgAgAkEYayABNgIAIAJBHGsgATYCACAEIANBBHFBGHIiBGsiAkEgSQ0AIAGtQoGAgIAQfiEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkEgayICQR9LDQALCyAAC4AEAQN/IAJBgARPBEAgACABIAIQFyAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAtIAQF/IwBBEGsiBCQAIAQgAzYCDAJAIABFBEBBAEEAIAEgAiAEKAIMEHEMAQsgACgC9AMgACABIAIgBCgCDBBxCyAEQRBqJAALkwECAX0BfyMAQRBrIgYkACAGQQhqIABB6ABqIAAgAkEBdGovAWIQH0MAAMB/IQUCQAJAAkAgBi0ADEEBaw4CAAECCyAGKgIIIQUMAQsgBioCCCADlEMK1yM8lCEFCyAALQADQRB0QYCAwABxBEAgBSAAIAEgAiAEEFQiA0MAAAAAIAMgA1sbkiEFCyAGQRBqJAAgBQu1AQECfyAAKAIEQQFqIgEgACgCACICKALsAyACKALoAyICa0ECdU8EQANAIAAoAggiAUUEQCAAQQA2AgggAEIANwIADwsgACABKAIENgIAIAAgASgCCDYCBCAAIAEoAgA2AgggARAjIAAoAgRBAWoiASAAKAIAIgIoAuwDIAIoAugDIgJrQQJ1Tw0ACwsgACABNgIEIAIgAUECdGooAgAtABdBEHRBgIAwcUGAgCBGBEAgABB9CwuBAQIBfwF9IwBBEGsiAyQAIANBCGogAEEDIAJBAkdBAXQgAUH+AXFBAkcbIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC4EBAgF/AX0jAEEQayIDJAAgA0EIaiAAQQEgAkECRkEBdCABQf4BcUECRxsgAhBTQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIQwAAAACUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsLeAICfQF/IAAgAkEDdGoiByoC+AMhBkMAAMB/IQUCQAJAAkAgBy0A/ANBAWsOAgABAgsgBiEFDAELIAYgA5RDCtcjPJQhBQsgAC0AF0EQdEGAgMAAcQR9IAUgAEEUaiABIAIgBBBUIgNDAAAAACADIANbG5IFIAULC1EBAX8CQCABKALoAyICIAEoAuwDRwRAIABCADcCBCAAIAE2AgAgAigCAC0AF0EQdEGAgDBxQYCAIEcNASAAEH0PCyAAQgA3AgAgAEEANgIICwvoAgECfwJAIAAgAUYNACABIAAgAmoiBGtBACACQQF0a00EQCAAIAEgAhArDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkEBayECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkEBayICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQQRrIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkEBayICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AA0AgAyABKAIANgIAIAFBBGohASADQQRqIQMgAkEEayICQQNLDQALCyACRQ0AA0AgAyABLQAAOgAAIANBAWohAyABQQFqIQEgAkEBayICDQALCyAAC5QCAgF8AX8CQCAAIAGiIgAQbCIERAAAAAAAAPA/oCAEIAREAAAAAAAAAABjGyIEIARiIgUgBJlELUMc6+I2Gj9jRXJFBEAgACAEoSEADAELIAUgBEQAAAAAAADwv6CZRC1DHOviNho/Y0VyRQRAIAAgBKFEAAAAAAAA8D+gIQAMAQsgACAEoSEAIAIEQCAARAAAAAAAAPA/oCEADAELIAMNACAAAnxEAAAAAAAAAAAgBQ0AGkQAAAAAAADwPyAERAAAAAAAAOA/ZA0AGkQAAAAAAADwP0QAAAAAAAAAACAERAAAAAAAAOC/oJlELUMc6+I2Gj9jGwugIQALIAAgAGIgASABYnIEQEMAAMB/DwsgACABo7YLkwECAX0BfyMAQRBrIgYkACAGQQhqIABB6ABqIAAgAkEBdGovAV4QH0MAAMB/IQUCQAJAAkAgBi0ADEEBaw4CAAECCyAGKgIIIQUMAQsgBioCCCADlEMK1yM8lCEFCyAALQADQRB0QYCAwABxBEAgBSAAIAEgAiAEEFQiA0MAAAAAIAMgA1sbkiEFCyAGQRBqJAAgBQtQAAJAAkACQAJAAkAgAg4EBAABAgMLIAAgASABQR5qEEMPCyAAIAEgAUEeaiADEEQPCyAAIAEgAUEeahBCDwsQJAALIAAgASABQR5qIAMQRQt+AgF/AX0jAEEQayIEJAAgBEEIaiAAQQMgAkECR0EBdCABQf4BcUECRxsgAhBQQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAACXQwAAAAAgBSAFWxsLfgIBfwF9IwBBEGsiBCQAIARBCGogAEEBIAJBAkZBAXQgAUH+AXFBAkcbIAIQUEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAl0MAAAAAIAUgBVsbC08AAkACQAJAIANB/wFxIgMOBAACAgECCyABIAEvAABB+P8DcTsAAA8LIAEgAS8AAEH4/wNxQQRyOwAADwsgACABIAJBAUECIANBAUYbEEwLNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEBAAtiAgJ9An8CQCAAKALkA0UNACAAQfwAaiIDIABBGmoiBC8BABAgIgIgAlwEQCADIABBGGoiBC8BABAgIgIgAlwNASADIAAvARgQIEMAAAAAXkUNAQsgAyAELwEAECAhAQsgAQtfAQN/IAEEQEEMEB4iAyABKQIENwIEIAMhAiABKAIAIgEEQCADIQQDQEEMEB4iAiABKQIENwIEIAQgAjYCACACIQQgASgCACIBDQALCyACIAAoAgA2AgAgACADNgIACwvXawMtfxx9AX4CfwJAIAAtAABBBHEEQCAAKAKgASAMRw0BCyAAKAKkASAAKAL0AygCDEcNAEEAIAAtAKgBIANGDQEaCyAAQoCAgPyLgIDAv383AoADIABCgYCAgBA3AvgCIABCgICA/IuAgMC/fzcC8AIgAEEANgKsAUEBCyErAkACQAJAAkAgACgCCARAIABBFGoiDkECQQEgBhAiIT4gDkECQQEgBhAhITwgDkEAQQEgBhAiITsgDkEAQQEgBhAhIUAgBCABIAUgAiAAKAL4AiAAQfACaiIOKgIAIAAoAvwCIAAqAvQCIAAqAoADIAAqAoQDID4gPJIiPiA7IECSIjwgACgC9AMiEBB7DQEgACgCrAEiEUUNAyAAQbABaiETA0AgBCABIAUgAiATIB1BGGxqIg4oAgggDioCACAOKAIMIA4qAgQgDioCECAOKgIUID4gPCAQEHsNAiAdQQFqIh0gEUcNAAsMAgsgCEUEQCAAKAKsASITRQ0CIABBsAFqIRADQAJAAkAgECAdQRhsIhFqIg4qAgAiPiA+XCABIAFcckUEQCA+IAGTi0MXt9E4XQ0BDAILIAEgAVsgPiA+W3INAQsCQCAQIBFqIhEqAgQiPiA+XCACIAJcckUEQCA+IAKTi0MXt9E4XQ0BDAILIAIgAlsgPiA+W3INAQsgESgCCCAERw0AIBEoAgwgBUYNAwsgEyAdQQFqIh1HDQALDAILAkAgAEHwAmoiDioCACI+ID5cIAEgAVxyRQRAID4gAZOLQxe30ThdDQEMBAsgASABWyA+ID5bcg0DCyAOQQAgACgC/AIgBUYbQQAgACgC+AIgBEYbQQACfyACIAJcIg4gACoC9AIiPiA+XHJFBEAgPiACk4tDF7fROF0MAQtBACA+ID5bDQAaIA4LGyEOCyAORSArcgRAIA4hHQwCCyAAIA4qAhA4ApQDIAAgDioCFDgCmAMgCkEMQRAgCBtqIgMgAygCAEEBajYCACAOIR0MAgtBACEdCyAGIUAgByFHIAtBAWohIiMAQaABayINJAACQAJAIARBAUYgASABW3JFBEAgDUGqCzYCICAAQQVB2CUgDUEgahAsDAELIAVBAUYgAiACW3JFBEAgDUHZCjYCECAAQQVB2CUgDUEQahAsDAELIApBAEEEIAgbaiILIAsoAgBBAWo2AgAgACAALQCIA0H8AXEgAC0AFEEDcSILIANBASADGyIsIAsbIg9BA3FyOgCIAyAAQawDaiIQIA9BAUdBA3QiC2ogAEEUaiIUQQNBAiAPQQJGGyIRIA8gQBAiIgY4AgAgECAPQQFGQQN0Ig5qIBQgESAPIEAQISIHOAIAIAAgFEEAIA8gQBAiIjw4ArADIAAgFEEAIA8gQBAhIjs4ArgDIABBvANqIhAgC2ogFCARIA8QMDgCACAOIBBqIBQgESAPEC84AgAgACAUQQAgDxAwOALAAyAAIBRBACAPEC84AsgDIAsgAEHMA2oiC2ogFCARIA8gQBA4OAIAIAsgDmogFCARIA8gQBA3OAIAIAAgFEEAIA8gQBA4OALQAyAAIBRBACAPIEAQNyI6OALYAyAGIAeSIT4gPCA7kiE8AkACQCAAKAIIIgsEQEMAAMB/IAEgPpMgBEEBRhshBkMAAMB/IAIgPJMgBUEBRhshPiAAAn0gBCAFckUEQCAAIABBAiAPIAYgQCBAECU4ApQDIABBACAPID4gRyBAECUMAQsgBEEDTyAFQQNPcg0EIA1BiAFqIAAgBiAGIAAqAswDIAAqAtQDkiAAKgK8A5IgACoCxAOSIjyTIgdDAAAAACAHQwAAAABeGyAGIAZcG0GBgAggBEEDdEH4//8HcXZB/wFxID4gPiAAKgLQAyA6kiAAKgLAA5IgACoCyAOSIjuTIgdDAAAAACAHQwAAAABeGyA+ID5cG0GBgAggBUEDdEH4//8HcXZB/wFxIAsREAAgDSoCjAEiPUMAAAAAYCANKgKIASIHQwAAAABgcUUEQCANID27OQMIIA0gB7s5AwAgAEEBQdwdIA0QLCANKgKMASIHQwAAAAAgB0MAAAAAXhshPSANKgKIASIHQwAAAAAgB0MAAAAAXhshBwsgCiAKKAIUQQFqNgIUIAogCUECdGoiCSAJKAIYQQFqNgIYIAAgAEECIA8gPCAHkiAGIARBAWtBAkkbIEAgQBAlOAKUAyAAQQAgDyA7ID2SID4gBUEBa0ECSRsgRyBAECULOAKYAwwBCwJAIAAoAuADRQRAIAAoAuwDIAAoAugDa0ECdSELDAELIA1BiAFqIAAQMgJAIA0oAogBRQRAQQAhCyANKAKMAUUNAQsgDUGAAWohEEEAIQsDQCANQQA2AoABIA0gDSkDiAE3A3ggECANKAKQARA8IA1BiAFqEC4gDSgCgAEiCQRAA0AgCSgCACEOIAkQJyAOIgkNAAsLIAtBAWohCyANQQA2AoABIA0oAowBIA0oAogBcg0ACwsgDSgCkAEiCUUNAANAIAkoAgAhDiAJECcgDiIJDQALCyALRQRAIAAgAEECIA8gBEEBa0EBSwR9IAEgPpMFIAAqAswDIAAqAtQDkiAAKgK8A5IgACoCxAOSCyBAIEAQJTgClAMgACAAQQAgDyAFQQFrQQFLBH0gAiA8kwUgACoC0AMgACoC2AOSIAAqAsADkiAAKgLIA5ILIEcgQBAlOAKYAwwBCwJAIAgNACAFQQJGIAIgPJMiBiAGW3EgBkMAAAAAX3EgBCAFckUgBEECRiABID6TIgdDAAAAAF9xcnJFDQAgACAAQQIgD0MAAAAAQwAAAAAgByAHQwAAAABdGyAHIARBAkYbIAcgB1wbIEAgQBAlOAKUAyAAIABBACAPQwAAAABDAAAAACAGIAZDAAAAAF0bIAYgBUECRhsgBiAGXBsgRyBAECU4ApgDDAELIAAQTyAAIAAtAIgDQfsBcToAiAMgABBeQQMhEyAALQAUQQJ2QQNxIQkCQAJAIA9BAkcNAAJAIAlBAmsOAgIAAQtBAiETDAELIAkhEwsgAC8AFSEnIBQgEyAPIEAQOCEGIBQgEyAPEDAhByAUIBMgDyBAEDchOyAUIBMgDxAvITpBACEQIBQgEUEAIBNBAkkbIhYgDyBAEDghPyAUIBYgDxAwIT0gFCAWIA8gQBA3IUEgFCAWIA8QLyFEIBQgFiAPIEAQYCFCIBQgFiAPEEshQyAAIA9BACABID6TIlAgBiAHkiA7IDqSkiJKID8gPZIgQSBEkpIiRiATQQFLIhkbIEAgQBB6ITsgACAPQQEgAiA8kyJRIEYgSiAZGyBHIEAQeiFFAkACQCAEIAUgGRsiHA0AIA1BiAFqIAAQMgJAAkAgDSgCiAEiDiANKAKMASIJckUNAANAIA4oAuwDIA4oAugDIg5rQQJ1IAlNDQQCQCAOIAlBAnRqKAIAIgkQeUUNACAQDQIgCRA7IgYgBlsgBotDF7fROF1xDQIgCRBAIgYgBlwEQCAJIRAMAQsgCSEQIAaLQxe30ThdDQILIA1BiAFqEC4gDSgCjAEiCSANKAKIASIOcg0ACwwBC0EAIRALIA0oApABIglFDQADQCAJKAIAIQ4gCRAnIA4iCQ0ACwsgDUGIAWogABAyIA0oAowBIQkCQCANKAKIASIORQRAQwAAAAAhPSAJRQ0BCyBFIEVcIiMgBUEAR3IhKCA7IDtcIiQgBEEAR3IhKUMAAAAAIT0DQCAOKALsAyAOKALoAyIOa0ECdSAJTQ0CIA4gCUECdGooAgAiDhB4AkAgDi8AFSAOLQAXQRB0ciIJQYCAMHFBgIAQRgRAIA4QdyAOIA4tAAAiCUEBciIOQfsBcSAOIAlBBHEbOgAADAELIAgEfyAOIA4tABRBA3EiCSAPIAkbIDsgRRB2IA4vABUgDi0AF0EQdHIFIAkLQYDgAHFBgMAARg0AIA5BFGohEQJAIA4gEEYEQCAQQQA2ApwBIBAgDDYCmAFDAAAAACEHDAELIBQtAABBAnZBA3EhCQJAAkAgD0ECRw0AQQMhEgJAIAlBAmsOAgIAAQtBAiESDAELIAkhEgsgDUGAgID+BzYCaCANQYCAgP4HNgJQIA1B+ABqIA5B/ABqIhcgDi8BHhAfIDsgRSASQQFLIh4bIT4CQAJAAkACQCANLQB8IgkOBAABAQABCwJAIBcgDi8BGBAgIgYgBlwNACAXIA4vARgQIEMAAAAAXkUNACAOKAL0Ay0ACEEBcSIJDQBDAADAf0MAAAAAIAkbIQcMAgtDAADAfyEGDAILIA0qAnghB0MAAMB/IQYCQCAJQQFrDgIBAAILIAcgPpRDCtcjPJQhBgwBCyAHIQYLIA4tABdBEHRBgIDAAHEEQCAGIBEgD0GBAiASQQN0dkEBcSA7EFQiBkMAAAAAIAYgBlsbkiEGCyAOKgL4AyEHQQAhH0EAIRgCQAJAAkAgDi0A/ANBAWsOAgEAAgsgOyAHlEMK1yM8lCEHCyAHIAdcDQAgB0MAAAAAYCEYCyAOKgKABCEHAkACQAJAIA4tAIQEQQFrDgIBAAILIEUgB5RDCtcjPJQhBwsgByAHXA0AIAdDAAAAAGAhHwsCQCAOAn0gBiAGXCIJID4gPlxyRQRAIA4qApwBIgcgB1sEQCAOKAL0Ay0AEEEBcUUNAyAOKAKYASAMRg0DCyARIBIgDyA7EDggESASIA8QMJIgESASIA8gOxA3IBEgEiAPEC+SkiIHIAYgBiAHXRsgByAGIAkbIAYgBlsgByAHW3EbDAELIBggHnEEQCARQQIgDyA7EDggEUECIA8QMJIgEUECIA8gOxA3IBFBAiAPEC+SkiIHIA4gD0EAIDsgOxAxIgYgBiAHXRsgByAGIAYgBlwbIAYgBlsgByAHW3EbDAELIB4gH0VyRQRAIBFBACAPIDsQOCARQQAgDxAwkiARQQAgDyA7EDcgEUEAIA8QL5KSIgcgDiAPQQEgRSA7EDEiBiAGIAddGyAHIAYgBiAGXBsgBiAGWyAHIAdbcRsMAQtBASEaIA1BATYCZCANQQE2AnggEUECQQEgOxAiIBFBAkEBIDsQIZIhPiARQQBBASA7ECIhPCARQQBBASA7ECEhOkMAAMB/IQdBASEVQwAAwH8hBiAYBEAgDiAPQQAgOyA7EDEhBiANQQA2AnggDSA+IAaSIgY4AmhBACEVCyA8IDqSITwgHwRAIA4gD0EBIEUgOxAxIQcgDUEANgJkIA0gPCAHkiIHOAJQQQAhGgsCQAJAAkAgAC0AF0EQdEGAgAxxQYCACEYiCSASQQJJIiBxRQRAIAkgJHINAiAGIAZcDQEMAgsgJCAGIAZbcg0CC0ECIRUgDUECNgJ4IA0gOzgCaCA7IQYLAkAgIEEBIAkbBEAgCSAjcg0CIAcgB1wNAQwCCyAjIAcgB1tyDQELQQIhGiANQQI2AmQgDSBFOAJQIEUhBwsCQCAXIA4vAXoQICI6IDpcDQACfyAVIB5yRQRAIBcgDi8BehAgIQcgDUEANgJkIA0gPCAGID6TIAeVkjgCUEEADAELIBogIHINASAXIA4vAXoQICEGIA1BADYCeCANIAYgByA8k5QgPpI4AmhBAAshGkEAIRULIA4vABZBD3EiCUUEQCAALQAVQQR2IQkLAkAgFUUgCUEFRiAeciAYIClyIAlBBEdycnINACANQQA2AnggDSA7OAJoIBcgDi8BehAgIgYgBlwNAEEAIRogFyAOLwF6ECAhBiANQQA2AmQgDSA7ID6TIAaVOAJQCyAOLwAWQQ9xIhhFBEAgAC0AFUEEdiEYCwJAICAgKHIgH3IgGEEFRnIgGkUgGEEER3JyDQAgDUEANgJkIA0gRTgCUCAXIA4vAXoQICIGIAZcDQAgFyAOLwF6ECAhBiANQQA2AnggDSAGIEUgPJOUOAJoCyAOIA9BAiA7IDsgDUH4AGogDUHoAGoQPyAOIA9BACBFIDsgDUHkAGogDUHQAGoQPyAOIA0qAmggDSoCUCAPIA0oAnggDSgCZCA7IEVBAEEFIAogIiAMED0aIA4gEkECdEH8JWooAgBBAnRqKgKUAyEGIBEgEiAPIDsQOCARIBIgDxAwkiARIBIgDyA7EDcgESASIA8QL5KSIgcgBiAGIAddGyAHIAYgBiAGXBsgBiAGWyAHIAdbcRsLIgc4ApwBCyAOIAw2ApgBCyA9IAcgESATQQEgOxAiIBEgE0EBIDsQIZKSkiE9CyANQYgBahAuIA0oAowBIgkgDSgCiAEiDnINAAsLIA0oApABIgkEQANAIAkoAgAhDiAJECcgDiIJDQALCyA7IEUgGRshByA9QwAAAACSIQYgC0ECTwRAIBQgEyAHEE0gC0EBa7OUIAaSIQYLIEIgQ5IhPiAFIAQgGRshGiBHIEAgGRshTSBAIEcgGRshSSANQdAAaiAAEDJBACAcIAYgB14iCxsgHCAcQQJGGyAcICdBgIADcSIfGyEeIBQgFiBFIDsgGRsiRBBNIU8gDSgCVCIRIA0oAlAiCXIEQEEBQQIgRCBEXCIpGyEtIAtFIBxBAUZyIS4gE0ECSSEZIABB8gBqIS8gAEH8AGohMCATQQJ0IgtB7CVqITEgC0HcJWohMiAWQQJ0Ig5B7CVqIRwgDkHcJWohICALQfwlaiEkIA5B/CVqISMgGkEARyIzIAhyITQgGkUiNSAIQQFzcSE2IBogH3JFITcgDUHwAGohOCANQYABaiEnQYECIBNBA3R2Qf8BcSEoIBpBAWtBAkkhOQNAIA1BADYCgAEgDUIANwN4AkAgACgC7AMiCyAAKALoAyIORg0AIAsgDmsiC0EASA0DIA1BiAFqIAtBAnVBACAnEEohECANKAKMASANKAJ8IA0oAngiC2siDmsgCyAOEDMhDiANIA0oAngiCzYCjAEgDSAONgJ4IA0pA5ABIVYgDSANKAJ8Ig42ApABIA0oAoABIRIgDSBWNwJ8IA0gEjYClAEgECALNgIAIAsgDkcEQCANIA4gCyAOa0EDakF8cWo2ApABCyALRQ0AIAsQJwsgFC0AACIOQQJ2QQNxIQsCQAJAIA5BA3EiDiAsIA4bIhJBAkcNAEEDIRACQCALQQJrDgICAAELQQIhEAwBCyALIRALIAAvABUhCyAUIBAgBxBNIT8CQCAJIBFyRQRAQwAAAAAhQ0EAIRFDAAAAACFCQwAAAAAhQUEAIRUMAQsgC0GAgANxISUgEEECSSEYIBBBAnQiC0HsJWohISALQdwlaiEqQQAhFUMAAAAAIUEgESEOQwAAAAAhQkMAAAAAIUNBACEXQwAAAAAhPQNAIAkoAuwDIAkoAugDIglrQQJ1IA5NDQQCQCAJIA5BAnRqKAIAIgkvABUgCS0AF0EQdHIiC0GAgDBxQYCAEEYgC0GA4ABxQYDAAEZyDQAgDUGIAWoiESAJQRRqIgsgKigCACADECggDS0AjAEhJiARIAsgISgCACADECggDS0AjAEhESAJIBs2AtwDIBUgJkEDRmohFSARQQNGIREgCyAQQQEgOxAiIUsgCyAQQQEgOxAhIU4gCSAXIAkgFxsiF0YhJiAJKgKcASE8IAsgEiAYIEkgQBA1IToCQCALIBIgGCBJIEAQLSIGQwAAAABgIAYgPF1xDQAgOkMAAAAAYEUEQCA8IQYMAQsgOiA8IDogPF4bIQYLIBEgFWohFQJAICVFQwAAAAAgPyAmGyI8IEsgTpIiOiA9IAaSkpIgB15Fcg0AIA0oAnggDSgCfEYNACAOIREMAwsgCRB5BEAgQiAJEDuSIUIgQyAJEEAgCSoCnAGUkyFDCyBBIDwgOiAGkpIiBpIhQSA9IAaSIT0gDSgCfCILIA0oAoABRwRAIAsgCTYCACANIAtBBGo2AnwMAQsgCyANKAJ4ayILQQJ1IhFBAWoiDkGAgICABE8NBSANQYgBakH/////AyALQQF1IiYgDiAOICZJGyALQfz///8HTxsgESAnEEohDiANKAKQASAJNgIAIA0gDSgCkAFBBGo2ApABIA0oAowBIA0oAnwgDSgCeCIJayILayAJIAsQMyELIA0gDSgCeCIJNgKMASANIAs2AnggDSkDkAEhViANIA0oAnwiCzYCkAEgDSgCgAEhESANIFY3AnwgDSARNgKUASAOIAk2AgAgCSALRwRAIA0gCyAJIAtrQQNqQXxxajYCkAELIAlFDQAgCRAnCyANQQA2AnAgDSANKQNQNwNoIDggDSgCWBA8IA1B0ABqEC4gDSgCcCIJBEADQCAJKAIAIQsgCRAnIAsiCQ0ACwtBACERIA1BADYCcCANKAJUIg4gDSgCUCIJcg0ACwtDAACAPyBCIEJDAACAP10bIEIgQkMAAAAAXhshPCANKAJ8IRcgDSgCeCEJAn0CQAJ9AkACQAJAIB5FDQAgFCAPQQAgQCBAEDUhBiAUIA9BACBAIEAQLSE6IBQgD0EBIEcgQBA1IT8gFCAPQQEgRyBAEC0hPSAGID8gE0EBSyILGyBKkyIGIAZbIAYgQV5xDQEgOiA9IAsbIEqTIgYgBlsgBiBBXXENASAAKAL0Ay0AFEEBcQ0AIEEgPEMAAAAAWw0DGiAAEDsiBiAGXA0CIEEgABA7QwAAAABbDQMaDAILIAchBgsgBiAGWw0CIAYhBwsgBwshBiBBjEMAAAAAIEFDAAAAAF0bIT8gBgwBCyAGIEGTIT8gBgshByA2RQRAAkAgCSAXRgRAQwAAAAAhQQwBC0MAAIA/IEMgQ0MAAIA/XRsgQyBDQwAAAABeGyE9QwAAAAAhQSAJIQ4DQCAOKAIAIgsqApwBITogC0EUaiIQIA8gGSBJIEAQNSFCAkAgECAPIBkgSSBAEC0iBkMAAAAAYCAGIDpdcQ0AIEJDAAAAAGBFBEAgOiEGDAELIEIgOiA6IEJdGyEGCwJAID9DAAAAAF0EQCAGIAsQQIyUIjpDAAAAAF4gOkMAAAAAXXJFDQEgCyATIA8gPyA9lSA6lCAGkiJCIAcgOxAlITogQiBCXCA6IDpcciA6IEJbcg0BIEEgOiAGk5IhQSALEEAgCyoCnAGUID2SIT0MAQsgP0MAAAAAXkUNACALEDsiQkMAAAAAXiBCQwAAAABdckUNACALIBMgDyA/IDyVIEKUIAaSIkMgByA7ECUhOiBDIENcIDogOlxyIDogQ1tyDQAgPCBCkyE8IEEgOiAGk5IhQQsgDkEEaiIOIBdHDQALID8gQZMiQiA9lSFLIEIgPJUhTiAALwAVQYCAA3FFIC5yISVDAAAAACFBIAkhCwNAIAsoAgAiDioCnAEhPCAOQRRqIhggDyAZIEkgQBA1IToCQCAYIA8gGSBJIEAQLSIGQwAAAABgIAYgPF1xDQAgOkMAAAAAYEUEQCA8IQYMAQsgOiA8IDogPF4bIQYLAn0gDiATIA8CfSBCQwAAAABdBEAgBiAGIA4QQIyUIjxDAAAAAFsNAhogBiA8kiA9QwAAAABbDQEaIEsgPJQgBpIMAQsgBiBCQwAAAABeRQ0BGiAGIA4QOyI8QwAAAABeIDxDAAAAAF1yRQ0BGiBOIDyUIAaSCyAHIDsQJQshQyAYIBNBASA7ECIhPCAYIBNBASA7ECEhOiAYIBZBASA7ECIhUiAYIBZBASA7ECEhUyANIEMgPCA6kiJUkiJVOAJoIA1BADYCYCBSIFOSITwCQCAOQfwAaiIQIA4vAXoQICI6IDpbBEAgECAOLwF6ECAhOiANQQA2AmQgDSA8IFUgVJMiPCA6lCA8IDqVIBkbkjgCeAwBCyAjKAIAIRACQCApDQAgDiAQQQN0aiIhKgL4AyE6QQAhEgJAAkACQCAhLQD8A0EBaw4CAQACCyBEIDqUQwrXIzyUIToLIDogOlwNACA6QwAAAABgIRILICUgNSASQQFzcXFFDQAgDi8AFkEPcSISBH8gEgUgAC0AFUEEdgtBBEcNACANQYgBaiAYICAoAgAgDxAoIA0tAIwBQQNGDQAgDUGIAWogGCAcKAIAIA8QKCANLQCMAUEDRg0AIA1BADYCZCANIEQ4AngMAQsgDkH4A2oiEiAQQQN0aiIQKgIAIToCQAJAAkACQCAQLQAEQQFrDgIBAAILIEQgOpRDCtcjPJQhOgsgOkMAAAAAYA0BCyANIC02AmQgDSBEOAJ4DAELAkACfwJAAkACQCAWQQJrDgICAAELIDwgDiAPQQAgRCA7EDGSITpBAAwCC0EBIRAgDSA8IA4gD0EBIEQgOxAxkiI6OAJ4IBNBAU0NDAwCCyA8IA4gD0EAIEQgOxAxkiE6QQALIRAgDSA6OAJ4CyANIDMgEiAQQQN0ajEABEIghkKAgICAIFFxIDogOlxyNgJkCyAOIA8gEyAHIDsgDUHgAGogDUHoAGoQPyAOIA8gFiBEIDsgDUHkAGogDUH4AGoQPyAOICMoAgBBA3RqIhAqAvgDIToCQAJAAkACQCAQLQD8A0EBaw4CAQACCyBEIDqUQwrXIzyUIToLQQEhECA6QwAAAABgDQELQQEhECAOLwAWQQ9xIhIEfyASBSAALQAVQQR2C0EERw0AIA1BiAFqIBggICgCACAPECggDS0AjAFBA0YNACANQYgBaiAYIBwoAgAgDxAoIA0tAIwBQQNGIRALIA4gDSoCaCI8IA0qAngiOiATQQFLIhIbIDogPCASGyAALQCIA0EDcSANKAJgIhggDSgCZCIhIBIbICEgGCASGyA7IEUgCCAQcSIQQQRBByAQGyAKICIgDBA9GiBBIEMgBpOSIUEgAAJ/IAAtAIgDIhBBBHFFBEBBACAOLQCIA0EEcUUNARoLQQQLIBBB+wFxcjoAiAMgC0EEaiILIBdHDQALCyA/IEGTIT8LIAAgAC0AiAMiC0H7AXFBBCA/QwAAAABdQQJ0IAtBBHFBAnYbcjoAiAMgFCATIA8gQBBgIBQgEyAPEEuSITogFCATIA8gQBB/IBQgEyAPEFKSIUsgFCATIAcQTSFCAn8CQAJ9ID9DAAAAAF5FIB5BAkdyRQRAIA1BiAFqIDAgLyAkKAIAQQF0ai8BABAfAkAgDS0AjAEEQCAUIA8gKCBJIEAQNSIGIAZbDQELQwAAAAAMAgtDAAAAACAUIA8gKCBJIEAQNSA6kyBLkyAHID+TkyI/QwAAAABeRQ0BGgsgP0MAAAAAYEUNASA/CyE8IBQtAABBBHZBB3EMAQsgPyE8IBQtAABBBHZBB3EiC0EAIAtBA2tBA08bCyELQwAAAAAhBgJAAkAgFQ0AQwAAAAAhPQJAAkACQAJAAkAgC0EBaw4FAAECBAMGCyA8QwAAAD+UIT0MBQsgPCE9DAQLIBcgCWsiC0EFSQ0CIEIgPCALQQJ1QQFrs5WSIUIMAgsgQiA8IBcgCWtBAnVBAWqzlSI9kiFCDAILIDxDAAAAP5QgFyAJa0ECdbOVIj0gPZIgQpIhQgwBC0MAAAAAIT0LIDogPZIhPSAAEHwhEgJAIAkgF0YiGARAQwAAAAAhP0MAAAAAIToMAQsgF0EEayElIDwgFbOVIU4gMigCACEhQwAAAAAhOkMAAAAAIT8gCSELA0AgDUGIAWogCygCACIOQRRqIhAgISAPECggPUMAAACAIE5DAAAAgCA8QwAAAABeGyJBIA0tAIwBQQNHG5IhPSAIBEACfwJAAkACQAJAIBNBAWsOAwECAwALQQEhFSAOQaADagwDC0EDIRUgDkGoA2oMAgtBACEVIA5BnANqDAELQQIhFSAOQaQDagshKiAOIBVBAnRqICoqAgAgPZI4ApwDCyAlKAIAIRUgDUGIAWogECAxKAIAIA8QKCA9QwAAAIAgQiAOIBVGG5JDAAAAgCBBIA0tAIwBQQNHG5IhPQJAIDRFBEAgPSAQIBNBASA7ECIgECATQQEgOxAhkiAOKgKcAZKSIT0gRCEGDAELIA4gEyA7EF0gPZIhPSASBEAgDhBOIUEgEEEAIA8gOxBBIUMgDioCmAMgEEEAQQEgOxAiIBBBAEEBIDsQIZKSIEEgQ5IiQZMiQyA/ID8gQ10bIEMgPyA/ID9cGyA/ID9bIEMgQ1txGyE/IEEgOiA6IEFdGyBBIDogOiA6XBsgOiA6WyBBIEFbcRshOgwBCyAOIBYgOxBdIkEgBiAGIEFdGyBBIAYgBiAGXBsgBiAGWyBBIEFbcRshBgsgC0EEaiILIBdHDQALCyA/IDqSIAYgEhshQQJ9IDkEQCAAIBYgDyBGIEGSIE0gQBAlIEaTDAELIEQgQSA3GyFBIEQLIT8gH0UEQCAAIBYgDyBGIEGSIE0gQBAlIEaTIUELIEsgPZIhPAJAIAhFDQAgCSELIBgNAANAIAsoAgAiFS8AFkEPcSIORQRAIAAtABVBBHYhDgsCQAJAAkACQCAOQQRrDgIAAQILIA1BiAFqIBVBFGoiECAgKAIAIA8QKEEEIQ4gDS0AjAFBA0YNASANQYgBaiAQIBwoAgAgDxAoIA0tAIwBQQNGDQEgFSAjKAIAQQN0aiIOKgL4AyE9AkACQAJAIA4tAPwDQQFrDgIBAAILIEQgPZRDCtcjPJQhPQsgPiEGID1DAAAAAGANAwsgFSAkKAIAQQJ0aioClAMhBiANIBVB/ABqIg4gFS8BehAgIjogOlsEfSAQIBZBASA7ECIgECAWQQEgOxAhkiAGIA4gFS8BehAgIjqUIAYgOpUgGRuSBSBBCzgCeCANIAYgECATQQEgOxAiIBAgE0EBIDsQIZKSOAKIASANQQA2AmggDUEANgJkIBUgDyATIAcgOyANQegAaiANQYgBahA/IBUgDyAWIEQgOyANQeQAaiANQfgAahA/IA0qAngiOiANKgKIASI9IBNBAUsiGCIOGyEGIB9BAEcgAC8AFUEPcUEER3EiECAZcSA9IDogDhsiOiA6XHIhDiAVIDogBiAPIA4gECAYcSAGIAZcciA7IEVBAUECIAogIiAMED0aID4hBgwCC0EFQQEgFC0AAEEIcRshDgsgFSAWIDsQXSEGIA1BiAFqIBVBFGoiECAgKAIAIhggDxAoID8gBpMhOgJAIA0tAIwBQQNHBEAgHCgCACESDAELIA1BiAFqIBAgHCgCACISIA8QKCANLQCMAUEDRw0AID4gOkMAAAA/lCIGQwAAAAAgBkMAAAAAXhuSIQYMAQsgDUGIAWogECASIA8QKCA+IQYgDS0AjAFBA0YNACANQYgBaiAQIBggDxAoIA0tAIwBQQNGBEAgPiA6QwAAAAAgOkMAAAAAXhuSIQYMAQsCQAJAIA5BAWsOAgIAAQsgPiA6QwAAAD+UkiEGDAELID4gOpIhBgsCfwJAAkACQAJAIBZBAWsOAwECAwALQQEhECAVQaADagwDC0EDIRAgFUGoA2oMAgtBACEQIBVBnANqDAELQQIhECAVQaQDagshDiAVIBBBAnRqIAYgTCAOKgIAkpI4ApwDIAtBBGoiCyAXRw0ACwsgCQRAIAkQJwsgPCBIIDwgSF4bIDwgSCBIIEhcGyBIIEhbIDwgPFtxGyFIIEwgT0MAAAAAIBsbIEGSkiFMIBtBAWohGyANKAJQIgkgEXINAAsLAkAgCEUNACAfRQRAIAAQfEUNAQsgACAWIA8CfSBGIESSIBpFDQAaIAAgFkECdEH8JWooAgBBA3RqIgkqAvgDIQYCQAJAAkAgCS0A/ANBAWsOAgEAAgsgTSAGlEMK1yM8lCEGCyAGQwAAAABgRQ0AIAAgD0GBAiAWQQN0dkEBcSBNIEAQMQwBCyBGIEySCyBHIEAQJSEGQwAAAAAhPCAALwAVQQ9xIQkCQAJAAkACQAJAAkACQAJAAkAgBiBGkyBMkyIGQwAAAABgRQRAQwAAAAAhQyAJQQJrDgICAQcLQwAAAAAhQyAJQQJrDgcBAAUGBAIDBgsgPiAGkiE+DAULID4gBkMAAAA/lJIhPgwECyAGIBuzIjqVITwgPiAGIDogOpKVkiE+DAMLID4gBiAbQQFqs5UiPJIhPgwCCyAbQQJJBEAMAgsgDUGIAWogABAyIAYgG0EBa7OVITwMAgsgBiAbs5UhQwsgDUGIAWogABAyIBtFDQELIBZBAnQiCUHcJWohECAJQfwlaiERIA1BOGohGCANQcgAaiEZIA1B8ABqIRUgDUGQAWohHCANQYABaiEfQQAhEgNAIA1BADYCgAEgDSANKQOIATcDeCAfIA0oApABEDwgDUEANgJwIA0gDSkDeCJWNwNoIBUgDSgCgAEiCxA8IA0oAmwhCQJAAkAgDSgCaCIOBEBDAAAAACE6QwAAAAAhP0MAAAAAIQYMAQtDAAAAACE6QwAAAAAhP0MAAAAAIQYgCUUNAQsDQCAOKALsAyAOKALoAyIOa0ECdSAJTQ0FAkAgDiAJQQJ0aigCACIJLwAVIAktABdBEHRyIhdBgIAwcUGAgBBGIBdBgOAAcUGAwABGcg0AIAkoAtwDIBJHDQIgCUEUaiEOIAkgESgCAEECdGoqApQDIj1DAAAAAGAEfyA9IA4gFkEBIDsQIiAOIBZBASA7ECGSkiI9IAYgBiA9XRsgPSAGIAYgBlwbIAYgBlsgPSA9W3EbIQYgCS0AFgUgF0EIdgtBD3EiFwR/IBcFIAAtABVBBHYLQQVHDQAgFC0AAEEIcUUNACAJEE4gDkEAIA8gOxBBkiI9ID8gPSA/XhsgPSA/ID8gP1wbID8gP1sgPSA9W3EbIj8gCSoCmAMgDkEAQQEgOxAiIA5BAEEBIDsQIZKSID2TIj0gOiA6ID1dGyA9IDogOiA6XBsgOiA6WyA9ID1bcRsiOpIiPSAGIAYgPV0bID0gBiAGIAZcGyAGIAZbID0gPVtxGyEGCyANQQA2AkggDSANKQNoNwNAIBkgDSgCcBA8IA1B6ABqEC4gDSgCSCIJBEADQCAJKAIAIQ4gCRAnIA4iCQ0ACwsgDUEANgJIIA0oAmwiCSANKAJoIg5yDQALCyANIA0pA2g3A4gBIBwgDSgCcBB1IA0gVjcDaCAVIAsQdSA+IE9DAAAAACASG5IhPiBDIAaSIT0gDSgCbCEJAkAgDSgCaCIOIA0oAogBRgRAIAkgDSgCjAFGDQELID4gP5IhQiA+ID2SIUsgPCA9kiEGA0AgDigC7AMgDigC6AMiDmtBAnUgCU0NBQJAIA4gCUECdGooAgAiCS8AFSAJLQAXQRB0ciIXQYCAMHFBgIAQRiAXQYDgAHFBgMAARnINACAJQRRqIQ4CQAJAAkACQAJAAkAgF0EIdkEPcSIXBH8gFwUgAC0AFUEEdgtBAWsOBQEDAgQABgsgFC0AAEEIcQ0ECyAOIBYgDyA7EFEhOiAJIBAoAgBBAnRqID4gOpI4ApwDDAQLIA4gFiAPIDsQYiE/AkACQAJAAkAgFkECaw4CAgABCyAJKgKUAyE6QQIhDgwCC0EBIQ4gCSoCmAMhOgJAIBYOAgIADwtBAyEODAELIAkqApQDITpBACEOCyAJIA5BAnRqIEsgP5MgOpM4ApwDDAMLAkACQAJAAkAgFkECaw4CAgABCyAJKgKUAyE/QQIhDgwCC0EBIQ4gCSoCmAMhPwJAIBYOAgIADgtBAyEODAELIAkqApQDIT9BACEOCyAJIA5BAnRqID4gPSA/k0MAAAA/lJI4ApwDDAILIA4gFiAPIDsQQSE6IAkgECgCAEECdGogPiA6kjgCnAMgCSARKAIAQQN0aiIXKgL4AyE/AkACQAJAIBctAPwDQQFrDgIBAAILIEQgP5RDCtcjPJQhPwsgP0MAAAAAYA0CCwJAAkACfSATQQFNBEAgCSoCmAMgDiAWQQEgOxAiIA4gFkEBIDsQIZKSITogBgwBCyAGITogCSoClAMgDiATQQEgOxAiIA4gE0EBIDsQIZKSCyI/ID9cIAkqApQDIkEgQVxyRQRAID8gQZOLQxe30ThdDQEMAgsgPyA/WyBBIEFbcg0BCyAJKgKYAyJBIEFcIg4gOiA6XHJFBEAgOiBBk4tDF7fROF1FDQEMAwsgOiA6Ww0AIA4NAgsgCSA/IDogD0EAQQAgOyBFQQFBAyAKICIgDBA9GgwBCyAJIEIgCRBOkyAOQQAgDyBEEFGSOAKgAwsgDUEANgI4IA0gDSkDaDcDMCAYIA0oAnAQPCANQegAahAuIA0oAjgiCQRAA0AgCSgCACEOIAkQJyAOIgkNAAsLIA1BADYCOCANKAJsIQkgDSgCaCIOIA0oAogBRw0AIAkgDSgCjAFHDQALCyANKAJwIgkEQANAIAkoAgAhDiAJECcgDiIJDQALCyALBEADQCALKAIAIQkgCxAnIAkiCw0ACwsgPCA+kiA9kiE+IBJBAWoiEiAbRw0ACwsgDSgCkAEiCUUNAANAIAkoAgAhCyAJECcgCyIJDQALCyAAQZQDaiIQIABBAiAPIFAgQCBAECU4AgAgAEGYA2oiESAAQQAgDyBRIEcgQBAlOAIAAkAgEEGBAiATQQN0dkEBcUECdGoCfQJAIB5BAUcEQCAALQAXQQNxIglBAkYgHkECR3INAQsgACATIA8gSCBJIEAQJQwBCyAeQQJHIAlBAkdyDQEgSiAAIA8gEyBIIEkgQBB0Ij4gSiAHkiIGIAYgPl4bID4gBiAGIAZcGyAGIAZbID4gPltxGyIGIAYgSl0bIEogBiAGIAZcGyAGIAZbIEogSltxGws4AgALAkAgEEGBAiAWQQN0dkEBcUECdGoCfQJAIBpBAUcEQCAaQQJHIgkgAC0AF0EDcSILQQJGcg0BCyAAIBYgDyBGIEySIE0gQBAlDAELIAkgC0ECR3INASBGIAAgDyAWIEYgTJIgTSBAEHQiByBGIESSIgYgBiAHXhsgByAGIAYgBlwbIAYgBlsgByAHW3EbIgYgBiBGXRsgRiAGIAYgBlwbIAYgBlsgRiBGW3EbCzgCAAsCQCAIRQ0AAkAgAC8AFUGAgANxQYCAAkcNACANQYgBaiAAEDIDQCANKAKMASIJIA0oAogBIgtyRQRAIA0oApABIglFDQIDQCAJKAIAIQsgCRAnIAsiCQ0ACwwCCyALKALsAyALKALoAyILa0ECdSAJTQ0DIAsgCUECdGooAgAiCS8AFUGA4ABxQYDAAEcEQCAJAn8CQAJAAkAgFkECaw4CAAECCyAJQZQDaiEOIBAqAgAgCSoCnAOTIQZBAAwCCyAJQZQDaiEOIBAqAgAgCSoCpAOTIQZBAgwBCyARKgIAIQYCQAJAIBYOAgABCgsgCUGYA2ohDiAGIAkqAqADkyEGQQEMAQsgCUGYA2ohDiAGIAkqAqgDkyEGQQMLQQJ0aiAGIA4qAgCTOAKcAwsgDUGIAWoQLgwACwALAkAgEyAWckEBcUUNACAWQQFxIRQgE0EBcSEVIA1BiAFqIAAQMgNAIA0oAowBIgkgDSgCiAEiC3JFBEAgDSgCkAEiCUUNAgNAIAkoAgAhCyAJECcgCyIJDQALDAILIAsoAuwDIAsoAugDIgtrQQJ1IAlNDQMCQCALIAlBAnRqKAIAIgkvABUgCS0AF0EQdHIiC0GAgDBxQYCAEEYgC0GA4ABxQYDAAEZyDQAgFQRAAn8CfwJAAkACQCATQQFrDgMAAQINCyAJQZgDaiEOIAlBqANqIQtBASESIBEMAwsgCUGUA2ohDkECIRIgCUGcA2oMAQsgCUGUA2ohDkEAIRIgCUGkA2oLIQsgEAshGyAJIBJBAnRqIBsqAgAgDioCAJMgCyoCAJM4ApwDCyAURQ0AAn8CfwJAAkACQCAWQQFrDgMAAQIMCyAJQZgDaiELIAlBqANqIRJBASEXIBEMAwsgCUGUA2ohCyAJQZwDaiESQQIMAQsgCUGUA2ohCyAJQaQDaiESQQALIRcgEAshDiAJIBdBAnRqIA4qAgAgCyoCAJMgEioCAJM4ApwDCyANQYgBahAuDAALAAsgAC8AFUGA4ABxICJBAUZyRQRAIAAtAABBCHFFDQELIAAgACAeIAQgE0EBSxsgDyAKICIgDEMAAAAAQwAAAAAgOyBFEH4aCyANKAJYIglFDQIDQCAJKAIAIQsgCRAnIAsiCQ0ACwwCCxACAAsgABBeCyANQaABaiQADAELECQACyAAIAM6AKgBIAAgACgC9AMoAgw2AqQBIB0NACAKIAooAggiAyAAKAKsASIOQQFqIgkgAyAJSxs2AgggDkEIRgRAIABBADYCrAFBACEOCyAIBH8gAEHwAmoFIAAgDkEBajYCrAEgACAOQRhsakGwAWoLIgMgBTYCDCADIAQ2AgggAyACOAIEIAMgATgCACADIAAqApQDOAIQIAMgACoCmAM4AhRBACEdCyAIBEAgACAAKQKUAzcCjAMgACAALQAAIgNBAXIiBEH7AXEgBCADQQRxGzoAAAsgACAMNgKgASArIB1Fcgs1AQF/IAEgACgCBCICQQF1aiEBIAAoAgAhACABIAJBAXEEfyABKAIAIABqKAIABSAACxECAAt9ACAAQRRqIgAgAUGBAiACQQN0dkH/AXEgAyAEEC0gACACQQEgBBAiIAAgAkEBIAQQIZKSIQQCQAJAAkACQCAFKAIADgMAAQADCyAGKgIAIgMgAyAEIAMgBF0bIAQgBFwbIQQMAQsgBCAEXA0BIAVBAjYCAAsgBiAEOAIACwuMAQIBfwF9IAAoAuQDRQRAQwAAAAAPCyAAQfwAaiIBIAAvARwQICICIAJbBEAgASAALwEcECAPCwJAIAAoAvQDLQAIQQFxDQAgASAALwEYECAiAiACXA0AIAEgAC8BGBAgQwAAAABdRQ0AIAEgAC8BGBAgjA8LQwAAgD9DAAAAACAAKAL0Ay0ACEEBcRsLcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEChDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwtHAQF/IAIvAAYiA0EHcQRAIAAgAUHoAGogAxAfDwsgAUHoAGohASACLwAOIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHwtHAQF/IAIvAAIiA0EHcQRAIAAgAUHoAGogAxAfDwsgAUHoAGohASACLwAOIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHwt7AAJAAkACQAJAIANBAWsOAgABAgsgAi8ACiIDQQdxRQ0BDAILIAIvAAgiA0EHcUUNAAwBCyACLwAEIgNBB3EEQAwBCyABQegAaiEBIAIvAAwiA0EHcQRAIAAgASADEB8PCyAAIAEgAi8AEBAfDwsgACABQegAaiADEB8LewACQAJAAkACQCADQQFrDgIAAQILIAIvAAgiA0EHcUUNAQwCCyACLwAKIgNBB3FFDQAMAQsgAi8AACIDQQdxBEAMAQsgAUHoAGohASACLwAMIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHw8LIAAgAUHoAGogAxAfC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQe4AaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAuFAQIDfwF+AkAgAEKAgICAEFQEQCAAIQUMAQsDQCABQQFrIgEgAEIKgCIFQvYBfiAAfKdBMHI6AAAgAEL/////nwFWIQIgBSEAIAINAAsLIAWnIgIEQANAIAFBAWsiASACQQpuIgNB9gFsIAJqQTByOgAAIAJBCUshBCADIQIgBA0ACwsgAQs3AQJ/QQQQHiICIAE2AgBBBBAeIgMgATYCAEHBOyAAQeI7QfooQb8BIAJB4jtB/ihBwAEgAxAHCw8AIAAgASACQQFBAhCLAQteAQF/IABBADYCDCAAIAM2AhACQCABBEAgAUGAgICABE8NASABQQJ0EB4hBAsgACAENgIAIAAgBCACQQJ0aiICNgIIIAAgBCABQQJ0ajYCDCAAIAI2AgQgAA8LEFgAC3kCAX8BfSMAQRBrIgMkACADQQhqIAAgAUECdEHcJWooAgAgAhBTQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIQwAAAACUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsLnAoBC38jAEEQayIIJAAgASABLwAAQXhxIANyIgM7AAACQAJAAkACQAJAAkACQAJAAkACQCADQQhxBEAgA0H//wNxIgZBBHYhBCAGQT9NBH8gACAEQQJ0akEEagUgBEEEayIEIAAoAhgiACgCBCAAKAIAIgBrQQJ1Tw0CIAAgBEECdGoLIAI4AgAMCgsCfyACi0MAAABPXQRAIAKoDAELQYCAgIB4CyIEQf8PakH+H0sgBLIgAlxyRQRAIANBD3FBACAEa0GAEHIgBCACQwAAAABdG0EEdHIhAwwKCyAAIAAvAQAiC0EBajsBACALQYAgTw0DIAtBA00EQCAAIAtBAnRqIAI4AgQMCQsgACgCGCIDRQRAQRgQHiIDQgA3AgAgA0IANwIQIANCADcCCCAAIAM2AhgLAkAgAygCBCIEIAMoAghHBEAgBCACOAIAIAMgBEEEajYCBAwBCyAEIAMoAgAiB2siBEECdSIJQQFqIgZBgICAgARPDQECf0H/////AyAEQQF1IgUgBiAFIAZLGyAEQfz///8HTxsiBkUEQEEAIQUgCQwBCyAGQYCAgIAETw0GIAZBAnQQHiEFIAMoAgQgAygCACIHayIEQQJ1CyEKIAUgCUECdGoiCSACOAIAIAkgCkECdGsgByAEEDMhByADIAUgBkECdGo2AgggAyAJQQRqNgIEIAMoAgAhBCADIAc2AgAgBEUNACAEECMLIAAoAhgiBigCECIDIAYoAhQiAEEFdEcNByADQQFqQQBIDQAgA0H+////A0sNASADIABBBnQiACADQWBxQSBqIgQgACAESxsiAE8NByAAQQBODQILEAIAC0H/////ByEAIANB/////wdPDQULIAhBADYCCCAIQgA3AwAgCCAAEJ8BIAYoAgwhBCAIIAgoAgQiByAGKAIQIgBBH3FqIABBYHFqIgM2AgQgB0UEQCADQQFrIQUMAwsgA0EBayIFIAdBAWtzQR9LDQIgCCgCACEKDAMLQZUlQeEXQSJB3BcQCwALEFgACyAIKAIAIgogBUEFdkEAIANBIU8bQQJ0akEANgIACyAKIAdBA3ZB/P///wFxaiEDAkAgB0EfcSIHRQRAIABBAEwNASAAQSBtIQUgAEEfakE/TwRAIAMgBCAFQQJ0EDMaCyAAIAVBBXRrIgBBAEwNASADIAVBAnQiBWoiAyADKAIAQX9BICAAa3YiAEF/c3EgBCAFaigCACAAcXI2AgAMAQsgAEEATA0AQX8gB3QhDEEgIAdrIQkgAEEgTgRAIAxBf3MhDSADKAIAIQUDQCADIAUgDXEgBCgCACIFIAd0cjYCACADIAMoAgQgDHEgBSAJdnIiBTYCBCAEQQRqIQQgA0EEaiEDIABBP0shDiAAQSBrIQAgDg0ACyAAQQBMDQELIAMgAygCAEF/IAkgCSAAIAAgCUobIgVrdiAMcUF/c3EgBCgCAEF/QSAgAGt2cSIEIAd0cjYCACAAIAVrIgBBAEwNACADIAUgB2pBA3ZB/P///wFxaiIDIAMoAgBBf0EgIABrdkF/c3EgBCAFdnI2AgALIAYoAgwhACAGIAo2AgwgBiAIKAIEIgM2AhAgBiAIKAIINgIUIABFDQAgABAjIAYoAhAhAwsgBiADQQFqNgIQIAYoAgwgA0EDdkH8////AXFqIgAgACgCAEF+IAN3cTYCACABLwAAIQMLIANBB3EgC0EEdHJBCHIhAwsgASADOwAAIAhBEGokAAuPAQIBfwF9IwBBEGsiAyQAIANBCGogAEHoAGogAEHUAEHWACABQf4BcUECRhtqLwEAIgEgAC8BWCABQQdxGxAfQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIIAKUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsL2AICBH8BfSMAQSBrIgMkAAJAIAAoAgwiAQRAIAAgACoClAMgACoCmAMgAREnACIFIAVbDQEgA0GqHjYCACAAQQVB2CUgAxAsECQACyADQRBqIAAQMgJAIAMoAhAiAiADKAIUIgFyRQ0AAkADQCABIAIoAuwDIAIoAugDIgJrQQJ1SQRAIAIgAUECdGooAgAiASgC3AMNAyABLwAVIAEtABdBEHRyIgJBgOAAcUGAwABHBEAgAkEIdkEPcSICBH8gAgUgAC0AFUEEdgtBBUYEQCAALQAUQQhxDQQLIAEtAABBAnENAyAEIAEgBBshBAsgA0EQahAuIAMoAhQiASADKAIQIgJyDQEMAwsLEAIACyABIQQLIAMoAhgiAQRAA0AgASgCACECIAEQIyACIgENAAsLIARFBEAgACoCmAMhBQwBCyAEEE4gBCoCoAOSIQULIANBIGokACAFC6EDAQh/AkAgACgC6AMiBSAAKALsAyIHRwRAA0AgACAFKAIAIgIoAuQDRwRAAkAgACgC9AMoAgAiAQRAIAIgACAGIAERBgAiAQ0BC0GIBBAeIgEgAigCEDYCECABIAIpAgg3AgggASACKQIANwIAIAFBFGogAkEUakHoABArGiABQgA3AoABIAFB/ABqIgNBADsBACABQgA3AogBIAFCADcCkAEgAyACQfwAahCgASABQZgBaiACQZgBakHQAhArGiABQQA2AvADIAFCADcC6AMgAigC7AMiAyACKALoAyIERwRAIAMgBGsiBEEASA0FIAEgBBAeIgM2AuwDIAEgAzYC6AMgASADIARqNgLwAyACKALoAyIEIAIoAuwDIghHBEADQCADIAQoAgA2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASADNgLsAwsgASACKQL0AzcC9AMgASACKAKEBDYChAQgASACKQL8AzcC/AMgAUEANgLkAwsgBSABNgIAIAEgADYC5AMLIAZBAWohBiAFQQRqIgUgB0cNAAsLDwsQAgALUAACQAJAAkACQAJAIAIOBAQAAQIDCyAAIAEgAUEwahBDDwsgACABIAFBMGogAxBEDwsgACABIAFBMGoQQg8LECQACyAAIAEgAUEwaiADEEULcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt5AgF/AX0jAEEQayIDJAAgA0EIaiAAIAFBAnRB7CVqKAIAIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC1QAAkACQAJAAkACQCACDgQEAAECAwsgACABIAFBwgBqEEMPCyAAIAEgAUHCAGogAxBEDwsgACABIAFBwgBqEEIPCxAkAAsgACABIAFBwgBqIAMQRQsvACAAIAJFQQF0IgIgASADEGAgACACIAEQS5IgACACIAEgAxB/IAAgAiABEFKSkgvOAQIDfwJ9IwBBEGsiAyQAQQEhBCADQQhqIABB/ABqIgUgACABQQF0akH2AGoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALzgECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpB8gBqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQACwoAIABBMGtBCkkLBQAQAgALBAAgAAsUACAABEAgACAAKAIAKAIEEQAACwsrAQF/IAAoAgwiAQRAIAEQIwsgACgCACIBBEAgACABNgIEIAEQIwsgABAjC4EEAQN/IwBBEGsiAyQAIABCADcCBCAAQcEgOwAVIABCADcCDCAAQoCAgICAgIACNwIYIAAgAC0AF0HgAXE6ABcgACAALQAAQeABcUEFcjoAACAAIAAtABRBgAFxOgAUIABBIGpBAEHOABAqGiAAQgA3AXIgAEGEgBA2AW4gAEEANgF6IABCADcCgAEgAEIANwKIASAAQgA3ApABIABCADcCoAEgAEKAgICAgICA4P8ANwKYASAAQQA6AKgBIABBrAFqQQBBxAEQKhogAEHwAmohBCAAQbABaiECA0AgAkKAgID8i4CAwL9/NwIQIAJCgYCAgBA3AgggAkKAgID8i4CAwL9/NwIAIAJBGGoiAiAERw0ACyAAQoCAgPyLgIDAv383AvACIABCgICA/IuAgMC/fzcCgAMgAEKBgICAEDcC+AIgAEKAgID+h4CA4P8ANwKUAyAAQoCAgP6HgIDg/wA3AowDIABBiANqIgIgAi0AAEH4AXE6AAAgAEGcA2pBAEHYABAqGiAAQQA6AIQEIABBgICA/gc2AoAEIABBADoA/AMgAEGAgID+BzYC+AMgACABNgL0AyABBEAgAS0ACEEBcQRAIAAgAC0AFEHzAXFBCHI6ABQgACAALwAVQfD/A3FBBHI7ABULIANBEGokACAADwsgA0GiGjYCACADEHIQJAALMwAgACABQQJ0QfwlaigCAEECdGoqApQDIABBFGoiACABQQEgAhAiIAAgAUEBIAIQIZKSC44DAQp/IwBB0AJrIgEkACAAKALoAyIDIAAoAuwDIgVHBEAgAUGMAmohBiABQeABaiEHIAFBIGohCCABQRxqIQkgAUEQaiEEA0AgAygCACICLQAXQRB0QYCAMHFBgIAgRgRAIAFBCGpBAEHEAhAqGiABQYCAgP4HNgIMIARBADoACCAEQgA3AgAgCUEAQcQBECoaIAghAANAIABCgICA/IuAgMC/fzcCECAAQoGAgIAQNwIIIABCgICA/IuAgMC/fzcCACAAQRhqIgAgB0cNAAsgAUKAgID8i4CAwL9/NwPwASABQoGAgIAQNwPoASABQoCAgPyLgIDAv383A+ABIAFCgICA/oeAgOD/ADcChAIgAUKAgID+h4CA4P8ANwL8ASABIAEtAPgBQfgBcToA+AEgBkEAQcAAECoaIAJBmAFqIAFBCGpBxAIQKxogAkIANwKMAyACIAItAAAiAEEBciIKQfsBcSAKIABBBHEbOgAAIAIQTyACEF4LIANBBGoiAyAFRw0ACwsgAUHQAmokAAtMAQF/QQEhAQJAIAAtAB5BB3ENACAALQAiQQdxDQAgAC0ALkEHcQ0AIAAtACpBB3ENACAALQAmQQdxDQAgAC0AKEEHcUEARyEBCyABC3YCAX8BfSMAQRBrIgQkACAEQQhqIAAgAUECdEHcJWooAgAgAhBQQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAACXQwAAAAAgBSAFWxsLogQCBn8CfgJ/QQghBAJAAkAgAEFHSw0AA0BBCCAEIARBCE0bIQRB6DopAwAiBwJ/QQggAEEDakF8cSAAQQhNGyIAQf8ATQRAIABBA3ZBAWsMAQsgAEEdIABnIgFrdkEEcyABQQJ0a0HuAGogAEH/H00NABpBPyAAQR4gAWt2QQJzIAFBAXRrQccAaiIBIAFBP08bCyIDrYgiCFBFBEADQCAIIAh6IgiIIQcCfiADIAinaiIDQQR0IgJB6DJqKAIAIgEgAkHgMmoiBkcEQCABIAQgABBjIgUNBSABKAIEIgUgASgCCDYCCCABKAIIIAU2AgQgASAGNgIIIAEgAkHkMmoiAigCADYCBCACIAE2AgAgASgCBCABNgIIIANBAWohAyAHQgGIDAELQeg6Qeg6KQMAQn4gA62JgzcDACAHQgGFCyIIQgBSDQALQeg6KQMAIQcLAkAgB1BFBEBBPyAHeadrIgZBBHQiAkHoMmooAgAhAQJAIAdCgICAgARUDQBB4wAhAyABIAJB4DJqIgJGDQADQCADRQ0BIAEgBCAAEGMiBQ0FIANBAWshAyABKAIIIgEgAkcNAAsgAiEBCyAAQTBqEGQNASABRQ0EIAEgBkEEdEHgMmoiAkYNBANAIAEgBCAAEGMiBQ0EIAEoAggiASACRw0ACwwECyAAQTBqEGRFDQMLQQAhBSAEIARBAWtxDQEgAEFHTQ0ACwsgBQwBC0EACwtwAgF/AX0jAEEQayIEJAAgBEEIaiAAIAFBAnRB7CVqKAIAIAIQKEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAIAUgBVsbC6ADAQN/IAEgAEEEaiIEakEBa0EAIAFrcSIFIAJqIAAgACgCACIBakEEa00EfyAAKAIEIgMgACgCCDYCCCAAKAIIIAM2AgQgBCAFRwRAIAAgAEEEaygCAEF+cWsiAyAFIARrIgQgAygCAGoiBTYCACAFQXxxIANqQQRrIAU2AgAgACAEaiIAIAEgBGsiATYCAAsCQCABIAJBGGpPBEAgACACakEIaiIDIAEgAmtBCGsiATYCACABQXxxIANqQQRrIAFBAXI2AgAgAwJ/IAMoAgBBCGsiAUH/AE0EQCABQQN2QQFrDAELIAFnIQQgAUEdIARrdkEEcyAEQQJ0a0HuAGogAUH/H00NABpBPyABQR4gBGt2QQJzIARBAXRrQccAaiIBIAFBP08bCyIBQQR0IgRB4DJqNgIEIAMgBEHoMmoiBCgCADYCCCAEIAM2AgAgAygCCCADNgIEQeg6Qeg6KQMAQgEgAa2GhDcDACAAIAJBCGoiATYCACABQXxxIABqQQRrIAE2AgAMAQsgACABakEEayABNgIACyAAQQRqBSADCwvmAwEFfwJ/QbAwKAIAIgEgAEEHakF4cSIDaiECAkAgA0EAIAEgAk8bDQAgAj8AQRB0SwRAIAIQFkUNAQtBsDAgAjYCACABDAELQfw7QTA2AgBBfwsiAkF/RwRAIAAgAmoiA0EQayIBQRA2AgwgAUEQNgIAAkACf0HgOigCACIABH8gACgCCAVBAAsgAkYEQCACIAJBBGsoAgBBfnFrIgRBBGsoAgAhBSAAIAM2AghBcCAEIAVBfnFrIgAgACgCAGpBBGstAABBAXFFDQEaIAAoAgQiAyAAKAIINgIIIAAoAgggAzYCBCAAIAEgAGsiATYCAAwCCyACQRA2AgwgAkEQNgIAIAIgAzYCCCACIAA2AgRB4DogAjYCAEEQCyACaiIAIAEgAGsiATYCAAsgAUF8cSAAakEEayABQQFyNgIAIAACfyAAKAIAQQhrIgFB/wBNBEAgAUEDdkEBawwBCyABQR0gAWciA2t2QQRzIANBAnRrQe4AaiABQf8fTQ0AGkE/IAFBHiADa3ZBAnMgA0EBdGtBxwBqIgEgAUE/TxsLIgFBBHQiA0HgMmo2AgQgACADQegyaiIDKAIANgIIIAMgADYCACAAKAIIIAA2AgRB6DpB6DopAwBCASABrYaENwMACyACQX9HC80BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQSBqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQAC0ABAX8CQEGsOy0AAEEBcQRAQag7KAIAIQIMAQtBAUGAJxAMIQJBrDtBAToAAEGoOyACNgIACyACIAAgAUEAEBMLzQECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBMmoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALDwAgASAAKAIAaiACOQMACw0AIAEgACgCAGorAwALCwAgAARAIAAQIwsLxwECBH8CfSMAQRBrIgIkACACQQhqIABB/ABqIgQgAEEeaiIFLwEAEB9BASEDAkACQCACKgIIIgcgASoCACIGXARAIAcgB1sEQCABLQAEIQEMAgsgBiAGXCEDCyABLQAEIQEgA0UNACACLQAMIAFB/wFxRg0BCyAEIAUgBiABEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyACQRBqJAALlgMCA34CfyAAvSICQjSIp0H/D3EiBEH/D0YEQCAARAAAAAAAAPA/oiIAIACjDwsgAkIBhiIBQoCAgICAgIDw/wBYBEAgAEQAAAAAAAAAAKIgACABQoCAgICAgIDw/wBRGw8LAn4gBEUEQEEAIQQgAkIMhiIBQgBZBEADQCAEQQFrIQQgAUIBhiIBQgBZDQALCyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgAUIBhiEBIARBAWsiBEH/B0oNAAtB/wchBAsCQCABQoCAgICAgIAIfSIDQgBTDQAgAyIBQgBSDQAgAEQAAAAAAAAAAKIPCyABQv////////8HWARAA0AgBEEBayEEIAFCgICAgICAgARUIQUgAUIBhiEBIAUNAAsLIAJCgICAgICAgICAf4MgAUKAgICAgICACH0gBK1CNIaEIAFBASAEa62IIARBAEobhL8LiwEBA38DQCAAQQR0IgFB5DJqIAFB4DJqIgI2AgAgAUHoMmogAjYCACAAQQFqIgBBwABHDQALQTAQZBpBmDtBBjYCAEGcO0EANgIAEJwBQZw7Qcg7KAIANgIAQcg7QZg7NgIAQcw7QcMBNgIAQdA7QQA2AgAQjwFB0DtByDsoAgA2AgBByDtBzDs2AgALjwEBAn8jAEEQayIEJAACfUMAAAAAIAAvABVBgOAAcUUNABogBEEIaiAAQRRqIgBBASACQQJGQQF0IAFB/gFxQQJHGyIFIAIQNgJAIAQtAAxFDQAgBEEIaiAAIAUgAhA2IAQtAAxBA0YNACAAIAEgAiADEIEBDAELIAAgASACIAMQgAGMCyEDIARBEGokACADC4QBAQJ/AkACQCAAKALoAyICIAAoAuwDIgNGDQADQCACKAIAIAFGDQEgAkEEaiICIANHDQALDAELIAIgA0YNACABLQAXQRB0QYCAMHFBgIAgRgRAIAAgACgC4ANBAWs2AuADCyACIAJBBGoiASADIAFrEDMaIAAgA0EEazYC7ANBAQ8LQQALCwBByDEgACABEEkLPAAgAEUEQCACQQVHQQAgAhtFBEBBuDAgAyAEEEkaDwsgAyAEEHAaDwsgACABIAIgAyAEIAAoAgQRDQAaCyYBAX8jAEEQayIBJAAgASAANgIMQbgwQdglIAAQSRogAUEQaiQAC4cDAwN/BXwCfSAAKgKgA7siBiACoCECIAAqApwDuyIHIAGgIQggACgC9AMqAhgiC0MAAAAAXARAIAAqApADuyEJIAAqAowDIQwgACAHIAu7IgFBACAALQAAQRBxIgNBBHYiBBA0OAKcAyAAIAYgAUEAIAQQNDgCoAMgASAMuyIHohBsIgYgBmIiBEUgBplELUMc6+I2Gj9jcUUEQCAEIAZEAAAAAAAA8L+gmUQtQxzr4jYaP2NFciEFCyACIAmgIQogCCAHoCEHAn8gASAJohBsIgYgBmIiBEUEQEEAIAaZRC1DHOviNho/Yw0BGgsgBCAGRAAAAAAAAPC/oJlELUMc6+I2Gj9jRXILIQQgACAHIAEgA0EARyIDIAVxIAMgBUEBc3EQNCAIIAFBACADEDSTOAKMAyAAIAogASADIARxIAMgBEEBc3EQNCACIAFBACADEDSTOAKQAwsgACgC6AMiAyAAKALsAyIARwRAA0AgAygCACAIIAIQcyADQQRqIgMgAEcNAAsLC1UBAX0gAEEUaiIAIAEgAkECSSICIAQgBRA1IQYgACABIAIgBCAFEC0iBUMAAAAAYCADIAVecQR9IAUFIAZDAAAAAGBFBEAgAw8LIAYgAyADIAZdGwsLeAEBfwJAIAAoAgAiAgRAA0AgAUUNAiACIAEoAgQ2AgQgAiABKAIINgIIIAEoAgAhASAAKAIAIQAgAigCACICDQALCyAAIAEQPA8LAkAgAEUNACAAKAIAIgFFDQAgAEEANgIAA0AgASgCACEAIAEQIyAAIgENAAsLC5kCAgZ/AX0gAEEUaiEHQQMhBCAALQAUQQJ2QQNxIQUCQAJ/AkAgAUEBIAAoAuQDGyIIQQJGBEACQCAFQQJrDgIEAAILQQIhBAwDC0ECIQRBACAFQQFLDQEaCyAECyEGIAUhBAsgACAEIAggAyACIARBAkkiBRsQbiEKIAAgBiAIIAIgAyAFGxBuIQMgAEGcA2oiAEEBIAFBAkZBAXQiCCAFG0ECdGogCiAHIAQgASACECKSOAIAIABBAyABQQJHQQF0IgkgBRtBAnRqIAogByAEIAEgAhAhkjgCACAAIAhBASAGQQF2IgQbQQJ0aiADIAcgBiABIAIQIpI4AgAgACAJQQMgBBtBAnRqIAMgByAGIAEgAhAhkjgCAAvUAgEDfyMAQdACayIBJAAgAUEIakEAQcQCECoaIAFBADoAGCABQgA3AxAgAUGAgID+BzYCDCABQRxqQQBBxAEQKhogAUHgAWohAyABQSBqIQIDQCACQoCAgPyLgIDAv383AhAgAkKBgICAEDcCCCACQoCAgPyLgIDAv383AgAgAkEYaiICIANHDQALIAFCgICA/IuAgMC/fzcD8AEgAUKBgICAEDcD6AEgAUKAgID8i4CAwL9/NwPgASABQoCAgP6HgIDg/wA3AoQCIAFCgICA/oeAgOD/ADcC/AEgASABLQD4AUH4AXE6APgBIAFBjAJqQQBBwAAQKhogAEGYAWogAUEIakHEAhArGiAAQgA3AowDIAAgAC0AAEEBcjoAACAAEE8gACgC6AMiAiAAKALsAyIARwRAA0AgAigCABB3IAJBBGoiAiAARw0ACwsgAUHQAmokAAuuAgIKfwJ9IwBBIGsiASQAIAFBgAI7AB4gAEHuAGohByAAQfgDaiEFIABB8gBqIQggAEH2AGohCSAAQfwAaiEDQQAhAANAIAFBEGogAyAJIAFBHmogBGotAAAiAkEBdCIEaiIGLwEAEB8CQAJAIAEtABRFDQAgAUEIaiADIAYvAQAQHyABIAMgBCAIai8BABAfIAEtAAwgAS0ABEcNAAJAIAEqAggiDCAMXCIKIAEqAgAiCyALXHJFBEAgDCALk4tDF7fROF0NAQwCCyAKRSALIAtbcg0BCyABQRBqIAMgBi8BABAfDAELIAFBEGogAyAEIAdqLwEAEB8LIAUgAkEDdGoiAiABLQAUOgAEIAIgASgCEDYCAEEBIQQgACECQQEhACACRQ0ACyABQSBqJAALMgACf0EAIAAvABVBgOAAcUGAwABGDQAaQQEgABA7QwAAAABcDQAaIAAQQEMAAAAAXAsLewEBfSADIASTIgMgA1sEfUMAAAAAIABBFGoiACABIAIgBSAGEDUiByAEkyAHIAdcGyIHQ///f38gACABIAIgBSAGEC0iBSAEkyAFIAVcGyIEIAMgAyAEXhsiAyADIAddGyAHIAMgAyADXBsgAyADWyAHIAdbcRsFIAMLC98FAwR/BX0BfCAJQwAAAABdIAhDAAAAAF1yBH8gDQUgBSESIAEhEyADIRQgByERIAwqAhgiFUMAAAAAXARAIAG7IBW7IhZBAEEAEDQhEyADuyAWQQBBABA0IRQgBbsgFkEAQQAQNCESIAe7IBZBAEEAEDQhEQsCf0EAIAAgBEcNABogEiATk4tDF7fROF0gEyATXCINIBIgElxyRQ0AGkEAIBIgElsNABogDQshDAJAIAIgBkcNACAUIBRcIg0gESARXHJFBEAgESAUk4tDF7fROF0hDwwBCyARIBFbDQAgDSEPC0EBIQ5BASENAkAgDA0AIAEgCpMhAQJAIABFBEAgASABXCIAIAggCFxyRQRAQQAhDCABIAiTi0MXt9E4XUUNAgwDC0EAIQwgCCAIWw0BIAANAgwBCyAAQQJGIQwgAEECRw0AIARBAUcNACABIAhgDQECQCAIIAhcIgAgASABXHJFBEAgASAIk4tDF7fROF1FDQEMAwtBACENIAEgAVsNAkEBIQ0gAA0CC0EAIQ0MAQtBACENIAggCFwiACABIAVdRXINACAMRSABIAFcIhAgBSAFXHIgBEECR3JyDQBBASENIAEgCGANAEEAIQ0gACAQcg0AIAEgCJOLQxe30ThdIQ0LAkAgDw0AIAMgC5MhAQJAAkAgAkUEQCABIAFcIgIgCSAJXHJFBEBBACEAIAEgCZOLQxe30ThdRQ0CDAQLQQAhACAJIAlbDQEgAg0DDAELIAJBAkYhACACQQJHIAZBAUdyDQAgASAJYARADAMLIAkgCVwiACABIAFcckUEQCABIAmTi0MXt9E4XUUNAgwDC0EAIQ4gASABWw0CQQEhDiAADQIMAQsgCSAJXCICIAEgB11Fcg0AIABFIAEgAVwiBCAHIAdcciAGQQJHcnINACABIAlgDQFBACEOIAIgBHINASABIAmTi0MXt9E4XSEODAELQQAhDgsgDSAOcQsL4wEBA38jAEEQayIBJAACQAJAIAAtABRBCHFFDQBBASEDIAAvABVB8AFxQdAARg0AIAEgABAyIAEoAgQhAAJAIAEoAgAiAkUEQEEAIQMgAEUNAQsDQCACKALsAyACKALoAyICa0ECdSAATQ0DIAIgAEECdGooAgAiAC8AFSAALQAXQRB0ciIAQYDgAHFBgMAARyAAQYAecUGACkZxIgMNASABEC4gASgCBCIAIAEoAgAiAnINAAsLIAEoAggiAEUNAANAIAAoAgAhAiAAECMgAiIADQALCyABQRBqJAAgAw8LEAIAC7IBAQR/AkACQCAAKAIEIgMgACgCACIEKALsAyAEKALoAyIBa0ECdUkEQCABIANBAnRqIQIDQCACKAIAIgEtABdBEHRBgIAwcUGAgCBHDQMgASgC7AMgASgC6ANGDQJBDBAeIgIgBDYCBCACIAM2AgggAiAAKAIINgIAQQAhAyAAQQA2AgQgACABNgIAIAAgAjYCCCABIQQgASgC6AMiAiABKALsA0cNAAsLEAIACyAAEC4LC4wQAgx/B30jAEEgayINJAAgDUEIaiABEDIgDSgCCCIOIA0oAgwiDHIEQCADQQEgAxshFSAAQRRqIRQgBUEBaiEWA0ACQAJAAn8CQAJAAkACQAJAIAwgDigC7AMgDigC6AMiDmtBAnVJBEAgDiAMQQJ0aigCACILLwAVIAstABdBEHRyIgxBgIAwcUGAgBBGDQgCQAJAIAxBDHZBA3EOAwEKAAoLIAkhFyAKIRogASgC9AMtABRBBHFFBEAgACoClAMgFEECQQEQMCAUQQJBARAvkpMhFyAAKgKYAyAUQQBBARAwIBRBAEEBEC+SkyEaCyALQRRqIQ8gAS0AFEECdkEDcSEQAkACfwJAIANBAkciE0UEQEEAIQ5BAyEMAkAgEEECaw4CBAACC0ECIQwMAwtBAiEMQQAgEEEBSw0BGgsgDAshDiAQIQwLIA9BAkEBIBcQIiAPQQJBASAXECGSIR0gD0EAQQEgFxAiIRwgD0EAQQEgFxAhIRsgCyoC+AMhGAJAAkACQAJAIAstAPwDQQFrDgIBAAILIBggF5RDCtcjPJQhGAsgGEMAAAAAYEUNACAdIAsgA0EAIBcgFxAxkiEYDAELIA1BGGogDyALQTJqIhAgAxBFQwAAwH8hGCANLQAcRQ0AIA1BGGogDyAQIAMQRCANLQAcRQ0AIA1BGGogDyAQIAMQRSANLQAcQQNGDQAgDUEYaiAPIBAgAxBEIA0tABxBA0YNACALQQIgAyAAKgKUAyAUQQIgAxBLIBRBAiADEFKSkyAPQQIgAyAXEFEgD0ECIAMgFxCDAZKTIBcgFxAlIRgLIBwgG5IhHCALKgKABCEZAkACQAJAIAstAIQEQQFrDgIBAAILIBkgGpRDCtcjPJQhGQsgGUMAAAAAYEUNACAcIAsgA0EBIBogFxAxkiEZDAMLIA1BGGogDyALQTJqIhAQQwJAIA0tABxFDQAgDUEYaiAPIBAQQiANLQAcRQ0AIA1BGGogDyAQEEMgDS0AHEEDRg0AIA1BGGogDyAQEEIgDS0AHEEDRg0AIAtBACADIAAqApgDIBRBACADEEsgFEEAIAMQUpKTIA9BACADIBoQUSAPQQAgAyAaEIMBkpMgGiAXECUhGQwDC0MAAMB/IRkgGCAYXA0GIAtB/ABqIhAgC0H6AGoiEi8BABAgIhsgG1sNAwwFCyALLQAAQQhxDQggCxBPIAAgCyACIAstABRBA3EiDCAVIAwbIAQgFiAGIAsqApwDIAeSIAsqAqADIAiSIAkgChB+IBFyIQxBACERIAxBAXFFDQhBASERIAsgCy0AAEEBcjoAAAwICxACAAsgGCAYXCAZIBlcRg0BIAtB/ABqIhAgC0H6AGoiEi8BABAgIhsgG1wNASAYIBhcBEAgGSAckyAQIAsvAXoQIJQgHZIhGAwCCyAZIBlbDQELIBwgGCAdkyAQIBIvAQAQIJWSIRkLIBggGFwNASAZIBlbDQMLQQAMAQtBAQshEiALIBcgGCACQQFHIAxBAklxIBdDAAAAAF5xIBJxIhAbIBkgA0ECIBIgEBsgGSAZXCAXIBpBAEEGIAQgBSAGED0aIAsqApQDIA9BAkEBIBcQIiAPQQJBASAXECGSkiEYIAsqApgDIA9BAEEBIBcQIiAPQQBBASAXECGSkiEZC0EBIRAgCyAYIBkgA0EAQQAgFyAaQQFBASAEIAUgBhA9GiAAIAEgCyADIAxBASAXIBoQggEgACABIAsgAyAOQQAgFyAaEIIBIBFBAXFFBEAgCy0AAEEBcSEQCyABLQAUIhJBAnZBA3EhDAJAAn8CQAJAAkACQAJAAkACQAJAAkACfwJAIBNFBEBBACERQQMhDiAMQQJrDgIDDQELQQIhDkEAIAxBAUsNARoLIA4LIREgEkEEcUUNBCASQQhxRQ0BIAwhDgsgASEMIA8QXw0BDAILAkAgCy0ANEEHcQ0AIAstADhBB3ENACALLQBCQQdxDQAgDCEOIAEhDCALQUBrLwEAQQdxRQ0CDAELIAwhDgsgACEMCwJ/AkACQAJAIA5BAWsOAwABAgULIAtBmANqIQ4gC0GoA2ohE0EBIRIgDEGYA2oMAgsgC0GUA2ohDiALQZwDaiETQQIhEiAMQZQDagwBCyALQZQDaiEOIAtBpANqIRNBACESIAxBlANqCyEMIAsgEkECdGogDCoCACAOKgIAkyATKgIAkzgCnAMLIBFBAXFFDQUCQAJAIBFBAnEEQCABIQwgDxBfDQEMAgsgCy0ANEEHcQ0AIAstADhBB3ENACALLQBCQQdxDQAgASEMIAtBQGsvAQBBB3FFDQELIAAhDAsgEUEBaw4DAQIDAAsQJAALIAtBmANqIREgC0GoA2ohDkEBIRMgDEGYA2oMAgsgC0GUA2ohESALQZwDaiEOQQIhEyAMQZQDagwBCyALQZQDaiERIAtBpANqIQ5BACETIAxBlANqCyEMIAsgE0ECdGogDCoCACARKgIAkyAOKgIAkzgCnAMLIAsqAqADIRsgCyoCnAMgB0MAAAAAIA8QXxuTIRcCfQJAIAstADRBB3ENACALLQA4QQdxDQAgCy0AQkEHcQ0AIAtBQGsvAQBBB3ENAEMAAAAADAELIAgLIRogCyAXOAKcAyALIBsgGpM4AqADIBAhEQsgDUEIahAuIA0oAgwiDCANKAIIIg5yDQALCyANKAIQIgwEQANAIAwoAgAhACAMECMgACIMDQALCyANQSBqJAAgEUEBcQt2AgF/AX0jAEEQayIEJAAgBEEIaiAAIAFBAnRB7CVqKAIAIAIQUEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAl0MAAAAAIAUgBVsbC3gCAX8BfSMAQRBrIgQkACAEQQhqIABBAyACQQJHQQF0IAFB/gFxQQJHGyACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt4AgF/AX0jAEEQayIEJAAgBEEIaiAAQQEgAkECRkEBdCABQf4BcUECRxsgAhA2QwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAAAgBSAFWxsLoA0BBH8jAEEQayIJJAAgCUEIaiACQRRqIgggA0ECRkEBdEEBIARB/gFxQQJGIgobIgsgAxA2IAYgByAKGyEHAkACQAJAAkACQAJAIAktAAxFDQAgCUEIaiAIIAsgAxA2IAktAAxBA0YNACAIIAQgAyAHEIEBIABBFGogBCADEDCSIAggBCADIAcQIpIhBkEBIQMCQAJ/AkACQAJAAkAgBA4EAgMBAAcLQQIhAwwBC0EAIQMLIAMgC0YNAgJAAkAgBA4EAgIAAQYLIABBlANqIQNBAAwCCyAAQZQDaiEDQQAMAQsgAEGYA2ohA0EBCyEAIAMqAgAgAiAAQQJ0aioClAOTIAaTIQYLIAIgBEECdEHcJWooAgBBAnRqIAY4ApwDDAULIAlBCGogCCADQQJHQQF0QQMgChsiCiADEDYCQCAJLQAMRQ0AIAlBCGogCCAKIAMQNiAJLQAMQQNGDQACfwJAAkACQCAEDgQCAgABBQsgAEGUA2ohBUEADAILIABBlANqIQVBAAwBCyAAQZgDaiEFQQELIQEgBSoCACACQZQDaiIFIAFBAnRqKgIAkyAAQRRqIAQgAxAvkyAIIAQgAyAHECGTIAggBCADIAcQgAGTIQZBASEDAkACfwJAAkACQAJAIAQOBAIDAQAHC0ECIQMMAQtBACEDCyADIAtGDQICQAJAIAQOBAICAAEGCyAAQZQDaiEDQQAMAgsgAEGUA2ohA0EADAELIABBmANqIQNBAQshACADKgIAIAUgAEECdGoqAgCTIAaTIQYLIAIgBEECdEHcJWooAgBBAnRqIAY4ApwDDAULAkACQAJAIAUEQCABLQAUQQR2QQdxIgBBBUsNCEEBIAB0IgBBMnENASAAQQlxBEAgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDDAkLIAEgBEECdEHsJWooAgBBAnRqIgAqArwDIAggBCADIAYQYpIhBiACKAL0Ay0AFEECcUUEQCAGIAAqAswDkiEGCwJAAkACQAJAIAQOBAEBAgAICyABKgKUAyACKgKUA5MhB0ECIQMMAgsgASoCmAMgAioCmAOTIQdBASEDAkAgBA4CAgAHC0EDIQMMAQsgASoClAMgAioClAOTIQdBACEDCyACIANBAnRqIAcgBpM4ApwDDAgLIAIvABZBD3EiBUUEQCABLQAVQQR2IQULIAVBBUYEQCABLQAUQQhxRQ0CCyABLwAVQYCAA3FBgIACRgRAIAVBAmsOAgEHAwsgBUEISw0HQQEgBXRB8wNxDQYgBUECRw0CC0EAIQACfQJ/AkACQAJAAkACfwJAAkACQCAEDgQCAgABBAsgASoClAMhB0ECIQAgAUG8A2oMAgsgASoClAMhByABQcQDagwBCyABKgKYAyEHAkACQCAEDgIAAQMLQQMhACABQcADagwBC0EBIQAgAUHIA2oLIQUgByAFKgIAkyABQbwDaiIIIABBAnRqKgIAkyIHIAIoAvQDLQAUQQJxDQUaAkAgBA4EAAIDBAELQQMhACABQdADagwECxAkAAtBASEAIAFB2ANqDAILQQIhACABQcwDagwBC0EAIQAgAUHUA2oLIQUgByAFKgIAkyABIABBAnRqKgLMA5MLIAIgBEECdCIFQfwlaigCAEECdGoqApQDIAJBFGoiACAEQQEgBhAiIAAgBEEBIAYQIZKSk0MAAAA/lCAIIAVB3CVqKAIAIgVBAnRqKgIAkiAAIAQgAyAGEEGSIQYgAiAFQQJ0aiACKAL0Ay0AFEECcQR9IAYFIAYgASAFQQJ0aioCzAOSCzgCnAMMBgsgAS8AFUGAgANxQYCAAkcNBAsgASAEQQJ0QewlaigCAEECdGoiACoCvAMgCCAEIAMgBhBikiEGIAIoAvQDLQAUQQJxRQRAIAYgACoCzAOSIQYLAkACQCAEDgQBAQMAAgsgASoClAMgAioClAOTIQdBAiEDDAMLIAEqApgDIAIqApgDkyEHQQEhAwJAIAQOAgMAAQtBAyEDDAILECQACyABKgKUAyACKgKUA5MhB0EAIQMLIAIgA0ECdGogByAGkzgCnAMMAQsgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDCyAJQRBqJAALcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QewlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwscACAAIAFBCCACpyACQiCIpyADpyADQiCIpxAVCwUAEFgACzkAIABFBEBBAA8LAn8gAUGAf3FBgL8DRiABQf8ATXJFBEBB/DtBGTYCAEF/DAELIAAgAToAAEEBCwvEAgACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACgsMCgsCAwQFDAsMDAoLBwgJCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCwALIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAtdAQR/IAAoAgAhAgNAIAIsAAAiAxBXBEBBfyEEIAAgAkEBaiICNgIAIAFBzJmz5gBNBH9BfyADQTBrIgMgAUEKbCIEaiADIARB/////wdzShsFIAQLIQEMAQsLIAELrhQCEn8BfiMAQdAAayIIJAAgCCABNgJMIAhBN2ohFyAIQThqIRQCQAJAAkACQANAIAEhDSAHIA5B/////wdzSg0BIAcgDmohDgJAAkACQCANIgctAAAiCQRAA0ACQAJAIAlB/wFxIgFFBEAgByEBDAELIAFBJUcNASAHIQkDQCAJLQABQSVHBEAgCSEBDAILIAdBAWohByAJLQACIQogCUECaiIBIQkgCkElRg0ACwsgByANayIHIA5B/////wdzIhhKDQcgAARAIAAgDSAHECYLIAcNBiAIIAE2AkwgAUEBaiEHQX8hEgJAIAEsAAEiChBXRQ0AIAEtAAJBJEcNACABQQNqIQcgCkEwayESQQEhFQsgCCAHNgJMQQAhDAJAIAcsAAAiCUEgayIBQR9LBEAgByEKDAELIAchCkEBIAF0IgFBidEEcUUNAANAIAggB0EBaiIKNgJMIAEgDHIhDCAHLAABIglBIGsiAUEgTw0BIAohB0EBIAF0IgFBidEEcQ0ACwsCQCAJQSpGBEACfwJAIAosAAEiARBXRQ0AIAotAAJBJEcNACABQQJ0IARqQcABa0EKNgIAIApBA2ohCUEBIRUgCiwAAUEDdCADakGAA2soAgAMAQsgFQ0GIApBAWohCSAARQRAIAggCTYCTEEAIRVBACETDAMLIAIgAigCACIBQQRqNgIAQQAhFSABKAIACyETIAggCTYCTCATQQBODQFBACATayETIAxBgMAAciEMDAELIAhBzABqEIkBIhNBAEgNCCAIKAJMIQkLQQAhB0F/IQsCfyAJLQAAQS5HBEAgCSEBQQAMAQsgCS0AAUEqRgRAAn8CQCAJLAACIgEQV0UNACAJLQADQSRHDQAgAUECdCAEakHAAWtBCjYCACAJQQRqIQEgCSwAAkEDdCADakGAA2soAgAMAQsgFQ0GIAlBAmohAUEAIABFDQAaIAIgAigCACIKQQRqNgIAIAooAgALIQsgCCABNgJMIAtBf3NBH3YMAQsgCCAJQQFqNgJMIAhBzABqEIkBIQsgCCgCTCEBQQELIQ8DQCAHIRFBHCEKIAEiECwAACIHQfsAa0FGSQ0JIBBBAWohASAHIBFBOmxqQf8qai0AACIHQQFrQQhJDQALIAggATYCTAJAAkAgB0EbRwRAIAdFDQsgEkEATgRAIAQgEkECdGogBzYCACAIIAMgEkEDdGopAwA3A0AMAgsgAEUNCCAIQUBrIAcgAiAGEIcBDAILIBJBAE4NCgtBACEHIABFDQcLIAxB//97cSIJIAwgDEGAwABxGyEMQQAhEkGPCSEWIBQhCgJAAkACQAJ/AkACQAJAAkACfwJAAkACQAJAAkACQAJAIBAsAAAiB0FfcSAHIAdBD3FBA0YbIAcgERsiB0HYAGsOIQQUFBQUFBQUFA4UDwYODg4UBhQUFBQCBQMUFAkUARQUBAALAkAgB0HBAGsOBw4UCxQODg4ACyAHQdMARg0JDBMLIAgpA0AhGUGPCQwFC0EAIQcCQAJAAkACQAJAAkACQCARQf8BcQ4IAAECAwQaBQYaCyAIKAJAIA42AgAMGQsgCCgCQCAONgIADBgLIAgoAkAgDqw3AwAMFwsgCCgCQCAOOwEADBYLIAgoAkAgDjoAAAwVCyAIKAJAIA42AgAMFAsgCCgCQCAOrDcDAAwTC0EIIAsgC0EITRshCyAMQQhyIQxB+AAhBwsgFCENIAgpA0AiGVBFBEAgB0EgcSEQA0AgDUEBayINIBmnQQ9xQZAvai0AACAQcjoAACAZQg9WIQkgGUIEiCEZIAkNAAsLIAxBCHFFIAgpA0BQcg0DIAdBBHZBjwlqIRZBAiESDAMLIBQhByAIKQNAIhlQRQRAA0AgB0EBayIHIBmnQQdxQTByOgAAIBlCB1YhDSAZQgOIIRkgDQ0ACwsgByENIAxBCHFFDQIgCyAUIA1rIgdBAWogByALSBshCwwCCyAIKQNAIhlCAFMEQCAIQgAgGX0iGTcDQEEBIRJBjwkMAQsgDEGAEHEEQEEBIRJBkAkMAQtBkQlBjwkgDEEBcSISGwshFiAZIBQQRyENCyAPQQAgC0EASBsNDiAMQf//e3EgDCAPGyEMIAgpA0AiGUIAUiALckUEQCAUIQ1BACELDAwLIAsgGVAgFCANa2oiByAHIAtIGyELDAsLQQAhDAJ/Qf////8HIAsgC0H/////B08bIgoiEUEARyEQAkACfwJAAkAgCCgCQCIHQY4lIAcbIg0iD0EDcUUgEUVyDQADQCAPLQAAIgxFDQIgEUEBayIRQQBHIRAgD0EBaiIPQQNxRQ0BIBENAAsLIBBFDQICQCAPLQAARSARQQRJckUEQANAIA8oAgAiB0F/cyAHQYGChAhrcUGAgYKEeHENAiAPQQRqIQ8gEUEEayIRQQNLDQALCyARRQ0DC0EADAELQQELIRADQCAQRQRAIA8tAAAhDEEBIRAMAQsgDyAMRQ0CGiAPQQFqIQ8gEUEBayIRRQ0BQQAhEAwACwALQQALIgcgDWsgCiAHGyIHIA1qIQogC0EATgRAIAkhDCAHIQsMCwsgCSEMIAchCyAKLQAADQ0MCgsgCwRAIAgoAkAMAgtBACEHIABBICATQQAgDBApDAILIAhBADYCDCAIIAgpA0A+AgggCCAIQQhqIgc2AkBBfyELIAcLIQlBACEHAkADQCAJKAIAIg1FDQEgCEEEaiANEIYBIgpBAEgiDSAKIAsgB2tLckUEQCAJQQRqIQkgCyAHIApqIgdLDQEMAgsLIA0NDQtBPSEKIAdBAEgNCyAAQSAgEyAHIAwQKSAHRQRAQQAhBwwBC0EAIQogCCgCQCEJA0AgCSgCACINRQ0BIAhBBGogDRCGASINIApqIgogB0sNASAAIAhBBGogDRAmIAlBBGohCSAHIApLDQALCyAAQSAgEyAHIAxBgMAAcxApIBMgByAHIBNIGyEHDAgLIA9BACALQQBIGw0IQT0hCiAAIAgrA0AgEyALIAwgByAFERwAIgdBAE4NBwwJCyAIIAgpA0A8ADdBASELIBchDSAJIQwMBAsgBy0AASEJIAdBAWohBwwACwALIAANByAVRQ0CQQEhBwNAIAQgB0ECdGooAgAiAARAIAMgB0EDdGogACACIAYQhwFBASEOIAdBAWoiB0EKRw0BDAkLC0EBIQ4gB0EKTw0HA0AgBCAHQQJ0aigCAA0BIAdBAWoiB0EKRw0ACwwHC0EcIQoMBAsgCyAKIA1rIhAgCyAQShsiCSASQf////8Hc0oNAkE9IQogEyAJIBJqIgsgCyATSBsiByAYSg0DIABBICAHIAsgDBApIAAgFiASECYgAEEwIAcgCyAMQYCABHMQKSAAQTAgCSAQQQAQKSAAIA0gEBAmIABBICAHIAsgDEGAwABzECkMAQsLQQAhDgwDC0E9IQoLQfw7IAo2AgALQX8hDgsgCEHQAGokACAOC9kCAQR/IwBB0AFrIgUkACAFIAI2AswBIAVBoAFqIgJBAEEoECoaIAUgBSgCzAE2AsgBAkBBACABIAVByAFqIAVB0ABqIAIgAyAEEIoBQQBIBEBBfyEEDAELQQEgBiAAKAJMQQBOGyEGIAAoAgAhByAAKAJIQQBMBEAgACAHQV9xNgIACwJ/AkACQCAAKAIwRQRAIABB0AA2AjAgAEEANgIcIABCADcDECAAKAIsIQggACAFNgIsDAELIAAoAhANAQtBfyAAEJ0BDQEaCyAAIAEgBUHIAWogBUHQAGogBUGgAWogAyAEEIoBCyECIAgEQCAAQQBBACAAKAIkEQYAGiAAQQA2AjAgACAINgIsIABBADYCHCAAKAIUIQEgAEIANwMQIAJBfyABGyECCyAAIAAoAgAiACAHQSBxcjYCAEF/IAIgAEEgcRshBCAGRQ0ACyAFQdABaiQAIAQLfwIBfwF+IAC9IgNCNIinQf8PcSICQf8PRwR8IAJFBEAgASAARAAAAAAAAAAAYQR/QQAFIABEAAAAAAAA8EOiIAEQjAEhACABKAIAQUBqCzYCACAADwsgASACQf4HazYCACADQv////////+HgH+DQoCAgICAgIDwP4S/BSAACwsVACAARQRAQQAPC0H8OyAANgIAQX8LzgECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBxABqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQAC9EDAEHUO0GoHBAcQdU7QYoWQQFBAUEAEBtB1jtB/RJBAUGAf0H/ABAEQdc7QfYSQQFBgH9B/wAQBEHYO0H0EkEBQQBB/wEQBEHZO0GUCkECQYCAfkH//wEQBEHaO0GLCkECQQBB//8DEARB2ztBsQpBBEGAgICAeEH/////BxAEQdw7QagKQQRBAEF/EARB3TtB+BhBBEGAgICAeEH/////BxAEQd47Qe8YQQRBAEF/EARB3ztBjxBCgICAgICAgICAf0L///////////8AEIQBQeA7QY4QQgBCfxCEAUHhO0GIEEEEEA1B4jtB9BtBCBANQeM7QaQZEA5B5DtBmSIQDkHlO0EEQZcZEAhB5jtBAkGwGRAIQec7QQRBvxkQCEHoO0GPFhAaQek7QQBB1CEQAUHqO0EAQboiEAFB6ztBAUHyIRABQew7QQJB5B4QAUHtO0EDQYMfEAFB7jtBBEGrHxABQe87QQVByB8QAUHwO0EEQd8iEAFB8TtBBUH9IhABQeo7QQBBriAQAUHrO0EBQY0gEAFB7DtBAkHwIBABQe07QQNBziAQAUHuO0EEQbMhEAFB7ztBBUGRIRABQfI7QQZB7h8QAUHzO0EHQaQjEAELJQAgAEH0JjYCACAALQAEBEAgACgCCEH9DxBmCyAAKAIIEAYgAAsDAAALJQAgAEHsJzYCACAALQAEBEAgACgCCEH9DxBmCyAAKAIIEAYgAAs3AQJ/QQQQHiICIAE2AgBBBBAeIgMgATYCAEGjOyAAQeI7QfooQcEBIAJB4jtB/ihBwgEgAxAHCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRBQALOQEBfyABIAAoAgQiBEEBdWohASAAKAIAIQAgASACIAMgBEEBcQR/IAEoAgAgAGooAgAFIAALEQMACwkAIAEgABEAAAsHACAAEQ4ACzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALEQAACzABAX8jAEEQayICJAAgAiABNgIIIAJBCGogABECACEAIAIoAggQBiACQRBqJAAgAAsMACABIAAoAgARAAALCQAgAEEBOgAEC9coAQJ/QaA7QaE7QaI7QQBBjCZBB0GPJkEAQY8mQQBB2RZBkSZBCBAFQQgQHiIAQoiAgIAQNwMAQaA7QZcbQQZBoCZBuCZBCSAAQQEQAEGkO0GlO0GmO0GgO0GMJkEKQYwmQQtBjCZBDEG4EUGRJkENEAVBBBAeIgBBDjYCAEGkO0HoFEECQcAmQcgmQQ8gAEEAEABBoDtBowxBAkHMJkHUJkEQQREQA0GgO0GAHEEDQaQnQbAnQRJBExADQbg7Qbk7Qbo7QQBBjCZBFEGPJkEAQY8mQQBB6RZBkSZBFRAFQQgQHiIAQoiAgIAQNwMAQbg7QegcQQJBuCdByCZBFiAAQQEQAEG7O0G8O0G9O0G4O0GMJkEXQYwmQRhBjCZBGUHPEUGRJkEaEAVBBBAeIgBBGzYCAEG7O0HoFEECQcAnQcgmQRwgAEEAEABBuDtBowxBAkHIJ0HUJkEdQR4QA0G4O0GAHEEDQaQnQbAnQRJBHxADQb47Qb87QcA7QQBBjCZBIEGPJkEAQY8mQQBB2hpBkSZBIRAFQb47QQFB+CdBjCZBIkEjEA9BvjtBkBtBAUH4J0GMJkEiQSMQA0G+O0HpCEECQfwnQcgmQSRBJRADQQgQHiIAQQA2AgQgAEEmNgIAQb47Qa0cQQRBkChBoChBJyAAQQAQAEEIEB4iAEEANgIEIABBKDYCAEG+O0GkEUEDQagoQbQoQSkgAEEAEABBCBAeIgBBADYCBCAAQSo2AgBBvjtByB1BA0G8KEHIKEErIABBABAAQQgQHiIAQQA2AgQgAEEsNgIAQb47QaYQQQNB0ChByChBLSAAQQAQAEEIEB4iAEEANgIEIABBLjYCAEG+O0HLHEEDQdwoQbAnQS8gAEEAEABBCBAeIgBBADYCBCAAQTA2AgBBvjtB0h1BAkHoKEHUJkExIABBABAAQQgQHiIAQQA2AgQgAEEyNgIAQb47QZcQQQJB8ChB1CZBMyAAQQAQAEHBO0GECkH4KEE0QZEmQTUQCkHiD0EAEEhB6g5BCBBIQYITQRAQSEHxFUEYEEhBgxdBIBBIQfAOQSgQSEHBOxAJQaM7Qf8aQfgoQTZBkSZBNxAKQYMXQQAQkwFB8A5BCBCTAUGjOxAJQcI7QYobQfgoQThBkSZBORAKQQQQHiIAQQg2AgBBBBAeIgFBCDYCAEHCO0GEG0HiO0H6KEE6IABB4jtB/ihBOyABEAdBBBAeIgBBADYCAEEEEB4iAUEANgIAQcI7QeUOQds7QdQmQTwgAEHbO0HIKEE9IAEQB0HCOxAJQcM7QcQ7QcU7QQBBjCZBPkGPJkEAQY8mQQBB+xtBkSZBPxAFQcM7QQFBhClBjCZBwABBwQAQD0HDO0HXDkEBQYQpQYwmQcAAQcEAEANBwztB0BpBAkGIKUHUJkHCAEHDABADQcM7QekIQQJBkClByCZBxABBxQAQA0EIEB4iAEEANgIEIABBxgA2AgBBwztB9w9BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABByAA2AgBBwztB6htBA0GYKUHIKEHJACAAQQAQAEEIEB4iAEEANgIEIABBygA2AgBBwztBnxtBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABBzAA2AgBBwztB0BRBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABBzgA2AgBBwztBiA1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABBzwA2AgBBwztB3RNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0AA2AgBBwztB+QtBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0QA2AgBBwztBuBBBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0gA2AgBBwztB5RpBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0wA2AgBBwztB/BRBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1AA2AgBBwztBlRNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1QA2AgBBwztBtQpBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1gA2AgBBwztBuBVBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB1wA2AgBBwztBmw1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB2AA2AgBBwztB7RNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2QA2AgBBwztBxAlBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2gA2AgBBwztB8QhBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2wA2AgBBwztBhwlBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3QA2AgBBwztB1BBBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3gA2AgBBwztB5gxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3wA2AgBBwztBzBNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB4AA2AgBBwztBrAlBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4QA2AgBBwztBnxZBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4gA2AgBBwztBoRdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4wA2AgBBwztBvw1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5AA2AgBBwztB+xNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB5QA2AgBBwztBkQ9BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5gA2AgBBwztBwQxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5wA2AgBBwztBvhNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB6AA2AgBBwztBsxdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6QA2AgBBwztBzw1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6gA2AgBBwztBpQ9BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6wA2AgBBwztB0gxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7AA2AgBBwztBiRdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7QA2AgBBwztBrA1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7gA2AgBBwztB9w5BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7wA2AgBBwztBrQxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB8AA2AgBBwztB/RhBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB8QA2AgBBwztBshRBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB8gA2AgBBwztBlBJBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB8wA2AgBBwztBzhlBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9AA2AgBBwztB4g1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9QA2AgBBwztBrRNBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9gA2AgBBwztB+gxBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9wA2AgBBwztBnhVBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB+AA2AgBBwztBrxtBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB+gA2AgBBwztB3BRBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABB/AA2AgBBwztBiQxBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/QA2AgBBwztBxhBBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/gA2AgBBwztB8hpBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/wA2AgBBwztBjRVBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBgAE2AgBBwztBoRNBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBgQE2AgBBwztBxwpBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBggE2AgBBwztBwhVBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABBgwE2AgBBwztB4RBBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBhQE2AgBBwztBuAlBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBhwE2AgBBwztBrRZBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBiAE2AgBBwztBqhdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBiQE2AgBBwztBmw9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBigE2AgBBwztBvxdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBiwE2AgBBwztBsg9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjAE2AgBBwztBlRdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjQE2AgBBwztBhA9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjgE2AgBBwztBihlBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBjwE2AgBBwztBwRRBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBkAE2AgBBwztBnhJBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBkgE2AgBBwztB0AlBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBkwE2AgBBwztB/AhBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBlAE2AgBBwztB2RlBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABBlQE2AgBBwztBtBNBA0GMKkGYKkGWASAAQQAQAEEIEB4iAEEANgIEIABBlwE2AgBBwztBhxxBBEGgKkGgKEGYASAAQQAQAEEIEB4iAEEANgIEIABBmQE2AgBBwztBnBxBA0GwKkHIKEGaASAAQQAQAEEIEB4iAEEANgIEIABBmwE2AgBBwztBmgpBAkG8KkHUJkGcASAAQQAQAEEIEB4iAEEANgIEIABBnQE2AgBBwztBmQxBAkHEKkHUJkGeASAAQQAQAEEIEB4iAEEANgIEIABBnwE2AgBBwztBkxxBA0HMKkGwJ0GgASAAQQAQAEEIEB4iAEEANgIEIABBoQE2AgBBwztBuxZBA0HYKkHIKEGiASAAQQAQAEEIEB4iAEEANgIEIABBowE2AgBBwztBvxtBAkHkKkHUJkGkASAAQQAQAEEIEB4iAEEANgIEIABBpQE2AgBBwztB0xtBA0HYKkHIKEGiASAAQQAQAEEIEB4iAEEANgIEIABBpgE2AgBBwztBqB1BA0HsKkHIKEGnASAAQQAQAEEIEB4iAEEANgIEIABBqAE2AgBBwztBph1BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBqQE2AgBBwztBuR1BA0H4KkHIKEGqASAAQQAQAEEIEB4iAEEANgIEIABBqwE2AgBBwztBtx1BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBrAE2AgBBwztB3whBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBrQE2AgBBwztB1whBAkGEK0HUJkGuASAAQQAQAEEIEB4iAEEANgIEIABBrwE2AgBBwztB3hVBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBsAE2AgBBwztB3AlBAkGEK0HUJkGuASAAQQAQAEEIEB4iAEEANgIEIABBsQE2AgBBwztB6QlBBUGQK0GkK0GyASAAQQAQAEEIEB4iAEEANgIEIABBswE2AgBBwztB5w9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtAE2AgBBwztB0Q9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtQE2AgBBwztBhhNBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtgE2AgBBwztB+BVBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtwE2AgBBwztByxdBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBuAE2AgBBwztBvw9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBuQE2AgBBwztB+QlBAkGsK0HUJkG6ASAAQQAQAEEIEB4iAEEANgIEIABBuwE2AgBBwztBzBVBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvAE2AgBBwztBqBJBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvQE2AgBBwztB5BlBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvgE2AgBBwztBqxVBAkHUKUHUJkH5ACAAQQAQAAtZAQF/IAAgACgCSCIBQQFrIAFyNgJIIAAoAgAiAUEIcQRAIAAgAUEgcjYCAEF/DwsgAEIANwIEIAAgACgCLCIBNgIcIAAgATYCFCAAIAEgACgCMGo2AhBBAAtHAAJAIAFBA00EfyAAIAFBAnRqQQRqBSABQQRrIgEgACgCGCIAKAIEIAAoAgAiAGtBAnVPDQEgACABQQJ0agsoAgAPCxACAAs4AQF/IAFBAEgEQBACAAsgAUEBa0EFdkEBaiIBQQJ0EB4hAiAAIAE2AgggAEEANgIEIAAgAjYCAAvSBQEJfyAAIAEvAQA7AQAgACABKQIENwIEIAAgASkCDDcCDCAAIAEoAhQ2AhQCQAJAIAEoAhgiA0UNAEEYEB4iBUEANgIIIAVCADcCACADKAIEIgEgAygCACICRwRAIAEgAmsiAkEASA0CIAUgAhAeIgE2AgAgBSABIAJqNgIIIAMoAgAiAiADKAIEIgZHBEADQCABIAIoAgA2AgAgAUEEaiEBIAJBBGoiAiAGRw0ACwsgBSABNgIECyAFQgA3AgwgBUEANgIUIAMoAhAiAUUNACAFQQxqIAEQnwEgAygCDCEGIAUgBSgCECIEIAMoAhAiAkEfcWogAkFgcWoiATYCEAJAAkAgBEUEQCABQQFrIQMMAQsgAUEBayIDIARBAWtzQSBJDQELIAUoAgwgA0EFdkEAIAFBIU8bQQJ0akEANgIACyAFKAIMIARBA3ZB/P///wFxaiEBIARBH3EiA0UEQCACQQBMDQEgAkEgbSEDIAJBH2pBP08EQCABIAYgA0ECdBAzGgsgAiADQQV0ayICQQBMDQEgASADQQJ0IgNqIgEgASgCAEF/QSAgAmt2IgFBf3NxIAMgBmooAgAgAXFyNgIADAELIAJBAEwNAEF/IAN0IQhBICADayEEIAJBIE4EQCAIQX9zIQkgASgCACEHA0AgASAHIAlxIAYoAgAiByADdHI2AgAgASABKAIEIAhxIAcgBHZyIgc2AgQgBkEEaiEGIAFBBGohASACQT9LIQogAkEgayECIAoNAAsgAkEATA0BCyABIAEoAgBBfyAEIAQgAiACIARKGyIEa3YgCHFBf3NxIAYoAgBBf0EgIAJrdnEiBiADdHI2AgAgAiAEayICQQBMDQAgASADIARqQQN2Qfz///8BcWoiASABKAIAQX9BICACa3ZBf3NxIAYgBHZyNgIACyAAKAIYIQEgACAFNgIYIAEEQCABEFsLDwsQAgALvQMBB38gAARAIwBBIGsiBiQAIAAoAgAiASgC5AMiAwRAIAMgARBvGiABQQA2AuQDCyABKALsAyICIAEoAugDIgNHBEBBASACIANrQQJ1IgIgAkEBTRshBEEAIQIDQCADIAJBAnRqKAIAQQA2AuQDIAJBAWoiAiAERw0ACwsgASADNgLsAwJAIAMgAUHwA2oiAigCAEYNACAGQQhqQQBBACACEEoiAigCBCABKALsAyABKALoAyIEayIFayIDIAQgBRAzIQUgASgC6AMhBCABIAU2AugDIAIgBDYCBCABKALsAyEFIAEgAigCCDYC7AMgAiAFNgIIIAEoAvADIQcgASACKAIMNgLwAyACIAQ2AgAgAiAHNgIMIAQgBUcEQCACIAUgBCAFa0EDakF8cWo2AggLIARFDQAgBBAnIAEoAugDIQMLIAMEQCABIAM2AuwDIAMQJwsgASgClAEhAyABQQA2ApQBIAMEQCADEFsLIAEQJyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALIAAoAgQhASAAQQA2AgQgAQRAIAEgASgCACgCBBEAAAsgBkEgaiQAIAAQIwsLtQEBAX8jAEEQayICJAACfyABBEAgASgCACEBQYgEEB4gARBcIAENARogAkH3GTYCACACEHIQJAALQZQ7LQAARQRAQfg6QQM2AgBBiDtCgICAgICAgMA/NwIAQYA7QgA3AgBBlDtBAToAAEH8OkH8Oi0AAEH+AXE6AABB9DpBADYCAEGQO0EANgIAC0GIBBAeQfQ6EFwLIQEgAEIANwIEIAAgATYCACABIAA2AgQgAkEQaiQAIAALGwEBfyAABEAgACgCACIBBEAgARAjCyAAECMLC0kBAn9BBBAeIQFBIBAeIgBBADYCHCAAQoCAgICAgIDAPzcCFCAAQgA3AgwgAEEAOgAIIABBAzYCBCAAQQA2AgAgASAANgIAIAELIAAgAkEFR0EAIAIbRQRAQbgwIAMgBBBJDwsgAyAEEHALIgEBfiABIAKtIAOtQiCGhCAEIAARFQAiBUIgiKckASAFpwuoAQEFfyAAKAJUIgMoAgAhBSADKAIEIgQgACgCFCAAKAIcIgdrIgYgBCAGSRsiBgRAIAUgByAGECsaIAMgAygCACAGaiIFNgIAIAMgAygCBCAGayIENgIECyAEIAIgAiAESxsiBARAIAUgASAEECsaIAMgAygCACAEaiIFNgIAIAMgAygCBCAEazYCBAsgBUEAOgAAIAAgACgCLCIBNgIcIAAgATYCFCACCwQAQgALBABBAAuKBQIGfgJ/IAEgASgCAEEHakF4cSIBQRBqNgIAIAAhCSABKQMAIQMgASkDCCEGIwBBIGsiCCQAAkAgBkL///////////8AgyIEQoCAgICAgMCAPH0gBEKAgICAgIDA/8MAfVQEQCAGQgSGIANCPIiEIQQgA0L//////////w+DIgNCgYCAgICAgIAIWgRAIARCgYCAgICAgIDAAHwhAgwCCyAEQoCAgICAgICAQH0hAiADQoCAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgCEEgaiQAIAkgAiAGQoCAgICAgICAgH+DhL85AwALmRgDEn8BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIZQgBTBEBBASERQZkJIRMgAZoiAb0hGQwBCyAEQYAQcQRAQQEhEUGcCSETDAELQZ8JQZoJIARBAXEiERshEyARRSEVCwJAIBlCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txECkgACATIBEQJiAAQe0VQdweIAVBIHEiBRtB4RpB4B4gBRsgASABYhtBAxAmIABBICACIAMgBEGAwABzECkgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahCMASIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAVBIHIiDkHhAEYNAiAMKAIsIQlBBiADIANBAEgbDAELIAwgBkEdayIJNgIsIAFEAAAAAAAAsEGiIQFBBiADIANBAEgbCyELIAxBMGpBoAJBACAJQQBOG2oiDSEHA0AgBwJ/IAFEAAAAAAAA8EFjIAFEAAAAAAAAAABmcQRAIAGrDAELQQALIgM2AgAgB0EEaiEHIAEgA7ihRAAAAABlzc1BoiIBRAAAAAAAAAAAYg0ACwJAIAlBAEwEQCAJIQMgByEGIA0hCAwBCyANIQggCSEDA0BBHSADIANBHU4bIQMCQCAHQQRrIgYgCEkNACADrSEaQgAhGQNAIAYgGUL/////D4MgBjUCACAahnwiG0KAlOvcA4AiGUKA7JSjDH4gG3w+AgAgBkEEayIGIAhPDQALIBmnIgZFDQAgCEEEayIIIAY2AgALA0AgCCAHIgZJBEAgBkEEayIHKAIARQ0BCwsgDCAMKAIsIANrIgM2AiwgBiEHIANBAEoNAAsLIANBAEgEQCALQRlqQQluQQFqIQ8gDkHmAEYhEANAQQlBACADayIDIANBCU4bIQoCQCAGIAhNBEAgCCgCACEHDAELQYCU69wDIAp2IRRBfyAKdEF/cyEWQQAhAyAIIQcDQCAHIAMgBygCACIXIAp2ajYCACAWIBdxIBRsIQMgB0EEaiIHIAZJDQALIAgoAgAhByADRQ0AIAYgAzYCACAGQQRqIQYLIAwgDCgCLCAKaiIDNgIsIA0gCCAHRUECdGoiCCAQGyIHIA9BAnRqIAYgBiAHa0ECdSAPShshBiADQQBIDQALC0EAIQMCQCAGIAhNDQAgDSAIa0ECdUEJbCEDQQohByAIKAIAIgpBCkkNAANAIANBAWohAyAKIAdBCmwiB08NAAsLIAsgA0EAIA5B5gBHG2sgDkHnAEYgC0EAR3FrIgcgBiANa0ECdUEJbEEJa0gEQEEEQaQCIAlBAEgbIAxqIAdBgMgAaiIKQQltIg9BAnRqQdAfayEJQQohByAPQXdsIApqIgpBB0wEQANAIAdBCmwhByAKQQFqIgpBCEcNAAsLAkAgCSgCACIQIBAgB24iDyAHbCIKRiAJQQRqIhQgBkZxDQAgECAKayEQAkAgD0EBcUUEQEQAAAAAAABAQyEBIAdBgJTr3ANHIAggCU9yDQEgCUEEay0AAEEBcUUNAQtEAQAAAAAAQEMhAQtEAAAAAAAA4D9EAAAAAAAA8D9EAAAAAAAA+D8gBiAURhtEAAAAAAAA+D8gECAHQQF2IhRGGyAQIBRJGyEYAkAgFQ0AIBMtAABBLUcNACAYmiEYIAGaIQELIAkgCjYCACABIBigIAFhDQAgCSAHIApqIgM2AgAgA0GAlOvcA08EQANAIAlBADYCACAIIAlBBGsiCUsEQCAIQQRrIghBADYCAAsgCSAJKAIAQQFqIgM2AgAgA0H/k+vcA0sNAAsLIA0gCGtBAnVBCWwhA0EKIQcgCCgCACIKQQpJDQADQCADQQFqIQMgCiAHQQpsIgdPDQALCyAJQQRqIgcgBiAGIAdLGyEGCwNAIAYiByAITSIKRQRAIAdBBGsiBigCAEUNAQsLAkAgDkHnAEcEQCAEQQhxIQkMAQsgA0F/c0F/IAtBASALGyIGIANKIANBe0pxIgkbIAZqIQtBf0F+IAkbIAVqIQUgBEEIcSIJDQBBdyEGAkAgCg0AIAdBBGsoAgAiDkUNAEEKIQpBACEGIA5BCnANAANAIAYiCUEBaiEGIA4gCkEKbCIKcEUNAAsgCUF/cyEGCyAHIA1rQQJ1QQlsIQogBUFfcUHGAEYEQEEAIQkgCyAGIApqQQlrIgZBACAGQQBKGyIGIAYgC0obIQsMAQtBACEJIAsgAyAKaiAGakEJayIGQQAgBkEAShsiBiAGIAtKGyELC0F/IQogC0H9////B0H+////ByAJIAtyIhAbSg0BIAsgEEEAR2pBAWohDgJAIAVBX3EiFUHGAEYEQCADIA5B/////wdzSg0DIANBACADQQBKGyEGDAELIBIgAyADQR91IgZzIAZrrSASEEciBmtBAUwEQANAIAZBAWsiBkEwOgAAIBIgBmtBAkgNAAsLIAZBAmsiDyAFOgAAIAZBAWtBLUErIANBAEgbOgAAIBIgD2siBiAOQf////8Hc0oNAgsgBiAOaiIDIBFB/////wdzSg0BIABBICACIAMgEWoiBSAEECkgACATIBEQJiAAQTAgAiAFIARBgIAEcxApAkACQAJAIBVBxgBGBEAgDEEQaiIGQQhyIQMgBkEJciEJIA0gCCAIIA1LGyIKIQgDQCAINQIAIAkQRyEGAkAgCCAKRwRAIAYgDEEQak0NAQNAIAZBAWsiBkEwOgAAIAYgDEEQaksNAAsMAQsgBiAJRw0AIAxBMDoAGCADIQYLIAAgBiAJIAZrECYgCEEEaiIIIA1NDQALIBAEQCAAQYwlQQEQJgsgC0EATCAHIAhNcg0BA0AgCDUCACAJEEciBiAMQRBqSwRAA0AgBkEBayIGQTA6AAAgBiAMQRBqSw0ACwsgACAGQQkgCyALQQlOGxAmIAtBCWshBiAIQQRqIgggB08NAyALQQlKIQMgBiELIAMNAAsMAgsCQCALQQBIDQAgByAIQQRqIAcgCEsbIQogDEEQaiIGQQhyIQMgBkEJciENIAghBwNAIA0gBzUCACANEEciBkYEQCAMQTA6ABggAyEGCwJAIAcgCEcEQCAGIAxBEGpNDQEDQCAGQQFrIgZBMDoAACAGIAxBEGpLDQALDAELIAAgBkEBECYgBkEBaiEGIAkgC3JFDQAgAEGMJUEBECYLIAAgBiALIA0gBmsiBiAGIAtKGxAmIAsgBmshCyAHQQRqIgcgCk8NASALQQBODQALCyAAQTAgC0ESakESQQAQKSAAIA8gEiAPaxAmDAILIAshBgsgAEEwIAZBCWpBCUEAECkLIABBICACIAUgBEGAwABzECkgBSACIAIgBUgbIQoMAQsgEyAFQRp0QR91QQlxaiELAkAgA0ELSw0AQQwgA2shBkQAAAAAAAAwQCEYA0AgGEQAAAAAAAAwQKIhGCAGQQFrIgYNAAsgCy0AAEEtRgRAIBggAZogGKGgmiEBDAELIAEgGKAgGKEhAQsgEUECciEJIAVBIHEhCCASIAwoAiwiByAHQR91IgZzIAZrrSASEEciBkYEQCAMQTA6AA8gDEEPaiEGCyAGQQJrIg0gBUEPajoAACAGQQFrQS1BKyAHQQBIGzoAACAEQQhxIQYgDEEQaiEHA0AgByIFAn8gAZlEAAAAAAAA4EFjBEAgAaoMAQtBgICAgHgLIgdBkC9qLQAAIAhyOgAAIAYgA0EASnJFIAEgB7ehRAAAAAAAADBAoiIBRAAAAAAAAAAAYXEgBUEBaiIHIAxBEGprQQFHckUEQCAFQS46AAEgBUECaiEHCyABRAAAAAAAAAAAYg0AC0F/IQpB/f///wcgCSASIA1rIgVqIgZrIANIDQAgAEEgIAIgBgJ/AkAgA0UNACAHIAxBEGprIghBAmsgA04NACADQQJqDAELIAcgDEEQamsiCAsiB2oiAyAEECkgACALIAkQJiAAQTAgAiADIARBgIAEcxApIAAgDEEQaiAIECYgAEEwIAcgCGtBAEEAECkgACANIAUQJiAAQSAgAiADIARBgMAAcxApIAMgAiACIANIGyEKCyAMQbAEaiQAIAoLRgEBfyAAKAI8IQMjAEEQayIAJAAgAyABpyABQiCIpyACQf8BcSAAQQhqEBQQjQEhAiAAKQMIIQEgAEEQaiQAQn8gASACGwu+AgEHfyMAQSBrIgMkACADIAAoAhwiBDYCECAAKAIUIQUgAyACNgIcIAMgATYCGCADIAUgBGsiATYCFCABIAJqIQVBAiEGIANBEGohAQJ/A0ACQAJAAkAgACgCPCABIAYgA0EMahAYEI0BRQRAIAUgAygCDCIHRg0BIAdBAE4NAgwDCyAFQX9HDQILIAAgACgCLCIBNgIcIAAgATYCFCAAIAEgACgCMGo2AhAgAgwDCyABIAcgASgCBCIISyIJQQN0aiIEIAcgCEEAIAkbayIIIAQoAgBqNgIAIAFBDEEEIAkbaiIBIAEoAgAgCGs2AgAgBSAHayEFIAYgCWshBiAEIQEMAQsLIABBADYCHCAAQgA3AxAgACAAKAIAQSByNgIAQQAgBkECRg0AGiACIAEoAgRrCyEEIANBIGokACAECwkAIAAoAjwQGQsjAQF/Qcg7KAIAIgAEQANAIAAoAgARCQAgACgCBCIADQALCwu/AgEFfyMAQeAAayICJAAgAiAANgIAIwBBEGsiAyQAIAMgAjYCDCMAQZABayIAJAAgAEGgL0GQARArIgAgAkEQaiIFIgE2AiwgACABNgIUIABB/////wdBfiABayIEIARB/////wdPGyIENgIwIAAgASAEaiIBNgIcIAAgATYCECAAQbsTIAJBAEEAEIsBGiAEBEAgACgCFCIBIAEgACgCEEZrQQA6AAALIABBkAFqJAAgA0EQaiQAAkAgBSIAQQNxBEADQCAALQAARQ0CIABBAWoiAEEDcQ0ACwsDQCAAIgFBBGohACABKAIAIgNBf3MgA0GBgoQIa3FBgIGChHhxRQ0ACwNAIAEiAEEBaiEBIAAtAAANAAsLIAAgBWtBAWoiABBhIgEEfyABIAUgABArBUEACyEAIAJB4ABqJAAgAAvFAQICfwF8IwBBMGsiBiQAIAEoAgghBwJAQbQ7LQAAQQFxBEBBsDsoAgAhAQwBC0EFQZAnEAwhAUG0O0EBOgAAQbA7IAE2AgALIAYgBTYCKCAGIAQ4AiAgBiADNgIYIAYgAjgCEAJ/IAEgB0GXGyAGQQxqIAZBEGoQEiIIRAAAAAAAAPBBYyAIRAAAAAAAAAAAZnEEQCAIqwwBC0EACyEBIAYoAgwhAyAAIAEpAwA3AwAgACABKQMINwMIIAMQESAGQTBqJAALCQAgABCQARAjCwwAIAAoAghB6BwQZgsJACAAEJIBECMLVQECfyMAQTBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEwEB4gAkEwECshACACQTBqJAAgAAs7AQF/IAEgACgCBCIFQQF1aiEBIAAoAgAhACABIAIgAyAEIAVBAXEEfyABKAIAIABqKAIABSAACxEdAAs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERIACzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRDAALNQEBfyABIAAoAgQiAkEBdWohASAAKAIAIQAgASACQQFxBH8gASgCACAAaigCAAUgAAsRCwALYQECfyMAQRBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEQEB4iACACKQMINwMIIAAgAikDADcDACACQRBqJAAgAAtjAQJ/IwBBEGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACADIAEgAiAEQQFxBH8gASgCACAAaigCAAUgAAsRAwBBEBAeIgAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiQAIAALNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEEAAs5AQF/IAEgACgCBCIEQQF1aiEBIAAoAgAhACABIAIgAyAEQQFxBH8gASgCACAAaigCAAUgAAsRCAALCQAgASAAEQIACwUAQcM7Cw8AIAEgACgCAGogAjYCAAsNACABIAAoAgBqKAIACxgBAX9BEBAeIgBCADcDCCAAQQA2AgAgAAsYAQF/QRAQHiIAQgA3AwAgAEIANwMIIAALDABBMBAeQQBBMBAqCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRHgALBQBBvjsLIQAgACABKAIAIAEgASwAC0EASBtBuzsgAigCABAQNgIACyoBAX9BDBAeIgFBADoABCABIAAoAgA2AgggAEEANgIAIAFB2Cc2AgAgAQsFAEG7OwsFAEG4OwshACAAIAEoAgAgASABLAALQQBIG0GkOyACKAIAEBA2AgAL2AEBBH8jAEEgayIDJAAgASgCACIEQfD///8HSQRAAkACQCAEQQtPBEAgBEEPckEBaiIFEB4hBiADIAVBgICAgHhyNgIQIAMgBjYCCCADIAQ2AgwgBCAGaiEFDAELIAMgBDoAEyADQQhqIgYgBGohBSAERQ0BCyAGIAFBBGogBBArGgsgBUEAOgAAIAMgAjYCACADQRhqIANBCGogAyAAEQMAIAMoAhgQHSADKAIYIgAQBiADKAIAEAYgAywAE0EASARAIAMoAggQIwsgA0EgaiQAIAAPCxACAAsqAQF/QQwQHiIBQQA6AAQgASAAKAIANgIIIABBADYCACABQeAmNgIAIAELBQBBpDsLaQECfyMAQRBrIgYkACABIAAoAgQiB0EBdWohASAAKAIAIQAgBiABIAIgAyAEIAUgB0EBcQR/IAEoAgAgAGooAgAFIAALERAAQRAQHiIAIAYpAwg3AwggACAGKQMANwMAIAZBEGokACAACwUAQaA7Cx0AIAAoAgAiACAALQAAQfcBcUEIQQAgARtyOgAAC6oBAgJ/AX0jAEEQayICJAAgACgCACEAIAFB/wFxIgNBBkkEQAJ/AkACQAJAIANBBGsOAgABAgsgAEHUA2ogAC0AiANBA3FBAkYNAhogAEHMA2oMAgsgAEHMA2ogAC0AiANBA3FBAkYNARogAEHUA2oMAQsgACABQf8BcUECdGpBzANqCyoCACEEIAJBEGokACAEuw8LIAJB7hA2AgAgAEEFQdglIAIQLBAkAAuqAQICfwF9IwBBEGsiAiQAIAAoAgAhACABQf8BcSIDQQZJBEACfwJAAkACQCADQQRrDgIAAQILIABBxANqIAAtAIgDQQNxQQJGDQIaIABBvANqDAILIABBvANqIAAtAIgDQQNxQQJGDQEaIABBxANqDAELIAAgAUH/AXFBAnRqQbwDagsqAgAhBCACQRBqJAAgBLsPCyACQe4QNgIAIABBBUHYJSACECwQJAALqgECAn8BfSMAQRBrIgIkACAAKAIAIQAgAUH/AXEiA0EGSQRAAn8CQAJAAkAgA0EEaw4CAAECCyAAQbQDaiAALQCIA0EDcUECRg0CGiAAQawDagwCCyAAQawDaiAALQCIA0EDcUECRg0BGiAAQbQDagwBCyAAIAFB/wFxQQJ0akGsA2oLKgIAIQQgAkEQaiQAIAS7DwsgAkHuEDYCACAAQQVB2CUgAhAsECQAC08AIAAgASgCACIBKgKcA7s5AwAgACABKgKkA7s5AwggACABKgKgA7s5AxAgACABKgKoA7s5AxggACABKgKMA7s5AyAgACABKgKQA7s5AygLDAAgACgCACoCkAO7CwwAIAAoAgAqAowDuwsMACAAKAIAKgKoA7sLDAAgACgCACoCoAO7CwwAIAAoAgAqAqQDuwsMACAAKAIAKgKcA7sL6AMCBH0FfyMAQUBqIgokACAAKAIAIQAgCkEIakEAQTgQKhpB8DpB8DooAgBBAWo2AgAgABB4IAAtABRBA3EiCCADQQEgA0H/AXEbIAgbIQkgAEEUaiEIIAG2IQQgACoC+AMhBQJ9AkACQAJAIAAtAPwDQQFrDgIBAAILIAUgBJRDCtcjPJQhBQsgBUMAAAAAYEUNACAAIAlB/wFxQQAgBCAEEDEgCEECQQEgBBAiIAhBAkEBIAQQIZKSDAELIAggCUH/AXFBACAEIAQQLSIFIAVbBEBBAiELIAggCUH/AXFBACAEIAQQLQwBCyAEIARcIQsgBAshByACtiEFIAAqAoAEIQYgACAHAn0CQAJAAkAgAC0AhARBAWsOAgEAAgsgBiAFlEMK1yM8lCEGCyAGQwAAAABgRQ0AIAAgCUH/AXFBASAFIAQQMSAIQQBBASAEECIgCEEAQQEgBBAhkpIMAQsgCCAJQf8BcSIJQQEgBSAEEC0iBiAGWwRAQQIhDCAIIAlBASAFIAQQLQwBCyAFIAVcIQwgBQsgA0H/AXEgCyAMIAQgBUEBQQAgCkEIakEAQfA6KAIAED0EQCAAIAAtAIgDQQNxIAQgBRB2IABEAAAAAAAAAABEAAAAAAAAAAAQcwsgCkFAayQACw0AIAAoAgAtAABBAXELFQAgACgCACIAIAAtAABB/gFxOgAACxAAIAAoAgAtAABBBHFBAnYLegECfyMAQRBrIgEkACAAKAIAIgAoAggEQANAIAAtAAAiAkEEcUUEQCAAIAJBBHI6AAAgACgCECICBEAgACACEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQELCyABQRBqJAAPCyABQYAINgIAIABBBUHYJSABECwQJAALLgEBfyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALIAAoAgBBADYCEAsXACAAKAIEKAIIIgAgACgCACgCCBEAAAsuAQF/IAAoAgghAiAAIAE2AgggAgRAIAIgAigCACgCBBEAAAsgACgCAEEFNgIQCz4BAX8gACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIAIgBBADYCCCAAIAAtAABB7wFxOgAAC0kBAX8jAEEQayIGJAAgBiABKAIEKAIEIgEgAiADIAQgBSABKAIAKAIIERAAIAAgBisDALY4AgAgACAGKwMItjgCBCAGQRBqJAALcwECfyMAQRBrIgIkACAAKAIEIQMgACABNgIEIAMEQCADIAMoAgAoAgQRAAALIAAoAgAiACgC6AMgACgC7ANHBEAgAkH5IzYCACAAQQVB2CUgAhAsECQACyAAQQQ2AgggACAALQAAQRByOgAAIAJBEGokAAs8AQF/AkAgACgCACIAKALsAyAAKALoAyIAa0ECdSABTQ0AIAAgAUECdGooAgAiAEUNACAAKAIEIQILIAILGQAgACgCACgC5AMiAEUEQEEADwsgACgCBAsXACAAKAIAIgAoAuwDIAAoAugDa0ECdQuOAwEDfyMAQdACayICJAACQCAAKAIAIgAoAuwDIAAoAugDRg0AIAEoAgAiAygC5AMhASAAIAMQb0UNACAAIAFGBEAgAkEIakEAQcQCECoaIAJBADoAGCACQgA3AxAgAkGAgID+BzYCDCACQRxqQQBBxAEQKhogAkHgAWohBCACQSBqIQEDQCABQoCAgPyLgIDAv383AhAgAUKBgICAEDcCCCABQoCAgPyLgIDAv383AgAgAUEYaiIBIARHDQALIAJCgICA/IuAgMC/fzcD8AEgAkKBgICAEDcD6AEgAkKAgID8i4CAwL9/NwPgASACQoCAgP6HgIDg/wA3AoQCIAJCgICA/oeAgOD/ADcC/AEgAiACLQD4AUH4AXE6APgBIAJBjAJqQQBBwAAQKhogA0GYAWogAkEIakHEAhArGiADQQA2AuQDCwNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIAJB0AJqJAAL4AcBCH8jAEHQAGsiByQAIAAoAgAhAAJAAkAgASgCACIIKALkA0UEQCAAKAIIDQEgCC0AF0EQdEGAgDBxQYCAIEYEQCAAIAAoAuADQQFqNgLgAwsgACgC6AMiASACQQJ0aiEGAkAgACgC7AMiBCAAQfADaiIDKAIAIgVJBEAgBCAGRgRAIAYgCDYCACAAIAZBBGo2AuwDDAILIAQgBCICQQRrIgFLBEADQCACIAEoAgA2AgAgAkEEaiECIAFBBGoiASAESQ0ACwsgACACNgLsAyAGQQRqIgEgBEcEQCAEIAQgAWsiAUF8cWsgBiABEDMaCyAGIAg2AgAMAQsgBCABa0ECdUEBaiIEQYCAgIAETw0DAkAgB0EgakH/////AyAFIAFrIgFBAXUiBSAEIAQgBUkbIAFB/P///wdPGyACIAMQSiIDKAIIIgIgAygCDEcNACADKAIEIgEgAygCACIESwRAIAMgASABIARrQQJ1QQFqQX5tQQJ0IgRqIAEgAiABayIBEDMgAWoiAjYCCCADIAMoAgQgBGo2AgQMAQsgB0E4akEBIAIgBGtBAXUgAiAERhsiASABQQJ2IAMoAhAQSiIFKAIIIQQCfyADKAIIIgIgAygCBCIBRgRAIAQhAiABDAELIAQgAiABa2ohAgNAIAQgASgCADYCACABQQRqIQEgBEEEaiIEIAJHDQALIAMoAgghASADKAIECyEEIAMoAgAhCSADIAUoAgA2AgAgBSAJNgIAIAMgBSgCBDYCBCAFIAQ2AgQgAyACNgIIIAUgATYCCCADKAIMIQogAyAFKAIMNgIMIAUgCjYCDCABIARHBEAgBSABIAQgAWtBA2pBfHFqNgIICyAJRQ0AIAkQIyADKAIIIQILIAIgCDYCACADIAMoAghBBGo2AgggAyADKAIEIAYgACgC6AMiAWsiAmsgASACEDM2AgQgAygCCCAGIAAoAuwDIAZrIgQQMyEGIAAoAugDIQEgACADKAIENgLoAyADIAE2AgQgACgC7AMhAiAAIAQgBmo2AuwDIAMgAjYCCCAAKALwAyEEIAAgAygCDDYC8AMgAyABNgIAIAMgBDYCDCABIAJHBEAgAyACIAEgAmtBA2pBfHFqNgIICyABRQ0AIAEQIwsgCCAANgLkAwNAIAAtAAAiAUEEcUUEQCAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQELCyAHQdAAaiQADwsgB0HEIzYCECAAQQVB2CUgB0EQahAsECQACyAHQckkNgIAIABBBUHYJSAHECwQJAALEAIACxAAIAAoAgAtAABBAnFBAXYLWQIBfwF9IwBBEGsiAiQAIAJBCGogACgCACIAQfwAaiAAIAFB/wFxQQF0ai8BaBAfQwAAwH8hAwJAAkAgAi0ADA4EAQAAAQALIAIqAgghAwsgAkEQaiQAIAMLTgEBfyMAQRBrIgMkACADQQhqIAEoAgAiAUH8AGogASACQf8BcUEBdGovAUQQHyADLQAMIQEgACADKgIIuzkDCCAAIAE2AgAgA0EQaiQAC14CAX8BfCMAQRBrIgIkACACQQhqIAAoAgAiAEH8AGogACABQf8BcUEBdGovAVYQH0QAAAAAAAD4fyEDAkACQCACLQAMDgQBAAABAAsgAioCCLshAwsgAkEQaiQAIAMLJAEBfUMAAMB/IAAoAgAiAEH8AGogAC8BehAgIgEgASABXBu7C0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXgQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXYQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXQQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXIQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXAQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAW4QHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0gCAX8BfQJ9IAAoAgAiAEH8AGoiASAALwEcECAiAiACXARAQwAAgD9DAAAAACAAKAL0Ay0ACEEBcRsMAQsgASAALwEcECALuws2AgF/AX0gACgCACIAQfwAaiIBIAAvARoQICICIAJcBEBEAAAAAAAAAAAPCyABIAAvARoQILsLRAEBfyMAQRBrIgIkACACQQhqIAEoAgAiAUH8AGogAS8BHhAfIAItAAwhASAAIAIqAgi7OQMIIAAgATYCACACQRBqJAALEAAgACgCAC0AF0ECdkEDcQsNACAAKAIALQAXQQNxC04BAX8jAEEQayIDJAAgA0EIaiABKAIAIgFB/ABqIAEgAkH/AXFBAXRqLwEgEB8gAy0ADCEBIAAgAyoCCLs5AwggACABNgIAIANBEGokAAsQACAAKAIALQAUQQR2QQdxCw0AIAAoAgAvABVBDnYLDQAgACgCAC0AFEEDcQsQACAAKAIALQAUQQJ2QQNxCw0AIAAoAgAvABZBD3ELEAAgACgCAC8AFUEEdkEPcQsNACAAKAIALwAVQQ9xC04BAX8jAEEQayIDJAAgA0EIaiABKAIAIgFB/ABqIAEgAkH/AXFBAXRqLwEyEB8gAy0ADCEBIAAgAyoCCLs5AwggACABNgIAIANBEGokAAsQACAAKAIALwAVQQx2QQNxCxAAIAAoAgAtABdBBHZBAXELgQECA38BfSMAQRBrIgMkACAAKAIAIQQCfSACtiIGIAZcBEBBACEAQwAAwH8MAQtBAEECIAZDAACAf1sgBkMAAID/W3IiBRshAEMAAMB/IAYgBRsLIQYgAyAAOgAMIAMgBjgCCCADIAMpAwg3AwAgBCABQf8BcSADEIgBIANBEGokAAt5AgF9An8jAEEQayIEJAAgACgCACEFIAQCfyACtiIDIANcBEBDAADAfyEDQQAMAQtDAADAfyADIANDAACAf1sgA0MAAID/W3IiABshAyAARQs6AAwgBCADOAIIIAQgBCkDCDcDACAFIAFB/wFxIAQQiAEgBEEQaiQAC3EBAX8CQCAAKAIAIgAtAAAiAkECcUEBdiABRg0AIAAgAkH9AXFBAkEAIAEbcjoAAANAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC4EBAgN/AX0jAEEQayIDJAAgACgCACEEAn0gArYiBiAGXARAQQAhAEMAAMB/DAELQQBBAiAGQwAAgH9bIAZDAACA/1tyIgUbIQBDAADAfyAGIAUbCyEGIAMgADoADCADIAY4AgggAyADKQMINwMAIAQgAUH/AXEgAxCOASADQRBqJAALeQIBfQJ/IwBBEGsiBCQAIAAoAgAhBSAEAn8gArYiAyADXARAQwAAwH8hA0EADAELQwAAwH8gAyADQwAAgH9bIANDAACA/1tyIgAbIQMgAEULOgAMIAQgAzgCCCAEIAQpAwg3AwAgBSABQf8BcSAEEI4BIARBEGokAAv5AQICfQR/IwBBEGsiBSQAIAAoAgAhAAJ/IAK2IgMgA1wEQEMAAMB/IQNBAAwBC0MAAMB/IAMgA0MAAIB/WyADQwAAgP9bciIGGyEDIAZFCyEGQQEhByAFQQhqIABB/ABqIgggACABQf8BcUEBdGpB1gBqIgEvAQAQHwJAAkAgAyAFKgIIIgRcBH8gBCAEWw0BIAMgA1wFIAcLRQ0AIAUtAAwgBkYNAQsgCCABIAMgBhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgBUEQaiQAC7UBAgN/An0CQCAAKAIAIgBB/ABqIgMgAEH6AGoiAi8BABAgIgYgAbYiBVsNACAFIAVbIgRFIAYgBlxxDQACQCAEIAVDAAAAAFsgBYtDAACAf1tyRXFFBEAgAiACLwEAQfj/A3E7AQAMAQsgAyACIAVBAxBMCwNAIAAtAAAiAkEEcQ0BIAAgAkEEcjoAACAAKAIQIgIEQCAAIAIRAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EBIAIQVSACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEBIAMQVSADQRBqJAALfAIDfwF9IwBBEGsiAiQAIAAoAgAhAwJ9IAG2IgUgBVwEQEEAIQBDAADAfwwBC0EAQQIgBUMAAIB/WyAFQwAAgP9bciIEGyEAQwAAwH8gBSAEGwshBSACIAA6AAwgAiAFOAIIIAIgAikDCDcDACADQQAgAhBVIAJBEGokAAt0AgF9An8jAEEQayIDJAAgACgCACEEIAMCfyABtiICIAJcBEBDAADAfyECQQAMAQtDAADAfyACIAJDAACAf1sgAkMAAID/W3IiABshAiAARQs6AAwgAyACOAIIIAMgAykDCDcDACAEQQAgAxBVIANBEGokAAt8AgN/AX0jAEEQayICJAAgACgCACEDAn0gAbYiBSAFXARAQQAhAEMAAMB/DAELQQBBAiAFQwAAgH9bIAVDAACA/1tyIgQbIQBDAADAfyAFIAQbCyEFIAIgADoADCACIAU4AgggAiACKQMINwMAIANBASACEFYgAkEQaiQAC3QCAX0CfyMAQRBrIgMkACAAKAIAIQQgAwJ/IAG2IgIgAlwEQEMAAMB/IQJBAAwBC0MAAMB/IAIgAkMAAIB/WyACQwAAgP9bciIAGyECIABFCzoADCADIAI4AgggAyADKQMINwMAIARBASADEFYgA0EQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EAIAIQViACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEAIAMQViADQRBqJAALPwEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIABBASABEEYgAUEQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EBIAIQRiACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEBIAMQRiADQRBqJAALPwEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIABBACABEEYgAUEQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EAIAIQRiACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEAIAMQRiADQRBqJAALoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRxqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRpqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLPQEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIAAgARBrIAFBEGokAAt6AgN/AX0jAEEQayICJAAgACgCACEDAn0gAbYiBSAFXARAQQAhAEMAAMB/DAELQQBBAiAFQwAAgH9bIAVDAACA/1tyIgQbIQBDAADAfyAFIAQbCyEFIAIgADoADCACIAU4AgggAiACKQMINwMAIAMgAhBrIAJBEGokAAtyAgF9An8jAEEQayIDJAAgACgCACEEIAMCfyABtiICIAJcBEBDAADAfyECQQAMAQtDAADAfyACIAJDAACAf1sgAkMAAID/W3IiABshAiAARQs6AAwgAyACOAIIIAMgAykDCDcDACAEIAMQayADQRBqJAALoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRhqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLkAEBAX8CQCAAKAIAIgBBF2otAAAiAkECdkEDcSABQf8BcUYNACAAIAAvABUgAkEQdHIiAjsAFSAAIAJB///PB3EgAUEDcUESdHJBEHY6ABcDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuNAQEBfwJAIAAoAgAiAEEXai0AACICQQNxIAFB/wFxRg0AIAAgAC8AFSACQRB0ciICOwAVIAAgAkH///MHcSABQQNxQRB0ckEQdjoAFwNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC0MBAX8jAEEQayICJAAgACgCACEAIAJBAzoADCACQYCAgP4HNgIIIAIgAikDCDcDACAAIAFB/wFxIAIQZSACQRBqJAALgAECA38BfSMAQRBrIgMkACAAKAIAIQQCfSACtiIGIAZcBEBBACEAQwAAwH8MAQtBAEECIAZDAACAf1sgBkMAAID/W3IiBRshAEMAAMB/IAYgBRsLIQYgAyAAOgAMIAMgBjgCCCADIAMpAwg3AwAgBCABQf8BcSADEGUgA0EQaiQAC3gCAX0CfyMAQRBrIgQkACAAKAIAIQUgBAJ/IAK2IgMgA1wEQEMAAMB/IQNBAAwBC0MAAMB/IAMgA0MAAIB/WyADQwAAgP9bciIAGyEDIABFCzoADCAEIAM4AgggBCAEKQMINwMAIAUgAUH/AXEgBBBlIARBEGokAAt3AQF/AkAgACgCACIALQAUIgJBBHZBB3EgAUH/AXFGDQAgACACQY8BcSABQQR0QfAAcXI6ABQDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuJAQEBfwJAIAFB/wFxIAAoAgAiAC8AFSICQQ52Rg0AIABBF2ogAiAALQAXQRB0ciICQRB2OgAAIAAgAkH//wBxIAFBDnRyOwAVA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLcAEBfwJAIAAoAgAiAC0AFCICQQNxIAFB/wFxRg0AIAAgAkH8AXEgAUEDcXI6ABQDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwt2AQF/AkAgACgCACIALQAUIgJBAnZBA3EgAUH/AXFGDQAgACACQfMBcSABQQJ0QQxxcjoAFANAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC48BAQF/AkAgACgCACIALwAVIgJBCHZBD3EgAUH/AXFGDQAgAEEXaiACIAAtABdBEHRyIgJBEHY6AAAgACACQf/hA3EgAUEPcUEIdHI7ABUDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuPAQEBfwJAIAFB/wFxIAAoAgAiAC8AFSAAQRdqLQAAQRB0ciICQfABcUEEdkYNACAAIAJBEHY6ABcgACACQY/+A3EgAUEEdEHwAXFyOwAVA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLhwEBAX8CQCAAKAIAIgAvABUgAEEXai0AAEEQdHIiAkEPcSABQf8BcUYNACAAIAJBEHY6ABcgACACQfD/A3EgAUEPcXI7ABUDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwtDAQF/IwBBEGsiAiQAIAAoAgAhACACQQM6AAwgAkGAgID+BzYCCCACIAIpAwg3AwAgACABQf8BcSACEGcgAkEQaiQAC4ABAgN/AX0jAEEQayIDJAAgACgCACEEAn0gArYiBiAGXARAQQAhAEMAAMB/DAELQQBBAiAGQwAAgH9bIAZDAACA/1tyIgUbIQBDAADAfyAGIAUbCyEGIAMgADoADCADIAY4AgggAyADKQMINwMAIAQgAUH/AXEgAxBnIANBEGokAAt4AgF9An8jAEEQayIEJAAgACgCACEFIAQCfyACtiIDIANcBEBDAADAfyEDQQAMAQtDAADAfyADIANDAACAf1sgA0MAAID/W3IiABshAyAARQs6AAwgBCADOAIIIAQgBCkDCDcDACAFIAFB/wFxIAQQZyAEQRBqJAALjwEBAX8CQCAAKAIAIgAvABUiAkEMdkEDcSABQf8BcUYNACAAQRdqIAIgAC0AF0EQdHIiAkEQdjoAACAAIAJB/58DcSABQQNxQQx0cjsAFQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC5ABAQF/AkAgACgCACIAQRdqLQAAIgJBBHZBAXEgAUH/AXFGDQAgACAALwAVIAJBEHRyIgI7ABUgACACQf//vwdxIAFBAXFBFHRyQRB2OgAXA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsL9g0CCH8CfSMAQRBrIgIkAAJAAkAgASgCACIFLQAUIAAoAgAiAS0AFHNB/wBxDQAgBS8AFSAFLQAXQRB0ciABLwAVIAEtABdBEHRyc0H//z9xDQAgBUH8AGohByABQfwAaiEIAkAgAS8AGCIAQQdxRQRAIAUtABhBB3FFDQELIAggABAgIgogByAFLwAYECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AGiIAQQdxRQRAIAUtABpBB3FFDQELIAggABAgIgogByAFLwAaECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AHCIAQQdxRQRAIAUtABxBB3FFDQELIAggABAgIgogByAFLwAcECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AHiIAQQdxRQRAIAUtAB5BB3FFDQELIAJBCGogCCAAEB8gAiAHIAUvAB4QH0EBIQAgAioCCCIKIAIqAgAiC1wEfyAKIApbDQIgCyALXAUgAAtFDQEgAi0ADCACLQAERw0BCyAFQSBqIQAgAUEgaiEGA0ACQCAGIANBAXRqLwAAIgRBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAQQHyACIAcgAC8AABAfQQEhBCACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSAEC0UNAiACLQAMIAItAARHDQILIABBAmohACADQQFqIgNBCUcNAAsgBUEyaiEAIAFBMmohBkEAIQMDQAJAIAYgA0EBdGovAAAiBEEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBBAfIAIgByAALwAAEB9BASEEIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAQLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAIANBAWoiA0EJRw0ACyAFQcQAaiEAIAFBxABqIQZBACEDA0ACQCAGIANBAXRqLwAAIgRBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAQQHyACIAcgAC8AABAfQQEhBCACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSAEC0UNAiACLQAMIAItAARHDQILIABBAmohACADQQFqIgNBCUcNAAsgBUHWAGohACABQdYAaiEGQQAhAwNAAkAgBiADQQF0ai8AACIEQQdxRQRAIAAtAABBB3FFDQELIAJBCGogCCAEEB8gAiAHIAAvAAAQH0EBIQQgAioCCCIKIAIqAgAiC1wEfyAKIApbDQMgCyALXAUgBAtFDQIgAi0ADCACLQAERw0CCyAAQQJqIQAgA0EBaiIDQQlHDQALIAVB6ABqIQAgAUHoAGohBkEAIQMDQAJAIAYgA0EBdGovAAAiBEEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBBAfIAIgByAALwAAEB9BASEEIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAQLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAIANBAWoiA0EDRw0ACyAFQe4AaiEAIAFB7gBqIQlBACEEQQAhAwNAAkAgCSADQQF0ai8AACIGQQdxRQRAIAAtAABBB3FFDQELIAJBCGogCCAGEB8gAiAHIAAvAAAQH0EBIQMgAioCCCIKIAIqAgAiC1wEfyAKIApbDQMgCyALXAUgAwtFDQIgAi0ADCACLQAERw0CCyAAQQJqIQBBASEDIAQhBkEBIQQgBkUNAAsgBUHyAGohACABQfIAaiEJQQAhBEEAIQMDQAJAIAkgA0EBdGovAAAiBkEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBhAfIAIgByAALwAAEB9BASEDIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAMLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAQQEhAyAEIQZBASEEIAZFDQALIAVB9gBqIQAgAUH2AGohCUEAIQRBACEDA0ACQCAJIANBAXRqLwAAIgZBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAYQHyACIAcgAC8AABAfQQEhAyACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSADC0UNAiACLQAMIAItAARHDQILIABBAmohAEEBIQMgBCEGQQEhBCAGRQ0ACyABLwB6IgBBB3FFBEAgBS0AekEHcUUNAgsgCCAAECAiCiAHIAUvAHoQICILWw0BIAogClsNACALIAtcDQELIAFBFGogBUEUakHoABArGiABQfwAaiAFQfwAahCgAQNAIAEtAAAiAEEEcQ0BIAEgAEEEcjoAACABKAIQIgAEQCABIAARAAALIAFBgICA/gc2ApwBIAEoAuQDIgENAAsLIAJBEGokAAvGAwEEfyMAQaAEayICJAAgACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALAkAgACgCACIAKALoAyAAKALsA0YEQCAAKALkAw0BIAAgAkEYaiAAKAL0AxBcIgEpAgA3AgAgACABKAIQNgIQIAAgASkCCDcCCCAAQRRqIAFBFGpB6AAQKxogACABKQKMATcCjAEgACABKQKEATcChAEgACABKQJ8NwJ8IAEoApQBIQQgAUEANgKUASAAKAKUASEDIAAgBDYClAEgAwRAIAMQWwsgAEGYAWogAUGYAWpB0AIQKxogACgC6AMiAwRAIAAgAzYC7AMgAxAjCyAAIAEoAugDNgLoAyAAIAEoAuwDNgLsAyAAIAEoAvADNgLwAyABQQA2AvADIAFCADcC6AMgACABKQL8AzcC/AMgACABKQL0AzcC9AMgACABKAKEBDYChAQgASgClAEhACABQQA2ApQBIAAEQCAAEFsLIAJBoARqJAAPCyACQfAcNgIQIABBBUHYJSACQRBqECwQJAALIAJB5hE2AgAgAEEFQdglIAIQLBAkAAsLAEEMEB4gABCiAQsLAEEMEB5BABCiAQsNACAAKAIALQAIQQFxCwoAIAAoAgAoAhQLGQAgAUH/AXEEQBACAAsgACgCACgCEEEBcQsYACAAKAIAIgAgAC0ACEH+AXEgAXI6AAgLJgAgASAAKAIAIgAoAhRHBEAgACABNgIUIAAgACgCDEEBajYCDAsLkgEBAn8jAEEQayICJAAgACgCACEAIAFDAAAAAGAEQCABIAAqAhhcBEAgACABOAIYIAAgACgCDEEBajYCDAsgAkEQaiQADwsgAkGIFDYCACMAQRBrIgMkACADIAI2AgwCQCAARQRAQbgwQdglIAIQSRoMAQsgAEEAQQVB2CUgAiAAKAIEEQ0AGgsgA0EQaiQAECQACz8AIAFB/wFxRQRAIAIgACgCACIAKAIQIgFBAXFHBEAgACABQX5xIAJyNgIQIAAgACgCDEEBajYCDAsPCxACAAsL4CYjAEGACAuBHk9ubHkgbGVhZiBub2RlcyB3aXRoIGN1c3RvbSBtZWFzdXJlIGZ1bmN0aW9ucyBzaG91bGQgbWFudWFsbHkgbWFyayB0aGVtc2VsdmVzIGFzIGRpcnR5AGlzRGlydHkAbWFya0RpcnR5AGRlc3Ryb3kAc2V0RGlzcGxheQBnZXREaXNwbGF5AHNldEZsZXgALSsgICAwWDB4AC0wWCswWCAwWC0weCsweCAweABzZXRGbGV4R3JvdwBnZXRGbGV4R3JvdwBzZXRPdmVyZmxvdwBnZXRPdmVyZmxvdwBoYXNOZXdMYXlvdXQAY2FsY3VsYXRlTGF5b3V0AGdldENvbXB1dGVkTGF5b3V0AHVuc2lnbmVkIHNob3J0AGdldENoaWxkQ291bnQAdW5zaWduZWQgaW50AHNldEp1c3RpZnlDb250ZW50AGdldEp1c3RpZnlDb250ZW50AGF2YWlsYWJsZUhlaWdodCBpcyBpbmRlZmluaXRlIHNvIGhlaWdodFNpemluZ01vZGUgbXVzdCBiZSBTaXppbmdNb2RlOjpNYXhDb250ZW50AGF2YWlsYWJsZVdpZHRoIGlzIGluZGVmaW5pdGUgc28gd2lkdGhTaXppbmdNb2RlIG11c3QgYmUgU2l6aW5nTW9kZTo6TWF4Q29udGVudABzZXRBbGlnbkNvbnRlbnQAZ2V0QWxpZ25Db250ZW50AGdldFBhcmVudABpbXBsZW1lbnQAc2V0TWF4SGVpZ2h0UGVyY2VudABzZXRIZWlnaHRQZXJjZW50AHNldE1pbkhlaWdodFBlcmNlbnQAc2V0RmxleEJhc2lzUGVyY2VudABzZXRHYXBQZXJjZW50AHNldFBvc2l0aW9uUGVyY2VudABzZXRNYXJnaW5QZXJjZW50AHNldE1heFdpZHRoUGVyY2VudABzZXRXaWR0aFBlcmNlbnQAc2V0TWluV2lkdGhQZXJjZW50AHNldFBhZGRpbmdQZXJjZW50AGhhbmRsZS50eXBlKCkgPT0gU3R5bGVWYWx1ZUhhbmRsZTo6VHlwZTo6UG9pbnQgfHwgaGFuZGxlLnR5cGUoKSA9PSBTdHlsZVZhbHVlSGFuZGxlOjpUeXBlOjpQZXJjZW50AGNyZWF0ZURlZmF1bHQAdW5pdAByaWdodABoZWlnaHQAc2V0TWF4SGVpZ2h0AGdldE1heEhlaWdodABzZXRIZWlnaHQAZ2V0SGVpZ2h0AHNldE1pbkhlaWdodABnZXRNaW5IZWlnaHQAZ2V0Q29tcHV0ZWRIZWlnaHQAZ2V0Q29tcHV0ZWRSaWdodABsZWZ0AGdldENvbXB1dGVkTGVmdAByZXNldABfX2Rlc3RydWN0AGZsb2F0AHVpbnQ2NF90AHVzZVdlYkRlZmF1bHRzAHNldFVzZVdlYkRlZmF1bHRzAHNldEFsaWduSXRlbXMAZ2V0QWxpZ25JdGVtcwBzZXRGbGV4QmFzaXMAZ2V0RmxleEJhc2lzAENhbm5vdCBnZXQgbGF5b3V0IHByb3BlcnRpZXMgb2YgbXVsdGktZWRnZSBzaG9ydGhhbmRzAHNldFBvaW50U2NhbGVGYWN0b3IATWVhc3VyZUNhbGxiYWNrV3JhcHBlcgBEaXJ0aWVkQ2FsbGJhY2tXcmFwcGVyAENhbm5vdCByZXNldCBhIG5vZGUgc3RpbGwgYXR0YWNoZWQgdG8gYSBvd25lcgBzZXRCb3JkZXIAZ2V0Qm9yZGVyAGdldENvbXB1dGVkQm9yZGVyAGdldE51bWJlcgBoYW5kbGUudHlwZSgpID09IFN0eWxlVmFsdWVIYW5kbGU6OlR5cGU6Ok51bWJlcgB1bnNpZ25lZCBjaGFyAHRvcABnZXRDb21wdXRlZFRvcABzZXRGbGV4V3JhcABnZXRGbGV4V3JhcABzZXRHYXAAZ2V0R2FwACVwAHNldEhlaWdodEF1dG8Ac2V0RmxleEJhc2lzQXV0bwBzZXRQb3NpdGlvbkF1dG8Ac2V0TWFyZ2luQXV0bwBzZXRXaWR0aEF1dG8AU2NhbGUgZmFjdG9yIHNob3VsZCBub3QgYmUgbGVzcyB0aGFuIHplcm8Ac2V0QXNwZWN0UmF0aW8AZ2V0QXNwZWN0UmF0aW8Ac2V0UG9zaXRpb24AZ2V0UG9zaXRpb24Abm90aWZ5T25EZXN0cnVjdGlvbgBzZXRGbGV4RGlyZWN0aW9uAGdldEZsZXhEaXJlY3Rpb24Ac2V0RGlyZWN0aW9uAGdldERpcmVjdGlvbgBzZXRNYXJnaW4AZ2V0TWFyZ2luAGdldENvbXB1dGVkTWFyZ2luAG1hcmtMYXlvdXRTZWVuAG5hbgBib3R0b20AZ2V0Q29tcHV0ZWRCb3R0b20AYm9vbABlbXNjcmlwdGVuOjp2YWwAc2V0RmxleFNocmluawBnZXRGbGV4U2hyaW5rAHNldEFsd2F5c0Zvcm1zQ29udGFpbmluZ0Jsb2NrAE1lYXN1cmVDYWxsYmFjawBEaXJ0aWVkQ2FsbGJhY2sAZ2V0TGVuZ3RoAHdpZHRoAHNldE1heFdpZHRoAGdldE1heFdpZHRoAHNldFdpZHRoAGdldFdpZHRoAHNldE1pbldpZHRoAGdldE1pbldpZHRoAGdldENvbXB1dGVkV2lkdGgAcHVzaAAvaG9tZS9ydW5uZXIvd29yay95b2dhL3lvZ2EvamF2YXNjcmlwdC8uLi95b2dhL3N0eWxlL1NtYWxsVmFsdWVCdWZmZXIuaAAvaG9tZS9ydW5uZXIvd29yay95b2dhL3lvZ2EvamF2YXNjcmlwdC8uLi95b2dhL3N0eWxlL1N0eWxlVmFsdWVQb29sLmgAdW5zaWduZWQgbG9uZwBzZXRCb3hTaXppbmcAZ2V0Qm94U2l6aW5nAHN0ZDo6d3N0cmluZwBzdGQ6OnN0cmluZwBzdGQ6OnUxNnN0cmluZwBzdGQ6OnUzMnN0cmluZwBzZXRQYWRkaW5nAGdldFBhZGRpbmcAZ2V0Q29tcHV0ZWRQYWRkaW5nAFRyaWVkIHRvIGNvbnN0cnVjdCBZR05vZGUgd2l0aCBudWxsIGNvbmZpZwBBdHRlbXB0aW5nIHRvIGNvbnN0cnVjdCBOb2RlIHdpdGggbnVsbCBjb25maWcAY3JlYXRlV2l0aENvbmZpZwBpbmYAc2V0QWxpZ25TZWxmAGdldEFsaWduU2VsZgBTaXplAHZhbHVlAFZhbHVlAGNyZWF0ZQBtZWFzdXJlAHNldFBvc2l0aW9uVHlwZQBnZXRQb3NpdGlvblR5cGUAaXNSZWZlcmVuY2VCYXNlbGluZQBzZXRJc1JlZmVyZW5jZUJhc2VsaW5lAGNvcHlTdHlsZQBkb3VibGUATm9kZQBleHRlbmQAaW5zZXJ0Q2hpbGQAZ2V0Q2hpbGQAcmVtb3ZlQ2hpbGQAdm9pZABzZXRFeHBlcmltZW50YWxGZWF0dXJlRW5hYmxlZABpc0V4cGVyaW1lbnRhbEZlYXR1cmVFbmFibGVkAGRpcnRpZWQAQ2Fubm90IHJlc2V0IGEgbm9kZSB3aGljaCBzdGlsbCBoYXMgY2hpbGRyZW4gYXR0YWNoZWQAdW5zZXRNZWFzdXJlRnVuYwB1bnNldERpcnRpZWRGdW5jAHNldEVycmF0YQBnZXRFcnJhdGEATWVhc3VyZSBmdW5jdGlvbiByZXR1cm5lZCBhbiBpbnZhbGlkIGRpbWVuc2lvbiB0byBZb2dhOiBbd2lkdGg9JWYsIGhlaWdodD0lZl0ARXhwZWN0IGN1c3RvbSBiYXNlbGluZSBmdW5jdGlvbiB0byBub3QgcmV0dXJuIE5hTgBOQU4ASU5GAGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8Y2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4Ac3RkOjpiYXNpY19zdHJpbmc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGRvdWJsZT4AQ2hpbGQgYWxyZWFkeSBoYXMgYSBvd25lciwgaXQgbXVzdCBiZSByZW1vdmVkIGZpcnN0LgBDYW5ub3Qgc2V0IG1lYXN1cmUgZnVuY3Rpb246IE5vZGVzIHdpdGggbWVhc3VyZSBmdW5jdGlvbnMgY2Fubm90IGhhdmUgY2hpbGRyZW4uAENhbm5vdCBhZGQgY2hpbGQ6IE5vZGVzIHdpdGggbWVhc3VyZSBmdW5jdGlvbnMgY2Fubm90IGhhdmUgY2hpbGRyZW4uAChudWxsKQBpbmRleCA8IDQwOTYgJiYgIlNtYWxsVmFsdWVCdWZmZXIgY2FuIG9ubHkgaG9sZCB1cCB0byA0MDk2IGNodW5rcyIAJXMKAAEAAAADAAAAAAAAAAIAAAADAAAAAQAAAAIAAAAAAAAAAQAAAAEAQYwmCwdpaQB2AHZpAEGgJgs3ox0AAKEdAADhHQAA2x0AAOEdAADbHQAAaWlpZmlmaQDUHQAApB0AAHZpaQClHQAA6B0AAGlpaQBB4CYLCcQAAADFAAAAxgBB9CYLDsQAAADHAAAAyAAAANQdAEGQJws+ox0AAOEdAADbHQAA4R0AANsdAADoHQAA4x0AAOgdAABpaWlpAAAAANQdAAC5HQAA1B0AALsdAAC8HQAA6B0AQdgnCwnJAAAAygAAAMsAQewnCxbJAAAAzAAAAMgAAAC/HQAA1B0AAL8dAEGQKAuiA9QdAAC/HQAA2x0AANUdAAB2aWlpaQAAANQdAAC/HQAA4R0AAHZpaWYAAAAA1B0AAL8dAADbHQAAdmlpaQAAAADUHQAAvx0AANUdAADVHQAAwB0AANsdAADbHQAAwB0AANUdAADAHQAAaQBkaWkAdmlpZAAAxB0AAMQdAAC/HQAA1B0AAMQdAADUHQAAxB0AAMMdAADUHQAAxB0AANsdAADUHQAAxB0AANsdAADiHQAAdmlpaWQAAADUHQAAxB0AAOIdAADbHQAAxR0AAMIdAADFHQAA2x0AAMIdAADFHQAA4h0AAMUdAADiHQAAxR0AANsdAABkaWlpAAAAAOEdAADEHQAA2x0AAGZpaWkAAAAA1B0AAMQdAADEHQAA3B0AANQdAADEHQAAxB0AANwdAADFHQAAxB0AAMQdAADEHQAAxB0AANwdAADUHQAAxB0AANUdAADVHQAAxB0AANQdAADEHQAAoR0AANQdAADEHQAAuR0AANUdAADFHQAAAAAAANQdAADEHQAA4h0AAOIdAADbHQAAdmlpZGRpAADBHQAAxR0AQcArC0EZAAoAGRkZAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABkAEQoZGRkDCgcAAQAJCxgAAAkGCwAACwAGGQAAABkZGQBBkSwLIQ4AAAAAAAAAABkACg0ZGRkADQAAAgAJDgAAAAkADgAADgBByywLAQwAQdcsCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT claudeShimmer claudeBlue_FOR_SYSTEM_SPINNER claudeBlueShimmer_FOR_SYSTEM_SPINNER file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/open/index.js github.com:anthropics/claude-cli-internal github.com/anthropics/claude-cli-internal github.com:anthropics/claude-cli-internal github.com/anthropics/claude-cli-internal file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/ide.ts report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude-code-action/ claude_desktop .claude claudemd_length claudemd_disabled 7. Reference local project files (CLAUDE.md, .claude/ directory) when relevant using Use this agent when the user asks questions ("Can Claude...", "Does Claude...", "How do I...") about: (1) Claude Code (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Claude Agent SDK - building custom agents; (3) Claude API (formerly Anthropic API) - API usage, tool use, Anthropic SDK usage. **IMPORTANT:** Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can resume using the "resume" parameter. mcp__claude_ai_Slack__slack_send_message mcp__claude_ai_Slack__slack_read_thread com.anthropic.claude_code.events claude-code /api/claude_code_grove /home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@grpc/grpc-js/build/src /home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@grpc/grpc-js/build/src claude-code claude_ai claudeai-proxy Configuration scope (e.g., project, user, local, claudeai, managed) Source for loading filesystem-based settings. 'user' - Global user settings (~/.claude/settings.json). 'project' - Project settings (.claude/settings.json). 'local' - Local settings (.claude/settings.local.json). claude_code_version .claude .claude tengu_write_claudemd platform.claude.com code.claude.com platform.claude.com code.claude.com claude-opus-4 claude-sonnet-4 claude-haiku-4 [claudeai-mcp] Checking gate (cached)... [claudeai-mcp] Gate returned: [claudeai-mcp] Disabled via gate tengu_claudeai_mcp_eligibility [claudeai-mcp] Disabled via env var [claudeai-mcp] No access token [claudeai-mcp] Missing user:mcp_servers scope (scopes= [claudeai-mcp] Fetching from claude.ai claudeai-proxy claudeai [claudeai-mcp] Fetched [claudeai-mcp] Fetch failed ^claude[-_]?context$ claude-context claudeai-proxy Initializing claude.ai proxy transport for server No claude.ai OAuth token found Using claude.ai proxy at claude.ai proxy transport created successfully . claude.ai MCP servers require ENABLE_CLAUDEAI_MCP_SERVERS=true. claude-code report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues claude.ai proxy connection failed after Authentication required for claude.ai proxy server No claude.ai OAuth token available claudeai-proxy claudecode/toolUseId _claude_fs_right: _claude_fs_left: _claude_fs_right: _claude_fs_left: _claude_fs_right: tengu_write_claudemd ^claude -h$ ^claude --help$ claude ^\s*alias\s+claude\s*= This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. claude @Claude Code - Tag @claude in issues and PR comments claude-review claude claude-review claude claude-review https://apps.apple.com/app/claude-by-anthropic/id6473753684 https://play.google.com/store/apps/details?id=com.anthropic.claude ultra-claude-md claude-ai-external-token , or run `claude /logout`. , or run `claude /logout`. claude.ai Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login. claude /logout claude /logout to sign out of claude.ai. https://docs.claude.com/s/claude-code-jetbrains anthropics/claude-plugins-official .claude claude-mcp-browser-bridge- Edit(~/.claude/settings.json) Edit(~/.claude/settings.json) - How to use: Run `claude mcp add -- ` - How to use: Create `.claude/skills/commit/SKILL.md` with instructions. Then type `/commit` to run it. - How to use: Add to `.claude/settings.json` under "hooks" key. - How to use: `claude -p "fix lint errors" --allowedTools "Edit,Read,Bash"` "claude_md_additions": [ IMPORTANT for claude_md_additions: PRIORITIZE instructions that appear MULTIPLE TIMES in the user data. If user told Claude the same thing in 2+ sessions (e.g., 'always run tests', 'use TypeScript'), that's a PRIME candidate - they shouldn't have to repeat themselves. claude_got_blocked claude-opus-4-6 claude-sonnet-4-5-20250929 claude-haiku-4-5-20251001 file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js .claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues .claude.json .claude.json .claude .claude report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues Run /install-github-app to tag @claude right from your Github issues and PRs Run claude --continue or claude --resume to resume a conversation Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project /plugin marketplace add anthropics/claude-code /plugin install frontend-design@claude-code-plugins frontend-design@claude-code-plugins claude claude claude-3-opus claude-3-7-sonnet claude-3-5-haiku ~/.claude/settings.json ~/.claude/CLAUDE.md /.claude/settings.local.json report the issue at https://github.com/anthropics/claude-code/issues @anthropic-ai/claude-code https://code.claude.com/docs/en/overview https://github.com/anthropics/claude-code/issues mcp__claude-in-chrome__ 2. **Read**: `.claude/settings.json` (or create if missing) 1. **Check the settings file** - Read ~/.claude/settings.json or .claude/settings.json 6. **Use --debug** - Run `claude --debug` to see hook execution logs https://www.schemastore.org/claude-code-keybindings.json https://code.claude.com/docs/en/keybindings Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts. Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts. The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`. Location: ~/.claude/keybindings.json /$bunfs/root/claude // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. var T5B=Object.create;var{getPrototypeOf:z5B,defineProperty:BHH,getOwnPropertyNames:icH,getOwnPropertyDescriptor:N5B}=Object,ncH=Object.prototype.hasOwnProperty,dA=(H,$,A)=>{for(let L of icH($))if(!ncH.call(H,L)&&L!=="default")BHH(H,L,{get:()=>$[L],enumerable:!0});if(A){for(let L of icH($))if(!ncH.call(A,L)&&L!=="default")BHH(A,L,{get:()=>$[L],enumerable:!0});return A}},b=(H,$,A)=>{A=H!=null?T5B(z5B(H)):{};let L=$||!H||!H.__esModule?BHH(A,"default",{value:H,enumerable:!0}):A;for(let I of icH(H))if(!ncH.call(L,I))BHH(L,I,{get:()=>H[I],enumerable:!0});return L},umA=new WeakMap,WN=(H)=>{var $=umA.get(H),A;if($)return $;if($=BHH({},"__esModule",{value:!0}),H&&typeof H==="object"||typeof H==="function")icH(H).map((L)=>!ncH.call($,L)&&BHH($,L,{get:()=>H[L],enumerable:!(A=N5B(H,L))||A.enumerable}));return umA.set(H,$),$},z=(H,$)=>()=>($||H(($={exports:{}}).exports,$),$.exports);var XA=(H,$)=>{for(var A in $)BHH(H,A,{get:$[A],enumerable:!0,configurable:!0,set:(L)=>$[A]=()=>L})};var K=(H,$)=>()=>(H&&($=H(H=0)),$);var gmA=z((FR1,O5B)=>{O5B.exports=require("/$bunfs/root/image-processor.node")});var mmA=z((KR1,x5B)=>{x5B.exports=require("/$bunfs/root/color-diff.node")});var pmA=z((QR1,S5B)=>{S5B.exports=require("/$bunfs/root/file-index.node")});var dmA=z((WR1,j5B)=>{j5B.exports=require("/$bunfs/root/ripgrep.node")});var R5B,rcH;var LS$=K(()=>{R5B=typeof global=="object"&&global&&global.Object===Object&&global,rcH=R5B});var y5B,v5B,aJ;var VN=K(()=>{LS$();y5B=typeof self=="object"&&self&&self.Object===Object&&self,v5B=rcH||y5B||Function("return this")(),aJ=v5B});var h5B,DQ;var fHH=K(()=>{VN();h5B=aJ.Symbol,DQ=h5B});function u5B(H){var $=b5B.call(H,XYH),A=H[XYH];try{H[XYH]=void 0;var L=!0}catch(D){}var I=k5B.call(H);if(L)if($)H[XYH]=A;else delete H[XYH];return I}var cmA,b5B,k5B,XYH,lmA;var imA=K(()=>{fHH();cmA=Object.prototype,b5B=cmA.hasOwnProperty,k5B=cmA.toString,XYH=DQ?DQ.toStringTag:void 0;lmA=u5B});function p5B(H){return m5B.call(H)}var g5B,m5B,nmA;var rmA=K(()=>{g5B=Object.prototype,m5B=g5B.toString;nmA=p5B});function l5B(H){if(H==null)return H===void 0?c5B:d5B;return amA&&amA in Object(H)?lmA(H):nmA(H)}var d5B="[object Null]",c5B="[object Undefined]",amA,iC;var EHH=K(()=>{fHH();imA();rmA();amA=DQ?DQ.toStringTag:void 0;iC=l5B});function i5B(H){var $=typeof H;return H!=null&&($=="object"||$=="function")}var f5;var hZ=K(()=>{f5=i5B});function t5B(H){if(!f5(H))return!1;var $=iC(H);return $==r5B||$==a5B||$==n5B||$==o5B}var n5B="[object AsyncFunction]",r5B="[object Function]",a5B="[object GeneratorFunction]",o5B="[object Proxy]",hfH;var acH=K(()=>{EHH();hZ();hfH=t5B});var s5B,ocH;var omA=K(()=>{VN();s5B=aJ["__core-js_shared__"],ocH=s5B});function e5B(H){return!!tmA&&tmA in H}var tmA,smA;var emA=K(()=>{omA();tmA=function(){var H=/[^.]+$/.exec(ocH&&ocH.keys&&ocH.keys.IE_PROTO||"");return H?"Symbol(src)_1."+H:""}();smA=e5B});function AXB(H){if(H!=null){try{return $XB.call(H)}catch($){}try{return H+""}catch($){}}return""}var HXB,$XB,Dk;var IS$=K(()=>{HXB=Function.prototype,$XB=HXB.toString;Dk=AXB});function GXB(H){if(!f5(H)||smA(H))return!1;var $=hfH(H)?MXB:IXB;return $.test(Dk(H))}var LXB,IXB,DXB,BXB,fXB,EXB,MXB,HpA;var $pA=K(()=>{acH();emA();hZ();IS$();LXB=/[\\^$.*+?()[\]{}|]/g,IXB=/^\[object .+?Constructor\]$/,DXB=Function.prototype,BXB=Object.prototype,fXB=DXB.toString,EXB=BXB.hasOwnProperty,MXB=RegExp("^"+fXB.call(EXB).replace(LXB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");HpA=GXB});function UXB(H,$){return H==null?void 0:H[$]}var ApA;var LpA=K(()=>{ApA=UXB});function XXB(H,$){var A=ApA(H,$);return HpA(A)?A:void 0}var Y_;var Yc=K(()=>{$pA();LpA();Y_=XXB});var JXB,Bk;var JYH=K(()=>{Yc();JXB=Y_(Object,"create"),Bk=JXB});function FXB(){this.__data__=Bk?Bk(null):{},this.size=0}var IpA;var DpA=K(()=>{JYH();IpA=FXB});function KXB(H){var $=this.has(H)&&delete this.__data__[H];return this.size-=$?1:0,$}var BpA;var fpA=K(()=>{BpA=KXB});function PXB(H){var $=this.__data__;if(Bk){var A=$[H];return A===QXB?void 0:A}return VXB.call($,H)?$[H]:void 0}var QXB="__lodash_hash_undefined__",WXB,VXB,EpA;var MpA=K(()=>{JYH();WXB=Object.prototype,VXB=WXB.hasOwnProperty;EpA=PXB});function CXB(H){var $=this.__data__;return Bk?$[H]!==void 0:YXB.call($,H)}var _XB,YXB,GpA;var UpA=K(()=>{JYH();_XB=Object.prototype,YXB=_XB.hasOwnProperty;GpA=CXB});function ZXB(H,$){var A=this.__data__;return this.size+=this.has(H)?0:1,A[H]=Bk&&$===void 0?wXB:$,this}var wXB="__lodash_hash_undefined__",XpA;var JpA=K(()=>{JYH();XpA=ZXB});function bfH(H){var $=-1,A=H==null?0:H.length;this.clear();while(++${DpA();fpA();MpA();UpA();JpA();bfH.prototype.clear=IpA;bfH.prototype.delete=BpA;bfH.prototype.get=EpA;bfH.prototype.has=GpA;bfH.prototype.set=XpA;DS$=bfH});function qXB(){this.__data__=[],this.size=0}var KpA;var QpA=K(()=>{KpA=qXB});function TXB(H,$){return H===$||H!==H&&$!==$}var ij;var kfH=K(()=>{ij=TXB});function zXB(H,$){var A=H.length;while(A--)if(ij(H[A][0],$))return A;return-1}var Cc;var FYH=K(()=>{kfH();Cc=zXB});function xXB(H){var $=this.__data__,A=Cc($,H);if(A<0)return!1;var L=$.length-1;if(A==L)$.pop();else OXB.call($,A,1);return--this.size,!0}var NXB,OXB,WpA;var VpA=K(()=>{FYH();NXB=Array.prototype,OXB=NXB.splice;WpA=xXB});function SXB(H){var $=this.__data__,A=Cc($,H);return A<0?void 0:$[A][1]}var PpA;var _pA=K(()=>{FYH();PpA=SXB});function jXB(H){return Cc(this.__data__,H)>-1}var YpA;var CpA=K(()=>{FYH();YpA=jXB});function RXB(H,$){var A=this.__data__,L=Cc(A,H);if(L<0)++this.size,A.push([H,$]);else A[L][1]=$;return this}var wpA;var ZpA=K(()=>{FYH();wpA=RXB});function ufH(H){var $=-1,A=H==null?0:H.length;this.clear();while(++${QpA();VpA();_pA();CpA();ZpA();ufH.prototype.clear=KpA;ufH.prototype.delete=WpA;ufH.prototype.get=PpA;ufH.prototype.has=YpA;ufH.prototype.set=wpA;wc=ufH});var yXB,Zc;var tcH=K(()=>{Yc();VN();yXB=Y_(aJ,"Map"),Zc=yXB});function vXB(){this.size=0,this.__data__={hash:new DS$,map:new(Zc||wc),string:new DS$}}var qpA;var TpA=K(()=>{FpA();KYH();tcH();qpA=vXB});function hXB(H){var $=typeof H;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?H!=="__proto__":H===null}var zpA;var NpA=K(()=>{zpA=hXB});function bXB(H,$){var A=H.__data__;return zpA($)?A[typeof $=="string"?"string":"hash"]:A.map}var qc;var QYH=K(()=>{NpA();qc=bXB});function kXB(H){var $=qc(this,H).delete(H);return this.size-=$?1:0,$}var OpA;var xpA=K(()=>{QYH();OpA=kXB});function uXB(H){return qc(this,H).get(H)}var SpA;var jpA=K(()=>{QYH();SpA=uXB});function gXB(H){return qc(this,H).has(H)}var RpA;var ypA=K(()=>{QYH();RpA=gXB});function mXB(H,$){var A=qc(this,H),L=A.size;return A.set(H,$),this.size+=A.size==L?0:1,this}var vpA;var hpA=K(()=>{QYH();vpA=mXB});function gfH(H){var $=-1,A=H==null?0:H.length;this.clear();while(++${TpA();xpA();jpA();ypA();hpA();gfH.prototype.clear=qpA;gfH.prototype.delete=OpA;gfH.prototype.get=SpA;gfH.prototype.has=RpA;gfH.prototype.set=vpA;MHH=gfH});function BS$(H,$){if(typeof H!="function"||$!=null&&typeof $!="function")throw TypeError(pXB);var A=function(){var L=arguments,I=$?$.apply(this,L):L[0],D=A.cache;if(D.has(I))return D.get(I);var B=H.apply(this,L);return A.cache=D.set(I,B)||D,B};return A.cache=new(BS$.Cache||MHH),A}var pXB="Expected a function",o$;var tD=K(()=>{scH();BS$.Cache=MHH;o$=BS$});function bpA(H){return($)=>{if($.code==="EPIPE")H.destroy()}}function kpA(){process.stdout.on("error",bpA(process.stdout)),process.stderr.on("error",bpA(process.stderr))}function upA(H,$){if(H.destroyed)return;H.write($)}function OD(H){upA(process.stdout,H)}function Tc(H){upA(process.stderr,H)}function dXB(H){let $=[],A=H.match(/^MCP server ["']([^"']+)["']/);if(A&&A[1])$.push("mcp"),$.push(A[1].toLowerCase());else{let D=H.match(/^([^:[]+):/);if(D&&D[1])$.push(D[1].trim().toLowerCase())}let L=H.match(/^\[([^\]]+)]/);if(L&&L[1])$.push(L[1].trim().toLowerCase());if(H.toLowerCase().includes("1p event:"))$.push("1p");let I=H.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(I&&I[1]){let D=I[1].trim().toLowerCase();if(D.length<30&&!D.includes(" "))$.push(D)}return Array.from(new Set($))}function cXB(H,$){if(!$)return!0;if(H.length===0)return!1;if($.isExclusive)return!H.some((A)=>$.exclude.includes(A));else return H.some((A)=>$.include.includes(A))}function mpA(H,$){if(!$)return!0;let A=dXB(H);return cXB(A,$)}var gpA;var ppA=K(()=>{tD();gpA=o$((H)=>{if(!H||H.trim()==="")return null;let $=H.split(",").map((D)=>D.trim()).filter(Boolean);if($.length===0)return null;let A=$.some((D)=>D.startsWith("!")),L=$.some((D)=>!D.startsWith("!"));if(A&&L)return null;let I=$.map((D)=>D.replace(/^!/,"").toLowerCase());return{include:A?[]:I,exclude:A?I:[],isExclusive:A}})});function lXB(){this.__data__=new wc,this.size=0}var dpA;var cpA=K(()=>{KYH();dpA=lXB});function iXB(H){var $=this.__data__,A=$.delete(H);return this.size=$.size,A}var lpA;var ipA=K(()=>{lpA=iXB});function nXB(H){return this.__data__.get(H)}var npA;var rpA=K(()=>{npA=nXB});function rXB(H){return this.__data__.has(H)}var apA;var opA=K(()=>{apA=rXB});function oXB(H,$){var A=this.__data__;if(A instanceof wc){var L=A.__data__;if(!Zc||L.length{KYH();tcH();scH();tpA=oXB});function mfH(H){var $=this.__data__=new wc(H);this.size=$.size}var nj;var WYH=K(()=>{KYH();cpA();ipA();rpA();opA();spA();mfH.prototype.clear=dpA;mfH.prototype.delete=lpA;mfH.prototype.get=npA;mfH.prototype.has=apA;mfH.prototype.set=tpA;nj=mfH});function sXB(H){return this.__data__.set(H,tXB),this}var tXB="__lodash_hash_undefined__",epA;var HdA=K(()=>{epA=sXB});function eXB(H){return this.__data__.has(H)}var $dA;var AdA=K(()=>{$dA=eXB});function ecH(H){var $=-1,A=H==null?0:H.length;this.__data__=new MHH;while(++${scH();HdA();AdA();ecH.prototype.add=ecH.prototype.push=epA;ecH.prototype.has=$dA;HlH=ecH});function HJB(H,$){var A=-1,L=H==null?0:H.length;while(++A{LdA=HJB});function $JB(H,$){return H.has($)}var $lH;var ES$=K(()=>{$lH=$JB});function IJB(H,$,A,L,I,D){var B=A&AJB,f=H.length,E=$.length;if(f!=E&&!(B&&E>f))return!1;var M=D.get(H),G=D.get($);if(M&&G)return M==$&&G==H;var U=-1,X=!0,J=A&LJB?new HlH:void 0;D.set(H,$),D.set($,H);while(++U{fS$();IdA();ES$();AlH=IJB});var DJB,pfH;var GS$=K(()=>{VN();DJB=aJ.Uint8Array,pfH=DJB});function BJB(H){var $=-1,A=Array(H.size);return H.forEach(function(L,I){A[++$]=[I,L]}),A}var DdA;var BdA=K(()=>{DdA=BJB});function fJB(H){var $=-1,A=Array(H.size);return H.forEach(function(L){A[++$]=L}),A}var dfH;var LlH=K(()=>{dfH=fJB});function YJB(H,$,A,L,I,D,B){switch(A){case _JB:if(H.byteLength!=$.byteLength||H.byteOffset!=$.byteOffset)return!1;H=H.buffer,$=$.buffer;case PJB:if(H.byteLength!=$.byteLength||!D(new pfH(H),new pfH($)))return!1;return!0;case GJB:case UJB:case FJB:return ij(+H,+$);case XJB:return H.name==$.name&&H.message==$.message;case KJB:case WJB:return H==$+"";case JJB:var f=DdA;case QJB:var E=L&EJB;if(f||(f=dfH),H.size!=$.size&&!E)return!1;var M=B.get(H);if(M)return M==$;L|=MJB,B.set(H,$);var G=AlH(f(H),f($),L,I,D,B);return B.delete(H),G;case VJB:if(US$)return US$.call(H)==US$.call($)}return!1}var EJB=1,MJB=2,GJB="[object Boolean]",UJB="[object Date]",XJB="[object Error]",JJB="[object Map]",FJB="[object Number]",KJB="[object RegExp]",QJB="[object Set]",WJB="[object String]",VJB="[object Symbol]",PJB="[object ArrayBuffer]",_JB="[object DataView]",fdA,US$,EdA;var MdA=K(()=>{fHH();GS$();kfH();MS$();BdA();LlH();fdA=DQ?DQ.prototype:void 0,US$=fdA?fdA.valueOf:void 0;EdA=YJB});function CJB(H,$){var A=-1,L=$.length,I=H.length;while(++A{cfH=CJB});var wJB,wE;var XV=K(()=>{wJB=Array.isArray,wE=wJB});function ZJB(H,$,A){var L=$(H);return wE(H)?L:cfH(L,A(H))}var DlH;var XS$=K(()=>{IlH();XV();DlH=ZJB});function qJB(H,$){var A=-1,L=H==null?0:H.length,I=0,D=[];while(++A{BlH=qJB});function TJB(){return[]}var flH;var FS$=K(()=>{flH=TJB});var zJB,NJB,GdA,OJB,lfH;var ElH=K(()=>{JS$();FS$();zJB=Object.prototype,NJB=zJB.propertyIsEnumerable,GdA=Object.getOwnPropertySymbols,OJB=!GdA?flH:function(H){if(H==null)return[];return H=Object(H),BlH(GdA(H),function($){return NJB.call(H,$)})},lfH=OJB});function xJB(H,$){var A=-1,L=Array(H);while(++A{UdA=xJB});function SJB(H){return H!=null&&typeof H=="object"}var sF;var rj=K(()=>{sF=SJB});function RJB(H){return sF(H)&&iC(H)==jJB}var jJB="[object Arguments]",KS$;var JdA=K(()=>{EHH();rj();KS$=RJB});var FdA,yJB,vJB,hJB,fk;var VYH=K(()=>{JdA();rj();FdA=Object.prototype,yJB=FdA.hasOwnProperty,vJB=FdA.propertyIsEnumerable,hJB=KS$(function(){return arguments}())?KS$:function(H){return sF(H)&&yJB.call(H,"callee")&&!vJB.call(H,"callee")},fk=hJB});function bJB(){return!1}var KdA;var QdA=K(()=>{KdA=bJB});var PYH={};XA(PYH,{default:()=>aj});var PdA,WdA,kJB,VdA,uJB,gJB,aj;var _YH=K(()=>{VN();QdA();PdA=typeof PYH=="object"&&PYH&&!PYH.nodeType&&PYH,WdA=PdA&&typeof MlH=="object"&&MlH&&!MlH.nodeType&&MlH,kJB=WdA&&WdA.exports===PdA,VdA=kJB?aJ.Buffer:void 0,uJB=VdA?VdA.isBuffer:void 0,gJB=uJB||KdA,aj=gJB});function dJB(H,$){var A=typeof H;return $=$==null?mJB:$,!!$&&(A=="number"||A!="symbol"&&pJB.test(H))&&(H>-1&&H%1==0&&H<$)}var mJB=9007199254740991,pJB,zc;var YYH=K(()=>{pJB=/^(?:0|[1-9]\d*)$/;zc=dJB});function lJB(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=cJB}var cJB=9007199254740991,ifH;var GlH=K(()=>{ifH=lJB});function QFB(H){return sF(H)&&ifH(H.length)&&!!NU[iC(H)]}var iJB="[object Arguments]",nJB="[object Array]",rJB="[object Boolean]",aJB="[object Date]",oJB="[object Error]",tJB="[object Function]",sJB="[object Map]",eJB="[object Number]",HFB="[object Object]",$FB="[object RegExp]",AFB="[object Set]",LFB="[object String]",IFB="[object WeakMap]",DFB="[object ArrayBuffer]",BFB="[object DataView]",fFB="[object Float32Array]",EFB="[object Float64Array]",MFB="[object Int8Array]",GFB="[object Int16Array]",UFB="[object Int32Array]",XFB="[object Uint8Array]",JFB="[object Uint8ClampedArray]",FFB="[object Uint16Array]",KFB="[object Uint32Array]",NU,_dA;var YdA=K(()=>{EHH();GlH();rj();NU={};NU[fFB]=NU[EFB]=NU[MFB]=NU[GFB]=NU[UFB]=NU[XFB]=NU[JFB]=NU[FFB]=NU[KFB]=!0;NU[iJB]=NU[nJB]=NU[DFB]=NU[rJB]=NU[BFB]=NU[aJB]=NU[oJB]=NU[tJB]=NU[sJB]=NU[eJB]=NU[HFB]=NU[$FB]=NU[AFB]=NU[LFB]=NU[IFB]=!1;_dA=QFB});function WFB(H){return function($){return H($)}}var nfH;var UlH=K(()=>{nfH=WFB});var CYH={};XA(CYH,{default:()=>oj});var CdA,wYH,VFB,QS$,PFB,oj;var JlH=K(()=>{LS$();CdA=typeof CYH=="object"&&CYH&&!CYH.nodeType&&CYH,wYH=CdA&&typeof XlH=="object"&&XlH&&!XlH.nodeType&&XlH,VFB=wYH&&wYH.exports===CdA,QS$=VFB&&rcH.process,PFB=function(){try{var H=wYH&&wYH.require&&wYH.require("util").types;if(H)return H;return QS$&&QS$.binding&&QS$.binding("util")}catch($){}}(),oj=PFB});var wdA,_FB,rfH;var FlH=K(()=>{YdA();UlH();JlH();wdA=oj&&oj.isTypedArray,_FB=wdA?nfH(wdA):_dA,rfH=_FB});function wFB(H,$){var A=wE(H),L=!A&&fk(H),I=!A&&!L&&aj(H),D=!A&&!L&&!I&&rfH(H),B=A||L||I||D,f=B?UdA(H.length,String):[],E=f.length;for(var M in H)if(($||CFB.call(H,M))&&!(B&&(M=="length"||I&&(M=="offset"||M=="parent")||D&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||zc(M,E))))f.push(M);return f}var YFB,CFB,KlH;var WS$=K(()=>{XdA();VYH();XV();_YH();YYH();FlH();YFB=Object.prototype,CFB=YFB.hasOwnProperty;KlH=wFB});function qFB(H){var $=H&&H.constructor,A=typeof $=="function"&&$.prototype||ZFB;return H===A}var ZFB,afH;var QlH=K(()=>{ZFB=Object.prototype;afH=qFB});function TFB(H,$){return function(A){return H($(A))}}var WlH;var VS$=K(()=>{WlH=TFB});var zFB,ZdA;var qdA=K(()=>{VS$();zFB=WlH(Object.keys,Object),ZdA=zFB});function xFB(H){if(!afH(H))return ZdA(H);var $=[];for(var A in Object(H))if(OFB.call(H,A)&&A!="constructor")$.push(A);return $}var NFB,OFB,TdA;var zdA=K(()=>{QlH();qdA();NFB=Object.prototype,OFB=NFB.hasOwnProperty;TdA=xFB});function SFB(H){return H!=null&&ifH(H.length)&&!hfH(H)}var tj;var ofH=K(()=>{acH();GlH();tj=SFB});function jFB(H){return tj(H)?KlH(H):TdA(H)}var bZ;var GHH=K(()=>{WS$();zdA();ofH();bZ=jFB});function RFB(H){return DlH(H,bZ,lfH)}var ZYH;var PS$=K(()=>{XS$();ElH();GHH();ZYH=RFB});function bFB(H,$,A,L,I,D){var B=A&yFB,f=ZYH(H),E=f.length,M=ZYH($),G=M.length;if(E!=G&&!B)return!1;var U=E;while(U--){var X=f[U];if(!(B?X in $:hFB.call($,X)))return!1}var J=D.get(H),F=D.get($);if(J&&F)return J==$&&F==H;var Q=!0;D.set(H,$),D.set($,H);var W=B;while(++U{PS$();vFB=Object.prototype,hFB=vFB.hasOwnProperty;NdA=bFB});var kFB,VlH;var xdA=K(()=>{Yc();VN();kFB=Y_(aJ,"DataView"),VlH=kFB});var uFB,PlH;var SdA=K(()=>{Yc();VN();uFB=Y_(aJ,"Promise"),PlH=uFB});var gFB,Nc;var _S$=K(()=>{Yc();VN();gFB=Y_(aJ,"Set"),Nc=gFB});var mFB,_lH;var jdA=K(()=>{Yc();VN();mFB=Y_(aJ,"WeakMap"),_lH=mFB});var RdA="[object Map]",pFB="[object Object]",ydA="[object Promise]",vdA="[object Set]",hdA="[object WeakMap]",bdA="[object DataView]",dFB,cFB,lFB,iFB,nFB,UHH,Ek;var qYH=K(()=>{xdA();tcH();SdA();_S$();jdA();EHH();IS$();dFB=Dk(VlH),cFB=Dk(Zc),lFB=Dk(PlH),iFB=Dk(Nc),nFB=Dk(_lH),UHH=iC;if(VlH&&UHH(new VlH(new ArrayBuffer(1)))!=bdA||Zc&&UHH(new Zc)!=RdA||PlH&&UHH(PlH.resolve())!=ydA||Nc&&UHH(new Nc)!=vdA||_lH&&UHH(new _lH)!=hdA)UHH=function(H){var $=iC(H),A=$==pFB?H.constructor:void 0,L=A?Dk(A):"";if(L)switch(L){case dFB:return bdA;case cFB:return RdA;case lFB:return ydA;case iFB:return vdA;case nFB:return hdA}return $};Ek=UHH});function oFB(H,$,A,L,I,D){var B=wE(H),f=wE($),E=B?udA:Ek(H),M=f?udA:Ek($);E=E==kdA?YlH:E,M=M==kdA?YlH:M;var G=E==YlH,U=M==YlH,X=E==M;if(X&&aj(H)){if(!aj($))return!1;B=!0,G=!1}if(X&&!G)return D||(D=new nj),B||rfH(H)?AlH(H,$,A,L,I,D):EdA(H,$,E,A,L,I,D);if(!(A&rFB)){var J=G&&gdA.call(H,"__wrapped__"),F=U&&gdA.call($,"__wrapped__");if(J||F){var Q=J?H.value():H,W=F?$.value():$;return D||(D=new nj),I(Q,W,A,L,D)}}if(!X)return!1;return D||(D=new nj),NdA(H,$,A,L,I,D)}var rFB=1,kdA="[object Arguments]",udA="[object Array]",YlH="[object Object]",aFB,gdA,mdA;var pdA=K(()=>{WYH();MS$();MdA();OdA();qYH();XV();_YH();FlH();aFB=Object.prototype,gdA=aFB.hasOwnProperty;mdA=oFB});function ddA(H,$,A,L,I){if(H===$)return!0;if(H==null||$==null||!sF(H)&&!sF($))return H!==H&&$!==$;return mdA(H,$,A,L,ddA,I)}var tfH;var ClH=K(()=>{pdA();rj();tfH=ddA});function eFB(H,$,A,L){var I=A.length,D=I,B=!L;if(H==null)return!D;H=Object(H);while(I--){var f=A[I];if(B&&f[2]?f[1]!==H[f[0]]:!(f[0]in H))return!1}while(++I{WYH();ClH();cdA=eFB});function HKB(H){return H===H&&!f5(H)}var wlH;var YS$=K(()=>{hZ();wlH=HKB});function $KB(H){var $=bZ(H),A=$.length;while(A--){var L=$[A],I=H[L];$[A]=[L,I,wlH(I)]}return $}var idA;var ndA=K(()=>{YS$();GHH();idA=$KB});function AKB(H,$){return function(A){if(A==null)return!1;return A[H]===$&&($!==void 0||(H in Object(A)))}}var ZlH;var CS$=K(()=>{ZlH=AKB});function LKB(H){var $=idA(H);if($.length==1&&$[0][2])return ZlH($[0][0],$[0][1]);return function(A){return A===H||cdA(A,H,$)}}var rdA;var adA=K(()=>{ldA();ndA();CS$();rdA=LKB});function DKB(H){return typeof H=="symbol"||sF(H)&&iC(H)==IKB}var IKB="[object Symbol]",sfH;var qlH=K(()=>{EHH();rj();sfH=DKB});function EKB(H,$){if(wE(H))return!1;var A=typeof H;if(A=="number"||A=="symbol"||A=="boolean"||H==null||sfH(H))return!0;return fKB.test(H)||!BKB.test(H)||$!=null&&H in Object($)}var BKB,fKB,efH;var TlH=K(()=>{XV();qlH();BKB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fKB=/^\w*$/;efH=EKB});function GKB(H){var $=o$(H,function(L){if(A.size===MKB)A.clear();return L}),A=$.cache;return $}var MKB=500,odA;var tdA=K(()=>{tD();odA=GKB});var UKB,XKB,JKB,sdA;var edA=K(()=>{tdA();UKB=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XKB=/\\(\\)?/g,JKB=odA(function(H){var $=[];if(H.charCodeAt(0)===46)$.push("");return H.replace(UKB,function(A,L,I,D){$.push(I?D.replace(XKB,"$1"):L||A)}),$}),sdA=JKB});function FKB(H,$){var A=-1,L=H==null?0:H.length,I=Array(L);while(++A{HEH=FKB});function AcA(H){if(typeof H=="string")return H;if(wE(H))return HEH(H,AcA)+"";if(sfH(H))return $cA?$cA.call(H):"";var $=H+"";return $=="0"&&1/H==-KKB?"-0":$}var KKB=1/0,HcA,$cA,LcA;var IcA=K(()=>{fHH();zlH();XV();qlH();HcA=DQ?DQ.prototype:void 0,$cA=HcA?HcA.toString:void 0;LcA=AcA});function QKB(H){return H==null?"":LcA(H)}var $EH;var NlH=K(()=>{IcA();$EH=QKB});function WKB(H,$){if(wE(H))return H;return efH(H,$)?[H]:sdA($EH(H))}var sj;var AEH=K(()=>{XV();TlH();edA();NlH();sj=WKB});function PKB(H){if(typeof H=="string"||sfH(H))return H;var $=H+"";return $=="0"&&1/H==-VKB?"-0":$}var VKB=1/0,kZ;var XHH=K(()=>{qlH();kZ=PKB});function _KB(H,$){$=sj($,H);var A=0,L=$.length;while(H!=null&&A{AEH();XHH();LEH=_KB});function YKB(H,$,A){var L=H==null?void 0:LEH(H,$);return L===void 0?A:L}var DcA;var BcA=K(()=>{OlH();DcA=YKB});function CKB(H,$){return H!=null&&$ in Object(H)}var fcA;var EcA=K(()=>{fcA=CKB});function wKB(H,$,A){$=sj($,H);var L=-1,I=$.length,D=!1;while(++L{AEH();VYH();XV();YYH();GlH();XHH();McA=wKB});function ZKB(H,$){return H!=null&&McA(H,$,fcA)}var UcA;var XcA=K(()=>{EcA();GcA();UcA=ZKB});function zKB(H,$){if(efH(H)&&wlH($))return ZlH(kZ(H),$);return function(A){var L=DcA(A,H);return L===void 0&&L===$?UcA(A,H):tfH($,L,qKB|TKB)}}var qKB=1,TKB=2,JcA;var FcA=K(()=>{ClH();BcA();XcA();TlH();YS$();CS$();XHH();JcA=zKB});function NKB(H){return H}var IEH;var xlH=K(()=>{IEH=NKB});function OKB(H){return function($){return $==null?void 0:$[H]}}var KcA;var QcA=K(()=>{KcA=OKB});function xKB(H){return function($){return LEH($,H)}}var WcA;var VcA=K(()=>{OlH();WcA=xKB});function SKB(H){return efH(H)?KcA(kZ(H)):WcA(H)}var PcA;var _cA=K(()=>{QcA();VcA();TlH();XHH();PcA=SKB});function jKB(H){if(typeof H=="function")return H;if(H==null)return IEH;if(typeof H=="object")return wE(H)?JcA(H[0],H[1]):rdA(H);return PcA(H)}var ej;var DEH=K(()=>{adA();FcA();xlH();XV();_cA();ej=jKB});function RKB(H,$){var A,L=-1,I=H.length;while(++L{YcA=RKB});function yKB(H,$){return H&&H.length?YcA(H,ej($,2)):0}var BEH;var wcA=K(()=>{DEH();CcA();BEH=yKB});function ZcA(H){return{name:H,default:30000,validate:($)=>{if(!$)return{effective:30000,status:"valid"};let A=parseInt($,10);if(isNaN(A)||A<=0)return{effective:30000,status:"invalid",message:`Invalid value "${$}" (using default: 30000)`};if(A>150000)return{effective:150000,status:"capped",message:`Capped from ${A} to 150000`};return{effective:A,status:"valid"}}}}var SlH,qcA,jlH;var TYH=K(()=>{SlH=ZcA("BASH_MAX_OUTPUT_LENGTH"),qcA=ZcA("TASK_MAX_OUTPUT_LENGTH"),jlH={name:"CLAUDE_CODE_MAX_OUTPUT_TOKENS",default:32000,validate:(H)=>{if(!H)return{effective:32000,status:"valid"};let L=parseInt(H,10);if(isNaN(L)||L<=0)return{effective:32000,status:"invalid",message:`Invalid value "${H}" (using default: 32000)`};if(L>64000)return{effective:64000,status:"capped",message:`Capped from ${L} to 64000`};return{effective:L,status:"valid"}}}});var TcA="claude-code-20250219",RlH="interleaved-thinking-2025-05-14",zYH="context-1m-2025-08-07",ylH="context-management-2025-06-27",Oc="structured-outputs-2025-12-15",wS$="web-search-2025-03-05",vlH="tool-examples-2025-10-29",zcA="advanced-tool-use-2025-11-20",NcA="tool-search-tool-2025-10-19",ZS$="effort-2025-11-24",qS$="adaptive-thinking-2026-01-28",NYH="prompt-caching-scope-2026-01-05",OcA="research-preview-2026-02-01",TS$,zS$;var JHH=K(()=>{TS$=new Set(["interleaved-thinking-2025-05-14","context-1m-2025-08-07","tool-search-tool-2025-10-19","tool-examples-2025-10-29"]),zS$=new Set(["claude-code-20250219","interleaved-thinking-2025-05-14","fine-grained-tool-streaming-2025-05-14","context-management-2025-06-27"])});function kKB(H){let $=H.toLowerCase();return $.includes("claude-sonnet-4")||$.includes("opus-4-6")}function JV(H,$){if(H.includes("[1m]")||$?.includes(zYH)&&kKB(H))return 1e6;return vKB}function xcA(H,$){if(!H)return{used:null,remaining:null};let A=H.input_tokens+H.cache_creation_input_tokens+H.cache_read_input_tokens,L=Math.round(A/$*100),I=Math.min(100,Math.max(0,L));return{used:I,remaining:100-I}}function fEH(H){let $=H.toLowerCase(),A;if($.includes("3-5"))A=8192;else if($.includes("claude-3-opus"))A=4096;else if($.includes("claude-3-sonnet"))A=8192;else if($.includes("claude-3-haiku"))A=4096;else if($.includes("opus-4-5"))A=64000;else if($.includes("opus-4"))A=32000;else if($.includes("sonnet-4")||$.includes("haiku-4"))A=64000;else A=hKB;return A}function hlH(H){return bKB}var vKB=200000,NS$=20000,hKB=32000,bKB=31999;var nC=K(()=>{JHH()});function ScA(){return OS$}function jcA(H){OS$=H}function E5(){OS$=null}var OS$=null;var dcA={};XA(dcA,{updateLastInteractionTime:()=>FHH,setUseCoworkPlugins:()=>aC,setTracerProvider:()=>llH,setTeleportedSessionInfo:()=>dYH,setSystemPromptSectionCacheEntry:()=>xj$,setSessionTrustAccepted:()=>Fj$,setSessionPersistenceDisabled:()=>Qj$,setSessionIngressToken:()=>VHH,setSessionId:()=>FV,setSessionBypassPermissionsMode:()=>Jj$,setSdkBetas:()=>nS$,setResumedTranscriptPath:()=>OYH,setQueuedCommandsSnapshot:()=>jj$,setOriginalCwd:()=>yS$,setOauthTokenFromFd:()=>PHH,setNeedsPlanModeExitAttachment:()=>$R,setNeedsDelegateModeExitAttachment:()=>mYH,setModelStrings:()=>vYH,setMeterProvider:()=>clH,setMeter:()=>rS$,setMainThreadAgentType:()=>YN,setMainLoopModelOverride:()=>KV,setLspRecommendationShownThisSession:()=>Cj$,setLoggerProvider:()=>plH,setLastAPIRequest:()=>Ej$,setIsRemoteMode:()=>Nj$,setIsInteractive:()=>$j$,setInlinePlugins:()=>Xj$,setInitialMainLoopModel:()=>iS$,setInitJsonSchema:()=>wj$,setHasUnknownModelCost:()=>ulH,setHasExitedPlanMode:()=>oC,setHasExitedDelegateMode:()=>Pj$,setFlagSettingsPath:()=>Lj$,setEventLogger:()=>dlH,setDirectConnectServerUrl:()=>uKB,setCwdState:()=>hS$,setCostStateForRestore:()=>yYH,setClientType:()=>Aj$,setApiKeyFromFd:()=>_HH,setAllowedSettingSources:()=>Uj$,setAdditionalDirectoriesForClaudeMd:()=>iYH,resetTotalDurationStateAndCost_FOR_TESTS_ONLY:()=>gKB,resetStateForTests:()=>bcA,resetSdkInitState:()=>kcA,resetModelStringsForTestingOnly:()=>mKB,resetCostState:()=>MEH,registerHookCallbacks:()=>CHH,regenerateSessionId:()=>jS$,preferThirdPartyAuthentication:()=>uYH,needsPlanModeExitAttachment:()=>Vj$,needsDelegateModeExitAttachment:()=>_j$,markFirstTeleportMessageLogged:()=>alH,isSessionPersistenceDisabled:()=>uZ,hasUnknownModelCost:()=>lS$,hasShownLspRecommendationThisSession:()=>Yj$,hasExitedPlanModeInSession:()=>Wj$,hasExitedDelegateModeInSession:()=>lKB,handlePlanModeTransition:()=>_N,getUseCoworkPlugins:()=>gYH,getUsageForModel:()=>hcA,getTracerProvider:()=>WHH,getTotalWebSearchRequests:()=>cS$,getTotalToolDuration:()=>mS$,getTotalOutputTokens:()=>SYH,getTotalLinesRemoved:()=>QHH,getTotalLinesAdded:()=>KHH,getTotalInputTokens:()=>xYH,getTotalDuration:()=>EEH,getTotalCostUSD:()=>BQ,getTotalCacheReadInputTokens:()=>pS$,getTotalCacheCreationInputTokens:()=>dS$,getTotalAPIDurationWithoutRetries:()=>gS$,getTotalAPIDuration:()=>rC,getTokenCounter:()=>UEH,getTeleportedSessionInfo:()=>rlH,getSystemPromptSectionCache:()=>Oj$,getSlowOperations:()=>gcA,getSessionTrustAccepted:()=>Kj$,getSessionIngressToken:()=>Ij$,getSessionId:()=>j$,getSessionCounter:()=>aS$,getSessionBypassPermissionsMode:()=>Gk,getSdkBetas:()=>V6,getResumedTranscriptPath:()=>vS$,getRegisteredHooks:()=>pYH,getQueuedCommandsSnapshot:()=>tKB,getPromptCacheBreaks:()=>mcA,getProjectRoot:()=>oJ,getPrCounter:()=>hYH,getPlanSlugCache:()=>wHH,getParentSessionId:()=>RS$,getOriginalCwd:()=>zL,getOauthTokenFromFd:()=>Dj$,getModelUsage:()=>PN,getModelStrings:()=>GEH,getMeterProvider:()=>Hj$,getMeter:()=>pKB,getMainThreadAgentType:()=>lYH,getMainLoopModelOverride:()=>C_,getLoggerProvider:()=>bYH,getLocCounter:()=>glH,getLastInteractionTime:()=>jYH,getLastAPIRequest:()=>Mj$,getIsRemoteMode:()=>ZHH,getIsNonInteractiveSession:()=>tI,getIsInteractive:()=>Mk,getInvokedSkills:()=>qj$,getInlinePlugins:()=>YHH,getInitialMainLoopModel:()=>RYH,getInitJsonSchema:()=>nlH,getInMemoryErrorLog:()=>dKB,getFlagSettingsPath:()=>xc,getEventLogger:()=>eS$,getEnvVarValidators:()=>fj$,getDirectConnectServerUrl:()=>bS$,getCwdState:()=>HR,getCostCounter:()=>tS$,getCommitCounter:()=>oS$,getCodeEditToolDecisionCounter:()=>sS$,getClientType:()=>kYH,getApiKeyFromFd:()=>Bj$,getAllowedSettingSources:()=>Gj$,getAgentColorMap:()=>ilH,getAdditionalDirectoriesForClaudeMd:()=>CN,getActiveTimeCounter:()=>mlH,clearSystemPromptSectionState:()=>Sj$,clearSlowOperations:()=>aKB,clearRegisteredPluginHooks:()=>Zj$,clearRegisteredHooks:()=>iKB,clearPromptCacheBreaks:()=>zj$,clearInvokedSkills:()=>nKB,addToTotalLinesChanged:()=>klH,addToTotalDurationState:()=>kS$,addToTotalCostState:()=>uS$,addToToolDuration:()=>blH,addToInMemoryErrorLog:()=>cKB,addSlowOperation:()=>rKB,addPromptCacheBreak:()=>Tj$,addInvokedSkill:()=>cYH});function vcA(){let H="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof xS$.realpathSync==="function")H=xS$.realpathSync(ycA.cwd());return{originalCwd:H,projectRoot:H,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:H,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,clientType:"cli",sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,sessionId:SS$.randomUUID(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,envVarValidators:[SlH,jlH],lastAPIRequest:null,inMemoryErrorLog:[],inlinePlugins:[],useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,hasExitedDelegateMode:!1,needsDelegateModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],promptCacheBreaks:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,directConnectServerUrl:void 0,systemPromptSectionCache:new Map,additionalDirectoriesForClaudeMd:[],resumedTranscriptPath:null}}function j$(){return k$.sessionId}function jS$(H={}){if(H.setCurrentAsParent)k$.parentSessionId=k$.sessionId;return k$.sessionId=SS$.randomUUID(),k$.resumedTranscriptPath=null,k$.sessionId}function RS$(){return k$.parentSessionId}function FV(H){if(k$.sessionId=H,process.env.CLAUDE_CODE_SESSION_ID!==void 0)process.env.CLAUDE_CODE_SESSION_ID=H}function zL(){return k$.originalCwd}function oJ(){return k$.projectRoot}function yS$(H){k$.originalCwd=H}function vS$(){return k$.resumedTranscriptPath}function OYH(H){k$.resumedTranscriptPath=H}function HR(){return k$.cwd}function hS$(H){k$.cwd=H}function bS$(){return k$.directConnectServerUrl}function uKB(H){k$.directConnectServerUrl=H}function kS$(H,$){k$.totalAPIDuration+=H,k$.totalAPIDurationWithoutRetries+=$}function gKB(){k$.totalAPIDuration=0,k$.totalAPIDurationWithoutRetries=0,k$.totalCostUSD=0}function uS$(H,$,A){k$.totalCostUSD+=H;let L=k$.modelUsage[A]??{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,webSearchRequests:0,costUSD:0,contextWindow:0,maxOutputTokens:0};L.inputTokens+=$.input_tokens,L.outputTokens+=$.output_tokens,L.cacheReadInputTokens+=$.cache_read_input_tokens??0,L.cacheCreationInputTokens+=$.cache_creation_input_tokens??0,L.webSearchRequests+=$.server_tool_use?.web_search_requests??0,L.costUSD+=H,L.contextWindow=JV(A,k$.sdkBetas),L.maxOutputTokens=fEH(A),k$.modelUsage[A]=L}function BQ(){return k$.totalCostUSD}function rC(){return k$.totalAPIDuration}function EEH(){return Date.now()-k$.startTime}function gS$(){return k$.totalAPIDurationWithoutRetries}function mS$(){return k$.totalToolDuration}function blH(H){k$.totalToolDuration+=H}function FHH(){k$.lastInteractionTime=Date.now()}function klH(H,$){k$.totalLinesAdded+=H,k$.totalLinesRemoved+=$}function KHH(){return k$.totalLinesAdded}function QHH(){return k$.totalLinesRemoved}function xYH(){return BEH(Object.values(k$.modelUsage),"inputTokens")}function SYH(){return BEH(Object.values(k$.modelUsage),"outputTokens")}function pS$(){return BEH(Object.values(k$.modelUsage),"cacheReadInputTokens")}function dS$(){return BEH(Object.values(k$.modelUsage),"cacheCreationInputTokens")}function cS$(){return BEH(Object.values(k$.modelUsage),"webSearchRequests")}function ulH(){k$.hasUnknownModelCost=!0}function lS$(){return k$.hasUnknownModelCost}function jYH(){return k$.lastInteractionTime}function PN(){return k$.modelUsage}function hcA(H){return k$.modelUsage[H]}function C_(){return k$.mainLoopModelOverride}function RYH(){return k$.initialMainLoopModel}function KV(H){k$.mainLoopModelOverride=H}function iS$(H){k$.initialMainLoopModel=H}function V6(){return k$.sdkBetas}function nS$(H){k$.sdkBetas=H}function MEH(){k$.totalCostUSD=0,k$.totalAPIDuration=0,k$.totalAPIDurationWithoutRetries=0,k$.totalToolDuration=0,k$.startTime=Date.now(),k$.totalLinesAdded=0,k$.totalLinesRemoved=0,k$.hasUnknownModelCost=!1,k$.modelUsage={}}function yYH({totalCostUSD:H,totalAPIDuration:$,totalAPIDurationWithoutRetries:A,totalToolDuration:L,totalLinesAdded:I,totalLinesRemoved:D,lastDuration:B,modelUsage:f}){if(k$.totalCostUSD=H,k$.totalAPIDuration=$,k$.totalAPIDurationWithoutRetries=A,k$.totalToolDuration=L,k$.totalLinesAdded=I,k$.totalLinesRemoved=D,f)k$.modelUsage=f;if(B)k$.startTime=Date.now()-B}function bcA(){throw Error("resetStateForTests can only be called in tests")}function GEH(){return k$.modelStrings}function vYH(H){k$.modelStrings=H}function mKB(){k$.modelStrings=null}function rS$(H,$){k$.meter=H,k$.sessionCounter=$("claude_code.session.count",{description:"Count of CLI sessions started"}),k$.locCounter=$("claude_code.lines_of_code.count",{description:"Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed"}),k$.prCounter=$("claude_code.pull_request.count",{description:"Number of pull requests created"}),k$.commitCounter=$("claude_code.commit.count",{description:"Number of git commits created"}),k$.costCounter=$("claude_code.cost.usage",{description:"Cost of the Claude Code session",unit:"USD"}),k$.tokenCounter=$("claude_code.token.usage",{description:"Number of tokens used",unit:"tokens"}),k$.codeEditToolDecisionCounter=$("claude_code.code_edit_tool.decision",{description:"Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools"}),k$.activeTimeCounter=$("claude_code.active_time.total",{description:"Total active time in seconds",unit:"s"})}function pKB(){return k$.meter}function aS$(){return k$.sessionCounter}function glH(){return k$.locCounter}function hYH(){return k$.prCounter}function oS$(){return k$.commitCounter}function tS$(){return k$.costCounter}function UEH(){return k$.tokenCounter}function sS$(){return k$.codeEditToolDecisionCounter}function mlH(){return k$.activeTimeCounter}function bYH(){return k$.loggerProvider}function plH(H){k$.loggerProvider=H}function eS$(){return k$.eventLogger}function dlH(H){k$.eventLogger=H}function Hj$(){return k$.meterProvider}function clH(H){k$.meterProvider=H}function WHH(){return k$.tracerProvider}function llH(H){k$.tracerProvider=H}function tI(){return!k$.isInteractive}function Mk(){return k$.isInteractive}function $j$(H){k$.isInteractive=H}function kYH(){return k$.clientType}function Aj$(H){k$.clientType=H}function ilH(){return k$.agentColorMap}function xc(){return k$.flagSettingsPath}function Lj$(H){k$.flagSettingsPath=H}function Ij$(){return k$.sessionIngressToken}function VHH(H){k$.sessionIngressToken=H}function Dj$(){return k$.oauthTokenFromFd}function PHH(H){k$.oauthTokenFromFd=H}function Bj$(){return k$.apiKeyFromFd}function _HH(H){k$.apiKeyFromFd=H}function fj$(){return k$.envVarValidators}function Ej$(H){k$.lastAPIRequest=H}function Mj$(){return k$.lastAPIRequest}function dKB(){return[...k$.inMemoryErrorLog]}function cKB(H){if(k$.inMemoryErrorLog.length>=100)k$.inMemoryErrorLog.shift();k$.inMemoryErrorLog.push(H)}function Gj$(){return k$.allowedSettingSources}function Uj$(H){k$.allowedSettingSources=H}function uYH(){return tI()&&k$.clientType!=="claude-vscode"}function Xj$(H){k$.inlinePlugins=H}function YHH(){return k$.inlinePlugins}function aC(H){k$.useCoworkPlugins=H,E5()}function gYH(){return k$.useCoworkPlugins}function Jj$(H){k$.sessionBypassPermissionsMode=H}function Gk(){return k$.sessionBypassPermissionsMode}function Fj$(H){k$.sessionTrustAccepted=H}function Kj$(){return k$.sessionTrustAccepted}function Qj$(H){k$.sessionPersistenceDisabled=H}function uZ(){return k$.sessionPersistenceDisabled}function Wj$(){return k$.hasExitedPlanMode}function oC(H){k$.hasExitedPlanMode=H}function Vj$(){return k$.needsPlanModeExitAttachment}function $R(H){k$.needsPlanModeExitAttachment=H}function _N(H,$){if($==="plan"&&H!=="plan")k$.needsPlanModeExitAttachment=!1;if(H==="plan"&&$!=="plan")k$.needsPlanModeExitAttachment=!0}function lKB(){return k$.hasExitedDelegateMode}function Pj$(H){k$.hasExitedDelegateMode=H}function _j$(){return k$.needsDelegateModeExitAttachment}function mYH(H){k$.needsDelegateModeExitAttachment=H}function Yj$(){return k$.lspRecommendationShownThisSession}function Cj$(H){k$.lspRecommendationShownThisSession=H}function wj$(H){k$.initJsonSchema=H}function nlH(){return k$.initJsonSchema}function CHH(H){if(!k$.registeredHooks)k$.registeredHooks={};for(let[$,A]of Object.entries(H)){let L=$;if(!k$.registeredHooks[L])k$.registeredHooks[L]=[];k$.registeredHooks[L].push(...A)}}function pYH(){return k$.registeredHooks}function iKB(){k$.registeredHooks=null}function Zj$(){if(!k$.registeredHooks)return;let H={};for(let[$,A]of Object.entries(k$.registeredHooks)){let L=A.filter((I)=>!("pluginRoot"in I));if(L.length>0)H[$]=L}k$.registeredHooks=Object.keys(H).length>0?H:null}function kcA(){k$.initJsonSchema=null,k$.registeredHooks=null}function wHH(){return k$.planSlugCache}function dYH(H){k$.teleportedSessionInfo={isTeleported:!0,hasLoggedFirstMessage:!1,sessionId:H.sessionId}}function rlH(){return k$.teleportedSessionInfo}function alH(){if(k$.teleportedSessionInfo)k$.teleportedSessionInfo.hasLoggedFirstMessage=!0}function cYH(H,$,A){k$.invokedSkills.set(H,{skillName:H,skillPath:$,content:A,invokedAt:Date.now()})}function qj$(){return k$.invokedSkills}function nKB(){k$.invokedSkills.clear()}function rKB(H,$){return}function gcA(){let H=Date.now();return k$.slowOperations=k$.slowOperations.filter(($)=>H-$.timestampH-$.timestamp{wcA();TYH();nC();ycA=require("process"),xS$=require("fs"),SS$=require("crypto");k$=vcA();pcA={length:0}});function sKB(H,$){var A=-1,L=H==null?0:H.length;while(++A{ccA=sKB});var eKB,XEH;var Rj$=K(()=>{Yc();eKB=function(){try{var H=Y_(Object,"defineProperty");return H({},"",{}),H}catch($){}}(),XEH=eKB});function HQB(H,$,A){if($=="__proto__"&&XEH)XEH(H,$,{configurable:!0,enumerable:!0,value:A,writable:!0});else H[$]=A}var Sc;var nYH=K(()=>{Rj$();Sc=HQB});function LQB(H,$,A){var L=H[$];if(!(AQB.call(H,$)&&ij(L,A))||A===void 0&&!($ in H))Sc(H,$,A)}var $QB,AQB,jc;var rYH=K(()=>{nYH();kfH();$QB=Object.prototype,AQB=$QB.hasOwnProperty;jc=LQB});function IQB(H,$,A,L){var I=!A;A||(A={});var D=-1,B=$.length;while(++D{rYH();nYH();gZ=IQB});function DQB(H,$){return H&&gZ($,bZ($),H)}var icA;var ncA=K(()=>{qHH();GHH();icA=DQB});function BQB(H){var $=[];if(H!=null)for(var A in Object(H))$.push(A);return $}var rcA;var acA=K(()=>{rcA=BQB});function MQB(H){if(!f5(H))return rcA(H);var $=afH(H),A=[];for(var L in H)if(!(L=="constructor"&&($||!EQB.call(H,L))))A.push(L);return A}var fQB,EQB,ocA;var tcA=K(()=>{hZ();QlH();acA();fQB=Object.prototype,EQB=fQB.hasOwnProperty;ocA=MQB});function GQB(H){return tj(H)?KlH(H,!0):ocA(H)}var AR;var JEH=K(()=>{WS$();tcA();ofH();AR=GQB});function UQB(H,$){return H&&gZ($,AR($),H)}var scA;var ecA=K(()=>{qHH();JEH();scA=UQB});var aYH={};XA(aYH,{default:()=>oYH});function JQB(H,$){if($)return H.slice();var A=H.length,L=AlA?AlA(A):new H.constructor(A);return H.copy(L),L}var LlA,HlA,XQB,$lA,AlA,oYH;var yj$=K(()=>{VN();LlA=typeof aYH=="object"&&aYH&&!aYH.nodeType&&aYH,HlA=LlA&&typeof olH=="object"&&olH&&!olH.nodeType&&olH,XQB=HlA&&HlA.exports===LlA,$lA=XQB?aJ.Buffer:void 0,AlA=$lA?$lA.allocUnsafe:void 0;oYH=JQB});function FQB(H,$){var A=-1,L=H.length;$||($=Array(L));while(++A{tlH=FQB});function KQB(H,$){return gZ(H,lfH(H),$)}var IlA;var DlA=K(()=>{qHH();ElH();IlA=KQB});var QQB,FEH;var slH=K(()=>{VS$();QQB=WlH(Object.getPrototypeOf,Object),FEH=QQB});var WQB,VQB,elH;var hj$=K(()=>{IlH();slH();ElH();FS$();WQB=Object.getOwnPropertySymbols,VQB=!WQB?flH:function(H){var $=[];while(H)cfH($,lfH(H)),H=FEH(H);return $},elH=VQB});function PQB(H,$){return gZ(H,elH(H),$)}var BlA;var flA=K(()=>{qHH();hj$();BlA=PQB});function _QB(H){return DlH(H,AR,elH)}var HiH;var bj$=K(()=>{XS$();hj$();JEH();HiH=_QB});function wQB(H){var $=H.length,A=new H.constructor($);if($&&typeof H[0]=="string"&&CQB.call(H,"index"))A.index=H.index,A.input=H.input;return A}var YQB,CQB,ElA;var MlA=K(()=>{YQB=Object.prototype,CQB=YQB.hasOwnProperty;ElA=wQB});function ZQB(H){var $=new H.constructor(H.byteLength);return new pfH($).set(new pfH(H)),$}var KEH;var $iH=K(()=>{GS$();KEH=ZQB});function qQB(H,$){var A=$?KEH(H.buffer):H.buffer;return new H.constructor(A,H.byteOffset,H.byteLength)}var GlA;var UlA=K(()=>{$iH();GlA=qQB});function zQB(H){var $=new H.constructor(H.source,TQB.exec(H));return $.lastIndex=H.lastIndex,$}var TQB,XlA;var JlA=K(()=>{TQB=/\w*$/;XlA=zQB});function NQB(H){return KlA?Object(KlA.call(H)):{}}var FlA,KlA,QlA;var WlA=K(()=>{fHH();FlA=DQ?DQ.prototype:void 0,KlA=FlA?FlA.valueOf:void 0;QlA=NQB});function OQB(H,$){var A=$?KEH(H.buffer):H.buffer;return new H.constructor(A,H.byteOffset,H.length)}var AiH;var kj$=K(()=>{$iH();AiH=OQB});function aQB(H,$,A){var L=H.constructor;switch($){case kQB:return KEH(H);case xQB:case SQB:return new L(+H);case uQB:return GlA(H,A);case gQB:case mQB:case pQB:case dQB:case cQB:case lQB:case iQB:case nQB:case rQB:return AiH(H,A);case jQB:return new L;case RQB:case hQB:return new L(H);case yQB:return XlA(H);case vQB:return new L;case bQB:return QlA(H)}}var xQB="[object Boolean]",SQB="[object Date]",jQB="[object Map]",RQB="[object Number]",yQB="[object RegExp]",vQB="[object Set]",hQB="[object String]",bQB="[object Symbol]",kQB="[object ArrayBuffer]",uQB="[object DataView]",gQB="[object Float32Array]",mQB="[object Float64Array]",pQB="[object Int8Array]",dQB="[object Int16Array]",cQB="[object Int32Array]",lQB="[object Uint8Array]",iQB="[object Uint8ClampedArray]",nQB="[object Uint16Array]",rQB="[object Uint32Array]",VlA;var PlA=K(()=>{$iH();UlA();JlA();WlA();kj$();VlA=aQB});var _lA,oQB,YlA;var ClA=K(()=>{hZ();_lA=Object.create,oQB=function(){function H(){}return function($){if(!f5($))return{};if(_lA)return _lA($);H.prototype=$;var A=new H;return H.prototype=void 0,A}}(),YlA=oQB});function tQB(H){return typeof H.constructor=="function"&&!afH(H)?YlA(FEH(H)):{}}var LiH;var uj$=K(()=>{ClA();slH();QlH();LiH=tQB});function eQB(H){return sF(H)&&Ek(H)==sQB}var sQB="[object Map]",wlA;var ZlA=K(()=>{qYH();rj();wlA=eQB});var qlA,HWB,TlA;var zlA=K(()=>{ZlA();UlH();JlH();qlA=oj&&oj.isMap,HWB=qlA?nfH(qlA):wlA,TlA=HWB});function AWB(H){return sF(H)&&Ek(H)==$WB}var $WB="[object Set]",NlA;var OlA=K(()=>{qYH();rj();NlA=AWB});var xlA,LWB,SlA;var jlA=K(()=>{OlA();UlH();JlH();xlA=oj&&oj.isSet,LWB=xlA?nfH(xlA):NlA,SlA=LWB});function IiH(H,$,A,L,I,D){var B,f=$&IWB,E=$&DWB,M=$&BWB;if(A)B=I?A(H,L,I,D):A(H);if(B!==void 0)return B;if(!f5(H))return H;var G=wE(H);if(G){if(B=ElA(H),!f)return tlH(H,B)}else{var U=Ek(H),X=U==ylA||U==UWB;if(aj(H))return oYH(H,f);if(U==vlA||U==RlA||X&&!I){if(B=E||X?{}:LiH(H),!f)return E?BlA(H,scA(B,H)):IlA(H,icA(B,H))}else{if(!cG[U])return I?H:{};B=VlA(H,U,f)}}D||(D=new nj);var J=D.get(H);if(J)return J;if(D.set(H,B),SlA(H))H.forEach(function(W){B.add(IiH(W,$,A,W,H,D))});else if(TlA(H))H.forEach(function(W,P){B.set(P,IiH(W,$,A,P,H,D))});var F=M?E?HiH:ZYH:E?AR:bZ,Q=G?void 0:F(H);return ccA(Q||H,function(W,P){if(Q)P=W,W=H[P];jc(B,P,IiH(W,$,A,P,H,D))}),B}var IWB=1,DWB=2,BWB=4,RlA="[object Arguments]",fWB="[object Array]",EWB="[object Boolean]",MWB="[object Date]",GWB="[object Error]",ylA="[object Function]",UWB="[object GeneratorFunction]",XWB="[object Map]",JWB="[object Number]",vlA="[object Object]",FWB="[object RegExp]",KWB="[object Set]",QWB="[object String]",WWB="[object Symbol]",VWB="[object WeakMap]",PWB="[object ArrayBuffer]",_WB="[object DataView]",YWB="[object Float32Array]",CWB="[object Float64Array]",wWB="[object Int8Array]",ZWB="[object Int16Array]",qWB="[object Int32Array]",TWB="[object Uint8Array]",zWB="[object Uint8ClampedArray]",NWB="[object Uint16Array]",OWB="[object Uint32Array]",cG,DiH;var gj$=K(()=>{WYH();lcA();rYH();ncA();ecA();yj$();vj$();DlA();flA();PS$();bj$();qYH();MlA();PlA();uj$();XV();_YH();zlA();hZ();jlA();GHH();JEH();cG={};cG[RlA]=cG[fWB]=cG[PWB]=cG[_WB]=cG[EWB]=cG[MWB]=cG[YWB]=cG[CWB]=cG[wWB]=cG[ZWB]=cG[qWB]=cG[XWB]=cG[JWB]=cG[vlA]=cG[FWB]=cG[KWB]=cG[QWB]=cG[WWB]=cG[TWB]=cG[zWB]=cG[NWB]=cG[OWB]=!0;cG[GWB]=cG[ylA]=cG[VWB]=!1;DiH=IiH});function jWB(H){return DiH(H,xWB|SWB)}var xWB=1,SWB=4,hlA;var blA=K(()=>{gj$();hlA=jWB});function mj$(H){if(H===null)return"null";if(H===void 0)return"undefined";if(Array.isArray(H))return`Array[${H.length}]`;if(typeof H==="object")return`Object{${Object.keys(H).length} keys}`;if(typeof H==="string")return`string(${H.length} chars)`;return typeof H}function BiH(H,$){let A=performance.now();try{return $()}finally{performance.now()-A>Xk}}function yH(H,$,A){let L=mj$(H);return BiH(`JSON.stringify(${L})`,()=>JSON.stringify(H,$,A))}function klA(H,$){let A=mj$(H);return BiH(`structuredClone(${A})`,()=>structuredClone(H,$))}function THH(H){let $=mj$(H);return BiH(`cloneDeep(${$})`,()=>hlA(H))}function iL(H,$,A){let L=performance.now();try{if(A!==null&&typeof A==="object"&&"flush"in A&&A.flush===!0){let D=typeof A==="object"&&"encoding"in A?A.encoding:void 0,B=typeof A==="object"&&"mode"in A?A.mode:void 0,f;try{f=Uk.openSync(H,"w",B),Uk.writeFileSync(f,$,{encoding:D??void 0}),Uk.fsyncSync(f)}finally{if(f!==void 0)Uk.closeSync(f)}}else Uk.writeFileSync(H,$,A)}finally{performance.now()-L>Xk}}var Uk,Xk=1/0,DA=(H,$)=>{let A=typeof H==="string"?H.length:0;return BiH(`JSON.parse(${A} chars)`,()=>JSON.parse(H,$))};var Z$=K(()=>{E$();g$();blA();Uk=require("fs")});function tJ(H,$){let A=performance.now();try{return $()}finally{performance.now()-A>Xk}}function OU(H,$){if(!H.existsSync($))return{resolvedPath:$,isSymlink:!1};try{let A=H.lstatSync($);if(A.isFIFO()||A.isSocket()||A.isCharacterDevice()||A.isBlockDevice())return{resolvedPath:$,isSymlink:!1};let L=H.realpathSync($);return{resolvedPath:L,isSymlink:L!==$}}catch(A){return{resolvedPath:$,isSymlink:!1}}}function LR(H,$,A){let{resolvedPath:L}=OU(H,$);if(A.has(L))return!0;return A.add(L),!1}function zHH(H){let $=H;if($==="~")$=pj$.homedir();else if($.startsWith("~/"))$=Rc.join(pj$.homedir(),$.slice(2));let A=new Set,L=zH();A.add($);try{let B=$,f=new Set,E=40;for(let M=0;M0){let f=Math.min(4096,I);I-=f,await A.read(B,0,f,I);let M=(B.toString("utf8",0,f)+D).split(` `);D=M[0]||"";for(let G=M.length-1;G>=1;G--){let U=M[G];if(U)yield U}}if(D)yield D}finally{await A.close()}}var H9,pj$,Rc,mZ,RWB=!1,yWB,vWB;var DL=K(()=>{E$();Z$();g$();H9=b(require("fs")),pj$=require("os"),Rc=b(require("path")),mZ=require("fs/promises");yWB={cwd(){return process.cwd()},existsSync(H){return tJ(`existsSync(${H})`,()=>H9.existsSync(H))},async stat(H){return mZ.stat(H)},async readdir(H){return mZ.readdir(H,{withFileTypes:!0})},async unlink(H){return mZ.unlink(H)},async rmdir(H){return mZ.rmdir(H)},async rm(H,$){return mZ.rm(H,$)},statSync(H){return tJ(`statSync(${H})`,()=>H9.statSync(H))},lstatSync(H){return tJ(`lstatSync(${H})`,()=>H9.lstatSync(H))},readFileSync(H,$){return tJ(`readFileSync(${H})`,()=>H9.readFileSync(H,{encoding:$.encoding}))},readFileBytesSync(H){return tJ(`readFileBytesSync(${H})`,()=>H9.readFileSync(H))},readSync(H,$){return tJ(`readSync(${H}, ${$.length} bytes)`,()=>{let A=void 0;try{A=H9.openSync(H,"r");let L=Buffer.alloc($.length),I=H9.readSync(A,L,0,$.length,0);return{buffer:L,bytesRead:I}}finally{if(A)H9.closeSync(A)}})},appendFileSync(H,$,A){return tJ(`appendFileSync(${H}, ${$.length} chars)`,()=>{if(!H9.existsSync(H)&&A?.mode!==void 0){let L=H9.openSync(H,"a",A.mode);try{H9.appendFileSync(L,$)}finally{H9.closeSync(L)}}else H9.appendFileSync(H,$)})},copyFileSync(H,$){return tJ(`copyFileSync(${H} \u2192 ${$})`,()=>H9.copyFileSync(H,$))},unlinkSync(H){return tJ(`unlinkSync(${H})`,()=>H9.unlinkSync(H))},renameSync(H,$){return tJ(`renameSync(${H} \u2192 ${$})`,()=>H9.renameSync(H,$))},linkSync(H,$){return tJ(`linkSync(${H} \u2192 ${$})`,()=>H9.linkSync(H,$))},symlinkSync(H,$){return tJ(`symlinkSync(${H} \u2192 ${$})`,()=>H9.symlinkSync(H,$))},readlinkSync(H){return tJ(`readlinkSync(${H})`,()=>H9.readlinkSync(H))},realpathSync(H){return tJ(`realpathSync(${H})`,()=>H9.realpathSync(H))},mkdirSync(H,$){return tJ(`mkdirSync(${H})`,()=>{if(!H9.existsSync(H)){let A={recursive:!0};if($?.mode!==void 0)A.mode=$.mode;H9.mkdirSync(H,A)}})},readdirSync(H){return tJ(`readdirSync(${H})`,()=>H9.readdirSync(H,{withFileTypes:!0}))},readdirStringSync(H){return tJ(`readdirStringSync(${H})`,()=>H9.readdirSync(H))},isDirEmptySync(H){return tJ(`isDirEmptySync(${H})`,()=>{return this.readdirSync(H).length===0})},rmdirSync(H){return tJ(`rmdirSync(${H})`,()=>H9.rmdirSync(H))},rmSync(H,$){return tJ(`rmSync(${H})`,()=>H9.rmSync(H,$))},createWriteStream(H){return H9.createWriteStream(H)}},vWB=yWB});function UL(){return process.env.CLAUDE_CONFIG_DIR??dj$.join(glA.homedir(),".claude")}function P6(){return dj$.join(UL(),"teams")}function cj$(H){let $=process.env.NODE_OPTIONS;if(!$)return!1;return $.split(/\s+/).includes(H)}function A$(H){if(!H)return!1;if(typeof H==="boolean")return H;let $=H.toLowerCase().trim();return["1","true","yes","on"].includes($)}function BE(H){if(H===void 0)return!1;if(typeof H==="boolean")return!H;if(!H)return!1;let $=H.toLowerCase().trim();return["0","false","no","off"].includes($)}function mlA(H){let $={};if(H)for(let A of H){let[L,...I]=A.split("=");if(!L||I.length===0)throw Error(`Invalid environment variable format: ${A}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);$[L]=I.join("=")}return $}function NHH(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||"us-east-1"}function wN(){return process.env.CLOUD_ML_REGION||"us-east5"}function lj$(){return A$(process.env.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR)}function plA(){return!1}function fiH(H){if(H?.startsWith("claude-haiku-4-5"))return process.env.VERTEX_REGION_CLAUDE_HAIKU_4_5||wN();if(H?.startsWith("claude-3-5-haiku"))return process.env.VERTEX_REGION_CLAUDE_3_5_HAIKU||wN();if(H?.startsWith("claude-3-5-sonnet"))return process.env.VERTEX_REGION_CLAUDE_3_5_SONNET||wN();if(H?.startsWith("claude-3-7-sonnet"))return process.env.VERTEX_REGION_CLAUDE_3_7_SONNET||wN();if(H?.startsWith("claude-opus-4-1"))return process.env.VERTEX_REGION_CLAUDE_4_1_OPUS||wN();if(H?.startsWith("claude-opus-4"))return process.env.VERTEX_REGION_CLAUDE_4_0_OPUS||wN();if(H?.startsWith("claude-sonnet-4-5"))return process.env.VERTEX_REGION_CLAUDE_4_5_SONNET||wN();if(H?.startsWith("claude-sonnet-4"))return process.env.VERTEX_REGION_CLAUDE_4_0_SONNET||wN();return wN()}var dj$,glA;var NA=K(()=>{dj$=require("path"),glA=require("os")});function EiH({writeFn:H,flushIntervalMs:$=1000,maxBufferSize:A=100,immediateMode:L=!1}){let I=[],D=null;function B(){if(D)clearTimeout(D),D=null}function f(){if(I.length===0)return;H(I.join("")),I=[],B()}function E(){if(!D)D=setTimeout(f,$)}return{write(M){if(L){H(M);return}if(I.push(M),E(),I.length>=A)f()},flush:f,dispose(){f()}}}function PB(H){return ij$.add(H),()=>ij$.delete(H)}async function dlA(){await Promise.all(Array.from(ij$).map((H)=>H()))}var ij$;var ZE=K(()=>{ij$=new Set});function bWB(H){if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let $=hWB();return mpA(H,$)}function ilA(H){llA=H}function kWB(){if(!MiH)MiH=EiH({writeFn:(H)=>{let $=xHH();if(!zH().existsSync(OHH.dirname($)))zH().mkdirSync(OHH.dirname($));zH().appendFileSync($,H),uWB()},flushIntervalMs:1000,maxBufferSize:100,immediateMode:QEH()}),PB(async()=>MiH?.dispose());return MiH}function N(H,{level:$}={level:"debug"}){if(!bWB(H))return;if(llA&&H.includes(` `)}function tj$(){if(elA(),sYH){let H=slA(),$=GiH.dirname(H),A=zH();if(!A.existsSync($))A.mkdirSync($);iL(H,alA(),{encoding:"utf8",flush:!0}),N("Startup profiling report:"),N(alA())}}function pWB(){return aj$}function dWB(){return sYH}function slA(){return GiH.join(UL(),"startup-perf",`${j$()}.txt`)}function elA(){if(!olA)return;let $=oj$().getEntriesByType("mark");if($.length===0)return;let A=new Map;for(let I of $)A.set(I.name,I.startTime);let L={};for(let[I,[D,B]]of Object.entries(mWB)){let f=A.get(D),E=A.get(B);if(f!==void 0&&E!==void 0)L[`${I}_ms`]=Math.round(E-f)}L.checkpoint_count=$.length,c("tengu_startup_perf",L)}var GiH,sYH,gWB=0.005,olA,aj$,tlA,nj$=null,mWB;var hc=K(()=>{E$();z$();NA();g$();DL();Z$();GiH=require("path"),sYH=process.env.CLAUDE_CODE_PROFILE_STARTUP==="1",olA=Math.random()0?I.join("__"):void 0;return{serverName:L,toolName:D}}function bc(H){return`mcp__${E1(H)}__`}function UiH(H,$){let A=`mcp__${E1($)}__`;return H.replace(A,"")}function XiH(H){let $=H.replace(/\s*\(MCP\)\s*$/,"");$=$.trim();let A=$.indexOf(" - ");if(A!==-1)return $.substring(A+3).trim();return $}var tC=()=>{};function cWB(H,$,A){switch(A.length){case 0:return H.call($);case 1:return H.call($,A[0]);case 2:return H.call($,A[0],A[1]);case 3:return H.call($,A[0],A[1],A[2])}return H.apply($,A)}var $iA;var AiA=K(()=>{$iA=cWB});function lWB(){}var Jk;var sj$=K(()=>{Jk=lWB});function aWB(H){var $=0,A=0;return function(){var L=rWB(),I=nWB-(L-A);if(A=L,I>0){if(++$>=iWB)return arguments[0]}else $=0;return H.apply(void 0,arguments)}}var iWB=800,nWB=16,rWB,LiA;var IiA=K(()=>{rWB=Date.now;LiA=aWB});function oWB(H){return function(){return H}}var DiA;var BiA=K(()=>{DiA=oWB});var tWB,fiA;var EiA=K(()=>{BiA();Rj$();xlH();tWB=!XEH?IEH:function(H,$){return XEH(H,"toString",{configurable:!0,enumerable:!1,value:DiA($),writable:!0})},fiA=tWB});var sWB,JiH;var ej$=K(()=>{EiA();IiA();sWB=LiA(fiA),JiH=sWB});function eWB(H,$,A,L){var I=H.length,D=A+(L?1:-1);while(L?D--:++D{MiA=eWB});function H7B(H){return H!==H}var UiA;var XiA=K(()=>{UiA=H7B});function $7B(H,$,A){var L=A-1,I=H.length;while(++L{JiA=$7B});function A7B(H,$,A){return $===$?JiA(H,$,A):MiA(H,UiA,A)}var KiA;var QiA=K(()=>{GiA();XiA();FiA();KiA=A7B});function L7B(H,$){var A=H==null?0:H.length;return!!A&&KiA(H,$,0)>-1}var WiA;var ViA=K(()=>{QiA();WiA=L7B});function I7B(H,$,A){return $=PiA($===void 0?H.length-1:$,0),function(){var L=arguments,I=-1,D=PiA(L.length-$,0),B=Array(D);while(++I{AiA();PiA=Math.max;FiH=I7B});function D7B(H,$){return JiH(FiH(H,$,IEH),H+"")}var _iA;var YiA=K(()=>{xlH();HR$();ej$();_iA=D7B});function B7B(H,$,A){if(!f5(A))return!1;var L=typeof $;if(L=="number"?tj(A)&&zc($,A.length):L=="string"&&($ in A))return ij(A[$],H);return!1}var CiA;var wiA=K(()=>{kfH();ofH();YYH();hZ();CiA=B7B});function f7B(H){return _iA(function($,A){var L=-1,I=A.length,D=I>1?A[I-1]:void 0,B=I>2?A[2]:void 0;if(D=H.length>3&&typeof D=="function"?(I--,D):void 0,B&&CiA(A[0],A[1],B))D=I<3?void 0:D,I=1;$=Object($);while(++L{YiA();wiA();ZiA=f7B});function E7B(H){return wE(H)||fk(H)||!!(TiA&&H&&H[TiA])}var TiA,ziA;var NiA=K(()=>{fHH();VYH();XV();TiA=DQ?DQ.isConcatSpreadable:void 0;ziA=E7B});function OiA(H,$,A,L,I){var D=-1,B=H.length;A||(A=ziA),I||(I=[]);while(++D0&&A(f))if($>1)OiA(f,$-1,A,L,I);else cfH(I,f);else if(!L)I[I.length]=f}return I}var xiA;var SiA=K(()=>{IlH();NiA();xiA=OiA});function M7B(H){var $=H==null?0:H.length;return $?xiA(H,1):[]}var jiA;var RiA=K(()=>{SiA();jiA=M7B});function G7B(H){return JiH(FiH(H,void 0,jiA),H+"")}var yiA;var viA=K(()=>{RiA();HR$();ej$();yiA=G7B});function Q7B(H){if(!sF(H)||iC(H)!=U7B)return!1;var $=FEH(H);if($===null)return!0;var A=F7B.call($,"constructor")&&$.constructor;return typeof A=="function"&&A instanceof A&&hiA.call(A)==K7B}var U7B="[object Object]",X7B,J7B,hiA,F7B,K7B,WEH;var KiH=K(()=>{EHH();slH();rj();X7B=Function.prototype,J7B=Object.prototype,hiA=X7B.toString,F7B=J7B.hasOwnProperty,K7B=hiA.call(Object);WEH=Q7B});function W7B(H,$,A){var L=-1,I=H.length;if($<0)$=-$>I?0:I+$;if(A=A>I?I:A,A<0)A+=I;I=$>A?0:A-$>>>0,$>>>=0;var D=Array(I);while(++L{QiH=W7B});function V7B(H,$,A){var L=H.length;return A=A===void 0?L:A,!$&&A>=L?H:QiH(H,$,A)}var biA;var kiA=K(()=>{$R$();biA=V7B});function z7B(H){return T7B.test(H)}var P7B="\\ud800-\\udfff",_7B="\\u0300-\\u036f",Y7B="\\ufe20-\\ufe2f",C7B="\\u20d0-\\u20ff",w7B,Z7B="\\ufe0e\\ufe0f",q7B="\\u200d",T7B,WiH;var AR$=K(()=>{w7B=_7B+Y7B+C7B,T7B=RegExp("["+q7B+P7B+w7B+Z7B+"]");WiH=z7B});function N7B(H){return H.split("")}var uiA;var giA=K(()=>{uiA=N7B});function m7B(H){return H.match(g7B)||[]}var miA="\\ud800-\\udfff",O7B="\\u0300-\\u036f",x7B="\\ufe20-\\ufe2f",S7B="\\u20d0-\\u20ff",j7B,R7B="\\ufe0e\\ufe0f",y7B,LR$,IR$="\\ud83c[\\udffb-\\udfff]",v7B,piA,diA="(?:\\ud83c[\\udde6-\\uddff]){2}",ciA="[\\ud800-\\udbff][\\udc00-\\udfff]",h7B="\\u200d",liA,iiA,b7B,k7B,u7B,g7B,niA;var riA=K(()=>{j7B=O7B+x7B+S7B,y7B="["+miA+"]",LR$="["+j7B+"]",v7B="(?:"+LR$+"|"+IR$+")",piA="[^"+miA+"]",liA=v7B+"?",iiA="["+R7B+"]?",b7B="(?:"+h7B+"(?:"+[piA,diA,ciA].join("|")+")"+iiA+liA+")*",k7B=iiA+liA+b7B,u7B="(?:"+[piA+LR$+"?",LR$,diA,ciA,y7B].join("|")+")",g7B=RegExp(IR$+"(?="+IR$+")|"+u7B+k7B,"g");niA=m7B});function p7B(H){return WiH(H)?niA(H):uiA(H)}var aiA;var oiA=K(()=>{giA();AR$();riA();aiA=p7B});function d7B(H){return function($){$=$EH($);var A=WiH($)?aiA($):void 0,L=A?A[0]:$.charAt(0),I=A?biA(A,1).join(""):$.slice(1);return L[H]()+I}}var tiA;var siA=K(()=>{kiA();AR$();oiA();NlH();tiA=d7B});var c7B,eiA;var HnA=K(()=>{siA();c7B=tiA("toUpperCase"),eiA=c7B});function l7B(H){return eiA($EH(H).toLowerCase())}var Fk;var eYH=K(()=>{NlH();HnA();Fk=l7B});function i7B(H,$,A,L){var I=-1,D=H==null?0:H.length;while(++I{$nA=i7B});function n7B(H){return function($,A,L){var I=-1,D=Object($),B=L($),f=B.length;while(f--){var E=B[H?f:++I];if(A(D[E],E,D)===!1)break}return $}}var LnA;var InA=K(()=>{LnA=n7B});var r7B,ViH;var DR$=K(()=>{InA();r7B=LnA(),ViH=r7B});function a7B(H,$){return H&&ViH(H,$,bZ)}var PiH;var BR$=K(()=>{DR$();GHH();PiH=a7B});function o7B(H,$){return function(A,L){if(A==null)return A;if(!tj(A))return H(A,L);var I=A.length,D=$?I:-1,B=Object(A);while($?D--:++D{ofH();DnA=o7B});var t7B,_iH;var fR$=K(()=>{BR$();BnA();t7B=DnA(PiH),_iH=t7B});function s7B(H,$,A,L){return _iH(H,function(I,D,B){$(L,I,A(I),B)}),L}var fnA;var EnA=K(()=>{fR$();fnA=s7B});function e7B(H,$){return function(A,L){var I=wE(A)?$nA:fnA,D=$?$():{};return I(A,H,ej(L,2),D)}}var MnA;var GnA=K(()=>{AnA();EnA();DEH();XV();MnA=e7B});function H6B(H,$,A){if(A!==void 0&&!ij(H[$],A)||A===void 0&&!($ in H))Sc(H,$,A)}var HCH;var ER$=K(()=>{nYH();kfH();HCH=H6B});function $6B(H){return sF(H)&&tj(H)}var UnA;var XnA=K(()=>{ofH();rj();UnA=$6B});function A6B(H,$){if($==="constructor"&&typeof H[$]==="function")return;if($=="__proto__")return;return H[$]}var $CH;var MR$=K(()=>{$CH=A6B});function L6B(H){return gZ(H,AR(H))}var JnA;var FnA=K(()=>{qHH();JEH();JnA=L6B});function I6B(H,$,A,L,I,D,B){var f=$CH(H,A),E=$CH($,A),M=B.get(E);if(M){HCH(H,A,M);return}var G=D?D(f,E,A+"",H,$,B):void 0,U=G===void 0;if(U){var X=wE(E),J=!X&&aj(E),F=!X&&!J&&rfH(E);if(G=E,X||J||F)if(wE(f))G=f;else if(UnA(f))G=tlH(f);else if(J)U=!1,G=oYH(E,!0);else if(F)U=!1,G=AiH(E,!0);else G=[];else if(WEH(E)||fk(E)){if(G=f,fk(f))G=JnA(f);else if(!f5(f)||hfH(f))G=LiH(E)}else U=!1}if(U)B.set(E,G),I(G,E,L,D,B),B.delete(E);HCH(H,A,G)}var KnA;var QnA=K(()=>{ER$();yj$();kj$();vj$();uj$();VYH();XV();XnA();_YH();acH();hZ();KiH();FlH();MR$();FnA();KnA=I6B});function WnA(H,$,A,L,I){if(H===$)return;ViH($,function(D,B){if(I||(I=new nj),f5(D))KnA(H,$,B,A,WnA,L,I);else{var f=L?L($CH(H,B),D,B+"",H,$,I):void 0;if(f===void 0)f=D;HCH(H,B,f)}},AR)}var VnA;var PnA=K(()=>{WYH();ER$();DR$();QnA();hZ();JEH();MR$();VnA=WnA});var D6B,ACH;var _nA=K(()=>{PnA();qiA();D6B=ZiA(function(H,$,A,L){VnA(H,$,A,L)}),ACH=D6B});function B6B(H,$,A){var L=-1,I=H==null?0:H.length;while(++L{YnA=B6B});function f6B(H){var $=H==null?0:H.length;return $?H[$-1]:void 0}var _6;var SHH=K(()=>{_6=f6B});function E6B(H,$){var A=[];return _iH(H,function(L,I,D){if($(L,I,D))A.push(L)}),A}var wnA;var ZnA=K(()=>{fR$();wnA=E6B});function M6B(H,$){return HEH($,function(A){return H[A]})}var qnA;var TnA=K(()=>{zlH();qnA=M6B});function G6B(H){return H==null?[]:qnA(H,bZ(H))}var znA;var NnA=K(()=>{TnA();GHH();znA=G6B});function U6B(H,$){return $.length<2?H:LEH(H,QiH($,0,-1))}var OnA;var xnA=K(()=>{OlH();$R$();OnA=U6B});function X6B(H,$){return tfH(H,$)}var jHH;var GR$=K(()=>{ClH();jHH=X6B});function J6B(H,$){var A={};return $=ej($,3),PiH(H,function(L,I,D){Sc(A,I,$(L,I,D))}),A}var RHH;var YiH=K(()=>{nYH();BR$();DEH();RHH=J6B});function K6B(H){if(typeof H!="function")throw TypeError(F6B);return function(){var $=arguments;switch($.length){case 0:return!H.call(this);case 1:return!H.call(this,$[0]);case 2:return!H.call(this,$[0],$[1]);case 3:return!H.call(this,$[0],$[1],$[2])}return!H.apply(this,$)}}var F6B="Expected a function",SnA;var jnA=K(()=>{SnA=K6B});function Q6B(H,$){return $=sj($,H),H=OnA(H,$),H==null||delete H[kZ(_6($))]}var RnA;var ynA=K(()=>{AEH();SHH();xnA();XHH();RnA=Q6B});function W6B(H){return WEH(H)?void 0:H}var vnA;var hnA=K(()=>{KiH();vnA=W6B});var V6B=1,P6B=2,_6B=4,Y6B,VEH;var UR$=K(()=>{zlH();gj$();ynA();AEH();qHH();hnA();viA();bj$();Y6B=yiA(function(H,$){var A={};if(H==null)return A;var L=!1;if($=HEH($,function(D){return D=sj(D,H),L||(L=D.length>1),D}),gZ(H,HiH(H),A),L)A=DiH(A,V6B|P6B|_6B,vnA);var I=$.length;while(I--)RnA(A,$[I]);return A}),VEH=Y6B});function C6B(H,$,A,L){if(!f5(H))return H;$=sj($,H);var I=-1,D=$.length,B=D-1,f=H;while(f!=null&&++I{rYH();AEH();YYH();hZ();XHH();bnA=C6B});var w6B,unA;var gnA=K(()=>{GnA();w6B=MnA(function(H,$,A){H[A?0:1].push($)},function(){return[[],[]]}),unA=w6B});function T6B(H,$){return H+Z6B(q6B()*($-H+1))}var Z6B,q6B,mnA;var pnA=K(()=>{Z6B=Math.floor,q6B=Math.random;mnA=T6B});function z6B(H,$){var A=wE(H)?BlH:wnA;return A(H,SnA(ej($,3)))}var DR;var XR$=K(()=>{JS$();ZnA();DEH();XV();jnA();DR=z6B});function N6B(H){var $=H.length;return $?H[mnA(0,$-1)]:void 0}var CiH;var JR$=K(()=>{pnA();CiH=N6B});function O6B(H){return CiH(znA(H))}var dnA;var cnA=K(()=>{JR$();NnA();dnA=O6B});function x6B(H){var $=wE(H)?CiH:dnA;return $(H)}var QV;var yHH=K(()=>{JR$();cnA();XV();QV=x6B});function S6B(H,$,A,L){return L=typeof L=="function"?L:void 0,H==null?H:bnA(H,$,A,L)}var lnA;var inA=K(()=>{knA();lnA=S6B});var j6B=1/0,R6B,nnA;var rnA=K(()=>{_S$();sj$();LlH();R6B=!(Nc&&1/dfH(new Nc([,-0]))[1]==j6B)?Jk:function(H){return new Nc(H)},nnA=R6B});function v6B(H,$,A){var L=-1,I=WiA,D=H.length,B=!0,f=[],E=f;if(A)B=!1,I=YnA;else if(D>=y6B){var M=$?null:nnA(H);if(M)return dfH(M);B=!1,I=$lH,E=new HlH}else E=$?[]:f;H:while(++L{fS$();ViA();CnA();ES$();rnA();LlH();anA=v6B});function h6B(H,$){return H&&H.length?anA(H,ej($,2)):[]}var BR;var PEH=K(()=>{DEH();onA();BR=h6B});function b6B(H,$,A){var L=-1,I=H.length,D=$.length,B={};while(++L{tnA=b6B});function k6B(H,$){return tnA(H||[],$||[],jc)}var enA;var HrA=K(()=>{rYH();snA();enA=k6B});var wiH=K(()=>{GR$();tD()});function LrA(){return ArA}function FR$(H){let $=2166136261,A=H.length;for(let L=0;L>>0}function LCH(H,$,A){if(A===2)return FR$(FR$(H+$)+"")%1e4/1e4;if(A===1)return FR$($+H)%1000/1000;return null}function u6B(H){if(H<=0)return[];return Array(H).fill(1/H)}function ZiH(H,$){return H>=$[0]&&H<$[1]}function IrA(H,$){let A=LCH("__"+$[0],H,1);if(A===null)return!1;return A>=$[1]&&A<$[2]}function DrA(H,$){for(let A=0;A<$.length;A++)if(ZiH(H,$[A]))return A;return-1}function QR$(H){try{let $=H.replace(/([^\\])\//g,"$1\\/");return new RegExp($)}catch($){console.error($);return}}function qiH(H,$){if(!$.length)return!1;let A=!1,L=!1;for(let I=0;I<$.length;I++){let D=p6B(H,$[I].type,$[I].pattern);if($[I].include===!1){if(D)return!1}else if(A=!0,D)L=!0}return L||!A}function g6B(H,$,A){try{let L=$.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");if(A)L="\\/?"+L.replace(/(^\/|\/$)/g,"")+"\\/?";return new RegExp("^"+L+"$","i").test(H)}catch(L){return!1}}function m6B(H,$){try{let A=new URL($.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),L=[[H.host,A.host,!1],[H.pathname,A.pathname,!0]];if(A.hash)L.push([H.hash,A.hash,!1]);return A.searchParams.forEach((I,D)=>{L.push([H.searchParams.get(D)||"",I,!1])}),!L.some((I)=>!g6B(I[0],I[1],I[2]))}catch(A){return!1}}function p6B(H,$,A){try{let L=new URL(H,"https://_");if($==="regex"){let I=QR$(A);if(!I)return!1;return I.test(L.href)||I.test(L.href.substring(L.origin.length))}else if($==="simple")return m6B(L,A);return!1}catch(L){return!1}}function BrA(H,$,A){if($=$===void 0?1:$,$<0)$=0;else if($>1)$=1;let L=u6B(H);if(A=A||L,A.length!==H)A=L;let I=A.reduce((B,f)=>f+B,0);if(I<0.99||I>1.01)A=L;let D=0;return A.map((B)=>{let f=D;return D+=B,[f,f+$*B]})}function frA(H,$,A){if(!$)return null;let L=$.split("?")[1];if(!L)return null;let I=L.replace(/#.*/,"").split("&").map((D)=>D.split("=",2)).filter((D)=>{let[B]=D;return B===H}).map((D)=>{let[,B]=D;return parseInt(B)});if(I.length>0&&I[0]>=0&&I[0]A.match(/^[0-9]+$/)?A.padStart(5," "):A).join("-")}function MrA(){let H;try{H="1.6.1"}catch($){H=""}return H}function GrA(H,$){let A,L;try{A=new URL(H),L=new URL($)}catch(I){return console.error(`Unable to merge query strings: ${I}`),$}return A.searchParams.forEach((I,D)=>{if(L.searchParams.has(D))return;L.searchParams.set(D,I)}),L.toString()}function $rA(H){return typeof H==="object"&&H!==null}function TiH(H){if(H.urlPatterns&&H.variations.some(($)=>$rA($)&&("urlRedirect"in $)))return"redirect";else if(H.variations.some(($)=>$rA($)&&($.domMutations||("js"in $)||("css"in $))))return"visual";return"unknown"}async function ziH(H,$){return new Promise((A)=>{let L=!1,I,D=(B)=>{if(L)return;L=!0,I&&clearTimeout(I),A(B||null)};if($)I=setTimeout(()=>D(),$);H.then((B)=>D(B)).catch(()=>D())})}var ArA,KR$=(H)=>Uint8Array.from(atob(H),($)=>$.charCodeAt(0));var DCH=K(()=>{ArA={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource}});function JrA(H){if(Object.assign(Y6,H),!Y6.backgroundSync)o6B()}async function FrA(H){let{instance:$,timeout:A,skipCache:L,allowStale:I,backgroundSync:D}=H;if(!D)Y6.backgroundSync=!1;return i6B({instance:$,allowStale:I,timeout:A,skipCache:L})}function d6B(H){let $=BCH(H),A=YEH.get($)||new Set;A.add(H),YEH.set($,A)}function KrA(H){YEH.forEach(($)=>$.delete(H))}function c6B(){CEH.forEach((H)=>{if(!H)return;H.state="idle",_R$(H)})}function l6B(){CEH.forEach((H)=>{if(!H)return;if(H.state!=="idle")return;YR$(H)})}async function XrA(){try{if(!fR.localStorage)return;await fR.localStorage.setItem(Y6.cacheKey,JSON.stringify(Array.from(Kk.entries())))}catch(H){}}async function i6B(H){let{instance:$,allowStale:A,timeout:L,skipCache:I}=H,D=BCH($),B=VR$($),f=new Date,E=new Date(f.getTime()-Y6.maxAge+Y6.staleTTL);await n6B();let M=!Y6.disableCache&&!I?Kk.get(B):void 0;if(M&&(A||M.staleAt>f)&&M.staleAt>E){if(M.sse)wEH.add(D);if(M.staleAt{I[f]=A[f]});let D=H.getForcedVariations(),B=H.getUrl();return`${$}||${JSON.stringify({ca:I,fv:D,url:B})}`}async function n6B(){if(UrA)return;UrA=!0;try{if(fR.localStorage){let H=await fR.localStorage.getItem(Y6.cacheKey);if(!Y6.disableCache&&H){let $=JSON.parse(H);if($&&Array.isArray($))$.forEach((A)=>{let[L,I]=A;Kk.set(L,{...I,staleAt:new Date(I.staleAt)})});QrA()}}}catch(H){}if(!Y6.disableIdleStreams){let H=_EH.startIdleListener();if(H)_EH.stopIdleListener=H}}function QrA(){let H=Array.from(Kk.entries()).map((A)=>{let[L,I]=A;return{key:L,staleAt:I.staleAt.getTime()}}).sort((A,L)=>A.staleAt-L.staleAt),$=Math.min(Math.max(0,Kk.size-Y6.maxEntries),Kk.size);for(let A=0;A<$;A++)Kk.delete(H[A].key)}function WrA(H,$,A){let L=A.dateUpdated||"",I=new Date(Date.now()+Y6.staleTTL),D=!Y6.disableCache?Kk.get($):void 0;if(D&&L&&D.version===L){D.staleAt=I,XrA();return}if(!Y6.disableCache)Kk.set($,{data:A,version:L,staleAt:I,sse:wEH.has(H)}),QrA();XrA();let B=YEH.get(H);B&&B.forEach((f)=>r6B(f,A))}async function r6B(H,$){await H.setPayload($||H.getPayload())}async function WR$(H){let{apiHost:$,apiRequestHeaders:A}=H.getApiHosts(),L=H.getClientKey(),I="isRemoteEval"in H&&H.isRemoteEval(),D=BCH(H),B=VR$(H),f=NiH.get(B);if(!f)f=(I?_EH.fetchRemoteEvalCall({host:$,clientKey:L,payload:{attributes:H.getAttributes(),forcedVariations:H.getForcedVariations(),forcedFeatures:Array.from(H.getForcedFeatures().entries()),url:H.getUrl()},headers:A}):_EH.fetchFeaturesCall({host:$,clientKey:L,headers:A})).then((M)=>{if(!M.ok)throw Error(`HTTP error: ${M.status}`);if(M.headers.get("x-sse-support")==="enabled")wEH.add(D);return M.json()}).then((M)=>{return WrA(D,B,M),PR$(H),NiH.delete(B),{data:M,success:!0,source:"network"}}).catch((M)=>{return NiH.delete(B),{data:null,source:"error",success:!1,error:M}}),NiH.set(B,f);return f}function PR$(H){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=BCH(H),L=VR$(H),{streamingHost:I,streamingHostRequestHeaders:D}=H.getApiHosts(),B=H.getClientKey();if($)wEH.add(A);if(Y6.backgroundSync&&wEH.has(A)&&fR.EventSource){if(CEH.has(A))return;let f={src:null,host:I,clientKey:B,headers:D,cb:(E)=>{try{if(E.type==="features-updated"){let M=YEH.get(A);M&&M.forEach((G)=>{WR$(G)})}else if(E.type==="features"){let M=JSON.parse(E.data);WrA(A,L,M)}f.errors=0}catch(M){VrA(f)}},errors:0,state:"active"};CEH.set(A,f),YR$(f)}}function VrA(H){if(H.state==="idle")return;if(H.errors++,H.errors>3||H.src&&H.src.readyState===2){let $=Math.pow(3,H.errors-3)*(1000+Math.random()*1000);_R$(H),setTimeout(()=>{if(["idle","active"].includes(H.state))return;YR$(H)},Math.min($,300000))}}function _R$(H){if(!H.src)return;if(H.src.onopen=null,H.src.onerror=null,H.src.close(),H.src=null,H.state==="active")H.state="disabled"}function YR$(H){H.src=_EH.eventSourceCall({host:H.host,clientKey:H.clientKey,headers:H.headers}),H.state="active",H.src.addEventListener("features",H.cb),H.src.addEventListener("features-updated",H.cb),H.src.onerror=()=>VrA(H),H.src.onopen=()=>{H.errors=0}}function a6B(H,$){_R$(H),CEH.delete($)}function o6B(){wEH.clear(),CEH.forEach(a6B),YEH.clear(),_EH.stopIdleListener()}function OiH(H,$){if($.streaming){if(!H.getClientKey())throw Error("Must specify clientKey to enable streaming");if($.payload)PR$(H,!0);d6B(H)}}var Y6,fR,_EH,YEH,UrA=!1,Kk,NiH,CEH,wEH;var PrA=K(()=>{DCH();Y6={staleTTL:60000,maxAge:14400000,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:20000,disableCache:!1},fR=LrA(),_EH={fetchFeaturesCall:(H)=>{let{host:$,clientKey:A,headers:L}=H;return fR.fetch(`${$}/api/features/${A}`,{headers:L})},fetchRemoteEvalCall:(H)=>{let{host:$,clientKey:A,payload:L,headers:I}=H,D={method:"POST",headers:{"Content-Type":"application/json",...I},body:JSON.stringify(L)};return fR.fetch(`${$}/api/eval/${A}`,D)},eventSourceCall:(H)=>{let{host:$,clientKey:A,headers:L}=H;if(L)return new fR.EventSource(`${$}/sub/${A}`,{headers:L});return new fR.EventSource(`${$}/sub/${A}`)},startIdleListener:()=>{let H;if(!(typeof window<"u"&&typeof document<"u"))return;let A=()=>{if(document.visibilityState==="visible")window.clearTimeout(H),l6B();else if(document.visibilityState==="hidden")H=window.setTimeout(c6B,Y6.idleStreamInterval)};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},stopIdleListener:()=>{}};try{if(globalThis.localStorage)fR.localStorage=globalThis.localStorage}catch(H){}YEH=new Map,Kk=new Map,NiH=new Map,CEH=new Map,wEH=new Set});function s6B(H){return H==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[H]}}function yiH(H){var $=RiH.get(H);if(!$)$={element:H,attributes:{}},RiH.set(H,$);return $}function viH(H,$,A,L,I){var D=A(H),B={isDirty:!1,originalValue:D,virtualValue:D,mutations:[],el:H,_positionTimeout:null,observer:new MutationObserver(function(){if($==="position"&&B._positionTimeout)return;else if($==="position")B._positionTimeout=setTimeout(function(){B._positionTimeout=null},1000);var f=A(H);if($==="position"&&f.parentNode===B.virtualValue.parentNode&&f.insertBeforeNode===B.virtualValue.insertBeforeNode)return;if(f===B.virtualValue)return;B.originalValue=f,I(B)}),mutationRunner:I,setValue:L,getCurrentValue:A};if($==="position"&&H.parentNode)B.observer.observe(H.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1});else B.observer.observe(H,s6B($));return B}function hiH(H,$){var A=$.getCurrentValue($.el);if($.virtualValue=H,H&&typeof H!=="string"){if(!A||H.parentNode!==A.parentNode||H.insertBeforeNode!==A.insertBeforeNode)$.isDirty=!0,_rA()}else if(H!==A)$.isDirty=!0,_rA()}function e6B(H){var $=H.originalValue;H.mutations.forEach(function(A){return $=A.mutate($)}),hiH(J3B($),H)}function H3B(H){var $=new Set(H.originalValue.split(/\s+/).filter(Boolean));H.mutations.forEach(function(A){return A.mutate($)}),hiH(Array.from($).filter(Boolean).join(" "),H)}function $3B(H){var $=H.originalValue;H.mutations.forEach(function(A){return $=A.mutate($)}),hiH($,H)}function A3B(H){var{parentSelector:$,insertBeforeSelector:A}=H,L=document.querySelector($);if(!L)return null;var I=A?document.querySelector(A):null;if(A&&!I)return null;return{parentNode:L,insertBeforeNode:I}}function L3B(H){var $=H.originalValue;H.mutations.forEach(function(A){var L=A.mutate(),I=A3B(L);$=I||$}),hiH($,H)}function CrA(H){var $=yiH(H);if(!$.html)$.html=viH(H,"html",I3B,D3B,e6B);return $.html}function wrA(H){var $=yiH(H);if(!$.position)$.position=viH(H,"position",B3B,f3B,L3B);return $.position}function ZrA(H){var $=yiH(H);if(!$.classes)$.classes=viH(H,"class",M3B,E3B,H3B);return $.classes}function qrA(H,$){var A=yiH(H);if(!A.attributes[$])A.attributes[$]=viH(H,$,G3B($),U3B($),$3B);return A.attributes[$]}function X3B(H,$){var A=RiH.get(H);if(!A)return;if($==="html"){var L,I;(L=A.html)==null||(I=L.observer)==null||I.disconnect(),delete A.html}else if($==="class"){var D,B;(D=A.classes)==null||(B=D.observer)==null||B.disconnect(),delete A.classes}else if($==="position"){var f,E;(f=A.position)==null||(E=f.observer)==null||E.disconnect(),delete A.position}else{var M,G,U;(M=A.attributes)==null||(G=M[$])==null||(U=G.observer)==null||U.disconnect(),delete A.attributes[$]}}function J3B(H){if(!xiH)xiH=document.createElement("div");return xiH.innerHTML=H,xiH.innerHTML}function SiH(H,$,A){if(!A.isDirty)return;A.isDirty=!1;var L=A.virtualValue;if(!A.mutations.length)X3B(H,$);A.setValue(H,L)}function F3B(H,$){H.html&&SiH($,"html",H.html),H.classes&&SiH($,"class",H.classes),H.position&&SiH($,"position",H.position),Object.keys(H.attributes).forEach(function(A){SiH($,A,H.attributes[A])})}function _rA(){RiH.forEach(F3B)}function K3B(H,$){var A=null;if(H.kind==="html")A=CrA($);else if(H.kind==="class")A=ZrA($);else if(H.kind==="attribute")A=qrA($,H.attribute);else if(H.kind==="position")A=wrA($);if(!A)return;A.mutations.push(H),A.mutationRunner(A)}function Q3B(H,$){var A=null;if(H.kind==="html")A=CrA($);else if(H.kind==="class")A=ZrA($);else if(H.kind==="attribute")A=qrA($,H.attribute);else if(H.kind==="position")A=wrA($);if(!A)return;var L=A.mutations.indexOf(H);if(L!==-1)A.mutations.splice(L,1);A.mutationRunner(A)}function TrA(H){if(H.kind==="position"&&H.elements.size===1)return;var $=new Set(H.elements),A=document.querySelectorAll(H.selector);A.forEach(function(L){if(!$.has(L))H.elements.add(L),K3B(H,L)})}function W3B(H){H.elements.forEach(function($){return Q3B(H,$)}),H.elements.clear(),qR$.delete(H)}function YrA(){qR$.forEach(TrA)}function V3B(){if(typeof document>"u")return;if(!CR$)CR$=new MutationObserver(function(){YrA()});YrA(),CR$.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1})}function biH(H){if(typeof document>"u")return ZR$;return qR$.add(H),TrA(H),{revert:function(){W3B(H)}}}function wR$(H,$){return biH({kind:"html",elements:new Set,mutate:$,selector:H})}function zrA(H,$){return biH({kind:"position",elements:new Set,mutate:$,selector:H})}function fCH(H,$){return biH({kind:"class",elements:new Set,mutate:$,selector:H})}function jiH(H,$,A){if(!t6B.test($))return ZR$;if($==="class"||$==="className")return fCH(H,function(L){var I=A(Array.from(L).join(" "));if(L.clear(),!I)return;I.split(/\s+/g).filter(Boolean).forEach(function(D){return L.add(D)})});return biH({kind:"attribute",attribute:$,elements:new Set,mutate:A,selector:H})}function P3B(H){var{selector:$,action:A,value:L,attribute:I,parentSelector:D,insertBeforeSelector:B}=H;if(I==="html"){if(A==="append")return wR$($,function(f){return f+(L!=null?L:"")});else if(A==="set")return wR$($,function(){return L!=null?L:""})}else if(I==="class"){if(A==="append")return fCH($,function(f){if(L)f.add(L)});else if(A==="remove")return fCH($,function(f){if(L)f.delete(L)});else if(A==="set")return fCH($,function(f){if(f.clear(),L)f.add(L)})}else if(I==="position"){if(A==="set"&&D)return zrA($,function(){return{insertBeforeSelector:B,parentSelector:D}})}else if(A==="append")return jiH($,I,function(f){return f!==null?f+(L!=null?L:""):L!=null?L:""});else if(A==="set")return jiH($,I,function(){return L!=null?L:""});else if(A==="remove")return jiH($,I,function(){return null});return ZR$}var t6B,ZR$,RiH,qR$,I3B=function($){return $.innerHTML},D3B=function($,A){return $.innerHTML=A},B3B=function($){return{parentNode:$.parentElement,insertBeforeNode:$.nextElementSibling}},f3B=function($,A){if(A.insertBeforeNode&&!A.parentNode.contains(A.insertBeforeNode))return;A.parentNode.insertBefore($,A.insertBeforeNode)},E3B=function($,A){return A?$.className=A:$.removeAttribute("class")},M3B=function($){return $.className},G3B=function($){return function(A){var L;return(L=A.getAttribute($))!=null?L:null}},U3B=function($){return function(A,L){return L!==null?A.setAttribute($,L):A.removeAttribute($)}},xiH,CR$,_3B,NrA;var OrA=K(()=>{t6B=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,ZR$={revert:function(){}},RiH=new Map,qR$=new Set;V3B();_3B={html:wR$,classes:fCH,attribute:jiH,position:zrA,declarative:P3B},NrA=_3B});function kc(H,$,A){A=A||{};for(let[L,I]of Object.entries($))switch(L){case"$or":if(!xrA(H,I,A))return!1;break;case"$nor":if(xrA(H,I,A))return!1;break;case"$and":if(!T3B(H,I,A))return!1;break;case"$not":if(kc(H,I,A))return!1;break;default:if(!ECH(I,Y3B(H,L),A))return!1}return!0}function Y3B(H,$){let A=$.split("."),L=H;for(let I=0;I0&&$.filter((A)=>A[0]==="$").length===$.length}function w3B(H){if(H===null)return"null";if(Array.isArray(H))return"array";let $=typeof H;if(["string","number","boolean","object","undefined"].includes($))return $;return"unknown"}function Z3B(H,$,A){if(!Array.isArray(H))return!1;let L=SrA($)?(I)=>ECH($,I,A):(I)=>kc(I,$,A);for(let I=0;I$.includes(A));return $.includes(H)}function q3B(H,$,A,L){switch(H){case"$veq":return sC($)===sC(A);case"$vne":return sC($)!==sC(A);case"$vgt":return sC($)>sC(A);case"$vgte":return sC($)>=sC(A);case"$vlt":return sC($)A;case"$gte":return $>=A;case"$exists":return A?$!=null:$==null;case"$in":if(!Array.isArray(A))return!1;return kiH($,A);case"$inGroup":return kiH($,L[A]||[]);case"$notInGroup":return!kiH($,L[A]||[]);case"$nin":if(!Array.isArray(A))return!1;return!kiH($,A);case"$not":return!ECH(A,$,L);case"$size":if(!Array.isArray($))return!1;return ECH(A,$.length,L);case"$elemMatch":return Z3B($,A,L);case"$all":if(!Array.isArray($))return!1;for(let I=0;I{DCH();TR$={}});function O3B(H){let $=new Map;if(H.global.forcedFeatureValues)H.global.forcedFeatureValues.forEach((A,L)=>$.set(L,A));if(H.user.forcedFeatureValues)H.user.forcedFeatureValues.forEach((A,L)=>$.set(L,A));return $}function x3B(H){if(H.global.forcedVariations&&H.user.forcedVariations)return{...H.global.forcedVariations,...H.user.forcedVariations};else if(H.global.forcedVariations)return H.global.forcedVariations;else if(H.user.forcedVariations)return H.user.forcedVariations;else return{}}async function ZEH(H){try{await H()}catch($){}}function RrA(H,$,A){if(H.user.trackedExperiments){let I=miH($,A);if(H.user.trackedExperiments.has(I))return[];H.user.trackedExperiments.add(I)}if(H.user.enableDevMode&&H.user.devLogs)H.user.devLogs.push({experiment:$,result:A,timestamp:Date.now().toString(),logType:"experiment"});let L=[];if(H.global.trackingCallback){let I=H.global.trackingCallback;L.push(ZEH(()=>I($,A,H.user)))}if(H.user.trackingCallback){let I=H.user.trackingCallback;L.push(ZEH(()=>I($,A)))}if(H.global.eventLogger){let I=H.global.eventLogger;L.push(ZEH(()=>I(N3B,{experimentId:$.key,variationId:A.key,hashAttribute:A.hashAttribute,hashValue:A.hashValue},H.user)))}return L}function S3B(H,$,A){if(H.user.trackedFeatureUsage){let L=JSON.stringify(A.value);if(H.user.trackedFeatureUsage[$]===L)return;if(H.user.trackedFeatureUsage[$]=L,H.user.enableDevMode&&H.user.devLogs)H.user.devLogs.push({featureKey:$,result:A,timestamp:Date.now().toString(),logType:"feature"})}if(H.global.onFeatureUsage){let L=H.global.onFeatureUsage;ZEH(()=>L($,A,H.user))}if(H.user.onFeatureUsage){let L=H.user.onFeatureUsage;ZEH(()=>L($,A))}if(H.global.eventLogger){let L=H.global.eventLogger;ZEH(()=>L(z3B,{feature:$,source:A.source,value:A.value,ruleId:A.source==="defaultValue"?"$default":A.ruleId||"",variationId:A.experimentResult?A.experimentResult.key:""},H.user))}}function uiH(H,$){if($.stack.evaluatedFeatures.has(H))return uc($,H,null,"cyclicPrerequisite");$.stack.evaluatedFeatures.add(H),$.stack.id=H;let A=O3B($);if(A.has(H))return uc($,H,A.get(H),"override");if(!$.global.features||!$.global.features[H])return uc($,H,null,"unknownFeature");let L=$.global.features[H];if(L.rules){let I=new Set($.stack.evaluatedFeatures);H:for(let D of L.rules){if(D.parentConditions)for(let E of D.parentConditions){$.stack.evaluatedFeatures=new Set(I);let M=uiH(E.id,$);if(M.source==="cyclicPrerequisite")return uc($,H,null,"cyclicPrerequisite");let G={value:M.value};if(!kc(G,E.condition||{})){if(E.gate)return uc($,H,null,"prerequisite");continue H}}if(D.filters&&hrA(D.filters,$))continue;if("force"in D){if(D.condition&&!vrA(D.condition,$))continue;if(!j3B($,D.seed||H,D.hashAttribute,$.user.saveStickyBucketAssignmentDoc&&!D.disableStickyBucketing?D.fallbackAttribute:void 0,D.range,D.coverage,D.hashVersion))continue;if(D.tracks)D.tracks.forEach((E)=>{if(!RrA($,E.experiment,E.result).length&&$.global.saveDeferredTrack)$.global.saveDeferredTrack({experiment:E.experiment,result:E.result})});return uc($,H,D.force,"force",D.id)}if(!D.variations)continue;let B={variations:D.variations,key:D.key||H};if("coverage"in D)B.coverage=D.coverage;if(D.weights)B.weights=D.weights;if(D.hashAttribute)B.hashAttribute=D.hashAttribute;if(D.fallbackAttribute)B.fallbackAttribute=D.fallbackAttribute;if(D.disableStickyBucketing)B.disableStickyBucketing=D.disableStickyBucketing;if(D.bucketVersion!==void 0)B.bucketVersion=D.bucketVersion;if(D.minBucketVersion!==void 0)B.minBucketVersion=D.minBucketVersion;if(D.namespace)B.namespace=D.namespace;if(D.meta)B.meta=D.meta;if(D.ranges)B.ranges=D.ranges;if(D.name)B.name=D.name;if(D.phase)B.phase=D.phase;if(D.seed)B.seed=D.seed;if(D.hashVersion)B.hashVersion=D.hashVersion;if(D.filters)B.filters=D.filters;if(D.condition)B.condition=D.condition;let{result:f}=giH(B,H,$);if($.global.onExperimentEval&&$.global.onExperimentEval(B,f),f.inExperiment&&!f.passthrough)return uc($,H,f.value,"experiment",D.id,B,f)}}return uc($,H,L.defaultValue===void 0?null:L.defaultValue,"defaultValue")}function giH(H,$,A){let L=H.key,I=H.variations.length;if(I<2)return{result:J4(A,H,-1,!1,$)};if(A.global.enabled===!1||A.user.enabled===!1)return{result:J4(A,H,-1,!1,$)};if(H=R3B(H,A),H.urlPatterns&&!qiH(A.user.url||"",H.urlPatterns))return{result:J4(A,H,-1,!1,$)};let D=frA(L,A.user.url||"",I);if(D!==null)return{result:J4(A,H,D,!1,$)};let B=x3B(A);if(L in B){let W=B[L];return{result:J4(A,H,W,!1,$)}}if(H.status==="draft"||H.active===!1)return{result:J4(A,H,-1,!1,$)};let{hashAttribute:f,hashValue:E}=hHH(A,H.hashAttribute,A.user.saveStickyBucketAssignmentDoc&&!H.disableStickyBucketing?H.fallbackAttribute:void 0);if(!E)return{result:J4(A,H,-1,!1,$)};let M=-1,G=!1,U=!1;if(A.user.saveStickyBucketAssignmentDoc&&!H.disableStickyBucketing){let{variation:W,versionIsBlocked:P}=h3B({ctx:A,expKey:H.key,expBucketVersion:H.bucketVersion,expHashAttribute:H.hashAttribute,expFallbackAttribute:H.fallbackAttribute,expMinBucketVersion:H.minBucketVersion,expMeta:H.meta});G=W>=0,M=W,U=!!P}if(!G){if(H.filters){if(hrA(H.filters,A))return{result:J4(A,H,-1,!1,$)}}else if(H.namespace&&!IrA(E,H.namespace))return{result:J4(A,H,-1,!1,$)};if(H.include&&!ErA(H.include))return{result:J4(A,H,-1,!1,$)};if(H.condition&&!vrA(H.condition,A))return{result:J4(A,H,-1,!1,$)};if(H.parentConditions){let W=new Set(A.stack.evaluatedFeatures);for(let P of H.parentConditions){A.stack.evaluatedFeatures=new Set(W);let C=uiH(P.id,A);if(C.source==="cyclicPrerequisite")return{result:J4(A,H,-1,!1,$)};let Y={value:C.value};if(!kc(Y,P.condition||{}))return{result:J4(A,H,-1,!1,$)}}}if(H.groups&&!v3B(H.groups,A))return{result:J4(A,H,-1,!1,$)}}if(H.url&&!y3B(H.url,A))return{result:J4(A,H,-1,!1,$)};let X=LCH(H.seed||L,E,H.hashVersion||1);if(X===null)return{result:J4(A,H,-1,!1,$)};if(!G){let W=H.ranges||BrA(I,H.coverage===void 0?1:H.coverage,H.weights);M=DrA(X,W)}if(U)return{result:J4(A,H,-1,!1,$,void 0,!0)};if(M<0)return{result:J4(A,H,-1,!1,$)};if("force"in H)return{result:J4(A,H,H.force===void 0?-1:H.force,!1,$)};if(A.global.qaMode||A.user.qaMode)return{result:J4(A,H,-1,!1,$)};if(H.status==="stopped")return{result:J4(A,H,-1,!1,$)};let J=J4(A,H,M,!0,$,X,G);if(A.user.saveStickyBucketAssignmentDoc&&!H.disableStickyBucketing){let{changed:W,key:P,doc:C}=k3B(A,f,ICH(E),{[zR$(H.key,H.bucketVersion)]:J.key});if(W)A.user.stickyBucketAssignmentDocs=A.user.stickyBucketAssignmentDocs||{},A.user.stickyBucketAssignmentDocs[P]=C,A.user.saveStickyBucketAssignmentDoc(C)}let F=RrA(A,H,J);if(F.length===0&&A.global.saveDeferredTrack)A.global.saveDeferredTrack({experiment:H,result:J});let Q=!F.length?void 0:F.length===1?F[0]:Promise.all(F).then(()=>{});return"changeId"in H&&H.changeId&&A.global.recordChangeId&&A.global.recordChangeId(H.changeId),{result:J,trackingCall:Q}}function uc(H,$,A,L,I,D,B){let f={value:A,on:!!A,off:!A,source:L,ruleId:I||""};if(D)f.experiment=D;if(B)f.experimentResult=B;if(L!=="override")S3B(H,$,f);return f}function yrA(H){return{...H.user.attributes,...H.user.attributeOverrides}}function vrA(H,$){return kc(yrA($),H,$.global.savedGroups||{})}function hrA(H,$){return H.some((A)=>{let{hashValue:L}=hHH($,A.attribute);if(!L)return!0;let I=LCH(A.seed,L,A.hashVersion||2);if(I===null)return!0;return!A.ranges.some((D)=>ZiH(I,D))})}function j3B(H,$,A,L,I,D,B){if(!I&&D===void 0)return!0;if(!I&&D===0)return!1;let{hashValue:f}=hHH(H,A,L);if(!f)return!1;let E=LCH($,f,B||1);if(E===null)return!1;return I?ZiH(E,I):D!==void 0?E<=D:!0}function J4(H,$,A,L,I,D,B){let f=!0;if(A<0||A>=$.variations.length)A=0,f=!1;let{hashAttribute:E,hashValue:M}=hHH(H,$.hashAttribute,H.user.saveStickyBucketAssignmentDoc&&!$.disableStickyBucketing?$.fallbackAttribute:void 0),G=$.meta?$.meta[A]:{},U={key:G.key||""+A,featureId:I,inExperiment:f,hashUsed:L,variationId:A,value:$.variations[A],hashAttribute:E,hashValue:M,stickyBucketUsed:!!B};if(G.name)U.name=G.name;if(D!==void 0)U.bucket=D;if(G.passthrough)U.passthrough=G.passthrough;return U}function R3B(H,$){let A=H.key,L=$.global.overrides;if(L&&L[A]){if(H=Object.assign({},H,L[A]),typeof H.url==="string")H.url=QR$(H.url)}return H}function hHH(H,$,A){let L=$||"id",I="",D=yrA(H);if(D[L])I=D[L];if(!I&&A){if(D[A])I=D[A];if(I)L=A}return{hashAttribute:L,hashValue:I}}function y3B(H,$){let A=$.user.url;if(!A)return!1;let L=A.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");if(H.test(A))return!0;if(H.test(L))return!0;return!1}function v3B(H,$){let A=$.global.groups||{};for(let L=0;L0)for(let X=0;X<=B;X++){let J=zR$(A,X);if(M[J]!==void 0)return{variation:-1,versionIsBlocked:!0}}let G=M[E];if(G===void 0)return{variation:-1};let U=f.findIndex((X)=>X.key===G);if(U<0)return{variation:-1};return{variation:U}}function zR$(H,$){return $=$||0,`${H}__${$}`}function NR$(H,$){return`${H}||${$}`}function b3B(H,$,A){if(!H.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:L,hashValue:I}=hHH(H,$),D=NR$(L,ICH(I)),{hashAttribute:B,hashValue:f}=hHH(H,A),E=f?NR$(B,ICH(f)):null,M={};if(E&&H.user.stickyBucketAssignmentDocs[E])Object.assign(M,H.user.stickyBucketAssignmentDocs[E].assignments||{});if(H.user.stickyBucketAssignmentDocs[D])Object.assign(M,H.user.stickyBucketAssignmentDocs[D].assignments||{});return M}function k3B(H,$,A,L){let I=NR$($,A),D=H.user.stickyBucketAssignmentDocs&&H.user.stickyBucketAssignmentDocs[I]?H.user.stickyBucketAssignmentDocs[I].assignments||{}:{},B={...D,...L},f=JSON.stringify(D)!==JSON.stringify(B);return{key:I,doc:{attributeName:$,attributeValue:A,assignments:B},changed:f}}function u3B(H,$){let A=new Set,L=$&&$.features?$.features:H.global.features||{},I=$&&$.experiments?$.experiments:H.global.experiments||[];return Object.keys(L).forEach((D)=>{let B=L[D];if(B.rules){for(let f of B.rules)if(f.variations){if(A.add(f.hashAttribute||"id"),f.fallbackAttribute)A.add(f.fallbackAttribute)}}}),I.map((D)=>{if(A.add(D.hashAttribute||"id"),D.fallbackAttribute)A.add(D.fallbackAttribute)}),Array.from(A)}async function brA(H,$,A){let L=OR$(H,A);return $.getAllAssignments(L)}function OR$(H,$){let A={};return u3B(H,$).forEach((I)=>{let{hashValue:D}=hHH(H,I);A[I]=ICH(D)}),A}async function krA(H,$,A){if(H={...H},H.encryptedFeatures){try{H.features=JSON.parse(await vHH(H.encryptedFeatures,$,A))}catch(L){console.error(L)}delete H.encryptedFeatures}if(H.encryptedExperiments){try{H.experiments=JSON.parse(await vHH(H.encryptedExperiments,$,A))}catch(L){console.error(L)}delete H.encryptedExperiments}if(H.encryptedSavedGroups){try{H.savedGroups=JSON.parse(await vHH(H.encryptedSavedGroups,$,A))}catch(L){console.error(L)}delete H.encryptedSavedGroups}return H}function urA(H){let $=H.apiHost||"https://cdn.growthbook.io";return{apiHost:$.replace(/\/*$/,""),streamingHost:(H.streamingHost||$).replace(/\/*$/,""),apiRequestHeaders:H.apiHostRequestHeaders,streamingHostRequestHeaders:H.streamingHostRequestHeaders}}function miH(H,$){return $.hashAttribute+$.hashValue+H.key+$.variationId}var z3B="Feature Evaluated",N3B="Experiment Viewed";var grA=K(()=>{jrA();DCH()});class piH{constructor(H){if(H=H||{},this.version=g3B,this._options=this.context=H,this._renderer=H.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!H.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!H.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),H.remoteEval){if(H.decryptionKey)throw Error("Encryption is not available for remoteEval");if(!H.clientKey)throw Error("Missing clientKey");let $=!1;try{$=!!new URL(H.apiHost||"").hostname.match(/growthbook\.io$/i)}catch(A){}if($)throw Error("Cannot use remoteEval on GrowthBook Cloud")}else if(H.cacheKeyAttributes)throw Error("cacheKeyAttributes are only used for remoteEval");if(H.stickyBucketService){let $=H.stickyBucketService;this._saveStickyBucketAssignmentDoc=(A)=>{return $.saveAssignments(A)}}if(H.plugins)for(let $ of H.plugins)$(this);if(H.features)this.ready=!0;if(qEH&&H.enableDevMode)window._growthbook=this,document.dispatchEvent(new Event("gbloaded"));if(H.experiments)this.ready=!0,this._updateAllAutoExperiments();if(this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let $ in this._options.stickyBucketAssignmentDocs){let A=this._options.stickyBucketAssignmentDocs[$];if(A)this._options.stickyBucketService.saveAssignments(A).catch(()=>{})}if(this.ready)this.refreshStickyBuckets(this.getPayload())}async setPayload(H){this._payload=H;let $=await krA(H,this._options.decryptionKey);if(this._decryptedPayload=$,await this.refreshStickyBuckets($),$.features)this._options.features=$.features;if($.savedGroups)this._options.savedGroups=$.savedGroups;if($.experiments)this._options.experiments=$.experiments,this._updateAllAutoExperiments();this.ready=!0,this._render()}initSync(H){this._initialized=!0;let $=H.payload;if($.encryptedExperiments||$.encryptedFeatures)throw Error("initSync does not support encrypted payloads");if(this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs)this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,$);if(this._payload=$,this._decryptedPayload=$,$.features)this._options.features=$.features;if($.experiments)this._options.experiments=$.experiments,this._updateAllAutoExperiments();return this.ready=!0,OiH(this,H),this}async init(H){if(this._initialized=!0,H=H||{},H.cacheSettings)JrA(H.cacheSettings);if(H.payload)return await this.setPayload(H.payload),OiH(this,H),{success:!0,source:"init"};else{let{data:$,...A}=await this._refresh({...H,allowStale:!0});return OiH(this,H),await this.setPayload($||{}),A}}async loadFeatures(H){H=H||{},await this.init({skipCache:H.skipCache,timeout:H.timeout,streaming:(this._options.backgroundSync??!0)&&(H.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(H){let $=await this._refresh({...H||{},allowStale:!1});if($.data)await this.setPayload($.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return urA(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh(H){let{timeout:$,skipCache:A,allowStale:L,streaming:I}=H;if(!this._options.clientKey)throw Error("Missing clientKey");return FrA({instance:this,timeout:$,skipCache:A||this._options.disableCache,allowStale:L,backgroundSync:I??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(H){console.error("Failed to render",H)}}setFeatures(H){this._options.features=H,this.ready=!0,this._render()}async setEncryptedFeatures(H,$,A){let L=await vHH(H,$||this._options.decryptionKey,A);this.setFeatures(JSON.parse(L))}setExperiments(H){this._options.experiments=H,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(H,$,A){let L=await vHH(H,$||this._options.decryptionKey,A);this.setExperiments(JSON.parse(L))}async setAttributes(H){if(this._options.attributes=H,this._options.stickyBucketService)await this.refreshStickyBuckets();if(this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(H){return this.setAttributes({...this._options.attributes,...H})}async setAttributeOverrides(H){if(this._options.attributeOverrides=H,this._options.stickyBucketService)await this.refreshStickyBuckets();if(this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(H){if(this._options.forcedVariations=H||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(H){this._options.forcedFeatureValues=H,this._render()}async setURL(H){if(H===this._options.url)return;if(this._options.url=H,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(H){return this._subscriptions.add(H),()=>{this._subscriptions.delete(H)}}async _refreshForRemoteEval(){if(!this._options.remoteEval)return;if(!this._initialized)return;let H=await this._refresh({allowStale:!1});if(H.data)await this.setPayload(H.data)}getAllResults(){return new Map(this._assigned)}onDestroy(H){this._destroyCallbacks.push(H)}isDestroyed(){return!!this._destroyed}destroy(){if(this._destroyed=!0,this._destroyCallbacks.forEach((H)=>{try{H()}catch($){console.error($)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,KrA(this),this.logs=[],qEH&&window._growthbook===this)delete window._growthbook;this._activeAutoExperiments.forEach((H)=>{H.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(H){this._renderer=H}forceVariation(H,$){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[H]=$,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(H){let{result:$}=giH(H,null,this._getEvalContext());return this._fireSubscriptions(H,$),$}triggerExperiment(H){if(this._triggeredExpKeys.add(H),!this._options.experiments)return null;return this._options.experiments.filter((A)=>A.key===H).map((A)=>{return this._runAutoExperiment(A)}).filter((A)=>A!==null)}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._subscriptions.size>0?this._fireSubscriptions:void 0,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(H,$){let A=this._activeAutoExperiments.get(H);if(H.manual&&!this._triggeredExpKeys.has(H.key)&&!A)return null;let L=this._isAutoExperimentBlockedByContext(H),I,D;if(L)I=J4(this._getEvalContext(),H,-1,!1,"");else({result:I,trackingCall:D}=giH(H,null,this._getEvalContext())),this._fireSubscriptions(H,I);let B=JSON.stringify(I.value);if(!$&&I.inExperiment&&A&&A.valueHash===B)return I;if(A)this._undoActiveAutoExperiment(H);if(I.inExperiment){let f=TiH(H);if(f==="redirect"&&I.value.urlRedirect&&H.urlPatterns){let E=H.persistQueryString?GrA(this._getContextUrl(),I.value.urlRedirect):I.value.urlRedirect;if(qiH(E,H.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:H.key}),I;this._redirectedUrl=E;let{navigate:M,delay:G}=this._getNavigateFunction();if(M)if(qEH)Promise.all([...D?[ziH(D,this._options.maxNavigateDelay??1000)]:[],new Promise((U)=>window.setTimeout(U,this._options.navigateDelay??G))]).then(()=>{try{M(E)}catch(U){console.error(U)}});else try{M(E)}catch(U){console.error(U)}}else if(f==="visual"){let E=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(I.value):this._applyDOMChanges(I.value);if(E)this._activeAutoExperiments.set(H,{undo:E,valueHash:B})}}return I}_undoActiveAutoExperiment(H){let $=this._activeAutoExperiments.get(H);if($)$.undo(),this._activeAutoExperiments.delete(H)}_updateAllAutoExperiments(H){if(!this._autoExperimentsAllowed)return;let $=this._options.experiments||[],A=new Set($);this._activeAutoExperiments.forEach((L,I)=>{if(!A.has(I))L.undo(),this._activeAutoExperiments.delete(I)});for(let L of $){let I=this._runAutoExperiment(L,H);if(I!==null&&I!==void 0&&I.inExperiment&&TiH(L)==="redirect")break}}_fireSubscriptions(H,$){let A=H.key,L=this._assigned.get(A);if(!L||L.result.inExperiment!==$.inExperiment||L.result.variationId!==$.variationId)this._assigned.set(A,{experiment:H,result:$}),this._subscriptions.forEach((I)=>{try{I(H,$)}catch(D){console.error(D)}})}_recordChangedId(H){this._completedChangeIds.add(H)}isOn(H){return this.evalFeature(H).on}isOff(H){return this.evalFeature(H).off}getFeatureValue(H,$){let A=this.evalFeature(H).value;return A===null?$:A}feature(H){return this.evalFeature(H)}evalFeature(H){return uiH(H,this._getEvalContext())}log(H,$){if(!this.debug)return;if(this._options.log)this._options.log(H,$);else console.log(H,$)}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(H){this._deferredTrackingCalls=new Map(H.filter(($)=>$&&$.experiment&&$.result).map(($)=>{return[miH($.experiment,$.result),$]}))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let H=[];this._deferredTrackingCalls.forEach(($)=>{if(!$||!$.experiment||!$.result)console.error("Invalid deferred tracking call",{call:$});else H.push(this._options.trackingCallback($.experiment,$.result))}),this._deferredTrackingCalls.clear(),await Promise.all(H)}setTrackingCallback(H){this._options.trackingCallback=H,this.fireDeferredTrackingCalls()}setEventLogger(H){this._options.eventLogger=H}async logEvent(H,$){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode)this.logs.push({eventName:H,properties:$,timestamp:Date.now().toString(),logType:"event"});if(this._options.eventLogger)try{await this._options.eventLogger(H,$||{},this._getUserContext())}catch(A){console.error(A)}else console.error("No event logger configured")}_saveDeferredTrack(H){this._deferredTrackingCalls.set(miH(H.experiment,H.result),H)}_getContextUrl(){return this._options.url||(qEH?window.location.href:"")}_isAutoExperimentBlockedByContext(H){let $=TiH(H);if($==="visual"){if(this._options.disableVisualExperiments)return!0;if(this._options.disableJsInjection){if(H.variations.some((A)=>A.js))return!0}}else if($==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let A=new URL(this._getContextUrl());for(let L of H.variations){if(!L||!L.urlRedirect)continue;let I=new URL(L.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments){if(I.protocol!==A.protocol)return!0;if(I.host!==A.host)return!0}}}catch(A){return this.log("Error parsing current or redirect URL",{id:H.key,error:A}),!0}}else return!0;if(H.changeId&&(this._options.blockedChangeIds||[]).includes(H.changeId))return!0;return!1}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){if(this._options.navigate)return{navigate:this._options.navigate,delay:0};else if(qEH)return{navigate:(H)=>{window.location.replace(H)},delay:100};return{navigate:null,delay:0}}_applyDOMChanges(H){if(!qEH)return;let $=[];if(H.css){let A=document.createElement("style");A.innerHTML=H.css,document.head.appendChild(A),$.push(()=>A.remove())}if(H.js){let A=document.createElement("script");if(A.innerHTML=H.js,this._options.jsInjectionNonce)A.nonce=this._options.jsInjectionNonce;document.head.appendChild(A),$.push(()=>A.remove())}if(H.domMutations)H.domMutations.forEach((A)=>{$.push(NrA.declarative(A).revert)});return()=>{$.forEach((A)=>A())}}async refreshStickyBuckets(H){if(this._options.stickyBucketService){let $=this._getEvalContext(),A=await brA($,this._options.stickyBucketService,H);this._options.stickyBucketAssignmentDocs=A}}generateStickyBucketAssignmentDocsSync(H,$){if(!("getAllAssignmentsSync"in H)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let A=this._getEvalContext(),L=OR$(A,$);return H.getAllAssignmentsSync(L)}inDevMode(){return!!this._options.enableDevMode}}var qEH,g3B;var mrA=K(()=>{OrA();DCH();PrA();grA();qEH=typeof window<"u"&&typeof document<"u",g3B=MrA()});var prA=K(()=>{mrA()});var drA="sdk-zAZezfDKGoZuXXKe";var crA=K(()=>{NA()});function MCH(H,$){return function(){return H.apply($,arguments)}}function p3B(H){return H!==null&&!GCH(H)&&H.constructor!==null&&!GCH(H.constructor)&&eC(H.constructor.isBuffer)&&H.constructor.isBuffer(H)}function d3B(H){let $;if(typeof ArrayBuffer<"u"&&ArrayBuffer.isView)$=ArrayBuffer.isView(H);else $=H&&H.buffer&&irA(H.buffer);return $}function UCH(H,$,{allOwnKeys:A=!1}={}){if(H===null||typeof H>"u")return;let L,I;if(typeof H!=="object")H=[H];if(TEH(H))for(L=0,I=H.length;L0)if(I=A[L],$===I.toLowerCase())return I;return null}function xR$(){let{caseless:H}=arA(this)&&this||{},$={},A=(L,I)=>{let D=H&&rrA($,I)||I;if(diH($[D])&&diH(L))$[D]=xR$($[D],L);else if(diH(L))$[D]=xR$({},L);else if(TEH(L))$[D]=L.slice();else $[D]=L};for(let L=0,I=arguments.length;L{return H=H.toLowerCase(),($)=>ciH($)===H},liH=(H)=>($)=>typeof $===H,TEH,GCH,irA,c3B,eC,nrA,iiH=(H)=>H!==null&&typeof H==="object",l3B=(H)=>H===!0||H===!1,diH=(H)=>{if(ciH(H)!=="object")return!1;let $=SR$(H);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in H)&&!(Symbol.iterator in H)},i3B,n3B,r3B,a3B,o3B=(H)=>iiH(H)&&eC(H.pipe),t3B=(H)=>{let $;return H&&(typeof FormData==="function"&&H instanceof FormData||eC(H.append)&&(($=ciH(H))==="formdata"||$==="object"&&eC(H.toString)&&H.toString()==="[object FormData]"))},s3B,e3B,HVB,$VB,AVB,LVB=(H)=>H.trim?H.trim():H.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),bHH,arA=(H)=>!GCH(H)&&H!==bHH,IVB=(H,$,A,{allOwnKeys:L}={})=>{return UCH($,(I,D)=>{if(A&&eC(I))H[D]=MCH(I,A);else H[D]=I},{allOwnKeys:L}),H},DVB=(H)=>{if(H.charCodeAt(0)===65279)H=H.slice(1);return H},BVB=(H,$,A,L)=>{H.prototype=Object.create($.prototype,L),H.prototype.constructor=H,Object.defineProperty(H,"super",{value:$.prototype}),A&&Object.assign(H.prototype,A)},fVB=(H,$,A,L)=>{let I,D,B,f={};if($=$||{},H==null)return $;do{I=Object.getOwnPropertyNames(H),D=I.length;while(D-- >0)if(B=I[D],(!L||L(B,H,$))&&!f[B])$[B]=H[B],f[B]=!0;H=A!==!1&&SR$(H)}while(H&&(!A||A(H,$))&&H!==Object.prototype);return $},EVB=(H,$,A)=>{if(H=String(H),A===void 0||A>H.length)A=H.length;A-=$.length;let L=H.indexOf($,A);return L!==-1&&L===A},MVB=(H)=>{if(!H)return null;if(TEH(H))return H;let $=H.length;if(!nrA($))return null;let A=Array($);while($-- >0)A[$]=H[$];return A},GVB,UVB=(H,$)=>{let L=(H&&H[Symbol.iterator]).call(H),I;while((I=L.next())&&!I.done){let D=I.value;$.call(H,D[0],D[1])}},XVB=(H,$)=>{let A,L=[];while((A=H.exec($))!==null)L.push(A);return L},JVB,FVB=(H)=>{return H.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(A,L,I){return L.toUpperCase()+I})},lrA,KVB,orA=(H,$)=>{let A=Object.getOwnPropertyDescriptors(H),L={};UCH(A,(I,D)=>{let B;if((B=$(I,D,H))!==!1)L[D]=B||I}),Object.defineProperties(H,L)},QVB=(H)=>{orA(H,($,A)=>{if(eC(H)&&["arguments","caller","callee"].indexOf(A)!==-1)return!1;let L=H[A];if(!eC(L))return;if($.enumerable=!1,"writable"in $){$.writable=!1;return}if(!$.set)$.set=()=>{throw Error("Can not rewrite read-only method '"+A+"'")}})},WVB=(H,$)=>{let A={},L=(I)=>{I.forEach((D)=>{A[D]=!0})};return TEH(H)?L(H):L(String(H).split($)),A},VVB=()=>{},PVB=(H,$)=>{return H!=null&&Number.isFinite(H=+H)?H:$},YVB=(H)=>{let $=[,,,,,,,,,,],A=(L,I)=>{if(iiH(L)){if($.indexOf(L)>=0)return;if(!("toJSON"in L)){$[I]=L;let D=TEH(L)?[]:{};return UCH(L,(B,f)=>{let E=A(B,I+1);!GCH(E)&&(D[f]=E)}),$[I]=void 0,D}}return L};return A(H,0)},CVB,wVB=(H)=>H&&(iiH(H)||eC(H))&&eC(H.then)&&eC(H.catch),trA,ZVB,v$;var iM=K(()=>{({toString:m3B}=Object.prototype),{getPrototypeOf:SR$}=Object,ciH=((H)=>($)=>{let A=m3B.call($);return H[A]||(H[A]=A.slice(8,-1).toLowerCase())})(Object.create(null)),{isArray:TEH}=Array,GCH=liH("undefined");irA=ZN("ArrayBuffer");c3B=liH("string"),eC=liH("function"),nrA=liH("number"),i3B=ZN("Date"),n3B=ZN("File"),r3B=ZN("Blob"),a3B=ZN("FileList"),s3B=ZN("URLSearchParams"),[e3B,HVB,$VB,AVB]=["ReadableStream","Request","Response","Headers"].map(ZN);bHH=(()=>{if(typeof globalThis<"u")return globalThis;return typeof self<"u"?self:typeof window<"u"?window:global})();GVB=((H)=>{return($)=>{return H&&$ instanceof H}})(typeof Uint8Array<"u"&&SR$(Uint8Array)),JVB=ZN("HTMLFormElement"),lrA=(({hasOwnProperty:H})=>($,A)=>H.call($,A))(Object.prototype),KVB=ZN("RegExp");CVB=ZN("AsyncFunction"),trA=((H,$)=>{if(H)return setImmediate;return $?((A,L)=>{return bHH.addEventListener("message",({source:I,data:D})=>{if(I===bHH&&D===A)L.length&&L.shift()()},!1),(I)=>{L.push(I),bHH.postMessage(A,"*")}})(`axios@${Math.random()}`,[]):(A)=>setTimeout(A)})(typeof setImmediate==="function",eC(bHH.postMessage)),ZVB=typeof queueMicrotask<"u"?queueMicrotask.bind(bHH):typeof process<"u"&&process.nextTick||trA,v$={isArray:TEH,isArrayBuffer:irA,isBuffer:p3B,isFormData:t3B,isArrayBufferView:d3B,isString:c3B,isNumber:nrA,isBoolean:l3B,isObject:iiH,isPlainObject:diH,isReadableStream:e3B,isRequest:HVB,isResponse:$VB,isHeaders:AVB,isUndefined:GCH,isDate:i3B,isFile:n3B,isBlob:r3B,isRegExp:KVB,isFunction:eC,isStream:o3B,isURLSearchParams:s3B,isTypedArray:GVB,isFileList:a3B,forEach:UCH,merge:xR$,extend:IVB,trim:LVB,stripBOM:DVB,inherits:BVB,toFlatObject:fVB,kindOf:ciH,kindOfTest:ZN,endsWith:EVB,toArray:MVB,forEachEntry:UVB,matchAll:XVB,isHTMLForm:JVB,hasOwnProperty:lrA,hasOwnProp:lrA,reduceDescriptors:orA,freezeMethods:QVB,toObjectSet:WVB,toCamelCase:FVB,noop:VVB,toFiniteNumber:PVB,findKey:rrA,global:bHH,isContextDefined:arA,isSpecCompliantForm:_VB,toJSONObject:YVB,isAsyncFn:CVB,isThenable:wVB,setImmediate:trA,asap:ZVB}});function zEH(H,$,A,L,I){if(Error.call(this),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack;if(this.message=H,this.name="AxiosError",$&&(this.code=$),A&&(this.config=A),L&&(this.request=L),I)this.response=I,this.status=I.status?I.status:null}var srA,erA,rI;var H2=K(()=>{iM();v$.inherits(zEH,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v$.toJSONObject(this.config),code:this.code,status:this.status}}});srA=zEH.prototype,erA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((H)=>{erA[H]={value:H}});Object.defineProperties(zEH,erA);Object.defineProperty(srA,"isAxiosError",{value:!0});zEH.from=(H,$,A,L,I,D)=>{let B=Object.create(srA);return v$.toFlatObject(H,B,function(E){return E!==Error.prototype},(f)=>{return f!=="isAxiosError"}),zEH.call(B,H.message,$,A,L,I),B.cause=H,B.name=H.name,D&&Object.assign(B,D),B};rI=zEH});var AaA=z((Bi1,$aA)=>{var HaA=require("stream").Stream,qVB=require("util");$aA.exports=qN;function qN(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}qVB.inherits(qN,HaA);qN.create=function(H,$){var A=new this;$=$||{};for(var L in $)A[L]=$[L];A.source=H;var I=H.emit;if(H.emit=function(){return A._handleEmit(arguments),I.apply(H,arguments)},H.on("error",function(){}),A.pauseStream)H.pause();return A};Object.defineProperty(qN.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});qN.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};qN.prototype.resume=function(){if(!this._released)this.release();this.source.resume()};qN.prototype.pause=function(){this.source.pause()};qN.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(H){this.emit.apply(this,H)}.bind(this)),this._bufferedEvents=[]};qN.prototype.pipe=function(){var H=HaA.prototype.pipe.apply(this,arguments);return this.resume(),H};qN.prototype._handleEmit=function(H){if(this._released){this.emit.apply(this,H);return}if(H[0]==="data")this.dataSize+=H[1].length,this._checkIfMaxDataSizeExceeded();this._bufferedEvents.push(H)};qN.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded)return;if(this.dataSize<=this.maxDataSize)return;this._maxDataSizeExceeded=!0;var H="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",Error(H))}});var BaA=z((fi1,DaA)=>{var TVB=require("util"),IaA=require("stream").Stream,LaA=AaA();DaA.exports=fX;function fX(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}TVB.inherits(fX,IaA);fX.create=function(H){var $=new this;H=H||{};for(var A in H)$[A]=H[A];return $};fX.isStreamLike=function(H){return typeof H!=="function"&&typeof H!=="string"&&typeof H!=="boolean"&&typeof H!=="number"&&!Buffer.isBuffer(H)};fX.prototype.append=function(H){var $=fX.isStreamLike(H);if($){if(!(H instanceof LaA)){var A=LaA.create(H,{maxDataSize:1/0,pauseStream:this.pauseStreams});H.on("data",this._checkDataSize.bind(this)),H=A}if(this._handleErrors(H),this.pauseStreams)H.pause()}return this._streams.push(H),this};fX.prototype.pipe=function(H,$){return IaA.prototype.pipe.call(this,H,$),this.resume(),H};fX.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};fX.prototype._realGetNext=function(){var H=this._streams.shift();if(typeof H>"u"){this.end();return}if(typeof H!=="function"){this._pipeNext(H);return}var $=H;$(function(A){var L=fX.isStreamLike(A);if(L)A.on("data",this._checkDataSize.bind(this)),this._handleErrors(A);this._pipeNext(A)}.bind(this))};fX.prototype._pipeNext=function(H){this._currentStream=H;var $=fX.isStreamLike(H);if($){H.on("end",this._getNext.bind(this)),H.pipe(this,{end:!1});return}var A=H;this.write(A),this._getNext()};fX.prototype._handleErrors=function(H){var $=this;H.on("error",function(A){$._emitError(A)})};fX.prototype.write=function(H){this.emit("data",H)};fX.prototype.pause=function(){if(!this.pauseStreams)return;if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};fX.prototype.resume=function(){if(!this._released)this._released=!0,this.writable=!0,this._getNext();if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};fX.prototype.end=function(){this._reset(),this.emit("end")};fX.prototype.destroy=function(){this._reset(),this.emit("close")};fX.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};fX.prototype._checkDataSize=function(){if(this._updateDataSize(),this.dataSize<=this.maxDataSize)return;var H="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(Error(H))};fX.prototype._updateDataSize=function(){this.dataSize=0;var H=this;if(this._streams.forEach(function($){if(!$.dataSize)return;H.dataSize+=$.dataSize}),this._currentStream&&this._currentStream.dataSize)this.dataSize+=this._currentStream.dataSize};fX.prototype._emitError=function(H){this._reset(),this.emit("error",H)}});var faA=z((Ei1,zVB)=>{zVB.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var MaA=z((Mi1,EaA)=>{/*! `):"",this.name="UnsubscriptionError",this.errors=A}})});var Vk=z((znH)=>{Object.defineProperty(znH,"__esModule",{value:!0});znH.arrRemove=void 0;function mYB(H,$){if(H){var A=H.indexOf($);0<=A&&H.splice(A,1)}}znH.arrRemove=mYB});var L2=z((q_)=>{var ssA=q_&&q_.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")},esA=q_&&q_.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},HeA=q_&&q_.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(NnH,"__esModule",{value:!0});NnH.config=void 0;NnH.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var ly$=z((UR)=>{var LeA=UR&&UR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},IeA=UR&&UR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(OnH,"__esModule",{value:!0});OnH.reportUnhandledError=void 0;var dYB=gEH(),cYB=ly$();function lYB(H){cYB.timeoutProvider.setTimeout(function(){var $=dYB.config.onUnhandledError;if($)$(H);else throw H})}OnH.reportUnhandledError=lYB});var NW=z((xnH)=>{Object.defineProperty(xnH,"__esModule",{value:!0});xnH.noop=void 0;function iYB(){}xnH.noop=iYB});var DeA=z((XR)=>{Object.defineProperty(XR,"__esModule",{value:!0});XR.createNotification=XR.nextNotification=XR.errorNotification=XR.COMPLETE_NOTIFICATION=void 0;XR.COMPLETE_NOTIFICATION=function(){return SnH("C",void 0,void 0)}();function nYB(H){return SnH("E",void 0,H)}XR.errorNotification=nYB;function rYB(H){return SnH("N",H,void 0)}XR.nextNotification=rYB;function SnH(H,$,A){return{kind:H,value:$,error:A}}XR.createNotification=SnH});var jnH=z((mEH)=>{Object.defineProperty(mEH,"__esModule",{value:!0});mEH.captureError=mEH.errorContext=void 0;var BeA=gEH(),rHH=null;function aYB(H){if(BeA.config.useDeprecatedSynchronousErrorHandling){var $=!rHH;if($)rHH={errorThrown:!1,error:null};if(H(),$){var A=rHH,L=A.errorThrown,I=A.error;if(rHH=null,L)throw I}}else H()}mEH.errorContext=aYB;function oYB(H){if(BeA.config.useDeprecatedSynchronousErrorHandling&&rHH)rHH.errorThrown=!0,rHH.error=H}mEH.captureError=oYB});var pEH=z((NN)=>{var MeA=NN&&NN.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(NN,"__esModule",{value:!0});NN.EMPTY_OBSERVER=NN.SafeSubscriber=NN.Subscriber=void 0;var tYB=sE(),feA=L2(),oy$=gEH(),sYB=iy$(),EeA=NW(),ny$=DeA(),eYB=ly$(),HCB=jnH(),GeA=function(H){MeA($,H);function $(A){var L=H.call(this)||this;if(L.isStopped=!1,A){if(L.destination=A,feA.isSubscription(A))A.add(L)}else L.destination=NN.EMPTY_OBSERVER;return L}return $.create=function(A,L,I){return new UeA(A,L,I)},$.prototype.next=function(A){if(this.isStopped)ay$(ny$.nextNotification(A),this);else this._next(A)},$.prototype.error=function(A){if(this.isStopped)ay$(ny$.errorNotification(A),this);else this.isStopped=!0,this._error(A)},$.prototype.complete=function(){if(this.isStopped)ay$(ny$.COMPLETE_NOTIFICATION,this);else this.isStopped=!0,this._complete()},$.prototype.unsubscribe=function(){if(!this.closed)this.isStopped=!0,H.prototype.unsubscribe.call(this),this.destination=null},$.prototype._next=function(A){this.destination.next(A)},$.prototype._error=function(A){try{this.destination.error(A)}finally{this.unsubscribe()}},$.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},$}(feA.Subscription);NN.Subscriber=GeA;var $CB=Function.prototype.bind;function ry$(H,$){return $CB.call(H,$)}var ACB=function(){function H($){this.partialObserver=$}return H.prototype.next=function($){var A=this.partialObserver;if(A.next)try{A.next($)}catch(L){RnH(L)}},H.prototype.error=function($){var A=this.partialObserver;if(A.error)try{A.error($)}catch(L){RnH(L)}else RnH($)},H.prototype.complete=function(){var $=this.partialObserver;if($.complete)try{$.complete()}catch(A){RnH(A)}},H}(),UeA=function(H){MeA($,H);function $(A,L,I){var D=H.call(this)||this,B;if(tYB.isFunction(A)||!A)B={next:A!==null&&A!==void 0?A:void 0,error:L!==null&&L!==void 0?L:void 0,complete:I!==null&&I!==void 0?I:void 0};else{var f;if(D&&oy$.config.useDeprecatedNextContext)f=Object.create(A),f.unsubscribe=function(){return D.unsubscribe()},B={next:A.next&&ry$(A.next,f),error:A.error&&ry$(A.error,f),complete:A.complete&&ry$(A.complete,f)};else B=A}return D.destination=new ACB(B),D}return $}(GeA);NN.SafeSubscriber=UeA;function RnH(H){if(oy$.config.useDeprecatedSynchronousErrorHandling)HCB.captureError(H);else sYB.reportUnhandledError(H)}function LCB(H){throw H}function ay$(H,$){var A=oy$.config.onStoppedNotification;A&&eYB.timeoutProvider.setTimeout(function(){return A(H,$)})}NN.EMPTY_OBSERVER={closed:!0,next:EeA.noop,error:LCB,complete:EeA.noop}});var jCH=z((ynH)=>{Object.defineProperty(ynH,"__esModule",{value:!0});ynH.observable=void 0;ynH.observable=function(){return typeof Symbol==="function"&&Symbol.observable||"@@observable"}()});var OW=z((vnH)=>{Object.defineProperty(vnH,"__esModule",{value:!0});vnH.identity=void 0;function ICB(H){return H}vnH.identity=ICB});var RCH=z((dEH)=>{Object.defineProperty(dEH,"__esModule",{value:!0});dEH.pipeFromArray=dEH.pipe=void 0;var DCB=OW();function BCB(){var H=[];for(var $=0;${Object.defineProperty(hnH,"__esModule",{value:!0});hnH.Observable=void 0;var sy$=pEH(),fCB=L2(),ECB=jCH(),MCB=RCH(),GCB=gEH(),ty$=sE(),UCB=jnH(),XCB=function(){function H($){if($)this._subscribe=$}return H.prototype.lift=function($){var A=new H;return A.source=this,A.operator=$,A},H.prototype.subscribe=function($,A,L){var I=this,D=FCB($)?$:new sy$.SafeSubscriber($,A,L);return UCB.errorContext(function(){var B=I,f=B.operator,E=B.source;D.add(f?f.call(D,E):E?I._subscribe(D):I._trySubscribe(D))}),D},H.prototype._trySubscribe=function($){try{return this._subscribe($)}catch(A){$.error(A)}},H.prototype.forEach=function($,A){var L=this;return A=JeA(A),new A(function(I,D){var B=new sy$.SafeSubscriber({next:function(f){try{$(f)}catch(E){D(E),B.unsubscribe()}},error:D,complete:I});L.subscribe(B)})},H.prototype._subscribe=function($){var A;return(A=this.source)===null||A===void 0?void 0:A.subscribe($)},H.prototype[ECB.observable]=function(){return this},H.prototype.pipe=function(){var $=[];for(var A=0;A{Object.defineProperty(cEH,"__esModule",{value:!0});cEH.operate=cEH.hasLift=void 0;var KCB=sE();function FeA(H){return KCB.isFunction(H===null||H===void 0?void 0:H.lift)}cEH.hasLift=FeA;function QCB(H){return function($){if(FeA($))return $.lift(function(A){try{return H(A,this)}catch(L){this.error(L)}});throw TypeError("Unable to lift unknown Observable type")}}cEH.operate=QCB});var EB=z((dc)=>{var WCB=dc&&dc.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(dc,"__esModule",{value:!0});dc.OperatorSubscriber=dc.createOperatorSubscriber=void 0;var VCB=pEH();function PCB(H,$,A,L,I){return new KeA(H,$,A,L,I)}dc.createOperatorSubscriber=PCB;var KeA=function(H){WCB($,H);function $(A,L,I,D,B,f){var E=H.call(this,A)||this;return E.onFinalize=B,E.shouldUnsubscribe=f,E._next=L?function(M){try{L(M)}catch(G){A.error(G)}}:H.prototype._next,E._error=D?function(M){try{D(M)}catch(G){A.error(G)}finally{this.unsubscribe()}}:H.prototype._error,E._complete=I?function(){try{I()}catch(M){A.error(M)}finally{this.unsubscribe()}}:H.prototype._complete,E}return $.prototype.unsubscribe=function(){var A;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var L=this.closed;H.prototype.unsubscribe.call(this),!L&&((A=this.onFinalize)===null||A===void 0||A.call(this))}},$}(VCB.Subscriber);dc.OperatorSubscriber=KeA});var knH=z((bnH)=>{Object.defineProperty(bnH,"__esModule",{value:!0});bnH.refCount=void 0;var _CB=ED(),YCB=EB();function CCB(){return _CB.operate(function(H,$){var A=null;H._refCount++;var L=YCB.createOperatorSubscriber($,void 0,void 0,void 0,function(){if(!H||H._refCount<=0||0<--H._refCount){A=null;return}var I=H._connection,D=A;if(A=null,I&&(!D||I===D))I.unsubscribe();$.unsubscribe()});if(H.subscribe(L),!L.closed)A=H.connect()})}bnH.refCount=CCB});var yCH=z((lEH)=>{var wCB=lEH&&lEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(lEH,"__esModule",{value:!0});lEH.ConnectableObservable=void 0;var ZCB=wM(),QeA=L2(),qCB=knH(),TCB=EB(),zCB=ED(),NCB=function(H){wCB($,H);function $(A,L){var I=H.call(this)||this;if(I.source=A,I.subjectFactory=L,I._subject=null,I._refCount=0,I._connection=null,zCB.hasLift(A))I.lift=A.lift;return I}return $.prototype._subscribe=function(A){return this.getSubject().subscribe(A)},$.prototype.getSubject=function(){var A=this._subject;if(!A||A.isStopped)this._subject=this.subjectFactory();return this._subject},$.prototype._teardown=function(){this._refCount=0;var A=this._connection;this._subject=this._connection=null,A===null||A===void 0||A.unsubscribe()},$.prototype.connect=function(){var A=this,L=this._connection;if(!L){L=this._connection=new QeA.Subscription;var I=this.getSubject();if(L.add(this.source.subscribe(TCB.createOperatorSubscriber(I,void 0,function(){A._teardown(),I.complete()},function(D){A._teardown(),I.error(D)},function(){return A._teardown()}))),L.closed)this._connection=null,L=QeA.Subscription.EMPTY}return L},$.prototype.refCount=function(){return qCB.refCount()(this)},$}(ZCB.Observable);lEH.ConnectableObservable=NCB});var WeA=z((vCH)=>{Object.defineProperty(vCH,"__esModule",{value:!0});vCH.performanceTimestampProvider=void 0;vCH.performanceTimestampProvider={now:function(){return(vCH.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var ey$=z((ON)=>{var VeA=ON&&ON.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},PeA=ON&&ON.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(unH,"__esModule",{value:!0});unH.animationFrames=void 0;var xCB=wM(),SCB=WeA(),_eA=ey$();function jCB(H){return H?YeA(H):RCB}unH.animationFrames=jCB;function YeA(H){return new xCB.Observable(function($){var A=H||SCB.performanceTimestampProvider,L=A.now(),I=0,D=function(){if(!$.closed)I=_eA.animationFrameProvider.requestAnimationFrame(function(B){I=0;var f=A.now();$.next({timestamp:H?f:B,elapsed:f-L}),D()})};return D(),function(){if(I)_eA.animationFrameProvider.cancelAnimationFrame(I)}})}var RCB=YeA()});var Hv$=z((gnH)=>{Object.defineProperty(gnH,"__esModule",{value:!0});gnH.ObjectUnsubscribedError=void 0;var yCB=pc();gnH.ObjectUnsubscribedError=yCB.createErrorClass(function(H){return function(){H(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var xW=z((JR)=>{var ZeA=JR&&JR.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}(),vCB=JR&&JR.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(JR,"__esModule",{value:!0});JR.AnonymousSubject=JR.Subject=void 0;var weA=wM(),Av$=L2(),hCB=Hv$(),bCB=Vk(),$v$=jnH(),qeA=function(H){ZeA($,H);function $(){var A=H.call(this)||this;return A.closed=!1,A.currentObservers=null,A.observers=[],A.isStopped=!1,A.hasError=!1,A.thrownError=null,A}return $.prototype.lift=function(A){var L=new Lv$(this,this);return L.operator=A,L},$.prototype._throwIfClosed=function(){if(this.closed)throw new hCB.ObjectUnsubscribedError},$.prototype.next=function(A){var L=this;$v$.errorContext(function(){var I,D;if(L._throwIfClosed(),!L.isStopped){if(!L.currentObservers)L.currentObservers=Array.from(L.observers);try{for(var B=vCB(L.currentObservers),f=B.next();!f.done;f=B.next()){var E=f.value;E.next(A)}}catch(M){I={error:M}}finally{try{if(f&&!f.done&&(D=B.return))D.call(B)}finally{if(I)throw I.error}}}})},$.prototype.error=function(A){var L=this;$v$.errorContext(function(){if(L._throwIfClosed(),!L.isStopped){L.hasError=L.isStopped=!0,L.thrownError=A;var I=L.observers;while(I.length)I.shift().error(A)}})},$.prototype.complete=function(){var A=this;$v$.errorContext(function(){if(A._throwIfClosed(),!A.isStopped){A.isStopped=!0;var L=A.observers;while(L.length)L.shift().complete()}})},$.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty($.prototype,"observed",{get:function(){var A;return((A=this.observers)===null||A===void 0?void 0:A.length)>0},enumerable:!1,configurable:!0}),$.prototype._trySubscribe=function(A){return this._throwIfClosed(),H.prototype._trySubscribe.call(this,A)},$.prototype._subscribe=function(A){return this._throwIfClosed(),this._checkFinalizedStatuses(A),this._innerSubscribe(A)},$.prototype._innerSubscribe=function(A){var L=this,I=this,D=I.hasError,B=I.isStopped,f=I.observers;if(D||B)return Av$.EMPTY_SUBSCRIPTION;return this.currentObservers=null,f.push(A),new Av$.Subscription(function(){L.currentObservers=null,bCB.arrRemove(f,A)})},$.prototype._checkFinalizedStatuses=function(A){var L=this,I=L.hasError,D=L.thrownError,B=L.isStopped;if(I)A.error(D);else if(B)A.complete()},$.prototype.asObservable=function(){var A=new weA.Observable;return A.source=this,A},$.create=function(A,L){return new Lv$(A,L)},$}(weA.Observable);JR.Subject=qeA;var Lv$=function(H){ZeA($,H);function $(A,L){var I=H.call(this)||this;return I.destination=A,I.source=L,I}return $.prototype.next=function(A){var L,I;(I=(L=this.destination)===null||L===void 0?void 0:L.next)===null||I===void 0||I.call(L,A)},$.prototype.error=function(A){var L,I;(I=(L=this.destination)===null||L===void 0?void 0:L.error)===null||I===void 0||I.call(L,A)},$.prototype.complete=function(){var A,L;(L=(A=this.destination)===null||A===void 0?void 0:A.complete)===null||L===void 0||L.call(A)},$.prototype._subscribe=function(A){var L,I;return(I=(L=this.source)===null||L===void 0?void 0:L.subscribe(A))!==null&&I!==void 0?I:Av$.EMPTY_SUBSCRIPTION},$}(qeA);JR.AnonymousSubject=Lv$});var Iv$=z((iEH)=>{var kCB=iEH&&iEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(iEH,"__esModule",{value:!0});iEH.BehaviorSubject=void 0;var uCB=xW(),gCB=function(H){kCB($,H);function $(A){var L=H.call(this)||this;return L._value=A,L}return Object.defineProperty($.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),$.prototype._subscribe=function(A){var L=H.prototype._subscribe.call(this,A);return!L.closed&&A.next(this._value),L},$.prototype.getValue=function(){var A=this,L=A.hasError,I=A.thrownError,D=A._value;if(L)throw I;return this._throwIfClosed(),D},$.prototype.next=function(A){H.prototype.next.call(this,this._value=A)},$}(uCB.Subject);iEH.BehaviorSubject=gCB});var mnH=z((hCH)=>{Object.defineProperty(hCH,"__esModule",{value:!0});hCH.dateTimestampProvider=void 0;hCH.dateTimestampProvider={now:function(){return(hCH.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var pnH=z((nEH)=>{var mCB=nEH&&nEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(nEH,"__esModule",{value:!0});nEH.ReplaySubject=void 0;var pCB=xW(),dCB=mnH(),cCB=function(H){mCB($,H);function $(A,L,I){if(A===void 0)A=1/0;if(L===void 0)L=1/0;if(I===void 0)I=dCB.dateTimestampProvider;var D=H.call(this)||this;return D._bufferSize=A,D._windowTime=L,D._timestampProvider=I,D._buffer=[],D._infiniteTimeWindow=!0,D._infiniteTimeWindow=L===1/0,D._bufferSize=Math.max(1,A),D._windowTime=Math.max(1,L),D}return $.prototype.next=function(A){var L=this,I=L.isStopped,D=L._buffer,B=L._infiniteTimeWindow,f=L._timestampProvider,E=L._windowTime;if(!I)D.push(A),!B&&D.push(f.now()+E);this._trimBuffer(),H.prototype.next.call(this,A)},$.prototype._subscribe=function(A){this._throwIfClosed(),this._trimBuffer();var L=this._innerSubscribe(A),I=this,D=I._infiniteTimeWindow,B=I._buffer,f=B.slice();for(var E=0;E{var lCB=rEH&&rEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(rEH,"__esModule",{value:!0});rEH.AsyncSubject=void 0;var iCB=xW(),nCB=function(H){lCB($,H);function $(){var A=H!==null&&H.apply(this,arguments)||this;return A._value=null,A._hasValue=!1,A._isComplete=!1,A}return $.prototype._checkFinalizedStatuses=function(A){var L=this,I=L.hasError,D=L._hasValue,B=L._value,f=L.thrownError,E=L.isStopped,M=L._isComplete;if(I)A.error(f);else if(E||M)D&&A.next(B),A.complete()},$.prototype.next=function(A){if(!this.isStopped)this._value=A,this._hasValue=!0},$.prototype.complete=function(){var A=this,L=A._hasValue,I=A._value,D=A._isComplete;if(!D)this._isComplete=!0,L&&H.prototype.next.call(this,I),H.prototype.complete.call(this)},$}(iCB.Subject);rEH.AsyncSubject=nCB});var TeA=z((aEH)=>{var rCB=aEH&&aEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(aEH,"__esModule",{value:!0});aEH.Action=void 0;var aCB=L2(),oCB=function(H){rCB($,H);function $(A,L){return H.call(this)||this}return $.prototype.schedule=function(A,L){if(L===void 0)L=0;return this},$}(aCB.Subscription);aEH.Action=oCB});var OeA=z((FR)=>{var zeA=FR&&FR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},NeA=FR&&FR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var tCB=oEH&&oEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(oEH,"__esModule",{value:!0});oEH.AsyncAction=void 0;var sCB=TeA(),xeA=OeA(),eCB=Vk(),H2B=function(H){tCB($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I.pending=!1,I}return $.prototype.schedule=function(A,L){var I;if(L===void 0)L=0;if(this.closed)return this;this.state=A;var D=this.id,B=this.scheduler;if(D!=null)this.id=this.recycleAsyncId(B,D,L);return this.pending=!0,this.delay=L,this.id=(I=this.id)!==null&&I!==void 0?I:this.requestAsyncId(B,this.id,L),this},$.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;return xeA.intervalProvider.setInterval(A.flush.bind(A,this),I)},$.prototype.recycleAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!=null&&this.delay===I&&this.pending===!1)return L;if(L!=null)xeA.intervalProvider.clearInterval(L);return},$.prototype.execute=function(A,L){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var I=this._execute(A,L);if(I)return I;else if(this.pending===!1&&this.id!=null)this.id=this.recycleAsyncId(this.scheduler,this.id,null)},$.prototype._execute=function(A,L){var I=!1,D;try{this.work(A)}catch(B){I=!0,D=B?B:Error("Scheduled action threw falsy error")}if(I)return this.unsubscribe(),D},$.prototype.unsubscribe=function(){if(!this.closed){var A=this,L=A.id,I=A.scheduler,D=I.actions;if(this.work=this.state=this.scheduler=null,this.pending=!1,eCB.arrRemove(D,this),L!=null)this.id=this.recycleAsyncId(I,L,null);this.delay=null,H.prototype.unsubscribe.call(this)}},$}(sCB.Action);oEH.AsyncAction=H2B});var jeA=z((sEH)=>{Object.defineProperty(sEH,"__esModule",{value:!0});sEH.TestTools=sEH.Immediate=void 0;var $2B=1,Dv$,cnH={};function SeA(H){if(H in cnH)return delete cnH[H],!0;return!1}sEH.Immediate={setImmediate:function(H){var $=$2B++;if(cnH[$]=!0,!Dv$)Dv$=Promise.resolve();return Dv$.then(function(){return SeA($)&&H()}),$},clearImmediate:function(H){SeA(H)}};sEH.TestTools={pending:function(){return Object.keys(cnH).length}}});var yeA=z((KR)=>{var A2B=KR&&KR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},L2B=KR&&KR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var B2B=eEH&&eEH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(eEH,"__esModule",{value:!0});eEH.AsapAction=void 0;var f2B=tEH(),veA=yeA(),E2B=function(H){B2B($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I}return $.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!==null&&I>0)return H.prototype.requestAsyncId.call(this,A,L,I);return A.actions.push(this),A._scheduled||(A._scheduled=veA.immediateProvider.setImmediate(A.flush.bind(A,void 0)))},$.prototype.recycleAsyncId=function(A,L,I){var D;if(I===void 0)I=0;if(I!=null?I>0:this.delay>0)return H.prototype.recycleAsyncId.call(this,A,L,I);var B=A.actions;if(L!=null&&((D=B[B.length-1])===null||D===void 0?void 0:D.id)!==L){if(veA.immediateProvider.clearImmediate(L),A._scheduled===L)A._scheduled=void 0}return},$}(f2B.AsyncAction);eEH.AsapAction=E2B});var Bv$=z((lnH)=>{Object.defineProperty(lnH,"__esModule",{value:!0});lnH.Scheduler=void 0;var M2B=mnH(),G2B=function(){function H($,A){if(A===void 0)A=H.now;this.schedulerActionCtor=$,this.now=A}return H.prototype.schedule=function($,A,L){if(A===void 0)A=0;return new this.schedulerActionCtor(this,$).schedule(L,A)},H.now=M2B.dateTimestampProvider.now,H}();lnH.Scheduler=G2B});var $MH=z((HMH)=>{var U2B=HMH&&HMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(HMH,"__esModule",{value:!0});HMH.AsyncScheduler=void 0;var beA=Bv$(),X2B=function(H){U2B($,H);function $(A,L){if(L===void 0)L=beA.Scheduler.now;var I=H.call(this,A,L)||this;return I.actions=[],I._active=!1,I}return $.prototype.flush=function(A){var L=this.actions;if(this._active){L.push(A);return}var I;this._active=!0;do if(I=A.execute(A.state,A.delay))break;while(A=L.shift());if(this._active=!1,I){while(A=L.shift())A.unsubscribe();throw I}},$}(beA.Scheduler);HMH.AsyncScheduler=X2B});var keA=z((AMH)=>{var J2B=AMH&&AMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(AMH,"__esModule",{value:!0});AMH.AsapScheduler=void 0;var F2B=$MH(),K2B=function(H){J2B($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $.prototype.flush=function(A){this._active=!0;var L=this._scheduled;this._scheduled=void 0;var I=this.actions,D;A=A||I.shift();do if(D=A.execute(A.state,A.delay))break;while((A=I[0])&&A.id===L&&I.shift());if(this._active=!1,D){while((A=I[0])&&A.id===L&&I.shift())A.unsubscribe();throw D}},$}(F2B.AsyncScheduler);AMH.AsapScheduler=K2B});var ueA=z((aHH)=>{Object.defineProperty(aHH,"__esModule",{value:!0});aHH.asap=aHH.asapScheduler=void 0;var Q2B=heA(),W2B=keA();aHH.asapScheduler=new W2B.AsapScheduler(Q2B.AsapAction);aHH.asap=aHH.asapScheduler});var T_=z((oHH)=>{Object.defineProperty(oHH,"__esModule",{value:!0});oHH.async=oHH.asyncScheduler=void 0;var V2B=tEH(),P2B=$MH();oHH.asyncScheduler=new P2B.AsyncScheduler(V2B.AsyncAction);oHH.async=oHH.asyncScheduler});var geA=z((LMH)=>{var _2B=LMH&&LMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(LMH,"__esModule",{value:!0});LMH.QueueAction=void 0;var Y2B=tEH(),C2B=function(H){_2B($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I}return $.prototype.schedule=function(A,L){if(L===void 0)L=0;if(L>0)return H.prototype.schedule.call(this,A,L);return this.delay=L,this.state=A,this.scheduler.flush(this),this},$.prototype.execute=function(A,L){return L>0||this.closed?H.prototype.execute.call(this,A,L):this._execute(A,L)},$.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!=null&&I>0||I==null&&this.delay>0)return H.prototype.requestAsyncId.call(this,A,L,I);return A.flush(this),0},$}(Y2B.AsyncAction);LMH.QueueAction=C2B});var meA=z((IMH)=>{var w2B=IMH&&IMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(IMH,"__esModule",{value:!0});IMH.QueueScheduler=void 0;var Z2B=$MH(),q2B=function(H){w2B($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $}(Z2B.AsyncScheduler);IMH.QueueScheduler=q2B});var peA=z((tHH)=>{Object.defineProperty(tHH,"__esModule",{value:!0});tHH.queue=tHH.queueScheduler=void 0;var T2B=geA(),z2B=meA();tHH.queueScheduler=new z2B.QueueScheduler(T2B.QueueAction);tHH.queue=tHH.queueScheduler});var ceA=z((DMH)=>{var N2B=DMH&&DMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(DMH,"__esModule",{value:!0});DMH.AnimationFrameAction=void 0;var O2B=tEH(),deA=ey$(),x2B=function(H){N2B($,H);function $(A,L){var I=H.call(this,A,L)||this;return I.scheduler=A,I.work=L,I}return $.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;if(I!==null&&I>0)return H.prototype.requestAsyncId.call(this,A,L,I);return A.actions.push(this),A._scheduled||(A._scheduled=deA.animationFrameProvider.requestAnimationFrame(function(){return A.flush(void 0)}))},$.prototype.recycleAsyncId=function(A,L,I){var D;if(I===void 0)I=0;if(I!=null?I>0:this.delay>0)return H.prototype.recycleAsyncId.call(this,A,L,I);var B=A.actions;if(L!=null&&L===A._scheduled&&((D=B[B.length-1])===null||D===void 0?void 0:D.id)!==L)deA.animationFrameProvider.cancelAnimationFrame(L),A._scheduled=void 0;return},$}(O2B.AsyncAction);DMH.AnimationFrameAction=x2B});var leA=z((BMH)=>{var S2B=BMH&&BMH.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(BMH,"__esModule",{value:!0});BMH.AnimationFrameScheduler=void 0;var j2B=$MH(),R2B=function(H){S2B($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $.prototype.flush=function(A){this._active=!0;var L;if(A)L=A.id;else L=this._scheduled,this._scheduled=void 0;var I=this.actions,D;A=A||I.shift();do if(D=A.execute(A.state,A.delay))break;while((A=I[0])&&A.id===L&&I.shift());if(this._active=!1,D){while((A=I[0])&&A.id===L&&I.shift())A.unsubscribe();throw D}},$}(j2B.AsyncScheduler);BMH.AnimationFrameScheduler=R2B});var ieA=z((sHH)=>{Object.defineProperty(sHH,"__esModule",{value:!0});sHH.animationFrame=sHH.animationFrameScheduler=void 0;var y2B=ceA(),v2B=leA();sHH.animationFrameScheduler=new v2B.AnimationFrameScheduler(y2B.AnimationFrameAction);sHH.animationFrame=sHH.animationFrameScheduler});var aeA=z((cc)=>{var neA=cc&&cc.__extends||function(){var H=function($,A){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,I){L.__proto__=I}||function(L,I){for(var D in I)if(Object.prototype.hasOwnProperty.call(I,D))L[D]=I[D]},H($,A)};return function($,A){if(typeof A!=="function"&&A!==null)throw TypeError("Class extends value "+String(A)+" is not a constructor or null");H($,A);function L(){this.constructor=$}$.prototype=A===null?Object.create(A):(L.prototype=A.prototype,new L)}}();Object.defineProperty(cc,"__esModule",{value:!0});cc.VirtualAction=cc.VirtualTimeScheduler=void 0;var h2B=tEH(),b2B=L2(),k2B=$MH(),u2B=function(H){neA($,H);function $(A,L){if(A===void 0)A=reA;if(L===void 0)L=1/0;var I=H.call(this,A,function(){return I.frame})||this;return I.maxFrames=L,I.frame=0,I.index=-1,I}return $.prototype.flush=function(){var A=this,L=A.actions,I=A.maxFrames,D,B;while((B=L[0])&&B.delay<=I)if(L.shift(),this.frame=B.delay,D=B.execute(B.state,B.delay))break;if(D){while(B=L.shift())B.unsubscribe();throw D}},$.frameTimeFactor=10,$}(k2B.AsyncScheduler);cc.VirtualTimeScheduler=u2B;var reA=function(H){neA($,H);function $(A,L,I){if(I===void 0)I=A.index+=1;var D=H.call(this,A,L)||this;return D.scheduler=A,D.work=L,D.index=I,D.active=!0,D.index=A.index=I,D}return $.prototype.schedule=function(A,L){if(L===void 0)L=0;if(Number.isFinite(L)){if(!this.id)return H.prototype.schedule.call(this,A,L);this.active=!1;var I=new $(this.scheduler,this.work);return this.add(I),I.schedule(A,L)}else return b2B.Subscription.EMPTY},$.prototype.requestAsyncId=function(A,L,I){if(I===void 0)I=0;this.delay=A.frame+I;var D=A.actions;return D.push(this),D.sort($.sortActions),1},$.prototype.recycleAsyncId=function(A,L,I){if(I===void 0)I=0;return},$.prototype._execute=function(A,L){if(this.active===!0)return H.prototype._execute.call(this,A,L)},$.sortActions=function(A,L){if(A.delay===L.delay)if(A.index===L.index)return 0;else if(A.index>L.index)return 1;else return-1;else if(A.delay>L.delay)return 1;else return-1},$}(h2B.AsyncAction);cc.VirtualAction=reA});var xN=z((eHH)=>{Object.defineProperty(eHH,"__esModule",{value:!0});eHH.empty=eHH.EMPTY=void 0;var oeA=wM();eHH.EMPTY=new oeA.Observable(function(H){return H.complete()});function g2B(H){return H?m2B(H):eHH.EMPTY}eHH.empty=g2B;function m2B(H){return new oeA.Observable(function($){return H.schedule(function(){return $.complete()})})}});var bCH=z((inH)=>{Object.defineProperty(inH,"__esModule",{value:!0});inH.isScheduler=void 0;var p2B=sE();function d2B(H){return H&&p2B.isFunction(H.schedule)}inH.isScheduler=d2B});var z_=z((lc)=>{Object.defineProperty(lc,"__esModule",{value:!0});lc.popNumber=lc.popScheduler=lc.popResultSelector=void 0;var c2B=sE(),l2B=bCH();function fv$(H){return H[H.length-1]}function i2B(H){return c2B.isFunction(fv$(H))?H.pop():void 0}lc.popResultSelector=i2B;function n2B(H){return l2B.isScheduler(fv$(H))?H.pop():void 0}lc.popScheduler=n2B;function r2B(H,$){return typeof fv$(H)==="number"?H.pop():$}lc.popNumber=r2B});var rnH=z((nnH)=>{Object.defineProperty(nnH,"__esModule",{value:!0});nnH.isArrayLike=void 0;nnH.isArrayLike=function(H){return H&&typeof H.length==="number"&&typeof H!=="function"}});var Ev$=z((anH)=>{Object.defineProperty(anH,"__esModule",{value:!0});anH.isPromise=void 0;var a2B=sE();function o2B(H){return a2B.isFunction(H===null||H===void 0?void 0:H.then)}anH.isPromise=o2B});var Mv$=z((onH)=>{Object.defineProperty(onH,"__esModule",{value:!0});onH.isInteropObservable=void 0;var t2B=jCH(),s2B=sE();function e2B(H){return s2B.isFunction(H[t2B.observable])}onH.isInteropObservable=e2B});var Gv$=z((tnH)=>{Object.defineProperty(tnH,"__esModule",{value:!0});tnH.isAsyncIterable=void 0;var HwB=sE();function $wB(H){return Symbol.asyncIterator&&HwB.isFunction(H===null||H===void 0?void 0:H[Symbol.asyncIterator])}tnH.isAsyncIterable=$wB});var Uv$=z((snH)=>{Object.defineProperty(snH,"__esModule",{value:!0});snH.createInvalidObservableTypeError=void 0;function AwB(H){return TypeError("You provided "+(H!==null&&typeof H==="object"?"an invalid object":"'"+H+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}snH.createInvalidObservableTypeError=AwB});var Xv$=z((fMH)=>{Object.defineProperty(fMH,"__esModule",{value:!0});fMH.iterator=fMH.getSymbolIterator=void 0;function teA(){if(typeof Symbol!=="function"||!Symbol.iterator)return"@@iterator";return Symbol.iterator}fMH.getSymbolIterator=teA;fMH.iterator=teA()});var Jv$=z((enH)=>{Object.defineProperty(enH,"__esModule",{value:!0});enH.isIterable=void 0;var LwB=Xv$(),IwB=sE();function DwB(H){return IwB.isFunction(H===null||H===void 0?void 0:H[LwB.iterator])}enH.isIterable=DwB});var HrH=z((cZ)=>{var BwB=cZ&&cZ.__generator||function(H,$){var A={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},L,I,D,B;return B={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function f(M){return function(G){return E([M,G])}}function E(M){if(L)throw TypeError("Generator is already executing.");while(A)try{if(L=1,I&&(D=M[0]&2?I.return:M[0]?I.throw||((D=I.return)&&D.call(I),0):I.next)&&!(D=D.call(I,M[1])).done)return D;if(I=0,D)M=[M[0]&2,D.value];switch(M[0]){case 0:case 1:D=M;break;case 4:return A.label++,{value:M[1],done:!1};case 5:A.label++,I=M[1],M=[0];continue;case 7:M=A.ops.pop(),A.trys.pop();continue;default:if((D=A.trys,!(D=D.length>0&&D[D.length-1]))&&(M[0]===6||M[0]===2)){A=0;continue}if(M[0]===3&&(!D||M[1]>D[0]&&M[1]1||f(X,J)})}}function f(X,J){try{E(L[X](J))}catch(F){U(D[0][3],F)}}function E(X){X.value instanceof EMH?Promise.resolve(X.value.v).then(M,G):U(D[0][2],X)}function M(X){f("next",X)}function G(X){f("throw",X)}function U(X,J){if(X(J),D.shift(),D.length)f(D[0][0],D[0][1])}};Object.defineProperty(cZ,"__esModule",{value:!0});cZ.isReadableStreamLike=cZ.readableStreamLikeToAsyncGenerator=void 0;var EwB=sE();function MwB(H){return fwB(this,arguments,function(){var A,L,I,D;return BwB(this,function(B){switch(B.label){case 0:A=H.getReader(),B.label=1;case 1:B.trys.push([1,,9,10]),B.label=2;case 2:return[4,EMH(A.read())];case 3:if(L=B.sent(),I=L.value,D=L.done,!D)return[3,5];return[4,EMH(void 0)];case 4:return[2,B.sent()];case 5:return[4,EMH(I)];case 6:return[4,B.sent()];case 7:return B.sent(),[3,2];case 8:return[3,10];case 9:return A.releaseLock(),[7];case 10:return[2]}})})}cZ.readableStreamLikeToAsyncGenerator=MwB;function GwB(H){return EwB.isFunction(H===null||H===void 0?void 0:H.getReader)}cZ.isReadableStreamLike=GwB});var M1=z((F4)=>{var UwB=F4&&F4.__awaiter||function(H,$,A,L){function I(D){return D instanceof A?D:new A(function(B){B(D)})}return new(A||(A=Promise))(function(D,B){function f(G){try{M(L.next(G))}catch(U){B(U)}}function E(G){try{M(L.throw(G))}catch(U){B(U)}}function M(G){G.done?D(G.value):I(G.value).then(f,E)}M((L=L.apply(H,$||[])).next())})},XwB=F4&&F4.__generator||function(H,$){var A={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},L,I,D,B;return B={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function f(M){return function(G){return E([M,G])}}function E(M){if(L)throw TypeError("Generator is already executing.");while(A)try{if(L=1,I&&(D=M[0]&2?I.return:M[0]?I.throw||((D=I.return)&&D.call(I),0):I.next)&&!(D=D.call(I,M[1])).done)return D;if(I=0,D)M=[M[0]&2,D.value];switch(M[0]){case 0:case 1:D=M;break;case 4:return A.label++,{value:M[1],done:!1};case 5:A.label++,I=M[1],M=[0];continue;case 7:M=A.ops.pop(),A.trys.pop();continue;default:if((D=A.trys,!(D=D.length>0&&D[D.length-1]))&&(M[0]===6||M[0]===2)){A=0;continue}if(M[0]===3&&(!D||M[1]>D[0]&&M[1]=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(F4,"__esModule",{value:!0});F4.fromReadableStreamLike=F4.fromAsyncIterable=F4.fromIterable=F4.fromPromise=F4.fromArrayLike=F4.fromInteropObservable=F4.innerFrom=void 0;var FwB=rnH(),KwB=Ev$(),MMH=wM(),QwB=Mv$(),WwB=Gv$(),VwB=Uv$(),PwB=Jv$(),seA=HrH(),_wB=sE(),YwB=iy$(),CwB=jCH();function wwB(H){if(H instanceof MMH.Observable)return H;if(H!=null){if(QwB.isInteropObservable(H))return eeA(H);if(FwB.isArrayLike(H))return HHL(H);if(KwB.isPromise(H))return $HL(H);if(WwB.isAsyncIterable(H))return Kv$(H);if(PwB.isIterable(H))return AHL(H);if(seA.isReadableStreamLike(H))return LHL(H)}throw VwB.createInvalidObservableTypeError(H)}F4.innerFrom=wwB;function eeA(H){return new MMH.Observable(function($){var A=H[CwB.observable]();if(_wB.isFunction(A.subscribe))return A.subscribe($);throw TypeError("Provided object does not correctly implement Symbol.observable")})}F4.fromInteropObservable=eeA;function HHL(H){return new MMH.Observable(function($){for(var A=0;A{Object.defineProperty($rH,"__esModule",{value:!0});$rH.executeSchedule=void 0;function qwB(H,$,A,L,I){if(L===void 0)L=0;if(I===void 0)I=!1;var D=$.schedule(function(){if(A(),I)H.add(this.schedule(null,L));else this.unsubscribe()},L);if(H.add(D),!I)return D}$rH.executeSchedule=qwB});var GMH=z((ArH)=>{Object.defineProperty(ArH,"__esModule",{value:!0});ArH.observeOn=void 0;var Qv$=Pk(),TwB=ED(),zwB=EB();function NwB(H,$){if($===void 0)$=0;return TwB.operate(function(A,L){A.subscribe(zwB.createOperatorSubscriber(L,function(I){return Qv$.executeSchedule(L,H,function(){return L.next(I)},$)},function(){return Qv$.executeSchedule(L,H,function(){return L.complete()},$)},function(I){return Qv$.executeSchedule(L,H,function(){return L.error(I)},$)}))})}ArH.observeOn=NwB});var UMH=z((LrH)=>{Object.defineProperty(LrH,"__esModule",{value:!0});LrH.subscribeOn=void 0;var OwB=ED();function xwB(H,$){if($===void 0)$=0;return OwB.operate(function(A,L){L.add(H.schedule(function(){return A.subscribe(L)},$))})}LrH.subscribeOn=xwB});var IHL=z((IrH)=>{Object.defineProperty(IrH,"__esModule",{value:!0});IrH.scheduleObservable=void 0;var SwB=M1(),jwB=GMH(),RwB=UMH();function ywB(H,$){return SwB.innerFrom(H).pipe(RwB.subscribeOn($),jwB.observeOn($))}IrH.scheduleObservable=ywB});var DHL=z((DrH)=>{Object.defineProperty(DrH,"__esModule",{value:!0});DrH.schedulePromise=void 0;var vwB=M1(),hwB=GMH(),bwB=UMH();function kwB(H,$){return vwB.innerFrom(H).pipe(bwB.subscribeOn($),hwB.observeOn($))}DrH.schedulePromise=kwB});var BHL=z((BrH)=>{Object.defineProperty(BrH,"__esModule",{value:!0});BrH.scheduleArray=void 0;var uwB=wM();function gwB(H,$){return new uwB.Observable(function(A){var L=0;return $.schedule(function(){if(L===H.length)A.complete();else if(A.next(H[L++]),!A.closed)this.schedule()})})}BrH.scheduleArray=gwB});var Wv$=z((frH)=>{Object.defineProperty(frH,"__esModule",{value:!0});frH.scheduleIterable=void 0;var mwB=wM(),pwB=Xv$(),dwB=sE(),fHL=Pk();function cwB(H,$){return new mwB.Observable(function(A){var L;return fHL.executeSchedule(A,$,function(){L=H[pwB.iterator](),fHL.executeSchedule(A,$,function(){var I,D,B;try{I=L.next(),D=I.value,B=I.done}catch(f){A.error(f);return}if(B)A.complete();else A.next(D)},0,!0)}),function(){return dwB.isFunction(L===null||L===void 0?void 0:L.return)&&L.return()}})}frH.scheduleIterable=cwB});var Vv$=z((ErH)=>{Object.defineProperty(ErH,"__esModule",{value:!0});ErH.scheduleAsyncIterable=void 0;var lwB=wM(),EHL=Pk();function iwB(H,$){if(!H)throw Error("Iterable cannot be null");return new lwB.Observable(function(A){EHL.executeSchedule(A,$,function(){var L=H[Symbol.asyncIterator]();EHL.executeSchedule(A,$,function(){L.next().then(function(I){if(I.done)A.complete();else A.next(I.value)})},0,!0)})})}ErH.scheduleAsyncIterable=iwB});var MHL=z((MrH)=>{Object.defineProperty(MrH,"__esModule",{value:!0});MrH.scheduleReadableStreamLike=void 0;var nwB=Vv$(),rwB=HrH();function awB(H,$){return nwB.scheduleAsyncIterable(rwB.readableStreamLikeToAsyncGenerator(H),$)}MrH.scheduleReadableStreamLike=awB});var Pv$=z((GrH)=>{Object.defineProperty(GrH,"__esModule",{value:!0});GrH.scheduled=void 0;var owB=IHL(),twB=DHL(),swB=BHL(),ewB=Wv$(),HZB=Vv$(),$ZB=Mv$(),AZB=Ev$(),LZB=rnH(),IZB=Jv$(),DZB=Gv$(),BZB=Uv$(),fZB=HrH(),EZB=MHL();function MZB(H,$){if(H!=null){if($ZB.isInteropObservable(H))return owB.scheduleObservable(H,$);if(LZB.isArrayLike(H))return swB.scheduleArray(H,$);if(AZB.isPromise(H))return twB.schedulePromise(H,$);if(DZB.isAsyncIterable(H))return HZB.scheduleAsyncIterable(H,$);if(IZB.isIterable(H))return ewB.scheduleIterable(H,$);if(fZB.isReadableStreamLike(H))return EZB.scheduleReadableStreamLike(H,$)}throw BZB.createInvalidObservableTypeError(H)}GrH.scheduled=MZB});var _k=z((UrH)=>{Object.defineProperty(UrH,"__esModule",{value:!0});UrH.from=void 0;var GZB=Pv$(),UZB=M1();function XZB(H,$){return $?GZB.scheduled(H,$):UZB.innerFrom(H)}UrH.from=XZB});var JrH=z((XrH)=>{Object.defineProperty(XrH,"__esModule",{value:!0});XrH.of=void 0;var JZB=z_(),FZB=_k();function KZB(){var H=[];for(var $=0;${Object.defineProperty(FrH,"__esModule",{value:!0});FrH.throwError=void 0;var QZB=wM(),WZB=sE();function VZB(H,$){var A=WZB.isFunction(H)?H:function(){return H},L=function(I){return I.error(A())};return new QZB.Observable($?function(I){return $.schedule(L,0,I)}:L)}FrH.throwError=VZB});var KrH=z((Yk)=>{Object.defineProperty(Yk,"__esModule",{value:!0});Yk.observeNotification=Yk.Notification=Yk.NotificationKind=void 0;var PZB=xN(),_ZB=JrH(),YZB=_v$(),CZB=sE(),wZB;(function(H){H.NEXT="N",H.ERROR="E",H.COMPLETE="C"})(wZB=Yk.NotificationKind||(Yk.NotificationKind={}));var ZZB=function(){function H($,A,L){this.kind=$,this.value=A,this.error=L,this.hasValue=$==="N"}return H.prototype.observe=function($){return GHL(this,$)},H.prototype.do=function($,A,L){var I=this,D=I.kind,B=I.value,f=I.error;return D==="N"?$===null||$===void 0?void 0:$(B):D==="E"?A===null||A===void 0?void 0:A(f):L===null||L===void 0?void 0:L()},H.prototype.accept=function($,A,L){var I;return CZB.isFunction((I=$)===null||I===void 0?void 0:I.next)?this.observe($):this.do($,A,L)},H.prototype.toObservable=function(){var $=this,A=$.kind,L=$.value,I=$.error,D=A==="N"?_ZB.of(L):A==="E"?YZB.throwError(function(){return I}):A==="C"?PZB.EMPTY:0;if(!D)throw TypeError("Unexpected notification kind "+A);return D},H.createNext=function($){return new H("N",$)},H.createError=function($){return new H("E",void 0,$)},H.createComplete=function(){return H.completeNotification},H.completeNotification=new H("C"),H}();Yk.Notification=ZZB;function GHL(H,$){var A,L,I,D=H,B=D.kind,f=D.value,E=D.error;if(typeof B!=="string")throw TypeError('Invalid notification, missing "kind"');B==="N"?(A=$.next)===null||A===void 0||A.call($,f):B==="E"?(L=$.error)===null||L===void 0||L.call($,E):(I=$.complete)===null||I===void 0||I.call($)}Yk.observeNotification=GHL});var XHL=z((QrH)=>{Object.defineProperty(QrH,"__esModule",{value:!0});QrH.isObservable=void 0;var qZB=wM(),UHL=sE();function TZB(H){return!!H&&(H instanceof qZB.Observable||UHL.isFunction(H.lift)&&UHL.isFunction(H.subscribe))}QrH.isObservable=TZB});var ic=z((WrH)=>{Object.defineProperty(WrH,"__esModule",{value:!0});WrH.EmptyError=void 0;var zZB=pc();WrH.EmptyError=zZB.createErrorClass(function(H){return function(){H(this),this.name="EmptyError",this.message="no elements in sequence"}})});var JHL=z((VrH)=>{Object.defineProperty(VrH,"__esModule",{value:!0});VrH.lastValueFrom=void 0;var NZB=ic();function OZB(H,$){var A=typeof $==="object";return new Promise(function(L,I){var D=!1,B;H.subscribe({next:function(f){B=f,D=!0},error:I,complete:function(){if(D)L(B);else if(A)L($.defaultValue);else I(new NZB.EmptyError)}})})}VrH.lastValueFrom=OZB});var FHL=z((PrH)=>{Object.defineProperty(PrH,"__esModule",{value:!0});PrH.firstValueFrom=void 0;var xZB=ic(),SZB=pEH();function jZB(H,$){var A=typeof $==="object";return new Promise(function(L,I){var D=new SZB.SafeSubscriber({next:function(B){L(B),D.unsubscribe()},error:I,complete:function(){if(A)L($.defaultValue);else I(new xZB.EmptyError)}});H.subscribe(D)})}PrH.firstValueFrom=jZB});var Yv$=z((_rH)=>{Object.defineProperty(_rH,"__esModule",{value:!0});_rH.ArgumentOutOfRangeError=void 0;var RZB=pc();_rH.ArgumentOutOfRangeError=RZB.createErrorClass(function(H){return function(){H(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var Cv$=z((YrH)=>{Object.defineProperty(YrH,"__esModule",{value:!0});YrH.NotFoundError=void 0;var yZB=pc();YrH.NotFoundError=yZB.createErrorClass(function(H){return function(A){H(this),this.name="NotFoundError",this.message=A}})});var wv$=z((CrH)=>{Object.defineProperty(CrH,"__esModule",{value:!0});CrH.SequenceError=void 0;var vZB=pc();CrH.SequenceError=vZB.createErrorClass(function(H){return function(A){H(this),this.name="SequenceError",this.message=A}})});var ZrH=z((wrH)=>{Object.defineProperty(wrH,"__esModule",{value:!0});wrH.isValidDate=void 0;function hZB(H){return H instanceof Date&&!isNaN(H)}wrH.isValidDate=hZB});var kCH=z((H$H)=>{Object.defineProperty(H$H,"__esModule",{value:!0});H$H.timeout=H$H.TimeoutError=void 0;var bZB=T_(),kZB=ZrH(),uZB=ED(),gZB=M1(),mZB=pc(),pZB=EB(),dZB=Pk();H$H.TimeoutError=mZB.createErrorClass(function(H){return function(A){if(A===void 0)A=null;H(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=A}});function cZB(H,$){var A=kZB.isValidDate(H)?{first:H}:typeof H==="number"?{each:H}:H,L=A.first,I=A.each,D=A.with,B=D===void 0?lZB:D,f=A.scheduler,E=f===void 0?$!==null&&$!==void 0?$:bZB.asyncScheduler:f,M=A.meta,G=M===void 0?null:M;if(L==null&&I==null)throw TypeError("No timeout provided.");return uZB.operate(function(U,X){var J,F,Q=null,W=0,P=function(C){F=dZB.executeSchedule(X,E,function(){try{J.unsubscribe(),gZB.innerFrom(B({meta:G,lastValue:Q,seen:W})).subscribe(X)}catch(Y){X.error(Y)}},C)};J=U.subscribe(pZB.createOperatorSubscriber(X,function(C){F===null||F===void 0||F.unsubscribe(),W++,X.next(Q=C),I>0&&P(I)},void 0,void 0,function(){if(!(F===null||F===void 0?void 0:F.closed))F===null||F===void 0||F.unsubscribe();Q=null})),!W&&P(L!=null?typeof L==="number"?L:+L-E.now():I)})}H$H.timeout=cZB;function lZB(H){throw new H$H.TimeoutError(H)}});var Ck=z((qrH)=>{Object.defineProperty(qrH,"__esModule",{value:!0});qrH.map=void 0;var iZB=ED(),nZB=EB();function rZB(H,$){return iZB.operate(function(A,L){var I=0;A.subscribe(nZB.createOperatorSubscriber(L,function(D){L.next(H.call($,D,I++))}))})}qrH.map=rZB});var rc=z((nc)=>{var aZB=nc&&nc.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},oZB=nc&&nc.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var $qB=ac&&ac.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},KHL=ac&&ac.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(TrH,"__esModule",{value:!0});TrH.bindCallback=void 0;var EqB=qv$();function MqB(H,$,A){return EqB.bindCallbackInternals(!1,H,$,A)}TrH.bindCallback=MqB});var WHL=z((zrH)=>{Object.defineProperty(zrH,"__esModule",{value:!0});zrH.bindNodeCallback=void 0;var GqB=qv$();function UqB(H,$,A){return GqB.bindCallbackInternals(!0,H,$,A)}zrH.bindNodeCallback=UqB});var Tv$=z((NrH)=>{Object.defineProperty(NrH,"__esModule",{value:!0});NrH.argsArgArrayOrObject=void 0;var XqB=Array.isArray,JqB=Object.getPrototypeOf,FqB=Object.prototype,KqB=Object.keys;function QqB(H){if(H.length===1){var $=H[0];if(XqB($))return{args:$,keys:null};if(WqB($)){var A=KqB($);return{args:A.map(function(L){return $[L]}),keys:A}}}return{args:H,keys:null}}NrH.argsArgArrayOrObject=QqB;function WqB(H){return H&&typeof H==="object"&&JqB(H)===FqB}});var zv$=z((OrH)=>{Object.defineProperty(OrH,"__esModule",{value:!0});OrH.createObject=void 0;function VqB(H,$){return H.reduce(function(A,L,I){return A[L]=$[I],A},{})}OrH.createObject=VqB});var xrH=z((XMH)=>{Object.defineProperty(XMH,"__esModule",{value:!0});XMH.combineLatestInit=XMH.combineLatest=void 0;var PqB=wM(),_qB=Tv$(),_HL=_k(),YHL=OW(),YqB=rc(),VHL=z_(),CqB=zv$(),wqB=EB(),ZqB=Pk();function qqB(){var H=[];for(var $=0;${Object.defineProperty(SrH,"__esModule",{value:!0});SrH.mergeInternals=void 0;var TqB=M1(),zqB=Pk(),wHL=EB();function NqB(H,$,A,L,I,D,B,f){var E=[],M=0,G=0,U=!1,X=function(){if(U&&!E.length&&!M)$.complete()},J=function(Q){return M{Object.defineProperty(RrH,"__esModule",{value:!0});RrH.mergeMap=void 0;var OqB=Ck(),xqB=M1(),SqB=ED(),jqB=jrH(),RqB=sE();function ZHL(H,$,A){if(A===void 0)A=1/0;if(RqB.isFunction($))return ZHL(function(L,I){return OqB.map(function(D,B){return $(L,D,I,B)})(xqB.innerFrom(H(L,I)))},A);else if(typeof $==="number")A=$;return SqB.operate(function(L,I){return jqB.mergeInternals(L,I,H,A)})}RrH.mergeMap=ZHL});var JMH=z((yrH)=>{Object.defineProperty(yrH,"__esModule",{value:!0});yrH.mergeAll=void 0;var yqB=QR(),vqB=OW();function hqB(H){if(H===void 0)H=1/0;return yqB.mergeMap(vqB.identity,H)}yrH.mergeAll=hqB});var uCH=z((vrH)=>{Object.defineProperty(vrH,"__esModule",{value:!0});vrH.concatAll=void 0;var bqB=JMH();function kqB(){return bqB.mergeAll(1)}vrH.concatAll=kqB});var gCH=z((hrH)=>{Object.defineProperty(hrH,"__esModule",{value:!0});hrH.concat=void 0;var uqB=uCH(),gqB=z_(),mqB=_k();function pqB(){var H=[];for(var $=0;${Object.defineProperty(brH,"__esModule",{value:!0});brH.defer=void 0;var dqB=wM(),cqB=M1();function lqB(H){return new dqB.Observable(function($){cqB.innerFrom(H()).subscribe($)})}brH.defer=lqB});var qHL=z((krH)=>{Object.defineProperty(krH,"__esModule",{value:!0});krH.connectable=void 0;var iqB=xW(),nqB=wM(),rqB=mCH(),aqB={connector:function(){return new iqB.Subject},resetOnDisconnect:!0};function oqB(H,$){if($===void 0)$=aqB;var A=null,L=$.connector,I=$.resetOnDisconnect,D=I===void 0?!0:I,B=L(),f=new nqB.Observable(function(E){return B.subscribe(E)});return f.connect=function(){if(!A||A.closed){if(A=rqB.defer(function(){return H}).subscribe(B),D)A.add(function(){return B=L()})}return A},f}krH.connectable=oqB});var THL=z((urH)=>{Object.defineProperty(urH,"__esModule",{value:!0});urH.forkJoin=void 0;var tqB=wM(),sqB=Tv$(),eqB=M1(),HTB=z_(),$TB=EB(),ATB=rc(),LTB=zv$();function ITB(){var H=[];for(var $=0;${var DTB=FMH&&FMH.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D};Object.defineProperty(FMH,"__esModule",{value:!0});FMH.fromEvent=void 0;var BTB=M1(),fTB=wM(),ETB=QR(),MTB=rnH(),$$H=sE(),GTB=rc(),UTB=["addListener","removeListener"],XTB=["addEventListener","removeEventListener"],JTB=["on","off"];function Nv$(H,$,A,L){if($$H.isFunction(A))L=A,A=void 0;if(L)return Nv$(H,$,A).pipe(GTB.mapOneOrManyArgs(L));var I=DTB(QTB(H)?XTB.map(function(f){return function(E){return H[f]($,E,A)}}):FTB(H)?UTB.map(zHL(H,$)):KTB(H)?JTB.map(zHL(H,$)):[],2),D=I[0],B=I[1];if(!D){if(MTB.isArrayLike(H))return ETB.mergeMap(function(f){return Nv$(f,$,A)})(BTB.innerFrom(H))}if(!D)throw TypeError("Invalid event target");return new fTB.Observable(function(f){var E=function(){var M=[];for(var G=0;G{Object.defineProperty(grH,"__esModule",{value:!0});grH.fromEventPattern=void 0;var WTB=wM(),VTB=sE(),PTB=rc();function OHL(H,$,A){if(A)return OHL(H,$).pipe(PTB.mapOneOrManyArgs(A));return new WTB.Observable(function(L){var I=function(){var B=[];for(var f=0;f{var _TB=KMH&&KMH.__generator||function(H,$){var A={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},L,I,D,B;return B={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function f(M){return function(G){return E([M,G])}}function E(M){if(L)throw TypeError("Generator is already executing.");while(A)try{if(L=1,I&&(D=M[0]&2?I.return:M[0]?I.throw||((D=I.return)&&D.call(I),0):I.next)&&!(D=D.call(I,M[1])).done)return D;if(I=0,D)M=[M[0]&2,D.value];switch(M[0]){case 0:case 1:D=M;break;case 4:return A.label++,{value:M[1],done:!1};case 5:A.label++,I=M[1],M=[0];continue;case 7:M=A.ops.pop(),A.trys.pop();continue;default:if((D=A.trys,!(D=D.length>0&&D[D.length-1]))&&(M[0]===6||M[0]===2)){A=0;continue}if(M[0]===3&&(!D||M[1]>D[0]&&M[1]{Object.defineProperty(mrH,"__esModule",{value:!0});mrH.iif=void 0;var qTB=mCH();function TTB(H,$,A){return qTB.defer(function(){return H()?$:A})}mrH.iif=TTB});var oc=z((prH)=>{Object.defineProperty(prH,"__esModule",{value:!0});prH.timer=void 0;var zTB=wM(),NTB=T_(),OTB=bCH(),xTB=ZrH();function STB(H,$,A){if(H===void 0)H=0;if(A===void 0)A=NTB.async;var L=-1;if($!=null)if(OTB.isScheduler($))A=$;else L=$;return new zTB.Observable(function(I){var D=xTB.isValidDate(H)?+H-A.now():H;if(D<0)D=0;var B=0;return A.schedule(function(){if(!I.closed)if(I.next(B++),0<=L)this.schedule(void 0,L);else I.complete()},D)})}prH.timer=STB});var Ov$=z((drH)=>{Object.defineProperty(drH,"__esModule",{value:!0});drH.interval=void 0;var jTB=T_(),RTB=oc();function yTB(H,$){if(H===void 0)H=0;if($===void 0)$=jTB.asyncScheduler;if(H<0)H=0;return RTB.timer(H,H,$)}drH.interval=yTB});var vHL=z((crH)=>{Object.defineProperty(crH,"__esModule",{value:!0});crH.merge=void 0;var vTB=JMH(),hTB=M1(),bTB=xN(),yHL=z_(),kTB=_k();function uTB(){var H=[];for(var $=0;${Object.defineProperty(A$H,"__esModule",{value:!0});A$H.never=A$H.NEVER=void 0;var gTB=wM(),mTB=NW();A$H.NEVER=new gTB.Observable(mTB.noop);function pTB(){return A$H.NEVER}A$H.never=pTB});var L$H=z((lrH)=>{Object.defineProperty(lrH,"__esModule",{value:!0});lrH.argsOrArgArray=void 0;var dTB=Array.isArray;function cTB(H){return H.length===1&&dTB(H[0])?H[0]:H}lrH.argsOrArgArray=cTB});var Sv$=z((irH)=>{Object.defineProperty(irH,"__esModule",{value:!0});irH.onErrorResumeNext=void 0;var lTB=wM(),iTB=L$H(),nTB=EB(),hHL=NW(),rTB=M1();function aTB(){var H=[];for(var $=0;${Object.defineProperty(nrH,"__esModule",{value:!0});nrH.pairs=void 0;var oTB=_k();function tTB(H,$){return oTB.from(Object.entries(H),$)}nrH.pairs=tTB});var jv$=z((rrH)=>{Object.defineProperty(rrH,"__esModule",{value:!0});rrH.not=void 0;function sTB(H,$){return function(A,L){return!H.call($,A,L)}}rrH.not=sTB});var wk=z((arH)=>{Object.defineProperty(arH,"__esModule",{value:!0});arH.filter=void 0;var eTB=ED(),HzB=EB();function $zB(H,$){return eTB.operate(function(A,L){var I=0;A.subscribe(HzB.createOperatorSubscriber(L,function(D){return H.call($,D,I++)&&L.next(D)}))})}arH.filter=$zB});var gHL=z((orH)=>{Object.defineProperty(orH,"__esModule",{value:!0});orH.partition=void 0;var AzB=jv$(),kHL=wk(),uHL=M1();function LzB(H,$,A){return[kHL.filter($,A)(uHL.innerFrom(H)),kHL.filter(AzB.not($,A))(uHL.innerFrom(H))]}orH.partition=LzB});var Rv$=z((QMH)=>{Object.defineProperty(QMH,"__esModule",{value:!0});QMH.raceInit=QMH.race=void 0;var IzB=wM(),mHL=M1(),DzB=L$H(),BzB=EB();function fzB(){var H=[];for(var $=0;${Object.defineProperty(trH,"__esModule",{value:!0});trH.range=void 0;var EzB=wM(),MzB=xN();function GzB(H,$,A){if($==null)$=H,H=0;if($<=0)return MzB.EMPTY;var L=$+H;return new EzB.Observable(A?function(I){var D=H;return A.schedule(function(){if(D{Object.defineProperty(srH,"__esModule",{value:!0});srH.using=void 0;var UzB=wM(),XzB=M1(),JzB=xN();function FzB(H,$){return new UzB.Observable(function(A){var L=H(),I=$(L),D=I?XzB.innerFrom(I):JzB.EMPTY;return D.subscribe(A),function(){if(L)L.unsubscribe()}})}srH.using=FzB});var erH=z((tc)=>{var KzB=tc&&tc.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},QzB=tc&&tc.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(lHL,"__esModule",{value:!0})});var $aH=z((HaH)=>{Object.defineProperty(HaH,"__esModule",{value:!0});HaH.audit=void 0;var ZzB=ED(),qzB=M1(),nHL=EB();function TzB(H){return ZzB.operate(function($,A){var L=!1,I=null,D=null,B=!1,f=function(){if(D===null||D===void 0||D.unsubscribe(),D=null,L){L=!1;var M=I;I=null,A.next(M)}B&&A.complete()},E=function(){D=null,B&&A.complete()};$.subscribe(nHL.createOperatorSubscriber(A,function(M){if(L=!0,I=M,!D)qzB.innerFrom(H(M)).subscribe(D=nHL.createOperatorSubscriber(A,f,E))},function(){B=!0,(!L||!D||D.closed)&&A.complete()}))})}HaH.audit=TzB});var yv$=z((AaH)=>{Object.defineProperty(AaH,"__esModule",{value:!0});AaH.auditTime=void 0;var zzB=T_(),NzB=$aH(),OzB=oc();function xzB(H,$){if($===void 0)$=zzB.asyncScheduler;return NzB.audit(function(){return OzB.timer(H,$)})}AaH.auditTime=xzB});var vv$=z((LaH)=>{Object.defineProperty(LaH,"__esModule",{value:!0});LaH.buffer=void 0;var SzB=ED(),jzB=NW(),rHL=EB(),RzB=M1();function yzB(H){return SzB.operate(function($,A){var L=[];return $.subscribe(rHL.createOperatorSubscriber(A,function(I){return L.push(I)},function(){A.next(L),A.complete()})),RzB.innerFrom(H).subscribe(rHL.createOperatorSubscriber(A,function(){var I=L;L=[],A.next(I)},jzB.noop)),function(){L=null}})}LaH.buffer=yzB});var bv$=z((WMH)=>{var hv$=WMH&&WMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(WMH,"__esModule",{value:!0});WMH.bufferCount=void 0;var vzB=ED(),hzB=EB(),bzB=Vk();function kzB(H,$){if($===void 0)$=null;return $=$!==null&&$!==void 0?$:H,vzB.operate(function(A,L){var I=[],D=0;A.subscribe(hzB.createOperatorSubscriber(L,function(B){var f,E,M,G,U=null;if(D++%$===0)I.push([]);try{for(var X=hv$(I),J=X.next();!J.done;J=X.next()){var F=J.value;if(F.push(B),H<=F.length)U=U!==null&&U!==void 0?U:[],U.push(F)}}catch(P){f={error:P}}finally{try{if(J&&!J.done&&(E=X.return))E.call(X)}finally{if(f)throw f.error}}if(U)try{for(var Q=hv$(U),W=Q.next();!W.done;W=Q.next()){var F=W.value;bzB.arrRemove(I,F),L.next(F)}}catch(P){M={error:P}}finally{try{if(W&&!W.done&&(G=Q.return))G.call(Q)}finally{if(M)throw M.error}}},function(){var B,f;try{for(var E=hv$(I),M=E.next();!M.done;M=E.next()){var G=M.value;L.next(G)}}catch(U){B={error:U}}finally{try{if(M&&!M.done&&(f=E.return))f.call(E)}finally{if(B)throw B.error}}L.complete()},void 0,function(){I=null}))})}WMH.bufferCount=kzB});var kv$=z((VMH)=>{var uzB=VMH&&VMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(VMH,"__esModule",{value:!0});VMH.bufferTime=void 0;var gzB=L2(),mzB=ED(),pzB=EB(),dzB=Vk(),czB=T_(),lzB=z_(),aHL=Pk();function izB(H){var $,A,L=[];for(var I=1;I=0)aHL.executeSchedule(M,D,J,B,!0);else U=!0;J();var F=pzB.createOperatorSubscriber(M,function(Q){var W,P,C=G.slice();try{for(var Y=uzB(C),Z=Y.next();!Z.done;Z=Y.next()){var q=Z.value,O=q.buffer;O.push(Q),f<=O.length&&X(q)}}catch(j){W={error:j}}finally{try{if(Z&&!Z.done&&(P=Y.return))P.call(Y)}finally{if(W)throw W.error}}},function(){while(G===null||G===void 0?void 0:G.length)M.next(G.shift().buffer);F===null||F===void 0||F.unsubscribe(),M.complete(),M.unsubscribe()},void 0,function(){return G=null});E.subscribe(F)})}VMH.bufferTime=izB});var gv$=z((PMH)=>{var nzB=PMH&&PMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(PMH,"__esModule",{value:!0});PMH.bufferToggle=void 0;var rzB=L2(),azB=ED(),oHL=M1(),uv$=EB(),tHL=NW(),ozB=Vk();function tzB(H,$){return azB.operate(function(A,L){var I=[];oHL.innerFrom(H).subscribe(uv$.createOperatorSubscriber(L,function(D){var B=[];I.push(B);var f=new rzB.Subscription,E=function(){ozB.arrRemove(I,B),L.next(B),f.unsubscribe()};f.add(oHL.innerFrom($(D)).subscribe(uv$.createOperatorSubscriber(L,E,tHL.noop)))},tHL.noop)),A.subscribe(uv$.createOperatorSubscriber(L,function(D){var B,f;try{for(var E=nzB(I),M=E.next();!M.done;M=E.next()){var G=M.value;G.push(D)}}catch(U){B={error:U}}finally{try{if(M&&!M.done&&(f=E.return))f.call(E)}finally{if(B)throw B.error}}},function(){while(I.length>0)L.next(I.shift());L.complete()}))})}PMH.bufferToggle=tzB});var mv$=z((IaH)=>{Object.defineProperty(IaH,"__esModule",{value:!0});IaH.bufferWhen=void 0;var szB=ED(),ezB=NW(),sHL=EB(),HNB=M1();function $NB(H){return szB.operate(function($,A){var L=null,I=null,D=function(){I===null||I===void 0||I.unsubscribe();var B=L;L=[],B&&A.next(B),HNB.innerFrom(H()).subscribe(I=sHL.createOperatorSubscriber(A,D,ezB.noop))};D(),$.subscribe(sHL.createOperatorSubscriber(A,function(B){return L===null||L===void 0?void 0:L.push(B)},function(){L&&A.next(L),A.complete()},void 0,function(){return L=I=null}))})}IaH.bufferWhen=$NB});var pv$=z((DaH)=>{Object.defineProperty(DaH,"__esModule",{value:!0});DaH.catchError=void 0;var ANB=M1(),LNB=EB(),INB=ED();function eHL(H){return INB.operate(function($,A){var L=null,I=!1,D;if(L=$.subscribe(LNB.createOperatorSubscriber(A,void 0,void 0,function(B){if(D=ANB.innerFrom(H(B,eHL(H)($))),L)L.unsubscribe(),L=null,D.subscribe(A);else I=!0})),I)L.unsubscribe(),L=null,D.subscribe(A)})}DaH.catchError=eHL});var dv$=z((BaH)=>{Object.defineProperty(BaH,"__esModule",{value:!0});BaH.scanInternals=void 0;var DNB=EB();function BNB(H,$,A,L,I){return function(D,B){var f=A,E=$,M=0;D.subscribe(DNB.createOperatorSubscriber(B,function(G){var U=M++;E=f?H(E,G,U):(f=!0,G),L&&B.next(E)},I&&function(){f&&B.next(E),B.complete()}))}}BaH.scanInternals=BNB});var I$H=z((faH)=>{Object.defineProperty(faH,"__esModule",{value:!0});faH.reduce=void 0;var fNB=dv$(),ENB=ED();function MNB(H,$){return ENB.operate(fNB.scanInternals(H,$,arguments.length>=2,!1,!0))}faH.reduce=MNB});var MaH=z((EaH)=>{Object.defineProperty(EaH,"__esModule",{value:!0});EaH.toArray=void 0;var GNB=I$H(),UNB=ED(),XNB=function(H,$){return H.push($),H};function JNB(){return UNB.operate(function(H,$){GNB.reduce(XNB,[])(H).subscribe($)})}EaH.toArray=JNB});var cv$=z((GaH)=>{Object.defineProperty(GaH,"__esModule",{value:!0});GaH.joinAllInternals=void 0;var FNB=OW(),KNB=rc(),QNB=RCH(),WNB=QR(),VNB=MaH();function PNB(H,$){return QNB.pipe(VNB.toArray(),WNB.mergeMap(function(A){return H(A)}),$?KNB.mapOneOrManyArgs($):FNB.identity)}GaH.joinAllInternals=PNB});var XaH=z((UaH)=>{Object.defineProperty(UaH,"__esModule",{value:!0});UaH.combineLatestAll=void 0;var _NB=xrH(),YNB=cv$();function CNB(H){return YNB.joinAllInternals(_NB.combineLatest,H)}UaH.combineLatestAll=CNB});var lv$=z((JaH)=>{Object.defineProperty(JaH,"__esModule",{value:!0});JaH.combineAll=void 0;var wNB=XaH();JaH.combineAll=wNB.combineLatestAll});var iv$=z((sc)=>{var H$L=sc&&sc.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},$$L=sc&&sc.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var xNB=ec&&ec.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},SNB=ec&&ec.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(FaH,"__esModule",{value:!0});FaH.concatMap=void 0;var L$L=QR(),yNB=sE();function vNB(H,$){return yNB.isFunction($)?L$L.mergeMap(H,$,1):L$L.mergeMap(H,1)}FaH.concatMap=vNB});var rv$=z((QaH)=>{Object.defineProperty(QaH,"__esModule",{value:!0});QaH.concatMapTo=void 0;var I$L=KaH(),hNB=sE();function bNB(H,$){return hNB.isFunction($)?I$L.concatMap(function(){return H},$):I$L.concatMap(function(){return H})}QaH.concatMapTo=bNB});var av$=z((Hl)=>{var kNB=Hl&&Hl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},uNB=Hl&&Hl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var lNB=$l&&$l.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},iNB=$l&&$l.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(WaH,"__esModule",{value:!0});WaH.fromSubscribable=void 0;var aNB=wM();function oNB(H){return new aNB.Observable(function($){return H.subscribe($)})}WaH.fromSubscribable=oNB});var pCH=z((VaH)=>{Object.defineProperty(VaH,"__esModule",{value:!0});VaH.connect=void 0;var tNB=xW(),sNB=M1(),eNB=ED(),HOB=D$L(),$OB={connector:function(){return new tNB.Subject}};function AOB(H,$){if($===void 0)$=$OB;var A=$.connector;return eNB.operate(function(L,I){var D=A();sNB.innerFrom(H(HOB.fromSubscribable(D))).subscribe(I),I.add(L.subscribe(D))})}VaH.connect=AOB});var tv$=z((PaH)=>{Object.defineProperty(PaH,"__esModule",{value:!0});PaH.count=void 0;var LOB=I$H();function IOB(H){return LOB.reduce(function($,A,L){return!H||H(A,L)?$+1:$},0)}PaH.count=IOB});var sv$=z((_aH)=>{Object.defineProperty(_aH,"__esModule",{value:!0});_aH.debounce=void 0;var DOB=ED(),BOB=NW(),B$L=EB(),fOB=M1();function EOB(H){return DOB.operate(function($,A){var L=!1,I=null,D=null,B=function(){if(D===null||D===void 0||D.unsubscribe(),D=null,L){L=!1;var f=I;I=null,A.next(f)}};$.subscribe(B$L.createOperatorSubscriber(A,function(f){D===null||D===void 0||D.unsubscribe(),L=!0,I=f,D=B$L.createOperatorSubscriber(A,B,BOB.noop),fOB.innerFrom(H(f)).subscribe(D)},function(){B(),A.complete()},void 0,function(){I=D=null}))})}_aH.debounce=EOB});var ev$=z((YaH)=>{Object.defineProperty(YaH,"__esModule",{value:!0});YaH.debounceTime=void 0;var MOB=T_(),GOB=ED(),UOB=EB();function XOB(H,$){if($===void 0)$=MOB.asyncScheduler;return GOB.operate(function(A,L){var I=null,D=null,B=null,f=function(){if(I){I.unsubscribe(),I=null;var M=D;D=null,L.next(M)}};function E(){var M=B+H,G=$.now();if(G{Object.defineProperty(CaH,"__esModule",{value:!0});CaH.defaultIfEmpty=void 0;var JOB=ED(),FOB=EB();function KOB(H){return JOB.operate(function($,A){var L=!1;$.subscribe(FOB.createOperatorSubscriber(A,function(I){L=!0,A.next(I)},function(){if(!L)A.next(H);A.complete()}))})}CaH.defaultIfEmpty=KOB});var YMH=z((waH)=>{Object.defineProperty(waH,"__esModule",{value:!0});waH.take=void 0;var QOB=xN(),WOB=ED(),VOB=EB();function POB(H){return H<=0?function(){return QOB.EMPTY}:WOB.operate(function($,A){var L=0;$.subscribe(VOB.createOperatorSubscriber(A,function(I){if(++L<=H){if(A.next(I),H<=L)A.complete()}}))})}waH.take=POB});var qaH=z((ZaH)=>{Object.defineProperty(ZaH,"__esModule",{value:!0});ZaH.ignoreElements=void 0;var _OB=ED(),YOB=EB(),COB=NW();function wOB(){return _OB.operate(function(H,$){H.subscribe(YOB.createOperatorSubscriber($,COB.noop))})}ZaH.ignoreElements=wOB});var zaH=z((TaH)=>{Object.defineProperty(TaH,"__esModule",{value:!0});TaH.mapTo=void 0;var ZOB=Ck();function qOB(H){return ZOB.map(function(){return H})}TaH.mapTo=qOB});var OaH=z((NaH)=>{Object.defineProperty(NaH,"__esModule",{value:!0});NaH.delayWhen=void 0;var TOB=gCH(),f$L=YMH(),zOB=qaH(),NOB=zaH(),OOB=QR(),xOB=M1();function E$L(H,$){if($)return function(A){return TOB.concat($.pipe(f$L.take(1),zOB.ignoreElements()),A.pipe(E$L(H)))};return OOB.mergeMap(function(A,L){return xOB.innerFrom(H(A,L)).pipe(f$L.take(1),NOB.mapTo(A))})}NaH.delayWhen=E$L});var Hh$=z((xaH)=>{Object.defineProperty(xaH,"__esModule",{value:!0});xaH.delay=void 0;var SOB=T_(),jOB=OaH(),ROB=oc();function yOB(H,$){if($===void 0)$=SOB.asyncScheduler;var A=ROB.timer(H,$);return jOB.delayWhen(function(){return A})}xaH.delay=yOB});var $h$=z((SaH)=>{Object.defineProperty(SaH,"__esModule",{value:!0});SaH.dematerialize=void 0;var vOB=KrH(),hOB=ED(),bOB=EB();function kOB(){return hOB.operate(function(H,$){H.subscribe(bOB.createOperatorSubscriber($,function(A){return vOB.observeNotification(A,$)}))})}SaH.dematerialize=kOB});var Ah$=z((jaH)=>{Object.defineProperty(jaH,"__esModule",{value:!0});jaH.distinct=void 0;var uOB=ED(),M$L=EB(),gOB=NW(),mOB=M1();function pOB(H,$){return uOB.operate(function(A,L){var I=new Set;A.subscribe(M$L.createOperatorSubscriber(L,function(D){var B=H?H(D):D;if(!I.has(B))I.add(B),L.next(D)})),$&&mOB.innerFrom($).subscribe(M$L.createOperatorSubscriber(L,function(){return I.clear()},gOB.noop))})}jaH.distinct=pOB});var yaH=z((RaH)=>{Object.defineProperty(RaH,"__esModule",{value:!0});RaH.distinctUntilChanged=void 0;var dOB=OW(),cOB=ED(),lOB=EB();function iOB(H,$){if($===void 0)$=dOB.identity;return H=H!==null&&H!==void 0?H:nOB,cOB.operate(function(A,L){var I,D=!0;A.subscribe(lOB.createOperatorSubscriber(L,function(B){var f=$(B);if(D||!H(I,f))D=!1,I=f,L.next(B)}))})}RaH.distinctUntilChanged=iOB;function nOB(H,$){return H===$}});var Lh$=z((vaH)=>{Object.defineProperty(vaH,"__esModule",{value:!0});vaH.distinctUntilKeyChanged=void 0;var rOB=yaH();function aOB(H,$){return rOB.distinctUntilChanged(function(A,L){return $?$(A[H],L[H]):A[H]===L[H]})}vaH.distinctUntilKeyChanged=aOB});var CMH=z((haH)=>{Object.defineProperty(haH,"__esModule",{value:!0});haH.throwIfEmpty=void 0;var oOB=ic(),tOB=ED(),sOB=EB();function eOB(H){if(H===void 0)H=HxB;return tOB.operate(function($,A){var L=!1;$.subscribe(sOB.createOperatorSubscriber(A,function(I){L=!0,A.next(I)},function(){return L?A.complete():A.error(H())}))})}haH.throwIfEmpty=eOB;function HxB(){return new oOB.EmptyError}});var Ih$=z((baH)=>{Object.defineProperty(baH,"__esModule",{value:!0});baH.elementAt=void 0;var G$L=Yv$(),$xB=wk(),AxB=CMH(),LxB=_MH(),IxB=YMH();function DxB(H,$){if(H<0)throw new G$L.ArgumentOutOfRangeError;var A=arguments.length>=2;return function(L){return L.pipe($xB.filter(function(I,D){return D===H}),IxB.take(1),A?LxB.defaultIfEmpty($):AxB.throwIfEmpty(function(){return new G$L.ArgumentOutOfRangeError}))}}baH.elementAt=DxB});var Dh$=z((Al)=>{var BxB=Al&&Al.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},fxB=Al&&Al.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(kaH,"__esModule",{value:!0});kaH.every=void 0;var UxB=ED(),XxB=EB();function JxB(H,$){return UxB.operate(function(A,L){var I=0;A.subscribe(XxB.createOperatorSubscriber(L,function(D){if(!H.call($,D,I++,A))L.next(!1),L.complete()},function(){L.next(!0),L.complete()}))})}kaH.every=JxB});var gaH=z((uaH)=>{Object.defineProperty(uaH,"__esModule",{value:!0});uaH.exhaustMap=void 0;var FxB=Ck(),U$L=M1(),KxB=ED(),X$L=EB();function J$L(H,$){if($)return function(A){return A.pipe(J$L(function(L,I){return U$L.innerFrom(H(L,I)).pipe(FxB.map(function(D,B){return $(L,D,I,B)}))}))};return KxB.operate(function(A,L){var I=0,D=null,B=!1;A.subscribe(X$L.createOperatorSubscriber(L,function(f){if(!D)D=X$L.createOperatorSubscriber(L,void 0,function(){D=null,B&&L.complete()}),U$L.innerFrom(H(f,I++)).subscribe(D)},function(){B=!0,!D&&L.complete()}))})}uaH.exhaustMap=J$L});var paH=z((maH)=>{Object.defineProperty(maH,"__esModule",{value:!0});maH.exhaustAll=void 0;var QxB=gaH(),WxB=OW();function VxB(){return QxB.exhaustMap(WxB.identity)}maH.exhaustAll=VxB});var fh$=z((daH)=>{Object.defineProperty(daH,"__esModule",{value:!0});daH.exhaust=void 0;var PxB=paH();daH.exhaust=PxB.exhaustAll});var Eh$=z((caH)=>{Object.defineProperty(caH,"__esModule",{value:!0});caH.expand=void 0;var _xB=ED(),YxB=jrH();function CxB(H,$,A){if($===void 0)$=1/0;return $=($||0)<1?1/0:$,_xB.operate(function(L,I){return YxB.mergeInternals(L,I,H,$,void 0,!0,A)})}caH.expand=CxB});var Mh$=z((laH)=>{Object.defineProperty(laH,"__esModule",{value:!0});laH.finalize=void 0;var wxB=ED();function ZxB(H){return wxB.operate(function($,A){try{$.subscribe(A)}finally{A.add(H)}})}laH.finalize=ZxB});var iaH=z((wMH)=>{Object.defineProperty(wMH,"__esModule",{value:!0});wMH.createFind=wMH.find=void 0;var qxB=ED(),TxB=EB();function zxB(H,$){return qxB.operate(F$L(H,$,"value"))}wMH.find=zxB;function F$L(H,$,A){var L=A==="index";return function(I,D){var B=0;I.subscribe(TxB.createOperatorSubscriber(D,function(f){var E=B++;if(H.call($,f,E,I))D.next(L?E:f),D.complete()},function(){D.next(L?-1:void 0),D.complete()}))}}wMH.createFind=F$L});var Gh$=z((naH)=>{Object.defineProperty(naH,"__esModule",{value:!0});naH.findIndex=void 0;var NxB=ED(),OxB=iaH();function xxB(H,$){return NxB.operate(OxB.createFind(H,$,"index"))}naH.findIndex=xxB});var Uh$=z((raH)=>{Object.defineProperty(raH,"__esModule",{value:!0});raH.first=void 0;var SxB=ic(),jxB=wk(),RxB=YMH(),yxB=_MH(),vxB=CMH(),hxB=OW();function bxB(H,$){var A=arguments.length>=2;return function(L){return L.pipe(H?jxB.filter(function(I,D){return H(I,D,L)}):hxB.identity,RxB.take(1),A?yxB.defaultIfEmpty($):vxB.throwIfEmpty(function(){return new SxB.EmptyError}))}}raH.first=bxB});var Xh$=z((aaH)=>{Object.defineProperty(aaH,"__esModule",{value:!0});aaH.groupBy=void 0;var kxB=wM(),uxB=M1(),gxB=xW(),mxB=ED(),K$L=EB();function pxB(H,$,A,L){return mxB.operate(function(I,D){var B;if(!$||typeof $==="function")B=$;else A=$.duration,B=$.element,L=$.connector;var f=new Map,E=function(F){f.forEach(F),F(D)},M=function(F){return E(function(Q){return Q.error(F)})},G=0,U=!1,X=new K$L.OperatorSubscriber(D,function(F){try{var Q=H(F),W=f.get(Q);if(!W){f.set(Q,W=L?L():new gxB.Subject);var P=J(Q,W);if(D.next(P),A){var C=K$L.createOperatorSubscriber(W,function(){W.complete(),C===null||C===void 0||C.unsubscribe()},void 0,void 0,function(){return f.delete(Q)});X.add(uxB.innerFrom(A(P)).subscribe(C))}}W.next(B?B(F):F)}catch(Y){M(Y)}},function(){return E(function(F){return F.complete()})},M,function(){return f.clear()},function(){return U=!0,G===0});I.subscribe(X);function J(F,Q){var W=new kxB.Observable(function(P){G++;var C=Q.subscribe(P);return function(){C.unsubscribe(),--G===0&&U&&X.unsubscribe()}});return W.key=F,W}})}aaH.groupBy=pxB});var Jh$=z((oaH)=>{Object.defineProperty(oaH,"__esModule",{value:!0});oaH.isEmpty=void 0;var dxB=ED(),cxB=EB();function lxB(){return dxB.operate(function(H,$){H.subscribe(cxB.createOperatorSubscriber($,function(){$.next(!1),$.complete()},function(){$.next(!0),$.complete()}))})}oaH.isEmpty=lxB});var taH=z((ZMH)=>{var ixB=ZMH&&ZMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ZMH,"__esModule",{value:!0});ZMH.takeLast=void 0;var nxB=xN(),rxB=ED(),axB=EB();function oxB(H){return H<=0?function(){return nxB.EMPTY}:rxB.operate(function($,A){var L=[];$.subscribe(axB.createOperatorSubscriber(A,function(I){L.push(I),H{Object.defineProperty(saH,"__esModule",{value:!0});saH.last=void 0;var txB=ic(),sxB=wk(),exB=taH(),HSB=CMH(),$SB=_MH(),ASB=OW();function LSB(H,$){var A=arguments.length>=2;return function(L){return L.pipe(H?sxB.filter(function(I,D){return H(I,D,L)}):ASB.identity,exB.takeLast(1),A?$SB.defaultIfEmpty($):HSB.throwIfEmpty(function(){return new txB.EmptyError}))}}saH.last=LSB});var Qh$=z((eaH)=>{Object.defineProperty(eaH,"__esModule",{value:!0});eaH.materialize=void 0;var Kh$=KrH(),ISB=ED(),DSB=EB();function BSB(){return ISB.operate(function(H,$){H.subscribe(DSB.createOperatorSubscriber($,function(A){$.next(Kh$.Notification.createNext(A))},function(){$.next(Kh$.Notification.createComplete()),$.complete()},function(A){$.next(Kh$.Notification.createError(A)),$.complete()}))})}eaH.materialize=BSB});var Wh$=z((HoH)=>{Object.defineProperty(HoH,"__esModule",{value:!0});HoH.max=void 0;var fSB=I$H(),ESB=sE();function MSB(H){return fSB.reduce(ESB.isFunction(H)?function($,A){return H($,A)>0?$:A}:function($,A){return $>A?$:A})}HoH.max=MSB});var Vh$=z(($oH)=>{Object.defineProperty($oH,"__esModule",{value:!0});$oH.flatMap=void 0;var GSB=QR();$oH.flatMap=GSB.mergeMap});var Ph$=z((AoH)=>{Object.defineProperty(AoH,"__esModule",{value:!0});AoH.mergeMapTo=void 0;var Q$L=QR(),USB=sE();function XSB(H,$,A){if(A===void 0)A=1/0;if(USB.isFunction($))return Q$L.mergeMap(function(){return H},$,A);if(typeof $==="number")A=$;return Q$L.mergeMap(function(){return H},A)}AoH.mergeMapTo=XSB});var _h$=z((LoH)=>{Object.defineProperty(LoH,"__esModule",{value:!0});LoH.mergeScan=void 0;var JSB=ED(),FSB=jrH();function KSB(H,$,A){if(A===void 0)A=1/0;return JSB.operate(function(L,I){var D=$;return FSB.mergeInternals(L,I,function(B,f){return H(D,B,f)},A,function(B){D=B},!1,void 0,function(){return D=null})})}LoH.mergeScan=KSB});var Yh$=z((Ll)=>{var QSB=Ll&&Ll.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},WSB=Ll&&Ll.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var CSB=Il&&Il.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},wSB=Il&&Il.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(IoH,"__esModule",{value:!0});IoH.min=void 0;var TSB=I$H(),zSB=sE();function NSB(H){return TSB.reduce(zSB.isFunction(H)?function($,A){return H($,A)<0?$:A}:function($,A){return ${Object.defineProperty(DoH,"__esModule",{value:!0});DoH.multicast=void 0;var OSB=yCH(),V$L=sE(),xSB=pCH();function SSB(H,$){var A=V$L.isFunction(H)?H:function(){return H};if(V$L.isFunction($))return xSB.connect($,{connector:A});return function(L){return new OSB.ConnectableObservable(L,A)}}DoH.multicast=SSB});var Zh$=z((WR)=>{var jSB=WR&&WR.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},RSB=WR&&WR.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(BoH,"__esModule",{value:!0});BoH.pairwise=void 0;var hSB=ED(),bSB=EB();function kSB(){return hSB.operate(function(H,$){var A,L=!1;H.subscribe(bSB.createOperatorSubscriber($,function(I){var D=A;A=I,L&&$.next([D,I]),L=!0}))})}BoH.pairwise=kSB});var Th$=z((foH)=>{Object.defineProperty(foH,"__esModule",{value:!0});foH.pluck=void 0;var uSB=Ck();function gSB(){var H=[];for(var $=0;${Object.defineProperty(EoH,"__esModule",{value:!0});EoH.publish=void 0;var mSB=xW(),pSB=dCH(),dSB=pCH();function cSB(H){return H?function($){return dSB.connect(H)($)}:function($){return pSB.multicast(new mSB.Subject)($)}}EoH.publish=cSB});var Nh$=z((MoH)=>{Object.defineProperty(MoH,"__esModule",{value:!0});MoH.publishBehavior=void 0;var lSB=Iv$(),iSB=yCH();function nSB(H){return function($){var A=new lSB.BehaviorSubject(H);return new iSB.ConnectableObservable($,function(){return A})}}MoH.publishBehavior=nSB});var Oh$=z((GoH)=>{Object.defineProperty(GoH,"__esModule",{value:!0});GoH.publishLast=void 0;var rSB=dnH(),aSB=yCH();function oSB(){return function(H){var $=new rSB.AsyncSubject;return new aSB.ConnectableObservable(H,function(){return $})}}GoH.publishLast=oSB});var xh$=z((UoH)=>{Object.defineProperty(UoH,"__esModule",{value:!0});UoH.publishReplay=void 0;var tSB=pnH(),sSB=dCH(),_$L=sE();function eSB(H,$,A,L){if(A&&!_$L.isFunction(A))L=A;var I=_$L.isFunction(A)?A:void 0;return function(D){return sSB.multicast(new tSB.ReplaySubject(H,$,L),I)(D)}}UoH.publishReplay=eSB});var XoH=z((Dl)=>{var HjB=Dl&&Dl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},$jB=Dl&&Dl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(JoH,"__esModule",{value:!0});JoH.repeat=void 0;var BjB=xN(),fjB=ED(),Y$L=EB(),EjB=M1(),MjB=oc();function GjB(H){var $,A=1/0,L;if(H!=null)if(typeof H==="object")$=H.count,A=$===void 0?1/0:$,L=H.delay;else A=H;return A<=0?function(){return BjB.EMPTY}:fjB.operate(function(I,D){var B=0,f,E=function(){if(f===null||f===void 0||f.unsubscribe(),f=null,L!=null){var G=typeof L==="number"?MjB.timer(L):EjB.innerFrom(L(B)),U=Y$L.createOperatorSubscriber(D,function(){U.unsubscribe(),M()});G.subscribe(U)}else M()},M=function(){var G=!1;if(f=I.subscribe(Y$L.createOperatorSubscriber(D,void 0,function(){if(++B{Object.defineProperty(FoH,"__esModule",{value:!0});FoH.repeatWhen=void 0;var UjB=M1(),XjB=xW(),JjB=ED(),C$L=EB();function FjB(H){return JjB.operate(function($,A){var L,I=!1,D,B=!1,f=!1,E=function(){return f&&B&&(A.complete(),!0)},M=function(){if(!D)D=new XjB.Subject,UjB.innerFrom(H(D)).subscribe(C$L.createOperatorSubscriber(A,function(){if(L)G();else I=!0},function(){B=!0,E()}));return D},G=function(){if(f=!1,L=$.subscribe(C$L.createOperatorSubscriber(A,void 0,function(){f=!0,!E()&&M().next()})),I)L.unsubscribe(),L=null,I=!1,G()};G()})}FoH.repeatWhen=FjB});var Rh$=z((KoH)=>{Object.defineProperty(KoH,"__esModule",{value:!0});KoH.retry=void 0;var KjB=ED(),w$L=EB(),QjB=OW(),WjB=oc(),VjB=M1();function PjB(H){if(H===void 0)H=1/0;var $;if(H&&typeof H==="object")$=H;else $={count:H};var A=$.count,L=A===void 0?1/0:A,I=$.delay,D=$.resetOnSuccess,B=D===void 0?!1:D;return L<=0?QjB.identity:KjB.operate(function(f,E){var M=0,G,U=function(){var X=!1;if(G=f.subscribe(w$L.createOperatorSubscriber(E,function(J){if(B)M=0;E.next(J)},void 0,function(J){if(M++{Object.defineProperty(QoH,"__esModule",{value:!0});QoH.retryWhen=void 0;var _jB=M1(),YjB=xW(),CjB=ED(),Z$L=EB();function wjB(H){return CjB.operate(function($,A){var L,I=!1,D,B=function(){if(L=$.subscribe(Z$L.createOperatorSubscriber(A,void 0,void 0,function(f){if(!D)D=new YjB.Subject,_jB.innerFrom(H(D)).subscribe(Z$L.createOperatorSubscriber(A,function(){return L?B():I=!0}));if(D)D.next(f)})),I)L.unsubscribe(),L=null,I=!1,B()};B()})}QoH.retryWhen=wjB});var VoH=z((WoH)=>{Object.defineProperty(WoH,"__esModule",{value:!0});WoH.sample=void 0;var ZjB=M1(),qjB=ED(),TjB=NW(),q$L=EB();function zjB(H){return qjB.operate(function($,A){var L=!1,I=null;$.subscribe(q$L.createOperatorSubscriber(A,function(D){L=!0,I=D})),ZjB.innerFrom(H).subscribe(q$L.createOperatorSubscriber(A,function(){if(L){L=!1;var D=I;I=null,A.next(D)}},TjB.noop))})}WoH.sample=zjB});var vh$=z((PoH)=>{Object.defineProperty(PoH,"__esModule",{value:!0});PoH.sampleTime=void 0;var NjB=T_(),OjB=VoH(),xjB=Ov$();function SjB(H,$){if($===void 0)$=NjB.asyncScheduler;return OjB.sample(xjB.interval(H,$))}PoH.sampleTime=SjB});var hh$=z((_oH)=>{Object.defineProperty(_oH,"__esModule",{value:!0});_oH.scan=void 0;var jjB=ED(),RjB=dv$();function yjB(H,$){return jjB.operate(RjB.scanInternals(H,$,arguments.length>=2,!0))}_oH.scan=yjB});var bh$=z((YoH)=>{Object.defineProperty(YoH,"__esModule",{value:!0});YoH.sequenceEqual=void 0;var vjB=ED(),hjB=EB(),bjB=M1();function kjB(H,$){if($===void 0)$=function(A,L){return A===L};return vjB.operate(function(A,L){var I=T$L(),D=T$L(),B=function(E){L.next(E),L.complete()},f=function(E,M){var G=hjB.createOperatorSubscriber(L,function(U){var{buffer:X,complete:J}=M;if(X.length===0)J?B(!1):E.buffer.push(U);else!$(U,X.shift())&&B(!1)},function(){E.complete=!0;var{complete:U,buffer:X}=M;U&&B(X.length===0),G===null||G===void 0||G.unsubscribe()});return G};A.subscribe(f(I,D)),bjB.innerFrom(H).subscribe(f(D,I))})}YoH.sequenceEqual=kjB;function T$L(){return{buffer:[],complete:!1}}});var CoH=z((Bl)=>{var ujB=Bl&&Bl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},gjB=Bl&&Bl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A0)G=new N$L.SafeSubscriber({next:function(O){return q.next(O)},error:function(O){Q=!0,W(),U=kh$(P,I,O),q.error(O)},complete:function(){F=!0,W(),U=kh$(P,B),q.complete()}}),z$L.innerFrom(Y).subscribe(G)})(M)}}Bl.share=djB;function kh$(H,$){var A=[];for(var L=2;L{Object.defineProperty(woH,"__esModule",{value:!0});woH.shareReplay=void 0;var cjB=pnH(),ljB=CoH();function ijB(H,$,A){var L,I,D,B,f=!1;if(H&&typeof H==="object")L=H.bufferSize,B=L===void 0?1/0:L,I=H.windowTime,$=I===void 0?1/0:I,D=H.refCount,f=D===void 0?!1:D,A=H.scheduler;else B=H!==null&&H!==void 0?H:1/0;return ljB.share({connector:function(){return new cjB.ReplaySubject(B,$,A)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:f})}woH.shareReplay=ijB});var gh$=z((ZoH)=>{Object.defineProperty(ZoH,"__esModule",{value:!0});ZoH.single=void 0;var njB=ic(),rjB=wv$(),ajB=Cv$(),ojB=ED(),tjB=EB();function sjB(H){return ojB.operate(function($,A){var L=!1,I,D=!1,B=0;$.subscribe(tjB.createOperatorSubscriber(A,function(f){if(D=!0,!H||H(f,B++,$))L&&A.error(new rjB.SequenceError("Too many matching values")),L=!0,I=f},function(){if(L)A.next(I),A.complete();else A.error(D?new ajB.NotFoundError("No matching values"):new njB.EmptyError)}))})}ZoH.single=sjB});var mh$=z((qoH)=>{Object.defineProperty(qoH,"__esModule",{value:!0});qoH.skip=void 0;var ejB=wk();function HRB(H){return ejB.filter(function($,A){return H<=A})}qoH.skip=HRB});var ph$=z((ToH)=>{Object.defineProperty(ToH,"__esModule",{value:!0});ToH.skipLast=void 0;var $RB=OW(),ARB=ED(),LRB=EB();function IRB(H){return H<=0?$RB.identity:ARB.operate(function($,A){var L=Array(H),I=0;return $.subscribe(LRB.createOperatorSubscriber(A,function(D){var B=I++;if(B{Object.defineProperty(zoH,"__esModule",{value:!0});zoH.skipUntil=void 0;var DRB=ED(),O$L=EB(),BRB=M1(),fRB=NW();function ERB(H){return DRB.operate(function($,A){var L=!1,I=O$L.createOperatorSubscriber(A,function(){I===null||I===void 0||I.unsubscribe(),L=!0},fRB.noop);BRB.innerFrom(H).subscribe(I),$.subscribe(O$L.createOperatorSubscriber(A,function(D){return L&&A.next(D)}))})}zoH.skipUntil=ERB});var ch$=z((NoH)=>{Object.defineProperty(NoH,"__esModule",{value:!0});NoH.skipWhile=void 0;var MRB=ED(),GRB=EB();function URB(H){return MRB.operate(function($,A){var L=!1,I=0;$.subscribe(GRB.createOperatorSubscriber(A,function(D){return(L||(L=!H(D,I++)))&&A.next(D)}))})}NoH.skipWhile=URB});var lh$=z((OoH)=>{Object.defineProperty(OoH,"__esModule",{value:!0});OoH.startWith=void 0;var x$L=gCH(),XRB=z_(),JRB=ED();function FRB(){var H=[];for(var $=0;${Object.defineProperty(xoH,"__esModule",{value:!0});xoH.switchMap=void 0;var KRB=M1(),QRB=ED(),S$L=EB();function WRB(H,$){return QRB.operate(function(A,L){var I=null,D=0,B=!1,f=function(){return B&&!I&&L.complete()};A.subscribe(S$L.createOperatorSubscriber(L,function(E){I===null||I===void 0||I.unsubscribe();var M=0,G=D++;KRB.innerFrom(H(E,G)).subscribe(I=S$L.createOperatorSubscriber(L,function(U){return L.next($?$(E,U,G,M++):U)},function(){I=null,f()}))},function(){B=!0,f()}))})}xoH.switchMap=WRB});var ih$=z((SoH)=>{Object.defineProperty(SoH,"__esModule",{value:!0});SoH.switchAll=void 0;var VRB=qMH(),PRB=OW();function _RB(){return VRB.switchMap(PRB.identity)}SoH.switchAll=_RB});var nh$=z((joH)=>{Object.defineProperty(joH,"__esModule",{value:!0});joH.switchMapTo=void 0;var j$L=qMH(),YRB=sE();function CRB(H,$){return YRB.isFunction($)?j$L.switchMap(function(){return H},$):j$L.switchMap(function(){return H})}joH.switchMapTo=CRB});var rh$=z((RoH)=>{Object.defineProperty(RoH,"__esModule",{value:!0});RoH.switchScan=void 0;var wRB=qMH(),ZRB=ED();function qRB(H,$){return ZRB.operate(function(A,L){var I=$;return wRB.switchMap(function(D,B){return H(I,D,B)},function(D,B){return I=B,B})(A).subscribe(L),function(){I=null}})}RoH.switchScan=qRB});var ah$=z((yoH)=>{Object.defineProperty(yoH,"__esModule",{value:!0});yoH.takeUntil=void 0;var TRB=ED(),zRB=EB(),NRB=M1(),ORB=NW();function xRB(H){return TRB.operate(function($,A){NRB.innerFrom(H).subscribe(zRB.createOperatorSubscriber(A,function(){return A.complete()},ORB.noop)),!A.closed&&$.subscribe(A)})}yoH.takeUntil=xRB});var oh$=z((voH)=>{Object.defineProperty(voH,"__esModule",{value:!0});voH.takeWhile=void 0;var SRB=ED(),jRB=EB();function RRB(H,$){if($===void 0)$=!1;return SRB.operate(function(A,L){var I=0;A.subscribe(jRB.createOperatorSubscriber(L,function(D){var B=H(D,I++);(B||$)&&L.next(D),!B&&L.complete()}))})}voH.takeWhile=RRB});var th$=z((hoH)=>{Object.defineProperty(hoH,"__esModule",{value:!0});hoH.tap=void 0;var yRB=sE(),vRB=ED(),hRB=EB(),bRB=OW();function kRB(H,$,A){var L=yRB.isFunction(H)||$||A?{next:H,error:$,complete:A}:H;return L?vRB.operate(function(I,D){var B;(B=L.subscribe)===null||B===void 0||B.call(L);var f=!0;I.subscribe(hRB.createOperatorSubscriber(D,function(E){var M;(M=L.next)===null||M===void 0||M.call(L,E),D.next(E)},function(){var E;f=!1,(E=L.complete)===null||E===void 0||E.call(L),D.complete()},function(E){var M;f=!1,(M=L.error)===null||M===void 0||M.call(L,E),D.error(E)},function(){var E,M;if(f)(E=L.unsubscribe)===null||E===void 0||E.call(L);(M=L.finalize)===null||M===void 0||M.call(L)}))}):bRB.identity}hoH.tap=kRB});var koH=z((boH)=>{Object.defineProperty(boH,"__esModule",{value:!0});boH.throttle=void 0;var uRB=ED(),R$L=EB(),gRB=M1();function mRB(H,$){return uRB.operate(function(A,L){var I=$!==null&&$!==void 0?$:{},D=I.leading,B=D===void 0?!0:D,f=I.trailing,E=f===void 0?!1:f,M=!1,G=null,U=null,X=!1,J=function(){if(U===null||U===void 0||U.unsubscribe(),U=null,E)W(),X&&L.complete()},F=function(){U=null,X&&L.complete()},Q=function(P){return U=gRB.innerFrom(H(P)).subscribe(R$L.createOperatorSubscriber(L,J,F))},W=function(){if(M){M=!1;var P=G;G=null,L.next(P),!X&&Q(P)}};A.subscribe(R$L.createOperatorSubscriber(L,function(P){M=!0,G=P,!(U&&!U.closed)&&(B?W():Q(P))},function(){X=!0,!(E&&M&&U&&!U.closed)&&L.complete()}))})}boH.throttle=mRB});var sh$=z((uoH)=>{Object.defineProperty(uoH,"__esModule",{value:!0});uoH.throttleTime=void 0;var pRB=T_(),dRB=koH(),cRB=oc();function lRB(H,$,A){if($===void 0)$=pRB.asyncScheduler;var L=cRB.timer(H,$);return dRB.throttle(function(){return L},A)}uoH.throttleTime=lRB});var eh$=z((TMH)=>{Object.defineProperty(TMH,"__esModule",{value:!0});TMH.TimeInterval=TMH.timeInterval=void 0;var iRB=T_(),nRB=ED(),rRB=EB();function aRB(H){if(H===void 0)H=iRB.asyncScheduler;return nRB.operate(function($,A){var L=H.now();$.subscribe(rRB.createOperatorSubscriber(A,function(I){var D=H.now(),B=D-L;L=D,A.next(new y$L(I,B))}))})}TMH.timeInterval=aRB;var y$L=function(){function H($,A){this.value=$,this.interval=A}return H}();TMH.TimeInterval=y$L});var Hb$=z((goH)=>{Object.defineProperty(goH,"__esModule",{value:!0});goH.timeoutWith=void 0;var oRB=T_(),tRB=ZrH(),sRB=kCH();function eRB(H,$,A){var L,I,D;if(A=A!==null&&A!==void 0?A:oRB.async,tRB.isValidDate(H))L=H;else if(typeof H==="number")I=H;if($)D=function(){return $};else throw TypeError("No observable provided to switch to");if(L==null&&I==null)throw TypeError("No timeout provided.");return sRB.timeout({first:L,each:I,scheduler:A,with:D})}goH.timeoutWith=eRB});var $b$=z((moH)=>{Object.defineProperty(moH,"__esModule",{value:!0});moH.timestamp=void 0;var HyB=mnH(),$yB=Ck();function AyB(H){if(H===void 0)H=HyB.dateTimestampProvider;return $yB.map(function($){return{value:$,timestamp:H.now()}})}moH.timestamp=AyB});var Ab$=z((poH)=>{Object.defineProperty(poH,"__esModule",{value:!0});poH.window=void 0;var v$L=xW(),LyB=ED(),h$L=EB(),IyB=NW(),DyB=M1();function ByB(H){return LyB.operate(function($,A){var L=new v$L.Subject;A.next(L.asObservable());var I=function(D){L.error(D),A.error(D)};return $.subscribe(h$L.createOperatorSubscriber(A,function(D){return L===null||L===void 0?void 0:L.next(D)},function(){L.complete(),A.complete()},I)),DyB.innerFrom(H).subscribe(h$L.createOperatorSubscriber(A,function(){L.complete(),A.next(L=new v$L.Subject)},IyB.noop,I)),function(){L===null||L===void 0||L.unsubscribe(),L=null}})}poH.window=ByB});var Lb$=z((zMH)=>{var fyB=zMH&&zMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(zMH,"__esModule",{value:!0});zMH.windowCount=void 0;var b$L=xW(),EyB=ED(),MyB=EB();function GyB(H,$){if($===void 0)$=0;var A=$>0?$:H;return EyB.operate(function(L,I){var D=[new b$L.Subject],B=[],f=0;I.next(D[0].asObservable()),L.subscribe(MyB.createOperatorSubscriber(I,function(E){var M,G;try{for(var U=fyB(D),X=U.next();!X.done;X=U.next()){var J=X.value;J.next(E)}}catch(W){M={error:W}}finally{try{if(X&&!X.done&&(G=U.return))G.call(U)}finally{if(M)throw M.error}}var F=f-H+1;if(F>=0&&F%A===0)D.shift().complete();if(++f%A===0){var Q=new b$L.Subject;D.push(Q),I.next(Q.asObservable())}},function(){while(D.length>0)D.shift().complete();I.complete()},function(E){while(D.length>0)D.shift().error(E);I.error(E)},function(){B=null,D=null}))})}zMH.windowCount=GyB});var Ib$=z((doH)=>{Object.defineProperty(doH,"__esModule",{value:!0});doH.windowTime=void 0;var UyB=xW(),XyB=T_(),JyB=L2(),FyB=ED(),KyB=EB(),QyB=Vk(),WyB=z_(),k$L=Pk();function VyB(H){var $,A,L=[];for(var I=1;I=0)k$L.executeSchedule(M,D,J,B,!0);else U=!0;J();var F=function(W){return G.slice().forEach(W)},Q=function(W){F(function(P){var C=P.window;return W(C)}),W(M),M.unsubscribe()};return E.subscribe(KyB.createOperatorSubscriber(M,function(W){F(function(P){P.window.next(W),f<=++P.seen&&X(P)})},function(){return Q(function(W){return W.complete()})},function(W){return Q(function(P){return P.error(W)})})),function(){G=null}})}doH.windowTime=VyB});var Bb$=z((NMH)=>{var PyB=NMH&&NMH.__values||function(H){var $=typeof Symbol==="function"&&Symbol.iterator,A=$&&H[$],L=0;if(A)return A.call(H);if(H&&typeof H.length==="number")return{next:function(){if(H&&L>=H.length)H=void 0;return{value:H&&H[L++],done:!H}}};throw TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(NMH,"__esModule",{value:!0});NMH.windowToggle=void 0;var _yB=xW(),YyB=L2(),CyB=ED(),u$L=M1(),Db$=EB(),g$L=NW(),wyB=Vk();function ZyB(H,$){return CyB.operate(function(A,L){var I=[],D=function(B){while(0{Object.defineProperty(coH,"__esModule",{value:!0});coH.windowWhen=void 0;var qyB=xW(),TyB=ED(),m$L=EB(),zyB=M1();function NyB(H){return TyB.operate(function($,A){var L,I,D=function(f){L.error(f),A.error(f)},B=function(){I===null||I===void 0||I.unsubscribe(),L===null||L===void 0||L.complete(),L=new qyB.Subject,A.next(L.asObservable());var f;try{f=zyB.innerFrom(H())}catch(E){D(E);return}f.subscribe(I=m$L.createOperatorSubscriber(A,B,B,D))};B(),$.subscribe(m$L.createOperatorSubscriber(A,function(f){return L.next(f)},function(){L.complete(),A.complete()},D,function(){I===null||I===void 0||I.unsubscribe(),L=null}))})}coH.windowWhen=NyB});var Eb$=z((fl)=>{var p$L=fl&&fl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},d$L=fl&&fl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(loH,"__esModule",{value:!0});loH.zipAll=void 0;var vyB=erH(),hyB=cv$();function byB(H){return hyB.joinAllInternals(vyB.zip,H)}loH.zipAll=byB});var Gb$=z((El)=>{var kyB=El&&El.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},uyB=El&&El.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var dyB=Ml&&Ml.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},cyB=Ml&&Ml.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{var nyB=lH&&lH.__createBinding||(Object.create?function(H,$,A,L){if(L===void 0)L=A;Object.defineProperty(H,L,{enumerable:!0,get:function(){return $[A]}})}:function(H,$,A,L){if(L===void 0)L=A;H[L]=$[A]}),ryB=lH&&lH.__exportStar||function(H,$){for(var A in H)if(A!=="default"&&!Object.prototype.hasOwnProperty.call($,A))nyB($,H,A)};Object.defineProperty(lH,"__esModule",{value:!0});lH.interval=lH.iif=lH.generate=lH.fromEventPattern=lH.fromEvent=lH.from=lH.forkJoin=lH.empty=lH.defer=lH.connectable=lH.concat=lH.combineLatest=lH.bindNodeCallback=lH.bindCallback=lH.UnsubscriptionError=lH.TimeoutError=lH.SequenceError=lH.ObjectUnsubscribedError=lH.NotFoundError=lH.EmptyError=lH.ArgumentOutOfRangeError=lH.firstValueFrom=lH.lastValueFrom=lH.isObservable=lH.identity=lH.noop=lH.pipe=lH.NotificationKind=lH.Notification=lH.Subscriber=lH.Subscription=lH.Scheduler=lH.VirtualAction=lH.VirtualTimeScheduler=lH.animationFrameScheduler=lH.animationFrame=lH.queueScheduler=lH.queue=lH.asyncScheduler=lH.async=lH.asapScheduler=lH.asap=lH.AsyncSubject=lH.ReplaySubject=lH.BehaviorSubject=lH.Subject=lH.animationFrames=lH.observable=lH.ConnectableObservable=lH.Observable=void 0;lH.filter=lH.expand=lH.exhaustMap=lH.exhaustAll=lH.exhaust=lH.every=lH.endWith=lH.elementAt=lH.distinctUntilKeyChanged=lH.distinctUntilChanged=lH.distinct=lH.dematerialize=lH.delayWhen=lH.delay=lH.defaultIfEmpty=lH.debounceTime=lH.debounce=lH.count=lH.connect=lH.concatWith=lH.concatMapTo=lH.concatMap=lH.concatAll=lH.combineLatestWith=lH.combineLatestAll=lH.combineAll=lH.catchError=lH.bufferWhen=lH.bufferToggle=lH.bufferTime=lH.bufferCount=lH.buffer=lH.auditTime=lH.audit=lH.config=lH.NEVER=lH.EMPTY=lH.scheduled=lH.zip=lH.using=lH.timer=lH.throwError=lH.range=lH.race=lH.partition=lH.pairs=lH.onErrorResumeNext=lH.of=lH.never=lH.merge=void 0;lH.switchMap=lH.switchAll=lH.subscribeOn=lH.startWith=lH.skipWhile=lH.skipUntil=lH.skipLast=lH.skip=lH.single=lH.shareReplay=lH.share=lH.sequenceEqual=lH.scan=lH.sampleTime=lH.sample=lH.refCount=lH.retryWhen=lH.retry=lH.repeatWhen=lH.repeat=lH.reduce=lH.raceWith=lH.publishReplay=lH.publishLast=lH.publishBehavior=lH.publish=lH.pluck=lH.pairwise=lH.onErrorResumeNextWith=lH.observeOn=lH.multicast=lH.min=lH.mergeWith=lH.mergeScan=lH.mergeMapTo=lH.mergeMap=lH.flatMap=lH.mergeAll=lH.max=lH.materialize=lH.mapTo=lH.map=lH.last=lH.isEmpty=lH.ignoreElements=lH.groupBy=lH.first=lH.findIndex=lH.find=lH.finalize=void 0;lH.zipWith=lH.zipAll=lH.withLatestFrom=lH.windowWhen=lH.windowToggle=lH.windowTime=lH.windowCount=lH.window=lH.toArray=lH.timestamp=lH.timeoutWith=lH.timeout=lH.timeInterval=lH.throwIfEmpty=lH.throttleTime=lH.throttle=lH.tap=lH.takeWhile=lH.takeUntil=lH.takeLast=lH.take=lH.switchScan=lH.switchMapTo=void 0;var ayB=wM();Object.defineProperty(lH,"Observable",{enumerable:!0,get:function(){return ayB.Observable}});var oyB=yCH();Object.defineProperty(lH,"ConnectableObservable",{enumerable:!0,get:function(){return oyB.ConnectableObservable}});var tyB=jCH();Object.defineProperty(lH,"observable",{enumerable:!0,get:function(){return tyB.observable}});var syB=CeA();Object.defineProperty(lH,"animationFrames",{enumerable:!0,get:function(){return syB.animationFrames}});var eyB=xW();Object.defineProperty(lH,"Subject",{enumerable:!0,get:function(){return eyB.Subject}});var HvB=Iv$();Object.defineProperty(lH,"BehaviorSubject",{enumerable:!0,get:function(){return HvB.BehaviorSubject}});var $vB=pnH();Object.defineProperty(lH,"ReplaySubject",{enumerable:!0,get:function(){return $vB.ReplaySubject}});var AvB=dnH();Object.defineProperty(lH,"AsyncSubject",{enumerable:!0,get:function(){return AvB.AsyncSubject}});var l$L=ueA();Object.defineProperty(lH,"asap",{enumerable:!0,get:function(){return l$L.asap}});Object.defineProperty(lH,"asapScheduler",{enumerable:!0,get:function(){return l$L.asapScheduler}});var i$L=T_();Object.defineProperty(lH,"async",{enumerable:!0,get:function(){return i$L.async}});Object.defineProperty(lH,"asyncScheduler",{enumerable:!0,get:function(){return i$L.asyncScheduler}});var n$L=peA();Object.defineProperty(lH,"queue",{enumerable:!0,get:function(){return n$L.queue}});Object.defineProperty(lH,"queueScheduler",{enumerable:!0,get:function(){return n$L.queueScheduler}});var r$L=ieA();Object.defineProperty(lH,"animationFrame",{enumerable:!0,get:function(){return r$L.animationFrame}});Object.defineProperty(lH,"animationFrameScheduler",{enumerable:!0,get:function(){return r$L.animationFrameScheduler}});var a$L=aeA();Object.defineProperty(lH,"VirtualTimeScheduler",{enumerable:!0,get:function(){return a$L.VirtualTimeScheduler}});Object.defineProperty(lH,"VirtualAction",{enumerable:!0,get:function(){return a$L.VirtualAction}});var LvB=Bv$();Object.defineProperty(lH,"Scheduler",{enumerable:!0,get:function(){return LvB.Scheduler}});var IvB=L2();Object.defineProperty(lH,"Subscription",{enumerable:!0,get:function(){return IvB.Subscription}});var DvB=pEH();Object.defineProperty(lH,"Subscriber",{enumerable:!0,get:function(){return DvB.Subscriber}});var o$L=KrH();Object.defineProperty(lH,"Notification",{enumerable:!0,get:function(){return o$L.Notification}});Object.defineProperty(lH,"NotificationKind",{enumerable:!0,get:function(){return o$L.NotificationKind}});var BvB=RCH();Object.defineProperty(lH,"pipe",{enumerable:!0,get:function(){return BvB.pipe}});var fvB=NW();Object.defineProperty(lH,"noop",{enumerable:!0,get:function(){return fvB.noop}});var EvB=OW();Object.defineProperty(lH,"identity",{enumerable:!0,get:function(){return EvB.identity}});var MvB=XHL();Object.defineProperty(lH,"isObservable",{enumerable:!0,get:function(){return MvB.isObservable}});var GvB=JHL();Object.defineProperty(lH,"lastValueFrom",{enumerable:!0,get:function(){return GvB.lastValueFrom}});var UvB=FHL();Object.defineProperty(lH,"firstValueFrom",{enumerable:!0,get:function(){return UvB.firstValueFrom}});var XvB=Yv$();Object.defineProperty(lH,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return XvB.ArgumentOutOfRangeError}});var JvB=ic();Object.defineProperty(lH,"EmptyError",{enumerable:!0,get:function(){return JvB.EmptyError}});var FvB=Cv$();Object.defineProperty(lH,"NotFoundError",{enumerable:!0,get:function(){return FvB.NotFoundError}});var KvB=Hv$();Object.defineProperty(lH,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return KvB.ObjectUnsubscribedError}});var QvB=wv$();Object.defineProperty(lH,"SequenceError",{enumerable:!0,get:function(){return QvB.SequenceError}});var WvB=kCH();Object.defineProperty(lH,"TimeoutError",{enumerable:!0,get:function(){return WvB.TimeoutError}});var VvB=py$();Object.defineProperty(lH,"UnsubscriptionError",{enumerable:!0,get:function(){return VvB.UnsubscriptionError}});var PvB=QHL();Object.defineProperty(lH,"bindCallback",{enumerable:!0,get:function(){return PvB.bindCallback}});var _vB=WHL();Object.defineProperty(lH,"bindNodeCallback",{enumerable:!0,get:function(){return _vB.bindNodeCallback}});var YvB=xrH();Object.defineProperty(lH,"combineLatest",{enumerable:!0,get:function(){return YvB.combineLatest}});var CvB=gCH();Object.defineProperty(lH,"concat",{enumerable:!0,get:function(){return CvB.concat}});var wvB=qHL();Object.defineProperty(lH,"connectable",{enumerable:!0,get:function(){return wvB.connectable}});var ZvB=mCH();Object.defineProperty(lH,"defer",{enumerable:!0,get:function(){return ZvB.defer}});var qvB=xN();Object.defineProperty(lH,"empty",{enumerable:!0,get:function(){return qvB.empty}});var TvB=THL();Object.defineProperty(lH,"forkJoin",{enumerable:!0,get:function(){return TvB.forkJoin}});var zvB=_k();Object.defineProperty(lH,"from",{enumerable:!0,get:function(){return zvB.from}});var NvB=NHL();Object.defineProperty(lH,"fromEvent",{enumerable:!0,get:function(){return NvB.fromEvent}});var OvB=xHL();Object.defineProperty(lH,"fromEventPattern",{enumerable:!0,get:function(){return OvB.fromEventPattern}});var xvB=jHL();Object.defineProperty(lH,"generate",{enumerable:!0,get:function(){return xvB.generate}});var SvB=RHL();Object.defineProperty(lH,"iif",{enumerable:!0,get:function(){return SvB.iif}});var jvB=Ov$();Object.defineProperty(lH,"interval",{enumerable:!0,get:function(){return jvB.interval}});var RvB=vHL();Object.defineProperty(lH,"merge",{enumerable:!0,get:function(){return RvB.merge}});var yvB=xv$();Object.defineProperty(lH,"never",{enumerable:!0,get:function(){return yvB.never}});var vvB=JrH();Object.defineProperty(lH,"of",{enumerable:!0,get:function(){return vvB.of}});var hvB=Sv$();Object.defineProperty(lH,"onErrorResumeNext",{enumerable:!0,get:function(){return hvB.onErrorResumeNext}});var bvB=bHL();Object.defineProperty(lH,"pairs",{enumerable:!0,get:function(){return bvB.pairs}});var kvB=gHL();Object.defineProperty(lH,"partition",{enumerable:!0,get:function(){return kvB.partition}});var uvB=Rv$();Object.defineProperty(lH,"race",{enumerable:!0,get:function(){return uvB.race}});var gvB=dHL();Object.defineProperty(lH,"range",{enumerable:!0,get:function(){return gvB.range}});var mvB=_v$();Object.defineProperty(lH,"throwError",{enumerable:!0,get:function(){return mvB.throwError}});var pvB=oc();Object.defineProperty(lH,"timer",{enumerable:!0,get:function(){return pvB.timer}});var dvB=cHL();Object.defineProperty(lH,"using",{enumerable:!0,get:function(){return dvB.using}});var cvB=erH();Object.defineProperty(lH,"zip",{enumerable:!0,get:function(){return cvB.zip}});var lvB=Pv$();Object.defineProperty(lH,"scheduled",{enumerable:!0,get:function(){return lvB.scheduled}});var ivB=xN();Object.defineProperty(lH,"EMPTY",{enumerable:!0,get:function(){return ivB.EMPTY}});var nvB=xv$();Object.defineProperty(lH,"NEVER",{enumerable:!0,get:function(){return nvB.NEVER}});ryB(iHL(),lH);var rvB=gEH();Object.defineProperty(lH,"config",{enumerable:!0,get:function(){return rvB.config}});var avB=$aH();Object.defineProperty(lH,"audit",{enumerable:!0,get:function(){return avB.audit}});var ovB=yv$();Object.defineProperty(lH,"auditTime",{enumerable:!0,get:function(){return ovB.auditTime}});var tvB=vv$();Object.defineProperty(lH,"buffer",{enumerable:!0,get:function(){return tvB.buffer}});var svB=bv$();Object.defineProperty(lH,"bufferCount",{enumerable:!0,get:function(){return svB.bufferCount}});var evB=kv$();Object.defineProperty(lH,"bufferTime",{enumerable:!0,get:function(){return evB.bufferTime}});var HhB=gv$();Object.defineProperty(lH,"bufferToggle",{enumerable:!0,get:function(){return HhB.bufferToggle}});var $hB=mv$();Object.defineProperty(lH,"bufferWhen",{enumerable:!0,get:function(){return $hB.bufferWhen}});var AhB=pv$();Object.defineProperty(lH,"catchError",{enumerable:!0,get:function(){return AhB.catchError}});var LhB=lv$();Object.defineProperty(lH,"combineAll",{enumerable:!0,get:function(){return LhB.combineAll}});var IhB=XaH();Object.defineProperty(lH,"combineLatestAll",{enumerable:!0,get:function(){return IhB.combineLatestAll}});var DhB=nv$();Object.defineProperty(lH,"combineLatestWith",{enumerable:!0,get:function(){return DhB.combineLatestWith}});var BhB=uCH();Object.defineProperty(lH,"concatAll",{enumerable:!0,get:function(){return BhB.concatAll}});var fhB=KaH();Object.defineProperty(lH,"concatMap",{enumerable:!0,get:function(){return fhB.concatMap}});var EhB=rv$();Object.defineProperty(lH,"concatMapTo",{enumerable:!0,get:function(){return EhB.concatMapTo}});var MhB=ov$();Object.defineProperty(lH,"concatWith",{enumerable:!0,get:function(){return MhB.concatWith}});var GhB=pCH();Object.defineProperty(lH,"connect",{enumerable:!0,get:function(){return GhB.connect}});var UhB=tv$();Object.defineProperty(lH,"count",{enumerable:!0,get:function(){return UhB.count}});var XhB=sv$();Object.defineProperty(lH,"debounce",{enumerable:!0,get:function(){return XhB.debounce}});var JhB=ev$();Object.defineProperty(lH,"debounceTime",{enumerable:!0,get:function(){return JhB.debounceTime}});var FhB=_MH();Object.defineProperty(lH,"defaultIfEmpty",{enumerable:!0,get:function(){return FhB.defaultIfEmpty}});var KhB=Hh$();Object.defineProperty(lH,"delay",{enumerable:!0,get:function(){return KhB.delay}});var QhB=OaH();Object.defineProperty(lH,"delayWhen",{enumerable:!0,get:function(){return QhB.delayWhen}});var WhB=$h$();Object.defineProperty(lH,"dematerialize",{enumerable:!0,get:function(){return WhB.dematerialize}});var VhB=Ah$();Object.defineProperty(lH,"distinct",{enumerable:!0,get:function(){return VhB.distinct}});var PhB=yaH();Object.defineProperty(lH,"distinctUntilChanged",{enumerable:!0,get:function(){return PhB.distinctUntilChanged}});var _hB=Lh$();Object.defineProperty(lH,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return _hB.distinctUntilKeyChanged}});var YhB=Ih$();Object.defineProperty(lH,"elementAt",{enumerable:!0,get:function(){return YhB.elementAt}});var ChB=Dh$();Object.defineProperty(lH,"endWith",{enumerable:!0,get:function(){return ChB.endWith}});var whB=Bh$();Object.defineProperty(lH,"every",{enumerable:!0,get:function(){return whB.every}});var ZhB=fh$();Object.defineProperty(lH,"exhaust",{enumerable:!0,get:function(){return ZhB.exhaust}});var qhB=paH();Object.defineProperty(lH,"exhaustAll",{enumerable:!0,get:function(){return qhB.exhaustAll}});var ThB=gaH();Object.defineProperty(lH,"exhaustMap",{enumerable:!0,get:function(){return ThB.exhaustMap}});var zhB=Eh$();Object.defineProperty(lH,"expand",{enumerable:!0,get:function(){return zhB.expand}});var NhB=wk();Object.defineProperty(lH,"filter",{enumerable:!0,get:function(){return NhB.filter}});var OhB=Mh$();Object.defineProperty(lH,"finalize",{enumerable:!0,get:function(){return OhB.finalize}});var xhB=iaH();Object.defineProperty(lH,"find",{enumerable:!0,get:function(){return xhB.find}});var ShB=Gh$();Object.defineProperty(lH,"findIndex",{enumerable:!0,get:function(){return ShB.findIndex}});var jhB=Uh$();Object.defineProperty(lH,"first",{enumerable:!0,get:function(){return jhB.first}});var RhB=Xh$();Object.defineProperty(lH,"groupBy",{enumerable:!0,get:function(){return RhB.groupBy}});var yhB=qaH();Object.defineProperty(lH,"ignoreElements",{enumerable:!0,get:function(){return yhB.ignoreElements}});var vhB=Jh$();Object.defineProperty(lH,"isEmpty",{enumerable:!0,get:function(){return vhB.isEmpty}});var hhB=Fh$();Object.defineProperty(lH,"last",{enumerable:!0,get:function(){return hhB.last}});var bhB=Ck();Object.defineProperty(lH,"map",{enumerable:!0,get:function(){return bhB.map}});var khB=zaH();Object.defineProperty(lH,"mapTo",{enumerable:!0,get:function(){return khB.mapTo}});var uhB=Qh$();Object.defineProperty(lH,"materialize",{enumerable:!0,get:function(){return uhB.materialize}});var ghB=Wh$();Object.defineProperty(lH,"max",{enumerable:!0,get:function(){return ghB.max}});var mhB=JMH();Object.defineProperty(lH,"mergeAll",{enumerable:!0,get:function(){return mhB.mergeAll}});var phB=Vh$();Object.defineProperty(lH,"flatMap",{enumerable:!0,get:function(){return phB.flatMap}});var dhB=QR();Object.defineProperty(lH,"mergeMap",{enumerable:!0,get:function(){return dhB.mergeMap}});var chB=Ph$();Object.defineProperty(lH,"mergeMapTo",{enumerable:!0,get:function(){return chB.mergeMapTo}});var lhB=_h$();Object.defineProperty(lH,"mergeScan",{enumerable:!0,get:function(){return lhB.mergeScan}});var ihB=Ch$();Object.defineProperty(lH,"mergeWith",{enumerable:!0,get:function(){return ihB.mergeWith}});var nhB=wh$();Object.defineProperty(lH,"min",{enumerable:!0,get:function(){return nhB.min}});var rhB=dCH();Object.defineProperty(lH,"multicast",{enumerable:!0,get:function(){return rhB.multicast}});var ahB=GMH();Object.defineProperty(lH,"observeOn",{enumerable:!0,get:function(){return ahB.observeOn}});var ohB=Zh$();Object.defineProperty(lH,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ohB.onErrorResumeNextWith}});var thB=qh$();Object.defineProperty(lH,"pairwise",{enumerable:!0,get:function(){return thB.pairwise}});var shB=Th$();Object.defineProperty(lH,"pluck",{enumerable:!0,get:function(){return shB.pluck}});var ehB=zh$();Object.defineProperty(lH,"publish",{enumerable:!0,get:function(){return ehB.publish}});var HbB=Nh$();Object.defineProperty(lH,"publishBehavior",{enumerable:!0,get:function(){return HbB.publishBehavior}});var $bB=Oh$();Object.defineProperty(lH,"publishLast",{enumerable:!0,get:function(){return $bB.publishLast}});var AbB=xh$();Object.defineProperty(lH,"publishReplay",{enumerable:!0,get:function(){return AbB.publishReplay}});var LbB=XoH();Object.defineProperty(lH,"raceWith",{enumerable:!0,get:function(){return LbB.raceWith}});var IbB=I$H();Object.defineProperty(lH,"reduce",{enumerable:!0,get:function(){return IbB.reduce}});var DbB=Sh$();Object.defineProperty(lH,"repeat",{enumerable:!0,get:function(){return DbB.repeat}});var BbB=jh$();Object.defineProperty(lH,"repeatWhen",{enumerable:!0,get:function(){return BbB.repeatWhen}});var fbB=Rh$();Object.defineProperty(lH,"retry",{enumerable:!0,get:function(){return fbB.retry}});var EbB=yh$();Object.defineProperty(lH,"retryWhen",{enumerable:!0,get:function(){return EbB.retryWhen}});var MbB=knH();Object.defineProperty(lH,"refCount",{enumerable:!0,get:function(){return MbB.refCount}});var GbB=VoH();Object.defineProperty(lH,"sample",{enumerable:!0,get:function(){return GbB.sample}});var UbB=vh$();Object.defineProperty(lH,"sampleTime",{enumerable:!0,get:function(){return UbB.sampleTime}});var XbB=hh$();Object.defineProperty(lH,"scan",{enumerable:!0,get:function(){return XbB.scan}});var JbB=bh$();Object.defineProperty(lH,"sequenceEqual",{enumerable:!0,get:function(){return JbB.sequenceEqual}});var FbB=CoH();Object.defineProperty(lH,"share",{enumerable:!0,get:function(){return FbB.share}});var KbB=uh$();Object.defineProperty(lH,"shareReplay",{enumerable:!0,get:function(){return KbB.shareReplay}});var QbB=gh$();Object.defineProperty(lH,"single",{enumerable:!0,get:function(){return QbB.single}});var WbB=mh$();Object.defineProperty(lH,"skip",{enumerable:!0,get:function(){return WbB.skip}});var VbB=ph$();Object.defineProperty(lH,"skipLast",{enumerable:!0,get:function(){return VbB.skipLast}});var PbB=dh$();Object.defineProperty(lH,"skipUntil",{enumerable:!0,get:function(){return PbB.skipUntil}});var _bB=ch$();Object.defineProperty(lH,"skipWhile",{enumerable:!0,get:function(){return _bB.skipWhile}});var YbB=lh$();Object.defineProperty(lH,"startWith",{enumerable:!0,get:function(){return YbB.startWith}});var CbB=UMH();Object.defineProperty(lH,"subscribeOn",{enumerable:!0,get:function(){return CbB.subscribeOn}});var wbB=ih$();Object.defineProperty(lH,"switchAll",{enumerable:!0,get:function(){return wbB.switchAll}});var ZbB=qMH();Object.defineProperty(lH,"switchMap",{enumerable:!0,get:function(){return ZbB.switchMap}});var qbB=nh$();Object.defineProperty(lH,"switchMapTo",{enumerable:!0,get:function(){return qbB.switchMapTo}});var TbB=rh$();Object.defineProperty(lH,"switchScan",{enumerable:!0,get:function(){return TbB.switchScan}});var zbB=YMH();Object.defineProperty(lH,"take",{enumerable:!0,get:function(){return zbB.take}});var NbB=taH();Object.defineProperty(lH,"takeLast",{enumerable:!0,get:function(){return NbB.takeLast}});var ObB=ah$();Object.defineProperty(lH,"takeUntil",{enumerable:!0,get:function(){return ObB.takeUntil}});var xbB=oh$();Object.defineProperty(lH,"takeWhile",{enumerable:!0,get:function(){return xbB.takeWhile}});var SbB=th$();Object.defineProperty(lH,"tap",{enumerable:!0,get:function(){return SbB.tap}});var jbB=koH();Object.defineProperty(lH,"throttle",{enumerable:!0,get:function(){return jbB.throttle}});var RbB=sh$();Object.defineProperty(lH,"throttleTime",{enumerable:!0,get:function(){return RbB.throttleTime}});var ybB=CMH();Object.defineProperty(lH,"throwIfEmpty",{enumerable:!0,get:function(){return ybB.throwIfEmpty}});var vbB=eh$();Object.defineProperty(lH,"timeInterval",{enumerable:!0,get:function(){return vbB.timeInterval}});var hbB=kCH();Object.defineProperty(lH,"timeout",{enumerable:!0,get:function(){return hbB.timeout}});var bbB=Hb$();Object.defineProperty(lH,"timeoutWith",{enumerable:!0,get:function(){return bbB.timeoutWith}});var kbB=$b$();Object.defineProperty(lH,"timestamp",{enumerable:!0,get:function(){return kbB.timestamp}});var ubB=MaH();Object.defineProperty(lH,"toArray",{enumerable:!0,get:function(){return ubB.toArray}});var gbB=Ab$();Object.defineProperty(lH,"window",{enumerable:!0,get:function(){return gbB.window}});var mbB=Lb$();Object.defineProperty(lH,"windowCount",{enumerable:!0,get:function(){return mbB.windowCount}});var pbB=Ib$();Object.defineProperty(lH,"windowTime",{enumerable:!0,get:function(){return pbB.windowTime}});var dbB=Bb$();Object.defineProperty(lH,"windowToggle",{enumerable:!0,get:function(){return dbB.windowToggle}});var cbB=fb$();Object.defineProperty(lH,"windowWhen",{enumerable:!0,get:function(){return cbB.windowWhen}});var lbB=Eb$();Object.defineProperty(lH,"withLatestFrom",{enumerable:!0,get:function(){return lbB.withLatestFrom}});var ibB=Mb$();Object.defineProperty(lH,"zipAll",{enumerable:!0,get:function(){return ibB.zipAll}});var nbB=Ub$();Object.defineProperty(lH,"zipWith",{enumerable:!0,get:function(){return nbB.zipWith}})});var e$L=z((ioH)=>{Object.defineProperty(ioH,"__esModule",{value:!0});ioH.partition=void 0;var rbB=jv$(),s$L=wk();function abB(H,$){return function(A){return[s$L.filter(H,$)(A),s$L.filter(rbB.not(H,$))(A)]}}ioH.partition=abB});var HAL=z((Gl)=>{var obB=Gl&&Gl.__read||function(H,$){var A=typeof Symbol==="function"&&H[Symbol.iterator];if(!A)return H;var L=A.call(H),I,D=[],B;try{while(($===void 0||$-- >0)&&!(I=L.next()).done)D.push(I.value)}catch(f){B={error:f}}finally{try{if(I&&!I.done&&(A=L.return))A.call(L)}finally{if(B)throw B.error}}return D},tbB=Gl&&Gl.__spreadArray||function(H,$){for(var A=0,L=$.length,I=H.length;A{Object.defineProperty(V$,"__esModule",{value:!0});V$.mergeAll=V$.merge=V$.max=V$.materialize=V$.mapTo=V$.map=V$.last=V$.isEmpty=V$.ignoreElements=V$.groupBy=V$.first=V$.findIndex=V$.find=V$.finalize=V$.filter=V$.expand=V$.exhaustMap=V$.exhaustAll=V$.exhaust=V$.every=V$.endWith=V$.elementAt=V$.distinctUntilKeyChanged=V$.distinctUntilChanged=V$.distinct=V$.dematerialize=V$.delayWhen=V$.delay=V$.defaultIfEmpty=V$.debounceTime=V$.debounce=V$.count=V$.connect=V$.concatWith=V$.concatMapTo=V$.concatMap=V$.concatAll=V$.concat=V$.combineLatestWith=V$.combineLatest=V$.combineLatestAll=V$.combineAll=V$.catchError=V$.bufferWhen=V$.bufferToggle=V$.bufferTime=V$.bufferCount=V$.buffer=V$.auditTime=V$.audit=void 0;V$.timeInterval=V$.throwIfEmpty=V$.throttleTime=V$.throttle=V$.tap=V$.takeWhile=V$.takeUntil=V$.takeLast=V$.take=V$.switchScan=V$.switchMapTo=V$.switchMap=V$.switchAll=V$.subscribeOn=V$.startWith=V$.skipWhile=V$.skipUntil=V$.skipLast=V$.skip=V$.single=V$.shareReplay=V$.share=V$.sequenceEqual=V$.scan=V$.sampleTime=V$.sample=V$.refCount=V$.retryWhen=V$.retry=V$.repeatWhen=V$.repeat=V$.reduce=V$.raceWith=V$.race=V$.publishReplay=V$.publishLast=V$.publishBehavior=V$.publish=V$.pluck=V$.partition=V$.pairwise=V$.onErrorResumeNext=V$.observeOn=V$.multicast=V$.min=V$.mergeWith=V$.mergeScan=V$.mergeMapTo=V$.mergeMap=V$.flatMap=void 0;V$.zipWith=V$.zipAll=V$.zip=V$.withLatestFrom=V$.windowWhen=V$.windowToggle=V$.windowTime=V$.windowCount=V$.window=V$.toArray=V$.timestamp=V$.timeoutWith=V$.timeout=void 0;var $kB=$aH();Object.defineProperty(V$,"audit",{enumerable:!0,get:function(){return $kB.audit}});var AkB=yv$();Object.defineProperty(V$,"auditTime",{enumerable:!0,get:function(){return AkB.auditTime}});var LkB=vv$();Object.defineProperty(V$,"buffer",{enumerable:!0,get:function(){return LkB.buffer}});var IkB=bv$();Object.defineProperty(V$,"bufferCount",{enumerable:!0,get:function(){return IkB.bufferCount}});var DkB=kv$();Object.defineProperty(V$,"bufferTime",{enumerable:!0,get:function(){return DkB.bufferTime}});var BkB=gv$();Object.defineProperty(V$,"bufferToggle",{enumerable:!0,get:function(){return BkB.bufferToggle}});var fkB=mv$();Object.defineProperty(V$,"bufferWhen",{enumerable:!0,get:function(){return fkB.bufferWhen}});var EkB=pv$();Object.defineProperty(V$,"catchError",{enumerable:!0,get:function(){return EkB.catchError}});var MkB=lv$();Object.defineProperty(V$,"combineAll",{enumerable:!0,get:function(){return MkB.combineAll}});var GkB=XaH();Object.defineProperty(V$,"combineLatestAll",{enumerable:!0,get:function(){return GkB.combineLatestAll}});var UkB=iv$();Object.defineProperty(V$,"combineLatest",{enumerable:!0,get:function(){return UkB.combineLatest}});var XkB=nv$();Object.defineProperty(V$,"combineLatestWith",{enumerable:!0,get:function(){return XkB.combineLatestWith}});var JkB=av$();Object.defineProperty(V$,"concat",{enumerable:!0,get:function(){return JkB.concat}});var FkB=uCH();Object.defineProperty(V$,"concatAll",{enumerable:!0,get:function(){return FkB.concatAll}});var KkB=KaH();Object.defineProperty(V$,"concatMap",{enumerable:!0,get:function(){return KkB.concatMap}});var QkB=rv$();Object.defineProperty(V$,"concatMapTo",{enumerable:!0,get:function(){return QkB.concatMapTo}});var WkB=ov$();Object.defineProperty(V$,"concatWith",{enumerable:!0,get:function(){return WkB.concatWith}});var VkB=pCH();Object.defineProperty(V$,"connect",{enumerable:!0,get:function(){return VkB.connect}});var PkB=tv$();Object.defineProperty(V$,"count",{enumerable:!0,get:function(){return PkB.count}});var _kB=sv$();Object.defineProperty(V$,"debounce",{enumerable:!0,get:function(){return _kB.debounce}});var YkB=ev$();Object.defineProperty(V$,"debounceTime",{enumerable:!0,get:function(){return YkB.debounceTime}});var CkB=_MH();Object.defineProperty(V$,"defaultIfEmpty",{enumerable:!0,get:function(){return CkB.defaultIfEmpty}});var wkB=Hh$();Object.defineProperty(V$,"delay",{enumerable:!0,get:function(){return wkB.delay}});var ZkB=OaH();Object.defineProperty(V$,"delayWhen",{enumerable:!0,get:function(){return ZkB.delayWhen}});var qkB=$h$();Object.defineProperty(V$,"dematerialize",{enumerable:!0,get:function(){return qkB.dematerialize}});var TkB=Ah$();Object.defineProperty(V$,"distinct",{enumerable:!0,get:function(){return TkB.distinct}});var zkB=yaH();Object.defineProperty(V$,"distinctUntilChanged",{enumerable:!0,get:function(){return zkB.distinctUntilChanged}});var NkB=Lh$();Object.defineProperty(V$,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return NkB.distinctUntilKeyChanged}});var OkB=Ih$();Object.defineProperty(V$,"elementAt",{enumerable:!0,get:function(){return OkB.elementAt}});var xkB=Dh$();Object.defineProperty(V$,"endWith",{enumerable:!0,get:function(){return xkB.endWith}});var SkB=Bh$();Object.defineProperty(V$,"every",{enumerable:!0,get:function(){return SkB.every}});var jkB=fh$();Object.defineProperty(V$,"exhaust",{enumerable:!0,get:function(){return jkB.exhaust}});var RkB=paH();Object.defineProperty(V$,"exhaustAll",{enumerable:!0,get:function(){return RkB.exhaustAll}});var ykB=gaH();Object.defineProperty(V$,"exhaustMap",{enumerable:!0,get:function(){return ykB.exhaustMap}});var vkB=Eh$();Object.defineProperty(V$,"expand",{enumerable:!0,get:function(){return vkB.expand}});var hkB=wk();Object.defineProperty(V$,"filter",{enumerable:!0,get:function(){return hkB.filter}});var bkB=Mh$();Object.defineProperty(V$,"finalize",{enumerable:!0,get:function(){return bkB.finalize}});var kkB=iaH();Object.defineProperty(V$,"find",{enumerable:!0,get:function(){return kkB.find}});var ukB=Gh$();Object.defineProperty(V$,"findIndex",{enumerable:!0,get:function(){return ukB.findIndex}});var gkB=Uh$();Object.defineProperty(V$,"first",{enumerable:!0,get:function(){return gkB.first}});var mkB=Xh$();Object.defineProperty(V$,"groupBy",{enumerable:!0,get:function(){return mkB.groupBy}});var pkB=qaH();Object.defineProperty(V$,"ignoreElements",{enumerable:!0,get:function(){return pkB.ignoreElements}});var dkB=Jh$();Object.defineProperty(V$,"isEmpty",{enumerable:!0,get:function(){return dkB.isEmpty}});var ckB=Fh$();Object.defineProperty(V$,"last",{enumerable:!0,get:function(){return ckB.last}});var lkB=Ck();Object.defineProperty(V$,"map",{enumerable:!0,get:function(){return lkB.map}});var ikB=zaH();Object.defineProperty(V$,"mapTo",{enumerable:!0,get:function(){return ikB.mapTo}});var nkB=Qh$();Object.defineProperty(V$,"materialize",{enumerable:!0,get:function(){return nkB.materialize}});var rkB=Wh$();Object.defineProperty(V$,"max",{enumerable:!0,get:function(){return rkB.max}});var akB=Yh$();Object.defineProperty(V$,"merge",{enumerable:!0,get:function(){return akB.merge}});var okB=JMH();Object.defineProperty(V$,"mergeAll",{enumerable:!0,get:function(){return okB.mergeAll}});var tkB=Vh$();Object.defineProperty(V$,"flatMap",{enumerable:!0,get:function(){return tkB.flatMap}});var skB=QR();Object.defineProperty(V$,"mergeMap",{enumerable:!0,get:function(){return skB.mergeMap}});var ekB=Ph$();Object.defineProperty(V$,"mergeMapTo",{enumerable:!0,get:function(){return ekB.mergeMapTo}});var HuB=_h$();Object.defineProperty(V$,"mergeScan",{enumerable:!0,get:function(){return HuB.mergeScan}});var $uB=Ch$();Object.defineProperty(V$,"mergeWith",{enumerable:!0,get:function(){return $uB.mergeWith}});var AuB=wh$();Object.defineProperty(V$,"min",{enumerable:!0,get:function(){return AuB.min}});var LuB=dCH();Object.defineProperty(V$,"multicast",{enumerable:!0,get:function(){return LuB.multicast}});var IuB=GMH();Object.defineProperty(V$,"observeOn",{enumerable:!0,get:function(){return IuB.observeOn}});var DuB=Zh$();Object.defineProperty(V$,"onErrorResumeNext",{enumerable:!0,get:function(){return DuB.onErrorResumeNext}});var BuB=qh$();Object.defineProperty(V$,"pairwise",{enumerable:!0,get:function(){return BuB.pairwise}});var fuB=e$L();Object.defineProperty(V$,"partition",{enumerable:!0,get:function(){return fuB.partition}});var EuB=Th$();Object.defineProperty(V$,"pluck",{enumerable:!0,get:function(){return EuB.pluck}});var MuB=zh$();Object.defineProperty(V$,"publish",{enumerable:!0,get:function(){return MuB.publish}});var GuB=Nh$();Object.defineProperty(V$,"publishBehavior",{enumerable:!0,get:function(){return GuB.publishBehavior}});var UuB=Oh$();Object.defineProperty(V$,"publishLast",{enumerable:!0,get:function(){return UuB.publishLast}});var XuB=xh$();Object.defineProperty(V$,"publishReplay",{enumerable:!0,get:function(){return XuB.publishReplay}});var JuB=HAL();Object.defineProperty(V$,"race",{enumerable:!0,get:function(){return JuB.race}});var FuB=XoH();Object.defineProperty(V$,"raceWith",{enumerable:!0,get:function(){return FuB.raceWith}});var KuB=I$H();Object.defineProperty(V$,"reduce",{enumerable:!0,get:function(){return KuB.reduce}});var QuB=Sh$();Object.defineProperty(V$,"repeat",{enumerable:!0,get:function(){return QuB.repeat}});var WuB=jh$();Object.defineProperty(V$,"repeatWhen",{enumerable:!0,get:function(){return WuB.repeatWhen}});var VuB=Rh$();Object.defineProperty(V$,"retry",{enumerable:!0,get:function(){return VuB.retry}});var PuB=yh$();Object.defineProperty(V$,"retryWhen",{enumerable:!0,get:function(){return PuB.retryWhen}});var _uB=knH();Object.defineProperty(V$,"refCount",{enumerable:!0,get:function(){return _uB.refCount}});var YuB=VoH();Object.defineProperty(V$,"sample",{enumerable:!0,get:function(){return YuB.sample}});var CuB=vh$();Object.defineProperty(V$,"sampleTime",{enumerable:!0,get:function(){return CuB.sampleTime}});var wuB=hh$();Object.defineProperty(V$,"scan",{enumerable:!0,get:function(){return wuB.scan}});var ZuB=bh$();Object.defineProperty(V$,"sequenceEqual",{enumerable:!0,get:function(){return ZuB.sequenceEqual}});var quB=CoH();Object.defineProperty(V$,"share",{enumerable:!0,get:function(){return quB.share}});var TuB=uh$();Object.defineProperty(V$,"shareReplay",{enumerable:!0,get:function(){return TuB.shareReplay}});var zuB=gh$();Object.defineProperty(V$,"single",{enumerable:!0,get:function(){return zuB.single}});var NuB=mh$();Object.defineProperty(V$,"skip",{enumerable:!0,get:function(){return NuB.skip}});var OuB=ph$();Object.defineProperty(V$,"skipLast",{enumerable:!0,get:function(){return OuB.skipLast}});var xuB=dh$();Object.defineProperty(V$,"skipUntil",{enumerable:!0,get:function(){return xuB.skipUntil}});var SuB=ch$();Object.defineProperty(V$,"skipWhile",{enumerable:!0,get:function(){return SuB.skipWhile}});var juB=lh$();Object.defineProperty(V$,"startWith",{enumerable:!0,get:function(){return juB.startWith}});var RuB=UMH();Object.defineProperty(V$,"subscribeOn",{enumerable:!0,get:function(){return RuB.subscribeOn}});var yuB=ih$();Object.defineProperty(V$,"switchAll",{enumerable:!0,get:function(){return yuB.switchAll}});var vuB=qMH();Object.defineProperty(V$,"switchMap",{enumerable:!0,get:function(){return vuB.switchMap}});var huB=nh$();Object.defineProperty(V$,"switchMapTo",{enumerable:!0,get:function(){return huB.switchMapTo}});var buB=rh$();Object.defineProperty(V$,"switchScan",{enumerable:!0,get:function(){return buB.switchScan}});var kuB=YMH();Object.defineProperty(V$,"take",{enumerable:!0,get:function(){return kuB.take}});var uuB=taH();Object.defineProperty(V$,"takeLast",{enumerable:!0,get:function(){return uuB.takeLast}});var guB=ah$();Object.defineProperty(V$,"takeUntil",{enumerable:!0,get:function(){return guB.takeUntil}});var muB=oh$();Object.defineProperty(V$,"takeWhile",{enumerable:!0,get:function(){return muB.takeWhile}});var puB=th$();Object.defineProperty(V$,"tap",{enumerable:!0,get:function(){return puB.tap}});var duB=koH();Object.defineProperty(V$,"throttle",{enumerable:!0,get:function(){return duB.throttle}});var cuB=sh$();Object.defineProperty(V$,"throttleTime",{enumerable:!0,get:function(){return cuB.throttleTime}});var luB=CMH();Object.defineProperty(V$,"throwIfEmpty",{enumerable:!0,get:function(){return luB.throwIfEmpty}});var iuB=eh$();Object.defineProperty(V$,"timeInterval",{enumerable:!0,get:function(){return iuB.timeInterval}});var nuB=kCH();Object.defineProperty(V$,"timeout",{enumerable:!0,get:function(){return nuB.timeout}});var ruB=Hb$();Object.defineProperty(V$,"timeoutWith",{enumerable:!0,get:function(){return ruB.timeoutWith}});var auB=$b$();Object.defineProperty(V$,"timestamp",{enumerable:!0,get:function(){return auB.timestamp}});var ouB=MaH();Object.defineProperty(V$,"toArray",{enumerable:!0,get:function(){return ouB.toArray}});var tuB=Ab$();Object.defineProperty(V$,"window",{enumerable:!0,get:function(){return tuB.window}});var suB=Lb$();Object.defineProperty(V$,"windowCount",{enumerable:!0,get:function(){return suB.windowCount}});var euB=Ib$();Object.defineProperty(V$,"windowTime",{enumerable:!0,get:function(){return euB.windowTime}});var HgB=Bb$();Object.defineProperty(V$,"windowToggle",{enumerable:!0,get:function(){return HgB.windowToggle}});var $gB=fb$();Object.defineProperty(V$,"windowWhen",{enumerable:!0,get:function(){return $gB.windowWhen}});var AgB=Eb$();Object.defineProperty(V$,"withLatestFrom",{enumerable:!0,get:function(){return AgB.withLatestFrom}});var LgB=Gb$();Object.defineProperty(V$,"zip",{enumerable:!0,get:function(){return LgB.zip}});var IgB=Mb$();Object.defineProperty(V$,"zipAll",{enumerable:!0,get:function(){return IgB.zipAll}});var DgB=Ub$();Object.defineProperty(V$,"zipWith",{enumerable:!0,get:function(){return DgB.zipWith}})});var Jb$=z((I2)=>{var __dirname="/home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/spawn-rx/lib/src",lZ=I2&&I2.__assign||function(){return lZ=Object.assign||function(H){for(var $,A=1,L=arguments.length;A>")}I.next({source:Y,text:q})}},Q=new Ul.Subscription;if(A.stdin)if(J.stdin)Q.add(A.stdin.subscribe({next:function(Y){return J.stdin.write(Y)},error:I.error.bind(I),complete:function(){return J.stdin.end()}}));else I.error(Error("opts.stdio conflicts with provided spawn opts.stdin observable, 'pipe' is required"));var W=null,P=null,C=!1;if(J.stdout)P=new Ul.AsyncSubject,J.stdout.on("data",F("stdout")),J.stdout.on("close",function(){P.next(!0),P.complete()});else P=(0,Ul.of)(!0);if(J.stderr)W=new Ul.AsyncSubject,J.stderr.on("data",F("stderr")),J.stderr.on("close",function(){W.next(!0),W.complete()});else W=(0,Ul.of)(!0);return J.on("error",function(Y){C=!0,I.error(Y)}),J.on("close",function(Y){C=!0;var Z=(0,Ul.merge)(P,W).pipe((0,AAL.reduce)(function(q){return q},!0));if(Y===0)Z.subscribe(function(){return I.complete()});else Z.subscribe(function(){var q=Error("Failed with exit code: ".concat(Y));q.exitCode=Y,q.code=Y,I.error(q)})}),Q.add(new Ul.Subscription(function(){if(C)return;if(OMH("Killing process: ".concat(U," ").concat(X.join())),A.jobber)EgB.connect("\\\\.\\pipe\\jobber-".concat(J.pid)),setTimeout(function(){return J.kill()},5000);else J.kill()})),Q});return A.split?L:L.pipe((0,AAL.map)(function(I){return I===null||I===void 0?void 0:I.text}))}function BAL(H){return new Promise(function($,A){var L="";H.subscribe({next:function(I){return L+=I},error:function(I){var D=Error("".concat(L,` `).concat(D.message));if("exitCode"in D)B.exitCode=D.exitCode,B.code=D.exitCode,B.stdout=L,B.stderr=I;A(B)},complete:function(){return $([L,I])}})})}function UgB(H,$,A){if(A===null||A===void 0?void 0:A.split)return fAL(Xb$(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!0})));else return BAL(Xb$(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!1})))}function XgB(H,$,A){if(A===null||A===void 0?void 0:A.split)return fAL(iCH(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!0})));else return BAL(iCH(H,$,lZ(lZ({},A!==null&&A!==void 0?A:{}),{split:!1})))}});function nD(H=JgB){let $=new AbortController;return EAL.setMaxListeners(H,$.signal),$}function FgB(H){let $=this.deref();H.deref()?.abort($?.signal.reason)}function KgB(H){let $=this.deref(),A=H.deref();if($&&A)$.signal.removeEventListener("abort",A)}function D$H(H,$){let A=nD($);if(H.signal.aborted)return A.abort(H.signal.reason),A;let L=new WeakRef(A),I=new WeakRef(H),D=FgB.bind(I,L);return H.signal.addEventListener("abort",D,{once:!0}),A.signal.addEventListener("abort",KgB.bind(I,new WeakRef(D)),{once:!0}),A}var EAL,JgB=50;var eE=K(()=>{EAL=require("events")});function xMH(){return!0}function U8(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}function GAL(){return"prod"}function UAL(){if(process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL)return"-custom-oauth";switch(GAL()){case"local":return"-local-oauth";case"staging":return"-staging-oauth";case"prod":return""}}function XD(){let H=(()=>{switch(GAL()){case"local":return PgB;case"staging":return VgB??MAL;case"prod":return MAL}})(),$=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if($){let L=$.replace(/\/$/,"");if(!_gB.includes(L))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");H={...H,BASE_API_URL:L,CONSOLE_AUTHORIZE_URL:`${L}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${L}/oauth/authorize`,TOKEN_URL:`${L}/v1/oauth/token`,API_KEY_URL:`${L}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${L}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${L}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${L}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${L}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let A=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;if(A)H={...H,CLIENT_ID:A};return H}var VR="user:inference",QgB="org:create_api_key",N_="oauth-2025-04-20",WgB,Fb$,XAL,MAL,VgB=void 0,PgB,_gB;var qE=K(()=>{NA();WgB=[QgB,"user:profile"],Fb$=["user:profile",VR,"user:sessions:claude_code","user:mcp_servers"],XAL=Array.from(new Set([...WgB,...Fb$])),MAL={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.ai/oauth/authorize",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},PgB={BASE_API_URL:"http://localhost:3000",CONSOLE_AUTHORIZE_URL:"http://localhost:3000/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"http://localhost:4000/oauth/authorize",TOKEN_URL:"http://localhost:3000/v1/oauth/token",API_KEY_URL:"http://localhost:3000/api/oauth/claude_cli/create_api_key",ROLES_URL:"http://localhost:3000/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"http://localhost:3000/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"http://localhost:3000/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://console.staging.ant.dev/oauth/code/callback",CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"},_gB=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"]});var WAL=z((Q$8,QAL)=>{QAL.exports=KAL;KAL.sync=CgB;var JAL=require("fs");function YgB(H,$){var A=$.pathExt!==void 0?$.pathExt:process.env.PATHEXT;if(!A)return!0;if(A=A.split(";"),A.indexOf("")!==-1)return!0;for(var L=0;L{YAL.exports=PAL;PAL.sync=wgB;var VAL=require("fs");function PAL(H,$,A){VAL.stat(H,function(L,I){A(L,L?!1:_AL(I,$))})}function wgB(H,$){return _AL(VAL.statSync(H),$)}function _AL(H,$){return H.isFile()&&ZgB(H,$)}function ZgB(H,$){var{mode:A,uid:L,gid:I}=H,D=$.uid!==void 0?$.uid:process.getuid&&process.getuid(),B=$.gid!==void 0?$.gid:process.getgid&&process.getgid(),f=parseInt("100",8),E=parseInt("010",8),M=parseInt("001",8),G=f|E,U=A&M||A&E&&I===B||A&f&&L===D||A&G&&D===0;return U}});var ZAL=z((P$8,wAL)=>{var V$8=require("fs"),roH;if(global.TESTING_WINDOWS)roH=WAL();else roH=CAL();wAL.exports=Kb$;Kb$.sync=qgB;function Kb$(H,$,A){if(typeof $==="function")A=$,$={};if(!A){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(L,I){Kb$(H,$||{},function(D,B){if(D)I(D);else L(B)})})}roH(H,$||{},function(L,I){if(L){if(L.code==="EACCES"||$&&$.ignoreErrors)L=null,I=!1}A(L,I)})}function qgB(H,$){try{return roH.sync(H,$||{})}catch(A){if($&&$.ignoreErrors||A.code==="EACCES")return!1;else throw A}}});var SAL=z((_$8,xAL)=>{var SMH=process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",qAL=require("path"),TgB=SMH?";":":",TAL=ZAL(),zAL=(H)=>Object.assign(Error(`not found: ${H}`),{code:"ENOENT"}),NAL=(H,$)=>{let A=$.colon||TgB,L=H.match(/\//)||SMH&&H.match(/\\/)?[""]:[...SMH?[process.cwd()]:[],...($.path||process.env.PATH||"").split(A)],I=SMH?$.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",D=SMH?I.split(A):[""];if(SMH){if(H.indexOf(".")!==-1&&D[0]!=="")D.unshift("")}return{pathEnv:L,pathExt:D,pathExtExe:I}},OAL=(H,$,A)=>{if(typeof $==="function")A=$,$={};if(!$)$={};let{pathEnv:L,pathExt:I,pathExtExe:D}=NAL(H,$),B=[],f=(M)=>new Promise((G,U)=>{if(M===L.length)return $.all&&B.length?G(B):U(zAL(H));let X=L[M],J=/^".*"$/.test(X)?X.slice(1,-1):X,F=qAL.join(J,H),Q=!J&&/^\.[\\\/]/.test(H)?H.slice(0,2)+F:F;G(E(Q,M,0))}),E=(M,G,U)=>new Promise((X,J)=>{if(U===I.length)return X(f(G+1));let F=I[U];TAL(M+F,{pathExt:D},(Q,W)=>{if(!Q&&W)if($.all)B.push(M+F);else return X(M+F);return X(E(M,G,U+1))})});return A?f(0).then((M)=>A(null,M),A):f(0)},zgB=(H,$)=>{$=$||{};let{pathEnv:A,pathExt:L,pathExtExe:I}=NAL(H,$),D=[];for(let B=0;B{var jAL=(H={})=>{let $=H.env||process.env;if((H.platform||"linux")!=="win32")return"PATH";return Object.keys($).reverse().find((L)=>L.toUpperCase()==="PATH")||"Path"};Qb$.exports=jAL;Qb$.exports.default=jAL});var bAL=z((C$8,hAL)=>{var yAL=require("path"),NgB=SAL(),OgB=RAL();function vAL(H,$){let A=H.options.env||process.env,L=process.cwd(),I=H.options.cwd!=null,D=I&&process.chdir!==void 0&&!process.chdir.disabled;if(D)try{process.chdir(H.options.cwd)}catch(f){}let B;try{B=NgB.sync(H.command,{path:A[OgB({env:A})],pathExt:$?yAL.delimiter:void 0})}catch(f){}finally{if(D)process.chdir(L)}if(B)B=yAL.resolve(I?H.options.cwd:"",B);return B}function xgB(H){return vAL(H)||vAL(H,!0)}hAL.exports=xgB});var kAL=z((w$8,Vb$)=>{var Wb$=/([()\][%!^"`<>&|;, *?])/g;function SgB(H){return H=H.replace(Wb$,"^$1"),H}function jgB(H,$){if(H=`${H}`,H=H.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),H=H.replace(/(?=(\\+?)?)\1$/,"$1$1"),H=`"${H}"`,H=H.replace(Wb$,"^$1"),$)H=H.replace(Wb$,"^$1");return H}Vb$.exports.command=SgB;Vb$.exports.argument=jgB});var gAL=z((Z$8,uAL)=>{uAL.exports=/^#!(.*)/});var pAL=z((q$8,mAL)=>{var RgB=gAL();mAL.exports=(H="")=>{let $=H.match(RgB);if(!$)return null;let[A,L]=$[0].replace(/#! ?/,"").split(" "),I=A.split("/").pop();if(I==="env")return L;return L?`${I} ${L}`:I}});var cAL=z((T$8,dAL)=>{var Pb$=require("fs"),ygB=pAL();function vgB(H){let A=Buffer.alloc(150),L;try{L=Pb$.openSync(H,"r"),Pb$.readSync(L,A,0,150,0),Pb$.closeSync(L)}catch(I){}return ygB(A.toString())}dAL.exports=vgB});var rAL=z((z$8,nAL)=>{var hgB=require("path"),lAL=bAL(),iAL=kAL(),bgB=cAL(),kgB=/\.(?:com|exe)$/i,ugB=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ggB(H){H.file=lAL(H);let $=H.file&&bgB(H.file);if($)return H.args.unshift(H.file),H.command=$,lAL(H);return H.file}function mgB(H){return H}function pgB(H,$,A){if($&&!Array.isArray($))A=$,$=null;$=$?$.slice(0):[],A=Object.assign({},A);let L={command:H,args:$,options:A,file:void 0,original:{command:H,args:$}};return A.shell?L:mgB(L)}nAL.exports=pgB});var tAL=z((N$8,oAL)=>{function dgB(H,$){return Object.assign(Error(`${$} ${H.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${$} ${H.command}`,path:H.command,spawnargs:H.args})}function cgB(H,$){return}function aAL(H,$){return null}function lgB(H,$){return null}oAL.exports={hookChildProcess:cgB,verifyENOENT:aAL,verifyENOENTSync:lgB,notFoundError:dgB}});var Cb$=z((O$8,jMH)=>{var sAL=require("child_process"),_b$=rAL(),Yb$=tAL();function eAL(H,$,A){let L=_b$(H,$,A),I=sAL.spawn(L.command,L.args,L.options);return Yb$.hookChildProcess(I,L),I}function igB(H,$,A){let L=_b$(H,$,A),I=sAL.spawnSync(L.command,L.args,L.options);return I.error=I.error||Yb$.verifyENOENTSync(I.status,L),I}jMH.exports=eAL;jMH.exports.spawn=eAL;jMH.exports.sync=igB;jMH.exports._parse=_b$;jMH.exports._enoent=Yb$});function wb$(H){let $=typeof H==="string"?` `)};var FIL=K(()=>{UIL=require("util"),XIL=b(require("process")),JIL=UIL.debuglog("execa").enabled});function fE(H,$,A){let L=PIL(H,$,A),I=lb$(H,$),D=ib$(H,$);rb$(D,L.options),zLL(L.options);let B;try{B=ftH.default.spawn(L.file,L.args,L.options)}catch(J){let F=new ftH.default.ChildProcess,Q=Promise.reject(rCH({error:J,stdout:"",stderr:"",all:"",command:I,escapedCommand:D,parsed:L,timedOut:!1,isCanceled:!1,killed:!1}));return cb$(F,Q),F}let f=LIL(B),E=TLL(B,L.options,f),M=NLL(B,L.options,E),G={isCanceled:!1};B.kill=ZLL.bind(null,B.kill.bind(B)),B.cancel=qLL.bind(null,B,G);let X=ILL(async()=>{let[{error:J,exitCode:F,signal:Q,timedOut:W},P,C,Y]=await $IL(B,L.options,M),Z=sCH(L.options,P),q=sCH(L.options,C),O=sCH(L.options,Y);if(J||F!==0||Q!==null){let j=rCH({error:J,exitCode:F,signal:Q,stdout:Z,stderr:q,all:O,command:I,escapedCommand:D,parsed:L,timedOut:W,isCanceled:G.isCanceled||(L.options.signal?L.options.signal.aborted:!1),killed:B.killed});if(!L.options.reject)return j;throw j}return{command:I,escapedCommand:D,exitCode:0,stdout:Z,stderr:q,all:O,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return eLL(B,L.options),B.all=HIL(B,L.options),jLL(B),cb$(B,X),B}function eCH(H,$,A){let L=PIL(H,$,A),I=lb$(H,$),D=ib$(H,$);rb$(D,L.options);let B=sLL(L.options),f;try{f=ftH.default.spawnSync(L.file,L.args,{...L.options,input:B})}catch(G){throw rCH({error:G,stdout:"",stderr:"",all:"",command:I,escapedCommand:D,parsed:L,timedOut:!1,isCanceled:!1,killed:!1})}let E=sCH(L.options,f.stdout,f.error),M=sCH(L.options,f.stderr,f.error);if(f.error||f.status!==0||f.signal!==null){let G=rCH({stdout:E,stderr:M,error:f.error,signal:f.signal,exitCode:f.status,command:I,escapedCommand:D,parsed:L,timedOut:f.error&&f.error.code==="ETIMEDOUT",isCanceled:!1,killed:f.signal!==null});if(!L.options.reject)return G;throw G}return{command:I,escapedCommand:D,exitCode:0,stdout:E,stderr:M,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function _IL(H){function $(A,...L){if(!Array.isArray(A))return _IL({...H,...A});let[I,...D]=nb$(A,L);return fE(I,D,KIL(H))}return $.sync=(A,...L)=>{if(!Array.isArray(A))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[I,...D]=nb$(A,L);return eCH(I,D,KIL(H))},$}var QIL,WIL,ftH,tCH,VIL,amB=1e8,omB=({env:H,extendEnv:$,preferLocal:A,localDir:L,execPath:I})=>{let D=$?{...tCH.default.env,...H}:H;if(A)return HLL({env:D,cwd:L,execPath:I});return D},PIL=(H,$,A={})=>{let L=VIL.default._parse(H,$,A);if(H=L.command,$=L.args,A=L.options,A={maxBuffer:amB,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:A.cwd||tCH.default.cwd(),execPath:tCH.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:JIL,...A},A.env=omB(A),A.stdio=WLL(A),tCH.default.platform==="win32"&&WIL.default.basename(H,".exe")==="cmd")$.unshift("/q");return{file:H,args:$,options:A,parsed:L}},sCH=(H,$,A)=>{if(typeof $!=="string"&&!QIL.Buffer.isBuffer($))return A===void 0?void 0:"";if(H.stripFinalNewline)return wb$($);return $},tmB=({input:H,inputFile:$,stdio:A})=>H===void 0&&$===void 0&&A===void 0?{stdin:"inherit"}:{},KIL=(H={})=>({preferLocal:!0,...tmB(H),...H}),lA8;var O_=K(()=>{$LL();DLL();QLL();VLL();OLL();RLL();AIL();IIL();GIL();FIL();QIL=require("buffer"),WIL=b(require("path")),ftH=b(require("child_process")),tCH=b(require("process")),VIL=b(Cb$(),1);lA8=_IL()});function smB(H,$){performance.now()-$>Xk}function SN(H,$){let A=`execSync: ${H.slice(0,100)}`,L=performance.now();try{return YIL.execSync(H,$)}finally{smB(A,L)}}var YIL;var H2H=K(()=>{E$();g$();Z$();YIL=require("child_process")});async function emB(H){let $=await fE(`which ${H}`,{shell:!0,stderr:"ignore",reject:!1});if($.exitCode!==0||!$.stdout)return null;return $.stdout.trim()}function HpB(H){try{return SN(`which ${H}`,{encoding:"utf-8"}).toString().trim()||null}catch{return null}}async function x_(H){if(typeof Bun<"u")return Bun.which(H);return emB(H)}function EtH(H){if(typeof Bun<"u")return Bun.which(H);return HpB(H)}var Zk=K(()=>{O_();H2H()});function SW(){if(zH().existsSync(MtH.join(UL(),".config.json")))return MtH.join(UL(),".config.json");let H=`.claude${UAL()}.json`;return MtH.join(process.env.CLAUDE_CONFIG_DIR||CIL.homedir(),H)}async function yMH(H){try{return!!await x_(H)}catch{return!1}}function BpB(){if(process.env.CURSOR_TRACE_ID)return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("/.cursor-server/"))return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("/.windsurf-server/"))return"windsurf";let H=process.env.__CFBundleIdentifier?.toLowerCase();if(H?.includes("vscodium"))return"codium";if(H?.includes("windsurf"))return"windsurf";if(H?.includes("com.google.android.studio"))return"androidstudio";if(H){for(let $ of ab$)if(H.includes($))return $}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")return"pycharm";if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(qIL())return"ssh-session";if(process.env.TERM){let $=process.env.TERM;if($.includes("alacritty"))return"alacritty";if($.includes("rxvt"))return"rxvt";if($.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}function qIL(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var MtH,CIL,wIL,$pB,ApB,LpB,ZIL,IpB,DpB=()=>{return process.env.__CFBundleIdentifier==="com.conductor.app"},ab$,fpB,OA;var Z1=K(()=>{tD();w1();DL();eE();NA();qE();Zk();MtH=require("path"),CIL=require("os"),wIL=b(Jb$(),1);$pB=o$(async()=>{try{let H=nD(),$=setTimeout(()=>H.abort(),1000);return await nA.head("http://1.1.1.1",{signal:H.signal}),clearTimeout($),!0}catch{return!1}});ApB=o$(async()=>{let H=[];if(await yMH("npm"))H.push("npm");if(await yMH("yarn"))H.push("yarn");if(await yMH("pnpm"))H.push("pnpm");return H}),LpB=o$(async()=>{let H=[];if(await yMH("bun"))H.push("bun");if(await yMH("deno"))H.push("deno");if(await yMH("node"))H.push("node");return H}),ZIL=o$(()=>{try{return zH().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(H){return!1}}),IpB=o$(()=>{try{if(!ZIL())return!1;let{cmd:H}=wIL.findActualExecutable("npm",[]);return H.startsWith("/mnt/c/")}catch(H){return!1}}),ab$=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];fpB=o$(()=>{if(A$(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(A$(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(A$(process.env.RENDER))return"render";if(A$(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(A$(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";try{if(zH().existsSync("/sys/hypervisor/uuid")){if(zH().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase().startsWith("ec2"))return"aws-ec2"}}catch{}if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(A$(process.env.GITHUB_ACTIONS))return"github-actions";if(A$(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(A$(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(zH().existsSync("/.dockerenv"))return"docker"}catch{}if(OA.platform==="darwin")return"unknown-darwin";if(OA.platform==="linux")return"unknown-linux";if(OA.platform==="win32")return"unknown-win32";return"unknown"});OA={hasInternetAccess:$pB,isCI:A$(!1),platform:["win32","darwin"].includes("linux")?"linux":"linux",arch:"x64",nodeVersion:process.version,terminal:BpB(),isSSH:qIL,getPackageManagers:ApB,getRuntimes:LpB,isRunningWithBun:o$(xMH),isWslEnvironment:ZIL,isNpmFromWindowsPath:IpB,isConductor:DpB,detectDeploymentEnvironment:fpB}});function GtH(){return HR()}function C$(){try{return GtH()}catch{return zL()}}var PI=K(()=>{g$()});function f$H(H){return H.sort(($,A)=>{let L=A.modified.getTime()-$.modified.getTime();if(L!==0)return L;return A.created.getTime()-$.created.getTime()})}function sb$(H,{suffix:$="nodejs"}={}){if(typeof H!=="string")throw TypeError(`Expected a string, got ${typeof H}`);if($)H+=`-${$}`;if(UtH.default.platform==="darwin")return EpB(H);if(UtH.default.platform==="win32")return MpB(H);return GpB(H)}var K4,ob$,UtH,Xl,tb$,vMH,EpB=(H)=>{let $=K4.default.join(Xl,"Library");return{data:K4.default.join($,"Application Support",H),config:K4.default.join($,"Preferences",H),cache:K4.default.join($,"Caches",H),log:K4.default.join($,"Logs",H),temp:K4.default.join(tb$,H)}},MpB=(H)=>{let $=vMH.APPDATA||K4.default.join(Xl,"AppData","Roaming"),A=vMH.LOCALAPPDATA||K4.default.join(Xl,"AppData","Local");return{data:K4.default.join(A,H,"Data"),config:K4.default.join($,H,"Config"),cache:K4.default.join(A,H,"Cache"),log:K4.default.join(A,H,"Log"),temp:K4.default.join(tb$,H)}},GpB=(H)=>{let $=K4.default.basename(Xl);return{data:K4.default.join(vMH.XDG_DATA_HOME||K4.default.join(Xl,".local","share"),H),config:K4.default.join(vMH.XDG_CONFIG_HOME||K4.default.join(Xl,".config"),H),cache:K4.default.join(vMH.XDG_CACHE_HOME||K4.default.join(Xl,".cache"),H),log:K4.default.join(vMH.XDG_STATE_HOME||K4.default.join(Xl,".local","state"),H),temp:K4.default.join(tb$,$,H)}};var TIL=K(()=>{K4=b(require("path")),ob$=b(require("os")),UtH=b(require("process")),Xl=ob$.default.homedir(),tb$=ob$.default.tmpdir(),{env:vMH}=UtH.default});function zIL(H){return H.replace(/[^a-zA-Z0-9]/g,"-")}function JtH(H){return zIL(H)}var $2H,XtH,Jl;var A2H=K(()=>{TIL();DL();$2H=require("path"),XtH=sb$("claude-cli");Jl={baseLogs:()=>$2H.join(XtH.cache,JtH(zH().cwd())),errors:()=>$2H.join(XtH.cache,JtH(zH().cwd()),"errors"),messages:()=>$2H.join(XtH.cache,JtH(zH().cwd()),"messages"),mcpLogs:(H)=>$2H.join(XtH.cache,JtH(zH().cwd()),`mcp-logs-${zIL(H)}`)}});var WV="command-name",C6="command-message",NIL="bash-stdout",OIL="bash-stderr",hMH="local-command-stdout",FtH="local-command-stderr",eb$="local-command-caveat",jN="tick",G5="task-notification",w6="task-id",KtH="task-type",D2="output-file",HK="status",$K="summary",sX="teammate-message",bMH,kMH;var EE=K(()=>{bMH=["help","-h","--help"],kMH=["list","show","display","current","view","get","check","describe","print","version","about","status","?"]});function QtH(H){return H.replace(XpB,"").trim()||H}var UpB,XpB;var Hk$=K(()=>{UpB=["ide_opened_file","ide_selection"],XpB=new RegExp(UpB.map((H)=>`<${H}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${H}>\\n?`).join("|"),"g")});function Fl(H,$){let A=H.firstPrompt?.startsWith(`<${jN}>`),L=H.firstPrompt&&H.firstPrompt!==""&&!A,I=H.agentName||H.customTitle||H.summary||(L?H.firstPrompt:void 0)||$||(A?"Autonomous session":void 0)||(H.sessionId?H.sessionId.slice(0,8):"")||"";return QtH(I).trim()}function xIL(H){return H.toISOString().replace(/[:.]/g,"-")}function FpB(H){if(WtH.length>=JpB)WtH.shift();WtH.push(H)}function SIL(H){if(RN!==null)throw Error("Error log sink already attached - cannot attach more than once");if(RN=H,uMH.length>0){let $=[...uMH];uMH.length=0;for(let A of $)switch(A.type){case"error":RN.logError(A.error);break;case"mcpError":RN.logMCPError(A.serverName,A.error);break;case"mcpDebug":RN.logMCPDebug(A.serverName,A.message);break}}}function r(H){try{if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.DISABLE_ERROR_REPORTING||process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return;let A={error:H.stack||H.message,timestamp:new Date().toISOString()};if(FpB(A),RN===null){uMH.push({type:"error",error:H});return}RN.logError(H)}catch{}}function gMH(){return[...WtH]}function ME(H,$){try{if(RN===null){uMH.push({type:"mcpError",serverName:H,error:$});return}RN.logMCPError(H,$)}catch{}}function TA(H,$){try{if(RN===null){uMH.push({type:"mcpDebug",serverName:H,message:$});return}RN.logMCPDebug(H,$)}catch{}}function VtH(H,$){if(!$||$!=="repl_main_thread")return;let A=klA(H);Ej$(A)}var JpB=100,WtH,uMH,RN=null,xL8;var _$=K(()=>{g$();A2H();DL();tD();NA();Z$();EE();Hk$();WtH=[];uMH=[];xL8=o$(()=>{return process.argv.includes("--hard-fail")})});function I2H(H,$=!1){let A=H.length,L=0,I="",D=0,B=16,f=0,E=0,M=0,G=0,U=0;function X(Y,Z){let q=0,O=0;while(q=48&&j<=57)O=O*16+j-48;else if(j>=65&&j<=70)O=O*16+j-65+10;else if(j>=97&&j<=102)O=O*16+j-97+10;else break;L++,q++}if(q=A){Y+=H.substring(Z,L),U=2;break}let q=H.charCodeAt(L);if(q===34){Y+=H.substring(Z,L),L++;break}if(q===92){if(Y+=H.substring(Z,L),L++,L>=A){U=2;break}switch(H.charCodeAt(L++)){case 34:Y+='"';break;case 92:Y+="\\";break;case 47:Y+="/";break;case 98:Y+="\b";break;case 102:Y+="\f";break;case 110:Y+=` `).filter(Boolean),F.length>0&&(X||J))F=F.slice(0,-1)}if(N(`rg error (signal=${B.signal}, code=${B.code}, stderr: ${E}), ${F.length} results`),B.code!==2)r(B);if(X&&F.length===0){I(new uDL(`Ripgrep search timed out after ${oA()==="wsl"?60:20} seconds. The search may have matched files but did not complete in time. Try searching a more specific path or pattern.`,F));return}L(F)};vDL(H,$,A,(B,f,E)=>{D(B,f,E,!1)})})}async function gDL(H,$,A){try{return(await YR(["-l","."],H,$)).slice(0,A)}catch{return[]}}function mDL(){let H=htH();return{mode:H.mode,path:H.command,working:vtH?.working??null}}async function WdB(){return}var hDL,bDL,V$H,kDL,sMH,XdB,JdB,htH,Q2H=20000000,uDL,btH,vtH=null,KdB,QdB=!1;var CR=K(()=>{tD();_$();B0();E$();NA();z$();Z9();Z$();hDL=b(Jb$(),1),bDL=require("url"),V$H=b(require("path")),kDL=require("os"),sMH=require("child_process"),XdB=bDL.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/ripgrep.ts"),JdB=V$H.join(XdB,"../"),htH=o$(()=>{if(BE(process.env.USE_BUILTIN_RIPGREP)){let{cmd:L}=hDL.findActualExecutable("rg",[]);if(L!=="rg")return{mode:"system",command:"rg",args:[]}}if(U8()){if(process.env.RIPGREP_EMBEDDED==="true")return{mode:"embedded",command:process.execPath,args:[],argv0:"rg"};return{mode:"builtin",command:process.execPath,args:["--ripgrep"]}}let $=V$H.resolve(JdB,"vendor","ripgrep");return{mode:"builtin",command:V$H.resolve($,"x64-linux","rg"),args:[]}});uDL=class uDL extends Error{partialResults;constructor(H,$){super(H);this.partialResults=$;this.name="RipgrepTimeoutError"}};btH=o$(async(H,$,A=[])=>{if(V$H.resolve(H)===V$H.resolve(kDL.homedir()))return;try{let L=["--files","--hidden"];A.forEach((E)=>{L.push("--glob",`!${E}`)});let D=(await YR(L,H,$)).length;if(D===0)return 0;let B=Math.floor(Math.log10(D)),f=Math.pow(10,B);return Math.round(D/f)*f}catch(L){r(L instanceof Error?L:Error(String(L)))}});KdB=o$(async()=>{if(vtH!==null)return;let H=htH();try{let $;if(H.argv0){let L=sMH.spawnSync(H.command,["--version"],{argv0:H.argv0,encoding:"utf8",timeout:5000});$={code:L.status??1,stdout:L.stdout||""}}else $=await jA(H.command,[...H.args,"--version"],{timeout:5000});let A=$.code===0&&!!$.stdout&&$.stdout.startsWith("ripgrep ");vtH={working:A,lastTested:Date.now(),config:H},N(`Ripgrep first use test: ${A?"PASSED":"FAILED"} (mode=${H.mode}, path=${H.command})`),c("tengu_ripgrep_availability",{working:A?1:0,using_system:H.mode==="system"?1:0})}catch($){vtH={working:!1,lastTested:Date.now(),config:H},r($ instanceof Error?$:Error(String($)))}})});class pDL{cache=new Map;maxCacheSize=1000;readFile(H){let $=zH(),A;try{A=$.statSync(H)}catch(f){throw this.cache.delete(H),f}let L=H,I=this.cache.get(L);if(I&&I.mtime===A.mtimeMs)return{content:I.content,encoding:I.encoding};let D=eJ(H),B=$.readFileSync(H,{encoding:D}).replaceAll(`\r `)}function wdB(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}var yk$;var Z6=K(()=>{DL();Z$();yk$=require("path")});function Vl(H){switch(H){case"userSettings":return"user";case"projectSettings":return"project";case"localSettings":return"project, gitignored";case"flagSettings":return"cli flag";case"policySettings":return"managed"}}function ktH(H){switch(H){case"userSettings":return"User";case"projectSettings":return"Project";case"localSettings":return"Local";case"flagSettings":return"Flag";case"policySettings":return"Managed";case"plugin":return"Plugin";case"built-in":return"Built-in"}}function utH(H){switch(H){case"userSettings":return"user settings";case"projectSettings":return"shared project settings";case"localSettings":return"project local settings";case"flagSettings":return"command line arguments";case"policySettings":return"enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"command configuration";case"session":return"current session"}}function rDL(H){switch(H){case"userSettings":return"User settings";case"projectSettings":return"Shared project settings";case"localSettings":return"Project local settings";case"flagSettings":return"Command line arguments";case"policySettings":return"Enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"Command configuration";case"session":return"Current session"}}function aDL(H){if(H==="")return[];let $=H.split(",").map((L)=>L.trim()),A=[];for(let L of $)switch(L){case"user":A.push("userSettings");break;case"project":A.push("projectSettings");break;case"local":A.push("localSettings");break;default:throw Error(`Invalid setting source: ${L}. Valid options are: user, project, local`)}return A}function Pl(){let H=Gj$(),$=new Set(H);return $.add("policySettings"),$.add("flagSettings"),Array.from($)}function HF(H){return Pl().includes(H)}var j_,oDL="https://json.schemastore.org/claude-code-settings.json";var W4=K(()=>{g$();j_=["userSettings","projectSettings","localSettings","flagSettings","policySettings"]});function LA(H,$,A){function L(f,E){var M;Object.defineProperty(f,"_zod",{value:f._zod??{},enumerable:!1}),(M=f._zod).traits??(M.traits=new Set),f._zod.traits.add(H),$(f,E);for(let G in B.prototype)if(!(G in f))Object.defineProperty(f,G,{value:B.prototype[G].bind(f)});f._zod.constr=B,f._zod.def=E}let I=A?.Parent??Object;class D extends I{}Object.defineProperty(D,"name",{value:H});function B(f){var E;let M=A?.Parent?new D:this;L(M,f),(E=M._zod).deferred??(E.deferred=[]);for(let G of M._zod.deferred)G();return M}return Object.defineProperty(B,"init",{value:L}),Object.defineProperty(B,Symbol.hasInstance,{value:(f)=>{if(A?.Parent&&f instanceof A.Parent)return!0;return f?._zod?.traits?.has(H)}}),Object.defineProperty(B,"name",{value:H}),B}function $F(H){if(H)Object.assign(W2H,H);return W2H}var V2H,vk$,Nk,W2H;var HGH=K(()=>{V2H=Object.freeze({status:"aborted"});vk$=Symbol("zod_brand");Nk=class Nk extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};W2H={}});var OI={};XA(OI,{unwrapMessage:()=>P2H,stringifyPrimitive:()=>RI,required:()=>gdB,randomString:()=>SdB,propertyKeyTypes:()=>w2H,promiseAllObject:()=>xdB,primitiveTypes:()=>mk$,prefixIssues:()=>R_,pick:()=>vdB,partial:()=>udB,optionalKeys:()=>pk$,omit:()=>hdB,numKeys:()=>jdB,nullish:()=>_l,normalizeParams:()=>FI,merge:()=>kdB,jsonStringifyReplacer:()=>bk$,joinValues:()=>fL,issue:()=>lk$,isPlainObject:()=>AGH,isObject:()=>$GH,getSizableOrigin:()=>Z2H,getParsedType:()=>RdB,getLengthableOrigin:()=>q2H,getEnumValues:()=>_2H,getElementAtPath:()=>OdB,floatSafeRemainder:()=>kk$,finalizeIssue:()=>E2,extend:()=>bdB,escapeRegex:()=>Ok,esc:()=>P$H,defineLazy:()=>GE,createTransparentProxy:()=>ydB,clone:()=>f2,cleanRegex:()=>C2H,cleanEnum:()=>mdB,captureStackTrace:()=>gtH,cached:()=>Y2H,assignProp:()=>uk$,assertNotEqual:()=>qdB,assertNever:()=>zdB,assertIs:()=>TdB,assertEqual:()=>ZdB,assert:()=>NdB,allowsEval:()=>gk$,aborted:()=>_$H,NUMBER_FORMAT_RANGES:()=>dk$,Class:()=>tDL,BIGINT_FORMAT_RANGES:()=>ck$});function ZdB(H){return H}function qdB(H){return H}function TdB(H){}function zdB(H){throw Error()}function NdB(H){}function _2H(H){let $=Object.values(H).filter((L)=>typeof L==="number");return Object.entries(H).filter(([L,I])=>$.indexOf(+L)===-1).map(([L,I])=>I)}function fL(H,$="|"){return H.map((A)=>RI(A)).join($)}function bk$(H,$){if(typeof $==="bigint")return $.toString();return $}function Y2H(H){return{get value(){{let A=H();return Object.defineProperty(this,"value",{value:A}),A}throw Error("cached value already set")}}}function _l(H){return H===null||H===void 0}function C2H(H){let $=H.startsWith("^")?1:0,A=H.endsWith("$")?H.length-1:H.length;return H.slice($,A)}function kk$(H,$){let A=(H.toString().split(".")[1]||"").length,L=($.toString().split(".")[1]||"").length,I=A>L?A:L,D=Number.parseInt(H.toFixed(I).replace(".","")),B=Number.parseInt($.toFixed(I).replace(".",""));return D%B/10**I}function GE(H,$,A){Object.defineProperty(H,$,{get(){{let I=A();return H[$]=I,I}throw Error("cached value already set")},set(I){Object.defineProperty(H,$,{value:I})},configurable:!0})}function uk$(H,$,A){Object.defineProperty(H,$,{value:A,writable:!0,enumerable:!0,configurable:!0})}function OdB(H,$){if(!$)return H;return $.reduce((A,L)=>A?.[L],H)}function xdB(H){let $=Object.keys(H),A=$.map((L)=>H[L]);return Promise.all(A).then((L)=>{let I={};for(let D=0;D<$.length;D++)I[$[D]]=L[D];return I})}function SdB(H=10){let A="";for(let L=0;L$};if($?.message!==void 0){if($?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");$.error=$.message}if(delete $.message,typeof $.error==="string")return{...$,error:()=>$.error};return $}function ydB(H){let $;return new Proxy({},{get(A,L,I){return $??($=H()),Reflect.get($,L,I)},set(A,L,I,D){return $??($=H()),Reflect.set($,L,I,D)},has(A,L){return $??($=H()),Reflect.has($,L)},deleteProperty(A,L){return $??($=H()),Reflect.deleteProperty($,L)},ownKeys(A){return $??($=H()),Reflect.ownKeys($)},getOwnPropertyDescriptor(A,L){return $??($=H()),Reflect.getOwnPropertyDescriptor($,L)},defineProperty(A,L,I){return $??($=H()),Reflect.defineProperty($,L,I)}})}function RI(H){if(typeof H==="bigint")return H.toString()+"n";if(typeof H==="string")return`"${H}"`;return`${H}`}function pk$(H){return Object.keys(H).filter(($)=>{return H[$]._zod.optin==="optional"&&H[$]._zod.optout==="optional"})}function vdB(H,$){let A={},L=H._zod.def;for(let I in $){if(!(I in L.shape))throw Error(`Unrecognized key: "${I}"`);if(!$[I])continue;A[I]=L.shape[I]}return f2(H,{...H._zod.def,shape:A,checks:[]})}function hdB(H,$){let A={...H._zod.def.shape},L=H._zod.def;for(let I in $){if(!(I in L.shape))throw Error(`Unrecognized key: "${I}"`);if(!$[I])continue;delete A[I]}return f2(H,{...H._zod.def,shape:A,checks:[]})}function bdB(H,$){if(!AGH($))throw Error("Invalid input to extend: expected a plain object");let A={...H._zod.def,get shape(){let L={...H._zod.def.shape,...$};return uk$(this,"shape",L),L},checks:[]};return f2(H,A)}function kdB(H,$){return f2(H,{...H._zod.def,get shape(){let A={...H._zod.def.shape,...$._zod.def.shape};return uk$(this,"shape",A),A},catchall:$._zod.def.catchall,checks:[]})}function udB(H,$,A){let L=$._zod.def.shape,I={...L};if(A)for(let D in A){if(!(D in L))throw Error(`Unrecognized key: "${D}"`);if(!A[D])continue;I[D]=H?new H({type:"optional",innerType:L[D]}):L[D]}else for(let D in L)I[D]=H?new H({type:"optional",innerType:L[D]}):L[D];return f2($,{...$._zod.def,shape:I,checks:[]})}function gdB(H,$,A){let L=$._zod.def.shape,I={...L};if(A)for(let D in A){if(!(D in I))throw Error(`Unrecognized key: "${D}"`);if(!A[D])continue;I[D]=new H({type:"nonoptional",innerType:L[D]})}else for(let D in L)I[D]=new H({type:"nonoptional",innerType:L[D]});return f2($,{...$._zod.def,shape:I,checks:[]})}function _$H(H,$=0){for(let A=$;A{var L;return(L=A).path??(L.path=[]),A.path.unshift(H),A})}function P2H(H){return typeof H==="string"?H:H?.message}function E2(H,$,A){let L={...H,path:H.path??[]};if(!H.message){let I=P2H(H.inst?._zod.def?.error?.(H))??P2H($?.error?.(H))??P2H(A.customError?.(H))??P2H(A.localeError?.(H))??"Invalid input";L.message=I}if(delete L.inst,delete L.continue,!$?.reportInput)delete L.input;return L}function Z2H(H){if(H instanceof Set)return"set";if(H instanceof Map)return"map";if(H instanceof File)return"file";return"unknown"}function q2H(H){if(Array.isArray(H))return"array";if(typeof H==="string")return"string";return"unknown"}function lk$(...H){let[$,A,L]=H;if(typeof $==="string")return{message:$,code:"custom",input:A,inst:L};return{...$}}function mdB(H){return Object.entries(H).filter(([$,A])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}class tDL{constructor(...H){}}var gtH,gk$,RdB=(H)=>{let $=typeof H;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(H)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(H))return"array";if(H===null)return"null";if(H.then&&typeof H.then==="function"&&H.catch&&typeof H.catch==="function")return"promise";if(typeof Map<"u"&&H instanceof Map)return"map";if(typeof Set<"u"&&H instanceof Set)return"set";if(typeof Date<"u"&&H instanceof Date)return"date";if(typeof File<"u"&&H instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},w2H,mk$,dk$,ck$;var n0=K(()=>{gtH=Error.captureStackTrace?Error.captureStackTrace:(...H)=>{};gk$=Y2H(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(H){return!1}});w2H=new Set(["string","number","symbol"]),mk$=new Set(["string","number","bigint","boolean","symbol","undefined"]);dk$={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ck$={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function z2H(H,$=(A)=>A.message){let A={},L=[];for(let I of H.issues)if(I.path.length>0)A[I.path[0]]=A[I.path[0]]||[],A[I.path[0]].push($(I));else L.push($(I));return{formErrors:L,fieldErrors:A}}function N2H(H,$){let A=$||function(D){return D.message},L={_errors:[]},I=(D)=>{for(let B of D.issues)if(B.code==="invalid_union"&&B.errors.length)B.errors.map((f)=>I({issues:f}));else if(B.code==="invalid_key")I({issues:B.issues});else if(B.code==="invalid_element")I({issues:B.issues});else if(B.path.length===0)L._errors.push(A(B));else{let f=L,E=0;while(E{var f,E;for(let M of D.issues)if(M.code==="invalid_union"&&M.errors.length)M.errors.map((G)=>I({issues:G},M.path));else if(M.code==="invalid_key")I({issues:M.issues},M.path);else if(M.code==="invalid_element")I({issues:M.issues},M.path);else{let G=[...B,...M.path];if(G.length===0){L.errors.push(A(M));continue}let U=L,X=0;while(XL.path.length-I.path.length);for(let L of A)if($.push(`\u2716 ${L.message}`),L.path?.length)$.push(` \u2192 at ${eDL(L.path)}`);return $.join(` Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(A.cycles==="ref")D(M);continue}if(G.count>1){if(A.reused==="ref"){D(M);continue}}}let B=(M,G)=>{let U=this.seen.get(M),X=U.def??U.schema,J={...X};if(U.ref===null)return;let F=U.ref;if(U.ref=null,F){B(F,G);let Q=this.seen.get(F).schema;if(Q.$ref&&G.target==="draft-7")X.allOf=X.allOf??[],X.allOf.push(Q);else Object.assign(X,Q),Object.assign(X,J)}if(!U.isParent)this.override({zodSchema:M,jsonSchema:X,path:U.path??[]})};for(let M of[...this.seen.entries()].reverse())B(M[0],{target:this.target});let f={};if(this.target==="draft-2020-12")f.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")f.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(f,L.def);let E=A.external?.defs??{};for(let M of this.seen.entries()){let G=M[1];if(G.def&&G.defId)E[G.defId]=G.def}if(!A.external&&Object.keys(E).length>0)if(this.target==="draft-2020-12")f.$defs=E;else f.definitions=E;try{return JSON.parse(JSON.stringify(f))}catch(M){throw Error("Error converting schema to JSON.")}}}function Rk(H,$){if(H instanceof k2H){let L=new TsH($),I={};for(let f of H._idmap.entries()){let[E,M]=f;L.process(M)}let D={},B={registry:H,uri:$?.uri||((f)=>f),defs:I};for(let f of H._idmap.entries()){let[E,M]=f;D[E]=L.emit(M,{...$,external:B})}if(Object.keys(I).length>0){let f=L.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[f]:I}}return{schemas:D}}let A=new TsH($);return A.process(H),A.emit(H,$)}function IK(H,$){let A=$??{seen:new Set};if(A.seen.has(H))return!1;A.seen.add(H);let I=H._zod.def;switch(I.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return IK(I.element,A);case"object":{for(let D in I.shape)if(IK(I.shape[D],A))return!0;return!1}case"union":{for(let D of I.options)if(IK(D,A))return!0;return!1}case"intersection":return IK(I.left,A)||IK(I.right,A);case"tuple":{for(let D of I.items)if(IK(D,A))return!0;if(I.rest&&IK(I.rest,A))return!0;return!1}case"record":return IK(I.keyType,A)||IK(I.valueType,A);case"map":return IK(I.keyType,A)||IK(I.valueType,A);case"set":return IK(I.valueType,A);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return IK(I.innerType,A);case"lazy":return IK(I.getter(),A);case"default":return IK(I.innerType,A);case"prefault":return IK(I.innerType,A);case"custom":return!1;case"transform":return!0;case"pipe":return IK(I.in,A)||IK(I.out,A);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${I.type}`)}var B0L=K(()=>{ym$();n0()});var f0L={};var E0L=()=>{};var ZR={};XA(ZR,{version:()=>pu$,util:()=>OI,treeifyError:()=>ik$,toJSONSchema:()=>Rk,toDotPath:()=>eDL,safeParseAsync:()=>S2H,safeParse:()=>IGH,registry:()=>IsH,regexes:()=>C$H,prettifyError:()=>nk$,parseAsync:()=>x2H,parse:()=>O2H,locales:()=>fGH,isValidJWT:()=>WBL,isValidBase64URL:()=>QBL,isValidBase64:()=>Gg$,globalRegistry:()=>wR,globalConfig:()=>W2H,function:()=>wp$,formatError:()=>N2H,flattenError:()=>z2H,config:()=>$F,clone:()=>f2,_xid:()=>QsH,_void:()=>Bp$,_uuidv7:()=>MsH,_uuidv6:()=>EsH,_uuidv4:()=>fsH,_uuid:()=>BsH,_url:()=>GsH,_uppercase:()=>d2H,_unknown:()=>EGH,_union:()=>mcB,_undefined:()=>Ap$,_ulid:()=>KsH,_uint64:()=>Hp$,_uint32:()=>rm$,_tuple:()=>Kp$,_trim:()=>a2H,_transform:()=>ocB,_toUpperCase:()=>t2H,_toLowerCase:()=>o2H,_templateLiteral:()=>DlB,_symbol:()=>$p$,_success:()=>$lB,_stringbool:()=>Pp$,_stringFormat:()=>_p$,_string:()=>vm$,_startsWith:()=>l2H,_size:()=>g2H,_set:()=>icB,_safeParseAsync:()=>ctH,_safeParse:()=>dtH,_regex:()=>m2H,_refine:()=>Vp$,_record:()=>ccB,_readonly:()=>IlB,_property:()=>Fp$,_promise:()=>flB,_positive:()=>Gp$,_pipe:()=>LlB,_parseAsync:()=>ptH,_parse:()=>mtH,_overwrite:()=>jk,_optional:()=>tcB,_number:()=>pm$,_nullable:()=>scB,_null:()=>Lp$,_normalize:()=>r2H,_nonpositive:()=>Xp$,_nonoptional:()=>HlB,_nonnegative:()=>Jp$,_never:()=>Dp$,_negative:()=>Up$,_nativeEnum:()=>rcB,_nanoid:()=>XsH,_nan:()=>Mp$,_multipleOf:()=>q$H,_minSize:()=>T$H,_minLength:()=>Yl,_min:()=>y_,_mime:()=>n2H,_maxSize:()=>MGH,_maxLength:()=>GGH,_max:()=>aZ,_map:()=>lcB,_lte:()=>aZ,_lt:()=>xk,_lowercase:()=>p2H,_literal:()=>acB,_length:()=>UGH,_lazy:()=>BlB,_ksuid:()=>WsH,_jwt:()=>qsH,_isoTime:()=>gm$,_isoDuration:()=>mm$,_isoDateTime:()=>km$,_isoDate:()=>um$,_ipv6:()=>PsH,_ipv4:()=>VsH,_intersection:()=>dcB,_int64:()=>em$,_int32:()=>nm$,_int:()=>cm$,_includes:()=>c2H,_guid:()=>u2H,_gte:()=>y_,_gt:()=>Sk,_float64:()=>im$,_float32:()=>lm$,_file:()=>Qp$,_enum:()=>ncB,_endsWith:()=>i2H,_emoji:()=>UsH,_email:()=>DsH,_e164:()=>ZsH,_discriminatedUnion:()=>pcB,_default:()=>ecB,_date:()=>fp$,_custom:()=>Wp$,_cuid2:()=>FsH,_cuid:()=>JsH,_coercedString:()=>hm$,_coercedNumber:()=>dm$,_coercedDate:()=>Ep$,_coercedBoolean:()=>om$,_coercedBigint:()=>sm$,_cidrv6:()=>YsH,_cidrv4:()=>_sH,_catch:()=>AlB,_boolean:()=>am$,_bigint:()=>tm$,_base64url:()=>wsH,_base64:()=>CsH,_array:()=>s2H,_any:()=>Ip$,TimePrecision:()=>bm$,NEVER:()=>V2H,JSONSchemaGenerator:()=>TsH,JSONSchema:()=>f0L,Doc:()=>ttH,$output:()=>jm$,$input:()=>Rm$,$constructor:()=>LA,$brand:()=>vk$,$ZodXID:()=>Hg$,$ZodVoid:()=>wg$,$ZodUnknown:()=>BGH,$ZodUnion:()=>AsH,$ZodUndefined:()=>Pg$,$ZodUUID:()=>iu$,$ZodURL:()=>ru$,$ZodULID:()=>eu$,$ZodType:()=>J9,$ZodTuple:()=>Z$H,$ZodTransform:()=>y2H,$ZodTemplateLiteral:()=>dg$,$ZodSymbol:()=>Vg$,$ZodSuccess:()=>ug$,$ZodStringFormat:()=>rM,$ZodString:()=>w$H,$ZodSet:()=>xg$,$ZodRegistry:()=>k2H,$ZodRecord:()=>Ng$,$ZodRealError:()=>LGH,$ZodReadonly:()=>pg$,$ZodPromise:()=>cg$,$ZodPrefault:()=>bg$,$ZodPipe:()=>v2H,$ZodOptional:()=>yg$,$ZodObject:()=>qg$,$ZodNumberFormat:()=>Qg$,$ZodNumber:()=>HsH,$ZodNullable:()=>vg$,$ZodNull:()=>_g$,$ZodNonOptional:()=>kg$,$ZodNever:()=>Cg$,$ZodNanoID:()=>ou$,$ZodNaN:()=>mg$,$ZodMap:()=>Og$,$ZodLiteral:()=>jg$,$ZodLazy:()=>lg$,$ZodKSUID:()=>$g$,$ZodJWT:()=>Fg$,$ZodIntersection:()=>zg$,$ZodISOTime:()=>Ig$,$ZodISODuration:()=>Dg$,$ZodISODateTime:()=>Ag$,$ZodISODate:()=>Lg$,$ZodIPv6:()=>fg$,$ZodIPv4:()=>Bg$,$ZodGUID:()=>lu$,$ZodFunction:()=>Cp$,$ZodFile:()=>Rg$,$ZodError:()=>T2H,$ZodEnum:()=>Sg$,$ZodEmoji:()=>au$,$ZodEmail:()=>nu$,$ZodE164:()=>Jg$,$ZodDiscriminatedUnion:()=>Tg$,$ZodDefault:()=>hg$,$ZodDate:()=>Zg$,$ZodCustomStringFormat:()=>Kg$,$ZodCustom:()=>ig$,$ZodCheckUpperCase:()=>vu$,$ZodCheckStringFormat:()=>DGH,$ZodCheckStartsWith:()=>bu$,$ZodCheckSizeEquals:()=>Ou$,$ZodCheckRegex:()=>Ru$,$ZodCheckProperty:()=>uu$,$ZodCheckOverwrite:()=>mu$,$ZodCheckNumberFormat:()=>qu$,$ZodCheckMultipleOf:()=>Zu$,$ZodCheckMinSize:()=>Nu$,$ZodCheckMinLength:()=>Su$,$ZodCheckMimeType:()=>gu$,$ZodCheckMaxSize:()=>zu$,$ZodCheckMaxLength:()=>xu$,$ZodCheckLowerCase:()=>yu$,$ZodCheckLessThan:()=>rtH,$ZodCheckLengthEquals:()=>ju$,$ZodCheckIncludes:()=>hu$,$ZodCheckGreaterThan:()=>atH,$ZodCheckEndsWith:()=>ku$,$ZodCheckBigIntFormat:()=>Tu$,$ZodCheck:()=>X5,$ZodCatch:()=>gg$,$ZodCUID2:()=>su$,$ZodCUID:()=>tu$,$ZodCIDRv6:()=>Mg$,$ZodCIDRv4:()=>Eg$,$ZodBoolean:()=>j2H,$ZodBigIntFormat:()=>Wg$,$ZodBigInt:()=>$sH,$ZodBase64URL:()=>Xg$,$ZodBase64:()=>Ug$,$ZodAsyncError:()=>Nk,$ZodArray:()=>R2H,$ZodAny:()=>Yg$});var VV=K(()=>{n0();ntH();LsH();E0L();HGH();ltH();rk$();h2H();otH();du$();ym$();D0L();Yp$();B0L()});var Zp$=K(()=>{VV()});var XGH={};XA(XGH,{time:()=>zp$,duration:()=>Np$,datetime:()=>qp$,date:()=>Tp$,ZodISOTime:()=>OsH,ZodISODuration:()=>xsH,ZodISODateTime:()=>zsH,ZodISODate:()=>NsH});function qp$(H){return km$(zsH,H)}function Tp$(H){return um$(NsH,H)}function zp$(H){return gm$(OsH,H)}function Np$(H){return mm$(xsH,H)}var zsH,NsH,OsH,xsH;var SsH=K(()=>{VV();jsH();zsH=LA("ZodISODateTime",(H,$)=>{Ag$.init(H,$),iG.init(H,$)});NsH=LA("ZodISODate",(H,$)=>{Lg$.init(H,$),iG.init(H,$)});OsH=LA("ZodISOTime",(H,$)=>{Ig$.init(H,$),iG.init(H,$)});xsH=LA("ZodISODuration",(H,$)=>{Dg$.init(H,$),iG.init(H,$)})});var G0L=(H,$)=>{T2H.init(H,$),H.name="ZodError",Object.defineProperties(H,{format:{value:(A)=>N2H(H,A)},flatten:{value:(A)=>z2H(H,A)},addIssue:{value:(A)=>H.issues.push(A)},addIssues:{value:(A)=>H.issues.push(...A)},isEmpty:{get(){return H.issues.length===0}}})},MlB,JGH;var Op$=K(()=>{VV();VV();MlB=LA("ZodError",G0L),JGH=LA("ZodError",G0L,{Parent:Error})});var xp$,Sp$,jp$,Rp$;var yp$=K(()=>{VV();Op$();xp$=mtH(JGH),Sp$=ptH(JGH),jp$=dtH(JGH),Rp$=ctH(JGH)});function N$(H){return vm$(HwH,H)}function UlB(H){return DsH(bp$,H)}function XlB(H){return u2H(RsH,H)}function JlB(H){return BsH(yk,H)}function FlB(H){return fsH(yk,H)}function KlB(H){return EsH(yk,H)}function QlB(H){return MsH(yk,H)}function up$(H){return GsH(kp$,H)}function WlB(H){return UsH(gp$,H)}function VlB(H){return XsH(mp$,H)}function PlB(H){return JsH(pp$,H)}function _lB(H){return FsH(dp$,H)}function YlB(H){return KsH(cp$,H)}function ClB(H){return QsH(lp$,H)}function wlB(H){return WsH(ip$,H)}function ZlB(H){return VsH(np$,H)}function qlB(H){return PsH(rp$,H)}function TlB(H){return _sH(ap$,H)}function zlB(H){return YsH(op$,H)}function NlB(H){return CsH(tp$,H)}function OlB(H){return wsH(sp$,H)}function xlB(H){return ZsH(ep$,H)}function SlB(H){return qsH(Hd$,H)}function jlB(H,$,A={}){return _p$(U0L,H,$,A)}function df(H){return pm$($wH,H)}function vp$(H){return cm$(FGH,H)}function RlB(H){return lm$(FGH,H)}function ylB(H){return im$(FGH,H)}function vlB(H){return nm$(FGH,H)}function hlB(H){return rm$(FGH,H)}function qM(H){return am$(AwH,H)}function blB(H){return tm$(LwH,H)}function klB(H){return em$($d$,H)}function ulB(H){return Hp$($d$,H)}function glB(H){return $p$(X0L,H)}function mlB(H){return Ap$(J0L,H)}function IwH(H){return Lp$(F0L,H)}function Ad$(){return Ip$(K0L)}function eX(){return EGH(Q0L)}function hsH(H){return Dp$(W0L,H)}function plB(H){return Bp$(V0L,H)}function dlB(H){return fp$(bsH,H)}function xI(H,$){return s2H(P0L,H,$)}function clB(H){let $=H._zod.def.shape;return sD(Object.keys($))}function LI(H,$){let A={type:"object",get shape(){return OI.assignProp(this,"shape",{...H}),this.shape},...OI.normalizeParams($)};return new ksH(A)}function llB(H,$){return new ksH({type:"object",get shape(){return OI.assignProp(this,"shape",{...H}),this.shape},catchall:hsH(),...OI.normalizeParams($)})}function RW(H,$){return new ksH({type:"object",get shape(){return OI.assignProp(this,"shape",{...H}),this.shape},catchall:eX(),...OI.normalizeParams($)})}function TM(H,$){return new Ld$({type:"union",options:H,...OI.normalizeParams($)})}function usH(H,$,A){return new _0L({type:"union",options:$,discriminator:H,...OI.normalizeParams(A)})}function DwH(H,$){return new Y0L({type:"intersection",left:H,right:$})}function ilB(H,$,A){let L=$ instanceof J9,I=L?A:$;return new C0L({type:"tuple",items:H,rest:L?$:null,...OI.normalizeParams(I)})}function MX(H,$,A){return new Id$({type:"record",keyType:H,valueType:$,...OI.normalizeParams(A)})}function nlB(H,$,A){return new Id$({type:"record",keyType:TM([H,hsH()]),valueType:$,...OI.normalizeParams(A)})}function rlB(H,$,A){return new w0L({type:"map",keyType:H,valueType:$,...OI.normalizeParams(A)})}function alB(H,$){return new Z0L({type:"set",valueType:H,...OI.normalizeParams($)})}function GQ(H,$){let A=Array.isArray(H)?Object.fromEntries(H.map((L)=>[L,L])):H;return new e2H({type:"enum",entries:A,...OI.normalizeParams($)})}function olB(H,$){return new e2H({type:"enum",entries:H,...OI.normalizeParams($)})}function sD(H,$){return new q0L({type:"literal",values:Array.isArray(H)?H:[H],...OI.normalizeParams($)})}function tlB(H){return Qp$(T0L,H)}function Bd$(H){return new Dd$({type:"transform",transform:H})}function MB(H){return new fd$({type:"optional",innerType:H})}function ysH(H){return new z0L({type:"nullable",innerType:H})}function slB(H){return MB(ysH(H))}function O0L(H,$){return new N0L({type:"default",innerType:H,get defaultValue(){return typeof $==="function"?$():$}})}function S0L(H,$){return new x0L({type:"prefault",innerType:H,get defaultValue(){return typeof $==="function"?$():$}})}function j0L(H,$){return new Ed$({type:"nonoptional",innerType:H,...OI.normalizeParams($)})}function elB(H){return new R0L({type:"success",innerType:H})}function v0L(H,$){return new y0L({type:"catch",innerType:H,catchValue:typeof $==="function"?$:()=>$})}function HiB(H){return Mp$(h0L,H)}function vsH(H,$){return new Md$({type:"pipe",in:H,out:$})}function k0L(H){return new b0L({type:"readonly",innerType:H})}function $iB(H,$){return new u0L({type:"template_literal",parts:H,...OI.normalizeParams($)})}function m0L(H){return new g0L({type:"lazy",getter:H})}function AiB(H){return new p0L({type:"promise",innerType:H})}function d0L(H,$){let A=new X5({check:"custom",...OI.normalizeParams($)});return A._zod.check=H,A}function Gd$(H,$){return Wp$(gsH,H??(()=>!0),$)}function c0L(H,$={}){return Vp$(gsH,H,$)}function l0L(H,$){let A=d0L((L)=>{return L.addIssue=(I)=>{if(typeof I==="string")L.issues.push(OI.issue(I,L.value,A._zod.def));else{let D=I;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=L.value),D.inst??(D.inst=A),D.continue??(D.continue=!A._zod.def.abort),L.issues.push(OI.issue(D))}},H(L.value,L)},$);return A}function LiB(H,$={error:`Input not instance of ${H.name}`}){let A=new gsH({type:"custom",check:"custom",fn:(L)=>L instanceof H,abort:!0,...OI.normalizeParams($)});return A._zod.bag.Class=H,A}function DiB(H){let $=m0L(()=>{return TM([N$(H),df(),qM(),IwH(),xI($),MX(N$(),$)])});return $}function msH(H,$){return vsH(Bd$(H),$)}var s1,hp$,HwH,iG,bp$,RsH,yk,kp$,gp$,mp$,pp$,dp$,cp$,lp$,ip$,np$,rp$,ap$,op$,tp$,sp$,ep$,Hd$,U0L,$wH,FGH,AwH,LwH,$d$,X0L,J0L,F0L,K0L,Q0L,W0L,V0L,bsH,P0L,ksH,Ld$,_0L,Y0L,C0L,Id$,w0L,Z0L,e2H,q0L,T0L,Dd$,fd$,z0L,N0L,x0L,Ed$,R0L,y0L,h0L,Md$,b0L,u0L,g0L,p0L,gsH,IiB=(...H)=>Pp$({Pipe:Md$,Boolean:AwH,String:HwH,Transform:Dd$},...H);var jsH=K(()=>{VV();VV();Zp$();SsH();yp$();s1=LA("ZodType",(H,$)=>{return J9.init(H,$),H.def=$,Object.defineProperty(H,"_def",{value:$}),H.check=(...A)=>{return H.clone({...$,checks:[...$.checks??[],...A.map((L)=>typeof L==="function"?{_zod:{check:L,def:{check:"custom"},onattach:[]}}:L)]})},H.clone=(A,L)=>f2(H,A,L),H.brand=()=>H,H.register=(A,L)=>{return A.add(H,L),H},H.parse=(A,L)=>xp$(H,A,L,{callee:H.parse}),H.safeParse=(A,L)=>jp$(H,A,L),H.parseAsync=async(A,L)=>Sp$(H,A,L,{callee:H.parseAsync}),H.safeParseAsync=async(A,L)=>Rp$(H,A,L),H.spa=H.safeParseAsync,H.refine=(A,L)=>H.check(c0L(A,L)),H.superRefine=(A)=>H.check(l0L(A)),H.overwrite=(A)=>H.check(jk(A)),H.optional=()=>MB(H),H.nullable=()=>ysH(H),H.nullish=()=>MB(ysH(H)),H.nonoptional=(A)=>j0L(H,A),H.array=()=>xI(H),H.or=(A)=>TM([H,A]),H.and=(A)=>DwH(H,A),H.transform=(A)=>vsH(H,Bd$(A)),H.default=(A)=>O0L(H,A),H.prefault=(A)=>S0L(H,A),H.catch=(A)=>v0L(H,A),H.pipe=(A)=>vsH(H,A),H.readonly=()=>k0L(H),H.describe=(A)=>{let L=H.clone();return wR.add(L,{description:A}),L},Object.defineProperty(H,"description",{get(){return wR.get(H)?.description},configurable:!0}),H.meta=(...A)=>{if(A.length===0)return wR.get(H);let L=H.clone();return wR.add(L,A[0]),L},H.isOptional=()=>H.safeParse(void 0).success,H.isNullable=()=>H.safeParse(null).success,H}),hp$=LA("_ZodString",(H,$)=>{w$H.init(H,$),s1.init(H,$);let A=H._zod.bag;H.format=A.format??null,H.minLength=A.minimum??null,H.maxLength=A.maximum??null,H.regex=(...L)=>H.check(m2H(...L)),H.includes=(...L)=>H.check(c2H(...L)),H.startsWith=(...L)=>H.check(l2H(...L)),H.endsWith=(...L)=>H.check(i2H(...L)),H.min=(...L)=>H.check(Yl(...L)),H.max=(...L)=>H.check(GGH(...L)),H.length=(...L)=>H.check(UGH(...L)),H.nonempty=(...L)=>H.check(Yl(1,...L)),H.lowercase=(L)=>H.check(p2H(L)),H.uppercase=(L)=>H.check(d2H(L)),H.trim=()=>H.check(a2H()),H.normalize=(...L)=>H.check(r2H(...L)),H.toLowerCase=()=>H.check(o2H()),H.toUpperCase=()=>H.check(t2H())}),HwH=LA("ZodString",(H,$)=>{w$H.init(H,$),hp$.init(H,$),H.email=(A)=>H.check(DsH(bp$,A)),H.url=(A)=>H.check(GsH(kp$,A)),H.jwt=(A)=>H.check(qsH(Hd$,A)),H.emoji=(A)=>H.check(UsH(gp$,A)),H.guid=(A)=>H.check(u2H(RsH,A)),H.uuid=(A)=>H.check(BsH(yk,A)),H.uuidv4=(A)=>H.check(fsH(yk,A)),H.uuidv6=(A)=>H.check(EsH(yk,A)),H.uuidv7=(A)=>H.check(MsH(yk,A)),H.nanoid=(A)=>H.check(XsH(mp$,A)),H.guid=(A)=>H.check(u2H(RsH,A)),H.cuid=(A)=>H.check(JsH(pp$,A)),H.cuid2=(A)=>H.check(FsH(dp$,A)),H.ulid=(A)=>H.check(KsH(cp$,A)),H.base64=(A)=>H.check(CsH(tp$,A)),H.base64url=(A)=>H.check(wsH(sp$,A)),H.xid=(A)=>H.check(QsH(lp$,A)),H.ksuid=(A)=>H.check(WsH(ip$,A)),H.ipv4=(A)=>H.check(VsH(np$,A)),H.ipv6=(A)=>H.check(PsH(rp$,A)),H.cidrv4=(A)=>H.check(_sH(ap$,A)),H.cidrv6=(A)=>H.check(YsH(op$,A)),H.e164=(A)=>H.check(ZsH(ep$,A)),H.datetime=(A)=>H.check(qp$(A)),H.date=(A)=>H.check(Tp$(A)),H.time=(A)=>H.check(zp$(A)),H.duration=(A)=>H.check(Np$(A))});iG=LA("ZodStringFormat",(H,$)=>{rM.init(H,$),hp$.init(H,$)}),bp$=LA("ZodEmail",(H,$)=>{nu$.init(H,$),iG.init(H,$)});RsH=LA("ZodGUID",(H,$)=>{lu$.init(H,$),iG.init(H,$)});yk=LA("ZodUUID",(H,$)=>{iu$.init(H,$),iG.init(H,$)});kp$=LA("ZodURL",(H,$)=>{ru$.init(H,$),iG.init(H,$)});gp$=LA("ZodEmoji",(H,$)=>{au$.init(H,$),iG.init(H,$)});mp$=LA("ZodNanoID",(H,$)=>{ou$.init(H,$),iG.init(H,$)});pp$=LA("ZodCUID",(H,$)=>{tu$.init(H,$),iG.init(H,$)});dp$=LA("ZodCUID2",(H,$)=>{su$.init(H,$),iG.init(H,$)});cp$=LA("ZodULID",(H,$)=>{eu$.init(H,$),iG.init(H,$)});lp$=LA("ZodXID",(H,$)=>{Hg$.init(H,$),iG.init(H,$)});ip$=LA("ZodKSUID",(H,$)=>{$g$.init(H,$),iG.init(H,$)});np$=LA("ZodIPv4",(H,$)=>{Bg$.init(H,$),iG.init(H,$)});rp$=LA("ZodIPv6",(H,$)=>{fg$.init(H,$),iG.init(H,$)});ap$=LA("ZodCIDRv4",(H,$)=>{Eg$.init(H,$),iG.init(H,$)});op$=LA("ZodCIDRv6",(H,$)=>{Mg$.init(H,$),iG.init(H,$)});tp$=LA("ZodBase64",(H,$)=>{Ug$.init(H,$),iG.init(H,$)});sp$=LA("ZodBase64URL",(H,$)=>{Xg$.init(H,$),iG.init(H,$)});ep$=LA("ZodE164",(H,$)=>{Jg$.init(H,$),iG.init(H,$)});Hd$=LA("ZodJWT",(H,$)=>{Fg$.init(H,$),iG.init(H,$)});U0L=LA("ZodCustomStringFormat",(H,$)=>{Kg$.init(H,$),iG.init(H,$)});$wH=LA("ZodNumber",(H,$)=>{HsH.init(H,$),s1.init(H,$),H.gt=(L,I)=>H.check(Sk(L,I)),H.gte=(L,I)=>H.check(y_(L,I)),H.min=(L,I)=>H.check(y_(L,I)),H.lt=(L,I)=>H.check(xk(L,I)),H.lte=(L,I)=>H.check(aZ(L,I)),H.max=(L,I)=>H.check(aZ(L,I)),H.int=(L)=>H.check(vp$(L)),H.safe=(L)=>H.check(vp$(L)),H.positive=(L)=>H.check(Sk(0,L)),H.nonnegative=(L)=>H.check(y_(0,L)),H.negative=(L)=>H.check(xk(0,L)),H.nonpositive=(L)=>H.check(aZ(0,L)),H.multipleOf=(L,I)=>H.check(q$H(L,I)),H.step=(L,I)=>H.check(q$H(L,I)),H.finite=()=>H;let A=H._zod.bag;H.minValue=Math.max(A.minimum??Number.NEGATIVE_INFINITY,A.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,H.maxValue=Math.min(A.maximum??Number.POSITIVE_INFINITY,A.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,H.isInt=(A.format??"").includes("int")||Number.isSafeInteger(A.multipleOf??0.5),H.isFinite=!0,H.format=A.format??null});FGH=LA("ZodNumberFormat",(H,$)=>{Qg$.init(H,$),$wH.init(H,$)});AwH=LA("ZodBoolean",(H,$)=>{j2H.init(H,$),s1.init(H,$)});LwH=LA("ZodBigInt",(H,$)=>{$sH.init(H,$),s1.init(H,$),H.gte=(L,I)=>H.check(y_(L,I)),H.min=(L,I)=>H.check(y_(L,I)),H.gt=(L,I)=>H.check(Sk(L,I)),H.gte=(L,I)=>H.check(y_(L,I)),H.min=(L,I)=>H.check(y_(L,I)),H.lt=(L,I)=>H.check(xk(L,I)),H.lte=(L,I)=>H.check(aZ(L,I)),H.max=(L,I)=>H.check(aZ(L,I)),H.positive=(L)=>H.check(Sk(BigInt(0),L)),H.negative=(L)=>H.check(xk(BigInt(0),L)),H.nonpositive=(L)=>H.check(aZ(BigInt(0),L)),H.nonnegative=(L)=>H.check(y_(BigInt(0),L)),H.multipleOf=(L,I)=>H.check(q$H(L,I));let A=H._zod.bag;H.minValue=A.minimum??null,H.maxValue=A.maximum??null,H.format=A.format??null});$d$=LA("ZodBigIntFormat",(H,$)=>{Wg$.init(H,$),LwH.init(H,$)});X0L=LA("ZodSymbol",(H,$)=>{Vg$.init(H,$),s1.init(H,$)});J0L=LA("ZodUndefined",(H,$)=>{Pg$.init(H,$),s1.init(H,$)});F0L=LA("ZodNull",(H,$)=>{_g$.init(H,$),s1.init(H,$)});K0L=LA("ZodAny",(H,$)=>{Yg$.init(H,$),s1.init(H,$)});Q0L=LA("ZodUnknown",(H,$)=>{BGH.init(H,$),s1.init(H,$)});W0L=LA("ZodNever",(H,$)=>{Cg$.init(H,$),s1.init(H,$)});V0L=LA("ZodVoid",(H,$)=>{wg$.init(H,$),s1.init(H,$)});bsH=LA("ZodDate",(H,$)=>{Zg$.init(H,$),s1.init(H,$),H.min=(L,I)=>H.check(y_(L,I)),H.max=(L,I)=>H.check(aZ(L,I));let A=H._zod.bag;H.minDate=A.minimum?new Date(A.minimum):null,H.maxDate=A.maximum?new Date(A.maximum):null});P0L=LA("ZodArray",(H,$)=>{R2H.init(H,$),s1.init(H,$),H.element=$.element,H.min=(A,L)=>H.check(Yl(A,L)),H.nonempty=(A)=>H.check(Yl(1,A)),H.max=(A,L)=>H.check(GGH(A,L)),H.length=(A,L)=>H.check(UGH(A,L)),H.unwrap=()=>H.element});ksH=LA("ZodObject",(H,$)=>{qg$.init(H,$),s1.init(H,$),OI.defineLazy(H,"shape",()=>$.shape),H.keyof=()=>GQ(Object.keys(H._zod.def.shape)),H.catchall=(A)=>H.clone({...H._zod.def,catchall:A}),H.passthrough=()=>H.clone({...H._zod.def,catchall:eX()}),H.loose=()=>H.clone({...H._zod.def,catchall:eX()}),H.strict=()=>H.clone({...H._zod.def,catchall:hsH()}),H.strip=()=>H.clone({...H._zod.def,catchall:void 0}),H.extend=(A)=>{return OI.extend(H,A)},H.merge=(A)=>OI.merge(H,A),H.pick=(A)=>OI.pick(H,A),H.omit=(A)=>OI.omit(H,A),H.partial=(...A)=>OI.partial(fd$,H,A[0]),H.required=(...A)=>OI.required(Ed$,H,A[0])});Ld$=LA("ZodUnion",(H,$)=>{AsH.init(H,$),s1.init(H,$),H.options=$.options});_0L=LA("ZodDiscriminatedUnion",(H,$)=>{Ld$.init(H,$),Tg$.init(H,$)});Y0L=LA("ZodIntersection",(H,$)=>{zg$.init(H,$),s1.init(H,$)});C0L=LA("ZodTuple",(H,$)=>{Z$H.init(H,$),s1.init(H,$),H.rest=(A)=>H.clone({...H._zod.def,rest:A})});Id$=LA("ZodRecord",(H,$)=>{Ng$.init(H,$),s1.init(H,$),H.keyType=$.keyType,H.valueType=$.valueType});w0L=LA("ZodMap",(H,$)=>{Og$.init(H,$),s1.init(H,$),H.keyType=$.keyType,H.valueType=$.valueType});Z0L=LA("ZodSet",(H,$)=>{xg$.init(H,$),s1.init(H,$),H.min=(...A)=>H.check(T$H(...A)),H.nonempty=(A)=>H.check(T$H(1,A)),H.max=(...A)=>H.check(MGH(...A)),H.size=(...A)=>H.check(g2H(...A))});e2H=LA("ZodEnum",(H,$)=>{Sg$.init(H,$),s1.init(H,$),H.enum=$.entries,H.options=Object.values($.entries);let A=new Set(Object.keys($.entries));H.extract=(L,I)=>{let D={};for(let B of L)if(A.has(B))D[B]=$.entries[B];else throw Error(`Key ${B} not found in enum`);return new e2H({...$,checks:[],...OI.normalizeParams(I),entries:D})},H.exclude=(L,I)=>{let D={...$.entries};for(let B of L)if(A.has(B))delete D[B];else throw Error(`Key ${B} not found in enum`);return new e2H({...$,checks:[],...OI.normalizeParams(I),entries:D})}});q0L=LA("ZodLiteral",(H,$)=>{jg$.init(H,$),s1.init(H,$),H.values=new Set($.values),Object.defineProperty(H,"value",{get(){if($.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return $.values[0]}})});T0L=LA("ZodFile",(H,$)=>{Rg$.init(H,$),s1.init(H,$),H.min=(A,L)=>H.check(T$H(A,L)),H.max=(A,L)=>H.check(MGH(A,L)),H.mime=(A,L)=>H.check(n2H(Array.isArray(A)?A:[A],L))});Dd$=LA("ZodTransform",(H,$)=>{y2H.init(H,$),s1.init(H,$),H._zod.parse=(A,L)=>{A.addIssue=(D)=>{if(typeof D==="string")A.issues.push(OI.issue(D,A.value,$));else{let B=D;if(B.fatal)B.continue=!1;B.code??(B.code="custom"),B.input??(B.input=A.value),B.inst??(B.inst=H),B.continue??(B.continue=!0),A.issues.push(OI.issue(B))}};let I=$.transform(A.value,A);if(I instanceof Promise)return I.then((D)=>{return A.value=D,A});return A.value=I,A}});fd$=LA("ZodOptional",(H,$)=>{yg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});z0L=LA("ZodNullable",(H,$)=>{vg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});N0L=LA("ZodDefault",(H,$)=>{hg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType,H.removeDefault=H.unwrap});x0L=LA("ZodPrefault",(H,$)=>{bg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});Ed$=LA("ZodNonOptional",(H,$)=>{kg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});R0L=LA("ZodSuccess",(H,$)=>{ug$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});y0L=LA("ZodCatch",(H,$)=>{gg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType,H.removeCatch=H.unwrap});h0L=LA("ZodNaN",(H,$)=>{mg$.init(H,$),s1.init(H,$)});Md$=LA("ZodPipe",(H,$)=>{v2H.init(H,$),s1.init(H,$),H.in=$.in,H.out=$.out});b0L=LA("ZodReadonly",(H,$)=>{pg$.init(H,$),s1.init(H,$)});u0L=LA("ZodTemplateLiteral",(H,$)=>{dg$.init(H,$),s1.init(H,$)});g0L=LA("ZodLazy",(H,$)=>{lg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.getter()});p0L=LA("ZodPromise",(H,$)=>{cg$.init(H,$),s1.init(H,$),H.unwrap=()=>H._zod.def.innerType});gsH=LA("ZodCustom",(H,$)=>{ig$.init(H,$),s1.init(H,$)})});function BiB(H){$F({customError:H})}function fiB(){return $F().customError}var Ud$;var i0L=K(()=>{VV();Ud$={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var BwH={};XA(BwH,{string:()=>EiB,number:()=>MiB,date:()=>XiB,boolean:()=>GiB,bigint:()=>UiB});function EiB(H){return hm$(HwH,H)}function MiB(H){return dm$($wH,H)}function GiB(H){return om$(AwH,H)}function UiB(H){return sm$(LwH,H)}function XiB(H){return Ep$(bsH,H)}var n0L=K(()=>{VV();jsH()});var S={};XA(S,{xid:()=>ClB,void:()=>plB,uuidv7:()=>QlB,uuidv6:()=>KlB,uuidv4:()=>FlB,uuid:()=>JlB,url:()=>up$,uppercase:()=>d2H,unknown:()=>eX,union:()=>TM,undefined:()=>mlB,ulid:()=>YlB,uint64:()=>ulB,uint32:()=>hlB,tuple:()=>ilB,trim:()=>a2H,treeifyError:()=>ik$,transform:()=>Bd$,toUpperCase:()=>t2H,toLowerCase:()=>o2H,toJSONSchema:()=>Rk,templateLiteral:()=>$iB,symbol:()=>glB,superRefine:()=>l0L,success:()=>elB,stringbool:()=>IiB,stringFormat:()=>jlB,string:()=>N$,strictObject:()=>llB,startsWith:()=>l2H,size:()=>g2H,setErrorMap:()=>BiB,set:()=>alB,safeParseAsync:()=>Rp$,safeParse:()=>jp$,registry:()=>IsH,regexes:()=>C$H,regex:()=>m2H,refine:()=>c0L,record:()=>MX,readonly:()=>k0L,property:()=>Fp$,promise:()=>AiB,prettifyError:()=>nk$,preprocess:()=>msH,prefault:()=>S0L,positive:()=>Gp$,pipe:()=>vsH,partialRecord:()=>nlB,parseAsync:()=>Sp$,parse:()=>xp$,overwrite:()=>jk,optional:()=>MB,object:()=>LI,number:()=>df,nullish:()=>slB,nullable:()=>ysH,null:()=>IwH,normalize:()=>r2H,nonpositive:()=>Xp$,nonoptional:()=>j0L,nonnegative:()=>Jp$,never:()=>hsH,negative:()=>Up$,nativeEnum:()=>olB,nanoid:()=>VlB,nan:()=>HiB,multipleOf:()=>q$H,minSize:()=>T$H,minLength:()=>Yl,mime:()=>n2H,maxSize:()=>MGH,maxLength:()=>GGH,map:()=>rlB,lte:()=>aZ,lt:()=>xk,lowercase:()=>p2H,looseObject:()=>RW,locales:()=>fGH,literal:()=>sD,length:()=>UGH,lazy:()=>m0L,ksuid:()=>wlB,keyof:()=>clB,jwt:()=>SlB,json:()=>DiB,iso:()=>XGH,ipv6:()=>qlB,ipv4:()=>ZlB,intersection:()=>DwH,int64:()=>klB,int32:()=>vlB,int:()=>vp$,instanceof:()=>LiB,includes:()=>c2H,guid:()=>XlB,gte:()=>y_,gt:()=>Sk,globalRegistry:()=>wR,getErrorMap:()=>fiB,function:()=>wp$,formatError:()=>N2H,float64:()=>ylB,float32:()=>RlB,flattenError:()=>z2H,file:()=>tlB,enum:()=>GQ,endsWith:()=>i2H,emoji:()=>WlB,email:()=>UlB,e164:()=>xlB,discriminatedUnion:()=>usH,date:()=>dlB,custom:()=>Gd$,cuid2:()=>_lB,cuid:()=>PlB,core:()=>ZR,config:()=>$F,coerce:()=>BwH,clone:()=>f2,cidrv6:()=>zlB,cidrv4:()=>TlB,check:()=>d0L,catch:()=>v0L,boolean:()=>qM,bigint:()=>blB,base64url:()=>OlB,base64:()=>NlB,array:()=>xI,any:()=>Ad$,_default:()=>O0L,_ZodString:()=>hp$,ZodXID:()=>lp$,ZodVoid:()=>V0L,ZodUnknown:()=>Q0L,ZodUnion:()=>Ld$,ZodUndefined:()=>J0L,ZodUUID:()=>yk,ZodURL:()=>kp$,ZodULID:()=>cp$,ZodType:()=>s1,ZodTuple:()=>C0L,ZodTransform:()=>Dd$,ZodTemplateLiteral:()=>u0L,ZodSymbol:()=>X0L,ZodSuccess:()=>R0L,ZodStringFormat:()=>iG,ZodString:()=>HwH,ZodSet:()=>Z0L,ZodRecord:()=>Id$,ZodRealError:()=>JGH,ZodReadonly:()=>b0L,ZodPromise:()=>p0L,ZodPrefault:()=>x0L,ZodPipe:()=>Md$,ZodOptional:()=>fd$,ZodObject:()=>ksH,ZodNumberFormat:()=>FGH,ZodNumber:()=>$wH,ZodNullable:()=>z0L,ZodNull:()=>F0L,ZodNonOptional:()=>Ed$,ZodNever:()=>W0L,ZodNanoID:()=>mp$,ZodNaN:()=>h0L,ZodMap:()=>w0L,ZodLiteral:()=>q0L,ZodLazy:()=>g0L,ZodKSUID:()=>ip$,ZodJWT:()=>Hd$,ZodIssueCode:()=>Ud$,ZodIntersection:()=>Y0L,ZodISOTime:()=>OsH,ZodISODuration:()=>xsH,ZodISODateTime:()=>zsH,ZodISODate:()=>NsH,ZodIPv6:()=>rp$,ZodIPv4:()=>np$,ZodGUID:()=>RsH,ZodFile:()=>T0L,ZodError:()=>MlB,ZodEnum:()=>e2H,ZodEmoji:()=>gp$,ZodEmail:()=>bp$,ZodE164:()=>ep$,ZodDiscriminatedUnion:()=>_0L,ZodDefault:()=>N0L,ZodDate:()=>bsH,ZodCustomStringFormat:()=>U0L,ZodCustom:()=>gsH,ZodCatch:()=>y0L,ZodCUID2:()=>dp$,ZodCUID:()=>pp$,ZodCIDRv6:()=>op$,ZodCIDRv4:()=>ap$,ZodBoolean:()=>AwH,ZodBigIntFormat:()=>$d$,ZodBigInt:()=>LwH,ZodBase64URL:()=>sp$,ZodBase64:()=>tp$,ZodArray:()=>P0L,ZodAny:()=>K0L,TimePrecision:()=>bm$,NEVER:()=>V2H,$output:()=>jm$,$input:()=>Rm$,$brand:()=>vk$});var Xd$=K(()=>{VV();VV();eg$();VV();LsH();SsH();SsH();n0L();jsH();Zp$();Op$();yp$();i0L();$F(b2H())});var r0L;var Jd$=K(()=>{Xd$();Xd$();r0L=S});var QD;var mI=K(()=>{Jd$();Jd$();QD=r0L});var z$H,JiB,qR;var Fd$=K(()=>{z$H=["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"],JiB=[...z$H],qR=JiB});function N$H(H){switch(H){case"acceptEdits":case"bypassPermissions":case"default":case"delegate":case"dontAsk":case"plan":return H}}function hN(H){switch(H){case"bypassPermissions":return"bypassPermissions";case"acceptEdits":return"acceptEdits";case"plan":return"plan";case"delegate":return"delegate";case"dontAsk":return"dontAsk";case"default":return"default";default:return"default"}}function vk(H){switch(H){case"default":return"Default";case"plan":return"Plan Mode";case"delegate":return"Delegate Mode";case"acceptEdits":return"Accept edits";case"bypassPermissions":return"Bypass Permissions";case"dontAsk":return"Don't Ask"}}function s0L(H){return H==="default"||H===void 0}function fwH(H){switch(H){case"default":return"";case"plan":return"\u23F8";case"delegate":return"\u21E2";case"acceptEdits":return"\u23F5\u23F5";case"bypassPermissions":return"\u23F5\u23F5";case"dontAsk":return"\u23F5\u23F5"}}function q6(H){switch(H){case"default":return"text";case"plan":return"planMode";case"delegate":return"delegateMode";case"acceptEdits":return"autoAccept";case"bypassPermissions":return"error";case"dontAsk":return"error"}}var o0L,t0L;var yW=K(()=>{mI();Fd$();o0L=QD.enum(qR),t0L=QD.enum(z$H)});function FiB(H){return H.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function KiB(H){return H.replace(/\\\(/g,"(").replace(/\\\)/g,")").replace(/\\\\/g,"\\")}function T6(H){let $=QiB(H,"(");if($===-1)return{toolName:H};let A=WiB(H,")");if(A===-1||A<=$)return{toolName:H};if(A!==H.length-1)return{toolName:H};let L=H.substring(0,$),I=H.substring($+1,A);if(!L)return{toolName:H};if(I===""||I==="*")return{toolName:L};let D=KiB(I);return{toolName:L,ruleContent:D}}function X8(H){if(!H.ruleContent)return H.toolName;let $=FiB(H.ruleContent);return`${H.toolName}(${$})`}function QiB(H,$){for(let A=0;A=0&&H[I]==="\\")L++,I--;if(L%2===0)return A}return-1}function WiB(H,$){for(let A=H.length-1;A>=0;A--)if(H[A]===$){let L=0,I=A-1;while(I>=0&&H[I]==="\\")L++,I--;if(L%2===0)return A}return-1}function e0L(H){return Kd$.filePatternTools.includes(H)}function H9L(H){return Kd$.bashPrefixTools.includes(H)}function $9L(H){return Kd$.customValidation[H]}var Kd$;var A9L=K(()=>{Kd$={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(H)=>{if(H.includes("*")||H.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(H)=>{if(H.includes("://")||H.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!H.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}}});function L9L(H,$){let A=0,L=$-1;while(L>=0&&H[L]==="\\")A++,L--;return A%2!==0}function Qd$(H,$){let A=0;for(let L=0;L0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${L.toolName}" without parentheses, or use "mcp__${I.serverName}__*" for all tools`,examples:[`mcp__${I.serverName}`,`mcp__${I.serverName}__*`,I.toolName&&I.toolName!=="*"?`mcp__${I.serverName}__${I.toolName}`:void 0].filter(Boolean)};return{valid:!0}}if(!L.toolName||L.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(L.toolName[0]!==L.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${String(L.toolName).charAt(0).toUpperCase()+String(L.toolName).slice(1)}"`};let D=$9L(L.toolName);if(D&&L.ruleContent!==void 0){let B=D(L.ruleContent);if(!B.valid)return B}if(H9L(L.toolName)&&L.ruleContent!==void 0){let B=L.ruleContent;if(B.includes(":*")&&!B.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(B===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm:*)","Bash(git:*)"]}}if(e0L(L.toolName)&&L.ruleContent!==void 0){let B=L.ruleContent;if(B.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${L.toolName}(*.ts) - matches .ts files`,`${L.toolName}(src/**) - matches all files in src`,`${L.toolName}(**/*.test.ts) - matches test files`]};if(B.includes("*")&&!B.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!B.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${L.toolName}(*.js) - all .js files`,`${L.toolName}(src/*) - all files directly in src`,`${L.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var psH;var I9L=K(()=>{mI();tC();A9L();psH=S.string().superRefine((H,$)=>{let A=PiB(H);if(!A.valid){let L=A.error;if(A.suggestion)L+=`. ${A.suggestion}`;if(A.examples&&A.examples.length>0)L+=`. Examples: ${A.examples.join(", ")}`;$.addIssue({code:S.ZodIssueCode.custom,message:L,params:{received:H}})}})});var TR;var D9L=K(()=>{TR=["PreToolUse","PostToolUse","PostToolUseFailure","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","SubagentStart","SubagentStop","PreCompact","PermissionRequest","Setup","TeammateIdle","TaskCompleted"]});var B9L=()=>{};var KGH=K(()=>{D9L();B9L()});var _iB,YiB,CiB,f9L,E9L,oZ;var dsH=K(()=>{mI();KGH();_iB=S.object({type:S.literal("command").describe("Bash command hook type"),command:S.string().describe("Shell command to execute"),timeout:S.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:S.string().optional().describe("Custom status message to display in spinner while hook runs"),once:S.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:S.boolean().optional().describe("If true, hook runs in background without blocking")}),YiB=S.object({type:S.literal("prompt").describe("LLM prompt hook type"),prompt:S.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),timeout:S.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:S.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-5-20250929"). If not specified, uses the default small fast model.'),statusMessage:S.string().optional().describe("Custom status message to display in spinner while hook runs"),once:S.boolean().optional().describe("If true, hook runs once and is removed after execution")}),CiB=S.object({type:S.literal("agent").describe("Agentic verifier hook type"),prompt:S.string().transform((H)=>($)=>H).describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),timeout:S.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:S.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-5-20250929"). If not specified, uses Haiku.'),statusMessage:S.string().optional().describe("Custom status message to display in spinner while hook runs"),once:S.boolean().optional().describe("If true, hook runs once and is removed after execution")}),f9L=S.discriminatedUnion("type",[_iB,YiB,CiB]),E9L=S.object({matcher:S.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:S.array(f9L).describe("List of hooks to execute when the matcher matches")}),oZ=S.partialRecord(S.enum(TR),S.array(E9L))});var Wd$,A98,Vd$,M9L,wiB,ZiB,qiB,TiB,ziB,NiB,OiB,zR,G9L;var O$H=K(()=>{mI();Wd$=S.enum(["local","user","project","dynamic","enterprise","claudeai","managed"]),A98=S.enum(["stdio","sse","sse-ide","http","ws","sdk"]),Vd$=S.object({type:S.literal("stdio").optional(),command:S.string().min(1,"Command cannot be empty"),args:S.array(S.string()).default([]),env:S.record(S.string(),S.string()).optional()}),M9L=S.object({clientId:S.string(),callbackPort:S.number().int().positive().optional()}),wiB=S.object({type:S.literal("sse"),url:S.string(),headers:S.record(S.string(),S.string()).optional(),headersHelper:S.string().optional(),oauth:M9L.optional()}),ZiB=S.object({type:S.literal("sse-ide"),url:S.string(),ideName:S.string(),ideRunningInWindows:S.boolean().optional()}),qiB=S.object({type:S.literal("ws-ide"),url:S.string(),ideName:S.string(),authToken:S.string().optional(),ideRunningInWindows:S.boolean().optional()}),TiB=S.object({type:S.literal("http"),url:S.string(),headers:S.record(S.string(),S.string()).optional(),headersHelper:S.string().optional(),oauth:M9L.optional()}),ziB=S.object({type:S.literal("ws"),url:S.string(),headers:S.record(S.string(),S.string()).optional(),headersHelper:S.string().optional()}),NiB=S.object({type:S.literal("sdk"),name:S.string()}),OiB=S.object({type:S.literal("claudeai-proxy"),url:S.string(),id:S.string()}),zR=S.union([Vd$,wiB,ZiB,qiB,TiB,ziB,NiB,OiB]),G9L=S.object({mcpServers:S.record(S.string(),zR)})});function EwH(H,$){let A=H.toLowerCase();return $.autoUpdate??(M2.has(A)&&!xiB.has(A))}function RiB(H){if(M2.has(H.toLowerCase()))return!1;if(jiB.test(H))return!0;return SiB.test(H)}function F9L(H,$){let A=H.toLowerCase();if(!M2.has(A))return null;if($.source==="github"){if(!($.repo||"").toLowerCase().startsWith(`${csH}/`))return`The name '${H}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${csH}/' can use this name.`;return null}if($.source==="git"&&$.url){let L=$.url.toLowerCase(),I=L.includes("github.com/anthropics/"),D=L.includes("git@github.com:anthropics/");if(I||D)return null;return`The name '${H}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${csH}/' can use this name.`}return`The name '${H}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${csH}' organization.`}function NR(H){return typeof H==="string"&&H.startsWith("./")}var M2,xiB,SiB,jiB,csH="anthropics",hk,QGH,U9L,Pd$,_d$,K9L,yiB,Q9L,viB,hiB,biB,kiB,uiB,giB,miB,X9L,piB,WGH,diB,S$H,W9L,MwH,J9L,ciB,liB,VGH,x$H,f98,iiB,GwH,niB,riB,UwH,E98,aiB,Yd$;var UQ=K(()=>{mI();dsH();O$H();M2=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),xiB=new Set(["knowledge-work-plugins"]);SiB=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,jiB=/[^\u0020-\u007E]/;hk=S.string().startsWith("./"),QGH=hk.endsWith(".json"),U9L=S.union([hk.refine((H)=>H.endsWith(".mcpb")||H.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),S.string().url().refine((H)=>H.endsWith(".mcpb")||H.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")]),Pd$=hk.endsWith(".md"),_d$=S.union([Pd$,hk]),K9L=S.object({name:S.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:S.string().optional().describe("Contact email for support or feedback"),url:S.string().optional().describe("Website, GitHub profile, or organization URL")}),yiB=S.object({name:S.string().min(1,"Plugin name cannot be empty").refine((H)=>!H.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),version:S.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:S.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:K9L.optional().describe("Information about the plugin creator or maintainer"),homepage:S.string().url().optional().describe("Plugin homepage or documentation URL"),repository:S.string().optional().describe("Source code repository URL"),license:S.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:S.array(S.string()).optional().describe("Tags for plugin discovery and categorization")}),Q9L=S.object({description:S.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:S.lazy(()=>oZ).describe("The hooks provided by the plugin, in the same format as the one used for settings")}),viB=S.object({hooks:S.union([QGH.describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),S.lazy(()=>oZ).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),S.array(S.union([QGH.describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),S.lazy(()=>oZ).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])}),hiB=S.object({source:_d$.optional().describe("Path to command markdown file, relative to plugin root"),content:S.string().optional().describe("Inline markdown content for the command"),description:S.string().optional().describe("Command description override"),argumentHint:S.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:S.string().optional().describe("Default model for this command"),allowedTools:S.array(S.string()).optional().describe("Tools allowed when command runs")}).refine((H)=>H.source&&!H.content||!H.source&&H.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'}),biB=S.object({commands:S.union([_d$.describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root"),S.array(_d$.describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional command files or skill directories"),S.record(S.string(),hiB).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])}),kiB=S.object({agents:S.union([Pd$.describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),S.array(Pd$.describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional agent files")])}),uiB=S.object({skills:S.union([hk.describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root"),S.array(hk.describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional skill directories")])}),giB=S.object({outputStyles:S.union([hk.describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root"),S.array(hk.describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional output styles directories or files")])}),miB=S.object({mcpServers:S.union([QGH.describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),U9L.describe("Path or URL to MCPB file containing MCP server configuration"),S.record(S.string(),zR).describe("MCP server configurations keyed by server name"),S.array(S.union([QGH.describe("Path to MCP servers configuration file"),U9L.describe("Path or URL to MCPB file"),S.record(S.string(),zR).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])}),X9L=S.string().min(1),piB=S.string().min(2).refine((H)=>H.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'}),WGH=S.strictObject({command:S.string().min(1).refine((H)=>{if(H.includes(" ")&&!H.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:S.array(X9L).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:S.record(piB,X9L).refine((H)=>Object.keys(H).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:S.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:S.record(S.string(),S.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:S.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:S.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:S.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:S.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:S.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:S.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:S.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")}),diB=S.object({lspServers:S.union([QGH.describe("Path to .lsp.json configuration file relative to plugin root"),S.record(S.string(),WGH).describe("LSP server configurations keyed by server name"),S.array(S.union([QGH.describe("Path to LSP configuration file"),S.record(S.string(),WGH).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])}),S$H=S.object({...yiB.shape,...viB.partial().shape,...biB.partial().shape,...kiB.partial().shape,...uiB.partial().shape,...giB.partial().shape,...miB.partial().shape,...diB.partial().shape}).strict(),W9L=S.string().refine((H)=>!H.includes("..")&&!H.includes("//"),"Package name cannot contain path traversal patterns").refine((H)=>{let $=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,A=/^[a-z0-9][a-z0-9-._]*$/;return $.test(H)||A.test(H)},"Invalid npm package name format"),MwH=S.discriminatedUnion("source",[S.object({source:S.literal("url"),url:S.string().url().describe("Direct URL to marketplace.json file"),headers:S.record(S.string(),S.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),S.object({source:S.literal("github"),repo:S.string().describe("GitHub repository in owner/repo format"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:S.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)")}),S.object({source:S.literal("git"),url:S.string().endsWith(".git").describe("Full git repository URL"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:S.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)")}),S.object({source:S.literal("npm"),package:W9L.describe("NPM package containing marketplace.json")}),S.object({source:S.literal("file"),path:S.string().describe("Local file path to marketplace.json")}),S.object({source:S.literal("directory"),path:S.string().describe("Local directory containing .claude-plugin/marketplace.json")}),S.object({source:S.literal("hostPattern"),hostPattern:S.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')})]),J9L=S.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA"),ciB=S.union([hk.describe("Path to the plugin root, relative to the marketplace directory"),S.object({source:S.literal("npm"),package:W9L.or(S.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:S.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:S.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),S.object({source:S.literal("pip"),package:S.string().describe("Python package name as it appears on PyPI"),version:S.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:S.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),S.object({source:S.literal("url"),url:S.string().endsWith(".git").describe("Full git repository URL (https:// or git@)"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:J9L.optional().describe("Specific commit SHA to use")}),S.object({source:S.literal("github"),repo:S.string().describe("GitHub repository in owner/repo format"),ref:S.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:J9L.optional().describe("Specific commit SHA to use")})]);liB=S$H.partial().extend({name:S.string().min(1,"Plugin name cannot be empty").refine((H)=>!H.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:ciB.describe("Where to fetch the plugin from"),category:S.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:S.array(S.string()).optional().describe("Tags for searchability and discovery"),strict:S.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.")}).strict(),VGH=S.object({name:S.string().min(1,"Marketplace must have a name").refine((H)=>!H.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((H)=>!RiB(H),{message:'Marketplace name cannot impersonate official Anthropic/Claude marketplaces. Names containing "official", "anthropic", or "claude" in official-sounding combinations are reserved.'}),owner:K9L.describe("Marketplace maintainer or curator information"),plugins:S.array(liB).describe("Collection of available plugins in this marketplace"),metadata:S.object({pluginRoot:S.string().optional().describe("Base path for relative plugin sources"),version:S.string().optional().describe("Marketplace version"),description:S.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata")}),x$H=S.string().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,"Plugin ID must be in format: plugin@marketplace"),f98=S.union([x$H,S.object({id:x$H.describe('Plugin identifier (e.g., "formatter@tools")'),version:S.string().optional().describe('Version constraint (e.g., "^2.0.0")'),required:S.boolean().optional().describe("If true, cannot be disabled"),config:S.record(S.string(),S.unknown()).optional().describe("Plugin-specific configuration")})]),iiB=S.object({version:S.string().describe("Currently installed version"),installedAt:S.string().describe("ISO 8601 timestamp of installation"),lastUpdated:S.string().optional().describe("ISO 8601 timestamp of last update"),installPath:S.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:S.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)")}),GwH=S.object({version:S.literal(1).describe("Schema version 1"),plugins:S.record(x$H,iiB).describe("Map of plugin IDs to their installation metadata")}),niB=S.enum(["managed","user","project","local"]),riB=S.object({scope:niB.describe("Installation scope"),projectPath:S.string().optional().describe("Project path (required for project/local scopes)"),installPath:S.string().describe("Absolute path to the versioned plugin directory"),version:S.string().optional().describe("Currently installed version"),installedAt:S.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:S.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:S.string().optional().describe("Git commit SHA for git-based plugins")}),UwH=S.object({version:S.literal(2).describe("Schema version 2"),plugins:S.record(x$H,S.array(riB)).describe("Map of plugin IDs to arrays of installation entries")}),E98=S.union([GwH,UwH]),aiB=S.object({source:MwH.describe("Where to fetch the marketplace from"),installLocation:S.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:S.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:S.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")}),Yd$=S.record(S.string(),aiB)});var oiB,V9L;var P9L=K(()=>{mI();oiB=S.object({allowedDomains:S.array(S.string()).optional(),allowManagedDomainsOnly:S.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:S.array(S.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:S.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:S.boolean().optional(),httpProxyPort:S.number().optional(),socksProxyPort:S.number().optional()}).optional(),V9L=S.object({enabled:S.boolean().optional(),autoAllowBashIfSandboxed:S.boolean().optional(),allowUnsandboxedCommands:S.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:oiB,ignoreViolations:S.record(S.string(),S.array(S.string())).optional(),enableWeakerNestedSandbox:S.boolean().optional(),excludedCommands:S.array(S.string()).optional(),ripgrep:S.object({command:S.string(),args:S.array(S.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support")}).passthrough()});function PGH(H){return"serverName"in H&&H.serverName!==void 0}function lsH(H){return"serverCommand"in H&&H.serverCommand!==void 0}function isH(H){return"serverUrl"in H&&H.serverUrl!==void 0}var tiB,siB,eiB,HnB,$nB,tZ;var bk=K(()=>{mI();yW();I9L();W4();UQ();P9L();dsH();dsH();tiB=S.record(S.string(),S.coerce.string()),siB=S.object({allow:S.array(psH).optional().describe("List of permission rules for allowed operations"),deny:S.array(psH).optional().describe("List of permission rules for denied operations"),ask:S.array(psH).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:S.enum(z$H).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:S.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),additionalDirectories:S.array(S.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough(),eiB=S.object({source:MwH.describe("Where to fetch the marketplace from"),installLocation:S.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)")}),HnB=S.object({serverName:S.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:S.array(S.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:S.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((H)=>{return[H.serverName!==void 0,H.serverCommand!==void 0,H.serverUrl!==void 0].filter(Boolean).length===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'}),$nB=S.object({serverName:S.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:S.array(S.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:S.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((H)=>{return[H.serverName!==void 0,H.serverCommand!==void 0,H.serverUrl!==void 0].filter(Boolean).length===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'}),tZ=S.object({$schema:S.literal(oDL).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:S.string().optional().describe("Path to a script that outputs authentication values"),awsCredentialExport:S.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:S.string().optional().describe("Path to a script that refreshes AWS authentication"),fileSuggestion:S.object({type:S.literal("command"),command:S.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:S.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),cleanupPeriodDays:S.number().nonnegative().int().optional().describe("Number of days to retain chat transcripts (0 to disable cleanup)"),env:tiB.optional().describe("Environment variables to set for Claude Code sessions"),attribution:S.object({commit:S.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:S.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:S.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),permissions:siB.optional().describe("Tool usage permissions configuration"),model:S.string().optional().describe("Override the default model used by Claude Code"),enableAllProjectMcpServers:S.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:S.array(S.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:S.array(S.string()).optional().describe("List of rejected MCP servers from .mcp.json"),allowedMcpServers:S.array(HnB).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:S.array($nB).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:oZ.optional().describe("Custom commands to run before/after tool executions"),disableAllHooks:S.boolean().optional().describe("Disable all hooks and statusLine execution"),allowManagedHooksOnly:S.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowManagedPermissionRulesOnly:S.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),statusLine:S.object({type:S.literal("command"),command:S.string(),padding:S.number().optional()}).optional().describe("Custom status line display configuration"),enabledPlugins:S.record(S.string(),S.union([S.array(S.string()),S.boolean(),S.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.'),extraKnownMarketplaces:S.record(S.string(),eiB).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),skippedMarketplaces:S.array(S.string()).optional().describe("List of marketplace names the user has chosen not to install when prompted"),skippedPlugins:S.array(S.string()).optional().describe("List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted"),strictKnownMarketplaces:S.array(MwH).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),blockedMarketplaces:S.array(MwH).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),forceLoginMethod:S.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),forceLoginOrgUUID:S.string().optional().describe("Organization UUID to use for OAuth login"),otelHeadersHelper:S.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:S.string().optional().describe("Controls the output style for assistant responses"),language:S.string().optional().describe('Preferred language for Claude responses (e.g., "japanese", "spanish")'),skipWebFetchPreflight:S.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:V9L.optional(),spinnerTipsEnabled:S.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:S.object({mode:S.enum(["append","replace"]),verbs:S.array(S.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),syntaxHighlightingDisabled:S.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:S.boolean().optional().describe("When true, terminal tab title is set from /rename and not auto-updated based on the conversation topic"),alwaysThinkingEnabled:S.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),fastMode:S.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),promptSuggestionEnabled:S.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),agent:S.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:S.array(S.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:S.record(S.string(),S.object({mcpServers:S.record(S.string(),S.record(S.string(),S.union([S.string(),S.number(),S.boolean(),S.array(S.string())]))).optional().describe("User configuration values for MCP servers keyed by server name")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:S.object({defaultEnvironmentId:S.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:S.enum(["latest","stable"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:S.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:S.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),...{},prefersReducedMotion:S.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)")}).passthrough()});async function Cd$(H,$,A,L){try{let I=await _9L.readFile(Y9L.join(H,"config"),"utf-8");return AnB(I,$,A,L)}catch{return null}}function AnB(H,$,A,L){let I=H.split(` `,"utf-8")}catch(A){r(A instanceof Error?A:Error(String(A)))}}var esH,b9L;var Td$=K(()=>{t8();DL();PI();_$();B0();Z$();esH=require("path"),b9L=require("os")});function k9L(H){let $=YnB.find((L)=>L.matches(H));if(!$)return null;let A={...$.tip};if(H.code==="invalid_value"&&H.enumValues&&!A.suggestion)A.suggestion=`Valid values: ${H.enumValues.map((L)=>`"${L}"`).join(", ")}`;if(!A.docLink&&H.path){let L=H.path.split(".")[0];if(L)A.docLink=CnB[L]}return A}var YnB,CnB;var u9L=K(()=>{YnB=[{matches:(H)=>H.path==="permissions.defaultMode"&&H.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:"https://code.claude.com/docs/en/iam#permission-modes"}},{matches:(H)=>H.path==="apiKeyHelper"&&H.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(H)=>H.path==="cleanupPeriodDays"&&H.code==="too_small"&&H.expected==="0",tip:{suggestion:"Must be 0 or greater. Use 0 to disable automatic cleanup and keep chat transcripts forever, or set a positive number for days to retain (default is 30 days)"}},{matches:(H)=>H.path.startsWith("env.")&&H.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:"https://code.claude.com/docs/en/settings#environment-variables"}},{matches:(H)=>(H.path==="permissions.allow"||H.path==="permissions.deny")&&H.code==="invalid_type"&&H.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(H)=>H.path.includes("hooks")&&H.code==="invalid_type",tip:{suggestion:'Hooks use a new format with matchers. Example: {"PostToolUse": [{"matcher": {"tools": ["BashTool"]}, "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(H)=>H.code==="invalid_type"&&H.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(H)=>H.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:"https://code.claude.com/docs/en/settings"}},{matches:(H)=>H.code==="invalid_value"&&H.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(H)=>H.code==="invalid_type"&&H.expected==="object"&&H.received===null&&H.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(H)=>H.path==="permissions.additionalDirectories"&&H.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:"https://code.claude.com/docs/en/iam#working-directories"}}],CnB={permissions:"https://code.claude.com/docs/en/iam#configuring-permissions",env:"https://code.claude.com/docs/en/settings#environment-variables",hooks:"https://code.claude.com/docs/en/hooks"}});function zd$(){let H=Rk(tZ,{unrepresentable:"any"});return yH(H,null,2)}var g9L=K(()=>{mI();bk();Z$()});function m9L(H){return H.code==="invalid_type"}function p9L(H){return H.code==="invalid_value"}function wnB(H){return H.code==="unrecognized_keys"}function d9L(H){return H.code==="too_small"}function Nd$(H){if(H===null)return"null";if(H===void 0)return"undefined";if(Array.isArray(H))return"array";return typeof H}function c9L(H){let $=H.match(/received (\w+)/);return $?$[1]:void 0}function HeH(H,$){return H.issues.map((A)=>{let L=A.path.map(String).join("."),I=A.message,D,B,f,E,M;if(p9L(A))B=A.values.map((U)=>String(U)),f=B.join(" | "),E=void 0,M=void 0;else if(m9L(A)){f=A.expected;let U=c9L(A.message);E=U??Nd$(A.input),M=U??Nd$(A.input)}else if(d9L(A))f=String(A.minimum);else if(A.code==="custom"&&"params"in A)E=A.params.received,M=E;let G=k9L({path:L,code:A.code,expected:f,received:E,enumValues:B,message:A.message,value:E});if(p9L(A))D=B?.map((U)=>`"${U}"`).join(", "),I=`Invalid value. Expected one of: ${D}`;else if(m9L(A)){let U=c9L(A.message)??Nd$(A.input);if(A.expected==="object"&&U==="null"&&L==="")I="Invalid or malformed JSON";else I=`Expected ${A.expected}, but received ${U}`}else if(wnB(A)){let U=A.keys.join(", ");I=`Unrecognized field${A.keys.length>1?"s":""}: ${U}`}else if(d9L(A))I=`Number must be greater than or equal to ${A.minimum}`,D=String(A.minimum);return{file:$,path:L,message:I,expected:D,invalidValue:M,suggestion:G?.suggestion,docLink:G?.docLink}})}function Od$(H){try{let $=DA(H),A=tZ.strict().safeParse($);if(A.success)return{isValid:!0};return{isValid:!1,error:`Settings validation failed: `),fullSchema:zd$()}}catch($){return{isValid:!1,error:`Invalid JSON: ${$ instanceof Error?$.message:"Unknown parsing error"}`,fullSchema:zd$()}}}var xd$=K(()=>{bk();u9L();g9L();Z$()});var l9L,v_;var y$H=K(()=>{tD();Z9();l9L=require("fs"),v_=o$(function(){switch(oA()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":if(l9L.existsSync("C:\\Program Files\\ClaudeCode"))return"C:\\Program Files\\ClaudeCode";return"C:\\ProgramData\\ClaudeCode";default:return"/etc/claude-code"}})});function s9L(H,$={}){let A=$.entryType||$.type;if(A==="both")A=G2.FILE_DIR_TYPE;if(A)$.type=A;if(!H)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof H!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(A&&!i9L.includes(A))throw Error(`readdirp: Invalid type passed. Use one of ${i9L.join(", ")}`);return $.root=H,new t9L($)}var kk,a9L,uk,G2,Sd$,o9L="READDIRP_RECURSIVE_ERROR",ZnB,i9L,qnB,TnB,znB=(H)=>ZnB.has(H.code),NnB=!1,n9L=(H)=>!0,r9L=(H)=>{if(H===void 0)return n9L;if(typeof H==="function")return H;if(typeof H==="string"){let $=H.trim();return(A)=>A.basename===$}if(Array.isArray(H)){let $=H.map((A)=>A.trim());return(A)=>$.some((L)=>A.basename===L)}return n9L},t9L;var e9L=K(()=>{kk=require("fs/promises"),a9L=require("stream"),uk=require("path"),G2={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Sd$={root:".",fileFilter:(H)=>!0,directoryFilter:(H)=>!0,type:G2.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Sd$);ZnB=new Set(["ENOENT","EPERM","EACCES","ELOOP",o9L]),i9L=[G2.DIR_TYPE,G2.EVERYTHING_TYPE,G2.FILE_DIR_TYPE,G2.FILE_TYPE],qnB=new Set([G2.DIR_TYPE,G2.EVERYTHING_TYPE,G2.FILE_DIR_TYPE]),TnB=new Set([G2.EVERYTHING_TYPE,G2.FILE_DIR_TYPE,G2.FILE_TYPE]);t9L=class t9L extends a9L.Readable{constructor(H={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:H.highWaterMark});let $={...Sd$,...H},{root:A,type:L}=$;this._fileFilter=r9L($.fileFilter),this._directoryFilter=r9L($.directoryFilter);let I=$.lstat?kk.lstat:kk.stat;if(NnB)this._stat=(D)=>I(D,{bigint:!0});else this._stat=I;this._maxDepth=$.depth??Sd$.depth,this._wantsDir=L?qnB.has(L):!1,this._wantsFile=L?TnB.has(L):!1,this._wantsEverything=L===G2.EVERYTHING_TYPE,this._root=uk.resolve(A),this._isDirent=!$.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(A,1)],this.reading=!1,this.parent=void 0}async _read(H){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&H>0){let $=this.parent,A=$&&$.files;if(A&&A.length>0){let{path:L,depth:I}=$,D=A.splice(0,H).map((f)=>this._formatEntry(f,L)),B=await Promise.all(D);for(let f of B){if(!f)continue;if(this.destroyed)return;let E=await this._getEntryType(f);if(E==="directory"&&this._directoryFilter(f)){if(I<=this._maxDepth)this.parents.push(this._exploreDir(f.fullPath,I+1));if(this._wantsDir)this.push(f),H--}else if((E==="file"||this._includeAsFile(f))&&this._fileFilter(f)){if(this._wantsFile)this.push(f),H--}}}else{let L=this.parents.pop();if(!L){this.push(null);break}if(this.parent=await L,this.destroyed)return}}}catch($){this.destroy($)}finally{this.reading=!1}}async _exploreDir(H,$){let A;try{A=await kk.readdir(H,this._rdOptions)}catch(L){this._onError(L)}return{files:A,depth:$,path:H}}async _formatEntry(H,$){let A,L=this._isDirent?H.name:H;try{let I=uk.resolve(uk.join($,L));A={path:uk.relative(this._root,I),fullPath:I,basename:L},A[this._statsProp]=this._isDirent?H:await this._stat(I)}catch(I){this._onError(I);return}return A}_onError(H){if(znB(H)&&!this.destroyed)this.emit("warn",H);else this.destroy(H)}async _getEntryType(H){if(!H&&this._statsProp in H)return"";let $=H[this._statsProp];if($.isFile())return"file";if($.isDirectory())return"directory";if($&&$.isSymbolicLink()){let A=H.fullPath;try{let L=await kk.realpath(A),I=await kk.lstat(L);if(I.isFile())return"file";if(I.isDirectory()){let D=L.length;if(A.startsWith(L)&&A.substr(D,1)===uk.sep){let B=Error(`Circular symlink detected: "${A}" points to "${L}"`);return B.code=o9L,this._onError(B)}return"directory"}}catch(L){return this._onError(L),""}}}_includeAsFile(H){let $=H&&H[this._statsProp];return $&&this._wantsEverything&&!$.isDirectory()}}});function H1L(H,$,A,L,I){let D=(B,f)=>{if(A(H),I(B,f,{watchedPath:H}),f&&H!==f)LeH(V4.resolve(H,f),v$H,V4.join(H,f))};try{return h$H.watch(H,{persistent:$.persistent},D)}catch(B){L(B);return}}class hd${constructor(H){this.fsw=H,this._boundHandleError=($)=>H._handleError($)}_watchWithNodeFs(H,$){let A=this.fsw.options,L=V4.dirname(H),I=V4.basename(H);this.fsw._getWatchedDir(L).add(I);let B=V4.resolve(H),f={persistent:A.persistent};if(!$)$=IeH;let E;if(A.usePolling){let M=A.interval!==A.binaryInterval;f.interval=M&&bnB(I)?A.binaryInterval:A.interval,E=gnB(H,B,f,{listener:$,rawEmitter:this.fsw._emitRaw})}else E=unB(H,B,f,{listener:$,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return E}_handleFile(H,$,A){if(this.fsw.closed)return;let L=V4.dirname(H),I=V4.basename(H),D=this.fsw._getWatchedDir(L),B=$;if(D.has(I))return;let f=async(M,G)=>{if(!this.fsw._throttle(RnB,H,5))return;if(!G||G.mtimeMs===0)try{let U=await uN.stat(H);if(this.fsw.closed)return;let{atimeMs:X,mtimeMs:J}=U;if(!X||X<=J||J!==B.mtimeMs)this.fsw._emit(kN.CHANGE,H,U);if((xnB||SnB||jnB)&&B.ino!==U.ino){this.fsw._closeFile(M),B=U;let F=this._watchWithNodeFs(H,f);if(F)this.fsw._addPathCloser(M,F)}else B=U}catch(U){this.fsw._remove(L,I)}else if(D.has(I)){let{atimeMs:U,mtimeMs:X}=G;if(!U||U<=X||X!==B.mtimeMs)this.fsw._emit(kN.CHANGE,H,G);B=G}},E=this._watchWithNodeFs(H,f);if(!(A&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(H)){if(!this.fsw._throttle(kN.ADD,H,0))return;this.fsw._emit(kN.ADD,H,$)}return E}async _handleSymlink(H,$,A,L){if(this.fsw.closed)return;let I=H.fullPath,D=this.fsw._getWatchedDir($);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let B;try{B=await uN.realpath(A)}catch(f){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(D.has(L)){if(this.fsw._symlinkPaths.get(I)!==B)this.fsw._symlinkPaths.set(I,B),this.fsw._emit(kN.CHANGE,A,H.stats)}else D.add(L),this.fsw._symlinkPaths.set(I,B),this.fsw._emit(kN.ADD,A,H.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(I))return!0;this.fsw._symlinkPaths.set(I,!0)}_handleRead(H,$,A,L,I,D,B){if(H=V4.join(H,""),B=this.fsw._throttle("readdir",H,1000),!B)return;let f=this.fsw._getWatchedDir(A.path),E=new Set,M=this.fsw._readdirp(H,{fileFilter:(G)=>A.filterPath(G),directoryFilter:(G)=>A.filterDir(G)});if(!M)return;return M.on(OnB,async(G)=>{if(this.fsw.closed){M=void 0;return}let U=G.path,X=V4.join(H,U);if(E.add(U),G.stats.isSymbolicLink()&&await this._handleSymlink(G,H,X,U))return;if(this.fsw.closed){M=void 0;return}if(U===L||!L&&!f.has(U))this.fsw._incrReadyCount(),X=V4.join(I,V4.relative(I,X)),this._addToNodeFs(X,$,A,D+1)}).on(kN.ERROR,this._boundHandleError),new Promise((G,U)=>{if(!M)return U();M.once(yd$,()=>{if(this.fsw.closed){M=void 0;return}let X=B?B.clear():!1;if(G(void 0),f.getChildren().filter((J)=>{return J!==H&&!E.has(J)}).forEach((J)=>{this.fsw._remove(H,J)}),M=void 0,X)this._handleRead(H,!1,A,L,I,D,B)})})}async _handleDir(H,$,A,L,I,D,B){let f=this.fsw._getWatchedDir(V4.dirname(H)),E=f.has(V4.basename(H));if(!(A&&this.fsw.options.ignoreInitial)&&!I&&!E)this.fsw._emit(kN.ADD_DIR,H,$);f.add(V4.basename(H)),this.fsw._getWatchedDir(H);let M,G,U=this.fsw.options.depth;if((U==null||L<=U)&&!this.fsw._symlinkPaths.has(B)){if(!I){if(await this._handleRead(H,A,D,I,H,L,M),this.fsw.closed)return}G=this._watchWithNodeFs(H,(X,J)=>{if(J&&J.mtimeMs===0)return;this._handleRead(X,!1,D,I,H,L,M)})}return G}async _addToNodeFs(H,$,A,L,I){let D=this.fsw._emitReady;if(this.fsw._isIgnored(H)||this.fsw.closed)return D(),!1;let B=this.fsw._getWatchHelpers(H);if(A)B.filterPath=(f)=>A.filterPath(f),B.filterDir=(f)=>A.filterDir(f);try{let f=await ynB[B.statMethod](B.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(B.watchPath,f))return D(),!1;let E=this.fsw.options.followSymlinks,M;if(f.isDirectory()){let G=V4.resolve(H),U=E?await uN.realpath(H):H;if(this.fsw.closed)return;if(M=await this._handleDir(B.watchPath,f,$,L,I,B,U),this.fsw.closed)return;if(G!==U&&U!==void 0)this.fsw._symlinkPaths.set(G,U)}else if(f.isSymbolicLink()){let G=E?await uN.realpath(H):H;if(this.fsw.closed)return;let U=V4.dirname(B.watchPath);if(this.fsw._getWatchedDir(U).add(B.watchPath),this.fsw._emit(kN.ADD,B.watchPath,f),M=await this._handleDir(U,f,$,L,H,B,G),this.fsw.closed)return;if(G!==void 0)this.fsw._symlinkPaths.set(V4.resolve(H),G)}else M=this._handleFile(B.watchPath,f,$);if(D(),M)this.fsw._addPathCloser(H,M);return!1}catch(f){if(this.fsw._handleError(f))return D(),H}}}var h$H,uN,V4,$1L,OnB="data",yd$="end",A1L="close",IeH=()=>{},DeH="linux",vd$,xnB,SnB,jnB,L1L,xU,kN,RnB="watch",ynB,v$H="listeners",$eH="errHandlers",_GH="rawEmitters",vnB,hnB,bnB=(H)=>hnB.has(V4.extname(H).slice(1).toLowerCase()),Rd$=(H,$)=>{if(H instanceof Set)H.forEach($);else $(H)},PwH=(H,$,A)=>{let L=H[$];if(!(L instanceof Set))H[$]=L=new Set([L]);L.add(A)},knB=(H)=>($)=>{let A=H[$];if(A instanceof Set)A.clear();else delete H[$]},_wH=(H,$,A)=>{let L=H[$];if(L instanceof Set)L.delete(A);else if(L===A)delete H[$]},I1L=(H)=>H instanceof Set?H.size===0:!H,AeH,LeH=(H,$,A,L,I)=>{let D=AeH.get(H);if(!D)return;Rd$(D[$],(B)=>{B(A,L,I)})},unB=(H,$,A,L)=>{let{listener:I,errHandler:D,rawEmitter:B}=L,f=AeH.get($),E;if(!A.persistent){if(E=H1L(H,A,I,D,B),!E)return;return E.close.bind(E)}if(f)PwH(f,v$H,I),PwH(f,$eH,D),PwH(f,_GH,B);else{if(E=H1L(H,A,LeH.bind(null,$,v$H),D,LeH.bind(null,$,_GH)),!E)return;E.on(kN.ERROR,async(M)=>{let G=LeH.bind(null,$,$eH);if(f)f.watcherUnusable=!0;if(vd$&&M.code==="EPERM")try{await(await uN.open(H,"r")).close(),G(M)}catch(U){}else G(M)}),f={listeners:I,errHandlers:D,rawEmitters:B,watcher:E},AeH.set($,f)}return()=>{if(_wH(f,v$H,I),_wH(f,$eH,D),_wH(f,_GH,B),I1L(f.listeners))f.watcher.close(),AeH.delete($),vnB.forEach(knB(f)),f.watcher=void 0,Object.freeze(f)}},jd$,gnB=(H,$,A,L)=>{let{listener:I,rawEmitter:D}=L,B=jd$.get($),f=B&&B.options;if(f&&(f.persistentA.interval))h$H.unwatchFile($),B=void 0;if(B)PwH(B,v$H,I),PwH(B,_GH,D);else B={listeners:I,rawEmitters:D,options:A,watcher:h$H.watchFile($,A,(E,M)=>{Rd$(B.rawEmitters,(U)=>{U(kN.CHANGE,$,{curr:E,prev:M})});let G=E.mtimeMs;if(E.size!==M.size||G>M.mtimeMs||G===0)Rd$(B.listeners,(U)=>U(H,E))})},jd$.set($,B);return()=>{if(_wH(B,v$H,I),_wH(B,_GH,D),I1L(B.listeners))jd$.delete($),h$H.unwatchFile($),B.options=B.watcher=void 0,Object.freeze(B)}};var D1L=K(()=>{h$H=require("fs"),uN=require("fs/promises"),V4=b(require("path")),$1L=require("os"),vd$=DeH==="win32",xnB=DeH==="darwin",SnB=DeH==="linux",jnB=DeH==="freebsd",L1L=$1L.type()==="OS400",xU={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},kN=xU,ynB={lstat:uN.lstat,stat:uN.stat},vnB=[v$H,$eH,_GH],hnB=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),AeH=new Map;jd$=new Map});function BeH(H){return Array.isArray(H)?H:[H]}function nnB(H){if(typeof H==="function")return H;if(typeof H==="string")return($)=>H===$;if(H instanceof RegExp)return($)=>H.test($);if(typeof H==="object"&&H!==null)return($)=>{if(H.path===$)return!0;if(H.recursive){let A=z8.relative(H.path,$);if(!A)return!1;return!A.startsWith("..")&&!z8.isAbsolute(A)}return!1};return()=>!1}function rnB(H){if(typeof H!=="string")throw Error("string expected");H=z8.normalize(H),H=H.replace(/\\/g,"/");let $=!1;if(H.startsWith("//"))$=!0;let A=/\/\//;while(H.match(A))H=H.replace(A,"/");if($)H="/"+H;return H}function f1L(H,$,A){let L=rnB($);for(let I=0;InnB(I));if($==null)return(I,D)=>{return f1L(L,I,D)};return f1L(L,$)}class K1L{constructor(H,$){this.path=H,this._removeWatcher=$,this.items=new Set}add(H){let{items:$}=this;if(!$)return;if(H!==J1L&&H!==pnB)$.add(H)}async remove(H){let{items:$}=this;if(!$)return;if($.delete(H),$.size>0)return;let A=this.path;try{await feH.readdir(A)}catch(L){if(this._removeWatcher)this._removeWatcher(z8.dirname(A),z8.basename(A))}}has(H){let{items:$}=this;if(!$)return;return $.has(H)}getChildren(){let{items:H}=this;if(!H)return[];return[...H.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=IeH,this.items=tnB,Object.freeze(this)}}class Q1L{constructor(H,$,A){this.fsw=A;let L=H;this.path=H=H.replace(inB,""),this.watchPath=L,this.fullWatchPath=z8.resolve(L),this.dirParts=[],this.dirParts.forEach((I)=>{if(I.length>1)I.pop()}),this.followSymlinks=$,this.statMethod=$?snB:enB}entryPath(H){return z8.join(this.watchPath,z8.relative(this.watchPath,H.fullPath))}filterPath(H){let{stats:$}=H;if($&&$.isSymbolicLink())return this.filterDir(H);let A=this.entryPath(H);return this.fsw._isntIgnored(A,$)&&this.fsw._hasReadPermissions($)}filterDir(H){return this.fsw._isntIgnored(this.entryPath(H),H.stats)}}function HrB(H,$={}){let A=new ud$($);return A.add(H),A}var U1L,feH,X1L,z8,bd$="/",mnB="//",J1L=".",pnB="..",dnB="string",cnB,B1L,lnB,inB,kd$=(H)=>typeof H==="object"&&H!==null&&!(H instanceof RegExp),E1L=(H)=>{let $=BeH(H).flat();if(!$.every((A)=>typeof A===dnB))throw TypeError(`Non-string provided as watch path: ${$}`);return $.map(F1L)},M1L=(H)=>{let $=H.replace(cnB,bd$),A=!1;if($.startsWith(mnB))A=!0;while($.match(B1L))$=$.replace(B1L,bd$);if(A)$=bd$+$;return $},F1L=(H)=>M1L(z8.normalize(M1L(H))),G1L=(H="")=>($)=>{if(typeof $==="string")return F1L(z8.isAbsolute($)?$:z8.join(H,$));else return $},onB=(H,$)=>{if(z8.isAbsolute(H))return H;return z8.join($,H)},tnB,snB="stat",enB="lstat",ud$,YGH;var EeH=K(()=>{e9L();D1L();U1L=require("fs"),feH=require("fs/promises"),X1L=require("events"),z8=b(require("path"));/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */cnB=/\\/g,B1L=/\/\//,lnB=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,inB=/^\.[/\\]/;tnB=Object.freeze(new Set);ud$=class ud$ extends X1L.EventEmitter{constructor(H={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let $=H.awaitWriteFinish,A={stabilityThreshold:2000,pollInterval:100},L={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...H,ignored:H.ignored?BeH(H.ignored):BeH([]),awaitWriteFinish:$===!0?A:typeof $==="object"?{...A,...$}:!1};if(L1L)L.usePolling=!0;if(L.atomic===void 0)L.atomic=!L.usePolling;let I=process.env.CHOKIDAR_USEPOLLING;if(I!==void 0){let f=I.toLowerCase();if(f==="false"||f==="0")L.usePolling=!1;else if(f==="true"||f==="1")L.usePolling=!0;else L.usePolling=!!f}let D=process.env.CHOKIDAR_INTERVAL;if(D)L.interval=Number.parseInt(D,10);let B=0;this._emitReady=()=>{if(B++,B>=this._readyCount)this._emitReady=IeH,this._readyEmitted=!0,process.nextTick(()=>this.emit(xU.READY))},this._emitRaw=(...f)=>this.emit(xU.RAW,...f),this._boundRemove=this._remove.bind(this),this.options=L,this._nodeFsHandler=new hd$(this),Object.freeze(L)}_addIgnoredPath(H){if(kd$(H)){for(let $ of this._ignoredPaths)if(kd$($)&&$.path===H.path&&$.recursive===H.recursive)return}this._ignoredPaths.add(H)}_removeIgnoredPath(H){if(this._ignoredPaths.delete(H),typeof H==="string"){for(let $ of this._ignoredPaths)if(kd$($)&&$.path===H)this._ignoredPaths.delete($)}}add(H,$,A){let{cwd:L}=this.options;this.closed=!1,this._closePromise=void 0;let I=E1L(H);if(L)I=I.map((D)=>{return onB(D,L)});if(I.forEach((D)=>{this._removeIgnoredPath(D)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=I.length,Promise.all(I.map(async(D)=>{let B=await this._nodeFsHandler._addToNodeFs(D,!A,void 0,0,$);if(B)this._emitReady();return B})).then((D)=>{if(this.closed)return;D.forEach((B)=>{if(B)this.add(z8.dirname(B),z8.basename($||B))})}),this}unwatch(H){if(this.closed)return this;let $=E1L(H),{cwd:A}=this.options;return $.forEach((L)=>{if(!z8.isAbsolute(L)&&!this._closers.has(L)){if(A)L=z8.join(A,L);L=z8.resolve(L)}if(this._closePath(L),this._addIgnoredPath(L),this._watched.has(L))this._addIgnoredPath({path:L,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let H=[];return this._closers.forEach(($)=>$.forEach((A)=>{let L=A();if(L instanceof Promise)H.push(L)})),this._streams.forEach(($)=>$.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(($)=>$.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=H.length?Promise.all(H).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let H={};return this._watched.forEach(($,A)=>{let I=(this.options.cwd?z8.relative(this.options.cwd,A):A)||J1L;H[I]=$.getChildren().sort()}),H}emitWithAll(H,$){if(this.emit(H,...$),H!==xU.ERROR)this.emit(xU.ALL,H,...$)}async _emit(H,$,A){if(this.closed)return;let L=this.options;if(vd$)$=z8.normalize($);if(L.cwd)$=z8.relative(L.cwd,$);let I=[$];if(A!=null)I.push(A);let D=L.awaitWriteFinish,B;if(D&&(B=this._pendingWrites.get($)))return B.lastChange=new Date,this;if(L.atomic){if(H===xU.UNLINK)return this._pendingUnlinks.set($,[H,...I]),setTimeout(()=>{this._pendingUnlinks.forEach((f,E)=>{this.emit(...f),this.emit(xU.ALL,...f),this._pendingUnlinks.delete(E)})},typeof L.atomic==="number"?L.atomic:100),this;if(H===xU.ADD&&this._pendingUnlinks.has($))H=xU.CHANGE,this._pendingUnlinks.delete($)}if(D&&(H===xU.ADD||H===xU.CHANGE)&&this._readyEmitted){let f=(E,M)=>{if(E)H=xU.ERROR,I[0]=E,this.emitWithAll(H,I);else if(M){if(I.length>1)I[1]=M;else I.push(M);this.emitWithAll(H,I)}};return this._awaitWriteFinish($,D.stabilityThreshold,H,f),this}if(H===xU.CHANGE){if(!this._throttle(xU.CHANGE,$,50))return this}if(L.alwaysStat&&A===void 0&&(H===xU.ADD||H===xU.ADD_DIR||H===xU.CHANGE)){let f=L.cwd?z8.join(L.cwd,$):$,E;try{E=await feH.stat(f)}catch(M){}if(!E||this.closed)return;I.push(E)}return this.emitWithAll(H,I),this}_handleError(H){let $=H&&H.code;if(H&&$!=="ENOENT"&&$!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||$!=="EPERM"&&$!=="EACCES"))this.emit(xU.ERROR,H);return H||this.closed}_throttle(H,$,A){if(!this._throttled.has(H))this._throttled.set(H,new Map);let L=this._throttled.get(H);if(!L)throw Error("invalid throttle");let I=L.get($);if(I)return I.count++,!1;let D,B=()=>{let E=L.get($),M=E?E.count:0;if(L.delete($),clearTimeout(D),E)clearTimeout(E.timeoutObject);return M};D=setTimeout(B,A);let f={timeoutObject:D,clear:B,count:0};return L.set($,f),f}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(H,$,A,L){let I=this.options.awaitWriteFinish;if(typeof I!=="object")return;let D=I.pollInterval,B,f=H;if(this.options.cwd&&!z8.isAbsolute(H))f=z8.join(this.options.cwd,H);let E=new Date,M=this._pendingWrites;function G(U){U1L.stat(f,(X,J)=>{if(X||!M.has(H)){if(X&&X.code!=="ENOENT")L(X);return}let F=Number(new Date);if(U&&J.size!==U.size)M.get(H).lastChange=F;let Q=M.get(H);if(F-Q.lastChange>=$)M.delete(H),L(void 0,J);else B=setTimeout(G,D,J)})}if(!M.has(H))M.set(H,{lastChange:E,cancelWait:()=>{return M.delete(H),clearTimeout(B),A}}),B=setTimeout(G,D)}_isIgnored(H,$){if(this.options.atomic&&lnB.test(H))return!0;if(!this._userIgnored){let{cwd:A}=this.options,I=(this.options.ignored||[]).map(G1L(A)),B=[...[...this._ignoredPaths].map(G1L(A)),...I];this._userIgnored=anB(B,void 0)}return this._userIgnored(H,$)}_isntIgnored(H,$){return!this._isIgnored(H,$)}_getWatchHelpers(H){return new Q1L(H,this.options.followSymlinks,this)}_getWatchedDir(H){let $=z8.resolve(H);if(!this._watched.has($))this._watched.set($,new K1L($,this._boundRemove));return this._watched.get($)}_hasReadPermissions(H){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number(H.mode)&256)}_remove(H,$,A){let L=z8.join(H,$),I=z8.resolve(L);if(A=A!=null?A:this._watched.has(L)||this._watched.has(I),!this._throttle("remove",L,100))return;if(!A&&this._watched.size===1)this.add(H,$,!0);this._getWatchedDir(L).getChildren().forEach((U)=>this._remove(L,U));let f=this._getWatchedDir(H),E=f.has($);if(f.remove($),this._symlinkPaths.has(I))this._symlinkPaths.delete(I);let M=L;if(this.options.cwd)M=z8.relative(this.options.cwd,L);if(this.options.awaitWriteFinish&&this._pendingWrites.has(M)){if(this._pendingWrites.get(M).cancelWait()===xU.ADD)return}this._watched.delete(L),this._watched.delete(I);let G=A?xU.UNLINK_DIR:xU.UNLINK;if(E&&!this._isIgnored(L))this._emit(G,L);this._closePath(L)}_closePath(H){this._closeFile(H);let $=z8.dirname(H);this._getWatchedDir($).remove(z8.basename(H))}_closeFile(H){let $=this._closers.get(H);if(!$)return;$.forEach((A)=>A()),this._closers.delete(H)}_addPathCloser(H,$){if(!$)return;let A=this._closers.get(H);if(!A)A=[],this._closers.set(H,A);A.push($)}_readdirp(H,$){if(this.closed)return;let A={type:xU.ALL,alwaysStat:!0,lstat:!0,...$,depth:0},L=s9L(H,A);return this._streams.add(L),L.once(A1L,()=>{L=void 0}),L.once(yd$,()=>{if(L)this._streams.delete(L),L=void 0}),L}};YGH={watch:HrB,FSWatcher:ud$}});function IrB(){if(gd$||pd$)return;gd$=!0;let{dirs:H,settingsFiles:$}=frB();if(H.length===0)return;N(`Watching for changes in setting files ${[...$].join(", ")}...`),CGH=YGH.watch(H,{persistent:!0,ignoreInitial:!0,depth:0,awaitWriteFinish:{stabilityThreshold:md$?.stabilityThreshold??$rB,pollInterval:md$?.pollInterval??ArB},ignored:(A,L)=>{if(L&&!L.isFile()&&!L.isDirectory())return!0;if(A.split(GeH.sep).some((I)=>I===".git"))return!0;if(!L||L.isDirectory())return!1;return!$.has(A)},ignorePermissionErrors:!0,usePolling:!1,atomic:!0}),CGH.on("change",ErB),CGH.on("unlink",MrB),PB(async()=>W1L())}function W1L(){if(pd$=!0,CGH)CGH.close(),CGH=null;MeH.clear(),wGH.clear()}function DrB(H){return wGH.add(H),()=>{wGH.delete(H)}}function BrB(H){let $=aM(H);if($)MeH.set($,Date.now())}function frB(){let H=zH(),$=new Map,A=new Set;for(let I of j_){if(I==="flagSettings")continue;let D=aM(I);if(!D)continue;let B=GeH.dirname(D);if(!$.has(B))$.set(B,new Set);$.get(B).add(D);try{if(H.statSync(D).isFile())A.add(B)}catch{}}let L=new Set;for(let I of A){let D=$.get(I);if(D)for(let B of D)L.add(B)}return{dirs:[...A],settingsFiles:L}}function ErB(H){let $=V1L(H);if(!$)return;let A=MeH.get(H);if(A&&Date.now()-AL($))}function MrB(H){let $=V1L(H);if(!$)return;N(`Detected deletion of ${H}`),wGH.forEach((A)=>A($))}function V1L(H){return j_.find(($)=>aM($)===H)}function GrB(H){N(`Programmatic settings change notification for ${H}`),wGH.forEach(($)=>$(H))}function UrB(H){gd$=!1,pd$=!1,md$=H??null}var GeH,$rB=1000,ArB=500,LrB=5000,CGH=null,gd$=!1,pd$=!1,MeH,wGH,md$=null,AF;var gk=K(()=>{EeH();E$();DL();mL();W4();ZE();GeH=b(require("path")),MeH=new Map,wGH=new Set;AF={initialize:IrB,dispose:W1L,subscribe:DrB,markInternalWrite:BrB,notifyChange:GrB,resetForTesting:UrB}});function sI(){return A$(process.env.CLAUDE_CODE_USE_BEDROCK)?"bedrock":A$(process.env.CLAUDE_CODE_USE_VERTEX)?"vertex":A$(process.env.CLAUDE_CODE_USE_FOUNDRY)?"foundry":"firstParty"}function SR(){return sI()}function ZGH(){let H=process.env.ANTHROPIC_BASE_URL;if(!H)return!0;try{let $=new URL(H).host;return["api.anthropic.com"].includes($)}catch{return!1}}var oM=K(()=>{NA()});class TGH{heap;length;static#L=!1;static create(H){let $=C1L(H);if(!$)return[];TGH.#L=!0;let A=new TGH(H,$);return TGH.#L=!1,A}constructor(H,$){if(!TGH.#L)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new $(H),this.length=0}push(H){this.heap[this.length++]=H}pop(){return this.heap[--this.length]}}var qGH,_1L,dd$,Y1L=(H,$,A,L)=>{typeof dd$.emitWarning==="function"?dd$.emitWarning(H,$,A,L):console.error(`[${A}] ${$}: ${H}`)},UeH,P1L,XrB=(H)=>!_1L.has(H),W18,Cl=(H)=>H&&H===Math.floor(H)&&H>0&&isFinite(H),C1L=(H)=>!Cl(H)?null:H<=Math.pow(2,8)?Uint8Array:H<=Math.pow(2,16)?Uint16Array:H<=Math.pow(2,32)?Uint32Array:H<=Number.MAX_SAFE_INTEGER?YwH:null,YwH,gN;var CwH=K(()=>{qGH=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,_1L=new Set,dd$=typeof process==="object"&&!!process?process:{},UeH=globalThis.AbortController,P1L=globalThis.AbortSignal;if(typeof UeH>"u"){P1L=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(L,I){this._onabort.push(I)}},UeH=class{constructor(){$()}signal=new P1L;abort(L){if(this.signal.aborted)return;this.signal.reason=L,this.signal.aborted=!0;for(let I of this.signal._onabort)I(L);this.signal.onabort?.(L)}};let H=dd$.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",$=()=>{if(!H)return;H=!1,Y1L("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",$)}}W18=Symbol("type");YwH=class YwH extends Array{constructor(H){super(H);this.fill(0)}};gN=class gN{#L;#A;#$;#f;#M;#J;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#I;#W;#E;#D;#H;#G;#F;#K;#U;#_;#X;#Y;#P;#V;#C;#Z;#Q;static unsafeExposeInternals(H){return{starts:H.#P,ttls:H.#V,sizes:H.#Y,keyMap:H.#E,keyList:H.#D,valList:H.#H,next:H.#G,prev:H.#F,get head(){return H.#K},get tail(){return H.#U},free:H.#_,isBackgroundFetch:($)=>H.#B($),backgroundFetch:($,A,L,I)=>H.#y($,A,L,I),moveToTail:($)=>H.#S($),indexes:($)=>H.#q($),rindexes:($)=>H.#T($),isStale:($)=>H.#w($)}}get max(){return this.#L}get maxSize(){return this.#A}get calculatedSize(){return this.#W}get size(){return this.#I}get fetchMethod(){return this.#M}get memoMethod(){return this.#J}get dispose(){return this.#$}get disposeAfter(){return this.#f}constructor(H){let{max:$=0,ttl:A,ttlResolution:L=1,ttlAutopurge:I,updateAgeOnGet:D,updateAgeOnHas:B,allowStale:f,dispose:E,disposeAfter:M,noDisposeOnSet:G,noUpdateTTL:U,maxSize:X=0,maxEntrySize:J=0,sizeCalculation:F,fetchMethod:Q,memoMethod:W,noDeleteOnFetchRejection:P,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:Y,allowStaleOnFetchAbort:Z,ignoreFetchAbort:q}=H;if($!==0&&!Cl($))throw TypeError("max option must be a nonnegative integer");let O=$?C1L($):Array;if(!O)throw Error("invalid max value: "+$);if(this.#L=$,this.#A=X,this.maxEntrySize=J||this.#A,this.sizeCalculation=F,this.sizeCalculation){if(!this.#A&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(W!==void 0&&typeof W!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#J=W,Q!==void 0&&typeof Q!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#M=Q,this.#Z=!!Q,this.#E=new Map,this.#D=Array($).fill(void 0),this.#H=Array($).fill(void 0),this.#G=new O($),this.#F=new O($),this.#K=0,this.#U=0,this.#_=TGH.create($),this.#I=0,this.#W=0,typeof E==="function")this.#$=E;if(typeof M==="function")this.#f=M,this.#X=[];else this.#f=void 0,this.#X=void 0;if(this.#C=!!this.#$,this.#Q=!!this.#f,this.noDisposeOnSet=!!G,this.noUpdateTTL=!!U,this.noDeleteOnFetchRejection=!!P,this.allowStaleOnFetchRejection=!!Y,this.allowStaleOnFetchAbort=!!Z,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#A!==0){if(!Cl(this.#A))throw TypeError("maxSize must be a positive integer if specified")}if(!Cl(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#m()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!D,this.updateAgeOnHas=!!B,this.ttlResolution=Cl(L)||L===0?L:1,this.ttlAutopurge=!!I,this.ttl=A||0,this.ttl){if(!Cl(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#v()}if(this.#L===0&&this.ttl===0&&this.#A===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#L&&!this.#A){if(XrB("LRU_CACHE_UNBOUNDED"))_1L.add("LRU_CACHE_UNBOUNDED"),Y1L("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",gN)}}getRemainingTTL(H){return this.#E.has(H)?1/0:0}#v(){let H=new YwH(this.#L),$=new YwH(this.#L);this.#V=H,this.#P=$,this.#h=(I,D,B=qGH.now())=>{if($[I]=D!==0?B:0,H[I]=D,D!==0&&this.ttlAutopurge){let f=setTimeout(()=>{if(this.#w(I))this.#z(this.#D[I],"expire")},D+1);if(f.unref)f.unref()}},this.#O=(I)=>{$[I]=H[I]!==0?qGH.now():0},this.#N=(I,D)=>{if(H[D]){let B=H[D],f=$[D];if(!B||!f)return;I.ttl=B,I.start=f,I.now=A||L();let E=I.now-f;I.remainingTTL=B-E}};let A=0,L=()=>{let I=qGH.now();if(this.ttlResolution>0){A=I;let D=setTimeout(()=>A=0,this.ttlResolution);if(D.unref)D.unref()}return I};this.getRemainingTTL=(I)=>{let D=this.#E.get(I);if(D===void 0)return 0;let B=H[D],f=$[D];if(!B||!f)return 1/0;let E=(A||L())-f;return B-E},this.#w=(I)=>{let D=$[I],B=H[I];return!!B&&!!D&&(A||L())-D>B}}#O=()=>{};#N=()=>{};#h=()=>{};#w=()=>!1;#m(){let H=new YwH(this.#L);this.#W=0,this.#Y=H,this.#x=($)=>{this.#W-=H[$],H[$]=0},this.#b=($,A,L,I)=>{if(this.#B(A))return 0;if(!Cl(L))if(I){if(typeof I!=="function")throw TypeError("sizeCalculation must be a function");if(L=I(A,$),!Cl(L))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return L},this.#j=($,A,L)=>{if(H[$]=A,this.#A){let I=this.#A-H[$];while(this.#W>I)this.#R(!0)}if(this.#W+=H[$],L)L.entrySize=A,L.totalCalculatedSize=this.#W}}#x=(H)=>{};#j=(H,$,A)=>{};#b=(H,$,A,L)=>{if(A||L)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#q({allowStale:H=this.allowStale}={}){if(this.#I)for(let $=this.#U;;){if(!this.#k($))break;if(H||!this.#w($))yield $;if($===this.#K)break;else $=this.#F[$]}}*#T({allowStale:H=this.allowStale}={}){if(this.#I)for(let $=this.#K;;){if(!this.#k($))break;if(H||!this.#w($))yield $;if($===this.#U)break;else $=this.#G[$]}}#k(H){return H!==void 0&&this.#E.get(this.#D[H])===H}*entries(){for(let H of this.#q())if(this.#H[H]!==void 0&&this.#D[H]!==void 0&&!this.#B(this.#H[H]))yield[this.#D[H],this.#H[H]]}*rentries(){for(let H of this.#T())if(this.#H[H]!==void 0&&this.#D[H]!==void 0&&!this.#B(this.#H[H]))yield[this.#D[H],this.#H[H]]}*keys(){for(let H of this.#q()){let $=this.#D[H];if($!==void 0&&!this.#B(this.#H[H]))yield $}}*rkeys(){for(let H of this.#T()){let $=this.#D[H];if($!==void 0&&!this.#B(this.#H[H]))yield $}}*values(){for(let H of this.#q())if(this.#H[H]!==void 0&&!this.#B(this.#H[H]))yield this.#H[H]}*rvalues(){for(let H of this.#T())if(this.#H[H]!==void 0&&!this.#B(this.#H[H]))yield this.#H[H]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(H,$={}){for(let A of this.#q()){let L=this.#H[A],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0)continue;if(H(I,this.#D[A],this))return this.get(this.#D[A],$)}}forEach(H,$=this){for(let A of this.#q()){let L=this.#H[A],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0)continue;H.call($,I,this.#D[A],this)}}rforEach(H,$=this){for(let A of this.#T()){let L=this.#H[A],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0)continue;H.call($,I,this.#D[A],this)}}purgeStale(){let H=!1;for(let $ of this.#T({allowStale:!0}))if(this.#w($))this.#z(this.#D[$],"expire"),H=!0;return H}info(H){let $=this.#E.get(H);if($===void 0)return;let A=this.#H[$],L=this.#B(A)?A.__staleWhileFetching:A;if(L===void 0)return;let I={value:L};if(this.#V&&this.#P){let D=this.#V[$],B=this.#P[$];if(D&&B){let f=D-(qGH.now()-B);I.ttl=f,I.start=Date.now()}}if(this.#Y)I.size=this.#Y[$];return I}dump(){let H=[];for(let $ of this.#q({allowStale:!0})){let A=this.#D[$],L=this.#H[$],I=this.#B(L)?L.__staleWhileFetching:L;if(I===void 0||A===void 0)continue;let D={value:I};if(this.#V&&this.#P){D.ttl=this.#V[$];let B=qGH.now()-this.#P[$];D.start=Math.floor(Date.now()-B)}if(this.#Y)D.size=this.#Y[$];H.unshift([A,D])}return H}load(H){this.clear();for(let[$,A]of H){if(A.start){let L=Date.now()-A.start;A.start=qGH.now()-L}this.set($,A.value,A)}}set(H,$,A={}){if($===void 0)return this.delete(H),this;let{ttl:L=this.ttl,start:I,noDisposeOnSet:D=this.noDisposeOnSet,sizeCalculation:B=this.sizeCalculation,status:f}=A,{noUpdateTTL:E=this.noUpdateTTL}=A,M=this.#b(H,$,A.size||0,B);if(this.maxEntrySize&&M>this.maxEntrySize){if(f)f.set="miss",f.maxEntrySizeExceeded=!0;return this.#z(H,"set"),this}let G=this.#I===0?void 0:this.#E.get(H);if(G===void 0){if(G=this.#I===0?this.#U:this.#_.length!==0?this.#_.pop():this.#I===this.#L?this.#R(!1):this.#I,this.#D[G]=H,this.#H[G]=$,this.#E.set(H,G),this.#G[this.#U]=G,this.#F[G]=this.#U,this.#U=G,this.#I++,this.#j(G,M,f),f)f.set="add";E=!1}else{this.#S(G);let U=this.#H[G];if($!==U){if(this.#Z&&this.#B(U)){U.__abortController.abort(Error("replaced"));let{__staleWhileFetching:X}=U;if(X!==void 0&&!D){if(this.#C)this.#$?.(X,H,"set");if(this.#Q)this.#X?.push([X,H,"set"])}}else if(!D){if(this.#C)this.#$?.(U,H,"set");if(this.#Q)this.#X?.push([U,H,"set"])}if(this.#x(G),this.#j(G,M,f),this.#H[G]=$,f){f.set="replace";let X=U&&this.#B(U)?U.__staleWhileFetching:U;if(X!==void 0)f.oldValue=X}}else if(f)f.set="update"}if(L!==0&&!this.#V)this.#v();if(this.#V){if(!E)this.#h(G,L,I);if(f)this.#N(f,G)}if(!D&&this.#Q&&this.#X){let U=this.#X,X;while(X=U?.shift())this.#f?.(...X)}return this}pop(){try{while(this.#I){let H=this.#H[this.#K];if(this.#R(!0),this.#B(H)){if(H.__staleWhileFetching)return H.__staleWhileFetching}else if(H!==void 0)return H}}finally{if(this.#Q&&this.#X){let H=this.#X,$;while($=H?.shift())this.#f?.(...$)}}}#R(H){let $=this.#K,A=this.#D[$],L=this.#H[$];if(this.#Z&&this.#B(L))L.__abortController.abort(Error("evicted"));else if(this.#C||this.#Q){if(this.#C)this.#$?.(L,A,"evict");if(this.#Q)this.#X?.push([L,A,"evict"])}if(this.#x($),H)this.#D[$]=void 0,this.#H[$]=void 0,this.#_.push($);if(this.#I===1)this.#K=this.#U=0,this.#_.length=0;else this.#K=this.#G[$];return this.#E.delete(A),this.#I--,$}has(H,$={}){let{updateAgeOnHas:A=this.updateAgeOnHas,status:L}=$,I=this.#E.get(H);if(I!==void 0){let D=this.#H[I];if(this.#B(D)&&D.__staleWhileFetching===void 0)return!1;if(!this.#w(I)){if(A)this.#O(I);if(L)L.has="hit",this.#N(L,I);return!0}else if(L)L.has="stale",this.#N(L,I)}else if(L)L.has="miss";return!1}peek(H,$={}){let{allowStale:A=this.allowStale}=$,L=this.#E.get(H);if(L===void 0||!A&&this.#w(L))return;let I=this.#H[L];return this.#B(I)?I.__staleWhileFetching:I}#y(H,$,A,L){let I=$===void 0?void 0:this.#H[$];if(this.#B(I))return I;let D=new UeH,{signal:B}=A;B?.addEventListener("abort",()=>D.abort(B.reason),{signal:D.signal});let f={signal:D.signal,options:A,context:L},E=(F,Q=!1)=>{let{aborted:W}=D.signal,P=A.ignoreFetchAbort&&F!==void 0;if(A.status)if(W&&!Q){if(A.status.fetchAborted=!0,A.status.fetchError=D.signal.reason,P)A.status.fetchAbortIgnored=!0}else A.status.fetchResolved=!0;if(W&&!P&&!Q)return G(D.signal.reason);let C=X;if(this.#H[$]===X)if(F===void 0)if(C.__staleWhileFetching)this.#H[$]=C.__staleWhileFetching;else this.#z(H,"fetch");else{if(A.status)A.status.fetchUpdated=!0;this.set(H,F,f.options)}return F},M=(F)=>{if(A.status)A.status.fetchRejected=!0,A.status.fetchError=F;return G(F)},G=(F)=>{let{aborted:Q}=D.signal,W=Q&&A.allowStaleOnFetchAbort,P=W||A.allowStaleOnFetchRejection,C=P||A.noDeleteOnFetchRejection,Y=X;if(this.#H[$]===X){if(!C||Y.__staleWhileFetching===void 0)this.#z(H,"fetch");else if(!W)this.#H[$]=Y.__staleWhileFetching}if(P){if(A.status&&Y.__staleWhileFetching!==void 0)A.status.returnedStale=!0;return Y.__staleWhileFetching}else if(Y.__returned===Y)throw F},U=(F,Q)=>{let W=this.#M?.(H,I,f);if(W&&W instanceof Promise)W.then((P)=>F(P===void 0?void 0:P),Q);D.signal.addEventListener("abort",()=>{if(!A.ignoreFetchAbort||A.allowStaleOnFetchAbort){if(F(void 0),A.allowStaleOnFetchAbort)F=(P)=>E(P,!0)}})};if(A.status)A.status.fetchDispatched=!0;let X=new Promise(U).then(E,M),J=Object.assign(X,{__abortController:D,__staleWhileFetching:I,__returned:void 0});if($===void 0)this.set(H,J,{...f.options,status:void 0}),$=this.#E.get(H);else this.#H[$]=J;return J}#B(H){if(!this.#Z)return!1;let $=H;return!!$&&$ instanceof Promise&&$.hasOwnProperty("__staleWhileFetching")&&$.__abortController instanceof UeH}async fetch(H,$={}){let{allowStale:A=this.allowStale,updateAgeOnGet:L=this.updateAgeOnGet,noDeleteOnStaleGet:I=this.noDeleteOnStaleGet,ttl:D=this.ttl,noDisposeOnSet:B=this.noDisposeOnSet,size:f=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:M=this.noUpdateTTL,noDeleteOnFetchRejection:G=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:U=this.allowStaleOnFetchRejection,ignoreFetchAbort:X=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:F,forceRefresh:Q=!1,status:W,signal:P}=$;if(!this.#Z){if(W)W.fetch="get";return this.get(H,{allowStale:A,updateAgeOnGet:L,noDeleteOnStaleGet:I,status:W})}let C={allowStale:A,updateAgeOnGet:L,noDeleteOnStaleGet:I,ttl:D,noDisposeOnSet:B,size:f,sizeCalculation:E,noUpdateTTL:M,noDeleteOnFetchRejection:G,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:J,ignoreFetchAbort:X,status:W,signal:P},Y=this.#E.get(H);if(Y===void 0){if(W)W.fetch="miss";let Z=this.#y(H,Y,C,F);return Z.__returned=Z}else{let Z=this.#H[Y];if(this.#B(Z)){let y=A&&Z.__staleWhileFetching!==void 0;if(W){if(W.fetch="inflight",y)W.returnedStale=!0}return y?Z.__staleWhileFetching:Z.__returned=Z}let q=this.#w(Y);if(!Q&&!q){if(W)W.fetch="hit";if(this.#S(Y),L)this.#O(Y);if(W)this.#N(W,Y);return Z}let O=this.#y(H,Y,C,F),u=O.__staleWhileFetching!==void 0&&A;if(W){if(W.fetch=q?"stale":"refresh",u&&q)W.returnedStale=!0}return u?O.__staleWhileFetching:O.__returned=O}}async forceFetch(H,$={}){let A=await this.fetch(H,$);if(A===void 0)throw Error("fetch() returned undefined");return A}memo(H,$={}){let A=this.#J;if(!A)throw Error("no memoMethod provided to constructor");let{context:L,forceRefresh:I,...D}=$,B=this.get(H,D);if(!I&&B!==void 0)return B;let f=A(H,B,{options:D,context:L});return this.set(H,f,D),f}get(H,$={}){let{allowStale:A=this.allowStale,updateAgeOnGet:L=this.updateAgeOnGet,noDeleteOnStaleGet:I=this.noDeleteOnStaleGet,status:D}=$,B=this.#E.get(H);if(B!==void 0){let f=this.#H[B],E=this.#B(f);if(D)this.#N(D,B);if(this.#w(B)){if(D)D.get="stale";if(!E){if(!I)this.#z(H,"expire");if(D&&A)D.returnedStale=!0;return A?f:void 0}else{if(D&&A&&f.__staleWhileFetching!==void 0)D.returnedStale=!0;return A?f.__staleWhileFetching:void 0}}else{if(D)D.get="hit";if(E)return f.__staleWhileFetching;if(this.#S(B),L)this.#O(B);return f}}else if(D)D.get="miss"}#u(H,$){this.#F[$]=H,this.#G[H]=$}#S(H){if(H!==this.#U){if(H===this.#K)this.#K=this.#G[H];else this.#u(this.#F[H],this.#G[H]);this.#u(this.#U,H),this.#U=H}}delete(H){return this.#z(H,"delete")}#z(H,$){let A=!1;if(this.#I!==0){let L=this.#E.get(H);if(L!==void 0)if(A=!0,this.#I===1)this.#g($);else{this.#x(L);let I=this.#H[L];if(this.#B(I))I.__abortController.abort(Error("deleted"));else if(this.#C||this.#Q){if(this.#C)this.#$?.(I,H,$);if(this.#Q)this.#X?.push([I,H,$])}if(this.#E.delete(H),this.#D[L]=void 0,this.#H[L]=void 0,L===this.#U)this.#U=this.#F[L];else if(L===this.#K)this.#K=this.#G[L];else{let D=this.#F[L];this.#G[D]=this.#G[L];let B=this.#G[L];this.#F[B]=this.#F[L]}this.#I--,this.#_.push(L)}}if(this.#Q&&this.#X?.length){let L=this.#X,I;while(I=L?.shift())this.#f?.(...I)}return A}clear(){return this.#g("delete")}#g(H){for(let $ of this.#T({allowStale:!0})){let A=this.#H[$];if(this.#B(A))A.__abortController.abort(Error("deleted"));else{let L=this.#D[$];if(this.#C)this.#$?.(A,L,H);if(this.#Q)this.#X?.push([A,L,H])}}if(this.#E.clear(),this.#H.fill(void 0),this.#D.fill(void 0),this.#V&&this.#P)this.#V.fill(0),this.#P.fill(0);if(this.#Y)this.#Y.fill(0);if(this.#K=0,this.#U=0,this.#_.length=0,this.#W=0,this.#I=0,this.#Q&&this.#X){let $=this.#X,A;while(A=$?.shift())this.#f?.(...A)}}}});function cd$(H,$=300000){let A=new Map,L=(...I)=>{let D=yH(I),B=A.get(D),f=Date.now();if(!B){let E=H(...I);return A.set(D,{value:E,timestamp:f,refreshing:!1}),E}if(B&&f-B.timestamp>$&&!B.refreshing)return B.refreshing=!0,Promise.resolve().then(()=>{let E=H(...I);A.set(D,{value:E,timestamp:Date.now(),refreshing:!1})}).catch((E)=>{r(E instanceof Error?E:Error(String(E))),A.delete(D)}),B.value;return A.get(D).value};return L.cache={clear:()=>A.clear()},L}function zGH(H,$=300000){let A=new Map,L=async(...I)=>{let D=yH(I),B=A.get(D),f=Date.now();if(!B){let E=await H(...I);return A.set(D,{value:E,timestamp:f,refreshing:!1}),E}if(B&&f-B.timestamp>$&&!B.refreshing)return B.refreshing=!0,H(...I).then((E)=>{A.set(D,{value:E,timestamp:Date.now(),refreshing:!1})}).catch((E)=>{r(E instanceof Error?E:Error(String(E))),A.delete(D)}),B.value;return A.get(D).value};return L.cache={clear:()=>A.clear()},L}var wwH=K(()=>{_$();Z$()});function KrB(){let H=new Map;for(let[$,A]of Object.entries(P4)){for(let[L,I]of Object.entries(A))P4[L]={open:`\x1B[${I[0]}m`,close:`\x1B[${I[1]}m`},A[L]=P4[L],H.set(I[0],I[1]);Object.defineProperty(P4,$,{value:A,enumerable:!1})}return Object.defineProperty(P4,"codes",{value:H,enumerable:!1}),P4.color.close="\x1B[39m",P4.bgColor.close="\x1B[49m",P4.color.ansi=w1L(),P4.color.ansi256=Z1L(),P4.color.ansi16m=q1L(),P4.bgColor.ansi=w1L(10),P4.bgColor.ansi256=Z1L(10),P4.bgColor.ansi16m=q1L(10),Object.defineProperties(P4,{rgbToAnsi256:{value($,A,L){if($===A&&A===L){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(A/255*5)+Math.round(L/255*5)},enumerable:!1},hexToRgb:{value($){let A=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!A)return[0,0,0];let[L]=A;if(L.length===3)L=[...L].map((D)=>D+D).join("");let I=Number.parseInt(L,16);return[I>>16&255,I>>8&255,I&255]},enumerable:!1},hexToAnsi256:{value:($)=>P4.rgbToAnsi256(...P4.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value($){if($<8)return 30+$;if($<16)return 90+($-8);let A,L,I;if($>=232)A=(($-232)*10+8)/255,L=A,I=A;else{$-=16;let f=$%36;A=Math.floor($/36)/5,L=Math.floor(f/6)/5,I=f%6/5}let D=Math.max(A,L,I)*2;if(D===0)return 30;let B=30+(Math.round(I)<<2|Math.round(L)<<1|Math.round(A));if(D===2)B+=60;return B},enumerable:!1},rgbToAnsi:{value:($,A,L)=>P4.ansi256ToAnsi(P4.rgbToAnsi256($,A,L)),enumerable:!1},hexToAnsi:{value:($)=>P4.ansi256ToAnsi(P4.hexToAnsi256($)),enumerable:!1}}),P4}var w1L=(H=0)=>($)=>`\x1B[${$+H}m`,Z1L=(H=0)=>($)=>`\x1B[${38+H};5;${$}m`,q1L=(H=0)=>($,A,L)=>`\x1B[${38+H};2;${$};${A};${L}m`,P4,C18,JrB,FrB,w18,QrB,mN;var T1L=K(()=>{P4={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},C18=Object.keys(P4.modifier),JrB=Object.keys(P4.color),FrB=Object.keys(P4.bgColor),w18=[...JrB,...FrB];QrB=KrB(),mN=QrB});function sZ(H,$=globalThis.Deno?globalThis.Deno.args:JeH.default.argv){let A=H.startsWith("-")?"":H.length===1?"-":"--",L=$.indexOf(A+H),I=$.indexOf("--");return L!==-1&&(I===-1||L=2,has16m:H>=3}}function PrB(H,{streamIsTTY:$,sniffFlags:A=!0}={}){let L=WrB();if(L!==void 0)XeH=L;let I=A?XeH:L;if(I===0)return 0;if(A){if(sZ("color=16m")||sZ("color=full")||sZ("color=truecolor"))return 3;if(sZ("color=256"))return 2}if("TF_BUILD"in GX&&"AGENT_NAME"in GX)return 1;if(H&&!$&&I===void 0)return 0;let D=I||0;if(GX.TERM==="dumb")return D;if(JeH.default.platform==="win32"){let B=N1L.default.release().split(".");if(Number(B[0])>=10&&Number(B[2])>=10586)return Number(B[2])>=14931?3:2;return 1}if("CI"in GX){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((B)=>(B in GX)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((B)=>(B in GX))||GX.CI_NAME==="codeship")return 1;return D}if("TEAMCITY_VERSION"in GX)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(GX.TEAMCITY_VERSION)?1:0;if(GX.COLORTERM==="truecolor")return 3;if(GX.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in GX){let B=Number.parseInt((GX.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(GX.TERM_PROGRAM){case"iTerm.app":return B>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(GX.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(GX.TERM))return 1;if("COLORTERM"in GX)return 1;return D}function z1L(H,$={}){let A=PrB(H,{streamIsTTY:H&&H.isTTY,...$});return VrB(A)}var JeH,N1L,ld$,GX,XeH,_rB,O1L;var x1L=K(()=>{JeH=b(require("process")),N1L=b(require("os")),ld$=b(require("tty"));({env:GX}=JeH.default);if(sZ("no-color")||sZ("no-colors")||sZ("color=false")||sZ("color=never"))XeH=0;else if(sZ("color")||sZ("colors")||sZ("color=true")||sZ("color=always"))XeH=1;_rB={stdout:z1L({isTTY:ld$.default.isatty(1)}),stderr:z1L({isTTY:ld$.default.isatty(2)})},O1L=_rB});function S1L(H,$,A){let L=H.indexOf($);if(L===-1)return H;let I=$.length,D=0,B="";do B+=H.slice(D,L)+$+A,D=L+I,L=H.indexOf($,D);while(L!==-1);return B+=H.slice(D),B}function j1L(H,$,A,L){let I=0,D="";do{let B=H[L-1]==="\r";D+=H.slice(I,B?L-1:L)+$+(B?`\r `);if(D!==-1)$=j1L($,I,L,D);return L+$+I},qrB,x18,oH;var r0=K(()=>{T1L();x1L();({stdout:R1L,stderr:y1L}=O1L),id$=Symbol("GENERATOR"),NGH=Symbol("STYLER"),ZwH=Symbol("IS_EMPTY"),v1L=["ansi","ansi","ansi256","ansi16m"],OGH=Object.create(null);Object.setPrototypeOf(qwH.prototype,Function.prototype);for(let[H,$]of Object.entries(mN))OGH[H]={get(){let A=FeH(this,rd$($.open,$.close,this[NGH]),this[ZwH]);return Object.defineProperty(this,H,{value:A}),A}};OGH.visible={get(){let H=FeH(this,this[NGH],!0);return Object.defineProperty(this,"visible",{value:H}),H}};CrB=["rgb","hex","ansi256"];for(let H of CrB){OGH[H]={get(){let{level:A}=this;return function(...L){let I=rd$(nd$(H,v1L[A],"color",...L),mN.color.close,this[NGH]);return FeH(this,I,this[ZwH])}}};let $="bg"+H[0].toUpperCase()+H.slice(1);OGH[$]={get(){let{level:A}=this;return function(...L){let I=rd$(nd$(H,v1L[A],"bgColor",...L),mN.bgColor.close,this[NGH]);return FeH(this,I,this[ZwH])}}}}wrB=Object.defineProperties(()=>{},{...OGH,level:{enumerable:!0,get(){return this[id$].level},set(H){this[id$].level=H}}});Object.defineProperties(qwH.prototype,OGH);qrB=qwH(),x18=qwH({level:y1L?y1L.level:0}),oH=qrB});function xGH(){TrB={data:null,valid:!1}}function b1L(){return!1}var TrB;var TwH=K(()=>{Ok$();B0();NA();qE();O_();Z$();TrB={data:null,valid:!1}});function od$(){let H=UL(),$=".credentials.json";return{storageDir:H,storagePath:k1L.join(H,".credentials.json")}}var k1L,u1L,g1L;var m1L=K(()=>{DL();NA();Z$();Z$();k1L=require("path"),u1L=require("fs");g1L={name:"plaintext",read(){let{storagePath:H}=od$();if(zH().existsSync(H))try{let $=zH().readFileSync(H,{encoding:"utf8"});return DA($)}catch($){return null}return null},async readAsync(){return this.read()},update(H){try{let{storageDir:$,storagePath:A}=od$();if(!zH().existsSync($))zH().mkdirSync($);return iL(A,yH(H),{encoding:"utf8",flush:!1}),u1L.chmodSync(A,384),{success:!0,warning:"Warning: Storing credentials in plaintext."}}catch($){return{success:!1}}},delete(){let{storagePath:H}=od$();if(zH().existsSync(H))try{return zH().unlinkSync(H),!0}catch($){return!1}return!0}}});function hW(){return g1L}var KeH=K(()=>{TwH();m1L()});function QeH(){let H=Dj$();if(H!==void 0)return H;let $=process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR;if(!$)return PHH(null),null;let A=parseInt($,10);if(Number.isNaN(A))return N(`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${$}`,{level:"error"}),PHH(null),null;try{let L=zH(),I=`/proc/self/fd/${A}`,D=L.readFileSync(I,{encoding:"utf8"}).trim();if(!D)return N("File descriptor contained empty OAuth token",{level:"error"}),PHH(null),null;return N(`Successfully read OAuth token from file descriptor ${A}`),PHH(D),D}catch(L){return N(`Failed to read OAuth token from file descriptor ${A}: ${L instanceof Error?L.message:String(L)}`,{level:"error"}),PHH(null),null}}function td$(){let H=Bj$();if(H!==void 0)return H;let $=process.env.CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR;if(!$)return _HH(null),null;let A=parseInt($,10);if(Number.isNaN(A))return N(`CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${$}`,{level:"error"}),_HH(null),null;try{let L=zH(),I=`/proc/self/fd/${A}`,D=L.readFileSync(I,{encoding:"utf8"}).trim();if(!D)return N("File descriptor contained empty API key",{level:"error"}),_HH(null),null;return N(`Successfully read API key from file descriptor ${A}`),_HH(D),D}catch(L){return N(`Failed to read API key from file descriptor ${A}: ${L instanceof Error?L.message:String(L)}`,{level:"error"}),_HH(null),null}}var p1L=K(()=>{E$();DL();g$()});async function WeH(){let $=M$().oauthAccount?.accountUuid,A=eZ();if(!$||!A)return;let L=`${XD().BASE_API_URL}/api/claude_cli_profile`;try{return(await nA.get(L,{headers:{"x-api-key":A,"anthropic-beta":N_},params:{account_uuid:$}})).data}catch(I){r(I)}}async function SGH(H){let $=`${XD().BASE_API_URL}/api/oauth/profile`;try{return(await nA.get($,{headers:{Authorization:`Bearer ${H}`,"Content-Type":"application/json"}})).data}catch(A){r(A)}}var zwH=K(()=>{w1();qE();EI();vA();_$()});function mk(H){return Boolean(H?.includes(VR))}function VeH(H){return H?.split(" ").filter(Boolean)??[]}function sd$({codeChallenge:H,state:$,port:A,isManual:L,loginWithClaudeAi:I,inferenceOnly:D,orgUUID:B}){let f=I?XD().CLAUDE_AI_AUTHORIZE_URL:XD().CONSOLE_AUTHORIZE_URL,E=new URL(f);E.searchParams.append("code","true"),E.searchParams.append("client_id",XD().CLIENT_ID),E.searchParams.append("response_type","code"),E.searchParams.append("redirect_uri",L?XD().MANUAL_REDIRECT_URL:`http://localhost:${A}/callback`);let M=D?[VR]:XAL;if(E.searchParams.append("scope",M.join(" ")),E.searchParams.append("code_challenge",H),E.searchParams.append("code_challenge_method","S256"),E.searchParams.append("state",$),B)E.searchParams.append("orgUUID",B);return E.toString()}async function d1L(H,$,A,L,I=!1,D){let B={grant_type:"authorization_code",code:H,redirect_uri:I?XD().MANUAL_REDIRECT_URL:`http://localhost:${L}/callback`,client_id:XD().CLIENT_ID,code_verifier:A,state:$};if(D!==void 0)B.expires_in=D;let f=await nA.post(XD().TOKEN_URL,B,{headers:{"Content-Type":"application/json"}});if(f.status!==200)throw Error(f.status===401?"Authentication failed: Invalid authorization code":`Token exchange failed (${f.status}): ${f.statusText}`);return c("tengu_oauth_token_exchange_success",{}),f.data}async function c1L(H){let $={grant_type:"refresh_token",refresh_token:H,client_id:XD().CLIENT_ID,scope:Fb$.join(" ")};try{let A=await nA.post(XD().TOKEN_URL,$,{headers:{"Content-Type":"application/json"}});if(A.status!==200)throw Error(`Token refresh failed: ${A.statusText}`);let L=A.data,{access_token:I,refresh_token:D=H,expires_in:B}=L,f=Date.now()+B*1000,E=VeH(L.scope);c("tengu_oauth_token_refresh_success",{});let M=await ed$(I);if(M$().oauthAccount){let U={};if(M.displayName!==void 0)U.displayName=M.displayName;if(typeof M.hasExtraUsageEnabled==="boolean")U.hasExtraUsageEnabled=M.hasExtraUsageEnabled;if(M.billingType!==null)U.billingType=M.billingType;if(M.accountCreatedAt!==void 0)U.accountCreatedAt=M.accountCreatedAt;if(M.subscriptionCreatedAt!==void 0)U.subscriptionCreatedAt=M.subscriptionCreatedAt;if(Object.keys(U).length>0)AA((X)=>({...X,oauthAccount:X.oauthAccount?{...X.oauthAccount,...U}:X.oauthAccount}))}return{accessToken:I,refreshToken:D,expiresAt:f,scopes:E,subscriptionType:M.subscriptionType,rateLimitTier:M.rateLimitTier}}catch(A){throw c("tengu_oauth_token_refresh_failure",{error:A.message}),A}}async function l1L(H){let $=await nA.get(XD().ROLES_URL,{headers:{Authorization:`Bearer ${H}`}});if($.status!==200)throw Error(`Failed to fetch user roles: ${$.statusText}`);let A=$.data;if(!M$().oauthAccount)throw Error("OAuth account information not found in config");AA((I)=>({...I,oauthAccount:I.oauthAccount?{...I.oauthAccount,organizationRole:A.organization_role,workspaceRole:A.workspace_role,organizationName:A.organization_name}:I.oauthAccount})),c("tengu_oauth_roles_stored",{org_role:A.organization_role})}async function i1L(H){try{let $=await nA.post(XD().API_KEY_URL,null,{headers:{Authorization:`Bearer ${H}`}}),A=$.data?.raw_key;if(A)return await r1L(A),c("tengu_oauth_api_key",{status:"success",statusCode:$.status}),A;return null}catch($){throw c("tengu_oauth_api_key",{status:"failure",error:$ instanceof Error?$.message:String($)}),$}}function pk(H){if(H===null)return!1;let $=300000;return Date.now()+$>=H}async function ed$(H){let $=await SGH(H),A=$?.organization?.organization_type,L=null;switch(A){case"claude_max":L="max";break;case"claude_pro":L="pro";break;case"claude_enterprise":L="enterprise";break;case"claude_team":L="team";break;default:L=null;break}let I={subscriptionType:L,rateLimitTier:$?.organization?.rate_limit_tier??null,hasExtraUsageEnabled:$?.organization?.has_extra_usage_enabled??null,billingType:$?.organization?.billing_type??null};if($?.account?.display_name)I.displayName=$.account.display_name;if($?.account?.created_at)I.accountCreatedAt=$.account.created_at;if($?.organization?.subscription_created_at)I.subscriptionCreatedAt=$.organization.subscription_created_at;return c("tengu_oauth_profile_fetch_success",{}),I}async function jR(){let $=M$().oauthAccount?.organizationUuid;if($)return $;let A=dD()?.accessToken;if(A===void 0)return null;let I=(await SGH(A))?.organization?.uuid;if(!I)return null;return I}async function n1L(){let H=M$();if(H.oauthAccount&&H.oauthAccount.billingType!==void 0&&H.oauthAccount.accountCreatedAt!==void 0&&H.oauthAccount.subscriptionCreatedAt!==void 0||!nL())return!1;let $=dD();if($?.accessToken){let A=await SGH($.accessToken);if(A)return Hc$({accountUuid:A.account.uuid,emailAddress:A.account.email,organizationUuid:A.organization.uuid,displayName:A.account.display_name||void 0,hasExtraUsageEnabled:A.organization.has_extra_usage_enabled??!1,billingType:A.organization.billing_type??void 0,accountCreatedAt:A.account.created_at,subscriptionCreatedAt:A.organization.subscription_created_at??void 0}),!0}return!1}function Hc$({accountUuid:H,emailAddress:$,organizationUuid:A,displayName:L,hasExtraUsageEnabled:I,billingType:D,accountCreatedAt:B,subscriptionCreatedAt:f}){let E={accountUuid:H,emailAddress:$,organizationUuid:A,hasExtraUsageEnabled:I,billingType:D,accountCreatedAt:B,subscriptionCreatedAt:f};if(L)E.displayName=L;AA((M)=>{if(M.oauthAccount?.accountUuid===E.accountUuid&&M.oauthAccount?.emailAddress===E.emailAddress&&M.oauthAccount?.organizationUuid===E.organizationUuid&&M.oauthAccount?.displayName===E.displayName&&M.oauthAccount?.hasExtraUsageEnabled===E.hasExtraUsageEnabled&&M.oauthAccount?.billingType===E.billingType&&M.oauthAccount?.accountCreatedAt===E.accountCreatedAt&&M.oauthAccount?.subscriptionCreatedAt===E.subscriptionCreatedAt)return M;return{...M,oauthAccount:E}})}var Hq=K(()=>{w1();qE();z$();vA();EI();zwH()});function o1L(){return null}function t1L(H){let $=o1L();if(!$)return H;let A=new globalThis.Headers(H);return Object.entries($).forEach(([L,I])=>{if(I!==void 0)A.set(L,I)}),A}function jGH(){return PeH&&!1}function s1L(){return null}function e1L(){return PeH&&a1L!==null&&!1}var NrB,PeH=!1,a1L=null,OrB="max";var $c$=K(()=>{vA();NrB={}});function xrB(H){let $=[],A=[];for(let L of H)if(H8L.includes(L))$.push(L);else A.push(L);return{allowed:$,disallowed:A}}function $8L(H){if(!H||H.length===0)return;if(nL()){console.warn("Warning: Custom betas are only available for API key users. Ignoring provided betas.");return}let{allowed:$,disallowed:A}=xrB(H);for(let L of A)console.warn(`Warning: Beta header '${L}' is not allowed. Only the following betas are supported: ${H8L.join(", ")}`);return $.length>0?$:void 0}function SrB(H){let $=sI();if($==="foundry")return!0;if($==="firstParty")return!H.includes("claude-3-");return H.includes("claude-opus-4")||H.includes("claude-sonnet-4")}function jrB(H){let $=H.toLowerCase();return $.includes("claude-opus-4")||$.includes("claude-sonnet-4")||$.includes("claude-haiku-4")}function RrB(H){let $=sI();if($==="foundry")return!0;if($==="firstParty")return!H.includes("claude-3-");return H.includes("claude-opus-4")||H.includes("claude-sonnet-4")||H.includes("claude-haiku-4")}function Ac$(H){let $=sI();if($!=="firstParty"&&$!=="foundry")return!1;return H.includes("claude-sonnet-4-5")||H.includes("claude-opus-4-1")||H.includes("claude-opus-4-5")||H.includes("claude-opus-4-6")||H.includes("claude-haiku-4-5")}function A8L(){let H=sI();if(H==="vertex"||H==="bedrock")return NcA;return zcA}function _eH(){return(sI()==="firstParty"||sI()==="foundry")&&!A$(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function YeH(H){let $=U2(H),A=V6();if(!A||A.length===0)return $;return[...$,...A.filter((L)=>!$.includes(L))]}function CeH(){Lc$.cache?.clear?.(),U2.cache?.clear?.(),Ic$.cache?.clear?.()}var H8L,Lc$,U2,Ic$;var $q=K(()=>{tD();g$();JHH();SD();qE();EI();NA();oM();SD();H8L=[zYH];Lc$=o$((H)=>{let $=[],A=H.includes("haiku"),L=sI(),I=_eH();if(!A)$.push(TcA);if(nL())$.push(N_);if(H.includes("[1m]"))$.push(zYH);if(!A$(process.env.DISABLE_INTERLEAVED_THINKING)&&SrB(H))$.push(RlH);let D=A$(process.env.USE_API_CONTEXT_MANAGEMENT)&&!1,B=RrB(H)&&NL("tengu_marble_anvil",!1);if(_eH()&&(D||B))$.push(ylH);let f=cf("tengu_tool_pear");if(Ac$(H)&&f)$.push(Oc);if(I&&NL("tengu_scarf_coffee",!1))$.push(vlH);if(L==="vertex"&&jrB(H))$.push(wS$);if(L==="foundry")$.push(wS$);if(I)$.push(NYH);if(process.env.ANTHROPIC_BETAS&&!A)$.push(...process.env.ANTHROPIC_BETAS.split(",").map((E)=>E.trim()).filter(Boolean));return $}),U2=o$((H)=>{let $=Lc$(H);if(sI()==="bedrock")return $.filter((A)=>!TS$.has(A));return $}),Ic$=o$((H)=>{return Lc$(H).filter((A)=>TS$.has(A))})});var L8L=z((tM)=>{tM.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(tM.HttpAuthLocation||(tM.HttpAuthLocation={}));tM.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(tM.HttpApiKeyAuthLocation||(tM.HttpApiKeyAuthLocation={}));tM.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(tM.EndpointURLScheme||(tM.EndpointURLScheme={}));tM.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(tM.AlgorithmId||(tM.AlgorithmId={}));var yrB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>tM.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>tM.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},vrB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},hrB=(H)=>{return yrB(H)},brB=(H)=>{return vrB(H)};tM.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(tM.FieldPosition||(tM.FieldPosition={}));var krB="__smithy_context";tM.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(tM.IniSectionType||(tM.IniSectionType={}));tM.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(tM.RequestHandlerProtocol||(tM.RequestHandlerProtocol={}));tM.SMITHY_CONTEXT_KEY=krB;tM.getDefaultClientConfiguration=hrB;tM.resolveDefaultRuntimeConfig=brB});var f8L=z((wl)=>{var urB=L8L(),grB=(H)=>{return{setHttpHandler($){H.httpHandler=$},httpHandler(){return H.httpHandler},updateHttpClientConfig($,A){H.httpHandler?.updateHttpClientConfig($,A)},httpHandlerConfigs(){return H.httpHandler.httpHandlerConfigs()}}},mrB=(H)=>{return{httpHandler:H.httpHandler()}};class I8L{name;kind;values;constructor({name:H,kind:$=urB.FieldPosition.HEADER,values:A=[]}){this.name=H,this.kind=$,this.values=A}add(H){this.values.push(H)}set(H){this.values=H}remove(H){this.values=this.values.filter(($)=>$!==H)}toString(){return this.values.map((H)=>H.includes(",")||H.includes(" ")?`"${H}"`:H).join(", ")}get(){return this.values}}class D8L{entries={};encoding;constructor({fields:H=[],encoding:$="utf-8"}){H.forEach(this.setField.bind(this)),this.encoding=$}setField(H){this.entries[H.name.toLowerCase()]=H}getField(H){return this.entries[H.toLowerCase()]}removeField(H){delete this.entries[H.toLowerCase()]}getByType(H){return Object.values(this.entries).filter(($)=>$.kind===H)}}class weH{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(H){this.method=H.method||"GET",this.hostname=H.hostname||"localhost",this.port=H.port,this.query=H.query||{},this.headers=H.headers||{},this.body=H.body,this.protocol=H.protocol?H.protocol.slice(-1)!==":"?`${H.protocol}:`:H.protocol:"https:",this.path=H.path?H.path.charAt(0)!=="/"?`/${H.path}`:H.path:"/",this.username=H.username,this.password=H.password,this.fragment=H.fragment}static clone(H){let $=new weH({...H,headers:{...H.headers}});if($.query)$.query=prB($.query);return $}static isInstance(H){if(!H)return!1;let $=H;return"method"in $&&"protocol"in $&&"hostname"in $&&"path"in $&&typeof $.query==="object"&&typeof $.headers==="object"}clone(){return weH.clone(this)}}function prB(H){return Object.keys(H).reduce(($,A)=>{let L=H[A];return{...$,[A]:Array.isArray(L)?[...L]:L}},{})}class B8L{statusCode;reason;headers;body;constructor(H){this.statusCode=H.statusCode,this.reason=H.reason,this.headers=H.headers||{},this.body=H.body}static isInstance(H){if(!H)return!1;let $=H;return typeof $.statusCode==="number"&&typeof $.headers==="object"}}function drB(H){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(H)}wl.Field=I8L;wl.Fields=D8L;wl.HttpRequest=weH;wl.HttpResponse=B8L;wl.getHttpHandlerExtensionConfiguration=grB;wl.isValidHostname=drB;wl.resolveHttpHandlerRuntimeConfig=mrB});var dk=z((NwH)=>{var crB=f8L();function lrB(H){return H}var E8L=(H)=>($)=>async(A)=>{if(!crB.HttpRequest.isInstance(A.request))return $(A);let{request:L}=A,{handlerProtocol:I=""}=H.requestHandler.metadata||{};if(I.indexOf("h2")>=0&&!L.headers[":authority"])delete L.headers.host,L.headers[":authority"]=L.hostname+(L.port?":"+L.port:"");else if(!L.headers.host){let D=L.hostname;if(L.port!=null)D+=`:${L.port}`;L.headers.host=D}return $(A)},M8L={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},irB=(H)=>({applyToStack:($)=>{$.add(E8L(H),M8L)}});NwH.getHostHeaderPlugin=irB;NwH.hostHeaderMiddleware=E8L;NwH.hostHeaderMiddlewareOptions=M8L;NwH.resolveHostHeaderConfig=lrB});var ck=z((ZeH)=>{var G8L=()=>(H,$)=>async(A)=>{try{let L=await H(A),{clientName:I,commandName:D,logger:B,dynamoDbDocumentClientOptions:f={}}=$,{overrideInputFilterSensitiveLog:E,overrideOutputFilterSensitiveLog:M}=f,G=E??$.inputFilterSensitiveLog,U=M??$.outputFilterSensitiveLog,{$metadata:X,...J}=L.output;return B?.info?.({clientName:I,commandName:D,input:G(A.input),output:U(J),metadata:X}),L}catch(L){let{clientName:I,commandName:D,logger:B,dynamoDbDocumentClientOptions:f={}}=$,{overrideInputFilterSensitiveLog:E}=f,M=E??$.inputFilterSensitiveLog;throw B?.error?.({clientName:I,commandName:D,input:M(A.input),error:L,metadata:L.$metadata}),L}},U8L={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},nrB=(H)=>({applyToStack:($)=>{$.add(G8L(),U8L)}});ZeH.getLoggerPlugin=nrB;ZeH.loggerMiddleware=G8L;ZeH.loggerMiddlewareOptions=U8L});var J8L=z((xwH)=>{var OwH={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID")},Dc$=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");if(!Dc$)globalThis.awslambda=globalThis.awslambda||{};class qeH{static PROTECTED_KEYS=OwH;isProtectedKey(H){return Object.values(OwH).includes(H)}getRequestId(){return this.get(OwH.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(OwH.X_RAY_TRACE_ID)}getTenantId(){return this.get(OwH.TENANT_ID)}}class X8L extends qeH{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(H){return this.currentContext?.[H]}set(H,$){if(this.isProtectedKey(H))throw Error(`Cannot modify protected Lambda context field: ${String(H)}`);this.currentContext=this.currentContext||{},this.currentContext[H]=$}run(H,$){this.currentContext=H;try{return $()}finally{this.currentContext=void 0}}}class Bc$ extends qeH{als;static async create(){let H=new Bc$,$=await import("async_hooks");return H.als=new $.AsyncLocalStorage,H}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(H){return this.als.getStore()?.[H]}set(H,$){if(this.isProtectedKey(H))throw Error(`Cannot modify protected Lambda context field: ${String(H)}`);let A=this.als.getStore();if(!A)throw Error("No context available");A[H]=$}run(H,$){return this.als.run(H,$)}}xwH.InvokeStore=void 0;(function(H){let $=null;async function A(){if(!$)$=(async()=>{let I="AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await Bc$.create():new X8L;if(!Dc$&&globalThis.awslambda?.InvokeStore)return globalThis.awslambda.InvokeStore;else if(!Dc$&&globalThis.awslambda)return globalThis.awslambda.InvokeStore=I,I;else return I})();return $}H.getInstanceAsync=A,H._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{if($=null,globalThis.awslambda?.InvokeStore)delete globalThis.awslambda.InvokeStore;globalThis.awslambda={}}}:void 0})(xwH.InvokeStore||(xwH.InvokeStore={}));xwH.InvokeStoreBase=qeH});var F8L=z((sM)=>{sM.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(sM.HttpAuthLocation||(sM.HttpAuthLocation={}));sM.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(sM.HttpApiKeyAuthLocation||(sM.HttpApiKeyAuthLocation={}));sM.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(sM.EndpointURLScheme||(sM.EndpointURLScheme={}));sM.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(sM.AlgorithmId||(sM.AlgorithmId={}));var rrB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>sM.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>sM.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},arB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},orB=(H)=>{return rrB(H)},trB=(H)=>{return arB(H)};sM.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(sM.FieldPosition||(sM.FieldPosition={}));var srB="__smithy_context";sM.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(sM.IniSectionType||(sM.IniSectionType={}));sM.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(sM.RequestHandlerProtocol||(sM.RequestHandlerProtocol={}));sM.SMITHY_CONTEXT_KEY=srB;sM.getDefaultClientConfiguration=orB;sM.resolveDefaultRuntimeConfig=trB});var V8L=z((Zl)=>{var erB=F8L(),HaB=(H)=>{return{setHttpHandler($){H.httpHandler=$},httpHandler(){return H.httpHandler},updateHttpClientConfig($,A){H.httpHandler?.updateHttpClientConfig($,A)},httpHandlerConfigs(){return H.httpHandler.httpHandlerConfigs()}}},$aB=(H)=>{return{httpHandler:H.httpHandler()}};class K8L{name;kind;values;constructor({name:H,kind:$=erB.FieldPosition.HEADER,values:A=[]}){this.name=H,this.kind=$,this.values=A}add(H){this.values.push(H)}set(H){this.values=H}remove(H){this.values=this.values.filter(($)=>$!==H)}toString(){return this.values.map((H)=>H.includes(",")||H.includes(" ")?`"${H}"`:H).join(", ")}get(){return this.values}}class Q8L{entries={};encoding;constructor({fields:H=[],encoding:$="utf-8"}){H.forEach(this.setField.bind(this)),this.encoding=$}setField(H){this.entries[H.name.toLowerCase()]=H}getField(H){return this.entries[H.toLowerCase()]}removeField(H){delete this.entries[H.toLowerCase()]}getByType(H){return Object.values(this.entries).filter(($)=>$.kind===H)}}class TeH{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(H){this.method=H.method||"GET",this.hostname=H.hostname||"localhost",this.port=H.port,this.query=H.query||{},this.headers=H.headers||{},this.body=H.body,this.protocol=H.protocol?H.protocol.slice(-1)!==":"?`${H.protocol}:`:H.protocol:"https:",this.path=H.path?H.path.charAt(0)!=="/"?`/${H.path}`:H.path:"/",this.username=H.username,this.password=H.password,this.fragment=H.fragment}static clone(H){let $=new TeH({...H,headers:{...H.headers}});if($.query)$.query=AaB($.query);return $}static isInstance(H){if(!H)return!1;let $=H;return"method"in $&&"protocol"in $&&"hostname"in $&&"path"in $&&typeof $.query==="object"&&typeof $.headers==="object"}clone(){return TeH.clone(this)}}function AaB(H){return Object.keys(H).reduce(($,A)=>{let L=H[A];return{...$,[A]:Array.isArray(L)?[...L]:L}},{})}class W8L{statusCode;reason;headers;body;constructor(H){this.statusCode=H.statusCode,this.reason=H.reason,this.headers=H.headers||{},this.body=H.body}static isInstance(H){if(!H)return!1;let $=H;return typeof $.statusCode==="number"&&typeof $.headers==="object"}}function LaB(H){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(H)}Zl.Field=K8L;Zl.Fields=Q8L;Zl.HttpRequest=TeH;Zl.HttpResponse=W8L;Zl.getHttpHandlerExtensionConfiguration=HaB;Zl.isValidHostname=LaB;Zl.resolveHttpHandlerRuntimeConfig=$aB});var P8L=z((zeH)=>{Object.defineProperty(zeH,"__esModule",{value:!0});zeH.recursionDetectionMiddleware=void 0;var IaB=J8L(),DaB=V8L(),fc$="X-Amzn-Trace-Id",BaB="AWS_LAMBDA_FUNCTION_NAME",faB="_X_AMZN_TRACE_ID",EaB=()=>(H)=>async($)=>{let{request:A}=$;if(!DaB.HttpRequest.isInstance(A))return H($);let L=Object.keys(A.headers??{}).find((G)=>G.toLowerCase()===fc$.toLowerCase())??fc$;if(A.headers.hasOwnProperty(L))return H($);let I=process.env[BaB],D=process.env[faB],E=(await IaB.InvokeStore.getInstanceAsync())?.getXRayTraceId()??D,M=(G)=>typeof G==="string"&&G.length>0;if(M(I)&&M(E))A.headers[fc$]=E;return H({...$,request:A})};zeH.recursionDetectionMiddleware=EaB});var lk=z((NeH)=>{var Ec$=P8L(),MaB={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},GaB=(H)=>({applyToStack:($)=>{$.add(Ec$.recursionDetectionMiddleware(),MaB)}});NeH.getRecursionDetectionPlugin=GaB;Object.keys(Ec$).forEach(function(H){if(H!=="default"&&!Object.prototype.hasOwnProperty.call(NeH,H))Object.defineProperty(NeH,H,{enumerable:!0,get:function(){return Ec$[H]}})})});var Mc$=z((eM)=>{eM.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(eM.HttpAuthLocation||(eM.HttpAuthLocation={}));eM.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(eM.HttpApiKeyAuthLocation||(eM.HttpApiKeyAuthLocation={}));eM.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(eM.EndpointURLScheme||(eM.EndpointURLScheme={}));eM.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(eM.AlgorithmId||(eM.AlgorithmId={}));var UaB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>eM.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>eM.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},XaB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},JaB=(H)=>{return UaB(H)},FaB=(H)=>{return XaB(H)};eM.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(eM.FieldPosition||(eM.FieldPosition={}));var KaB="__smithy_context";eM.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(eM.IniSectionType||(eM.IniSectionType={}));eM.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(eM.RequestHandlerProtocol||(eM.RequestHandlerProtocol={}));eM.SMITHY_CONTEXT_KEY=KaB;eM.getDefaultClientConfiguration=JaB;eM.resolveDefaultRuntimeConfig=FaB});var _8L=z((HG)=>{HG.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(HG.HttpAuthLocation||(HG.HttpAuthLocation={}));HG.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})(HG.HttpApiKeyAuthLocation||(HG.HttpApiKeyAuthLocation={}));HG.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})(HG.EndpointURLScheme||(HG.EndpointURLScheme={}));HG.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})(HG.AlgorithmId||(HG.AlgorithmId={}));var QaB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>HG.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>HG.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},WaB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},VaB=(H)=>{return QaB(H)},PaB=(H)=>{return WaB(H)};HG.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})(HG.FieldPosition||(HG.FieldPosition={}));var _aB="__smithy_context";HG.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})(HG.IniSectionType||(HG.IniSectionType={}));HG.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})(HG.RequestHandlerProtocol||(HG.RequestHandlerProtocol={}));HG.SMITHY_CONTEXT_KEY=_aB;HG.getDefaultClientConfiguration=VaB;HG.resolveDefaultRuntimeConfig=PaB});var O6=z((Gc$)=>{var Y8L=_8L(),YaB=(H)=>H[Y8L.SMITHY_CONTEXT_KEY]||(H[Y8L.SMITHY_CONTEXT_KEY]={}),CaB=(H)=>{if(typeof H==="function")return H;let $=Promise.resolve(H);return()=>$};Gc$.getSmithyContext=YaB;Gc$.normalizeProvider=CaB});var C8L=z(($G)=>{$G.HttpAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})($G.HttpAuthLocation||($G.HttpAuthLocation={}));$G.HttpApiKeyAuthLocation=void 0;(function(H){H.HEADER="header",H.QUERY="query"})($G.HttpApiKeyAuthLocation||($G.HttpApiKeyAuthLocation={}));$G.EndpointURLScheme=void 0;(function(H){H.HTTP="http",H.HTTPS="https"})($G.EndpointURLScheme||($G.EndpointURLScheme={}));$G.AlgorithmId=void 0;(function(H){H.MD5="md5",H.CRC32="crc32",H.CRC32C="crc32c",H.SHA1="sha1",H.SHA256="sha256"})($G.AlgorithmId||($G.AlgorithmId={}));var waB=(H)=>{let $=[];if(H.sha256!==void 0)$.push({algorithmId:()=>$G.AlgorithmId.SHA256,checksumConstructor:()=>H.sha256});if(H.md5!=null)$.push({algorithmId:()=>$G.AlgorithmId.MD5,checksumConstructor:()=>H.md5});return{addChecksumAlgorithm(A){$.push(A)},checksumAlgorithms(){return $}}},ZaB=(H)=>{let $={};return H.checksumAlgorithms().forEach((A)=>{$[A.algorithmId()]=A.checksumConstructor()}),$},qaB=(H)=>{return waB(H)},TaB=(H)=>{return ZaB(H)};$G.FieldPosition=void 0;(function(H){H[H.HEADER=0]="HEADER",H[H.TRAILER=1]="TRAILER"})($G.FieldPosition||($G.FieldPosition={}));var zaB="__smithy_context";$G.IniSectionType=void 0;(function(H){H.PROFILE="profile",H.SSO_SESSION="sso-session",H.SERVICES="services"})($G.IniSectionType||($G.IniSectionType={}));$G.RequestHandlerProtocol=void 0;(function(H){H.HTTP_0_9="http/0.9",H.HTTP_1_0="http/1.0",H.TDS_8_0="tds/8.0"})($G.RequestHandlerProtocol||($G.RequestHandlerProtocol={}));$G.SMITHY_CONTEXT_KEY=zaB;$G.getDefaultClientConfiguration=qaB;$G.resolveDefaultRuntimeConfig=TaB});var T8L=z((ql)=>{var NaB=C8L(),OaB=(H)=>{return{setHttpHandler($){H.httpHandler=$},httpHandler(){return H.httpHandler},updateHttpClientConfig($,A){H.httpHandler?.updateHttpClientConfig($,A)},httpHandlerConfigs(){return H.httpHandler.httpHandlerConfigs()}}},xaB=(H)=>{return{httpHandler:H.httpHandler()}};class w8L{name;kind;values;constructor({name:H,kind:$=NaB.FieldPosition.HEADER,values:A=[]}){this.name=H,this.kind=$,this.values=A}add(H){this.values.push(H)}set(H){this.values=H}remove(H){this.values=this.values.filter(($)=>$!==H)}toString(){return this.values.map((H)=>H.includes(",")||H.includes(" ")?`"${H}"`:H).join(", ")}get(){return this.values}}class Z8L{entries={};encoding;constructor({fields:H=[],encoding:$="utf-8"}){H.forEach(this.setField.bind(this)),this.encoding=$}setField(H){this.entries[H.name.toLowerCase()]=H}getField(H){return this.entries[H.toLowerCase()]}removeField(H){delete this.entries[H.toLowerCase()]}getByType(H){return Object.values(this.entries).filter(($)=>$.kind===H)}}class OeH{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(H){this.method=H.method||"GET",this.hostname=H.hostname||"localhost",this.port=H.port,this.query=H.query||{},this.headers=H.headers||{},this.body=H.body,this.protocol=H.protocol?H.protocol.slice(-1)!==":"?`${H.protocol}:`:H.protocol:"https:",this.path=H.path?H.path.charAt(0)!=="/"?`/${H.path}`:H.path:"/",this.username=H.username,this.password=H.password,this.fragment=H.fragment}static clone(H){let $=new OeH({...H,headers:{...H.headers}});if($.query)$.query=SaB($.query);return $}static isInstance(H){if(!H)return!1;let $=H;return"method"in $&&"protocol"in $&&"hostname"in $&&"path"in $&&typeof $.query==="object"&&typeof $.headers==="object"}clone(){return OeH.clone(this)}}function SaB(H){return Object.keys(H).reduce(($,A)=>{let L=H[A];return{...$,[A]:Array.isArray(L)?[...L]:L}},{})}class q8L{statusCode;reason;headers;body;constructor(H){this.statusCode=H.statusCode,this.reason=H.reason,this.headers=H.headers||{},this.body=H.body}static isInstance(H){if(!H)return!1;let $=H;return typeof $.statusCode==="number"&&typeof $.headers==="object"}}function jaB(H){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(H)}ql.Field=w8L;ql.Fields=Z8L;ql.HttpRequest=OeH;ql.HttpResponse=q8L;ql.getHttpHandlerExtensionConfiguration=OaB;ql.isValidHostname=jaB;ql.resolveHttpHandlerRuntimeConfig=xaB});var Xc$=z((RGH)=>{var RaB=T8L(),z8L=(H,$)=>(A,L)=>async(I)=>{let{response:D}=await A(I);try{let B=await $(D,H);return{response:D,output:B}}catch(B){if(Object.defineProperty(B,"$response",{value:D,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in B)){try{B.message+=` `);let{connect:E,buffered:M}=await f;if(H.emit("proxyConnect",E),this.emit("proxyConnect",E,H),E.statusCode===200){if(H.once("socket",F_0),$.secureEndpoint)return GqH("Upgrading socket connection to TLS"),jgL.connect({...ygL(RgL($),"host","path","port"),socket:L});return L}L.destroy();let G=new ZD$.Socket({writable:!1});return G.readable=!0,H.once("socket",(U)=>{GqH("Replaying proxy buffer for failed request"),(0,M_0.default)(U.listenerCount("data")>0),U.push(M),U.push(null)}),G}}b$A.protocols=["http","https"];Qq.HttpsProxyAgent=b$A;function F_0(H){H.resume()}function ygL(H,...$){let A={},L;for(L in H)if(!$.includes(L))A[L]=H[L];return A}});function k$A(){let H=sN();if(!H)return;return{cert:H.cert,key:H.key,passphrase:H.passphrase}}function u$A(){let H=sN();if(!H)return{};if(typeof Bun<"u")return{tls:H};return N("mTLS: Created undici agent with custom certificates"),{dispatcher:new kgL.Agent({connect:{cert:H.cert,key:H.key,passphrase:H.passphrase},pipelining:1})}}function ggL(){if(!sN())return;if(process.env.NODE_EXTRA_CA_CERTS)N("NODE_EXTRA_CA_CERTS detected - Node.js will automatically append to built-in CAs")}var bgL,kgL,sN,ugL;var H4H=K(()=>{tD();E$();DL();bgL=require("https"),kgL=b(require("undici")),sN=o$(()=>{let H={};if(process.env.CLAUDE_CODE_CLIENT_CERT)try{H.cert=zH().readFileSync(process.env.CLAUDE_CODE_CLIENT_CERT,{encoding:"utf8"}),N("mTLS: Loaded client certificate from CLAUDE_CODE_CLIENT_CERT")}catch($){N(`mTLS: Failed to load client certificate: ${$}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY)try{H.key=zH().readFileSync(process.env.CLAUDE_CODE_CLIENT_KEY,{encoding:"utf8"}),N("mTLS: Loaded client key from CLAUDE_CODE_CLIENT_KEY")}catch($){N(`mTLS: Failed to load client key: ${$}`,{level:"error"})}if(process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE)H.passphrase=process.env.CLAUDE_CODE_CLIENT_KEY_PASSPHRASE,N("mTLS: Using client key passphrase");if(Object.keys(H).length===0)return;return H}),ugL=o$(()=>{let H=sN();if(!H)return;let $={...H,keepAlive:!0};return N("mTLS: Creating HTTPS agent with custom certificates"),new bgL.Agent($)})});function K_0(H){switch(H.family){case 0:case 4:case 6:return H.family;case"IPv6":return 6;case"IPv4":case void 0:return 4;default:throw Error(`Unsupported address family: ${H.family}`)}}function Ku(H=process.env){return H.https_proxy||H.HTTPS_PROXY||H.http_proxy||H.HTTP_PROXY}function Q_0(H=process.env){return H.no_proxy||H.NO_PROXY}function JqH(H,$=Q_0()){if(!$)return!1;if($==="*")return!0;try{let A=new URL(H),L=A.hostname.toLowerCase(),I=A.port||(A.protocol==="https:"?"443":"80"),D=`${L}:${I}`;return $.split(/[,\s]+/).filter(Boolean).some((f)=>{if(f=f.toLowerCase().trim(),f.includes(":"))return D===f;if(f.startsWith(".")){let E=f;return L===f.substring(1)||L.endsWith(E)}return L===f})}catch{return!1}}function pgL(H){let $=sN(),A={...$&&{cert:$.cert,key:$.key,passphrase:$.passphrase}};if(A$(process.env.CLAUDE_CODE_PROXY_RESOLVES_HOSTS))A.lookup=(L,I,D)=>{D(null,L,K_0(I))};return new g$A.HttpsProxyAgent(H,A)}function VAH(H){let $=Ku();if(!$)return;if(JqH(H))return;return pgL($)}function PAH(H){let $=Ku();if(!$)return;if(JqH(H))return;return $}function _AH(){let H=Ku(),$=u$A();if(H){if(typeof Bun<"u")return{proxy:H,...$};return{dispatcher:dgL(H)}}return $}function TD$(){let H=Ku(),$=ugL();if(qD$!==void 0)nA.interceptors.request.eject(qD$),qD$=void 0;if(nA.defaults.proxy=void 0,nA.defaults.httpAgent=void 0,nA.defaults.httpsAgent=void 0,H){nA.defaults.proxy=!1;let A=pgL(H);qD$=nA.interceptors.request.use((L)=>{if(L.url&&JqH(L.url))if($)L.httpsAgent=$,L.httpAgent=$;else delete L.httpsAgent,delete L.httpAgent;else L.httpsAgent=A,L.httpAgent=A;return L}),XqH.setGlobalDispatcher(dgL(H))}else if($){nA.defaults.httpsAgent=$;let A=u$A();if(A.dispatcher)XqH.setGlobalDispatcher(A.dispatcher)}}function m$A(){let H=Ku();if(!H)return{};let $=new g$A.HttpsProxyAgent(H),A=new mgL.NodeHttpHandler({httpAgent:$,httpsAgent:$});return{requestHandler:A,credentials:P2({clientConfig:{requestHandler:A}})}}var mgL,g$A,XqH,dgL,qD$;var nR=K(()=>{BAH();w1();tD();H4H();NA();mgL=b(X2(),1),g$A=b(UqH(),1),XqH=b(require("undici"));dgL=o$((H)=>{let $=sN(),A={httpProxy:H,httpsProxy:H,noProxy:process.env.NO_PROXY||process.env.no_proxy};if($)A.connect={cert:$.cert,key:$.key,passphrase:$.passphrase};return new XqH.EnvHttpProxyAgent(A)})});function eN(H,$){return H.find((A)=>A.includes($))??null}async function lgL(){let H=NHH(),$=A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),A={region:H,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...m$A(),...$&&{requestHandler:new d$A.NodeHttpHandler,httpAuthSchemes:[{schemeId:"smithy.api#noAuth",identityProvider:()=>async()=>({}),signer:new p$A.NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:"smithy.api#noAuth"}]}};if(!$&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let L=await YAH();if(L)A.credentials={accessKeyId:L.accessKeyId,secretAccessKey:L.secretAccessKey,sessionToken:L.sessionToken}}return new e1(A)}async function igL(){let H=NHH(),$=A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),A={region:H,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...m$A(),...$&&{requestHandler:new d$A.NodeHttpHandler,httpAuthSchemes:[{schemeId:"smithy.api#noAuth",identityProvider:()=>async()=>({}),signer:new p$A.NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:"smithy.api#noAuth"}]}};if(!$&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let L=await YAH();if(L)A.credentials={accessKeyId:L.accessKeyId,secretAccessKey:L.secretAccessKey,sessionToken:L.sessionToken}}return new WAH(A)}function c$A(H){return H.startsWith("anthropic.")}function l$A(H){for(let $ of W_0)if(H.startsWith(`${$}.anthropic.`))return $;return}function ngL(H,$){let A=l$A(H);if(A)return H.replace(`${A}.`,`${$}.`);if(c$A(H))return`${$}.${H}`;return H}var p$A,d$A,cgL,zD$,W_0;var FqH=K(()=>{WvL();CD$();tD();EI();NA();_$();nR();p$A=b(S0(),1),d$A=b(X2(),1),cgL=o$(async function(){let H=await lgL(),$=[],A;try{do{let L=new GAH({...A&&{nextToken:A},typeEquals:"SYSTEM_DEFINED"}),I=await H.send(L);if(I.inferenceProfileSummaries)$.push(...I.inferenceProfileSummaries);A=I.nextToken}while(A);return $.filter((L)=>L.inferenceProfileId?.includes("anthropic")).map((L)=>L.inferenceProfileId).filter(Boolean)}catch(L){throw r(L),L}});zD$=o$(async function(H){try{let $=await lgL(),A=new mZH({inferenceProfileIdentifier:H}),L=await $.send(A);if(!L.models||L.models.length===0)return null;let I=L.models[0];if(!I?.modelArn)return null;let D=I.modelArn.lastIndexOf("/");return D>=0?I.modelArn.substring(D+1):I.modelArn}catch($){return r($),null}});W_0=["us","eu","apac","global"]});function i$A(H){if(sI()==="foundry")return;let $=H.toLowerCase();if($.includes("claude-opus-4-6[1m]"))return"Opus 4.6 (with 1M context)";if($.includes("claude-opus-4-6"))return"Opus 4.6";if($.includes("claude-opus-4-5"))return"Opus 4.5";if($.includes("claude-opus-4-1"))return"Opus 4.1";if($.includes("claude-opus-4"))return"Opus 4";if($.includes("claude-sonnet-4-5[1m]"))return"Sonnet 4.5 (with 1M context)";if($.includes("claude-sonnet-4-5"))return"Sonnet 4.5";if($.includes("claude-sonnet-4[1m]"))return"Sonnet 4 (with 1M context)";if($.includes("claude-sonnet-4"))return"Sonnet 4";if($.includes("claude-3-7-sonnet"))return"Claude 3.7 Sonnet";if($.includes("claude-3-5-sonnet"))return"Claude 3.5 Sonnet";if($.includes("claude-haiku-4-5"))return"Haiku 4.5";if($.includes("claude-3-5-haiku"))return"Claude 3.5 Haiku";return}var KqH,QqH,WqH,VqH,CAH,PqH,_qH,YqH,CqH,wAH;var $4H=K(()=>{oM();KqH={firstParty:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet"},QqH={firstParty:"claude-3-5-sonnet-20241022",bedrock:"anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet"},WqH={firstParty:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku"},VqH={firstParty:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5"},CAH={firstParty:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4"},PqH={firstParty:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5"},_qH={firstParty:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4"},YqH={firstParty:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1"},CqH={firstParty:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5"},wAH={firstParty:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6"}});function rR(H){let $=[],A=!1;async function L(){if(A)return;if($.length===0)return;A=!0;while($.length>0){let{args:I,resolve:D,reject:B,context:f}=$.shift();try{let E=await H.apply(f,I);D(E)}catch(E){B(E)}}if(A=!1,$.length>0)L()}return function(...I){return new Promise((D,B)=>{$.push({args:I,resolve:D,reject:B,context:this}),L()})}}function wqH(H){return{haiku35:WqH[H],haiku45:VqH[H],sonnet35:QqH[H],sonnet37:KqH[H],sonnet40:CAH[H],sonnet45:PqH[H],opus40:_qH[H],opus41:YqH[H],opus45:CqH[H],opus46:wAH[H]}}async function V_0(){let H;try{H=await cgL()}catch(U){return r(U),wqH("bedrock")}if(!H?.length)return wqH("bedrock");let $=eN(H,"claude-3-5-haiku-20241022"),A=eN(H,"claude-haiku-4-5-20251001"),L=eN(H,"claude-3-5-sonnet-20241022"),I=eN(H,"claude-3-7-sonnet-20250219"),D=eN(H,"claude-sonnet-4-20250514"),B=eN(H,"claude-sonnet-4-5-20250929"),f=eN(H,"claude-opus-4-20250514"),E=eN(H,"claude-opus-4-1-20250805"),M=eN(H,"claude-opus-4-5-20251101"),G=eN(H,"claude-opus-4-6");return{haiku35:$||WqH.bedrock,haiku45:A||VqH.bedrock,sonnet35:L||QqH.bedrock,sonnet37:I||KqH.bedrock,sonnet40:D||CAH.bedrock,sonnet45:B||PqH.bedrock,opus40:f||_qH.bedrock,opus41:E||YqH.bedrock,opus45:M||CqH.bedrock,opus46:G||wAH.bedrock}}function P_0(){if(GEH()!==null)return;if(sI()!=="bedrock"){vYH(wqH(sI()));return}rgL()}function aG(){let H=GEH();if(H===null)return P_0(),wqH(sI());return H}async function agL(){if(GEH()!==null)return;if(sI()!=="bedrock"){vYH(wqH(sI()));return}await rgL()}var rgL;var ND$=K(()=>{g$();_$();FqH();$4H();oM();rgL=rR(async()=>{if(GEH()!==null)return;try{let H=await V_0();vYH(H)}catch(H){r(H)}})});async function ogL(){}function Z2(H){return H.slice(-20)}var ZqH=K(()=>{TwH();O_()});class q2{static instance=null;status={isAuthenticating:!1,output:[]};listeners=new Set;static getInstance(){if(!q2.instance)q2.instance=new q2;return q2.instance}getStatus(){return{...this.status,output:[...this.status.output]}}startAuthentication(){this.status={isAuthenticating:!0,output:[]},this.notifyListeners()}addOutput(H){this.status.output.push(H),this.notifyListeners()}setError(H){this.status.error=H,this.notifyListeners()}endAuthentication(H){if(H)this.status={isAuthenticating:!1,output:[]};else this.status.isAuthenticating=!1;this.notifyListeners()}subscribe(H){return this.listeners.add(H),()=>{this.listeners.delete(H)}}notifyListeners(){this.listeners.forEach((H)=>H(this.getStatus()))}static reset(){if(q2.instance)q2.instance.listeners.clear(),q2.instance=null}}function p_(){let H=A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY),A=(VL()||{}).apiKeyHelper,L=process.env.ANTHROPIC_AUTH_TOKEN||A||process.env.CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR,{source:I}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return!(H||L||(I==="ANTHROPIC_API_KEY"||I==="apiKeyHelper")&&!A$(process.env.CLAUDE_CODE_REMOTE))}function ji(){if(process.env.ANTHROPIC_AUTH_TOKEN)return{source:"ANTHROPIC_AUTH_TOKEN",hasToken:!0};if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{source:"CLAUDE_CODE_OAUTH_TOKEN",hasToken:!0};if(QeH())return{source:"CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR",hasToken:!0};if(TqH())return{source:"apiKeyHelper",hasToken:!0};let A=dD();if(mk(A?.scopes)&&A?.accessToken)return{source:"claude.ai",hasToken:!0};return{source:"none",hasToken:!1}}function eZ(){let{key:H}=Y5();return H}function HmL(){let{key:H,source:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return H!==null&&$!=="none"}function Y5(H={}){if(uYH()&&process.env.ANTHROPIC_API_KEY)return{key:process.env.ANTHROPIC_API_KEY,source:"ANTHROPIC_API_KEY"};if(A$(!1)){let L=td$();if(L)return{key:L,source:"ANTHROPIC_API_KEY"};if(!process.env.ANTHROPIC_API_KEY&&!process.env.CLAUDE_CODE_OAUTH_TOKEN&&!process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR)throw Error("ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN env var is required");if(process.env.ANTHROPIC_API_KEY)return{key:process.env.ANTHROPIC_API_KEY,source:"ANTHROPIC_API_KEY"};return{key:null,source:"none"}}if(process.env.ANTHROPIC_API_KEY&&M$().customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY)))return{key:process.env.ANTHROPIC_API_KEY,source:"ANTHROPIC_API_KEY"};let $=td$();if($)return{key:$,source:"ANTHROPIC_API_KEY"};if(H.skipRetrievingKeyFromApiKeyHelper){if(TqH())return{key:null,source:"apiKeyHelper"}}else{let L=zqH(tI());if(L)return{key:L,source:"apiKeyHelper"}}let A=NqH();if(A)return A;return{key:null,source:"none"}}function TqH(){return(VL()||{}).apiKeyHelper}function $mL(){let H=TqH();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.apiKeyHelper===H||A?.apiKeyHelper===H}function a$A(){return(VL()||{}).awsAuthRefresh}function AmL(){let H=a$A();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.awsAuthRefresh===H||A?.awsAuthRefresh===H}function o$A(){return(VL()||{}).awsCredentialExport}function LmL(){let H=o$A();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.awsCredentialExport===H||A?.awsCredentialExport===H}function Y_0(){let H=process.env.CLAUDE_CODE_API_KEY_HELPER_TTL_MS;if(H){let $=parseInt(H,10);if(!Number.isNaN($)&&$>=0)return $;N(`Found CLAUDE_CODE_API_KEY_HELPER_TTL_MS env var, but it was not a valid number. Got ${H}`,{level:"error"})}return __0}function xD$(){zqH.cache.clear()}function ImL(H){if(TqH()){if($mL()){if(!XG(!0))return}}zqH(H)}async function w_0(){let H=a$A();if(!H)return!1;if(AmL()){if(!XG(!0)&&!tI()){let A=Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);return pZ("awsAuthRefresh invoked before trust check",A),c("tengu_awsAuthRefresh_missing_trust",{}),!1}}try{return N("Fetching AWS caller identity for AWS auth refresh command"),await ao$(),N("Fetched AWS caller identity, skipping AWS auth refresh command"),!1}catch{return Z_0(H)}}function Z_0(H){N("Running AWS auth refresh command");let $=q2.getInstance();return $.startAuthentication(),new Promise((A)=>{let L=egL.exec(H);L.stdout.on("data",(I)=>{let D=I.toString().trim();if(D)$.addOutput(D),N(D,{level:"debug"})}),L.stderr.on("data",(I)=>{let D=I.toString().trim();if(D)$.setError(D),N(D,{level:"error"})}),L.on("close",(I)=>{if(I===0)N("AWS auth refresh completed successfully"),$.endAuthentication(!0),A(!0);else{let D=oH.red("Error running awsAuthRefresh (in settings or ~/.claude.json):");console.error(D),$.endAuthentication(!1),A(!1)}})})}async function q_0(){let H=o$A();if(!H)return null;if(LmL()){if(!XG(!0)&&!tI()){let A=Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);return pZ("awsCredentialExport invoked before trust check",A),c("tengu_awsCredentialExport_missing_trust",{}),null}}try{return N("Fetching AWS caller identity for credential export command"),await ao$(),N("Fetched AWS caller identity, skipping AWS credential export command"),null}catch{try{N("Running AWS credential export command");let $=await fE(H,{shell:!0,reject:!1});if($.exitCode!==0||!$.stdout)throw Error("awsCredentialExport did not return a valid value");let A=DA($.stdout.trim());if(!KzL(A))throw Error("awsCredentialExport did not return valid AWS STS output structure");return N("AWS credentials retrieved from awsCredentialExport"),{accessKeyId:A.Credentials.AccessKeyId,secretAccessKey:A.Credentials.SecretAccessKey,sessionToken:A.Credentials.SessionToken}}catch($){let A=oH.red("Error getting AWS credentials from awsCredentialExport (in settings or ~/.claude.json):");if($ instanceof Error)console.error(A,$.message);else console.error(A,$);return null}}}function SD$(){YAH.cache.clear()}function DmL(){let H=a$A(),$=o$A();if(!H&&!$)return;if(AmL()||LmL()){if(!XG(!0)&&!tI())return}YAH(),aG()}function T_0(H){return/^[a-zA-Z0-9-_]+$/.test(H)}async function r1L(H){if(!T_0(H))throw Error("Invalid API key format. API key must contain only alphanumeric characters, dashes, and underscores.");await fmL();let $=!1;c("tengu_api_key_saved_to_config",{});let A=Z2(H);AA((L)=>{let I=L.customApiKeyResponses?.approved??[];return{...L,primaryApiKey:$?L.primaryApiKey:H,customApiKeyResponses:{...L.customApiKeyResponses,approved:I.includes(A)?I:[...I,A],rejected:L.customApiKeyResponses?.rejected??[]}}}),NqH.cache.clear?.()}async function BmL(){await fmL(),AA((H)=>({...H,primaryApiKey:void 0})),NqH.cache.clear?.()}async function fmL(){try{await ogL()}catch(H){r(H)}}function OqH(H){if(!mk(H.scopes))return c("tengu_oauth_tokens_not_claude_ai",{}),{success:!0};if(!H.refreshToken||!H.expiresAt)return c("tengu_oauth_tokens_inference_only",{}),{success:!0};let $=hW(),A=$.name;try{let L=$.read()||{};L.claudeAiOauth={accessToken:H.accessToken,refreshToken:H.refreshToken,expiresAt:H.expiresAt,scopes:H.scopes,subscriptionType:H.subscriptionType,rateLimitTier:H.rateLimitTier};let I=$.update(L);if(I.success)c("tengu_oauth_tokens_saved",{storageBackend:A});else c("tengu_oauth_tokens_save_failed",{storageBackend:A});return dD.cache?.clear?.(),CeH(),I}catch(L){return r(L),c("tengu_oauth_tokens_save_exception",{storageBackend:A,error:L.message}),{success:!1,warning:"Failed to save OAuth tokens"}}}function z_0(){dD.cache?.clear?.(),xGH()}async function A4H(H){z_0();let $=dD();if(!$?.refreshToken)return!1;if($.accessToken!==H)return c("tengu_oauth_401_recovered_from_keychain",{}),!0;return iW(0,!0)}async function n$A(){if(process.env.CLAUDE_CODE_OAUTH_TOKEN||QeH())return dD();try{let A=(await hW().readAsync())?.claudeAiOauth;if(!A?.accessToken)return null;return A}catch(H){return r(H),null}}function iW(H=0,$=!1){if(H===0&&!$){if(qqH)return qqH;return qqH=r$A(H,$).finally(()=>{qqH=null}),qqH}return r$A(H,$)}async function r$A(H,$){let L=dD();if(!$){if(!L?.refreshToken||!pk(L.expiresAt))return!1}if(!L?.refreshToken)return!1;if(!mk(L.scopes))return!1;dD.cache?.clear?.(),xGH();let I=await n$A();if(!I?.refreshToken||!pk(I.expiresAt))return!1;let D=UL();zH().mkdirSync(D);let f;try{c("tengu_oauth_token_refresh_lock_acquiring",{}),f=await sgL.lock(D),c("tengu_oauth_token_refresh_lock_acquired",{})}catch(E){if(E.code==="ELOCKED"){if(H<5)return c("tengu_oauth_token_refresh_lock_retry",{retryCount:H+1}),await new Promise((M)=>setTimeout(M,1000+Math.random()*1000)),r$A(H+1,$);return c("tengu_oauth_token_refresh_lock_retry_limit_reached",{maxRetries:5}),!1}return r(E),c("tengu_oauth_token_refresh_lock_error",{error:E.message}),!1}try{dD.cache?.clear?.(),xGH();let E=await n$A();if(!E?.refreshToken||!pk(E.expiresAt))return c("tengu_oauth_token_refresh_race_resolved",{}),!1;c("tengu_oauth_token_refresh_starting",{});let M=await c1L(E.refreshToken);return OqH(M),dD.cache?.clear?.(),xGH(),!0}catch(E){r(E instanceof Error?E:Error(String(E))),dD.cache?.clear?.(),xGH();let M=await n$A();if(M&&!pk(M.expiresAt))return c("tengu_oauth_token_refresh_race_recovered",{}),!0;return!1}finally{c("tengu_oauth_token_refresh_lock_releasing",{}),await f(),c("tengu_oauth_token_refresh_lock_released",{})}}function nL(){if(!p_())return!1;return mk(dD()?.scopes)}function EmL(){if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY))return!1;if(nL())return!1;return!0}function T9(){return p_()?M$().oauthAccount:void 0}function HO(){let $=T9()?.billingType;if(!nL()||!$)return!1;if($!=="stripe_subscription"&&$!=="stripe_subscription_contracted"&&$!=="apple_subscription"&&$!=="google_play_subscription")return!1;return!0}function Wq(){let H=f0();return H==="max"||H==="enterprise"||H==="team"||H==="pro"||H===null}function f0(){if(e1L())return s1L();if(!p_())return null;let H=dD();if(!H)return null;return H.subscriptionType??null}function Ri(){if(!p_())return null;let H=dD();if(!H)return null;return H.rateLimitTier??null}function t$A(){switch(f0()){case"enterprise":return"Claude Enterprise";case"team":return"Claude Team";case"max":return"Claude Max";case"pro":return"Claude Pro";default:return"Claude API"}}function $O(){return!!(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY))}function MmL(){return(VL()||{}).otelHeadersHelper}function N_0(){let H=MmL();if(!H)return!1;let $=ZI("projectSettings"),A=ZI("localSettings");return $?.otelHeadersHelper===H||A?.otelHeadersHelper===H}function GmL(){let H=MmL();if(!H)return{};let $=parseInt(process.env.CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS||O_0.toString());if(OD$&&Date.now()-tgL<$)return OD$;if(N_0()){if(!XG(!0))return{}}try{let A=vN(H,{timeout:30000})?.toString().trim();if(!A)throw Error("otelHeadersHelper did not return a valid value");let L=DA(A);if(typeof L!=="object"||L===null||Array.isArray(L))throw Error("otelHeadersHelper must return a JSON object with string key-value pairs");for(let[I,D]of Object.entries(L))if(typeof D!=="string")throw Error(`otelHeadersHelper returned non-string value for key "${I}": ${typeof D}`);return OD$=L,tgL=Date.now(),OD$}catch(A){throw r(Error(`Error getting OpenTelemetry headers from otelHeadersHelper (in settings): ${A instanceof Error?A.message:String(A)}`)),A}}function x_0(H){return H==="max"||H==="pro"}function jD$(){let H=f0();return nL()&&H!==null&&x_0(H)}function RD$(){if(sI()!=="firstParty")return;let{source:$}=ji(),A={};if(nL())A.subscription=t$A();else A.tokenSource=$;let{key:L,source:I}=Y5();if(L)A.apiKeySource=I;if($==="claude.ai"||I==="/login managed key"){let B=T9()?.organizationName;if(B)A.organization=B}let D=T9()?.emailAddress;if(($==="claude.ai"||I==="/login managed key")&&D)A.email=D;return A}var sgL,egL,__0=300000,zqH,C_0=3600000,YAH,NqH,dD,qqH=null,OD$=null,tgL=0,O_0=1740000;var EI=K(()=>{vA();mL();B0();O_();tD();wwH();_$();E$();r0();KeH();p1L();Hq();$c$();$q();DL();NA();TwH();g$();oo$();z$();oM();ND$();ZqH();Z$();sgL=b(zk(),1),egL=require("child_process");zqH=cd$((H)=>{let $=TqH();if(!$)return null;if($mL()){if(!XG(!0)&&!H){let L=Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);pZ("apiKeyHelper invoked before trust check",L),c("tengu_apiKeyHelper_missing_trust11",{})}}try{let A=vN($)?.toString().trim();if(!A)throw Error("apiKeyHelper did not return a valid value");return A}catch(A){let L=oH.red("Error getting API key from apiKeyHelper (in settings or ~/.claude.json):");if(A instanceof Error&&"stderr"in A)console.error(L,String(A.stderr));else if(A instanceof Error)console.error(L,A.message);else console.error(L,A);return" "}},Y_0());YAH=cd$(async()=>{let H=await w_0(),$=await q_0();if(H||$)await QzL();return $},C_0);NqH=o$(()=>{let H=M$();if(!H.primaryApiKey)return null;return{key:H.primaryApiKey,source:"/login managed key"}});dD=o$(()=>{if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{accessToken:process.env.CLAUDE_CODE_OAUTH_TOKEN,refreshToken:null,expiresAt:null,scopes:["user:inference"],subscriptionType:null,rateLimitTier:null};let H=QeH();if(H)return{accessToken:H,refreshToken:null,expiresAt:null,scopes:["user:inference"],subscriptionType:null,rateLimitTier:null};try{let L=hW().read()?.claudeAiOauth;if(!L?.accessToken)return null;return L}catch($){return r($),null}})});function s$A(){return L4H}function I4H(H){L4H=H}function xqH(){return UmL.join(UL(),S_0)}function aR(){if(sI()!=="firstParty")return!1;if(!ZGH())return!1;try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return!0}catch{}let H=dD();if(!H?.accessToken)return!1;if(!H.scopes?.includes(VR))return!1;if(H.subscriptionType!=="enterprise")return!1;return!0}function e$A(){try{let H=xqH(),$=$J(H),A=q1($,!1);if(!A||typeof A!=="object"||Array.isArray(A))return null;return A}catch{return null}}function yD$(){if(!aR())return null;if(L4H)return L4H;let H=e$A();if(H)return L4H=H,H;return null}function XmL(){L4H=null}var UmL,S_0="remote-settings.json",L4H=null;var HAA=K(()=>{NA();oM();EI();qE();rD();nM();UmL=require("path")});function JmL(){if(oA()!=="windows")return!1;if(LAA.existsSync("C:\\Program Files\\ClaudeCode"))return!1;return LAA.existsSync("C:\\ProgramData\\ClaudeCode\\managed-settings.json")}function FmL(){return SV.join(v_(),"managed-settings.json")}function KmL(H,$){if(typeof H==="object"&&H&&"code"in H&&H.code==="ENOENT")N(`Broken symlink or missing file encountered for settings.json at path: ${$}`);else r(H instanceof Error?H:Error(String(H)))}function vD$(H){let $=zH();if(!$.existsSync(H))return{settings:null,errors:[]};try{let{resolvedPath:A}=OU($,H),L=$J(A);if(L.trim()==="")return{settings:{},errors:[]};let I=q1(L,!1),D=tZ.safeParse(I);if(!D.success)return{settings:null,errors:HeH(D.error,H)};return{settings:D.data,errors:[]}}catch(A){return KmL(A,H),{settings:null,errors:[]}}}function D4H(H){switch(H){case"userSettings":return SV.resolve(UL());case"policySettings":case"projectSettings":case"localSettings":return SV.resolve(zL());case"flagSettings":{let $=xc();return $?SV.dirname(SV.resolve($)):SV.resolve(zL())}}}function j_0(){if(gYH()||A$(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return"cowork_settings.json";return"settings.json"}function aM(H){switch(H){case"userSettings":return SV.join(D4H(H),j_0());case"projectSettings":case"localSettings":return SV.join(D4H(H),B4H(H));case"policySettings":return FmL();case"flagSettings":return xc()}}function B4H(H){switch(H){case"projectSettings":return SV.join(".claude","settings.json");case"localSettings":return SV.join(".claude","settings.local.json")}}function ZI(H){if(H==="policySettings"){let L=yD$();if(L&&Object.keys(L).length>0)return L}let $=aM(H);if(!$)return null;let{settings:A}=vD$($);return A}function QmL(){let H=yD$();if(H&&Object.keys(H).length>0)return"remote";let $=FmL(),{settings:A}=vD$($);if(A&&Object.keys(A).length>0)return"local";return null}function II(H,$){if(H==="policySettings"||H==="flagSettings")return{error:null};let A=aM(H);if(!A)return{error:null};try{let L=SV.dirname(A);if(!zH().existsSync(L))zH().mkdirSync(L);let I=ZI(H);if(!I&&zH().existsSync(A)){let B=$J(A),f=q1(B);if(f===null)return{error:Error(`Invalid JSON syntax in settings file at ${A}`)};if(f&&typeof f==="object")I=f,N(`Using raw settings from ${A} due to validation failure`)}let D=ACH(I||{},$,(B,f,E,M)=>{if(f===void 0&&M&&typeof E==="string"){delete M[E];return}if(Array.isArray(f))return f;return});if(AF.markInternalWrite(H),d_(A,yH(D,null,2)+` ${U}`)}return B},C4;var li=K(()=>{jV();acL=Object.freeze(Object.create(null)),C4=hZ0(ocL)});var CTH;var lLA=K(()=>{$y();Yq();P4H();li();CTH=class CTH extends w5{list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/files",IO,{query:L,...$,headers:z9([{"anthropic-beta":[...A??[],"files-api-2025-04-14"].toString()},$?.headers])})}delete(H,$={},A){let{betas:L}=$??{};return this._client.delete(C4`/v1/files/${H}`,{...A,headers:z9([{"anthropic-beta":[...L??[],"files-api-2025-04-14"].toString()},A?.headers])})}download(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/files/${H}/content`,{...A,headers:z9([{"anthropic-beta":[...L??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},A?.headers]),__binaryResponse:!0})}retrieveMetadata(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/files/${H}`,{...A,headers:z9([{"anthropic-beta":[...L??[],"files-api-2025-04-14"].toString()},A?.headers])})}upload(H,$){let{betas:A,...L}=H;return this._client.post("/v1/files",V4H({body:L,...$,headers:z9([{"anthropic-beta":[...A??[],"files-api-2025-04-14"].toString()},$?.headers])},this._client))}}});var wTH;var iLA=K(()=>{$y();Yq();li();wTH=class wTH extends w5{retrieve(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/models/${H}?beta=true`,{...A,headers:z9([{...L?.toString()!=null?{"anthropic-beta":L?.toString()}:void 0},A?.headers])})}list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/models?beta=true",IO,{query:L,...$,headers:z9([{...A?.toString()!=null?{"anthropic-beta":A?.toString()}:void 0},$?.headers])})}}});var nB$;var nLA=K(()=>{nB$={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function rLA(H,$){if(!$||!("parse"in($.output_format??{})))return{...H,content:H.content.map((A)=>{if(A.type==="text")return{...A,parsed:null};return A}),parsed_output:null};return aLA(H,$)}function aLA(H,$){let A=null,L=H.content.map((I)=>{if(I.type==="text"){let D=uZ0($,I.text);if(A===null)A=D;return{...I,parsed:D}}return I});return{...H,content:L,parsed_output:A}}function uZ0(H,$){if(H.output_format?.type!=="json_schema")return null;try{if("parse"in H.output_format)return H.output_format.parse($);return JSON.parse($)}catch(A){throw new ID(`Failed to parse structured output: ${A}`)}}var oLA=K(()=>{jV()});var gZ0=(H)=>{let $=0,A=[];while(${if(H.length===0)return H;let $=H[H.length-1];switch($.type){case"separator":return H=H.slice(0,H.length-1),_4H(H);break;case"number":let A=$.value[$.value.length-1];if(A==="."||A==="-")return H=H.slice(0,H.length-1),_4H(H);case"string":let L=H[H.length-2];if(L?.type==="delimiter")return H=H.slice(0,H.length-1),_4H(H);else if(L?.type==="brace"&&L.value==="{")return H=H.slice(0,H.length-1),_4H(H);break;case"delimiter":return H=H.slice(0,H.length-1),_4H(H);break}return H},mZ0=(H)=>{let $=[];if(H.map((A)=>{if(A.type==="brace")if(A.value==="{")$.push("}");else $.splice($.lastIndexOf("}"),1);if(A.type==="paren")if(A.value==="[")$.push("]");else $.splice($.lastIndexOf("]"),1)}),$.length>0)$.reverse().map((A)=>{if(A==="}")H.push({type:"brace",value:"}"});else if(A==="]")H.push({type:"paren",value:"]"})});return H},pZ0=(H)=>{let $="";return H.map((A)=>{switch(A.type){case"string":$+='"'+A.value+'"';break;default:$+=A.value;break}}),$},rB$=(H)=>JSON.parse(pZ0(mZ0(_4H(gZ0(H)))));var tLA=()=>{};var kAH=K(()=>{jV()});var aB$=K(()=>{hLA()});function HlL(H){return H.type==="tool_use"||H.type==="server_tool_use"||H.type==="mcp_tool_use"}function $lL(H){}var Cq,ii,Y4H,ZTH,oB$,qTH,TTH,tB$,zTH,wu,NTH,sB$,eB$,C4H,H0$,$0$,sLA,tcL,A0$,eLA,HIA,$IA,scL,ecL="__json_buf",OTH;var AlL=K(()=>{_u();tLA();kAH();aB$();oLA();OTH=class OTH{constructor(H){Cq.add(this),this.messages=[],this.receivedMessages=[],ii.set(this,void 0),Y4H.set(this,null),this.controller=new AbortController,ZTH.set(this,void 0),oB$.set(this,()=>{}),qTH.set(this,()=>{}),TTH.set(this,void 0),tB$.set(this,()=>{}),zTH.set(this,()=>{}),wu.set(this,{}),NTH.set(this,!1),sB$.set(this,!1),eB$.set(this,!1),C4H.set(this,!1),H0$.set(this,void 0),$0$.set(this,void 0),A0$.set(this,($)=>{if(MD(this,sB$,!0,"f"),Yu($))$=new rf;if($ instanceof rf)return MD(this,eB$,!0,"f"),this._emit("abort",$);if($ instanceof ID)return this._emit("error",$);if($ instanceof Error){let A=new ID($.message);return A.cause=$,this._emit("error",A)}return this._emit("error",new ID(String($)))}),MD(this,ZTH,new Promise(($,A)=>{MD(this,oB$,$,"f"),MD(this,qTH,A,"f")}),"f"),MD(this,TTH,new Promise(($,A)=>{MD(this,tB$,$,"f"),MD(this,zTH,A,"f")}),"f"),xA(this,ZTH,"f").catch(()=>{}),xA(this,TTH,"f").catch(()=>{}),MD(this,Y4H,H,"f")}get response(){return xA(this,H0$,"f")}get request_id(){return xA(this,$0$,"f")}async withResponse(){let H=await xA(this,ZTH,"f");if(!H)throw Error("Could not resolve a `Response` object");return{data:this,response:H,request_id:H.headers.get("request-id")}}static fromReadableStream(H){let $=new OTH(null);return $._run(()=>$._fromReadableStream(H)),$}static createMessage(H,$,A){let L=new OTH($);for(let I of $.messages)L._addMessageParam(I);return MD(L,Y4H,{...$,stream:!0},"f"),L._run(()=>L._createMessage(H,{...$,stream:!0},{...A,headers:{...A?.headers,"X-Stainless-Helper-Method":"stream"}})),L}_run(H){H().then(()=>{this._emitFinal(),this._emit("end")},xA(this,A0$,"f"))}_addMessageParam(H){this.messages.push(H)}_addMessage(H,$=!0){if(this.receivedMessages.push(H),$)this._emit("message",H)}async _createMessage(H,$,A){let L=A?.signal,I;if(L){if(L.aborted)this.controller.abort();I=this.controller.abort.bind(this.controller),L.addEventListener("abort",I)}try{xA(this,Cq,"m",eLA).call(this);let{response:D,data:B}=await H.create({...$,stream:!0},{...A,signal:this.controller.signal}).withResponse();this._connected(D);for await(let f of B)xA(this,Cq,"m",HIA).call(this,f);if(B.controller.signal?.aborted)throw new rf;xA(this,Cq,"m",$IA).call(this)}finally{if(L&&I)L.removeEventListener("abort",I)}}_connected(H){if(this.ended)return;MD(this,H0$,H,"f"),MD(this,$0$,H?.headers.get("request-id"),"f"),xA(this,oB$,"f").call(this,H),this._emit("connect")}get ended(){return xA(this,NTH,"f")}get errored(){return xA(this,sB$,"f")}get aborted(){return xA(this,eB$,"f")}abort(){this.controller.abort()}on(H,$){return(xA(this,wu,"f")[H]||(xA(this,wu,"f")[H]=[])).push({listener:$}),this}off(H,$){let A=xA(this,wu,"f")[H];if(!A)return this;let L=A.findIndex((I)=>I.listener===$);if(L>=0)A.splice(L,1);return this}once(H,$){return(xA(this,wu,"f")[H]||(xA(this,wu,"f")[H]=[])).push({listener:$,once:!0}),this}emitted(H){return new Promise(($,A)=>{if(MD(this,C4H,!0,"f"),H!=="error")this.once("error",A);this.once(H,$)})}async done(){MD(this,C4H,!0,"f"),await xA(this,TTH,"f")}get currentMessage(){return xA(this,ii,"f")}async finalMessage(){return await this.done(),xA(this,Cq,"m",sLA).call(this)}async finalText(){return await this.done(),xA(this,Cq,"m",tcL).call(this)}_emit(H,...$){if(xA(this,NTH,"f"))return;if(H==="end")MD(this,NTH,!0,"f"),xA(this,tB$,"f").call(this);let A=xA(this,wu,"f")[H];if(A)xA(this,wu,"f")[H]=A.filter((L)=>!L.once),A.forEach(({listener:L})=>L(...$));if(H==="abort"){let L=$[0];if(!xA(this,C4H,"f")&&!A?.length)Promise.reject(L);xA(this,qTH,"f").call(this,L),xA(this,zTH,"f").call(this,L),this._emit("end");return}if(H==="error"){let L=$[0];if(!xA(this,C4H,"f")&&!A?.length)Promise.reject(L);xA(this,qTH,"f").call(this,L),xA(this,zTH,"f").call(this,L),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",xA(this,Cq,"m",sLA).call(this))}async _fromReadableStream(H,$){let A=$?.signal,L;if(A){if(A.aborted)this.controller.abort();L=this.controller.abort.bind(this.controller),A.addEventListener("abort",L)}try{xA(this,Cq,"m",eLA).call(this),this._connected(null);let I=RV.fromReadableStream(H,this.controller);for await(let D of I)xA(this,Cq,"m",HIA).call(this,D);if(I.controller.signal?.aborted)throw new rf;xA(this,Cq,"m",$IA).call(this)}finally{if(A&&L)A.removeEventListener("abort",L)}}[(ii=new WeakMap,Y4H=new WeakMap,ZTH=new WeakMap,oB$=new WeakMap,qTH=new WeakMap,TTH=new WeakMap,tB$=new WeakMap,zTH=new WeakMap,wu=new WeakMap,NTH=new WeakMap,sB$=new WeakMap,eB$=new WeakMap,C4H=new WeakMap,H0$=new WeakMap,$0$=new WeakMap,A0$=new WeakMap,Cq=new WeakSet,sLA=function(){if(this.receivedMessages.length===0)throw new ID("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},tcL=function(){if(this.receivedMessages.length===0)throw new ID("stream ended without producing a Message with role=assistant");let $=this.receivedMessages.at(-1).content.filter((A)=>A.type==="text").map((A)=>A.text);if($.length===0)throw new ID("stream ended without producing a content block with type=text");return $.join(" ")},eLA=function(){if(this.ended)return;MD(this,ii,void 0,"f")},HIA=function($){if(this.ended)return;let A=xA(this,Cq,"m",scL).call(this,$);switch(this._emit("streamEvent",$,A),$.type){case"content_block_delta":{let L=A.content.at(-1);switch($.delta.type){case"text_delta":{if(L.type==="text")this._emit("text",$.delta.text,L.text||"");break}case"citations_delta":{if(L.type==="text")this._emit("citation",$.delta.citation,L.citations??[]);break}case"input_json_delta":{if(HlL(L)&&L.input)this._emit("inputJson",$.delta.partial_json,L.input);break}case"thinking_delta":{if(L.type==="thinking")this._emit("thinking",$.delta.thinking,L.thinking);break}case"signature_delta":{if(L.type==="thinking")this._emit("signature",L.signature);break}default:$lL($.delta)}break}case"message_stop":{this._addMessageParam(A),this._addMessage(rLA(A,xA(this,Y4H,"f")),!0);break}case"content_block_stop":{this._emit("contentBlock",A.content.at(-1));break}case"message_start":{MD(this,ii,A,"f");break}case"content_block_start":case"message_delta":break}},$IA=function(){if(this.ended)throw new ID("stream has ended, this shouldn't happen");let $=xA(this,ii,"f");if(!$)throw new ID("request ended without sending any chunks");return MD(this,ii,void 0,"f"),rLA($,xA(this,Y4H,"f"))},scL=function($){let A=xA(this,ii,"f");if($.type==="message_start"){if(A)throw new ID(`Unexpected event order, got ${$.type} before receiving "message_stop"`);return $.message}if(!A)throw new ID(`Unexpected event order, got ${$.type} before "message_start"`);switch($.type){case"message_stop":return A;case"message_delta":if(A.container=$.delta.container,A.stop_reason=$.delta.stop_reason,A.stop_sequence=$.delta.stop_sequence,A.usage.output_tokens=$.usage.output_tokens,A.context_management=$.context_management,$.usage.input_tokens!=null)A.usage.input_tokens=$.usage.input_tokens;if($.usage.cache_creation_input_tokens!=null)A.usage.cache_creation_input_tokens=$.usage.cache_creation_input_tokens;if($.usage.cache_read_input_tokens!=null)A.usage.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.server_tool_use!=null)A.usage.server_tool_use=$.usage.server_tool_use;return A;case"content_block_start":return A.content.push($.content_block),A;case"content_block_delta":{let L=A.content.at($.index);switch($.delta.type){case"text_delta":{if(L?.type==="text")A.content[$.index]={...L,text:(L.text||"")+$.delta.text};break}case"citations_delta":{if(L?.type==="text")A.content[$.index]={...L,citations:[...L.citations??[],$.delta.citation]};break}case"input_json_delta":{if(L&&HlL(L)){let I=L[ecL]||"";I+=$.delta.partial_json;let D={...L};if(Object.defineProperty(D,ecL,{value:I,enumerable:!1,writable:!0}),I)try{D.input=rB$(I)}catch(B){let f=new ID(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${B}. JSON: ${I}`);xA(this,A0$,"f").call(this,f)}A.content[$.index]=D}break}case"thinking_delta":{if(L?.type==="thinking")A.content[$.index]={...L,thinking:L.thinking+$.delta.thinking};break}case"signature_delta":{if(L?.type==="thinking")A.content[$.index]={...L,signature:$.delta.signature};break}default:$lL($.delta)}return A}case"content_block_stop":return A}},Symbol.asyncIterator)](){let H=[],$=[],A=!1;return this.on("streamEvent",(L)=>{let I=$.shift();if(I)I.resolve(L);else H.push(L)}),this.on("end",()=>{A=!0;for(let L of $)L.resolve(void 0);$.length=0}),this.on("abort",(L)=>{A=!0;for(let I of $)I.reject(L);$.length=0}),this.on("error",(L)=>{A=!0;for(let I of $)I.reject(L);$.length=0}),{next:async()=>{if(!H.length){if(A)return{value:void 0,done:!0};return new Promise((I,D)=>$.push({resolve:I,reject:D})).then((I)=>I?{value:I,done:!1}:{value:void 0,done:!0})}return{value:H.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new RV(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});function LlL(){let H,$;return{promise:new Promise((L,I)=>{H=L,$=I}),resolve:H,reject:$}}async function dZ0(H,$=H.messages.at(-1)){if(!$||$.role!=="assistant"||!$.content||typeof $.content==="string")return null;let A=$.content.filter((I)=>I.type==="tool_use");if(A.length===0)return null;return{role:"user",content:await Promise.all(A.map(async(I)=>{let D=H.tools.find((B)=>B.name===I.name);if(!D||!("run"in D))return{type:"tool_result",tool_use_id:I.id,content:`Error: Tool '${I.name}' not found`,is_error:!0};try{let B=I.input;if("parse"in D&&D.parse)B=D.parse(B);let f=await D.run(B);return{type:"tool_result",tool_use_id:I.id,content:f}}catch(B){return{type:"tool_result",tool_use_id:I.id,content:`Error: ${B instanceof Error?B.message:String(B)}`,is_error:!0}}}))}}var L0$,w4H,uAH,i_,xTH,DO,Zu,ni,STH,AIA,jTH;var LIA=K(()=>{_u();jV();Yq();jTH=class jTH{constructor(H,$,A){L0$.add(this),this.client=H,w4H.set(this,!1),uAH.set(this,!1),i_.set(this,void 0),xTH.set(this,void 0),DO.set(this,void 0),Zu.set(this,void 0),ni.set(this,void 0),STH.set(this,0),MD(this,i_,{params:{...$,messages:structuredClone($.messages)}},"f"),MD(this,xTH,{...A,headers:z9([{"x-stainless-helper":"BetaToolRunner"},A?.headers])},"f"),MD(this,ni,LlL(),"f")}async*[(w4H=new WeakMap,uAH=new WeakMap,i_=new WeakMap,xTH=new WeakMap,DO=new WeakMap,Zu=new WeakMap,ni=new WeakMap,STH=new WeakMap,L0$=new WeakSet,Symbol.asyncIterator)](){var H;if(xA(this,w4H,"f"))throw new ID("Cannot iterate over a consumed stream");MD(this,w4H,!0,"f"),MD(this,uAH,!0,"f"),MD(this,Zu,void 0,"f");try{while(!0){let $;try{if(xA(this,i_,"f").params.max_iterations&&xA(this,STH,"f")>=xA(this,i_,"f").params.max_iterations)break;MD(this,uAH,!1,"f"),MD(this,DO,void 0,"f"),MD(this,Zu,void 0,"f"),MD(this,STH,(H=xA(this,STH,"f"),H++,H),"f");let{max_iterations:A,...L}=xA(this,i_,"f").params;if(L.stream)$=this.client.beta.messages.stream({...L},xA(this,xTH,"f")),MD(this,DO,$.finalMessage(),"f"),xA(this,DO,"f").catch(()=>{}),yield $;else MD(this,DO,this.client.beta.messages.create({...L,stream:!1},xA(this,xTH,"f")),"f"),yield xA(this,DO,"f");if(!xA(this,uAH,"f")){let{role:D,content:B}=await xA(this,DO,"f");xA(this,i_,"f").params.messages.push({role:D,content:B})}let I=await xA(this,L0$,"m",AIA).call(this,xA(this,i_,"f").params.messages.at(-1));if(I)xA(this,i_,"f").params.messages.push(I);if(!I&&!xA(this,uAH,"f"))break}finally{if($)$.abort()}}if(!xA(this,DO,"f"))throw new ID("ToolRunner concluded without a message from the server");xA(this,ni,"f").resolve(await xA(this,DO,"f"))}catch($){throw MD(this,w4H,!1,"f"),xA(this,ni,"f").promise.catch(()=>{}),xA(this,ni,"f").reject($),MD(this,ni,LlL(),"f"),$}}setMessagesParams(H){if(typeof H==="function")xA(this,i_,"f").params=H(xA(this,i_,"f").params);else xA(this,i_,"f").params=H;MD(this,uAH,!0,"f"),MD(this,Zu,void 0,"f")}async generateToolResponse(){let H=await xA(this,DO,"f")??this.params.messages.at(-1);if(!H)return null;return xA(this,L0$,"m",AIA).call(this,H)}done(){return xA(this,ni,"f").promise}async runUntilDone(){if(!xA(this,w4H,"f"))for await(let H of this);return this.done()}get params(){return xA(this,i_,"f").params}pushMessages(...H){this.setMessagesParams(($)=>({...$,messages:[...$.messages,...H]}))}then(H,$){return this.runUntilDone().then(H,$)}};AIA=async function($){if(xA(this,Zu,"f")!==void 0)return xA(this,Zu,"f");return MD(this,Zu,dZ0(xA(this,i_,"f").params,$),"f"),xA(this,Zu,"f")}});var Z4H;var IIA=K(()=>{jV();yLA();Z4H=class Z4H{constructor(H,$){this.iterator=H,this.controller=$}async*decoder(){let H=new ci;for await(let $ of this.iterator)for(let A of H.decode($))yield JSON.parse(A);for(let $ of H.flush())yield JSON.parse($)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(H,$){if(!H.body){if($.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new ID("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ID("Attempted to iterate over a response with no body")}return new Z4H(KTH(H.body),$)}}});var RTH;var DIA=K(()=>{$y();Yq();IIA();kAH();li();RTH=class RTH extends w5{create(H,$){let{betas:A,...L}=H;return this._client.post("/v1/messages/batches?beta=true",{body:L,...$,headers:z9([{"anthropic-beta":[...A??[],"message-batches-2024-09-24"].toString()},$?.headers])})}retrieve(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/messages/batches/${H}?beta=true`,{...A,headers:z9([{"anthropic-beta":[...L??[],"message-batches-2024-09-24"].toString()},A?.headers])})}list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/messages/batches?beta=true",IO,{query:L,...$,headers:z9([{"anthropic-beta":[...A??[],"message-batches-2024-09-24"].toString()},$?.headers])})}delete(H,$={},A){let{betas:L}=$??{};return this._client.delete(C4`/v1/messages/batches/${H}?beta=true`,{...A,headers:z9([{"anthropic-beta":[...L??[],"message-batches-2024-09-24"].toString()},A?.headers])})}cancel(H,$={},A){let{betas:L}=$??{};return this._client.post(C4`/v1/messages/batches/${H}/cancel?beta=true`,{...A,headers:z9([{"anthropic-beta":[...L??[],"message-batches-2024-09-24"].toString()},A?.headers])})}async results(H,$={},A){let L=await this.retrieve(H);if(!L.results_url)throw new ID(`No batch \`results_url\`; Has it finished processing? ${L.processing_status} - ${L.id}`);let{betas:I}=$??{};return this._client.get(L.results_url,{...A,headers:z9([{"anthropic-beta":[...I??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},A?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((D,B)=>Z4H.fromResponse(B.response,B.controller))}}});var IlL,gAH;var BIA=K(()=>{nLA();Yq();oLA();AlL();LIA();DIA();DIA();LIA();IlL={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};gAH=class gAH extends w5{constructor(){super(...arguments);this.batches=new RTH(this._client)}create(H,$){let{betas:A,...L}=H;if(L.model in IlL)console.warn(`The model '${L.model}' is deprecated and will reach end-of-life on ${IlL[L.model]} Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let A=this._client._options.timeout;if(!H.stream&&A==null){let L=nB$[H.model]??void 0;A=this._client.calculateNonstreamingTimeout(H.max_tokens,L)}return this._client.post("/v1/messages",{body:H,timeout:A??600000,...$,stream:H.stream??!1})}stream(H,$){return gTH.createMessage(this,H,$)}countTokens(H,$){return this._client.post("/v1/messages/count_tokens",{body:H,...$})}};UlL={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};O2.Batches=mTH});var z4H;var VIA=K(()=>{$y();Yq();li();z4H=class z4H extends w5{retrieve(H,$={},A){let{betas:L}=$??{};return this._client.get(C4`/v1/models/${H}`,{...A,headers:z9([{...L?.toString()!=null?{"anthropic-beta":L?.toString()}:void 0},A?.headers])})}list(H={},$){let{betas:A,...L}=H??{};return this._client.getAPIList("/v1/models",IO,{query:L,...$,headers:z9([{...A?.toString()!=null?{"anthropic-beta":A?.toString()}:void 0},$?.headers])})}}});var pTH=K(()=>{MIA();GIA();WIA();VIA();ncL()});var dTH=(H)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[H]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(H)?.trim();return};class fM{constructor({baseURL:H=dTH("ANTHROPIC_BASE_URL"),apiKey:$=dTH("ANTHROPIC_API_KEY")??null,authToken:A=dTH("ANTHROPIC_AUTH_TOKEN")??null,...L}={}){PIA.add(this),U0$.set(this,void 0);let I={apiKey:$,authToken:A,...L,baseURL:H||"https://api.anthropic.com"};if(!I.dangerouslyAllowBrowser&&RcL())throw new ID(`It looks like you're running in a browser-like environment. `).filter(Boolean));return}if(E.code===1){B([]);return}f(Error(`ripgrep failed with exit code ${E.code}: ${G||E.message}`))})})}var qrL;var zrL=K(()=>{qrL=require("child_process")});function a0$(){return[...QO0.filter((H)=>H!==".git"),".claude/commands",".claude/agents"]}function aIA(H){return H.toLowerCase()}function EO(H){return H.includes("*")||H.includes("?")||H.includes("[")||H.includes("]")}function LzH(H){return H.replace(/\/\*\*$/,"")}function NrL(H,$){let A=x2.normalize(H),L=x2.normalize($);if(L===A)return!1;if(A.startsWith("/tmp/")&&L==="/private"+A)return!1;if(A.startsWith("/var/")&&L==="/private"+A)return!1;if(A.startsWith("/private/tmp/")&&L===A)return!1;if(A.startsWith("/private/var/")&&L===A)return!1;if(L==="/")return!0;if(L.split("/").filter(Boolean).length<=1)return!0;if(A.startsWith(L+"/"))return!0;let D=A;if(A.startsWith("/tmp/"))D="/private"+A;else if(A.startsWith("/var/"))D="/private"+A;if(D!==A&&D.startsWith(L+"/"))return!0;let B=L.startsWith(A+"/"),f=D!==A&&L.startsWith(D+"/");if(L!==A&&!(D!==A&&L===D)&&!B&&!f)return!0;return!1}function MO(H){let $=process.cwd(),A=H;if(H==="~")A=r0$.homedir();else if(H.startsWith("~/"))A=r0$.homedir()+H.slice(1);else if(H.startsWith("./")||H.startsWith("../"))A=x2.resolve($,H);else if(!x2.isAbsolute(H))A=x2.resolve($,H);if(EO(A)){let L=A.split(/[*?[\]]/)[0];if(L&&L!=="/"){let I=L.endsWith("/")?L.slice(0,-1):x2.dirname(L);try{let D=rIA.realpathSync(I);if(!NrL(I,D)){let B=A.slice(I.length);return D+B}}catch{}}return A}try{let L=rIA.realpathSync(A);if(NrL(A,L));else A=L}catch{}return A}function IzH(){let H=r0$.homedir();return["/dev/stdout","/dev/stderr","/dev/null","/dev/tty","/dev/dtracehelper","/dev/autofs_nowait","/tmp/claude","/private/tmp/claude",x2.join(H,".npm/_logs"),x2.join(H,".claude/debug")]}function o0$(H,$){let L=["SANDBOX_RUNTIME=1",`TMPDIR=${process.env.CLAUDE_TMPDIR||"/tmp/claude"}`];if(!H&&!$)return L;let I=["localhost","127.0.0.1","::1","*.local",".local","169.254.0.0/16","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"].join(",");if(L.push(`NO_PROXY=${I}`),L.push(`no_proxy=${I}`),H)L.push(`HTTP_PROXY=http://localhost:${H}`),L.push(`HTTPS_PROXY=http://localhost:${H}`),L.push(`http_proxy=http://localhost:${H}`),L.push(`https_proxy=http://localhost:${H}`);if($){if(L.push(`ALL_PROXY=socks5h://localhost:${$}`),L.push(`all_proxy=socks5h://localhost:${$}`),Zq()==="macos")L.push(`GIT_SSH_COMMAND=ssh -o ProxyCommand='nc -X 5 -x localhost:${$} %h %p'`);if(L.push(`FTP_PROXY=socks5h://localhost:${$}`),L.push(`ftp_proxy=socks5h://localhost:${$}`),L.push(`RSYNC_PROXY=localhost:${$}`),L.push(`DOCKER_HTTP_PROXY=http://localhost:${H||$}`),L.push(`DOCKER_HTTPS_PROXY=http://localhost:${H||$}`),H)L.push("CLOUDSDK_PROXY_TYPE=https"),L.push("CLOUDSDK_PROXY_ADDRESS=localhost"),L.push(`CLOUDSDK_PROXY_PORT=${H}`);L.push(`GRPC_PROXY=socks5h://localhost:${$}`),L.push(`grpc_proxy=socks5h://localhost:${$}`)}return L}function t0$(H){let $=H.slice(0,100);return Buffer.from($).toString("base64")}function OrL(H){return Buffer.from(H,"base64").toString("utf8")}var r0$,x2,rIA,AzH,QO0;var p4H=K(()=>{n0$();r0$=require("os"),x2=b(require("path")),rIA=b(require("fs")),AzH=[".gitconfig",".gitmodules",".bashrc",".bash_profile",".zshrc",".zprofile",".profile",".ripgreprc",".mcp.json"],QO0=[".git",".vscode",".idea"]});function RrL(){if(sIA)return sIA;let H=[];try{let A=SrL.execSync("npm root -g",{encoding:"utf8",timeout:5000,stdio:["pipe","pipe","ignore"]}).trim();if(A)H.push(yV.join(A,"@anthropic-ai","sandbox-runtime"))}catch{}let $=jrL.homedir();return H.push(yV.join("/usr","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join("/usr","local","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join("/opt","homebrew","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join($,".npm","lib","node_modules","@anthropic-ai","sandbox-runtime"),yV.join($,".npm-global","lib","node_modules","@anthropic-ai","sandbox-runtime")),sIA=H,H}function eIA(){switch("x64"){case"x64":case"x86_64":return"x64";case"arm64":case"aarch64":return"arm64";case"ia32":case"x86":return wL("[SeccompFilter] 32-bit x86 (ia32) is not currently supported due to missing socketcall() syscall blocking. The current seccomp filter only blocks socket(AF_UNIX, ...), but on 32-bit x86, socketcall() can be used to bypass this.",{level:"error"}),null;default:return wL("[SeccompFilter] Unsupported architecture: x64. Only x64 and arm64 are supported."),null}}function yrL(H){let $=eIA();if(!$)return[];let A=yV.dirname(xrL.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js")),L=yV.join("vendor","seccomp",$,H);return[yV.join(A,L),yV.join(A,"..","..",L),yV.join(A,"..",L)]}function HDA(H){let $=H??"";if(oIA.has($))return oIA.get($);let A=WO0(H);return oIA.set($,A),A}function WO0(H){if(H){if(pAH.existsSync(H))return wL(`[SeccompFilter] Using BPF filter from explicit path: ${H}`),H;wL(`[SeccompFilter] Explicit path provided but file not found: ${H}`)}let $=eIA();if(!$)return wL("[SeccompFilter] Cannot find pre-generated BPF filter: unsupported architecture x64"),null;wL(`[SeccompFilter] Detected architecture: ${$}`);for(let A of yrL("unix-block.bpf"))if(pAH.existsSync(A))return wL(`[SeccompFilter] Found pre-generated BPF filter: ${A} (${$})`),A;for(let A of RrL()){let L=yV.join(A,"vendor","seccomp",$,"unix-block.bpf");if(pAH.existsSync(L))return wL(`[SeccompFilter] Found pre-generated BPF filter in global install: ${L} (${$})`),L}return wL(`[SeccompFilter] Pre-generated BPF filter not found in any expected location (${$})`),null}function DzH(H){let $=H??"";if(tIA.has($))return tIA.get($);let A=VO0(H);return tIA.set($,A),A}function VO0(H){if(H){if(pAH.existsSync(H))return wL(`[SeccompFilter] Using apply-seccomp binary from explicit path: ${H}`),H;wL(`[SeccompFilter] Explicit path provided but file not found: ${H}`)}let $=eIA();if(!$)return wL("[SeccompFilter] Cannot find apply-seccomp binary: unsupported architecture x64"),null;wL(`[SeccompFilter] Looking for apply-seccomp binary for architecture: ${$}`);for(let A of yrL("apply-seccomp"))if(pAH.existsSync(A))return wL(`[SeccompFilter] Found apply-seccomp binary: ${A} (${$})`),A;for(let A of RrL()){let L=yV.join(A,"vendor","seccomp",$,"apply-seccomp");if(pAH.existsSync(L))return wL(`[SeccompFilter] Found apply-seccomp binary in global install: ${L} (${$})`),L}return wL(`[SeccompFilter] apply-seccomp binary not found in any expected location (${$})`),null}function vrL(H){let $=HDA(H);if($)return wL("[SeccompFilter] Using pre-generated BPF filter"),$;return wL("[SeccompFilter] Pre-generated BPF filter not available for this architecture. Only x64 and arm64 are supported.",{level:"error"}),null}function $DA(H){}var yV,xrL,pAH,SrL,jrL,oIA,tIA,sIA=null;var hrL=K(()=>{yV=require("path"),xrL=require("url"),pAH=b(require("fs")),SrL=require("child_process"),jrL=require("os"),oIA=new Map,tIA=new Map});function PO0(H,$){let A=H.split(g6.default.sep),L="";for(let I of A){if(!I)continue;let D=L+g6.default.sep+I;try{if(S2.lstatSync(D).isSymbolicLink()){if($.some((E)=>D.startsWith(E+"/")||D===E))return D}}catch{break}L=D}return null}async function _O0(H={command:"rg"},$=IDA,A=!1,L){let I=process.cwd(),D=new AbortController,B=L??D.signal,f=a0$(),E=[...AzH.map((U)=>g6.default.resolve(I,U)),...f.map((U)=>g6.default.resolve(I,U)),g6.default.resolve(I,".git/hooks")];if(!A)E.push(g6.default.resolve(I,".git/config"));let M=[];for(let U of AzH)M.push("--iglob",U);for(let U of f)M.push("--iglob",`**/${U}/**`);if(M.push("--iglob","**/.git/hooks/**"),!A)M.push("--iglob","**/.git/config");let G=[];try{G=await TrL(["--files","--hidden","--max-depth",String($),...M,"-g","!**/node_modules/**"],I,B,H)}catch(U){wL(`[Sandbox] ripgrep scan failed: ${U}`)}for(let U of G){let X=g6.default.resolve(I,U),J=!1;for(let F of[...f,".git"]){let Q=aIA(F),W=X.split(g6.default.sep),P=W.findIndex((C)=>aIA(C)===Q);if(P!==-1){if(F===".git"){let C=W.slice(0,P+1).join(g6.default.sep);if(U.includes(".git/hooks"))E.push(g6.default.join(C,"hooks"));else if(U.includes(".git/config"))E.push(g6.default.join(C,"config"))}else E.push(W.slice(0,P+1).join(g6.default.sep));J=!0;break}}if(!J)E.push(X)}return[...new Set(E)]}function YO0(){if(brL)return;process.on("exit",()=>{for(let H of LDA)try{$DA(H)}catch{}}),brL=!0}function urL(H){let $=[],A=[],L=cAH.spawnSync("which",["bwrap"],{stdio:"ignore",timeout:1000}),I=cAH.spawnSync("which",["socat"],{stdio:"ignore",timeout:1000});if(L.status!==0)$.push("bubblewrap (bwrap) not installed");if(I.status!==0)$.push("socat not installed");let D=HDA(H?.bpfPath)!==null,B=DzH(H?.applyPath)!==null;if(!D||!B)A.push("seccomp not available - unix socket access not restricted");return{warnings:A,errors:$}}async function grL(H,$){let A=krL.randomBytes(8).toString("hex"),L=g6.join(ADA.tmpdir(),`claude-http-${A}.sock`),I=g6.join(ADA.tmpdir(),`claude-socks-${A}.sock`),D=[`UNIX-LISTEN:${L},fork,reuseaddr`,`TCP:localhost:${H},keepalive,keepidle=10,keepintvl=5,keepcnt=3`];wL(`Starting HTTP bridge: socat ${D.join(" ")}`);let B=cAH.spawn("socat",D,{stdio:"ignore"});if(!B.pid)throw Error("Failed to start HTTP bridge process");B.on("error",(G)=>{wL(`HTTP bridge process error: ${G}`,{level:"error"})}),B.on("exit",(G,U)=>{wL(`HTTP bridge process exited with code ${G}, signal ${U}`,{level:G===0?"info":"error"})});let f=[`UNIX-LISTEN:${I},fork,reuseaddr`,`TCP:localhost:${$},keepalive,keepidle=10,keepintvl=5,keepcnt=3`];wL(`Starting SOCKS bridge: socat ${f.join(" ")}`);let E=cAH.spawn("socat",f,{stdio:"ignore"});if(!E.pid){if(B.pid)try{process.kill(B.pid,"SIGTERM")}catch{}throw Error("Failed to start SOCKS bridge process")}E.on("error",(G)=>{wL(`SOCKS bridge process error: ${G}`,{level:"error"})}),E.on("exit",(G,U)=>{wL(`SOCKS bridge process exited with code ${G}, signal ${U}`,{level:G===0?"info":"error"})});let M=5;for(let G=0;GsetTimeout(U,G*100))}return{httpSocketPath:L,socksSocketPath:I,httpBridgeProcess:B,socksBridgeProcess:E,httpProxyPort:H,socksProxyPort:$}}function CO0(H,$,A,L,I,D){let B=I||"bash",f=[`socat TCP-LISTEN:3128,fork,reuseaddr UNIX-CONNECT:${H} >/dev/null 2>&1 &`,`socat TCP-LISTEN:1080,fork,reuseaddr UNIX-CONNECT:${$} >/dev/null 2>&1 &`,'trap "kill %1 %2 2>/dev/null; exit" EXIT'];if(L){let E=DzH(D);if(!E)throw Error("apply-seccomp binary not found. This should have been caught earlier. Ensure vendor/seccomp/{x64,arm64}/apply-seccomp binaries are included in the package.");let M=dAH.default.quote([E,L,B,"-c",A]),G=[...f,M].join(` `),M=E.find((Q)=>Q.includes("Sandbox:")&&Q.includes("deny")),G=E.find((Q)=>Q.startsWith("CMD64_"));if(!M)return;let U=M.match(L);if(!U?.[1])return;let X=U[1],J,F;if(G){if(F=G.match(A)?.[1],F)try{J=OrL(F)}catch{}}if(X.includes("mDNSResponder")||X.includes("mach-lookup com.apple.diagnosticd")||X.includes("mach-lookup com.apple.analyticsd"))return;if($&&J){if(I.length>0){if(I.some((W)=>X.includes(W)))return}for(let[Q,W]of D)if(J.includes(Q)){if(W.some((C)=>X.includes(C)))return}}H({line:X,command:J,encodedCommand:F,timestamp:new Date})}),B.stderr?.on("data",(f)=>{wL(`[Sandbox Monitor] Log stream stderr: ${f.toString()}`)}),B.on("error",(f)=>{wL(`[Sandbox Monitor] Failed to start log stream: ${f.message}`)}),B.on("exit",(f)=>{wL(`[Sandbox Monitor] Log stream exited with code: ${f}`)}),()=>{wL("[Sandbox Monitor] Stopping log monitor"),B.kill("SIGTERM")}}var crL,e0$,Su,lrL;var arL=K(()=>{p4H();crL=b(wtH(),1),e0$=require("child_process"),Su=b(require("path"));lrL=`_${Math.random().toString(36).slice(2,11)}_SBX`});class BzH{constructor(){this.violations=[],this.totalCount=0,this.maxSize=100,this.listeners=new Set}addViolation(H){if(this.violations.push(H),this.totalCount++,this.violations.length>this.maxSize)this.violations=this.violations.slice(-this.maxSize);this.notifyListeners()}getViolations(H){if(H===void 0)return[...this.violations];return this.violations.slice(-H)}getCount(){return this.violations.length}getTotalCount(){return this.totalCount}getViolationsForCommand(H){let $=t0$(H);return this.violations.filter((A)=>A.encodedCommand===$)}clear(){this.violations=[],this.notifyListeners()}subscribe(H){return this.listeners.add(H),H(this.getViolations()),()=>{this.listeners.delete(H)}}notifyListeners(){let H=this.getViolations();this.listeners.forEach(($)=>$(H))}}var DDA=K(()=>{p4H()});function xO0(){if(orL)return;let H=()=>EDA().catch(($)=>{wL(`Cleanup failed in registerCleanup ${$}`,{level:"error"})});process.once("exit",H),process.once("SIGINT",H),process.once("SIGTERM",H),orL=!0}function fDA(H,$){if($.startsWith("*.")){let A=$.substring(2);return H.toLowerCase().endsWith("."+A.toLowerCase())}return H.toLowerCase()===$.toLowerCase()}async function HaL(H,$,A){if(!u9)return wL("No config available, denying network request"),!1;for(let L of u9.network.deniedDomains)if(fDA($,L))return wL(`Denied by config rule: ${$}:${H}`),!1;for(let L of u9.network.allowedDomains)if(fDA($,L))return wL(`Allowed by config rule: ${$}:${H}`),!0;if(!A)return wL(`No matching config rule, denying: ${$}:${H}`),!1;wL(`No matching config rule, asking user: ${$}:${H}`);try{if(await A({host:$,port:H}))return wL(`User allowed: ${$}:${H}`),!0;else return wL(`User denied: ${$}:${H}`),!1}catch(L){return wL(`Error in permission callback: ${L}`,{level:"error"}),!1}}function SO0(H){if(!u9?.network.mitmProxy)return;let{socketPath:$,domains:A}=u9.network.mitmProxy;for(let L of A)if(fDA(H,L))return wL(`Host ${H} matches MITM pattern ${L}`),$;return}async function jO0(H){return d4H=WlL({filter:($,A)=>HaL($,A,H),getMitmSocketPath:SO0}),new Promise(($,A)=>{if(!d4H){A(Error("HTTP proxy server undefined before listen"));return}let L=d4H;L.once("error",A),L.once("listening",()=>{let I=L.address();if(I&&typeof I==="object")L.unref(),wL(`HTTP proxy listening on localhost:${I.port}`),$(I.port);else A(Error("Failed to get proxy server address"))}),L.listen(0,"127.0.0.1")})}async function RO0(H){return lAH=qlL({filter:($,A)=>HaL($,A,H)}),new Promise(($,A)=>{if(!lAH){A(Error("SOCKS proxy server undefined before listen"));return}lAH.listen(0,"127.0.0.1").then((L)=>{lAH?.unref(),$(L)}).catch(A)})}async function yO0(H,$,A=!1){if(An){await An;return}u9=H;let L=AaL();if(L.errors.length>0)throw Error(`Sandbox dependencies not available: ${L.errors.join(", ")}`);if(A&&Zq()==="macos")$9$=rrL(A9$.addViolation.bind(A9$),u9.ignoreViolations),wL("Started macOS sandbox log monitor");xO0(),An=(async()=>{try{let I;if(u9.network.httpProxyPort!==void 0)I=u9.network.httpProxyPort,wL(`Using external HTTP proxy on port ${I}`);else I=await jO0($);let D;if(u9.network.socksProxyPort!==void 0)D=u9.network.socksProxyPort,wL(`Using external SOCKS proxy on port ${D}`);else D=await RO0($);let B;if(Zq()==="linux")B=await grL(I,D);let f={httpProxyPort:I,socksProxyPort:D,linuxBridge:B};return qq=f,wL("Network infrastructure initialized"),f}catch(I){throw An=void 0,qq=void 0,EDA().catch((D)=>{wL(`Cleanup failed in initializationPromise ${D}`,{level:"error"})}),I}})(),await An}function $aL(){let H=Zq();if(H==="linux")return nIA()!=="1";return H==="macos"}function vO0(){return u9!==void 0}function AaL(H){if(!$aL())return{errors:["Unsupported platform"],warnings:[]};let $=[],A=[],L=H??u9?.ripgrep??{command:"rg"};if(erL.spawnSync("which",[L.command],{stdio:"ignore",timeout:1000}).status!==0)$.push(`ripgrep (${L.command}) not found`);if(Zq()==="linux"){let B=urL(u9?.seccomp);$.push(...B.errors),A.push(...B.warnings)}return{errors:$,warnings:A}}function hO0(){if(!u9)return{denyOnly:[]};return{denyOnly:u9.filesystem.denyRead.map(($)=>LzH($)).filter(($)=>{if(Zq()==="linux"&&EO($))return wL(`Skipping glob pattern on Linux/WSL: ${$}`),!1;return!0})}}function bO0(){if(!u9)return{allowOnly:IzH(),denyWithinAllow:[]};let H=u9.filesystem.allowWrite.map((L)=>LzH(L)).filter((L)=>{if(Zq()==="linux"&&EO(L))return wL(`Skipping glob pattern on Linux/WSL: ${L}`),!1;return!0}),$=u9.filesystem.denyWrite.map((L)=>LzH(L)).filter((L)=>{if(Zq()==="linux"&&EO(L))return wL(`Skipping glob pattern on Linux/WSL: ${L}`),!1;return!0});return{allowOnly:[...IzH(),...H],denyWithinAllow:$}}function kO0(){if(!u9)return{};let H=u9.network.allowedDomains,$=u9.network.deniedDomains;return{...H.length>0&&{allowedHosts:H},...$.length>0&&{deniedHosts:$}}}function LaL(){return u9?.network?.allowUnixSockets}function trL(){return u9?.network?.allowAllUnixSockets}function IaL(){return u9?.network?.allowLocalBinding}function DaL(){return u9?.ignoreViolations}function BaL(){return u9?.enableWeakerNestedSandbox}function uO0(){return u9?.ripgrep??{command:"rg"}}function gO0(){return u9?.mandatoryDenySearchDepth??3}function srL(){return u9?.filesystem?.allowGitConfig??!1}function mO0(){return u9?.seccomp}function faL(){return qq?.httpProxyPort}function EaL(){return qq?.socksProxyPort}function MaL(){return qq?.linuxBridge?.httpSocketPath}function GaL(){return qq?.linuxBridge?.socksSocketPath}async function UaL(){if(!u9)return!1;if(An)try{return await An,!0}catch{return!1}return qq!==void 0}async function pO0(H,$,A,L){let I=Zq(),D=A?.filesystem?.allowWrite??u9?.filesystem.allowWrite??[],B={allowOnly:[...IzH(),...D],denyWithinAllow:A?.filesystem?.denyWrite??u9?.filesystem.denyWrite??[]},f={denyOnly:A?.filesystem?.denyRead??u9?.filesystem.denyRead??[]},E=A?.network?.allowedDomains!==void 0||u9?.network?.allowedDomains!==void 0,M=E,G=E;if(G)await UaL();let U=A?.allowPty??u9?.allowPty;switch(I){case"macos":return nrL({command:H,needsNetworkRestriction:M,httpProxyPort:G?faL():void 0,socksProxyPort:G?EaL():void 0,readConfig:f,writeConfig:B,allowUnixSockets:LaL(),allowAllUnixSockets:trL(),allowLocalBinding:IaL(),ignoreViolations:DaL(),allowPty:U,allowGitConfig:srL(),binShell:$});case"linux":return mrL({command:H,needsNetworkRestriction:M,httpSocketPath:G?MaL():void 0,socksSocketPath:G?GaL():void 0,httpProxyPort:G?qq?.httpProxyPort:void 0,socksProxyPort:G?qq?.socksProxyPort:void 0,readConfig:f,writeConfig:B,enableWeakerNestedSandbox:BaL(),allowAllUnixSockets:trL(),binShell:$,ripgrepConfig:uO0(),mandatoryDenySearchDepth:gO0(),allowGitConfig:srL(),seccompConfig:mO0(),abortSignal:L});default:throw Error(`Sandbox configuration is not supported on platform: ${I}`)}}function dO0(){return u9}function cO0(H){u9=iIA(H),wL("Sandbox configuration updated")}async function EDA(){if($9$)$9$(),$9$=void 0;if(qq?.linuxBridge){let{httpSocketPath:$,socksSocketPath:A,httpBridgeProcess:L,socksBridgeProcess:I}=qq.linuxBridge,D=[];if(L.pid&&!L.killed)try{process.kill(L.pid,"SIGTERM"),wL("Sent SIGTERM to HTTP bridge process"),D.push(new Promise((B)=>{L.once("exit",()=>{wL("HTTP bridge process exited"),B()}),setTimeout(()=>{if(!L.killed){wL("HTTP bridge did not exit, forcing SIGKILL",{level:"warn"});try{if(L.pid)process.kill(L.pid,"SIGKILL")}catch{}}B()},5000)}))}catch(B){if(B.code!=="ESRCH")wL(`Error killing HTTP bridge: ${B}`,{level:"error"})}if(I.pid&&!I.killed)try{process.kill(I.pid,"SIGTERM"),wL("Sent SIGTERM to SOCKS bridge process"),D.push(new Promise((B)=>{I.once("exit",()=>{wL("SOCKS bridge process exited"),B()}),setTimeout(()=>{if(!I.killed){wL("SOCKS bridge did not exit, forcing SIGKILL",{level:"warn"});try{if(I.pid)process.kill(I.pid,"SIGKILL")}catch{}}B()},5000)}))}catch(B){if(B.code!=="ESRCH")wL(`Error killing SOCKS bridge: ${B}`,{level:"error"})}if(await Promise.all(D),$)try{BDA.rmSync($,{force:!0}),wL("Cleaned up HTTP socket")}catch(B){wL(`HTTP socket cleanup error: ${B}`,{level:"error"})}if(A)try{BDA.rmSync(A,{force:!0}),wL("Cleaned up SOCKS socket")}catch(B){wL(`SOCKS socket cleanup error: ${B}`,{level:"error"})}}let H=[];if(d4H){let $=d4H,A=new Promise((L)=>{$.close((I)=>{if(I&&I.message!=="Server is not running.")wL(`Error closing HTTP proxy server: ${I.message}`,{level:"error"});L()})});H.push(A)}if(lAH){let $=lAH.close().catch((A)=>{wL(`Error closing SOCKS proxy server: ${A.message}`,{level:"error"})});H.push($)}await Promise.all(H),d4H=void 0,lAH=void 0,qq=void 0,An=void 0}function lO0(){return A9$}function iO0(H,$){if(!u9)return $;let A=A9$.getViolationsForCommand(H);if(A.length===0)return $;let L=$;L+=H9$.EOL+""+H9$.EOL;for(let I of A)L+=I.line+H9$.EOL;return L+="",L}function nO0(){if(Zq()!=="linux"||!u9)return[];let H=[],$=[...u9.filesystem.denyRead,...u9.filesystem.allowWrite,...u9.filesystem.denyWrite];for(let A of $){let L=LzH(A);if(EO(L))H.push(A)}return H}var BDA,erL,H9$,u9,d4H,lAH,qq,An,orL=!1,$9$,A9$,Z5;var XaL=K(()=>{VlL();TlL();wrL();n0$();prL();arL();p4H();DDA();BDA=b(require("fs")),erL=require("child_process"),H9$=require("os"),A9$=new BzH;Z5={initialize:yO0,isSupportedPlatform:$aL,isSandboxingEnabled:vO0,checkDependencies:AaL,getFsReadConfig:hO0,getFsWriteConfig:bO0,getNetworkRestrictionConfig:kO0,getAllowUnixSockets:LaL,getAllowLocalBinding:IaL,getIgnoreViolations:DaL,getEnableWeakerNestedSandbox:BaL,getProxyPort:faL,getSocksProxyPort:EaL,getLinuxHttpSocketPath:MaL,getLinuxSocksSocketPath:GaL,waitForNetworkInitialization:UaL,wrapWithSandbox:pO0,reset:EDA,getSandboxViolationStore:lO0,annotateStderrWithSandboxFailures:iO0,getLinuxGlobPatternWarnings:nO0,getConfig:dO0,updateConfig:cO0}});var N8,MDA,qI,Dy=(H)=>{switch(typeof H){case"undefined":return qI.undefined;case"string":return qI.string;case"number":return Number.isNaN(H)?qI.nan:qI.number;case"boolean":return qI.boolean;case"function":return qI.function;case"bigint":return qI.bigint;case"symbol":return qI.symbol;case"object":if(Array.isArray(H))return qI.array;if(H===null)return qI.null;if(H.then&&typeof H.then==="function"&&H.catch&&typeof H.catch==="function")return qI.promise;if(typeof Map<"u"&&H instanceof Map)return qI.map;if(typeof Set<"u"&&H instanceof Set)return qI.set;if(typeof Date<"u"&&H instanceof Date)return qI.date;return qI.object;default:return qI.unknown}};var fzH=K(()=>{(function(H){H.assertEqual=(I)=>{};function $(I){}H.assertIs=$;function A(I){throw Error()}H.assertNever=A,H.arrayToEnum=(I)=>{let D={};for(let B of I)D[B]=B;return D},H.getValidEnumValues=(I)=>{let D=H.objectKeys(I).filter((f)=>typeof I[I[f]]!=="number"),B={};for(let f of D)B[f]=I[f];return H.objectValues(B)},H.objectValues=(I)=>{return H.objectKeys(I).map(function(D){return I[D]})},H.objectKeys=typeof Object.keys==="function"?(I)=>Object.keys(I):(I)=>{let D=[];for(let B in I)if(Object.prototype.hasOwnProperty.call(I,B))D.push(B);return D},H.find=(I,D)=>{for(let B of I)if(D(B))return B;return},H.isInteger=typeof Number.isInteger==="function"?(I)=>Number.isInteger(I):(I)=>typeof I==="number"&&Number.isFinite(I)&&Math.floor(I)===I;function L(I,D=" | "){return I.map((B)=>typeof B==="string"?`'${B}'`:B).join(D)}H.joinValues=L,H.jsonStringifyReplacer=(I,D)=>{if(typeof D==="bigint")return D.toString();return D}})(N8||(N8={}));(function(H){H.mergeShapes=($,A)=>{return{...$,...A}}})(MDA||(MDA={}));qI=N8.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var rL,rO0=(H)=>{return JSON.stringify(H,null,2).replace(/"([^"]+)":/g,"$1:")},a_;var L9$=K(()=>{fzH();rL=N8.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"]);a_=class a_ extends Error{get errors(){return this.issues}constructor(H){super();this.issues=[],this.addIssue=(A)=>{this.issues=[...this.issues,A]},this.addIssues=(A=[])=>{this.issues=[...this.issues,...A]};let $=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,$);else this.__proto__=$;this.name="ZodError",this.issues=H}format(H){let $=H||function(I){return I.message},A={_errors:[]},L=(I)=>{for(let D of I.issues)if(D.code==="invalid_union")D.unionErrors.map(L);else if(D.code==="invalid_return_type")L(D.returnTypeError);else if(D.code==="invalid_arguments")L(D.argumentsError);else if(D.path.length===0)A._errors.push($(D));else{let B=A,f=0;while(f$.message){let $={},A=[];for(let L of this.issues)if(L.path.length>0){let I=L.path[0];$[I]=$[I]||[],$[I].push(H(L))}else A.push(H(L));return{formErrors:A,fieldErrors:$}}get formErrors(){return this.flatten()}};a_.create=(H)=>{return new a_(H)}});var aO0=(H,$)=>{let A;switch(H.code){case rL.invalid_type:if(H.received===qI.undefined)A="Required";else A=`Expected ${H.expected}, received ${H.received}`;break;case rL.invalid_literal:A=`Invalid literal value, expected ${JSON.stringify(H.expected,N8.jsonStringifyReplacer)}`;break;case rL.unrecognized_keys:A=`Unrecognized key(s) in object: ${N8.joinValues(H.keys,", ")}`;break;case rL.invalid_union:A="Invalid input";break;case rL.invalid_union_discriminator:A=`Invalid discriminator value. Expected ${N8.joinValues(H.options)}`;break;case rL.invalid_enum_value:A=`Invalid enum value. Expected ${N8.joinValues(H.options)}, received '${H.received}'`;break;case rL.invalid_arguments:A="Invalid function arguments";break;case rL.invalid_return_type:A="Invalid function return type";break;case rL.invalid_date:A="Invalid date";break;case rL.invalid_string:if(typeof H.validation==="object")if("includes"in H.validation){if(A=`Invalid input: must include "${H.validation.includes}"`,typeof H.validation.position==="number")A=`${A} at one or more positions greater than or equal to ${H.validation.position}`}else if("startsWith"in H.validation)A=`Invalid input: must start with "${H.validation.startsWith}"`;else if("endsWith"in H.validation)A=`Invalid input: must end with "${H.validation.endsWith}"`;else N8.assertNever(H.validation);else if(H.validation!=="regex")A=`Invalid ${H.validation}`;else A="Invalid";break;case rL.too_small:if(H.type==="array")A=`Array must contain ${H.exact?"exactly":H.inclusive?"at least":"more than"} ${H.minimum} element(s)`;else if(H.type==="string")A=`String must contain ${H.exact?"exactly":H.inclusive?"at least":"over"} ${H.minimum} character(s)`;else if(H.type==="number")A=`Number must be ${H.exact?"exactly equal to ":H.inclusive?"greater than or equal to ":"greater than "}${H.minimum}`;else if(H.type==="bigint")A=`Number must be ${H.exact?"exactly equal to ":H.inclusive?"greater than or equal to ":"greater than "}${H.minimum}`;else if(H.type==="date")A=`Date must be ${H.exact?"exactly equal to ":H.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(H.minimum))}`;else A="Invalid input";break;case rL.too_big:if(H.type==="array")A=`Array must contain ${H.exact?"exactly":H.inclusive?"at most":"less than"} ${H.maximum} element(s)`;else if(H.type==="string")A=`String must contain ${H.exact?"exactly":H.inclusive?"at most":"under"} ${H.maximum} character(s)`;else if(H.type==="number")A=`Number must be ${H.exact?"exactly":H.inclusive?"less than or equal to":"less than"} ${H.maximum}`;else if(H.type==="bigint")A=`BigInt must be ${H.exact?"exactly":H.inclusive?"less than or equal to":"less than"} ${H.maximum}`;else if(H.type==="date")A=`Date must be ${H.exact?"exactly":H.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(H.maximum))}`;else A="Invalid input";break;case rL.custom:A="Invalid input";break;case rL.invalid_intersection_types:A="Intersection results could not be merged";break;case rL.not_multiple_of:A=`Number must be a multiple of ${H.multipleOf}`;break;case rL.not_finite:A="Number must be finite";break;default:A=$.defaultError,N8.assertNever(H)}return{message:A}},ju;var GDA=K(()=>{L9$();fzH();ju=aO0});function oO0(H){JaL=H}function c4H(){return JaL}var JaL;var I9$=K(()=>{GDA();JaL=ju});function pI(H,$){let A=c4H(),L=EzH({issueData:$,data:H.data,path:H.path,errorMaps:[H.common.contextualErrorMap,H.schemaErrorMap,A,A===ju?void 0:ju].filter((I)=>!!I)});H.common.issues.push(L)}class rW{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(H,$){let A=[];for(let L of $){if(L.status==="aborted")return Y0;if(L.status==="dirty")H.dirty();A.push(L.value)}return{status:H.value,value:A}}static async mergeObjectAsync(H,$){let A=[];for(let L of $){let I=await L.key,D=await L.value;A.push({key:I,value:D})}return rW.mergeObjectSync(H,A)}static mergeObjectSync(H,$){let A={};for(let L of $){let{key:I,value:D}=L;if(I.status==="aborted")return Y0;if(D.status==="aborted")return Y0;if(I.status==="dirty")H.dirty();if(D.status==="dirty")H.dirty();if(I.value!=="__proto__"&&(typeof D.value<"u"||L.alwaysSet))A[I.value]=D.value}return{status:H.value,value:A}}}var EzH=(H)=>{let{data:$,path:A,errorMaps:L,issueData:I}=H,D=[...A,...I.path||[]],B={...I,path:D};if(I.message!==void 0)return{...I,path:D,message:I.message};let f="",E=L.filter((M)=>!!M).slice().reverse();for(let M of E)f=M(B,{data:$,defaultError:f}).message;return{...I,path:D,message:f}},tO0,Y0,iAH=(H)=>({status:"dirty",value:H}),m6=(H)=>({status:"valid",value:H}),D9$=(H)=>H.status==="aborted",B9$=(H)=>H.status==="dirty",Ln=(H)=>H.status==="valid",l4H=(H)=>typeof Promise<"u"&&H instanceof Promise;var UDA=K(()=>{I9$();GDA();tO0=[];Y0=Object.freeze({status:"aborted"})});var FaL=()=>{};var HB;var KaL=K(()=>{(function(H){H.errToObj=($)=>typeof $==="string"?{message:$}:$||{},H.toString=($)=>typeof $==="string"?$:$?.message})(HB||(HB={}))});class JO{constructor(H,$,A,L){this._cachedPath=[],this.parent=H,this.data=$,this._path=A,this._key=L}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 G1(H){if(!H)return{};let{errorMap:$,invalid_type_error:A,required_error:L,description:I}=H;if($&&(A||L))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if($)return{errorMap:$,description:I};return{errorMap:(B,f)=>{let{message:E}=H;if(B.code==="invalid_enum_value")return{message:E??f.defaultError};if(typeof f.data>"u")return{message:E??L??f.defaultError};if(B.code!=="invalid_type")return{message:f.defaultError};return{message:E??A??f.defaultError}},description:I}}class H8{get description(){return this._def.description}_getType(H){return Dy(H.data)}_getOrReturnCtx(H,$){return $||{common:H.parent.common,data:H.data,parsedType:Dy(H.data),schemaErrorMap:this._def.errorMap,path:H.path,parent:H.parent}}_processInputParams(H){return{status:new rW,ctx:{common:H.parent.common,data:H.data,parsedType:Dy(H.data),schemaErrorMap:this._def.errorMap,path:H.path,parent:H.parent}}}_parseSync(H){let $=this._parse(H);if(l4H($))throw Error("Synchronous parse encountered promise.");return $}_parseAsync(H){let $=this._parse(H);return Promise.resolve($)}parse(H,$){let A=this.safeParse(H,$);if(A.success)return A.data;throw A.error}safeParse(H,$){let A={common:{issues:[],async:$?.async??!1,contextualErrorMap:$?.errorMap},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:H,parsedType:Dy(H)},L=this._parseSync({data:H,path:A.path,parent:A});return QaL(A,L)}"~validate"(H){let $={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:H,parsedType:Dy(H)};if(!this["~standard"].async)try{let A=this._parseSync({data:H,path:[],parent:$});return Ln(A)?{value:A.value}:{issues:$.common.issues}}catch(A){if(A?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;$.common={issues:[],async:!0}}return this._parseAsync({data:H,path:[],parent:$}).then((A)=>Ln(A)?{value:A.value}:{issues:$.common.issues})}async parseAsync(H,$){let A=await this.safeParseAsync(H,$);if(A.success)return A.data;throw A.error}async safeParseAsync(H,$){let A={common:{issues:[],contextualErrorMap:$?.errorMap,async:!0},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:H,parsedType:Dy(H)},L=this._parse({data:H,path:A.path,parent:A}),I=await(l4H(L)?L:Promise.resolve(L));return QaL(A,I)}refine(H,$){let A=(L)=>{if(typeof $==="string"||typeof $>"u")return{message:$};else if(typeof $==="function")return $(L);else return $};return this._refinement((L,I)=>{let D=H(L),B=()=>I.addIssue({code:rL.custom,...A(L)});if(typeof Promise<"u"&&D instanceof Promise)return D.then((f)=>{if(!f)return B(),!1;else return!0});if(!D)return B(),!1;else return!0})}refinement(H,$){return this._refinement((A,L)=>{if(!H(A))return L.addIssue(typeof $==="function"?$(A,L):$),!1;else return!0})}_refinement(H){return new FO({schema:this,typeName:m0.ZodEffects,effect:{type:"refinement",refinement:H}})}superRefine(H){return this._refinement(H)}constructor(H){this.spa=this.safeParseAsync,this._def=H,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:($)=>this["~validate"]($)}}optional(){return XO.create(this,this._def)}nullable(){return yu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return UO.create(this)}promise(){return oAH.create(this,this._def)}or(H){return t4H.create([this,H],this._def)}and(H){return s4H.create(this,H,this._def)}transform(H){return new FO({...G1(this._def),schema:this,typeName:m0.ZodEffects,effect:{type:"transform",transform:H}})}default(H){let $=typeof H==="function"?H:()=>H;return new A5H({...G1(this._def),innerType:this,defaultValue:$,typeName:m0.ZodDefault})}brand(){return new E9$({typeName:m0.ZodBranded,type:this,...G1(this._def)})}catch(H){let $=typeof H==="function"?H:()=>H;return new L5H({...G1(this._def),innerType:this,catchValue:$,typeName:m0.ZodCatch})}describe(H){return new this.constructor({...this._def,description:H})}pipe(H){return FzH.create(this,H)}readonly(){return I5H.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function PaL(H){let $="[0-5]\\d";if(H.precision)$=`${$}\\.\\d{${H.precision}}`;else if(H.precision==null)$=`${$}(\\.\\d+)?`;let A=H.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${$})${A}`}function Fx0(H){return new RegExp(`^${PaL(H)}$`)}function _aL(H){let $=`${VaL}T${PaL(H)}`,A=[];if(A.push(H.local?"Z?":"Z"),H.offset)A.push("([+-]\\d{2}:?\\d{2})");return $=`${$}(${A.join("|")})`,new RegExp(`^${$}$`)}function Kx0(H,$){if(($==="v4"||!$)&&fx0.test(H))return!0;if(($==="v6"||!$)&&Mx0.test(H))return!0;return!1}function Qx0(H,$){if(!Lx0.test(H))return!1;try{let[A]=H.split(".");if(!A)return!1;let L=A.replace(/-/g,"+").replace(/_/g,"/").padEnd(A.length+(4-A.length%4)%4,"="),I=JSON.parse(atob(L));if(typeof I!=="object"||I===null)return!1;if("typ"in I&&I?.typ!=="JWT")return!1;if(!I.alg)return!1;if($&&I.alg!==$)return!1;return!0}catch{return!1}}function Wx0(H,$){if(($==="v4"||!$)&&Ex0.test(H))return!0;if(($==="v6"||!$)&&Gx0.test(H))return!0;return!1}function Vx0(H,$){let A=(H.toString().split(".")[1]||"").length,L=($.toString().split(".")[1]||"").length,I=A>L?A:L,D=Number.parseInt(H.toFixed(I).replace(".","")),B=Number.parseInt($.toFixed(I).replace(".",""));return D%B/10**I}function i4H(H){if(H instanceof q5){let $={};for(let A in H.shape){let L=H.shape[A];$[A]=XO.create(i4H(L))}return new q5({...H._def,shape:()=>$})}else if(H instanceof UO)return new UO({...H._def,type:i4H(H.element)});else if(H instanceof XO)return XO.create(i4H(H.unwrap()));else if(H instanceof yu)return yu.create(i4H(H.unwrap()));else if(H instanceof fy)return fy.create(H.items.map(($)=>i4H($)));else return H}function JDA(H,$){let A=Dy(H),L=Dy($);if(H===$)return{valid:!0,data:H};else if(A===qI.object&&L===qI.object){let I=N8.objectKeys($),D=N8.objectKeys(H).filter((f)=>I.indexOf(f)!==-1),B={...H,...$};for(let f of D){let E=JDA(H[f],$[f]);if(!E.valid)return{valid:!1};B[f]=E.data}return{valid:!0,data:B}}else if(A===qI.array&&L===qI.array){if(H.length!==$.length)return{valid:!1};let I=[];for(let D=0;D{let D=H(L);if(D instanceof Promise)return D.then((B)=>{if(!B){let f=WaL($,L),E=f.fatal??A??!0;I.addIssue({code:"custom",...f,fatal:E})}});if(!D){let B=WaL($,L),f=B.fatal??A??!0;I.addIssue({code:"custom",...B,fatal:f})}return});return rAH.create()}var QaL=(H,$)=>{if(Ln($))return{success:!0,data:$.value};else{if(!H.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let A=new a_(H.common.issues);return this._error=A,this._error}}}},sO0,eO0,Hx0,$x0,Ax0,Lx0,Ix0,Dx0,Bx0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",XDA,fx0,Ex0,Mx0,Gx0,Ux0,Xx0,VaL="((\\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])))",Jx0,GO,Dn,Bn,r4H,nAH,MzH,a4H,o4H,rAH,In,By,GzH,UO,q5,t4H,Ru=(H)=>{if(H instanceof e4H)return Ru(H.schema);else if(H instanceof FO)return Ru(H.innerType());else if(H instanceof H5H)return[H.value];else if(H instanceof fn)return H.options;else if(H instanceof $5H)return N8.objectValues(H.enum);else if(H instanceof A5H)return Ru(H._def.innerType);else if(H instanceof a4H)return[void 0];else if(H instanceof o4H)return[null];else if(H instanceof XO)return[void 0,...Ru(H.unwrap())];else if(H instanceof yu)return[null,...Ru(H.unwrap())];else if(H instanceof E9$)return Ru(H.unwrap());else if(H instanceof I5H)return Ru(H.unwrap());else if(H instanceof L5H)return Ru(H._def.innerType);else return[]},f9$,s4H,fy,UzH,XzH,aAH,n4H,e4H,H5H,fn,$5H,oAH,FO,XO,yu,A5H,L5H,JzH,Px0,E9$,FzH,I5H,_x0,m0,Yx0=(H,$={message:`Input not instance of ${H.name}`})=>CaL((A)=>A instanceof H,$),uL,Tq,Cx0,wx0,PQ,Zx0,qx0,Tx0,zx0,Nx0,Ox0,xx0,Sx0,FX,R2,y2,tAH,jx0,Rx0,yx0,KO,vx0,hx0,bx0,kx0,ux0,QO,gx0,mx0,px0,dx0,cx0,lx0,ix0,nx0=()=>uL().optional(),rx0=()=>Tq().optional(),ax0=()=>PQ().optional(),ox0,tx0;var waL=K(()=>{L9$();I9$();KaL();UDA();fzH();sO0=/^c[^\s-]{8,}$/i,eO0=/^[0-9a-z]+$/,Hx0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$x0=/^[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,Ax0=/^[a-z0-9_-]{21}$/i,Lx0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ix0=/^[-+]?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)?)??$/,Dx0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fx0=/^(?:(?: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])$/,Ex0=/^(?:(?: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])$/,Mx0=/^(([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]))$/,Gx0=/^(([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])$/,Ux0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xx0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jx0=new RegExp(`^${VaL}$`);GO=class GO extends H8{_parse(H){if(this._def.coerce)H.data=String(H.data);if(this._getType(H)!==qI.string){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_type,expected:qI.string,received:I.parsedType}),Y0}let A=new rW,L=void 0;for(let I of this._def.checks)if(I.kind==="min"){if(H.data.lengthI.value)L=this._getOrReturnCtx(H,L),pI(L,{code:rL.too_big,maximum:I.value,type:"string",inclusive:!0,exact:!1,message:I.message}),A.dirty()}else if(I.kind==="length"){let D=H.data.length>I.value,B=H.data.lengthH.test(L),{validation:$,code:rL.invalid_string,...HB.errToObj(A)})}_addCheck(H){return new GO({...this._def,checks:[...this._def.checks,H]})}email(H){return this._addCheck({kind:"email",...HB.errToObj(H)})}url(H){return this._addCheck({kind:"url",...HB.errToObj(H)})}emoji(H){return this._addCheck({kind:"emoji",...HB.errToObj(H)})}uuid(H){return this._addCheck({kind:"uuid",...HB.errToObj(H)})}nanoid(H){return this._addCheck({kind:"nanoid",...HB.errToObj(H)})}cuid(H){return this._addCheck({kind:"cuid",...HB.errToObj(H)})}cuid2(H){return this._addCheck({kind:"cuid2",...HB.errToObj(H)})}ulid(H){return this._addCheck({kind:"ulid",...HB.errToObj(H)})}base64(H){return this._addCheck({kind:"base64",...HB.errToObj(H)})}base64url(H){return this._addCheck({kind:"base64url",...HB.errToObj(H)})}jwt(H){return this._addCheck({kind:"jwt",...HB.errToObj(H)})}ip(H){return this._addCheck({kind:"ip",...HB.errToObj(H)})}cidr(H){return this._addCheck({kind:"cidr",...HB.errToObj(H)})}datetime(H){if(typeof H==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:H});return this._addCheck({kind:"datetime",precision:typeof H?.precision>"u"?null:H?.precision,offset:H?.offset??!1,local:H?.local??!1,...HB.errToObj(H?.message)})}date(H){return this._addCheck({kind:"date",message:H})}time(H){if(typeof H==="string")return this._addCheck({kind:"time",precision:null,message:H});return this._addCheck({kind:"time",precision:typeof H?.precision>"u"?null:H?.precision,...HB.errToObj(H?.message)})}duration(H){return this._addCheck({kind:"duration",...HB.errToObj(H)})}regex(H,$){return this._addCheck({kind:"regex",regex:H,...HB.errToObj($)})}includes(H,$){return this._addCheck({kind:"includes",value:H,position:$?.position,...HB.errToObj($?.message)})}startsWith(H,$){return this._addCheck({kind:"startsWith",value:H,...HB.errToObj($)})}endsWith(H,$){return this._addCheck({kind:"endsWith",value:H,...HB.errToObj($)})}min(H,$){return this._addCheck({kind:"min",value:H,...HB.errToObj($)})}max(H,$){return this._addCheck({kind:"max",value:H,...HB.errToObj($)})}length(H,$){return this._addCheck({kind:"length",value:H,...HB.errToObj($)})}nonempty(H){return this.min(1,HB.errToObj(H))}trim(){return new GO({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new GO({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new GO({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((H)=>H.kind==="datetime")}get isDate(){return!!this._def.checks.find((H)=>H.kind==="date")}get isTime(){return!!this._def.checks.find((H)=>H.kind==="time")}get isDuration(){return!!this._def.checks.find((H)=>H.kind==="duration")}get isEmail(){return!!this._def.checks.find((H)=>H.kind==="email")}get isURL(){return!!this._def.checks.find((H)=>H.kind==="url")}get isEmoji(){return!!this._def.checks.find((H)=>H.kind==="emoji")}get isUUID(){return!!this._def.checks.find((H)=>H.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((H)=>H.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((H)=>H.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((H)=>H.kind==="cuid2")}get isULID(){return!!this._def.checks.find((H)=>H.kind==="ulid")}get isIP(){return!!this._def.checks.find((H)=>H.kind==="ip")}get isCIDR(){return!!this._def.checks.find((H)=>H.kind==="cidr")}get isBase64(){return!!this._def.checks.find((H)=>H.kind==="base64")}get isBase64url(){return!!this._def.checks.find((H)=>H.kind==="base64url")}get minLength(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H}get maxLength(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.value{return new GO({checks:[],typeName:m0.ZodString,coerce:H?.coerce??!1,...G1(H)})};Dn=class Dn extends H8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(H){if(this._def.coerce)H.data=Number(H.data);if(this._getType(H)!==qI.number){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_type,expected:qI.number,received:I.parsedType}),Y0}let A=void 0,L=new rW;for(let I of this._def.checks)if(I.kind==="int"){if(!N8.isInteger(H.data))A=this._getOrReturnCtx(H,A),pI(A,{code:rL.invalid_type,expected:"integer",received:"float",message:I.message}),L.dirty()}else if(I.kind==="min"){if(I.inclusive?H.dataI.value:H.data>=I.value)A=this._getOrReturnCtx(H,A),pI(A,{code:rL.too_big,maximum:I.value,type:"number",inclusive:I.inclusive,exact:!1,message:I.message}),L.dirty()}else if(I.kind==="multipleOf"){if(Vx0(H.data,I.value)!==0)A=this._getOrReturnCtx(H,A),pI(A,{code:rL.not_multiple_of,multipleOf:I.value,message:I.message}),L.dirty()}else if(I.kind==="finite"){if(!Number.isFinite(H.data))A=this._getOrReturnCtx(H,A),pI(A,{code:rL.not_finite,message:I.message}),L.dirty()}else N8.assertNever(I);return{status:L.value,value:H.data}}gte(H,$){return this.setLimit("min",H,!0,HB.toString($))}gt(H,$){return this.setLimit("min",H,!1,HB.toString($))}lte(H,$){return this.setLimit("max",H,!0,HB.toString($))}lt(H,$){return this.setLimit("max",H,!1,HB.toString($))}setLimit(H,$,A,L){return new Dn({...this._def,checks:[...this._def.checks,{kind:H,value:$,inclusive:A,message:HB.toString(L)}]})}_addCheck(H){return new Dn({...this._def,checks:[...this._def.checks,H]})}int(H){return this._addCheck({kind:"int",message:HB.toString(H)})}positive(H){return this._addCheck({kind:"min",value:0,inclusive:!1,message:HB.toString(H)})}negative(H){return this._addCheck({kind:"max",value:0,inclusive:!1,message:HB.toString(H)})}nonpositive(H){return this._addCheck({kind:"max",value:0,inclusive:!0,message:HB.toString(H)})}nonnegative(H){return this._addCheck({kind:"min",value:0,inclusive:!0,message:HB.toString(H)})}multipleOf(H,$){return this._addCheck({kind:"multipleOf",value:H,message:HB.toString($)})}finite(H){return this._addCheck({kind:"finite",message:HB.toString(H)})}safe(H){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:HB.toString(H)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:HB.toString(H)})}get minValue(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H}get maxValue(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.valueH.kind==="int"||H.kind==="multipleOf"&&N8.isInteger(H.value))}get isFinite(){let H=null,$=null;for(let A of this._def.checks)if(A.kind==="finite"||A.kind==="int"||A.kind==="multipleOf")return!0;else if(A.kind==="min"){if($===null||A.value>$)$=A.value}else if(A.kind==="max"){if(H===null||A.value{return new Dn({checks:[],typeName:m0.ZodNumber,coerce:H?.coerce||!1,...G1(H)})};Bn=class Bn extends H8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(H){if(this._def.coerce)try{H.data=BigInt(H.data)}catch{return this._getInvalidInput(H)}if(this._getType(H)!==qI.bigint)return this._getInvalidInput(H);let A=void 0,L=new rW;for(let I of this._def.checks)if(I.kind==="min"){if(I.inclusive?H.dataI.value:H.data>=I.value)A=this._getOrReturnCtx(H,A),pI(A,{code:rL.too_big,type:"bigint",maximum:I.value,inclusive:I.inclusive,message:I.message}),L.dirty()}else if(I.kind==="multipleOf"){if(H.data%I.value!==BigInt(0))A=this._getOrReturnCtx(H,A),pI(A,{code:rL.not_multiple_of,multipleOf:I.value,message:I.message}),L.dirty()}else N8.assertNever(I);return{status:L.value,value:H.data}}_getInvalidInput(H){let $=this._getOrReturnCtx(H);return pI($,{code:rL.invalid_type,expected:qI.bigint,received:$.parsedType}),Y0}gte(H,$){return this.setLimit("min",H,!0,HB.toString($))}gt(H,$){return this.setLimit("min",H,!1,HB.toString($))}lte(H,$){return this.setLimit("max",H,!0,HB.toString($))}lt(H,$){return this.setLimit("max",H,!1,HB.toString($))}setLimit(H,$,A,L){return new Bn({...this._def,checks:[...this._def.checks,{kind:H,value:$,inclusive:A,message:HB.toString(L)}]})}_addCheck(H){return new Bn({...this._def,checks:[...this._def.checks,H]})}positive(H){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:HB.toString(H)})}negative(H){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:HB.toString(H)})}nonpositive(H){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:HB.toString(H)})}nonnegative(H){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:HB.toString(H)})}multipleOf(H,$){return this._addCheck({kind:"multipleOf",value:H,message:HB.toString($)})}get minValue(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H}get maxValue(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.value{return new Bn({checks:[],typeName:m0.ZodBigInt,coerce:H?.coerce??!1,...G1(H)})};r4H=class r4H extends H8{_parse(H){if(this._def.coerce)H.data=Boolean(H.data);if(this._getType(H)!==qI.boolean){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.boolean,received:A.parsedType}),Y0}return m6(H.data)}};r4H.create=(H)=>{return new r4H({typeName:m0.ZodBoolean,coerce:H?.coerce||!1,...G1(H)})};nAH=class nAH extends H8{_parse(H){if(this._def.coerce)H.data=new Date(H.data);if(this._getType(H)!==qI.date){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_type,expected:qI.date,received:I.parsedType}),Y0}if(Number.isNaN(H.data.getTime())){let I=this._getOrReturnCtx(H);return pI(I,{code:rL.invalid_date}),Y0}let A=new rW,L=void 0;for(let I of this._def.checks)if(I.kind==="min"){if(H.data.getTime()I.value)L=this._getOrReturnCtx(H,L),pI(L,{code:rL.too_big,message:I.message,inclusive:!0,exact:!1,maximum:I.value,type:"date"}),A.dirty()}else N8.assertNever(I);return{status:A.value,value:new Date(H.data.getTime())}}_addCheck(H){return new nAH({...this._def,checks:[...this._def.checks,H]})}min(H,$){return this._addCheck({kind:"min",value:H.getTime(),message:HB.toString($)})}max(H,$){return this._addCheck({kind:"max",value:H.getTime(),message:HB.toString($)})}get minDate(){let H=null;for(let $ of this._def.checks)if($.kind==="min"){if(H===null||$.value>H)H=$.value}return H!=null?new Date(H):null}get maxDate(){let H=null;for(let $ of this._def.checks)if($.kind==="max"){if(H===null||$.value{return new nAH({checks:[],coerce:H?.coerce||!1,typeName:m0.ZodDate,...G1(H)})};MzH=class MzH extends H8{_parse(H){if(this._getType(H)!==qI.symbol){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.symbol,received:A.parsedType}),Y0}return m6(H.data)}};MzH.create=(H)=>{return new MzH({typeName:m0.ZodSymbol,...G1(H)})};a4H=class a4H extends H8{_parse(H){if(this._getType(H)!==qI.undefined){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.undefined,received:A.parsedType}),Y0}return m6(H.data)}};a4H.create=(H)=>{return new a4H({typeName:m0.ZodUndefined,...G1(H)})};o4H=class o4H extends H8{_parse(H){if(this._getType(H)!==qI.null){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.null,received:A.parsedType}),Y0}return m6(H.data)}};o4H.create=(H)=>{return new o4H({typeName:m0.ZodNull,...G1(H)})};rAH=class rAH extends H8{constructor(){super(...arguments);this._any=!0}_parse(H){return m6(H.data)}};rAH.create=(H)=>{return new rAH({typeName:m0.ZodAny,...G1(H)})};In=class In extends H8{constructor(){super(...arguments);this._unknown=!0}_parse(H){return m6(H.data)}};In.create=(H)=>{return new In({typeName:m0.ZodUnknown,...G1(H)})};By=class By extends H8{_parse(H){let $=this._getOrReturnCtx(H);return pI($,{code:rL.invalid_type,expected:qI.never,received:$.parsedType}),Y0}};By.create=(H)=>{return new By({typeName:m0.ZodNever,...G1(H)})};GzH=class GzH extends H8{_parse(H){if(this._getType(H)!==qI.undefined){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.void,received:A.parsedType}),Y0}return m6(H.data)}};GzH.create=(H)=>{return new GzH({typeName:m0.ZodVoid,...G1(H)})};UO=class UO extends H8{_parse(H){let{ctx:$,status:A}=this._processInputParams(H),L=this._def;if($.parsedType!==qI.array)return pI($,{code:rL.invalid_type,expected:qI.array,received:$.parsedType}),Y0;if(L.exactLength!==null){let D=$.data.length>L.exactLength.value,B=$.data.lengthL.maxLength.value)pI($,{code:rL.too_big,maximum:L.maxLength.value,type:"array",inclusive:!0,exact:!1,message:L.maxLength.message}),A.dirty()}if($.common.async)return Promise.all([...$.data].map((D,B)=>{return L.type._parseAsync(new JO($,D,$.path,B))})).then((D)=>{return rW.mergeArray(A,D)});let I=[...$.data].map((D,B)=>{return L.type._parseSync(new JO($,D,$.path,B))});return rW.mergeArray(A,I)}get element(){return this._def.type}min(H,$){return new UO({...this._def,minLength:{value:H,message:HB.toString($)}})}max(H,$){return new UO({...this._def,maxLength:{value:H,message:HB.toString($)}})}length(H,$){return new UO({...this._def,exactLength:{value:H,message:HB.toString($)}})}nonempty(H){return this.min(1,H)}};UO.create=(H,$)=>{return new UO({type:H,minLength:null,maxLength:null,exactLength:null,typeName:m0.ZodArray,...G1($)})};q5=class q5 extends H8{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let H=this._def.shape(),$=N8.objectKeys(H);return this._cached={shape:H,keys:$},this._cached}_parse(H){if(this._getType(H)!==qI.object){let E=this._getOrReturnCtx(H);return pI(E,{code:rL.invalid_type,expected:qI.object,received:E.parsedType}),Y0}let{status:A,ctx:L}=this._processInputParams(H),{shape:I,keys:D}=this._getCached(),B=[];if(!(this._def.catchall instanceof By&&this._def.unknownKeys==="strip")){for(let E in L.data)if(!D.includes(E))B.push(E)}let f=[];for(let E of D){let M=I[E],G=L.data[E];f.push({key:{status:"valid",value:E},value:M._parse(new JO(L,G,L.path,E)),alwaysSet:E in L.data})}if(this._def.catchall instanceof By){let E=this._def.unknownKeys;if(E==="passthrough")for(let M of B)f.push({key:{status:"valid",value:M},value:{status:"valid",value:L.data[M]}});else if(E==="strict"){if(B.length>0)pI(L,{code:rL.unrecognized_keys,keys:B}),A.dirty()}else if(E==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let E=this._def.catchall;for(let M of B){let G=L.data[M];f.push({key:{status:"valid",value:M},value:E._parse(new JO(L,G,L.path,M)),alwaysSet:M in L.data})}}if(L.common.async)return Promise.resolve().then(async()=>{let E=[];for(let M of f){let G=await M.key,U=await M.value;E.push({key:G,value:U,alwaysSet:M.alwaysSet})}return E}).then((E)=>{return rW.mergeObjectSync(A,E)});else return rW.mergeObjectSync(A,f)}get shape(){return this._def.shape()}strict(H){return HB.errToObj,new q5({...this._def,unknownKeys:"strict",...H!==void 0?{errorMap:($,A)=>{let L=this._def.errorMap?.($,A).message??A.defaultError;if($.code==="unrecognized_keys")return{message:HB.errToObj(H).message??L};return{message:L}}}:{}})}strip(){return new q5({...this._def,unknownKeys:"strip"})}passthrough(){return new q5({...this._def,unknownKeys:"passthrough"})}extend(H){return new q5({...this._def,shape:()=>({...this._def.shape(),...H})})}merge(H){return new q5({unknownKeys:H._def.unknownKeys,catchall:H._def.catchall,shape:()=>({...this._def.shape(),...H._def.shape()}),typeName:m0.ZodObject})}setKey(H,$){return this.augment({[H]:$})}catchall(H){return new q5({...this._def,catchall:H})}pick(H){let $={};for(let A of N8.objectKeys(H))if(H[A]&&this.shape[A])$[A]=this.shape[A];return new q5({...this._def,shape:()=>$})}omit(H){let $={};for(let A of N8.objectKeys(this.shape))if(!H[A])$[A]=this.shape[A];return new q5({...this._def,shape:()=>$})}deepPartial(){return i4H(this)}partial(H){let $={};for(let A of N8.objectKeys(this.shape)){let L=this.shape[A];if(H&&!H[A])$[A]=L;else $[A]=L.optional()}return new q5({...this._def,shape:()=>$})}required(H){let $={};for(let A of N8.objectKeys(this.shape))if(H&&!H[A])$[A]=this.shape[A];else{let I=this.shape[A];while(I instanceof XO)I=I._def.innerType;$[A]=I}return new q5({...this._def,shape:()=>$})}keyof(){return YaL(N8.objectKeys(this.shape))}};q5.create=(H,$)=>{return new q5({shape:()=>H,unknownKeys:"strip",catchall:By.create(),typeName:m0.ZodObject,...G1($)})};q5.strictCreate=(H,$)=>{return new q5({shape:()=>H,unknownKeys:"strict",catchall:By.create(),typeName:m0.ZodObject,...G1($)})};q5.lazycreate=(H,$)=>{return new q5({shape:H,unknownKeys:"strip",catchall:By.create(),typeName:m0.ZodObject,...G1($)})};t4H=class t4H extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A=this._def.options;function L(I){for(let B of I)if(B.result.status==="valid")return B.result;for(let B of I)if(B.result.status==="dirty")return $.common.issues.push(...B.ctx.common.issues),B.result;let D=I.map((B)=>new a_(B.ctx.common.issues));return pI($,{code:rL.invalid_union,unionErrors:D}),Y0}if($.common.async)return Promise.all(A.map(async(I)=>{let D={...$,common:{...$.common,issues:[]},parent:null};return{result:await I._parseAsync({data:$.data,path:$.path,parent:D}),ctx:D}})).then(L);else{let I=void 0,D=[];for(let f of A){let E={...$,common:{...$.common,issues:[]},parent:null},M=f._parseSync({data:$.data,path:$.path,parent:E});if(M.status==="valid")return M;else if(M.status==="dirty"&&!I)I={result:M,ctx:E};if(E.common.issues.length)D.push(E.common.issues)}if(I)return $.common.issues.push(...I.ctx.common.issues),I.result;let B=D.map((f)=>new a_(f));return pI($,{code:rL.invalid_union,unionErrors:B}),Y0}}get options(){return this._def.options}};t4H.create=(H,$)=>{return new t4H({options:H,typeName:m0.ZodUnion,...G1($)})};f9$=class f9$ extends H8{_parse(H){let{ctx:$}=this._processInputParams(H);if($.parsedType!==qI.object)return pI($,{code:rL.invalid_type,expected:qI.object,received:$.parsedType}),Y0;let A=this.discriminator,L=$.data[A],I=this.optionsMap.get(L);if(!I)return pI($,{code:rL.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[A]}),Y0;if($.common.async)return I._parseAsync({data:$.data,path:$.path,parent:$});else return I._parseSync({data:$.data,path:$.path,parent:$})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(H,$,A){let L=new Map;for(let I of $){let D=Ru(I.shape[H]);if(!D.length)throw Error(`A discriminator value for key \`${H}\` could not be extracted from all schema options`);for(let B of D){if(L.has(B))throw Error(`Discriminator property ${String(H)} has duplicate value ${String(B)}`);L.set(B,I)}}return new f9$({typeName:m0.ZodDiscriminatedUnion,discriminator:H,options:$,optionsMap:L,...G1(A)})}};s4H=class s4H extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H),L=(I,D)=>{if(D9$(I)||D9$(D))return Y0;let B=JDA(I.value,D.value);if(!B.valid)return pI(A,{code:rL.invalid_intersection_types}),Y0;if(B9$(I)||B9$(D))$.dirty();return{status:$.value,value:B.data}};if(A.common.async)return Promise.all([this._def.left._parseAsync({data:A.data,path:A.path,parent:A}),this._def.right._parseAsync({data:A.data,path:A.path,parent:A})]).then(([I,D])=>L(I,D));else return L(this._def.left._parseSync({data:A.data,path:A.path,parent:A}),this._def.right._parseSync({data:A.data,path:A.path,parent:A}))}};s4H.create=(H,$,A)=>{return new s4H({left:H,right:$,typeName:m0.ZodIntersection,...G1(A)})};fy=class fy extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.array)return pI(A,{code:rL.invalid_type,expected:qI.array,received:A.parsedType}),Y0;if(A.data.lengththis._def.items.length)pI(A,{code:rL.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty();let I=[...A.data].map((D,B)=>{let f=this._def.items[B]||this._def.rest;if(!f)return null;return f._parse(new JO(A,D,A.path,B))}).filter((D)=>!!D);if(A.common.async)return Promise.all(I).then((D)=>{return rW.mergeArray($,D)});else return rW.mergeArray($,I)}get items(){return this._def.items}rest(H){return new fy({...this._def,rest:H})}};fy.create=(H,$)=>{if(!Array.isArray(H))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new fy({items:H,typeName:m0.ZodTuple,rest:null,...G1($)})};UzH=class UzH extends H8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.object)return pI(A,{code:rL.invalid_type,expected:qI.object,received:A.parsedType}),Y0;let L=[],I=this._def.keyType,D=this._def.valueType;for(let B in A.data)L.push({key:I._parse(new JO(A,B,A.path,B)),value:D._parse(new JO(A,A.data[B],A.path,B)),alwaysSet:B in A.data});if(A.common.async)return rW.mergeObjectAsync($,L);else return rW.mergeObjectSync($,L)}get element(){return this._def.valueType}static create(H,$,A){if($ instanceof H8)return new UzH({keyType:H,valueType:$,typeName:m0.ZodRecord,...G1(A)});return new UzH({keyType:GO.create(),valueType:H,typeName:m0.ZodRecord,...G1($)})}};XzH=class XzH extends H8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.map)return pI(A,{code:rL.invalid_type,expected:qI.map,received:A.parsedType}),Y0;let L=this._def.keyType,I=this._def.valueType,D=[...A.data.entries()].map(([B,f],E)=>{return{key:L._parse(new JO(A,B,A.path,[E,"key"])),value:I._parse(new JO(A,f,A.path,[E,"value"]))}});if(A.common.async){let B=new Map;return Promise.resolve().then(async()=>{for(let f of D){let E=await f.key,M=await f.value;if(E.status==="aborted"||M.status==="aborted")return Y0;if(E.status==="dirty"||M.status==="dirty")$.dirty();B.set(E.value,M.value)}return{status:$.value,value:B}})}else{let B=new Map;for(let f of D){let{key:E,value:M}=f;if(E.status==="aborted"||M.status==="aborted")return Y0;if(E.status==="dirty"||M.status==="dirty")$.dirty();B.set(E.value,M.value)}return{status:$.value,value:B}}}};XzH.create=(H,$,A)=>{return new XzH({valueType:$,keyType:H,typeName:m0.ZodMap,...G1(A)})};aAH=class aAH extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.parsedType!==qI.set)return pI(A,{code:rL.invalid_type,expected:qI.set,received:A.parsedType}),Y0;let L=this._def;if(L.minSize!==null){if(A.data.sizeL.maxSize.value)pI(A,{code:rL.too_big,maximum:L.maxSize.value,type:"set",inclusive:!0,exact:!1,message:L.maxSize.message}),$.dirty()}let I=this._def.valueType;function D(f){let E=new Set;for(let M of f){if(M.status==="aborted")return Y0;if(M.status==="dirty")$.dirty();E.add(M.value)}return{status:$.value,value:E}}let B=[...A.data.values()].map((f,E)=>I._parse(new JO(A,f,A.path,E)));if(A.common.async)return Promise.all(B).then((f)=>D(f));else return D(B)}min(H,$){return new aAH({...this._def,minSize:{value:H,message:HB.toString($)}})}max(H,$){return new aAH({...this._def,maxSize:{value:H,message:HB.toString($)}})}size(H,$){return this.min(H,$).max(H,$)}nonempty(H){return this.min(1,H)}};aAH.create=(H,$)=>{return new aAH({valueType:H,minSize:null,maxSize:null,typeName:m0.ZodSet,...G1($)})};n4H=class n4H extends H8{constructor(){super(...arguments);this.validate=this.implement}_parse(H){let{ctx:$}=this._processInputParams(H);if($.parsedType!==qI.function)return pI($,{code:rL.invalid_type,expected:qI.function,received:$.parsedType}),Y0;function A(B,f){return EzH({data:B,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,c4H(),ju].filter((E)=>!!E),issueData:{code:rL.invalid_arguments,argumentsError:f}})}function L(B,f){return EzH({data:B,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,c4H(),ju].filter((E)=>!!E),issueData:{code:rL.invalid_return_type,returnTypeError:f}})}let I={errorMap:$.common.contextualErrorMap},D=$.data;if(this._def.returns instanceof oAH){let B=this;return m6(async function(...f){let E=new a_([]),M=await B._def.args.parseAsync(f,I).catch((X)=>{throw E.addIssue(A(f,X)),E}),G=await Reflect.apply(D,this,M);return await B._def.returns._def.type.parseAsync(G,I).catch((X)=>{throw E.addIssue(L(G,X)),E})})}else{let B=this;return m6(function(...f){let E=B._def.args.safeParse(f,I);if(!E.success)throw new a_([A(f,E.error)]);let M=Reflect.apply(D,this,E.data),G=B._def.returns.safeParse(M,I);if(!G.success)throw new a_([L(M,G.error)]);return G.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...H){return new n4H({...this._def,args:fy.create(H).rest(In.create())})}returns(H){return new n4H({...this._def,returns:H})}implement(H){return this.parse(H)}strictImplement(H){return this.parse(H)}static create(H,$,A){return new n4H({args:H?H:fy.create([]).rest(In.create()),returns:$||In.create(),typeName:m0.ZodFunction,...G1(A)})}};e4H=class e4H extends H8{get schema(){return this._def.getter()}_parse(H){let{ctx:$}=this._processInputParams(H);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}};e4H.create=(H,$)=>{return new e4H({getter:H,typeName:m0.ZodLazy,...G1($)})};H5H=class H5H extends H8{_parse(H){if(H.data!==this._def.value){let $=this._getOrReturnCtx(H);return pI($,{received:$.data,code:rL.invalid_literal,expected:this._def.value}),Y0}return{status:"valid",value:H.data}}get value(){return this._def.value}};H5H.create=(H,$)=>{return new H5H({value:H,typeName:m0.ZodLiteral,...G1($)})};fn=class fn extends H8{_parse(H){if(typeof H.data!=="string"){let $=this._getOrReturnCtx(H),A=this._def.values;return pI($,{expected:N8.joinValues(A),received:$.parsedType,code:rL.invalid_type}),Y0}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(H.data)){let $=this._getOrReturnCtx(H),A=this._def.values;return pI($,{received:$.data,code:rL.invalid_enum_value,options:A}),Y0}return m6(H.data)}get options(){return this._def.values}get enum(){let H={};for(let $ of this._def.values)H[$]=$;return H}get Values(){let H={};for(let $ of this._def.values)H[$]=$;return H}get Enum(){let H={};for(let $ of this._def.values)H[$]=$;return H}extract(H,$=this._def){return fn.create(H,{...this._def,...$})}exclude(H,$=this._def){return fn.create(this.options.filter((A)=>!H.includes(A)),{...this._def,...$})}};fn.create=YaL;$5H=class $5H extends H8{_parse(H){let $=N8.getValidEnumValues(this._def.values),A=this._getOrReturnCtx(H);if(A.parsedType!==qI.string&&A.parsedType!==qI.number){let L=N8.objectValues($);return pI(A,{expected:N8.joinValues(L),received:A.parsedType,code:rL.invalid_type}),Y0}if(!this._cache)this._cache=new Set(N8.getValidEnumValues(this._def.values));if(!this._cache.has(H.data)){let L=N8.objectValues($);return pI(A,{received:A.data,code:rL.invalid_enum_value,options:L}),Y0}return m6(H.data)}get enum(){return this._def.values}};$5H.create=(H,$)=>{return new $5H({values:H,typeName:m0.ZodNativeEnum,...G1($)})};oAH=class oAH extends H8{unwrap(){return this._def.type}_parse(H){let{ctx:$}=this._processInputParams(H);if($.parsedType!==qI.promise&&$.common.async===!1)return pI($,{code:rL.invalid_type,expected:qI.promise,received:$.parsedType}),Y0;let A=$.parsedType===qI.promise?$.data:Promise.resolve($.data);return m6(A.then((L)=>{return this._def.type.parseAsync(L,{path:$.path,errorMap:$.common.contextualErrorMap})}))}};oAH.create=(H,$)=>{return new oAH({type:H,typeName:m0.ZodPromise,...G1($)})};FO=class FO extends H8{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(H){let{status:$,ctx:A}=this._processInputParams(H),L=this._def.effect||null,I={addIssue:(D)=>{if(pI(A,D),D.fatal)$.abort();else $.dirty()},get path(){return A.path}};if(I.addIssue=I.addIssue.bind(I),L.type==="preprocess"){let D=L.transform(A.data,I);if(A.common.async)return Promise.resolve(D).then(async(B)=>{if($.value==="aborted")return Y0;let f=await this._def.schema._parseAsync({data:B,path:A.path,parent:A});if(f.status==="aborted")return Y0;if(f.status==="dirty")return iAH(f.value);if($.value==="dirty")return iAH(f.value);return f});else{if($.value==="aborted")return Y0;let B=this._def.schema._parseSync({data:D,path:A.path,parent:A});if(B.status==="aborted")return Y0;if(B.status==="dirty")return iAH(B.value);if($.value==="dirty")return iAH(B.value);return B}}if(L.type==="refinement"){let D=(B)=>{let f=L.refinement(B,I);if(A.common.async)return Promise.resolve(f);if(f instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return B};if(A.common.async===!1){let B=this._def.schema._parseSync({data:A.data,path:A.path,parent:A});if(B.status==="aborted")return Y0;if(B.status==="dirty")$.dirty();return D(B.value),{status:$.value,value:B.value}}else return this._def.schema._parseAsync({data:A.data,path:A.path,parent:A}).then((B)=>{if(B.status==="aborted")return Y0;if(B.status==="dirty")$.dirty();return D(B.value).then(()=>{return{status:$.value,value:B.value}})})}if(L.type==="transform")if(A.common.async===!1){let D=this._def.schema._parseSync({data:A.data,path:A.path,parent:A});if(!Ln(D))return Y0;let B=L.transform(D.value,I);if(B instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:B}}else return this._def.schema._parseAsync({data:A.data,path:A.path,parent:A}).then((D)=>{if(!Ln(D))return Y0;return Promise.resolve(L.transform(D.value,I)).then((B)=>({status:$.value,value:B}))});N8.assertNever(L)}};FO.create=(H,$,A)=>{return new FO({schema:H,typeName:m0.ZodEffects,effect:$,...G1(A)})};FO.createWithPreprocess=(H,$,A)=>{return new FO({schema:$,effect:{type:"preprocess",transform:H},typeName:m0.ZodEffects,...G1(A)})};XO=class XO extends H8{_parse(H){if(this._getType(H)===qI.undefined)return m6(void 0);return this._def.innerType._parse(H)}unwrap(){return this._def.innerType}};XO.create=(H,$)=>{return new XO({innerType:H,typeName:m0.ZodOptional,...G1($)})};yu=class yu extends H8{_parse(H){if(this._getType(H)===qI.null)return m6(null);return this._def.innerType._parse(H)}unwrap(){return this._def.innerType}};yu.create=(H,$)=>{return new yu({innerType:H,typeName:m0.ZodNullable,...G1($)})};A5H=class A5H extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A=$.data;if($.parsedType===qI.undefined)A=this._def.defaultValue();return this._def.innerType._parse({data:A,path:$.path,parent:$})}removeDefault(){return this._def.innerType}};A5H.create=(H,$)=>{return new A5H({innerType:H,typeName:m0.ZodDefault,defaultValue:typeof $.default==="function"?$.default:()=>$.default,...G1($)})};L5H=class L5H extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A={...$,common:{...$.common,issues:[]}},L=this._def.innerType._parse({data:A.data,path:A.path,parent:{...A}});if(l4H(L))return L.then((I)=>{return{status:"valid",value:I.status==="valid"?I.value:this._def.catchValue({get error(){return new a_(A.common.issues)},input:A.data})}});else return{status:"valid",value:L.status==="valid"?L.value:this._def.catchValue({get error(){return new a_(A.common.issues)},input:A.data})}}removeCatch(){return this._def.innerType}};L5H.create=(H,$)=>{return new L5H({innerType:H,typeName:m0.ZodCatch,catchValue:typeof $.catch==="function"?$.catch:()=>$.catch,...G1($)})};JzH=class JzH extends H8{_parse(H){if(this._getType(H)!==qI.nan){let A=this._getOrReturnCtx(H);return pI(A,{code:rL.invalid_type,expected:qI.nan,received:A.parsedType}),Y0}return{status:"valid",value:H.data}}};JzH.create=(H)=>{return new JzH({typeName:m0.ZodNaN,...G1(H)})};Px0=Symbol("zod_brand");E9$=class E9$ extends H8{_parse(H){let{ctx:$}=this._processInputParams(H),A=$.data;return this._def.type._parse({data:A,path:$.path,parent:$})}unwrap(){return this._def.type}};FzH=class FzH extends H8{_parse(H){let{status:$,ctx:A}=this._processInputParams(H);if(A.common.async)return(async()=>{let I=await this._def.in._parseAsync({data:A.data,path:A.path,parent:A});if(I.status==="aborted")return Y0;if(I.status==="dirty")return $.dirty(),iAH(I.value);else return this._def.out._parseAsync({data:I.value,path:A.path,parent:A})})();else{let L=this._def.in._parseSync({data:A.data,path:A.path,parent:A});if(L.status==="aborted")return Y0;if(L.status==="dirty")return $.dirty(),{status:"dirty",value:L.value};else return this._def.out._parseSync({data:L.value,path:A.path,parent:A})}}static create(H,$){return new FzH({in:H,out:$,typeName:m0.ZodPipeline})}};I5H=class I5H extends H8{_parse(H){let $=this._def.innerType._parse(H),A=(L)=>{if(Ln(L))L.value=Object.freeze(L.value);return L};return l4H($)?$.then((L)=>A(L)):A($)}unwrap(){return this._def.innerType}};I5H.create=(H,$)=>{return new I5H({innerType:H,typeName:m0.ZodReadonly,...G1($)})};_x0={object:q5.lazycreate};(function(H){H.ZodString="ZodString",H.ZodNumber="ZodNumber",H.ZodNaN="ZodNaN",H.ZodBigInt="ZodBigInt",H.ZodBoolean="ZodBoolean",H.ZodDate="ZodDate",H.ZodSymbol="ZodSymbol",H.ZodUndefined="ZodUndefined",H.ZodNull="ZodNull",H.ZodAny="ZodAny",H.ZodUnknown="ZodUnknown",H.ZodNever="ZodNever",H.ZodVoid="ZodVoid",H.ZodArray="ZodArray",H.ZodObject="ZodObject",H.ZodUnion="ZodUnion",H.ZodDiscriminatedUnion="ZodDiscriminatedUnion",H.ZodIntersection="ZodIntersection",H.ZodTuple="ZodTuple",H.ZodRecord="ZodRecord",H.ZodMap="ZodMap",H.ZodSet="ZodSet",H.ZodFunction="ZodFunction",H.ZodLazy="ZodLazy",H.ZodLiteral="ZodLiteral",H.ZodEnum="ZodEnum",H.ZodEffects="ZodEffects",H.ZodNativeEnum="ZodNativeEnum",H.ZodOptional="ZodOptional",H.ZodNullable="ZodNullable",H.ZodDefault="ZodDefault",H.ZodCatch="ZodCatch",H.ZodPromise="ZodPromise",H.ZodBranded="ZodBranded",H.ZodPipeline="ZodPipeline",H.ZodReadonly="ZodReadonly"})(m0||(m0={}));uL=GO.create,Tq=Dn.create,Cx0=JzH.create,wx0=Bn.create,PQ=r4H.create,Zx0=nAH.create,qx0=MzH.create,Tx0=a4H.create,zx0=o4H.create,Nx0=rAH.create,Ox0=In.create,xx0=By.create,Sx0=GzH.create,FX=UO.create,R2=q5.create,y2=q5.strictCreate,tAH=t4H.create,jx0=f9$.create,Rx0=s4H.create,yx0=fy.create,KO=UzH.create,vx0=XzH.create,hx0=aAH.create,bx0=n4H.create,kx0=e4H.create,ux0=H5H.create,QO=fn.create,gx0=$5H.create,mx0=oAH.create,px0=FO.create,dx0=XO.create,cx0=yu.create,lx0=FO.createWithPreprocess,ix0=FzH.create,ox0={string:(H)=>GO.create({...H,coerce:!0}),number:(H)=>Dn.create({...H,coerce:!0}),boolean:(H)=>r4H.create({...H,coerce:!0}),bigint:(H)=>Bn.create({...H,coerce:!0}),date:(H)=>nAH.create({...H,coerce:!0})},tx0=Y0});var $9={};XA($9,{void:()=>Sx0,util:()=>N8,unknown:()=>Ox0,union:()=>tAH,undefined:()=>Tx0,tuple:()=>yx0,transformer:()=>px0,symbol:()=>qx0,string:()=>uL,strictObject:()=>y2,setErrorMap:()=>oO0,set:()=>hx0,record:()=>KO,quotelessJson:()=>rO0,promise:()=>mx0,preprocess:()=>lx0,pipeline:()=>ix0,ostring:()=>nx0,optional:()=>dx0,onumber:()=>rx0,oboolean:()=>ax0,objectUtil:()=>MDA,object:()=>R2,number:()=>Tq,nullable:()=>cx0,null:()=>zx0,never:()=>xx0,nativeEnum:()=>gx0,nan:()=>Cx0,map:()=>vx0,makeIssue:()=>EzH,literal:()=>ux0,lazy:()=>kx0,late:()=>_x0,isValid:()=>Ln,isDirty:()=>B9$,isAsync:()=>l4H,isAborted:()=>D9$,intersection:()=>Rx0,instanceof:()=>Yx0,getParsedType:()=>Dy,getErrorMap:()=>c4H,function:()=>bx0,enum:()=>QO,effect:()=>px0,discriminatedUnion:()=>jx0,defaultErrorMap:()=>ju,datetimeRegex:()=>_aL,date:()=>Zx0,custom:()=>CaL,coerce:()=>ox0,boolean:()=>PQ,bigint:()=>wx0,array:()=>FX,any:()=>Nx0,addIssueToContext:()=>pI,ZodVoid:()=>GzH,ZodUnknown:()=>In,ZodUnion:()=>t4H,ZodUndefined:()=>a4H,ZodType:()=>H8,ZodTuple:()=>fy,ZodTransformer:()=>FO,ZodSymbol:()=>MzH,ZodString:()=>GO,ZodSet:()=>aAH,ZodSchema:()=>H8,ZodRecord:()=>UzH,ZodReadonly:()=>I5H,ZodPromise:()=>oAH,ZodPipeline:()=>FzH,ZodParsedType:()=>qI,ZodOptional:()=>XO,ZodObject:()=>q5,ZodNumber:()=>Dn,ZodNullable:()=>yu,ZodNull:()=>o4H,ZodNever:()=>By,ZodNativeEnum:()=>$5H,ZodNaN:()=>JzH,ZodMap:()=>XzH,ZodLiteral:()=>H5H,ZodLazy:()=>e4H,ZodIssueCode:()=>rL,ZodIntersection:()=>s4H,ZodFunction:()=>n4H,ZodFirstPartyTypeKind:()=>m0,ZodError:()=>a_,ZodEnum:()=>fn,ZodEffects:()=>FO,ZodDiscriminatedUnion:()=>f9$,ZodDefault:()=>A5H,ZodDate:()=>nAH,ZodCatch:()=>L5H,ZodBranded:()=>E9$,ZodBoolean:()=>r4H,ZodBigInt:()=>Bn,ZodArray:()=>UO,ZodAny:()=>rAH,Schema:()=>H8,ParseStatus:()=>rW,OK:()=>m6,NEVER:()=>tx0,INVALID:()=>Y0,EMPTY_PATH:()=>tO0,DIRTY:()=>iAH,BRAND:()=>Px0});var FDA=K(()=>{I9$();UDA();FaL();fzH();waL();L9$()});var KzH=K(()=>{FDA();FDA()});var QDA,KDA,sx0,qaL,TaL,zaL,NaL,ex0,OaL;var xaL=K(()=>{KzH();QDA=$9.string().refine((H)=>{if(H.includes("://")||H.includes("/")||H.includes(":"))return!1;if(H==="localhost")return!0;if(H.startsWith("*.")){let $=H.slice(2);if(!$.includes(".")||$.startsWith(".")||$.endsWith("."))return!1;let A=$.split(".");return A.length>=2&&A.every((L)=>L.length>0)}if(H.includes("*"))return!1;return H.includes(".")&&!H.startsWith(".")&&!H.endsWith(".")},{message:'Invalid domain pattern. Must be a valid domain (e.g., "example.com") or wildcard (e.g., "*.example.com"). Overly broad patterns like "*.com" or "*" are not allowed for security reasons.'}),KDA=$9.string().min(1,"Path cannot be empty"),sx0=$9.object({socketPath:$9.string().min(1).describe("Unix socket path to the MITM proxy"),domains:$9.array(QDA).min(1).describe('Domains to route through the MITM proxy (e.g., ["api.example.com", "*.internal.org"])')}),qaL=$9.object({allowedDomains:$9.array(QDA).describe('List of allowed domains (e.g., ["github.com", "*.npmjs.org"])'),deniedDomains:$9.array(QDA).describe("List of denied domains"),allowUnixSockets:$9.array($9.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:$9.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:$9.boolean().optional().describe("Whether to allow binding to local ports (default: false)"),httpProxyPort:$9.number().int().min(1).max(65535).optional().describe("Port of an external HTTP proxy to use instead of starting a local one. When provided, the library will skip starting its own HTTP proxy and use this port. The external proxy must handle domain filtering."),socksProxyPort:$9.number().int().min(1).max(65535).optional().describe("Port of an external SOCKS proxy to use instead of starting a local one. When provided, the library will skip starting its own SOCKS proxy and use this port. The external proxy must handle domain filtering."),mitmProxy:sx0.optional().describe("Optional MITM proxy configuration. Routes matching domains through an upstream proxy via Unix socket while SRT still handles allow/deny filtering.")}),TaL=$9.object({denyRead:$9.array(KDA).describe("Paths denied for reading"),allowWrite:$9.array(KDA).describe("Paths allowed for writing"),denyWrite:$9.array(KDA).describe("Paths denied for writing (takes precedence over allowWrite)"),allowGitConfig:$9.boolean().optional().describe("Allow writes to .git/config files (default: false). Enables git remote URL updates while keeping .git/hooks protected.")}),zaL=$9.record($9.string(),$9.array($9.string())).describe('Map of command patterns to filesystem paths to ignore violations for. Use "*" to match all commands'),NaL=$9.object({command:$9.string().describe('The ripgrep command to execute (e.g., "rg", "claude")'),args:$9.array($9.string()).optional().describe('Additional arguments to pass before ripgrep args (e.g., ["--ripgrep"])')}),ex0=$9.object({bpfPath:$9.string().optional().describe("Path to the unix-block.bpf filter file"),applyPath:$9.string().optional().describe("Path to the apply-seccomp binary")}),OaL=$9.object({network:qaL.describe("Network restrictions configuration"),filesystem:TaL.describe("Filesystem restrictions configuration"),ignoreViolations:zaL.optional().describe("Optional configuration for ignoring specific violations"),enableWeakerNestedSandbox:$9.boolean().optional().describe("Enable weaker nested sandbox mode (for Docker environments)"),ripgrep:NaL.optional().describe('Custom ripgrep configuration (default: { command: "rg" })'),mandatoryDenySearchDepth:$9.number().int().min(1).max(10).optional().describe("Maximum directory depth to search for dangerous files on Linux (default: 3). Higher values provide more protection but slower performance."),allowPty:$9.boolean().optional().describe("Allow pseudo-terminal (pty) operations (macOS only)"),seccomp:ex0.optional().describe("Custom seccomp binary paths (Linux only).")})});var SaL=K(()=>{XaL();DDA();xaL();p4H();n0$()});function jaL(H,$,A){return` `;var TB="Edit",M9$="/.claude/**",G9$="~/.claude/**",QzH="File has been unexpectedly modified. Read it again before attempting to write it.";function VDA(H){let $=H.trim();if(!$)return null;if($.endsWith("-")){let D=parseInt($.slice(0,-1),10);if(isNaN(D)||D<1)return null;return{firstPage:D,lastPage:1/0}}let A=$.indexOf("-");if(A===-1){let D=parseInt($,10);if(isNaN(D)||D<1)return null;return{firstPage:D,lastPage:D}}let L=parseInt($.slice(0,A),10),I=parseInt($.slice(A+1),10);if(isNaN(L)||isNaN(I)||L<1||I<1||I{oM();HS0=new Set(["pdf"])});var $B="Read",VzH=2000,$S0=2000,RaL="Read a file from the local filesystem.",yaL;var tG=K(()=>{U9$();yaL=`Reads a file from the local filesystem. You can access any file directly by using this tool. - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.`});function D5H(H){let $=H.match(/^([^(]+)\(([^)]+)\)$/);if(!$)return{toolName:H};let A=$[1],L=$[2];if(!A||!L)return{toolName:H};return{toolName:A,ruleContent:L}}function AS0(H){return H.match(/^(.+):\*$/)?.[1]??null}function PDA(H,$){if(H.startsWith("//"))return H.slice(1);if(H.startsWith("/")&&!H.startsWith("//")){let A=D4H($);return B5H.resolve(A,H.slice(1))}return H}function PzH(){return ZI("policySettings")?.sandbox?.network?.allowManagedDomainsOnly===!0}function _DA(H){let $=H.permissions||{},A=[],L=[];if(PzH()){let J=ZI("policySettings");for(let F of J?.sandbox?.network?.allowedDomains||[])A.push(F);for(let F of J?.permissions?.allow||[]){let Q=D5H(F);if(Q.toolName===w4&&Q.ruleContent?.startsWith("domain:"))A.push(Q.ruleContent.substring(7))}}else{for(let J of H.sandbox?.network?.allowedDomains||[])A.push(J);for(let J of $.allow||[]){let F=D5H(J);if(F.toolName===w4&&F.ruleContent?.startsWith("domain:"))A.push(F.ruleContent.substring(7))}}for(let J of $.deny||[]){let F=D5H(J);if(F.toolName===w4&&F.ruleContent?.startsWith("domain:"))L.push(F.ruleContent.substring(7))}let I=[".",_zH()],D=[],B=[],f=j_.map((J)=>aM(J)).filter((J)=>J!==void 0);D.push(...f);let E=HR(),M=zL();if(E!==M)D.push(B5H.resolve(E,".claude","settings.json")),D.push(B5H.resolve(E,".claude","settings.local.json"));let G=B5H.join(E,".git");try{if(X9$.statSync(G).isFile()){let Q=X9$.readFileSync(G,{encoding:"utf8"}).match(/^gitdir:\s*(.+)$/m);if(Q?.[1]){let W=Q[1].trim(),P=W.indexOf(".git");if(P>0){let C=W.substring(0,P-1);if(C!==E)I.push(C)}}}}catch{}let U=new Set([...H.permissions?.additionalDirectories||[],...CN()]);I.push(...U);for(let J of j_){let F=ZI(J);if(!F?.permissions)continue;for(let Q of F.permissions.allow||[]){let W=D5H(Q);if(W.toolName===TB&&W.ruleContent)I.push(PDA(W.ruleContent,J))}for(let Q of F.permissions.deny||[]){let W=D5H(Q);if(W.toolName===TB&&W.ruleContent)D.push(PDA(W.ruleContent,J));if(W.toolName===$B&&W.ruleContent)B.push(PDA(W.ruleContent,J))}}let X=H.sandbox?.ripgrep?H.sandbox.ripgrep:(()=>{let{rgPath:J,rgArgs:F}=eMH();return{command:J,args:F}})();return{network:{allowedDomains:A,deniedDomains:L,allowUnixSockets:H.sandbox?.network?.allowUnixSockets,allowAllUnixSockets:H.sandbox?.network?.allowAllUnixSockets,allowLocalBinding:H.sandbox?.network?.allowLocalBinding,httpProxyPort:H.sandbox?.network?.httpProxyPort,socksProxyPort:H.sandbox?.network?.socksProxyPort},filesystem:{denyRead:B,allowWrite:I,denyWrite:D},ignoreViolations:H.sandbox?.ignoreViolations,enableWeakerNestedSandbox:H.sandbox?.enableWeakerNestedSandbox,ripgrep:X}}function haL(){try{let H=VL();return vaL(H)}catch(H){return N(`Failed to get settings for sandbox check: ${H}`),!1}}function LS0(){let H=VL();return baL(H)}function IS0(){let H=VL();return kaL(H)}function gaL(){try{let H=GB();return uaL(H)}catch(H){return N(`Failed to check enabledPlatforms: ${H}`),!0}}function J9$(){if(!wDA())return!1;if(CDA().errors.length>0)return!1;if(!gaL())return!1;return haL()}function DS0(){let H=oA();if(H!=="linux"&&H!=="wsl")return[];try{let $=VL();if(!$?.sandbox?.enabled)return[];let A=$?.permissions||{},L=[],I=(D)=>{let B=D.replace(/\/\*\*$/,"");return/[*?[\]]/.test(B)};for(let D of[...A.allow||[],...A.deny||[]]){let B=D5H(D);if((B.toolName===TB||B.toolName===$B)&&B.ruleContent&&I(B.ruleContent))L.push(D)}return L}catch($){return N(`Failed to get Linux glob pattern warnings: ${$}`),[]}}function BS0(){let H=["flagSettings","policySettings"];for(let $ of H){let A=ZI($);if(A?.sandbox?.enabled!==void 0||A?.sandbox?.autoAllowBashIfSandboxed!==void 0||A?.sandbox?.allowUnsandboxedCommands!==void 0)return!0}return!1}async function fS0(H){let $=ZI("localSettings");II("localSettings",{sandbox:{...$?.sandbox,...H.enabled!==void 0&&{enabled:H.enabled},...H.autoAllowBashIfSandboxed!==void 0&&{autoAllowBashIfSandboxed:H.autoAllowBashIfSandboxed},...H.allowUnsandboxedCommands!==void 0&&{allowUnsandboxedCommands:H.allowUnsandboxedCommands}}})}function ES0(){return VL()?.sandbox?.excludedCommands??[]}async function MS0(H,$,A,L){if(J9$())if(En)await En;else throw Error("Sandbox failed to initialize. ");return Z5.wrapWithSandbox(H,$,A,L)}async function GS0(H){if(En)return En;if(!J9$())return;let $=VL(),A=_DA($);return En=(async()=>{try{await Z5.initialize(A,H),YDA=AF.subscribe(()=>{let L=VL(),I=_DA(L);Z5.updateConfig(I),N("Sandbox configuration updated from settings change")})}catch(L){En=void 0,N(`Failed to initialize sandbox: ${L instanceof Error?L.message:String(L)}`)}})(),En}function US0(){if(!J9$())return;let H=VL(),$=_DA(H);Z5.updateConfig($)}async function XS0(){return YDA?.(),YDA=void 0,vaL.cache.clear?.(),baL.cache.clear?.(),kaL.cache.clear?.(),uaL.cache.clear?.(),CDA.cache.clear?.(),wDA.cache.clear?.(),En=void 0,Z5.reset()}function maL(H,$){let A=ZI("localSettings"),L=A?.sandbox?.excludedCommands||[],I=H;if($){let D=$.filter((B)=>B.type==="addRules"&&B.rules.some((f)=>f.toolName===WD));if(D.length>0&&D[0].type==="addRules"){let B=D[0].rules.find((f)=>f.toolName===WD);if(B?.ruleContent)I=AS0(B.ruleContent)||B.ruleContent}}if(!L.includes(I))II("localSettings",{sandbox:{...A?.sandbox,excludedCommands:[...L,I]}});return I}var B5H,X9$,En,YDA,CDA,vaL,baL,kaL,wDA,uaL,vL;var EM=K(()=>{SaL();Z9();mL();W4();g$();E$();gk();wiH();tG();CR();BM();B5H=require("path"),X9$=require("fs");CDA=o$(()=>{let{rgPath:H,rgArgs:$}=eMH();return Z5.checkDependencies({command:H,args:$})}),vaL=o$((H)=>{return H?.sandbox?.enabled??!1});baL=o$((H)=>{return H?.sandbox?.autoAllowBashIfSandboxed??!0});kaL=o$((H)=>{return H?.sandbox?.allowUnsandboxedCommands??!0});wDA=o$(()=>{return Z5.isSupportedPlatform()}),uaL=o$((H)=>{let $=H?.sandbox?.enabledPlatforms;if($===void 0)return!0;if($.length===0)return!1;let A=oA();return $.includes(A)});vL={initialize:GS0,isSandboxingEnabled:J9$,isSandboxEnabledInSettings:haL,isPlatformInEnabledList:gaL,isAutoAllowBashIfSandboxedEnabled:LS0,areUnsandboxedCommandsAllowed:IS0,areSandboxSettingsLockedByPolicy:BS0,setSandboxSettings:fS0,getExcludedCommands:ES0,wrapWithSandbox:MS0,refreshConfig:US0,reset:XS0,checkDependencies:CDA,getFsReadConfig:Z5.getFsReadConfig,getFsWriteConfig:Z5.getFsWriteConfig,getNetworkRestrictionConfig:Z5.getNetworkRestrictionConfig,getIgnoreViolations:Z5.getIgnoreViolations,getLinuxGlobPatternWarnings:DS0,isSupportedPlatform:wDA,getAllowUnixSockets:Z5.getAllowUnixSockets,getAllowLocalBinding:Z5.getAllowLocalBinding,getEnableWeakerNestedSandbox:Z5.getEnableWeakerNestedSandbox,getProxyPort:Z5.getProxyPort,getSocksProxyPort:Z5.getSocksProxyPort,getLinuxHttpSocketPath:Z5.getLinuxHttpSocketPath,getLinuxSocksSocketPath:Z5.getLinuxSocksSocketPath,waitForNetworkInitialization:Z5.waitForNetworkInitialization,getSandboxViolationStore:Z5.getSandboxViolationStore,annotateStderrWithSandboxFailures:Z5.annotateStderrWithSandboxFailures}});var saL=z((n9)=>{var TDA=Symbol.for("react.transitional.element"),JS0=Symbol.for("react.portal"),FS0=Symbol.for("react.fragment"),KS0=Symbol.for("react.strict_mode"),QS0=Symbol.for("react.profiler"),WS0=Symbol.for("react.consumer"),VS0=Symbol.for("react.context"),PS0=Symbol.for("react.forward_ref"),_S0=Symbol.for("react.suspense"),YS0=Symbol.for("react.memo"),iaL=Symbol.for("react.lazy"),CS0=Symbol.for("react.activity"),paL=Symbol.iterator;function wS0(H){if(H===null||typeof H!=="object")return null;return H=paL&&H[paL]||H["@@iterator"],typeof H==="function"?H:null}var naL={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},raL=Object.assign,aaL={};function E5H(H,$,A){this.props=H,this.context=$,this.refs=aaL,this.updater=A||naL}E5H.prototype.isReactComponent={};E5H.prototype.setState=function(H,$){if(typeof H!=="object"&&typeof H!=="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,$,"setState")};E5H.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function oaL(){}oaL.prototype=E5H.prototype;function zDA(H,$,A){this.props=H,this.context=$,this.refs=aaL,this.updater=A||naL}var NDA=zDA.prototype=new oaL;NDA.constructor=zDA;raL(NDA,E5H.prototype);NDA.isPureReactComponent=!0;var daL=Array.isArray;function qDA(){}var bU={H:null,A:null,T:null,S:null},taL=Object.prototype.hasOwnProperty;function ODA(H,$,A){var L=A.ref;return{$$typeof:TDA,type:H,key:$,ref:L!==void 0?L:null,props:A}}function ZS0(H,$){return ODA(H.type,$,H.props)}function xDA(H){return typeof H==="object"&&H!==null&&H.$$typeof===TDA}function qS0(H){var $={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(A){return $[A]})}var caL=/\/+/g;function ZDA(H,$){return typeof H==="object"&&H!==null&&H.key!=null?qS0(""+H.key):$.toString(36)}function TS0(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status==="string"?H.then(qDA,qDA):(H.status="pending",H.then(function($){H.status==="pending"&&(H.status="fulfilled",H.value=$)},function($){H.status==="pending"&&(H.status="rejected",H.reason=$)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function f5H(H,$,A,L,I){var D=typeof H;if(D==="undefined"||D==="boolean")H=null;var B=!1;if(H===null)B=!0;else switch(D){case"bigint":case"string":case"number":B=!0;break;case"object":switch(H.$$typeof){case TDA:case JS0:B=!0;break;case iaL:return B=H._init,f5H(B(H._payload),$,A,L,I)}}if(B)return I=I(H),B=L===""?"."+ZDA(H,0):L,daL(I)?(A="",B!=null&&(A=B.replace(caL,"$&/")+"/"),f5H(I,$,A,"",function(M){return M})):I!=null&&(xDA(I)&&(I=ZS0(I,A+(I.key==null||H&&H.key===I.key?"":(""+I.key).replace(caL,"$&/")+"/")+B)),$.push(I)),1;B=0;var f=L===""?".":L+":";if(daL(H))for(var E=0;E{eaL.exports=saL()});var af="Glob",SDA=`- Fast file pattern matching tool that works with any codebase size `}var v2="WebSearch";var Mn=()=>{};function IoL(H){let{hasThinking:$=!1}=H??{},A=[];if($&&NL("tengu_marble_anvil",!1))A.push({type:"clear_thinking_20251015",keep:"all"});return A.length>0?{edits:A}:void 0}var AoL=180000,LoL=40000,xS0,SS0;var DoL=K(()=>{NA();SD();vV();tG();GK();Mn();xS0=[WD,af,s8,$B,w4,v2],SS0=[TB,U1,aW]});function cD(){return NL("tengu_penguins_enabled",!0)}function WO(){let H=NL("tengu_penguin_mode_promo",{discountPercent:50,endDate:"Feb 16"});if(!H||H.discountPercent===0)return null;return H}function Z4(){if(!cD())return!1;return W9$()===null}function jS0(H,$){switch(H){case"free":return $==="oauth"?"Fast mode requires a paid subscription":"Fast mode unavailable during evaluation. Please purchase credits.";case"preference":return"Fast mode has been disabled by your organization";case"extra_usage_disabled":return"Fast mode requires extra usage billing \xB7 /extra-usage to enable"}}function W9$(){if(!cD())return"Fast mode is not available";if(!U8())return"Fast mode requires the native binary \xB7 Install from: https://claude.com/product/claude-code";let H=NL("tengu_penguins_off",null);if(H!==null)return N(`Fast mode unavailable: ${H}`),H;if(tI()&&uYH())return N("Fast mode unavailable: Fast mode is not available in the Agent SDK"),"Fast mode is not available in the Agent SDK";if(sI()!=="firstParty")return N("Fast mode unavailable: Fast mode is not available on Bedrock, Vertex, or Foundry"),"Fast mode is not available on Bedrock, Vertex, or Foundry";if(X5H){let $=dD()!==null?"oauth":"api-key",A=jS0(X5H,$);return N(`Fast mode unavailable: ${A}`),A}return null}function foL(H){if(!cD())return!1;if(!Z4())return!1;if(!UK(H))return!1;return GB().fastMode===!0}function UK(H){if(!cD())return!1;let $=H??J5H();return m8($).toLowerCase().includes("opus-4-6")}function EoL(H){return K9$.add(H),()=>{K9$.delete(H)}}function hDA(){if(G5H.status==="cooldown"&&Date.now()>=G5H.resetAt){if(cD()&&!RDA){N("Fast mode cooldown expired, re-enabling fast mode"),RDA=!0;for(let H of K9$)H.onCooldownExpired()}G5H={status:"active"}}return G5H}function MoL(H){if(!cD())return;G5H={status:"cooldown",resetAt:H},RDA=!1;let $=H-Date.now();N(`Fast mode cooldown triggered, duration ${Math.round($/1000)}s`),c("tengu_fast_mode_fallback_triggered",{cooldown_duration_ms:$});for(let A of K9$)A.onCooldownTriggered(H)}function eAH(){G5H={status:"active"}}function GoL(){if(U5H===!1)return;U5H=!1,X5H="preference",II("userSettings",{fastMode:void 0}),AA((H)=>({...H,penguinModeOrgEnabled:!1}));for(let H of Q9$)H(!1)}function UoL(H){return yDA.add(H),()=>{yDA.delete(H)}}function RS0(H){switch(H){case"out_of_credits":return"Fast mode disabled \xB7 extra usage credits exhausted";case"org_level_disabled":case"org_service_level_disabled":return"Fast mode disabled \xB7 extra usage disabled by your organization";case"org_level_disabled_until":return"Fast mode disabled \xB7 extra usage temporarily unavailable";case"member_level_disabled":return"Fast mode disabled \xB7 extra usage disabled for your account";case"seat_tier_level_disabled":case"seat_tier_zero_credit_limit":case"member_zero_credit_limit":return"Fast mode disabled \xB7 extra usage not available for your plan";case"overage_not_provisioned":case"no_limits_configured":return"Fast mode requires extra usage billing \xB7 /extra-usage to enable";default:return"Fast mode disabled \xB7 extra usage not available"}}function XoL(H){let $=RS0(H);N(`Fast mode overage rejection: ${H??"unknown"} \u2014 ${$}`),c("tengu_fast_mode_overage_rejected",{overage_disabled_reason:H??"unknown"}),II("userSettings",{fastMode:void 0}),AA((A)=>({...A,penguinModeOrgEnabled:!1}));for(let A of yDA)A($)}function zq(){return hDA().status==="cooldown"}function JoL(H){return Q9$.add(H),()=>{Q9$.delete(H)}}async function yS0(H){let $=`${XD().BASE_API_URL}/api/claude_code_penguin_mode`,A="accessToken"in H?{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}:{"x-api-key":H.apiKey};return(await nA.get($,{headers:A})).data}async function V9$(){if(!cD())return;let H=Date.now();if(H-BoL({...B,penguinModeOrgEnabled:I.enabled}));for(let B of Q9$)B(I.enabled)}N(`Org penguin mode: ${I.enabled?"enabled":`disabled (${X5H??"unknown"})`}`)}catch{U5H=!1,X5H=null,N(`Failed to fetch org penguin mode status, defaulting to ${U5H?"enabled":"disabled"}`),c("tengu_org_penguin_mode_fetch_failed",{})}}var YzH="opus",VO="Opus 4.6",vDA="Billed at a premium rate",G5H,RDA=!1,K9$,yDA,U5H,X5H=null,Q9$,vS0=30000,BoL=0;var AJ=K(()=>{w1();mL();z$();E$();g$();EI();oM();aI();SD();qE();vA();G5H={status:"active"},K9$=new Set;yDA=new Set;Q9$=new Set});function PO(){if(!bDA)bDA=new Intl.Segmenter(void 0,{granularity:"grapheme"});return bDA}function KoL(){if(!kDA)kDA=new Intl.Segmenter(void 0,{granularity:"word"});return kDA}function gDA(H,$){let A=`${H}:${$}`,L=FoL.get(A);if(!L)L=new Intl.RelativeTimeFormat("en",{style:H,numeric:$}),FoL.set(A,L);return L}function mDA(){if(!uDA)uDA=Intl.DateTimeFormat().resolvedOptions().timeZone;return uDA}var bDA=null,kDA=null,FoL,uDA=null;var F5H=K(()=>{FoL=new Map});function QoL(H,$){if(H.length<=$)return H;if($<=0)return"\u2026";if($<5)return H.slice(0,$-1)+"\u2026";let A=H.lastIndexOf("/"),L=A>=0?H.slice(A):H,I=A>=0?H.slice(0,A):"";if(L.length>=$-1)return"\u2026"+H.slice(-($-1));let D=$-1-L.length;if(D<=0)return"\u2026"+L.slice(-($-1));return I.slice(0,D)+"\u2026"+L}function e8(H,$,A=!1){let L=H;if(A){let I=H.indexOf(` `);lDA(H?.())};return process.on("exit",$),()=>{process.off("exit",$)}},[])}function uS0(H,$){return Math.round(H*$)/$}function _9$(H,$,A){uS$(H,$,A);let L=cD()&&$.speed?{model:A,speed:$.speed}:{model:A};tS$()?.add(H,L),UEH()?.add($.input_tokens,{...L,type:"input"}),UEH()?.add($.output_tokens,{...L,type:"output"}),UEH()?.add($.cache_read_input_tokens??0,{...L,type:"cacheRead"}),UEH()?.add($.cache_creation_input_tokens??0,{...L,type:"cacheCreation"})}var VoL;var Nq=K(()=>{r0();AJ();Q9();aI();vA();g$();g$();g$();nC();g$();VoL=b(s(),1)});function ALH(H,$){if(cD()&&$){let A=H?rDA:nDA,L=WO();if(L)return cS0(A,L.discountPercent);return A}return H?gS0:Q5H}function mS0(H,$){return $.input_tokens/1e6*H.inputTokens+$.output_tokens/1e6*H.outputTokens+($.cache_read_input_tokens??0)/1e6*H.promptCacheReadTokens+($.cache_creation_input_tokens??0)/1e6*H.promptCacheWriteTokens+($.server_tool_use?.web_search_requests??0)*H.webSearchRequests}function pS0(H){return H.input_tokens+(H.cache_read_input_tokens??0)+(H.cache_creation_input_tokens??0)}function dS0(H,$){let A=JK(H),L=w9$[A];if(L===$LH&&pS0($)>200000)return aDA;if(!L)return c("tengu_unknown_model_cost",{model:H,shortName:A}),ulH(),w9$[JK(YoL)];return L}function Z9$(H,$){let A=dS0(H,$);return mS0(A,$)}function _oL(H){if(Number.isInteger(H))return`$${H}`;return`$${H.toFixed(2)}`}function o_(H){return`${_oL(H.inputTokens)}/${_oL(H.outputTokens)} per Mtok`}function cS0(H,$){let A=(100-$)/100;return{inputTokens:H.inputTokens*A,outputTokens:H.outputTokens*A,promptCacheWriteTokens:H.promptCacheWriteTokens*A,promptCacheReadTokens:H.promptCacheReadTokens*A,webSearchRequests:H.webSearchRequests}}var $LH,C9$,Q5H,gS0,nDA,rDA,aDA,oDA,tDA,w9$;var W5H=K(()=>{Nq();z$();AJ();$4H();aI();$LH={inputTokens:3,outputTokens:15,promptCacheWriteTokens:3.75,promptCacheReadTokens:0.3,webSearchRequests:0.01},C9$={inputTokens:15,outputTokens:75,promptCacheWriteTokens:18.75,promptCacheReadTokens:1.5,webSearchRequests:0.01},Q5H={inputTokens:5,outputTokens:25,promptCacheWriteTokens:6.25,promptCacheReadTokens:0.5,webSearchRequests:0.01},gS0={inputTokens:10,outputTokens:37.5,promptCacheWriteTokens:12.5,promptCacheReadTokens:1,webSearchRequests:0.01},nDA={inputTokens:30,outputTokens:150,promptCacheWriteTokens:37.5,promptCacheReadTokens:3,webSearchRequests:0.01},rDA={inputTokens:60,outputTokens:225,promptCacheWriteTokens:75,promptCacheReadTokens:6,webSearchRequests:0.01},aDA={inputTokens:6,outputTokens:22.5,promptCacheWriteTokens:7.5,promptCacheReadTokens:0.6,webSearchRequests:0.01},oDA={inputTokens:0.8,outputTokens:4,promptCacheWriteTokens:1,promptCacheReadTokens:0.08,webSearchRequests:0.01},tDA={inputTokens:1,outputTokens:5,promptCacheWriteTokens:1.25,promptCacheReadTokens:0.1,webSearchRequests:0.01};w9$={[JK(WqH.firstParty)]:oDA,[JK(VqH.firstParty)]:tDA,[JK(QqH.firstParty)]:$LH,[JK(KqH.firstParty)]:$LH,[JK(CAH.firstParty)]:$LH,[JK(PqH.firstParty)]:Q5H,[JK(_qH.firstParty)]:C9$,[JK(YqH.firstParty)]:C9$,[JK(CqH.firstParty)]:Q5H,[JK(wAH.firstParty)]:Q5H}});function Gn(){let H=process.env.CLAUDE_AGENT_SDK_VERSION?`, agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`:"";return`claude-cli/${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} (external, ${process.env.CLAUDE_CODE_ENTRYPOINT}${H})`}function Un(){return`claude-code/${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}`}function sG(){return`claude-code/${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}`}function eG(){if(nL()){let $=dD();if(!$?.accessToken)return{headers:{},error:"No OAuth token available"};return{headers:{Authorization:`Bearer ${$.accessToken}`,"anthropic-beta":N_}}}let H=eZ();if(!H)return{headers:{},error:"No API key available"};return{headers:{"x-api-key":H}}}var _Q=K(()=>{EI();qE()});async function iS0(){let H=T9()?.organizationUuid;if(!H)throw Error("No organization ID available");let $=eG();if($.error)throw Error(`Auth error: ${$.error}`);let A={"Content-Type":"application/json","User-Agent":sG(),...$.headers};try{let L=`https://api.anthropic.com/api/organization/${H}/claude_code_sonnet_1m_access`,I=await nA.get(L,{headers:A,timeout:5000});return{hasAccess:I.data.has_access,hasAccessNotAsDefault:I.data.has_access_not_as_default,hasError:!1}}catch(L){return r(L),{hasAccess:!1,hasError:!0}}}async function rS0(){try{return await nS0()}catch(H){return N("Sonnet-1M access check failed, defaulting to no access"),{hasAccess:!1,hasError:!0}}}function LLH(){let H=T9()?.organizationUuid;if(!H)return{hasAccess:!1,wasPartOfDefaultRollout:!1,needsRefresh:!1};let $=M$(),A=(nL()?$.s1mAccessCache:$.s1mNonSubscriberAccessCache)?.[H],L=Date.now();if(!A)return{hasAccess:!1,wasPartOfDefaultRollout:!1,needsRefresh:!0};let{hasAccess:I,hasAccessNotAsDefault:D,timestamp:B}=A,f=L-B>aS0;return{hasAccess:I||(D??!1),wasPartOfDefaultRollout:I,needsRefresh:f}}async function CoL(){let{needsRefresh:H}=LLH();if(H)oS0()}async function oS0(){let H=T9()?.organizationUuid;if(!H)return;if(!nL()){let $=await WeH();if(!$)return;let{uuid:A,rate_limit_tier:L}=$.organization,I={hasAccess:L==="auto_prepaid_tier_3"||L==="manual_tier_3",timestamp:Date.now()};AA((D)=>({...D,s1mNonSubscriberAccessCache:{...D.s1mNonSubscriberAccessCache,[A]:I}}));return}try{let{hasAccess:$,hasAccessNotAsDefault:A}=await rS0(),L={hasAccess:$,hasAccessNotAsDefault:A,timestamp:Date.now()};AA((I)=>({...I,s1mAccessCache:{...I.s1mAccessCache,[H]:L}}))}catch($){N("Failed to fetch and cache Sonnet-1M access"),r($)}}var lS0=3600000,nS0,aS0=3600000;var q9$=K(()=>{w1();wwH();_Q();E$();_$();vA();EI();zwH();nS0=zGH(iS0,lS0)});function T9$(){if(NL("tengu_marble_lantern_disabled",!1))return{hasAccess:!1};return{hasAccess:!nL()}}var woL=K(()=>{SD();EI()});var Zf,qzH="\u273B",Ey="\u21AF";var p6=K(()=>{Z1();Zf=OA.platform==="darwin"?"\u23FA":"\u25CF"});function z9$(){return"inherit"}function LJ(){return process.env.ANTHROPIC_SMALL_FAST_MODEL||eDA()}function _5H(H){return H===aG().opus40||H===aG().opus41||H===aG().opus45||H===aG().opus46}function N9$(H){return H.includes("opus")}function O9$(){let H,$=C_();if($!==void 0)H=$;else{let A=VL()||{};H=process.env.ANTHROPIC_MODEL||A.model||void 0}if(nL()&&!Wq()&&H&&N9$(H))return;return H}function DLH(H={}){let $=O9$();if($!==null&&$!==void 0)return $;let{forDisplay:A=!1}=H;return NoL(A)}function X1(){let H=DLH();if(H!==void 0&&H!==null)return m8(H);return xq()}function Oq(){if(process.env.ANTHROPIC_DEFAULT_SONNET_MODEL)return process.env.ANTHROPIC_DEFAULT_SONNET_MODEL;return aG().sonnet45}function TzH(){return f0()==="max"}function zzH(){return f0()==="team"}function NzH(){return f0()==="pro"}function My(){if(process.env.ANTHROPIC_DEFAULT_OPUS_MODEL)return process.env.ANTHROPIC_DEFAULT_OPUS_MODEL;if(sI()==="firstParty")return aG().opus46;return aG().opus41}function sS0(){return My()}function eDA(){if(process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL)return process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL;return aG().haiku45}function BLH(H){let{permissionMode:$,mainLoopModel:A,exceeds200kTokens:L=!1}=H;if(DLH()==="opusplan"&&$==="plan"&&!L)return My();if(DLH()==="haiku"&&$==="plan")return Oq();return A}function ToL(){return null}function zoL(H){return}function NoL(H){let $=eS0();if($!==null&&$.name)return H?$.displayName??$.name:$.name;return}function J5H(H={}){let{forDisplay:$=!1}=H,A=NoL($);if(A!==void 0)return A;if(TzH()||zzH()||NzH())return My();return Oq()}function xq(H={}){return m8(J5H(H))}function JK(H){if(H.includes("claude-opus-4-6"))return"claude-opus-4-6";if(H.includes("claude-opus-4-5"))return"claude-opus-4-5";if(H.includes("claude-opus-4-1"))return"claude-opus-4-1";if(H.includes("claude-opus-4"))return"claude-opus-4";if(H.includes("claude-sonnet-4-5"))return"claude-sonnet-4-5";if(H.includes("claude-sonnet-4"))return"claude-sonnet-4";if(H.includes("claude-haiku-4-5"))return"claude-haiku-4-5";let $=H.match(/(claude-(\d+-\d+-)?\w+)/);if($&&$[1])return $[1];return H}async function OoL(){try{if(M$().claudeCodeFirstTokenDate!==void 0)return;let $=eG();if($.error){r(Error(`Failed to get auth headers: ${$.error}`));return}let L=`${XD().BASE_API_URL}/api/organization/claude_code_first_token_date`,D=(await nA.get(L,{headers:{...$.headers,"User-Agent":sG()}})).data?.first_token_date??null;if(D!==null){let B=new Date(D).getTime();if(isNaN(B)){r(Error(`Received invalid first_token_date from API: ${D}`));return}}AA((B)=>({...B,claudeCodeFirstTokenDate:D}))}catch(H){r(H instanceof Error?H:Error(String(H)))}}function x9$(H=!1){if(TzH()||zzH()||NzH())return`Opus 4.6 \xB7 Most capable for complex work${$BA(!1,H)}`;return"Sonnet 4.5 \xB7 Best for everyday tasks"}function Hj0(H){if(H==="opusplan")return"Opus 4.6 in plan mode, else Sonnet 4.5";return hV(m8(H))}function xoL(H){if(H==="opusplan")return"Opus Plan";if(ABA(H))return H.charAt(0).toUpperCase()+H.slice(1);return hV(H)}function S9$(H){switch(H){case aG().opus46:return"Opus 4.6";case aG().opus46+"[1m]":return"Opus 4.6 (1M context)";case aG().opus45:return"Opus 4.5";case aG().opus41:return"Opus 4.1";case aG().opus40:return"Opus 4";case aG().sonnet45+"[1m]":return"Sonnet 4.5 (1M context)";case aG().sonnet45:return"Sonnet 4.5";case aG().sonnet40:return"Sonnet 4";case aG().sonnet40+"[1m]":return"Sonnet 4 (1M context)";case aG().sonnet37:return"Sonnet 3.7";case aG().sonnet35:return"Sonnet 3.5";case aG().haiku45:return"Haiku 4.5";case aG().haiku35:return"Haiku 3.5";default:return null}}function hV(H){let $=S9$(H);if($)return $;return H}function SoL(H){let $=S9$(H);if($)return`Claude ${$}`;return`Claude (${H})`}function ILH(H=!1){if(nL()){if(!Wq())return{value:null,label:"Sonnet",description:HBA().description};return{value:null,label:"Default (recommended)",description:x9$(H)}}let $=sI()!=="firstParty";return{value:null,label:"Default (recommended)",description:`Use the default model (currently ${Hj0(J5H({forDisplay:!0}))})${$?"":` \xB7 ${o_($LH)}`}`}}function HBA(){return{value:"sonnet",label:"Sonnet",description:`Sonnet 4.5 \xB7 Best for everyday tasks${sI()!=="firstParty"?"":` \xB7 ${o_($LH)}`}`,descriptionForModel:"Sonnet 4.5 - best for everyday tasks. Generally recommended for most coding tasks"}}function $BA(H,$){if(!$)return"";let A=o_(ALH(H,!0)),L=WO(),I=L?` (${L.discountPercent}% off)`:"";return` \xB7 (${Ey}) ${A}${I}`}function RoL(){return{value:"sonnet[1m]",label:"Sonnet (1M context)",description:`Sonnet 4.5 for long sessions${sI()!=="firstParty"?"":` \xB7 ${o_(aDA)}`}`,descriptionForModel:"Sonnet 4.5 with 1M context window - for long sessions with large codebases"}}function yoL(H=!1){let $=sI()!=="firstParty",A=H&&!$?` (${Ey})`:"",L=H&&!$?WO():null,I=L?` (${L.discountPercent}% off)`:"";return{value:$?"claude-opus-4-6[1m]":"opus[1m]",label:"Opus (1M context)",description:`Opus 4.6 for long sessions${$?"":` \xB7${A} ${o_(ALH(!0,H))}${I}`}`,descriptionForModel:"Opus 4.6 with 1M context window - for long sessions with large codebases"}}function voL(){return{value:"haiku",label:"Haiku",description:`Haiku 4.5 \xB7 Fastest for quick answers${sI()!=="firstParty"?"":` \xB7 ${o_(tDA)}`}`,descriptionForModel:"Haiku 4.5 - fastest for quick answers. Lower cost but less capable than Sonnet 4.5."}}function Aj0(){return{value:"haiku",label:"Haiku",description:`Haiku 3.5 for simple tasks${sI()!=="firstParty"?"":` \xB7 ${o_(oDA)}`}`,descriptionForModel:"Haiku 3.5 - faster and lower cost, but less capable than Sonnet. Use for simple tasks."}}function Lj0(){return eDA()===aG().haiku45?voL():Aj0()}function Ij0(H=!1){return{value:"opus",label:"Opus",description:`Opus 4.6 \xB7 Most capable for complex work${$BA(!1,H)}`}}function qoL(H=!1){return{value:"opus[1m]",label:"Opus (1M context)",description:`Opus 4.6 with 1M context \xB7 Uses rate limits faster${$BA(!0,H)}`}}function fj0(H=!1){if(nL()){if(!Wq())return[ILH(),sDA];if(TzH()||zzH()||NzH()){let L=[ILH(H)];if(T9$().hasAccess)L.push(qoL(H));if(L.push(Dj0),LLH().hasAccess)L.push(ZoL);return L.push(sDA),L}let A=[ILH(),Ij0(H)];if(T9$().hasAccess)A.push(qoL(H));if(LLH().hasAccess)A.push(ZoL);return A.push(sDA),A}let $=[ILH(),joL(H)];if(sI()!=="firstParty")$.push($j0());if(T9$().hasAccess)$.push(yoL(H));if(LLH().hasAccess)$.push(RoL());return $.push(voL()),$}function fLH(H=!1){let $=fj0(H),A=null,L=O9$(),I=RYH();if(L!==void 0&&L!==null)A=L;else if(I!==null)A=I;if(A===null||$.some((D)=>D.value===A))return $;if(A==="opusplan")return[...$,Bj0()];if(!nL()&&ABA(A))if(A==="sonnet")$.push(HBA());else if(A==="sonnet[1m]")$.push(RoL());else if(A==="opus[1m]")$.push(yoL(H));else if(A==="opus")$.push(joL(H));else if(A==="haiku")$.push(Lj0());else $.push({value:A,label:A,description:"Custom model"});else $.push({value:A,label:A,description:"Custom model"});return $}function ABA(H){return V5H.includes(H)}function m8(H){let $=H.trim(),A=$.toLowerCase(),L=A.endsWith("[1m]"),I=L?A.replace(/\[1m]$/i,"").trim():A;if(ABA(I))switch(I){case"opusplan":return Oq()+(L?"[1m]":"");case"sonnet":return Oq()+(L?"[1m]":"");case"haiku":return eDA()+(L?"[1m]":"");case"opus":return My()+(L?"[1m]":"");case"best":return sS0();default:}if(L)return $.replace(/\[1m\]$/i,"").trim()+"[1m]";return $}function _O(H){if(H===null){if(nL()&&!Wq())return`Sonnet (${HBA().description})`;else if(nL())return`Default (${x9$()})`;return`Default (${xq({forDisplay:!0})})`}let $=m8(H);return H===$?$:`${H} (${$})`}function j9$(H,$,A,L,I){if(process.env.CLAUDE_CODE_SUBAGENT_MODEL)return m8(process.env.CLAUDE_CODE_SUBAGENT_MODEL);let D=l$A($),B=(E)=>{if(D&&sI()==="bedrock")return ngL(E,D);return E};if(A)return B(m8(A));let f=H??z9$();if(!f)return B(m8(z9$()));if(f==="inherit")return BLH({permissionMode:L??"default",mainLoopModel:$,exceeds200kTokens:!1});return B(m8(f))}function R9$(H){if(!H)return"Inherit (default)";if(H==="inherit")return"Inherit from parent";return H.charAt(0).toUpperCase()+H.slice(1)}function hoL(){let H=[{value:"sonnet",label:"Sonnet",description:"Balanced performance - best for most agents"}];if(Wq())H.push({value:"opus",label:"Opus",description:"Most capable for complex reasoning tasks"});return H.push({value:"haiku",label:"Haiku",description:"Fast and efficient for simple tasks"},{value:"inherit",label:"Inherit from parent",description:"Use the same model as the main conversation"}),H}function vu(H){return H.replace(/\[(1|2)m\]/gi,"")}var V5H,tS0,YoL,P5H,eS0,joL=(H=!1)=>{let $=sI()!=="firstParty",A=$?"4.1":"4.6",L=$?C9$:ALH(!1,H),I=$?"Legacy":"Most capable for complex work",D=H&&!$?` (${Ey})`:"",B=H&&!$?WO():null,f=B?` (${B.discountPercent}% off)`:"";return{value:"opus",label:$?"Opus 4.1":"Opus",description:`Opus ${A} \xB7 ${I}${$?"":` \xB7${D} ${o_(L)}${f}`}`,descriptionForModel:$?"Opus 4.1 - legacy version":"Opus 4.6 - most capable for complex work"}},$j0=()=>{let H=sI()!=="firstParty";return{value:aG().opus46,label:"Opus 4.6",description:`Opus 4.6 \xB7 Most capable for complex work${H?"":` \xB7 ${o_(Q5H)}`}`,descriptionForModel:"Opus 4.6 - most capable for complex work"}},ZoL,Dj0,sDA,Bj0=()=>{return{value:"opusplan",label:"Opus Plan Mode",description:"Use Opus 4.6 in plan mode, Sonnet 4.5 otherwise"}};var aI=K(()=>{tD();vA();g$();EI();$4H();ND$();W5H();AJ();mL();ELH();w1();qE();_$();_Q();q9$();woL();oM();FqH();SD();p6();V5H=["sonnet","opus","haiku","best","sonnet[1m]","opus[1m]","opusplan"],tS0=CAH,YoL=tS0.firstParty,P5H=[...V5H,"inherit"];eS0=o$(()=>{return null});ZoL={value:"sonnet[1m]",label:"Sonnet (1M context)",description:"Sonnet 4.5 with 1M context \xB7 Uses rate limits faster"};Dj0={value:"sonnet",label:"Sonnet",description:"Sonnet 4.5 \xB7 Best for everyday tasks"},sDA={value:"haiku",label:"Haiku",description:"Haiku 4.5 \xB7 Fastest for quick answers"}});function v9$(H){if(sI()==="vertex")return LBA;if(H?.isNonInteractive){if(H.hasAppendSystemPrompt)return boL;return koL}return LBA}function Mj0(){if(BE(process.env.CLAUDE_CODE_ATTRIBUTION_HEADER))return!1;return NL("tengu_attribution_header",!0)}function h9$(H){if(!Mj0())return"";let $=`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}.${H}`,A=process.env.CLAUDE_CODE_ENTRYPOINT??"unknown",I=`x-anthropic-billing-header: cc_version=${$}; cc_entrypoint=${A};${" cch=00000;"}`;return N(`attribution header ${I}`),I}var LBA="You are Claude Code, Anthropic's official CLI for Claude.",boL="You are Claude Code, Anthropic's official CLI for Claude, running within the Claude Agent SDK.",koL="You are a Claude agent, built on Anthropic's Claude Agent SDK.",Ej0,y9$;var b9$=K(()=>{oM();E$();SD();NA();Ej0=[LBA,boL,koL],y9$=new Set(Ej0)});function Uj0(H){let $=H.find((L)=>L.type==="user");if(!$)return"";let A=$.message.content;if(typeof A==="string")return A;if(Array.isArray(A)){let L=A.find((I)=>I.type==="text");if(L&&L.type==="text")return L.text}return""}function IBA(H,$){let L=[4,7,20].map((B)=>H[B]||"0").join(""),I=`${Gj0}${L}${$}`;return uoL.createHash("sha256").update(I).digest("hex").slice(0,3)}function goL(H){let $=Uj0(H);return IBA($,{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)}var uoL,Gj0="59cf53e54c78";var DBA=K(()=>{uoL=require("crypto")});var moL,poL="Update the todo list for the current session. To be used proactively and often to track progress and pending tasks. Make sure that at least one task is in_progress at all times. Always provide both content (imperative) and activeForm (present continuous) for each task.";var doL=K(()=>{moL=`Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user. `)I+=E,D=0;else I+=E,D+=GI(E)}return I}var ej0=8;var FsL=K(()=>{DJ();f1$()});var Yn,j5H;var cBA=K(()=>{Yn=new WeakMap,j5H=new WeakMap});var HR0,KsL;var QsL=K(()=>{HR0=(()=>{var H="file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js";return function($){$=$||{};var A;A||(A=typeof $<"u"?$:{});var L,I;A.ready=new Promise(function(RH,kH){L=RH,I=kH});var D=Object.assign({},A),B="";typeof document<"u"&&document.currentScript&&(B=document.currentScript.src),H&&(B=H),B.indexOf("blob:")!==0?B=B.substr(0,B.replace(/[?#].*/,"").lastIndexOf("/")+1):B="";var f=A.print||console.log.bind(console),E=A.printErr||console.warn.bind(console);Object.assign(A,D),D=null;var M;A.wasmBinary&&(M=A.wasmBinary);var G=A.noExitRuntime||!0;typeof WebAssembly!="object"&&GH("no native wasm support detected");var U,X=!1;function J(RH,kH,eH){eH=kH+eH;for(var W$="";!(kH>=eH);){var O$=RH[kH++];if(!O$)break;if(O$&128){var YA=RH[kH++]&63;if((O$&224)==192)W$+=String.fromCharCode((O$&31)<<6|YA);else{var aA=RH[kH++]&63;O$=(O$&240)==224?(O$&15)<<12|YA<<6|aA:(O$&7)<<18|YA<<12|aA<<6|RH[kH++]&63,65536>O$?W$+=String.fromCharCode(O$):(O$-=65536,W$+=String.fromCharCode(55296|O$>>10,56320|O$&1023))}}else W$+=String.fromCharCode(O$)}return W$}var F,Q,W,P,C,Y,Z,q,O;function j(){var RH=U.buffer;F=RH,A.HEAP8=Q=new Int8Array(RH),A.HEAP16=P=new Int16Array(RH),A.HEAP32=Y=new Int32Array(RH),A.HEAPU8=W=new Uint8Array(RH),A.HEAPU16=C=new Uint16Array(RH),A.HEAPU32=Z=new Uint32Array(RH),A.HEAPF32=q=new Float32Array(RH),A.HEAPF64=O=new Float64Array(RH)}var u,y=[],g=[],h=[];function p(){var RH=A.preRun.shift();y.unshift(RH)}var d=0,k=null,n=null;function GH(RH){if(A.onAbort)A.onAbort(RH);throw RH="Aborted("+RH+")",E(RH),X=!0,RH=new WebAssembly.RuntimeError(RH+". Build with -sASSERTIONS for more info."),I(RH),RH}function HH(RH){return RH.startsWith("data:application/octet-stream;base64,")}var BH="data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f38AYAJ+fwF/YAN/fX0BfWABfAF8YAN/fHwAYAR/f319AGAHf39/fX19fQF9YA1/fX99f31/fX19fX1/AX9gC39/f39/f399fX19AX9gCH9/f39/f319AGAEf39+fgBgB39/f39/f38Bf2ACfH8BfGAFf398fH8AYAN/f38BfGAEf39/fABgA39/fQBgBn9/fX99fwF/ArUBHgFhAWEAHwFhAWIAAwFhAWMACQFhAWQAFgFhAWUAEQFhAWYAIAFhAWcAAAFhAWgAIQFhAWkAAwFhAWoAAAFhAWsAFwFhAWwACgFhAW0ABQFhAW4AAwFhAW8AAQFhAXAAFwFhAXEABgFhAXIAAAFhAXMAIgFhAXQACgFhAXUADQFhAXYAFgFhAXcAAgFhAXgAAwFhAXkAGAFhAXoAAgFhAUEAAQFhAUIAEQFhAUMAAQFhAUQAAAOiAqACAgMSBwcACRkDAAoRBgYKEwAPDxMBBiMTCgcHGgMUASQFJRQHAwMKCgMmAQYYDxobFAAKBw8KBwMDAgkCAAAFGwACBwIHBgIDAQMIDAABKAkHBQURACkZASoAAAIrLAIALQcHBy4HLwkFCgMCMA0xAgMJAgACAQYKAQIBBQEACQIFAQEABQAODQ0GFQIBHBUGAgkCEAAAAAUyDzMMBQYINAUCAwUODg41AgMCAgIDBgICNgIBDAwMAQsLCwsLCx0CAAIAAAABABABBQICAQMCEgMMCwEBAQEBAQsLAQICAwICAgICAgIDAgIICAEICAgEBAQEBAQEBAQABAQABAQEBAAEBAQBAQEICAEBAQEBAQEBCAgBAQEAAg4CAgUBAR4DBAcBcAHUAdQBBQcBAYACgIACBg0CfwFBkMQEC38BQQALByQIAUUCAAFGAG0BRwCwAQFIAK8BAUkAYQFKAQABSwAjAUwApgEJjQMBAEEBC9MBqwGqAaUB5QHiAZwB0AFazwHOAVlZWpsBmgGZAc0BzAHLAcoBWpgByQFZWVqbAZoBmQHIAccBxgGjAZcBpAGWAaMBvQKVAbwCxQG7Ajq6Ajq5ApQBuAI+twI+xAFqwwFqwgFqaWjBAcABvwGhAZcBtgK+AbUClgGhAbQCmAGzAjqxAjqwAr0BrwKuAq0CrAKrAqoCqAKnAqYCpQKkAqMCogKhArwBoAKfAp4CnQKcApsCmgKZApgClwKWApUClAKTApICkQKQAo8CjgKyAo0CjAKLAooCiAKHAqkChQI+hAK7AYMCggKBAoAC/gH9AfwB+QG6AfgBuQH3AfYB9QH0AfMB8gHxAYYC8AHvAbgB+wH6Ae4B7QG3AesBlQHqATrpAT7oAT7nAZQB0QE67AE+iQLmATrkAeMBOuEB4AHfAT7eAd0B3AG2AdsB2gHZAdgB1wHWAdUBtQHUAdMB0gH/AWloaWiPAZABsgGxAZEBhQGSAbQBswGRAa4BrQGsAakBqAGnAYUBCtj+A6ACMwEBfyAAQQEgABshAAJAA0AgABBhIgENAUGIxAAoAgAiAQRAIAERCQAMAQsLEAIACyABC+0BAgJ9A39DAADAfyEEAkACQAJAAkAgAkEHcSIGDgUCAQEBAAELQQMhBQwBCyAGQQFrQQJPDQEgAkHw/wNxQQR2IQcCfSACQQhxBEAgASAHEJ4BvgwBC0EAIAdB/w9xIgFrIAEgAsFBAEgbsgshAyAGQQFGBEAgAyADXA0BQwAAwH8gAyADQwAAgH9bIANDAACA/1tyIgEbIQQgAUUhBQwBCyADIANcDQBBAEECIANDAACAf1sgA0MAAID/W3IiARshBUMAAMB/IAMgARshBAsgACAFOgAEIAAgBDgCAA8LQfQNQakYQTpB+RYQCwALZwIBfQF/QwAAwH8hAgJAAkACQCABQQdxDgQCAAABAAtBxBJBqRhByQBBuhIQCwALIAFB8P8DcUEEdiEDIAFBCHEEQCAAIAMQngG+DwtBACADQf8PcSIAayAAIAHBQQBIG7IhAgsgAgt4AgF/AX0jAEEQayIEJAAgBEEIaiAAQQMgAkECR0EBdCABQf4BcUECRxsgAhAoQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAAAgBSAFWxsLeAIBfwF9IwBBEGsiBCQAIARBCGogAEEBIAJBAkZBAXQgAUH+AXFBAkcbIAIQKEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAIAUgBVsbC8wCAQV/IAAEQCAAQQRrIgEoAgAiBSEDIAEhAiAAQQhrKAIAIgAgAEF+cSIERwRAIAEgBGsiAigCBCIAIAIoAgg2AgggAigCCCAANgIEIAQgBWohAwsgASAFaiIEKAIAIgEgASAEakEEaygCAEcEQCAEKAIEIgAgBCgCCDYCCCAEKAIIIAA2AgQgASADaiEDCyACIAM2AgAgA0F8cSACakEEayADQQFyNgIAIAICfyACKAIAQQhrIgFB/wBNBEAgAUEDdkEBawwBCyABQR0gAWciAGt2QQRzIABBAnRrQe4AaiABQf8fTQ0AGkE/IAFBHiAAa3ZBAnMgAEEBdGtBxwBqIgAgAEE/TxsLIgFBBHQiAEHgMmo2AgQgAiAAQegyaiIAKAIANgIIIAAgAjYCACACKAIIIAI2AgRB6DpB6DopAwBCASABrYaENwMACwsOAEHYMigCABEJABBYAAunAQIBfQJ/IABBFGoiByACIAFBAkkiCCAEIAUQNSEGAkAgByACIAggBCAFEC0iBEMAAAAAYCADIARecQ0AIAZDAAAAAGBFBEAgAyEEDAELIAYgAyADIAZdGyEECyAAQRRqIgAgASACIAUQOCAAIAEgAhAwkiAAIAEgAiAFEDcgACABIAIQL5KSIgMgBCADIAReGyADIAQgBCAEXBsgBCAEWyADIANbcRsLvwEBA38gAC0AAEEgcUUEQAJAIAEhAwJAIAIgACIBKAIQIgAEfyAABSABEJ0BDQEgASgCEAsgASgCFCIFa0sEQCABIAMgAiABKAIkEQYAGgwCCwJAIAEoAlBBAEgNACACIQADQCAAIgRFDQEgAyAEQQFrIgBqLQAAQQpHDQALIAEgAyAEIAEoAiQRBgAgBEkNASADIARqIQMgAiAEayECIAEoAhQhBQsgBSADIAIQKxogASABKAIUIAJqNgIUCwsLCwYAIAAQIwtQAAJAAkACQAJAAkAgAg4EBAABAgMLIAAgASABQQxqEEMPCyAAIAEgAUEMaiADEEQPCyAAIAEgAUEMahBCDwsQJAALIAAgASABQQxqIAMQRQttAQF/IwBBgAJrIgUkACAEQYDABHEgAiADTHJFBEAgBSABQf8BcSACIANrIgNBgAIgA0GAAkkiARsQKhogAUUEQANAIAAgBUGAAhAmIANBgAJrIgNB/wFLDQALCyAAIAUgAxAmCyAFQYACaiQAC/ICAgJ/AX4CQCACRQ0AIAAgAToAACAAIAJqIgNBAWsgAToAACACQQNJDQAgACABOgACIAAgAToAASADQQNrIAE6AAAgA0ECayABOgAAIAJBB0kNACAAIAE6AAMgA0EEayABOgAAIAJBCUkNACAAQQAgAGtBA3EiBGoiAyABQf8BcUGBgoQIbCIBNgIAIAMgAiAEa0F8cSIEaiICQQRrIAE2AgAgBEEJSQ0AIAMgATYCCCADIAE2AgQgAkEIayABNgIAIAJBDGsgATYCACAEQRlJDQAgAyABNgIYIAMgATYCFCADIAE2AhAgAyABNgIMIAJBEGsgATYCACACQRRrIAE2AgAgAkEYayABNgIAIAJBHGsgATYCACAEIANBBHFBGHIiBGsiAkEgSQ0AIAGtQoGAgIAQfiEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkEgayICQR9LDQALCyAAC4AEAQN/IAJBgARPBEAgACABIAIQFyAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAtIAQF/IwBBEGsiBCQAIAQgAzYCDAJAIABFBEBBAEEAIAEgAiAEKAIMEHEMAQsgACgC9AMgACABIAIgBCgCDBBxCyAEQRBqJAALkwECAX0BfyMAQRBrIgYkACAGQQhqIABB6ABqIAAgAkEBdGovAWIQH0MAAMB/IQUCQAJAAkAgBi0ADEEBaw4CAAECCyAGKgIIIQUMAQsgBioCCCADlEMK1yM8lCEFCyAALQADQRB0QYCAwABxBEAgBSAAIAEgAiAEEFQiA0MAAAAAIAMgA1sbkiEFCyAGQRBqJAAgBQu1AQECfyAAKAIEQQFqIgEgACgCACICKALsAyACKALoAyICa0ECdU8EQANAIAAoAggiAUUEQCAAQQA2AgggAEIANwIADwsgACABKAIENgIAIAAgASgCCDYCBCAAIAEoAgA2AgggARAjIAAoAgRBAWoiASAAKAIAIgIoAuwDIAIoAugDIgJrQQJ1Tw0ACwsgACABNgIEIAIgAUECdGooAgAtABdBEHRBgIAwcUGAgCBGBEAgABB9CwuBAQIBfwF9IwBBEGsiAyQAIANBCGogAEEDIAJBAkdBAXQgAUH+AXFBAkcbIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC4EBAgF/AX0jAEEQayIDJAAgA0EIaiAAQQEgAkECRkEBdCABQf4BcUECRxsgAhBTQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIQwAAAACUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsLeAICfQF/IAAgAkEDdGoiByoC+AMhBkMAAMB/IQUCQAJAAkAgBy0A/ANBAWsOAgABAgsgBiEFDAELIAYgA5RDCtcjPJQhBQsgAC0AF0EQdEGAgMAAcQR9IAUgAEEUaiABIAIgBBBUIgNDAAAAACADIANbG5IFIAULC1EBAX8CQCABKALoAyICIAEoAuwDRwRAIABCADcCBCAAIAE2AgAgAigCAC0AF0EQdEGAgDBxQYCAIEcNASAAEH0PCyAAQgA3AgAgAEEANgIICwvoAgECfwJAIAAgAUYNACABIAAgAmoiBGtBACACQQF0a00EQCAAIAEgAhArDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkEBayECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkEBayICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQQRrIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkEBayICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AA0AgAyABKAIANgIAIAFBBGohASADQQRqIQMgAkEEayICQQNLDQALCyACRQ0AA0AgAyABLQAAOgAAIANBAWohAyABQQFqIQEgAkEBayICDQALCyAAC5QCAgF8AX8CQCAAIAGiIgAQbCIERAAAAAAAAPA/oCAEIAREAAAAAAAAAABjGyIEIARiIgUgBJlELUMc6+I2Gj9jRXJFBEAgACAEoSEADAELIAUgBEQAAAAAAADwv6CZRC1DHOviNho/Y0VyRQRAIAAgBKFEAAAAAAAA8D+gIQAMAQsgACAEoSEAIAIEQCAARAAAAAAAAPA/oCEADAELIAMNACAAAnxEAAAAAAAAAAAgBQ0AGkQAAAAAAADwPyAERAAAAAAAAOA/ZA0AGkQAAAAAAADwP0QAAAAAAAAAACAERAAAAAAAAOC/oJlELUMc6+I2Gj9jGwugIQALIAAgAGIgASABYnIEQEMAAMB/DwsgACABo7YLkwECAX0BfyMAQRBrIgYkACAGQQhqIABB6ABqIAAgAkEBdGovAV4QH0MAAMB/IQUCQAJAAkAgBi0ADEEBaw4CAAECCyAGKgIIIQUMAQsgBioCCCADlEMK1yM8lCEFCyAALQADQRB0QYCAwABxBEAgBSAAIAEgAiAEEFQiA0MAAAAAIAMgA1sbkiEFCyAGQRBqJAAgBQtQAAJAAkACQAJAAkAgAg4EBAABAgMLIAAgASABQR5qEEMPCyAAIAEgAUEeaiADEEQPCyAAIAEgAUEeahBCDwsQJAALIAAgASABQR5qIAMQRQt+AgF/AX0jAEEQayIEJAAgBEEIaiAAQQMgAkECR0EBdCABQf4BcUECRxsgAhBQQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAACXQwAAAAAgBSAFWxsLfgIBfwF9IwBBEGsiBCQAIARBCGogAEEBIAJBAkZBAXQgAUH+AXFBAkcbIAIQUEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAl0MAAAAAIAUgBVsbC08AAkACQAJAIANB/wFxIgMOBAACAgECCyABIAEvAABB+P8DcTsAAA8LIAEgAS8AAEH4/wNxQQRyOwAADwsgACABIAJBAUECIANBAUYbEEwLNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEBAAtiAgJ9An8CQCAAKALkA0UNACAAQfwAaiIDIABBGmoiBC8BABAgIgIgAlwEQCADIABBGGoiBC8BABAgIgIgAlwNASADIAAvARgQIEMAAAAAXkUNAQsgAyAELwEAECAhAQsgAQtfAQN/IAEEQEEMEB4iAyABKQIENwIEIAMhAiABKAIAIgEEQCADIQQDQEEMEB4iAiABKQIENwIEIAQgAjYCACACIQQgASgCACIBDQALCyACIAAoAgA2AgAgACADNgIACwvXawMtfxx9AX4CfwJAIAAtAABBBHEEQCAAKAKgASAMRw0BCyAAKAKkASAAKAL0AygCDEcNAEEAIAAtAKgBIANGDQEaCyAAQoCAgPyLgIDAv383AoADIABCgYCAgBA3AvgCIABCgICA/IuAgMC/fzcC8AIgAEEANgKsAUEBCyErAkACQAJAAkAgACgCCARAIABBFGoiDkECQQEgBhAiIT4gDkECQQEgBhAhITwgDkEAQQEgBhAiITsgDkEAQQEgBhAhIUAgBCABIAUgAiAAKAL4AiAAQfACaiIOKgIAIAAoAvwCIAAqAvQCIAAqAoADIAAqAoQDID4gPJIiPiA7IECSIjwgACgC9AMiEBB7DQEgACgCrAEiEUUNAyAAQbABaiETA0AgBCABIAUgAiATIB1BGGxqIg4oAgggDioCACAOKAIMIA4qAgQgDioCECAOKgIUID4gPCAQEHsNAiAdQQFqIh0gEUcNAAsMAgsgCEUEQCAAKAKsASITRQ0CIABBsAFqIRADQAJAAkAgECAdQRhsIhFqIg4qAgAiPiA+XCABIAFcckUEQCA+IAGTi0MXt9E4XQ0BDAILIAEgAVsgPiA+W3INAQsCQCAQIBFqIhEqAgQiPiA+XCACIAJcckUEQCA+IAKTi0MXt9E4XQ0BDAILIAIgAlsgPiA+W3INAQsgESgCCCAERw0AIBEoAgwgBUYNAwsgEyAdQQFqIh1HDQALDAILAkAgAEHwAmoiDioCACI+ID5cIAEgAVxyRQRAID4gAZOLQxe30ThdDQEMBAsgASABWyA+ID5bcg0DCyAOQQAgACgC/AIgBUYbQQAgACgC+AIgBEYbQQACfyACIAJcIg4gACoC9AIiPiA+XHJFBEAgPiACk4tDF7fROF0MAQtBACA+ID5bDQAaIA4LGyEOCyAORSArcgRAIA4hHQwCCyAAIA4qAhA4ApQDIAAgDioCFDgCmAMgCkEMQRAgCBtqIgMgAygCAEEBajYCACAOIR0MAgtBACEdCyAGIUAgByFHIAtBAWohIiMAQaABayINJAACQAJAIARBAUYgASABW3JFBEAgDUGqCzYCICAAQQVB2CUgDUEgahAsDAELIAVBAUYgAiACW3JFBEAgDUHZCjYCECAAQQVB2CUgDUEQahAsDAELIApBAEEEIAgbaiILIAsoAgBBAWo2AgAgACAALQCIA0H8AXEgAC0AFEEDcSILIANBASADGyIsIAsbIg9BA3FyOgCIAyAAQawDaiIQIA9BAUdBA3QiC2ogAEEUaiIUQQNBAiAPQQJGGyIRIA8gQBAiIgY4AgAgECAPQQFGQQN0Ig5qIBQgESAPIEAQISIHOAIAIAAgFEEAIA8gQBAiIjw4ArADIAAgFEEAIA8gQBAhIjs4ArgDIABBvANqIhAgC2ogFCARIA8QMDgCACAOIBBqIBQgESAPEC84AgAgACAUQQAgDxAwOALAAyAAIBRBACAPEC84AsgDIAsgAEHMA2oiC2ogFCARIA8gQBA4OAIAIAsgDmogFCARIA8gQBA3OAIAIAAgFEEAIA8gQBA4OALQAyAAIBRBACAPIEAQNyI6OALYAyAGIAeSIT4gPCA7kiE8AkACQCAAKAIIIgsEQEMAAMB/IAEgPpMgBEEBRhshBkMAAMB/IAIgPJMgBUEBRhshPiAAAn0gBCAFckUEQCAAIABBAiAPIAYgQCBAECU4ApQDIABBACAPID4gRyBAECUMAQsgBEEDTyAFQQNPcg0EIA1BiAFqIAAgBiAGIAAqAswDIAAqAtQDkiAAKgK8A5IgACoCxAOSIjyTIgdDAAAAACAHQwAAAABeGyAGIAZcG0GBgAggBEEDdEH4//8HcXZB/wFxID4gPiAAKgLQAyA6kiAAKgLAA5IgACoCyAOSIjuTIgdDAAAAACAHQwAAAABeGyA+ID5cG0GBgAggBUEDdEH4//8HcXZB/wFxIAsREAAgDSoCjAEiPUMAAAAAYCANKgKIASIHQwAAAABgcUUEQCANID27OQMIIA0gB7s5AwAgAEEBQdwdIA0QLCANKgKMASIHQwAAAAAgB0MAAAAAXhshPSANKgKIASIHQwAAAAAgB0MAAAAAXhshBwsgCiAKKAIUQQFqNgIUIAogCUECdGoiCSAJKAIYQQFqNgIYIAAgAEECIA8gPCAHkiAGIARBAWtBAkkbIEAgQBAlOAKUAyAAQQAgDyA7ID2SID4gBUEBa0ECSRsgRyBAECULOAKYAwwBCwJAIAAoAuADRQRAIAAoAuwDIAAoAugDa0ECdSELDAELIA1BiAFqIAAQMgJAIA0oAogBRQRAQQAhCyANKAKMAUUNAQsgDUGAAWohEEEAIQsDQCANQQA2AoABIA0gDSkDiAE3A3ggECANKAKQARA8IA1BiAFqEC4gDSgCgAEiCQRAA0AgCSgCACEOIAkQJyAOIgkNAAsLIAtBAWohCyANQQA2AoABIA0oAowBIA0oAogBcg0ACwsgDSgCkAEiCUUNAANAIAkoAgAhDiAJECcgDiIJDQALCyALRQRAIAAgAEECIA8gBEEBa0EBSwR9IAEgPpMFIAAqAswDIAAqAtQDkiAAKgK8A5IgACoCxAOSCyBAIEAQJTgClAMgACAAQQAgDyAFQQFrQQFLBH0gAiA8kwUgACoC0AMgACoC2AOSIAAqAsADkiAAKgLIA5ILIEcgQBAlOAKYAwwBCwJAIAgNACAFQQJGIAIgPJMiBiAGW3EgBkMAAAAAX3EgBCAFckUgBEECRiABID6TIgdDAAAAAF9xcnJFDQAgACAAQQIgD0MAAAAAQwAAAAAgByAHQwAAAABdGyAHIARBAkYbIAcgB1wbIEAgQBAlOAKUAyAAIABBACAPQwAAAABDAAAAACAGIAZDAAAAAF0bIAYgBUECRhsgBiAGXBsgRyBAECU4ApgDDAELIAAQTyAAIAAtAIgDQfsBcToAiAMgABBeQQMhEyAALQAUQQJ2QQNxIQkCQAJAIA9BAkcNAAJAIAlBAmsOAgIAAQtBAiETDAELIAkhEwsgAC8AFSEnIBQgEyAPIEAQOCEGIBQgEyAPEDAhByAUIBMgDyBAEDchOyAUIBMgDxAvITpBACEQIBQgEUEAIBNBAkkbIhYgDyBAEDghPyAUIBYgDxAwIT0gFCAWIA8gQBA3IUEgFCAWIA8QLyFEIBQgFiAPIEAQYCFCIBQgFiAPEEshQyAAIA9BACABID6TIlAgBiAHkiA7IDqSkiJKID8gPZIgQSBEkpIiRiATQQFLIhkbIEAgQBB6ITsgACAPQQEgAiA8kyJRIEYgSiAZGyBHIEAQeiFFAkACQCAEIAUgGRsiHA0AIA1BiAFqIAAQMgJAAkAgDSgCiAEiDiANKAKMASIJckUNAANAIA4oAuwDIA4oAugDIg5rQQJ1IAlNDQQCQCAOIAlBAnRqKAIAIgkQeUUNACAQDQIgCRA7IgYgBlsgBotDF7fROF1xDQIgCRBAIgYgBlwEQCAJIRAMAQsgCSEQIAaLQxe30ThdDQILIA1BiAFqEC4gDSgCjAEiCSANKAKIASIOcg0ACwwBC0EAIRALIA0oApABIglFDQADQCAJKAIAIQ4gCRAnIA4iCQ0ACwsgDUGIAWogABAyIA0oAowBIQkCQCANKAKIASIORQRAQwAAAAAhPSAJRQ0BCyBFIEVcIiMgBUEAR3IhKCA7IDtcIiQgBEEAR3IhKUMAAAAAIT0DQCAOKALsAyAOKALoAyIOa0ECdSAJTQ0CIA4gCUECdGooAgAiDhB4AkAgDi8AFSAOLQAXQRB0ciIJQYCAMHFBgIAQRgRAIA4QdyAOIA4tAAAiCUEBciIOQfsBcSAOIAlBBHEbOgAADAELIAgEfyAOIA4tABRBA3EiCSAPIAkbIDsgRRB2IA4vABUgDi0AF0EQdHIFIAkLQYDgAHFBgMAARg0AIA5BFGohEQJAIA4gEEYEQCAQQQA2ApwBIBAgDDYCmAFDAAAAACEHDAELIBQtAABBAnZBA3EhCQJAAkAgD0ECRw0AQQMhEgJAIAlBAmsOAgIAAQtBAiESDAELIAkhEgsgDUGAgID+BzYCaCANQYCAgP4HNgJQIA1B+ABqIA5B/ABqIhcgDi8BHhAfIDsgRSASQQFLIh4bIT4CQAJAAkACQCANLQB8IgkOBAABAQABCwJAIBcgDi8BGBAgIgYgBlwNACAXIA4vARgQIEMAAAAAXkUNACAOKAL0Ay0ACEEBcSIJDQBDAADAf0MAAAAAIAkbIQcMAgtDAADAfyEGDAILIA0qAnghB0MAAMB/IQYCQCAJQQFrDgIBAAILIAcgPpRDCtcjPJQhBgwBCyAHIQYLIA4tABdBEHRBgIDAAHEEQCAGIBEgD0GBAiASQQN0dkEBcSA7EFQiBkMAAAAAIAYgBlsbkiEGCyAOKgL4AyEHQQAhH0EAIRgCQAJAAkAgDi0A/ANBAWsOAgEAAgsgOyAHlEMK1yM8lCEHCyAHIAdcDQAgB0MAAAAAYCEYCyAOKgKABCEHAkACQAJAIA4tAIQEQQFrDgIBAAILIEUgB5RDCtcjPJQhBwsgByAHXA0AIAdDAAAAAGAhHwsCQCAOAn0gBiAGXCIJID4gPlxyRQRAIA4qApwBIgcgB1sEQCAOKAL0Ay0AEEEBcUUNAyAOKAKYASAMRg0DCyARIBIgDyA7EDggESASIA8QMJIgESASIA8gOxA3IBEgEiAPEC+SkiIHIAYgBiAHXRsgByAGIAkbIAYgBlsgByAHW3EbDAELIBggHnEEQCARQQIgDyA7EDggEUECIA8QMJIgEUECIA8gOxA3IBFBAiAPEC+SkiIHIA4gD0EAIDsgOxAxIgYgBiAHXRsgByAGIAYgBlwbIAYgBlsgByAHW3EbDAELIB4gH0VyRQRAIBFBACAPIDsQOCARQQAgDxAwkiARQQAgDyA7EDcgEUEAIA8QL5KSIgcgDiAPQQEgRSA7EDEiBiAGIAddGyAHIAYgBiAGXBsgBiAGWyAHIAdbcRsMAQtBASEaIA1BATYCZCANQQE2AnggEUECQQEgOxAiIBFBAkEBIDsQIZIhPiARQQBBASA7ECIhPCARQQBBASA7ECEhOkMAAMB/IQdBASEVQwAAwH8hBiAYBEAgDiAPQQAgOyA7EDEhBiANQQA2AnggDSA+IAaSIgY4AmhBACEVCyA8IDqSITwgHwRAIA4gD0EBIEUgOxAxIQcgDUEANgJkIA0gPCAHkiIHOAJQQQAhGgsCQAJAAkAgAC0AF0EQdEGAgAxxQYCACEYiCSASQQJJIiBxRQRAIAkgJHINAiAGIAZcDQEMAgsgJCAGIAZbcg0CC0ECIRUgDUECNgJ4IA0gOzgCaCA7IQYLAkAgIEEBIAkbBEAgCSAjcg0CIAcgB1wNAQwCCyAjIAcgB1tyDQELQQIhGiANQQI2AmQgDSBFOAJQIEUhBwsCQCAXIA4vAXoQICI6IDpcDQACfyAVIB5yRQRAIBcgDi8BehAgIQcgDUEANgJkIA0gPCAGID6TIAeVkjgCUEEADAELIBogIHINASAXIA4vAXoQICEGIA1BADYCeCANIAYgByA8k5QgPpI4AmhBAAshGkEAIRULIA4vABZBD3EiCUUEQCAALQAVQQR2IQkLAkAgFUUgCUEFRiAeciAYIClyIAlBBEdycnINACANQQA2AnggDSA7OAJoIBcgDi8BehAgIgYgBlwNAEEAIRogFyAOLwF6ECAhBiANQQA2AmQgDSA7ID6TIAaVOAJQCyAOLwAWQQ9xIhhFBEAgAC0AFUEEdiEYCwJAICAgKHIgH3IgGEEFRnIgGkUgGEEER3JyDQAgDUEANgJkIA0gRTgCUCAXIA4vAXoQICIGIAZcDQAgFyAOLwF6ECAhBiANQQA2AnggDSAGIEUgPJOUOAJoCyAOIA9BAiA7IDsgDUH4AGogDUHoAGoQPyAOIA9BACBFIDsgDUHkAGogDUHQAGoQPyAOIA0qAmggDSoCUCAPIA0oAnggDSgCZCA7IEVBAEEFIAogIiAMED0aIA4gEkECdEH8JWooAgBBAnRqKgKUAyEGIBEgEiAPIDsQOCARIBIgDxAwkiARIBIgDyA7EDcgESASIA8QL5KSIgcgBiAGIAddGyAHIAYgBiAGXBsgBiAGWyAHIAdbcRsLIgc4ApwBCyAOIAw2ApgBCyA9IAcgESATQQEgOxAiIBEgE0EBIDsQIZKSkiE9CyANQYgBahAuIA0oAowBIgkgDSgCiAEiDnINAAsLIA0oApABIgkEQANAIAkoAgAhDiAJECcgDiIJDQALCyA7IEUgGRshByA9QwAAAACSIQYgC0ECTwRAIBQgEyAHEE0gC0EBa7OUIAaSIQYLIEIgQ5IhPiAFIAQgGRshGiBHIEAgGRshTSBAIEcgGRshSSANQdAAaiAAEDJBACAcIAYgB14iCxsgHCAcQQJGGyAcICdBgIADcSIfGyEeIBQgFiBFIDsgGRsiRBBNIU8gDSgCVCIRIA0oAlAiCXIEQEEBQQIgRCBEXCIpGyEtIAtFIBxBAUZyIS4gE0ECSSEZIABB8gBqIS8gAEH8AGohMCATQQJ0IgtB7CVqITEgC0HcJWohMiAWQQJ0Ig5B7CVqIRwgDkHcJWohICALQfwlaiEkIA5B/CVqISMgGkEARyIzIAhyITQgGkUiNSAIQQFzcSE2IBogH3JFITcgDUHwAGohOCANQYABaiEnQYECIBNBA3R2Qf8BcSEoIBpBAWtBAkkhOQNAIA1BADYCgAEgDUIANwN4AkAgACgC7AMiCyAAKALoAyIORg0AIAsgDmsiC0EASA0DIA1BiAFqIAtBAnVBACAnEEohECANKAKMASANKAJ8IA0oAngiC2siDmsgCyAOEDMhDiANIA0oAngiCzYCjAEgDSAONgJ4IA0pA5ABIVYgDSANKAJ8Ig42ApABIA0oAoABIRIgDSBWNwJ8IA0gEjYClAEgECALNgIAIAsgDkcEQCANIA4gCyAOa0EDakF8cWo2ApABCyALRQ0AIAsQJwsgFC0AACIOQQJ2QQNxIQsCQAJAIA5BA3EiDiAsIA4bIhJBAkcNAEEDIRACQCALQQJrDgICAAELQQIhEAwBCyALIRALIAAvABUhCyAUIBAgBxBNIT8CQCAJIBFyRQRAQwAAAAAhQ0EAIRFDAAAAACFCQwAAAAAhQUEAIRUMAQsgC0GAgANxISUgEEECSSEYIBBBAnQiC0HsJWohISALQdwlaiEqQQAhFUMAAAAAIUEgESEOQwAAAAAhQkMAAAAAIUNBACEXQwAAAAAhPQNAIAkoAuwDIAkoAugDIglrQQJ1IA5NDQQCQCAJIA5BAnRqKAIAIgkvABUgCS0AF0EQdHIiC0GAgDBxQYCAEEYgC0GA4ABxQYDAAEZyDQAgDUGIAWoiESAJQRRqIgsgKigCACADECggDS0AjAEhJiARIAsgISgCACADECggDS0AjAEhESAJIBs2AtwDIBUgJkEDRmohFSARQQNGIREgCyAQQQEgOxAiIUsgCyAQQQEgOxAhIU4gCSAXIAkgFxsiF0YhJiAJKgKcASE8IAsgEiAYIEkgQBA1IToCQCALIBIgGCBJIEAQLSIGQwAAAABgIAYgPF1xDQAgOkMAAAAAYEUEQCA8IQYMAQsgOiA8IDogPF4bIQYLIBEgFWohFQJAICVFQwAAAAAgPyAmGyI8IEsgTpIiOiA9IAaSkpIgB15Fcg0AIA0oAnggDSgCfEYNACAOIREMAwsgCRB5BEAgQiAJEDuSIUIgQyAJEEAgCSoCnAGUkyFDCyBBIDwgOiAGkpIiBpIhQSA9IAaSIT0gDSgCfCILIA0oAoABRwRAIAsgCTYCACANIAtBBGo2AnwMAQsgCyANKAJ4ayILQQJ1IhFBAWoiDkGAgICABE8NBSANQYgBakH/////AyALQQF1IiYgDiAOICZJGyALQfz///8HTxsgESAnEEohDiANKAKQASAJNgIAIA0gDSgCkAFBBGo2ApABIA0oAowBIA0oAnwgDSgCeCIJayILayAJIAsQMyELIA0gDSgCeCIJNgKMASANIAs2AnggDSkDkAEhViANIA0oAnwiCzYCkAEgDSgCgAEhESANIFY3AnwgDSARNgKUASAOIAk2AgAgCSALRwRAIA0gCyAJIAtrQQNqQXxxajYCkAELIAlFDQAgCRAnCyANQQA2AnAgDSANKQNQNwNoIDggDSgCWBA8IA1B0ABqEC4gDSgCcCIJBEADQCAJKAIAIQsgCRAnIAsiCQ0ACwtBACERIA1BADYCcCANKAJUIg4gDSgCUCIJcg0ACwtDAACAPyBCIEJDAACAP10bIEIgQkMAAAAAXhshPCANKAJ8IRcgDSgCeCEJAn0CQAJ9AkACQAJAIB5FDQAgFCAPQQAgQCBAEDUhBiAUIA9BACBAIEAQLSE6IBQgD0EBIEcgQBA1IT8gFCAPQQEgRyBAEC0hPSAGID8gE0EBSyILGyBKkyIGIAZbIAYgQV5xDQEgOiA9IAsbIEqTIgYgBlsgBiBBXXENASAAKAL0Ay0AFEEBcQ0AIEEgPEMAAAAAWw0DGiAAEDsiBiAGXA0CIEEgABA7QwAAAABbDQMaDAILIAchBgsgBiAGWw0CIAYhBwsgBwshBiBBjEMAAAAAIEFDAAAAAF0bIT8gBgwBCyAGIEGTIT8gBgshByA2RQRAAkAgCSAXRgRAQwAAAAAhQQwBC0MAAIA/IEMgQ0MAAIA/XRsgQyBDQwAAAABeGyE9QwAAAAAhQSAJIQ4DQCAOKAIAIgsqApwBITogC0EUaiIQIA8gGSBJIEAQNSFCAkAgECAPIBkgSSBAEC0iBkMAAAAAYCAGIDpdcQ0AIEJDAAAAAGBFBEAgOiEGDAELIEIgOiA6IEJdGyEGCwJAID9DAAAAAF0EQCAGIAsQQIyUIjpDAAAAAF4gOkMAAAAAXXJFDQEgCyATIA8gPyA9lSA6lCAGkiJCIAcgOxAlITogQiBCXCA6IDpcciA6IEJbcg0BIEEgOiAGk5IhQSALEEAgCyoCnAGUID2SIT0MAQsgP0MAAAAAXkUNACALEDsiQkMAAAAAXiBCQwAAAABdckUNACALIBMgDyA/IDyVIEKUIAaSIkMgByA7ECUhOiBDIENcIDogOlxyIDogQ1tyDQAgPCBCkyE8IEEgOiAGk5IhQQsgDkEEaiIOIBdHDQALID8gQZMiQiA9lSFLIEIgPJUhTiAALwAVQYCAA3FFIC5yISVDAAAAACFBIAkhCwNAIAsoAgAiDioCnAEhPCAOQRRqIhggDyAZIEkgQBA1IToCQCAYIA8gGSBJIEAQLSIGQwAAAABgIAYgPF1xDQAgOkMAAAAAYEUEQCA8IQYMAQsgOiA8IDogPF4bIQYLAn0gDiATIA8CfSBCQwAAAABdBEAgBiAGIA4QQIyUIjxDAAAAAFsNAhogBiA8kiA9QwAAAABbDQEaIEsgPJQgBpIMAQsgBiBCQwAAAABeRQ0BGiAGIA4QOyI8QwAAAABeIDxDAAAAAF1yRQ0BGiBOIDyUIAaSCyAHIDsQJQshQyAYIBNBASA7ECIhPCAYIBNBASA7ECEhOiAYIBZBASA7ECIhUiAYIBZBASA7ECEhUyANIEMgPCA6kiJUkiJVOAJoIA1BADYCYCBSIFOSITwCQCAOQfwAaiIQIA4vAXoQICI6IDpbBEAgECAOLwF6ECAhOiANQQA2AmQgDSA8IFUgVJMiPCA6lCA8IDqVIBkbkjgCeAwBCyAjKAIAIRACQCApDQAgDiAQQQN0aiIhKgL4AyE6QQAhEgJAAkACQCAhLQD8A0EBaw4CAQACCyBEIDqUQwrXIzyUIToLIDogOlwNACA6QwAAAABgIRILICUgNSASQQFzcXFFDQAgDi8AFkEPcSISBH8gEgUgAC0AFUEEdgtBBEcNACANQYgBaiAYICAoAgAgDxAoIA0tAIwBQQNGDQAgDUGIAWogGCAcKAIAIA8QKCANLQCMAUEDRg0AIA1BADYCZCANIEQ4AngMAQsgDkH4A2oiEiAQQQN0aiIQKgIAIToCQAJAAkACQCAQLQAEQQFrDgIBAAILIEQgOpRDCtcjPJQhOgsgOkMAAAAAYA0BCyANIC02AmQgDSBEOAJ4DAELAkACfwJAAkACQCAWQQJrDgICAAELIDwgDiAPQQAgRCA7EDGSITpBAAwCC0EBIRAgDSA8IA4gD0EBIEQgOxAxkiI6OAJ4IBNBAU0NDAwCCyA8IA4gD0EAIEQgOxAxkiE6QQALIRAgDSA6OAJ4CyANIDMgEiAQQQN0ajEABEIghkKAgICAIFFxIDogOlxyNgJkCyAOIA8gEyAHIDsgDUHgAGogDUHoAGoQPyAOIA8gFiBEIDsgDUHkAGogDUH4AGoQPyAOICMoAgBBA3RqIhAqAvgDIToCQAJAAkACQCAQLQD8A0EBaw4CAQACCyBEIDqUQwrXIzyUIToLQQEhECA6QwAAAABgDQELQQEhECAOLwAWQQ9xIhIEfyASBSAALQAVQQR2C0EERw0AIA1BiAFqIBggICgCACAPECggDS0AjAFBA0YNACANQYgBaiAYIBwoAgAgDxAoIA0tAIwBQQNGIRALIA4gDSoCaCI8IA0qAngiOiATQQFLIhIbIDogPCASGyAALQCIA0EDcSANKAJgIhggDSgCZCIhIBIbICEgGCASGyA7IEUgCCAQcSIQQQRBByAQGyAKICIgDBA9GiBBIEMgBpOSIUEgAAJ/IAAtAIgDIhBBBHFFBEBBACAOLQCIA0EEcUUNARoLQQQLIBBB+wFxcjoAiAMgC0EEaiILIBdHDQALCyA/IEGTIT8LIAAgAC0AiAMiC0H7AXFBBCA/QwAAAABdQQJ0IAtBBHFBAnYbcjoAiAMgFCATIA8gQBBgIBQgEyAPEEuSITogFCATIA8gQBB/IBQgEyAPEFKSIUsgFCATIAcQTSFCAn8CQAJ9ID9DAAAAAF5FIB5BAkdyRQRAIA1BiAFqIDAgLyAkKAIAQQF0ai8BABAfAkAgDS0AjAEEQCAUIA8gKCBJIEAQNSIGIAZbDQELQwAAAAAMAgtDAAAAACAUIA8gKCBJIEAQNSA6kyBLkyAHID+TkyI/QwAAAABeRQ0BGgsgP0MAAAAAYEUNASA/CyE8IBQtAABBBHZBB3EMAQsgPyE8IBQtAABBBHZBB3EiC0EAIAtBA2tBA08bCyELQwAAAAAhBgJAAkAgFQ0AQwAAAAAhPQJAAkACQAJAAkAgC0EBaw4FAAECBAMGCyA8QwAAAD+UIT0MBQsgPCE9DAQLIBcgCWsiC0EFSQ0CIEIgPCALQQJ1QQFrs5WSIUIMAgsgQiA8IBcgCWtBAnVBAWqzlSI9kiFCDAILIDxDAAAAP5QgFyAJa0ECdbOVIj0gPZIgQpIhQgwBC0MAAAAAIT0LIDogPZIhPSAAEHwhEgJAIAkgF0YiGARAQwAAAAAhP0MAAAAAIToMAQsgF0EEayElIDwgFbOVIU4gMigCACEhQwAAAAAhOkMAAAAAIT8gCSELA0AgDUGIAWogCygCACIOQRRqIhAgISAPECggPUMAAACAIE5DAAAAgCA8QwAAAABeGyJBIA0tAIwBQQNHG5IhPSAIBEACfwJAAkACQAJAIBNBAWsOAwECAwALQQEhFSAOQaADagwDC0EDIRUgDkGoA2oMAgtBACEVIA5BnANqDAELQQIhFSAOQaQDagshKiAOIBVBAnRqICoqAgAgPZI4ApwDCyAlKAIAIRUgDUGIAWogECAxKAIAIA8QKCA9QwAAAIAgQiAOIBVGG5JDAAAAgCBBIA0tAIwBQQNHG5IhPQJAIDRFBEAgPSAQIBNBASA7ECIgECATQQEgOxAhkiAOKgKcAZKSIT0gRCEGDAELIA4gEyA7EF0gPZIhPSASBEAgDhBOIUEgEEEAIA8gOxBBIUMgDioCmAMgEEEAQQEgOxAiIBBBAEEBIDsQIZKSIEEgQ5IiQZMiQyA/ID8gQ10bIEMgPyA/ID9cGyA/ID9bIEMgQ1txGyE/IEEgOiA6IEFdGyBBIDogOiA6XBsgOiA6WyBBIEFbcRshOgwBCyAOIBYgOxBdIkEgBiAGIEFdGyBBIAYgBiAGXBsgBiAGWyBBIEFbcRshBgsgC0EEaiILIBdHDQALCyA/IDqSIAYgEhshQQJ9IDkEQCAAIBYgDyBGIEGSIE0gQBAlIEaTDAELIEQgQSA3GyFBIEQLIT8gH0UEQCAAIBYgDyBGIEGSIE0gQBAlIEaTIUELIEsgPZIhPAJAIAhFDQAgCSELIBgNAANAIAsoAgAiFS8AFkEPcSIORQRAIAAtABVBBHYhDgsCQAJAAkACQCAOQQRrDgIAAQILIA1BiAFqIBVBFGoiECAgKAIAIA8QKEEEIQ4gDS0AjAFBA0YNASANQYgBaiAQIBwoAgAgDxAoIA0tAIwBQQNGDQEgFSAjKAIAQQN0aiIOKgL4AyE9AkACQAJAIA4tAPwDQQFrDgIBAAILIEQgPZRDCtcjPJQhPQsgPiEGID1DAAAAAGANAwsgFSAkKAIAQQJ0aioClAMhBiANIBVB/ABqIg4gFS8BehAgIjogOlsEfSAQIBZBASA7ECIgECAWQQEgOxAhkiAGIA4gFS8BehAgIjqUIAYgOpUgGRuSBSBBCzgCeCANIAYgECATQQEgOxAiIBAgE0EBIDsQIZKSOAKIASANQQA2AmggDUEANgJkIBUgDyATIAcgOyANQegAaiANQYgBahA/IBUgDyAWIEQgOyANQeQAaiANQfgAahA/IA0qAngiOiANKgKIASI9IBNBAUsiGCIOGyEGIB9BAEcgAC8AFUEPcUEER3EiECAZcSA9IDogDhsiOiA6XHIhDiAVIDogBiAPIA4gECAYcSAGIAZcciA7IEVBAUECIAogIiAMED0aID4hBgwCC0EFQQEgFC0AAEEIcRshDgsgFSAWIDsQXSEGIA1BiAFqIBVBFGoiECAgKAIAIhggDxAoID8gBpMhOgJAIA0tAIwBQQNHBEAgHCgCACESDAELIA1BiAFqIBAgHCgCACISIA8QKCANLQCMAUEDRw0AID4gOkMAAAA/lCIGQwAAAAAgBkMAAAAAXhuSIQYMAQsgDUGIAWogECASIA8QKCA+IQYgDS0AjAFBA0YNACANQYgBaiAQIBggDxAoIA0tAIwBQQNGBEAgPiA6QwAAAAAgOkMAAAAAXhuSIQYMAQsCQAJAIA5BAWsOAgIAAQsgPiA6QwAAAD+UkiEGDAELID4gOpIhBgsCfwJAAkACQAJAIBZBAWsOAwECAwALQQEhECAVQaADagwDC0EDIRAgFUGoA2oMAgtBACEQIBVBnANqDAELQQIhECAVQaQDagshDiAVIBBBAnRqIAYgTCAOKgIAkpI4ApwDIAtBBGoiCyAXRw0ACwsgCQRAIAkQJwsgPCBIIDwgSF4bIDwgSCBIIEhcGyBIIEhbIDwgPFtxGyFIIEwgT0MAAAAAIBsbIEGSkiFMIBtBAWohGyANKAJQIgkgEXINAAsLAkAgCEUNACAfRQRAIAAQfEUNAQsgACAWIA8CfSBGIESSIBpFDQAaIAAgFkECdEH8JWooAgBBA3RqIgkqAvgDIQYCQAJAAkAgCS0A/ANBAWsOAgEAAgsgTSAGlEMK1yM8lCEGCyAGQwAAAABgRQ0AIAAgD0GBAiAWQQN0dkEBcSBNIEAQMQwBCyBGIEySCyBHIEAQJSEGQwAAAAAhPCAALwAVQQ9xIQkCQAJAAkACQAJAAkACQAJAAkAgBiBGkyBMkyIGQwAAAABgRQRAQwAAAAAhQyAJQQJrDgICAQcLQwAAAAAhQyAJQQJrDgcBAAUGBAIDBgsgPiAGkiE+DAULID4gBkMAAAA/lJIhPgwECyAGIBuzIjqVITwgPiAGIDogOpKVkiE+DAMLID4gBiAbQQFqs5UiPJIhPgwCCyAbQQJJBEAMAgsgDUGIAWogABAyIAYgG0EBa7OVITwMAgsgBiAbs5UhQwsgDUGIAWogABAyIBtFDQELIBZBAnQiCUHcJWohECAJQfwlaiERIA1BOGohGCANQcgAaiEZIA1B8ABqIRUgDUGQAWohHCANQYABaiEfQQAhEgNAIA1BADYCgAEgDSANKQOIATcDeCAfIA0oApABEDwgDUEANgJwIA0gDSkDeCJWNwNoIBUgDSgCgAEiCxA8IA0oAmwhCQJAAkAgDSgCaCIOBEBDAAAAACE6QwAAAAAhP0MAAAAAIQYMAQtDAAAAACE6QwAAAAAhP0MAAAAAIQYgCUUNAQsDQCAOKALsAyAOKALoAyIOa0ECdSAJTQ0FAkAgDiAJQQJ0aigCACIJLwAVIAktABdBEHRyIhdBgIAwcUGAgBBGIBdBgOAAcUGAwABGcg0AIAkoAtwDIBJHDQIgCUEUaiEOIAkgESgCAEECdGoqApQDIj1DAAAAAGAEfyA9IA4gFkEBIDsQIiAOIBZBASA7ECGSkiI9IAYgBiA9XRsgPSAGIAYgBlwbIAYgBlsgPSA9W3EbIQYgCS0AFgUgF0EIdgtBD3EiFwR/IBcFIAAtABVBBHYLQQVHDQAgFC0AAEEIcUUNACAJEE4gDkEAIA8gOxBBkiI9ID8gPSA/XhsgPSA/ID8gP1wbID8gP1sgPSA9W3EbIj8gCSoCmAMgDkEAQQEgOxAiIA5BAEEBIDsQIZKSID2TIj0gOiA6ID1dGyA9IDogOiA6XBsgOiA6WyA9ID1bcRsiOpIiPSAGIAYgPV0bID0gBiAGIAZcGyAGIAZbID0gPVtxGyEGCyANQQA2AkggDSANKQNoNwNAIBkgDSgCcBA8IA1B6ABqEC4gDSgCSCIJBEADQCAJKAIAIQ4gCRAnIA4iCQ0ACwsgDUEANgJIIA0oAmwiCSANKAJoIg5yDQALCyANIA0pA2g3A4gBIBwgDSgCcBB1IA0gVjcDaCAVIAsQdSA+IE9DAAAAACASG5IhPiBDIAaSIT0gDSgCbCEJAkAgDSgCaCIOIA0oAogBRgRAIAkgDSgCjAFGDQELID4gP5IhQiA+ID2SIUsgPCA9kiEGA0AgDigC7AMgDigC6AMiDmtBAnUgCU0NBQJAIA4gCUECdGooAgAiCS8AFSAJLQAXQRB0ciIXQYCAMHFBgIAQRiAXQYDgAHFBgMAARnINACAJQRRqIQ4CQAJAAkACQAJAAkAgF0EIdkEPcSIXBH8gFwUgAC0AFUEEdgtBAWsOBQEDAgQABgsgFC0AAEEIcQ0ECyAOIBYgDyA7EFEhOiAJIBAoAgBBAnRqID4gOpI4ApwDDAQLIA4gFiAPIDsQYiE/AkACQAJAAkAgFkECaw4CAgABCyAJKgKUAyE6QQIhDgwCC0EBIQ4gCSoCmAMhOgJAIBYOAgIADwtBAyEODAELIAkqApQDITpBACEOCyAJIA5BAnRqIEsgP5MgOpM4ApwDDAMLAkACQAJAAkAgFkECaw4CAgABCyAJKgKUAyE/QQIhDgwCC0EBIQ4gCSoCmAMhPwJAIBYOAgIADgtBAyEODAELIAkqApQDIT9BACEOCyAJIA5BAnRqID4gPSA/k0MAAAA/lJI4ApwDDAILIA4gFiAPIDsQQSE6IAkgECgCAEECdGogPiA6kjgCnAMgCSARKAIAQQN0aiIXKgL4AyE/AkACQAJAIBctAPwDQQFrDgIBAAILIEQgP5RDCtcjPJQhPwsgP0MAAAAAYA0CCwJAAkACfSATQQFNBEAgCSoCmAMgDiAWQQEgOxAiIA4gFkEBIDsQIZKSITogBgwBCyAGITogCSoClAMgDiATQQEgOxAiIA4gE0EBIDsQIZKSCyI/ID9cIAkqApQDIkEgQVxyRQRAID8gQZOLQxe30ThdDQEMAgsgPyA/WyBBIEFbcg0BCyAJKgKYAyJBIEFcIg4gOiA6XHJFBEAgOiBBk4tDF7fROF1FDQEMAwsgOiA6Ww0AIA4NAgsgCSA/IDogD0EAQQAgOyBFQQFBAyAKICIgDBA9GgwBCyAJIEIgCRBOkyAOQQAgDyBEEFGSOAKgAwsgDUEANgI4IA0gDSkDaDcDMCAYIA0oAnAQPCANQegAahAuIA0oAjgiCQRAA0AgCSgCACEOIAkQJyAOIgkNAAsLIA1BADYCOCANKAJsIQkgDSgCaCIOIA0oAogBRw0AIAkgDSgCjAFHDQALCyANKAJwIgkEQANAIAkoAgAhDiAJECcgDiIJDQALCyALBEADQCALKAIAIQkgCxAnIAkiCw0ACwsgPCA+kiA9kiE+IBJBAWoiEiAbRw0ACwsgDSgCkAEiCUUNAANAIAkoAgAhCyAJECcgCyIJDQALCyAAQZQDaiIQIABBAiAPIFAgQCBAECU4AgAgAEGYA2oiESAAQQAgDyBRIEcgQBAlOAIAAkAgEEGBAiATQQN0dkEBcUECdGoCfQJAIB5BAUcEQCAALQAXQQNxIglBAkYgHkECR3INAQsgACATIA8gSCBJIEAQJQwBCyAeQQJHIAlBAkdyDQEgSiAAIA8gEyBIIEkgQBB0Ij4gSiAHkiIGIAYgPl4bID4gBiAGIAZcGyAGIAZbID4gPltxGyIGIAYgSl0bIEogBiAGIAZcGyAGIAZbIEogSltxGws4AgALAkAgEEGBAiAWQQN0dkEBcUECdGoCfQJAIBpBAUcEQCAaQQJHIgkgAC0AF0EDcSILQQJGcg0BCyAAIBYgDyBGIEySIE0gQBAlDAELIAkgC0ECR3INASBGIAAgDyAWIEYgTJIgTSBAEHQiByBGIESSIgYgBiAHXhsgByAGIAYgBlwbIAYgBlsgByAHW3EbIgYgBiBGXRsgRiAGIAYgBlwbIAYgBlsgRiBGW3EbCzgCAAsCQCAIRQ0AAkAgAC8AFUGAgANxQYCAAkcNACANQYgBaiAAEDIDQCANKAKMASIJIA0oAogBIgtyRQRAIA0oApABIglFDQIDQCAJKAIAIQsgCRAnIAsiCQ0ACwwCCyALKALsAyALKALoAyILa0ECdSAJTQ0DIAsgCUECdGooAgAiCS8AFUGA4ABxQYDAAEcEQCAJAn8CQAJAAkAgFkECaw4CAAECCyAJQZQDaiEOIBAqAgAgCSoCnAOTIQZBAAwCCyAJQZQDaiEOIBAqAgAgCSoCpAOTIQZBAgwBCyARKgIAIQYCQAJAIBYOAgABCgsgCUGYA2ohDiAGIAkqAqADkyEGQQEMAQsgCUGYA2ohDiAGIAkqAqgDkyEGQQMLQQJ0aiAGIA4qAgCTOAKcAwsgDUGIAWoQLgwACwALAkAgEyAWckEBcUUNACAWQQFxIRQgE0EBcSEVIA1BiAFqIAAQMgNAIA0oAowBIgkgDSgCiAEiC3JFBEAgDSgCkAEiCUUNAgNAIAkoAgAhCyAJECcgCyIJDQALDAILIAsoAuwDIAsoAugDIgtrQQJ1IAlNDQMCQCALIAlBAnRqKAIAIgkvABUgCS0AF0EQdHIiC0GAgDBxQYCAEEYgC0GA4ABxQYDAAEZyDQAgFQRAAn8CfwJAAkACQCATQQFrDgMAAQINCyAJQZgDaiEOIAlBqANqIQtBASESIBEMAwsgCUGUA2ohDkECIRIgCUGcA2oMAQsgCUGUA2ohDkEAIRIgCUGkA2oLIQsgEAshGyAJIBJBAnRqIBsqAgAgDioCAJMgCyoCAJM4ApwDCyAURQ0AAn8CfwJAAkACQCAWQQFrDgMAAQIMCyAJQZgDaiELIAlBqANqIRJBASEXIBEMAwsgCUGUA2ohCyAJQZwDaiESQQIMAQsgCUGUA2ohCyAJQaQDaiESQQALIRcgEAshDiAJIBdBAnRqIA4qAgAgCyoCAJMgEioCAJM4ApwDCyANQYgBahAuDAALAAsgAC8AFUGA4ABxICJBAUZyRQRAIAAtAABBCHFFDQELIAAgACAeIAQgE0EBSxsgDyAKICIgDEMAAAAAQwAAAAAgOyBFEH4aCyANKAJYIglFDQIDQCAJKAIAIQsgCRAnIAsiCQ0ACwwCCxACAAsgABBeCyANQaABaiQADAELECQACyAAIAM6AKgBIAAgACgC9AMoAgw2AqQBIB0NACAKIAooAggiAyAAKAKsASIOQQFqIgkgAyAJSxs2AgggDkEIRgRAIABBADYCrAFBACEOCyAIBH8gAEHwAmoFIAAgDkEBajYCrAEgACAOQRhsakGwAWoLIgMgBTYCDCADIAQ2AgggAyACOAIEIAMgATgCACADIAAqApQDOAIQIAMgACoCmAM4AhRBACEdCyAIBEAgACAAKQKUAzcCjAMgACAALQAAIgNBAXIiBEH7AXEgBCADQQRxGzoAAAsgACAMNgKgASArIB1Fcgs1AQF/IAEgACgCBCICQQF1aiEBIAAoAgAhACABIAJBAXEEfyABKAIAIABqKAIABSAACxECAAt9ACAAQRRqIgAgAUGBAiACQQN0dkH/AXEgAyAEEC0gACACQQEgBBAiIAAgAkEBIAQQIZKSIQQCQAJAAkACQCAFKAIADgMAAQADCyAGKgIAIgMgAyAEIAMgBF0bIAQgBFwbIQQMAQsgBCAEXA0BIAVBAjYCAAsgBiAEOAIACwuMAQIBfwF9IAAoAuQDRQRAQwAAAAAPCyAAQfwAaiIBIAAvARwQICICIAJbBEAgASAALwEcECAPCwJAIAAoAvQDLQAIQQFxDQAgASAALwEYECAiAiACXA0AIAEgAC8BGBAgQwAAAABdRQ0AIAEgAC8BGBAgjA8LQwAAgD9DAAAAACAAKAL0Ay0ACEEBcRsLcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEChDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwtHAQF/IAIvAAYiA0EHcQRAIAAgAUHoAGogAxAfDwsgAUHoAGohASACLwAOIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHwtHAQF/IAIvAAIiA0EHcQRAIAAgAUHoAGogAxAfDwsgAUHoAGohASACLwAOIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHwt7AAJAAkACQAJAIANBAWsOAgABAgsgAi8ACiIDQQdxRQ0BDAILIAIvAAgiA0EHcUUNAAwBCyACLwAEIgNBB3EEQAwBCyABQegAaiEBIAIvAAwiA0EHcQRAIAAgASADEB8PCyAAIAEgAi8AEBAfDwsgACABQegAaiADEB8LewACQAJAAkACQCADQQFrDgIAAQILIAIvAAgiA0EHcUUNAQwCCyACLwAKIgNBB3FFDQAMAQsgAi8AACIDQQdxBEAMAQsgAUHoAGohASACLwAMIgNBB3EEQCAAIAEgAxAfDwsgACABIAIvABAQHw8LIAAgAUHoAGogAxAfC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQe4AaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAuFAQIDfwF+AkAgAEKAgICAEFQEQCAAIQUMAQsDQCABQQFrIgEgAEIKgCIFQvYBfiAAfKdBMHI6AAAgAEL/////nwFWIQIgBSEAIAINAAsLIAWnIgIEQANAIAFBAWsiASACQQpuIgNB9gFsIAJqQTByOgAAIAJBCUshBCADIQIgBA0ACwsgAQs3AQJ/QQQQHiICIAE2AgBBBBAeIgMgATYCAEHBOyAAQeI7QfooQb8BIAJB4jtB/ihBwAEgAxAHCw8AIAAgASACQQFBAhCLAQteAQF/IABBADYCDCAAIAM2AhACQCABBEAgAUGAgICABE8NASABQQJ0EB4hBAsgACAENgIAIAAgBCACQQJ0aiICNgIIIAAgBCABQQJ0ajYCDCAAIAI2AgQgAA8LEFgAC3kCAX8BfSMAQRBrIgMkACADQQhqIAAgAUECdEHcJWooAgAgAhBTQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIQwAAAACUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsLnAoBC38jAEEQayIIJAAgASABLwAAQXhxIANyIgM7AAACQAJAAkACQAJAAkACQAJAAkACQCADQQhxBEAgA0H//wNxIgZBBHYhBCAGQT9NBH8gACAEQQJ0akEEagUgBEEEayIEIAAoAhgiACgCBCAAKAIAIgBrQQJ1Tw0CIAAgBEECdGoLIAI4AgAMCgsCfyACi0MAAABPXQRAIAKoDAELQYCAgIB4CyIEQf8PakH+H0sgBLIgAlxyRQRAIANBD3FBACAEa0GAEHIgBCACQwAAAABdG0EEdHIhAwwKCyAAIAAvAQAiC0EBajsBACALQYAgTw0DIAtBA00EQCAAIAtBAnRqIAI4AgQMCQsgACgCGCIDRQRAQRgQHiIDQgA3AgAgA0IANwIQIANCADcCCCAAIAM2AhgLAkAgAygCBCIEIAMoAghHBEAgBCACOAIAIAMgBEEEajYCBAwBCyAEIAMoAgAiB2siBEECdSIJQQFqIgZBgICAgARPDQECf0H/////AyAEQQF1IgUgBiAFIAZLGyAEQfz///8HTxsiBkUEQEEAIQUgCQwBCyAGQYCAgIAETw0GIAZBAnQQHiEFIAMoAgQgAygCACIHayIEQQJ1CyEKIAUgCUECdGoiCSACOAIAIAkgCkECdGsgByAEEDMhByADIAUgBkECdGo2AgggAyAJQQRqNgIEIAMoAgAhBCADIAc2AgAgBEUNACAEECMLIAAoAhgiBigCECIDIAYoAhQiAEEFdEcNByADQQFqQQBIDQAgA0H+////A0sNASADIABBBnQiACADQWBxQSBqIgQgACAESxsiAE8NByAAQQBODQILEAIAC0H/////ByEAIANB/////wdPDQULIAhBADYCCCAIQgA3AwAgCCAAEJ8BIAYoAgwhBCAIIAgoAgQiByAGKAIQIgBBH3FqIABBYHFqIgM2AgQgB0UEQCADQQFrIQUMAwsgA0EBayIFIAdBAWtzQR9LDQIgCCgCACEKDAMLQZUlQeEXQSJB3BcQCwALEFgACyAIKAIAIgogBUEFdkEAIANBIU8bQQJ0akEANgIACyAKIAdBA3ZB/P///wFxaiEDAkAgB0EfcSIHRQRAIABBAEwNASAAQSBtIQUgAEEfakE/TwRAIAMgBCAFQQJ0EDMaCyAAIAVBBXRrIgBBAEwNASADIAVBAnQiBWoiAyADKAIAQX9BICAAa3YiAEF/c3EgBCAFaigCACAAcXI2AgAMAQsgAEEATA0AQX8gB3QhDEEgIAdrIQkgAEEgTgRAIAxBf3MhDSADKAIAIQUDQCADIAUgDXEgBCgCACIFIAd0cjYCACADIAMoAgQgDHEgBSAJdnIiBTYCBCAEQQRqIQQgA0EEaiEDIABBP0shDiAAQSBrIQAgDg0ACyAAQQBMDQELIAMgAygCAEF/IAkgCSAAIAAgCUobIgVrdiAMcUF/c3EgBCgCAEF/QSAgAGt2cSIEIAd0cjYCACAAIAVrIgBBAEwNACADIAUgB2pBA3ZB/P///wFxaiIDIAMoAgBBf0EgIABrdkF/c3EgBCAFdnI2AgALIAYoAgwhACAGIAo2AgwgBiAIKAIEIgM2AhAgBiAIKAIINgIUIABFDQAgABAjIAYoAhAhAwsgBiADQQFqNgIQIAYoAgwgA0EDdkH8////AXFqIgAgACgCAEF+IAN3cTYCACABLwAAIQMLIANBB3EgC0EEdHJBCHIhAwsgASADOwAAIAhBEGokAAuPAQIBfwF9IwBBEGsiAyQAIANBCGogAEHoAGogAEHUAEHWACABQf4BcUECRhtqLwEAIgEgAC8BWCABQQdxGxAfQwAAwH8hBAJAAkACQCADLQAMQQFrDgIAAQILIAMqAgghBAwBCyADKgIIIAKUQwrXIzyUIQQLIANBEGokACAEQwAAAACXQwAAAAAgBCAEWxsL2AICBH8BfSMAQSBrIgMkAAJAIAAoAgwiAQRAIAAgACoClAMgACoCmAMgAREnACIFIAVbDQEgA0GqHjYCACAAQQVB2CUgAxAsECQACyADQRBqIAAQMgJAIAMoAhAiAiADKAIUIgFyRQ0AAkADQCABIAIoAuwDIAIoAugDIgJrQQJ1SQRAIAIgAUECdGooAgAiASgC3AMNAyABLwAVIAEtABdBEHRyIgJBgOAAcUGAwABHBEAgAkEIdkEPcSICBH8gAgUgAC0AFUEEdgtBBUYEQCAALQAUQQhxDQQLIAEtAABBAnENAyAEIAEgBBshBAsgA0EQahAuIAMoAhQiASADKAIQIgJyDQEMAwsLEAIACyABIQQLIAMoAhgiAQRAA0AgASgCACECIAEQIyACIgENAAsLIARFBEAgACoCmAMhBQwBCyAEEE4gBCoCoAOSIQULIANBIGokACAFC6EDAQh/AkAgACgC6AMiBSAAKALsAyIHRwRAA0AgACAFKAIAIgIoAuQDRwRAAkAgACgC9AMoAgAiAQRAIAIgACAGIAERBgAiAQ0BC0GIBBAeIgEgAigCEDYCECABIAIpAgg3AgggASACKQIANwIAIAFBFGogAkEUakHoABArGiABQgA3AoABIAFB/ABqIgNBADsBACABQgA3AogBIAFCADcCkAEgAyACQfwAahCgASABQZgBaiACQZgBakHQAhArGiABQQA2AvADIAFCADcC6AMgAigC7AMiAyACKALoAyIERwRAIAMgBGsiBEEASA0FIAEgBBAeIgM2AuwDIAEgAzYC6AMgASADIARqNgLwAyACKALoAyIEIAIoAuwDIghHBEADQCADIAQoAgA2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASADNgLsAwsgASACKQL0AzcC9AMgASACKAKEBDYChAQgASACKQL8AzcC/AMgAUEANgLkAwsgBSABNgIAIAEgADYC5AMLIAZBAWohBiAFQQRqIgUgB0cNAAsLDwsQAgALUAACQAJAAkACQAJAIAIOBAQAAQIDCyAAIAEgAUEwahBDDwsgACABIAFBMGogAxBEDwsgACABIAFBMGoQQg8LECQACyAAIAEgAUEwaiADEEULcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt5AgF/AX0jAEEQayIDJAAgA0EIaiAAIAFBAnRB7CVqKAIAIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC1QAAkACQAJAAkACQCACDgQEAAECAwsgACABIAFBwgBqEEMPCyAAIAEgAUHCAGogAxBEDwsgACABIAFBwgBqEEIPCxAkAAsgACABIAFBwgBqIAMQRQsvACAAIAJFQQF0IgIgASADEGAgACACIAEQS5IgACACIAEgAxB/IAAgAiABEFKSkgvOAQIDfwJ9IwBBEGsiAyQAQQEhBCADQQhqIABB/ABqIgUgACABQQF0akH2AGoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALzgECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpB8gBqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQACwoAIABBMGtBCkkLBQAQAgALBAAgAAsUACAABEAgACAAKAIAKAIEEQAACwsrAQF/IAAoAgwiAQRAIAEQIwsgACgCACIBBEAgACABNgIEIAEQIwsgABAjC4EEAQN/IwBBEGsiAyQAIABCADcCBCAAQcEgOwAVIABCADcCDCAAQoCAgICAgIACNwIYIAAgAC0AF0HgAXE6ABcgACAALQAAQeABcUEFcjoAACAAIAAtABRBgAFxOgAUIABBIGpBAEHOABAqGiAAQgA3AXIgAEGEgBA2AW4gAEEANgF6IABCADcCgAEgAEIANwKIASAAQgA3ApABIABCADcCoAEgAEKAgICAgICA4P8ANwKYASAAQQA6AKgBIABBrAFqQQBBxAEQKhogAEHwAmohBCAAQbABaiECA0AgAkKAgID8i4CAwL9/NwIQIAJCgYCAgBA3AgggAkKAgID8i4CAwL9/NwIAIAJBGGoiAiAERw0ACyAAQoCAgPyLgIDAv383AvACIABCgICA/IuAgMC/fzcCgAMgAEKBgICAEDcC+AIgAEKAgID+h4CA4P8ANwKUAyAAQoCAgP6HgIDg/wA3AowDIABBiANqIgIgAi0AAEH4AXE6AAAgAEGcA2pBAEHYABAqGiAAQQA6AIQEIABBgICA/gc2AoAEIABBADoA/AMgAEGAgID+BzYC+AMgACABNgL0AyABBEAgAS0ACEEBcQRAIAAgAC0AFEHzAXFBCHI6ABQgACAALwAVQfD/A3FBBHI7ABULIANBEGokACAADwsgA0GiGjYCACADEHIQJAALMwAgACABQQJ0QfwlaigCAEECdGoqApQDIABBFGoiACABQQEgAhAiIAAgAUEBIAIQIZKSC44DAQp/IwBB0AJrIgEkACAAKALoAyIDIAAoAuwDIgVHBEAgAUGMAmohBiABQeABaiEHIAFBIGohCCABQRxqIQkgAUEQaiEEA0AgAygCACICLQAXQRB0QYCAMHFBgIAgRgRAIAFBCGpBAEHEAhAqGiABQYCAgP4HNgIMIARBADoACCAEQgA3AgAgCUEAQcQBECoaIAghAANAIABCgICA/IuAgMC/fzcCECAAQoGAgIAQNwIIIABCgICA/IuAgMC/fzcCACAAQRhqIgAgB0cNAAsgAUKAgID8i4CAwL9/NwPwASABQoGAgIAQNwPoASABQoCAgPyLgIDAv383A+ABIAFCgICA/oeAgOD/ADcChAIgAUKAgID+h4CA4P8ANwL8ASABIAEtAPgBQfgBcToA+AEgBkEAQcAAECoaIAJBmAFqIAFBCGpBxAIQKxogAkIANwKMAyACIAItAAAiAEEBciIKQfsBcSAKIABBBHEbOgAAIAIQTyACEF4LIANBBGoiAyAFRw0ACwsgAUHQAmokAAtMAQF/QQEhAQJAIAAtAB5BB3ENACAALQAiQQdxDQAgAC0ALkEHcQ0AIAAtACpBB3ENACAALQAmQQdxDQAgAC0AKEEHcUEARyEBCyABC3YCAX8BfSMAQRBrIgQkACAEQQhqIAAgAUECdEHcJWooAgAgAhBQQwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAACXQwAAAAAgBSAFWxsLogQCBn8CfgJ/QQghBAJAAkAgAEFHSw0AA0BBCCAEIARBCE0bIQRB6DopAwAiBwJ/QQggAEEDakF8cSAAQQhNGyIAQf8ATQRAIABBA3ZBAWsMAQsgAEEdIABnIgFrdkEEcyABQQJ0a0HuAGogAEH/H00NABpBPyAAQR4gAWt2QQJzIAFBAXRrQccAaiIBIAFBP08bCyIDrYgiCFBFBEADQCAIIAh6IgiIIQcCfiADIAinaiIDQQR0IgJB6DJqKAIAIgEgAkHgMmoiBkcEQCABIAQgABBjIgUNBSABKAIEIgUgASgCCDYCCCABKAIIIAU2AgQgASAGNgIIIAEgAkHkMmoiAigCADYCBCACIAE2AgAgASgCBCABNgIIIANBAWohAyAHQgGIDAELQeg6Qeg6KQMAQn4gA62JgzcDACAHQgGFCyIIQgBSDQALQeg6KQMAIQcLAkAgB1BFBEBBPyAHeadrIgZBBHQiAkHoMmooAgAhAQJAIAdCgICAgARUDQBB4wAhAyABIAJB4DJqIgJGDQADQCADRQ0BIAEgBCAAEGMiBQ0FIANBAWshAyABKAIIIgEgAkcNAAsgAiEBCyAAQTBqEGQNASABRQ0EIAEgBkEEdEHgMmoiAkYNBANAIAEgBCAAEGMiBQ0EIAEoAggiASACRw0ACwwECyAAQTBqEGRFDQMLQQAhBSAEIARBAWtxDQEgAEFHTQ0ACwsgBQwBC0EACwtwAgF/AX0jAEEQayIEJAAgBEEIaiAAIAFBAnRB7CVqKAIAIAIQKEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAIAUgBVsbC6ADAQN/IAEgAEEEaiIEakEBa0EAIAFrcSIFIAJqIAAgACgCACIBakEEa00EfyAAKAIEIgMgACgCCDYCCCAAKAIIIAM2AgQgBCAFRwRAIAAgAEEEaygCAEF+cWsiAyAFIARrIgQgAygCAGoiBTYCACAFQXxxIANqQQRrIAU2AgAgACAEaiIAIAEgBGsiATYCAAsCQCABIAJBGGpPBEAgACACakEIaiIDIAEgAmtBCGsiATYCACABQXxxIANqQQRrIAFBAXI2AgAgAwJ/IAMoAgBBCGsiAUH/AE0EQCABQQN2QQFrDAELIAFnIQQgAUEdIARrdkEEcyAEQQJ0a0HuAGogAUH/H00NABpBPyABQR4gBGt2QQJzIARBAXRrQccAaiIBIAFBP08bCyIBQQR0IgRB4DJqNgIEIAMgBEHoMmoiBCgCADYCCCAEIAM2AgAgAygCCCADNgIEQeg6Qeg6KQMAQgEgAa2GhDcDACAAIAJBCGoiATYCACABQXxxIABqQQRrIAE2AgAMAQsgACABakEEayABNgIACyAAQQRqBSADCwvmAwEFfwJ/QbAwKAIAIgEgAEEHakF4cSIDaiECAkAgA0EAIAEgAk8bDQAgAj8AQRB0SwRAIAIQFkUNAQtBsDAgAjYCACABDAELQfw7QTA2AgBBfwsiAkF/RwRAIAAgAmoiA0EQayIBQRA2AgwgAUEQNgIAAkACf0HgOigCACIABH8gACgCCAVBAAsgAkYEQCACIAJBBGsoAgBBfnFrIgRBBGsoAgAhBSAAIAM2AghBcCAEIAVBfnFrIgAgACgCAGpBBGstAABBAXFFDQEaIAAoAgQiAyAAKAIINgIIIAAoAgggAzYCBCAAIAEgAGsiATYCAAwCCyACQRA2AgwgAkEQNgIAIAIgAzYCCCACIAA2AgRB4DogAjYCAEEQCyACaiIAIAEgAGsiATYCAAsgAUF8cSAAakEEayABQQFyNgIAIAACfyAAKAIAQQhrIgFB/wBNBEAgAUEDdkEBawwBCyABQR0gAWciA2t2QQRzIANBAnRrQe4AaiABQf8fTQ0AGkE/IAFBHiADa3ZBAnMgA0EBdGtBxwBqIgEgAUE/TxsLIgFBBHQiA0HgMmo2AgQgACADQegyaiIDKAIANgIIIAMgADYCACAAKAIIIAA2AgRB6DpB6DopAwBCASABrYaENwMACyACQX9HC80BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQSBqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQAC0ABAX8CQEGsOy0AAEEBcQRAQag7KAIAIQIMAQtBAUGAJxAMIQJBrDtBAToAAEGoOyACNgIACyACIAAgAUEAEBMLzQECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBMmoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALDwAgASAAKAIAaiACOQMACw0AIAEgACgCAGorAwALCwAgAARAIAAQIwsLxwECBH8CfSMAQRBrIgIkACACQQhqIABB/ABqIgQgAEEeaiIFLwEAEB9BASEDAkACQCACKgIIIgcgASoCACIGXARAIAcgB1sEQCABLQAEIQEMAgsgBiAGXCEDCyABLQAEIQEgA0UNACACLQAMIAFB/wFxRg0BCyAEIAUgBiABEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyACQRBqJAALlgMCA34CfyAAvSICQjSIp0H/D3EiBEH/D0YEQCAARAAAAAAAAPA/oiIAIACjDwsgAkIBhiIBQoCAgICAgIDw/wBYBEAgAEQAAAAAAAAAAKIgACABQoCAgICAgIDw/wBRGw8LAn4gBEUEQEEAIQQgAkIMhiIBQgBZBEADQCAEQQFrIQQgAUIBhiIBQgBZDQALCyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgAUIBhiEBIARBAWsiBEH/B0oNAAtB/wchBAsCQCABQoCAgICAgIAIfSIDQgBTDQAgAyIBQgBSDQAgAEQAAAAAAAAAAKIPCyABQv////////8HWARAA0AgBEEBayEEIAFCgICAgICAgARUIQUgAUIBhiEBIAUNAAsLIAJCgICAgICAgICAf4MgAUKAgICAgICACH0gBK1CNIaEIAFBASAEa62IIARBAEobhL8LiwEBA38DQCAAQQR0IgFB5DJqIAFB4DJqIgI2AgAgAUHoMmogAjYCACAAQQFqIgBBwABHDQALQTAQZBpBmDtBBjYCAEGcO0EANgIAEJwBQZw7Qcg7KAIANgIAQcg7QZg7NgIAQcw7QcMBNgIAQdA7QQA2AgAQjwFB0DtByDsoAgA2AgBByDtBzDs2AgALjwEBAn8jAEEQayIEJAACfUMAAAAAIAAvABVBgOAAcUUNABogBEEIaiAAQRRqIgBBASACQQJGQQF0IAFB/gFxQQJHGyIFIAIQNgJAIAQtAAxFDQAgBEEIaiAAIAUgAhA2IAQtAAxBA0YNACAAIAEgAiADEIEBDAELIAAgASACIAMQgAGMCyEDIARBEGokACADC4QBAQJ/AkACQCAAKALoAyICIAAoAuwDIgNGDQADQCACKAIAIAFGDQEgAkEEaiICIANHDQALDAELIAIgA0YNACABLQAXQRB0QYCAMHFBgIAgRgRAIAAgACgC4ANBAWs2AuADCyACIAJBBGoiASADIAFrEDMaIAAgA0EEazYC7ANBAQ8LQQALCwBByDEgACABEEkLPAAgAEUEQCACQQVHQQAgAhtFBEBBuDAgAyAEEEkaDwsgAyAEEHAaDwsgACABIAIgAyAEIAAoAgQRDQAaCyYBAX8jAEEQayIBJAAgASAANgIMQbgwQdglIAAQSRogAUEQaiQAC4cDAwN/BXwCfSAAKgKgA7siBiACoCECIAAqApwDuyIHIAGgIQggACgC9AMqAhgiC0MAAAAAXARAIAAqApADuyEJIAAqAowDIQwgACAHIAu7IgFBACAALQAAQRBxIgNBBHYiBBA0OAKcAyAAIAYgAUEAIAQQNDgCoAMgASAMuyIHohBsIgYgBmIiBEUgBplELUMc6+I2Gj9jcUUEQCAEIAZEAAAAAAAA8L+gmUQtQxzr4jYaP2NFciEFCyACIAmgIQogCCAHoCEHAn8gASAJohBsIgYgBmIiBEUEQEEAIAaZRC1DHOviNho/Yw0BGgsgBCAGRAAAAAAAAPC/oJlELUMc6+I2Gj9jRXILIQQgACAHIAEgA0EARyIDIAVxIAMgBUEBc3EQNCAIIAFBACADEDSTOAKMAyAAIAogASADIARxIAMgBEEBc3EQNCACIAFBACADEDSTOAKQAwsgACgC6AMiAyAAKALsAyIARwRAA0AgAygCACAIIAIQcyADQQRqIgMgAEcNAAsLC1UBAX0gAEEUaiIAIAEgAkECSSICIAQgBRA1IQYgACABIAIgBCAFEC0iBUMAAAAAYCADIAVecQR9IAUFIAZDAAAAAGBFBEAgAw8LIAYgAyADIAZdGwsLeAEBfwJAIAAoAgAiAgRAA0AgAUUNAiACIAEoAgQ2AgQgAiABKAIINgIIIAEoAgAhASAAKAIAIQAgAigCACICDQALCyAAIAEQPA8LAkAgAEUNACAAKAIAIgFFDQAgAEEANgIAA0AgASgCACEAIAEQIyAAIgENAAsLC5kCAgZ/AX0gAEEUaiEHQQMhBCAALQAUQQJ2QQNxIQUCQAJ/AkAgAUEBIAAoAuQDGyIIQQJGBEACQCAFQQJrDgIEAAILQQIhBAwDC0ECIQRBACAFQQFLDQEaCyAECyEGIAUhBAsgACAEIAggAyACIARBAkkiBRsQbiEKIAAgBiAIIAIgAyAFGxBuIQMgAEGcA2oiAEEBIAFBAkZBAXQiCCAFG0ECdGogCiAHIAQgASACECKSOAIAIABBAyABQQJHQQF0IgkgBRtBAnRqIAogByAEIAEgAhAhkjgCACAAIAhBASAGQQF2IgQbQQJ0aiADIAcgBiABIAIQIpI4AgAgACAJQQMgBBtBAnRqIAMgByAGIAEgAhAhkjgCAAvUAgEDfyMAQdACayIBJAAgAUEIakEAQcQCECoaIAFBADoAGCABQgA3AxAgAUGAgID+BzYCDCABQRxqQQBBxAEQKhogAUHgAWohAyABQSBqIQIDQCACQoCAgPyLgIDAv383AhAgAkKBgICAEDcCCCACQoCAgPyLgIDAv383AgAgAkEYaiICIANHDQALIAFCgICA/IuAgMC/fzcD8AEgAUKBgICAEDcD6AEgAUKAgID8i4CAwL9/NwPgASABQoCAgP6HgIDg/wA3AoQCIAFCgICA/oeAgOD/ADcC/AEgASABLQD4AUH4AXE6APgBIAFBjAJqQQBBwAAQKhogAEGYAWogAUEIakHEAhArGiAAQgA3AowDIAAgAC0AAEEBcjoAACAAEE8gACgC6AMiAiAAKALsAyIARwRAA0AgAigCABB3IAJBBGoiAiAARw0ACwsgAUHQAmokAAuuAgIKfwJ9IwBBIGsiASQAIAFBgAI7AB4gAEHuAGohByAAQfgDaiEFIABB8gBqIQggAEH2AGohCSAAQfwAaiEDQQAhAANAIAFBEGogAyAJIAFBHmogBGotAAAiAkEBdCIEaiIGLwEAEB8CQAJAIAEtABRFDQAgAUEIaiADIAYvAQAQHyABIAMgBCAIai8BABAfIAEtAAwgAS0ABEcNAAJAIAEqAggiDCAMXCIKIAEqAgAiCyALXHJFBEAgDCALk4tDF7fROF0NAQwCCyAKRSALIAtbcg0BCyABQRBqIAMgBi8BABAfDAELIAFBEGogAyAEIAdqLwEAEB8LIAUgAkEDdGoiAiABLQAUOgAEIAIgASgCEDYCAEEBIQQgACECQQEhACACRQ0ACyABQSBqJAALMgACf0EAIAAvABVBgOAAcUGAwABGDQAaQQEgABA7QwAAAABcDQAaIAAQQEMAAAAAXAsLewEBfSADIASTIgMgA1sEfUMAAAAAIABBFGoiACABIAIgBSAGEDUiByAEkyAHIAdcGyIHQ///f38gACABIAIgBSAGEC0iBSAEkyAFIAVcGyIEIAMgAyAEXhsiAyADIAddGyAHIAMgAyADXBsgAyADWyAHIAdbcRsFIAMLC98FAwR/BX0BfCAJQwAAAABdIAhDAAAAAF1yBH8gDQUgBSESIAEhEyADIRQgByERIAwqAhgiFUMAAAAAXARAIAG7IBW7IhZBAEEAEDQhEyADuyAWQQBBABA0IRQgBbsgFkEAQQAQNCESIAe7IBZBAEEAEDQhEQsCf0EAIAAgBEcNABogEiATk4tDF7fROF0gEyATXCINIBIgElxyRQ0AGkEAIBIgElsNABogDQshDAJAIAIgBkcNACAUIBRcIg0gESARXHJFBEAgESAUk4tDF7fROF0hDwwBCyARIBFbDQAgDSEPC0EBIQ5BASENAkAgDA0AIAEgCpMhAQJAIABFBEAgASABXCIAIAggCFxyRQRAQQAhDCABIAiTi0MXt9E4XUUNAgwDC0EAIQwgCCAIWw0BIAANAgwBCyAAQQJGIQwgAEECRw0AIARBAUcNACABIAhgDQECQCAIIAhcIgAgASABXHJFBEAgASAIk4tDF7fROF1FDQEMAwtBACENIAEgAVsNAkEBIQ0gAA0CC0EAIQ0MAQtBACENIAggCFwiACABIAVdRXINACAMRSABIAFcIhAgBSAFXHIgBEECR3JyDQBBASENIAEgCGANAEEAIQ0gACAQcg0AIAEgCJOLQxe30ThdIQ0LAkAgDw0AIAMgC5MhAQJAAkAgAkUEQCABIAFcIgIgCSAJXHJFBEBBACEAIAEgCZOLQxe30ThdRQ0CDAQLQQAhACAJIAlbDQEgAg0DDAELIAJBAkYhACACQQJHIAZBAUdyDQAgASAJYARADAMLIAkgCVwiACABIAFcckUEQCABIAmTi0MXt9E4XUUNAgwDC0EAIQ4gASABWw0CQQEhDiAADQIMAQsgCSAJXCICIAEgB11Fcg0AIABFIAEgAVwiBCAHIAdcciAGQQJHcnINACABIAlgDQFBACEOIAIgBHINASABIAmTi0MXt9E4XSEODAELQQAhDgsgDSAOcQsL4wEBA38jAEEQayIBJAACQAJAIAAtABRBCHFFDQBBASEDIAAvABVB8AFxQdAARg0AIAEgABAyIAEoAgQhAAJAIAEoAgAiAkUEQEEAIQMgAEUNAQsDQCACKALsAyACKALoAyICa0ECdSAATQ0DIAIgAEECdGooAgAiAC8AFSAALQAXQRB0ciIAQYDgAHFBgMAARyAAQYAecUGACkZxIgMNASABEC4gASgCBCIAIAEoAgAiAnINAAsLIAEoAggiAEUNAANAIAAoAgAhAiAAECMgAiIADQALCyABQRBqJAAgAw8LEAIAC7IBAQR/AkACQCAAKAIEIgMgACgCACIEKALsAyAEKALoAyIBa0ECdUkEQCABIANBAnRqIQIDQCACKAIAIgEtABdBEHRBgIAwcUGAgCBHDQMgASgC7AMgASgC6ANGDQJBDBAeIgIgBDYCBCACIAM2AgggAiAAKAIINgIAQQAhAyAAQQA2AgQgACABNgIAIAAgAjYCCCABIQQgASgC6AMiAiABKALsA0cNAAsLEAIACyAAEC4LC4wQAgx/B30jAEEgayINJAAgDUEIaiABEDIgDSgCCCIOIA0oAgwiDHIEQCADQQEgAxshFSAAQRRqIRQgBUEBaiEWA0ACQAJAAn8CQAJAAkACQAJAIAwgDigC7AMgDigC6AMiDmtBAnVJBEAgDiAMQQJ0aigCACILLwAVIAstABdBEHRyIgxBgIAwcUGAgBBGDQgCQAJAIAxBDHZBA3EOAwEKAAoLIAkhFyAKIRogASgC9AMtABRBBHFFBEAgACoClAMgFEECQQEQMCAUQQJBARAvkpMhFyAAKgKYAyAUQQBBARAwIBRBAEEBEC+SkyEaCyALQRRqIQ8gAS0AFEECdkEDcSEQAkACfwJAIANBAkciE0UEQEEAIQ5BAyEMAkAgEEECaw4CBAACC0ECIQwMAwtBAiEMQQAgEEEBSw0BGgsgDAshDiAQIQwLIA9BAkEBIBcQIiAPQQJBASAXECGSIR0gD0EAQQEgFxAiIRwgD0EAQQEgFxAhIRsgCyoC+AMhGAJAAkACQAJAIAstAPwDQQFrDgIBAAILIBggF5RDCtcjPJQhGAsgGEMAAAAAYEUNACAdIAsgA0EAIBcgFxAxkiEYDAELIA1BGGogDyALQTJqIhAgAxBFQwAAwH8hGCANLQAcRQ0AIA1BGGogDyAQIAMQRCANLQAcRQ0AIA1BGGogDyAQIAMQRSANLQAcQQNGDQAgDUEYaiAPIBAgAxBEIA0tABxBA0YNACALQQIgAyAAKgKUAyAUQQIgAxBLIBRBAiADEFKSkyAPQQIgAyAXEFEgD0ECIAMgFxCDAZKTIBcgFxAlIRgLIBwgG5IhHCALKgKABCEZAkACQAJAIAstAIQEQQFrDgIBAAILIBkgGpRDCtcjPJQhGQsgGUMAAAAAYEUNACAcIAsgA0EBIBogFxAxkiEZDAMLIA1BGGogDyALQTJqIhAQQwJAIA0tABxFDQAgDUEYaiAPIBAQQiANLQAcRQ0AIA1BGGogDyAQEEMgDS0AHEEDRg0AIA1BGGogDyAQEEIgDS0AHEEDRg0AIAtBACADIAAqApgDIBRBACADEEsgFEEAIAMQUpKTIA9BACADIBoQUSAPQQAgAyAaEIMBkpMgGiAXECUhGQwDC0MAAMB/IRkgGCAYXA0GIAtB/ABqIhAgC0H6AGoiEi8BABAgIhsgG1sNAwwFCyALLQAAQQhxDQggCxBPIAAgCyACIAstABRBA3EiDCAVIAwbIAQgFiAGIAsqApwDIAeSIAsqAqADIAiSIAkgChB+IBFyIQxBACERIAxBAXFFDQhBASERIAsgCy0AAEEBcjoAAAwICxACAAsgGCAYXCAZIBlcRg0BIAtB/ABqIhAgC0H6AGoiEi8BABAgIhsgG1wNASAYIBhcBEAgGSAckyAQIAsvAXoQIJQgHZIhGAwCCyAZIBlbDQELIBwgGCAdkyAQIBIvAQAQIJWSIRkLIBggGFwNASAZIBlbDQMLQQAMAQtBAQshEiALIBcgGCACQQFHIAxBAklxIBdDAAAAAF5xIBJxIhAbIBkgA0ECIBIgEBsgGSAZXCAXIBpBAEEGIAQgBSAGED0aIAsqApQDIA9BAkEBIBcQIiAPQQJBASAXECGSkiEYIAsqApgDIA9BAEEBIBcQIiAPQQBBASAXECGSkiEZC0EBIRAgCyAYIBkgA0EAQQAgFyAaQQFBASAEIAUgBhA9GiAAIAEgCyADIAxBASAXIBoQggEgACABIAsgAyAOQQAgFyAaEIIBIBFBAXFFBEAgCy0AAEEBcSEQCyABLQAUIhJBAnZBA3EhDAJAAn8CQAJAAkACQAJAAkACQAJAAkACfwJAIBNFBEBBACERQQMhDiAMQQJrDgIDDQELQQIhDkEAIAxBAUsNARoLIA4LIREgEkEEcUUNBCASQQhxRQ0BIAwhDgsgASEMIA8QXw0BDAILAkAgCy0ANEEHcQ0AIAstADhBB3ENACALLQBCQQdxDQAgDCEOIAEhDCALQUBrLwEAQQdxRQ0CDAELIAwhDgsgACEMCwJ/AkACQAJAIA5BAWsOAwABAgULIAtBmANqIQ4gC0GoA2ohE0EBIRIgDEGYA2oMAgsgC0GUA2ohDiALQZwDaiETQQIhEiAMQZQDagwBCyALQZQDaiEOIAtBpANqIRNBACESIAxBlANqCyEMIAsgEkECdGogDCoCACAOKgIAkyATKgIAkzgCnAMLIBFBAXFFDQUCQAJAIBFBAnEEQCABIQwgDxBfDQEMAgsgCy0ANEEHcQ0AIAstADhBB3ENACALLQBCQQdxDQAgASEMIAtBQGsvAQBBB3FFDQELIAAhDAsgEUEBaw4DAQIDAAsQJAALIAtBmANqIREgC0GoA2ohDkEBIRMgDEGYA2oMAgsgC0GUA2ohESALQZwDaiEOQQIhEyAMQZQDagwBCyALQZQDaiERIAtBpANqIQ5BACETIAxBlANqCyEMIAsgE0ECdGogDCoCACARKgIAkyAOKgIAkzgCnAMLIAsqAqADIRsgCyoCnAMgB0MAAAAAIA8QXxuTIRcCfQJAIAstADRBB3ENACALLQA4QQdxDQAgCy0AQkEHcQ0AIAtBQGsvAQBBB3ENAEMAAAAADAELIAgLIRogCyAXOAKcAyALIBsgGpM4AqADIBAhEQsgDUEIahAuIA0oAgwiDCANKAIIIg5yDQALCyANKAIQIgwEQANAIAwoAgAhACAMECMgACIMDQALCyANQSBqJAAgEUEBcQt2AgF/AX0jAEEQayIEJAAgBEEIaiAAIAFBAnRB7CVqKAIAIAIQUEMAAMB/IQUCQAJAAkAgBC0ADEEBaw4CAAECCyAEKgIIIQUMAQsgBCoCCCADlEMK1yM8lCEFCyAEQRBqJAAgBUMAAAAAl0MAAAAAIAUgBVsbC3gCAX8BfSMAQRBrIgQkACAEQQhqIABBAyACQQJHQQF0IAFB/gFxQQJHGyACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt4AgF/AX0jAEEQayIEJAAgBEEIaiAAQQEgAkECRkEBdCABQf4BcUECRxsgAhA2QwAAwH8hBQJAAkACQCAELQAMQQFrDgIAAQILIAQqAgghBQwBCyAEKgIIIAOUQwrXIzyUIQULIARBEGokACAFQwAAAAAgBSAFWxsLoA0BBH8jAEEQayIJJAAgCUEIaiACQRRqIgggA0ECRkEBdEEBIARB/gFxQQJGIgobIgsgAxA2IAYgByAKGyEHAkACQAJAAkACQAJAIAktAAxFDQAgCUEIaiAIIAsgAxA2IAktAAxBA0YNACAIIAQgAyAHEIEBIABBFGogBCADEDCSIAggBCADIAcQIpIhBkEBIQMCQAJ/AkACQAJAAkAgBA4EAgMBAAcLQQIhAwwBC0EAIQMLIAMgC0YNAgJAAkAgBA4EAgIAAQYLIABBlANqIQNBAAwCCyAAQZQDaiEDQQAMAQsgAEGYA2ohA0EBCyEAIAMqAgAgAiAAQQJ0aioClAOTIAaTIQYLIAIgBEECdEHcJWooAgBBAnRqIAY4ApwDDAULIAlBCGogCCADQQJHQQF0QQMgChsiCiADEDYCQCAJLQAMRQ0AIAlBCGogCCAKIAMQNiAJLQAMQQNGDQACfwJAAkACQCAEDgQCAgABBQsgAEGUA2ohBUEADAILIABBlANqIQVBAAwBCyAAQZgDaiEFQQELIQEgBSoCACACQZQDaiIFIAFBAnRqKgIAkyAAQRRqIAQgAxAvkyAIIAQgAyAHECGTIAggBCADIAcQgAGTIQZBASEDAkACfwJAAkACQAJAIAQOBAIDAQAHC0ECIQMMAQtBACEDCyADIAtGDQICQAJAIAQOBAICAAEGCyAAQZQDaiEDQQAMAgsgAEGUA2ohA0EADAELIABBmANqIQNBAQshACADKgIAIAUgAEECdGoqAgCTIAaTIQYLIAIgBEECdEHcJWooAgBBAnRqIAY4ApwDDAULAkACQAJAIAUEQCABLQAUQQR2QQdxIgBBBUsNCEEBIAB0IgBBMnENASAAQQlxBEAgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDDAkLIAEgBEECdEHsJWooAgBBAnRqIgAqArwDIAggBCADIAYQYpIhBiACKAL0Ay0AFEECcUUEQCAGIAAqAswDkiEGCwJAAkACQAJAIAQOBAEBAgAICyABKgKUAyACKgKUA5MhB0ECIQMMAgsgASoCmAMgAioCmAOTIQdBASEDAkAgBA4CAgAHC0EDIQMMAQsgASoClAMgAioClAOTIQdBACEDCyACIANBAnRqIAcgBpM4ApwDDAgLIAIvABZBD3EiBUUEQCABLQAVQQR2IQULIAVBBUYEQCABLQAUQQhxRQ0CCyABLwAVQYCAA3FBgIACRgRAIAVBAmsOAgEHAwsgBUEISw0HQQEgBXRB8wNxDQYgBUECRw0CC0EAIQACfQJ/AkACQAJAAkACfwJAAkACQCAEDgQCAgABBAsgASoClAMhB0ECIQAgAUG8A2oMAgsgASoClAMhByABQcQDagwBCyABKgKYAyEHAkACQCAEDgIAAQMLQQMhACABQcADagwBC0EBIQAgAUHIA2oLIQUgByAFKgIAkyABQbwDaiIIIABBAnRqKgIAkyIHIAIoAvQDLQAUQQJxDQUaAkAgBA4EAAIDBAELQQMhACABQdADagwECxAkAAtBASEAIAFB2ANqDAILQQIhACABQcwDagwBC0EAIQAgAUHUA2oLIQUgByAFKgIAkyABIABBAnRqKgLMA5MLIAIgBEECdCIFQfwlaigCAEECdGoqApQDIAJBFGoiACAEQQEgBhAiIAAgBEEBIAYQIZKSk0MAAAA/lCAIIAVB3CVqKAIAIgVBAnRqKgIAkiAAIAQgAyAGEEGSIQYgAiAFQQJ0aiACKAL0Ay0AFEECcQR9IAYFIAYgASAFQQJ0aioCzAOSCzgCnAMMBgsgAS8AFUGAgANxQYCAAkcNBAsgASAEQQJ0QewlaigCAEECdGoiACoCvAMgCCAEIAMgBhBikiEGIAIoAvQDLQAUQQJxRQRAIAYgACoCzAOSIQYLAkACQCAEDgQBAQMAAgsgASoClAMgAioClAOTIQdBAiEDDAMLIAEqApgDIAIqApgDkyEHQQEhAwJAIAQOAgMAAQtBAyEDDAILECQACyABKgKUAyACKgKUA5MhB0EAIQMLIAIgA0ECdGogByAGkzgCnAMMAQsgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDCyAJQRBqJAALcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QewlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwscACAAIAFBCCACpyACQiCIpyADpyADQiCIpxAVCwUAEFgACzkAIABFBEBBAA8LAn8gAUGAf3FBgL8DRiABQf8ATXJFBEBB/DtBGTYCAEF/DAELIAAgAToAAEEBCwvEAgACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACgsMCgsCAwQFDAsMDAoLBwgJCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCwALIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAtdAQR/IAAoAgAhAgNAIAIsAAAiAxBXBEBBfyEEIAAgAkEBaiICNgIAIAFBzJmz5gBNBH9BfyADQTBrIgMgAUEKbCIEaiADIARB/////wdzShsFIAQLIQEMAQsLIAELrhQCEn8BfiMAQdAAayIIJAAgCCABNgJMIAhBN2ohFyAIQThqIRQCQAJAAkACQANAIAEhDSAHIA5B/////wdzSg0BIAcgDmohDgJAAkACQCANIgctAAAiCQRAA0ACQAJAIAlB/wFxIgFFBEAgByEBDAELIAFBJUcNASAHIQkDQCAJLQABQSVHBEAgCSEBDAILIAdBAWohByAJLQACIQogCUECaiIBIQkgCkElRg0ACwsgByANayIHIA5B/////wdzIhhKDQcgAARAIAAgDSAHECYLIAcNBiAIIAE2AkwgAUEBaiEHQX8hEgJAIAEsAAEiChBXRQ0AIAEtAAJBJEcNACABQQNqIQcgCkEwayESQQEhFQsgCCAHNgJMQQAhDAJAIAcsAAAiCUEgayIBQR9LBEAgByEKDAELIAchCkEBIAF0IgFBidEEcUUNAANAIAggB0EBaiIKNgJMIAEgDHIhDCAHLAABIglBIGsiAUEgTw0BIAohB0EBIAF0IgFBidEEcQ0ACwsCQCAJQSpGBEACfwJAIAosAAEiARBXRQ0AIAotAAJBJEcNACABQQJ0IARqQcABa0EKNgIAIApBA2ohCUEBIRUgCiwAAUEDdCADakGAA2soAgAMAQsgFQ0GIApBAWohCSAARQRAIAggCTYCTEEAIRVBACETDAMLIAIgAigCACIBQQRqNgIAQQAhFSABKAIACyETIAggCTYCTCATQQBODQFBACATayETIAxBgMAAciEMDAELIAhBzABqEIkBIhNBAEgNCCAIKAJMIQkLQQAhB0F/IQsCfyAJLQAAQS5HBEAgCSEBQQAMAQsgCS0AAUEqRgRAAn8CQCAJLAACIgEQV0UNACAJLQADQSRHDQAgAUECdCAEakHAAWtBCjYCACAJQQRqIQEgCSwAAkEDdCADakGAA2soAgAMAQsgFQ0GIAlBAmohAUEAIABFDQAaIAIgAigCACIKQQRqNgIAIAooAgALIQsgCCABNgJMIAtBf3NBH3YMAQsgCCAJQQFqNgJMIAhBzABqEIkBIQsgCCgCTCEBQQELIQ8DQCAHIRFBHCEKIAEiECwAACIHQfsAa0FGSQ0JIBBBAWohASAHIBFBOmxqQf8qai0AACIHQQFrQQhJDQALIAggATYCTAJAAkAgB0EbRwRAIAdFDQsgEkEATgRAIAQgEkECdGogBzYCACAIIAMgEkEDdGopAwA3A0AMAgsgAEUNCCAIQUBrIAcgAiAGEIcBDAILIBJBAE4NCgtBACEHIABFDQcLIAxB//97cSIJIAwgDEGAwABxGyEMQQAhEkGPCSEWIBQhCgJAAkACQAJ/AkACQAJAAkACfwJAAkACQAJAAkACQAJAIBAsAAAiB0FfcSAHIAdBD3FBA0YbIAcgERsiB0HYAGsOIQQUFBQUFBQUFA4UDwYODg4UBhQUFBQCBQMUFAkUARQUBAALAkAgB0HBAGsOBw4UCxQODg4ACyAHQdMARg0JDBMLIAgpA0AhGUGPCQwFC0EAIQcCQAJAAkACQAJAAkACQCARQf8BcQ4IAAECAwQaBQYaCyAIKAJAIA42AgAMGQsgCCgCQCAONgIADBgLIAgoAkAgDqw3AwAMFwsgCCgCQCAOOwEADBYLIAgoAkAgDjoAAAwVCyAIKAJAIA42AgAMFAsgCCgCQCAOrDcDAAwTC0EIIAsgC0EITRshCyAMQQhyIQxB+AAhBwsgFCENIAgpA0AiGVBFBEAgB0EgcSEQA0AgDUEBayINIBmnQQ9xQZAvai0AACAQcjoAACAZQg9WIQkgGUIEiCEZIAkNAAsLIAxBCHFFIAgpA0BQcg0DIAdBBHZBjwlqIRZBAiESDAMLIBQhByAIKQNAIhlQRQRAA0AgB0EBayIHIBmnQQdxQTByOgAAIBlCB1YhDSAZQgOIIRkgDQ0ACwsgByENIAxBCHFFDQIgCyAUIA1rIgdBAWogByALSBshCwwCCyAIKQNAIhlCAFMEQCAIQgAgGX0iGTcDQEEBIRJBjwkMAQsgDEGAEHEEQEEBIRJBkAkMAQtBkQlBjwkgDEEBcSISGwshFiAZIBQQRyENCyAPQQAgC0EASBsNDiAMQf//e3EgDCAPGyEMIAgpA0AiGUIAUiALckUEQCAUIQ1BACELDAwLIAsgGVAgFCANa2oiByAHIAtIGyELDAsLQQAhDAJ/Qf////8HIAsgC0H/////B08bIgoiEUEARyEQAkACfwJAAkAgCCgCQCIHQY4lIAcbIg0iD0EDcUUgEUVyDQADQCAPLQAAIgxFDQIgEUEBayIRQQBHIRAgD0EBaiIPQQNxRQ0BIBENAAsLIBBFDQICQCAPLQAARSARQQRJckUEQANAIA8oAgAiB0F/cyAHQYGChAhrcUGAgYKEeHENAiAPQQRqIQ8gEUEEayIRQQNLDQALCyARRQ0DC0EADAELQQELIRADQCAQRQRAIA8tAAAhDEEBIRAMAQsgDyAMRQ0CGiAPQQFqIQ8gEUEBayIRRQ0BQQAhEAwACwALQQALIgcgDWsgCiAHGyIHIA1qIQogC0EATgRAIAkhDCAHIQsMCwsgCSEMIAchCyAKLQAADQ0MCgsgCwRAIAgoAkAMAgtBACEHIABBICATQQAgDBApDAILIAhBADYCDCAIIAgpA0A+AgggCCAIQQhqIgc2AkBBfyELIAcLIQlBACEHAkADQCAJKAIAIg1FDQEgCEEEaiANEIYBIgpBAEgiDSAKIAsgB2tLckUEQCAJQQRqIQkgCyAHIApqIgdLDQEMAgsLIA0NDQtBPSEKIAdBAEgNCyAAQSAgEyAHIAwQKSAHRQRAQQAhBwwBC0EAIQogCCgCQCEJA0AgCSgCACINRQ0BIAhBBGogDRCGASINIApqIgogB0sNASAAIAhBBGogDRAmIAlBBGohCSAHIApLDQALCyAAQSAgEyAHIAxBgMAAcxApIBMgByAHIBNIGyEHDAgLIA9BACALQQBIGw0IQT0hCiAAIAgrA0AgEyALIAwgByAFERwAIgdBAE4NBwwJCyAIIAgpA0A8ADdBASELIBchDSAJIQwMBAsgBy0AASEJIAdBAWohBwwACwALIAANByAVRQ0CQQEhBwNAIAQgB0ECdGooAgAiAARAIAMgB0EDdGogACACIAYQhwFBASEOIAdBAWoiB0EKRw0BDAkLC0EBIQ4gB0EKTw0HA0AgBCAHQQJ0aigCAA0BIAdBAWoiB0EKRw0ACwwHC0EcIQoMBAsgCyAKIA1rIhAgCyAQShsiCSASQf////8Hc0oNAkE9IQogEyAJIBJqIgsgCyATSBsiByAYSg0DIABBICAHIAsgDBApIAAgFiASECYgAEEwIAcgCyAMQYCABHMQKSAAQTAgCSAQQQAQKSAAIA0gEBAmIABBICAHIAsgDEGAwABzECkMAQsLQQAhDgwDC0E9IQoLQfw7IAo2AgALQX8hDgsgCEHQAGokACAOC9kCAQR/IwBB0AFrIgUkACAFIAI2AswBIAVBoAFqIgJBAEEoECoaIAUgBSgCzAE2AsgBAkBBACABIAVByAFqIAVB0ABqIAIgAyAEEIoBQQBIBEBBfyEEDAELQQEgBiAAKAJMQQBOGyEGIAAoAgAhByAAKAJIQQBMBEAgACAHQV9xNgIACwJ/AkACQCAAKAIwRQRAIABB0AA2AjAgAEEANgIcIABCADcDECAAKAIsIQggACAFNgIsDAELIAAoAhANAQtBfyAAEJ0BDQEaCyAAIAEgBUHIAWogBUHQAGogBUGgAWogAyAEEIoBCyECIAgEQCAAQQBBACAAKAIkEQYAGiAAQQA2AjAgACAINgIsIABBADYCHCAAKAIUIQEgAEIANwMQIAJBfyABGyECCyAAIAAoAgAiACAHQSBxcjYCAEF/IAIgAEEgcRshBCAGRQ0ACyAFQdABaiQAIAQLfwIBfwF+IAC9IgNCNIinQf8PcSICQf8PRwR8IAJFBEAgASAARAAAAAAAAAAAYQR/QQAFIABEAAAAAAAA8EOiIAEQjAEhACABKAIAQUBqCzYCACAADwsgASACQf4HazYCACADQv////////+HgH+DQoCAgICAgIDwP4S/BSAACwsVACAARQRAQQAPC0H8OyAANgIAQX8LzgECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBxABqIgEvAQAQHwJAAkAgAyoCCCIHIAIqAgAiBlwEQCAHIAdbBEAgAi0ABCECDAILIAYgBlwhBAsgAi0ABCECIARFDQAgAy0ADCACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQAC9EDAEHUO0GoHBAcQdU7QYoWQQFBAUEAEBtB1jtB/RJBAUGAf0H/ABAEQdc7QfYSQQFBgH9B/wAQBEHYO0H0EkEBQQBB/wEQBEHZO0GUCkECQYCAfkH//wEQBEHaO0GLCkECQQBB//8DEARB2ztBsQpBBEGAgICAeEH/////BxAEQdw7QagKQQRBAEF/EARB3TtB+BhBBEGAgICAeEH/////BxAEQd47Qe8YQQRBAEF/EARB3ztBjxBCgICAgICAgICAf0L///////////8AEIQBQeA7QY4QQgBCfxCEAUHhO0GIEEEEEA1B4jtB9BtBCBANQeM7QaQZEA5B5DtBmSIQDkHlO0EEQZcZEAhB5jtBAkGwGRAIQec7QQRBvxkQCEHoO0GPFhAaQek7QQBB1CEQAUHqO0EAQboiEAFB6ztBAUHyIRABQew7QQJB5B4QAUHtO0EDQYMfEAFB7jtBBEGrHxABQe87QQVByB8QAUHwO0EEQd8iEAFB8TtBBUH9IhABQeo7QQBBriAQAUHrO0EBQY0gEAFB7DtBAkHwIBABQe07QQNBziAQAUHuO0EEQbMhEAFB7ztBBUGRIRABQfI7QQZB7h8QAUHzO0EHQaQjEAELJQAgAEH0JjYCACAALQAEBEAgACgCCEH9DxBmCyAAKAIIEAYgAAsDAAALJQAgAEHsJzYCACAALQAEBEAgACgCCEH9DxBmCyAAKAIIEAYgAAs3AQJ/QQQQHiICIAE2AgBBBBAeIgMgATYCAEGjOyAAQeI7QfooQcEBIAJB4jtB/ihBwgEgAxAHCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRBQALOQEBfyABIAAoAgQiBEEBdWohASAAKAIAIQAgASACIAMgBEEBcQR/IAEoAgAgAGooAgAFIAALEQMACwkAIAEgABEAAAsHACAAEQ4ACzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALEQAACzABAX8jAEEQayICJAAgAiABNgIIIAJBCGogABECACEAIAIoAggQBiACQRBqJAAgAAsMACABIAAoAgARAAALCQAgAEEBOgAEC9coAQJ/QaA7QaE7QaI7QQBBjCZBB0GPJkEAQY8mQQBB2RZBkSZBCBAFQQgQHiIAQoiAgIAQNwMAQaA7QZcbQQZBoCZBuCZBCSAAQQEQAEGkO0GlO0GmO0GgO0GMJkEKQYwmQQtBjCZBDEG4EUGRJkENEAVBBBAeIgBBDjYCAEGkO0HoFEECQcAmQcgmQQ8gAEEAEABBoDtBowxBAkHMJkHUJkEQQREQA0GgO0GAHEEDQaQnQbAnQRJBExADQbg7Qbk7Qbo7QQBBjCZBFEGPJkEAQY8mQQBB6RZBkSZBFRAFQQgQHiIAQoiAgIAQNwMAQbg7QegcQQJBuCdByCZBFiAAQQEQAEG7O0G8O0G9O0G4O0GMJkEXQYwmQRhBjCZBGUHPEUGRJkEaEAVBBBAeIgBBGzYCAEG7O0HoFEECQcAnQcgmQRwgAEEAEABBuDtBowxBAkHIJ0HUJkEdQR4QA0G4O0GAHEEDQaQnQbAnQRJBHxADQb47Qb87QcA7QQBBjCZBIEGPJkEAQY8mQQBB2hpBkSZBIRAFQb47QQFB+CdBjCZBIkEjEA9BvjtBkBtBAUH4J0GMJkEiQSMQA0G+O0HpCEECQfwnQcgmQSRBJRADQQgQHiIAQQA2AgQgAEEmNgIAQb47Qa0cQQRBkChBoChBJyAAQQAQAEEIEB4iAEEANgIEIABBKDYCAEG+O0GkEUEDQagoQbQoQSkgAEEAEABBCBAeIgBBADYCBCAAQSo2AgBBvjtByB1BA0G8KEHIKEErIABBABAAQQgQHiIAQQA2AgQgAEEsNgIAQb47QaYQQQNB0ChByChBLSAAQQAQAEEIEB4iAEEANgIEIABBLjYCAEG+O0HLHEEDQdwoQbAnQS8gAEEAEABBCBAeIgBBADYCBCAAQTA2AgBBvjtB0h1BAkHoKEHUJkExIABBABAAQQgQHiIAQQA2AgQgAEEyNgIAQb47QZcQQQJB8ChB1CZBMyAAQQAQAEHBO0GECkH4KEE0QZEmQTUQCkHiD0EAEEhB6g5BCBBIQYITQRAQSEHxFUEYEEhBgxdBIBBIQfAOQSgQSEHBOxAJQaM7Qf8aQfgoQTZBkSZBNxAKQYMXQQAQkwFB8A5BCBCTAUGjOxAJQcI7QYobQfgoQThBkSZBORAKQQQQHiIAQQg2AgBBBBAeIgFBCDYCAEHCO0GEG0HiO0H6KEE6IABB4jtB/ihBOyABEAdBBBAeIgBBADYCAEEEEB4iAUEANgIAQcI7QeUOQds7QdQmQTwgAEHbO0HIKEE9IAEQB0HCOxAJQcM7QcQ7QcU7QQBBjCZBPkGPJkEAQY8mQQBB+xtBkSZBPxAFQcM7QQFBhClBjCZBwABBwQAQD0HDO0HXDkEBQYQpQYwmQcAAQcEAEANBwztB0BpBAkGIKUHUJkHCAEHDABADQcM7QekIQQJBkClByCZBxABBxQAQA0EIEB4iAEEANgIEIABBxgA2AgBBwztB9w9BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABByAA2AgBBwztB6htBA0GYKUHIKEHJACAAQQAQAEEIEB4iAEEANgIEIABBygA2AgBBwztBnxtBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABBzAA2AgBBwztB0BRBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABBzgA2AgBBwztBiA1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABBzwA2AgBBwztB3RNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0AA2AgBBwztB+QtBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0QA2AgBBwztBuBBBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0gA2AgBBwztB5RpBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB0wA2AgBBwztB/BRBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1AA2AgBBwztBlRNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1QA2AgBBwztBtQpBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB1gA2AgBBwztBuBVBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB1wA2AgBBwztBmw1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB2AA2AgBBwztB7RNBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2QA2AgBBwztBxAlBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2gA2AgBBwztB8QhBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB2wA2AgBBwztBhwlBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3QA2AgBBwztB1BBBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3gA2AgBBwztB5gxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB3wA2AgBBwztBzBNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB4AA2AgBBwztBrAlBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4QA2AgBBwztBnxZBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4gA2AgBBwztBoRdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB4wA2AgBBwztBvw1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5AA2AgBBwztB+xNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB5QA2AgBBwztBkQ9BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5gA2AgBBwztBwQxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB5wA2AgBBwztBvhNBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABB6AA2AgBBwztBsxdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6QA2AgBBwztBzw1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6gA2AgBBwztBpQ9BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB6wA2AgBBwztB0gxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7AA2AgBBwztBiRdBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7QA2AgBBwztBrA1BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7gA2AgBBwztB9w5BA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB7wA2AgBBwztBrQxBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB8AA2AgBBwztB/RhBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB8QA2AgBBwztBshRBA0HIKUH+KEHcACAAQQAQAEEIEB4iAEEANgIEIABB8gA2AgBBwztBlBJBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB8wA2AgBBwztBzhlBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9AA2AgBBwztB4g1BBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9QA2AgBBwztBrRNBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9gA2AgBBwztB+gxBBEGwKUHAKUHNACAAQQAQAEEIEB4iAEEANgIEIABB9wA2AgBBwztBnhVBA0GkKUHIKEHLACAAQQAQAEEIEB4iAEEANgIEIABB+AA2AgBBwztBrxtBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB+gA2AgBBwztB3BRBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABB/AA2AgBBwztBiQxBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/QA2AgBBwztBxhBBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/gA2AgBBwztB8hpBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABB/wA2AgBBwztBjRVBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBgAE2AgBBwztBoRNBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBgQE2AgBBwztBxwpBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBggE2AgBBwztBwhVBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABBgwE2AgBBwztB4RBBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBhQE2AgBBwztBuAlBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBhwE2AgBBwztBrRZBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBiAE2AgBBwztBqhdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBiQE2AgBBwztBmw9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBigE2AgBBwztBvxdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBiwE2AgBBwztBsg9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjAE2AgBBwztBlRdBAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjQE2AgBBwztBhA9BAkHoKUHUJkGEASAAQQAQAEEIEB4iAEEANgIEIABBjgE2AgBBwztBihlBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBjwE2AgBBwztBwRRBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBkAE2AgBBwztBnhJBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBkgE2AgBBwztB0AlBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBkwE2AgBBwztB/AhBAkHUKUHUJkH5ACAAQQAQAEEIEB4iAEEANgIEIABBlAE2AgBBwztB2RlBA0HcKUGwJ0H7ACAAQQAQAEEIEB4iAEEANgIEIABBlQE2AgBBwztBtBNBA0GMKkGYKkGWASAAQQAQAEEIEB4iAEEANgIEIABBlwE2AgBBwztBhxxBBEGgKkGgKEGYASAAQQAQAEEIEB4iAEEANgIEIABBmQE2AgBBwztBnBxBA0GwKkHIKEGaASAAQQAQAEEIEB4iAEEANgIEIABBmwE2AgBBwztBmgpBAkG8KkHUJkGcASAAQQAQAEEIEB4iAEEANgIEIABBnQE2AgBBwztBmQxBAkHEKkHUJkGeASAAQQAQAEEIEB4iAEEANgIEIABBnwE2AgBBwztBkxxBA0HMKkGwJ0GgASAAQQAQAEEIEB4iAEEANgIEIABBoQE2AgBBwztBuxZBA0HYKkHIKEGiASAAQQAQAEEIEB4iAEEANgIEIABBowE2AgBBwztBvxtBAkHkKkHUJkGkASAAQQAQAEEIEB4iAEEANgIEIABBpQE2AgBBwztB0xtBA0HYKkHIKEGiASAAQQAQAEEIEB4iAEEANgIEIABBpgE2AgBBwztBqB1BA0HsKkHIKEGnASAAQQAQAEEIEB4iAEEANgIEIABBqAE2AgBBwztBph1BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBqQE2AgBBwztBuR1BA0H4KkHIKEGqASAAQQAQAEEIEB4iAEEANgIEIABBqwE2AgBBwztBtx1BAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBrAE2AgBBwztB3whBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBrQE2AgBBwztB1whBAkGEK0HUJkGuASAAQQAQAEEIEB4iAEEANgIEIABBrwE2AgBBwztB3hVBAkGQKUHIJkHHACAAQQAQAEEIEB4iAEEANgIEIABBsAE2AgBBwztB3AlBAkGEK0HUJkGuASAAQQAQAEEIEB4iAEEANgIEIABBsQE2AgBBwztB6QlBBUGQK0GkK0GyASAAQQAQAEEIEB4iAEEANgIEIABBswE2AgBBwztB5w9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtAE2AgBBwztB0Q9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtQE2AgBBwztBhhNBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtgE2AgBBwztB+BVBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBtwE2AgBBwztByxdBAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBuAE2AgBBwztBvw9BAkHwKUH6KEGGASAAQQAQAEEIEB4iAEEANgIEIABBuQE2AgBBwztB+QlBAkGsK0HUJkG6ASAAQQAQAEEIEB4iAEEANgIEIABBuwE2AgBBwztBzBVBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvAE2AgBBwztBqBJBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvQE2AgBBwztB5BlBA0H4KUGEKkGRASAAQQAQAEEIEB4iAEEANgIEIABBvgE2AgBBwztBqxVBAkHUKUHUJkH5ACAAQQAQAAtZAQF/IAAgACgCSCIBQQFrIAFyNgJIIAAoAgAiAUEIcQRAIAAgAUEgcjYCAEF/DwsgAEIANwIEIAAgACgCLCIBNgIcIAAgATYCFCAAIAEgACgCMGo2AhBBAAtHAAJAIAFBA00EfyAAIAFBAnRqQQRqBSABQQRrIgEgACgCGCIAKAIEIAAoAgAiAGtBAnVPDQEgACABQQJ0agsoAgAPCxACAAs4AQF/IAFBAEgEQBACAAsgAUEBa0EFdkEBaiIBQQJ0EB4hAiAAIAE2AgggAEEANgIEIAAgAjYCAAvSBQEJfyAAIAEvAQA7AQAgACABKQIENwIEIAAgASkCDDcCDCAAIAEoAhQ2AhQCQAJAIAEoAhgiA0UNAEEYEB4iBUEANgIIIAVCADcCACADKAIEIgEgAygCACICRwRAIAEgAmsiAkEASA0CIAUgAhAeIgE2AgAgBSABIAJqNgIIIAMoAgAiAiADKAIEIgZHBEADQCABIAIoAgA2AgAgAUEEaiEBIAJBBGoiAiAGRw0ACwsgBSABNgIECyAFQgA3AgwgBUEANgIUIAMoAhAiAUUNACAFQQxqIAEQnwEgAygCDCEGIAUgBSgCECIEIAMoAhAiAkEfcWogAkFgcWoiATYCEAJAAkAgBEUEQCABQQFrIQMMAQsgAUEBayIDIARBAWtzQSBJDQELIAUoAgwgA0EFdkEAIAFBIU8bQQJ0akEANgIACyAFKAIMIARBA3ZB/P///wFxaiEBIARBH3EiA0UEQCACQQBMDQEgAkEgbSEDIAJBH2pBP08EQCABIAYgA0ECdBAzGgsgAiADQQV0ayICQQBMDQEgASADQQJ0IgNqIgEgASgCAEF/QSAgAmt2IgFBf3NxIAMgBmooAgAgAXFyNgIADAELIAJBAEwNAEF/IAN0IQhBICADayEEIAJBIE4EQCAIQX9zIQkgASgCACEHA0AgASAHIAlxIAYoAgAiByADdHI2AgAgASABKAIEIAhxIAcgBHZyIgc2AgQgBkEEaiEGIAFBBGohASACQT9LIQogAkEgayECIAoNAAsgAkEATA0BCyABIAEoAgBBfyAEIAQgAiACIARKGyIEa3YgCHFBf3NxIAYoAgBBf0EgIAJrdnEiBiADdHI2AgAgAiAEayICQQBMDQAgASADIARqQQN2Qfz///8BcWoiASABKAIAQX9BICACa3ZBf3NxIAYgBHZyNgIACyAAKAIYIQEgACAFNgIYIAEEQCABEFsLDwsQAgALvQMBB38gAARAIwBBIGsiBiQAIAAoAgAiASgC5AMiAwRAIAMgARBvGiABQQA2AuQDCyABKALsAyICIAEoAugDIgNHBEBBASACIANrQQJ1IgIgAkEBTRshBEEAIQIDQCADIAJBAnRqKAIAQQA2AuQDIAJBAWoiAiAERw0ACwsgASADNgLsAwJAIAMgAUHwA2oiAigCAEYNACAGQQhqQQBBACACEEoiAigCBCABKALsAyABKALoAyIEayIFayIDIAQgBRAzIQUgASgC6AMhBCABIAU2AugDIAIgBDYCBCABKALsAyEFIAEgAigCCDYC7AMgAiAFNgIIIAEoAvADIQcgASACKAIMNgLwAyACIAQ2AgAgAiAHNgIMIAQgBUcEQCACIAUgBCAFa0EDakF8cWo2AggLIARFDQAgBBAnIAEoAugDIQMLIAMEQCABIAM2AuwDIAMQJwsgASgClAEhAyABQQA2ApQBIAMEQCADEFsLIAEQJyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALIAAoAgQhASAAQQA2AgQgAQRAIAEgASgCACgCBBEAAAsgBkEgaiQAIAAQIwsLtQEBAX8jAEEQayICJAACfyABBEAgASgCACEBQYgEEB4gARBcIAENARogAkH3GTYCACACEHIQJAALQZQ7LQAARQRAQfg6QQM2AgBBiDtCgICAgICAgMA/NwIAQYA7QgA3AgBBlDtBAToAAEH8OkH8Oi0AAEH+AXE6AABB9DpBADYCAEGQO0EANgIAC0GIBBAeQfQ6EFwLIQEgAEIANwIEIAAgATYCACABIAA2AgQgAkEQaiQAIAALGwEBfyAABEAgACgCACIBBEAgARAjCyAAECMLC0kBAn9BBBAeIQFBIBAeIgBBADYCHCAAQoCAgICAgIDAPzcCFCAAQgA3AgwgAEEAOgAIIABBAzYCBCAAQQA2AgAgASAANgIAIAELIAAgAkEFR0EAIAIbRQRAQbgwIAMgBBBJDwsgAyAEEHALIgEBfiABIAKtIAOtQiCGhCAEIAARFQAiBUIgiKckASAFpwuoAQEFfyAAKAJUIgMoAgAhBSADKAIEIgQgACgCFCAAKAIcIgdrIgYgBCAGSRsiBgRAIAUgByAGECsaIAMgAygCACAGaiIFNgIAIAMgAygCBCAGayIENgIECyAEIAIgAiAESxsiBARAIAUgASAEECsaIAMgAygCACAEaiIFNgIAIAMgAygCBCAEazYCBAsgBUEAOgAAIAAgACgCLCIBNgIcIAAgATYCFCACCwQAQgALBABBAAuKBQIGfgJ/IAEgASgCAEEHakF4cSIBQRBqNgIAIAAhCSABKQMAIQMgASkDCCEGIwBBIGsiCCQAAkAgBkL///////////8AgyIEQoCAgICAgMCAPH0gBEKAgICAgIDA/8MAfVQEQCAGQgSGIANCPIiEIQQgA0L//////////w+DIgNCgYCAgICAgIAIWgRAIARCgYCAgICAgIDAAHwhAgwCCyAEQoCAgICAgICAQH0hAiADQoCAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgCEEgaiQAIAkgAiAGQoCAgICAgICAgH+DhL85AwALmRgDEn8BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIZQgBTBEBBASERQZkJIRMgAZoiAb0hGQwBCyAEQYAQcQRAQQEhEUGcCSETDAELQZ8JQZoJIARBAXEiERshEyARRSEVCwJAIBlCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txECkgACATIBEQJiAAQe0VQdweIAVBIHEiBRtB4RpB4B4gBRsgASABYhtBAxAmIABBICACIAMgBEGAwABzECkgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahCMASIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAVBIHIiDkHhAEYNAiAMKAIsIQlBBiADIANBAEgbDAELIAwgBkEdayIJNgIsIAFEAAAAAAAAsEGiIQFBBiADIANBAEgbCyELIAxBMGpBoAJBACAJQQBOG2oiDSEHA0AgBwJ/IAFEAAAAAAAA8EFjIAFEAAAAAAAAAABmcQRAIAGrDAELQQALIgM2AgAgB0EEaiEHIAEgA7ihRAAAAABlzc1BoiIBRAAAAAAAAAAAYg0ACwJAIAlBAEwEQCAJIQMgByEGIA0hCAwBCyANIQggCSEDA0BBHSADIANBHU4bIQMCQCAHQQRrIgYgCEkNACADrSEaQgAhGQNAIAYgGUL/////D4MgBjUCACAahnwiG0KAlOvcA4AiGUKA7JSjDH4gG3w+AgAgBkEEayIGIAhPDQALIBmnIgZFDQAgCEEEayIIIAY2AgALA0AgCCAHIgZJBEAgBkEEayIHKAIARQ0BCwsgDCAMKAIsIANrIgM2AiwgBiEHIANBAEoNAAsLIANBAEgEQCALQRlqQQluQQFqIQ8gDkHmAEYhEANAQQlBACADayIDIANBCU4bIQoCQCAGIAhNBEAgCCgCACEHDAELQYCU69wDIAp2IRRBfyAKdEF/cyEWQQAhAyAIIQcDQCAHIAMgBygCACIXIAp2ajYCACAWIBdxIBRsIQMgB0EEaiIHIAZJDQALIAgoAgAhByADRQ0AIAYgAzYCACAGQQRqIQYLIAwgDCgCLCAKaiIDNgIsIA0gCCAHRUECdGoiCCAQGyIHIA9BAnRqIAYgBiAHa0ECdSAPShshBiADQQBIDQALC0EAIQMCQCAGIAhNDQAgDSAIa0ECdUEJbCEDQQohByAIKAIAIgpBCkkNAANAIANBAWohAyAKIAdBCmwiB08NAAsLIAsgA0EAIA5B5gBHG2sgDkHnAEYgC0EAR3FrIgcgBiANa0ECdUEJbEEJa0gEQEEEQaQCIAlBAEgbIAxqIAdBgMgAaiIKQQltIg9BAnRqQdAfayEJQQohByAPQXdsIApqIgpBB0wEQANAIAdBCmwhByAKQQFqIgpBCEcNAAsLAkAgCSgCACIQIBAgB24iDyAHbCIKRiAJQQRqIhQgBkZxDQAgECAKayEQAkAgD0EBcUUEQEQAAAAAAABAQyEBIAdBgJTr3ANHIAggCU9yDQEgCUEEay0AAEEBcUUNAQtEAQAAAAAAQEMhAQtEAAAAAAAA4D9EAAAAAAAA8D9EAAAAAAAA+D8gBiAURhtEAAAAAAAA+D8gECAHQQF2IhRGGyAQIBRJGyEYAkAgFQ0AIBMtAABBLUcNACAYmiEYIAGaIQELIAkgCjYCACABIBigIAFhDQAgCSAHIApqIgM2AgAgA0GAlOvcA08EQANAIAlBADYCACAIIAlBBGsiCUsEQCAIQQRrIghBADYCAAsgCSAJKAIAQQFqIgM2AgAgA0H/k+vcA0sNAAsLIA0gCGtBAnVBCWwhA0EKIQcgCCgCACIKQQpJDQADQCADQQFqIQMgCiAHQQpsIgdPDQALCyAJQQRqIgcgBiAGIAdLGyEGCwNAIAYiByAITSIKRQRAIAdBBGsiBigCAEUNAQsLAkAgDkHnAEcEQCAEQQhxIQkMAQsgA0F/c0F/IAtBASALGyIGIANKIANBe0pxIgkbIAZqIQtBf0F+IAkbIAVqIQUgBEEIcSIJDQBBdyEGAkAgCg0AIAdBBGsoAgAiDkUNAEEKIQpBACEGIA5BCnANAANAIAYiCUEBaiEGIA4gCkEKbCIKcEUNAAsgCUF/cyEGCyAHIA1rQQJ1QQlsIQogBUFfcUHGAEYEQEEAIQkgCyAGIApqQQlrIgZBACAGQQBKGyIGIAYgC0obIQsMAQtBACEJIAsgAyAKaiAGakEJayIGQQAgBkEAShsiBiAGIAtKGyELC0F/IQogC0H9////B0H+////ByAJIAtyIhAbSg0BIAsgEEEAR2pBAWohDgJAIAVBX3EiFUHGAEYEQCADIA5B/////wdzSg0DIANBACADQQBKGyEGDAELIBIgAyADQR91IgZzIAZrrSASEEciBmtBAUwEQANAIAZBAWsiBkEwOgAAIBIgBmtBAkgNAAsLIAZBAmsiDyAFOgAAIAZBAWtBLUErIANBAEgbOgAAIBIgD2siBiAOQf////8Hc0oNAgsgBiAOaiIDIBFB/////wdzSg0BIABBICACIAMgEWoiBSAEECkgACATIBEQJiAAQTAgAiAFIARBgIAEcxApAkACQAJAIBVBxgBGBEAgDEEQaiIGQQhyIQMgBkEJciEJIA0gCCAIIA1LGyIKIQgDQCAINQIAIAkQRyEGAkAgCCAKRwRAIAYgDEEQak0NAQNAIAZBAWsiBkEwOgAAIAYgDEEQaksNAAsMAQsgBiAJRw0AIAxBMDoAGCADIQYLIAAgBiAJIAZrECYgCEEEaiIIIA1NDQALIBAEQCAAQYwlQQEQJgsgC0EATCAHIAhNcg0BA0AgCDUCACAJEEciBiAMQRBqSwRAA0AgBkEBayIGQTA6AAAgBiAMQRBqSw0ACwsgACAGQQkgCyALQQlOGxAmIAtBCWshBiAIQQRqIgggB08NAyALQQlKIQMgBiELIAMNAAsMAgsCQCALQQBIDQAgByAIQQRqIAcgCEsbIQogDEEQaiIGQQhyIQMgBkEJciENIAghBwNAIA0gBzUCACANEEciBkYEQCAMQTA6ABggAyEGCwJAIAcgCEcEQCAGIAxBEGpNDQEDQCAGQQFrIgZBMDoAACAGIAxBEGpLDQALDAELIAAgBkEBECYgBkEBaiEGIAkgC3JFDQAgAEGMJUEBECYLIAAgBiALIA0gBmsiBiAGIAtKGxAmIAsgBmshCyAHQQRqIgcgCk8NASALQQBODQALCyAAQTAgC0ESakESQQAQKSAAIA8gEiAPaxAmDAILIAshBgsgAEEwIAZBCWpBCUEAECkLIABBICACIAUgBEGAwABzECkgBSACIAIgBUgbIQoMAQsgEyAFQRp0QR91QQlxaiELAkAgA0ELSw0AQQwgA2shBkQAAAAAAAAwQCEYA0AgGEQAAAAAAAAwQKIhGCAGQQFrIgYNAAsgCy0AAEEtRgRAIBggAZogGKGgmiEBDAELIAEgGKAgGKEhAQsgEUECciEJIAVBIHEhCCASIAwoAiwiByAHQR91IgZzIAZrrSASEEciBkYEQCAMQTA6AA8gDEEPaiEGCyAGQQJrIg0gBUEPajoAACAGQQFrQS1BKyAHQQBIGzoAACAEQQhxIQYgDEEQaiEHA0AgByIFAn8gAZlEAAAAAAAA4EFjBEAgAaoMAQtBgICAgHgLIgdBkC9qLQAAIAhyOgAAIAYgA0EASnJFIAEgB7ehRAAAAAAAADBAoiIBRAAAAAAAAAAAYXEgBUEBaiIHIAxBEGprQQFHckUEQCAFQS46AAEgBUECaiEHCyABRAAAAAAAAAAAYg0AC0F/IQpB/f///wcgCSASIA1rIgVqIgZrIANIDQAgAEEgIAIgBgJ/AkAgA0UNACAHIAxBEGprIghBAmsgA04NACADQQJqDAELIAcgDEEQamsiCAsiB2oiAyAEECkgACALIAkQJiAAQTAgAiADIARBgIAEcxApIAAgDEEQaiAIECYgAEEwIAcgCGtBAEEAECkgACANIAUQJiAAQSAgAiADIARBgMAAcxApIAMgAiACIANIGyEKCyAMQbAEaiQAIAoLRgEBfyAAKAI8IQMjAEEQayIAJAAgAyABpyABQiCIpyACQf8BcSAAQQhqEBQQjQEhAiAAKQMIIQEgAEEQaiQAQn8gASACGwu+AgEHfyMAQSBrIgMkACADIAAoAhwiBDYCECAAKAIUIQUgAyACNgIcIAMgATYCGCADIAUgBGsiATYCFCABIAJqIQVBAiEGIANBEGohAQJ/A0ACQAJAAkAgACgCPCABIAYgA0EMahAYEI0BRQRAIAUgAygCDCIHRg0BIAdBAE4NAgwDCyAFQX9HDQILIAAgACgCLCIBNgIcIAAgATYCFCAAIAEgACgCMGo2AhAgAgwDCyABIAcgASgCBCIISyIJQQN0aiIEIAcgCEEAIAkbayIIIAQoAgBqNgIAIAFBDEEEIAkbaiIBIAEoAgAgCGs2AgAgBSAHayEFIAYgCWshBiAEIQEMAQsLIABBADYCHCAAQgA3AxAgACAAKAIAQSByNgIAQQAgBkECRg0AGiACIAEoAgRrCyEEIANBIGokACAECwkAIAAoAjwQGQsjAQF/Qcg7KAIAIgAEQANAIAAoAgARCQAgACgCBCIADQALCwu/AgEFfyMAQeAAayICJAAgAiAANgIAIwBBEGsiAyQAIAMgAjYCDCMAQZABayIAJAAgAEGgL0GQARArIgAgAkEQaiIFIgE2AiwgACABNgIUIABB/////wdBfiABayIEIARB/////wdPGyIENgIwIAAgASAEaiIBNgIcIAAgATYCECAAQbsTIAJBAEEAEIsBGiAEBEAgACgCFCIBIAEgACgCEEZrQQA6AAALIABBkAFqJAAgA0EQaiQAAkAgBSIAQQNxBEADQCAALQAARQ0CIABBAWoiAEEDcQ0ACwsDQCAAIgFBBGohACABKAIAIgNBf3MgA0GBgoQIa3FBgIGChHhxRQ0ACwNAIAEiAEEBaiEBIAAtAAANAAsLIAAgBWtBAWoiABBhIgEEfyABIAUgABArBUEACyEAIAJB4ABqJAAgAAvFAQICfwF8IwBBMGsiBiQAIAEoAgghBwJAQbQ7LQAAQQFxBEBBsDsoAgAhAQwBC0EFQZAnEAwhAUG0O0EBOgAAQbA7IAE2AgALIAYgBTYCKCAGIAQ4AiAgBiADNgIYIAYgAjgCEAJ/IAEgB0GXGyAGQQxqIAZBEGoQEiIIRAAAAAAAAPBBYyAIRAAAAAAAAAAAZnEEQCAIqwwBC0EACyEBIAYoAgwhAyAAIAEpAwA3AwAgACABKQMINwMIIAMQESAGQTBqJAALCQAgABCQARAjCwwAIAAoAghB6BwQZgsJACAAEJIBECMLVQECfyMAQTBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEwEB4gAkEwECshACACQTBqJAAgAAs7AQF/IAEgACgCBCIFQQF1aiEBIAAoAgAhACABIAIgAyAEIAVBAXEEfyABKAIAIABqKAIABSAACxEdAAs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERIACzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRDAALNQEBfyABIAAoAgQiAkEBdWohASAAKAIAIQAgASACQQFxBH8gASgCACAAaigCAAUgAAsRCwALYQECfyMAQRBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEQEB4iACACKQMINwMIIAAgAikDADcDACACQRBqJAAgAAtjAQJ/IwBBEGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACADIAEgAiAEQQFxBH8gASgCACAAaigCAAUgAAsRAwBBEBAeIgAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiQAIAALNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEEAAs5AQF/IAEgACgCBCIEQQF1aiEBIAAoAgAhACABIAIgAyAEQQFxBH8gASgCACAAaigCAAUgAAsRCAALCQAgASAAEQIACwUAQcM7Cw8AIAEgACgCAGogAjYCAAsNACABIAAoAgBqKAIACxgBAX9BEBAeIgBCADcDCCAAQQA2AgAgAAsYAQF/QRAQHiIAQgA3AwAgAEIANwMIIAALDABBMBAeQQBBMBAqCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRHgALBQBBvjsLIQAgACABKAIAIAEgASwAC0EASBtBuzsgAigCABAQNgIACyoBAX9BDBAeIgFBADoABCABIAAoAgA2AgggAEEANgIAIAFB2Cc2AgAgAQsFAEG7OwsFAEG4OwshACAAIAEoAgAgASABLAALQQBIG0GkOyACKAIAEBA2AgAL2AEBBH8jAEEgayIDJAAgASgCACIEQfD///8HSQRAAkACQCAEQQtPBEAgBEEPckEBaiIFEB4hBiADIAVBgICAgHhyNgIQIAMgBjYCCCADIAQ2AgwgBCAGaiEFDAELIAMgBDoAEyADQQhqIgYgBGohBSAERQ0BCyAGIAFBBGogBBArGgsgBUEAOgAAIAMgAjYCACADQRhqIANBCGogAyAAEQMAIAMoAhgQHSADKAIYIgAQBiADKAIAEAYgAywAE0EASARAIAMoAggQIwsgA0EgaiQAIAAPCxACAAsqAQF/QQwQHiIBQQA6AAQgASAAKAIANgIIIABBADYCACABQeAmNgIAIAELBQBBpDsLaQECfyMAQRBrIgYkACABIAAoAgQiB0EBdWohASAAKAIAIQAgBiABIAIgAyAEIAUgB0EBcQR/IAEoAgAgAGooAgAFIAALERAAQRAQHiIAIAYpAwg3AwggACAGKQMANwMAIAZBEGokACAACwUAQaA7Cx0AIAAoAgAiACAALQAAQfcBcUEIQQAgARtyOgAAC6oBAgJ/AX0jAEEQayICJAAgACgCACEAIAFB/wFxIgNBBkkEQAJ/AkACQAJAIANBBGsOAgABAgsgAEHUA2ogAC0AiANBA3FBAkYNAhogAEHMA2oMAgsgAEHMA2ogAC0AiANBA3FBAkYNARogAEHUA2oMAQsgACABQf8BcUECdGpBzANqCyoCACEEIAJBEGokACAEuw8LIAJB7hA2AgAgAEEFQdglIAIQLBAkAAuqAQICfwF9IwBBEGsiAiQAIAAoAgAhACABQf8BcSIDQQZJBEACfwJAAkACQCADQQRrDgIAAQILIABBxANqIAAtAIgDQQNxQQJGDQIaIABBvANqDAILIABBvANqIAAtAIgDQQNxQQJGDQEaIABBxANqDAELIAAgAUH/AXFBAnRqQbwDagsqAgAhBCACQRBqJAAgBLsPCyACQe4QNgIAIABBBUHYJSACECwQJAALqgECAn8BfSMAQRBrIgIkACAAKAIAIQAgAUH/AXEiA0EGSQRAAn8CQAJAAkAgA0EEaw4CAAECCyAAQbQDaiAALQCIA0EDcUECRg0CGiAAQawDagwCCyAAQawDaiAALQCIA0EDcUECRg0BGiAAQbQDagwBCyAAIAFB/wFxQQJ0akGsA2oLKgIAIQQgAkEQaiQAIAS7DwsgAkHuEDYCACAAQQVB2CUgAhAsECQAC08AIAAgASgCACIBKgKcA7s5AwAgACABKgKkA7s5AwggACABKgKgA7s5AxAgACABKgKoA7s5AxggACABKgKMA7s5AyAgACABKgKQA7s5AygLDAAgACgCACoCkAO7CwwAIAAoAgAqAowDuwsMACAAKAIAKgKoA7sLDAAgACgCACoCoAO7CwwAIAAoAgAqAqQDuwsMACAAKAIAKgKcA7sL6AMCBH0FfyMAQUBqIgokACAAKAIAIQAgCkEIakEAQTgQKhpB8DpB8DooAgBBAWo2AgAgABB4IAAtABRBA3EiCCADQQEgA0H/AXEbIAgbIQkgAEEUaiEIIAG2IQQgACoC+AMhBQJ9AkACQAJAIAAtAPwDQQFrDgIBAAILIAUgBJRDCtcjPJQhBQsgBUMAAAAAYEUNACAAIAlB/wFxQQAgBCAEEDEgCEECQQEgBBAiIAhBAkEBIAQQIZKSDAELIAggCUH/AXFBACAEIAQQLSIFIAVbBEBBAiELIAggCUH/AXFBACAEIAQQLQwBCyAEIARcIQsgBAshByACtiEFIAAqAoAEIQYgACAHAn0CQAJAAkAgAC0AhARBAWsOAgEAAgsgBiAFlEMK1yM8lCEGCyAGQwAAAABgRQ0AIAAgCUH/AXFBASAFIAQQMSAIQQBBASAEECIgCEEAQQEgBBAhkpIMAQsgCCAJQf8BcSIJQQEgBSAEEC0iBiAGWwRAQQIhDCAIIAlBASAFIAQQLQwBCyAFIAVcIQwgBQsgA0H/AXEgCyAMIAQgBUEBQQAgCkEIakEAQfA6KAIAED0EQCAAIAAtAIgDQQNxIAQgBRB2IABEAAAAAAAAAABEAAAAAAAAAAAQcwsgCkFAayQACw0AIAAoAgAtAABBAXELFQAgACgCACIAIAAtAABB/gFxOgAACxAAIAAoAgAtAABBBHFBAnYLegECfyMAQRBrIgEkACAAKAIAIgAoAggEQANAIAAtAAAiAkEEcUUEQCAAIAJBBHI6AAAgACgCECICBEAgACACEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQELCyABQRBqJAAPCyABQYAINgIAIABBBUHYJSABECwQJAALLgEBfyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALIAAoAgBBADYCEAsXACAAKAIEKAIIIgAgACgCACgCCBEAAAsuAQF/IAAoAgghAiAAIAE2AgggAgRAIAIgAigCACgCBBEAAAsgACgCAEEFNgIQCz4BAX8gACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIAIgBBADYCCCAAIAAtAABB7wFxOgAAC0kBAX8jAEEQayIGJAAgBiABKAIEKAIEIgEgAiADIAQgBSABKAIAKAIIERAAIAAgBisDALY4AgAgACAGKwMItjgCBCAGQRBqJAALcwECfyMAQRBrIgIkACAAKAIEIQMgACABNgIEIAMEQCADIAMoAgAoAgQRAAALIAAoAgAiACgC6AMgACgC7ANHBEAgAkH5IzYCACAAQQVB2CUgAhAsECQACyAAQQQ2AgggACAALQAAQRByOgAAIAJBEGokAAs8AQF/AkAgACgCACIAKALsAyAAKALoAyIAa0ECdSABTQ0AIAAgAUECdGooAgAiAEUNACAAKAIEIQILIAILGQAgACgCACgC5AMiAEUEQEEADwsgACgCBAsXACAAKAIAIgAoAuwDIAAoAugDa0ECdQuOAwEDfyMAQdACayICJAACQCAAKAIAIgAoAuwDIAAoAugDRg0AIAEoAgAiAygC5AMhASAAIAMQb0UNACAAIAFGBEAgAkEIakEAQcQCECoaIAJBADoAGCACQgA3AxAgAkGAgID+BzYCDCACQRxqQQBBxAEQKhogAkHgAWohBCACQSBqIQEDQCABQoCAgPyLgIDAv383AhAgAUKBgICAEDcCCCABQoCAgPyLgIDAv383AgAgAUEYaiIBIARHDQALIAJCgICA/IuAgMC/fzcD8AEgAkKBgICAEDcD6AEgAkKAgID8i4CAwL9/NwPgASACQoCAgP6HgIDg/wA3AoQCIAJCgICA/oeAgOD/ADcC/AEgAiACLQD4AUH4AXE6APgBIAJBjAJqQQBBwAAQKhogA0GYAWogAkEIakHEAhArGiADQQA2AuQDCwNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIAJB0AJqJAAL4AcBCH8jAEHQAGsiByQAIAAoAgAhAAJAAkAgASgCACIIKALkA0UEQCAAKAIIDQEgCC0AF0EQdEGAgDBxQYCAIEYEQCAAIAAoAuADQQFqNgLgAwsgACgC6AMiASACQQJ0aiEGAkAgACgC7AMiBCAAQfADaiIDKAIAIgVJBEAgBCAGRgRAIAYgCDYCACAAIAZBBGo2AuwDDAILIAQgBCICQQRrIgFLBEADQCACIAEoAgA2AgAgAkEEaiECIAFBBGoiASAESQ0ACwsgACACNgLsAyAGQQRqIgEgBEcEQCAEIAQgAWsiAUF8cWsgBiABEDMaCyAGIAg2AgAMAQsgBCABa0ECdUEBaiIEQYCAgIAETw0DAkAgB0EgakH/////AyAFIAFrIgFBAXUiBSAEIAQgBUkbIAFB/P///wdPGyACIAMQSiIDKAIIIgIgAygCDEcNACADKAIEIgEgAygCACIESwRAIAMgASABIARrQQJ1QQFqQX5tQQJ0IgRqIAEgAiABayIBEDMgAWoiAjYCCCADIAMoAgQgBGo2AgQMAQsgB0E4akEBIAIgBGtBAXUgAiAERhsiASABQQJ2IAMoAhAQSiIFKAIIIQQCfyADKAIIIgIgAygCBCIBRgRAIAQhAiABDAELIAQgAiABa2ohAgNAIAQgASgCADYCACABQQRqIQEgBEEEaiIEIAJHDQALIAMoAgghASADKAIECyEEIAMoAgAhCSADIAUoAgA2AgAgBSAJNgIAIAMgBSgCBDYCBCAFIAQ2AgQgAyACNgIIIAUgATYCCCADKAIMIQogAyAFKAIMNgIMIAUgCjYCDCABIARHBEAgBSABIAQgAWtBA2pBfHFqNgIICyAJRQ0AIAkQIyADKAIIIQILIAIgCDYCACADIAMoAghBBGo2AgggAyADKAIEIAYgACgC6AMiAWsiAmsgASACEDM2AgQgAygCCCAGIAAoAuwDIAZrIgQQMyEGIAAoAugDIQEgACADKAIENgLoAyADIAE2AgQgACgC7AMhAiAAIAQgBmo2AuwDIAMgAjYCCCAAKALwAyEEIAAgAygCDDYC8AMgAyABNgIAIAMgBDYCDCABIAJHBEAgAyACIAEgAmtBA2pBfHFqNgIICyABRQ0AIAEQIwsgCCAANgLkAwNAIAAtAAAiAUEEcUUEQCAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQELCyAHQdAAaiQADwsgB0HEIzYCECAAQQVB2CUgB0EQahAsECQACyAHQckkNgIAIABBBUHYJSAHECwQJAALEAIACxAAIAAoAgAtAABBAnFBAXYLWQIBfwF9IwBBEGsiAiQAIAJBCGogACgCACIAQfwAaiAAIAFB/wFxQQF0ai8BaBAfQwAAwH8hAwJAAkAgAi0ADA4EAQAAAQALIAIqAgghAwsgAkEQaiQAIAMLTgEBfyMAQRBrIgMkACADQQhqIAEoAgAiAUH8AGogASACQf8BcUEBdGovAUQQHyADLQAMIQEgACADKgIIuzkDCCAAIAE2AgAgA0EQaiQAC14CAX8BfCMAQRBrIgIkACACQQhqIAAoAgAiAEH8AGogACABQf8BcUEBdGovAVYQH0QAAAAAAAD4fyEDAkACQCACLQAMDgQBAAABAAsgAioCCLshAwsgAkEQaiQAIAMLJAEBfUMAAMB/IAAoAgAiAEH8AGogAC8BehAgIgEgASABXBu7C0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXgQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXYQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXQQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXIQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAXAQHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0QBAX8jAEEQayICJAAgAkEIaiABKAIAIgFB/ABqIAEvAW4QHyACLQAMIQEgACACKgIIuzkDCCAAIAE2AgAgAkEQaiQAC0gCAX8BfQJ9IAAoAgAiAEH8AGoiASAALwEcECAiAiACXARAQwAAgD9DAAAAACAAKAL0Ay0ACEEBcRsMAQsgASAALwEcECALuws2AgF/AX0gACgCACIAQfwAaiIBIAAvARoQICICIAJcBEBEAAAAAAAAAAAPCyABIAAvARoQILsLRAEBfyMAQRBrIgIkACACQQhqIAEoAgAiAUH8AGogAS8BHhAfIAItAAwhASAAIAIqAgi7OQMIIAAgATYCACACQRBqJAALEAAgACgCAC0AF0ECdkEDcQsNACAAKAIALQAXQQNxC04BAX8jAEEQayIDJAAgA0EIaiABKAIAIgFB/ABqIAEgAkH/AXFBAXRqLwEgEB8gAy0ADCEBIAAgAyoCCLs5AwggACABNgIAIANBEGokAAsQACAAKAIALQAUQQR2QQdxCw0AIAAoAgAvABVBDnYLDQAgACgCAC0AFEEDcQsQACAAKAIALQAUQQJ2QQNxCw0AIAAoAgAvABZBD3ELEAAgACgCAC8AFUEEdkEPcQsNACAAKAIALwAVQQ9xC04BAX8jAEEQayIDJAAgA0EIaiABKAIAIgFB/ABqIAEgAkH/AXFBAXRqLwEyEB8gAy0ADCEBIAAgAyoCCLs5AwggACABNgIAIANBEGokAAsQACAAKAIALwAVQQx2QQNxCxAAIAAoAgAtABdBBHZBAXELgQECA38BfSMAQRBrIgMkACAAKAIAIQQCfSACtiIGIAZcBEBBACEAQwAAwH8MAQtBAEECIAZDAACAf1sgBkMAAID/W3IiBRshAEMAAMB/IAYgBRsLIQYgAyAAOgAMIAMgBjgCCCADIAMpAwg3AwAgBCABQf8BcSADEIgBIANBEGokAAt5AgF9An8jAEEQayIEJAAgACgCACEFIAQCfyACtiIDIANcBEBDAADAfyEDQQAMAQtDAADAfyADIANDAACAf1sgA0MAAID/W3IiABshAyAARQs6AAwgBCADOAIIIAQgBCkDCDcDACAFIAFB/wFxIAQQiAEgBEEQaiQAC3EBAX8CQCAAKAIAIgAtAAAiAkECcUEBdiABRg0AIAAgAkH9AXFBAkEAIAEbcjoAAANAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC4EBAgN/AX0jAEEQayIDJAAgACgCACEEAn0gArYiBiAGXARAQQAhAEMAAMB/DAELQQBBAiAGQwAAgH9bIAZDAACA/1tyIgUbIQBDAADAfyAGIAUbCyEGIAMgADoADCADIAY4AgggAyADKQMINwMAIAQgAUH/AXEgAxCOASADQRBqJAALeQIBfQJ/IwBBEGsiBCQAIAAoAgAhBSAEAn8gArYiAyADXARAQwAAwH8hA0EADAELQwAAwH8gAyADQwAAgH9bIANDAACA/1tyIgAbIQMgAEULOgAMIAQgAzgCCCAEIAQpAwg3AwAgBSABQf8BcSAEEI4BIARBEGokAAv5AQICfQR/IwBBEGsiBSQAIAAoAgAhAAJ/IAK2IgMgA1wEQEMAAMB/IQNBAAwBC0MAAMB/IAMgA0MAAIB/WyADQwAAgP9bciIGGyEDIAZFCyEGQQEhByAFQQhqIABB/ABqIgggACABQf8BcUEBdGpB1gBqIgEvAQAQHwJAAkAgAyAFKgIIIgRcBH8gBCAEWw0BIAMgA1wFIAcLRQ0AIAUtAAwgBkYNAQsgCCABIAMgBhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgBUEQaiQAC7UBAgN/An0CQCAAKAIAIgBB/ABqIgMgAEH6AGoiAi8BABAgIgYgAbYiBVsNACAFIAVbIgRFIAYgBlxxDQACQCAEIAVDAAAAAFsgBYtDAACAf1tyRXFFBEAgAiACLwEAQfj/A3E7AQAMAQsgAyACIAVBAxBMCwNAIAAtAAAiAkEEcQ0BIAAgAkEEcjoAACAAKAIQIgIEQCAAIAIRAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EBIAIQVSACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEBIAMQVSADQRBqJAALfAIDfwF9IwBBEGsiAiQAIAAoAgAhAwJ9IAG2IgUgBVwEQEEAIQBDAADAfwwBC0EAQQIgBUMAAIB/WyAFQwAAgP9bciIEGyEAQwAAwH8gBSAEGwshBSACIAA6AAwgAiAFOAIIIAIgAikDCDcDACADQQAgAhBVIAJBEGokAAt0AgF9An8jAEEQayIDJAAgACgCACEEIAMCfyABtiICIAJcBEBDAADAfyECQQAMAQtDAADAfyACIAJDAACAf1sgAkMAAID/W3IiABshAiAARQs6AAwgAyACOAIIIAMgAykDCDcDACAEQQAgAxBVIANBEGokAAt8AgN/AX0jAEEQayICJAAgACgCACEDAn0gAbYiBSAFXARAQQAhAEMAAMB/DAELQQBBAiAFQwAAgH9bIAVDAACA/1tyIgQbIQBDAADAfyAFIAQbCyEFIAIgADoADCACIAU4AgggAiACKQMINwMAIANBASACEFYgAkEQaiQAC3QCAX0CfyMAQRBrIgMkACAAKAIAIQQgAwJ/IAG2IgIgAlwEQEMAAMB/IQJBAAwBC0MAAMB/IAIgAkMAAIB/WyACQwAAgP9bciIAGyECIABFCzoADCADIAI4AgggAyADKQMINwMAIARBASADEFYgA0EQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EAIAIQViACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEAIAMQViADQRBqJAALPwEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIABBASABEEYgAUEQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EBIAIQRiACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEBIAMQRiADQRBqJAALPwEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIABBACABEEYgAUEQaiQAC3wCA38BfSMAQRBrIgIkACAAKAIAIQMCfSABtiIFIAVcBEBBACEAQwAAwH8MAQtBAEECIAVDAACAf1sgBUMAAID/W3IiBBshAEMAAMB/IAUgBBsLIQUgAiAAOgAMIAIgBTgCCCACIAIpAwg3AwAgA0EAIAIQRiACQRBqJAALdAIBfQJ/IwBBEGsiAyQAIAAoAgAhBCADAn8gAbYiAiACXARAQwAAwH8hAkEADAELQwAAwH8gAiACQwAAgH9bIAJDAACA/1tyIgAbIQIgAEULOgAMIAMgAjgCCCADIAMpAwg3AwAgBEEAIAMQRiADQRBqJAALoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRxqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRpqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLPQEBfyMAQRBrIgEkACAAKAIAIQAgAUEDOgAMIAFBgICA/gc2AgggASABKQMINwMAIAAgARBrIAFBEGokAAt6AgN/AX0jAEEQayICJAAgACgCACEDAn0gAbYiBSAFXARAQQAhAEMAAMB/DAELQQBBAiAFQwAAgH9bIAVDAACA/1tyIgQbIQBDAADAfyAFIAQbCyEFIAIgADoADCACIAU4AgggAiACKQMINwMAIAMgAhBrIAJBEGokAAtyAgF9An8jAEEQayIDJAAgACgCACEEIAMCfyABtiICIAJcBEBDAADAfyECQQAMAQtDAADAfyACIAJDAACAf1sgAkMAAID/W3IiABshAiAARQs6AAwgAyACOAIIIAMgAykDCDcDACAEIAMQayADQRBqJAALoAECA38CfQJAIAAoAgAiAEH8AGoiAyAAQRhqIgIvAQAQICIGIAG2IgVbDQAgBSAFWyIERSAGIAZccQ0AAkAgBEUEQCACIAIvAQBB+P8DcTsBAAwBCyADIAIgBUEDEEwLA0AgAC0AACICQQRxDQEgACACQQRyOgAAIAAoAhAiAgRAIAAgAhEAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLkAEBAX8CQCAAKAIAIgBBF2otAAAiAkECdkEDcSABQf8BcUYNACAAIAAvABUgAkEQdHIiAjsAFSAAIAJB///PB3EgAUEDcUESdHJBEHY6ABcDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuNAQEBfwJAIAAoAgAiAEEXai0AACICQQNxIAFB/wFxRg0AIAAgAC8AFSACQRB0ciICOwAVIAAgAkH///MHcSABQQNxQRB0ckEQdjoAFwNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC0MBAX8jAEEQayICJAAgACgCACEAIAJBAzoADCACQYCAgP4HNgIIIAIgAikDCDcDACAAIAFB/wFxIAIQZSACQRBqJAALgAECA38BfSMAQRBrIgMkACAAKAIAIQQCfSACtiIGIAZcBEBBACEAQwAAwH8MAQtBAEECIAZDAACAf1sgBkMAAID/W3IiBRshAEMAAMB/IAYgBRsLIQYgAyAAOgAMIAMgBjgCCCADIAMpAwg3AwAgBCABQf8BcSADEGUgA0EQaiQAC3gCAX0CfyMAQRBrIgQkACAAKAIAIQUgBAJ/IAK2IgMgA1wEQEMAAMB/IQNBAAwBC0MAAMB/IAMgA0MAAIB/WyADQwAAgP9bciIAGyEDIABFCzoADCAEIAM4AgggBCAEKQMINwMAIAUgAUH/AXEgBBBlIARBEGokAAt3AQF/AkAgACgCACIALQAUIgJBBHZBB3EgAUH/AXFGDQAgACACQY8BcSABQQR0QfAAcXI6ABQDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuJAQEBfwJAIAFB/wFxIAAoAgAiAC8AFSICQQ52Rg0AIABBF2ogAiAALQAXQRB0ciICQRB2OgAAIAAgAkH//wBxIAFBDnRyOwAVA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLcAEBfwJAIAAoAgAiAC0AFCICQQNxIAFB/wFxRg0AIAAgAkH8AXEgAUEDcXI6ABQDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwt2AQF/AkAgACgCACIALQAUIgJBAnZBA3EgAUH/AXFGDQAgACACQfMBcSABQQJ0QQxxcjoAFANAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC48BAQF/AkAgACgCACIALwAVIgJBCHZBD3EgAUH/AXFGDQAgAEEXaiACIAAtABdBEHRyIgJBEHY6AAAgACACQf/hA3EgAUEPcUEIdHI7ABUDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwuPAQEBfwJAIAFB/wFxIAAoAgAiAC8AFSAAQRdqLQAAQRB0ciICQfABcUEEdkYNACAAIAJBEHY6ABcgACACQY/+A3EgAUEEdEHwAXFyOwAVA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsLhwEBAX8CQCAAKAIAIgAvABUgAEEXai0AAEEQdHIiAkEPcSABQf8BcUYNACAAIAJBEHY6ABcgACACQfD/A3EgAUEPcXI7ABUDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCwtDAQF/IwBBEGsiAiQAIAAoAgAhACACQQM6AAwgAkGAgID+BzYCCCACIAIpAwg3AwAgACABQf8BcSACEGcgAkEQaiQAC4ABAgN/AX0jAEEQayIDJAAgACgCACEEAn0gArYiBiAGXARAQQAhAEMAAMB/DAELQQBBAiAGQwAAgH9bIAZDAACA/1tyIgUbIQBDAADAfyAGIAUbCyEGIAMgADoADCADIAY4AgggAyADKQMINwMAIAQgAUH/AXEgAxBnIANBEGokAAt4AgF9An8jAEEQayIEJAAgACgCACEFIAQCfyACtiIDIANcBEBDAADAfyEDQQAMAQtDAADAfyADIANDAACAf1sgA0MAAID/W3IiABshAyAARQs6AAwgBCADOAIIIAQgBCkDCDcDACAFIAFB/wFxIAQQZyAEQRBqJAALjwEBAX8CQCAAKAIAIgAvABUiAkEMdkEDcSABQf8BcUYNACAAQRdqIAIgAC0AF0EQdHIiAkEQdjoAACAAIAJB/58DcSABQQNxQQx0cjsAFQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLC5ABAQF/AkAgACgCACIAQRdqLQAAIgJBBHZBAXEgAUH/AXFGDQAgACAALwAVIAJBEHRyIgI7ABUgACACQf//vwdxIAFBAXFBFHRyQRB2OgAXA0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsL9g0CCH8CfSMAQRBrIgIkAAJAAkAgASgCACIFLQAUIAAoAgAiAS0AFHNB/wBxDQAgBS8AFSAFLQAXQRB0ciABLwAVIAEtABdBEHRyc0H//z9xDQAgBUH8AGohByABQfwAaiEIAkAgAS8AGCIAQQdxRQRAIAUtABhBB3FFDQELIAggABAgIgogByAFLwAYECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AGiIAQQdxRQRAIAUtABpBB3FFDQELIAggABAgIgogByAFLwAaECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AHCIAQQdxRQRAIAUtABxBB3FFDQELIAggABAgIgogByAFLwAcECAiC1sNACAKIApbIAsgC1tyDQELAkAgAS8AHiIAQQdxRQRAIAUtAB5BB3FFDQELIAJBCGogCCAAEB8gAiAHIAUvAB4QH0EBIQAgAioCCCIKIAIqAgAiC1wEfyAKIApbDQIgCyALXAUgAAtFDQEgAi0ADCACLQAERw0BCyAFQSBqIQAgAUEgaiEGA0ACQCAGIANBAXRqLwAAIgRBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAQQHyACIAcgAC8AABAfQQEhBCACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSAEC0UNAiACLQAMIAItAARHDQILIABBAmohACADQQFqIgNBCUcNAAsgBUEyaiEAIAFBMmohBkEAIQMDQAJAIAYgA0EBdGovAAAiBEEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBBAfIAIgByAALwAAEB9BASEEIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAQLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAIANBAWoiA0EJRw0ACyAFQcQAaiEAIAFBxABqIQZBACEDA0ACQCAGIANBAXRqLwAAIgRBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAQQHyACIAcgAC8AABAfQQEhBCACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSAEC0UNAiACLQAMIAItAARHDQILIABBAmohACADQQFqIgNBCUcNAAsgBUHWAGohACABQdYAaiEGQQAhAwNAAkAgBiADQQF0ai8AACIEQQdxRQRAIAAtAABBB3FFDQELIAJBCGogCCAEEB8gAiAHIAAvAAAQH0EBIQQgAioCCCIKIAIqAgAiC1wEfyAKIApbDQMgCyALXAUgBAtFDQIgAi0ADCACLQAERw0CCyAAQQJqIQAgA0EBaiIDQQlHDQALIAVB6ABqIQAgAUHoAGohBkEAIQMDQAJAIAYgA0EBdGovAAAiBEEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBBAfIAIgByAALwAAEB9BASEEIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAQLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAIANBAWoiA0EDRw0ACyAFQe4AaiEAIAFB7gBqIQlBACEEQQAhAwNAAkAgCSADQQF0ai8AACIGQQdxRQRAIAAtAABBB3FFDQELIAJBCGogCCAGEB8gAiAHIAAvAAAQH0EBIQMgAioCCCIKIAIqAgAiC1wEfyAKIApbDQMgCyALXAUgAwtFDQIgAi0ADCACLQAERw0CCyAAQQJqIQBBASEDIAQhBkEBIQQgBkUNAAsgBUHyAGohACABQfIAaiEJQQAhBEEAIQMDQAJAIAkgA0EBdGovAAAiBkEHcUUEQCAALQAAQQdxRQ0BCyACQQhqIAggBhAfIAIgByAALwAAEB9BASEDIAIqAggiCiACKgIAIgtcBH8gCiAKWw0DIAsgC1wFIAMLRQ0CIAItAAwgAi0ABEcNAgsgAEECaiEAQQEhAyAEIQZBASEEIAZFDQALIAVB9gBqIQAgAUH2AGohCUEAIQRBACEDA0ACQCAJIANBAXRqLwAAIgZBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAYQHyACIAcgAC8AABAfQQEhAyACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSADC0UNAiACLQAMIAItAARHDQILIABBAmohAEEBIQMgBCEGQQEhBCAGRQ0ACyABLwB6IgBBB3FFBEAgBS0AekEHcUUNAgsgCCAAECAiCiAHIAUvAHoQICILWw0BIAogClsNACALIAtcDQELIAFBFGogBUEUakHoABArGiABQfwAaiAFQfwAahCgAQNAIAEtAAAiAEEEcQ0BIAEgAEEEcjoAACABKAIQIgAEQCABIAARAAALIAFBgICA/gc2ApwBIAEoAuQDIgENAAsLIAJBEGokAAvGAwEEfyMAQaAEayICJAAgACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALAkAgACgCACIAKALoAyAAKALsA0YEQCAAKALkAw0BIAAgAkEYaiAAKAL0AxBcIgEpAgA3AgAgACABKAIQNgIQIAAgASkCCDcCCCAAQRRqIAFBFGpB6AAQKxogACABKQKMATcCjAEgACABKQKEATcChAEgACABKQJ8NwJ8IAEoApQBIQQgAUEANgKUASAAKAKUASEDIAAgBDYClAEgAwRAIAMQWwsgAEGYAWogAUGYAWpB0AIQKxogACgC6AMiAwRAIAAgAzYC7AMgAxAjCyAAIAEoAugDNgLoAyAAIAEoAuwDNgLsAyAAIAEoAvADNgLwAyABQQA2AvADIAFCADcC6AMgACABKQL8AzcC/AMgACABKQL0AzcC9AMgACABKAKEBDYChAQgASgClAEhACABQQA2ApQBIAAEQCAAEFsLIAJBoARqJAAPCyACQfAcNgIQIABBBUHYJSACQRBqECwQJAALIAJB5hE2AgAgAEEFQdglIAIQLBAkAAsLAEEMEB4gABCiAQsLAEEMEB5BABCiAQsNACAAKAIALQAIQQFxCwoAIAAoAgAoAhQLGQAgAUH/AXEEQBACAAsgACgCACgCEEEBcQsYACAAKAIAIgAgAC0ACEH+AXEgAXI6AAgLJgAgASAAKAIAIgAoAhRHBEAgACABNgIUIAAgACgCDEEBajYCDAsLkgEBAn8jAEEQayICJAAgACgCACEAIAFDAAAAAGAEQCABIAAqAhhcBEAgACABOAIYIAAgACgCDEEBajYCDAsgAkEQaiQADwsgAkGIFDYCACMAQRBrIgMkACADIAI2AgwCQCAARQRAQbgwQdglIAIQSRoMAQsgAEEAQQVB2CUgAiAAKAIEEQ0AGgsgA0EQaiQAECQACz8AIAFB/wFxRQRAIAIgACgCACIAKAIQIgFBAXFHBEAgACABQX5xIAJyNgIQIAAgACgCDEEBajYCDAsPCxACAAsL4CYjAEGACAuBHk9ubHkgbGVhZiBub2RlcyB3aXRoIGN1c3RvbSBtZWFzdXJlIGZ1bmN0aW9ucyBzaG91bGQgbWFudWFsbHkgbWFyayB0aGVtc2VsdmVzIGFzIGRpcnR5AGlzRGlydHkAbWFya0RpcnR5AGRlc3Ryb3kAc2V0RGlzcGxheQBnZXREaXNwbGF5AHNldEZsZXgALSsgICAwWDB4AC0wWCswWCAwWC0weCsweCAweABzZXRGbGV4R3JvdwBnZXRGbGV4R3JvdwBzZXRPdmVyZmxvdwBnZXRPdmVyZmxvdwBoYXNOZXdMYXlvdXQAY2FsY3VsYXRlTGF5b3V0AGdldENvbXB1dGVkTGF5b3V0AHVuc2lnbmVkIHNob3J0AGdldENoaWxkQ291bnQAdW5zaWduZWQgaW50AHNldEp1c3RpZnlDb250ZW50AGdldEp1c3RpZnlDb250ZW50AGF2YWlsYWJsZUhlaWdodCBpcyBpbmRlZmluaXRlIHNvIGhlaWdodFNpemluZ01vZGUgbXVzdCBiZSBTaXppbmdNb2RlOjpNYXhDb250ZW50AGF2YWlsYWJsZVdpZHRoIGlzIGluZGVmaW5pdGUgc28gd2lkdGhTaXppbmdNb2RlIG11c3QgYmUgU2l6aW5nTW9kZTo6TWF4Q29udGVudABzZXRBbGlnbkNvbnRlbnQAZ2V0QWxpZ25Db250ZW50AGdldFBhcmVudABpbXBsZW1lbnQAc2V0TWF4SGVpZ2h0UGVyY2VudABzZXRIZWlnaHRQZXJjZW50AHNldE1pbkhlaWdodFBlcmNlbnQAc2V0RmxleEJhc2lzUGVyY2VudABzZXRHYXBQZXJjZW50AHNldFBvc2l0aW9uUGVyY2VudABzZXRNYXJnaW5QZXJjZW50AHNldE1heFdpZHRoUGVyY2VudABzZXRXaWR0aFBlcmNlbnQAc2V0TWluV2lkdGhQZXJjZW50AHNldFBhZGRpbmdQZXJjZW50AGhhbmRsZS50eXBlKCkgPT0gU3R5bGVWYWx1ZUhhbmRsZTo6VHlwZTo6UG9pbnQgfHwgaGFuZGxlLnR5cGUoKSA9PSBTdHlsZVZhbHVlSGFuZGxlOjpUeXBlOjpQZXJjZW50AGNyZWF0ZURlZmF1bHQAdW5pdAByaWdodABoZWlnaHQAc2V0TWF4SGVpZ2h0AGdldE1heEhlaWdodABzZXRIZWlnaHQAZ2V0SGVpZ2h0AHNldE1pbkhlaWdodABnZXRNaW5IZWlnaHQAZ2V0Q29tcHV0ZWRIZWlnaHQAZ2V0Q29tcHV0ZWRSaWdodABsZWZ0AGdldENvbXB1dGVkTGVmdAByZXNldABfX2Rlc3RydWN0AGZsb2F0AHVpbnQ2NF90AHVzZVdlYkRlZmF1bHRzAHNldFVzZVdlYkRlZmF1bHRzAHNldEFsaWduSXRlbXMAZ2V0QWxpZ25JdGVtcwBzZXRGbGV4QmFzaXMAZ2V0RmxleEJhc2lzAENhbm5vdCBnZXQgbGF5b3V0IHByb3BlcnRpZXMgb2YgbXVsdGktZWRnZSBzaG9ydGhhbmRzAHNldFBvaW50U2NhbGVGYWN0b3IATWVhc3VyZUNhbGxiYWNrV3JhcHBlcgBEaXJ0aWVkQ2FsbGJhY2tXcmFwcGVyAENhbm5vdCByZXNldCBhIG5vZGUgc3RpbGwgYXR0YWNoZWQgdG8gYSBvd25lcgBzZXRCb3JkZXIAZ2V0Qm9yZGVyAGdldENvbXB1dGVkQm9yZGVyAGdldE51bWJlcgBoYW5kbGUudHlwZSgpID09IFN0eWxlVmFsdWVIYW5kbGU6OlR5cGU6Ok51bWJlcgB1bnNpZ25lZCBjaGFyAHRvcABnZXRDb21wdXRlZFRvcABzZXRGbGV4V3JhcABnZXRGbGV4V3JhcABzZXRHYXAAZ2V0R2FwACVwAHNldEhlaWdodEF1dG8Ac2V0RmxleEJhc2lzQXV0bwBzZXRQb3NpdGlvbkF1dG8Ac2V0TWFyZ2luQXV0bwBzZXRXaWR0aEF1dG8AU2NhbGUgZmFjdG9yIHNob3VsZCBub3QgYmUgbGVzcyB0aGFuIHplcm8Ac2V0QXNwZWN0UmF0aW8AZ2V0QXNwZWN0UmF0aW8Ac2V0UG9zaXRpb24AZ2V0UG9zaXRpb24Abm90aWZ5T25EZXN0cnVjdGlvbgBzZXRGbGV4RGlyZWN0aW9uAGdldEZsZXhEaXJlY3Rpb24Ac2V0RGlyZWN0aW9uAGdldERpcmVjdGlvbgBzZXRNYXJnaW4AZ2V0TWFyZ2luAGdldENvbXB1dGVkTWFyZ2luAG1hcmtMYXlvdXRTZWVuAG5hbgBib3R0b20AZ2V0Q29tcHV0ZWRCb3R0b20AYm9vbABlbXNjcmlwdGVuOjp2YWwAc2V0RmxleFNocmluawBnZXRGbGV4U2hyaW5rAHNldEFsd2F5c0Zvcm1zQ29udGFpbmluZ0Jsb2NrAE1lYXN1cmVDYWxsYmFjawBEaXJ0aWVkQ2FsbGJhY2sAZ2V0TGVuZ3RoAHdpZHRoAHNldE1heFdpZHRoAGdldE1heFdpZHRoAHNldFdpZHRoAGdldFdpZHRoAHNldE1pbldpZHRoAGdldE1pbldpZHRoAGdldENvbXB1dGVkV2lkdGgAcHVzaAAvaG9tZS9ydW5uZXIvd29yay95b2dhL3lvZ2EvamF2YXNjcmlwdC8uLi95b2dhL3N0eWxlL1NtYWxsVmFsdWVCdWZmZXIuaAAvaG9tZS9ydW5uZXIvd29yay95b2dhL3lvZ2EvamF2YXNjcmlwdC8uLi95b2dhL3N0eWxlL1N0eWxlVmFsdWVQb29sLmgAdW5zaWduZWQgbG9uZwBzZXRCb3hTaXppbmcAZ2V0Qm94U2l6aW5nAHN0ZDo6d3N0cmluZwBzdGQ6OnN0cmluZwBzdGQ6OnUxNnN0cmluZwBzdGQ6OnUzMnN0cmluZwBzZXRQYWRkaW5nAGdldFBhZGRpbmcAZ2V0Q29tcHV0ZWRQYWRkaW5nAFRyaWVkIHRvIGNvbnN0cnVjdCBZR05vZGUgd2l0aCBudWxsIGNvbmZpZwBBdHRlbXB0aW5nIHRvIGNvbnN0cnVjdCBOb2RlIHdpdGggbnVsbCBjb25maWcAY3JlYXRlV2l0aENvbmZpZwBpbmYAc2V0QWxpZ25TZWxmAGdldEFsaWduU2VsZgBTaXplAHZhbHVlAFZhbHVlAGNyZWF0ZQBtZWFzdXJlAHNldFBvc2l0aW9uVHlwZQBnZXRQb3NpdGlvblR5cGUAaXNSZWZlcmVuY2VCYXNlbGluZQBzZXRJc1JlZmVyZW5jZUJhc2VsaW5lAGNvcHlTdHlsZQBkb3VibGUATm9kZQBleHRlbmQAaW5zZXJ0Q2hpbGQAZ2V0Q2hpbGQAcmVtb3ZlQ2hpbGQAdm9pZABzZXRFeHBlcmltZW50YWxGZWF0dXJlRW5hYmxlZABpc0V4cGVyaW1lbnRhbEZlYXR1cmVFbmFibGVkAGRpcnRpZWQAQ2Fubm90IHJlc2V0IGEgbm9kZSB3aGljaCBzdGlsbCBoYXMgY2hpbGRyZW4gYXR0YWNoZWQAdW5zZXRNZWFzdXJlRnVuYwB1bnNldERpcnRpZWRGdW5jAHNldEVycmF0YQBnZXRFcnJhdGEATWVhc3VyZSBmdW5jdGlvbiByZXR1cm5lZCBhbiBpbnZhbGlkIGRpbWVuc2lvbiB0byBZb2dhOiBbd2lkdGg9JWYsIGhlaWdodD0lZl0ARXhwZWN0IGN1c3RvbSBiYXNlbGluZSBmdW5jdGlvbiB0byBub3QgcmV0dXJuIE5hTgBOQU4ASU5GAGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50MzJfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8Y2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dW5zaWduZWQgY2hhcj4Ac3RkOjpiYXNpY19zdHJpbmc8dW5zaWduZWQgY2hhcj4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8c2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGxvbmc+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGRvdWJsZT4AQ2hpbGQgYWxyZWFkeSBoYXMgYSBvd25lciwgaXQgbXVzdCBiZSByZW1vdmVkIGZpcnN0LgBDYW5ub3Qgc2V0IG1lYXN1cmUgZnVuY3Rpb246IE5vZGVzIHdpdGggbWVhc3VyZSBmdW5jdGlvbnMgY2Fubm90IGhhdmUgY2hpbGRyZW4uAENhbm5vdCBhZGQgY2hpbGQ6IE5vZGVzIHdpdGggbWVhc3VyZSBmdW5jdGlvbnMgY2Fubm90IGhhdmUgY2hpbGRyZW4uAChudWxsKQBpbmRleCA8IDQwOTYgJiYgIlNtYWxsVmFsdWVCdWZmZXIgY2FuIG9ubHkgaG9sZCB1cCB0byA0MDk2IGNodW5rcyIAJXMKAAEAAAADAAAAAAAAAAIAAAADAAAAAQAAAAIAAAAAAAAAAQAAAAEAQYwmCwdpaQB2AHZpAEGgJgs3ox0AAKEdAADhHQAA2x0AAOEdAADbHQAAaWlpZmlmaQDUHQAApB0AAHZpaQClHQAA6B0AAGlpaQBB4CYLCcQAAADFAAAAxgBB9CYLDsQAAADHAAAAyAAAANQdAEGQJws+ox0AAOEdAADbHQAA4R0AANsdAADoHQAA4x0AAOgdAABpaWlpAAAAANQdAAC5HQAA1B0AALsdAAC8HQAA6B0AQdgnCwnJAAAAygAAAMsAQewnCxbJAAAAzAAAAMgAAAC/HQAA1B0AAL8dAEGQKAuiA9QdAAC/HQAA2x0AANUdAAB2aWlpaQAAANQdAAC/HQAA4R0AAHZpaWYAAAAA1B0AAL8dAADbHQAAdmlpaQAAAADUHQAAvx0AANUdAADVHQAAwB0AANsdAADbHQAAwB0AANUdAADAHQAAaQBkaWkAdmlpZAAAxB0AAMQdAAC/HQAA1B0AAMQdAADUHQAAxB0AAMMdAADUHQAAxB0AANsdAADUHQAAxB0AANsdAADiHQAAdmlpaWQAAADUHQAAxB0AAOIdAADbHQAAxR0AAMIdAADFHQAA2x0AAMIdAADFHQAA4h0AAMUdAADiHQAAxR0AANsdAABkaWlpAAAAAOEdAADEHQAA2x0AAGZpaWkAAAAA1B0AAMQdAADEHQAA3B0AANQdAADEHQAAxB0AANwdAADFHQAAxB0AAMQdAADEHQAAxB0AANwdAADUHQAAxB0AANUdAADVHQAAxB0AANQdAADEHQAAoR0AANQdAADEHQAAuR0AANUdAADFHQAAAAAAANQdAADEHQAA4h0AAOIdAADbHQAAdmlpZGRpAADBHQAAxR0AQcArC0EZAAoAGRkZAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABkAEQoZGRkDCgcAAQAJCxgAAAkGCwAACwAGGQAAABkZGQBBkSwLIQ4AAAAAAAAAABkACg0ZGRkADQAAAgAJDgAAAAkADgAADgBByywLAQwAQdcsCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT";if(!HH(BH)){var WH=BH;BH=A.locateFile?A.locateFile(WH,B):B+WH}function wH(){var RH=BH;try{if(RH==BH&&M)return new Uint8Array(M);if(HH(RH))try{var kH=c9(RH.slice(37)),eH=new Uint8Array(kH.length);for(RH=0;RH=kH?"_"+RH:RH}function IH(RH,kH){return RH=t(RH),function(){return kH.apply(this,arguments)}}var KH=[{},{value:void 0},{value:null},{value:!0},{value:!1}],MH=[];function CH(RH){var kH=Error,eH=IH(RH,function(W$){this.name=RH,this.message=W$,W$=Error(W$).stack,W$!==void 0&&(this.stack=this.toString()+` `,A),I=L===-1?H.substring(A):H.substring(A,L);if($=Math.max($,t9$(I)),L===-1)break;A=L+1}return $}var B0A=K(()=>{yBA()});function f0A(H,$=1,A={}){let{indent:L=" ",includeEmptyLines:I=!1}=A;if(typeof H!=="string")throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof H}\``);if(typeof $!=="number")throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof $}\``);if($<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${$}\``);if(typeof L!=="string")throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof L}\``);if($===0)return H;let D=I?/^/gm:/^(?!\s*$)/gm;return H.replace(D,L.repeat($))}var WR0=(H)=>{return H.getComputedWidth()-H.getComputedPadding(J1.Left)-H.getComputedPadding(J1.Right)-H.getComputedBorder(J1.Left)-H.getComputedBorder(J1.Right)},csL;var lsL=K(()=>{Qn();csL=WR0});var isL=z((zMf,VR0)=>{VR0.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}}});var rsL=z((NMf,E0A)=>{var nsL=isL();E0A.exports=nsL;E0A.exports.default=nsL});function c6(H){switch(H){case"light":return PR0;case"light-ansi":return _R0;case"dark-ansi":return YR0;case"light-daltonized":return CR0;case"dark-daltonized":return ZR0;default:return wR0}}function F1$(H){let $=H.match(/rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)/);if($){let A=parseInt($[1],10),L=parseInt($[2],10),I=parseInt($[3],10),D=qR0.rgb(A,L,I)("X");return D.slice(0,D.indexOf("X"))}return"\x1B[35m"}var asL,PR0,_R0,YR0,CR0,wR0,ZR0,qR0;var Ky=K(()=>{r0();Z1();asL=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],PR0={autoAccept:"rgb(135,0,255)",bashBorder:"rgb(255,0,135)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(245,149,117)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(87,105,247)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(117,135,255)",permission:"rgb(87,105,247)",permissionShimmer:"rgb(137,155,255)",planMode:"rgb(0,102,102)",delegateMode:"rgb(138,43,226)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",inactiveShimmer:"rgb(142,142,142)",subtle:"rgb(175,175,175)",suggestion:"rgb(87,105,247)",remember:"rgb(0,0,255)",background:"rgb(0,153,153)",success:"rgb(44,122,57)",error:"rgb(171,43,63)",warning:"rgb(150,108,30)",merged:"rgb(135,0,255)",warningShimmer:"rgb(200,158,80)",diffAdded:"rgb(105,219,124)",diffRemoved:"rgb(255,168,180)",diffAddedDimmed:"rgb(199,225,203)",diffRemovedDimmed:"rgb(253,210,216)",diffAddedWord:"rgb(47,157,68)",diffRemovedWord:"rgb(209,69,75)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(240, 240, 240)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(87,105,247)",rate_limit_empty:"rgb(39,47,111)",penguin:"rgb(255,106,0)",penguinShimmer:"rgb(255,150,50)"},_R0={autoAccept:"ansi:magenta",bashBorder:"ansi:magenta",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blue",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blue",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyan",delegateMode:"ansi:magenta",ide:"ansi:blueBright",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:black",inverseText:"ansi:white",inactive:"ansi:blackBright",inactiveShimmer:"ansi:white",subtle:"ansi:blackBright",suggestion:"ansi:blue",remember:"ansi:blue",background:"ansi:cyan",success:"ansi:green",error:"ansi:red",warning:"ansi:yellow",merged:"ansi:magenta",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",red_FOR_SUBAGENTS_ONLY:"ansi:red",blue_FOR_SUBAGENTS_ONLY:"ansi:blue",green_FOR_SUBAGENTS_ONLY:"ansi:green",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellow",purple_FOR_SUBAGENTS_ONLY:"ansi:magenta",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyan",professionalBlue:"ansi:blueBright",chromeYellow:"ansi:yellow",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:white",bashMessageBackgroundColor:"ansi:whiteBright",memoryBackgroundColor:"ansi:white",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:black",penguin:"ansi:red",penguinShimmer:"ansi:redBright"},YR0={autoAccept:"ansi:magentaBright",bashBorder:"ansi:magentaBright",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blueBright",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blueBright",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyanBright",delegateMode:"ansi:magentaBright",ide:"ansi:blue",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:whiteBright",inverseText:"ansi:black",inactive:"ansi:white",inactiveShimmer:"ansi:whiteBright",subtle:"ansi:white",suggestion:"ansi:blueBright",remember:"ansi:blueBright",background:"ansi:cyanBright",success:"ansi:greenBright",error:"ansi:redBright",warning:"ansi:yellowBright",merged:"ansi:magentaBright",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",red_FOR_SUBAGENTS_ONLY:"ansi:redBright",blue_FOR_SUBAGENTS_ONLY:"ansi:blueBright",green_FOR_SUBAGENTS_ONLY:"ansi:greenBright",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellowBright",purple_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyanBright",professionalBlue:"rgb(106,155,204)",chromeYellow:"ansi:yellowBright",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:blackBright",bashMessageBackgroundColor:"ansi:black",memoryBackgroundColor:"ansi:blackBright",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:white",penguin:"ansi:redBright",penguinShimmer:"ansi:redBright"},CR0={autoAccept:"rgb(135,0,255)",bashBorder:"rgb(0,102,204)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(51,102,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(101,152,255)",permission:"rgb(51,102,255)",permissionShimmer:"rgb(101,152,255)",planMode:"rgb(51,102,102)",delegateMode:"rgb(138,43,226)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",inactiveShimmer:"rgb(142,142,142)",subtle:"rgb(175,175,175)",suggestion:"rgb(51,102,255)",remember:"rgb(51,102,255)",background:"rgb(0,153,153)",success:"rgb(0,102,153)",error:"rgb(204,0,0)",warning:"rgb(255,153,0)",merged:"rgb(135,0,255)",warningShimmer:"rgb(255,183,50)",diffAdded:"rgb(153,204,255)",diffRemoved:"rgb(255,204,204)",diffAddedDimmed:"rgb(209,231,253)",diffRemovedDimmed:"rgb(255,233,233)",diffAddedWord:"rgb(51,102,204)",diffRemovedWord:"rgb(153,51,51)",red_FOR_SUBAGENTS_ONLY:"rgb(204,0,0)",blue_FOR_SUBAGENTS_ONLY:"rgb(0,102,204)",green_FOR_SUBAGENTS_ONLY:"rgb(0,204,0)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,204,0)",purple_FOR_SUBAGENTS_ONLY:"rgb(128,0,128)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,128,0)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,102,178)",cyan_FOR_SUBAGENTS_ONLY:"rgb(0,178,178)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(220, 220, 220)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(51,102,255)",rate_limit_empty:"rgb(23,46,114)",penguin:"rgb(255,106,0)",penguinShimmer:"rgb(255,150,50)"},wR0={autoAccept:"rgb(175,135,255)",bashBorder:"rgb(253,93,177)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(235,159,127)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(147,165,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(177,195,255)",permission:"rgb(177,185,249)",permissionShimmer:"rgb(207,215,255)",planMode:"rgb(72,150,140)",delegateMode:"rgb(186,85,255)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",inactiveShimmer:"rgb(193,193,193)",subtle:"rgb(80,80,80)",suggestion:"rgb(177,185,249)",remember:"rgb(177,185,249)",background:"rgb(0,204,204)",success:"rgb(78,186,101)",error:"rgb(255,107,128)",warning:"rgb(255,193,7)",merged:"rgb(175,135,255)",warningShimmer:"rgb(255,223,57)",diffAdded:"rgb(34,92,43)",diffRemoved:"rgb(122,41,54)",diffAddedDimmed:"rgb(71,88,74)",diffRemovedDimmed:"rgb(105,72,77)",diffAddedWord:"rgb(56,166,96)",diffRemovedWord:"rgb(179,89,107)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(177,185,249)",rate_limit_empty:"rgb(80,83,112)",penguin:"rgb(255,120,20)",penguinShimmer:"rgb(255,165,70)"},ZR0={autoAccept:"rgb(175,135,255)",bashBorder:"rgb(51,153,255)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(153,204,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(183,224,255)",permission:"rgb(153,204,255)",permissionShimmer:"rgb(183,224,255)",planMode:"rgb(102,153,153)",delegateMode:"rgb(186,85,255)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",inactiveShimmer:"rgb(193,193,193)",subtle:"rgb(80,80,80)",suggestion:"rgb(153,204,255)",remember:"rgb(153,204,255)",background:"rgb(0,204,204)",success:"rgb(51,153,255)",error:"rgb(255,102,102)",warning:"rgb(255,204,0)",merged:"rgb(175,135,255)",warningShimmer:"rgb(255,234,50)",diffAdded:"rgb(0,68,102)",diffRemoved:"rgb(102,0,0)",diffAddedDimmed:"rgb(62,81,91)",diffRemovedDimmed:"rgb(62,44,44)",diffAddedWord:"rgb(0,119,179)",diffRemovedWord:"rgb(179,0,0)",red_FOR_SUBAGENTS_ONLY:"rgb(255,102,102)",blue_FOR_SUBAGENTS_ONLY:"rgb(102,178,255)",green_FOR_SUBAGENTS_ONLY:"rgb(102,255,102)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,255,102)",purple_FOR_SUBAGENTS_ONLY:"rgb(178,102,255)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,178,102)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,153,204)",cyan_FOR_SUBAGENTS_ONLY:"rgb(102,204,204)",professionalBlue:"rgb(106,155,204)",chromeYellow:"rgb(251,188,4)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(153,204,255)",rate_limit_empty:"rgb(69,92,115)",penguin:"rgb(255,120,20)",penguinShimmer:"rgb(255,165,70)"};qR0=OA.terminal==="Apple_Terminal"?new ad$({level:2}):oH});function rzH(H,$){let A=H;if($.inverse)A=oH.inverse(A);if($.strikethrough)A=oH.strikethrough(A);if($.underline)A=oH.underline(A);if($.italic)A=oH.italic(A);if($.bold)A=oH.bold(A);if($.dim)A=oH.dim(A);if($.color)A=nzH(A,$.color,"foreground");if($.backgroundColor)A=nzH(A,$.backgroundColor,"background");return A}function du(H,$){if(!$)return H;return nzH(H,$,"foreground")}function ZL(H,$,A="foreground"){return(L)=>{if(!H)return L;if(H.startsWith("rgb(")||H.startsWith("#")||H.startsWith("ansi256(")||H.startsWith("ansi:"))return nzH(L,H,A);return nzH(L,c6($)[H],A)}}var TR0,zR0,nzH=(H,$,A)=>{if(!$)return H;if($.startsWith("ansi:"))switch($.substring(5)){case"black":return A==="foreground"?oH.black(H):oH.bgBlack(H);case"red":return A==="foreground"?oH.red(H):oH.bgRed(H);case"green":return A==="foreground"?oH.green(H):oH.bgGreen(H);case"yellow":return A==="foreground"?oH.yellow(H):oH.bgYellow(H);case"blue":return A==="foreground"?oH.blue(H):oH.bgBlue(H);case"magenta":return A==="foreground"?oH.magenta(H):oH.bgMagenta(H);case"cyan":return A==="foreground"?oH.cyan(H):oH.bgCyan(H);case"white":return A==="foreground"?oH.white(H):oH.bgWhite(H);case"blackBright":return A==="foreground"?oH.blackBright(H):oH.bgBlackBright(H);case"redBright":return A==="foreground"?oH.redBright(H):oH.bgRedBright(H);case"greenBright":return A==="foreground"?oH.greenBright(H):oH.bgGreenBright(H);case"yellowBright":return A==="foreground"?oH.yellowBright(H):oH.bgYellowBright(H);case"blueBright":return A==="foreground"?oH.blueBright(H):oH.bgBlueBright(H);case"magentaBright":return A==="foreground"?oH.magentaBright(H):oH.bgMagentaBright(H);case"cyanBright":return A==="foreground"?oH.cyanBright(H):oH.bgCyanBright(H);case"whiteBright":return A==="foreground"?oH.whiteBright(H):oH.bgWhiteBright(H)}if($.startsWith("#"))return A==="foreground"?oH.hex($)(H):oH.bgHex($)(H);if($.startsWith("ansi256")){let L=zR0.exec($);if(!L)return H;let I=Number(L[1]);return A==="foreground"?oH.ansi256(I)(H):oH.bgAnsi256(I)(H)}if($.startsWith("rgb")){let L=TR0.exec($);if(!L)return H;let I=Number(L[1]),D=Number(L[2]),B=Number(L[3]);return A==="foreground"?oH.rgb(I,D,B)(H):oH.bgRgb(I,D,B)(H)}return H};var Cn=K(()=>{r0();Ky();TR0=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,zR0=/^ansi256\(\s?(\d+)\s?\)$/});function osL(H,$,A,L=0,I){let D=GI($),B=H.length;if(D>=B-2)return["",$.substring(0,B),""];let f;if(A==="center")f=Math.floor((B-D)/2);else if(A==="start")f=L+1;else f=B-D-L-1;f=Math.max(1,Math.min(f,B-D-1));let E=H.substring(0,1)+I.repeat(f-1),M=I.repeat(B-f-D-1)+H.substring(B-1);return[E,$,M]}function k5H(H,$,A){let L=du(H,$);if(A)L=oH.dim(L);return L}var tsL,NR0,OR0=(H,$,A,L)=>{if(A.style.borderStyle){let I=Math.floor(A.yogaNode.getComputedWidth()),D=Math.floor(A.yogaNode.getComputedHeight()),B=typeof A.style.borderStyle==="string"?NR0[A.style.borderStyle]??tsL.default[A.style.borderStyle]:A.style.borderStyle,f=A.style.borderTopColor??A.style.borderColor,E=A.style.borderBottomColor??A.style.borderColor,M=A.style.borderLeftColor??A.style.borderColor,G=A.style.borderRightColor??A.style.borderColor,U=A.style.borderTopDimColor??A.style.borderDimColor,X=A.style.borderBottomDimColor??A.style.borderDimColor,J=A.style.borderLeftDimColor??A.style.borderDimColor,F=A.style.borderRightDimColor??A.style.borderDimColor,Q=A.style.borderTop!==!1,W=A.style.borderBottom!==!1,P=A.style.borderLeft!==!1,C=A.style.borderRight!==!1,Y=Math.max(0,I-(P?1:0)-(C?1:0)),Z=Q?(P?B.topLeft:"")+B.top.repeat(Y)+(C?B.topRight:""):"",q;if(Q&&A.style.borderText?.position==="top"){let[p,d,k]=osL(Z,A.style.borderText.content,A.style.borderText.align,A.style.borderText.offset,B.top);q=k5H(p,f,U)+d+k5H(k,f,U)}else if(Q)q=k5H(Z,f,U);let O=D;if(Q)O-=1;if(W)O-=1;O=Math.max(0,O);let j=(du(B.left,M)+` tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var OQI=K(()=>{NQI()});async function RUA(H=n$9){let{stdout:$}=await H("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),A=/ProgId\s*REG_SZ\s*(?\S+)/.exec($);if(!A)throw new jUA(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:L}=A.groups,I=r$9[L];if(!I)throw new jUA(`Unknown browser ID: ${L}`);return I}var xQI,SQI,n$9,r$9,jUA;var jQI=K(()=>{xQI=require("util"),SQI=require("child_process"),n$9=xQI.promisify(SQI.execFile),r$9={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}};jUA=class jUA extends Error{}});async function yUA(){if(lG$.default.platform==="darwin"){let H=await OUA();return{name:await SUA(H),id:H}}if(lG$.default.platform==="linux"){let{stdout:H}=await a$9("xdg-mime",["query","default","x-scheme-handler/http"]),$=H.trim();return{name:o$9($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(lG$.default.platform==="win32")return RUA();throw Error("Only macOS, Linux, and Windows are supported")}var RQI,lG$,yQI,a$9,o$9=(H)=>H.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());var vQI=K(()=>{ZQI();OQI();jQI();RQI=require("util"),lG$=b(require("process")),yQI=require("child_process"),a$9=RQI.promisify(yQI.execFile)});var pQI={};XA(pQI,{openApp:()=>HA9,default:()=>$A9,apps:()=>Yr});async function s$9(){let H=await NUA(),$=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,A=hUA.Buffer.from($,"utf16le").toString("base64"),{stdout:L}=await t$9(H,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",A],{encoding:"utf8"}),I=L.trim(),D={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return D[I]?{id:D[I]}:{}}function uQI(H){if(typeof H==="string"||Array.isArray(H))return H;let{[bQI]:$}=H;if(!$)throw Error(`${bQI} is not supported`);return $}function rG$({[CJH]:H},{wsl:$}){if($&&Pr)return uQI($);if(!H)throw Error(`${CJH} is not supported`);return uQI(H)}var iG$,hUA,bUA,gQI,mQI,kUA,nG$,t$9,vUA,hQI,CJH,bQI,kQI=async(H,$)=>{let A;for(let L of H)try{return await $(L)}catch(I){A=I}throw A},ASH=async(H)=>{if(H={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...H},Array.isArray(H.app))return kQI(H.app,(f)=>ASH({...H,app:f}));let{name:$,arguments:A=[]}=H.app??{};if(A=[...A],Array.isArray($))return kQI($,(f)=>ASH({...H,app:{name:f,arguments:A}}));if($==="browser"||$==="browserPrivate"){let f={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},E={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},M=Pr?await s$9():await yUA();if(M.id in f){let G=f[M.id];if($==="browserPrivate")A.push(E[G]);return ASH({...H,app:{name:Yr[G],arguments:A}})}throw Error(`${M.name} is not supported as a default browser`)}let L,I=[],D={};if(CJH==="darwin"){if(L="open",H.wait)I.push("--wait-apps");if(H.background)I.push("--background");if(H.newInstance)I.push("--new");if($)I.push("-a",$)}else if(CJH==="win32"||Pr&&!YJH()&&!$){if(L=await NUA(),I.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!Pr)D.windowsVerbatimArguments=!0;let f=["Start"];if(H.wait)f.push("-Wait");if($){if(f.push(`"\`"${$}\`""`),H.target)A.push(H.target)}else if(H.target)f.push(`"${H.target}"`);if(A.length>0)A=A.map((E)=>`"\`"${E}\`""`),f.push("-ArgumentList",A.join(","));H.target=hUA.Buffer.from(f.join(" "),"utf16le").toString("base64")}else{if($)L=$;else{let f=!vUA||vUA==="/",E=!1;try{await nG$.default.access(hQI,nG$.constants.X_OK),E=!0}catch{}L=iG$.default.versions.electron??(CJH==="android"||f||!E)?"xdg-open":hQI}if(A.length>0)I.push(...A);if(!H.wait)D.stdio="ignore",D.detached=!0}if(CJH==="darwin"&&A.length>0)I.push("--args",...A);if(H.target)I.push(H.target);let B=kUA.default.spawn(L,I,D);if(H.wait)return new Promise((f,E)=>{B.once("error",E),B.once("close",(M)=>{if(!H.allowNonzeroExitCode&&M>0){E(Error(`Exited with code ${M}`));return}f(B)})});return B.unref(),B},e$9=(H,$)=>{if(typeof H!=="string")throw TypeError("Expected a `target`");return ASH({...$,target:H})},HA9=(H,$)=>{if(typeof H!=="string"&&!Array.isArray(H))throw TypeError("Expected a valid `name`");let{arguments:A=[]}=$??{};if(A!==void 0&&A!==null&&!Array.isArray(A))throw TypeError("Expected `appArguments` as Array type");return ASH({...$,app:{name:H,arguments:A}})},Yr,$A9;var dQI=K(()=>{_QI();vQI();ZUA();iG$=b(require("process")),hUA=require("buffer"),bUA=b(require("path")),gQI=require("url"),mQI=require("util"),kUA=b(require("child_process")),nG$=b(require("fs/promises")),t$9=mQI.promisify(kUA.default.execFile),vUA=bUA.default.dirname(gQI.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/open/index.js")),hQI=bUA.default.join(vUA,"xdg-open"),{platform:CJH,arch:bQI}=iG$.default;Yr={};_r(Yr,"chrome",()=>rG$({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));_r(Yr,"brave",()=>rG$({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));_r(Yr,"firefox",()=>rG$({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));_r(Yr,"edge",()=>rG$({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));_r(Yr,"browser",()=>"browser");_r(Yr,"browserPrivate",()=>"browserPrivate");$A9=e$9});function AA9(H,$,A={}){var L,I,D;let B=JGI((L=A.logger)!==null&&L!==void 0?L:GY,$,H),f=QUA(B,KUA(A)),E=new lXH(Object.assign(Object.assign({},A.tokenCredentialOptions),{authorityHost:f,loggingOptions:A.loggingOptions}));return{auth:{clientId:H,authority:f,knownAuthorities:EQI(B,f,A.disableInstanceDiscovery)},system:{networkClient:E,loggerOptions:{loggerCallback:pG$((I=A.logger)!==null&&I!==void 0?I:GY),logLevel:dG$(VE$()),piiLoggingEnabled:(D=A.loggingOptions)===null||D===void 0?void 0:D.enableUnsafeSupportLogging}}}}function Cr(H,$,A={}){var L;let I={msalConfig:AA9(H,$,A),cachedAccount:A.authenticationRecord?MQI(A.authenticationRecord):null,pluginConfiguration:nMI.generatePluginConfiguration(A),logger:(L=A.logger)!==null&&L!==void 0?L:GY},D=new Map;async function B(q={}){let O=q.enableCae?"CAE":"default",j=D.get(O);if(j)return I.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),j;I.logger.getToken.info(`Creating new PublicClientApplication with CAE ${q.enableCae?"enabled":"disabled"}.`);let u=q.enableCae?I.pluginConfiguration.cache.cachePluginCae:I.pluginConfiguration.cache.cachePlugin;return I.msalConfig.auth.clientCapabilities=q.enableCae?["cp1"]:void 0,j=new oxH(Object.assign(Object.assign({},I.msalConfig),{broker:{nativeBrokerPlugin:I.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await u}})),D.set(O,j),j}let f=new Map;async function E(q={}){let O=q.enableCae?"CAE":"default",j=f.get(O);if(j)return I.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),j;I.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${q.enableCae?"enabled":"disabled"}.`);let u=q.enableCae?I.pluginConfiguration.cache.cachePluginCae:I.pluginConfiguration.cache.cachePlugin;return I.msalConfig.auth.clientCapabilities=q.enableCae?["cp1"]:void 0,j=new sxH(Object.assign(Object.assign({},I.msalConfig),{broker:{nativeBrokerPlugin:I.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await u}})),f.set(O,j),j}async function M(q,O,j={}){if(I.cachedAccount===null)throw I.logger.getToken.info("No cached account found in local state."),new $g({scopes:O});if(j.claims)I.cachedClaims=j.claims;let u={account:I.cachedAccount,scopes:O,claims:I.cachedClaims};if(I.pluginConfiguration.broker.isEnabled){if(u.tokenQueryParameters||(u.tokenQueryParameters={}),I.pluginConfiguration.broker.enableMsaPassthrough)u.tokenQueryParameters.msal_request_type="consumer_passthrough"}if(j.proofOfPossessionOptions)u.shrNonce=j.proofOfPossessionOptions.nonce,u.authenticationScheme="pop",u.resourceRequestMethod=j.proofOfPossessionOptions.resourceRequestMethod,u.resourceRequestUri=j.proofOfPossessionOptions.resourceRequestUrl;I.logger.getToken.info("Attempting to acquire token silently");try{return await q.acquireTokenSilent(u)}catch(y){throw lIH(O,y,j)}}function G(q){if(q===null||q===void 0?void 0:q.tenantId)return QUA(q.tenantId,KUA(A));return I.msalConfig.auth.authority}async function U(q,O,j,u){var y,g;let h=null;try{h=await M(q,O,j)}catch(p){if(p.name!=="AuthenticationRequiredError")throw p;if(j.disableAutomaticAuthentication)throw new $g({scopes:O,getTokenOptions:j,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(h===null)try{h=await u()}catch(p){throw lIH(O,p,j)}return _JH(O,h,j),I.cachedAccount=(y=h===null||h===void 0?void 0:h.account)!==null&&y!==void 0?y:null,I.logger.getToken.info(ZQ(O)),{token:h.accessToken,expiresOnTimestamp:h.expiresOn.getTime(),refreshAfterTimestamp:(g=h.refreshOn)===null||g===void 0?void 0:g.getTime(),tokenType:h.tokenType}}async function X(q,O,j={}){var u;I.logger.getToken.info("Attempting to acquire token using client secret"),I.msalConfig.auth.clientSecret=O;let y=await E(j);try{let g=await y.acquireTokenByClientCredential({scopes:q,authority:G(j),azureRegion:cG$(),claims:j===null||j===void 0?void 0:j.claims});return _JH(q,g,j),I.logger.getToken.info(ZQ(q)),{token:g.accessToken,expiresOnTimestamp:g.expiresOn.getTime(),refreshAfterTimestamp:(u=g.refreshOn)===null||u===void 0?void 0:u.getTime(),tokenType:g.tokenType}}catch(g){throw lIH(q,g,j)}}async function J(q,O,j={}){var u;I.logger.getToken.info("Attempting to acquire token using client assertion"),I.msalConfig.auth.clientAssertion=O;let y=await E(j);try{let g=await y.acquireTokenByClientCredential({scopes:q,authority:G(j),azureRegion:cG$(),claims:j===null||j===void 0?void 0:j.claims,clientAssertion:O});return _JH(q,g,j),I.logger.getToken.info(ZQ(q)),{token:g.accessToken,expiresOnTimestamp:g.expiresOn.getTime(),refreshAfterTimestamp:(u=g.refreshOn)===null||u===void 0?void 0:u.getTime(),tokenType:g.tokenType}}catch(g){throw lIH(q,g,j)}}async function F(q,O,j={}){var u;I.logger.getToken.info("Attempting to acquire token using client certificate"),I.msalConfig.auth.clientCertificate=O;let y=await E(j);try{let g=await y.acquireTokenByClientCredential({scopes:q,authority:G(j),azureRegion:cG$(),claims:j===null||j===void 0?void 0:j.claims});return _JH(q,g,j),I.logger.getToken.info(ZQ(q)),{token:g.accessToken,expiresOnTimestamp:g.expiresOn.getTime(),refreshAfterTimestamp:(u=g.refreshOn)===null||u===void 0?void 0:u.getTime(),tokenType:g.tokenType}}catch(g){throw lIH(q,g,j)}}async function Q(q,O,j={}){I.logger.getToken.info("Attempting to acquire token using device code");let u=await B(j);return U(u,q,j,()=>{var y,g;let h={scopes:q,cancel:(g=(y=j===null||j===void 0?void 0:j.abortSignal)===null||y===void 0?void 0:y.aborted)!==null&&g!==void 0?g:!1,deviceCodeCallback:O,authority:G(j),claims:j===null||j===void 0?void 0:j.claims},p=u.acquireTokenByDeviceCode(h);if(j.abortSignal)j.abortSignal.addEventListener("abort",()=>{h.cancel=!0});return p})}async function W(q,O,j,u={}){I.logger.getToken.info("Attempting to acquire token using username and password");let y=await B(u);return U(y,q,u,()=>{let g={scopes:q,username:O,password:j,authority:G(u),claims:u===null||u===void 0?void 0:u.claims};return y.acquireTokenByUsernamePassword(g)})}function P(){if(!I.cachedAccount)return;return GQI(H,I.cachedAccount)}async function C(q,O,j,u,y={}){I.logger.getToken.info("Attempting to acquire token using authorization code");let g;if(u)I.msalConfig.auth.clientSecret=u,g=await E(y);else g=await B(y);return U(g,q,y,()=>{return g.acquireTokenByCode({scopes:q,redirectUri:O,code:j,authority:G(y),claims:y===null||y===void 0?void 0:y.claims})})}async function Y(q,O,j,u={}){var y;if(GY.getToken.info("Attempting to acquire token on behalf of another user"),typeof j==="string")GY.getToken.info("Using client secret for on behalf of flow"),I.msalConfig.auth.clientSecret=j;else if(typeof j==="function")GY.getToken.info("Using client assertion callback for on behalf of flow"),I.msalConfig.auth.clientAssertion=j;else GY.getToken.info("Using client certificate for on behalf of flow"),I.msalConfig.auth.clientCertificate=j;let g=await E(u);try{let h=await g.acquireTokenOnBehalfOf({scopes:q,authority:G(u),claims:u.claims,oboAssertion:O});return _JH(q,h,u),GY.getToken.info(ZQ(q)),{token:h.accessToken,expiresOnTimestamp:h.expiresOn.getTime(),refreshAfterTimestamp:(y=h.refreshOn)===null||y===void 0?void 0:y.getTime(),tokenType:h.tokenType}}catch(h){throw lIH(q,h,u)}}async function Z(q,O={}){GY.getToken.info("Attempting to acquire token interactively");let j=await B(O);async function u(g){var h;GY.verbose("Authentication will resume through the broker");let p=y();if(I.pluginConfiguration.broker.parentWindowHandle)p.windowHandle=Buffer.from(I.pluginConfiguration.broker.parentWindowHandle);else GY.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle.");if(I.pluginConfiguration.broker.enableMsaPassthrough)((h=p.tokenQueryParameters)!==null&&h!==void 0?h:p.tokenQueryParameters={}).msal_request_type="consumer_passthrough";if(g)p.prompt="none",GY.verbose("Attempting broker authentication using the default broker account");else GY.verbose("Attempting broker authentication without the default broker account");if(O.proofOfPossessionOptions)p.shrNonce=O.proofOfPossessionOptions.nonce,p.authenticationScheme="pop",p.resourceRequestMethod=O.proofOfPossessionOptions.resourceRequestMethod,p.resourceRequestUri=O.proofOfPossessionOptions.resourceRequestUrl;try{return await j.acquireTokenInteractive(p)}catch(d){if(GY.verbose(`Failed to authenticate through the broker: ${d.message}`),g)return u(!1);else throw d}}function y(){var g,h;return{openBrowser:async(p)=>{await(await Promise.resolve().then(() => (dQI(),pQI))).default(p,{wait:!0,newInstance:!0})},scopes:q,authority:G(O),claims:O===null||O===void 0?void 0:O.claims,loginHint:O===null||O===void 0?void 0:O.loginHint,errorTemplate:(g=O===null||O===void 0?void 0:O.browserCustomizationOptions)===null||g===void 0?void 0:g.errorMessage,successTemplate:(h=O===null||O===void 0?void 0:O.browserCustomizationOptions)===null||h===void 0?void 0:h.successMessage,prompt:(O===null||O===void 0?void 0:O.loginHint)?"login":"select_account"}}return U(j,q,O,async()=>{var g;let h=y();if(I.pluginConfiguration.broker.isEnabled)return u((g=I.pluginConfiguration.broker.useDefaultBrokerAccount)!==null&&g!==void 0?g:!1);if(O.proofOfPossessionOptions)h.shrNonce=O.proofOfPossessionOptions.nonce,h.authenticationScheme="pop",h.resourceRequestMethod=O.proofOfPossessionOptions.resourceRequestMethod,h.resourceRequestUri=O.proofOfPossessionOptions.resourceRequestUrl;return j.acquireTokenInteractive(h)})}return{getActiveAccount:P,getTokenByClientSecret:X,getTokenByClientAssertion:J,getTokenByClientCertificate:F,getTokenByDeviceCode:Q,getTokenByUsernamePassword:W,getTokenByAuthorizationCode:C,getTokenOnBehalfOf:Y,getTokenByInteractiveRequest:Z}}var GY;var LSH=K(()=>{mG$();MJ();rMI();WUA();pV();hEA();FQI();uLH();mO();GY=sf("MsalClient")});class uUA{constructor(H,$,A,L={}){if(!H)throw new W0("ClientAssertionCredential: tenantId is a required parameter.");if(!$)throw new W0("ClientAssertionCredential: clientId is a required parameter.");if(!A)throw new W0("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=H,this.additionallyAllowedTenantIds=$Y(L===null||L===void 0?void 0:L.additionallyAllowedTenants),this.options=L,this.getAssertion=A,this.msalClient=Cr($,H,Object.assign(Object.assign({},L),{logger:cQI,tokenCredentialOptions:this.options}))}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,cQI);let L=Array.isArray(H)?H:[H];return this.msalClient.getTokenByClientAssertion(L,this.getAssertion,A)})}}var cQI;var lQI=K(()=>{LSH();mO();pV();MJ();d2();cQI=sf("ClientAssertionCredential")});class rIH{constructor(H){this.azureFederatedTokenFileContent=void 0,this.cacheDate=void 0;let $=PE$(LA9).assigned.join(", ");ISH.info(`Found the following environment variables: ${$}`);let A=H!==null&&H!==void 0?H:{},L=A.tenantId||process.env.AZURE_TENANT_ID,I=A.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=A.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,L)HY(ISH,L);if(!I)throw new W0(`${nIH}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". `]]))[0];return EA9(D)}throw Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async()=>{let A=dV(this.tenantId,$,this.additionallyAllowedTenantIds),L=typeof H==="string"?H:H[0];if(A)HY(Tg,A);try{ZJH(L,Tg),Tg.getToken.info(`Using the scope ${L}`);let I=oG$(L),D=await this.getAzurePowerShellAccessToken(I,A,this.timeout);return Tg.getToken.info(ZQ(H)),{token:D.Token,expiresOnTimestamp:new Date(D.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(I){if(fA9(I)){let B=new W0(lUA.installed);throw Tg.getToken.info(SE(L,B)),B}else if(BA9(I)){let B=new W0(lUA.login);throw Tg.getToken.info(SE(L,B)),B}let D=new W0(`${I}. ${lUA.troubleshoot}`);throw Tg.getToken.info(SE(L,D)),D}})}}async function EA9(H){let $=/{[^{}]*}/g,A=H.match($),L=H;if(A)try{for(let I of A)try{let D=JSON.parse(I);if(D===null||D===void 0?void 0:D.Token){if(L=L.replace(I,""),L)Tg.getToken.warning(L);return D}}catch(D){continue}}catch(I){throw Error(`Unable to parse the output of PowerShell. Received output: ${H}`)}throw Error(`No access token found in the output. Received output: ${H}`)}var Tg,fWI=!1,MWI,lUA,BA9=(H)=>H.message.match(`(.*)${MWI.login}(.*)`),fA9=(H)=>H.message.match(MWI.installed),iUA;var GWI=K(()=>{mO();MJ();qJH();pV();DWI();d2();Tg=sf("AzurePowerShellCredential");MWI={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},lUA={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},iUA=[EWI("pwsh")];if(fWI)iUA.push(EWI("powershell"))});class aUA{constructor(...H){this._sources=[],this._sources=H}async getToken(H,$={}){let{token:A}=await this.getTokenInternal(H,$);return A}async getTokenInternal(H,$={}){let A=null,L,I=[];return O4.withSpan("ChainedTokenCredential.getToken",$,async(D)=>{for(let B=0;B0){let B=new ufA(I,"ChainedTokenCredential authentication failed.");throw rUA.getToken.info(SE(H,B)),B}if(rUA.getToken.info(`Result for ${L.constructor.name}: ${ZQ(H)}`),A===null)throw new W0("Failed to retrieve a valid token");return{token:A,successfulCredential:L}})}}var rUA;var UWI=K(()=>{pV();MJ();d2();rUA=sf("ChainedTokenCredential")});class oUA{constructor(H,$,A,L={}){if(!H||!$)throw Error(`${DSH}: tenantId and clientId are required parameters.`);this.tenantId=H,this.additionallyAllowedTenantIds=$Y(L===null||L===void 0?void 0:L.additionallyAllowedTenants),this.sendCertificateChain=L.sendCertificateChain,this.certificateConfiguration=Object.assign({},typeof A==="string"?{certificatePath:A}:A);let I=this.certificateConfiguration.certificate,D=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(I||D))throw Error(`${DSH}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(I&&D)throw Error(`${DSH}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=Cr($,H,Object.assign(Object.assign({},L),{logger:XWI,tokenCredentialOptions:L}))}async getToken(H,$={}){return O4.withSpan(`${DSH}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,XWI);let L=Array.isArray(H)?H:[H],I=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(L,I,A)})}async buildClientCertificate(){var H;let $=await MA9(this.certificateConfiguration,(H=this.sendCertificateChain)!==null&&H!==void 0?H:!1),A;if(this.certificateConfiguration.certificatePassword!==void 0)A=BSH.createPrivateKey({key:$.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString();else A=$.certificateContents;return{thumbprint:$.thumbprint,thumbprintSha256:$.thumbprintSha256,privateKey:A,x5c:$.x5c}}}async function MA9(H,$){let{certificate:A,certificatePath:L}=H,I=A||await JWI.readFile(L,"utf8"),D=$?I:void 0,B=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,f=[],E;do if(E=B.exec(I),E)f.push(E[3]);while(E);if(f.length===0)throw Error("The file at the specified path does not contain a PEM-encoded certificate.");let M=BSH.createHash("sha1").update(Buffer.from(f[0],"base64")).digest("hex").toUpperCase(),G=BSH.createHash("sha256").update(Buffer.from(f[0],"base64")).digest("hex").toUpperCase();return{certificateContents:I,thumbprintSha256:G,thumbprint:M,x5c:D}}var BSH,JWI,DSH="ClientCertificateCredential",XWI;var FWI=K(()=>{LSH();mO();MJ();d2();BSH=require("crypto"),JWI=require("fs/promises"),XWI=sf(DSH)});class tUA{constructor(H,$,A,L={}){if(!H)throw new W0("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!$)throw new W0("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!A)throw new W0("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=A,this.tenantId=H,this.additionallyAllowedTenantIds=$Y(L===null||L===void 0?void 0:L.additionallyAllowedTenants),this.msalClient=Cr($,H,Object.assign(Object.assign({},L),{logger:KWI,tokenCredentialOptions:L}))}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,KWI);let L=aG$(H);return this.msalClient.getTokenByClientSecret(L,this.clientSecret,A)})}}var KWI;var QWI=K(()=>{LSH();mO();pV();MJ();qJH();d2();KWI=sf("ClientSecretCredential")});class sUA{constructor(H,$,A,L,I={}){if(!H)throw new W0("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!$)throw new W0("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!A)throw new W0("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!L)throw new W0("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=H,this.additionallyAllowedTenantIds=$Y(I===null||I===void 0?void 0:I.additionallyAllowedTenants),this.username=A,this.password=L,this.msalClient=Cr($,this.tenantId,Object.assign(Object.assign({},I),{tokenCredentialOptions:I!==null&&I!==void 0?I:{}}))}async getToken(H,$={}){return O4.withSpan(`${this.constructor.name}.getToken`,$,async(A)=>{A.tenantId=dV(this.tenantId,A,this.additionallyAllowedTenantIds,GA9);let L=aG$(H);return this.msalClient.getTokenByUsernamePassword(L,this.username,this.password,A)})}}var GA9;var WWI=K(()=>{LSH();mO();pV();MJ();qJH();d2();GA9=sf("UsernamePasswordCredential")});function XA9(){var H;return((H=process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS)!==null&&H!==void 0?H:"").split(";")}function JA9(){var H;let $=((H=process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN)!==null&&H!==void 0?H:"").toLowerCase(),A=$==="true"||$==="1";return zg.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${A}`),A}class eUA{constructor(H){this._credential=void 0;let $=PE$(UA9).assigned.join(", ");zg.info(`Found the following environment variables: ${$}`);let A=process.env.AZURE_TENANT_ID,L=process.env.AZURE_CLIENT_ID,I=process.env.AZURE_CLIENT_SECRET,D=XA9(),B=JA9(),f=Object.assign(Object.assign({},H),{additionallyAllowedTenantIds:D,sendCertificateChain:B});if(A)HY(zg,A);if(A&&L&&I){zg.info(`Invoking ClientSecretCredential with tenant ID: ${A}, clientId: ${L} and clientSecret: [REDACTED]`),this._credential=new tUA(A,L,I,f);return}let E=process.env.AZURE_CLIENT_CERTIFICATE_PATH,M=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(A&&L&&E){zg.info(`Invoking ClientCertificateCredential with tenant ID: ${A}, clientId: ${L} and certificatePath: ${E}`),this._credential=new oUA(A,L,{certificatePath:E,certificatePassword:M},f);return}let G=process.env.AZURE_USERNAME,U=process.env.AZURE_PASSWORD;if(A&&L&&G&&U)zg.info(`Invoking UsernamePasswordCredential with tenant ID: ${A}, clientId: ${L} and username: ${G}`),zg.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new sUA(A,L,G,U,f)}async getToken(H,$={}){return O4.withSpan(`${tG$}.getToken`,$,async(A)=>{if(this._credential)try{let L=await this._credential.getToken(H,A);return zg.getToken.info(ZQ(H)),L}catch(L){let I=new AOH(400,{error:`${tG$} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:L.message.toString().split("More details:").join("")});throw zg.getToken.info(SE(H,I)),I}throw new W0(`${tG$} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}}var UA9,tG$="EnvironmentCredential",zg;var VWI=K(()=>{pV();MJ();FWI();QWI();WWI();mO();d2();UA9=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];zg=sf(tG$)});function FA9(H={}){var $,A,L,I;($=H.retryOptions)!==null&&$!==void 0||(H.retryOptions={maxRetries:5,retryDelayInMs:800});let D=(A=H===null||H===void 0?void 0:H.managedIdentityClientId)!==null&&A!==void 0?A:process.env.AZURE_CLIENT_ID,B=(L=H===null||H===void 0?void 0:H.workloadIdentityClientId)!==null&&L!==void 0?L:D,f=H===null||H===void 0?void 0:H.managedIdentityResourceId,E=process.env.AZURE_FEDERATED_TOKEN_FILE,M=(I=H===null||H===void 0?void 0:H.tenantId)!==null&&I!==void 0?I:process.env.AZURE_TENANT_ID;if(f){let G=Object.assign(Object.assign({},H),{resourceId:f});return new wJH(G)}if(E&&B){let G=Object.assign(Object.assign({},H),{tenantId:M});return new wJH(B,G)}if(D){let G=Object.assign(Object.assign({},H),{clientId:D});return new wJH(G)}return new wJH(H)}function KA9(H){var $,A,L;let I=($=H===null||H===void 0?void 0:H.managedIdentityClientId)!==null&&$!==void 0?$:process.env.AZURE_CLIENT_ID,D=(A=H===null||H===void 0?void 0:H.workloadIdentityClientId)!==null&&A!==void 0?A:I,B=process.env.AZURE_FEDERATED_TOKEN_FILE,f=(L=H===null||H===void 0?void 0:H.tenantId)!==null&&L!==void 0?L:process.env.AZURE_TENANT_ID;if(B&&D){let E=Object.assign(Object.assign({},H),{tenantId:f,clientId:D,tokenFilePath:B});return new rIH(E)}if(f){let E=Object.assign(Object.assign({},H),{tenantId:f});return new rIH(E)}return new rIH(H)}function QA9(H={}){let $=H.processTimeoutInMs;return new cUA(Object.assign({processTimeoutInMs:$},H))}function WA9(H={}){let $=H.processTimeoutInMs;return new dUA(Object.assign({processTimeoutInMs:$},H))}function VA9(H={}){let $=H.processTimeoutInMs;return new nUA(Object.assign({processTimeoutInMs:$},H))}function PA9(H={}){return new eUA(H)}class PWI{constructor(H,$){this.credentialName=H,this.credentialUnavailableErrorMessage=$}getToken(){return H4A.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}}var H4A,sG$;var _WI=K(()=>{aQI();eQI();AWI();GWI();UWI();VWI();gUA();MJ();H4A=sf("DefaultAzureCredential");sG$=class sG$ extends aUA{constructor(H){let $=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,A=[WA9,VA9,QA9],L=[PA9,KA9,FA9],I=[];if($)switch($){case"dev":I=A;break;case"prod":I=L;break;default:{let B=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev'.`;throw H4A.warning(B),Error(B)}}else I=[...L,...A];let D=I.map((B)=>{try{return B(H)}catch(f){return H4A.warning(`Skipped ${B.name} because of an error creating the credential: ${f}`),new PWI(B.name,f.message)}});super(...D)}}});function $4A(H,$,A){let{abortSignal:L,tracingOptions:I}=A||{},D=UOH();D.addPolicy(WOH({credential:H,scopes:$}));async function B(){var f;let M=(f=(await D.sendRequest({sendRequest:(G)=>Promise.resolve({request:G,status:200,headers:G.headers})},cO({url:"https://example.com",abortSignal:L,tracingOptions:I}))).headers.get("authorization"))===null||f===void 0?void 0:f.split(" ")[1];if(!M)throw Error("Failed to get access token");return M}return B}var YWI=K(()=>{Ig()});var CWI=K(()=>{_WI();YWI();m4I()});function eG$(){return{error:(H,...$)=>console.error("[Anthropic SDK ERROR]",H,...$),warn:(H,...$)=>console.error("[Anthropic SDK WARN]",H,...$),info:(H,...$)=>console.error("[Anthropic SDK INFO]",H,...$),debug:(H,...$)=>console.error("[Anthropic SDK DEBUG]",H,...$)}}async function eO({apiKey:H,maxRetries:$,model:A,fetchOverride:L}){let I=process.env.CLAUDE_CODE_CONTAINER_ID,D=process.env.CLAUDE_CODE_REMOTE_SESSION_ID,B=YA9(),f={"x-app":"cli","User-Agent":Gn(),...B,...I?{"x-claude-remote-container-id":I}:{},...D?{"x-claude-remote-session-id":D}:{}};if(N(`[API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: ${!!process.env.ANTHROPIC_CUSTOM_HEADERS}, has Authorization header: ${!!B.Authorization}`),A$(process.env.CLAUDE_CODE_ADDITIONAL_PROTECTION))f["x-anthropic-additional-protection"]="true";if(N("[API:auth] OAuth token check starting"),await iW(),N("[API:auth] OAuth token check complete"),!nL())_A9(f,tI());let M={defaultHeaders:f,maxRetries:$,timeout:parseInt(process.env.API_TIMEOUT_MS||String(600000),10),dangerouslyAllowBrowser:!0,fetchOptions:_AH(),...L&&{fetch:L}};if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)){let U=A===LJ()&&process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION?process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:NHH(),X={...M,awsRegion:U,...A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&{skipAuth:!0},...IR()&&{logger:eG$()}};if(process.env.AWS_BEARER_TOKEN_BEDROCK)X.skipAuth=!0,X.defaultHeaders={...X.defaultHeaders,Authorization:`Bearer ${process.env.AWS_BEARER_TOKEN_BEDROCK}`};else if(!A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)){let J=await YAH();if(J)X.awsAccessKey=J.accessKeyId,X.awsSecretKey=J.secretAccessKey,X.awsSessionToken=J.sessionToken}return new o8$(X)}if(A$(process.env.CLAUDE_CODE_USE_FOUNDRY)){let U;if(!process.env.ANTHROPIC_FOUNDRY_API_KEY)if(A$(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH))U=()=>Promise.resolve("");else U=$4A(new sG$,"https://cognitiveservices.azure.com/.default");let X={...M,...U&&{azureADTokenProvider:U},...IR()&&{logger:eG$()}};return new Hf$(X)}if(A$(process.env.CLAUDE_CODE_USE_VERTEX)){let U=process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project,X=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials,J=A$(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)?{getClient:()=>({getRequestHeaders:()=>({})})}:new wWI.GoogleAuth({scopes:["https://www.googleapis.com/auth/cloud-platform"],...U||X?{}:{projectId:process.env.ANTHROPIC_VERTEX_PROJECT_ID}}),F={...M,region:fiH(A),googleAuth:J,...IR()&&{logger:eG$()}};return new XE$(F)}let G={apiKey:nL()?null:H||eZ(),authToken:nL()?dD()?.accessToken:void 0,...{},...M,...IR()&&{logger:eG$()}};return new BO(G)}function _A9(H,$){let A=process.env.ANTHROPIC_AUTH_TOKEN||zqH($);if(A)H.Authorization=`Bearer ${A}`}function YA9(){let H={},$=process.env.ANTHROPIC_CUSTOM_HEADERS;if(!$)return H;let A=$.split(/\n|\r\n/);for(let L of A){if(!L.trim())continue;let I=L.match(/^\s*(.*?)\s*:\s*(.*?)\s*$/);if(I){let[,D,B]=I;if(D&&B!==void 0)H[D]=B}}return H}var wWI;var fSH=K(()=>{H8I();B8I();n_();uMI();CWI();EI();g$();_Q();NA();nR();qE();E$();aI();wWI=b(ZfA(),1)});function A4A(H){if(jGH())return t1L(H);return H}function TJH(H){return H||jGH()}function ZWI(H){return jGH()&&H.status===429}var ESH=K(()=>{$c$();n_();aI()});function qWI(H){return CA9.some(($)=>H.startsWith($))}function TWI(H,$){if(H.isUsingOverage){if(H.overageStatus==="allowed_warning")return{message:"You're close to your extra usage spending limit",severity:"warning"};return null}if(H.status==="rejected")return{message:wA9(H,$),severity:"error"};if(H.status==="allowed_warning"){if(H.utilization!==void 0&&H.utilization<0.7)return null;if($T()){let I=f0(),D=I==="team"||I==="enterprise",B=T9()?.hasExtraUsageEnabled===!0;if(D&&B&&!my())return null}let L=ZA9(H);if(L)return{message:L,severity:"warning"}}return null}function L4A(H,$){let A=TWI(H,$);if(A&&A.severity==="error")return A.message;return null}function I4A(H,$){let A=TWI(H,$);if(A&&A.severity==="warning")return A.message;return null}function wA9(H,$){let A=H.resetsAt,L=A?K5H(A,!0):void 0,I=H.overageResetsAt?K5H(H.overageResetsAt,!0):void 0,D=L?` \xB7 resets ${L}`:"";if(H.overageStatus==="rejected"){let B="";if(A&&H.overageResetsAt)if(A{Q9();EI();vA();CA9=["You've hit your","You've used","You're now using extra usage","You're close to","You're out of extra usage"]});function NA9(H,$){let A=Date.now()/1000,L=H-$,I=A-L;return Math.max(0,Math.min(1,I/$))}function E4A(H){a2=H,f4A.forEach((A)=>A(H));let $=Math.round((H.resetsAt?H.resetsAt-Date.now()/1000:0)/3600);c("tengu_claudeai_limits_status_changed",{status:H.status,unifiedRateLimitFallbackAvailable:H.unifiedRateLimitFallbackAvailable,hoursTillReset:$})}async function OA9(){let H=LJ(),$=await eO({maxRetries:0,model:H}),A=[{role:"user",content:"quota"}],L=U2(H);return $.beta.messages.create({model:H,max_tokens:1,messages:A,metadata:qr(),...L.length>0?{betas:L}:{}}).asResponse()}async function zWI(){if(!TJH(nL()))return;try{let H=await OA9();M4A(H.headers)}catch(H){if(H instanceof JD)$U$(H)}}function Zr(){let[H,$]=HU$.useState({...a2});return HU$.useEffect(()=>{let A=(L)=>{$({...L})};return f4A.add(A),()=>{f4A.delete(A)}},[]),H}function xA9(H,$){for(let[A,L]of Object.entries(zA9)){let I=H.get(`anthropic-ratelimit-unified-${A}-surpassed-threshold`);if(I!==null){let D=H.get(`anthropic-ratelimit-unified-${A}-utilization`),B=H.get(`anthropic-ratelimit-unified-${A}-reset`),f=D?Number(D):void 0;return{status:"allowed_warning",resetsAt:B?Number(B):void 0,rateLimitType:L,utilization:f,unifiedRateLimitFallbackAvailable:$,isUsingOverage:!1,surpassedThreshold:Number(I)}}}return null}function SA9(H,$,A){let{rateLimitType:L,claimAbbrev:I,windowSeconds:D,thresholds:B}=$,f=H.get(`anthropic-ratelimit-unified-${I}-utilization`),E=H.get(`anthropic-ratelimit-unified-${I}-reset`);if(f===null||E===null)return null;let M=Number(f),G=Number(E),U=NA9(G,D);if(!B.some((J)=>M>=J.utilization&&U<=J.timePct))return null;return{status:"allowed_warning",resetsAt:G,rateLimitType:L,utilization:M,unifiedRateLimitFallbackAvailable:A,isUsingOverage:!1}}function jA9(H,$){let A=xA9(H,$);if(A)return A;for(let L of TA9){let I=SA9(H,L,$);if(I)return I}return null}function NWI(H){let $=H.get("anthropic-ratelimit-unified-status")||"allowed",A=H.get("anthropic-ratelimit-unified-reset"),L=A?Number(A):void 0,I=H.get("anthropic-ratelimit-unified-fallback")==="available",D=H.get("anthropic-ratelimit-unified-representative-claim"),B=H.get("anthropic-ratelimit-unified-overage-status"),f=H.get("anthropic-ratelimit-unified-overage-reset"),E=f?Number(f):void 0,M=H.get("anthropic-ratelimit-unified-overage-disabled-reason"),G=$==="rejected"&&(B==="allowed"||B==="allowed_warning"),U=$;if($==="allowed"||$==="allowed_warning"){let X=jA9(H,I);if(X)return X;U="allowed"}return{status:U,resetsAt:L,unifiedRateLimitFallbackAvailable:I,...D&&{rateLimitType:D},...B&&{overageStatus:B},...E&&{overageResetsAt:E},...M&&{overageDisabledReason:M},isUsingOverage:G}}function M4A(H){let $=nL();if(!TJH($)){if(a2.status!=="allowed"||a2.resetsAt)E4A({status:"allowed",unifiedRateLimitFallbackAvailable:!1,isUsingOverage:!1});return}let A=A4A(H),L=NWI(A);if(!jHH(a2,L))E4A(L)}function $U$(H){if(!TJH(nL())||H.status!==429)return;try{let $={...a2};if(H.headers){let A=A4A(H.headers);$=NWI(A)}if($.status="rejected",!jHH(a2,$))E4A($)}catch($){r($)}}var HU$,TA9,zA9,a2,f4A;var py=K(()=>{fSH();_$();aI();z$();EI();$q();n_();dU();GR$();ESH();B4A();HU$=b(s(),1),TA9=[{rateLimitType:"five_hour",claimAbbrev:"5h",windowSeconds:18000,thresholds:[{utilization:0.9,timePct:0.72}]},{rateLimitType:"seven_day",claimAbbrev:"7d",windowSeconds:604800,thresholds:[{utilization:0.75,timePct:0.6},{utilization:0.5,timePct:0.35},{utilization:0.25,timePct:0.15}]}],zA9={"5h":"five_hour","7d":"seven_day",overage:"overage"};a2={status:"allowed",unifiedRateLimitFallbackAvailable:!1,isUsingOverage:!1},f4A=new Set});var NJH=5242880,Hx=3932160,OJH=2000,xJH=2000,SJH=20971520,OWI=100,xWI=3145728,G4A=104857600,jJH=20,AU$=10;var aIH=()=>{};function MSH(H){if(!H||typeof H!=="object")return null;let $=H,A=5,L=0;while($&&L([^<]+)<\/title>/);if(A&&A[1])return A[1].trim();return""}return H.message}function LU$(H){let $=MSH(H);if($){let{code:L,isSSLError:I}=$;if(L==="ETIMEDOUT")return"Request timed out. Check your internet connection and proxy settings";if(I)switch(L){case"UNABLE_TO_VERIFY_LEAF_SIGNATURE":case"UNABLE_TO_GET_ISSUER_CERT":case"UNABLE_TO_GET_ISSUER_CERT_LOCALLY":return"Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates";case"CERT_HAS_EXPIRED":return"Unable to connect to API: SSL certificate has expired";case"CERT_REVOKED":return"Unable to connect to API: SSL certificate has been revoked";case"DEPTH_ZERO_SELF_SIGNED_CERT":case"SELF_SIGNED_CERT_IN_CHAIN":return"Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates";case"ERR_TLS_CERT_ALTNAME_INVALID":case"HOSTNAME_MISMATCH":return"Unable to connect to API: SSL certificate hostname mismatch";case"CERT_NOT_YET_VALID":return"Unable to connect to API: SSL certificate is not yet valid";default:return`Unable to connect to API: SSL error (${L})`}}if(H.message==="Connection error."){if($?.code)return`Unable to connect to API (${$.code})`;return"Unable to connect to API. Check your internet connection"}let A=yA9(H);return A!==H.message&&A.length>0?A:H.message}async function $x(H,$){await new Promise((A,L)=>{let I=setTimeout(A,H);if($){let D=()=>{clearTimeout(I),L(new rf)};if($.aborted){D();return}$.addEventListener("abort",D,{once:!0}),setTimeout(()=>{$?.removeEventListener("abort",D)},H)}})}var RA9;var Ng=K(()=>{n_();RA9=new Set(["UNABLE_TO_VERIFY_LEAF_SIGNATURE","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","CERT_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CERT_REVOKED","CERT_REJECTED","CERT_UNTRUSTED","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","CERT_CHAIN_TOO_LONG","PATH_LENGTH_EXCEEDED","ERR_TLS_CERT_ALTNAME_INVALID","HOSTNAME_MISMATCH","ERR_TLS_HANDSHAKE_TIMEOUT","ERR_SSL_WRONG_VERSION_NUMBER","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC"])});var jWI={};XA(jWI,{sharp:()=>SWI,default:()=>vA9});function SWI(H){let $=null,A=[],L=0;async function I(){if(!$)$=(async()=>{if(!IU$)throw Error("Native image processor module not available");let{processImage:f}=IU$;return f(H)})();return $}function D(f){for(let E=L;E{G.resize(f,E,M)}),B},jpeg(f){return A.push((E)=>{E.jpeg(f?.quality)}),B},png(f){return A.push((E)=>{E.png(f)}),B},webp(f){return A.push((E)=>{E.webp(f?.quality)}),B},async toBuffer(){let f=await I();return D(f),f.toBuffer()}};return B}var IU$,vA9;var RWI=K(()=>{try{IU$=gmA()}catch(H){IU$=null}vA9=SWI});var dy=z((Rmf,vWI)=>{var yWI=function(H){return typeof H<"u"&&H!==null},hA9=function(H){return typeof H==="object"},bA9=function(H){return Object.prototype.toString.call(H)==="[object Object]"},kA9=function(H){return typeof H==="function"},uA9=function(H){return typeof H==="boolean"},gA9=function(H){return H instanceof Buffer},mA9=function(H){if(yWI(H))switch(H.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},pA9=function(H){return H instanceof ArrayBuffer},dA9=function(H){return typeof H==="string"&&H.length>0},cA9=function(H){return typeof H==="number"&&!Number.isNaN(H)},lA9=function(H){return Number.isInteger(H)},iA9=function(H,$,A){return H>=$&&H<=A},nA9=function(H,$){return $.includes(H)},rA9=function(H,$,A){return Error(`Expected ${$} for ${H} but received ${A} of type ${typeof A}`)},aA9=function(H,$){return $.message=H.message,$};vWI.exports={defined:yWI,object:hA9,plainObject:bA9,fn:kA9,bool:uA9,buffer:gA9,typedArray:mA9,arrayBuffer:pA9,string:dA9,number:cA9,integer:lA9,inRange:iA9,inArray:nA9,invalidParameterError:rA9,nativeError:aA9}});var kWI=z((ymf,bWI)=>{var hWI=()=>!0,DU$=null,oA9=()=>{if(!DU$)if(hWI()&&process.report){let H=process.report.excludeNetwork;process.report.excludeNetwork=!0,DU$=process.report.getReport(),process.report.excludeNetwork=H}else DU$={};return DU$};bWI.exports={isLinux:hWI,getReport:oA9}});var mWI=z((vmf,gWI)=>{var uWI=require("fs"),tA9=(H)=>uWI.readFileSync(H,"utf-8"),sA9=(H)=>new Promise(($,A)=>{uWI.readFile(H,"utf-8",(L,I)=>{if(L)A(L);else $(I)})});gWI.exports={LDD_PATH:"/usr/bin/ldd",readFileSync:tA9,readFile:sA9}});var fU$=z((hmf,L7I)=>{var dWI=require("child_process"),{isLinux:yJH,getReport:cWI}=kWI(),{LDD_PATH:BU$,readFile:lWI,readFileSync:iWI}=mWI(),cy,ly,Tr="",nWI=()=>{if(!Tr)return new Promise((H)=>{dWI.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",($,A)=>{Tr=$?" ":A,H(Tr)})});return Tr},rWI=()=>{if(!Tr)try{Tr=dWI.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(H){Tr=" "}return Tr},zr="glibc",aWI=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,RJH="musl",eA9=(H)=>H.includes("libc.musl-")||H.includes("ld-musl-"),oWI=()=>{let H=cWI();if(H.header&&H.header.glibcVersionRuntime)return zr;if(Array.isArray(H.sharedObjects)){if(H.sharedObjects.some(eA9))return RJH}return null},tWI=(H)=>{let[$,A]=H.split(/[\r\n]+/);if($&&$.includes(zr))return zr;if(A&&A.includes(RJH))return RJH;return null},sWI=(H)=>{if(H.includes("musl"))return RJH;if(H.includes("GNU C Library"))return zr;return null},HL9=async()=>{if(cy!==void 0)return cy;cy=null;try{let H=await lWI(BU$);cy=sWI(H)}catch(H){}return cy},$L9=()=>{if(cy!==void 0)return cy;cy=null;try{let H=iWI(BU$);cy=sWI(H)}catch(H){}return cy},eWI=async()=>{let H=null;if(yJH()){if(H=await HL9(),!H)H=oWI();if(!H){let $=await nWI();H=tWI($)}}return H},H7I=()=>{let H=null;if(yJH()){if(H=$L9(),!H)H=oWI();if(!H){let $=rWI();H=tWI($)}}return H},AL9=async()=>yJH()&&await eWI()!==zr,LL9=()=>yJH()&&H7I()!==zr,IL9=async()=>{if(ly!==void 0)return ly;ly=null;try{let $=(await lWI(BU$)).match(aWI);if($)ly=$[1]}catch(H){}return ly},DL9=()=>{if(ly!==void 0)return ly;ly=null;try{let $=iWI(BU$).match(aWI);if($)ly=$[1]}catch(H){}return ly},$7I=()=>{let H=cWI();if(H.header&&H.header.glibcVersionRuntime)return H.header.glibcVersionRuntime;return null},pWI=(H)=>H.trim().split(/\s+/)[1],A7I=(H)=>{let[$,A,L]=H.split(/[\r\n]+/);if($&&$.includes(zr))return pWI($);if(A&&L&&A.includes(RJH))return pWI(L);return null},BL9=async()=>{let H=null;if(yJH()){if(H=await IL9(),!H)H=$7I();if(!H){let $=await nWI();H=A7I($)}}return H},fL9=()=>{let H=null;if(yJH()){if(H=DL9(),!H)H=$7I();if(!H){let $=rWI();H=A7I($)}}return H};L7I.exports={GLIBC:zr,MUSL:RJH,family:eWI,familySync:H7I,isNonGlibcLinux:AL9,isNonGlibcLinuxSync:LL9,version:BL9,versionSync:fL9}});var GSH=z((bmf,I7I)=>{var EL9=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...H)=>console.error("SEMVER",...H):()=>{};I7I.exports=EL9});var EU$=z((kmf,D7I)=>{var ML9=Number.MAX_SAFE_INTEGER||9007199254740991,GL9=["major","premajor","minor","preminor","patch","prepatch","prerelease"];D7I.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:ML9,RELEASE_TYPES:GL9,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var USH=z((iy,B7I)=>{var{MAX_SAFE_COMPONENT_LENGTH:U4A,MAX_SAFE_BUILD_LENGTH:UL9,MAX_LENGTH:XL9}=EU$(),JL9=GSH();iy=B7I.exports={};var FL9=iy.re=[],KL9=iy.safeRe=[],qD=iy.src=[],QL9=iy.safeSrc=[],TD=iy.t={},WL9=0,X4A="[a-zA-Z0-9-]",VL9=[["\\s",1],["\\d",XL9],[X4A,UL9]],PL9=(H)=>{for(let[$,A]of VL9)H=H.split(`${$}*`).join(`${$}{0,${A}}`).split(`${$}+`).join(`${$}{1,${A}}`);return H},t9=(H,$,A)=>{let L=PL9($),I=WL9++;JL9(H,I,$),TD[H]=I,qD[I]=$,QL9[I]=L,FL9[I]=new RegExp($,A?"g":void 0),KL9[I]=new RegExp(L,A?"g":void 0)};t9("NUMERICIDENTIFIER","0|[1-9]\\d*");t9("NUMERICIDENTIFIERLOOSE","\\d+");t9("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${X4A}*`);t9("MAINVERSION",`(${qD[TD.NUMERICIDENTIFIER]})\\.(${qD[TD.NUMERICIDENTIFIER]})\\.(${qD[TD.NUMERICIDENTIFIER]})`);t9("MAINVERSIONLOOSE",`(${qD[TD.NUMERICIDENTIFIERLOOSE]})\\.(${qD[TD.NUMERICIDENTIFIERLOOSE]})\\.(${qD[TD.NUMERICIDENTIFIERLOOSE]})`);t9("PRERELEASEIDENTIFIER",`(?:${qD[TD.NUMERICIDENTIFIER]}|${qD[TD.NONNUMERICIDENTIFIER]})`);t9("PRERELEASEIDENTIFIERLOOSE",`(?:${qD[TD.NUMERICIDENTIFIERLOOSE]}|${qD[TD.NONNUMERICIDENTIFIER]})`);t9("PRERELEASE",`(?:-(${qD[TD.PRERELEASEIDENTIFIER]}(?:\\.${qD[TD.PRERELEASEIDENTIFIER]})*))`);t9("PRERELEASELOOSE",`(?:-?(${qD[TD.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${qD[TD.PRERELEASEIDENTIFIERLOOSE]})*))`);t9("BUILDIDENTIFIER",`${X4A}+`);t9("BUILD",`(?:\\+(${qD[TD.BUILDIDENTIFIER]}(?:\\.${qD[TD.BUILDIDENTIFIER]})*))`);t9("FULLPLAIN",`v?${qD[TD.MAINVERSION]}${qD[TD.PRERELEASE]}?${qD[TD.BUILD]}?`);t9("FULL",`^${qD[TD.FULLPLAIN]}$`);t9("LOOSEPLAIN",`[v=\\s]*${qD[TD.MAINVERSIONLOOSE]}${qD[TD.PRERELEASELOOSE]}?${qD[TD.BUILD]}?`);t9("LOOSE",`^${qD[TD.LOOSEPLAIN]}$`);t9("GTLT","((?:<|>)?=?)");t9("XRANGEIDENTIFIERLOOSE",`${qD[TD.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);t9("XRANGEIDENTIFIER",`${qD[TD.NUMERICIDENTIFIER]}|x|X|\\*`);t9("XRANGEPLAIN",`[v=\\s]*(${qD[TD.XRANGEIDENTIFIER]})(?:\\.(${qD[TD.XRANGEIDENTIFIER]})(?:\\.(${qD[TD.XRANGEIDENTIFIER]})(?:${qD[TD.PRERELEASE]})?${qD[TD.BUILD]}?)?)?`);t9("XRANGEPLAINLOOSE",`[v=\\s]*(${qD[TD.XRANGEIDENTIFIERLOOSE]})(?:\\.(${qD[TD.XRANGEIDENTIFIERLOOSE]})(?:\\.(${qD[TD.XRANGEIDENTIFIERLOOSE]})(?:${qD[TD.PRERELEASELOOSE]})?${qD[TD.BUILD]}?)?)?`);t9("XRANGE",`^${qD[TD.GTLT]}\\s*${qD[TD.XRANGEPLAIN]}$`);t9("XRANGELOOSE",`^${qD[TD.GTLT]}\\s*${qD[TD.XRANGEPLAINLOOSE]}$`);t9("COERCEPLAIN",`(^|[^\\d])(\\d{1,${U4A}})(?:\\.(\\d{1,${U4A}}))?(?:\\.(\\d{1,${U4A}}))?`);t9("COERCE",`${qD[TD.COERCEPLAIN]}(?:$|[^\\d])`);t9("COERCEFULL",qD[TD.COERCEPLAIN]+`(?:${qD[TD.PRERELEASE]})?(?:${qD[TD.BUILD]})?(?:$|[^\\d])`);t9("COERCERTL",qD[TD.COERCE],!0);t9("COERCERTLFULL",qD[TD.COERCEFULL],!0);t9("LONETILDE","(?:~>?)");t9("TILDETRIM",`(\\s*)${qD[TD.LONETILDE]}\\s+`,!0);iy.tildeTrimReplace="$1~";t9("TILDE",`^${qD[TD.LONETILDE]}${qD[TD.XRANGEPLAIN]}$`);t9("TILDELOOSE",`^${qD[TD.LONETILDE]}${qD[TD.XRANGEPLAINLOOSE]}$`);t9("LONECARET","(?:\\^)");t9("CARETTRIM",`(\\s*)${qD[TD.LONECARET]}\\s+`,!0);iy.caretTrimReplace="$1^";t9("CARET",`^${qD[TD.LONECARET]}${qD[TD.XRANGEPLAIN]}$`);t9("CARETLOOSE",`^${qD[TD.LONECARET]}${qD[TD.XRANGEPLAINLOOSE]}$`);t9("COMPARATORLOOSE",`^${qD[TD.GTLT]}\\s*(${qD[TD.LOOSEPLAIN]})$|^$`);t9("COMPARATOR",`^${qD[TD.GTLT]}\\s*(${qD[TD.FULLPLAIN]})$|^$`);t9("COMPARATORTRIM",`(\\s*)${qD[TD.GTLT]}\\s*(${qD[TD.LOOSEPLAIN]}|${qD[TD.XRANGEPLAIN]})`,!0);iy.comparatorTrimReplace="$1$2$3";t9("HYPHENRANGE",`^\\s*(${qD[TD.XRANGEPLAIN]})\\s+-\\s+(${qD[TD.XRANGEPLAIN]})\\s*$`);t9("HYPHENRANGELOOSE",`^\\s*(${qD[TD.XRANGEPLAINLOOSE]})\\s+-\\s+(${qD[TD.XRANGEPLAINLOOSE]})\\s*$`);t9("STAR","(<|>)?=?\\s*\\*");t9("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");t9("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var MU$=z((umf,f7I)=>{var _L9=Object.freeze({loose:!0}),YL9=Object.freeze({}),CL9=(H)=>{if(!H)return YL9;if(typeof H!=="object")return _L9;return H};f7I.exports=CL9});var U7I=z((gmf,G7I)=>{var E7I=/^[0-9]+$/,M7I=(H,$)=>{let A=E7I.test(H),L=E7I.test($);if(A&&L)H=+H,$=+$;return H===$?0:A&&!L?-1:L&&!A?1:H<$?-1:1},wL9=(H,$)=>M7I($,H);G7I.exports={compareIdentifiers:M7I,rcompareIdentifiers:wL9}});var hJH=z((mmf,K7I)=>{var GU$=GSH(),{MAX_LENGTH:X7I,MAX_SAFE_INTEGER:UU$}=EU$(),{safeRe:J7I,safeSrc:F7I,t:XU$}=USH(),ZL9=MU$(),{compareIdentifiers:vJH}=U7I();class Ax{constructor(H,$){if($=ZL9($),H instanceof Ax)if(H.loose===!!$.loose&&H.includePrerelease===!!$.includePrerelease)return H;else H=H.version;else if(typeof H!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof H}".`);if(H.length>X7I)throw TypeError(`version is longer than ${X7I} characters`);GU$("SemVer",H,$),this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease;let A=H.trim().match($.loose?J7I[XU$.LOOSE]:J7I[XU$.FULL]);if(!A)throw TypeError(`Invalid Version: ${H}`);if(this.raw=H,this.major=+A[1],this.minor=+A[2],this.patch=+A[3],this.major>UU$||this.major<0)throw TypeError("Invalid major version");if(this.minor>UU$||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>UU$||this.patch<0)throw TypeError("Invalid patch version");if(!A[4])this.prerelease=[];else this.prerelease=A[4].split(".").map((L)=>{if(/^[0-9]+$/.test(L)){let I=+L;if(I>=0&&I=0)if(typeof this.prerelease[I]==="number")this.prerelease[I]++,I=-2;if(I===-1){if($===this.prerelease.join(".")&&A===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(L)}}if($){let I=[$,L];if(A===!1)I=[$];if(vJH(this.prerelease[0],$)===0){if(isNaN(this.prerelease[1]))this.prerelease=I}else this.prerelease=I}break}default:throw Error(`invalid increment argument: ${H}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}K7I.exports=Ax});var V7I=z((pmf,W7I)=>{var Q7I=hJH(),qL9=(H,$,A=!1)=>{if(H instanceof Q7I)return H;try{return new Q7I(H,$)}catch(L){if(!A)return null;throw L}};W7I.exports=qL9});var _7I=z((dmf,P7I)=>{var TL9=hJH(),zL9=V7I(),{safeRe:JU$,t:FU$}=USH(),NL9=(H,$)=>{if(H instanceof TL9)return H;if(typeof H==="number")H=String(H);if(typeof H!=="string")return null;$=$||{};let A=null;if(!$.rtl)A=H.match($.includePrerelease?JU$[FU$.COERCEFULL]:JU$[FU$.COERCE]);else{let E=$.includePrerelease?JU$[FU$.COERCERTLFULL]:JU$[FU$.COERCERTL],M;while((M=E.exec(H))&&(!A||A.index+A[0].length!==H.length)){if(!A||M.index+M[0].length!==A.index+A[0].length)A=M;E.lastIndex=M.index+M[1].length+M[2].length}E.lastIndex=-1}if(A===null)return null;let L=A[2],I=A[3]||"0",D=A[4]||"0",B=$.includePrerelease&&A[5]?`-${A[5]}`:"",f=$.includePrerelease&&A[6]?`+${A[6]}`:"";return zL9(`${L}.${I}.${D}${B}${f}`,$)};P7I.exports=NL9});var oIH=z((cmf,C7I)=>{var Y7I=hJH(),OL9=(H,$,A)=>new Y7I(H,A).compare(new Y7I($,A));C7I.exports=OL9});var J4A=z((lmf,w7I)=>{var xL9=oIH(),SL9=(H,$,A)=>xL9(H,$,A)>=0;w7I.exports=SL9});var T7I=z((imf,q7I)=>{class Z7I{constructor(){this.max=1000,this.map=new Map}get(H){let $=this.map.get(H);if($===void 0)return;else return this.map.delete(H),this.map.set(H,$),$}delete(H){return this.map.delete(H)}set(H,$){if(!this.delete(H)&&$!==void 0){if(this.map.size>=this.max){let L=this.map.keys().next().value;this.delete(L)}this.map.set(H,$)}return this}}q7I.exports=Z7I});var N7I=z((nmf,z7I)=>{var jL9=oIH(),RL9=(H,$,A)=>jL9(H,$,A)===0;z7I.exports=RL9});var x7I=z((rmf,O7I)=>{var yL9=oIH(),vL9=(H,$,A)=>yL9(H,$,A)!==0;O7I.exports=vL9});var j7I=z((amf,S7I)=>{var hL9=oIH(),bL9=(H,$,A)=>hL9(H,$,A)>0;S7I.exports=bL9});var y7I=z((omf,R7I)=>{var kL9=oIH(),uL9=(H,$,A)=>kL9(H,$,A)<0;R7I.exports=uL9});var h7I=z((tmf,v7I)=>{var gL9=oIH(),mL9=(H,$,A)=>gL9(H,$,A)<=0;v7I.exports=mL9});var k7I=z((smf,b7I)=>{var pL9=N7I(),dL9=x7I(),cL9=j7I(),lL9=J4A(),iL9=y7I(),nL9=h7I(),rL9=(H,$,A,L)=>{switch($){case"===":if(typeof H==="object")H=H.version;if(typeof A==="object")A=A.version;return H===A;case"!==":if(typeof H==="object")H=H.version;if(typeof A==="object")A=A.version;return H!==A;case"":case"=":case"==":return pL9(H,A,L);case"!=":return dL9(H,A,L);case">":return cL9(H,A,L);case">=":return lL9(H,A,L);case"<":return iL9(H,A,L);case"<=":return nL9(H,A,L);default:throw TypeError(`Invalid operator: ${$}`)}};b7I.exports=rL9});var l7I=z((emf,c7I)=>{var XSH=Symbol("SemVer ANY");class KU${static get ANY(){return XSH}constructor(H,$){if($=u7I($),H instanceof KU$)if(H.loose===!!$.loose)return H;else H=H.value;if(H=H.trim().split(/\s+/).join(" "),K4A("comparator",H,$),this.options=$,this.loose=!!$.loose,this.parse(H),this.semver===XSH)this.value="";else this.value=this.operator+this.semver.version;K4A("comp",this)}parse(H){let $=this.options.loose?g7I[m7I.COMPARATORLOOSE]:g7I[m7I.COMPARATOR],A=H.match($);if(!A)throw TypeError(`Invalid comparator: ${H}`);if(this.operator=A[1]!==void 0?A[1]:"",this.operator==="=")this.operator="";if(!A[2])this.semver=XSH;else this.semver=new p7I(A[2],this.options.loose)}toString(){return this.value}test(H){if(K4A("Comparator.test",H,this.options.loose),this.semver===XSH||H===XSH)return!0;if(typeof H==="string")try{H=new p7I(H,this.options)}catch($){return!1}return F4A(H,this.operator,this.semver,this.options)}intersects(H,$){if(!(H instanceof KU$))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new d7I(H.value,$).test(this.value)}else if(H.operator===""){if(H.value==="")return!0;return new d7I(this.value,$).test(H.semver)}if($=u7I($),$.includePrerelease&&(this.value==="<0.0.0-0"||H.value==="<0.0.0-0"))return!1;if(!$.includePrerelease&&(this.value.startsWith("<0.0.0")||H.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&H.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&H.operator.startsWith("<"))return!0;if(this.semver.version===H.semver.version&&this.operator.includes("=")&&H.operator.includes("="))return!0;if(F4A(this.semver,"<",H.semver,$)&&this.operator.startsWith(">")&&H.operator.startsWith("<"))return!0;if(F4A(this.semver,">",H.semver,$)&&this.operator.startsWith("<")&&H.operator.startsWith(">"))return!0;return!1}}c7I.exports=KU$;var u7I=MU$(),{safeRe:g7I,t:m7I}=USH(),F4A=k7I(),K4A=GSH(),p7I=hJH(),d7I=Q4A()});var Q4A=z((Hpf,a7I)=>{var aL9=/\s+/g;class JSH{constructor(H,$){if($=tL9($),H instanceof JSH)if(H.loose===!!$.loose&&H.includePrerelease===!!$.includePrerelease)return H;else return new JSH(H.raw,$);if(H instanceof W4A)return this.raw=H.value,this.set=[[H]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=H.trim().replace(aL9," "),this.set=this.raw.split("||").map((A)=>this.parseRange(A.trim())).filter((A)=>A.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let A=this.set[0];if(this.set=this.set.filter((L)=>!n7I(L[0])),this.set.length===0)this.set=[A];else if(this.set.length>1){for(let L of this.set)if(L.length===1&&II9(L[0])){this.set=[L];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let H=0;H0)this.formatted+="||";let $=this.set[H];for(let A=0;A<$.length;A++){if(A>0)this.formatted+=" ";this.formatted+=$[A].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(H){let A=((this.options.includePrerelease&&AI9)|(this.options.loose&&LI9))+":"+H,L=i7I.get(A);if(L)return L;let I=this.options.loose,D=I?UY[eV.HYPHENRANGELOOSE]:UY[eV.HYPHENRANGE];H=H.replace(D,FI9(this.options.includePrerelease)),cU("hyphen replace",H),H=H.replace(UY[eV.COMPARATORTRIM],eL9),cU("comparator trim",H),H=H.replace(UY[eV.TILDETRIM],HI9),cU("tilde trim",H),H=H.replace(UY[eV.CARETTRIM],$I9),cU("caret trim",H);let B=H.split(" ").map((G)=>DI9(G,this.options)).join(" ").split(/\s+/).map((G)=>JI9(G,this.options));if(I)B=B.filter((G)=>{return cU("loose invalid filter",G,this.options),!!G.match(UY[eV.COMPARATORLOOSE])});cU("range list",B);let f=new Map,E=B.map((G)=>new W4A(G,this.options));for(let G of E){if(n7I(G))return[G];f.set(G.value,G)}if(f.size>1&&f.has(""))f.delete("");let M=[...f.values()];return i7I.set(A,M),M}intersects(H,$){if(!(H instanceof JSH))throw TypeError("a Range is required");return this.set.some((A)=>{return r7I(A,$)&&H.set.some((L)=>{return r7I(L,$)&&A.every((I)=>{return L.every((D)=>{return I.intersects(D,$)})})})})}test(H){if(!H)return!1;if(typeof H==="string")try{H=new sL9(H,this.options)}catch($){return!1}for(let $=0;$H.value==="<0.0.0-0",II9=(H)=>H.value==="",r7I=(H,$)=>{let A=!0,L=H.slice(),I=L.pop();while(A&&L.length)A=L.every((D)=>{return I.intersects(D,$)}),I=L.pop();return A},DI9=(H,$)=>{return cU("comp",H,$),H=EI9(H,$),cU("caret",H),H=BI9(H,$),cU("tildes",H),H=GI9(H,$),cU("xrange",H),H=XI9(H,$),cU("stars",H),H},HP=(H)=>!H||H.toLowerCase()==="x"||H==="*",BI9=(H,$)=>{return H.trim().split(/\s+/).map((A)=>fI9(A,$)).join(" ")},fI9=(H,$)=>{let A=$.loose?UY[eV.TILDELOOSE]:UY[eV.TILDE];return H.replace(A,(L,I,D,B,f)=>{cU("tilde",H,L,I,D,B,f);let E;if(HP(I))E="";else if(HP(D))E=`>=${I}.0.0 <${+I+1}.0.0-0`;else if(HP(B))E=`>=${I}.${D}.0 <${I}.${+D+1}.0-0`;else if(f)cU("replaceTilde pr",f),E=`>=${I}.${D}.${B}-${f} <${I}.${+D+1}.0-0`;else E=`>=${I}.${D}.${B} <${I}.${+D+1}.0-0`;return cU("tilde return",E),E})},EI9=(H,$)=>{return H.trim().split(/\s+/).map((A)=>MI9(A,$)).join(" ")},MI9=(H,$)=>{cU("caret",H,$);let A=$.loose?UY[eV.CARETLOOSE]:UY[eV.CARET],L=$.includePrerelease?"-0":"";return H.replace(A,(I,D,B,f,E)=>{cU("caret",H,I,D,B,f,E);let M;if(HP(D))M="";else if(HP(B))M=`>=${D}.0.0${L} <${+D+1}.0.0-0`;else if(HP(f))if(D==="0")M=`>=${D}.${B}.0${L} <${D}.${+B+1}.0-0`;else M=`>=${D}.${B}.0${L} <${+D+1}.0.0-0`;else if(E)if(cU("replaceCaret pr",E),D==="0")if(B==="0")M=`>=${D}.${B}.${f}-${E} <${D}.${B}.${+f+1}-0`;else M=`>=${D}.${B}.${f}-${E} <${D}.${+B+1}.0-0`;else M=`>=${D}.${B}.${f}-${E} <${+D+1}.0.0-0`;else if(cU("no pr"),D==="0")if(B==="0")M=`>=${D}.${B}.${f}${L} <${D}.${B}.${+f+1}-0`;else M=`>=${D}.${B}.${f}${L} <${D}.${+B+1}.0-0`;else M=`>=${D}.${B}.${f} <${+D+1}.0.0-0`;return cU("caret return",M),M})},GI9=(H,$)=>{return cU("replaceXRanges",H,$),H.split(/\s+/).map((A)=>UI9(A,$)).join(" ")},UI9=(H,$)=>{H=H.trim();let A=$.loose?UY[eV.XRANGELOOSE]:UY[eV.XRANGE];return H.replace(A,(L,I,D,B,f,E)=>{cU("xRange",H,L,I,D,B,f,E);let M=HP(D),G=M||HP(B),U=G||HP(f),X=U;if(I==="="&&X)I="";if(E=$.includePrerelease?"-0":"",M)if(I===">"||I==="<")L="<0.0.0-0";else L="*";else if(I&&X){if(G)B=0;if(f=0,I===">")if(I=">=",G)D=+D+1,B=0,f=0;else B=+B+1,f=0;else if(I==="<=")if(I="<",G)D=+D+1;else B=+B+1;if(I==="<")E="-0";L=`${I+D}.${B}.${f}${E}`}else if(G)L=`>=${D}.0.0${E} <${+D+1}.0.0-0`;else if(U)L=`>=${D}.${B}.0${E} <${D}.${+B+1}.0-0`;return cU("xRange return",L),L})},XI9=(H,$)=>{return cU("replaceStars",H,$),H.trim().replace(UY[eV.STAR],"")},JI9=(H,$)=>{return cU("replaceGTE0",H,$),H.trim().replace(UY[$.includePrerelease?eV.GTE0PRE:eV.GTE0],"")},FI9=(H)=>($,A,L,I,D,B,f,E,M,G,U,X)=>{if(HP(L))A="";else if(HP(I))A=`>=${L}.0.0${H?"-0":""}`;else if(HP(D))A=`>=${L}.${I}.0${H?"-0":""}`;else if(B)A=`>=${A}`;else A=`>=${A}${H?"-0":""}`;if(HP(M))E="";else if(HP(G))E=`<${+M+1}.0.0-0`;else if(HP(U))E=`<${M}.${+G+1}.0-0`;else if(X)E=`<=${M}.${G}.${U}-${X}`;else if(H)E=`<${M}.${G}.${+U+1}-0`;else E=`<=${E}`;return`${A} ${E}`.trim()},KI9=(H,$,A)=>{for(let L=0;L0){let I=H[L].semver;if(I.major===$.major&&I.minor===$.minor&&I.patch===$.patch)return!0}}return!1}return!0}});var t7I=z(($pf,o7I)=>{var QI9=Q4A(),WI9=(H,$,A)=>{try{$=new QI9($,A)}catch(L){return!1}return $.test(H)};o7I.exports=WI9});var V4A=z((Apf,VI9)=>{VI9.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.33.5",author:"Lovell Fuller ",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert ","Jonathan Ong ","Chanon Sajjamanochai ","Juliano Julio ","Daniel Gasienica ","Julian Walker ","Amit Pitaru ","Brandon Aaron ","Andreas Lind ","Maurus Cuelenaere ","Linus Unneb\xE4ck ","Victor Mateevitsi ","Alaric Holloway ","Bernhard K. Weisshuhn ","Chris Riley ","David Carley ","John Tobin ","Kenton Gray ","Felix B\xFCnemann ","Samy Al Zahrani ","Chintan Thakkar ","F. Orlando Galashan ","Kleis Auke Wolthuizen ","Matt Hirsch ","Matthias Thoemmes ","Patrick Paskaris ","J\xE9r\xE9my Lal ","Rahul Nanwani ","Alice Monday ","Kristo Jorgenson ","YvesBos ","Guy Maliar ","Nicolas Coden ","Matt Parrish ","Marcel Bretschneider ","Matthew McEachen ","Jarda Kot\u011B\u0161ovec ","Kenric D'Souza ","Oleh Aleinyk ","Marcel Bretschneider ","Andrea Bianco ","Rik Heywood ","Thomas Parisot ","Nathan Graves ","Tom Lokhorst ","Espen Hovlandsdal ","Sylvain Dumont ","Alun Davies ","Aidan Hoolachan ","Axel Eirola ","Freezy ","Daiz ","Julian Aubourg ","Keith Belovay ","Michael B. Klein ","Jordan Prudhomme ","Ilya Ovdin ","Andargor ","Paul Neave ","Brendan Kennedy ","Brychan Bennett-Odlum ","Edward Silverton ","Roman Malieiev ","Tomas Szabo ","Robert O'Rourke ","Guillermo Alfonso Varela Chouci\xF1o ","Christian Flintrup ","Manan Jadhav ","Leon Radley ","alza54 ","Jacob Smith ","Michael Nutt ","Brad Parham ","Taneli Vatanen ","Joris Dugu\xE9 ","Chris Banks ","Ompal Singh ","Brodan ","Ankur Parihar ","Brahim Ait elhaj ","Mart Jansink ","Lachlan Newman ","Dennis Beatty ","Ingvar Stepanyan ","Don Denton "],scripts:{install:"node install/check",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types","test-lint":"semistandard && cpplint","test-unit":"nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha","test-licensing":'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',"test-leak":"./test/leak/leak.sh","test-types":"tsd","package-from-local-build":"node npm/from-local-build","package-from-github-release":"node npm/from-github-release","docs-build":"node docs/build && node docs/search-index/build","docs-serve":"cd docs && npx serve","docs-publish":"cd docs && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{color:"^4.2.3","detect-libc":"^2.0.3",semver:"^7.6.3"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.33.5","@img/sharp-darwin-x64":"0.33.5","@img/sharp-libvips-darwin-arm64":"1.0.4","@img/sharp-libvips-darwin-x64":"1.0.4","@img/sharp-libvips-linux-arm":"1.0.5","@img/sharp-libvips-linux-arm64":"1.0.4","@img/sharp-libvips-linux-s390x":"1.0.4","@img/sharp-libvips-linux-x64":"1.0.4","@img/sharp-libvips-linuxmusl-arm64":"1.0.4","@img/sharp-libvips-linuxmusl-x64":"1.0.4","@img/sharp-linux-arm":"0.33.5","@img/sharp-linux-arm64":"0.33.5","@img/sharp-linux-s390x":"0.33.5","@img/sharp-linux-x64":"0.33.5","@img/sharp-linuxmusl-arm64":"0.33.5","@img/sharp-linuxmusl-x64":"0.33.5","@img/sharp-wasm32":"0.33.5","@img/sharp-win32-ia32":"0.33.5","@img/sharp-win32-x64":"0.33.5"},devDependencies:{"@emnapi/runtime":"^1.2.0","@img/sharp-libvips-dev":"1.0.4","@img/sharp-libvips-dev-wasm32":"1.0.5","@img/sharp-libvips-win32-ia32":"1.0.4","@img/sharp-libvips-win32-x64":"1.0.4","@types/node":"*",async:"^3.2.5",cc:"^3.0.1",emnapi:"^1.2.0","exif-reader":"^2.0.1","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^8.0.3","license-checker":"^25.0.1",mocha:"^10.7.3","node-addon-api":"^8.1.0",nyc:"^17.0.0",prebuild:"^13.0.1",semistandard:"^17.0.0","tar-fs":"^3.0.6",tsd:"^0.31.1"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.15.3"},funding:{url:"https://opencollective.com/libvips"},binary:{napi_versions:[9]},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var C4A=z((Lpf,f6I)=>{var{spawnSync:_4A}=require("child_process"),{createHash:PI9}=require("crypto"),$6I=_7I(),_I9=J4A(),YI9=t7I(),s7I=fU$(),{config:CI9,engines:e7I,optionalDependencies:wI9}=V4A(),ZI9=process.env.npm_package_config_libvips||CI9.libvips,A6I=$6I(ZI9).version,qI9=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-ia32","win32-x64"],Y4A={encoding:"utf8",shell:!0},TI9=(H)=>{if(H instanceof Error)console.error(`sharp: Installation error: ${H.message}`);else console.log(`sharp: ${H}`)},L6I=()=>s7I.isNonGlibcLinuxSync()?s7I.familySync():"",zI9=()=>`linux${L6I()}-x64`,bJH=()=>{if(I6I())return"wasm32";let{npm_config_arch:H,npm_config_platform:$,npm_config_libc:A}=process.env,L=typeof A==="string"?A:L6I();return`${$||"linux"}${L}-${H||"x64"}`},NI9=()=>{try{return require(`@img/sharp-libvips-dev-${bJH()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},OI9=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},xI9=()=>{try{return require(`@img/sharp-libvips-dev-${bJH()}/lib`)}catch{try{return require(`@img/sharp-libvips-${bJH()}/lib`)}catch{}}return""},SI9=()=>{if(process.release?.name==="node"&&process.versions){if(!YI9(process.versions.node,e7I.node))return{found:process.versions.node,expected:e7I.node}}},I6I=()=>{let{CC:H}=process.env;return Boolean(H&&H.endsWith("/emcc"))},jI9=()=>{return!1},H6I=(H)=>PI9("sha512").update(H).digest("hex"),RI9=()=>{try{let H=H6I(`imgsharp-libvips-${bJH()}`),$=$6I(wI9[`@img/sharp-libvips-${bJH()}`]).version;return H6I(`${H}npm:${$}`).slice(0,10)}catch{}return""},yI9=()=>_4A(`node-gyp rebuild --directory=src ${I6I()?"--nodedir=emscripten":""}`,{...Y4A,stdio:"inherit"}).status,D6I=()=>{return(_4A("pkg-config --modversion vips-cpp",{...Y4A,env:{...process.env,PKG_CONFIG_PATH:B6I()}}).stdout||"").trim()},B6I=()=>{return[(_4A('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',Y4A).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":")},P4A=(H,$,A)=>{if(A)A(`Detected ${$}, skipping search for globally-installed libvips`);return H},vI9=(H)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return P4A(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",H);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return P4A(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",H);if(jI9())return P4A(!1,"Rosetta",H);let $=D6I();return!!$&&_I9($,A6I)};f6I.exports={minimumLibvipsVersion:A6I,prebuiltPlatforms:qI9,buildPlatformArch:bJH,buildSharpLibvipsIncludeDir:NI9,buildSharpLibvipsCPlusPlusDir:OI9,buildSharpLibvipsLibDir:xI9,isUnsupportedNodeRuntime:SI9,runtimePlatformArch:zI9,log:TI9,yarnLocator:RI9,spawnRebuild:yI9,globalLibvipsVersion:D6I,pkgConfigPath:B6I,useGlobalLibvips:vI9}});var FSH=z((Ipf,M6I)=>{var{familySync:hI9,versionSync:bI9}=fU$(),{runtimePlatformArch:kI9,isUnsupportedNodeRuntime:E6I,prebuiltPlatforms:uI9,minimumLibvipsVersion:gI9}=C4A(),tIH=kI9(),mI9=[`../src/build/Release/sharp-${tIH}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${tIH}/sharp.node`,"@img/sharp-wasm32/sharp.node"],w4A,QU$=[];for(let H of mI9)try{w4A=require(H);break}catch($){QU$.push($)}if(w4A)M6I.exports=w4A;else{let[H,$,A]=["linux","darwin","win32"].map((D)=>tIH.startsWith(D)),L=[`Could not load the "sharp" module using the ${tIH} runtime`];QU$.forEach((D)=>{if(D.code!=="MODULE_NOT_FOUND")L.push(`${D.code}: ${D.message}`)});let I=QU$.map((D)=>D.message).join(" ");if(L.push("Possible solutions:"),E6I()){let{found:D,expected:B}=E6I();L.push("- Please upgrade Node.js:",` Found ${D}`,` Requires ${B}`)}else if(uI9.includes(tIH)){let[D,B]=tIH.split("-"),f=D.endsWith("musl")?" --libc=musl":"";L.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${D.replace("musl","")}${f} --cpu=${B} sharp`)}else L.push(`- Manually install libvips >= ${gI9}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(H&&/(symbol not found|CXXABI_)/i.test(I))try{let{config:D}=require(`@img/sharp-libvips-${tIH}/package`),B=`${hI9()} ${bI9()}`,f=`${D.musl?"musl":"glibc"} ${D.musl||D.glibc}`;L.push("- Update your OS:",` Found ${B}`,` Requires ${f}`)}catch(D){}if(H&&/\/snap\/core[0-9]{2}/.test(I))L.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if($&&/Incompatible library version/.test(I))L.push("- Update Homebrew:"," brew update && brew upgrade vips");if(QU$.some((D)=>D.code==="ERR_DLOPEN_DISABLED"))L.push("- Run Node.js without using the --no-addons flag");if(A&&/The specified procedure could not be found/.test(I))L.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw L.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(L.join(` `))}});var U6I=z((Dpf,G6I)=>{var pI9=require("util"),Z4A=require("stream"),dI9=dy();FSH();var cI9=pI9.debuglog("sharp"),sIH=function(H,$){if(arguments.length===1&&!dI9.defined(H))throw Error("Invalid input");if(!(this instanceof sIH))return new sIH(H,$);return Z4A.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],useExifOrientation:!1,angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBeforePreExtract:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,resolveWithObject:!1,jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],debuglog:(A)=>{this.emit("warning",A),cI9(A)},queueListener:function(A){sIH.queue.emit("change",A)}},this.options.input=this._createInputDescriptor(H,$,{allowStream:!0}),this};Object.setPrototypeOf(sIH.prototype,Z4A.Duplex.prototype);Object.setPrototypeOf(sIH,Z4A.Duplex);function lI9(){let H=this.constructor.call(),{debuglog:$,queueListener:A,...L}=this.options;if(H.options=structuredClone(L),H.options.debuglog=$,H.options.queueListener=A,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),H.options.input.buffer=this.options.input.buffer,H.emit("finish")});return H}Object.assign(sIH.prototype,{clone:lI9});G6I.exports=sIH});var q4A=z((Bpf,X6I)=>{X6I.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var F6I=z((fpf,J6I)=>{J6I.exports=function($){if(!$||typeof $==="string")return!1;return $ instanceof Array||Array.isArray($)||$.length>=0&&($.splice instanceof Function||Object.getOwnPropertyDescriptor($,$.length-1)&&$.constructor.name!=="String")}});var W6I=z((Epf,Q6I)=>{var iI9=F6I(),nI9=Array.prototype.concat,rI9=Array.prototype.slice,K6I=Q6I.exports=function($){var A=[];for(var L=0,I=$.length;L{var QSH=q4A(),WSH=W6I(),V6I=Object.hasOwnProperty,P6I=Object.create(null);for(KSH in QSH)if(V6I.call(QSH,KSH))P6I[QSH[KSH]]=KSH;var KSH,o2=_6I.exports={to:{},get:{}};o2.get=function(H){var $=H.substring(0,3).toLowerCase(),A,L;switch($){case"hsl":A=o2.get.hsl(H),L="hsl";break;case"hwb":A=o2.get.hwb(H),L="hwb";break;default:A=o2.get.rgb(H),L="rgb";break}if(!A)return null;return{model:L,value:A}};o2.get.rgb=function(H){if(!H)return null;var $=/^#([a-f0-9]{3,4})$/i,A=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,L=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,I=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,D=/^(\w+)$/,B=[0,0,0,1],f,E,M;if(f=H.match(A)){M=f[2],f=f[1];for(E=0;E<3;E++){var G=E*2;B[E]=parseInt(f.slice(G,G+2),16)}if(M)B[3]=parseInt(M,16)/255}else if(f=H.match($)){f=f[1],M=f[3];for(E=0;E<3;E++)B[E]=parseInt(f[E]+f[E],16);if(M)B[3]=parseInt(M+M,16)/255}else if(f=H.match(L)){for(E=0;E<3;E++)B[E]=parseInt(f[E+1],0);if(f[4])if(f[5])B[3]=parseFloat(f[4])*0.01;else B[3]=parseFloat(f[4])}else if(f=H.match(I)){for(E=0;E<3;E++)B[E]=Math.round(parseFloat(f[E+1])*2.55);if(f[4])if(f[5])B[3]=parseFloat(f[4])*0.01;else B[3]=parseFloat(f[4])}else if(f=H.match(D)){if(f[1]==="transparent")return[0,0,0,0];if(!V6I.call(QSH,f[1]))return null;return B=QSH[f[1]],B[3]=1,B}else return null;for(E=0;E<3;E++)B[E]=Nr(B[E],0,255);return B[3]=Nr(B[3],0,1),B};o2.get.hsl=function(H){if(!H)return null;var $=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,A=H.match($);if(A){var L=parseFloat(A[4]),I=(parseFloat(A[1])%360+360)%360,D=Nr(parseFloat(A[2]),0,100),B=Nr(parseFloat(A[3]),0,100),f=Nr(isNaN(L)?1:L,0,1);return[I,D,B,f]}return null};o2.get.hwb=function(H){if(!H)return null;var $=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,A=H.match($);if(A){var L=parseFloat(A[4]),I=(parseFloat(A[1])%360+360)%360,D=Nr(parseFloat(A[2]),0,100),B=Nr(parseFloat(A[3]),0,100),f=Nr(isNaN(L)?1:L,0,1);return[I,D,B,f]}return null};o2.to.hex=function(){var H=WSH(arguments);return"#"+WU$(H[0])+WU$(H[1])+WU$(H[2])+(H[3]<1?WU$(Math.round(H[3]*255)):"")};o2.to.rgb=function(){var H=WSH(arguments);return H.length<4||H[3]===1?"rgb("+Math.round(H[0])+", "+Math.round(H[1])+", "+Math.round(H[2])+")":"rgba("+Math.round(H[0])+", "+Math.round(H[1])+", "+Math.round(H[2])+", "+H[3]+")"};o2.to.rgb.percent=function(){var H=WSH(arguments),$=Math.round(H[0]/255*100),A=Math.round(H[1]/255*100),L=Math.round(H[2]/255*100);return H.length<4||H[3]===1?"rgb("+$+"%, "+A+"%, "+L+"%)":"rgba("+$+"%, "+A+"%, "+L+"%, "+H[3]+")"};o2.to.hsl=function(){var H=WSH(arguments);return H.length<4||H[3]===1?"hsl("+H[0]+", "+H[1]+"%, "+H[2]+"%)":"hsla("+H[0]+", "+H[1]+"%, "+H[2]+"%, "+H[3]+")"};o2.to.hwb=function(){var H=WSH(arguments),$="";if(H.length>=4&&H[3]!==1)$=", "+H[3];return"hwb("+H[0]+", "+H[1]+"%, "+H[2]+"%"+$+")"};o2.to.keyword=function(H){return P6I[H.slice(0,3)]};function Nr(H,$,A){return Math.min(Math.max($,H),A)}function WU$(H){var $=Math.round(H).toString(16).toUpperCase();return $.length<2?"0"+$:$}});var T4A=z((Gpf,w6I)=>{var VSH=q4A(),C6I={};for(let H of Object.keys(VSH))C6I[VSH[H]]=H;var AB={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};w6I.exports=AB;for(let H of Object.keys(AB)){if(!("channels"in AB[H]))throw Error("missing channels property: "+H);if(!("labels"in AB[H]))throw Error("missing channel labels property: "+H);if(AB[H].labels.length!==AB[H].channels)throw Error("channel and label counts mismatch: "+H);let{channels:$,labels:A}=AB[H];delete AB[H].channels,delete AB[H].labels,Object.defineProperty(AB[H],"channels",{value:$}),Object.defineProperty(AB[H],"labels",{value:A})}AB.rgb.hsl=function(H){let $=H[0]/255,A=H[1]/255,L=H[2]/255,I=Math.min($,A,L),D=Math.max($,A,L),B=D-I,f,E;if(D===I)f=0;else if($===D)f=(A-L)/B;else if(A===D)f=2+(L-$)/B;else if(L===D)f=4+($-A)/B;if(f=Math.min(f*60,360),f<0)f+=360;let M=(I+D)/2;if(D===I)E=0;else if(M<=0.5)E=B/(D+I);else E=B/(2-D-I);return[f,E*100,M*100]};AB.rgb.hsv=function(H){let $,A,L,I,D,B=H[0]/255,f=H[1]/255,E=H[2]/255,M=Math.max(B,f,E),G=M-Math.min(B,f,E),U=function(X){return(M-X)/6/G+0.5};if(G===0)I=0,D=0;else{if(D=G/M,$=U(B),A=U(f),L=U(E),B===M)I=L-A;else if(f===M)I=0.3333333333333333+$-L;else if(E===M)I=0.6666666666666666+A-$;if(I<0)I+=1;else if(I>1)I-=1}return[I*360,D*100,M*100]};AB.rgb.hwb=function(H){let $=H[0],A=H[1],L=H[2],I=AB.rgb.hsl(H)[0],D=0.00392156862745098*Math.min($,Math.min(A,L));return L=1-0.00392156862745098*Math.max($,Math.max(A,L)),[I,D*100,L*100]};AB.rgb.cmyk=function(H){let $=H[0]/255,A=H[1]/255,L=H[2]/255,I=Math.min(1-$,1-A,1-L),D=(1-$-I)/(1-I)||0,B=(1-A-I)/(1-I)||0,f=(1-L-I)/(1-I)||0;return[D*100,B*100,f*100,I*100]};function aI9(H,$){return(H[0]-$[0])**2+(H[1]-$[1])**2+(H[2]-$[2])**2}AB.rgb.keyword=function(H){let $=C6I[H];if($)return $;let A=1/0,L;for(let I of Object.keys(VSH)){let D=VSH[I],B=aI9(H,D);if(B0.04045?(($+0.055)/1.055)**2.4:$/12.92,A=A>0.04045?((A+0.055)/1.055)**2.4:A/12.92,L=L>0.04045?((L+0.055)/1.055)**2.4:L/12.92;let I=$*0.4124+A*0.3576+L*0.1805,D=$*0.2126+A*0.7152+L*0.0722,B=$*0.0193+A*0.1192+L*0.9505;return[I*100,D*100,B*100]};AB.rgb.lab=function(H){let $=AB.rgb.xyz(H),A=$[0],L=$[1],I=$[2];A/=95.047,L/=100,I/=108.883,A=A>0.008856?A**0.3333333333333333:7.787*A+0.13793103448275862,L=L>0.008856?L**0.3333333333333333:7.787*L+0.13793103448275862,I=I>0.008856?I**0.3333333333333333:7.787*I+0.13793103448275862;let D=116*L-16,B=500*(A-L),f=200*(L-I);return[D,B,f]};AB.hsl.rgb=function(H){let $=H[0]/360,A=H[1]/100,L=H[2]/100,I,D,B;if(A===0)return B=L*255,[B,B,B];if(L<0.5)I=L*(1+A);else I=L+A-L*A;let f=2*L-I,E=[0,0,0];for(let M=0;M<3;M++){if(D=$+0.3333333333333333*-(M-1),D<0)D++;if(D>1)D--;if(6*D<1)B=f+(I-f)*6*D;else if(2*D<1)B=I;else if(3*D<2)B=f+(I-f)*(0.6666666666666666-D)*6;else B=f;E[M]=B*255}return E};AB.hsl.hsv=function(H){let $=H[0],A=H[1]/100,L=H[2]/100,I=A,D=Math.max(L,0.01);L*=2,A*=L<=1?L:2-L,I*=D<=1?D:2-D;let B=(L+A)/2,f=L===0?2*I/(D+I):2*A/(L+A);return[$,f*100,B*100]};AB.hsv.rgb=function(H){let $=H[0]/60,A=H[1]/100,L=H[2]/100,I=Math.floor($)%6,D=$-Math.floor($),B=255*L*(1-A),f=255*L*(1-A*D),E=255*L*(1-A*(1-D));switch(L*=255,I){case 0:return[L,E,B];case 1:return[f,L,B];case 2:return[B,L,E];case 3:return[B,f,L];case 4:return[E,B,L];case 5:return[L,B,f]}};AB.hsv.hsl=function(H){let $=H[0],A=H[1]/100,L=H[2]/100,I=Math.max(L,0.01),D,B;B=(2-A)*L;let f=(2-A)*I;return D=A*I,D/=f<=1?f:2-f,D=D||0,B/=2,[$,D*100,B*100]};AB.hwb.rgb=function(H){let $=H[0]/360,A=H[1]/100,L=H[2]/100,I=A+L,D;if(I>1)A/=I,L/=I;let B=Math.floor(6*$),f=1-L;if(D=6*$-B,(B&1)!==0)D=1-D;let E=A+D*(f-A),M,G,U;switch(B){default:case 6:case 0:M=f,G=E,U=A;break;case 1:M=E,G=f,U=A;break;case 2:M=A,G=f,U=E;break;case 3:M=A,G=E,U=f;break;case 4:M=E,G=A,U=f;break;case 5:M=f,G=A,U=E;break}return[M*255,G*255,U*255]};AB.cmyk.rgb=function(H){let $=H[0]/100,A=H[1]/100,L=H[2]/100,I=H[3]/100,D=1-Math.min(1,$*(1-I)+I),B=1-Math.min(1,A*(1-I)+I),f=1-Math.min(1,L*(1-I)+I);return[D*255,B*255,f*255]};AB.xyz.rgb=function(H){let $=H[0]/100,A=H[1]/100,L=H[2]/100,I,D,B;return I=$*3.2406+A*-1.5372+L*-0.4986,D=$*-0.9689+A*1.8758+L*0.0415,B=$*0.0557+A*-0.204+L*1.057,I=I>0.0031308?1.055*I**0.4166666666666667-0.055:I*12.92,D=D>0.0031308?1.055*D**0.4166666666666667-0.055:D*12.92,B=B>0.0031308?1.055*B**0.4166666666666667-0.055:B*12.92,I=Math.min(Math.max(0,I),1),D=Math.min(Math.max(0,D),1),B=Math.min(Math.max(0,B),1),[I*255,D*255,B*255]};AB.xyz.lab=function(H){let $=H[0],A=H[1],L=H[2];$/=95.047,A/=100,L/=108.883,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,A=A>0.008856?A**0.3333333333333333:7.787*A+0.13793103448275862,L=L>0.008856?L**0.3333333333333333:7.787*L+0.13793103448275862;let I=116*A-16,D=500*($-A),B=200*(A-L);return[I,D,B]};AB.lab.xyz=function(H){let $=H[0],A=H[1],L=H[2],I,D,B;D=($+16)/116,I=A/500+D,B=D-L/200;let f=D**3,E=I**3,M=B**3;return D=f>0.008856?f:(D-0.13793103448275862)/7.787,I=E>0.008856?E:(I-0.13793103448275862)/7.787,B=M>0.008856?M:(B-0.13793103448275862)/7.787,I*=95.047,D*=100,B*=108.883,[I,D,B]};AB.lab.lch=function(H){let $=H[0],A=H[1],L=H[2],I;if(I=Math.atan2(L,A)*360/2/Math.PI,I<0)I+=360;let B=Math.sqrt(A*A+L*L);return[$,B,I]};AB.lch.lab=function(H){let $=H[0],A=H[1],I=H[2]/360*2*Math.PI,D=A*Math.cos(I),B=A*Math.sin(I);return[$,D,B]};AB.rgb.ansi16=function(H,$=null){let[A,L,I]=H,D=$===null?AB.rgb.hsv(H)[2]:$;if(D=Math.round(D/50),D===0)return 30;let B=30+(Math.round(I/255)<<2|Math.round(L/255)<<1|Math.round(A/255));if(D===2)B+=60;return B};AB.hsv.ansi16=function(H){return AB.rgb.ansi16(AB.hsv.rgb(H),H[2])};AB.rgb.ansi256=function(H){let $=H[0],A=H[1],L=H[2];if($===A&&A===L){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(A/255*5)+Math.round(L/255*5)};AB.ansi16.rgb=function(H){let $=H%10;if($===0||$===7){if(H>50)$+=3.5;return $=$/10.5*255,[$,$,$]}let A=(~~(H>50)+1)*0.5,L=($&1)*A*255,I=($>>1&1)*A*255,D=($>>2&1)*A*255;return[L,I,D]};AB.ansi256.rgb=function(H){if(H>=232){let D=(H-232)*10+8;return[D,D,D]}H-=16;let $,A=Math.floor(H/36)/5*255,L=Math.floor(($=H%36)/6)/5*255,I=$%6/5*255;return[A,L,I]};AB.rgb.hex=function(H){let A=(((Math.round(H[0])&255)<<16)+((Math.round(H[1])&255)<<8)+(Math.round(H[2])&255)).toString(16).toUpperCase();return"000000".substring(A.length)+A};AB.hex.rgb=function(H){let $=H.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!$)return[0,0,0];let A=$[0];if($[0].length===3)A=A.split("").map((f)=>{return f+f}).join("");let L=parseInt(A,16),I=L>>16&255,D=L>>8&255,B=L&255;return[I,D,B]};AB.rgb.hcg=function(H){let $=H[0]/255,A=H[1]/255,L=H[2]/255,I=Math.max(Math.max($,A),L),D=Math.min(Math.min($,A),L),B=I-D,f,E;if(B<1)f=D/(1-B);else f=0;if(B<=0)E=0;else if(I===$)E=(A-L)/B%6;else if(I===A)E=2+(L-$)/B;else E=4+($-A)/B;return E/=6,E%=1,[E*360,B*100,f*100]};AB.hsl.hcg=function(H){let $=H[1]/100,A=H[2]/100,L=A<0.5?2*$*A:2*$*(1-A),I=0;if(L<1)I=(A-0.5*L)/(1-L);return[H[0],L*100,I*100]};AB.hsv.hcg=function(H){let $=H[1]/100,A=H[2]/100,L=$*A,I=0;if(L<1)I=(A-L)/(1-L);return[H[0],L*100,I*100]};AB.hcg.rgb=function(H){let $=H[0]/360,A=H[1]/100,L=H[2]/100;if(A===0)return[L*255,L*255,L*255];let I=[0,0,0],D=$%1*6,B=D%1,f=1-B,E=0;switch(Math.floor(D)){case 0:I[0]=1,I[1]=B,I[2]=0;break;case 1:I[0]=f,I[1]=1,I[2]=0;break;case 2:I[0]=0,I[1]=1,I[2]=B;break;case 3:I[0]=0,I[1]=f,I[2]=1;break;case 4:I[0]=B,I[1]=0,I[2]=1;break;default:I[0]=1,I[1]=0,I[2]=f}return E=(1-A)*L,[(A*I[0]+E)*255,(A*I[1]+E)*255,(A*I[2]+E)*255]};AB.hcg.hsv=function(H){let $=H[1]/100,A=H[2]/100,L=$+A*(1-$),I=0;if(L>0)I=$/L;return[H[0],I*100,L*100]};AB.hcg.hsl=function(H){let $=H[1]/100,L=H[2]/100*(1-$)+0.5*$,I=0;if(L>0&&L<0.5)I=$/(2*L);else if(L>=0.5&&L<1)I=$/(2*(1-L));return[H[0],I*100,L*100]};AB.hcg.hwb=function(H){let $=H[1]/100,A=H[2]/100,L=$+A*(1-$);return[H[0],(L-$)*100,(1-L)*100]};AB.hwb.hcg=function(H){let $=H[1]/100,L=1-H[2]/100,I=L-$,D=0;if(I<1)D=(L-I)/(1-I);return[H[0],I*100,D*100]};AB.apple.rgb=function(H){return[H[0]/65535*255,H[1]/65535*255,H[2]/65535*255]};AB.rgb.apple=function(H){return[H[0]/255*65535,H[1]/255*65535,H[2]/255*65535]};AB.gray.rgb=function(H){return[H[0]/100*255,H[0]/100*255,H[0]/100*255]};AB.gray.hsl=function(H){return[0,0,H[0]]};AB.gray.hsv=AB.gray.hsl;AB.gray.hwb=function(H){return[0,100,H[0]]};AB.gray.cmyk=function(H){return[0,0,0,H[0]]};AB.gray.lab=function(H){return[H[0],0,0]};AB.gray.hex=function(H){let $=Math.round(H[0]/100*255)&255,L=(($<<16)+($<<8)+$).toString(16).toUpperCase();return"000000".substring(L.length)+L};AB.rgb.gray=function(H){return[(H[0]+H[1]+H[2])/3/255*100]}});var q6I=z((Upf,Z6I)=>{var VU$=T4A();function oI9(){let H={},$=Object.keys(VU$);for(let A=$.length,L=0;L{var z4A=T4A(),HD9=q6I(),kJH={},$D9=Object.keys(z4A);function AD9(H){let $=function(...A){let L=A[0];if(L===void 0||L===null)return L;if(L.length>1)A=L;return H(A)};if("conversion"in H)$.conversion=H.conversion;return $}function LD9(H){let $=function(...A){let L=A[0];if(L===void 0||L===null)return L;if(L.length>1)A=L;let I=H(A);if(typeof I==="object")for(let D=I.length,B=0;B{kJH[H]={},Object.defineProperty(kJH[H],"channels",{value:z4A[H].channels}),Object.defineProperty(kJH[H],"labels",{value:z4A[H].labels});let $=HD9(H);Object.keys($).forEach((L)=>{let I=$[L];kJH[H][L]=LD9(I),kJH[H][L].raw=AD9(I)})});T6I.exports=kJH});var _U$=z((Jpf,N6I)=>{var uJH=Y6I(),t2=N4A(),z6I=["keyword","gray","hex"],O4A={};for(let H of Object.keys(t2))O4A[[...t2[H].labels].sort().join("")]=H;var PU$={};function qQ(H,$){if(!(this instanceof qQ))return new qQ(H,$);if($&&$ in z6I)$=null;if($&&!($ in t2))throw Error("Unknown model: "+$);let A,L;if(H==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(H instanceof qQ)this.model=H.model,this.color=[...H.color],this.valpha=H.valpha;else if(typeof H==="string"){let I=uJH.get(H);if(I===null)throw Error("Unable to parse color from string: "+H);this.model=I.model,L=t2[this.model].channels,this.color=I.value.slice(0,L),this.valpha=typeof I.value[L]==="number"?I.value[L]:1}else if(H.length>0){this.model=$||"rgb",L=t2[this.model].channels;let I=Array.prototype.slice.call(H,0,L);this.color=x4A(I,L),this.valpha=typeof H[L]==="number"?H[L]:1}else if(typeof H==="number")this.model="rgb",this.color=[H>>16&255,H>>8&255,H&255],this.valpha=1;else{this.valpha=1;let I=Object.keys(H);if("alpha"in H)I.splice(I.indexOf("alpha"),1),this.valpha=typeof H.alpha==="number"?H.alpha:0;let D=I.sort().join("");if(!(D in O4A))throw Error("Unable to parse color from object: "+JSON.stringify(H));this.model=O4A[D];let{labels:B}=t2[this.model],f=[];for(A=0;A(H%360+360)%360),saturationl:VX("hsl",1,VK(100)),lightness:VX("hsl",2,VK(100)),saturationv:VX("hsv",1,VK(100)),value:VX("hsv",2,VK(100)),chroma:VX("hcg",1,VK(100)),gray:VX("hcg",2,VK(100)),white:VX("hwb",1,VK(100)),wblack:VX("hwb",2,VK(100)),cyan:VX("cmyk",0,VK(100)),magenta:VX("cmyk",1,VK(100)),yellow:VX("cmyk",2,VK(100)),black:VX("cmyk",3,VK(100)),x:VX("xyz",0,VK(95.047)),y:VX("xyz",1,VK(100)),z:VX("xyz",2,VK(108.833)),l:VX("lab",0,VK(100)),a:VX("lab",1),b:VX("lab",2),keyword(H){if(H!==void 0)return new qQ(H);return t2[this.model].keyword(this.color)},hex(H){if(H!==void 0)return new qQ(H);return uJH.to.hex(this.rgb().round().color)},hexa(H){if(H!==void 0)return new qQ(H);let $=this.rgb().round().color,A=Math.round(this.valpha*255).toString(16).toUpperCase();if(A.length===1)A="0"+A;return uJH.to.hex($)+A},rgbNumber(){let H=this.rgb().color;return(H[0]&255)<<16|(H[1]&255)<<8|H[2]&255},luminosity(){let H=this.rgb().color,$=[];for(let[A,L]of H.entries()){let I=L/255;$[A]=I<=0.04045?I/12.92:((I+0.055)/1.055)**2.4}return 0.2126*$[0]+0.7152*$[1]+0.0722*$[2]},contrast(H){let $=this.luminosity(),A=H.luminosity();if($>A)return($+0.05)/(A+0.05);return(A+0.05)/($+0.05)},level(H){let $=this.contrast(H);if($>=7)return"AAA";return $>=4.5?"AA":""},isDark(){let H=this.rgb().color;return(H[0]*2126+H[1]*7152+H[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let H=this.rgb();for(let $=0;$<3;$++)H.color[$]=255-H.color[$];return H},lighten(H){let $=this.hsl();return $.color[2]+=$.color[2]*H,$},darken(H){let $=this.hsl();return $.color[2]-=$.color[2]*H,$},saturate(H){let $=this.hsl();return $.color[1]+=$.color[1]*H,$},desaturate(H){let $=this.hsl();return $.color[1]-=$.color[1]*H,$},whiten(H){let $=this.hwb();return $.color[1]+=$.color[1]*H,$},blacken(H){let $=this.hwb();return $.color[2]+=$.color[2]*H,$},grayscale(){let H=this.rgb().color,$=H[0]*0.3+H[1]*0.59+H[2]*0.11;return qQ.rgb($,$,$)},fade(H){return this.alpha(this.valpha-this.valpha*H)},opaquer(H){return this.alpha(this.valpha+this.valpha*H)},rotate(H){let $=this.hsl(),A=$.color[0];return A=(A+H)%360,A=A<0?360+A:A,$.color[0]=A,$},mix(H,$){if(!H||!H.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof H);let A=H.rgb(),L=this.rgb(),I=$===void 0?0.5:$,D=2*I-1,B=A.alpha()-L.alpha(),f=((D*B===-1?D:(D+B)/(1+D*B))+1)/2,E=1-f;return qQ.rgb(f*A.red()+E*L.red(),f*A.green()+E*L.green(),f*A.blue()+E*L.blue(),A.alpha()*I+L.alpha()*(1-I))}};for(let H of Object.keys(t2)){if(z6I.includes(H))continue;let{channels:$}=t2[H];qQ.prototype[H]=function(...A){if(this.model===H)return new qQ(this);if(A.length>0)return new qQ(A,H);return new qQ([...BD9(t2[this.model][H].raw(this.color)),this.valpha],H)},qQ[H]=function(...A){let L=A[0];if(typeof L==="number")L=x4A(A,$);return new qQ(L,H)}}function ID9(H,$){return Number(H.toFixed($))}function DD9(H){return function($){return ID9($,H)}}function VX(H,$,A){H=Array.isArray(H)?H:[H];for(let L of H)(PU$[L]||(PU$[L]=[]))[$]=A;return H=H[0],function(L){let I;if(L!==void 0){if(A)L=A(L);return I=this[H](),I.color[$]=L,I}if(I=this[H]().color[$],A)I=A(I);return I}}function VK(H){return function($){return Math.max(0,Math.min(H,$))}}function BD9(H){return Array.isArray(H)?H:[H]}function x4A(H,$){for(let A=0;A<$;A++)if(typeof H[A]!=="number")H[A]=0;return H}N6I.exports=qQ});var S6I=z((Fpf,x6I)=>{var fD9=_U$(),cA=dy(),Or=FSH(),ED9={left:"low",center:"centre",centre:"centre",right:"high"};function O6I(H){let{raw:$,density:A,limitInputPixels:L,ignoreIcc:I,unlimited:D,sequentialRead:B,failOn:f,failOnError:E,animated:M,page:G,pages:U,subifd:X}=H;return[$,A,L,I,D,B,f,E,M,G,U,X].some(cA.defined)?{raw:$,density:A,limitInputPixels:L,ignoreIcc:I,unlimited:D,sequentialRead:B,failOn:f,failOnError:E,animated:M,page:G,pages:U,subifd:X}:void 0}function MD9(H,$,A){let L={failOn:"warning",limitInputPixels:Math.pow(16383,2),ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(cA.string(H))L.file=H;else if(cA.buffer(H)){if(H.length===0)throw Error("Input Buffer is empty");L.buffer=H}else if(cA.arrayBuffer(H)){if(H.byteLength===0)throw Error("Input bit Array is empty");L.buffer=Buffer.from(H,0,H.byteLength)}else if(cA.typedArray(H)){if(H.length===0)throw Error("Input Bit Array is empty");L.buffer=Buffer.from(H.buffer,H.byteOffset,H.byteLength)}else if(cA.plainObject(H)&&!cA.defined($)){if($=H,O6I($))L.buffer=[]}else if(!cA.defined(H)&&!cA.defined($)&&cA.object(A)&&A.allowStream)L.buffer=[];else throw Error(`Unsupported input '${H}' of type ${typeof H}${cA.defined($)?` when also providing options of type ${typeof $}`:""}`);if(cA.object($)){if(cA.defined($.failOnError))if(cA.bool($.failOnError))L.failOn=$.failOnError?"warning":"none";else throw cA.invalidParameterError("failOnError","boolean",$.failOnError);if(cA.defined($.failOn))if(cA.string($.failOn)&&cA.inArray($.failOn,["none","truncated","error","warning"]))L.failOn=$.failOn;else throw cA.invalidParameterError("failOn","one of: none, truncated, error, warning",$.failOn);if(cA.defined($.density))if(cA.inRange($.density,1,1e5))L.density=$.density;else throw cA.invalidParameterError("density","number between 1 and 100000",$.density);if(cA.defined($.ignoreIcc))if(cA.bool($.ignoreIcc))L.ignoreIcc=$.ignoreIcc;else throw cA.invalidParameterError("ignoreIcc","boolean",$.ignoreIcc);if(cA.defined($.limitInputPixels))if(cA.bool($.limitInputPixels))L.limitInputPixels=$.limitInputPixels?Math.pow(16383,2):0;else if(cA.integer($.limitInputPixels)&&cA.inRange($.limitInputPixels,0,Number.MAX_SAFE_INTEGER))L.limitInputPixels=$.limitInputPixels;else throw cA.invalidParameterError("limitInputPixels","positive integer",$.limitInputPixels);if(cA.defined($.unlimited))if(cA.bool($.unlimited))L.unlimited=$.unlimited;else throw cA.invalidParameterError("unlimited","boolean",$.unlimited);if(cA.defined($.sequentialRead))if(cA.bool($.sequentialRead))L.sequentialRead=$.sequentialRead;else throw cA.invalidParameterError("sequentialRead","boolean",$.sequentialRead);if(cA.defined($.raw))if(cA.object($.raw)&&cA.integer($.raw.width)&&$.raw.width>0&&cA.integer($.raw.height)&&$.raw.height>0&&cA.integer($.raw.channels)&&cA.inRange($.raw.channels,1,4))switch(L.rawWidth=$.raw.width,L.rawHeight=$.raw.height,L.rawChannels=$.raw.channels,L.rawPremultiplied=!!$.raw.premultiplied,H.constructor){case Uint8Array:case Uint8ClampedArray:L.rawDepth="uchar";break;case Int8Array:L.rawDepth="char";break;case Uint16Array:L.rawDepth="ushort";break;case Int16Array:L.rawDepth="short";break;case Uint32Array:L.rawDepth="uint";break;case Int32Array:L.rawDepth="int";break;case Float32Array:L.rawDepth="float";break;case Float64Array:L.rawDepth="double";break;default:L.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(cA.defined($.animated))if(cA.bool($.animated))L.pages=$.animated?-1:1;else throw cA.invalidParameterError("animated","boolean",$.animated);if(cA.defined($.pages))if(cA.integer($.pages)&&cA.inRange($.pages,-1,1e5))L.pages=$.pages;else throw cA.invalidParameterError("pages","integer between -1 and 100000",$.pages);if(cA.defined($.page))if(cA.integer($.page)&&cA.inRange($.page,0,1e5))L.page=$.page;else throw cA.invalidParameterError("page","integer between 0 and 100000",$.page);if(cA.defined($.level))if(cA.integer($.level)&&cA.inRange($.level,0,256))L.level=$.level;else throw cA.invalidParameterError("level","integer between 0 and 256",$.level);if(cA.defined($.subifd))if(cA.integer($.subifd)&&cA.inRange($.subifd,-1,1e5))L.subifd=$.subifd;else throw cA.invalidParameterError("subifd","integer between -1 and 100000",$.subifd);if(cA.defined($.create))if(cA.object($.create)&&cA.integer($.create.width)&&$.create.width>0&&cA.integer($.create.height)&&$.create.height>0&&cA.integer($.create.channels)){if(L.createWidth=$.create.width,L.createHeight=$.create.height,L.createChannels=$.create.channels,cA.defined($.create.noise)){if(!cA.object($.create.noise))throw Error("Expected noise to be an object");if(!cA.inArray($.create.noise.type,["gaussian"]))throw Error("Only gaussian noise is supported at the moment");if(!cA.inRange($.create.channels,1,4))throw cA.invalidParameterError("create.channels","number between 1 and 4",$.create.channels);if(L.createNoiseType=$.create.noise.type,cA.number($.create.noise.mean)&&cA.inRange($.create.noise.mean,0,1e4))L.createNoiseMean=$.create.noise.mean;else throw cA.invalidParameterError("create.noise.mean","number between 0 and 10000",$.create.noise.mean);if(cA.number($.create.noise.sigma)&&cA.inRange($.create.noise.sigma,0,1e4))L.createNoiseSigma=$.create.noise.sigma;else throw cA.invalidParameterError("create.noise.sigma","number between 0 and 10000",$.create.noise.sigma)}else if(cA.defined($.create.background)){if(!cA.inRange($.create.channels,3,4))throw cA.invalidParameterError("create.channels","number between 3 and 4",$.create.channels);let I=fD9($.create.background);L.createBackground=[I.red(),I.green(),I.blue(),Math.round(I.alpha()*255)]}else throw Error("Expected valid noise or background to create a new input image");delete L.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(cA.defined($.text))if(cA.object($.text)&&cA.string($.text.text)){if(L.textValue=$.text.text,cA.defined($.text.height)&&cA.defined($.text.dpi))throw Error("Expected only one of dpi or height");if(cA.defined($.text.font))if(cA.string($.text.font))L.textFont=$.text.font;else throw cA.invalidParameterError("text.font","string",$.text.font);if(cA.defined($.text.fontfile))if(cA.string($.text.fontfile))L.textFontfile=$.text.fontfile;else throw cA.invalidParameterError("text.fontfile","string",$.text.fontfile);if(cA.defined($.text.width))if(cA.integer($.text.width)&&$.text.width>0)L.textWidth=$.text.width;else throw cA.invalidParameterError("text.width","positive integer",$.text.width);if(cA.defined($.text.height))if(cA.integer($.text.height)&&$.text.height>0)L.textHeight=$.text.height;else throw cA.invalidParameterError("text.height","positive integer",$.text.height);if(cA.defined($.text.align))if(cA.string($.text.align)&&cA.string(this.constructor.align[$.text.align]))L.textAlign=this.constructor.align[$.text.align];else throw cA.invalidParameterError("text.align","valid alignment",$.text.align);if(cA.defined($.text.justify))if(cA.bool($.text.justify))L.textJustify=$.text.justify;else throw cA.invalidParameterError("text.justify","boolean",$.text.justify);if(cA.defined($.text.dpi))if(cA.integer($.text.dpi)&&cA.inRange($.text.dpi,1,1e6))L.textDpi=$.text.dpi;else throw cA.invalidParameterError("text.dpi","integer between 1 and 1000000",$.text.dpi);if(cA.defined($.text.rgba))if(cA.bool($.text.rgba))L.textRgba=$.text.rgba;else throw cA.invalidParameterError("text.rgba","bool",$.text.rgba);if(cA.defined($.text.spacing))if(cA.integer($.text.spacing)&&cA.inRange($.text.spacing,-1e6,1e6))L.textSpacing=$.text.spacing;else throw cA.invalidParameterError("text.spacing","integer between -1000000 and 1000000",$.text.spacing);if(cA.defined($.text.wrap))if(cA.string($.text.wrap)&&cA.inArray($.text.wrap,["word","char","word-char","none"]))L.textWrap=$.text.wrap;else throw cA.invalidParameterError("text.wrap","one of: word, char, word-char, none",$.text.wrap);delete L.buffer}else throw Error("Expected a valid string to create an image with text.")}else if(cA.defined($))throw Error("Invalid input options "+$);return L}function GD9(H,$,A){if(Array.isArray(this.options.input.buffer))if(cA.buffer(H)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(H),A()}else A(Error("Non-Buffer data on Writable Stream"));else A(Error("Unexpected data on Writable Stream"))}function UD9(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function XD9(){return Array.isArray(this.options.input.buffer)}function JD9(H){let $=Error();if(cA.fn(H)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Or.metadata(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)})});else Or.metadata(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)});return this}else if(this._isStreamInput())return new Promise((A,L)=>{let I=()=>{this._flattenBufferIn(),Or.metadata(this.options,(D,B)=>{if(D)L(cA.nativeError(D,$));else A(B)})};if(this.writableFinished)I();else this.once("finish",I)});else return new Promise((A,L)=>{Or.metadata(this.options,(I,D)=>{if(I)L(cA.nativeError(I,$));else A(D)})})}function FD9(H){let $=Error();if(cA.fn(H)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Or.stats(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)})});else Or.stats(this.options,(A,L)=>{if(A)H(cA.nativeError(A,$));else H(null,L)});return this}else if(this._isStreamInput())return new Promise((A,L)=>{this.on("finish",function(){this._flattenBufferIn(),Or.stats(this.options,(I,D)=>{if(I)L(cA.nativeError(I,$));else A(D)})})});else return new Promise((A,L)=>{Or.stats(this.options,(I,D)=>{if(I)L(cA.nativeError(I,$));else A(D)})})}x6I.exports=function(H){Object.assign(H.prototype,{_inputOptionsFromObject:O6I,_createInputDescriptor:MD9,_write:GD9,_flattenBufferIn:UD9,_isStreamInput:XD9,metadata:JD9,stats:FD9}),H.align=ED9}});var b6I=z((Kpf,h6I)=>{var YB=dy(),R6I={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},y6I={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},j6I={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},v6I={entropy:16,attention:17},S4A={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3"},KD9={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},QD9={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function j4A(H){return H.angle%360!==0||H.useExifOrientation===!0||H.rotationAngle!==0}function YU$(H){return H.width!==-1||H.height!==-1}function WD9(H,$,A){if(YU$(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(YB.defined(H))if(YB.object(H)&&!YB.defined(A))A=H;else if(YB.integer(H)&&H>0)this.options.width=H;else throw YB.invalidParameterError("width","positive integer",H);else this.options.width=-1;if(YB.defined($))if(YB.integer($)&&$>0)this.options.height=$;else throw YB.invalidParameterError("height","positive integer",$);else this.options.height=-1;if(YB.object(A)){if(YB.defined(A.width))if(YB.integer(A.width)&&A.width>0)this.options.width=A.width;else throw YB.invalidParameterError("width","positive integer",A.width);if(YB.defined(A.height))if(YB.integer(A.height)&&A.height>0)this.options.height=A.height;else throw YB.invalidParameterError("height","positive integer",A.height);if(YB.defined(A.fit)){let L=QD9[A.fit];if(YB.string(L))this.options.canvas=L;else throw YB.invalidParameterError("fit","valid fit",A.fit)}if(YB.defined(A.position)){let L=YB.integer(A.position)?A.position:v6I[A.position]||y6I[A.position]||R6I[A.position];if(YB.integer(L)&&(YB.inRange(L,0,8)||YB.inRange(L,16,17)))this.options.position=L;else throw YB.invalidParameterError("position","valid position/gravity/strategy",A.position)}if(this._setBackgroundColourOption("resizeBackground",A.background),YB.defined(A.kernel))if(YB.string(S4A[A.kernel]))this.options.kernel=S4A[A.kernel];else throw YB.invalidParameterError("kernel","valid kernel name",A.kernel);if(YB.defined(A.withoutEnlargement))this._setBooleanOption("withoutEnlargement",A.withoutEnlargement);if(YB.defined(A.withoutReduction))this._setBooleanOption("withoutReduction",A.withoutReduction);if(YB.defined(A.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",A.fastShrinkOnLoad)}if(j4A(this.options)&&YU$(this.options))this.options.rotateBeforePreExtract=!0;return this}function VD9(H){if(YB.integer(H)&&H>0)this.options.extendTop=H,this.options.extendBottom=H,this.options.extendLeft=H,this.options.extendRight=H;else if(YB.object(H)){if(YB.defined(H.top))if(YB.integer(H.top)&&H.top>=0)this.options.extendTop=H.top;else throw YB.invalidParameterError("top","positive integer",H.top);if(YB.defined(H.bottom))if(YB.integer(H.bottom)&&H.bottom>=0)this.options.extendBottom=H.bottom;else throw YB.invalidParameterError("bottom","positive integer",H.bottom);if(YB.defined(H.left))if(YB.integer(H.left)&&H.left>=0)this.options.extendLeft=H.left;else throw YB.invalidParameterError("left","positive integer",H.left);if(YB.defined(H.right))if(YB.integer(H.right)&&H.right>=0)this.options.extendRight=H.right;else throw YB.invalidParameterError("right","positive integer",H.right);if(this._setBackgroundColourOption("extendBackground",H.background),YB.defined(H.extendWith))if(YB.string(j6I[H.extendWith]))this.options.extendWith=j6I[H.extendWith];else throw YB.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",H.extendWith)}else throw YB.invalidParameterError("extend","integer or object",H);return this}function PD9(H){let $=YU$(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${$}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(A){let L=H[A];if(YB.integer(L)&&L>=0)this.options[A+(A==="left"||A==="top"?"Offset":"")+$]=L;else throw YB.invalidParameterError(A,"integer",L)},this),j4A(this.options)&&!YU$(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBeforePreExtract=!0}return this}function _D9(H){if(this.options.trimThreshold=10,YB.defined(H))if(YB.object(H)){if(YB.defined(H.background))this._setBackgroundColourOption("trimBackground",H.background);if(YB.defined(H.threshold))if(YB.number(H.threshold)&&H.threshold>=0)this.options.trimThreshold=H.threshold;else throw YB.invalidParameterError("threshold","positive number",H.threshold);if(YB.defined(H.lineArt))this._setBooleanOption("trimLineArt",H.lineArt)}else throw YB.invalidParameterError("trim","object",H);if(j4A(this.options))this.options.rotateBeforePreExtract=!0;return this}h6I.exports=function(H){Object.assign(H.prototype,{resize:WD9,extend:VD9,extract:PD9,trim:_D9}),H.gravity=R6I,H.strategy=v6I,H.kernel=S4A,H.fit=KD9,H.position=y6I}});var u6I=z((Qpf,k6I)=>{var RM=dy(),R4A={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};function YD9(H){if(!Array.isArray(H))throw RM.invalidParameterError("images to composite","array",H);return this.options.composite=H.map(($)=>{if(!RM.object($))throw RM.invalidParameterError("image to composite","object",$);let A=this._inputOptionsFromObject($),L={input:this._createInputDescriptor($.input,A,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(RM.defined($.blend))if(RM.string(R4A[$.blend]))L.blend=R4A[$.blend];else throw RM.invalidParameterError("blend","valid blend name",$.blend);if(RM.defined($.tile))if(RM.bool($.tile))L.tile=$.tile;else throw RM.invalidParameterError("tile","boolean",$.tile);if(RM.defined($.left))if(RM.integer($.left))L.left=$.left;else throw RM.invalidParameterError("left","integer",$.left);if(RM.defined($.top))if(RM.integer($.top))L.top=$.top;else throw RM.invalidParameterError("top","integer",$.top);if(RM.defined($.top)!==RM.defined($.left))throw Error("Expected both left and top to be set");else L.hasOffset=RM.integer($.top)&&RM.integer($.left);if(RM.defined($.gravity))if(RM.integer($.gravity)&&RM.inRange($.gravity,0,8))L.gravity=$.gravity;else if(RM.string($.gravity)&&RM.integer(this.constructor.gravity[$.gravity]))L.gravity=this.constructor.gravity[$.gravity];else throw RM.invalidParameterError("gravity","valid gravity",$.gravity);if(RM.defined($.premultiplied))if(RM.bool($.premultiplied))L.premultiplied=$.premultiplied;else throw RM.invalidParameterError("premultiplied","boolean",$.premultiplied);return L}),this}k6I.exports=function(H){H.prototype.composite=YD9,H.blend=R4A}});var p6I=z((Wpf,m6I)=>{var CD9=_U$(),FA=dy(),g6I={integer:"integer",float:"float",approximate:"approximate"};function wD9(H,$){if(this.options.useExifOrientation||this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options");if(!FA.defined(H))this.options.useExifOrientation=!0;else if(FA.integer(H)&&!(H%90))this.options.angle=H;else if(FA.number(H)){if(this.options.rotationAngle=H,FA.object($)&&$.background){let A=CD9($.background);this.options.rotationBackground=[A.red(),A.green(),A.blue(),Math.round(A.alpha()*255)]}}else throw FA.invalidParameterError("angle","numeric",H);return this}function ZD9(H){return this.options.flip=FA.bool(H)?H:!0,this}function qD9(H){return this.options.flop=FA.bool(H)?H:!0,this}function TD9(H,$){let A=[].concat(...H);if(A.length===4&&A.every(FA.number))this.options.affineMatrix=A;else throw FA.invalidParameterError("matrix","1x4 or 2x2 array",H);if(FA.defined($))if(FA.object($)){if(this._setBackgroundColourOption("affineBackground",$.background),FA.defined($.idx))if(FA.number($.idx))this.options.affineIdx=$.idx;else throw FA.invalidParameterError("options.idx","number",$.idx);if(FA.defined($.idy))if(FA.number($.idy))this.options.affineIdy=$.idy;else throw FA.invalidParameterError("options.idy","number",$.idy);if(FA.defined($.odx))if(FA.number($.odx))this.options.affineOdx=$.odx;else throw FA.invalidParameterError("options.odx","number",$.odx);if(FA.defined($.ody))if(FA.number($.ody))this.options.affineOdy=$.ody;else throw FA.invalidParameterError("options.ody","number",$.ody);if(FA.defined($.interpolator))if(FA.inArray($.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=$.interpolator;else throw FA.invalidParameterError("options.interpolator","valid interpolator name",$.interpolator)}else throw FA.invalidParameterError("options","object",$);return this}function zD9(H,$,A){if(!FA.defined(H))this.options.sharpenSigma=-1;else if(FA.bool(H))this.options.sharpenSigma=H?-1:0;else if(FA.number(H)&&FA.inRange(H,0.01,1e4)){if(this.options.sharpenSigma=H,FA.defined($))if(FA.number($)&&FA.inRange($,0,1e4))this.options.sharpenM1=$;else throw FA.invalidParameterError("flat","number between 0 and 10000",$);if(FA.defined(A))if(FA.number(A)&&FA.inRange(A,0,1e4))this.options.sharpenM2=A;else throw FA.invalidParameterError("jagged","number between 0 and 10000",A)}else if(FA.plainObject(H)){if(FA.number(H.sigma)&&FA.inRange(H.sigma,0.000001,10))this.options.sharpenSigma=H.sigma;else throw FA.invalidParameterError("options.sigma","number between 0.000001 and 10",H.sigma);if(FA.defined(H.m1))if(FA.number(H.m1)&&FA.inRange(H.m1,0,1e6))this.options.sharpenM1=H.m1;else throw FA.invalidParameterError("options.m1","number between 0 and 1000000",H.m1);if(FA.defined(H.m2))if(FA.number(H.m2)&&FA.inRange(H.m2,0,1e6))this.options.sharpenM2=H.m2;else throw FA.invalidParameterError("options.m2","number between 0 and 1000000",H.m2);if(FA.defined(H.x1))if(FA.number(H.x1)&&FA.inRange(H.x1,0,1e6))this.options.sharpenX1=H.x1;else throw FA.invalidParameterError("options.x1","number between 0 and 1000000",H.x1);if(FA.defined(H.y2))if(FA.number(H.y2)&&FA.inRange(H.y2,0,1e6))this.options.sharpenY2=H.y2;else throw FA.invalidParameterError("options.y2","number between 0 and 1000000",H.y2);if(FA.defined(H.y3))if(FA.number(H.y3)&&FA.inRange(H.y3,0,1e6))this.options.sharpenY3=H.y3;else throw FA.invalidParameterError("options.y3","number between 0 and 1000000",H.y3)}else throw FA.invalidParameterError("sigma","number between 0.01 and 10000",H);return this}function ND9(H){if(!FA.defined(H))this.options.medianSize=3;else if(FA.integer(H)&&FA.inRange(H,1,1000))this.options.medianSize=H;else throw FA.invalidParameterError("size","integer between 1 and 1000",H);return this}function OD9(H){let $;if(FA.number(H))$=H;else if(FA.plainObject(H)){if(!FA.number(H.sigma))throw FA.invalidParameterError("options.sigma","number between 0.3 and 1000",$);if($=H.sigma,"precision"in H)if(FA.string(g6I[H.precision]))this.options.precision=g6I[H.precision];else throw FA.invalidParameterError("precision","one of: integer, float, approximate",H.precision);if("minAmplitude"in H)if(FA.number(H.minAmplitude)&&FA.inRange(H.minAmplitude,0.001,1))this.options.minAmpl=H.minAmplitude;else throw FA.invalidParameterError("minAmplitude","number between 0.001 and 1",H.minAmplitude)}if(!FA.defined(H))this.options.blurSigma=-1;else if(FA.bool(H))this.options.blurSigma=H?-1:0;else if(FA.number($)&&FA.inRange($,0.3,1000))this.options.blurSigma=$;else throw FA.invalidParameterError("sigma","number between 0.3 and 1000",$);return this}function xD9(H){if(this.options.flatten=FA.bool(H)?H:!0,FA.object(H))this._setBackgroundColourOption("flattenBackground",H.background);return this}function SD9(){return this.options.unflatten=!0,this}function jD9(H,$){if(!FA.defined(H))this.options.gamma=2.2;else if(FA.number(H)&&FA.inRange(H,1,3))this.options.gamma=H;else throw FA.invalidParameterError("gamma","number between 1.0 and 3.0",H);if(!FA.defined($))this.options.gammaOut=this.options.gamma;else if(FA.number($)&&FA.inRange($,1,3))this.options.gammaOut=$;else throw FA.invalidParameterError("gammaOut","number between 1.0 and 3.0",$);return this}function RD9(H){if(this.options.negate=FA.bool(H)?H:!0,FA.plainObject(H)&&"alpha"in H)if(!FA.bool(H.alpha))throw FA.invalidParameterError("alpha","should be boolean value",H.alpha);else this.options.negateAlpha=H.alpha;return this}function yD9(H){if(FA.plainObject(H)){if(FA.defined(H.lower))if(FA.number(H.lower)&&FA.inRange(H.lower,0,99))this.options.normaliseLower=H.lower;else throw FA.invalidParameterError("lower","number between 0 and 99",H.lower);if(FA.defined(H.upper))if(FA.number(H.upper)&&FA.inRange(H.upper,1,100))this.options.normaliseUpper=H.upper;else throw FA.invalidParameterError("upper","number between 1 and 100",H.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw FA.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function vD9(H){return this.normalise(H)}function hD9(H){if(FA.plainObject(H)){if(FA.integer(H.width)&&H.width>0)this.options.claheWidth=H.width;else throw FA.invalidParameterError("width","integer greater than zero",H.width);if(FA.integer(H.height)&&H.height>0)this.options.claheHeight=H.height;else throw FA.invalidParameterError("height","integer greater than zero",H.height);if(FA.defined(H.maxSlope))if(FA.integer(H.maxSlope)&&FA.inRange(H.maxSlope,0,100))this.options.claheMaxSlope=H.maxSlope;else throw FA.invalidParameterError("maxSlope","integer between 0 and 100",H.maxSlope)}else throw FA.invalidParameterError("options","plain object",H);return this}function bD9(H){if(!FA.object(H)||!Array.isArray(H.kernel)||!FA.integer(H.width)||!FA.integer(H.height)||!FA.inRange(H.width,3,1001)||!FA.inRange(H.height,3,1001)||H.height*H.width!==H.kernel.length)throw Error("Invalid convolution kernel");if(!FA.integer(H.scale))H.scale=H.kernel.reduce(function($,A){return $+A},0);if(H.scale<1)H.scale=1;if(!FA.integer(H.offset))H.offset=0;return this.options.convKernel=H,this}function kD9(H,$){if(!FA.defined(H))this.options.threshold=128;else if(FA.bool(H))this.options.threshold=H?128:0;else if(FA.integer(H)&&FA.inRange(H,0,255))this.options.threshold=H;else throw FA.invalidParameterError("threshold","integer between 0 and 255",H);if(!FA.object($)||$.greyscale===!0||$.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function uD9(H,$,A){if(this.options.boolean=this._createInputDescriptor(H,A),FA.string($)&&FA.inArray($,["and","or","eor"]))this.options.booleanOp=$;else throw FA.invalidParameterError("operator","one of: and, or, eor",$);return this}function gD9(H,$){if(!FA.defined(H)&&FA.number($))H=1;else if(FA.number(H)&&!FA.defined($))$=0;if(!FA.defined(H))this.options.linearA=[];else if(FA.number(H))this.options.linearA=[H];else if(Array.isArray(H)&&H.length&&H.every(FA.number))this.options.linearA=H;else throw FA.invalidParameterError("a","number or array of numbers",H);if(!FA.defined($))this.options.linearB=[];else if(FA.number($))this.options.linearB=[$];else if(Array.isArray($)&&$.length&&$.every(FA.number))this.options.linearB=$;else throw FA.invalidParameterError("b","number or array of numbers",$);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function mD9(H){if(!Array.isArray(H))throw FA.invalidParameterError("inputMatrix","array",H);if(H.length!==3&&H.length!==4)throw FA.invalidParameterError("inputMatrix","3x3 or 4x4 array",H.length);let $=H.flat().map(Number);if($.length!==9&&$.length!==16)throw FA.invalidParameterError("inputMatrix","cardinality of 9 or 16",$.length);return this.options.recombMatrix=$,this}function pD9(H){if(!FA.plainObject(H))throw FA.invalidParameterError("options","plain object",H);if("brightness"in H)if(FA.number(H.brightness)&&H.brightness>=0)this.options.brightness=H.brightness;else throw FA.invalidParameterError("brightness","number above zero",H.brightness);if("saturation"in H)if(FA.number(H.saturation)&&H.saturation>=0)this.options.saturation=H.saturation;else throw FA.invalidParameterError("saturation","number above zero",H.saturation);if("hue"in H)if(FA.integer(H.hue))this.options.hue=H.hue%360;else throw FA.invalidParameterError("hue","number",H.hue);if("lightness"in H)if(FA.number(H.lightness))this.options.lightness=H.lightness;else throw FA.invalidParameterError("lightness","number",H.lightness);return this}m6I.exports=function(H){Object.assign(H.prototype,{rotate:wD9,flip:ZD9,flop:qD9,affine:TD9,sharpen:zD9,median:ND9,blur:OD9,flatten:xD9,unflatten:SD9,gamma:jD9,negate:RD9,normalise:yD9,normalize:vD9,clahe:hD9,convolve:bD9,threshold:kD9,boolean:uD9,linear:gD9,recomb:mD9,modulate:pD9})}});var l6I=z((Vpf,c6I)=>{var dD9=_U$(),Og=dy(),d6I={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function cD9(H){return this._setBackgroundColourOption("tint",H),this}function lD9(H){return this.options.greyscale=Og.bool(H)?H:!0,this}function iD9(H){return this.greyscale(H)}function nD9(H){if(!Og.string(H))throw Og.invalidParameterError("colourspace","string",H);return this.options.colourspacePipeline=H,this}function rD9(H){return this.pipelineColourspace(H)}function aD9(H){if(!Og.string(H))throw Og.invalidParameterError("colourspace","string",H);return this.options.colourspace=H,this}function oD9(H){return this.toColourspace(H)}function tD9(H,$){if(Og.defined($))if(Og.object($)||Og.string($)){let A=dD9($);this.options[H]=[A.red(),A.green(),A.blue(),Math.round(A.alpha()*255)]}else throw Og.invalidParameterError("background","object or string",$)}c6I.exports=function(H){Object.assign(H.prototype,{tint:cD9,greyscale:lD9,grayscale:iD9,pipelineColourspace:nD9,pipelineColorspace:rD9,toColourspace:aD9,toColorspace:oD9,_setBackgroundColourOption:tD9}),H.colourspace=d6I,H.colorspace=d6I}});var n6I=z((Ppf,i6I)=>{var ny=dy(),sD9={and:"and",or:"or",eor:"eor"};function eD9(){return this.options.removeAlpha=!0,this}function HB9(H){if(ny.defined(H))if(ny.number(H)&&ny.inRange(H,0,1))this.options.ensureAlpha=H;else throw ny.invalidParameterError("alpha","number between 0 and 1",H);else this.options.ensureAlpha=1;return this}function $B9(H){let $={red:0,green:1,blue:2,alpha:3};if(Object.keys($).includes(H))H=$[H];if(ny.integer(H)&&ny.inRange(H,0,4))this.options.extractChannel=H;else throw ny.invalidParameterError("channel","integer or one of: red, green, blue, alpha",H);return this}function AB9(H,$){if(Array.isArray(H))H.forEach(function(A){this.options.joinChannelIn.push(this._createInputDescriptor(A,$))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(H,$));return this}function LB9(H){if(ny.string(H)&&ny.inArray(H,["and","or","eor"]))this.options.bandBoolOp=H;else throw ny.invalidParameterError("boolOp","one of: and, or, eor",H);return this}i6I.exports=function(H){Object.assign(H.prototype,{removeAlpha:eD9,ensureAlpha:HB9,extractChannel:$B9,joinChannel:AB9,bandbool:LB9}),H.bool=sD9}});var e6I=z((_pf,s6I)=>{var y4A=require("path"),sH=dy(),gJH=FSH(),r6I=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),IB9=/\.(jp[2x]|j2[kc])$/i,a6I=()=>Error("JP2 output requires libvips with support for OpenJPEG"),o6I=(H)=>1<<31-Math.clz32(Math.ceil(Math.log2(H)));function DB9(H,$){let A;if(!sH.string(H))A=Error("Missing output file path");else if(sH.string(this.options.input.file)&&y4A.resolve(this.options.input.file)===y4A.resolve(H))A=Error("Cannot use same file for input and output");else if(IB9.test(y4A.extname(H))&&!this.constructor.format.jp2k.output.file)A=a6I();if(A)if(sH.fn($))$(A);else return Promise.reject(A);else{this.options.fileOut=H;let L=Error();return this._pipeline($,L)}return this}function BB9(H,$){if(sH.object(H))this._setBooleanOption("resolveWithObject",H.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let A=Error();return this._pipeline(sH.fn(H)?H:$,A)}function fB9(){return this.options.keepMetadata|=1,this}function EB9(H){if(sH.object(H))for(let[$,A]of Object.entries(H))if(sH.object(A))for(let[L,I]of Object.entries(A))if(sH.string(I))this.options.withExif[`exif-${$.toLowerCase()}-${L}`]=I;else throw sH.invalidParameterError(`${$}.${L}`,"string",I);else throw sH.invalidParameterError($,"object",A);else throw sH.invalidParameterError("exif","object",H);return this.options.withExifMerge=!1,this.keepExif()}function MB9(H){return this.withExif(H),this.options.withExifMerge=!0,this}function GB9(){return this.options.keepMetadata|=8,this}function UB9(H,$){if(sH.string(H))this.options.withIccProfile=H;else throw sH.invalidParameterError("icc","string",H);if(this.keepIccProfile(),sH.object($)){if(sH.defined($.attach))if(sH.bool($.attach)){if(!$.attach)this.options.keepMetadata&=-9}else throw sH.invalidParameterError("attach","boolean",$.attach)}return this}function XB9(){return this.options.keepMetadata=31,this}function JB9(H){if(this.keepMetadata(),this.withIccProfile("srgb"),sH.object(H)){if(sH.defined(H.orientation))if(sH.integer(H.orientation)&&sH.inRange(H.orientation,1,8))this.options.withMetadataOrientation=H.orientation;else throw sH.invalidParameterError("orientation","integer between 1 and 8",H.orientation);if(sH.defined(H.density))if(sH.number(H.density)&&H.density>0)this.options.withMetadataDensity=H.density;else throw sH.invalidParameterError("density","positive number",H.density);if(sH.defined(H.icc))this.withIccProfile(H.icc);if(sH.defined(H.exif))this.withExifMerge(H.exif)}return this}function FB9(H,$){let A=r6I.get((sH.object(H)&&sH.string(H.id)?H.id:H).toLowerCase());if(!A)throw sH.invalidParameterError("format",`one of: ${[...r6I.keys()].join(", ")}`,H);return this[A]($)}function KB9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.jpegQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.progressive))this._setBooleanOption("jpegProgressive",H.progressive);if(sH.defined(H.chromaSubsampling))if(sH.string(H.chromaSubsampling)&&sH.inArray(H.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=H.chromaSubsampling;else throw sH.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",H.chromaSubsampling);let $=sH.bool(H.optimizeCoding)?H.optimizeCoding:H.optimiseCoding;if(sH.defined($))this._setBooleanOption("jpegOptimiseCoding",$);if(sH.defined(H.mozjpeg))if(sH.bool(H.mozjpeg)){if(H.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw sH.invalidParameterError("mozjpeg","boolean",H.mozjpeg);let A=sH.bool(H.trellisQuantization)?H.trellisQuantization:H.trellisQuantisation;if(sH.defined(A))this._setBooleanOption("jpegTrellisQuantisation",A);if(sH.defined(H.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",H.overshootDeringing);let L=sH.bool(H.optimizeScans)?H.optimizeScans:H.optimiseScans;if(sH.defined(L)){if(this._setBooleanOption("jpegOptimiseScans",L),L)this.options.jpegProgressive=!0}let I=sH.number(H.quantizationTable)?H.quantizationTable:H.quantisationTable;if(sH.defined(I))if(sH.integer(I)&&sH.inRange(I,0,8))this.options.jpegQuantisationTable=I;else throw sH.invalidParameterError("quantisationTable","integer between 0 and 8",I)}return this._updateFormatOut("jpeg",H)}function QB9(H){if(sH.object(H)){if(sH.defined(H.progressive))this._setBooleanOption("pngProgressive",H.progressive);if(sH.defined(H.compressionLevel))if(sH.integer(H.compressionLevel)&&sH.inRange(H.compressionLevel,0,9))this.options.pngCompressionLevel=H.compressionLevel;else throw sH.invalidParameterError("compressionLevel","integer between 0 and 9",H.compressionLevel);if(sH.defined(H.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",H.adaptiveFiltering);let $=H.colours||H.colors;if(sH.defined($))if(sH.integer($)&&sH.inRange($,2,256))this.options.pngBitdepth=o6I($);else throw sH.invalidParameterError("colours","integer between 2 and 256",$);if(sH.defined(H.palette))this._setBooleanOption("pngPalette",H.palette);else if([H.quality,H.effort,H.colours,H.colors,H.dither].some(sH.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,0,100))this.options.pngQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 0 and 100",H.quality);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,1,10))this.options.pngEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 1 and 10",H.effort);if(sH.defined(H.dither))if(sH.number(H.dither)&&sH.inRange(H.dither,0,1))this.options.pngDither=H.dither;else throw sH.invalidParameterError("dither","number between 0.0 and 1.0",H.dither)}}return this._updateFormatOut("png",H)}function WB9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.webpQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.alphaQuality))if(sH.integer(H.alphaQuality)&&sH.inRange(H.alphaQuality,0,100))this.options.webpAlphaQuality=H.alphaQuality;else throw sH.invalidParameterError("alphaQuality","integer between 0 and 100",H.alphaQuality);if(sH.defined(H.lossless))this._setBooleanOption("webpLossless",H.lossless);if(sH.defined(H.nearLossless))this._setBooleanOption("webpNearLossless",H.nearLossless);if(sH.defined(H.smartSubsample))this._setBooleanOption("webpSmartSubsample",H.smartSubsample);if(sH.defined(H.preset))if(sH.string(H.preset)&&sH.inArray(H.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=H.preset;else throw sH.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",H.preset);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,0,6))this.options.webpEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 0 and 6",H.effort);if(sH.defined(H.minSize))this._setBooleanOption("webpMinSize",H.minSize);if(sH.defined(H.mixed))this._setBooleanOption("webpMixed",H.mixed)}return t6I(H,this.options),this._updateFormatOut("webp",H)}function VB9(H){if(sH.object(H)){if(sH.defined(H.reuse))this._setBooleanOption("gifReuse",H.reuse);if(sH.defined(H.progressive))this._setBooleanOption("gifProgressive",H.progressive);let $=H.colours||H.colors;if(sH.defined($))if(sH.integer($)&&sH.inRange($,2,256))this.options.gifBitdepth=o6I($);else throw sH.invalidParameterError("colours","integer between 2 and 256",$);if(sH.defined(H.effort))if(sH.number(H.effort)&&sH.inRange(H.effort,1,10))this.options.gifEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 1 and 10",H.effort);if(sH.defined(H.dither))if(sH.number(H.dither)&&sH.inRange(H.dither,0,1))this.options.gifDither=H.dither;else throw sH.invalidParameterError("dither","number between 0.0 and 1.0",H.dither);if(sH.defined(H.interFrameMaxError))if(sH.number(H.interFrameMaxError)&&sH.inRange(H.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=H.interFrameMaxError;else throw sH.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",H.interFrameMaxError);if(sH.defined(H.interPaletteMaxError))if(sH.number(H.interPaletteMaxError)&&sH.inRange(H.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=H.interPaletteMaxError;else throw sH.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",H.interPaletteMaxError)}return t6I(H,this.options),this._updateFormatOut("gif",H)}function PB9(H){if(!this.constructor.format.jp2k.output.buffer)throw a6I();if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.jp2Quality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.lossless))if(sH.bool(H.lossless))this.options.jp2Lossless=H.lossless;else throw sH.invalidParameterError("lossless","boolean",H.lossless);if(sH.defined(H.tileWidth))if(sH.integer(H.tileWidth)&&sH.inRange(H.tileWidth,1,32768))this.options.jp2TileWidth=H.tileWidth;else throw sH.invalidParameterError("tileWidth","integer between 1 and 32768",H.tileWidth);if(sH.defined(H.tileHeight))if(sH.integer(H.tileHeight)&&sH.inRange(H.tileHeight,1,32768))this.options.jp2TileHeight=H.tileHeight;else throw sH.invalidParameterError("tileHeight","integer between 1 and 32768",H.tileHeight);if(sH.defined(H.chromaSubsampling))if(sH.string(H.chromaSubsampling)&&sH.inArray(H.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=H.chromaSubsampling;else throw sH.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",H.chromaSubsampling)}return this._updateFormatOut("jp2",H)}function t6I(H,$){if(sH.object(H)&&sH.defined(H.loop))if(sH.integer(H.loop)&&sH.inRange(H.loop,0,65535))$.loop=H.loop;else throw sH.invalidParameterError("loop","integer between 0 and 65535",H.loop);if(sH.object(H)&&sH.defined(H.delay))if(sH.integer(H.delay)&&sH.inRange(H.delay,0,65535))$.delay=[H.delay];else if(Array.isArray(H.delay)&&H.delay.every(sH.integer)&&H.delay.every((A)=>sH.inRange(A,0,65535)))$.delay=H.delay;else throw sH.invalidParameterError("delay","integer or an array of integers between 0 and 65535",H.delay)}function _B9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.tiffQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.bitdepth))if(sH.integer(H.bitdepth)&&sH.inArray(H.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=H.bitdepth;else throw sH.invalidParameterError("bitdepth","1, 2, 4 or 8",H.bitdepth);if(sH.defined(H.tile))this._setBooleanOption("tiffTile",H.tile);if(sH.defined(H.tileWidth))if(sH.integer(H.tileWidth)&&H.tileWidth>0)this.options.tiffTileWidth=H.tileWidth;else throw sH.invalidParameterError("tileWidth","integer greater than zero",H.tileWidth);if(sH.defined(H.tileHeight))if(sH.integer(H.tileHeight)&&H.tileHeight>0)this.options.tiffTileHeight=H.tileHeight;else throw sH.invalidParameterError("tileHeight","integer greater than zero",H.tileHeight);if(sH.defined(H.miniswhite))this._setBooleanOption("tiffMiniswhite",H.miniswhite);if(sH.defined(H.pyramid))this._setBooleanOption("tiffPyramid",H.pyramid);if(sH.defined(H.xres))if(sH.number(H.xres)&&H.xres>0)this.options.tiffXres=H.xres;else throw sH.invalidParameterError("xres","number greater than zero",H.xres);if(sH.defined(H.yres))if(sH.number(H.yres)&&H.yres>0)this.options.tiffYres=H.yres;else throw sH.invalidParameterError("yres","number greater than zero",H.yres);if(sH.defined(H.compression))if(sH.string(H.compression)&&sH.inArray(H.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=H.compression;else throw sH.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",H.compression);if(sH.defined(H.predictor))if(sH.string(H.predictor)&&sH.inArray(H.predictor,["none","horizontal","float"]))this.options.tiffPredictor=H.predictor;else throw sH.invalidParameterError("predictor","one of: none, horizontal, float",H.predictor);if(sH.defined(H.resolutionUnit))if(sH.string(H.resolutionUnit)&&sH.inArray(H.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=H.resolutionUnit;else throw sH.invalidParameterError("resolutionUnit","one of: inch, cm",H.resolutionUnit)}return this._updateFormatOut("tiff",H)}function YB9(H){return this.heif({...H,compression:"av1"})}function CB9(H){if(sH.object(H)){if(sH.string(H.compression)&&sH.inArray(H.compression,["av1","hevc"]))this.options.heifCompression=H.compression;else throw sH.invalidParameterError("compression","one of: av1, hevc",H.compression);if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.heifQuality=H.quality;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);if(sH.defined(H.lossless))if(sH.bool(H.lossless))this.options.heifLossless=H.lossless;else throw sH.invalidParameterError("lossless","boolean",H.lossless);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,0,9))this.options.heifEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 0 and 9",H.effort);if(sH.defined(H.chromaSubsampling))if(sH.string(H.chromaSubsampling)&&sH.inArray(H.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=H.chromaSubsampling;else throw sH.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",H.chromaSubsampling);if(sH.defined(H.bitdepth))if(sH.integer(H.bitdepth)&&sH.inArray(H.bitdepth,[8,10,12])){if(H.bitdepth!==8&&this.constructor.versions.heif)throw sH.invalidParameterError("bitdepth when using prebuilt binaries",8,H.bitdepth);this.options.heifBitdepth=H.bitdepth}else throw sH.invalidParameterError("bitdepth","8, 10 or 12",H.bitdepth)}else throw sH.invalidParameterError("options","Object",H);return this._updateFormatOut("heif",H)}function wB9(H){if(sH.object(H)){if(sH.defined(H.quality))if(sH.integer(H.quality)&&sH.inRange(H.quality,1,100))this.options.jxlDistance=H.quality>=30?0.1+(100-H.quality)*0.09:0.017666666666666667*H.quality*H.quality-1.15*H.quality+25;else throw sH.invalidParameterError("quality","integer between 1 and 100",H.quality);else if(sH.defined(H.distance))if(sH.number(H.distance)&&sH.inRange(H.distance,0,15))this.options.jxlDistance=H.distance;else throw sH.invalidParameterError("distance","number between 0.0 and 15.0",H.distance);if(sH.defined(H.decodingTier))if(sH.integer(H.decodingTier)&&sH.inRange(H.decodingTier,0,4))this.options.jxlDecodingTier=H.decodingTier;else throw sH.invalidParameterError("decodingTier","integer between 0 and 4",H.decodingTier);if(sH.defined(H.lossless))if(sH.bool(H.lossless))this.options.jxlLossless=H.lossless;else throw sH.invalidParameterError("lossless","boolean",H.lossless);if(sH.defined(H.effort))if(sH.integer(H.effort)&&sH.inRange(H.effort,3,9))this.options.jxlEffort=H.effort;else throw sH.invalidParameterError("effort","integer between 3 and 9",H.effort)}return this._updateFormatOut("jxl",H)}function ZB9(H){if(sH.object(H)){if(sH.defined(H.depth))if(sH.string(H.depth)&&sH.inArray(H.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=H.depth;else throw sH.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",H.depth)}return this._updateFormatOut("raw")}function qB9(H){if(sH.object(H)){if(sH.defined(H.size))if(sH.integer(H.size)&&sH.inRange(H.size,1,8192))this.options.tileSize=H.size;else throw sH.invalidParameterError("size","integer between 1 and 8192",H.size);if(sH.defined(H.overlap))if(sH.integer(H.overlap)&&sH.inRange(H.overlap,0,8192)){if(H.overlap>this.options.tileSize)throw sH.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,H.overlap);this.options.tileOverlap=H.overlap}else throw sH.invalidParameterError("overlap","integer between 0 and 8192",H.overlap);if(sH.defined(H.container))if(sH.string(H.container)&&sH.inArray(H.container,["fs","zip"]))this.options.tileContainer=H.container;else throw sH.invalidParameterError("container","one of: fs, zip",H.container);if(sH.defined(H.layout))if(sH.string(H.layout)&&sH.inArray(H.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=H.layout;else throw sH.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",H.layout);if(sH.defined(H.angle))if(sH.integer(H.angle)&&!(H.angle%90))this.options.tileAngle=H.angle;else throw sH.invalidParameterError("angle","positive/negative multiple of 90",H.angle);if(this._setBackgroundColourOption("tileBackground",H.background),sH.defined(H.depth))if(sH.string(H.depth)&&sH.inArray(H.depth,["onepixel","onetile","one"]))this.options.tileDepth=H.depth;else throw sH.invalidParameterError("depth","one of: onepixel, onetile, one",H.depth);if(sH.defined(H.skipBlanks))if(sH.integer(H.skipBlanks)&&sH.inRange(H.skipBlanks,-1,65535))this.options.tileSkipBlanks=H.skipBlanks;else throw sH.invalidParameterError("skipBlanks","integer between -1 and 255/65535",H.skipBlanks);else if(sH.defined(H.layout)&&H.layout==="google")this.options.tileSkipBlanks=5;let $=sH.bool(H.center)?H.center:H.centre;if(sH.defined($))this._setBooleanOption("tileCentre",$);if(sH.defined(H.id))if(sH.string(H.id))this.options.tileId=H.id;else throw sH.invalidParameterError("id","string",H.id);if(sH.defined(H.basename))if(sH.string(H.basename))this.options.tileBasename=H.basename;else throw sH.invalidParameterError("basename","string",H.basename)}if(sH.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw sH.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function TB9(H){if(!sH.plainObject(H))throw sH.invalidParameterError("options","object",H);if(sH.integer(H.seconds)&&sH.inRange(H.seconds,0,3600))this.options.timeoutSeconds=H.seconds;else throw sH.invalidParameterError("seconds","integer between 0 and 3600",H.seconds);return this}function zB9(H,$){if(!(sH.object($)&&$.force===!1))this.options.formatOut=H;return this}function NB9(H,$){if(sH.bool($))this.options[H]=$;else throw sH.invalidParameterError(H,"boolean",$)}function OB9(){if(!this.options.streamOut){this.options.streamOut=!0;let H=Error();this._pipeline(void 0,H)}}function xB9(H,$){if(typeof H==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),gJH.pipeline(this.options,(A,L,I)=>{if(A)H(sH.nativeError(A,$));else H(null,L,I)})});else gJH.pipeline(this.options,(A,L,I)=>{if(A)H(sH.nativeError(A,$));else H(null,L,I)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),gJH.pipeline(this.options,(A,L,I)=>{if(A)this.emit("error",sH.nativeError(A,$));else this.emit("info",I),this.push(L);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else gJH.pipeline(this.options,(A,L,I)=>{if(A)this.emit("error",sH.nativeError(A,$));else this.emit("info",I),this.push(L);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((A,L)=>{this.once("finish",()=>{this._flattenBufferIn(),gJH.pipeline(this.options,(I,D,B)=>{if(I)L(sH.nativeError(I,$));else if(this.options.resolveWithObject)A({data:D,info:B});else A(D)})})});else return new Promise((A,L)=>{gJH.pipeline(this.options,(I,D,B)=>{if(I)L(sH.nativeError(I,$));else if(this.options.resolveWithObject)A({data:D,info:B});else A(D)})})}s6I.exports=function(H){Object.assign(H.prototype,{toFile:DB9,toBuffer:BB9,keepExif:fB9,withExif:EB9,withExifMerge:MB9,keepIccProfile:GB9,withIccProfile:UB9,keepMetadata:XB9,withMetadata:JB9,toFormat:FB9,jpeg:KB9,jp2:PB9,png:QB9,webp:WB9,tiff:_B9,avif:YB9,heif:CB9,jxl:wB9,gif:VB9,raw:ZB9,tile:qB9,timeout:TB9,_updateFormatOut:zB9,_setBooleanOption:NB9,_read:OB9,_pipeline:xB9})}});var L3I=z((Ypf,A3I)=>{var SB9=require("events"),CU$=fU$(),AT=dy(),{runtimePlatformArch:jB9}=C4A(),$P=FSH(),H3I=jB9(),v4A=$P.libvipsVersion(),xr=$P.format();xr.heif.output.alias=["avif","heic"];xr.jpeg.output.alias=["jpe","jpg"];xr.tiff.output.alias=["tif"];xr.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var RB9={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},mJH={vips:v4A.semver};if(!v4A.isGlobal)if(!v4A.isWasm)try{mJH=require(`@img/sharp-${H3I}/versions`)}catch(H){try{mJH=require(`@img/sharp-libvips-${H3I}/versions`)}catch($){}}else try{mJH=(()=>{throw new Error("Cannot require module "+"@img/sharp-wasm32/versions");})()}catch(H){}mJH.sharp=V4A().version;if(mJH.heif&&xr.heif)xr.heif.input.fileSuffix=[".avif"],xr.heif.output.alias=["avif"];function $3I(H){if(AT.bool(H))if(H)return $P.cache(50,20,100);else return $P.cache(0,0,0);else if(AT.object(H))return $P.cache(H.memory,H.files,H.items);else return $P.cache()}$3I(!0);function yB9(H){return $P.concurrency(AT.integer(H)?H:null)}if(CU$.familySync()===CU$.GLIBC&&!$P._isUsingJemalloc())$P.concurrency(1);else if(CU$.familySync()===CU$.MUSL&&$P.concurrency()===1024)$P.concurrency(require("os").availableParallelism());var vB9=new SB9.EventEmitter;function hB9(){return $P.counters()}function bB9(H){return $P.simd(AT.bool(H)?H:null)}function kB9(H){if(AT.object(H))if(Array.isArray(H.operation)&&H.operation.every(AT.string))$P.block(H.operation,!0);else throw AT.invalidParameterError("operation","Array",H.operation);else throw AT.invalidParameterError("options","object",H)}function uB9(H){if(AT.object(H))if(Array.isArray(H.operation)&&H.operation.every(AT.string))$P.block(H.operation,!1);else throw AT.invalidParameterError("operation","Array",H.operation);else throw AT.invalidParameterError("options","object",H)}A3I.exports=function(H){H.cache=$3I,H.concurrency=yB9,H.counters=hB9,H.simd=bB9,H.format=xr,H.interpolators=RB9,H.versions=mJH,H.queue=vB9,H.block=kB9,H.unblock=uB9}});var h4A=z((Cpf,I3I)=>{var xg=U6I();S6I()(xg);b6I()(xg);u6I()(xg);p6I()(xg);l6I()(xg);n6I()(xg);e6I()(xg);L3I()(xg);I3I.exports=xg});async function b4A(){if(wU$)return wU$.default;if(U8())try{let A=await Promise.resolve().then(() => (RWI(),jWI)),L=A.sharp||A.default;return wU$={default:L},L}catch{console.warn("Native image processor not available, falling back to sharp")}let H=await Promise.resolve().then(() => b(h4A(),1)),$=H?.default||H;return wU$={default:$},$}var wU$=null;var D3I=()=>{};function pB9(H){if(H instanceof Error){let A=H;if(A.code==="MODULE_NOT_FOUND"||A.code==="ERR_MODULE_NOT_FOUND"||A.code==="ERR_DLOPEN_FAILED")return B3I}let $=H instanceof Error?H.message:String(H);if($.includes("Native image processor module not available"))return B3I;if($.includes("unsupported image format")||$.includes("Input buffer")||$.includes("Input file is missing")||$.includes("Input file has corrupt header"))return gB9;return mB9}function Sg(H){if(H<1024)return`${H} B`;if(H<1048576)return`${(H/1024).toFixed(1)} KB`;return`${(H/1048576).toFixed(1)} MB`}async function pJH(H,$,A){try{let L=await b4A(),D=await L(H).metadata(),B=D.format??A,f=B==="jpg"?"jpeg":B;if(!D.width||!D.height){if($>Hx)return{buffer:await L(H).jpeg({quality:80}).toBuffer(),mediaType:"jpeg"};return{buffer:H,mediaType:f}}let{width:E,height:M}=D,G=E,U=M;if($<=Hx&&G<=OJH&&U<=xJH)return{buffer:H,mediaType:f,dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}};let X=G>OJH||U>xJH,J=f==="png";if(!X&&$>Hx){if(J){let Q=await L(H).png({compressionLevel:9,palette:!0}).toBuffer();if(Q.length<=Hx)return{buffer:Q,mediaType:"png",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}for(let Q of[80,60,40,20]){let W=await L(H).jpeg({quality:Q}).toBuffer();if(W.length<=Hx)return{buffer:W,mediaType:"jpeg",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}}if(G>OJH)U=Math.round(U*OJH/G),G=OJH;if(U>xJH)G=Math.round(G*xJH/U),U=xJH;N(`Resizing to ${G}x${U}`);let F=await L(H).resize(G,U,{fit:"inside",withoutEnlargement:!0}).toBuffer();if(F.length>Hx){if(J){let C=await L(H).resize(G,U,{fit:"inside",withoutEnlargement:!0}).png({compressionLevel:9,palette:!0}).toBuffer();if(C.length<=Hx)return{buffer:C,mediaType:"png",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}for(let C of[80,60,40,20]){let Y=await L(H).resize(G,U,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:C}).toBuffer();if(Y.length<=Hx)return{buffer:Y,mediaType:"jpeg",dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}let Q=Math.min(G,1000),W=Math.round(U*Q/Math.max(G,1));N("Still too large, compressing with JPEG");let P=await L(H).resize(Q,W,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:20}).toBuffer();return N(`JPEG compressed buffer size: ${P.length}`),{buffer:P,mediaType:"jpeg",dimensions:{originalWidth:E,originalHeight:M,displayWidth:Q,displayHeight:W}}}return{buffer:F,mediaType:f,dimensions:{originalWidth:E,originalHeight:M,displayWidth:G,displayHeight:U}}}catch(L){r(L);let I=pB9(L);c("tengu_image_resize_failed",{original_size_bytes:$,error_type:I});let B=dJH(H).slice(6),f=Math.ceil($*4/3);if(f<=NJH)return c("tengu_image_resize_fallback",{original_size_bytes:$,base64_size_bytes:f,error_type:I}),{buffer:H,mediaType:B};throw new eIH(`Unable to resize image (${Sg($)} raw, ${Sg(f)} base64). The image exceeds the 5MB API limit and compression failed. Please resize the image manually or use a smaller image.`)}}async function HDH(H){if(H.source.type!=="base64")return{block:H};let $=Buffer.from(H.source.data,"base64"),A=$.length,I=H.source.media_type?.split("/")[1]||"png",D=await pJH($,A,I);return{block:{type:"image",source:{type:"base64",media_type:`image/${D.mediaType}`,data:D.buffer.toString("base64")}},dimensions:D.dimensions}}async function $DH(H,$=Hx,A){let L=A?.split("/")[1]||"jpeg",I=L==="jpg"?"jpeg":L;try{let D=await b4A(),B=await D(H).metadata(),f=B.format||I,E=H.length,M={imageBuffer:H,metadata:B,format:f,maxBytes:$,originalSize:E};if(E<=$)return PSH(H,f,E);let G=await dB9(M,D);if(G)return G;if(f==="png"){let X=await lB9(M,D);if(X)return X}let U=await iB9(M,50,D);if(U)return U;return await nB9(M,D)}catch(D){if(r(D),c("tengu_image_compress_failed",{original_size_bytes:H.length,max_bytes:$}),H.length<=$){let B=dJH(H);return{base64:H.toString("base64"),mediaType:B,originalSize:H.length}}throw new eIH(`Unable to compress image (${Sg(H.length)}) to fit within ${Sg($)}. Please use a smaller image.`)}}async function f3I(H,$,A){let L=Math.floor($/0.125),I=Math.floor(L*0.75);return $DH(H,I,A)}async function E3I(H,$=Hx){if(H.source.type!=="base64")return H;let A=Buffer.from(H.source.data,"base64");if(A.length<=$)return H;let L=await $DH(A,$);return{type:"image",source:{type:"base64",media_type:L.mediaType,data:L.base64}}}function PSH(H,$,A){let L=$==="jpg"?"jpeg":$;return{base64:H.toString("base64"),mediaType:`image/${L}`,originalSize:A}}async function dB9(H,$){let A=[1,0.75,0.5,0.25];for(let L of A){let I=Math.round((H.metadata.width||2000)*L),D=Math.round((H.metadata.height||2000)*L),B=$(H.imageBuffer).resize(I,D,{fit:"inside",withoutEnlargement:!0});B=cB9(B,H.format);let f=await B.toBuffer();if(f.length<=H.maxBytes)return PSH(f,H.format,H.originalSize)}return null}function cB9(H,$){switch($){case"png":return H.png({compressionLevel:9,palette:!0});case"jpeg":case"jpg":return H.jpeg({quality:80});case"webp":return H.webp({quality:80});default:return H}}async function lB9(H,$){let A=await $(H.imageBuffer).resize(800,800,{fit:"inside",withoutEnlargement:!0}).png({compressionLevel:9,palette:!0,colors:64}).toBuffer();if(A.length<=H.maxBytes)return PSH(A,"png",H.originalSize);return null}async function iB9(H,$,A){let L=await A(H.imageBuffer).resize(600,600,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:$}).toBuffer();if(L.length<=H.maxBytes)return PSH(L,"jpeg",H.originalSize);return null}async function nB9(H,$){let A=await $(H.imageBuffer).resize(400,400,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:20}).toBuffer();return PSH(A,"jpeg",H.originalSize)}function dJH(H){if(H.length<4)return"image/png";if(H[0]===137&&H[1]===80&&H[2]===78&&H[3]===71)return"image/png";if(H[0]===255&&H[1]===216&&H[2]===255)return"image/jpeg";if(H[0]===71&&H[1]===73&&H[2]===70)return"image/gif";if(H[0]===82&&H[1]===73&&H[2]===70&&H[3]===70){if(H.length>=12&&H[8]===87&&H[9]===69&&H[10]===66&&H[11]===80)return"image/webp"}return"image/png"}function k4A(H){try{let $=Buffer.from(H,"base64");return dJH($)}catch{return"image/png"}}function cJH(H,$){let{originalWidth:A,originalHeight:L,displayWidth:I,displayHeight:D}=H;if(!A||!L||!I||!D||I<=0||D<=0){if($)return`[Image source: ${$}]`;return null}let B=A!==I||L!==D;if(!B&&!$)return null;let f=[];if($)f.push(`source: ${$}`);if(B){let E=A/I;f.push(`original ${A}x${L}, displayed at ${I}x${D}. Multiply coordinates by ${E.toFixed(2)} to map to original image.`)}return`[Image: ${f.join(", ")}]`}var B3I=1,gB9=2,mB9=3,eIH;var LT=K(()=>{_$();E$();z$();D3I();aIH();eIH=class eIH extends Error{constructor(H){super(H);this.name="ImageResizeError"}}});function rB9(H){if(typeof H!=="object"||H===null)return!1;let $=H;if($.type!=="image")return!1;if(typeof $.source!=="object"||$.source===null)return!1;let A=$.source;return A.type==="base64"&&typeof A.data==="string"}function M3I(H){let $=[],A=0;for(let L of H){if(typeof L!=="object"||L===null)continue;let I=L;if(I.type!=="user")continue;let D=I.message;if(!D)continue;let B=D.content;if(typeof B==="string"||!Array.isArray(B))continue;for(let f of B)if(rB9(f)){A++;let E=f.source.data.length;if(E>NJH)c("tengu_image_api_validation_failed",{base64_size_bytes:E,max_bytes:NJH}),$.push({index:A,size:E})}}if($.length>0)throw new lJH($,NJH)}var lJH;var ZU$=K(()=>{z$();aIH();LT();lJH=class lJH extends Error{constructor(H,$){let A,L=H[0];if(H.length===1&&L)A=`Image base64 size (${Sg(L.size)}) exceeds API limit (${Sg($)}). Please resize the image before sending.`;else A=`${H.length} images exceed the API limit (${Sg($)}): `+H.map((I)=>`Image ${I.index}: ${Sg(I.size)}`).join(", ")+". Please resize these images before sending.";super(A);this.name="ImageSizeError"}}});function g4A(){let H=`max ${OWI} pages, ${GM(SJH)}`;return tI()?`PDF too large (${H}). Try reading the file a different way (e.g., extract text with pdftotext).`:`PDF too large (${H}). Double press esc to go back and try again, or use pdftotext to convert to text first.`}function m4A(){return tI()?"PDF is password protected. Try using a CLI tool to extract or convert the PDF.":"PDF is password protected. Please double press esc to edit your message and try again."}function qU$(){return tI()?"Image was too large. Try resizing the image or using a different approach.":"Image was too large. Double press esc to go back and try again with a smaller image."}function p4A(){let H=`max ${GM(SJH)}`;return tI()?`Request too large (${H}). Try with a smaller file.`:`Request too large (${H}). Double press esc to go back and try with a smaller file.`}function oB9(){return tI()?"Your account does not have access to Claude. Please login again or contact your administrator.":OU$}function tB9(){return tI()?"Your organization does not have access to Claude. Please login again or contact your administrator.":aB9}function sB9(H,$,A){try{let L=-1;for(let f=0;f=500)return"server_error";if($>=400)return"client_error"}if(H instanceof k6){if(MSH(H)?.isSSLError)return"ssl_cert_error";return"connection_error"}return"unknown"}function U3I(H,$){if(H!=="refusal")return;c("tengu_refusal_api_response",{});let A=tI()?`${x5}: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Try rephrasing the request or attempting a different approach.`:`${x5}: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.`;return qf({content:A+($!=="claude-sonnet-4-20250514"?" If you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models.":""),error:"invalid_request"})}var x5="API Error",jg="Prompt is too long",TU$="Credit balance is too low",zU$="Not logged in \xB7 Please run /login",NU$="Invalid API key \xB7 Fix external API key",OU$="OAuth token revoked \xB7 Please run /login",u4A="Repeated 529 Overloaded errors",ADH="Opus is experiencing high load, please use /model to switch to Sonnet",xU$="Request timed out",aB9="Your account does not have access to Claude Code. Please run /login.";var ry=K(()=>{n_();EI();_L();aI();z$();py();ESH();NA();g$();aIH();rD();Ng();ZU$();LT()});async function*RU$(H,$,A){let L=D09(A),I={model:A.model,maxThinkingTokens:A.maxThinkingTokens,...cD()?{fastMode:A.fastMode}:{}},D=null,B=0,f;for(let E=1;E<=L+1;E++){if(A.signal?.aborted)throw new rf;let M=cD()?I.fastMode&&!zq():!1;try{if(D===null||f instanceof JD&&f.status===401||K3I(f)){if(f instanceof JD&&f.status===401){let G=dD()?.accessToken;if(G)await A4H(G)}D=await H()}return await $(D,E,I)}catch(G){if(f=G,N(`API error (attempt ${E}/${L+1}): ${G instanceof JD?`${G.status} ${G.message}`:G instanceof Error?G.message:String(G)}`,{level:"error"}),M&&G instanceof JD&&(G.status===429||X3I(G))){let F=G.headers?.get("anthropic-ratelimit-unified-overage-disabled-reason");if(F!==null&&F!==void 0){XoL(F),I.fastMode=!1;continue}let Q=M09(G);if(Q!==null&&Q=H09){if(A.fallbackModel)throw c("tengu_api_opus_fallback_triggered",{original_model:A.model,fallback_model:A.fallbackModel,provider:SR()}),new jU$(A.model,A.fallbackModel);if(!process.env.IS_SANDBOX)throw c("tengu_api_custom_529_overloaded_error",{}),new ay(Error(u4A),I)}}if(E>L)throw new ay(G,I);if(!L09(G)&&(!(G instanceof JD)||!I09(G)))throw new ay(G,I);if(G instanceof JD){let F=F3I(G);if(F){let{inputTokens:Q,contextLimit:W}=F,P=1000,C=Math.max(0,W-Q-1000);if(C (\d+)/,A=H.message.match($);if(!A||A.length!==4)return;if(!A[1]||!A[2]||!A[3]){r(Error("Unable to parse max_tokens from max_tokens exceed context limit error message"));return}let L=parseInt(A[1],10),I=parseInt(A[2],10),D=parseInt(A[3],10);if(isNaN(L)||isNaN(I)||isNaN(D))return;return{inputTokens:L,maxTokens:I,contextLimit:D}}function A09(H){if(!(H instanceof JD))return!1;return H.status===400&&(H.message?.includes("Fast mode is not enabled")??!1)}function X3I(H){if(!(H instanceof JD))return!1;return H.status===529||(H.message?.includes('"type":"overloaded_error"')??!1)}function K3I(H){if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)){if(FzL(H)||H instanceof JD&&H.status===403)return!0}return!1}function L09(H){if(K3I(H))return SD$(),!0;return!1}function I09(H){if(ZWI(H))return!1;if(H.message?.includes('"type":"overloaded_error"'))return!0;if(F3I(H))return!0;let $=H.headers?.get("x-should-retry");if($==="true"&&!nL())return!0;if($==="false"){let A=H.status!==void 0&&H.status>=500;return!1}if(H instanceof k6)return!0;if(!H.status)return!1;if(H.status===408)return!0;if(H.status===409)return!0;if(H.status===429)return!nL();if(H.status===401)return xD$(),!0;if(H.status&&H.status>=500)return!0;return!1}function D09(H){if(H.maxRetries)return H.maxRetries;if(process.env.CLAUDE_CODE_MAX_RETRIES)return parseInt(process.env.CLAUDE_CODE_MAX_RETRIES,10);return eB9}function M09(H){let $=J3I(H);if($){let A=parseInt($,10);if(!isNaN(A))return A*1000}return null}var eB9=10,d4A=3000,H09=3,$09=500,ay,jU$,B09=1800000,f09=20000,E09=600000;var IDH=K(()=>{n_();_$();E$();aI();oM();EI();z$();ry();oo$();ESH();_L();Ng();NA();AJ();ay=class ay extends Error{originalError;retryContext;constructor(H,$){let A=H instanceof Error?H.message:String(H);super(A);this.originalError=H;this.retryContext=$;if(this.name="RetryError",H instanceof Error&&H.stack)this.stack=H.stack}};jU$=class jU$ extends Error{originalModel;fallbackModel;constructor(H,$){super(`Model fallback triggered: ${H} -> ${$}`);this.originalModel=H;this.fallbackModel=$;this.name="FallbackTriggeredError"}}});function G09(H){return H instanceof Error}function _3I(){if(DDH)return;if(oy())DDH=new Promise((H)=>{yg=H,setTimeout(()=>{if(yg)N("Policy limits: Loading promise timed out, resolving anyway"),yg(),yg=null},F09)})}function yU$(){return V3I.join(UL(),U09)}function K09(){return`${XD().BASE_API_URL}/api/claude_code/policy_limits`}function l4A(H){if(Array.isArray(H))return H.map(l4A);if(H!==null&&typeof H==="object"){let $={};for(let[A,L]of Object.entries(H).sort(([I],[D])=>I.localeCompare(D)))$[A]=l4A(L);return $}return H}function Q09(H){let $=l4A(H),A=yH($);return`sha256:${P3I.createHash("sha256").update(A).digest("hex")}`}function oy(){if(sI()!=="firstParty")return!1;if(!ZGH())return!1;try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return!0}catch{}let H=dD();if(!H?.accessToken)return!1;if(!H.scopes?.includes(VR))return!1;if(H.subscriptionType!=="enterprise")return!1;return!0}async function i4A(){if(DDH)await DDH}function W09(){try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return{headers:{"x-api-key":$}}}catch{}let H=dD();if(H?.accessToken)return{headers:{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}};return{headers:{},error:"No authentication available"}}async function V09(H){let $=null;for(let A=1;A<=c4A+1;A++){if($=await P09(H),$.success)return $;if($.skipRetry)return $;if(A>c4A)return $;let L=Rg(A);N(`Policy limits: Retry ${A}/${c4A} after ${L}ms`),await $x(L)}return $}async function P09(H){try{await iW();let $=W09();if($.error)return{success:!1,error:"Authentication required for policy limits",skipRetry:!0};let A=K09(),L={...$.headers,"User-Agent":sG()};if(H)L["If-None-Match"]=`"${H}"`;let I=await nA.get(A,{headers:L,timeout:X09,validateStatus:(B)=>B===200||B===304||B===404});if(I.status===304)return N("Policy limits: Using cached restrictions (304)"),{success:!0,restrictions:null,etag:H};if(I.status===404)return N("Policy limits: No restrictions found (404)"),{success:!0,restrictions:{},etag:void 0};let D=F9A.safeParse(I.data);if(!D.success)return N(`Policy limits: Invalid response format - ${D.error.message}`),{success:!1,error:"Invalid policy limits format"};return N("Policy limits: Fetched successfully"),{success:!0,restrictions:D.data.restrictions}}catch($){if(nA.isAxiosError($)){if($.response?.status===401||$.response?.status===403)return{success:!1,error:"Not authorized for policy limits",skipRetry:!0};if($.code==="ECONNABORTED")return{success:!1,error:"Policy limits request timeout"};if($.code==="ECONNREFUSED"||$.code==="ENOTFOUND")return{success:!1,error:"Cannot connect to server"}}return{success:!1,error:$ instanceof Error?$.message:"Unknown error"}}}function Y3I(){try{let H=YSH.readFileSync(yU$(),"utf-8"),$=q1(H,!1),A=F9A.safeParse($);if(!A.success)return null;return A.data.restrictions}catch{return null}}function _09(H){try{let $=yU$();d_($,yH({restrictions:H},null,2),{encoding:"utf-8",mode:384}),N(`Policy limits: Saved to ${$}`)}catch($){N(`Policy limits: Failed to save - ${$ instanceof Error?$.message:"unknown error"}`)}}async function n4A(){if(!oy())return null;let H=Y3I(),$=H?Q09(H):void 0;try{let A=await V09($);if(!A.success){if(H)return N("Policy limits: Using stale cache after fetch failure"),s2=H,H;return null}if(A.restrictions===null&&H)return N("Policy limits: Cache still valid (304 Not Modified)"),s2=H,H;let L=A.restrictions||{};if(Object.keys(L).length>0)return s2=L,_09(L),N("Policy limits: Applied new restrictions successfully"),L;s2=L;try{YSH.unlinkSync(yU$()),N("Policy limits: Deleted cached file (404 response)")}catch(D){if(G09(D)&&D.code!=="ENOENT")N(`Policy limits: Failed to delete cached file - ${D.message}`)}return L}catch{if(H)return N("Policy limits: Using stale cache after error"),s2=H,H;return null}}function PK(H){let $=Y09();if(!$)return!0;let A=$[H];if(!A)return!0;return A.allowed}function Y09(){if(!oy())return null;if(s2)return s2;let H=Y3I();if(H)return s2=H,H;return null}async function C3I(){if(oy()&&!DDH)DDH=new Promise((H)=>{yg=H});try{if(await n4A(),oy())w09()}finally{if(yg)yg(),yg=null}}async function vU$(){if(r4A(),!oy())return;await n4A(),N("Policy limits: Refreshed after auth change")}function r4A(){w3I(),s2=null,DDH=null,yg=null;try{YSH.unlinkSync(yU$())}catch{}}async function C09(){if(!oy())return;let H=s2?yH(s2):null;try{if(await n4A(),(s2?yH(s2):null)!==H)N("Policy limits: Changed during background poll")}catch{}}function w09(){if(_SH!==null)return;if(!oy())return;if(_SH=setInterval(()=>{C09()},J09),!W3I)W3I=!0,PB(async()=>w3I())}function w3I(){if(_SH!==null)clearInterval(_SH),_SH=null}var V3I,P3I,YSH,U09="policy-limits.json",X09=1e4,c4A=5,J09=3600000,_SH=null,W3I=!1,DDH=null,yg=null,F09=30000,s2=null;var XY=K(()=>{w1();_Q();E$();qE();EI();uAI();NA();oM();rD();nM();IDH();Ng();ZE();Z$();V3I=require("path"),P3I=require("crypto"),YSH=require("fs")});var Z3I=K(()=>{vA();PI();mL();FG();EI();XY();NA()});function q3I(){return!1}function yD(H){if(!q3I())return;let L=(M$().featureUsage??{})[H],I={firstUsedAt:L?.firstUsedAt??Date.now(),usageCount:(L?.usageCount??0)+1};if(!L||L.usageCount!==I.usageCount)AA((D)=>({...D,featureUsage:{...D.featureUsage,[H]:I}}))}var yE=K(()=>{vA();Z3I()});class hU${options;log;terminal;scheduleRender;isUnmounted=!1;isPaused=!1;container;rootNode;renderer;stylePool;charPool;hyperlinkPool;exitPromise;restoreConsole;unsubscribeTTYHandlers;terminalColumns;terminalRows;currentNode=null;frontFrame;backFrame;lastPoolResetTime=performance.now();constructor(H){this.options=H;if(VBA(this),this.options.patchConsole)this.restoreConsole=this.patchConsole();if(this.terminal={stdout:H.stdout,stderr:H.stderr},this.terminalColumns=H.stdout.columns||80,this.terminalRows=H.stdout.rows||24,this.stylePool=new V0A,this.charPool=new P1$,this.hyperlinkPool=new _1$,this.frontFrame=xn(this.terminalRows,this.terminalColumns,this.stylePool,this.charPool,this.hyperlinkPool),this.backFrame=xn(this.terminalRows,this.terminalColumns,this.stylePool,this.charPool,this.hyperlinkPool),this.log=new Z0A({debug:H.debug,isTTY:H.stdout.isTTY||!1,stylePool:this.stylePool}),this.scheduleRender=H.debug?this.onRender:WBA(this.onRender,n5H,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.unsubscribeExit=eoH(this.unmount,{alwaysLast:!1}),H.stdout.isTTY)H.stdout.on("resize",this.handleResize),process.on("SIGCONT",this.handleResume),this.unsubscribeTTYHandlers=()=>{H.stdout.off("resize",this.handleResize),process.off("SIGCONT",this.handleResume)};this.rootNode=U1$("ink-root"),this.renderer=C0A(this.rootNode,this.stylePool),this.rootNode.onRender=this.scheduleRender,this.rootNode.onImmediateRender=this.onRender,this.rootNode.onComputeLayout=()=>{if(this.isUnmounted)return;if(this.rootNode.yogaNode)this.rootNode.yogaNode.setWidth(this.terminalColumns),this.rootNode.yogaNode.calculateLayout(this.terminalColumns)},this.container=pu.createContainer(this.rootNode,T3I.ConcurrentRoot,null,!1,null,"id",Jk,Jk,Jk,Jk)}handleResume=()=>{if(!this.options.stdout.isTTY)return;this.frontFrame=xn(this.frontFrame.viewport.height,this.frontFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.backFrame=xn(this.backFrame.viewport.height,this.backFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.log.reset()};handleResize=()=>{if(this.terminalColumns=this.options.stdout.columns||80,this.terminalRows=this.options.stdout.rows||24,this.currentNode!==null)this.render(this.currentNode)};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};setTheme(H){this.options.theme=H}handleThemeChange=(H)=>{this.setTheme(H)};handleThemeSave=(H)=>{yD("theme"),AA(($)=>({...$,theme:H}))};onRender(){if(this.isUnmounted||this.isPaused)return;let H=performance.now(),$=this.options.stdout.columns||80,A=this.options.stdout.rows||24,L=this.renderer({frontFrame:this.frontFrame,backFrame:this.backFrame,isTTY:this.options.stdout.isTTY,terminalWidth:$,terminalRows:A}),I=this.log.render(this.frontFrame,L);if(this.backFrame=this.frontFrame,this.frontFrame=L,H-this.lastPoolResetTime>300000)this.resetPools(),this.lastPoolResetTime=H;let D=[];for(let B of I)if(B.type==="clearTerminal")D.push({desiredHeight:L.screen.height,availableHeight:L.viewport.height,reason:B.reason});B9A(this.terminal,f9A(I)),this.options.onFrame?.({durationMs:performance.now()-H,flickers:D})}pause(){pu.flushSyncFromReconciler(),this.onRender(),this.isPaused=!0}resume(){this.isPaused=!1,this.onRender()}repaint(){this.frontFrame=xn(this.frontFrame.viewport.height,this.frontFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.backFrame=xn(this.backFrame.viewport.height,this.backFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.log.reset()}stdinListeners=[];wasRawMode=!1;suspendStdin(){let H=this.options.stdin;if(!H.isTTY)return;H.listeners("readable").forEach((L)=>{this.stdinListeners.push({event:"readable",listener:L}),H.removeListener("readable",L)});let A=H;if(A.isRaw&&A.setRawMode)A.setRawMode(!1),this.wasRawMode=!0}resumeStdin(){let H=this.options.stdin;if(!H.isTTY)return;if(this.stdinListeners.forEach(({event:$,listener:A})=>{H.addListener($,A)}),this.stdinListeners=[],this.wasRawMode){let $=H;if($.setRawMode)$.setRawMode(!0);this.wasRawMode=!1}}render(H){this.currentNode=H;let $=a4A.default.createElement(b1$,{initialTheme:this.options.theme,stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount,terminalColumns:this.terminalColumns,terminalRows:this.terminalRows,onThemeChange:this.handleThemeChange,onThemeSave:this.handleThemeSave},a4A.default.createElement(PAI,{value:(A)=>this.options.stdout.write(A)},H));pu.updateContainerSync($,this.container,null,Jk),pu.flushSyncWork()}unmount(H){if(this.isUnmounted)return;if(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole==="function")this.restoreConsole();this.unsubscribeTTYHandlers?.();let $=this.log.renderPreviousOutput_DEPRECATED(this.frontFrame);if(B9A(this.terminal,f9A($)),this.options.stdout.isTTY)iJH.writeSync(1,x5H),iJH.writeSync(1,YLH),iJH.writeSync(1,a5H),iJH.writeSync(1,TO),iJH.writeSync(1,k1$);if(this.isUnmounted=!0,this.scheduleRender.cancel?.(),pu.updateContainerSync(null,this.container,null,Jk),pu.flushSyncWork(),qO.delete(this.options.stdout),H instanceof Error)this.rejectExitPromise(H);else this.resolveExitPromise()}async waitUntilExit(){return this.exitPromise||=new Promise((H,$)=>{this.resolveExitPromise=H,this.rejectExitPromise=$}),this.exitPromise}resetLineCount(){if(this.options.stdout.isTTY&&!this.options.debug)this.backFrame=this.frontFrame,this.frontFrame=xn(this.frontFrame.viewport.height,this.frontFrame.viewport.width,this.stylePool,this.charPool,this.hyperlinkPool),this.log.reset()}resetPools(){this.charPool=new P1$,this.hyperlinkPool=new _1$,_eL(this.frontFrame.screen,this.charPool,this.hyperlinkPool),this.backFrame.screen.charPool=this.charPool,this.backFrame.screen.hyperlinkPool=this.hyperlinkPool}patchConsole(){if(this.options.debug)return;return GtL((H,$)=>{if(H==="stdout")N(`console.log: ${$}`);if(H==="stderr")r(Error(`console.error: ${$}`))})}}var a4A,iJH,T3I;var z3I=K(()=>{EtL();jb$();UtL();D0A();OeL();A0A();jeL();d5H();wHI();TLH();_$();E$();sj$();s1$();_AI();g5H();CLH();Jy();t5H();vA();yE();a4A=b(s(),1),iJH=require("fs"),T3I=b(xBA(),1)});var N3I,Z09=(H,$)=>{let A=T09($),L={stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0,...A,theme:A.theme??M$().theme},I=z09(L.stdout,()=>new hU$(L));return I.render(H),{rerender:I.render,unmount(){I.unmount()},waitUntilExit:I.waitUntilExit,cleanup:()=>qO.delete(L.stdout)}},q09=async(H,$)=>{N("[render] initLayout starting"),await ysL(),N("[render] initLayout complete");let A=Z09(H,$);return N(`[render] first ink render: ${Math.round(process.uptime()*1000)}ms since process start`),A},A8,T09=(H={})=>{if(H instanceof N3I.Stream)return{stdout:H,stdin:process.stdin};return H},z09=(H,$)=>{let A=qO.get(H);if(!A)A=$(),qO.set(H,A);return A};var O3I=K(()=>{z3I();sBA();d5H();vA();E$();N3I=require("stream"),A8=q09});function CSH(H,$){if(!H)return;if(H.startsWith("rgb(")||H.startsWith("#")||H.startsWith("ansi256(")||H.startsWith("ansi:"))return H;return $[H]}function N09({borderColor:H,borderTopColor:$,borderBottomColor:A,borderLeftColor:L,borderRightColor:I,children:D,ref:B,...f}){let[E]=_I(),M=c6(E),G=CSH(H,M),U=CSH($,M),X=CSH(A,M),J=CSH(L,M),F=CSH(I,M);return x3I.default.createElement(s_,{ref:B,borderColor:G,borderTopColor:U,borderBottomColor:X,borderLeftColor:J,borderRightColor:F,...f},D)}var x3I,x;var S3I=K(()=>{Ky();DNH();INH();x3I=b(s(),1);x=N09});var y3I=z((Zcf,R3I)=>{var wcf=require("os"),j3I=require("tty"),IT=YCH(),{env:TQ}=process,Sr;if(IT("no-color")||IT("no-colors")||IT("color=false")||IT("color=never"))Sr=0;else if(IT("color")||IT("colors")||IT("color=true")||IT("color=always"))Sr=1;if("FORCE_COLOR"in TQ)if(TQ.FORCE_COLOR==="true")Sr=1;else if(TQ.FORCE_COLOR==="false")Sr=0;else Sr=TQ.FORCE_COLOR.length===0?1:Math.min(parseInt(TQ.FORCE_COLOR,10),3);function o4A(H){if(H===0)return!1;return{level:H,hasBasic:!0,has256:H>=2,has16m:H>=3}}function t4A(H,$){if(Sr===0)return 0;if(IT("color=16m")||IT("color=full")||IT("color=truecolor"))return 3;if(IT("color=256"))return 2;if(H&&!$&&Sr===void 0)return 0;let A=Sr||0;if(TQ.TERM==="dumb")return A;if("CI"in TQ){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((L)=>(L in TQ))||TQ.CI_NAME==="codeship")return 1;return A}if("TEAMCITY_VERSION"in TQ)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(TQ.TEAMCITY_VERSION)?1:0;if(TQ.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in TQ){let L=parseInt((TQ.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(TQ.TERM_PROGRAM){case"iTerm.app":return L>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(TQ.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(TQ.TERM))return 1;if("COLORTERM"in TQ)return 1;return A}function O09(H){let $=t4A(H,H&&H.isTTY);return o4A($)}R3I.exports={supportsColor:O09,stdout:o4A(t4A(!0,j3I.isatty(1))),stderr:o4A(t4A(!0,j3I.isatty(2)))}});var b3I=z((qcf,h3I)=>{var x09=y3I(),nJH=YCH();function v3I(H){if(/^\d{3,4}$/.test(H)){let A=/(\d{1,2})(\d{2})/.exec(H);return{major:0,minor:parseInt(A[1],10),patch:parseInt(A[2],10)}}let $=(H||"").split(".").map((A)=>parseInt(A,10));return{major:$[0],minor:$[1],patch:$[2]}}function s4A(H){let{env:$}=process;if("FORCE_HYPERLINK"in $)return!($.FORCE_HYPERLINK.length>0&&parseInt($.FORCE_HYPERLINK,10)===0);if(nJH("no-hyperlink")||nJH("no-hyperlinks")||nJH("hyperlink=false")||nJH("hyperlink=never"))return!1;if(nJH("hyperlink=true")||nJH("hyperlink=always"))return!0;if("NETLIFY"in $)return!0;if(!x09.supportsColor(H))return!1;if(H&&!H.isTTY)return!1;if("CI"in $)return!1;if("TEAMCITY_VERSION"in $)return!1;if("TERM_PROGRAM"in $){let A=v3I($.TERM_PROGRAM_VERSION);switch($.TERM_PROGRAM){case"iTerm.app":if(A.major===3)return A.minor>=1;return A.major>3;case"WezTerm":return A.major>=20200620;case"vscode":return A.major>1||A.major===1&&A.minor>=72}}if("VTE_VERSION"in $){if($.VTE_VERSION==="0.50.0")return!1;let A=v3I($.VTE_VERSION);return A.major>0||A.minor>=50}return!1}h3I.exports={supportsHyperlink:s4A,stdout:s4A(process.stdout),stderr:s4A(process.stderr)}});function e2(){if(u3I.default.stdout)return!0;let H=process.env.TERM_PROGRAM;if(H&&k3I.includes(H))return!0;let $=process.env.LC_TERMINAL;if($&&k3I.includes($))return!0;if(process.env.TERM?.includes("kitty"))return!0;return!1}var u3I,k3I;var jr=K(()=>{u3I=b(b3I(),1),k3I=["ghostty","Hyper","kitty","alacritty","iTerm.app","iTerm2"]});function dI({children:H,url:$,fallback:A}){let L=H??$;if(e2())return bU$.default.createElement(fJ,null,bU$.default.createElement("ink-link",{href:$},L));return bU$.default.createElement(fJ,null,A??L)}var bU$;var rJH=K(()=>{jr();i5H();bU$=b(s(),1)});function aJH(){return{bold:!1,dim:!1,italic:!1,underline:"none",blink:!1,inverse:!1,hidden:!1,strikethrough:!1,overline:!1,fg:{type:"default"},bg:{type:"default"},underlineColor:{type:"default"}}}function g3I(H){if(H.length===0)return null;let $=H[0];if($==="c")return{type:"reset"};if($==="7")return{type:"cursor",action:{type:"save"}};if($==="8")return{type:"cursor",action:{type:"restore"}};if($==="D")return{type:"cursor",action:{type:"move",direction:"down",count:1}};if($==="M")return{type:"cursor",action:{type:"move",direction:"up",count:1}};if($==="E")return{type:"cursor",action:{type:"nextLine",count:1}};if($==="H")return null;if("()".includes($)&&H.length>=2)return null;return{type:"unknown",sequence:`\x1B${H}`}}function j09(H){if(H==="")return[{value:0,subparams:[],colon:!1}];let $=[],A={value:null,subparams:[],colon:!1},L="",I=!1;for(let D=0;D<=H.length;D++){let B=H[D];if(B===";"||B===void 0){let f=L===""?null:parseInt(L,10);if(I){if(f!==null)A.subparams.push(f)}else A.value=f;$.push(A),A={value:null,subparams:[],colon:!1},L="",I=!1}else if(B===":"){let f=L===""?null:parseInt(L,10);if(!I)A.value=f,A.colon=!0,I=!0;else if(f!==null)A.subparams.push(f);L=""}else if(B>="0"&&B<="9")L+=B}return $}function e4A(H,$){let A=H[$];if(!A)return null;if(A.colon&&A.subparams.length>=1){if(A.subparams[0]===5&&A.subparams.length>=2)return{index:A.subparams[1]};if(A.subparams[0]===2&&A.subparams.length>=4){let I=A.subparams.length>=5?1:0;return{r:A.subparams[1+I],g:A.subparams[2+I],b:A.subparams[3+I]}}}let L=H[$+1];if(!L)return null;if(L.value===5&&H[$+2]?.value!==null&&H[$+2]?.value!==void 0)return{index:H[$+2].value};if(L.value===2){let I=H[$+2]?.value,D=H[$+3]?.value,B=H[$+4]?.value;if(I!==null&&I!==void 0&&D!==null&&D!==void 0&&B!==null&&B!==void 0)return{r:I,g:D,b:B}}return null}function m3I(H,$){let A=j09(H),L={...$},I=0;while(I=30&&B<=37){L.fg={type:"named",name:kU$[B-30]},I++;continue}if(B===39){L.fg={type:"default"},I++;continue}if(B>=40&&B<=47){L.bg={type:"named",name:kU$[B-40]},I++;continue}if(B===49){L.bg={type:"default"},I++;continue}if(B>=90&&B<=97){L.fg={type:"named",name:kU$[B-90+8]},I++;continue}if(B>=100&&B<=107){L.bg={type:"named",name:kU$[B-100+8]},I++;continue}if(B===38){let f=e4A(A,I);if(f){L.fg="index"in f?{type:"indexed",index:f.index}:{type:"rgb",...f},I+=D.colon?1:("index"in f)?3:5;continue}}if(B===48){let f=e4A(A,I);if(f){L.bg="index"in f?{type:"indexed",index:f.index}:{type:"rgb",...f},I+=D.colon?1:("index"in f)?3:5;continue}}if(B===58){let f=e4A(A,I);if(f){L.underlineColor="index"in f?{type:"indexed",index:f.index}:{type:"rgb",...f},I+=D.colon?1:("index"in f)?3:5;continue}}if(B===59){L.underlineColor={type:"default"},I++;continue}I++}return L}var kU$,S09;var p3I=K(()=>{kU$=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],S09=["none","single","double","curly","dotted","dashed"]});function R09(H){return H>=9728&&H<=9983||H>=9984&&H<=10175||H>=127744&&H<=129535||H>=129536&&H<=129791||H>=127456&&H<=127487}function y09(H){return H>=4352&&H<=4447||H>=11904&&H<=40959||H>=44032&&H<=55203||H>=63744&&H<=64255||H>=65040&&H<=65055||H>=65072&&H<=65135||H>=65280&&H<=65376||H>=65504&&H<=65510||H>=131072&&H<=196605||H>=196608&&H<=262141}function v09(H){if([...H].length>1)return 2;let $=H.codePointAt(0);if($===void 0)return 1;if(R09($)||y09($))return 2;return 1}function*d3I(H){for(let{segment:$}of PO().segment(H))yield{value:$,width:v09($)}}function h09(H){if(H==="")return[];return H.split(/[;:]/).map(($)=>$===""?0:parseInt($,10))}function b09(H){let $=H.slice(2);if($.length===0)return null;let A=$.charCodeAt($.length-1),L=$.slice(0,-1),I="",D=L,B="";if(L.length>0&&"?>=".includes(L[0]))I=L[0],D=L.slice(1);let f=D.match(/([^0-9;:]+)$/);if(f)B=f[1],D=D.slice(0,-B.length);let E=h09(D),M=E[0]??1,G=E[1]??1;if(A===N4.SGR&&I==="")return{type:"sgr",params:D};if(A===N4.CUU)return{type:"cursor",action:{type:"move",direction:"up",count:M}};if(A===N4.CUD)return{type:"cursor",action:{type:"move",direction:"down",count:M}};if(A===N4.CUF)return{type:"cursor",action:{type:"move",direction:"forward",count:M}};if(A===N4.CUB)return{type:"cursor",action:{type:"move",direction:"back",count:M}};if(A===N4.CNL)return{type:"cursor",action:{type:"nextLine",count:M}};if(A===N4.CPL)return{type:"cursor",action:{type:"prevLine",count:M}};if(A===N4.CHA)return{type:"cursor",action:{type:"column",col:M}};if(A===N4.CUP||A===N4.HVP)return{type:"cursor",action:{type:"position",row:M,col:G}};if(A===N4.VPA)return{type:"cursor",action:{type:"row",row:M}};if(A===N4.ED)return{type:"erase",action:{type:"display",region:etL[E[0]??0]??"toEnd"}};if(A===N4.EL)return{type:"erase",action:{type:"line",region:HsL[E[0]??0]??"toEnd"}};if(A===N4.ECH)return{type:"erase",action:{type:"chars",count:M}};if(A===N4.SU)return{type:"scroll",action:{type:"up",count:M}};if(A===N4.SD)return{type:"scroll",action:{type:"down",count:M}};if(A===N4.DECSTBM)return{type:"scroll",action:{type:"setRegion",top:M,bottom:G}};if(A===N4.SCOSC)return{type:"cursor",action:{type:"save"}};if(A===N4.SCORC)return{type:"cursor",action:{type:"restore"}};if(A===N4.DECSCUSR&&B===" ")return{type:"cursor",action:{type:"style",...dBA[M]??dBA[0]}};if(I==="?"&&(A===N4.SM||A===N4.RM)){let U=A===N4.SM;if(M===eW.CURSOR_VISIBLE)return{type:"cursor",action:U?{type:"show"}:{type:"hide"}};if(M===eW.ALT_SCREEN_CLEAR||M===eW.ALT_SCREEN)return{type:"mode",action:{type:"alternateScreen",enabled:U}};if(M===eW.BRACKETED_PASTE)return{type:"mode",action:{type:"bracketedPaste",enabled:U}};if(M===eW.MOUSE_NORMAL)return{type:"mode",action:{type:"mouseTracking",mode:U?"normal":"off"}};if(M===eW.MOUSE_BUTTON)return{type:"mode",action:{type:"mouseTracking",mode:U?"button":"off"}};if(M===eW.MOUSE_ANY)return{type:"mode",action:{type:"mouseTracking",mode:U?"any":"off"}};if(M===eW.FOCUS_EVENTS)return{type:"mode",action:{type:"focusEvents",enabled:U}}}return{type:"unknown",sequence:H}}function k09(H){if(H.length<2)return"unknown";if(H.charCodeAt(0)!==Xy.ESC)return"unknown";let $=H.charCodeAt(1);if($===91)return"csi";if($===93)return"osc";if($===79)return"ss3";return"esc"}class uU${tokenizer=S5H();style=aJH();inLink=!1;linkUrl;reset(){this.tokenizer.reset(),this.style=aJH(),this.inLink=!1,this.linkUrl=void 0}feed(H){let $=this.tokenizer.feed(H),A=[];for(let L of $){let I=this.processToken(L);A.push(...I)}return A}processToken(H){switch(H.type){case"text":return this.processText(H.value);case"sequence":return this.processSequence(H.value)}}processText(H){let $=[],A="";for(let L of H)if(L.charCodeAt(0)===Xy.BEL){if(A){let I=[...d3I(A)];if(I.length>0)$.push({type:"text",graphemes:I,style:{...this.style}});A=""}$.push({type:"bell"})}else A+=L;if(A){let L=[...d3I(A)];if(L.length>0)$.push({type:"text",graphemes:L,style:{...this.style}})}return $}processSequence(H){switch(k09(H)){case"csi":{let A=b09(H);if(!A)return[];if(A.type==="sgr")return this.style=m3I(A.params,this.style),[];return[A]}case"osc":{let A=H.slice(2);if(A.endsWith("\x07"))A=A.slice(0,-1);else if(A.endsWith("\x1B\\"))A=A.slice(0,-2);let L=qHI(A);if(L){if(L.type==="link")if(L.action.type==="start")this.inLink=!0,this.linkUrl=L.action.url;else this.inLink=!1,this.linkUrl=void 0;return[L]}return[]}case"esc":{let A=H.slice(1),L=g3I(A);return L?[L]:[]}case"ss3":return[{type:"unknown",sequence:H}];default:return[{type:"unknown",sequence:H}]}}}var c3I=K(()=>{FLH();Jy();CLH();t5H();p3I();f1$();F5H()});var l3I=K(()=>{c3I()});function u09(H){let A=new uU$().feed(H),L=[],I;for(let D of A){if(D.type==="link"){if(D.action.type==="start")I=D.action.url;else I=void 0;continue}if(D.type==="text"){let B=D.graphemes.map((M)=>M.value).join("");if(!B)continue;let f=g09(D.style);if(I)f.hyperlink=I;let E=L[L.length-1];if(E&&p09(E.props,f))E.text+=B;else L.push({text:B,props:f})}}return L}function g09(H){let $={};if(H.bold)$.bold=!0;if(H.dim)$.dim=!0;if(H.italic)$.italic=!0;if(H.underline!=="none")$.underline=!0;if(H.strikethrough)$.strikethrough=!0;if(H.inverse)$.inverse=!0;let A=i3I(H.fg);if(A)$.color=A;let L=i3I(H.bg);if(L)$.backgroundColor=L;return $}function i3I(H){switch(H.type){case"named":return m09[H.name];case"indexed":return`ansi256(${H.index})`;case"rgb":return`rgb(${H.r},${H.g},${H.b})`;case"default":return}}function p09(H,$){return H.color===$.color&&H.backgroundColor===$.backgroundColor&&H.bold===$.bold&&H.dim===$.dim&&H.italic===$.italic&&H.underline===$.underline&&H.strikethrough===$.strikethrough&&H.inverse===$.inverse&&H.hyperlink===$.hyperlink}function n3I({bold:H,dim:$,children:A,...L}){if($)return AP.default.createElement(fJ,{...L,dim:!0},A);if(H)return AP.default.createElement(fJ,{...L,bold:!0},A);return AP.default.createElement(fJ,{...L},A)}var AP,m9,m09;var r3I=K(()=>{i5H();rJH();l3I();AP=b(s(),1),m9=AP.default.memo(function({children:$,dimColor:A}){if(typeof $!=="string")return A?AP.default.createElement(fJ,{dim:!0},String($)):AP.default.createElement(fJ,null,String($));if($==="")return null;let L=u09($);if(L.length===0)return null;if(L.length===1&&Object.keys(L[0].props).length===0)return A?AP.default.createElement(fJ,{dim:!0},L[0].text):AP.default.createElement(fJ,null,L[0].text);let I=L.map((D,B)=>{let{hyperlink:f,...E}=D.props;if(A)E.dim=!0;let M=Object.keys(E).length>0;if(f)return M?AP.default.createElement(dI,{key:B,url:f},AP.default.createElement(n3I,{...E},D.text)):AP.default.createElement(dI,{key:B,url:f},D.text);return M?AP.default.createElement(n3I,{key:B,...E},D.text):D.text});return A?AP.default.createElement(fJ,{dim:!0},I):AP.default.createElement(fJ,null,I)});m09={black:"ansi:black",red:"ansi:red",green:"ansi:green",yellow:"ansi:yellow",blue:"ansi:blue",magenta:"ansi:magenta",cyan:"ansi:cyan",white:"ansi:white",brightBlack:"ansi:blackBright",brightRed:"ansi:redBright",brightGreen:"ansi:greenBright",brightYellow:"ansi:yellowBright",brightBlue:"ansi:blueBright",brightMagenta:"ansi:magentaBright",brightCyan:"ansi:cyanBright",brightWhite:"ansi:whiteBright"}});function _K({count:H=1}){return a3I.default.createElement("ink-text",null,` `;if(G)L=M;$.push(new iU$(B,E,f(E),G))}}return $}getWrappedText(){return this.wrappedLines.map((H)=>H.isPrecededByNewline?H.text:H.text.trimStart())}getWrappedLines(){return this.wrappedLines}getLine(H){let $=this.wrappedLines;return $[Math.max(0,Math.min(H,$.length-1))]}getOffsetFromPosition(H){let $=this.getLine(H.line);if($.text.length===0&&$.endsWithNewline)return $.startOffset;let A=$.isPrecededByNewline?0:$.text.length-$.text.trimStart().length,L=H.column+A,I=this.displayWidthToStringIndex($.text,L),D=$.startOffset+I,B=$.startOffset+$.text.length,f=B,E=GI($.text);if($.endsWithNewline&&H.column>E)f=B+1;return Math.min(D,f)}getLineLength(H){let $=this.getLine(H);return GI($.text)}getPositionFromOffset(H){let $=this.wrappedLines;for(let I=0;I<$.length;I++){let D=$[I],B=$[I+1];if(H>=D.startOffset&&(!B||H{let $=this.getGraphemeBoundaries();return this.binarySearchBoundary($,H,!0)})}prevOffset(H){if(H<=0)return 0;return this.withCache(`prev:${H}`,()=>{let $=this.getGraphemeBoundaries();return this.binarySearchBoundary($,H,!1)})}}var F99=10,BT,lU$=0,I5A=!1,KVI=0,D5A=0,nU$=!1,K99,TSH,hg=(H)=>K99.test(H),sU$=(H)=>TSH.test(H),hr=(H)=>H.length>0&&!sU$(H)&&!hg(H);var eJH=K(()=>{$1$();DJ();F5H();BT=[];K99=/^[\p{L}\p{N}\p{M}_]$/u,TSH=/\s/});function eU$({children:H}){let{marker:$}=br.useContext(Q99);return br.default.createElement(x,{gap:1},br.default.createElement(V,{dimColor:!0},$),br.default.createElement(x,{flexDirection:"column"},H))}var br,Q99;var WVI=K(()=>{xH();br=b(s(),1),Q99=br.createContext({marker:""})});function PVI({children:H}){let{marker:$}=JY.useContext(VVI),A=0;for(let I of JY.default.Children.toArray(H)){if(!JY.isValidElement(I)||I.type!==eU$)continue;A++}let L=String(A).length;return JY.default.createElement(x,{flexDirection:"column"},JY.default.Children.map(H,(I,D)=>{if(!JY.isValidElement(I)||I.type!==eU$)return I;let B=`${String(D+1).padStart(L)}.`,f=`${$}${B}`;return JY.default.createElement(VVI.Provider,{value:{marker:f}},JY.default.createElement(W99.Provider,{value:{marker:f}},I))}))}var JY,VVI,W99,OSH;var B5A=K(()=>{xH();WVI();JY=b(s(),1),VVI=JY.createContext({marker:""}),W99=JY.createContext({marker:""});PVI.Item=eU$;OSH=PVI});function CVI(){return f5A().filter(({isCompletable:H,isEnabled:$})=>H&&$).every(({isComplete:H})=>H)}function HFH(){let H=Mf();if(CVI()&&!H.hasCompletedProjectOnboarding)MM(($)=>({...$,hasCompletedProjectOnboarding:!0}))}function f5A(){let H=zH().existsSync(_VI.join(C$(),"CLAUDE.md")),$=qVI(C$());return[{key:"workspace",text:"Ask Claude to create a new app or clone a repository",isComplete:!1,isCompletable:!0,isEnabled:$},{key:"claudemd",text:"Run /init to create a CLAUDE.md file with instructions for Claude",isComplete:H,isCompletable:!0,isEnabled:!$}]}function ZVI(){MM((H)=>({...H,projectOnboardingSeenCount:H.projectOnboardingSeenCount+1}))}var V99,_VI,YVI,wVI;var xSH=K(()=>{B5A();xH();vA();rD();PI();DL();tD();V99=b(s(),1),_VI=require("path"),YVI=b(s(),1);wVI=o$(()=>{if(CVI()||Mf().projectOnboardingSeenCount>=4||process.env.IS_DEMO)return!1;return!0})});function P99(H){AA(($)=>({...$,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:H}))}function SSH(){AA((H)=>({...H,appleTerminalSetupInProgress:!1}))}function _99(){let H=M$();return{inProgress:H.appleTerminalSetupInProgress??!1,backupPath:H.appleTerminalBackupPath||null}}function $FH(){return zVI.join(TVI.homedir(),"Library","Preferences","com.apple.Terminal.plist")}async function NVI(){let H=$FH(),$=`${H}.bak`;try{let{code:A}=await jA("defaults",["export","com.apple.Terminal",H]);if(A!==0)return null;if(zH().existsSync(H))return await jA("defaults",["export","com.apple.Terminal",$]),P99($),$;return null}catch(A){return r(A instanceof Error?A:Error(String(A))),null}}async function H4$(){let{inProgress:H,backupPath:$}=_99();if(!H)return{status:"no_backup"};if(!$||!zH().existsSync($))return SSH(),{status:"no_backup"};try{let{code:A}=await jA("defaults",["import","com.apple.Terminal",$]);if(A!==0)return{status:"failed",backupPath:$};return await jA("killall",["cfprefsd"]),SSH(),{status:"restored"}}catch(A){return r(Error(`Failed to restore Terminal.app settings with: ${A}`)),SSH(),{status:"failed",backupPath:$}}}var TVI,zVI;var E5A=K(()=>{B0();_$();vA();DL();TVI=require("os"),zVI=require("path")});function Y99(){let H=process.env.SHELL||"",$=M5A.homedir(),A=sy.join($,".claude");if(H.endsWith("/zsh")||H.endsWith("/zsh.exe")){let L=sy.join(A,"completion.zsh");return{name:"zsh",rcFile:sy.join($,".zshrc"),cacheFile:L,completionLine:`[[ -f "${L}" ]] && source "${L}"`,shellFlag:"zsh"}}if(H.endsWith("/bash")||H.endsWith("/bash.exe")){let L=sy.join(A,"completion.bash");return{name:"bash",rcFile:sy.join($,".bashrc"),cacheFile:L,completionLine:`[ -f "${L}" ] && source "${L}"`,shellFlag:"bash"}}if(H.endsWith("/fish")||H.endsWith("/fish.exe")){let L=process.env.XDG_CONFIG_HOME||sy.join($,".config"),I=sy.join(A,"completion.fish");return{name:"fish",rcFile:sy.join(L,"fish","config.fish"),cacheFile:I,completionLine:`[ -f "${I}" ] && source "${I}"`,shellFlag:"fish"}}return null}async function G5A(){let H=Y99();if(!H)return;N(`update: Regenerating ${H.name} completion cache`);let $=process.argv[1]||"claude";if((await jA($,["completion",H.shellFlag,"--output",H.cacheFile])).code!==0){N(`update: Failed to regenerate ${H.name} completion cache`);return}N(`update: Regenerated ${H.name} completion cache at ${H.cacheFile}`)}var M5A,sy;var U5A=K(()=>{xH();jr();E$();B0();DL();_$();Z$();M5A=require("os"),sy=require("path")});var jVI={};XA(jVI,{shouldOfferTerminalSetup:()=>AFH,setupTerminal:()=>A4$,markBackslashReturnUsed:()=>Q5A,isShiftEnterKeyBindingInstalled:()=>F5A,isOptionAsMetaKeyInstalled:()=>Z99,isNativeCSIuTerminal:()=>w99,hasUsedBackslashReturn:()=>K5A,getNativeCSIuTerminalDisplayName:()=>J5A,call:()=>q99});function C99(){let H=process.env.VSCODE_GIT_ASKPASS_MAIN??"",$=process.env.PATH??"";return H.includes(".vscode-server")||H.includes(".cursor-server")||H.includes(".windsurf-server")||$.includes(".vscode-server")||$.includes(".cursor-server")||$.includes(".windsurf-server")}function w99(){return OA.terminal!==null&&OA.terminal in jSH}function J5A(){if(!OA.terminal||!(OA.terminal in jSH))return null;return jSH[OA.terminal]??null}function fT(H){if(!e2())return H;return`\x1B]8;;${SVI.pathToFileURL(H).href}\x07${H}\x1B]8;;\x07`}function AFH(){return NB.platform()==="darwin"&&OA.terminal==="Apple_Terminal"||OA.terminal==="vscode"||OA.terminal==="cursor"||OA.terminal==="windsurf"||OA.terminal==="alacritty"||OA.terminal==="WarpTerminal"||OA.terminal==="zed"}async function A4$(H){let $="";switch(OA.terminal){case"Apple_Terminal":$=await T99(H);break;case"vscode":$=X5A("VSCode",H);break;case"cursor":$=X5A("Cursor",H);break;case"windsurf":$=X5A("Windsurf",H);break;case"alacritty":$=await z99(H);break;case"WarpTerminal":$=N99(H);break;case"zed":$=O99(H);break;case null:break}return AA((A)=>{if(["vscode","cursor","windsurf","alacritty","WarpTerminal","zed"].includes(OA.terminal??"")){if(A.shiftEnterKeyBindingInstalled===!0)return A;return{...A,shiftEnterKeyBindingInstalled:!0}}else if(OA.terminal==="Apple_Terminal"){if(A.optionAsMetaKeyInstalled===!0)return A;return{...A,optionAsMetaKeyInstalled:!0}}return A}),HFH(),$}function F5A(){return M$().shiftEnterKeyBindingInstalled===!0}function Z99(){return M$().optionAsMetaKeyInstalled===!0}function K5A(){return M$().hasUsedBackslashReturn===!0}function Q5A(){if(!M$().hasUsedBackslashReturn)AA(($)=>({...$,hasUsedBackslashReturn:!0}))}async function q99(H,$,A){if(OA.terminal&&OA.terminal in jSH){let I=`Shift+Enter is natively supported in ${jSH[OA.terminal]}. `)+"\u2026"}var API=67108736;var T5A,IPI=({isDisabled:H=!1,disableSelection:$=!1,state:A,options:L,isMultiSelect:I=!1,onUpFromFirstItem:D,onDownFromLastItem:B,onInputModeToggle:f,inputValues:E,imagesSelected:M=!1,onEnterImageSelection:G})=>{FY("select",!!A.onCancel);let U=T5A.useMemo(()=>{return L.find((F)=>F.value===A.focusedValue)?.type==="input"},[L,A.focusedValue]),X=T5A.useMemo(()=>{let J={};if(!U)J["select:next"]=()=>{if(B){let F=L[L.length-1];if(F&&A.focusedValue===F.value){B();return}}A.focusNextOption()},J["select:previous"]=()=>{if(D&&A.visibleFromIndex===0){let F=L[0];if(F&&A.focusedValue===F.value){D();return}}A.focusPreviousOption()},J["select:accept"]=()=>{if($===!0)return;if(A.focusedValue===void 0)return;if(L.find((Q)=>Q.value===A.focusedValue)?.disabled===!0)return;A.selectFocusedOption?.(),A.onChange?.(A.focusedValue)};if(A.onCancel)J["select:cancel"]=()=>{A.onCancel()};return J},[L,A,B,D,U,$]);bI(X,{context:"Select",isActive:!H}),WL((J,F,Q)=>{let W=fFH(J),P=L.find((Y)=>Y.value===A.focusedValue),C=P?.type==="input";if(F.tab&&f&&A.focusedValue!==void 0){f(A.focusedValue);return}if(C){if(M)return;if(F.downArrow&&G?.()){Q.stopImmediatePropagation();return}if(F.downArrow||F.ctrl&&J==="n"){if(B){let Y=L[L.length-1];if(Y&&A.focusedValue===Y.value){B(),Q.stopImmediatePropagation();return}}A.focusNextOption(),Q.stopImmediatePropagation();return}if(F.upArrow||F.ctrl&&J==="p"){if(D&&A.visibleFromIndex===0){let Y=L[0];if(Y&&A.focusedValue===Y.value){D(),Q.stopImmediatePropagation();return}}A.focusPreviousOption(),Q.stopImmediatePropagation();return}if(/^[0-9]$/.test(W)&&P?.type==="input"){if((E?.get(A.focusedValue)??"").trim())return}else return}if(F.pageDown)A.focusNextPage();if(F.pageUp)A.focusPreviousPage();if($!==!0){if(I&&K4$(J)===" "&&A.focusedValue!==void 0){if(P?.disabled!==!0)A.selectFocusedOption?.(),A.onChange?.(A.focusedValue)}if($!=="numeric"&&/^[0-9]+$/.test(W)){let Y=parseInt(W)-1;if(Y>=0&&Y{xH();Dx();$I();T5A=b(s(),1)});function m99(){let $={darwin:"No image found in clipboard. Use Cmd + Ctrl + Shift + 4 to copy a screenshot to clipboard.",win32:"No image found in clipboard. Use Print Screen to copy a screenshot to clipboard.",linux:"No image found in clipboard. Use appropriate screenshot tool to copy a screenshot to clipboard."};return $.linux||$.linux}function fPI(){let $=process.env.CLAUDE_CODE_TMPDIR||"/tmp",A="claude_cli_latest_screenshot.png",L={darwin:Hv.join($,"claude_cli_latest_screenshot.png"),linux:Hv.join($,"claude_cli_latest_screenshot.png"),win32:Hv.join($,"claude_cli_latest_screenshot.png")},I=L.linux||L.linux,D={darwin:{checkImage:"osascript -e 'the clipboard as \xABclass PNGf\xBB'",saveImage:`osascript -e 'set png_data to (the clipboard as \xABclass PNGf\xBB)' -e 'set fp to open for access POSIX file "${I}" with write permission' -e 'write png_data to fp' -e 'close access fp'`,getPath:"osascript -e 'get POSIX path of (the clipboard as \xABclass furl\xBB)'",deleteFile:`rm -f "${I}"`},linux:{checkImage:'xclip -selection clipboard -t TARGETS -o 2>/dev/null | grep -E "image/(png|jpeg|jpg|gif|webp)" || wl-paste -l 2>/dev/null | grep -E "image/(png|jpeg|jpg|gif|webp)"',saveImage:`xclip -selection clipboard -t image/png -o > "${I}" 2>/dev/null || wl-paste --type image/png > "${I}"`,getPath:"xclip -selection clipboard -t text/plain -o 2>/dev/null || wl-paste 2>/dev/null",deleteFile:`rm -f "${I}"`},win32:{checkImage:'powershell -NoProfile -Command "(Get-Clipboard -Format Image) -ne $null"',saveImage:`powershell -NoProfile -Command "$img = Get-Clipboard -Format Image; if ($img) { $img.Save('${I.replace(/\\/g,"\\\\")}', [System.Drawing.Imaging.ImageFormat]::Png) }"`,getPath:'powershell -NoProfile -Command "Get-Clipboard"',deleteFile:`del /f "${I}"`}};return{commands:D.linux||D.linux,screenshotPath:I}}async function EPI(){return!1}async function MFH(){let{commands:H,screenshotPath:$}=fPI();try{if((await fE(H.checkImage,{shell:!0,reject:!1})).exitCode!==0)return null;if((await fE(H.saveImage,{shell:!0,reject:!1})).exitCode!==0)return null;let I=zH().readFileBytesSync($),D=await pJH(I,I.length,"png"),B=D.buffer.toString("base64"),f=k4A(B);return fE(H.deleteFile,{shell:!0,reject:!1}),{base64:B,mediaType:f,dimensions:D.dimensions}}catch{return null}}async function p99(){let{commands:H}=fPI();try{let $=await fE(H.getPath,{shell:!0,reject:!1});if($.exitCode!==0||!$.stdout)return null;return $.stdout.trim()}catch($){return r($),null}}function GPI(H){if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'"))return H.slice(1,-1);return H}function UPI(H){let L=`__DOUBLE_BACKSLASH_${BPI.randomBytes(8).toString("hex")}__`;return H.replace(/\\\\/g,L).replace(/\\(.)/g,"$1").replace(new RegExp(L,"g"),"\\")}function W4$(H){let $=GPI(H.trim()),A=UPI($);return MPI.test(A)}function d99(H){let $=GPI(H.trim()),A=UPI($);if(MPI.test(A))return A;return null}async function XPI(H){let $=d99(H);if(!$)return null;let A=$,L;try{if(Hv.isAbsolute(A))L=zH().readFileBytesSync(A);else{let E=await p99();if(E&&A===Hv.basename(E))L=zH().readFileBytesSync(E)}}catch(E){return r(E),null}if(!L)return null;let I=Hv.extname(A).slice(1).toLowerCase()||"png",D=await pJH(L,L.length,I),B=D.buffer.toString("base64"),f=k4A(B);return{path:A,base64:B,mediaType:f,dimensions:D.dimensions}}var BPI,Hv,dnf,Q4$=800,MPI;var ySH=K(()=>{B0();O_();DL();_$();LT();BPI=require("crypto"),Hv=require("path");dnf=m99();MPI=/\.(png|jpe?g|gif|webp)$/i});function FPI(){return MDH.join(UL(),JPI,j$())}function KPI(H,$){if(H.existsSync($))return;let A=MDH.dirname($);if(A!==$)KPI(H,A);H.mkdirSync($)}function c99(){let H=zH(),$=FPI();KPI(H,$)}function QPI(H,$){let A=$.split("/")[1]||"png";return MDH.join(FPI(),`${H}.${A}`)}function GFH(H){if(H.type!=="image")return null;let $=QPI(H.id,H.mediaType||"image/png");return z5A.set(H.id,$),$}function GDH(H){if(H.type!=="image")return null;try{c99();let $=QPI(H.id,H.mediaType||"image/png");return iL($,H.content,{encoding:"base64",flush:!0,mode:384}),z5A.set(H.id,$),N(`Stored image ${H.id} to ${$}`),$}catch($){return N(`Failed to store image: ${$}`),null}}function WPI(H){let $=new Map;for(let[A,L]of Object.entries(H))if(L.type==="image"){let I=GDH(L);if(I)$.set(Number(A),I)}return $}function V4$(H){return z5A.get(H)??null}async function VPI(){let H=zH(),$=MDH.join(UL(),JPI),A=j$();try{let L;try{L=await H.readdir($)}catch{return}for(let I of L){if(I.name===A)continue;let D=MDH.join($,I.name);try{await H.rm(D,{recursive:!0,force:!0}),N(`Cleaned up old image cache: ${D}`)}catch{}}try{if((await H.readdir($)).length===0)await H.rmdir($)}catch{}}catch{}}var MDH,JPI="image-cache",z5A;var gr=K(()=>{NA();g$();DL();E$();Z$();MDH=require("path"),z5A=new Map});function P4$({imageId:H,backgroundColor:$,isSelected:A=!1}){let L=V4$(H),I=`[Image #${H}]`;if(L&&e2()){let D=PPI.pathToFileURL(L).href;return ug.createElement(dI,{url:D,fallback:ug.createElement(V,{backgroundColor:$,inverse:A},I)},ug.createElement(V,{backgroundColor:$,inverse:A,bold:A},I))}return ug.createElement(V,{backgroundColor:$,inverse:A},I)}var ug,PPI;var N5A=K(()=>{xH();rJH();gr();jr();ug=b(s(),1),PPI=require("url")});function s$({shortcut:H,action:$,parens:A=!1,bold:L=!1}){let I=L?_4$.default.createElement(fJ,{bold:!0},H):H;if(A)return _4$.default.createElement(fJ,null,"(",I," to ",$,")");return _4$.default.createElement(fJ,null,I," to ",$)}var _4$;var lB=K(()=>{i5H();_4$=b(s(),1)});function VA({action:H,context:$,fallback:A,description:L,parens:I,bold:D}){let B=C0(H,$,A);return O5A.createElement(s$,{shortcut:B,action:L,parens:I,bold:D})}var O5A;var j0=K(()=>{lB();FG();O5A=b(s(),1)});function rA({children:H}){let $=$v.Children.toArray(H);if($.length===0)return null;return $v.default.createElement($v.default.Fragment,null,$.map((A,L)=>$v.default.createElement($v.default.Fragment,{key:$v.isValidElement(A)?A.key??L:L},L>0&&$v.default.createElement(V,{dimColor:!0}," \xB7 "),A)))}var $v;var eB=K(()=>{xH();$v=b(s(),1)});function UFH({option:H,isFocused:$,isSelected:A,shouldShowDownArrow:L,shouldShowUpArrow:I,maxIndexWidth:D,index:B,inputValue:f,onInputChange:E,onSubmit:M,onExit:G,layout:U,children:X,showLabel:J=!1,onOpenEditor:F,resetCursorOnUpdate:Q=!1,onImagePaste:W,pastedContents:P,onRemoveImage:C,imagesSelected:Y,selectedImageIndex:Z=0,onImagesSelectedChange:q,onSelectedImageIndexChange:O}){let j=P?Object.values(P).filter((p)=>p.type==="image"):[],u=J||H.showLabelWithValue===!0,[y,g]=Gf.useState(f.length);Gf.useEffect(()=>{if(Q&&$)g(f.length)},[Q,$,f]),BA("chat:externalEditor",()=>{F?.(f,E)},{context:"Chat",isActive:$&&!!F}),BA("chat:imagePaste",()=>{if(!W)return;MFH().then((p)=>{if(p)W(p.base64,p.mediaType,void 0,p.dimensions)})},{context:"Chat",isActive:$&&!!W}),BA("attachments:remove",()=>{if(j.length>0&&C)C(j[j.length-1].id)},{context:"Attachments",isActive:$&&!Y&&f===""&&j.length>0&&!!C}),bI({"attachments:next":()=>{if(j.length>1)O?.((Z+1)%j.length)},"attachments:previous":()=>{if(j.length>1)O?.((Z-1+j.length)%j.length)},"attachments:remove":()=>{let p=j[Z];if(p&&C)if(C(p.id),j.length<=1)q?.(!1);else O?.(Math.min(Z,j.length-2))},"attachments:exit":()=>{q?.(!1)}},{context:"Attachments",isActive:$&&!!Y}),WL((p,d)=>{if(d.upArrow)q?.(!1)},{isActive:$&&!!Y}),Gf.useEffect(()=>{if(!$&&Y)q?.(!1)},[$,Y,q]);let h=U==="expanded"?D+3:D+4;return Gf.default.createElement(x,{flexDirection:"column",flexShrink:0},Gf.default.createElement(ur,{isFocused:$,isSelected:A,shouldShowDownArrow:L,shouldShowUpArrow:I},Gf.default.createElement(x,{flexDirection:"row",flexShrink:U==="compact"?0:void 0},Gf.default.createElement(V,{dimColor:!0},`${B}.`.padEnd(D+2)),X,u?Gf.default.createElement(Gf.default.Fragment,null,Gf.default.createElement(V,{color:$?"suggestion":void 0},H.label),$?Gf.default.createElement(Gf.default.Fragment,null,Gf.default.createElement(V,{color:"suggestion"},H.labelValueSeparator??", "),Gf.default.createElement(W9,{value:f,onChange:(p)=>{E(p),H.onChange(p)},onSubmit:M,onExit:G,placeholder:H.placeholder,focus:!Y,showCursor:!0,cursorOffset:y,onChangeCursorOffset:g,columns:80,onImagePaste:W,onPaste:(p)=>{let d=f.slice(0,y),k=f.slice(y),n=d+p+k;E(n),H.onChange(n),g(d.length+p.length)}})):f&&Gf.default.createElement(V,null,H.labelValueSeparator??", ",f)):$?Gf.default.createElement(W9,{value:f,onChange:(p)=>{E(p),H.onChange(p)},onSubmit:M,onExit:G,placeholder:H.placeholder||(typeof H.label==="string"?H.label:void 0),focus:!Y,showCursor:!0,cursorOffset:y,onChangeCursorOffset:g,columns:80,onImagePaste:W,onPaste:(p)=>{let d=f.slice(0,y),k=f.slice(y),n=d+p+k;E(n),H.onChange(n),g(d.length+p.length)}}):Gf.default.createElement(V,{color:f?void 0:"inactive"},f||H.placeholder||H.label))),H.description&&Gf.default.createElement(x,{paddingLeft:h},Gf.default.createElement(V,{dimColor:H.dimDescription!==!1,color:A?"success":$?"suggestion":void 0},H.description)),j.length>0&&Gf.default.createElement(x,{flexDirection:"row",gap:1,paddingLeft:h},j.map((p,d)=>Gf.default.createElement(P4$,{key:p.id,imageId:p.id,isSelected:!!Y&&d===Z})),Gf.default.createElement(x,{flexGrow:1,justifyContent:"flex-start",flexDirection:"row"},Gf.default.createElement(V,{dimColor:!0},Y?Gf.default.createElement(rA,null,j.length>1&&Gf.default.createElement(Gf.default.Fragment,null,Gf.default.createElement(VA,{action:"attachments:next",context:"Attachments",fallback:"\u2192",description:"next"}),Gf.default.createElement(VA,{action:"attachments:previous",context:"Attachments",fallback:"\u2190",description:"prev"})),Gf.default.createElement(VA,{action:"attachments:remove",context:"Attachments",fallback:"backspace",description:"remove"}),Gf.default.createElement(VA,{action:"attachments:exit",context:"Attachments",fallback:"esc",description:"cancel"})):$?"(\u2193 to select)":null))),U==="expanded"&&Gf.default.createElement(V,null," "))}var Gf;var x5A=K(()=>{xH();G4$();S5();$I();ySH();N5A();j0();eB();Gf=b(s(),1)});function Y4$(H){if(typeof H==="string")return H;if(typeof H==="number")return String(H);if(!H)return"";if(Array.isArray(H))return H.map(Y4$).join("");if(jD.default.isValidElement(H))return Y4$(H.props.children);return""}function QA({isDisabled:H=!1,hideIndexes:$=!1,visibleOptionCount:A=5,highlightText:L,options:I,defaultValue:D,onCancel:B,onChange:f,onFocus:E,defaultFocusValue:M,layout:G="compact",disableSelection:U=!1,inlineDescriptions:X=!1,onUpFromFirstItem:J,onDownFromLastItem:F,onInputModeToggle:Q,onOpenEditor:W,onImagePaste:P,pastedContents:C,onRemoveImage:Y}){let[Z,q]=jD.useState(!1),[O,j]=jD.useState(0),[u,y]=jD.useState(()=>{let HH=new Map;return I.forEach((BH)=>{if(BH.type==="input"&&BH.initialValue)HH.set(BH.value,BH.initialValue)}),HH}),g=jD.useRef(new Map);jD.useEffect(()=>{for(let HH of I)if(HH.type==="input"&&HH.initialValue!==void 0){let BH=g.current.get(HH.value)??"",WH=u.get(HH.value)??"",wH=HH.initialValue;if(wH!==BH&&WH===BH)y((QH)=>{let TH=new Map(QH);return TH.set(HH.value,wH),TH});g.current.set(HH.value,wH)}},[I,u]);let h=tVI({visibleOptionCount:A,options:I,defaultValue:D,onChange:f,onCancel:B,onFocus:E,focusValue:M});IPI({isDisabled:H,disableSelection:U||($?"numeric":!1),state:h,options:I,isMultiSelect:!1,onUpFromFirstItem:J,onDownFromLastItem:F,onInputModeToggle:Q,inputValues:u,imagesSelected:Z,onEnterImageSelection:()=>{if(C&&Object.values(C).some((HH)=>HH.type==="image")){let HH=Object.values(C).filter((BH)=>BH.type==="image").length;return q(!0),j(HH-1),!0}return!1}});let p={container:()=>({flexDirection:"column"}),highlightedText:()=>({bold:!0})};if(G==="expanded"){let HH=h.options.length.toString().length;return jD.default.createElement(x,{...p.container()},h.visibleOptions.map((BH,WH)=>{let wH=BH.index===h.visibleFromIndex,QH=BH.index===h.visibleToIndex-1,TH=h.visibleToIndex0,IH=h.visibleFromIndex+WH+1,KH=!H&&h.focusedValue===BH.value,MH=h.value===BH.value;if(BH.type==="input"){let e=u.has(BH.value)?u.get(BH.value):BH.initialValue||"";return jD.default.createElement(UFH,{key:String(BH.value),option:BH,isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH,maxIndexWidth:HH,index:IH,inputValue:e,onInputChange:(DH)=>{y((EH)=>{let $H=new Map(EH);return $H.set(BH.value,DH),$H})},onSubmit:(DH)=>{let EH=C&&Object.values(C).some(($H)=>$H.type==="image");if(DH.trim()||EH||BH.allowEmptySubmitToCancel)f?.(BH.value);else B?.()},onExit:B,layout:"expanded",showLabel:X,onOpenEditor:W,resetCursorOnUpdate:BH.resetCursorOnUpdate,onImagePaste:P,pastedContents:C,onRemoveImage:Y,imagesSelected:Z,selectedImageIndex:O,onImagesSelectedChange:q,onSelectedImageIndexChange:j})}let CH=BH.label;if(typeof BH.label==="string"&&L&&BH.label.includes(L)){let e=BH.label,DH=e.indexOf(L);CH=jD.default.createElement(jD.default.Fragment,null,e.slice(0,DH),jD.default.createElement(V,{...p.highlightedText()},L),e.slice(DH+L.length))}let OH=BH.disabled===!0,LH=OH?void 0:MH?"success":KH?"suggestion":void 0;return jD.default.createElement(x,{key:String(BH.value),flexDirection:"column",flexShrink:0},jD.default.createElement(ur,{isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH},jD.default.createElement(V,{dimColor:OH,color:LH},CH)),BH.description&&jD.default.createElement(x,{paddingLeft:2},jD.default.createElement(V,{dimColor:OH||BH.dimDescription!==!1,color:LH},jD.default.createElement(m9,null,BH.description))),jD.default.createElement(V,null," "))}))}if(G==="compact-vertical"){let HH=$?0:h.options.length.toString().length;return jD.default.createElement(x,{...p.container()},h.visibleOptions.map((BH,WH)=>{let wH=BH.index===h.visibleFromIndex,QH=BH.index===h.visibleToIndex-1,TH=h.visibleToIndex0,IH=h.visibleFromIndex+WH+1,KH=!H&&h.focusedValue===BH.value,MH=h.value===BH.value;if(BH.type==="input"){let LH=u.has(BH.value)?u.get(BH.value):BH.initialValue||"";return jD.default.createElement(UFH,{key:String(BH.value),option:BH,isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH,maxIndexWidth:HH,index:IH,inputValue:LH,onInputChange:(e)=>{y((DH)=>{let EH=new Map(DH);return EH.set(BH.value,e),EH})},onSubmit:(e)=>{let DH=C&&Object.values(C).some((EH)=>EH.type==="image");if(e.trim()||DH||BH.allowEmptySubmitToCancel)f?.(BH.value);else B?.()},onExit:B,layout:"compact",showLabel:X,onOpenEditor:W,resetCursorOnUpdate:BH.resetCursorOnUpdate,onImagePaste:P,pastedContents:C,onRemoveImage:Y,imagesSelected:Z,selectedImageIndex:O,onImagesSelectedChange:q,onSelectedImageIndexChange:j})}let CH=BH.label;if(typeof BH.label==="string"&&L&&BH.label.includes(L)){let LH=BH.label,e=LH.indexOf(L);CH=jD.default.createElement(jD.default.Fragment,null,LH.slice(0,e),jD.default.createElement(V,{...p.highlightedText()},L),LH.slice(e+L.length))}let OH=BH.disabled===!0;return jD.default.createElement(x,{key:String(BH.value),flexDirection:"column",flexShrink:0},jD.default.createElement(ur,{isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH},jD.default.createElement(jD.default.Fragment,null,!$&&jD.default.createElement(V,{dimColor:!0},`${IH}.`.padEnd(HH+1)),jD.default.createElement(V,{dimColor:OH,color:OH?void 0:MH?"success":KH?"suggestion":void 0},CH))),BH.description&&jD.default.createElement(x,{paddingLeft:$?2:HH+4},jD.default.createElement(V,{dimColor:OH||BH.dimDescription!==!1,color:OH?void 0:MH?"success":KH?"suggestion":void 0},jD.default.createElement(m9,null,BH.description))))}))}let d=$?0:h.options.length.toString().length,k=h.visibleOptions.some((HH)=>HH.type==="input"),n=!X&&!k&&h.visibleOptions.some((HH)=>HH.description),GH=h.visibleOptions.map((HH,BH)=>{let WH=HH.index===h.visibleFromIndex,wH=HH.index===h.visibleToIndex-1,QH=h.visibleToIndex0,t=h.visibleFromIndex+BH+1,IH=!H&&h.focusedValue===HH.value,KH=h.value===HH.value,MH=HH.disabled===!0,CH=HH.label;if(typeof HH.label==="string"&&L&&HH.label.includes(L)){let OH=HH.label,LH=OH.indexOf(L);CH=jD.default.createElement(jD.default.Fragment,null,OH.slice(0,LH),jD.default.createElement(V,{...p.highlightedText()},L),OH.slice(LH+L.length))}return{option:HH,index:t,label:CH,isFocused:IH,isSelected:KH,isOptionDisabled:MH,shouldShowDownArrow:QH&&wH,shouldShowUpArrow:TH&&WH}});if(n){let HH=Math.max(...GH.map((BH)=>{if(BH.option.type==="input")return 0;let WH=Y4$(BH.option.label),wH=$?0:d+2,QH=BH.isSelected?2:0;return 2+wH+GI(WH)+QH}));return jD.default.createElement(x,{...p.container()},GH.map((BH)=>{if(BH.option.type==="input")return null;let WH=Y4$(BH.option.label),wH=$?0:d+2,QH=BH.isSelected?2:0,TH=2+wH+GI(WH)+QH,t=HH-TH;return jD.default.createElement(x,{key:String(BH.option.value),flexDirection:"row"},jD.default.createElement(x,{flexDirection:"row",flexShrink:0},BH.isFocused?jD.default.createElement(V,{color:"suggestion"},pH.pointer):BH.shouldShowDownArrow?jD.default.createElement(V,{dimColor:!0},pH.arrowDown):BH.shouldShowUpArrow?jD.default.createElement(V,{dimColor:!0},pH.arrowUp):jD.default.createElement(V,null," "),jD.default.createElement(V,null," "),jD.default.createElement(V,{dimColor:BH.isOptionDisabled,color:BH.isOptionDisabled?void 0:BH.isSelected?"success":BH.isFocused?"suggestion":void 0},!$&&jD.default.createElement(V,{dimColor:!0},`${BH.index}.`.padEnd(d+2)),BH.label),BH.isSelected&&jD.default.createElement(V,{color:"success"}," ",pH.tick),t>0&&jD.default.createElement(V,null," ".repeat(t))),jD.default.createElement(x,{flexGrow:1,marginLeft:2},jD.default.createElement(V,{wrap:"wrap",dimColor:BH.isOptionDisabled||BH.option.dimDescription!==!1,color:BH.isOptionDisabled?void 0:BH.isSelected?"success":BH.isFocused?"suggestion":void 0},jD.default.createElement(m9,null,BH.option.description||" "))))}))}return jD.default.createElement(x,{...p.container()},h.visibleOptions.map((HH,BH)=>{if(HH.type==="input"){let OH=u.has(HH.value)?u.get(HH.value):HH.initialValue||"",LH=HH.index===h.visibleFromIndex,e=HH.index===h.visibleToIndex-1,DH=h.visibleToIndex0,$H=h.visibleFromIndex+BH+1,FH=!H&&h.focusedValue===HH.value,YH=h.value===HH.value;return jD.default.createElement(UFH,{key:String(HH.value),option:HH,isFocused:FH,isSelected:YH,shouldShowDownArrow:DH&&e,shouldShowUpArrow:EH&&LH,maxIndexWidth:d,index:$H,inputValue:OH,onInputChange:(qH)=>{y((bH)=>{let hH=new Map(bH);return hH.set(HH.value,qH),hH})},onSubmit:(qH)=>{let bH=C&&Object.values(C).some((hH)=>hH.type==="image");if(qH.trim()||bH||HH.allowEmptySubmitToCancel)f?.(HH.value);else B?.()},onExit:B,layout:"compact",showLabel:X,onOpenEditor:W,resetCursorOnUpdate:HH.resetCursorOnUpdate,onImagePaste:P,pastedContents:C,onRemoveImage:Y,imagesSelected:Z,selectedImageIndex:O,onImagesSelectedChange:q,onSelectedImageIndexChange:j})}let WH=HH.label;if(typeof HH.label==="string"&&L&&HH.label.includes(L)){let OH=HH.label,LH=OH.indexOf(L);WH=jD.default.createElement(jD.default.Fragment,null,OH.slice(0,LH),jD.default.createElement(V,{...p.highlightedText()},L),OH.slice(LH+L.length))}let wH=HH.index===h.visibleFromIndex,QH=HH.index===h.visibleToIndex-1,TH=h.visibleToIndex0,IH=h.visibleFromIndex+BH+1,KH=!H&&h.focusedValue===HH.value,MH=h.value===HH.value,CH=HH.disabled===!0;return jD.default.createElement(ur,{key:String(HH.value),isFocused:KH,isSelected:MH,shouldShowDownArrow:TH&&QH,shouldShowUpArrow:t&&wH},jD.default.createElement(x,{flexDirection:"row",flexShrink:0},!$&&jD.default.createElement(V,{dimColor:!0},`${IH}.`.padEnd(d+2)),jD.default.createElement(V,{dimColor:CH,color:CH?void 0:MH?"success":KH?"suggestion":void 0},WH,X&&HH.description&&jD.default.createElement(V,{dimColor:CH||HH.dimDescription!==!1}," ",HH.description))),!X&&HH.description&&jD.default.createElement(x,{flexShrink:99,marginLeft:2},jD.default.createElement(V,{wrap:"wrap-trim",dimColor:CH||HH.dimDescription!==!1,color:CH?void 0:MH?"success":KH?"suggestion":void 0},jD.default.createElement(m9,null,HH.description))))}))}var jD;var N1=K(()=>{xH();G4$();sVI();DPI();jI();x5A();DJ();jD=b(s(),1)});function C4$({ruleValue:H}){switch(H.toolName){case aD.name:if(H.ruleContent)if(H.ruleContent.endsWith(":*"))return LP.createElement(V,{dimColor:!0},"Any Bash command starting with"," ",LP.createElement(V,{bold:!0},H.ruleContent.slice(0,-2)));else return LP.createElement(V,{dimColor:!0},"The Bash command ",LP.createElement(V,{bold:!0},H.ruleContent));else return LP.createElement(V,{dimColor:!0},"Any Bash command");default:if(!H.ruleContent)return LP.createElement(V,{dimColor:!0},"Any use of the ",LP.createElement(V,{bold:!0},H.toolName)," tool");else return null}}var LP;var S5A=K(()=>{xH();zQ();LP=b(s(),1)});function l99({orientation:H="horizontal",width:$="auto",dividerChar:A,dividerColor:L,dividerDimColor:I=!0,boxProps:D}){let B=H==="vertical",f=A||(B?"\u2502":"\u2500");if(B)return gg.default.createElement(x,{height:"100%",borderStyle:{topLeft:"",top:"",topRight:"",right:f,bottomRight:"",bottom:"",bottomLeft:"",left:""},borderColor:L,borderDimColor:I,borderBottom:!1,borderTop:!1,borderLeft:!1,borderRight:!0,...D});return gg.default.createElement(x,{width:$,borderStyle:{topLeft:"",top:"",topRight:"",right:"",bottomRight:"",bottom:f,bottomLeft:"",left:""},borderColor:L,borderDimColor:I,flexGrow:1,borderBottom:!0,borderTop:!1,borderLeft:!1,borderRight:!1,...D})}function i99({orientation:H="horizontal",title:$,width:A="auto",padding:L=0,titlePadding:I=1,titleColor:D="text",titleDimColor:B=!0,dividerChar:f,dividerColor:E,dividerDimColor:M=!0,boxProps:G}){let U=H==="vertical",J=gg.default.createElement(l99,{orientation:H,dividerChar:f||(U?"\u2502":"\u2500"),dividerColor:E,dividerDimColor:M,boxProps:G});if(U)return J;if(!$)return gg.default.createElement(x,{paddingLeft:L,paddingRight:L},J);return gg.default.createElement(x,{flexDirection:"row",width:A,paddingLeft:L,paddingRight:L,gap:I},J,gg.default.createElement(x,null,gg.default.createElement(V,{color:D,dimColor:B},gg.default.createElement(m9,null,$))),J)}var gg,Uf;var e6=K(()=>{xH();gg=b(s(),1);Uf=i99});function BL({title:H,subtitle:$,children:A,onCancel:L,color:I,borderDimColor:D,hideInputGuide:B,hideBorder:f,inputGuide:E,isCancelActive:M}){return H3.default.createElement(n99,{title:H,subtitle:$,onCancel:L,color:I,borderDimColor:D,hideInputGuide:B,hideBorder:f,inputGuide:E,isCancelActive:M},A)}function n99({title:H,subtitle:$,children:A,onCancel:L,color:I="permission",borderDimColor:D=!0,hideInputGuide:B,hideBorder:f,inputGuide:E,isCancelActive:M=!0}){let G=zB();BA("confirm:no",L,{context:"Confirmation",isActive:M});let U=G.pending?H3.default.createElement(V,null,"Press ",G.keyName," again to exit"):H3.default.createElement(rA,null,H3.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),H3.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}));return H3.default.createElement(H3.default.Fragment,null,H3.default.createElement(x,{flexDirection:"column",paddingBottom:1},!f&&H3.default.createElement(Uf,{dividerColor:I,dividerDimColor:D}),H3.default.createElement(x,{flexDirection:"column",paddingX:f?0:1,gap:1},H3.default.createElement(x,{flexDirection:"column"},H3.default.createElement(V,{bold:!0,color:I},H),$&&H3.default.createElement(V,{dimColor:!0},$)),A)),!B&&H3.default.createElement(x,{paddingX:f?0:1},H3.default.createElement(V,{dimColor:!0,italic:!0},E?E(G):U)))}var H3;var bB=K(()=>{xH();UM();e6();lB();j0();eB();$I();H3=b(s(),1)});function r99(H){return H==="projectSettings"||H==="policySettings"||H==="command"}function w4$(H){return vSH(H)}function _PI(H,$,A){let L=w4$($.source),I=w4$(A.source),D=$.ruleValue.toolName;if(H==="deny")return`Remove the "${D}" deny rule from ${L}, or remove the specific allow rule from ${I}`;return`Remove the "${D}" ask rule from ${L}, or remove the specific allow rule from ${I}`}function a99(H,$,A){let{toolName:L,ruleContent:I}=H.ruleValue;if(I===void 0)return{shadowed:!1};let D=$.find((B)=>B.ruleValue.toolName===L&&B.ruleValue.ruleContent===void 0);if(!D)return{shadowed:!1};if(L===WD&&A.sandboxAutoAllowEnabled){if(!r99(D.source))return{shadowed:!1}}return{shadowed:!0,shadowedBy:D,shadowType:"ask"}}function o99(H,$){let{toolName:A,ruleContent:L}=H.ruleValue;if(L===void 0)return{shadowed:!1};let I=$.find((D)=>D.ruleValue.toolName===A&&D.ruleValue.ruleContent===void 0);if(!I)return{shadowed:!1};return{shadowed:!0,shadowedBy:I,shadowType:"deny"}}function XFH(H,$){let A=[],L=JFH(H),I=FFH(H),D=mg(H);for(let B of L){let f=o99(B,D);if(f.shadowed){let M=w4$(f.shadowedBy.source);A.push({rule:B,reason:`Blocked by "${f.shadowedBy.ruleValue.toolName}" deny rule (from ${M})`,shadowedBy:f.shadowedBy,shadowType:"deny",fix:_PI("deny",f.shadowedBy,B)});continue}let E=a99(B,I,$);if(E.shadowed){let M=w4$(E.shadowedBy.source);A.push({rule:B,reason:`Shadowed by "${E.shadowedBy.ruleValue.toolName}" ask rule (from ${M})`,shadowedBy:E.shadowedBy,shadowType:"ask",fix:_PI("ask",E.shadowedBy,B)})}}return A}var Z4$=K(()=>{XJ()});function j5A(H){switch(H){case"localSettings":return{label:"Project settings (local)",description:`Saved in ${B4H("localSettings")}`,value:H};case"projectSettings":return{label:"Project settings",description:`Checked in at ${B4H("projectSettings")}`,value:H};case"userSettings":return{label:"User settings",description:"Saved in at ~/.claude/settings.json",value:H}}}function CPI({onAddRules:H,onCancel:$,ruleValues:A,ruleBehavior:L,initialContext:I,setToolPermissionContext:D}){let B=KFH.map(j5A),f=YPI.useCallback((M)=>{if(M==="cancel"){$();return}else if(KFH.includes(M)){let G=M,U=OM(I,{type:"addRules",rules:A,behavior:L,destination:G});eR({type:"addRules",rules:A,behavior:L,destination:G}),D(U);let X=A.map((W)=>({ruleValue:W,ruleBehavior:L,source:G})),J=vL.isSandboxingEnabled()&&vL.isAutoAllowBashIfSandboxedEnabled(),Q=XFH(U,{sandboxAutoAllowEnabled:J}).filter((W)=>A.some((P)=>P.toolName===W.rule.ruleValue.toolName&&P.ruleContent===W.rule.ruleValue.ruleContent));H(X,Q.length>0?Q:void 0)}},[H,$,A,L,I,D]),E=`Add ${L} permission rule${A.length===1?"":"s"}`;return f7.createElement(BL,{title:E,onCancel:$,color:"permission"},f7.createElement(x,{flexDirection:"column",paddingX:2},A.map((M)=>f7.createElement(x,{flexDirection:"column",key:X8(M)},f7.createElement(V,{bold:!0},X8(M)),f7.createElement(C4$,{ruleValue:M})))),f7.createElement(x,{flexDirection:"column",marginY:1},f7.createElement(V,null,A.length===1?"Where should this rule be saved?":"Where should these rules be saved?"),f7.createElement(QA,{options:B,onChange:f})))}var f7,YPI,KFH;var q4$=K(()=>{xH();N1();C5();C5();S5A();mL();bB();Z4$();EM();f7=b(s(),1),YPI=b(s(),1);KFH=["localSettings","projectSettings","userSettings"]});function T4$(H,$,A,L,I,D,B){ZPI(H,$,A,L,I,D,B)}function z4$(H,$,A,L,I,D,B){let f=B?.id||`function-hook-${Date.now()}-${Math.random()}`,E={type:"function",id:f,timeout:B?.timeout||5000,callback:I,errorMessage:D};return ZPI(H,$,A,L,E),f}function ZPI(H,$,A,L,I,D,B){H((f)=>{let E=f.sessionHooks[$]||{hooks:{}},M=E.hooks[A]||[],G=M.findIndex((J)=>J.matcher===L&&J.skillRoot===B),U;if(G>=0){U=[...M];let J=U[G];U[G]={matcher:J.matcher,skillRoot:J.skillRoot,hooks:[...J.hooks,{hook:I,onHookSuccess:D}]}}else U=[...M,{matcher:L,skillRoot:B,hooks:[{hook:I,onHookSuccess:D}]}];let X={...E.hooks,[A]:U};return{...f,sessionHooks:{...f.sessionHooks,[$]:{hooks:X}}}}),N(`Added session hook for event ${A} in session ${$}`)}function qPI(H,$,A,L){H((I)=>{let D=I.sessionHooks[$];if(!D)return I;let f=(D.hooks[A]||[]).map((M)=>{let G=M.hooks.filter((U)=>!WFH(U.hook,L));return G.length>0?{...M,hooks:G}:null}).filter((M)=>M!==null),E=f.length>0?{...D.hooks,[A]:f}:{...D.hooks};if(f.length===0)delete E[A];return{...I,sessionHooks:{...I.sessionHooks,[$]:{...D,hooks:E}}}}),N(`Removed session hook for event ${A} in session ${$}`)}function wPI(H){return H.map(($)=>({matcher:$.matcher,skillRoot:$.skillRoot,hooks:$.hooks.map((A)=>A.hook).filter((A)=>A.type!=="function")}))}function N4$(H,$,A){let L=H.sessionHooks[$];if(!L)return new Map;let I=new Map;if(A){let D=L.hooks[A];if(D)I.set(A,wPI(D));return I}for(let D of TR){let B=L.hooks[D];if(B)I.set(D,wPI(B))}return I}function TPI(H,$,A){let L=H.sessionHooks[$];if(!L)return new Map;let I=new Map,D=(B)=>{return B.map((f)=>({matcher:f.matcher,hooks:f.hooks.map((E)=>E.hook).filter((E)=>E.type==="function")})).filter((f)=>f.hooks.length>0)};if(A){let B=L.hooks[A];if(B){let f=D(B);if(f.length>0)I.set(A,f)}return I}for(let B of TR){let f=L.hooks[B];if(f){let E=D(f);if(E.length>0)I.set(B,E)}}return I}function zPI(H,$,A,L,I){let D=H.sessionHooks[$];if(!D)return;let B=D.hooks[A];if(!B)return;for(let f of B)if(f.matcher===L||L===""){let E=f.hooks.find((M)=>WFH(M.hook,I));if(E)return E}return}function QFH(H,$){H((A)=>{let L={...A.sessionHooks};return delete L[$],{...A,sessionHooks:L}}),N(`Cleared all session hooks for session ${$}`)}var pg=K(()=>{KGH();E$();Av()});function WFH(H,$){if(H.type!==$.type)return!1;switch(H.type){case"command":return $.type==="command"&&H.command===$.command;case"prompt":return $.type==="prompt"&&H.prompt===$.prompt;case"agent":return $.type==="agent"&&H.prompt===$.prompt;case"function":return!1}}function IP(H){if("statusMessage"in H&&H.statusMessage)return H.statusMessage;switch(H.type){case"command":return H.command;case"prompt":return H.prompt;case"agent":return H.prompt([]);case"callback":return"callback";case"function":return"function"}}function OPI(H){let $=[];if(ZI("policySettings")?.allowManagedHooksOnly!==!0){let B=["userSettings","projectSettings","localSettings"],f=new Set;for(let E of B){let M=aM(E);if(M){let U=NPI.resolve(M);if(f.has(U))continue;f.add(U)}let G=ZI(E);if(!G?.hooks)continue;for(let[U,X]of Object.entries(G.hooks))for(let J of X)for(let F of J.hooks)$.push({event:U,config:F,matcher:J.matcher,source:E})}}let I=j$(),D=N4$(H,I);for(let[B,f]of D.entries())for(let E of f)for(let M of E.hooks)$.push({event:B,config:M,matcher:E.matcher,source:"sessionHook"});return $}async function xPI(H,$,A="",L="userSettings"){let D=(ZI(L)??{}).hooks??{},B=D[H]??[],f=B.findIndex((U)=>U.matcher===A),E;if(f>=0){E=[...B];let U=E[f];E[f]={matcher:U.matcher,hooks:[...U.hooks,$]}}else E=[...B,{matcher:A,hooks:[$]}];let M={...D,[H]:E},{error:G}=II(L,{hooks:M});if(G)throw Error(G.message);UDH()}async function SPI(H){if(H.source==="pluginHook")throw Error("Plugin hooks cannot be removed through settings. Disable the plugin instead.");if(H.source==="sessionHook")throw Error("Session hooks cannot be removed through settings. They are temporary and will be cleared when the session ends.");let $=ZI(H.source)??{},A=$.hooks??{},I=(A[H.event]??[]).map((f)=>{if(f.matcher===H.matcher){let E=f.hooks.filter((M)=>!WFH(M,H.config));return E.length>0?{...f,hooks:E}:null}return f}).filter((f)=>f!==null),D={...A,[H.event]:I.length>0?I:void 0},B=Object.values(D).some((f)=>f!==void 0);II(H.source,{...$,hooks:B?D:void 0}),UDH()}function jPI(H){switch(H){case"userSettings":return"User settings (~/.claude/settings.json)";case"projectSettings":return"Project settings (.claude/settings.json)";case"localSettings":return"Local settings (.claude/settings.local.json)";case"pluginHook":return"Plugin hooks (~/.claude/plugins/*/hooks/hooks.json)";case"sessionHook":return"Session hooks (in-memory, temporary)";default:return H}}function R5A(H){switch(H){case"userSettings":return"User Settings";case"projectSettings":return"Project Settings";case"localSettings":return"Local Settings";case"pluginHook":return"Plugin Hooks";case"sessionHook":return"Session Hooks";default:return H}}function RPI(H){switch(H){case"userSettings":return"User";case"projectSettings":return"Project";case"localSettings":return"Local";case"pluginHook":return"Plugin";case"sessionHook":return"Session";default:return H}}function yPI(H,$,A){let L=KFH.reduce((I,D,B)=>{return I[D]=B,I},{});return[...H].sort((I,D)=>{let B=$[A]?.[I]||[],f=$[A]?.[D]||[],E=Array.from(new Set(B.map((J)=>J.source))),M=Array.from(new Set(f.map((J)=>J.source))),G=(J)=>J==="pluginHook"?999:L[J],U=Math.min(...E.map(G)),X=Math.min(...M.map(G));if(U!==X)return U-X;return I.localeCompare(D)})}var NPI;var Av=K(()=>{mL();q4$();XDH();pg();g$();NPI=require("path")});function y5A(){let H=ZI("policySettings");if(H?.allowManagedHooksOnly===!0)return H.hooks??{};return VL().hooks??{}}function dg(){return ZI("policySettings")?.allowManagedHooksOnly===!0}function v5A(H){if(!H)return null;let $={},A=Object.keys(H).sort();for(let L of A){let I=H[L];if(!I)continue;let D=[...I].sort((B,f)=>{let E=B.matcher||"",M=f.matcher||"";return E.localeCompare(M)});$[L]=D.map((B)=>({matcher:B.matcher,hooks:[...B.hooks].sort((f,E)=>IP(f).localeCompare(IP(E)))}))}return $}function h5A(){let H=y5A();mr=v5A(H)}function UDH(){E5();let H=y5A();mr=v5A(H)}function vPI(){if(mr===null)return null;let H=v5A(y5A()),$=yH(mr),A=yH(H);if($===A)return null;let L=[],I=new Set(Object.keys(mr||{})),D=new Set(Object.keys(H||{}));for(let B of D)if(!I.has(B))L.push(`Added hooks for event: ${B}`);for(let B of I)if(!D.has(B))L.push(`Removed all hooks for event: ${B}`);for(let B of I)if(D.has(B)){let f=mr?.[B]||[],E=H?.[B]||[];if(yH(f)!==yH(E)){let M=[],G=new Map(f.map((X)=>[X.matcher||"",X])),U=new Map(E.map((X)=>[X.matcher||"",X]));for(let[X]of U)if(!G.has(X))M.push(` - Added matcher: ${X||"(no matcher)"}`);for(let[X]of G)if(!U.has(X))M.push(` - Removed matcher: ${X||"(no matcher)"}`);for(let[X,J]of U)if(G.has(X)){let F=G.get(X);if(yH(F.hooks)!==yH(J.hooks))M.push(` - Modified hooks for matcher: ${X||"(no matcher)"}`)}if(M.length>0)L.push(`Modified hooks for event: ${B}`),L.push(...M);else L.push(`Modified hooks for event: ${B}`)}}return L.length>0?L.join(` `):"Hooks configuration has been modified"}function hPI(){if(mr===null)h5A();return mr}var mr=null;var XDH=K(()=>{mL();Av();g$();Z$()});function O4$(H,$){E5();let A=GB();N(`Settings changed from ${H}, updating app state`);let L=jB$();UDH(),$((I)=>{let D=bPI(I.toolPermissionContext,L);if(D.isBypassPermissionsModeAvailable&&VFH())D=PFH(D);return{...I,settings:A,toolPermissionContext:D}})}var b5A=K(()=>{mL();E$();XJ();_q();cg();XDH()});var kPI=()=>{};function uPI(){return _FH===!0}function e99(){return process.env.CLAUDE_CODE_ENTRYPOINT??"cli"}function x4$(){return{fileStates:new Map,sessionBaselines:new Map,surface:e99(),startingHeadSha:null,promptCount:0,promptCountAtLastCommit:0,permissionPromptCount:0,permissionPromptCountAtLastCommit:0,escapeCount:0,escapeCountAtLastCommit:0}}var t99,_FH=null,s99;var JDH=K(()=>{g$();DL();E$();_$();kPI();B0();aI();t8();j$H();t99=["github.com:anthropics/claude-cli-internal","github.com/anthropics/claude-cli-internal","github.com:anthropics/anthropic","github.com/anthropics/anthropic","github.com:anthropics/apps","github.com/anthropics/apps","github.com:anthropics/terraform-config","github.com/anthropics/terraform-config","github.com:anthropics/hex-export","github.com/anthropics/hex-export","github.com:anthropics/feedback-v2","github.com/anthropics/feedback-v2"];s99=rR(async()=>{if(_FH!==null)return _FH;let H=zL(),$=await asH(H);if(!$)return _FH=!1,!1;return _FH=t99.some((A)=>$.includes(A)),_FH})});class k5A{queue=[];waiters=[];listeners=new Set;_revision=0;get length(){return this.queue.length}get revision(){return this._revision}send(H){this._revision++;let $=this.waiters.findIndex((A)=>A.fn(H));if($!==-1){let A=this.waiters.splice($,1)[0];if(A){A.resolve(H),this.notify();return}}this.queue.push(H),this.notify()}poll(H=()=>!0){let $=this.queue.findIndex(H);if($===-1)return;return this.queue.splice($,1)[0]}receive(H=()=>!0){let $=this.queue.findIndex(H);if($!==-1){let A=this.queue.splice($,1)[0];if(A)return this.notify(),Promise.resolve(A)}return new Promise((A)=>{this.waiters.push({fn:H,resolve:A})})}subscribe(H){return this.listeners.add(H),()=>{this.listeners.delete(H)}}notify(){for(let H of this.listeners)H()}}function mPI({children:H}){let $=pr.useMemo(()=>new k5A,[]);return pr.default.createElement(gPI.Provider,{value:$},H)}function pPI(){let H=pr.useContext(gPI);if(!H)throw Error("useMailbox must be used within a MailboxProvider");return H}var pr,gPI;var u5A=K(()=>{pr=b(s(),1),gPI=pr.createContext(void 0)});function lg(H,$){if(process.env.MAX_THINKING_TOKENS){let I=parseInt(process.env.MAX_THINKING_TOKENS,10);if(I>0)c("tengu_thinking",{provider:SR(),tokenCount:I});return I}let L=H.filter((I)=>I.type==="user"&&!I.isMeta).map(H19).filter((I)=>I!==void 0);if($!==void 0)return Math.max(...L,$);if(L.length>0)return Math.max(...L);return}function H19(H){if(H.isMeta)return 0;if(H.thinkingMetadata){let{maxThinkingTokens:$}=H.thinkingMetadata;if($!==void 0&&$>0)c("tengu_thinking",{provider:SR(),tokenCount:$});return $}return 0}function dPI(H){let $=[],A=H.matchAll($19);for(let L of A)if(L.index!==void 0)$.push({word:L[0],start:L.index,end:L.index+L[0].length});return $}function A19(H){let $=H.toLowerCase(),A=sI();if(A==="foundry"||A==="firstParty")return!$.includes("claude-3-");return $.includes("sonnet-4")||$.includes("opus-4")}function cPI(H){return H.toLowerCase().includes("opus-4-6")}function S4$(){if(process.env.MAX_THINKING_TOKENS)return parseInt(process.env.MAX_THINKING_TOKENS,10)>0;let{settings:H}=ZAH();if(H.alwaysThinkingEnabled===!1)return!1;return A19(X1())}var $19;var ig=K(()=>{z$();oM();mL();aI();$19=/\bultrathink\b/gi});function g5A(){return!1}async function L19(H,$,A){if(!g5A())return await A();let L=hSH.createHash("sha1").update(yH(H)).digest("hex").slice(0,12),I=dr.join(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT??C$(),`fixtures/${$}-${L}.json`);if(zH().existsSync(I))return DA(zH().readFileSync(I,{encoding:"utf8"}));if(OA.isCI)throw Error(`Fixture missing: ${I}. Re-run npm test locally, then commit the result.`);let D=await A();if(!zH().existsSync(dr.dirname(I)))zH().mkdirSync(dr.dirname(I));return iL(I,yH(D,null,2),{encoding:"utf8",flush:!1}),D}async function R4$(H,$){if(!g5A())return await $();let A=JJ(H.filter((B)=>{if(B.type!=="user")return!0;if(B.isMeta)return!1;return!0})),L=D19(A.map((B)=>B.message.content),iPI),I=dr.join(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT??C$(),`fixtures/${L.map((B)=>hSH.createHash("sha1").update(yH(B)).digest("hex").slice(0,6)).join("-")}.json`);if(zH().existsSync(I)){let B=DA(zH().readFileSync(I,{encoding:"utf8"}));return B.output.forEach(I19),B.output.map((f,E)=>lPI(f,f19,E,hSH.randomUUID()))}if(OA.isCI)throw Error(`Anthropic API fixture missing: ${I}. Re-run npm test locally, then commit the result. Input messages: `);if($)A.pop();else A.push(A.pop().slice(0,-1));return A}var P_I;var Y_I=K(()=>{m4$();P_I={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0}});var qFH=K(()=>{A_I();f_I();m4$();U_I();J_I();K_I();W_I();V_I();Y_I()});function C19(){let $="";for(let A=0;A<4;A++)$+="abcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(Math.random()*36)];return`/tmp/claude/cache-break-${$}.diff`}function z19(H){return H.includes("haiku")}function l4$(H,$){if($)return $;if(H==="compact")return"repl_main_thread";for(let A of w19)if(H.startsWith(A))return H;return null}function C_I(H){return H.map(($)=>{if(!("cache_control"in $))return $;let{cache_control:A,...L}=$;return L})}function w_I(H){let $=yH(H);if(typeof Bun<"u"){let L=Bun.hash($);return typeof L==="bigint"?Number(L&0xffffffffn):L}let A=0;for(let L=0;L<$.length;L++)A=(A<<5)-A+$.charCodeAt(L)|0;return A}function N19(H){let $=0;for(let A of H)$+=A.text.length;return $}function O19(H,$,A){let L=H.map((D)=>D.text).join(` `}function Z_I(H,$,A,L,I){try{let D=l4$(A,I);if(!D)return;let B=C_I(H),f=C_I($),E=w_I(B),M=w_I(f),G=$.map((P)=>("name"in P)?P.name:"unknown"),U=N19(H),X=O19(H,$,L),J=TFH.get(D);if(!J){TFH.set(D,{systemHash:E,toolsHash:M,toolNames:G,systemCharCount:U,model:L,callCount:1,pendingChanges:null,prevCacheReadTokens:null,microcompacted:!1,diffableContent:X});return}J.callCount++;let F=E!==J.systemHash,Q=M!==J.toolsHash,W=L!==J.model;if(F||Q||W){let P=new Set(J.toolNames),C=new Set(G);J.pendingChanges={systemPromptChanged:F,toolSchemasChanged:Q,modelChanged:W,addedToolCount:G.filter((Y)=>!P.has(Y)).length,removedToolCount:J.toolNames.filter((Y)=>!C.has(Y)).length,systemCharDelta:U-J.systemCharCount,previousModel:J.model,newModel:L,prevDiffableContent:J.diffableContent}}else J.pendingChanges=null;J.systemHash=E,J.toolsHash=M,J.toolNames=G,J.systemCharCount=U,J.model=L,J.diffableContent=X}catch(D){r(D instanceof Error?D:Error(String(D)))}}function q_I(H,$,A,L,I){try{let D=l4$(H,I);if(!D)return;let B=TFH.get(D);if(!B)return;if(z19(B.model))return;let f=B.prevCacheReadTokens;B.prevCacheReadTokens=$;let E=L.findLast((Y)=>Y.type==="assistant"),M=E?Date.now()-new Date(E.timestamp).getTime():null;if(f===null)return;let G=B.pendingChanges,U=f-$;if($>=f*0.95||U0?` (+${Y} chars)`:` (${Y} chars)`;X.push(`system prompt changed${Z}`)}if(G.toolSchemasChanged){let Y=G.addedToolCount>0||G.removedToolCount>0?` (+${G.addedToolCount}/-${G.removedToolCount} tools)`:" (tool prompt/schema changed, same tool set)";X.push(`tools changed${Y}`)}}let F=M!==null&&M>q19,Q=M!==null&&M>T19,P=`[PROMPT CACHE BREAK] ${X.length>0?X.join(", "):"unknown cause"} [source=${H}, call #${B.callCount}, cache read: ${f} \u2192 ${$}, creation: ${A}]`;N(P,{level:"warn"}),c("tengu_prompt_cache_break",{systemPromptChanged:G?.systemPromptChanged??!1,toolSchemasChanged:G?.toolSchemasChanged??!1,modelChanged:G?.modelChanged??!1,microcompacted:J,addedToolCount:G?.addedToolCount??0,removedToolCount:G?.removedToolCount??0,callNumber:B.callCount,prevCacheReadTokens:f,cacheReadTokens:$,cacheCreationTokens:A,timeSinceLastAssistantMsg:M??-1,lastAssistantMsgOver5minAgo:F,lastAssistantMsgOver1hAgo:Q});let C;if(G?.prevDiffableContent)C=x19(G.prevDiffableContent,B.diffableContent);Tj$(P,C),B.pendingChanges=null}catch(D){r(D instanceof Error?D:Error(String(D)))}}function T_I(H,$){let A=l4$(H,$),L=A?TFH.get(A):void 0;if(L)L.microcompacted=!0}function e5A(H,$){let A=l4$(H,$),L=A?TFH.get(A):void 0;if(L)L.prevCacheReadTokens=null}function z_I(){TFH.clear()}function x19(H,$){try{let A=C19();c4$.mkdirSync("/tmp/claude",{recursive:!0});let L=s5A("prompt-state",H,$,"before","after");return c4$.writeFileSync(A,L),A}catch{return}}var c4$,TFH,w19,Z19=2000,q19=300000,T19=3600000;var gSH=K(()=>{E$();z$();g$();Z$();_$();qFH();c4$=require("fs");TFH=new Map,w19=["repl_main_thread","sdk","agent:custom","agent:default","agent:builtin"]});function N_I(H){let $=`Your task is to create a detailed summary of the RECENT portion of the conversation \u2014 the messages that follow earlier retained context. The earlier messages are being kept intact and do NOT need to be summarized. Focus your summary on what was discussed, learned, and accomplished in the recent messages only. Please continue the conversation from where we left it off without asking the user any further questions. Continue with the last task that you were asked to work on.`;return D}function j19(H,$){return H?.includes("_staging_")===!0||$?.includes("staging")===!0}function R19(H,$){return j19(H,$)?"https://staging.claude.ai":"https://claude.ai"}function i4$(H,$){return`${R19(H,$)}/code/${H}`}var O_I="https://claude.com/claude-code";function QL(){let H=x_I.useContext(r5H);if(!H)throw Error("useTerminalSize must be used within an Ink App component");return H}var x_I;var OB=K(()=>{y1$();x_I=b(s(),1)});function S_I({children:H,lock:$="always"}){let[A,{isVisible:L}]=vg(),{rows:I}=QL(),D=XT.useRef(null),B=XT.useRef(0),[f,E]=XT.useState(0),M=XT.useCallback((U)=>{A(U)},[A]),G=$==="always"||!L;return XT.useLayoutEffect(()=>{if(!D.current)return;let{height:U}=ZSH(D.current);if(U>B.current)B.current=Math.min(U,I),E(B.current)}),XT.default.createElement(x,{minHeight:G?f:void 0,ref:M},XT.default.createElement(x,{ref:D,flexDirection:"column"},H))}var XT;var j_I=K(()=>{xH();OB();dU$();XT=b(s(),1)});function HA({children:H,height:$}){if(R_I.useContext(y_I))return H;let L=Lw.createElement(y19,null,Lw.createElement(x,{flexDirection:"row",height:$,overflowY:"hidden"},Lw.createElement(V,null," ","\u23BF \xA0"),H));if($!==void 0)return L;return Lw.createElement(S_I,{lock:"offscreen"},L)}function y19({children:H}){return Lw.createElement(y_I.Provider,{value:!0},H)}var Lw,R_I,y_I;var iB=K(()=>{xH();j_I();Lw=b(s(),1),R_I=b(s(),1);y_I=Lw.createContext(!1)});function Iv(){return Lv.createElement(Lv.Fragment,null,Lv.createElement(V,{dimColor:!0},"Interrupted "),Lv.createElement(V,{dimColor:!0},"\xB7 What should Claude do instead?"))}var Lv;var zFH=K(()=>{xH();Lv=b(s(),1)});function L8(){return pSH.createElement(HA,{height:1},pSH.createElement(Iv,null))}var pSH;var _F=K(()=>{iB();zFH();pSH=b(s(),1)});function dSH({children:H}){return FDH.default.createElement(v_I.Provider,{value:!0},H)}function Bx(){let H=FDH.useContext(v_I),$=C0("app:toggleTranscript","Global","ctrl+o");if(H)return null;return FDH.default.createElement(V,{dimColor:!0},FDH.default.createElement(s$,{shortcut:$,action:"expand",parens:!0}))}function h_I(){let H=CQ("app:toggleTranscript","Global","ctrl+o");return oH.dim(`(${H} to expand)`)}var FDH,v_I;var lr=K(()=>{xH();r0();lB();FG();FDH=b(s(),1),v_I=FDH.default.createContext(!1)});function LXA(H,$){if(A$(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))return;let A=$?`${H} ${$}`:"";process.stdout.write(`\x1B]0;${A}\x07`)}function cSH(H){if(r4$=H,!NFH)LXA(AXA,H)}function u_I(H){k_I=!0,cSH(H)}function g_I(){cSH("Claude Code")}function m_I(){return r4$}function p_I(){if(NFH)return;n4$=0,NFH=setInterval(()=>{n4$=(n4$+1)%b_I.length,LXA(b_I[n4$]??AXA,r4$)},v19)}function d_I(){if(NFH)clearInterval(NFH),NFH=null}function c_I(){if(IXA=!0,ANH()!=="blurred")p_I()}function lSH(){IXA=!1,d_I(),LXA(AXA,r4$)}async function l_I(H){if(A$(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))return;if(k_I)return;if(H.startsWith(`<${hMH}>`))return;try{let A=(await OQ({systemPrompt:["Analyze if this message indicates a new conversation topic. If it does, extract a 2-3 word title that captures the new topic. Format your response as a JSON object with two fields: 'isNewTopic' (boolean) and 'title' (string, or null if isNewTopic is false)."],userPrompt:H,outputFormat:{type:"json_schema",schema:{type:"object",properties:{isNewTopic:{type:"boolean"},title:{anyOf:[{type:"string"},{type:"null"}]}},required:["isNewTopic","title"],additionalProperties:!1}},signal:new AbortController().signal,options:{querySource:"terminal_update_title",agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content.filter((I)=>I.type==="text").map((I)=>I.text).join(""),L=q1(A);if(L&&typeof L==="object"&&"isNewTopic"in L&&"title"in L){if(L.isNewTopic&&L.title)cSH(L.title)}}catch($){r($)}}function ir(){return new Promise((H)=>{process.stdout.write(VNH(),()=>{H()})})}function b19(H,$){let A=H.split(` `).filter(Boolean).map((I)=>parseInt(I,10)).filter((I)=>!isNaN(I))}function SZI(H){try{let A=`ps -o command= -p ${String(H)}`,L=vN(A,{timeout:1000});return L?L.trim():null}catch{return null}}async function jZI(H,$=10){let A=`currentpid=${String(H)}; for i in $(seq 1 ${$}); do cmd=$(ps -o command= -p $currentpid 2>/dev/null); if [ -n "$cmd" ]; then printf '%s\\0' "$cmd"; fi; ppid=$(ps -o ppid= -p $currentpid 2>/dev/null | tr -d ' '); if [ -z "$ppid" ] || [ "$ppid" = "0" ] || [ "$ppid" = "1" ]; then break; fi; currentpid=$ppid; done`,L=await pD("sh",["-c",A],{timeout:3000});if(L.code!==0||!L.stdout?.trim())return[];return L.stdout.split("\x00").filter(Boolean)}var TX$=K(()=>{B0()});function m59(H){let $=ijH.homedir(),A=[],L=yZI[H.toLowerCase()];if(!L)return A;let I=process.env.APPDATA||SQ.join($,"AppData","Roaming"),D=process.env.LOCALAPPDATA||SQ.join($,"AppData","Local");switch(ijH.platform()){case"darwin":if(A.push(SQ.join($,"Library","Application Support","JetBrains"),SQ.join($,"Library","Application Support")),H.toLowerCase()==="androidstudio")A.push(SQ.join($,"Library","Application Support","Google"));break;case"win32":if(A.push(SQ.join(I,"JetBrains"),SQ.join(D,"JetBrains"),SQ.join(I)),H.toLowerCase()==="androidstudio")A.push(SQ.join(D,"Google"));break;case"linux":A.push(SQ.join($,".config","JetBrains"),SQ.join($,".local","share","JetBrains"));for(let B of L)A.push(SQ.join($,"."+B));if(H.toLowerCase()==="androidstudio")A.push(SQ.join($,".config","Google"));break;default:break}return A}function p59(H){let $=[],A=zH(),L=m59(H),I=yZI[H.toLowerCase()];if(!I)return $;for(let D of L){if(!A.existsSync(D))continue;for(let B of I)try{let f=new RegExp("^"+B+".*$"),E=A.readdirSync(D).filter((M)=>f.test(M.name)&&A.statSync(SQ.join(D,M.name)).isDirectory()).map((M)=>SQ.join(D,M.name));for(let M of E){let G=ijH.platform()==="linux"?M:SQ.join(M,"plugins");if(A.existsSync(G))$.push(G)}}catch{continue}}return $.filter((D,B)=>$.indexOf(D)===B)}function VKA(H){let $=p59(H);for(let A of $){let L=SQ.join(A,g59);if(zH().existsSync(L))return!0}return!1}function vZI(H,$=!1){if($)RZI.cache.delete(H);return RZI(H)}var SQ,ijH,g59="claude-code-jetbrains-plugin",yZI,RZI;var PKA=K(()=>{DL();tD();SQ=b(require("path")),ijH=b(require("os")),yZI={pycharm:["PyCharm"],intellij:["IntelliJIdea","IdeaIC"],webstorm:["WebStorm"],phpstorm:["PhpStorm"],rubymine:["RubyMine"],clion:["CLion"],goland:["GoLand"],rider:["Rider"],datagrip:["DataGrip"],appcode:["AppCode"],dataspell:["DataSpell"],aqua:["Aqua"],gateway:["Gateway"],fleet:["Fleet"],androidstudio:["AndroidStudio"]};RZI=o$(VKA)});async function hZI(){if(JKH!==void 0)return JKH;try{let H=await jZI(process.pid,10);for(let $ of H){let A=$.toLowerCase();for(let L of ab$)if(A.includes(L))return JKH=L,L}}catch{}return JKH=null,null}async function n59(){if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(OA.platform!=="darwin")return await hZI()||"pycharm"}return OA.terminal}function r59(){if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(OA.platform!=="darwin"){if(JKH!==void 0)return JKH||"pycharm";return"pycharm"}}return OA.terminal}async function _KA(){if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")await hZI()}var c59,l59=()=>{return process.env.CLAUDE_CODE_BUBBLEWRAP==="1"},i59,JKH,YY;var Ma=K(()=>{B0();TX$();tD();DL();Z1();c59=o$(async()=>{let{code:H}=await jA("test",["-f","/.dockerenv"]);if(H!==0)return!1;return!0}),i59=o$(()=>{let H="x86_64";return zH().existsSync(`/lib/libc.musl-${H}.so.1`)});YY={...OA,terminal:r59(),getIsDocker:c59,getIsBubblewrapSandbox:l59,isMuslEnvironment:i59,getTerminalWithJetBrainsDetectionAsync:n59,initJetBrainsDetection:_KA}});function bZI({onDone:H,installationStatus:$}){a59(),bI({"confirm:yes":H,"confirm:no":H},{context:"Confirmation"});let A=$?.ideType??FKH(),L=Wx(A),I=PX(A),D=$?.installedVersion,B=L?"plugin":"extension",f=OA.platform==="darwin"?"Cmd+Option+K":"Ctrl+Alt+K";return KJ.default.createElement(KJ.default.Fragment,null,KJ.default.createElement(BL,{title:KJ.default.createElement(KJ.default.Fragment,null,KJ.default.createElement(V,{color:"claude"},"\u273B "),KJ.default.createElement(V,null,"Welcome to Claude Code for ",I)),subtitle:D?`installed ${B} v${D}`:void 0,color:"ide",onCancel:H,hideInputGuide:!0},KJ.default.createElement(x,{flexDirection:"column",gap:1},KJ.default.createElement(V,null,"\u2022 Claude has context of ",KJ.default.createElement(V,{color:"suggestion"},"\u29C9 open files")," ","and ",KJ.default.createElement(V,{color:"suggestion"},"\u29C9 selected lines")),KJ.default.createElement(V,null,"\u2022 Review Claude Code's changes"," ",KJ.default.createElement(V,{color:"diffAddedWord"},"+11")," ",KJ.default.createElement(V,{color:"diffRemovedWord"},"-22")," in the comfort of your IDE"),KJ.default.createElement(V,null,"\u2022 Cmd+Esc",KJ.default.createElement(V,{dimColor:!0}," for Quick Launch")),KJ.default.createElement(V,null,"\u2022 ",f,KJ.default.createElement(V,{dimColor:!0}," to reference files or lines in your input")))),KJ.default.createElement(x,{paddingX:1},KJ.default.createElement(V,{dimColor:!0,italic:!0},"Press Enter to continue")))}function zX$(){let H=M$(),$=YY.terminal||"unknown";return H.hasIdeOnboardingBeenShown?.[$]===!0}function a59(){if(zX$())return;let H=YY.terminal||"unknown";AA(($)=>({...$,hasIdeOnboardingBeenShown:{...$.hasIdeOnboardingBeenShown,[H]:!0}}))}var KJ;var YKA=K(()=>{xH();nU();Z1();$I();vA();Ma();bB();KJ=b(s(),1)});class KKH{wslDistroName;constructor(H){this.wslDistroName=H}toLocalPath(H){if(!H)return H;if(this.wslDistroName){let $=H.match(/^\\\\wsl(?:\.localhost|\$)\\([^\\]+)(.*)$/);if($&&$[1]!==this.wslDistroName)return H}try{return CKA.execFileSync("wslpath",["-u",H],{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim()}catch{return H.replace(/\\/g,"/").replace(/^([A-Z]):/i,($,A)=>`/mnt/${A.toLowerCase()}`)}}toIDEPath(H){if(!H)return H;try{return CKA.execFileSync("wslpath",["-w",H],{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim()}catch{return H}}}function kZI(H,$){let A=H.match(/^\\\\wsl(?:\.localhost|\$)\\([^\\]+)(.*)$/);if(A)return A[1]===$;return!0}var CKA;var wKA=K(()=>{CKA=require("child_process")});function iZI(H){try{return process.kill(H,0),!0}catch{return!1}}async function o59(H){if(!iZI(H))return!1;if(!ZF())return!0;if(process.ppid===H)return!0;return(await xZI(process.ppid,10)).includes(H)}function OX$(H){if(!H)return!1;let $=QKH[H];return $&&$.ideKind==="vscode"}function Wx(H){if(!H)return!1;let $=QKH[H];return $&&$.ideKind==="jetbrains"}function FKH(){if(!ZF())return null;return OA.terminal}function xX$(){try{return t59().flatMap((A)=>{try{return zH().readdirSync(A).filter((L)=>L.name.endsWith(".lock")).map((L)=>{let I=B3.join(A,L.name);return{path:I,mtime:zH().statSync(I).mtime}})}catch(L){return r(L),[]}}).sort((A,L)=>L.mtime.getTime()-A.mtime.getTime()).map((A)=>A.path)}catch(H){return r(H),[]}}function nZI(H){try{let $=zH().readFileSync(H,{encoding:"utf-8"}),A=[],L,I,D=!1,B=!1,f;try{let G=DA($);if(G.workspaceFolders)A=G.workspaceFolders;L=G.pid,I=G.ideName,D=G.transport==="ws",B=G.runningInWindows===!0,f=G.authToken}catch(G){A=$.split(` `).map((U)=>U.trim())}let E=H.split(B3.sep).pop();if(!E)return null;let M=E.replace(".lock","");return{workspaceFolders:A,port:parseInt(M),pid:L,ideName:I,useWebSocket:D,runningInWindows:B,authToken:f}}catch($){return r($),null}}async function ZKA(H,$,A=500){try{return new Promise((L)=>{let I=lZI.createConnection({host:H,port:$,timeout:A});I.on("connect",()=>{I.destroy(),L(!0)}),I.on("error",()=>{L(!1)}),I.on("timeout",()=>{I.destroy(),L(!1)})})}catch(L){return!1}}function t59(){let H=[],$=zH(),A=oA(),L=B3.join(UL(),"ide");if($.existsSync(L))H.push(L);if(A!=="wsl")return H;let I=process.env.USERPROFILE;if(!I)try{let D=vN("powershell.exe -Command '$env:USERPROFILE'");if(D)I=D.trim()}catch{N("Unable to get Windows USERPROFILE via PowerShell - IDE detection may be incomplete")}if(I){let B=new KKH(process.env.WSL_DISTRO_NAME).toLocalPath(I),f=B3.resolve(B,".claude","ide");if($.existsSync(f))H.push(f)}try{if($.existsSync("/mnt/c/Users")){let B=$.readdirSync("/mnt/c/Users");for(let f of B){if(f.name==="Public"||f.name==="Default"||f.name==="Default User"||f.name==="All Users")continue;let E=B3.join("/mnt/c/Users",f.name,".claude","ide");if($.existsSync(E))H.push(E)}}}catch(D){r(D instanceof Error?D:Error(String(D)))}return H}async function s59(){try{let H=xX$();for(let $ of H){let A=nZI($);if(!A){try{zH().unlinkSync($)}catch(D){r(D)}continue}let L=await AqI(A.runningInWindows,A.port),I=!1;if(A.pid){if(!iZI(A.pid)){if(oA()!=="wsl")I=!0;else if(!await ZKA(L,A.port))I=!0}}else if(!await ZKA(L,A.port))I=!0;if(I)try{zH().unlinkSync($)}catch(D){r(D)}}}catch(H){r(H)}}async function HX9(H){try{let $=await AX9(H);if(c("tengu_ext_installed",{}),!M$().diffTool)AA((L)=>({...L,diffTool:"auto"}));return{installed:!0,error:null,installedVersion:$,ideType:H}}catch($){c("tengu_ext_install_error",{});let A=$ instanceof Error?$.message:String($);return r($),{installed:!1,error:A,installedVersion:null,ideType:H}}}async function uZI(){if(NX$)NX$.abort();NX$=nD();let H=NX$.signal;await s59();let $=Date.now();while(Date.now()-$<30000&&!H.aborted){let A=await ajH(!1);if(H.aborted)return null;if(A.length===1)return A[0];await new Promise((L)=>setTimeout(L,1000))}return null}async function ajH(H){let $=[];try{let A=process.env.CLAUDE_CODE_SSE_PORT,L=A?parseInt(A):null,I=zL(),D=xX$();for(let B of D){let f=nZI(B);if(!f)continue;if(oA()!=="wsl"&&ZF()){if(!(f.pid?await o59(f.pid):!1))continue}let E=!1;if(process.env.CLAUDE_CODE_IDE_SKIP_VALID_CHECK==="true")E=!0;else if(f.port===L)E=!0;else E=f.workspaceFolders.some((X)=>{if(!X)return!1;let J=X;if(oA()==="wsl"&&f.runningInWindows&&process.env.WSL_DISTRO_NAME){if(!kZI(X,process.env.WSL_DISTRO_NAME))return!1;let Q=B3.resolve(J);if(I===Q||I.startsWith(Q+B3.sep))return!0;J=new KKH(process.env.WSL_DISTRO_NAME).toLocalPath(X)}let F=B3.resolve(J);if(oA()==="windows"){let Q=I.replace(/^[a-zA-Z]:/,(P)=>P.toUpperCase()),W=F.replace(/^[a-zA-Z]:/,(P)=>P.toUpperCase());return Q===W||Q.startsWith(W+B3.sep)}return I===F||I.startsWith(F+B3.sep)});if(!E&&!H)continue;let M=f.ideName??(ZF()?PX(YY.terminal):"IDE"),G=await AqI(f.runningInWindows,f.port),U;if(f.useWebSocket)U=`ws://${G}:${f.port}`;else U=`http://${G}:${f.port}/sse`;$.push({url:U,name:M,workspaceFolders:f.workspaceFolders,port:f.port,isValid:E,authToken:f.authToken,ideRunningInWindows:f.runningInWindows})}if(!H&&L){let B=$.filter((f)=>f.isValid&&f.port===L);if(B.length===1)return B}}catch(A){r(A)}return $}async function rZI(H){await H.notification({method:"ide_connected",params:{pid:process.pid}})}function SX$(H){return H.some(($)=>$.type==="connected"&&$.name==="ide")}async function gZI(H){if(OX$(H)){let $=aZI(H);if($)try{if((await pD($,["--list-extensions"],{env:TKA()})).stdout?.includes($X9))return!0}catch{}}else if(Wx(H))return VKA(H);return!1}async function AX9(H){if(OX$(H)){let $=aZI(H);if($){let A=await LX9($);if(!A||dZI.lt(A,mZI())){await new Promise((I)=>{setTimeout(I,500)});let L=await pD($,["--force","--install-extension","anthropic.claude-code"],{env:TKA()});if(L.code!==0)throw Error(`${L.code}: ${L.error} ${L.stderr}`);A=mZI()}return A}}return null}function TKA(){if(oA()==="linux")return{...process.env,DISPLAY:""};return}function mZI(){return{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}async function LX9(H){let{stdout:$}=await jA(H,["--list-extensions","--show-versions"],{env:TKA()}),A=$?.split(` `)||[];for(let L of A){let[I,D]=L.split("@");if(I==="anthropic.claude-code"&&D)return D}return null}function IX9(){try{if(oA()!=="macos")return null;let $=process.ppid;for(let A=0;A<10;A++){if(!$||$===0||$===1)break;let L=vN(`ps -o command= -p ${$}`)?.trim();if(L){let D={"Visual Studio Code.app":"code","Cursor.app":"cursor","Windsurf.app":"windsurf","Visual Studio Code - Insiders.app":"code","VSCodium.app":"codium"},B="/Contents/MacOS/Electron";for(let[f,E]of Object.entries(D)){let M=L.indexOf(f+"/Contents/MacOS/Electron");if(M!==-1){let G=M+f.length;return L.substring(0,G)+"/Contents/Resources/app/bin/"+E}}}let I=vN(`ps -o ppid= -p ${$}`)?.trim();if(!I)break;$=parseInt(I.trim())}return null}catch{return null}}function aZI(H){let $=IX9();if($){if(zH().existsSync($))return $}switch(H){case"vscode":return"code";case"cursor":return"cursor";case"windsurf":return"windsurf";default:break}return null}async function oZI(){return(await jA("cursor",["--version"])).code===0}async function tZI(){return(await jA("windsurf",["--version"])).code===0}async function sZI(){let H=await jA("code",["--help"]);return H.code===0&&Boolean(H.stdout?.includes("Visual Studio Code"))}async function DX9(){let H=[];try{let $=oA();if($==="macos"){let L=(await fE('ps aux | grep -E "Visual Studio Code|Code Helper|Cursor Helper|Windsurf Helper|IntelliJ IDEA|PyCharm|WebStorm|PhpStorm|RubyMine|CLion|GoLand|Rider|DataGrip|AppCode|DataSpell|Aqua|Gateway|Fleet|Android Studio" | grep -v grep',{shell:!0,reject:!1})).stdout??"";for(let[I,D]of Object.entries(QKH))for(let B of D.processKeywordsMac)if(L.includes(B)){H.push(I);break}}else if($==="windows"){let I=((await fE('tasklist | findstr /I "Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe"',{shell:!0,reject:!1})).stdout??"").toLowerCase();for(let[D,B]of Object.entries(QKH))for(let f of B.processKeywordsWindows)if(I.includes(f.toLowerCase())){H.push(D);break}}else if($==="linux"){let I=((await fE('ps aux | grep -E "code|cursor|windsurf|idea|pycharm|webstorm|phpstorm|rubymine|clion|goland|rider|datagrip|dataspell|aqua|gateway|fleet|android-studio" | grep -v grep',{shell:!0,reject:!1})).stdout??"").toLowerCase();for(let[D,B]of Object.entries(QKH))for(let f of B.processKeywordsLinux)if(I.includes(f)){if(D!=="vscode"){H.push(D);break}else if(!I.includes("cursor")&&!I.includes("appcode")){H.push(D);break}}}}catch($){r($)}return H}async function zKA(){let H=await DX9();return qKA=H,H}async function eZI(){if(qKA===null)return zKA();return qKA}function jX$(H){let $=H.find((A)=>A.type==="connected"&&A.name==="ide");return NKA($)}function NKA(H){let $=H?.config;return $?.type==="sse-ide"||$?.type==="ws-ide"?$.ideName:ZF()?PX(YY.terminal):null}function PX(H){if(!H)return"IDE";let $=QKH[H];if($)return $.displayName;let A=pZI[H.toLowerCase().trim()];if(A)return A;let L=H.split(" ")[0],I=L?B3.basename(L).toLowerCase():null;if(I){let D=pZI[I];if(D)return D;return Fk(I)}return Fk(H)}function CY(H){if(!H)return;let $=H.find((A)=>A.type==="connected"&&A.name==="ide");return $?.type==="connected"?$:void 0}async function HqI(H){try{await Vx("closeAllDiffTabs",{},H)}catch($){}}async function $qI(H,$,A,L){uZI().then(H);let I=M$().autoInstallIdeExtension??!0;if(process.env.CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL!=="true"&&I){let D=$??FKH();if(D){if(OX$(D))gZI(D).then(async(B)=>{HX9(D).catch((f)=>{return{installed:!1,error:f.message||"Installation failed",installedVersion:null,ideType:D}}).then((f)=>{if(L(f),f?.installed)uZI().then(H);if(!B&&f?.installed===!0&&!zX$())A()})});else if(Wx(D)&&!zX$())gZI(D).then(async(B)=>{if(B)A()})}}}var dZI,B3,cZI,lZI,QKH,njH,rjH,ZF,e59,YBE,NX$=null,$X9="anthropic.claude-code",qKA=null,pZI,AqI;var nU=K(()=>{Z1();NA();TX$();B0();O_();vA();z$();eYH();tD();g$();DL();_$();Z9();f3();PKA();YKA();wKA();E$();eE();Ma();Z$();dZI=b(OO(),1),B3=require("path"),cZI=require("url"),lZI=require("net");QKH={cursor:{ideKind:"vscode",displayName:"Cursor",processKeywordsMac:["Cursor Helper","Cursor.app"],processKeywordsWindows:["cursor.exe"],processKeywordsLinux:["cursor"]},windsurf:{ideKind:"vscode",displayName:"Windsurf",processKeywordsMac:["Windsurf Helper","Windsurf.app"],processKeywordsWindows:["windsurf.exe"],processKeywordsLinux:["windsurf"]},vscode:{ideKind:"vscode",displayName:"VS Code",processKeywordsMac:["Visual Studio Code","Code Helper"],processKeywordsWindows:["code.exe"],processKeywordsLinux:["code"]},intellij:{ideKind:"jetbrains",displayName:"IntelliJ IDEA",processKeywordsMac:["IntelliJ IDEA"],processKeywordsWindows:["idea64.exe"],processKeywordsLinux:["idea","intellij"]},pycharm:{ideKind:"jetbrains",displayName:"PyCharm",processKeywordsMac:["PyCharm"],processKeywordsWindows:["pycharm64.exe"],processKeywordsLinux:["pycharm"]},webstorm:{ideKind:"jetbrains",displayName:"WebStorm",processKeywordsMac:["WebStorm"],processKeywordsWindows:["webstorm64.exe"],processKeywordsLinux:["webstorm"]},phpstorm:{ideKind:"jetbrains",displayName:"PhpStorm",processKeywordsMac:["PhpStorm"],processKeywordsWindows:["phpstorm64.exe"],processKeywordsLinux:["phpstorm"]},rubymine:{ideKind:"jetbrains",displayName:"RubyMine",processKeywordsMac:["RubyMine"],processKeywordsWindows:["rubymine64.exe"],processKeywordsLinux:["rubymine"]},clion:{ideKind:"jetbrains",displayName:"CLion",processKeywordsMac:["CLion"],processKeywordsWindows:["clion64.exe"],processKeywordsLinux:["clion"]},goland:{ideKind:"jetbrains",displayName:"GoLand",processKeywordsMac:["GoLand"],processKeywordsWindows:["goland64.exe"],processKeywordsLinux:["goland"]},rider:{ideKind:"jetbrains",displayName:"Rider",processKeywordsMac:["Rider"],processKeywordsWindows:["rider64.exe"],processKeywordsLinux:["rider"]},datagrip:{ideKind:"jetbrains",displayName:"DataGrip",processKeywordsMac:["DataGrip"],processKeywordsWindows:["datagrip64.exe"],processKeywordsLinux:["datagrip"]},appcode:{ideKind:"jetbrains",displayName:"AppCode",processKeywordsMac:["AppCode"],processKeywordsWindows:["appcode.exe"],processKeywordsLinux:["appcode"]},dataspell:{ideKind:"jetbrains",displayName:"DataSpell",processKeywordsMac:["DataSpell"],processKeywordsWindows:["dataspell64.exe"],processKeywordsLinux:["dataspell"]},aqua:{ideKind:"jetbrains",displayName:"Aqua",processKeywordsMac:[],processKeywordsWindows:["aqua64.exe"],processKeywordsLinux:[]},gateway:{ideKind:"jetbrains",displayName:"Gateway",processKeywordsMac:[],processKeywordsWindows:["gateway64.exe"],processKeywordsLinux:[]},fleet:{ideKind:"jetbrains",displayName:"Fleet",processKeywordsMac:[],processKeywordsWindows:["fleet.exe"],processKeywordsLinux:[]},androidstudio:{ideKind:"jetbrains",displayName:"Android Studio",processKeywordsMac:["Android Studio"],processKeywordsWindows:["studio64.exe"],processKeywordsLinux:["android-studio"]}};njH=o$(()=>{return OX$(OA.terminal)}),rjH=o$(()=>{return Wx(YY.terminal)}),ZF=o$(()=>{return njH()||rjH()||Boolean(process.env.FORCE_CODE_TERMINAL)});e59=cZI.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/ide.ts"),YBE=B3.resolve(e59,"../");pZI={code:"VS Code",cursor:"Cursor",windsurf:"Windsurf",antigravity:"Antigravity",vi:"Vim",vim:"Vim",nano:"nano",notepad:"Notepad","start /wait notepad":"Notepad",emacs:"Emacs",subl:"Sublime Text",atom:"Atom"};AqI=o$(async(H,$)=>{if(process.env.CLAUDE_CODE_IDE_HOST_OVERRIDE)return process.env.CLAUDE_CODE_IDE_HOST_OVERRIDE;if(oA()!=="wsl"||!H)return"127.0.0.1";try{let A=await fE("ip route show | grep -i default",{shell:!0,reject:!1});if(A.exitCode===0&&A.stdout){let L=A.stdout.match(/default via (\d+\.\d+\.\d+\.\d+)/);if(L){let I=L[1];if(await ZKA(I,$))return I}}}catch(A){}return"127.0.0.1"})});function BX9(){let H=Ij$();if(H!==void 0)return H;let $=process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(!$)return VHH(null),null;let A=parseInt($,10);if(Number.isNaN(A))return N(`CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${$}`,{level:"error"}),VHH(null),null;try{let L=zH(),I=`/proc/self/fd/${A}`,D=L.readFileSync(I,{encoding:"utf8"}).trim();if(!D)return N("File descriptor contained empty token",{level:"error"}),VHH(null),null;return N(`Successfully read token from file descriptor ${A}`),VHH(D),D}catch(L){return N(`Failed to read token from file descriptor ${A}: ${L instanceof Error?L.message:String(L)}`,{level:"error"}),VHH(null),null}}function wY(){let H=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN;if(H)return H;return BX9()}var Ga=K(()=>{E$();DL();g$()});function LqI(H){RX$=H}function OKA(){RX$=null}function IqI(){RX$?.()}function DqI(){return RX$!==null}var RX$=null;function fX9(H){let $=H,A="",L=0,I=10;while($!==A&&L=I)throw Error(`Unicode sanitization reached maximum iterations (${I}) for input: ${H.slice(0,100)}`);return $}function Ua(H){if(typeof H==="string")return fX9(H);if(Array.isArray(H))return H.map(Ua);if(H!==null&&typeof H==="object"){let $={};for(let[A,L]of Object.entries(H))$[Ua(A)]=Ua(L);return $}return H}function yX$(){return parseInt(process.env.MAX_MCP_OUTPUT_TOKENS??"25000",10)}function fqI(H){return H.type==="text"}function EqI(H){return H.type==="image"}function xKA(H){if(!H)return 0;if(typeof H==="string")return JE(H);return H.reduce(($,A)=>{if(fqI(A))return $+JE(A.text);else if(EqI(A))return $+BqI;return $},0)}function MX9(){return yX$()*4}function GX9(){return` `}var jKA=K(()=>{vV()});function RKA(){return GqI.getStore()}function WKH(H,$){return GqI.run(H,$)}function FX9(H){return H?.agentType==="subagent"}function UqI(){let H=RKA();if(!FX9(H)||!H.subagentName)return;return H.isBuiltIn?H.subagentName:"user-defined"}var MqI,GqI;var tjH=K(()=>{T8();MqI=require("async_hooks"),GqI=new MqI.AsyncLocalStorage});function nB(H){if(H.startsWith("mcp__"))return"mcp_tool";return H}function JqI(){return A$(process.env.OTEL_LOG_TOOL_DETAILS)}function Kv(){return A$(process.env.ANALYTICS_LOG_TOOL_DETAILS)}function Px(H){if(!H.startsWith("mcp__"))return;let $=H.split("__");if($.length<3)return;let A=$[1],L=$.slice(2).join("__");if(!A||!L)return;return{serverName:A,mcpToolName:L}}function FqI(H,$){if(H!=="Skill")return;if(typeof $==="object"&&$!==null&&"skill"in $&&typeof $.skill==="string")return $.skill;return}function sjH(H){let $=XqI.extname(H).toLowerCase();if(!$||$===".")return;let A=$.slice(1);if(A.length>WX9)return"other";return A}function KqI(H,$){if(!H.includes(".")&&!$)return;let A,L=new Set;if($){let I=sjH($);if(I)L.add(I),A=I}for(let I of H.split(PX9)){if(!I)continue;let D=I.split(_X9);if(D.length<2)continue;let B=D[0],f=B.lastIndexOf("/"),E=f>=0?B.slice(f+1):B;if(!VX9.has(E))continue;for(let M=1;M0?{betas:A.join(",")}:{},envContext:L,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(Mk()),clientType:kYH(),...I&&{processMetrics:I},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||"",sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||"",sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||"",...YX9(),...f0()&&{subscriptionType:f0()}}}function QqI(H,$={}){let{envContext:A,processMetrics:L,...I}=H;return{...$,...I,env:A,...L&&{process:L},surface:QX9}}function WqI(H,$,A={}){let{envContext:L,processMetrics:I,...D}=H,B={platform:L.platform,arch:L.arch,node_version:L.nodeVersion,terminal:L.terminal||"unknown",package_managers:L.packageManagers,runtimes:L.runtimes,is_running_with_bun:L.isRunningWithBun,is_ci:L.isCi,is_claubbit:L.isClaubbit,is_claude_code_remote:L.isClaudeCodeRemote,is_local_agent_mode:L.isLocalAgentMode,is_conductor:L.isConductor,is_github_action:L.isGithubAction,is_claude_code_action:L.isClaudeCodeAction,is_claude_ai_auth:L.isClaudeAiAuth,version:L.version,build_time:L.buildTime,deployment_environment:L.deploymentEnvironment};if(L.remoteEnvironmentType)B.remote_environment_type=L.remoteEnvironmentType;if(L.claudeCodeContainerId)B.claude_code_container_id=L.claudeCodeContainerId;if(L.claudeCodeRemoteSessionId)B.claude_code_remote_session_id=L.claudeCodeRemoteSessionId;if(L.tags)B.tags=L.tags.split(",").map((E)=>E.trim()).filter(Boolean);if(L.githubEventName)B.github_event_name=L.githubEventName;if(L.githubActionsRunnerEnvironment)B.github_actions_runner_environment=L.githubActionsRunnerEnvironment;if(L.githubActionsRunnerOs)B.github_actions_runner_os=L.githubActionsRunnerOs;if(L.githubActionRef)B.github_action_ref=L.githubActionRef;if(L.wslVersion)B.wsl_version=L.wslVersion;if(L.versionBase)B.version_base=L.versionBase;let f={session_id:D.sessionId,model:D.model,user_type:D.userType,is_interactive:D.isInteractive==="true",client_type:D.clientType};if(D.betas)f.betas=D.betas;if(D.entrypoint)f.entrypoint=D.entrypoint;if(D.agentSdkVersion)f.agent_sdk_version=D.agentSdkVersion;if(D.sweBenchRunId)f.swe_bench_run_id=D.sweBenchRunId;if(D.sweBenchInstanceId)f.swe_bench_instance_id=D.sweBenchInstanceId;if(D.sweBenchTaskId)f.swe_bench_task_id=D.sweBenchTaskId;if(D.agentId)f.agent_id=D.agentId;if(D.parentSessionId)f.parent_session_id=D.parentSessionId;if(D.agentType)f.agent_type=D.agentType;if(D.teamName)f.team_name=D.teamName;if($.githubActionsMetadata){let E=$.githubActionsMetadata;B.github_actions_metadata={actor_id:E.actorId,repository_id:E.repositoryId,repository_owner_id:E.repositoryOwnerId}}return{env:B,...I&&{process:yH(I)},core:f,additional:A}}var XqI,QX9="claude-code",WX9=10,VX9,PX9,_X9,CX9,wX9,kX$=null,yKA=null;var R4=K(()=>{tD();Z1();Ma();$q();aI();g$();NA();EI();Z9();tjH();Z$();XE();XqI=require("path");VX9=new Set(["rm","mv","cp","touch","mkdir","chmod","chown","cat","head","tail","sort","stat","diff","wc","grep","rg","sed"]),PX9=/\s*(?:&&|\|\||[;|])\s*/,_X9=/\s+/;CX9=o$(()=>{let H={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return H?H[0]:void 0}),wX9=o$(async()=>{let[H,$]=await Promise.all([OA.getPackageManagers(),OA.getRuntimes()]);return{platform:OA.platform,arch:OA.arch,nodeVersion:OA.nodeVersion,terminal:YY.terminal,packageManagers:H.join(","),runtimes:$.join(","),isRunningWithBun:OA.isRunningWithBun(),isCi:A$(!1),isClaubbit:A$(process.env.CLAUBBIT),isClaudeCodeRemote:A$(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT==="local-agent",isConductor:OA.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...{},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:A$(process.env.GITHUB_ACTIONS),isClaudeCodeAction:A$(process.env.CLAUDE_CODE_ACTION),isClaudeAiAuth:nL(),version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,versionBase:CX9(),buildTime:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.BUILD_TIME,deploymentEnvironment:OA.detectDeploymentEnvironment(),...A$(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes("claude-code-action/")?process.env.GITHUB_ACTION_PATH.split("claude-code-action/")[1]:void 0},...U$H()&&{wslVersion:U$H()}}})});function qX9(){return uX$.join(rU(zL()),j$())}function _KH(){return uX$.join(qX9(),vKA)}async function TX9(){try{await PKH.mkdir(_KH(),{recursive:!0})}catch{}}async function jDH(H,$){let A=Array.isArray(H);if(A){if(H.some((G)=>G.type!=="text"))return{error:"Cannot persist tool results containing non-text content"}}await TX9();let L=A?"json":"txt",I=uX$.join(_KH(),`${$}.${L}`),D=A?yH(H,null,2):H,B=!1;try{await PKH.stat(I),B=!0}catch{}if(!B){try{await PKH.writeFile(I,D,"utf-8")}catch(M){let G=M instanceof Error?M:Error(String(M));return r(G),{error:xX9(G)}}N(`Persisted tool result to ${I} (${GM(D.length)})`)}let{preview:f,hasMore:E}=OX9(D,VqI);return{filepath:I,originalSize:D.length,isJson:A,preview:f,hasMore:E}}function zX9(H){let $=`${gX$} `),I=L>$*0.5?L:$;return{preview:H.slice(0,I),hasMore:!0}}function RDH(H){return"error"in H}function xX9(H){let $=H;if($.code)switch($.code){case"ENOENT":return`Directory not found: ${$.path??"unknown path"}`;case"EACCES":return`Permission denied: ${$.path??"unknown path"}`;case"ENOSPC":return"No space left on device";case"EROFS":return"Read-only file system";case"EMFILE":return"Too many open files";case"EEXIST":return`File already exists: ${$.path??"unknown path"}`;default:return`${$.code}: ${$.message}`}return H.message}var uX$,PKH,vKA="tool-results",gX$="",hKA="",bKA="[Old tool result content cleared]",VqI=2000;var Bm=K(()=>{E$();_$();rD();z$();R4();g$();rB();Z$();uX$=require("path"),PKH=require("fs/promises")});function YKH(H){let $=[];return{expanded:H.replace(/\$\{([^}]+)\}/g,(L,I)=>{let[D,B]=I.split(":-",2),f=process.env[D];if(f!==void 0)return f;if(B!==void 0)return B;return $.push(D),L}),missingVars:$}}function jX9(){if(gYH())return PqI;if(A$(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return PqI;return SX9}function Dw(){return _qI.join(UL(),jX9())}var _qI,SX9="plugins",PqI="cowork_plugins";var ejH=K(()=>{NA();g$();_qI=require("path")});async function RX9(H){try{return!!await x_(H)}catch{return!1}}var pX$;var kKA=K(()=>{tD();Zk();pX$=o$(async()=>{return RX9("git")})});function CKH(H,$){let L=H.slice(0,2).map((B)=>{let f=B.reason||B.error||"unknown error";return $?`${B.name} (${f})`:B.name}).join($?"; ":", "),I=H.length-2,D=I>0?` and ${I} more`:"";return`${L}${D}`}function HRH(H){switch(H.source){case"github":return H.repo;case"url":return H.url;case"git":return H.url;case"directory":return H.path;case"file":return H.path;default:return"Unknown source"}}function Qv(H,$){return`${H}@${$}`}async function fm(H){let $=[],A=[];for(let[L,I]of Object.entries(H)){if(!vDH(I.source))continue;let D=null;try{D=await GP(L)}catch(B){let f=B instanceof Error?B.message:String(B);A.push({name:L,error:f}),r(B instanceof Error?B:Error(`Failed to load marketplace ${L}: ${B}`))}$.push({name:L,config:I,data:D})}return{marketplaces:$,failures:A}}function wKH(H,$){if(H.length===0)return null;if($>0)return{type:"warning",message:H.length===1?`Warning: Failed to load marketplace '${H[0].name}': ${H[0].error}`:`Warning: Failed to load ${H.length} marketplaces: ${yX9(H)}`};return{type:"error",message:`Failed to load all marketplaces. Errors: ${vX9(H)}`}}function yX9(H){return H.map(($)=>$.name).join(", ")}function vX9(H){return H.map(($)=>`${$.name}: ${$.error}`).join("; ")}function yDH(){let H=ZI("policySettings");if(!H?.strictKnownMarketplaces)return null;return H.strictKnownMarketplaces}function hX9(){let H=ZI("policySettings");if(!H?.blockedMarketplaces)return null;return H.blockedMarketplaces}function bX9(H,$){if(H.source!==$.source)return!1;switch(H.source){case"url":return H.url===$.url;case"github":return H.repo===$.repo&&(H.ref||void 0)===($.ref||void 0)&&(H.path||void 0)===($.path||void 0);case"git":return H.url===$.url&&(H.ref||void 0)===($.ref||void 0)&&(H.path||void 0)===($.path||void 0);case"npm":return H.package===$.package;case"file":return H.path===$.path;case"directory":return H.path===$.path;default:return!1}}function uKA(H){switch(H.source){case"github":return"github.com";case"git":{let $=H.url.match(/^[^@]+@([^:]+):/);if($?.[1])return $[1];try{return new URL(H.url).hostname}catch{return null}}case"url":try{return new URL(H.url).hostname}catch{return null}default:return null}}function kX9(H,$){let A=uKA(H);if(!A)return!1;try{return new RegExp($.hostPattern).test(A)}catch{return r(Error(`Invalid hostPattern regex: ${$.hostPattern}`)),!1}}function CqI(){let H=yDH();if(!H)return[];return H.filter(($)=>$.source==="hostPattern").map(($)=>$.hostPattern)}function YqI(H){let $=H.match(/^git@github\.com:([^/]+\/[^/]+?)(?:\.git)?$/);if($&&$[1])return $[1];let A=H.match(/^https?:\/\/github\.com\/([^/]+\/[^/]+?)(?:\.git)?$/);if(A&&A[1])return A[1];return null}function Xa(H,$){if(!H)return!0;return(H||void 0)===($||void 0)}function uX9(H,$){if(H.source===$.source)switch(H.source){case"github":{let A=$;if(H.repo!==A.repo)return!1;return Xa(A.ref,H.ref)&&Xa(A.path,H.path)}case"git":{let A=$;if(H.url!==A.url)return!1;return Xa(A.ref,H.ref)&&Xa(A.path,H.path)}case"url":return H.url===$.url;case"npm":return H.package===$.package;case"file":return H.path===$.path;case"directory":return H.path===$.path;default:return!1}if(H.source==="git"&&$.source==="github"){if(YqI(H.url)===$.repo)return Xa($.ref,H.ref)&&Xa($.path,H.path)}if(H.source==="github"&&$.source==="git"){if(YqI($.url)===H.repo)return Xa($.ref,H.ref)&&Xa($.path,H.path)}return!1}function $RH(H){let $=hX9();if($===null)return!1;return $.some((A)=>uX9(H,A))}function vDH(H){if($RH(H))return!1;let $=yDH();if($===null)return!0;return $.some((A)=>{if(A.source==="hostPattern")return kX9(H,A);return bX9(H,A)})}function ZKH(H){switch(H.source){case"github":return`github:${H.repo}${H.ref?`@${H.ref}`:""}`;case"url":return H.url;case"git":return`git:${H.url}${H.ref?`@${H.ref}`:""}`;case"npm":return`npm:${H.package}`;case"file":return`file:${H.path}`;case"directory":return`dir:${H.path}`;case"hostPattern":return`hostPattern:${H.hostPattern}`;default:return"unknown source"}}async function wqI({configuredMarketplaceCount:H,failedMarketplaceCount:$}){if(!await pX$())return"git-not-installed";let L=yDH();if(L!==null){if(L.length===0)return"all-blocked-by-policy";if(H===0)return"policy-restricts-sources"}if(H===0)return"no-marketplaces-configured";if($>0&&$===H)return"all-marketplaces-failed";return"all-plugins-installed"}var Ja=K(()=>{y4();_$();mL();kKA()});function Fa(H){if(H.includes("@")){let $=H.split("@");return{name:$[0]||"",marketplace:$[1]}}return{name:H}}function Wv(H){if(H==="managed")throw Error("Cannot install plugins to managed scope");return gX9[H]}function ZqI(H){return gKA[H]}var gKA,gX9;var hDH=K(()=>{gKA={policySettings:"managed",userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag"};gX9={user:"userSettings",project:"projectSettings",local:"localSettings"}});function ARH(){return Em.join(Dw(),"installed_plugins.json")}function mX9(){return Em.join(Dw(),"installed_plugins_v2.json")}function pX9(){if(mKA)return;let H=zH(),$=ARH(),A=mX9();try{let L=H.existsSync(A),I=H.existsSync($);if(L){H.renameSync(A,$),N("Renamed installed_plugins_v2.json to installed_plugins.json");let D=F7();qqI(D)}else if(I){let D=H.readFileSync($,{encoding:"utf-8"}),B=DA(D);if((typeof B?.version==="number"?B.version:1)===1){let E=GwH.parse(B),M=cKA(E);iL($,yH(M,null,2),{encoding:"utf-8",flush:!0}),N(`Converted installed_plugins.json from V1 to V2 format (${Object.keys(E.plugins).length} plugins)`),qqI(M)}}mKA=!0}catch(L){let I=L instanceof Error?L.message:String(L);N(`Failed to migrate plugin files: ${I}`,{level:"error"}),r(L instanceof Error?L:Error(`Failed to migrate plugin files: ${I}`)),mKA=!0}}function qqI(H){let $=zH(),A=Mm();if(!$.existsSync(A))return;try{let L=new Set;for(let D of Object.values(H.plugins))for(let B of D)L.add(B.installPath);let I=$.readdirSync(A);for(let D of I){if(!D.isDirectory())continue;let B=D.name,f=Em.join(A,B);if($.readdirSync(f).some((G)=>{if(!G.isDirectory())return!1;let U=Em.join(f,G.name);return $.readdirSync(U).some((J)=>J.isDirectory())}))continue;if(!L.has(f))$.rmSync(f,{recursive:!0,force:!0}),N(`Cleaned up legacy cache directory: ${B}`)}}catch(L){let I=L instanceof Error?L.message:String(L);N(`Failed to clean up legacy cache: ${I}`,{level:"warn"})}}function dKA(){let H=zH(),$=ARH();if(!H.existsSync($))return null;let A=H.readFileSync($,{encoding:"utf-8"}),L=DA(A);return{version:typeof L?.version==="number"?L.version:1,data:L}}function cKA(H){let $={};for(let[A,L]of Object.entries(H.plugins)){let I=Pv(A,L.version);$[A]=[{scope:"user",installPath:I,version:L.version,installedAt:L.installedAt,lastUpdated:L.lastUpdated,gitCommitSha:L.gitCommitSha}]}return{version:2,plugins:$}}function F7(){if(Vv!==null)return Vv;let H=ARH();try{let $=dKA();if($){if($.version===2){let I=UwH.parse($.data);return Vv=I,N(`Loaded ${Object.keys(I.plugins).length} installed plugins from ${H}`),I}let A=GwH.parse($.data),L=cKA(A);return Vv=L,N(`Loaded and converted ${Object.keys(A.plugins).length} plugins from V1 format`),L}return N("installed_plugins.json doesn't exist, returning empty V2 object"),Vv={version:2,plugins:{}},Vv}catch($){let A=$ instanceof Error?$.message:String($);return N(`Failed to load installed_plugins.json: ${A}. Starting with empty state.`,{level:"error"}),r($ instanceof Error?$:Error(`Failed to load installed_plugins.json: ${A}`)),Vv={version:2,plugins:{}},Vv}}function cX$(H){let $=zH(),A=ARH();try{let L=Dw();if(!$.existsSync(L))$.mkdirSync(L);let I=yH(H,null,2);iL(A,I,{encoding:"utf-8",flush:!0}),Vv=H,N(`Saved ${Object.keys(H.plugins).length} installed plugins to ${A}`)}catch(L){let I=L instanceof Error?L.message:String(L);throw r(L instanceof Error?L:Error(`Failed to save installed_plugins.json: ${I}`)),L}}function zqI(H,$,A){let L=F7(),I=L.plugins[H];if(!I)return;if(L.plugins[H]=I.filter((D)=>!(D.scope===$&&D.projectPath===A)),L.plugins[H].length===0)delete L.plugins[H];cX$(L),N(`Removed installation for ${H} at scope ${$}`)}function lKA(){if(pKA===null)pKA=F7();return pKA}function Ka(){try{let H=dKA();if(H){if(H.version===2)return UwH.parse(H.data);let $=GwH.parse(H.data);return cKA($)}return{version:2,plugins:{}}}catch(H){let $=H instanceof Error?H.message:String(H);return N(`Failed to load installed plugins from disk: ${$}`,{level:"error"}),{version:2,plugins:{}}}}function NqI(H,$,A,L,I){let D=Ka(),B=D.plugins[H];if(!B){N(`Cannot update ${H} on disk: plugin not found in installed plugins`);return}let f=B.find((E)=>E.scope===$&&E.projectPath===A);if(f){f.installPath=L,f.version=I,f.lastUpdated=new Date().toISOString();let E=ARH();iL(E,yH(D,null,2),{encoding:"utf-8",flush:!0}),Vv=null,N(`Updated ${H} on disk to version ${I} at ${L}`)}else N(`Cannot update ${H} on disk: no installation for scope ${$}`)}async function iKA(){pX9();try{await rKA()}catch($){r($ instanceof Error?$:Error(String($)))}let H=lKA();N(`Initialized versioned plugins system with ${Object.keys(H.plugins).length} plugins`)}function dX9(H){let A=F7().plugins[H];if(!A||A.length===0)return;let L=A[0];if(!L)return;return{version:L.version||"unknown",installedAt:L.installedAt||new Date().toISOString(),lastUpdated:L.lastUpdated,installPath:L.installPath,gitCommitSha:L.gitCommitSha}}function OqI(H){if(!H)return[];let $=F7(),A=`@${H}`,L=new Set,I=!1;for(let D of Object.keys($.plugins)){if(!D.endsWith(A))continue;for(let B of $.plugins[D]??[])if(B.installPath)L.add(B.installPath);delete $.plugins[D],I=!0,N(`Removed installed plugin for marketplace removal: ${D}`)}if(I)cX$($);return Array.from(L)}function K7(H){return dX9(H)!==void 0}function nKA(H,$,A="user",L){let I=F7(),D={scope:A,installPath:$.installPath,version:$.version,installedAt:$.installedAt,lastUpdated:$.lastUpdated,gitCommitSha:$.gitCommitSha,...L&&{projectPath:L}},B=I.plugins[H]||[],f=B.findIndex((M)=>M.scope===A&&M.projectPath===L),E=f>=0;if(E)B[f]=D;else B.push(D);I.plugins[H]=B,cX$(I),N(`${E?"Updated":"Added"} installed plugin: ${H} (scope: ${A})`)}async function dX$(H){return await KwH(H)??void 0}function TqI(H,$){let A=zH(),L=Em.join(H,".claude-plugin","plugin.json");if(!A.existsSync(L))return"unknown";try{let I=A.readFileSync(L,{encoding:"utf-8"});return DA(I).version||"unknown"}catch{return N(`Could not read version from manifest for ${$}`),"unknown"}}async function rKA(){let $=VL().enabledPlugins||{};if(Object.keys($).length===0)return;let A=dKA(),L=A!==null;if(L&&A?.version===2&&A){let J=UwH.safeParse(A.data);if(J?.success){let F=J.data.plugins;if(Object.keys($).filter((W)=>W.includes("@")).every((W)=>{let P=F[W];return P&&P.length>0})){N("All plugins already exist, skipping migration");return}}}N(L?"Syncing installed_plugins.json with enabledPlugins from all settings.json files":"Creating installed_plugins.json from settings.json files");let D=zH(),B=new Date().toISOString(),f=C$(),E=new Map,M=["userSettings","projectSettings","localSettings"];for(let J of M){let Q=ZI(J)?.enabledPlugins||{};for(let W of Object.keys(Q)){if(!W.includes("@"))continue;let P=ZqI(J);E.set(W,{scope:P,projectPath:P==="user"?void 0:f})}}let G={};if(L)G={...F7().plugins};let U=0,X=0;for(let[J,F]of E){let Q=G[J];if(Q&&Q.length>0){let W=Q[0];if(W&&(W.scope!==F.scope||W.projectPath!==F.projectPath)){if(W.scope=F.scope,F.projectPath)W.projectPath=F.projectPath;else delete W.projectPath;W.lastUpdated=B,U++,N(`Updated ${J} scope to ${F.scope} (settings.json is source of truth)`)}}else{let W=J.split("@"),P=W[0];if(!P||W.length!==2)continue;try{let C=await ZK(J);if(!C){N(`Plugin ${J} not found in any marketplace, skipping`);continue}let{entry:Y,marketplaceInstallLocation:Z}=C,q,O="unknown",j=void 0;if(typeof Y.source==="string")q=Em.join(Z,Y.source),O=TqI(q,J),j=await dX$(q);else{let u=Mm(),y=P.replace(/[^a-zA-Z0-9-_]/g,"-"),g=Em.join(u,y);if(!D.existsSync(g)){N(`External plugin ${J} not in cache, skipping`);continue}q=g,O=TqI(g,J),j=await dX$(g)}if(O==="unknown"&&Y.version)O=Y.version;if(O==="unknown"&&j)O=j.substring(0,12);G[J]=[{scope:F.scope,installPath:Pv(J,O),version:O,installedAt:B,lastUpdated:B,gitCommitSha:j,...F.projectPath&&{projectPath:F.projectPath}}],X++,N(`Added ${J} with scope ${F.scope}`)}catch(C){N(`Failed to add plugin ${J}: ${C}`)}}}if(!L||U>0||X>0)cX$({version:2,plugins:G}),N(`Sync completed: ${X} added, ${U} updated in installed_plugins.json`)}var Em,mKA=!1,Vv=null,pKA=null;var Q7=K(()=>{DL();Z$();E$();_$();ejH();UQ();Z$();mL();hDH();PI();_X();j$H();y4();Em=require("path")});function UP(H){switch(H.type){case"generic-error":return H.error;case"path-not-found":return`Path not found: ${H.path} (${H.component})`;case"git-auth-failed":return`Git authentication failed (${H.authType}): ${H.gitUrl}`;case"git-timeout":return`Git ${H.operation} timeout: ${H.gitUrl}`;case"network-error":return`Network error: ${H.url}${H.details?` - ${H.details}`:""}`;case"manifest-parse-error":return`Manifest parse error: ${H.parseError}`;case"manifest-validation-error":return`Manifest validation failed: ${H.validationErrors.join(", ")}`;case"plugin-not-found":return`Plugin ${H.pluginId} not found in marketplace ${H.marketplace}`;case"marketplace-not-found":return`Marketplace ${H.marketplace} not found`;case"marketplace-load-failed":return`Marketplace ${H.marketplace} failed to load: ${H.reason}`;case"repository-scan-failed":return`Repository scan failed: ${H.reason}`;case"mcp-config-invalid":return`MCP server ${H.serverName} invalid: ${H.validationError}`;case"hook-load-failed":return`Hook load failed: ${H.reason}`;case"component-load-failed":return`${H.component} load failed from ${H.path}: ${H.reason}`;case"mcpb-download-failed":return`Failed to download MCPB from ${H.url}: ${H.reason}`;case"mcpb-extract-failed":return`Failed to extract MCPB ${H.mcpbPath}: ${H.reason}`;case"mcpb-invalid-manifest":return`MCPB manifest invalid at ${H.mcpbPath}: ${H.validationError}`;case"lsp-config-invalid":return`Plugin "${H.plugin}" has invalid LSP server config for "${H.serverName}": ${H.validationError}`;case"lsp-server-start-failed":return`Plugin "${H.plugin}" failed to start LSP server "${H.serverName}": ${H.reason}`;case"lsp-server-crashed":if(H.signal)return`Plugin "${H.plugin}" LSP server "${H.serverName}" crashed with signal ${H.signal}`;return`Plugin "${H.plugin}" LSP server "${H.serverName}" crashed with exit code ${H.exitCode??"unknown"}`;case"lsp-request-timeout":return`Plugin "${H.plugin}" LSP server "${H.serverName}" timed out on ${H.method} request after ${H.timeoutMs}ms`;case"lsp-request-failed":return`Plugin "${H.plugin}" LSP server "${H.serverName}" ${H.method} request failed: ${H.error}`;case"marketplace-blocked-by-policy":if(H.blockedByBlocklist)return`Marketplace '${H.marketplace}' is blocked by enterprise policy`;return`Marketplace '${H.marketplace}' is not in the allowed marketplace list`}}async function Qa(H,$,A){let L=H;return await Promise.all([...H.matchAll(cX9),...H.matchAll(lX9)].map(async(I)=>{let D=I[1]?.trim();if(D)try{let B=await qF(aD,{command:D},$,PT({content:[]}),"");if(B.behavior!=="allow")throw N(`Bash command permission check failed for command in ${A}: ${D}. Error: ${B.message}`),new _R(`Bash command permission check failed for pattern "${I[0]}": ${B.message||"Permission denied"}`);let{data:f}=await aD.call({command:D},$),E=await mX$(aD,f,xqI.randomUUID()),M=typeof E.content==="string"?E.content:SqI(f.stdout,f.stderr);L=L.replace(I[0],M)}catch(B){if(B instanceof _R)throw B;iX9(B,I[0])}})),L}function SqI(H,$,A=!1){let L=[];if(H.trim())L.push(H.trim());if($.trim())if(A)L.push(`[stderr: ${$.trim()}]`);else L.push(`[stderr] ${L}`;throw new _R(I)}var xqI,cX9,lX9;var qKH=K(()=>{zQ();lG();E$();XJ();_L();Bm();xqI=require("crypto"),cX9=/```!\s*\n?([\s\S]*?)\n?```/g,lX9=/(?{KzH();jqI=y2({command:uL(),args:FX(uL()).optional(),env:KO(uL(),uL()).optional()}),nX9=y2({name:uL(),email:uL().email().optional(),url:uL().url().optional()}),rX9=y2({type:uL(),url:uL().url()}),aX9=jqI.partial(),oX9=jqI.extend({platform_overrides:KO(uL(),aX9).optional()}),tX9=y2({type:QO(["python","node","binary"]),entry_point:uL(),mcp_config:oX9}),sX9=y2({claude_desktop:uL().optional(),platforms:FX(QO(["darwin","win32","linux"])).optional(),runtimes:y2({python:uL().optional(),node:uL().optional()}).optional()}).passthrough(),eX9=y2({name:uL(),description:uL().optional()}),HJ9=y2({name:uL(),description:uL().optional(),arguments:FX(uL()).optional(),text:uL()}),$J9=y2({type:QO(["string","number","boolean","directory","file"]),title:uL(),description:uL(),required:PQ().optional(),default:tAH([uL(),Tq(),PQ(),FX(uL())]).optional(),multiple:PQ().optional(),sensitive:PQ().optional(),min:Tq().optional(),max:Tq().optional()}),m0E=KO(uL(),tAH([uL(),Tq(),PQ(),FX(uL())])),lX$=y2({$schema:uL().optional(),dxt_version:uL().optional().describe("@deprecated Use manifest_version instead"),manifest_version:uL().optional(),name:uL(),display_name:uL().optional(),version:uL(),description:uL(),long_description:uL().optional(),author:nX9,repository:rX9.optional(),homepage:uL().url().optional(),documentation:uL().url().optional(),support:uL().url().optional(),icon:uL().optional(),screenshots:FX(uL()).optional(),server:tX9,tools:FX(eX9).optional(),tools_generated:PQ().optional(),prompts:FX(HJ9).optional(),prompts_generated:PQ().optional(),keywords:FX(uL()).optional(),license:uL().optional(),privacy_policies:FX(uL()).optional(),compatibility:sX9.optional(),user_config:KO(uL(),$J9).optional()}).refine((H)=>!!(H.dxt_version||H.manifest_version),{message:"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided"}),p0E=y2({status:QO(["signed","unsigned","self-signed"]),publisher:uL().optional(),issuer:uL().optional(),valid_from:uL().optional(),valid_to:uL().optional(),fingerprint:uL().optional()})});var aKA=K(()=>{LRH()});function KJ9(H,$){return JJ9(H,{i:2},$&&$.out,$&&$.dictionary)}function VJ9(H,$){if($){var A="";for(var L=0;L65558)_T(13);var I=Yv(H,L+8);if(!I)return{};var D=Yx(H,L+16),B=D==4294967295||I==65535;if(B){var f=Yx(H,L-12);if(B=Yx(H,f)==101075792,B)I=Yx(H,f+32),D=Yx(H,f+48)}var E=$&&$.filter;for(var M=0;M>E]=M}}else{f=new TKH(L);for(I=0;I>15-H[I]}return f},DRH,S8,S8,S8,S8,gqI,S8,MJ9,GJ9,oKA=function(H){var $=H[0];for(var A=1;A$)$=H[A];return $},_x=function(H,$,A){var L=$/8|0;return(H[L]|H[L+1]<<8)>>($&7)&A},tKA=function(H,$){var A=$/8|0;return(H[A]|H[A+1]<<8|H[A+2]<<16)>>($&7)},UJ9=function(H){return(H+7)/8|0},$QA=function(H,$,A){if($==null||$<0)$=0;if(A==null||A>H.length)A=H.length;return new Bw(H.subarray($,A))},XJ9,_T=function(H,$,A){var L=Error($||XJ9[H]);if(L.code=H,Error.captureStackTrace)Error.captureStackTrace(L,_T);if(!A)throw L;return L},JJ9=function(H,$,A,L){var I=H.length,D=L?L.length:0;if(!I||$.f&&!$.l)return A||new Bw(0);var B=!A,f=B||$.i!=2,E=$.i;if(B)A=new Bw(I*3);var M=function(DH){var EH=A.length;if(DH>EH){var $H=new Bw(Math.max(EH*2,DH));$H.set(A),A=$H}},G=$.f||0,U=$.p||0,X=$.b||0,J=$.l,F=$.d,Q=$.m,W=$.n,P=I*8;do{if(!J){G=_x(H,U,1);var C=_x(H,U+1,3);if(U+=3,!C){var Y=UJ9(U)+4,Z=H[Y-4]|H[Y-3]<<8,q=Y+Z;if(q>I){if(E)_T(0);break}if(f)M(X+Z);A.set(H.subarray(Y,q),X),$.b=X+=Z,$.p=U=q*8,$.f=G;continue}else if(C==1)J=MJ9,F=GJ9,Q=9,W=5;else if(C==2){var O=_x(H,U,31)+257,j=_x(H,U+10,15)+4,u=O+_x(H,U+5,31)+1;U+=14;var y=new Bw(u),g=new Bw(19);for(var h=0;h>4;if(Y<16)y[h++]=Y;else{var GH=0,HH=0;if(Y==16)HH=3+_x(H,U,3),U+=2,GH=y[h-1];else if(Y==17)HH=3+_x(H,U,7),U+=3;else if(Y==18)HH=11+_x(H,U,127),U+=7;while(HH--)y[h++]=GH}}var BH=y.subarray(0,O),WH=y.subarray(O);Q=oKA(BH),W=oKA(WH),J=IRH(BH,Q,1),F=IRH(WH,W,1)}else _T(1);if(U>P){if(E)_T(0);break}}if(f)M(X+131072);var wH=(1<>4;if(U+=GH&15,U>P){if(E)_T(0);break}if(!GH)_T(2);if(t<256)A[X++]=t;else if(t==256){TH=U,J=null;break}else{var IH=t-254;if(t>264){var h=t-257,KH=yqI[h];IH=_x(H,U,(1<>4;if(!MH)_T(3);U+=MH&15;var WH=EJ9[CH];if(CH>3){var KH=vqI[CH];WH+=tKA(H,U)&(1<P){if(E)_T(0);break}if(f)M(X+131072);var OH=X+IH;if(X>>0},sKA=function(H,$){return Yx(H,$)+Yx(H,$+4)*4294967296},HQA,QJ9=0,WJ9=function(H){for(var $="",A=0;;){var L=H[A++],I=(L>127)+(L>223)+(L>239);if(A+I>H.length)return{s:$,r:$QA(H,A-1)};if(!I)$+=String.fromCharCode(L);else if(I==3)L=((L&15)<<18|(H[A++]&63)<<12|(H[A++]&63)<<6|H[A++]&63)-65536,$+=String.fromCharCode(55296|L>>10,56320|L&1023);else if(I&1)$+=String.fromCharCode((L&31)<<6|H[A++]&63);else $+=String.fromCharCode((L&15)<<12|(H[A++]&63)<<6|H[A++]&63)}},PJ9=function(H,$){return $+30+Yv(H,$+26)+Yv(H,$+28)},_J9=function(H,$,A){var L=Yv(H,$+28),I=VJ9(H.subarray($+46,$+46+L),!(Yv(H,$+8)&2048)),D=$+46+L,B=Yx(H,$+20),f=A&&B==4294967295?YJ9(H,D):[B,Yx(H,$+24),Yx(H,$+42)],E=f[0],M=f[1],G=f[2];return[Yv(H,$+10),E,M,I,D+Yv(H,$+30)+Yv(H,$+32),G]},YJ9=function(H,$){for(;Yv(H,$)!=1;$+=4+Yv(H,$+2));return[sKA(H,$+12),sKA(H,$+4),sKA(H,$+20)]};var pqI=K(()=>{RqI=require("module"),LJ9=RqI.createRequire("/");try{IJ9=LJ9("worker_threads").Worker}catch(H){}Bw=Uint8Array,TKH=Uint16Array,DJ9=Int32Array,yqI=new Bw([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),vqI=new Bw([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),BJ9=new Bw([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bqI=hqI(yqI,2),kqI=bqI.b,fJ9=bqI.r;kqI[28]=258,fJ9[258]=28;uqI=hqI(vqI,0),EJ9=uqI.b,i0E=uqI.r,eKA=new TKH(32768);for(S8=0;S8<32768;++S8)_v=(S8&43690)>>1|(S8&21845)<<1,_v=(_v&52428)>>2|(_v&13107)<<2,_v=(_v&61680)>>4|(_v&3855)<<4,eKA[S8]=((_v&65280)>>8|(_v&255)<<8)>>1;DRH=new Bw(288);for(S8=0;S8<144;++S8)DRH[S8]=8;for(S8=144;S8<256;++S8)DRH[S8]=9;for(S8=256;S8<280;++S8)DRH[S8]=7;for(S8=280;S8<288;++S8)DRH[S8]=8;gqI=new Bw(32);for(S8=0;S8<32;++S8)gqI[S8]=5;MJ9=IRH(DRH,9,1),GJ9=IRH(gqI,5,1),XJ9=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],FJ9=new Bw(0);HQA=typeof TextDecoder<"u"&&new TextDecoder;try{HQA.decode(FJ9,{stream:!0}),QJ9=1}catch(H){}});var fRH=z((r0E,rX$)=>{function lqI(H){return Array.isArray(H)?H:[H]}var CJ9=void 0,LQA="",dqI=" ",AQA="\\",wJ9=/^\s+$/,ZJ9=/(?:[^\\]|^)\\$/,qJ9=/^\\!/,TJ9=/^\\#/,zJ9=/\r?\n/g,NJ9=/^\.{0,2}\/|^\.{1,2}$/,OJ9=/\/$/,zKH="/",iqI="node-ignore";if(typeof Symbol<"u")iqI=Symbol.for("node-ignore");var nqI=iqI,NKH=(H,$,A)=>{return Object.defineProperty(H,$,{value:A}),A},xJ9=/([0-z])-([0-z])/g,rqI=()=>!1,SJ9=(H)=>H.replace(xJ9,($,A,L)=>A.charCodeAt(0)<=L.charCodeAt(0)?$:LQA),jJ9=(H)=>{let{length:$}=H;return H.slice(0,$-$%2)},RJ9=[[/^\uFEFF/,()=>LQA],[/((?:\\\\)*?)(\\?\s+)$/,(H,$,A)=>$+(A.indexOf("\\")===0?dqI:LQA)],[/(\\+?)\s/g,(H,$)=>{let{length:A}=$;return $.slice(0,A-A%2)+dqI}],[/[\\$.|*+(){^]/g,(H)=>`\\${H}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(H,$,A)=>$+6{let L=A.replace(/\\\*/g,"[^\\/]*");return $+L}],[/\\\\\\(?=[$.|*+(){^])/g,()=>AQA],[/\\\\/g,()=>AQA],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(H,$,A,L,I)=>$===AQA?`\\[${A}${jJ9(L)}${I}`:I==="]"?L.length%2===0?`[${SJ9(A)}${L}]`:"[]":"[]"],[/(?:[^*])$/,(H)=>/\/$/.test(H)?`${H}$`:`${H}(?=$|\\/$)`]],yJ9=/(^|\\\/)?\\\*$/,BRH="regex",iX$="checkRegex",cqI="_",vJ9={[BRH](H,$){return`${$?`${$}[^/]+`:"[^/]*"}(?=$|\\/$)`},[iX$](H,$){return`${$?`${$}[^/]*`:"[^/]*"}(?=$|\\/$)`}},hJ9=(H)=>RJ9.reduce(($,[A,L])=>$.replace(A,L.bind(H)),H),nX$=(H)=>typeof H==="string",bJ9=(H)=>H&&nX$(H)&&!wJ9.test(H)&&!ZJ9.test(H)&&H.indexOf("#")!==0,kJ9=(H)=>H.split(zJ9).filter(Boolean);class aqI{constructor(H,$,A,L,I,D){this.pattern=H,this.mark=$,this.negative=I,NKH(this,"body",A),NKH(this,"ignoreCase",L),NKH(this,"regexPrefix",D)}get regex(){let H=cqI+BRH;if(this[H])return this[H];return this._make(BRH,H)}get checkRegex(){let H=cqI+iX$;if(this[H])return this[H];return this._make(iX$,H)}_make(H,$){let A=this.regexPrefix.replace(yJ9,vJ9[H]),L=this.ignoreCase?new RegExp(A,"i"):new RegExp(A);return NKH(this,$,L)}}var uJ9=({pattern:H,mark:$},A)=>{let L=!1,I=H;if(I.indexOf("!")===0)L=!0,I=I.substr(1);I=I.replace(qJ9,"!").replace(TJ9,"#");let D=hJ9(I);return new aqI(H,$,I,A,L,D)};class oqI{constructor(H){this._ignoreCase=H,this._rules=[]}_add(H){if(H&&H[nqI]){this._rules=this._rules.concat(H._rules._rules),this._added=!0;return}if(nX$(H))H={pattern:H};if(bJ9(H.pattern)){let $=uJ9(H,this._ignoreCase);this._added=!0,this._rules.push($)}}add(H){return this._added=!1,lqI(nX$(H)?kJ9(H):H).forEach(this._add,this),this._added}test(H,$,A){let L=!1,I=!1,D;this._rules.forEach((f)=>{let{negative:E}=f;if(I===E&&L!==I||E&&!L&&!I&&!$)return;if(!f[A].test(H))return;L=!E,I=E,D=E?CJ9:f});let B={ignored:L,unignored:I};if(D)B.rule=D;return B}}var gJ9=(H,$)=>{throw new $(H)},Gm=(H,$,A)=>{if(!nX$(H))return A(`path must be a string, but got \`${$}\``,TypeError);if(!H)return A("path must not be empty",TypeError);if(Gm.isNotRelative(H))return A(`path should be a \`path.relative()\`d string, but got "${$}"`,RangeError);return!0},tqI=(H)=>NJ9.test(H);Gm.isNotRelative=tqI;Gm.convert=(H)=>H;class sqI{constructor({ignorecase:H=!0,ignoreCase:$=H,allowRelativePaths:A=!1}={}){NKH(this,nqI,!0),this._rules=new oqI($),this._strictPathCheck=!A,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(H){if(this._rules.add(H))this._initCache();return this}addPattern(H){return this.add(H)}_test(H,$,A,L){let I=H&&Gm.convert(H);return Gm(I,H,this._strictPathCheck?gJ9:rqI),this._t(I,$,A,L)}checkIgnore(H){if(!OJ9.test(H))return this.test(H);let $=H.split(zKH).filter(Boolean);if($.pop(),$.length){let A=this._t($.join(zKH)+zKH,this._testCache,!0,$);if(A.ignored)return A}return this._rules.test(H,!1,iX$)}_t(H,$,A,L){if(H in $)return $[H];if(!L)L=H.split(zKH).filter(Boolean);if(L.pop(),!L.length)return $[H]=this._rules.test(H,A,BRH);let I=this._t(L.join(zKH)+zKH,$,A,L);return $[H]=I.ignored?I:this._rules.test(H,A,BRH)}ignores(H){return this._test(H,this._ignoreCache,!1).ignored}createFilter(){return(H)=>!this.ignores(H)}filter(H){return lqI(H).filter(this.createFilter())}test(H){return this._test(H,this._testCache,!0)}}var IQA=(H)=>new sqI(H),mJ9=(H)=>Gm(H&&Gm.convert(H),H,rqI),pJ9=()=>{let H=(A)=>/^\\\\\?\\/.test(A)||/["<>|\u0000-\u001F]+/u.test(A)?A:A.replace(/\\/g,"/");Gm.convert=H;let $=/^[a-z]:\//i;Gm.isNotRelative=(A)=>$.test(A)||tqI(A)};rX$.exports=IQA;IQA.default=IQA;rX$.exports.isPathValid=mJ9;NKH(rX$.exports,Symbol.for("setupWindows"),pJ9)});var dJ9;var DQA=K(()=>{dJ9=b(fRH(),1)});var DU=z((BQA)=>{BQA.fromCallback=function(H){return Object.defineProperty(function(...$){if(typeof $[$.length-1]==="function")H.apply(this,$);else return new Promise((A,L)=>{$.push((I,D)=>I!=null?L(I):A(D)),H.apply(this,$)})},"name",{value:H.name})};BQA.fromPromise=function(H){return Object.defineProperty(function(...$){let A=$[$.length-1];if(typeof A!=="function")return H.apply(this,$);else $.pop(),H.apply(this,$).then((L)=>A(null,L),A)},"name",{value:H.name})}});var bDH=z((Wa)=>{var eqI=DU().fromCallback,ZY=zE(),cJ9=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((H)=>{return typeof ZY[H]==="function"});Object.assign(Wa,ZY);cJ9.forEach((H)=>{Wa[H]=eqI(ZY[H])});Wa.exists=function(H,$){if(typeof $==="function")return ZY.exists(H,$);return new Promise((A)=>{return ZY.exists(H,A)})};Wa.read=function(H,$,A,L,I,D){if(typeof D==="function")return ZY.read(H,$,A,L,I,D);return new Promise((B,f)=>{ZY.read(H,$,A,L,I,(E,M,G)=>{if(E)return f(E);B({bytesRead:M,buffer:G})})})};Wa.write=function(H,$,...A){if(typeof A[A.length-1]==="function")return ZY.write(H,$,...A);return new Promise((L,I)=>{ZY.write(H,$,...A,(D,B,f)=>{if(D)return I(D);L({bytesWritten:B,buffer:f})})})};if(typeof ZY.writev==="function")Wa.writev=function(H,$,...A){if(typeof A[A.length-1]==="function")return ZY.writev(H,$,...A);return new Promise((L,I)=>{ZY.writev(H,$,...A,(D,B,f)=>{if(D)return I(D);L({bytesWritten:B,buffers:f})})})};if(typeof ZY.realpath.native==="function")Wa.realpath.native=eqI(ZY.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var $TI=z((e0E,HTI)=>{var s0E=require("path");HTI.exports.checkPath=function($){}});var DTI=z((H9E,fQA)=>{var ATI=bDH(),{checkPath:LTI}=$TI(),ITI=(H)=>{let $={mode:511};if(typeof H==="number")return H;return{...$,...H}.mode};fQA.exports.makeDir=async(H,$)=>{return LTI(H),ATI.mkdir(H,{mode:ITI($),recursive:!0})};fQA.exports.makeDirSync=(H,$)=>{return LTI(H),ATI.mkdirSync(H,{mode:ITI($),recursive:!0})}});var Cx=z(($9E,BTI)=>{var lJ9=DU().fromPromise,{makeDir:iJ9,makeDirSync:EQA}=DTI(),MQA=lJ9(iJ9);BTI.exports={mkdirs:MQA,mkdirsSync:EQA,mkdirp:MQA,mkdirpSync:EQA,ensureDir:MQA,ensureDirSync:EQA}});var Va=z((A9E,ETI)=>{var nJ9=DU().fromPromise,fTI=bDH();function rJ9(H){return fTI.access(H).then(()=>!0).catch(()=>!1)}ETI.exports={pathExists:nJ9(rJ9),pathExistsSync:fTI.existsSync}});var GQA=z((L9E,MTI)=>{var OKH=zE();function aJ9(H,$,A,L){OKH.open(H,"r+",(I,D)=>{if(I)return L(I);OKH.futimes(D,$,A,(B)=>{OKH.close(D,(f)=>{if(L)L(B||f)})})})}function oJ9(H,$,A){let L=OKH.openSync(H,"r+");return OKH.futimesSync(L,$,A),OKH.closeSync(L)}MTI.exports={utimesMillis:aJ9,utimesMillisSync:oJ9}});var kDH=z((I9E,XTI)=>{var xKH=bDH(),jQ=require("path"),tJ9=require("util");function sJ9(H,$,A){let L=A.dereference?(I)=>xKH.stat(I,{bigint:!0}):(I)=>xKH.lstat(I,{bigint:!0});return Promise.all([L(H),L($).catch((I)=>{if(I.code==="ENOENT")return null;throw I})]).then(([I,D])=>({srcStat:I,destStat:D}))}function eJ9(H,$,A){let L,I=A.dereference?(B)=>xKH.statSync(B,{bigint:!0}):(B)=>xKH.lstatSync(B,{bigint:!0}),D=I(H);try{L=I($)}catch(B){if(B.code==="ENOENT")return{srcStat:D,destStat:null};throw B}return{srcStat:D,destStat:L}}function HF9(H,$,A,L,I){tJ9.callbackify(sJ9)(H,$,L,(D,B)=>{if(D)return I(D);let{srcStat:f,destStat:E}=B;if(E){if(ERH(f,E)){let M=jQ.basename(H),G=jQ.basename($);if(A==="move"&&M!==G&&M.toLowerCase()===G.toLowerCase())return I(null,{srcStat:f,destStat:E,isChangingCase:!0});return I(Error("Source and destination must not be the same."))}if(f.isDirectory()&&!E.isDirectory())return I(Error(`Cannot overwrite non-directory '${$}' with directory '${H}'.`));if(!f.isDirectory()&&E.isDirectory())return I(Error(`Cannot overwrite directory '${$}' with non-directory '${H}'.`))}if(f.isDirectory()&&UQA(H,$))return I(Error(aX$(H,$,A)));return I(null,{srcStat:f,destStat:E})})}function $F9(H,$,A,L){let{srcStat:I,destStat:D}=eJ9(H,$,L);if(D){if(ERH(I,D)){let B=jQ.basename(H),f=jQ.basename($);if(A==="move"&&B!==f&&B.toLowerCase()===f.toLowerCase())return{srcStat:I,destStat:D,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(I.isDirectory()&&!D.isDirectory())throw Error(`Cannot overwrite non-directory '${$}' with directory '${H}'.`);if(!I.isDirectory()&&D.isDirectory())throw Error(`Cannot overwrite directory '${$}' with non-directory '${H}'.`)}if(I.isDirectory()&&UQA(H,$))throw Error(aX$(H,$,A));return{srcStat:I,destStat:D}}function GTI(H,$,A,L,I){let D=jQ.resolve(jQ.dirname(H)),B=jQ.resolve(jQ.dirname(A));if(B===D||B===jQ.parse(B).root)return I();xKH.stat(B,{bigint:!0},(f,E)=>{if(f){if(f.code==="ENOENT")return I();return I(f)}if(ERH($,E))return I(Error(aX$(H,A,L)));return GTI(H,$,B,L,I)})}function UTI(H,$,A,L){let I=jQ.resolve(jQ.dirname(H)),D=jQ.resolve(jQ.dirname(A));if(D===I||D===jQ.parse(D).root)return;let B;try{B=xKH.statSync(D,{bigint:!0})}catch(f){if(f.code==="ENOENT")return;throw f}if(ERH($,B))throw Error(aX$(H,A,L));return UTI(H,$,D,L)}function ERH(H,$){return $.ino&&$.dev&&$.ino===H.ino&&$.dev===H.dev}function UQA(H,$){let A=jQ.resolve(H).split(jQ.sep).filter((I)=>I),L=jQ.resolve($).split(jQ.sep).filter((I)=>I);return A.reduce((I,D,B)=>I&&L[B]===D,!0)}function aX$(H,$,A){return`Cannot ${A} '${H}' to a subdirectory of itself, '${$}'.`}XTI.exports={checkPaths:HF9,checkPathsSync:$F9,checkParentPaths:GTI,checkParentPathsSync:UTI,isSrcSubdir:UQA,areIdentical:ERH}});var _TI=z((D9E,PTI)=>{var qY=zE(),MRH=require("path"),AF9=Cx().mkdirs,LF9=Va().pathExists,IF9=GQA().utimesMillis,GRH=kDH();function DF9(H,$,A,L){if(typeof A==="function"&&!L)L=A,A={};else if(typeof A==="function")A={filter:A};L=L||function(){},A=A||{},A.clobber="clobber"in A?!!A.clobber:!0,A.overwrite="overwrite"in A?!!A.overwrite:A.clobber,A.preserveTimestamps,GRH.checkPaths(H,$,"copy",A,(I,D)=>{if(I)return L(I);let{srcStat:B,destStat:f}=D;GRH.checkParentPaths(H,B,$,"copy",(E)=>{if(E)return L(E);if(A.filter)return KTI(JTI,f,H,$,A,L);return JTI(f,H,$,A,L)})})}function JTI(H,$,A,L,I){let D=MRH.dirname(A);LF9(D,(B,f)=>{if(B)return I(B);if(f)return oX$(H,$,A,L,I);AF9(D,(E)=>{if(E)return I(E);return oX$(H,$,A,L,I)})})}function KTI(H,$,A,L,I,D){Promise.resolve(I.filter(A,L)).then((B)=>{if(B)return H($,A,L,I,D);return D()},(B)=>D(B))}function BF9(H,$,A,L,I){if(L.filter)return KTI(oX$,H,$,A,L,I);return oX$(H,$,A,L,I)}function oX$(H,$,A,L,I){(L.dereference?qY.stat:qY.lstat)($,(B,f)=>{if(B)return I(B);if(f.isDirectory())return JF9(f,H,$,A,L,I);else if(f.isFile()||f.isCharacterDevice()||f.isBlockDevice())return fF9(f,H,$,A,L,I);else if(f.isSymbolicLink())return QF9(H,$,A,L,I);else if(f.isSocket())return I(Error(`Cannot copy a socket file: ${$}`));else if(f.isFIFO())return I(Error(`Cannot copy a FIFO pipe: ${$}`));return I(Error(`Unknown file: ${$}`))})}function fF9(H,$,A,L,I,D){if(!$)return QTI(H,A,L,I,D);return EF9(H,A,L,I,D)}function EF9(H,$,A,L,I){if(L.overwrite)qY.unlink(A,(D)=>{if(D)return I(D);return QTI(H,$,A,L,I)});else if(L.errorOnExist)return I(Error(`'${A}' already exists`));else return I()}function QTI(H,$,A,L,I){qY.copyFile($,A,(D)=>{if(D)return I(D);if(L.preserveTimestamps)return MF9(H.mode,$,A,I);return tX$(A,H.mode,I)})}function MF9(H,$,A,L){if(GF9(H))return UF9(A,H,(I)=>{if(I)return L(I);return FTI(H,$,A,L)});return FTI(H,$,A,L)}function GF9(H){return(H&128)===0}function UF9(H,$,A){return tX$(H,$|128,A)}function FTI(H,$,A,L){XF9($,A,(I)=>{if(I)return L(I);return tX$(A,H,L)})}function tX$(H,$,A){return qY.chmod(H,$,A)}function XF9(H,$,A){qY.stat(H,(L,I)=>{if(L)return A(L);return IF9($,I.atime,I.mtime,A)})}function JF9(H,$,A,L,I,D){if(!$)return FF9(H.mode,A,L,I,D);return WTI(A,L,I,D)}function FF9(H,$,A,L,I){qY.mkdir(A,(D)=>{if(D)return I(D);WTI($,A,L,(B)=>{if(B)return I(B);return tX$(A,H,I)})})}function WTI(H,$,A,L){qY.readdir(H,(I,D)=>{if(I)return L(I);return VTI(D,H,$,A,L)})}function VTI(H,$,A,L,I){let D=H.pop();if(!D)return I();return KF9(H,D,$,A,L,I)}function KF9(H,$,A,L,I,D){let B=MRH.join(A,$),f=MRH.join(L,$);GRH.checkPaths(B,f,"copy",I,(E,M)=>{if(E)return D(E);let{destStat:G}=M;BF9(G,B,f,I,(U)=>{if(U)return D(U);return VTI(H,A,L,I,D)})})}function QF9(H,$,A,L,I){qY.readlink($,(D,B)=>{if(D)return I(D);if(L.dereference)B=MRH.resolve(process.cwd(),B);if(!H)return qY.symlink(B,A,I);else qY.readlink(A,(f,E)=>{if(f){if(f.code==="EINVAL"||f.code==="UNKNOWN")return qY.symlink(B,A,I);return I(f)}if(L.dereference)E=MRH.resolve(process.cwd(),E);if(GRH.isSrcSubdir(B,E))return I(Error(`Cannot copy '${B}' to a subdirectory of itself, '${E}'.`));if(H.isDirectory()&&GRH.isSrcSubdir(E,B))return I(Error(`Cannot overwrite '${E}' with '${B}'.`));return WF9(B,A,I)})})}function WF9(H,$,A){qY.unlink($,(L)=>{if(L)return A(L);return qY.symlink(H,$,A)})}PTI.exports=DF9});var qTI=z((B9E,ZTI)=>{var E3=zE(),URH=require("path"),VF9=Cx().mkdirsSync,PF9=GQA().utimesMillisSync,XRH=kDH();function _F9(H,$,A){if(typeof A==="function")A={filter:A};A=A||{},A.clobber="clobber"in A?!!A.clobber:!0,A.overwrite="overwrite"in A?!!A.overwrite:A.clobber,A.preserveTimestamps;let{srcStat:L,destStat:I}=XRH.checkPathsSync(H,$,"copy",A);return XRH.checkParentPathsSync(H,L,$,"copy"),YF9(I,H,$,A)}function YF9(H,$,A,L){if(L.filter&&!L.filter($,A))return;let I=URH.dirname(A);if(!E3.existsSync(I))VF9(I);return YTI(H,$,A,L)}function CF9(H,$,A,L){if(L.filter&&!L.filter($,A))return;return YTI(H,$,A,L)}function YTI(H,$,A,L){let D=(L.dereference?E3.statSync:E3.lstatSync)($);if(D.isDirectory())return OF9(D,H,$,A,L);else if(D.isFile()||D.isCharacterDevice()||D.isBlockDevice())return wF9(D,H,$,A,L);else if(D.isSymbolicLink())return jF9(H,$,A,L);else if(D.isSocket())throw Error(`Cannot copy a socket file: ${$}`);else if(D.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${$}`);throw Error(`Unknown file: ${$}`)}function wF9(H,$,A,L,I){if(!$)return CTI(H,A,L,I);return ZF9(H,A,L,I)}function ZF9(H,$,A,L){if(L.overwrite)return E3.unlinkSync(A),CTI(H,$,A,L);else if(L.errorOnExist)throw Error(`'${A}' already exists`)}function CTI(H,$,A,L){if(E3.copyFileSync($,A),L.preserveTimestamps)qF9(H.mode,$,A);return XQA(A,H.mode)}function qF9(H,$,A){if(TF9(H))zF9(A,H);return NF9($,A)}function TF9(H){return(H&128)===0}function zF9(H,$){return XQA(H,$|128)}function XQA(H,$){return E3.chmodSync(H,$)}function NF9(H,$){let A=E3.statSync(H);return PF9($,A.atime,A.mtime)}function OF9(H,$,A,L,I){if(!$)return xF9(H.mode,A,L,I);return wTI(A,L,I)}function xF9(H,$,A,L){return E3.mkdirSync(A),wTI($,A,L),XQA(A,H)}function wTI(H,$,A){E3.readdirSync(H).forEach((L)=>SF9(L,H,$,A))}function SF9(H,$,A,L){let I=URH.join($,H),D=URH.join(A,H),{destStat:B}=XRH.checkPathsSync(I,D,"copy",L);return CF9(B,I,D,L)}function jF9(H,$,A,L){let I=E3.readlinkSync($);if(L.dereference)I=URH.resolve(process.cwd(),I);if(!H)return E3.symlinkSync(I,A);else{let D;try{D=E3.readlinkSync(A)}catch(B){if(B.code==="EINVAL"||B.code==="UNKNOWN")return E3.symlinkSync(I,A);throw B}if(L.dereference)D=URH.resolve(process.cwd(),D);if(XRH.isSrcSubdir(I,D))throw Error(`Cannot copy '${I}' to a subdirectory of itself, '${D}'.`);if(E3.statSync(A).isDirectory()&&XRH.isSrcSubdir(D,I))throw Error(`Cannot overwrite '${D}' with '${I}'.`);return RF9(I,A)}}function RF9(H,$){return E3.unlinkSync($),E3.symlinkSync(H,$)}ZTI.exports=_F9});var sX$=z((f9E,TTI)=>{var yF9=DU().fromCallback;TTI.exports={copy:yF9(_TI()),copySync:qTI()}});var RTI=z((E9E,jTI)=>{var zTI=zE(),OTI=require("path"),YX=require("assert");function xTI(H){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((A)=>{H[A]=H[A]||zTI[A],A=A+"Sync",H[A]=H[A]||zTI[A]}),H.maxBusyTries=H.maxBusyTries||3}function KQA(H,$,A){let L=0;if(typeof $==="function")A=$,$={};YX(H,"rimraf: missing path"),YX.strictEqual(typeof H,"string","rimraf: path should be a string"),YX.strictEqual(typeof A,"function","rimraf: callback function required"),YX($,"rimraf: invalid options argument provided"),YX.strictEqual(typeof $,"object","rimraf: options should be object"),xTI($),NTI(H,$,function I(D){if(D){if((D.code==="EBUSY"||D.code==="ENOTEMPTY"||D.code==="EPERM")&&L<$.maxBusyTries){L++;let B=L*100;return setTimeout(()=>NTI(H,$,I),B)}if(D.code==="ENOENT")D=null}A(D)})}function NTI(H,$,A){YX(H),YX($),YX(typeof A==="function"),$.lstat(H,(L,I)=>{if(L&&L.code==="ENOENT")return A(null);if(L&&L.code,I&&I.isDirectory())return JQA(H,$,L,A);$.unlink(H,(D)=>{if(D){if(D.code==="ENOENT")return A(null);if(D.code==="EPERM")return JQA(H,$,D,A);if(D.code==="EISDIR")return JQA(H,$,D,A)}return A(D)})})}function JQA(H,$,A,L){YX(H),YX($),YX(typeof L==="function"),$.rmdir(H,(I)=>{if(I&&(I.code==="ENOTEMPTY"||I.code==="EEXIST"||I.code==="EPERM"))vF9(H,$,L);else if(I&&I.code==="ENOTDIR")L(A);else L(I)})}function vF9(H,$,A){YX(H),YX($),YX(typeof A==="function"),$.readdir(H,(L,I)=>{if(L)return A(L);let D=I.length,B;if(D===0)return $.rmdir(H,A);I.forEach((f)=>{KQA(OTI.join(H,f),$,(E)=>{if(B)return;if(E)return A(B=E);if(--D===0)$.rmdir(H,A)})})})}function STI(H,$){let A;$=$||{},xTI($),YX(H,"rimraf: missing path"),YX.strictEqual(typeof H,"string","rimraf: path should be a string"),YX($,"rimraf: missing options"),YX.strictEqual(typeof $,"object","rimraf: options should be object");try{A=$.lstatSync(H)}catch(L){if(L.code==="ENOENT")return;L.code}try{if(A&&A.isDirectory())FQA(H,$,null);else $.unlinkSync(H)}catch(L){if(L.code==="ENOENT")return;else if(L.code==="EPERM")return FQA(H,$,L);else if(L.code!=="EISDIR")throw L;FQA(H,$,L)}}function FQA(H,$,A){YX(H),YX($);try{$.rmdirSync(H)}catch(L){if(L.code==="ENOTDIR")throw A;else if(L.code==="ENOTEMPTY"||L.code==="EEXIST"||L.code==="EPERM")hF9(H,$);else if(L.code!=="ENOENT")throw L}}function hF9(H,$){return YX(H),YX($),$.readdirSync(H).forEach((A)=>STI(OTI.join(H,A),$)),$.rmdirSync(H,$)}jTI.exports=KQA;KQA.sync=STI});var JRH=z((M9E,vTI)=>{var eX$=zE(),bF9=DU().fromCallback,yTI=RTI();function kF9(H,$){if(eX$.rm)return eX$.rm(H,{recursive:!0,force:!0},$);yTI(H,$)}function uF9(H){if(eX$.rmSync)return eX$.rmSync(H,{recursive:!0,force:!0});yTI.sync(H)}vTI.exports={remove:bF9(kF9),removeSync:uF9}});var dTI=z((G9E,pTI)=>{var gF9=DU().fromPromise,kTI=bDH(),uTI=require("path"),gTI=Cx(),mTI=JRH(),hTI=gF9(async function($){let A;try{A=await kTI.readdir($)}catch{return gTI.mkdirs($)}return Promise.all(A.map((L)=>mTI.remove(uTI.join($,L))))});function bTI(H){let $;try{$=kTI.readdirSync(H)}catch{return gTI.mkdirsSync(H)}$.forEach((A)=>{A=uTI.join(H,A),mTI.removeSync(A)})}pTI.exports={emptyDirSync:bTI,emptydirSync:bTI,emptyDir:hTI,emptydir:hTI}});var nTI=z((U9E,iTI)=>{var mF9=DU().fromCallback,cTI=require("path"),Pa=zE(),lTI=Cx();function pF9(H,$){function A(){Pa.writeFile(H,"",(L)=>{if(L)return $(L);$()})}Pa.stat(H,(L,I)=>{if(!L&&I.isFile())return $();let D=cTI.dirname(H);Pa.stat(D,(B,f)=>{if(B){if(B.code==="ENOENT")return lTI.mkdirs(D,(E)=>{if(E)return $(E);A()});return $(B)}if(f.isDirectory())A();else Pa.readdir(D,(E)=>{if(E)return $(E)})})})}function dF9(H){let $;try{$=Pa.statSync(H)}catch{}if($&&$.isFile())return;let A=cTI.dirname(H);try{if(!Pa.statSync(A).isDirectory())Pa.readdirSync(A)}catch(L){if(L&&L.code==="ENOENT")lTI.mkdirsSync(A);else throw L}Pa.writeFileSync(H,"")}iTI.exports={createFile:mF9(pF9),createFileSync:dF9}});var sTI=z((X9E,tTI)=>{var cF9=DU().fromCallback,rTI=require("path"),_a=zE(),aTI=Cx(),lF9=Va().pathExists,{areIdentical:oTI}=kDH();function iF9(H,$,A){function L(I,D){_a.link(I,D,(B)=>{if(B)return A(B);A(null)})}_a.lstat($,(I,D)=>{_a.lstat(H,(B,f)=>{if(B)return B.message=B.message.replace("lstat","ensureLink"),A(B);if(D&&oTI(f,D))return A(null);let E=rTI.dirname($);lF9(E,(M,G)=>{if(M)return A(M);if(G)return L(H,$);aTI.mkdirs(E,(U)=>{if(U)return A(U);L(H,$)})})})})}function nF9(H,$){let A;try{A=_a.lstatSync($)}catch{}try{let D=_a.lstatSync(H);if(A&&oTI(D,A))return}catch(D){throw D.message=D.message.replace("lstat","ensureLink"),D}let L=rTI.dirname($);if(_a.existsSync(L))return _a.linkSync(H,$);return aTI.mkdirsSync(L),_a.linkSync(H,$)}tTI.exports={createLink:cF9(iF9),createLinkSync:nF9}});var HzI=z((J9E,eTI)=>{var Ya=require("path"),FRH=zE(),rF9=Va().pathExists;function aF9(H,$,A){if(Ya.isAbsolute(H))return FRH.lstat(H,(L)=>{if(L)return L.message=L.message.replace("lstat","ensureSymlink"),A(L);return A(null,{toCwd:H,toDst:H})});else{let L=Ya.dirname($),I=Ya.join(L,H);return rF9(I,(D,B)=>{if(D)return A(D);if(B)return A(null,{toCwd:I,toDst:H});else return FRH.lstat(H,(f)=>{if(f)return f.message=f.message.replace("lstat","ensureSymlink"),A(f);return A(null,{toCwd:H,toDst:Ya.relative(L,H)})})})}}function oF9(H,$){let A;if(Ya.isAbsolute(H)){if(A=FRH.existsSync(H),!A)throw Error("absolute srcpath does not exist");return{toCwd:H,toDst:H}}else{let L=Ya.dirname($),I=Ya.join(L,H);if(A=FRH.existsSync(I),A)return{toCwd:I,toDst:H};else{if(A=FRH.existsSync(H),!A)throw Error("relative srcpath does not exist");return{toCwd:H,toDst:Ya.relative(L,H)}}}}eTI.exports={symlinkPaths:aF9,symlinkPathsSync:oF9}});var LzI=z((F9E,AzI)=>{var $zI=zE();function tF9(H,$,A){if(A=typeof $==="function"?$:A,$=typeof $==="function"?!1:$,$)return A(null,$);$zI.lstat(H,(L,I)=>{if(L)return A(null,"file");$=I&&I.isDirectory()?"dir":"file",A(null,$)})}function sF9(H,$){let A;if($)return $;try{A=$zI.lstatSync(H)}catch{return"file"}return A&&A.isDirectory()?"dir":"file"}AzI.exports={symlinkType:tF9,symlinkTypeSync:sF9}});var UzI=z((K9E,GzI)=>{var eF9=DU().fromCallback,DzI=require("path"),wx=bDH(),BzI=Cx(),HK9=BzI.mkdirs,$K9=BzI.mkdirsSync,fzI=HzI(),AK9=fzI.symlinkPaths,LK9=fzI.symlinkPathsSync,EzI=LzI(),IK9=EzI.symlinkType,DK9=EzI.symlinkTypeSync,BK9=Va().pathExists,{areIdentical:MzI}=kDH();function fK9(H,$,A,L){L=typeof A==="function"?A:L,A=typeof A==="function"?!1:A,wx.lstat($,(I,D)=>{if(!I&&D.isSymbolicLink())Promise.all([wx.stat(H),wx.stat($)]).then(([B,f])=>{if(MzI(B,f))return L(null);IzI(H,$,A,L)});else IzI(H,$,A,L)})}function IzI(H,$,A,L){AK9(H,$,(I,D)=>{if(I)return L(I);H=D.toDst,IK9(D.toCwd,A,(B,f)=>{if(B)return L(B);let E=DzI.dirname($);BK9(E,(M,G)=>{if(M)return L(M);if(G)return wx.symlink(H,$,f,L);HK9(E,(U)=>{if(U)return L(U);wx.symlink(H,$,f,L)})})})})}function EK9(H,$,A){let L;try{L=wx.lstatSync($)}catch{}if(L&&L.isSymbolicLink()){let f=wx.statSync(H),E=wx.statSync($);if(MzI(f,E))return}let I=LK9(H,$);H=I.toDst,A=DK9(I.toCwd,A);let D=DzI.dirname($);if(wx.existsSync(D))return wx.symlinkSync(H,$,A);return $K9(D),wx.symlinkSync(H,$,A)}GzI.exports={createSymlink:eF9(fK9),createSymlinkSync:EK9}});var PzI=z((Q9E,VzI)=>{var{createFile:XzI,createFileSync:JzI}=nTI(),{createLink:FzI,createLinkSync:KzI}=sTI(),{createSymlink:QzI,createSymlinkSync:WzI}=UzI();VzI.exports={createFile:XzI,createFileSync:JzI,ensureFile:XzI,ensureFileSync:JzI,createLink:FzI,createLinkSync:KzI,ensureLink:FzI,ensureLinkSync:KzI,createSymlink:QzI,createSymlinkSync:WzI,ensureSymlink:QzI,ensureSymlinkSync:WzI}});var SKH=z((W9E,_zI)=>{function MK9(H,{EOL:$=` `,D};iJ$.publicKeyToOpenSSH=function(H,$){var A="ssh-rsa";$=$||"";var L=TF.util.createBuffer();return tKH(L,A),xv(L,H.e),xv(L,H.n),A+" "+TF.util.encode64(L.bytes())+" "+$};iJ$.privateKeyToOpenSSH=function(H,$){if(!$)return TF.pki.privateKeyToPem(H);return TF.pki.encryptRsaPrivateKey(H,$,{legacy:!0,algorithm:"aes128"})};iJ$.getPublicKeyFingerprint=function(H,$){$=$||{};var A=$.md||TF.md.md5.create(),L="ssh-rsa",I=TF.util.createBuffer();tKH(I,L),xv(I,H.e),xv(I,H.n),A.start(),A.update(I.getBytes());var D=A.digest();if($.encoding==="hex"){var B=D.toHex();if($.delimiter)return B.match(/.{2}/g).join($.delimiter);return B}else if($.encoding==="binary")return D.getBytes();else if($.encoding)throw Error('Unknown encoding "'+$.encoding+'".');return D};function xv(H,$){var A=$.toString(16);if(A[0]>="8")A="00"+A;var L=TF.util.hexToBytes(A);H.putInt32(L.length),H.putBytes(L)}function tKH(H,$){H.putInt32($.length),H.putString($)}function lJ$(){var H=TF.md.sha1.create(),$=arguments.length;for(var A=0;A<$;++A)H.update(arguments[A]);return H.digest()}});var MjI=z((t1E,EjI)=>{EjI.exports=p1();ja();SSI();zx();KJ$();ORH();rSI();kKH();sSI();HjI();AjI();JWA();TJ$();pDH();BWA();QWA();DjI();VWA();EWA();sQA();RJ$();CT();$WA();fjI();ZWA();Nf()});var GjI,qV9,UjI,s1E;var dWA=K(()=>{GjI=require("child_process"),qV9=b(MjI(),1),UjI=require("util"),s1E=UjI.promisify(GjI.execFile)});var cWA=K(()=>{dWA()});var XjI,zV9,NV9,OV9,xV9,SV9,jV9,RV9,yV9,vV9,D8E,hV9,B8E;var JjI=K(()=>{KzH();XjI=R2({command:uL(),args:FX(uL()).optional(),env:KO(uL(),uL()).optional()}),zV9=R2({name:uL(),email:uL().email().optional(),url:uL().url().optional()}),NV9=R2({type:uL(),url:uL().url()}),OV9=XjI.partial(),xV9=XjI.extend({platform_overrides:KO(uL(),OV9).optional()}),SV9=R2({type:QO(["python","node","binary"]),entry_point:uL(),mcp_config:xV9}),jV9=R2({claude_desktop:uL().optional(),platforms:FX(QO(["darwin","win32","linux"])).optional(),runtimes:R2({python:uL().optional(),node:uL().optional()}).optional()}).passthrough(),RV9=R2({name:uL(),description:uL().optional()}),yV9=R2({name:uL(),description:uL().optional(),arguments:FX(uL()).optional(),text:uL()}),vV9=R2({type:QO(["string","number","boolean","directory","file"]),title:uL(),description:uL(),required:PQ().optional(),default:tAH([uL(),Tq(),PQ(),FX(uL())]).optional(),multiple:PQ().optional(),sensitive:PQ().optional(),min:Tq().optional(),max:Tq().optional()}),D8E=KO(uL(),tAH([uL(),Tq(),PQ(),FX(uL())])),hV9=R2({$schema:uL().optional(),dxt_version:uL().optional().describe("@deprecated Use manifest_version instead"),manifest_version:uL().optional(),name:uL(),display_name:uL().optional(),version:uL(),description:uL(),long_description:uL().optional(),author:zV9,repository:NV9.optional(),homepage:uL().url().optional(),documentation:uL().url().optional(),support:uL().url().optional(),icon:uL().optional(),screenshots:FX(uL()).optional(),server:SV9,tools:FX(RV9).optional(),tools_generated:PQ().optional(),prompts:FX(yV9).optional(),prompts_generated:PQ().optional(),keywords:FX(uL()).optional(),license:uL().optional(),compatibility:jV9.optional(),user_config:KO(uL(),vV9).optional()}).refine((H)=>!!(H.dxt_version||H.manifest_version),{message:"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided"}),B8E=R2({status:QO(["signed","unsigned","self-signed"]),publisher:uL().optional(),issuer:uL().optional(),valid_from:uL().optional(),valid_to:uL().optional(),fingerprint:uL().optional()})});var bV9,kV9;var lWA=K(()=>{cWA();LRH();JjI();bV9=b(rOI(),1),kV9=b(tOI(),1)});var FjI=K(()=>{DQA();lWA();LRH();aKA()});function iWA(H,$){if(typeof H==="string"){let A=H;for(let[L,I]of Object.entries($)){let D=new RegExp(`\\$\\{${L}\\}`,"g");if(A.match(D))if(Array.isArray(I))console.warn(`Cannot replace ${L} with array value in string context: "${H}"`,{key:L,replacement:I});else A=A.replace(D,I)}return A}else if(Array.isArray(H)){let A=[];for(let L of H)if(typeof L==="string"&&L.match(/^\$\{user_config\.[^}]+\}$/)){let I=L.match(/^\$\{([^}]+)\}$/)?.[1];if(I&&$[I]){let D=$[I];if(Array.isArray(D))A.push(...D);else A.push(D)}else A.push(L)}else A.push(iWA(L,$));return A}else if(H&&typeof H==="object"){let A={};for(let[L,I]of Object.entries(H))A[L]=iWA(I,$);return A}return H}async function nJ$(H){let{manifest:$,extensionPath:A,systemDirs:L,userConfig:I,pathSeparator:D,logger:B}=H,f=$.server?.mcp_config;if(!f)return;let E={...f};if(f.platform_overrides){if("linux"in f.platform_overrides){let U=f.platform_overrides.linux;E.command=U.command||E.command,E.args=U.args||E.args,E.env=U.env||E.env}}if(uV9({manifest:$,userConfig:I})){B?.warn(`Extension ${$.name} has missing required configuration, skipping MCP config`);return}let M={__dirname:A,pathSeparator:D,"/":D,...L},G={};if($.user_config){for(let[U,X]of Object.entries($.user_config))if(X.default!==void 0)G[U]=X.default}if(I)Object.assign(G,I);for(let[U,X]of Object.entries(G)){let J=`user_config.${U}`;if(Array.isArray(X))M[J]=X.map(String);else if(typeof X==="boolean")M[J]=X?"true":"false";else M[J]=String(X)}return E=iWA(E,M),E}function KjI(H){return H===void 0||H===null||H===""}function uV9({manifest:H,userConfig:$}){if(!H.user_config)return!1;let A=$||{};for(let[L,I]of Object.entries(H.user_config))if(I.required){let D=A[L];if(KjI(D)||Array.isArray(D)&&(D.length===0||D.some(KjI)))return!0}return!1}var QjI=()=>{};var nWA=K(()=>{aKA();FjI();cWA();DQA();dWA();lWA();LRH();QjI()});function gV9(H){let $=lX$.safeParse(H);if(!$.success){let A=$.error.flatten(),L=[...Object.entries(A.fieldErrors).map(([I,D])=>`${I}: ${D?.join(", ")}`),...A.formErrors||[]].filter(Boolean).join("; ");throw Error(`Invalid manifest: ${L}`)}return $.data}function mV9(H){let $;try{$=DA(H)}catch(A){throw Error(`Invalid JSON in manifest.json: ${A instanceof Error?A.message:String(A)}`)}return gV9($)}function rWA(H){let $=new TextDecoder().decode(H);return mV9($)}var WjI=K(()=>{nWA();Z$()});function pV9(H){if(nMH(H))return!1;let $=rJ$.normalize(H);if(rJ$.isAbsolute($))return!1;return!0}function dV9(H,$){$.fileCount++;let A;if($.fileCount>ma.MAX_FILE_COUNT)A=`Archive contains too many files: ${$.fileCount} (max: ${ma.MAX_FILE_COUNT})`;if(!pV9(H.name))A=`Unsafe file path detected: "${H.name}". Path traversal or absolute paths are not allowed.`;let L=H.originalSize||0;if(L>ma.MAX_FILE_SIZE)A=`File "${H.name}" is too large: ${Math.round(L/1024/1024)}MB (max: ${Math.round(ma.MAX_FILE_SIZE/1024/1024)}MB)`;if($.totalUncompressedSize+=L,$.totalUncompressedSize>ma.MAX_TOTAL_SIZE)A=`Archive total size is too large: ${Math.round($.totalUncompressedSize/1024/1024)}MB (max: ${Math.round(ma.MAX_TOTAL_SIZE/1024/1024)}MB)`;let I=$.totalUncompressedSize/$.compressedSize;if(I>ma.MAX_COMPRESSION_RATIO)A=`Suspicious compression ratio detected: ${I.toFixed(1)}:1 (max: ${ma.MAX_COMPRESSION_RATIO}:1). This may be a zip bomb.`;return A?{isValid:!1,error:A}:{isValid:!0}}function VjI(H){let $=zH();if(!$.existsSync(H))throw Error(`Zip file does not exist: ${H}`);try{let A=$.readFileBytesSync(H),I={fileCount:0,totalUncompressedSize:0,compressedSize:A.length,errors:[]},D=mqI(new Uint8Array(A),{filter:(B)=>{let f=dV9(B,I);if(!f.isValid)throw Error(f.error);return!0}});return N(`Zip extraction completed: ${I.fileCount} files, ${Math.round(I.totalUncompressedSize/1024)}KB uncompressed`),D}catch(A){let L=A instanceof Error?A.message:String(A);throw Error(`Failed to read or unzip file: ${L}`)}}var rJ$,ma;var PjI=K(()=>{pqI();E$();DL();ZM();rJ$=b(require("path")),ma={MAX_FILE_SIZE:536870912,MAX_TOTAL_SIZE:1073741824,MAX_FILE_COUNT:1e5,MAX_COMPRESSION_RATIO:50,MIN_COMPRESSION_RATIO:0.5}});function aJ$(H){let $=H?.platform??oA(),A=H?.homedir??_jI.homedir(),L=H?.env??process.env,I={HOME:A,DESKTOP:tDH.join(A,"Desktop"),DOCUMENTS:tDH.join(A,"Documents"),DOWNLOADS:tDH.join(A,"Downloads")};switch($){case"windows":{let D=L.USERPROFILE||A;return{HOME:A,DESKTOP:tDH.join(D,"Desktop"),DOCUMENTS:tDH.join(D,"Documents"),DOWNLOADS:tDH.join(D,"Downloads")}}case"linux":case"wsl":return{HOME:A,DESKTOP:L.XDG_DESKTOP_DIR||I.DESKTOP,DOCUMENTS:L.XDG_DOCUMENTS_DIR||I.DOCUMENTS,DOWNLOADS:L.XDG_DOWNLOAD_DIR||I.DOWNLOADS};case"macos":default:{if($==="unknown")N("Unknown platform detected, using default paths");return I}}}var _jI,tDH;var YjI=K(()=>{Z9();E$();_jI=b(require("os")),tDH=b(require("path"))});function OT(H){return H.endsWith(".mcpb")||H.endsWith(".dxt")}function TjI(H){return H.startsWith("http://")||H.startsWith("https://")}function cV9(H){return oJ$.createHash("sha256").update(H).digest("hex").substring(0,16)}function zjI(H){return Ox.join(H,".mcpb-cache")}function NjI(H,$){let A=oJ$.createHash("md5").update($).digest("hex").substring(0,8);return Ox.join(H,`${A}.metadata.json`)}function CjI(H,$){try{let L=VL().pluginConfigs?.[H]?.mcpServers?.[$];if(!L)return null;return N(`Loaded user config for ${H}/${$} from settings`),L}catch(A){let L=A instanceof Error?A:Error(String(A));return r(L),N(`Failed to load user config for ${H}/${$}: ${A}`,{level:"error"}),null}}function wjI(H,$,A){try{let L=VL();if(!L.pluginConfigs)L.pluginConfigs={};if(!L.pluginConfigs[H])L.pluginConfigs[H]={};if(!L.pluginConfigs[H].mcpServers)L.pluginConfigs[H].mcpServers={};L.pluginConfigs[H].mcpServers[$]=A;let I=II("userSettings",L);if(I.error)throw I.error;N(`Saved user config for ${H}/${$} to user settings`)}catch(L){let I=L instanceof Error?L:Error(String(L));throw r(I),Error(`Failed to save user configuration for ${H}/${$}: ${I.message}`)}}function ZjI(H,$){let A=[];for(let[L,I]of Object.entries($)){let D=H[L];if(I.required&&(D===void 0||D==="")){A.push(`${I.title||L} is required but not provided`);continue}if(D===void 0||D==="")continue;if(I.type==="string"){if(Array.isArray(D)){if(!I.multiple)A.push(`${I.title||L} must be a string, not an array`);else if(!D.every((B)=>typeof B==="string"))A.push(`${I.title||L} must be an array of strings`)}else if(typeof D!=="string")A.push(`${I.title||L} must be a string`)}else if(I.type==="number"&&typeof D!=="number")A.push(`${I.title||L} must be a number`);else if(I.type==="boolean"&&typeof D!=="boolean")A.push(`${I.title||L} must be a boolean`);else if((I.type==="file"||I.type==="directory")&&typeof D!=="string")A.push(`${I.title||L} must be a path string`);if(I.type==="number"&&typeof D==="number"){if(I.min!==void 0&&DI.max)A.push(`${I.title||L} must be at most ${I.max}`)}}return{valid:A.length===0,errors:A}}async function qjI(H,$){let A=await nJ$({manifest:H,extensionPath:$,systemDirs:aJ$(),userConfig:{},pathSeparator:"/"});if(!A){let L=Error(`Failed to generate MCP server configuration from manifest "${H.name}"`);throw r(L),L}return A}async function OjI(H,$){let A=zH(),L=NjI(H,$);if(!A.existsSync(L))return null;try{let I=A.readFileSync(L,{encoding:"utf-8"});return DA(I)}catch(I){let D=I instanceof Error?I:Error(String(I));return r(D),N(`Failed to load MCPB cache metadata: ${I}`,{level:"error"}),null}}async function aWA(H,$,A){let L=zH(),I=NjI(H,$);L.mkdirSync(H),iL(I,yH(A,null,2),"utf-8")}async function lV9(H,$,A){if(N(`Downloading MCPB from ${H}`),A)A(`Downloading ${H}...`);try{let L=await nA.get(H,{timeout:120000,responseType:"arraybuffer",maxRedirects:5,onDownloadProgress:(D)=>{if(D.total&&A){let B=Math.round(D.loaded/D.total*100);A(`Downloading... ${B}%`)}}}),I=new Uint8Array(L.data);if(iL($,Buffer.from(I)),N(`Downloaded ${I.length} bytes to ${$}`),A)A("Download complete");return I}catch(L){let I=L instanceof Error?L.message:String(L),D=Error(`Failed to download MCPB file from ${H}: ${I}`);throw r(D),D}}async function iV9(H,$,A){let L=zH();if(A)A("Extracting files...");L.mkdirSync($);let I=0,D=Object.keys(H).length;for(let[B,f]of Object.entries(H)){let E=Ox.join($,B),M=Ox.dirname(E);if(M!==$&&!L.existsSync(M))L.mkdirSync(M);if(B.endsWith(".json")||B.endsWith(".js")||B.endsWith(".ts")||B.endsWith(".txt")||B.endsWith(".md")||B.endsWith(".yml")||B.endsWith(".yaml")){let U=new TextDecoder().decode(f);iL(E,U,"utf-8")}else iL(E,Buffer.from(f));if(I++,A&&I%10===0)A(`Extracted ${I}/${D} files`)}if(N(`Extracted ${I} files to ${$}`),A)A(`Extraction complete (${I} files)`)}async function nV9(H,$){let A=zH(),L=zjI($),I=await OjI(L,H);if(!I)return!0;if(!A.existsSync(I.extractedPath))return N(`MCPB extraction path missing: ${I.extractedPath}`),!0;if(!TjI(H)){let D=Ox.join($,H);if(!A.existsSync(D))return N(`MCPB source file missing: ${D}`),!0;let B=A.statSync(D),f=new Date(I.cachedAt).getTime(),E=B.mtimeMs;if(E>f)return N(`MCPB file modified: ${new Date(E)} > ${new Date(f)}`),!0}return!1}async function uRH(H,$,A,L,I,D){let B=zH(),f=zjI($);B.mkdirSync(f),N(`Loading MCPB from source: ${H}`);let E=await OjI(f,H);if(E&&!await nV9(H,$)){N(`Using cached MCPB from ${E.extractedPath} (hash: ${E.contentHash})`);let C=Ox.join(E.extractedPath,"manifest.json");if(!B.existsSync(C)){let j=Error(`Cached manifest not found: ${C}`);throw r(j),j}let Y=B.readFileSync(C,{encoding:"utf-8"}),Z=new TextEncoder().encode(Y),q=rWA(Z);if(q.user_config&&Object.keys(q.user_config).length>0){let j=q.name,u=CjI(A,j),y=I||u||{},g=ZjI(y,q.user_config);if(D||!g.valid)return{status:"needs-config",manifest:q,extractedPath:E.extractedPath,contentHash:E.contentHash,configSchema:q.user_config,existingConfig:u||{},validationErrors:g.valid?[]:g.errors};if(I)wjI(A,j,I);let h=await nJ$({manifest:q,extensionPath:E.extractedPath,systemDirs:aJ$(),userConfig:y,pathSeparator:"/"});if(!h){let p=Error(`Failed to generate MCP server configuration from manifest "${q.name}"`);throw r(p),p}return{manifest:q,mcpConfig:h,extractedPath:E.extractedPath,contentHash:E.contentHash}}let O=await qjI(q,E.extractedPath);return{manifest:q,mcpConfig:O,extractedPath:E.extractedPath,contentHash:E.contentHash}}let M,G;if(TjI(H)){let C=oJ$.createHash("md5").update(H).digest("hex").substring(0,8);G=Ox.join(f,`${C}.mcpb`),M=await lV9(H,G,L)}else{let C=Ox.join($,H);if(!B.existsSync(C)){let Y=Error(`MCPB file not found: ${C}`);throw r(Y),Y}if(L)L(`Loading ${H}...`);M=B.readFileBytesSync(C),G=C}let U=cV9(M);if(N(`MCPB content hash: ${U}`),L)L("Extracting MCPB archive...");let X=VjI(G),J=X["manifest.json"];if(!J){let C=Error("No manifest.json found in MCPB file");throw r(C),C}let F=rWA(J);if(N(`MCPB manifest: ${F.name} v${F.version} by ${F.author.name}`),!F.server){let C=Error(`MCPB manifest for "${F.name}" does not define a server configuration`);throw r(C),C}let Q=Ox.join(f,U);if(await iV9(X,Q,L),F.user_config&&Object.keys(F.user_config).length>0){let C=F.name,Y=CjI(A,C),Z=I||Y||{},q=ZjI(Z,F.user_config);if(!q.valid){let u={source:H,contentHash:U,extractedPath:Q,cachedAt:new Date().toISOString(),lastChecked:new Date().toISOString()};return await aWA(f,H,u),{status:"needs-config",manifest:F,extractedPath:Q,contentHash:U,configSchema:F.user_config,existingConfig:Y||{},validationErrors:q.errors}}if(I)wjI(A,C,I);if(L)L("Generating MCP server configuration...");let O=await nJ$({manifest:F,extensionPath:Q,systemDirs:aJ$(),userConfig:Z,pathSeparator:"/"});if(!O){let u=Error(`Failed to generate MCP server configuration from manifest "${F.name}"`);throw r(u),u}let j={source:H,contentHash:U,extractedPath:Q,cachedAt:new Date().toISOString(),lastChecked:new Date().toISOString()};return await aWA(f,H,j),{manifest:F,mcpConfig:O,extractedPath:Q,contentHash:U}}if(L)L("Generating MCP server configuration...");let W=await qjI(F,Q),P={source:H,contentHash:U,extractedPath:Q,cachedAt:new Date().toISOString(),lastChecked:new Date().toISOString()};return await aWA(f,H,P),N(`Successfully loaded MCPB: ${F.name} (extracted to ${Q})`),{manifest:F,mcpConfig:W,extractedPath:Q,contentHash:U}}var oJ$,Ox;var oWA=K(()=>{w1();Z$();nWA();WjI();PjI();DL();E$();_$();YjI();mL();Z$();oJ$=require("crypto"),Ox=require("path")});async function xjI(H,$,A){try{N(`Loading MCP servers from MCPB: ${$}`);let L=H.repository,I=await uRH($,H.path,L,(f)=>{N(`MCPB [${H.name}]: ${f}`)});if("status"in I&&I.status==="needs-config")return N(`MCPB ${$} requires user configuration. `+`User can configure via: /plugin \u2192 Manage plugins \u2192 ${H.name} \u2192 Configure`),null;let D=I,B=D.manifest.name;return N(`Loaded MCP server "${B}" from MCPB (extracted to ${D.extractedPath})`),{[B]:D.mcpConfig}}catch(L){let I=L instanceof Error?L.message:String(L);N(`Failed to load MCPB ${$}: ${I}`,{level:"error"});let D=`${H.name}@${H.repository}`;if($.startsWith("http")&&(I.includes("download")||I.includes("network")))A.push({type:"mcpb-download-failed",source:D,plugin:H.name,url:$,reason:I});else if(I.includes("manifest")||I.includes("user configuration"))A.push({type:"mcpb-invalid-manifest",source:D,plugin:H.name,mcpbPath:$,validationError:I});else A.push({type:"mcpb-extract-failed",source:D,plugin:H.name,mcpbPath:$,reason:I});return null}}async function sWA(H,$=[]){let A={},L=tWA(H.path,".mcp.json");if(L)A={...A,...L};if(H.manifest.mcpServers){let I=H.manifest.mcpServers;if(typeof I==="string")if(OT(I)){let D=await xjI(H,I,$);if(D)A={...A,...D}}else{let D=tWA(H.path,I);if(D)A={...A,...D}}else if(Array.isArray(I))for(let D of I)if(typeof D==="string")if(OT(D)){let B=await xjI(H,D,$);if(B)A={...A,...B}}else{let B=tWA(H.path,D);if(B)A={...A,...B}}else A={...A,...D};else A={...A,...I}}return Object.keys(A).length>0?A:void 0}function tWA(H,$){let A=zH(),L=SjI.join(H,$);if(!A.existsSync(L))return null;try{let I=A.readFileSync(L,{encoding:"utf-8"}),D=DA(I),B=D.mcpServers||D,f={};for(let[E,M]of Object.entries(B)){let G=zR.safeParse(M);if(G.success)f[E]=G.data;else N(`Invalid MCP server config for ${E} in ${L}: ${G.error.message}`,{level:"error"})}return f}catch(I){return N(`Failed to load MCP servers from ${L}: ${I}`,{level:"error"}),null}}function rV9(H,$){let A={};for(let[L,I]of Object.entries(H)){let D=`plugin:${$}:${L}`;A[D]={...I,scope:"dynamic"}}return A}function gRH(H,$){return H.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g,$)}function aV9(H,$){return H.replace(/\$\{user_config\.([^}]+)\}/g,(A,L)=>{let I=$[L];if(I===void 0)throw Error(`Missing required user configuration value: ${L}. This should have been validated before variable substitution.`);return String(I)})}function oV9(H,$,A,L,I,D){let B=[],f=(M)=>{let G=gRH(M,$);if(A)G=aV9(G,A);let{expanded:U,missingVars:X}=YKH(G);return B.push(...X),U},E;switch(H.type){case void 0:case"stdio":{let M={...H};if(M.command)M.command=f(M.command);if(M.args)M.args=M.args.map((U)=>f(U));let G={CLAUDE_PLUGIN_ROOT:$,...M.env||{}};for(let[U,X]of Object.entries(G))if(U!=="CLAUDE_PLUGIN_ROOT")G[U]=f(X);M.env=G,E=M;break}case"sse":case"http":case"ws":{let M={...H};if(M.url)M.url=f(M.url);if(M.headers){let G={};for(let[U,X]of Object.entries(M.headers))G[U]=f(X);M.headers=G}E=M;break}case"sse-ide":case"ws-ide":case"sdk":case"claudeai-proxy":E=H;break}if(L&&B.length>0){let G=[...new Set(B)].join(", ");if(N(`Missing environment variables in plugin MCP config: ${G}`,{level:"warn"}),I&&D)L.push({type:"mcp-config-invalid",source:`plugin:${I}`,plugin:I,serverName:D,validationError:`Missing environment variables: ${G}`})}return E}async function jjI(H,$=[]){if(!H.enabled)return;let A=H.mcpServers||await sWA(H,$);if(!A)return;let L={};for(let[I,D]of Object.entries(A))L[I]=oV9(D,H.path,void 0,$,H.name,I);return rV9(L,H.name)}var SjI;var tJ$=K(()=>{DL();E$();O$H();oWA();Z$();SjI=require("path")});function eWA(H){if(!H||!H.trim())return[];let $=TE(H,(A)=>`$${A}`);if(!$.success)return H.split(/\s+/).filter(Boolean);return $.tokens.filter((A)=>typeof A==="string")}function mRH(H){if(!H)return[];let $=(A)=>typeof A==="string"&&A.trim()!==""&&!/^\d+$/.test(A);if(Array.isArray(H))return H.filter($);if(typeof H==="string")return H.split(/\s+/).filter($);return[]}function RjI(H,$){let A=H.slice($.length);if(A.length===0)return;return A.map((L)=>`[${L}]`).join(" ")}function sKH(H,$,A=!0,L=[]){if($===void 0||$===null)return H;let I=eWA($),D=H;for(let B=0;B{let E=parseInt(f,10);return I[E]??""}),H=H.replace(/\$(\d+)(?!\w)/g,(B,f)=>{let E=parseInt(f,10);return I[E]??""}),H=H.replaceAll("$ARGUMENTS",$),H===D&&A&&$)H=H+` `)}function L7A(){if(PG())return A7A({displayName:Pm(),memoryDir:$7A()});return null}var pa="MEMORY.md",iRH=200;var I7A=K(()=>{DL();G3();z$()});function $P9(H){return H.replace(/:/g,"-")}function B7A(H,$){let A=$P9(H);switch($){case"project":return kQ.join(C$(),".claude","agent-memory",A)+kQ.sep;case"local":return kQ.join(C$(),".claude","agent-memory-local",A)+kQ.sep;case"user":return kQ.join(D7A.homedir(),".claude","agent-memory",A)+kQ.sep}}function nRH(H){let $=kQ.normalize(H),A=kQ.join(D7A.homedir(),".claude","agent-memory")+kQ.sep,L=kQ.join(C$(),".claude","agent-memory")+kQ.sep,I=kQ.join(C$(),".claude","agent-memory-local")+kQ.sep;return $.startsWith(A)||$.startsWith(L)||$.startsWith(I)}function AP9(H,$){return kQ.join(B7A(H,$),"MEMORY.md")}function LP9(H,$){return kQ.join(B7A(H,$),"memory.md")}function IP9(H,$){let A=zH(),L=LP9(H,$),I=AP9(H,$);try{A.renameSync(L,I)}catch{}}function ujI(H){switch(H){case"user":return"User (~/.claude/agent-memory/)";case"project":return"Project (.claude/agent-memory/)";case"local":return"Local (.claude/agent-memory-local/)";default:return"None"}}function HBH(H,$){IP9(H,$);let A;switch($){case"user":A="- Since this memory is user-scope, keep learnings general since they apply across all projects";break;case"project":A="- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project";break;case"local":A="- Since this memory is local-scope (not checked into version control), tailor your memories to this project and machine";break}return A7A({displayName:"Persistent Agent Memory",memoryDir:B7A(H,$),extraGuidelines:[A]})}var kQ,D7A;var $BH=K(()=>{DL();PI();I7A();kQ=require("path"),D7A=require("os")});function mjI(H,$,A,L){let I=[],D=zH();function B(f,E=[]){try{let M=D.readdirSync(f);for(let G of M){let U=$F$.join(f,G.name);if(G.isDirectory())B(U,[...E,G.name]);else if(G.isFile()&&G.name.endsWith(".md")){let X=pjI(U,$,E,A,L);if(X)I.push(X)}}}catch(M){N(`Failed to scan agents directory ${f}: ${M}`,{level:"error"})}}return B(H),I}function pjI(H,$,A,L,I){let D=zH();if(LR(D,H,I))return null;try{let B=D.readFileSync(H,{encoding:"utf-8"}),{frontmatter:f,content:E}=MK(B,H),M=f.name||$F$.basename(H).replace(/\.md$/,""),U=[$,...A,M].join(":"),X=f.description||f["when-to-use"]||`Agent from ${$} plugin`,J=LBH(f.tools),F=xx(f.skills),Q=f.color,W=f.model,P=f.forkContext,C=E.trim(),Y=f.memory,Z;if(Y!==void 0)if(gjI.includes(Y))Z=Y;else N(`Plugin agent file ${H} has invalid memory value '${Y}'. Valid options: ${gjI.join(", ")}`);if(PG()&&Z&&J!==void 0){let q=new Set(J);for(let O of[U1,TB,$B])if(!q.has(O))J=[...J,O]}return{agentType:U,whenToUse:X,tools:J,...F!==void 0?{skills:F}:{},getSystemPrompt:()=>{if(PG()&&Z){let q=HBH(U,Z);return C+` ]`).replace("lheading",XRI).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},NP9=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OP9=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,FRI=/^( {2,}|\\)\n(?!\s*$)/,xP9=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,WRI=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vP9=XM(WRI,"u").replace(/punct/g,XF$).getRegex(),hP9=XM(WRI,"u").replace(/punct/g,QRI).getRegex(),bP9=XM(VRI,"gu").replace(/notPunctSpace/g,KRI).replace(/punctSpace/g,C7A).replace(/punct/g,XF$).getRegex(),kP9=XM(VRI,"gu").replace(/notPunctSpace/g,RP9).replace(/punctSpace/g,jP9).replace(/punct/g,QRI).getRegex(),uP9=XM("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,KRI).replace(/punctSpace/g,C7A).replace(/punct/g,XF$).getRegex(),gP9=XM(/\\(punct)/,"gu").replace(/punct/g,XF$).getRegex(),mP9=XM(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pP9=XM(_7A).replace("(?:-->|$)","-->").getRegex(),dP9=XM("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",pP9).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),GF$=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,cP9=XM(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",GF$).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),PRI=XM(/^!?\[(label)\]\[(ref)\]/).replace("label",GF$).replace("ref",P7A).getRegex(),_RI=XM(/^!?\[(ref)\](?:\[\])?/).replace("ref",P7A).getRegex(),lP9=XM("reflink|nolink(?!\\()","g").replace("reflink",PRI).replace("nolink",_RI).getRegex(),w7A={_backpedal:$yH,anyPunctuation:gP9,autolink:mP9,blockSkip:yP9,br:FRI,code:OP9,del:$yH,emStrongLDelim:vP9,emStrongRDelimAst:bP9,emStrongRDelimUnd:uP9,escape:NP9,link:cP9,nolink:_RI,punctuation:SP9,reflink:PRI,reflinkSearch:lP9,tag:dP9,text:xP9,url:$yH},iP9={...w7A,link:XM(/^!?\[(label)\]\((.*?)\)/).replace("label",GF$).getRegex(),reflink:XM(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",GF$).getRegex()},Q7A={...w7A,emStrongRDelimAst:kP9,emStrongLDelim:hP9,url:XM(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"};AyH=class AyH{options;block;constructor(H){this.options=H||BBH}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(H){return H}postprocess(H){return H}processAllTokens(H){return H}provideLexer(){return this.block?_P.lex:_P.lexInline}provideParser(){return this.block?ST.parse:ST.parseInline}};DBH=new YRI;ef.options=ef.setOptions=function(H){return DBH.setOptions(H),ef.defaults=DBH.defaults,GRI(ef.defaults),ef};ef.getDefaults=W7A;ef.defaults=BBH;ef.use=function(...H){return DBH.use(...H),ef.defaults=DBH.defaults,GRI(ef.defaults),ef};ef.walkTokens=function(H,$){return DBH.walkTokens(H,$)};ef.parseInline=DBH.parseInline;ef.Parser=ST;ef.parser=ST.parse;ef.Renderer=IyH;ef.TextRenderer=JF$;ef.Lexer=_P;ef.lexer=_P.lex;ef.Tokenizer=LyH;ef.Hooks=AyH;ef.parse=ef;mEE=ef.options,pEE=ef.setOptions,dEE=ef.use,cEE=ef.walkTokens,lEE=ef.parseInline,iEE=ST.parse,nEE=_P.lex});class CRI{cache;constructor(H,$){this.cache=new gN({max:H,maxSize:$,sizeCalculation:(A)=>Math.max(1,Buffer.byteLength(A.content))})}get(H){return this.cache.get(ByH.normalize(H))}set(H,$){return this.cache.set(ByH.normalize(H),$),this}has(H){return this.cache.has(ByH.normalize(H))}delete(H){return this.cache.delete(ByH.normalize(H))}clear(){this.cache.clear()}get size(){return this.cache.size}get max(){return this.cache.max}get maxSize(){return this.cache.maxSize}get calculatedSize(){return this.cache.calculatedSize}keys(){return this.cache.keys()}entries(){return this.cache.entries()}dump(){return this.cache.dump()}load(H){this.cache.load(H)}}function _m(H,$=tP9){return new CRI(H,$)}function Z7A(H){return Object.fromEntries(H.entries())}function yx(H){return Array.from(H.keys())}function Ym(H){let $=_m(H.max,H.maxSize);return $.load(H.dump()),$}function eKH(H,$){let A=Ym(H);for(let[L,I]of $.entries()){let D=A.get(L);if(!D||I.timestamp>D.timestamp)A.set(L,I)}return A}var ByH,fBH=100,tP9=26214400;var Y7=K(()=>{CwH();ByH=require("path")});function ZRI(H){return wm(H,zL())}function H_9(H){let{frontmatter:$,content:A}=MK(H);if(!$.paths)return{content:A};let L=_cL($.paths).map((I)=>{return I.endsWith("/**")?I.slice(0,-3):I}).filter((I)=>I.length>0);if(L.length===0||L.every((I)=>I==="**"))return{content:A};return{content:A,paths:L}}function q7A(H,$){try{let A=zH();if(!A.existsSync(H)||!A.statSync(H).isFile())return null;let L=Sf.extname(H).toLowerCase();if(L&&!eP9.has(L))return N(`Skipping non-text file in @include: ${H}`),null;let I=A.readFileSync(H,{encoding:"utf-8"}),{content:D,paths:B}=H_9(I);return{path:H,type:$,content:D,globs:B}}catch(A){if(A instanceof Error&&A.message.includes("EACCES"))c("tengu_claude_md_permission_error",{is_access_error:1,has_home_dir:H.includes(UL())?1:0})}return null}function $_9(H,$){let A=new Set,I=new _P({gfm:!1}).lex(H);function D(B){for(let f of B){if(f.type==="code"||f.type==="codespan")continue;if(f.type==="text"){let E=f.text||"",M=/(?:^|\s)@((?:[^\s\\]|\\ )+)/g,G;while((G=M.exec(E))!==null){let U=G[1];if(!U)continue;if(U=U.replace(/\\ /g," "),U){if(U.startsWith("./")||U.startsWith("~/")||U.startsWith("/")&&U!=="/"||!U.startsWith("@")&&!U.match(/^[#%^&*()]+/)&&U.match(/^[a-zA-Z0-9._-]/)){let J=xD(U,Sf.dirname($));A.add(J)}}}}if(f.tokens)D(f.tokens);if(f.items)D(f.items)}}return D(I),[...A]}function jT(H,$,A,L,I=0,D){if(A.has(H)||I>=A_9)return[];let{resolvedPath:B,isSymlink:f}=OU(zH(),H);if(A.add(H),f)A.add(B);let E=q7A(H,$);if(!E||!E.content.trim())return[];if(D)E.parent=D;let M=[];M.push(E);let G=$_9(E.content,B);for(let U of G){if(!ZRI(U)&&!L)continue;let J=jT(U,$,A,L,I+1,H);M.push(...J)}return M}function EBH({rulesDir:H,type:$,processedPaths:A,includeExternal:L,conditionalRule:I,visitedDirs:D=new Set}){if(D.has(H))return[];try{let B=zH();if(!B.existsSync(H)||!B.statSync(H).isDirectory())return[];let{resolvedPath:f,isSymlink:E}=OU(B,H);if(D.add(H),E)D.add(f);let M=[],G=B.readdirSync(f);for(let U of G){let X=Sf.join(H,U.name),{resolvedPath:J,isSymlink:F}=OU(B,X),Q=F?B.statSync(J):null,W=Q?Q.isDirectory():U.isDirectory(),P=Q?Q.isFile():U.isFile();if(W)M.push(...EBH({rulesDir:J,type:$,processedPaths:A,includeExternal:L,conditionalRule:I,visitedDirs:D}));else if(P&&U.name.endsWith(".md")){let C=jT(J,$,A,L);M.push(...C.filter((Y)=>I?Y.globs:!Y.globs))}}return M}catch(B){if(B instanceof Error&&B.message.includes("EACCES"))c("tengu_claude_rules_md_permission_error",{is_access_error:1,has_home_dir:H.includes(UL())?1:0});return[]}}function MBH(){return QJ().filter((H)=>H.content.length>Cm)}function GBH(){return null}function T7A(){return[]}function TRI(H,$){let A=[],L=N7A();if(A.push(...KF$(H,L,"Managed",$,!1)),HF("userSettings")){let I=O7A();A.push(...KF$(H,I,"User",$,!0))}return A}function zRI(H,$,A){let L=[];if(HF("projectSettings")){let B=Sf.join(H,"CLAUDE.md");L.push(...jT(B,"Project",A,!1));let f=Sf.join(H,".claude","CLAUDE.md");L.push(...jT(f,"Project",A,!1))}if(HF("localSettings")){let B=Sf.join(H,"CLAUDE.local.md");L.push(...jT(B,"Local",A,!1))}let I=Sf.join(H,".claude","rules"),D=new Set(A);L.push(...EBH({rulesDir:I,type:"Project",processedPaths:D,includeExternal:!1,conditionalRule:!1})),L.push(...KF$($,I,"Project",A,!1));for(let B of D)A.add(B);return L}function NRI(H,$,A){let L=Sf.join(H,".claude","rules");return KF$($,L,"Project",A,!1)}function KF$(H,$,A,L,I){return EBH({rulesDir:$,type:A,processedPaths:L,includeExternal:I,conditionalRule:!0}).filter((B)=>{if(!B.globs||B.globs.length===0)return!1;let f=A==="Project"?Sf.dirname(Sf.dirname($)):zL(),E=Sf.isAbsolute(H)?Sf.relative(f,H):H;return wRI.default().add(B.globs).ignores(E)})}function fyH(){let H=[];for(let $ of QJ(!0))if($.type!=="User"&&$.parent&&!ZRI($.path))H.push({path:$.path,parent:$.parent});return H}function z7A(){return fyH().length>0}async function ORI(){let H=Mf();if(H.hasClaudeMdExternalIncludesApproved||H.hasClaudeMdExternalIncludesWarningShown)return!1;return z7A()}function xRI(H){let $=Sf.basename(H);if($==="CLAUDE.md"||$==="CLAUDE.local.md")return!0;if($.endsWith(".md")&&H.includes(`${Sf.sep}.claude${Sf.sep}rules${Sf.sep}`))return!0;return!1}var Sf,wRI,sP9="Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.",Cm=40000,HQH=3000,eP9,A_9=5,QJ,qRI=()=>{let H=QJ(),$=[];for(let A of H)if(A.content){let L=A.type==="Project"?" (project instructions, checked into the codebase)":A.type==="Local"?" (user's private project instructions, not checked in)":" (user's private global instructions for all projects)";$.push(`Contents of ${A.path}${L}: `)}`};var mQ=K(()=>{tD();g$();DL();ZM();z$();FF$();W4();BM();vA();NA();Vu();Y7();E$();Z6();G3();G3();Sf=require("path"),wRI=b(fRH(),1),eP9=new Set([".md",".txt",".text",".json",".yaml",".yml",".toml",".xml",".csv",".html",".htm",".css",".scss",".sass",".less",".js",".ts",".tsx",".jsx",".mjs",".cjs",".mts",".cts",".py",".pyi",".pyw",".rb",".erb",".rake",".go",".rs",".java",".kt",".kts",".scala",".c",".cpp",".cc",".cxx",".h",".hpp",".hxx",".cs",".swift",".sh",".bash",".zsh",".fish",".ps1",".bat",".cmd",".env",".ini",".cfg",".conf",".config",".properties",".sql",".graphql",".gql",".proto",".vue",".svelte",".astro",".ejs",".hbs",".pug",".jade",".php",".pl",".pm",".lua",".r",".R",".dart",".ex",".exs",".erl",".hrl",".clj",".cljs",".cljc",".edn",".hs",".lhs",".elm",".ml",".mli",".f",".f90",".f95",".for",".cmake",".make",".makefile",".gradle",".sbt",".rst",".adoc",".asciidoc",".org",".tex",".latex",".lock",".log",".diff",".patch"]);QJ=o$((H=!1)=>{let $=Date.now();EL("info","memory_files_started");let A=[],L=new Set,I=Mf(),D=H||I.hasClaudeMdExternalIncludesApproved||!1,B=yv("Managed");A.push(...jT(B,"Managed",L,D));let f=N7A();if(A.push(...EBH({rulesDir:f,type:"Managed",processedPaths:L,includeExternal:D,conditionalRule:!1})),HF("userSettings")){let G=yv("User");A.push(...jT(G,"User",L,!0));let U=O7A();A.push(...EBH({rulesDir:U,type:"User",processedPaths:L,includeExternal:!0,conditionalRule:!1}))}let E=[],M=zL();while(M!==Sf.parse(M).root)E.push(M),M=Sf.dirname(M);for(let G of E.reverse()){if(HF("projectSettings")){let U=Sf.join(G,"CLAUDE.md");A.push(...jT(U,"Project",L,D));let X=Sf.join(G,".claude","CLAUDE.md");A.push(...jT(X,"Project",L,D));let J=Sf.join(G,".claude","rules");A.push(...EBH({rulesDir:J,type:"Project",processedPaths:L,includeExternal:D,conditionalRule:!1}))}if(HF("localSettings")){let U=Sf.join(G,"CLAUDE.local.md");A.push(...jT(U,"Local",L,D))}}if(A$(process.env.CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD)){let G=CN();for(let U of G){let X=Sf.join(U,"CLAUDE.md");A.push(...jT(X,"Project",L,D));let J=Sf.join(U,".claude","CLAUDE.md");A.push(...jT(J,"Project",L,D));let F=Sf.join(U,".claude","rules");A.push(...EBH({rulesDir:F,type:"Project",processedPaths:L,includeExternal:D,conditionalRule:!1}))}}if(PG()){let G=q7A(HF$(),"AutoMem");if(G&&!L.has(G.path))L.add(G.path),A.push(G)}return EL("info","memory_files_completed",{duration_ms:Date.now()-$,file_count:A.length,total_content_length:A.reduce((G,U)=>G+U.content.length,0)}),A})});function b4(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="in_process_teammate"}function RT(H){let{viewingAgentTaskId:$,tasks:A}=H;if(!$)return;let L=A[$];if(!L)return;if(!b4(L))return;return L}function SRI(H){let $=RT(H);if($)return{type:"viewed",task:$};return{type:"leader"}}function jRI(H){return RT(H)!==void 0}var UBH=()=>{};function RRI(H){return H.replaceAll(L_9,"'").replaceAll(I_9,"'").replaceAll(D_9,'"').replaceAll(B_9,'"')}function x7A(H){let $=H.split(/(\r\n|\n|\r)/),A="";for(let L=0;L<$.length;L++){let I=$[L];if(I!==void 0)if(L%2===0)A+=I.replace(/\s+$/,"");else A+=I}return A}function XBH(H,$){if(H.includes($))return $;let A=RRI($),I=RRI(H).indexOf(A);if(I!==-1)return H.substring(I,I+$.length);return null}function f_9(H,$,A,L=!1){let I=L?(B,f,E)=>B.replaceAll(f,()=>E):(B,f,E)=>B.replace(f,()=>E);if(A!=="")return I(H,$,A);return!$.endsWith(` This is a BLOCKING REQUIREMENT - deferred tools are NOT available until you load them using this tool. Look for messages in the conversation for the list of tools you can discover. Both query modes (keyword search and direct selection) load the returned tools \u2014 once a tool appears in the results, it is immediately available to call.${LyI}`});function ByI(H){return H.isNonInteractiveSession}function xF$(H){try{let $=new DyI.Ajv({allErrors:!0});if(!$.validateSchema(H))throw Error(`Invalid JSON Schema: ${$.errorsText($.errors)}`);let L=$.compile(H);return{...h7A,inputJSONSchema:H,async call(I){if(!L(I)){let B=L.errors?.map((f)=>`${f.instancePath||"root"}: ${f.message}`).join(", ");throw Error(`Output does not match required schema: ${B}`)}return{data:"Structured output provided successfully",structured_output:I}}}}catch{return null}}var DyI,W_9,V_9,qK="StructuredOutput",h7A;var hv=K(()=>{mI();Z$();DyI=b(AX$(),1),W_9=S.object({}).passthrough(),V_9=S.string().describe("Structured output tool result");h7A={isMcp:!1,isEnabled(){return!0},isConcurrencySafe(){return!0},isReadOnly(){return!0},isDestructive(){return!1},isOpenWorld(){return!1},name:qK,maxResultSizeChars:1e5,async description(){return"Return structured output in the requested format"},async prompt(){return"Use this tool to return your final response in the requested structured format. You MUST call this tool exactly once at the end of your response to provide the structured output."},inputSchema:W_9,outputSchema:V_9,async call(H){return{data:"Structured output provided successfully",structured_output:H}},async checkPermissions(H){return{behavior:"allow",updatedInput:H}},renderToolUseMessage(H){let $=Object.keys(H);if($.length===0)return null;if($.length<=3)return $.map((A)=>`${A}: ${yH(H[A])}`).join(", ");return`${$.length} fields: ${$.slice(0,3).join(", ")}\u2026`},userFacingName:()=>qK,renderToolUseRejectedMessage(){return"Structured output rejected"},renderToolUseErrorMessage(){return"Structured output error"},renderToolUseProgressMessage(){return null},renderToolResultMessage(H){return H},mapToolResultToToolResultBlockParam(H,$){return{tool_use_id:$,type:"tool_result",content:H}}}});var EQH,b7A,SF$,fyI,jF$;var GyH=K(()=>{tG();Mn();vV();GK();ia();hv();EQH=new Set([fQH,xY,TF$,E0,EU,BQH]),b7A=new Set([...EQH]),SF$=new Set([$B,v2,hu,s8,w4,af,WD,TB,U1,aW,WJ,qK,C7,...[],vv]),fyI=new Set([jx,WBH,VBH,xT]),jF$=new Set([vx,QBH,vv,jx,WBH,VBH,xT,E0])});function v8(){return!1}var w7=K(()=>{z$();NA();GyH();hv()});function Z7(H){return H}function ZP(H){return H}var RF$="REPL",EyI;var k7A=K(()=>{EyI=new Set(["Read","Write","Edit","Glob","Grep","Bash","NotebookEdit"])});function UyH(H){let $=UL();if(!H.startsWith($))return null;let A=H.split(bv.win32.sep).join(bv.posix.sep);if(A.includes("/session-memory/")&&A.endsWith(".md"))return"session_memory";if(A.includes("/projects/")&&A.endsWith(".jsonl"))return"session_transcript";return null}function yF$(H){let $=H.split(bv.win32.sep).join(bv.posix.sep);if($.includes("session-memory")&&($.includes(".md")||$.endsWith("*")))return"session_memory";if($.includes(".jsonl")||$.includes("projects")&&$.includes("*.jsonl"))return"session_transcript";return null}function vF$(H){if(PG())return lRH(H);return!1}function P_9(H){if(PG())return nRH(H);return!1}function na(H){if(xRI(H))return!0;if(vF$(H))return!0;if(UyH(H)!==null)return!0;if(P_9(H))return!0;return!1}function MyI(H){let $=bv.normalize(H),A=$.split(bv.win32.sep).join(bv.posix.sep);if(PG()&&(A.includes("/agent-memory/")||A.includes("/agent-memory-local/")))return!0;let L=UL();if(!$.startsWith(L))return!1;if(A.includes("/projects/")||A.includes("/session-memory/"))return!0;if(PG()&&A.includes("/memory/"))return!0;return!1}function GyI(H){if(yF$(H)!==null)return!0;let $=H.replace(/\\/g,"/");if($.includes("CLAUDE.md")||$.includes("CLAUDE.local.md")||$.includes(".claude/rules/"))return!0;if(PG()&&($.includes("agent-memory/")||$.includes("agent-memory-local/")))return!0;return!1}var bv;var XyH=K(()=>{mQ();NA();G3();$BH();G3();bv=require("path")});function __9(H){let $=H;return $?.file_path??$?.path}function Y_9(H){let $=H;if(!$)return!1;if($.path){if(na($.path)||MyI($.path))return!0}if($.glob&&GyI($.glob))return!0;return!1}function C_9(H,$){if(H!==U1&&H!==TB)return!1;let A=__9($);return A!==void 0&&na(A)}function bF$(H,$,A){if(H===RF$)return{isCollapsible:!1,isSearch:!1,isRead:!1,isREPL:!0,isMemoryWrite:!1};if(C_9(H,$))return{isCollapsible:!0,isSearch:!1,isRead:!1,isREPL:!1,isMemoryWrite:!0};let L=$w(A,H);if(!L?.isSearchOrReadCommand)return{isCollapsible:!1,isSearch:!1,isRead:!1,isREPL:!1,isMemoryWrite:!1};let I=L.isSearchOrReadCommand($);return{isCollapsible:I.isSearch||I.isRead,isSearch:I.isSearch,isRead:I.isRead,isREPL:!1,isMemoryWrite:!1}}function JyH(H,$){if(H?.type==="tool_use"&&H.name){let A=bF$(H.name,H.input,$);if(A.isCollapsible||A.isREPL)return{isSearch:A.isSearch,isRead:A.isRead,isREPL:A.isREPL,isMemoryWrite:A.isMemoryWrite}}return null}function hF$(H,$,A){return bF$(H,$,A).isCollapsible}function w_9(H,$){if(H.type==="assistant"){let A=H.message.content[0],L=JyH(A,$);if(L&&A?.type==="tool_use")return{name:A.name,input:A.input,...L}}if(H.type==="grouped_tool_use"){let A=H.messages[0]?.message.content[0],L=JyH(A?{type:"tool_use",name:H.toolName,input:A.input}:void 0,$);if(L&&A?.type==="tool_use")return{name:H.toolName,input:A.input,...L}}return null}function Z_9(H){if(H.type==="assistant"){let $=H.message.content[0];if($?.type==="text"&&$.text.trim().length>0)return!0}return!1}function q_9(H,$){if(H.type==="assistant"){let A=H.message.content[0];if(A?.type==="tool_use"&&!hF$(A.name,A.input,$))return!0}if(H.type==="grouped_tool_use"){let A=H.messages[0]?.message.content[0];if(A?.type==="tool_use"&&!hF$(H.toolName,A.input,$))return!0}return!1}function T_9(H){if(H.type==="assistant"){let $=H.message.content[0];if($?.type==="thinking"||$?.type==="redacted_thinking")return!0}if(H.type==="attachment")return!0;if(H.type==="system")return!0;return!1}function z_9(H,$){if(H.type==="assistant"){let A=H.message.content[0];return A?.type==="tool_use"&&hF$(A.name,A.input,$)}if(H.type==="grouped_tool_use"){let A=H.messages[0]?.message.content[0];return A?.type==="tool_use"&&hF$(H.toolName,A.input,$)}return!1}function N_9(H,$){if(H.type==="user"){let A=H.message.content.filter((L)=>L.type==="tool_result");return A.length>0&&A.every((L)=>$.has(L.tool_use_id))}return!1}function XyI(H){if(H.type==="assistant"){let $=H.message.content[0];if($?.type==="tool_use")return[$.id]}if(H.type==="grouped_tool_use")return H.messages.map(($)=>{let A=$.message.content[0];return A.type==="tool_use"?A.id:""}).filter(Boolean);return[]}function MQH(H){let $=[];for(let A of H.messages)$.push(...XyI(A));return $}function JyI(H,$){return MQH(H).some((A)=>$.has(A))}function FyI(H){let $=H.displayMessage;if($.type==="grouped_tool_use")return $.displayMessage;return $}function u7A(H){if(H.type==="grouped_tool_use")return H.messages.length;return 1}function O_9(H){let $=[];if(H.type==="assistant"){let A=H.message.content[0];if(A?.type==="tool_use"){let L=A.input;if(L?.file_path)$.push(L.file_path)}}else if(H.type==="grouped_tool_use")for(let A of H.messages){let L=A.message.content[0];if(L?.type==="tool_use"){let I=L.input;if(I?.file_path)$.push(I.file_path)}}return $}function UyI(){return{messages:[],searchCount:0,readFilePaths:new Set,readOperationCount:0,toolUseIds:new Set,memorySearchCount:0,memoryReadFilePaths:new Set,memoryWriteCount:0}}function x_9(H){let $=H.messages[0],A=H.readFilePaths.size+H.readOperationCount,L=H.memoryReadFilePaths.size;return{type:"collapsed_read_search",searchCount:Math.max(0,H.searchCount-H.memorySearchCount),readCount:Math.max(0,A-L),replCount:0,memorySearchCount:H.memorySearchCount,memoryReadCount:L,memoryWriteCount:H.memoryWriteCount,messages:H.messages,displayMessage:$,uuid:`collapsed-${$.uuid}`,timestamp:$.timestamp}}function KyI(H,$){let A=[],L=UyI(),I=[];function D(){if(L.messages.length===0)return;A.push(x_9(L));for(let B of I)A.push(B);I=[],L=UyI()}for(let B of H)if(z_9(B,$)){let f=w_9(B,$);if(f.isMemoryWrite)L.memoryWriteCount+=u7A(B);else if(f.isSearch){let E=u7A(B);if(L.searchCount+=E,Y_9(f.input))L.memorySearchCount+=E}else{let E=O_9(B);for(let M of E)if(L.readFilePaths.add(M),na(M))L.memoryReadFilePaths.add(M);if(E.length===0)L.readOperationCount+=u7A(B)}for(let E of XyI(B))L.toolUseIds.add(E);L.messages.push(B)}else if(N_9(B,L.toolUseIds))L.messages.push(B);else if(T_9(B))if(L.messages.length>0)I.push(B);else A.push(B);else if(Z_9(B))D(),A.push(B);else if(q_9(B,$))D(),A.push(B);else D(),A.push(B);return D(),A}function kF$(H,$,A,L=0,I){let D=[];if(I){let{memorySearchCount:f,memoryReadCount:E,memoryWriteCount:M}=I;if(E>0){let G=A?D.length===0?"Recalling":"recalling":D.length===0?"Recalled":"recalled";D.push(`${G} ${E} ${E===1?"memory":"memories"}`)}if(f>0){let G=A?D.length===0?"Searching":"searching":D.length===0?"Searched":"searched";D.push(`${G} memories`)}if(M>0){let G=A?D.length===0?"Writing":"writing":D.length===0?"Wrote":"wrote";D.push(`${G} ${M} ${M===1?"memory":"memories"}`)}}if(H>0){let f=A?D.length===0?"Searching for":"searching for":D.length===0?"Searched for":"searched for";D.push(`${f} ${H} ${H===1?"pattern":"patterns"}`)}if($>0){let f=A?D.length===0?"Reading":"reading":D.length===0?"Read":"read";D.push(`${f} ${$} ${$===1?"file":"files"}`)}if(L>0){let f=A?"REPL'ing":"REPL'd";D.push(`${f} ${L} ${L===1?"time":"times"}`)}let B=D.join(", ");return A?`${B}\u2026`:B}function kv(H){if(H.length===0)return;let $=0,A=0;for(let I=H.length-1;I>=0;I--){let D=H[I];if(D.isSearch)$++;else if(D.isRead)A++;else break}if($+A>=2)return kF$($,A,!0);for(let I=H.length-1;I>=0;I--)if(H[I]?.activityDescription)return H[I].activityDescription;return}var hx=K(()=>{k7A();GK();XyH()});function FyH(){return{toolUseCount:0,latestInputTokens:0,cumulativeOutputTokens:0,recentActivities:[]}}function g7A(H){return H.latestInputTokens+H.cumulativeOutputTokens}function GQH(H,$,A,L){if($.type!=="assistant")return;let I=$.message.usage;H.latestInputTokens=I.input_tokens+(I.cache_creation_input_tokens??0)+(I.cache_read_input_tokens??0),H.cumulativeOutputTokens+=I.output_tokens;for(let D of $.message.content)if(D.type==="tool_use"){if(H.toolUseCount++,D.name!==qK){let B=D.input,f=L?bF$(D.name,B,L):void 0;H.recentActivities.push({toolName:D.name,input:B,activityDescription:A?.(D.name,B),isSearch:f?.isSearch,isRead:f?.isRead})}}while(H.recentActivities.length>S_9)H.recentActivities.shift()}function KyH(H){return{toolUseCount:H.toolUseCount,tokenCount:g7A(H),lastActivity:H.recentActivities.length>0?H.recentActivities[H.recentActivities.length-1]:void 0,recentActivities:[...H.recentActivities]}}function QyH(H){return($,A)=>{return $w(H,$)?.getActivityDescription?.(A)??void 0}}function ra(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="local_agent"}function PBH(H,$,A,L,I,D,B){let f=!1;if(d1(H,I,(F)=>{if(F.notified)return F;return f=!0,{...F,notified:!0}}),!f)return;let E=A==="completed"?`Agent "${$}" completed`:A==="failed"?`Agent "${$}" failed: ${L||"Unknown error"}`:`Agent "${$}" was stopped`,M=vM(H),G=D?` `),N(`Session environment script ready (${ta.length} chars total)`),ta}var gv,lF$,ta=void 0;var iF$=K(()=>{E$();Z9();NA();g$();gv=require("fs"),lF$=require("path")});function a7A(H){let $=k_9[H],A=process.env[H];if(A===void 0)return $;return A==="true"}function XQH(){let H=ux(),$=j$(),A={"user.id":H};if(a7A("OTEL_METRICS_INCLUDE_SESSION_ID"))A["session.id"]=$;if(a7A("OTEL_METRICS_INCLUDE_VERSION"))A["app.version"]={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION;let L=T9();if(L){let{organizationUuid:I,emailAddress:D,accountUuid:B}=L;if(I)A["organization.id"]=I;if(D)A["user.email"]=D;if(B&&a7A("OTEL_METRICS_INCLUDE_ACCOUNT_UUID"))A["user.account_uuid"]=B}if(YY.terminal)A["terminal.type"]=YY.terminal;return A}var k_9;var nF$=K(()=>{g$();vA();Ma();EI();k_9={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}});function g_9(){return A$(process.env.OTEL_LOG_USER_PROMPTS)}function rF$(H){return g_9()?H:""}async function pQ(H,$={}){let A=eS$();if(!A)return;let L={...XQH(),"event.name":H,"event.timestamp":new Date().toISOString(),"event.sequence":u_9++};for(let[I,D]of Object.entries($))if(D!==void 0)L[I]=D;A.emit({body:`claude_code.${H}`,attributes:L})}var u_9=0;var sa=K(()=>{g$();nF$();NA()});var oyI=z((aF$)=>{Object.defineProperty(aF$,"__esModule",{value:!0});aF$._globalThis=void 0;aF$._globalThis=typeof globalThis==="object"?globalThis:global});var tyI=z((YBH)=>{var m_9=YBH&&YBH.__createBinding||(Object.create?function(H,$,A,L){if(L===void 0)L=A;Object.defineProperty(H,L,{enumerable:!0,get:function(){return $[A]}})}:function(H,$,A,L){if(L===void 0)L=A;H[L]=$[A]}),p_9=YBH&&YBH.__exportStar||function(H,$){for(var A in H)if(A!=="default"&&!Object.prototype.hasOwnProperty.call($,A))m_9($,H,A)};Object.defineProperty(YBH,"__esModule",{value:!0});p_9(oyI(),YBH)});var syI=z((CBH)=>{var d_9=CBH&&CBH.__createBinding||(Object.create?function(H,$,A,L){if(L===void 0)L=A;Object.defineProperty(H,L,{enumerable:!0,get:function(){return $[A]}})}:function(H,$,A,L){if(L===void 0)L=A;H[L]=$[A]}),c_9=CBH&&CBH.__exportStar||function(H,$){for(var A in H)if(A!=="default"&&!Object.prototype.hasOwnProperty.call($,A))d_9($,H,A)};Object.defineProperty(CBH,"__esModule",{value:!0});c_9(tyI(),CBH)});var o7A=z((oF$)=>{Object.defineProperty(oF$,"__esModule",{value:!0});oF$.VERSION=void 0;oF$.VERSION="1.9.0"});var $vI=z((JQH)=>{Object.defineProperty(JQH,"__esModule",{value:!0});JQH.isCompatible=JQH._makeCompatibilityCheck=void 0;var l_9=o7A(),eyI=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function HvI(H){let $=new Set([H]),A=new Set,L=H.match(eyI);if(!L)return()=>!1;let I={major:+L[1],minor:+L[2],patch:+L[3],prerelease:L[4]};if(I.prerelease!=null)return function(E){return E===H};function D(f){return A.add(f),!1}function B(f){return $.add(f),!0}return function(E){if($.has(E))return!0;if(A.has(E))return!1;let M=E.match(eyI);if(!M)return D(E);let G={major:+M[1],minor:+M[2],patch:+M[3],prerelease:M[4]};if(G.prerelease!=null)return D(E);if(I.major!==G.major)return D(E);if(I.major===0){if(I.minor===G.minor&&I.patch<=G.patch)return B(E);return D(E)}if(I.minor<=G.minor)return B(E);return D(E)}}JQH._makeCompatibilityCheck=HvI;JQH.isCompatible=HvI(l_9.VERSION)});var wBH=z((ea)=>{Object.defineProperty(ea,"__esModule",{value:!0});ea.unregisterGlobal=ea.getGlobal=ea.registerGlobal=void 0;var i_9=syI(),FQH=o7A(),n_9=$vI(),r_9=FQH.VERSION.split(".")[0],PyH=Symbol.for(`opentelemetry.js.api.${r_9}`),_yH=i_9._globalThis;function a_9(H,$,A,L=!1){var I;let D=_yH[PyH]=(I=_yH[PyH])!==null&&I!==void 0?I:{version:FQH.VERSION};if(!L&&D[H]){let B=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${H}`);return A.error(B.stack||B.message),!1}if(D.version!==FQH.VERSION){let B=Error(`@opentelemetry/api: Registration of version v${D.version} for ${H} does not match previously registered API v${FQH.VERSION}`);return A.error(B.stack||B.message),!1}return D[H]=$,A.debug(`@opentelemetry/api: Registered a global for ${H} v${FQH.VERSION}.`),!0}ea.registerGlobal=a_9;function o_9(H){var $,A;let L=($=_yH[PyH])===null||$===void 0?void 0:$.version;if(!L||!(0,n_9.isCompatible)(L))return;return(A=_yH[PyH])===null||A===void 0?void 0:A[H]}ea.getGlobal=o_9;function t_9(H,$){$.debug(`@opentelemetry/api: Unregistering a global for ${H} v${FQH.VERSION}.`);let A=_yH[PyH];if(A)delete A[H]}ea.unregisterGlobal=t_9});var LvI=z((tF$)=>{Object.defineProperty(tF$,"__esModule",{value:!0});tF$.DiagComponentLogger=void 0;var s_9=wBH();class AvI{constructor(H){this._namespace=H.namespace||"DiagComponentLogger"}debug(...H){return YyH("debug",this._namespace,H)}error(...H){return YyH("error",this._namespace,H)}info(...H){return YyH("info",this._namespace,H)}warn(...H){return YyH("warn",this._namespace,H)}verbose(...H){return YyH("verbose",this._namespace,H)}}tF$.DiagComponentLogger=AvI;function YyH(H,$,A){let L=(0,s_9.getGlobal)("diag");if(!L)return;return A.unshift($),L[H](...A)}});var sF$=z((CyH)=>{Object.defineProperty(CyH,"__esModule",{value:!0});CyH.DiagLogLevel=void 0;var e_9;(function(H){H[H.NONE=0]="NONE",H[H.ERROR=30]="ERROR",H[H.WARN=50]="WARN",H[H.INFO=60]="INFO",H[H.DEBUG=70]="DEBUG",H[H.VERBOSE=80]="VERBOSE",H[H.ALL=9999]="ALL"})(e_9=CyH.DiagLogLevel||(CyH.DiagLogLevel={}))});var IvI=z((eF$)=>{Object.defineProperty(eF$,"__esModule",{value:!0});eF$.createLogLevelDiagLogger=void 0;var zm=sF$();function HY9(H,$){if(Hzm.DiagLogLevel.ALL)H=zm.DiagLogLevel.ALL;$=$||{};function A(L,I){let D=$[L];if(typeof D==="function"&&H>=I)return D.bind($);return function(){}}return{error:A("error",zm.DiagLogLevel.ERROR),warn:A("warn",zm.DiagLogLevel.WARN),info:A("info",zm.DiagLogLevel.INFO),debug:A("debug",zm.DiagLogLevel.DEBUG),verbose:A("verbose",zm.DiagLogLevel.VERBOSE)}}eF$.createLogLevelDiagLogger=HY9});var ZBH=z(($K$)=>{Object.defineProperty($K$,"__esModule",{value:!0});$K$.DiagAPI=void 0;var $Y9=LvI(),AY9=IvI(),DvI=sF$(),HK$=wBH(),LY9="diag";class t7A{constructor(){function H(L){return function(...I){let D=(0,HK$.getGlobal)("diag");if(!D)return;return D[L](...I)}}let $=this,A=(L,I={logLevel:DvI.DiagLogLevel.INFO})=>{var D,B,f;if(L===$){let G=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return $.error((D=G.stack)!==null&&D!==void 0?D:G.message),!1}if(typeof I==="number")I={logLevel:I};let E=(0,HK$.getGlobal)("diag"),M=(0,AY9.createLogLevelDiagLogger)((B=I.logLevel)!==null&&B!==void 0?B:DvI.DiagLogLevel.INFO,L);if(E&&!I.suppressOverrideMessage){let G=(f=Error().stack)!==null&&f!==void 0?f:"";E.warn(`Current logger will be overwritten from ${G}`),M.warn(`Current logger will overwrite one already registered from ${G}`)}return(0,HK$.registerGlobal)("diag",M,$,!0)};$.setLogger=A,$.disable=()=>{(0,HK$.unregisterGlobal)(LY9,$)},$.createComponentLogger=(L)=>{return new $Y9.DiagComponentLogger(L)},$.verbose=H("verbose"),$.debug=H("debug"),$.info=H("info"),$.warn=H("warn"),$.error=H("error")}static instance(){if(!this._instance)this._instance=new t7A;return this._instance}}$K$.DiagAPI=t7A});var BvI=z((AK$)=>{Object.defineProperty(AK$,"__esModule",{value:!0});AK$.BaggageImpl=void 0;class KQH{constructor(H){this._entries=H?new Map(H):new Map}getEntry(H){let $=this._entries.get(H);if(!$)return;return Object.assign({},$)}getAllEntries(){return Array.from(this._entries.entries()).map(([H,$])=>[H,$])}setEntry(H,$){let A=new KQH(this._entries);return A._entries.set(H,$),A}removeEntry(H){let $=new KQH(this._entries);return $._entries.delete(H),$}removeEntries(...H){let $=new KQH(this._entries);for(let A of H)$._entries.delete(A);return $}clear(){return new KQH}}AK$.BaggageImpl=KQH});var fvI=z((LK$)=>{Object.defineProperty(LK$,"__esModule",{value:!0});LK$.baggageEntryMetadataSymbol=void 0;LK$.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var s7A=z((QQH)=>{Object.defineProperty(QQH,"__esModule",{value:!0});QQH.baggageEntryMetadataFromString=QQH.createBaggage=void 0;var IY9=ZBH(),DY9=BvI(),BY9=fvI(),fY9=IY9.DiagAPI.instance();function EY9(H={}){return new DY9.BaggageImpl(new Map(Object.entries(H)))}QQH.createBaggage=EY9;function MY9(H){if(typeof H!=="string")fY9.error(`Cannot create baggage metadata from unknown type: ${typeof H}`),H="";return{__TYPE__:BY9.baggageEntryMetadataSymbol,toString(){return H}}}QQH.baggageEntryMetadataFromString=MY9});var wyH=z((WQH)=>{Object.defineProperty(WQH,"__esModule",{value:!0});WQH.ROOT_CONTEXT=WQH.createContextKey=void 0;function GY9(H){return Symbol.for(H)}WQH.createContextKey=GY9;class IK${constructor(H){let $=this;$._currentContext=H?new Map(H):new Map,$.getValue=(A)=>$._currentContext.get(A),$.setValue=(A,L)=>{let I=new IK$($._currentContext);return I._currentContext.set(A,L),I},$.deleteValue=(A)=>{let L=new IK$($._currentContext);return L._currentContext.delete(A),L}}}WQH.ROOT_CONTEXT=new IK$});var MvI=z((DK$)=>{Object.defineProperty(DK$,"__esModule",{value:!0});DK$.DiagConsoleLogger=void 0;var e7A=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class EvI{constructor(){function H($){return function(...A){if(console){let L=console[$];if(typeof L!=="function")L=console.log;if(typeof L==="function")return L.apply(console,A)}}}for(let $=0;${Object.defineProperty(t0,"__esModule",{value:!0});t0.createNoopMeter=t0.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t0.NOOP_OBSERVABLE_GAUGE_METRIC=t0.NOOP_OBSERVABLE_COUNTER_METRIC=t0.NOOP_UP_DOWN_COUNTER_METRIC=t0.NOOP_HISTOGRAM_METRIC=t0.NOOP_GAUGE_METRIC=t0.NOOP_COUNTER_METRIC=t0.NOOP_METER=t0.NoopObservableUpDownCounterMetric=t0.NoopObservableGaugeMetric=t0.NoopObservableCounterMetric=t0.NoopObservableMetric=t0.NoopHistogramMetric=t0.NoopGaugeMetric=t0.NoopUpDownCounterMetric=t0.NoopCounterMetric=t0.NoopMetric=t0.NoopMeter=void 0;class H6A{constructor(){}createGauge(H,$){return t0.NOOP_GAUGE_METRIC}createHistogram(H,$){return t0.NOOP_HISTOGRAM_METRIC}createCounter(H,$){return t0.NOOP_COUNTER_METRIC}createUpDownCounter(H,$){return t0.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(H,$){return t0.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(H,$){return t0.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(H,$){return t0.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(H,$){}removeBatchObservableCallback(H){}}t0.NoopMeter=H6A;class VQH{}t0.NoopMetric=VQH;class $6A extends VQH{add(H,$){}}t0.NoopCounterMetric=$6A;class A6A extends VQH{add(H,$){}}t0.NoopUpDownCounterMetric=A6A;class L6A extends VQH{record(H,$){}}t0.NoopGaugeMetric=L6A;class I6A extends VQH{record(H,$){}}t0.NoopHistogramMetric=I6A;class ZyH{addCallback(H){}removeCallback(H){}}t0.NoopObservableMetric=ZyH;class D6A extends ZyH{}t0.NoopObservableCounterMetric=D6A;class B6A extends ZyH{}t0.NoopObservableGaugeMetric=B6A;class f6A extends ZyH{}t0.NoopObservableUpDownCounterMetric=f6A;t0.NOOP_METER=new H6A;t0.NOOP_COUNTER_METRIC=new $6A;t0.NOOP_GAUGE_METRIC=new L6A;t0.NOOP_HISTOGRAM_METRIC=new I6A;t0.NOOP_UP_DOWN_COUNTER_METRIC=new A6A;t0.NOOP_OBSERVABLE_COUNTER_METRIC=new D6A;t0.NOOP_OBSERVABLE_GAUGE_METRIC=new B6A;t0.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f6A;function UY9(){return t0.NOOP_METER}t0.createNoopMeter=UY9});var GvI=z((qyH)=>{Object.defineProperty(qyH,"__esModule",{value:!0});qyH.ValueType=void 0;var XY9;(function(H){H[H.INT=0]="INT",H[H.DOUBLE=1]="DOUBLE"})(XY9=qyH.ValueType||(qyH.ValueType={}))});var M6A=z((PQH)=>{Object.defineProperty(PQH,"__esModule",{value:!0});PQH.defaultTextMapSetter=PQH.defaultTextMapGetter=void 0;PQH.defaultTextMapGetter={get(H,$){if(H==null)return;return H[$]},keys(H){if(H==null)return[];return Object.keys(H)}};PQH.defaultTextMapSetter={set(H,$,A){if(H==null)return;H[$]=A}}});var XvI=z((BK$)=>{Object.defineProperty(BK$,"__esModule",{value:!0});BK$.NoopContextManager=void 0;var JY9=wyH();class UvI{active(){return JY9.ROOT_CONTEXT}with(H,$,A,...L){return $.call(A,...L)}bind(H,$){return $}enable(){return this}disable(){return this}}BK$.NoopContextManager=UvI});var TyH=z((fK$)=>{Object.defineProperty(fK$,"__esModule",{value:!0});fK$.ContextAPI=void 0;var FY9=XvI(),G6A=wBH(),JvI=ZBH(),U6A="context",KY9=new FY9.NoopContextManager;class X6A{constructor(){}static getInstance(){if(!this._instance)this._instance=new X6A;return this._instance}setGlobalContextManager(H){return(0,G6A.registerGlobal)(U6A,H,JvI.DiagAPI.instance())}active(){return this._getContextManager().active()}with(H,$,A,...L){return this._getContextManager().with(H,$,A,...L)}bind(H,$){return this._getContextManager().bind(H,$)}_getContextManager(){return(0,G6A.getGlobal)(U6A)||KY9}disable(){this._getContextManager().disable(),(0,G6A.unregisterGlobal)(U6A,JvI.DiagAPI.instance())}}fK$.ContextAPI=X6A});var J6A=z((zyH)=>{Object.defineProperty(zyH,"__esModule",{value:!0});zyH.TraceFlags=void 0;var QY9;(function(H){H[H.NONE=0]="NONE",H[H.SAMPLED=1]="SAMPLED"})(QY9=zyH.TraceFlags||(zyH.TraceFlags={}))});var EK$=z((mv)=>{Object.defineProperty(mv,"__esModule",{value:!0});mv.INVALID_SPAN_CONTEXT=mv.INVALID_TRACEID=mv.INVALID_SPANID=void 0;var WY9=J6A();mv.INVALID_SPANID="0000000000000000";mv.INVALID_TRACEID="00000000000000000000000000000000";mv.INVALID_SPAN_CONTEXT={traceId:mv.INVALID_TRACEID,spanId:mv.INVALID_SPANID,traceFlags:WY9.TraceFlags.NONE}});var GK$=z((MK$)=>{Object.defineProperty(MK$,"__esModule",{value:!0});MK$.NonRecordingSpan=void 0;var VY9=EK$();class FvI{constructor(H=VY9.INVALID_SPAN_CONTEXT){this._spanContext=H}spanContext(){return this._spanContext}setAttribute(H,$){return this}setAttributes(H){return this}addEvent(H,$){return this}addLink(H){return this}addLinks(H){return this}setStatus(H){return this}updateName(H){return this}end(H){}isRecording(){return!1}recordException(H,$){}}MK$.NonRecordingSpan=FvI});var Q6A=z((SY)=>{Object.defineProperty(SY,"__esModule",{value:!0});SY.getSpanContext=SY.setSpanContext=SY.deleteSpan=SY.setSpan=SY.getActiveSpan=SY.getSpan=void 0;var PY9=wyH(),_Y9=GK$(),YY9=TyH(),F6A=(0,PY9.createContextKey)("OpenTelemetry Context Key SPAN");function K6A(H){return H.getValue(F6A)||void 0}SY.getSpan=K6A;function CY9(){return K6A(YY9.ContextAPI.getInstance().active())}SY.getActiveSpan=CY9;function KvI(H,$){return H.setValue(F6A,$)}SY.setSpan=KvI;function wY9(H){return H.deleteValue(F6A)}SY.deleteSpan=wY9;function ZY9(H,$){return KvI(H,new _Y9.NonRecordingSpan($))}SY.setSpanContext=ZY9;function qY9(H){var $;return($=K6A(H))===null||$===void 0?void 0:$.spanContext()}SY.getSpanContext=qY9});var UK$=z((pv)=>{Object.defineProperty(pv,"__esModule",{value:!0});pv.wrapSpanContext=pv.isSpanContextValid=pv.isValidSpanId=pv.isValidTraceId=void 0;var QvI=EK$(),TY9=GK$(),zY9=/^([0-9a-f]{32})$/i,NY9=/^[0-9a-f]{16}$/i;function WvI(H){return zY9.test(H)&&H!==QvI.INVALID_TRACEID}pv.isValidTraceId=WvI;function VvI(H){return NY9.test(H)&&H!==QvI.INVALID_SPANID}pv.isValidSpanId=VvI;function OY9(H){return WvI(H.traceId)&&VvI(H.spanId)}pv.isSpanContextValid=OY9;function xY9(H){return new TY9.NonRecordingSpan(H)}pv.wrapSpanContext=xY9});var P6A=z((XK$)=>{Object.defineProperty(XK$,"__esModule",{value:!0});XK$.NoopTracer=void 0;var SY9=TyH(),PvI=Q6A(),W6A=GK$(),jY9=UK$(),V6A=SY9.ContextAPI.getInstance();class _vI{startSpan(H,$,A=V6A.active()){if(Boolean($===null||$===void 0?void 0:$.root))return new W6A.NonRecordingSpan;let I=A&&(0,PvI.getSpanContext)(A);if(RY9(I)&&(0,jY9.isSpanContextValid)(I))return new W6A.NonRecordingSpan(I);else return new W6A.NonRecordingSpan}startActiveSpan(H,$,A,L){let I,D,B;if(arguments.length<2)return;else if(arguments.length===2)B=$;else if(arguments.length===3)I=$,B=A;else I=$,D=A,B=L;let f=D!==null&&D!==void 0?D:V6A.active(),E=this.startSpan(H,I,f),M=(0,PvI.setSpan)(f,E);return V6A.with(M,B,void 0,E)}}XK$.NoopTracer=_vI;function RY9(H){return typeof H==="object"&&typeof H.spanId==="string"&&typeof H.traceId==="string"&&typeof H.traceFlags==="number"}});var _6A=z((JK$)=>{Object.defineProperty(JK$,"__esModule",{value:!0});JK$.ProxyTracer=void 0;var yY9=P6A(),vY9=new yY9.NoopTracer;class YvI{constructor(H,$,A,L){this._provider=H,this.name=$,this.version=A,this.options=L}startSpan(H,$,A){return this._getTracer().startSpan(H,$,A)}startActiveSpan(H,$,A,L){let I=this._getTracer();return Reflect.apply(I.startActiveSpan,I,arguments)}_getTracer(){if(this._delegate)return this._delegate;let H=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!H)return vY9;return this._delegate=H,this._delegate}}JK$.ProxyTracer=YvI});var wvI=z((FK$)=>{Object.defineProperty(FK$,"__esModule",{value:!0});FK$.NoopTracerProvider=void 0;var hY9=P6A();class CvI{getTracer(H,$,A){return new hY9.NoopTracer}}FK$.NoopTracerProvider=CvI});var Y6A=z((KK$)=>{Object.defineProperty(KK$,"__esModule",{value:!0});KK$.ProxyTracerProvider=void 0;var bY9=_6A(),kY9=wvI(),uY9=new kY9.NoopTracerProvider;class ZvI{getTracer(H,$,A){var L;return(L=this.getDelegateTracer(H,$,A))!==null&&L!==void 0?L:new bY9.ProxyTracer(this,H,$,A)}getDelegate(){var H;return(H=this._delegate)!==null&&H!==void 0?H:uY9}setDelegate(H){this._delegate=H}getDelegateTracer(H,$,A){var L;return(L=this._delegate)===null||L===void 0?void 0:L.getTracer(H,$,A)}}KK$.ProxyTracerProvider=ZvI});var qvI=z((NyH)=>{Object.defineProperty(NyH,"__esModule",{value:!0});NyH.SamplingDecision=void 0;var gY9;(function(H){H[H.NOT_RECORD=0]="NOT_RECORD",H[H.RECORD=1]="RECORD",H[H.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(gY9=NyH.SamplingDecision||(NyH.SamplingDecision={}))});var TvI=z((OyH)=>{Object.defineProperty(OyH,"__esModule",{value:!0});OyH.SpanKind=void 0;var mY9;(function(H){H[H.INTERNAL=0]="INTERNAL",H[H.SERVER=1]="SERVER",H[H.CLIENT=2]="CLIENT",H[H.PRODUCER=3]="PRODUCER",H[H.CONSUMER=4]="CONSUMER"})(mY9=OyH.SpanKind||(OyH.SpanKind={}))});var zvI=z((xyH)=>{Object.defineProperty(xyH,"__esModule",{value:!0});xyH.SpanStatusCode=void 0;var pY9;(function(H){H[H.UNSET=0]="UNSET",H[H.OK=1]="OK",H[H.ERROR=2]="ERROR"})(pY9=xyH.SpanStatusCode||(xyH.SpanStatusCode={}))});var NvI=z((_QH)=>{Object.defineProperty(_QH,"__esModule",{value:!0});_QH.validateValue=_QH.validateKey=void 0;var C6A="[_0-9a-z-*/]",dY9=`[a-z]${C6A}{0,255}`,cY9=`[a-z0-9]${C6A}{0,240}@[a-z]${C6A}{0,13}`,lY9=new RegExp(`^(?:${dY9}|${cY9})$`),iY9=/^[ -~]{0,255}[!-~]$/,nY9=/,|=/;function rY9(H){return lY9.test(H)}_QH.validateKey=rY9;function aY9(H){return iY9.test(H)&&!nY9.test(H)}_QH.validateValue=aY9});var RvI=z((QK$)=>{Object.defineProperty(QK$,"__esModule",{value:!0});QK$.TraceStateImpl=void 0;var OvI=NvI(),xvI=32,oY9=512,SvI=",",jvI="=";class w6A{constructor(H){if(this._internalState=new Map,H)this._parse(H)}set(H,$){let A=this._clone();if(A._internalState.has(H))A._internalState.delete(H);return A._internalState.set(H,$),A}unset(H){let $=this._clone();return $._internalState.delete(H),$}get(H){return this._internalState.get(H)}serialize(){return this._keys().reduce((H,$)=>{return H.push($+jvI+this.get($)),H},[]).join(SvI)}_parse(H){if(H.length>oY9)return;if(this._internalState=H.split(SvI).reverse().reduce(($,A)=>{let L=A.trim(),I=L.indexOf(jvI);if(I!==-1){let D=L.slice(0,I),B=L.slice(I+1,A.length);if((0,OvI.validateKey)(D)&&(0,OvI.validateValue)(B))$.set(D,B)}return $},new Map),this._internalState.size>xvI)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,xvI))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let H=new w6A;return H._internalState=new Map(this._internalState),H}}QK$.TraceStateImpl=w6A});var yvI=z((WK$)=>{Object.defineProperty(WK$,"__esModule",{value:!0});WK$.createTraceState=void 0;var tY9=RvI();function sY9(H){return new tY9.TraceStateImpl(H)}WK$.createTraceState=sY9});var vvI=z((VK$)=>{Object.defineProperty(VK$,"__esModule",{value:!0});VK$.context=void 0;var eY9=TyH();VK$.context=eY9.ContextAPI.getInstance()});var hvI=z((PK$)=>{Object.defineProperty(PK$,"__esModule",{value:!0});PK$.diag=void 0;var HC9=ZBH();PK$.diag=HC9.DiagAPI.instance()});var bvI=z((YQH)=>{Object.defineProperty(YQH,"__esModule",{value:!0});YQH.NOOP_METER_PROVIDER=YQH.NoopMeterProvider=void 0;var $C9=E6A();class Z6A{getMeter(H,$,A){return $C9.NOOP_METER}}YQH.NoopMeterProvider=Z6A;YQH.NOOP_METER_PROVIDER=new Z6A});var uvI=z((_K$)=>{Object.defineProperty(_K$,"__esModule",{value:!0});_K$.MetricsAPI=void 0;var AC9=bvI(),q6A=wBH(),kvI=ZBH(),T6A="metrics";class z6A{constructor(){}static getInstance(){if(!this._instance)this._instance=new z6A;return this._instance}setGlobalMeterProvider(H){return(0,q6A.registerGlobal)(T6A,H,kvI.DiagAPI.instance())}getMeterProvider(){return(0,q6A.getGlobal)(T6A)||AC9.NOOP_METER_PROVIDER}getMeter(H,$,A){return this.getMeterProvider().getMeter(H,$,A)}disable(){(0,q6A.unregisterGlobal)(T6A,kvI.DiagAPI.instance())}}_K$.MetricsAPI=z6A});var gvI=z((YK$)=>{Object.defineProperty(YK$,"__esModule",{value:!0});YK$.metrics=void 0;var LC9=uvI();YK$.metrics=LC9.MetricsAPI.getInstance()});var pvI=z((CK$)=>{Object.defineProperty(CK$,"__esModule",{value:!0});CK$.NoopTextMapPropagator=void 0;class mvI{inject(H,$){}extract(H,$){return H}fields(){return[]}}CK$.NoopTextMapPropagator=mvI});var cvI=z((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});dv.deleteBaggage=dv.setBaggage=dv.getActiveBaggage=dv.getBaggage=void 0;var IC9=TyH(),DC9=wyH(),N6A=(0,DC9.createContextKey)("OpenTelemetry Baggage Key");function dvI(H){return H.getValue(N6A)||void 0}dv.getBaggage=dvI;function BC9(){return dvI(IC9.ContextAPI.getInstance().active())}dv.getActiveBaggage=BC9;function fC9(H,$){return H.setValue(N6A,$)}dv.setBaggage=fC9;function EC9(H){return H.deleteValue(N6A)}dv.deleteBaggage=EC9});var nvI=z((ZK$)=>{Object.defineProperty(ZK$,"__esModule",{value:!0});ZK$.PropagationAPI=void 0;var O6A=wBH(),MC9=pvI(),lvI=M6A(),wK$=cvI(),GC9=s7A(),ivI=ZBH(),x6A="propagation",UC9=new MC9.NoopTextMapPropagator;class S6A{constructor(){this.createBaggage=GC9.createBaggage,this.getBaggage=wK$.getBaggage,this.getActiveBaggage=wK$.getActiveBaggage,this.setBaggage=wK$.setBaggage,this.deleteBaggage=wK$.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new S6A;return this._instance}setGlobalPropagator(H){return(0,O6A.registerGlobal)(x6A,H,ivI.DiagAPI.instance())}inject(H,$,A=lvI.defaultTextMapSetter){return this._getGlobalPropagator().inject(H,$,A)}extract(H,$,A=lvI.defaultTextMapGetter){return this._getGlobalPropagator().extract(H,$,A)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,O6A.unregisterGlobal)(x6A,ivI.DiagAPI.instance())}_getGlobalPropagator(){return(0,O6A.getGlobal)(x6A)||UC9}}ZK$.PropagationAPI=S6A});var rvI=z((qK$)=>{Object.defineProperty(qK$,"__esModule",{value:!0});qK$.propagation=void 0;var XC9=nvI();qK$.propagation=XC9.PropagationAPI.getInstance()});var svI=z((TK$)=>{Object.defineProperty(TK$,"__esModule",{value:!0});TK$.TraceAPI=void 0;var j6A=wBH(),avI=Y6A(),ovI=UK$(),CQH=Q6A(),tvI=ZBH(),R6A="trace";class y6A{constructor(){this._proxyTracerProvider=new avI.ProxyTracerProvider,this.wrapSpanContext=ovI.wrapSpanContext,this.isSpanContextValid=ovI.isSpanContextValid,this.deleteSpan=CQH.deleteSpan,this.getSpan=CQH.getSpan,this.getActiveSpan=CQH.getActiveSpan,this.getSpanContext=CQH.getSpanContext,this.setSpan=CQH.setSpan,this.setSpanContext=CQH.setSpanContext}static getInstance(){if(!this._instance)this._instance=new y6A;return this._instance}setGlobalTracerProvider(H){let $=(0,j6A.registerGlobal)(R6A,this._proxyTracerProvider,tvI.DiagAPI.instance());if($)this._proxyTracerProvider.setDelegate(H);return $}getTracerProvider(){return(0,j6A.getGlobal)(R6A)||this._proxyTracerProvider}getTracer(H,$){return this.getTracerProvider().getTracer(H,$)}disable(){(0,j6A.unregisterGlobal)(R6A,tvI.DiagAPI.instance()),this._proxyTracerProvider=new avI.ProxyTracerProvider}}TK$.TraceAPI=y6A});var evI=z((zK$)=>{Object.defineProperty(zK$,"__esModule",{value:!0});zK$.trace=void 0;var JC9=svI();zK$.trace=JC9.TraceAPI.getInstance()});var kB=z((xB)=>{Object.defineProperty(xB,"__esModule",{value:!0});xB.trace=xB.propagation=xB.metrics=xB.diag=xB.context=xB.INVALID_SPAN_CONTEXT=xB.INVALID_TRACEID=xB.INVALID_SPANID=xB.isValidSpanId=xB.isValidTraceId=xB.isSpanContextValid=xB.createTraceState=xB.TraceFlags=xB.SpanStatusCode=xB.SpanKind=xB.SamplingDecision=xB.ProxyTracerProvider=xB.ProxyTracer=xB.defaultTextMapSetter=xB.defaultTextMapGetter=xB.ValueType=xB.createNoopMeter=xB.DiagLogLevel=xB.DiagConsoleLogger=xB.ROOT_CONTEXT=xB.createContextKey=xB.baggageEntryMetadataFromString=void 0;var FC9=s7A();Object.defineProperty(xB,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return FC9.baggageEntryMetadataFromString}});var HhI=wyH();Object.defineProperty(xB,"createContextKey",{enumerable:!0,get:function(){return HhI.createContextKey}});Object.defineProperty(xB,"ROOT_CONTEXT",{enumerable:!0,get:function(){return HhI.ROOT_CONTEXT}});var KC9=MvI();Object.defineProperty(xB,"DiagConsoleLogger",{enumerable:!0,get:function(){return KC9.DiagConsoleLogger}});var QC9=sF$();Object.defineProperty(xB,"DiagLogLevel",{enumerable:!0,get:function(){return QC9.DiagLogLevel}});var WC9=E6A();Object.defineProperty(xB,"createNoopMeter",{enumerable:!0,get:function(){return WC9.createNoopMeter}});var VC9=GvI();Object.defineProperty(xB,"ValueType",{enumerable:!0,get:function(){return VC9.ValueType}});var $hI=M6A();Object.defineProperty(xB,"defaultTextMapGetter",{enumerable:!0,get:function(){return $hI.defaultTextMapGetter}});Object.defineProperty(xB,"defaultTextMapSetter",{enumerable:!0,get:function(){return $hI.defaultTextMapSetter}});var PC9=_6A();Object.defineProperty(xB,"ProxyTracer",{enumerable:!0,get:function(){return PC9.ProxyTracer}});var _C9=Y6A();Object.defineProperty(xB,"ProxyTracerProvider",{enumerable:!0,get:function(){return _C9.ProxyTracerProvider}});var YC9=qvI();Object.defineProperty(xB,"SamplingDecision",{enumerable:!0,get:function(){return YC9.SamplingDecision}});var CC9=TvI();Object.defineProperty(xB,"SpanKind",{enumerable:!0,get:function(){return CC9.SpanKind}});var wC9=zvI();Object.defineProperty(xB,"SpanStatusCode",{enumerable:!0,get:function(){return wC9.SpanStatusCode}});var ZC9=J6A();Object.defineProperty(xB,"TraceFlags",{enumerable:!0,get:function(){return ZC9.TraceFlags}});var qC9=yvI();Object.defineProperty(xB,"createTraceState",{enumerable:!0,get:function(){return qC9.createTraceState}});var v6A=UK$();Object.defineProperty(xB,"isSpanContextValid",{enumerable:!0,get:function(){return v6A.isSpanContextValid}});Object.defineProperty(xB,"isValidTraceId",{enumerable:!0,get:function(){return v6A.isValidTraceId}});Object.defineProperty(xB,"isValidSpanId",{enumerable:!0,get:function(){return v6A.isValidSpanId}});var h6A=EK$();Object.defineProperty(xB,"INVALID_SPANID",{enumerable:!0,get:function(){return h6A.INVALID_SPANID}});Object.defineProperty(xB,"INVALID_TRACEID",{enumerable:!0,get:function(){return h6A.INVALID_TRACEID}});Object.defineProperty(xB,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return h6A.INVALID_SPAN_CONTEXT}});var AhI=vvI();Object.defineProperty(xB,"context",{enumerable:!0,get:function(){return AhI.context}});var LhI=hvI();Object.defineProperty(xB,"diag",{enumerable:!0,get:function(){return LhI.diag}});var IhI=gvI();Object.defineProperty(xB,"metrics",{enumerable:!0,get:function(){return IhI.metrics}});var DhI=rvI();Object.defineProperty(xB,"propagation",{enumerable:!0,get:function(){return DhI.propagation}});var BhI=evI();Object.defineProperty(xB,"trace",{enumerable:!0,get:function(){return BhI.trace}});xB.default={context:AhI.context,diag:LhI.diag,metrics:IhI.metrics,propagation:DhI.propagation,trace:BhI.trace}});function zF(){if(!(A$(process.env.ENABLE_BETA_TRACING_DETAILED)&&Boolean(process.env.BETA_TRACING_ENDPOINT)))return!1;return tI()}function Nm(H,$=TC9){if(H.length<=$)return{content:H,truncated:!1};return{content:H.slice(0,$)+` ${A}`);if(H.new_context=L,I)H.new_context_truncated=!0,H.new_context_original_length=A.length}var MhI,NK$,fhI,TC9=61440,NC9;var OK$=K(()=>{NA();sa();R4();g$();Z$();MhI=require("crypto"),NK$=new Set,fhI=new Map;NC9=/^\n?([\s\S]*?)\n?<\/system-reminder>$/});function KhI(H){let $=0;for(let A=0;A0?Math.round(D/(B/1000)*100)/100:void 0,U=f!==void 0&&B!==void 0?f-B:void 0,X=U!==void 0&&E!==void 0&&U>0?Math.round(E/(U/1000)*100)/100:void 0,J=M!==void 0&&D!==void 0&&D>0?Math.round(M/D*1e4)/100:void 0,F={...A.args,ttft_ms:B,ttlt_ms:f,prompt_tokens:D,output_tokens:E,cache_read_tokens:M,cache_creation_tokens:$.cacheCreationTokens,message_id:$.messageId??A.args.message_id,success:$.success??!0,error:$.error,duration_ms:I/1000,itps:G,otps:X,cache_hit_rate_pct:J};if(B!==void 0){let Q=A.startTime+B*1000;if(TP.push({name:"First Token",cat:"api,ttft",ph:"B",ts:A.startTime,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:{ttft_ms:B,prompt_tokens:D,itps:G,cache_hit_rate_pct:J}}),TP.push({name:"First Token",cat:"api,ttft",ph:"E",ts:Q,pid:A.agentInfo.processId,tid:A.agentInfo.threadId}),U!==void 0&&U>0)TP.push({name:"Sampling",cat:"api,sampling",ph:"B",ts:Q,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:{sampling_ms:U,output_tokens:E,otps:X}}),TP.push({name:"Sampling",cat:"api,sampling",ph:"E",ts:Q+U*1000,pid:A.agentInfo.processId,tid:A.agentInfo.threadId})}TP.push({name:A.name,cat:A.category,ph:"E",ts:L,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:F}),NF.delete(H)}function _hI(H,$){if(!gx)return"";let A=SK$(),L=xK$();return NF.set(A,{name:`Tool: ${H}`,category:"tool",startTime:Ho(),agentInfo:L,args:{tool_name:H,...$}}),TP.push({name:`Tool: ${H}`,cat:"tool",ph:"B",ts:NF.get(A).startTime,pid:L.processId,tid:L.threadId,args:NF.get(A).args}),A}function YhI(H,$){if(!gx||!H)return;let A=NF.get(H);if(!A)return;let L=Ho(),I=L-A.startTime,D={...A.args,success:$?.success??!0,error:$?.error,result_tokens:$?.resultTokens,duration_ms:I/1000};TP.push({name:A.name,cat:A.category,ph:"E",ts:L,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:D}),NF.delete(H)}function ChI(H){if(!gx)return"";let $=SK$(),A=xK$();return NF.set($,{name:"Waiting for User Input",category:"user_input",startTime:Ho(),agentInfo:A,args:{context:H}}),TP.push({name:"Waiting for User Input",cat:"user_input",ph:"B",ts:NF.get($).startTime,pid:A.processId,tid:A.threadId,args:NF.get($).args}),$}function whI(H,$){if(!gx||!H)return;let A=NF.get(H);if(!A)return;let L=Ho(),I=L-A.startTime,D={...A.args,decision:$?.decision,source:$?.source,duration_ms:I/1000};TP.push({name:A.name,cat:A.category,ph:"E",ts:L,pid:A.agentInfo.processId,tid:A.agentInfo.threadId,args:D}),NF.delete(H)}function ZhI(H){if(!gx)return"";let $=SK$(),A=xK$();return NF.set($,{name:"Interaction",category:"interaction",startTime:Ho(),agentInfo:A,args:{user_prompt_length:H?.length}}),TP.push({name:"Interaction",cat:"interaction",ph:"B",ts:NF.get($).startTime,pid:A.processId,tid:A.threadId,args:NF.get($).args}),$}function qhI(H){if(!gx||!H)return;let $=NF.get(H);if(!$)return;let A=Ho(),L=A-$.startTime;TP.push({name:$.name,cat:$.category,ph:"E",ts:A,pid:$.agentInfo.processId,tid:$.agentInfo.threadId,args:{...$.args,duration_ms:L/1000}}),NF.delete(H)}var gx=!1,TP,NF,g6A,xC9=0,SC9=0,u6A=1,FhI;var SyH=K(()=>{NA();g$();Z$();XE();ZE();E$();TP=[],NF=new Map,g6A=new Map,FhI=new Map});function OF(H){return H.spanContext().spanId||""}function p6A(){{let H=process.env.CLAUDE_CODE_ENHANCED_TELEMETRY_BETA??process.env.ENABLE_ENHANCED_TELEMETRY_BETA;if(A$(H))return!0;if(BE(H))return!1;return NL("enhanced_telemetry_beta",!1)}return!1}function mx(){return p6A()||zF()}function X3(){return hM.trace.getTracer("com.anthropic.claude_code.tracing","1.0.0")}function wQH(H,$={}){return{...XQH(),"span.type":H,...$}}function zhI(H){let $=Om()?ZhI(H):void 0;if(!mx()){if($){let E=hM.trace.getActiveSpan()||X3().startSpan("dummy"),M=OF(E);return _G.set(M,{span:E,startTime:Date.now(),attributes:{},perfettoSpanId:$}),$o.enterWith(E),E}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let A=X3(),I=A$(process.env.OTEL_LOG_USER_PROMPTS)?H:"";ThI++;let D=wQH("interaction",{user_prompt:I,user_prompt_length:H.length,"interaction.sequence":ThI}),B=A.startSpan("claude_code.interaction",{attributes:D});GhI(B,H);let f=OF(B);return _G.set(f,{span:B,startTime:Date.now(),attributes:D,perfettoSpanId:$}),$o.enterWith(B),B}function jyH(){let H=$o.getStore();if(!H)return;let $=OF(H),A=_G.get($);if(!A)return;if(A.ended)return;if(A.perfettoSpanId)qhI(A.perfettoSpanId);if(!mx()){A.ended=!0,_G.delete($),$o.exit(()=>{});return}let L=Date.now()-A.startTime;A.span.setAttributes({"interaction.duration_ms":L}),A.span.end(),A.ended=!0,_G.delete($),$o.exit(()=>{})}function NhI(H,$,A){let L=Om()?VhI({model:H,querySource:$?.querySource,messageId:void 0}):void 0;if(!mx()){if(L){let G=hM.trace.getActiveSpan()||X3().startSpan("dummy"),U=OF(G);return _G.set(U,{span:G,startTime:Date.now(),attributes:{model:H},perfettoSpanId:L}),G}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let I=X3(),D=$o.getStore(),B=wQH("llm_request",{model:H,"llm_request.context":D?"interaction":"standalone"}),f=D?hM.trace.setSpan(hM.context.active(),D):hM.context.active(),E=I.startSpan("claude_code.llm_request",{attributes:B},f);if($?.querySource)E.setAttribute("query_source",$.querySource);UhI(E,$,A);let M=OF(E);return _G.set(M,{span:E,startTime:Date.now(),attributes:B,perfettoSpanId:L}),E}function d6A(H,$){let A;if(H){let D=OF(H);A=_G.get(D)}else for(let[,D]of Array.from(_G.entries()).reverse())if(D.attributes["span.type"]==="llm_request"||D.attributes.model){A=D;break}if(!A)return;let L=Date.now()-A.startTime;if(A.perfettoSpanId)PhI(A.perfettoSpanId,{ttftMs:$?.ttftMs,ttltMs:L,promptTokens:$?.inputTokens,outputTokens:$?.outputTokens,cacheReadTokens:$?.cacheReadTokens,cacheCreationTokens:$?.cacheCreationTokens,success:$?.success,error:$?.error});if(!mx()){_G.delete(OF(A.span));return}let I={duration_ms:L};if($){if($.inputTokens!==void 0)I.input_tokens=$.inputTokens;if($.outputTokens!==void 0)I.output_tokens=$.outputTokens;if($.cacheReadTokens!==void 0)I.cache_read_tokens=$.cacheReadTokens;if($.cacheCreationTokens!==void 0)I.cache_creation_tokens=$.cacheCreationTokens;if($.success!==void 0)I.success=$.success;if($.statusCode!==void 0)I.status_code=$.statusCode;if($.error!==void 0)I.error=$.error;if($.attempt!==void 0)I.attempt=$.attempt;if($.hasToolCall!==void 0)I["response.has_tool_call"]=$.hasToolCall;if($.ttftMs!==void 0)I.ttft_ms=$.ttftMs;XhI(I,$)}A.span.setAttributes(I),A.span.end(),_G.delete(OF(A.span))}function OhI(H,$){let A=Om()?_hI(H,$):void 0;if(!mx()){if(A){let M=hM.trace.getActiveSpan()||X3().startSpan("dummy"),G=OF(M);return _G.set(G,{span:M,startTime:Date.now(),attributes:{"span.type":"tool",tool_name:H},perfettoSpanId:A}),Ao.enterWith(M),M}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let L=X3(),I=$o.getStore(),D=wQH("tool",{tool_name:H,...$}),B=I?hM.trace.setSpan(hM.context.active(),I):hM.context.active(),f=L.startSpan("claude_code.tool",{attributes:D},B),E=OF(f);return _G.set(E,{span:f,startTime:Date.now(),attributes:D,perfettoSpanId:A}),Ao.enterWith(f),f}function xhI(){let H=Om()?ChI("tool_permission"):void 0;if(!mx()){if(H){let f=hM.trace.getActiveSpan()||X3().startSpan("dummy"),E=OF(f);return _G.set(E,{span:f,startTime:Date.now(),attributes:{"span.type":"tool.blocked_on_user"},perfettoSpanId:H}),f}return hM.trace.getActiveSpan()||X3().startSpan("dummy")}let $=X3(),A=Ao.getStore(),L=wQH("tool.blocked_on_user"),I=A?hM.trace.setSpan(hM.context.active(),A):hM.context.active(),D=$.startSpan("claude_code.tool.blocked_on_user",{attributes:L},I),B=OF(D);return _G.set(B,{span:D,startTime:Date.now(),attributes:L,perfettoSpanId:H}),D}function c6A(H,$){let A;for(let[,B]of Array.from(_G.entries()).reverse())if(B.attributes["span.type"]==="tool.blocked_on_user"){A=B;break}if(!A)return;if(A.perfettoSpanId)whI(A.perfettoSpanId,{decision:H,source:$});if(!mx()){let B=OF(A.span);_G.delete(B);return}let I={duration_ms:Date.now()-A.startTime};if(H)I.decision=H;if($)I.source=$;A.span.setAttributes(I),A.span.end();let D=OF(A.span);_G.delete(D)}function ShI(){if(!mx())return hM.trace.getActiveSpan()||X3().startSpan("dummy");let H=X3(),$=Ao.getStore(),A=wQH("tool.execution"),L=$?hM.trace.setSpan(hM.context.active(),$):hM.context.active(),I=H.startSpan("claude_code.tool.execution",{attributes:A},L),D=OF(I);return _G.set(D,{span:I,startTime:Date.now(),attributes:A}),I}function l6A(H){if(!mx())return;let $;for(let[,D]of Array.from(_G.entries()).reverse())if(D.attributes["span.type"]==="tool.execution"){$=D;break}if(!$)return;let L={duration_ms:Date.now()-$.startTime};if(H){if(H.success!==void 0)L.success=H.success;if(H.error!==void 0)L.error=H.error}$.span.setAttributes(L),$.span.end();let I=OF($.span);_G.delete(I)}function RK$(H,$){let A;for(let[,B]of Array.from(_G.entries()).reverse())if(B.attributes["span.type"]==="tool"){A=B;break}if(!A)return;if(A.perfettoSpanId)YhI(A.perfettoSpanId,{success:!0,resultTokens:$});if(!mx()){let B=OF(A.span);_G.delete(B),Ao.exit(()=>{});return}let I={duration_ms:Date.now()-A.startTime};if(H){let B=A.attributes.tool_name||"unknown";JhI(I,B,H)}if($!==void 0)I.result_tokens=$;A.span.setAttributes(I),A.span.end();let D=OF(A.span);_G.delete(D),Ao.exit(()=>{})}function RC9(){return A$(process.env.OTEL_LOG_TOOL_CONTENT)}function jhI(H,$){if(!mx()||!RC9())return;let A=Ao.getStore();if(!A)return;let L={};for(let[I,D]of Object.entries($))if(typeof D==="string"){let{content:B,truncated:f}=Nm(D);if(L[I]=B,f)L[`${I}_truncated`]=!0,L[`${I}_original_length`]=D.length}else L[I]=D;A.addEvent(H,L)}function RhI(H,$,A,L){if(!zF())return hM.trace.getActiveSpan()||X3().startSpan("dummy");let I=X3(),D=Ao.getStore()||$o.getStore(),B=wQH("hook",{hook_event:H,hook_name:$,num_hooks:A,hook_definitions:L}),f=D?hM.trace.setSpan(hM.context.active(),D):hM.context.active(),E=I.startSpan("claude_code.hook",{attributes:B},f),M=OF(E);return _G.set(M,{span:E,startTime:Date.now(),attributes:B}),E}function yhI(H,$){if(!zF())return;let A=OF(H),L=_G.get(A);if(!L)return;let D={duration_ms:Date.now()-L.startTime};if($){if($.numSuccess!==void 0)D.num_success=$.numSuccess;if($.numBlocking!==void 0)D.num_blocking=$.numBlocking;if($.numNonBlockingError!==void 0)D.num_non_blocking_error=$.numNonBlockingError;if($.numCancelled!==void 0)D.num_cancelled=$.numCancelled}L.span.setAttributes(D),L.span.end(),_G.delete(A)}var hM,m6A,$o,Ao,_G,ThI=0;var Lo=K(()=>{SD();nF$();NA();OK$();SyH();hM=b(kB(),1),m6A=require("async_hooks"),$o=new m6A.AsyncLocalStorage,Ao=new m6A.AsyncLocalStorage,_G=new Map});var v5E,yK$;var vhI=K(()=>{mI();v5E=QD.enum(["allow","deny","ask"]),yK$=QD.object({toolName:QD.string(),ruleContent:QD.string().optional()})});var ZQH,vK$;var i6A=K(()=>{mI();vhI();yW();ZQH=QD.enum(["userSettings","projectSettings","localSettings","session","cliArg"]),vK$=QD.discriminatedUnion("type",[QD.object({type:QD.literal("addRules"),rules:QD.array(yK$),behavior:QD.enum(["allow","deny","ask"]),destination:ZQH}),QD.object({type:QD.literal("replaceRules"),rules:QD.array(yK$),behavior:QD.enum(["allow","deny","ask"]),destination:ZQH}),QD.object({type:QD.literal("removeRules"),rules:QD.array(yK$),behavior:QD.enum(["allow","deny","ask"]),destination:ZQH}),QD.object({type:QD.literal("setMode"),mode:t0L,destination:ZQH}),QD.object({type:QD.literal("addDirectories"),directories:QD.array(QD.string()),destination:ZQH}),QD.object({type:QD.literal("removeDirectories"),directories:QD.array(QD.string()),destination:ZQH})])});function hhI(H){return!(("async"in H)&&H.async===!0)}function qBH(H){return"async"in H&&H.async===!0}var yC9,vC9,hK$;var n6A=K(()=>{mI();KGH();i6A();yC9=S.object({async:S.literal(!0),asyncTimeout:S.number().optional()}),vC9=S.object({continue:S.boolean().describe("Whether Claude should continue after hook (default: true)").optional(),suppressOutput:S.boolean().describe("Hide stdout from transcript (default: false)").optional(),stopReason:S.string().describe("Message shown when continue is false").optional(),decision:S.enum(["approve","block"]).optional(),reason:S.string().describe("Explanation for the decision").optional(),systemMessage:S.string().describe("Warning message shown to the user").optional(),hookSpecificOutput:S.union([S.object({hookEventName:S.literal("PreToolUse"),permissionDecision:S.enum(["allow","deny","ask"]).optional(),permissionDecisionReason:S.string().optional(),updatedInput:S.record(S.string(),S.unknown()).optional(),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("UserPromptSubmit"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("SessionStart"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("Setup"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("SubagentStart"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("PostToolUse"),additionalContext:S.string().optional(),updatedMCPToolOutput:S.unknown().describe("Updates the output for MCP tools").optional()}),S.object({hookEventName:S.literal("PostToolUseFailure"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("Notification"),additionalContext:S.string().optional()}),S.object({hookEventName:S.literal("PermissionRequest"),decision:S.union([S.object({behavior:S.literal("allow"),updatedInput:S.record(S.string(),S.unknown()).optional(),updatedPermissions:S.array(vK$).optional()}),S.object({behavior:S.literal("deny"),message:S.string().optional(),interrupt:S.boolean().optional()})])})]).optional()}),hK$=S.union([yC9,vC9])});function yT(H,$){let A=nD();if(H.aborted||$?.aborted)return A.abort(),{signal:A.signal,cleanup:()=>{}};let L=()=>{A.abort()};H.addEventListener("abort",L),$?.addEventListener("abort",L);let I=()=>{H.removeEventListener("abort",L),$?.removeEventListener("abort",L)};return{signal:A.signal,cleanup:I}}var RyH=K(()=>{eE()});function bhI(H){if(a6A=H,H&&r6A.length>0)for(let $ of r6A.splice(0))H($)}function o6A(H){if(a6A)a6A(H);else r6A.push(H)}function bK$(H){return hC9.includes(H)}function khI(H,$,A){if(!bK$(A))return;o6A({type:"started",hookId:H,hookName:$,hookEvent:A})}function bC9(H){if(!bK$(H.hookEvent))return;if(!A$(process.env.CLAUDE_CODE_REMOTE))return;o6A({type:"progress",...H})}function kK$(H){if(!bK$(H.hookEvent))return()=>{};if(!A$(process.env.CLAUDE_CODE_REMOTE))return()=>{};let $="",A=setInterval(()=>{let{stdout:L,stderr:I,output:D}=H.getOutput();if(D===$)return;$=D,bC9({hookId:H.hookId,hookName:H.hookName,hookEvent:H.hookEvent,stdout:L,stderr:I,output:D})},1000);return A.unref(),()=>clearInterval(A)}function px(H){let $=H.stdout||H.stderr||H.output;if($)N(`Hook ${H.hookName} (${H.hookEvent}) ${H.outcome}: ${f}`}catch(L){return EL("error","git_status_failed",{duration_ms:Date.now()-H}),r(L instanceof Error?L:Error(String(L))),null}}),k5=o$(async()=>{let H=Date.now();EL("info","system_context_started");let $=A$(process.env.CLAUDE_CODE_REMOTE)?null:await $3A(),A=null;return EL("info","system_context_completed",{duration_ms:Date.now()-H,has_git_status:$!==null,has_injection:A!==null}),{...$?{gitStatus:$}:{},...{}}}),u5=o$(async()=>{let H=Date.now();EL("info","user_context_started");let $=process.env.CLAUDE_CODE_DISABLE_CLAUDE_MDS,A=$?null:qRI();return EL("info","user_context_completed",{duration_ms:Date.now()-H,claudemd_length:A?.length??0,claudemd_disabled:Boolean($)}),{...A?{claudeMd:A}:{}}})});function A3A({tools:H,isBuiltIn:$,isAsync:A=!1,permissionMode:L}){return H.filter((I)=>{if(I.name.startsWith("mcp__"))return!0;if(I.name===xY&&L==="plan")return!0;if(EQH.has(I.name))return!1;if(!$&&b7A.has(I.name))return!1;if(A&&!SF$.has(I.name)){if(dL()&&oW()){if(I.name===E0)return!0;if(fyI.has(I.name))return!0}return!1}return!0})}function Io(H,$,A=!1){let{tools:L,disallowedTools:I,source:D,permissionMode:B}=H,f=A3A({tools:$,isBuiltIn:D==="built-in",isAsync:A,permissionMode:B}),E=new Set(I?.map((P)=>{let{toolName:C}=T6(P);return C})??[]),M=f.filter((P)=>!E.has(P.name));if(L===void 0||L.length===1&&L[0]==="*")return{hasWildcard:!0,validTools:[],invalidTools:[],resolvedTools:M};let U=new Map;for(let P of M)U.set(P.name,P);let X=[],J=[],F=[],Q=new Set,W;for(let P of L){let{toolName:C,ruleContent:Y}=T6(P);if(C===E0){if(X.push(P),Y)W=Y.split(",").map((q)=>q.trim());continue}let Z=U.get(C);if(Z){if(X.push(P),!Q.has(Z))F.push(Z),Q.add(Z)}else J.push(P)}return{hasWildcard:!1,validTools:X,invalidTools:J,resolvedTools:F,allowedAgentTypes:W}}function AbI(H,$){let A=R$({content:H}),L=$.message.content.find((E)=>{if(E.type!=="tool_use"||E.name!==E0)return!1;let M=E.input;return"prompt"in M&&M.prompt===H});if(!L)return N(`Could not find matching AgentTool tool use for prompt: ${H.slice(0,50)}...`,{level:"error"}),[A];let I={...$,uuid:HbI.randomUUID(),message:{...$.message,content:[L]}},D=`### FORKING CONVERSATION CONTEXT ### "id": "string", // Model ID (e.g., "claude-3-5-sonnet-20241022") 2. For longer commands, you can save a new file in the user's ~/.claude directory, e.g.: - ~/.claude/statusline-command.sh and reference that file in the settings. 3. Update the user's ~/.claude/settings.json with: 4. If ~/.claude/settings.json is a symlink, update the target file instead. REMEMBER: You can ONLY explore and plan. You CANNOT and MUST NOT write, edit, or modify any files. You do NOT have access to file editing tools.`,nK$={agentType:"Plan",whenToUse:"Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs.",disallowedTools:[E0,qF$,TB,U1,aW],source:"built-in",tools:Uw.tools,baseDir:"built-in",model:"inherit",getSystemPrompt:()=>cC9,criticalSystemReminder_EXPERIMENTAL:"CRITICAL: This is a READ-ONLY task. You CANNOT edit, write, or create files."}});function nC9(){if($O())return`- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.ISSUES_EXPLAINER}`;return"- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug"}var lC9="https://code.claude.com/docs/en/claude_code_docs_map.md",fbI="https://platform.claude.com/llms.txt",D3A="claude-code-guide",iC9,EbI;var B3A=K(()=>{tG();vV();Mn();mL();EI();Z$();iC9=`You are the Claude guide agent. Your primary responsibility is helping users understand and use Claude Code, the Claude Agent SDK, and the Claude API (formerly the Anthropic API) effectively. 7. Reference local project files (CLAUDE.md, .claude/ directory) when relevant using ${$B}, ${af}, and ${s8} Complete the user's request by providing accurate, documentation-based guidance.`;EbI={agentType:D3A,whenToUse:'Use this agent when the user asks questions ("Can Claude...", "Does Claude...", "How do I...") about: (1) Claude Code (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Claude Agent SDK - building custom agents; (3) Claude API (formerly Anthropic API) - API usage, tool use, Anthropic SDK usage. **IMPORTANT:** Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can resume using the "resume" parameter.',tools:[af,s8,$B,w4,v2],source:"built-in",baseDir:"built-in",model:"haiku",permissionMode:"dontAsk",getSystemPrompt({toolUseContext:H}){let $=H.options.commands,A=[],L=$.filter((G)=>G.type==="prompt");if(L.length>0){let G=L.map((U)=>`- /${U.name}: ${U.description}`).join(` When answering questions, consider these configured features and proactively suggest them when relevant.`;return M}}});var RJE;var MbI=K(()=>{ia();GT();RJE=[C7,`${WD}(sleep:*)`,"mcp__slack__send_message","mcp__slack__read_thread","mcp__claude_ai_Slack__slack_send_message","mcp__claude_ai_Slack__slack_read_thread"]});function f3A(){if(A$(process.env.CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS)&&tI())return[];let H=[LbI,vyH,DbI,Uw,nK$];if(process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-ts"&&process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-py"&&process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-cli")H.push(EbI);return H}var GbI=K(()=>{IbI();L3A();BbI();hyH();I3A();B3A();MbI();NA();g$()});function TK(H){return H.source==="built-in"}function rK$(H){return H.source!=="built-in"&&H.source!=="plugin"}function aK$(H){return H.source==="plugin"}function jm(H){let $=H.filter((M)=>M.source==="built-in"),A=H.filter((M)=>M.source==="plugin"),L=H.filter((M)=>M.source==="userSettings"),I=H.filter((M)=>M.source==="projectSettings"),D=H.filter((M)=>M.source==="policySettings"),B=H.filter((M)=>M.source==="flagSettings"),f=[$,A,L,I,B,D],E=new Map;for(let M of f)for(let G of M)E.set(G.agentType,G);return Array.from(E.values())}function E3A(H,$){if(!H.requiredMcpServers||H.requiredMcpServers.length===0)return!0;return H.requiredMcpServers.every((A)=>$.some((L)=>L.toLowerCase().includes(A.toLowerCase())))}function FbI(H,$){return H.filter((A)=>E3A(A,$))}function aC9(H){let{name:$,description:A,model:L}=H;if(!$||typeof $!=="string")return'Missing required "name" field in frontmatter';if(!A||typeof A!=="string")return'Missing required "description" field in frontmatter';if(L&&typeof L==="string"&&!P5H.includes(L))return`Invalid model "${L}". Valid options: ${P5H.join(", ")}`;return"Unknown parsing error"}function oC9(H,$){if(!H.hooks)return;let A=oZ.safeParse(H.hooks);if(!A.success){N(`Invalid hooks in agent '${$}': ${A.error.message}`);return}return A.data}function tC9(H,$,A="flagSettings"){try{let L=JbI.parse($),I=LBH(L.tools);if(PG()&&L.memory&&I!==void 0){let E=new Set(I);for(let M of[U1,TB,$B])if(!E.has(M))I=[...I,M]}let D=L.disallowedTools!==void 0?LBH(L.disallowedTools):void 0,B=L.prompt;return{agentType:H,whenToUse:L.description,...I!==void 0?{tools:I}:{},...D!==void 0?{disallowedTools:D}:{},getSystemPrompt:()=>{if(PG()&&L.memory){let E=HBH(H,L.memory);return B+` `).find((L)=>L.includes("IOPlatformUUID"));if(!$)return;let A=$.split('" = "');if(A.length===2)return A[1].slice(0,-1)}catch(H){Uy9.diag.debug(`error reading machine id: ${H}`)}return}SW$.getMachineId=Xy9});var XLD=z((jW$)=>{Object.defineProperty(jW$,"__esModule",{value:!0});jW$.getMachineId=void 0;var Jy9=require("fs"),Fy9=kB();async function Ky9(){let H=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let $ of H)try{return(await Jy9.promises.readFile($,{encoding:"utf8"})).trim()}catch(A){Fy9.diag.debug(`error reading machine id: ${A}`)}return}jW$.getMachineId=Ky9});var FLD=z((RW$)=>{Object.defineProperty(RW$,"__esModule",{value:!0});RW$.getMachineId=void 0;var Qy9=require("fs"),Wy9=xW$(),JLD=kB();async function Vy9(){try{return(await Qy9.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(H){JLD.diag.debug(`error reading machine id: ${H}`)}try{return(await(0,Wy9.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(H){JLD.diag.debug(`error reading machine id: ${H}`)}return}RW$.getMachineId=Vy9});var QLD=z((yW$)=>{Object.defineProperty(yW$,"__esModule",{value:!0});yW$.getMachineId=void 0;var KLD=require("process"),Py9=xW$(),_y9=kB();async function Yy9(){let $="%windir%\\System32\\REG.exe";if(KLD.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in KLD.env)$="%windir%\\sysnative\\cmd.exe /c "+$;try{let L=(await(0,Py9.execAsync)(`${$} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split("REG_SZ");if(L.length===2)return L[1].trim()}catch(A){_y9.diag.debug(`error reading machine id: ${A}`)}return}yW$.getMachineId=Yy9});var WLD=z((vW$)=>{Object.defineProperty(vW$,"__esModule",{value:!0});vW$.getMachineId=void 0;var Cy9=kB();async function wy9(){Cy9.diag.debug("could not read machine-id: unsupported platform");return}vW$.getMachineId=wy9});var VLD=z((hW$)=>{Object.defineProperty(hW$,"__esModule",{value:!0});hW$.getMachineId=void 0;var Zy9=require("process"),eBH;async function qy9(){if(!eBH)switch(Zy9.platform){case"darwin":eBH=(await Promise.resolve().then(() => b(ULD()))).getMachineId;break;case"linux":eBH=(await Promise.resolve().then(() => b(XLD()))).getMachineId;break;case"freebsd":eBH=(await Promise.resolve().then(() => b(FLD()))).getMachineId;break;case"win32":eBH=(await Promise.resolve().then(() => b(QLD()))).getMachineId;break;default:eBH=(await Promise.resolve().then(() => b(WLD()))).getMachineId;break}return eBH()}hW$.getMachineId=qy9});var rVA=z((oQH)=>{Object.defineProperty(oQH,"__esModule",{value:!0});oQH.normalizeType=oQH.normalizeArch=void 0;var Ty9=(H)=>{switch(H){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return H}};oQH.normalizeArch=Ty9;var zy9=(H)=>{switch(H){case"sunos":return"solaris";case"win32":return"windows";default:return H}};oQH.normalizeType=zy9});var YLD=z((bW$)=>{Object.defineProperty(bW$,"__esModule",{value:!0});bW$.hostDetector=void 0;var aVA=QvH(),PLD=require("os"),Ny9=VLD(),Oy9=rVA();class _LD{detect(H){return{attributes:{[aVA.ATTR_HOST_NAME]:(0,PLD.hostname)(),[aVA.ATTR_HOST_ARCH]:(0,Oy9.normalizeArch)((0,PLD.arch)()),[aVA.ATTR_HOST_ID]:(0,Ny9.getMachineId)()}}}}bW$.hostDetector=new _LD});var qLD=z((kW$)=>{Object.defineProperty(kW$,"__esModule",{value:!0});kW$.osDetector=void 0;var CLD=QvH(),wLD=require("os"),xy9=rVA();class ZLD{detect(H){return{attributes:{[CLD.ATTR_OS_TYPE]:(0,xy9.normalizeType)((0,wLD.platform)()),[CLD.ATTR_OS_VERSION]:(0,wLD.release)()}}}}kW$.osDetector=new ZLD});var zLD=z((uW$)=>{Object.defineProperty(uW$,"__esModule",{value:!0});uW$.processDetector=void 0;var Sy9=kB(),cm=QvH(),jy9=require("os");class TLD{detect(H){let $={[cm.ATTR_PROCESS_PID]:process.pid,[cm.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[cm.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[cm.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[cm.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[cm.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[cm.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};if(process.argv.length>1)$[cm.ATTR_PROCESS_COMMAND]=process.argv[1];try{let A=jy9.userInfo();$[cm.ATTR_PROCESS_OWNER]=A.username}catch(A){Sy9.diag.debug(`error obtaining process owner: ${A}`)}return{attributes:$}}}uW$.processDetector=new TLD});var OLD=z((gW$)=>{Object.defineProperty(gW$,"__esModule",{value:!0});gW$.serviceInstanceIdDetector=void 0;var Ry9=QvH(),yy9=require("crypto");class NLD{detect(H){return{attributes:{[Ry9.ATTR_SERVICE_INSTANCE_ID]:(0,yy9.randomUUID)()}}}}gW$.serviceInstanceIdDetector=new NLD});var xLD=z((av)=>{Object.defineProperty(av,"__esModule",{value:!0});av.serviceInstanceIdDetector=av.processDetector=av.osDetector=av.hostDetector=void 0;var vy9=YLD();Object.defineProperty(av,"hostDetector",{enumerable:!0,get:function(){return vy9.hostDetector}});var hy9=qLD();Object.defineProperty(av,"osDetector",{enumerable:!0,get:function(){return hy9.osDetector}});var by9=zLD();Object.defineProperty(av,"processDetector",{enumerable:!0,get:function(){return by9.processDetector}});var ky9=OLD();Object.defineProperty(av,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return ky9.serviceInstanceIdDetector}})});var SLD=z((ov)=>{Object.defineProperty(ov,"__esModule",{value:!0});ov.serviceInstanceIdDetector=ov.processDetector=ov.osDetector=ov.hostDetector=void 0;var mW$=xLD();Object.defineProperty(ov,"hostDetector",{enumerable:!0,get:function(){return mW$.hostDetector}});Object.defineProperty(ov,"osDetector",{enumerable:!0,get:function(){return mW$.osDetector}});Object.defineProperty(ov,"processDetector",{enumerable:!0,get:function(){return mW$.processDetector}});Object.defineProperty(ov,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return mW$.serviceInstanceIdDetector}})});var jLD=z((tQH)=>{Object.defineProperty(tQH,"__esModule",{value:!0});tQH.noopDetector=tQH.NoopDetector=void 0;class oVA{detect(){return{attributes:{}}}}tQH.NoopDetector=oVA;tQH.noopDetector=new oVA});var RLD=z((vY)=>{Object.defineProperty(vY,"__esModule",{value:!0});vY.noopDetector=vY.serviceInstanceIdDetector=vY.processDetector=vY.osDetector=vY.hostDetector=vY.envDetector=void 0;var uy9=GLD();Object.defineProperty(vY,"envDetector",{enumerable:!0,get:function(){return uy9.envDetector}});var pW$=SLD();Object.defineProperty(vY,"hostDetector",{enumerable:!0,get:function(){return pW$.hostDetector}});Object.defineProperty(vY,"osDetector",{enumerable:!0,get:function(){return pW$.osDetector}});Object.defineProperty(vY,"processDetector",{enumerable:!0,get:function(){return pW$.processDetector}});Object.defineProperty(vY,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return pW$.serviceInstanceIdDetector}});var gy9=jLD();Object.defineProperty(vY,"noopDetector",{enumerable:!0,get:function(){return gy9.noopDetector}})});var sQH=z((zX)=>{Object.defineProperty(zX,"__esModule",{value:!0});zX.defaultServiceName=zX.emptyResource=zX.defaultResource=zX.resourceFromAttributes=zX.serviceInstanceIdDetector=zX.processDetector=zX.osDetector=zX.hostDetector=zX.envDetector=zX.detectResources=void 0;var my9=fLD();Object.defineProperty(zX,"detectResources",{enumerable:!0,get:function(){return my9.detectResources}});var WvH=RLD();Object.defineProperty(zX,"envDetector",{enumerable:!0,get:function(){return WvH.envDetector}});Object.defineProperty(zX,"hostDetector",{enumerable:!0,get:function(){return WvH.hostDetector}});Object.defineProperty(zX,"osDetector",{enumerable:!0,get:function(){return WvH.osDetector}});Object.defineProperty(zX,"processDetector",{enumerable:!0,get:function(){return WvH.processDetector}});Object.defineProperty(zX,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return WvH.serviceInstanceIdDetector}});var tVA=iVA();Object.defineProperty(zX,"resourceFromAttributes",{enumerable:!0,get:function(){return tVA.resourceFromAttributes}});Object.defineProperty(zX,"defaultResource",{enumerable:!0,get:function(){return tVA.defaultResource}});Object.defineProperty(zX,"emptyResource",{enumerable:!0,get:function(){return tVA.emptyResource}});var py9=dVA();Object.defineProperty(zX,"defaultServiceName",{enumerable:!0,get:function(){return py9.defaultServiceName}})});class sVA{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;totalAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(H){if(this._isLogRecordReadonly())return;this._severityText=H}get severityText(){return this._severityText}set severityNumber(H){if(this._isLogRecordReadonly())return;this._severityNumber=H}get severityNumber(){return this._severityNumber}set body(H){if(this._isLogRecordReadonly())return;this._body=H}get body(){return this._body}get eventName(){return this._eventName}set eventName(H){if(this._isLogRecordReadonly())return;this._eventName=H}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(H,$,A){let{timestamp:L,observedTimestamp:I,eventName:D,severityNumber:B,severityText:f,body:E,attributes:M={},context:G}=A,U=Date.now();if(this.hrTime=eQH.timeInputToHrTime(L??U),this.hrTimeObserved=eQH.timeInputToHrTime(I??U),G){let X=tv.trace.getSpanContext(G);if(X&&tv.isSpanContextValid(X))this.spanContext=X}this.severityNumber=B,this.severityText=f,this.body=E,this.resource=H.resource,this.instrumentationScope=$,this._logRecordLimits=H.logRecordLimits,this._eventName=D,this.setAttributes(M)}setAttribute(H,$){if(this._isLogRecordReadonly())return this;if($===null)return this;if(H.length===0)return tv.diag.warn(`Invalid attribute key: ${H}`),this;if(!eQH.isAttributeValue($)&&!(typeof $==="object"&&!Array.isArray($)&&Object.keys($).length>0))return tv.diag.warn(`Invalid attribute value set for key: ${H}`),this;if(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,H)){if(this.droppedAttributesCount===1)tv.diag.warn("Dropping extra attributes.");return this}if(eQH.isAttributeValue($))this.attributes[H]=this._truncateToSize($);else this.attributes[H]=$;return this}setAttributes(H){for(let[$,A]of Object.entries(H))this.setAttribute($,A);return this}setBody(H){return this.body=H,this}setEventName(H){return this.eventName=H,this}setSeverityNumber(H){return this.severityNumber=H,this}setSeverityText(H){return this.severityText=H,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(H){let $=this._logRecordLimits.attributeValueLengthLimit;if($<=0)return tv.diag.warn(`Attribute value limit must be positive, got ${$}`),H;if(typeof H==="string")return this._truncateToLimitUtil(H,$);if(Array.isArray(H))return H.map((A)=>typeof A==="string"?this._truncateToLimitUtil(A,$):A);return H}_truncateToLimitUtil(H,$){if(H.length<=$)return H;return H.substring(0,$)}_isLogRecordReadonly(){if(this._isReadonly)tv.diag.warn("Can not execute the operation on emitted log record");return this._isReadonly}}var tv,eQH;var yLD=K(()=>{tv=b(kB(),1),eQH=b(Kf(),1)});class eVA{instrumentationScope;_sharedState;constructor(H,$){this.instrumentationScope=H,this._sharedState=$}emit(H){let $=H.context||vLD.context.active(),A=new sVA(this._sharedState,this.instrumentationScope,{context:$,...H});this._sharedState.activeProcessor.onEmit(A,$),A._makeReadonly()}}var vLD;var hLD=K(()=>{yLD();vLD=b(kB(),1)});function bLD(){return{forceFlushTimeoutMillis:30000,logRecordLimits:{attributeValueLengthLimit:H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??128},includeTraceContext:!0}}function kLD(H){return{attributeCountLimit:H.attributeCountLimit??H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??H0H.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,attributeValueLengthLimit:H.attributeValueLengthLimit??H0H.getNumberFromEnv("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??H0H.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0}}var H0H;var uLD=K(()=>{H0H=b(Kf(),1)});class HPA{forceFlush(){return Promise.resolve()}onEmit(H,$){}shutdown(){return Promise.resolve()}}class $PA{processors;forceFlushTimeoutMillis;constructor(H,$){this.processors=H,this.forceFlushTimeoutMillis=$}async forceFlush(){let H=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(($)=>gLD.callWithTimeout($.forceFlush(),H)))}onEmit(H,$){this.processors.forEach((A)=>A.onEmit(H,$))}async shutdown(){await Promise.all(this.processors.map((H)=>H.shutdown()))}}var gLD;var mLD=K(()=>{gLD=b(Kf(),1)});class APA{resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];constructor(H,$,A,L){if(this.resource=H,this.forceFlushTimeoutMillis=$,this.logRecordLimits=A,this.processors=L,L.length>0)this.registeredLogRecordProcessors=L,this.activeProcessor=new $PA(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis);else this.activeProcessor=new HPA}}var pLD=K(()=>{mLD()});class $0H{_shutdownOnce;_sharedState;constructor(H={}){let $=dW$.merge({},bLD(),H),A=H.resource??dLD.defaultResource();this._sharedState=new APA(A,$.forceFlushTimeoutMillis,kLD($.logRecordLimits),H?.processors??[]),this._shutdownOnce=new dW$.BindOnceFuture(this._shutdown,this)}getLogger(H,$,A){if(this._shutdownOnce.isCalled)return VvH.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),DvH;if(!H)VvH.diag.warn("Logger requested without instrumentation scope name.");let L=H||dy9,I=`${L}@${$||""}:${A?.schemaUrl||""}`;if(!this._sharedState.loggers.has(I))this._sharedState.loggers.set(I,new eVA({name:L,version:$,schemaUrl:A?.schemaUrl},this._sharedState));return this._sharedState.loggers.get(I)}forceFlush(){if(this._shutdownOnce.isCalled)return VvH.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise;return this._sharedState.activeProcessor.forceFlush()}shutdown(){if(this._shutdownOnce.isCalled)return VvH.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise;return this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}var VvH,dLD,dW$,dy9="unknown";var cLD=K(()=>{qVA();hLD();uLD();pLD();VvH=b(kB(),1),dLD=b(sQH(),1),dW$=b(Kf(),1)});class lW${export(H,$){this._sendLogRecords(H,$)}shutdown(){return Promise.resolve()}_exportInfo(H){return{resource:{attributes:H.resource.attributes},instrumentationScope:H.instrumentationScope,timestamp:cW$.hrTimeToMicroseconds(H.hrTime),traceId:H.spanContext?.traceId,spanId:H.spanContext?.spanId,traceFlags:H.spanContext?.traceFlags,severityText:H.severityText,severityNumber:H.severityNumber,body:H.body,attributes:H.attributes}}_sendLogRecords(H,$){for(let A of H)console.dir(this._exportInfo(A),{depth:3});$?.({code:cW$.ExportResultCode.SUCCESS})}}var cW$;var lLD=K(()=>{cW$=b(Kf(),1)});class LPA{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedLogRecords=[];_timer;_shutdownOnce;constructor(H,$){if(this._exporter=H,this._maxExportBatchSize=$?.maxExportBatchSize??iQ.getNumberFromEnv("OTEL_BLRP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=$?.maxQueueSize??iQ.getNumberFromEnv("OTEL_BLRP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=$?.scheduledDelayMillis??iQ.getNumberFromEnv("OTEL_BLRP_SCHEDULE_DELAY")??5000,this._exportTimeoutMillis=$?.exportTimeoutMillis??iQ.getNumberFromEnv("OTEL_BLRP_EXPORT_TIMEOUT")??30000,this._shutdownOnce=new iQ.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)iLD.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}onEmit(H){if(this._shutdownOnce.isCalled)return;this._addToBuffer(H)}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(H){if(this._finishedLogRecords.length>=this._maxQueueSize)return;this._finishedLogRecords.push(H),this._maybeStartTimer()}_flushAll(){return new Promise((H,$)=>{let A=[],L=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let I=0;I{H()}).catch($)})}_flushOneBatch(){if(this._clearTimer(),this._finishedLogRecords.length===0)return Promise.resolve();return new Promise((H,$)=>{iQ.callWithTimeout(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>H()).catch($)})}_maybeStartTimer(){if(this._isExporting)return;let H=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{if(this._isExporting=!1,this._finishedLogRecords.length>0)this._clearTimer(),this._maybeStartTimer()}).catch(($)=>{this._isExporting=!1,iQ.globalErrorHandler($)})};if(this._finishedLogRecords.length>=this._maxExportBatchSize)return H();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>H(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}_export(H){let $=()=>iQ.internal._export(this._exporter,H).then((L)=>{if(L.code!==iQ.ExportResultCode.SUCCESS)iQ.globalErrorHandler(L.error??Error(`BatchLogRecordProcessor: log record export failed (status ${L})`))}).catch(iQ.globalErrorHandler),A=H.map((L)=>L.resource).filter((L)=>L.asyncAttributesPending);if(A.length===0)return $();else return Promise.all(A.map((L)=>L.waitForAsyncAttributes?.())).then($,iQ.globalErrorHandler)}}var iLD,iQ;var nLD=K(()=>{iLD=b(kB(),1),iQ=b(Kf(),1)});var lm;var rLD=K(()=>{nLD();lm=class lm extends LPA{onShutdown(){}}});var aLD=K(()=>{rLD()});var oLD=K(()=>{aLD()});var IPA=K(()=>{cLD();lLD();oLD()});function cy9(){return{seconds:0,nanos:0}}function tLD(H){return H!==null&&H!==void 0}var PvH;var DPA=K(()=>{PvH={fromJSON(H){return{seconds:tLD(H.seconds)?globalThis.Number(H.seconds):0,nanos:tLD(H.nanos)?globalThis.Number(H.nanos):0}},toJSON(H){let $={};if(H.seconds!==void 0)$.seconds=Math.round(H.seconds);if(H.nanos!==void 0)$.nanos=Math.round(H.nanos);return $},create(H){return PvH.fromPartial(H??{})},fromPartial(H){let $=cy9();return $.seconds=H.seconds??0,$.nanos=H.nanos??0,$}}});function ly9(){return{account_id:0,organization_uuid:"",account_uuid:""}}function BPA(H){return H!==null&&H!==void 0}var im;var fPA=K(()=>{im={fromJSON(H){return{account_id:BPA(H.account_id)?globalThis.Number(H.account_id):0,organization_uuid:BPA(H.organization_uuid)?globalThis.String(H.organization_uuid):"",account_uuid:BPA(H.account_uuid)?globalThis.String(H.account_uuid):""}},toJSON(H){let $={};if(H.account_id!==void 0)$.account_id=Math.round(H.account_id);if(H.organization_uuid!==void 0)$.organization_uuid=H.organization_uuid;if(H.account_uuid!==void 0)$.account_uuid=H.account_uuid;return $},create(H){return im.fromPartial(H??{})},fromPartial(H){let $=ly9();return $.account_id=H.account_id??0,$.organization_uuid=H.organization_uuid??"",$.account_uuid=H.account_uuid??"",$}}});function iy9(){return{actor_id:"",repository_id:"",repository_owner_id:""}}function ny9(){return{platform:"",node_version:"",terminal:"",package_managers:"",runtimes:"",is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:"",github_event_name:"",github_actions_runner_environment:"",github_actions_runner_os:"",github_action_ref:"",wsl_version:"",github_actions_metadata:void 0,arch:"",is_claude_code_remote:!1,remote_environment_type:"",claude_code_container_id:"",claude_code_remote_session_id:"",tags:[],deployment_environment:"",is_conductor:!1,version_base:"",coworker_type:""}}function ry9(){return{slack_team_id:"",is_enterprise_install:!1,trigger:"",creation_method:""}}function ay9(){return{event_name:"",client_timestamp:void 0,model:"",session_id:"",user_type:"",betas:"",env:void 0,entrypoint:"",agent_sdk_version:"",is_interactive:!1,client_type:"",process:"",additional_metadata:"",auth:void 0,server_timestamp:void 0,event_id:"",device_id:"",swe_bench_run_id:"",swe_bench_instance_id:"",swe_bench_task_id:"",email:"",agent_id:"",parent_session_id:"",agent_type:"",slack:void 0,team_name:""}}function oy9(H){let $=(H.seconds||0)*1000;return $+=(H.nanos||0)/1e6,new globalThis.Date($)}function sLD(H){if(H instanceof globalThis.Date)return H;else if(typeof H==="string")return new globalThis.Date(H);else return oy9(PvH.fromJSON(H))}function UB(H){return H!==null&&H!==void 0}var iW$,nW$,rW$,aW$;var eLD=K(()=>{DPA();fPA();iW$={fromJSON(H){return{actor_id:UB(H.actor_id)?globalThis.String(H.actor_id):"",repository_id:UB(H.repository_id)?globalThis.String(H.repository_id):"",repository_owner_id:UB(H.repository_owner_id)?globalThis.String(H.repository_owner_id):""}},toJSON(H){let $={};if(H.actor_id!==void 0)$.actor_id=H.actor_id;if(H.repository_id!==void 0)$.repository_id=H.repository_id;if(H.repository_owner_id!==void 0)$.repository_owner_id=H.repository_owner_id;return $},create(H){return iW$.fromPartial(H??{})},fromPartial(H){let $=iy9();return $.actor_id=H.actor_id??"",$.repository_id=H.repository_id??"",$.repository_owner_id=H.repository_owner_id??"",$}};nW$={fromJSON(H){return{platform:UB(H.platform)?globalThis.String(H.platform):"",node_version:UB(H.node_version)?globalThis.String(H.node_version):"",terminal:UB(H.terminal)?globalThis.String(H.terminal):"",package_managers:UB(H.package_managers)?globalThis.String(H.package_managers):"",runtimes:UB(H.runtimes)?globalThis.String(H.runtimes):"",is_running_with_bun:UB(H.is_running_with_bun)?globalThis.Boolean(H.is_running_with_bun):!1,is_ci:UB(H.is_ci)?globalThis.Boolean(H.is_ci):!1,is_claubbit:UB(H.is_claubbit)?globalThis.Boolean(H.is_claubbit):!1,is_github_action:UB(H.is_github_action)?globalThis.Boolean(H.is_github_action):!1,is_claude_code_action:UB(H.is_claude_code_action)?globalThis.Boolean(H.is_claude_code_action):!1,is_claude_ai_auth:UB(H.is_claude_ai_auth)?globalThis.Boolean(H.is_claude_ai_auth):!1,version:UB(H.version)?globalThis.String(H.version):"",github_event_name:UB(H.github_event_name)?globalThis.String(H.github_event_name):"",github_actions_runner_environment:UB(H.github_actions_runner_environment)?globalThis.String(H.github_actions_runner_environment):"",github_actions_runner_os:UB(H.github_actions_runner_os)?globalThis.String(H.github_actions_runner_os):"",github_action_ref:UB(H.github_action_ref)?globalThis.String(H.github_action_ref):"",wsl_version:UB(H.wsl_version)?globalThis.String(H.wsl_version):"",github_actions_metadata:UB(H.github_actions_metadata)?iW$.fromJSON(H.github_actions_metadata):void 0,arch:UB(H.arch)?globalThis.String(H.arch):"",is_claude_code_remote:UB(H.is_claude_code_remote)?globalThis.Boolean(H.is_claude_code_remote):!1,remote_environment_type:UB(H.remote_environment_type)?globalThis.String(H.remote_environment_type):"",claude_code_container_id:UB(H.claude_code_container_id)?globalThis.String(H.claude_code_container_id):"",claude_code_remote_session_id:UB(H.claude_code_remote_session_id)?globalThis.String(H.claude_code_remote_session_id):"",tags:globalThis.Array.isArray(H?.tags)?H.tags.map(($)=>globalThis.String($)):[],deployment_environment:UB(H.deployment_environment)?globalThis.String(H.deployment_environment):"",is_conductor:UB(H.is_conductor)?globalThis.Boolean(H.is_conductor):!1,version_base:UB(H.version_base)?globalThis.String(H.version_base):"",coworker_type:UB(H.coworker_type)?globalThis.String(H.coworker_type):""}},toJSON(H){let $={};if(H.platform!==void 0)$.platform=H.platform;if(H.node_version!==void 0)$.node_version=H.node_version;if(H.terminal!==void 0)$.terminal=H.terminal;if(H.package_managers!==void 0)$.package_managers=H.package_managers;if(H.runtimes!==void 0)$.runtimes=H.runtimes;if(H.is_running_with_bun!==void 0)$.is_running_with_bun=H.is_running_with_bun;if(H.is_ci!==void 0)$.is_ci=H.is_ci;if(H.is_claubbit!==void 0)$.is_claubbit=H.is_claubbit;if(H.is_github_action!==void 0)$.is_github_action=H.is_github_action;if(H.is_claude_code_action!==void 0)$.is_claude_code_action=H.is_claude_code_action;if(H.is_claude_ai_auth!==void 0)$.is_claude_ai_auth=H.is_claude_ai_auth;if(H.version!==void 0)$.version=H.version;if(H.github_event_name!==void 0)$.github_event_name=H.github_event_name;if(H.github_actions_runner_environment!==void 0)$.github_actions_runner_environment=H.github_actions_runner_environment;if(H.github_actions_runner_os!==void 0)$.github_actions_runner_os=H.github_actions_runner_os;if(H.github_action_ref!==void 0)$.github_action_ref=H.github_action_ref;if(H.wsl_version!==void 0)$.wsl_version=H.wsl_version;if(H.github_actions_metadata!==void 0)$.github_actions_metadata=iW$.toJSON(H.github_actions_metadata);if(H.arch!==void 0)$.arch=H.arch;if(H.is_claude_code_remote!==void 0)$.is_claude_code_remote=H.is_claude_code_remote;if(H.remote_environment_type!==void 0)$.remote_environment_type=H.remote_environment_type;if(H.claude_code_container_id!==void 0)$.claude_code_container_id=H.claude_code_container_id;if(H.claude_code_remote_session_id!==void 0)$.claude_code_remote_session_id=H.claude_code_remote_session_id;if(H.tags?.length)$.tags=H.tags;if(H.deployment_environment!==void 0)$.deployment_environment=H.deployment_environment;if(H.is_conductor!==void 0)$.is_conductor=H.is_conductor;if(H.version_base!==void 0)$.version_base=H.version_base;if(H.coworker_type!==void 0)$.coworker_type=H.coworker_type;return $},create(H){return nW$.fromPartial(H??{})},fromPartial(H){let $=ny9();return $.platform=H.platform??"",$.node_version=H.node_version??"",$.terminal=H.terminal??"",$.package_managers=H.package_managers??"",$.runtimes=H.runtimes??"",$.is_running_with_bun=H.is_running_with_bun??!1,$.is_ci=H.is_ci??!1,$.is_claubbit=H.is_claubbit??!1,$.is_github_action=H.is_github_action??!1,$.is_claude_code_action=H.is_claude_code_action??!1,$.is_claude_ai_auth=H.is_claude_ai_auth??!1,$.version=H.version??"",$.github_event_name=H.github_event_name??"",$.github_actions_runner_environment=H.github_actions_runner_environment??"",$.github_actions_runner_os=H.github_actions_runner_os??"",$.github_action_ref=H.github_action_ref??"",$.wsl_version=H.wsl_version??"",$.github_actions_metadata=H.github_actions_metadata!==void 0&&H.github_actions_metadata!==null?iW$.fromPartial(H.github_actions_metadata):void 0,$.arch=H.arch??"",$.is_claude_code_remote=H.is_claude_code_remote??!1,$.remote_environment_type=H.remote_environment_type??"",$.claude_code_container_id=H.claude_code_container_id??"",$.claude_code_remote_session_id=H.claude_code_remote_session_id??"",$.tags=H.tags?.map((A)=>A)||[],$.deployment_environment=H.deployment_environment??"",$.is_conductor=H.is_conductor??!1,$.version_base=H.version_base??"",$.coworker_type=H.coworker_type??"",$}};rW$={fromJSON(H){return{slack_team_id:UB(H.slack_team_id)?globalThis.String(H.slack_team_id):"",is_enterprise_install:UB(H.is_enterprise_install)?globalThis.Boolean(H.is_enterprise_install):!1,trigger:UB(H.trigger)?globalThis.String(H.trigger):"",creation_method:UB(H.creation_method)?globalThis.String(H.creation_method):""}},toJSON(H){let $={};if(H.slack_team_id!==void 0)$.slack_team_id=H.slack_team_id;if(H.is_enterprise_install!==void 0)$.is_enterprise_install=H.is_enterprise_install;if(H.trigger!==void 0)$.trigger=H.trigger;if(H.creation_method!==void 0)$.creation_method=H.creation_method;return $},create(H){return rW$.fromPartial(H??{})},fromPartial(H){let $=ry9();return $.slack_team_id=H.slack_team_id??"",$.is_enterprise_install=H.is_enterprise_install??!1,$.trigger=H.trigger??"",$.creation_method=H.creation_method??"",$}};aW$={fromJSON(H){return{event_name:UB(H.event_name)?globalThis.String(H.event_name):"",client_timestamp:UB(H.client_timestamp)?sLD(H.client_timestamp):void 0,model:UB(H.model)?globalThis.String(H.model):"",session_id:UB(H.session_id)?globalThis.String(H.session_id):"",user_type:UB(H.user_type)?globalThis.String(H.user_type):"",betas:UB(H.betas)?globalThis.String(H.betas):"",env:UB(H.env)?nW$.fromJSON(H.env):void 0,entrypoint:UB(H.entrypoint)?globalThis.String(H.entrypoint):"",agent_sdk_version:UB(H.agent_sdk_version)?globalThis.String(H.agent_sdk_version):"",is_interactive:UB(H.is_interactive)?globalThis.Boolean(H.is_interactive):!1,client_type:UB(H.client_type)?globalThis.String(H.client_type):"",process:UB(H.process)?globalThis.String(H.process):"",additional_metadata:UB(H.additional_metadata)?globalThis.String(H.additional_metadata):"",auth:UB(H.auth)?im.fromJSON(H.auth):void 0,server_timestamp:UB(H.server_timestamp)?sLD(H.server_timestamp):void 0,event_id:UB(H.event_id)?globalThis.String(H.event_id):"",device_id:UB(H.device_id)?globalThis.String(H.device_id):"",swe_bench_run_id:UB(H.swe_bench_run_id)?globalThis.String(H.swe_bench_run_id):"",swe_bench_instance_id:UB(H.swe_bench_instance_id)?globalThis.String(H.swe_bench_instance_id):"",swe_bench_task_id:UB(H.swe_bench_task_id)?globalThis.String(H.swe_bench_task_id):"",email:UB(H.email)?globalThis.String(H.email):"",agent_id:UB(H.agent_id)?globalThis.String(H.agent_id):"",parent_session_id:UB(H.parent_session_id)?globalThis.String(H.parent_session_id):"",agent_type:UB(H.agent_type)?globalThis.String(H.agent_type):"",slack:UB(H.slack)?rW$.fromJSON(H.slack):void 0,team_name:UB(H.team_name)?globalThis.String(H.team_name):""}},toJSON(H){let $={};if(H.event_name!==void 0)$.event_name=H.event_name;if(H.client_timestamp!==void 0)$.client_timestamp=H.client_timestamp.toISOString();if(H.model!==void 0)$.model=H.model;if(H.session_id!==void 0)$.session_id=H.session_id;if(H.user_type!==void 0)$.user_type=H.user_type;if(H.betas!==void 0)$.betas=H.betas;if(H.env!==void 0)$.env=nW$.toJSON(H.env);if(H.entrypoint!==void 0)$.entrypoint=H.entrypoint;if(H.agent_sdk_version!==void 0)$.agent_sdk_version=H.agent_sdk_version;if(H.is_interactive!==void 0)$.is_interactive=H.is_interactive;if(H.client_type!==void 0)$.client_type=H.client_type;if(H.process!==void 0)$.process=H.process;if(H.additional_metadata!==void 0)$.additional_metadata=H.additional_metadata;if(H.auth!==void 0)$.auth=im.toJSON(H.auth);if(H.server_timestamp!==void 0)$.server_timestamp=H.server_timestamp.toISOString();if(H.event_id!==void 0)$.event_id=H.event_id;if(H.device_id!==void 0)$.device_id=H.device_id;if(H.swe_bench_run_id!==void 0)$.swe_bench_run_id=H.swe_bench_run_id;if(H.swe_bench_instance_id!==void 0)$.swe_bench_instance_id=H.swe_bench_instance_id;if(H.swe_bench_task_id!==void 0)$.swe_bench_task_id=H.swe_bench_task_id;if(H.email!==void 0)$.email=H.email;if(H.agent_id!==void 0)$.agent_id=H.agent_id;if(H.parent_session_id!==void 0)$.parent_session_id=H.parent_session_id;if(H.agent_type!==void 0)$.agent_type=H.agent_type;if(H.slack!==void 0)$.slack=rW$.toJSON(H.slack);if(H.team_name!==void 0)$.team_name=H.team_name;return $},create(H){return aW$.fromPartial(H??{})},fromPartial(H){let $=ay9();return $.event_name=H.event_name??"",$.client_timestamp=H.client_timestamp??void 0,$.model=H.model??"",$.session_id=H.session_id??"",$.user_type=H.user_type??"",$.betas=H.betas??"",$.env=H.env!==void 0&&H.env!==null?nW$.fromPartial(H.env):void 0,$.entrypoint=H.entrypoint??"",$.agent_sdk_version=H.agent_sdk_version??"",$.is_interactive=H.is_interactive??!1,$.client_type=H.client_type??"",$.process=H.process??"",$.additional_metadata=H.additional_metadata??"",$.auth=H.auth!==void 0&&H.auth!==null?im.fromPartial(H.auth):void 0,$.server_timestamp=H.server_timestamp??void 0,$.event_id=H.event_id??"",$.device_id=H.device_id??"",$.swe_bench_run_id=H.swe_bench_run_id??"",$.swe_bench_instance_id=H.swe_bench_instance_id??"",$.swe_bench_task_id=H.swe_bench_task_id??"",$.email=H.email??"",$.agent_id=H.agent_id??"",$.parent_session_id=H.parent_session_id??"",$.agent_type=H.agent_type??"",$.slack=H.slack!==void 0&&H.slack!==null?rW$.fromPartial(H.slack):void 0,$.team_name=H.team_name??"",$}}});function ty9(){return{event_id:"",timestamp:void 0,experiment_id:"",variation_id:0,environment:"",user_attributes:"",experiment_metadata:"",device_id:"",auth:void 0,session_id:"",anonymous_id:"",event_metadata_vars:""}}function sy9(H){let $=(H.seconds||0)*1000;return $+=(H.nanos||0)/1e6,new globalThis.Date($)}function ey9(H){if(H instanceof globalThis.Date)return H;else if(typeof H==="string")return new globalThis.Date(H);else return sy9(PvH.fromJSON(H))}function lT(H){return H!==null&&H!==void 0}var EPA;var HID=K(()=>{DPA();fPA();EPA={fromJSON(H){return{event_id:lT(H.event_id)?globalThis.String(H.event_id):"",timestamp:lT(H.timestamp)?ey9(H.timestamp):void 0,experiment_id:lT(H.experiment_id)?globalThis.String(H.experiment_id):"",variation_id:lT(H.variation_id)?globalThis.Number(H.variation_id):0,environment:lT(H.environment)?globalThis.String(H.environment):"",user_attributes:lT(H.user_attributes)?globalThis.String(H.user_attributes):"",experiment_metadata:lT(H.experiment_metadata)?globalThis.String(H.experiment_metadata):"",device_id:lT(H.device_id)?globalThis.String(H.device_id):"",auth:lT(H.auth)?im.fromJSON(H.auth):void 0,session_id:lT(H.session_id)?globalThis.String(H.session_id):"",anonymous_id:lT(H.anonymous_id)?globalThis.String(H.anonymous_id):"",event_metadata_vars:lT(H.event_metadata_vars)?globalThis.String(H.event_metadata_vars):""}},toJSON(H){let $={};if(H.event_id!==void 0)$.event_id=H.event_id;if(H.timestamp!==void 0)$.timestamp=H.timestamp.toISOString();if(H.experiment_id!==void 0)$.experiment_id=H.experiment_id;if(H.variation_id!==void 0)$.variation_id=Math.round(H.variation_id);if(H.environment!==void 0)$.environment=H.environment;if(H.user_attributes!==void 0)$.user_attributes=H.user_attributes;if(H.experiment_metadata!==void 0)$.experiment_metadata=H.experiment_metadata;if(H.device_id!==void 0)$.device_id=H.device_id;if(H.auth!==void 0)$.auth=im.toJSON(H.auth);if(H.session_id!==void 0)$.session_id=H.session_id;if(H.anonymous_id!==void 0)$.anonymous_id=H.anonymous_id;if(H.event_metadata_vars!==void 0)$.event_metadata_vars=H.event_metadata_vars;return $},create(H){return EPA.fromPartial(H??{})},fromPartial(H){let $=ty9();return $.event_id=H.event_id??"",$.timestamp=H.timestamp??void 0,$.experiment_id=H.experiment_id??"",$.variation_id=H.variation_id??0,$.environment=H.environment??"",$.user_attributes=H.user_attributes??"",$.experiment_metadata=H.experiment_metadata??"",$.device_id=H.device_id??"",$.auth=H.auth!==void 0&&H.auth!==null?im.fromPartial(H.auth):void 0,$.session_id=H.session_id??"",$.anonymous_id=H.anonymous_id??"",$.event_metadata_vars=H.event_metadata_vars??"",$}}});function HWH(){return oW$.join(UL(),"telemetry")}class MPA{endpoint;timeout;maxBatchSize;batchDelayMs;baseBackoffDelayMs;maxBackoffDelayMs;pendingExports=[];isShutdown=!1;backoffRetryTimer=null;backoffAttempt=0;isRetrying=!1;lastExportErrorContext;constructor(H={}){let $=process.env.ANTHROPIC_BASE_URL==="https://api-staging.anthropic.com"?"https://api-staging.anthropic.com":"https://api.anthropic.com";this.endpoint=`${$}/api/event_logging/batch`,this.timeout=H.timeout||1e4,this.maxBatchSize=H.maxBatchSize||200,this.batchDelayMs=H.batchDelayMs||100,this.baseBackoffDelayMs=H.baseBackoffDelayMs||500,this.maxBackoffDelayMs=H.maxBackoffDelayMs||30000,this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return oW$.join(HWH(),`${AID}${j$()}.${$ID}.json`)}async loadEventsFromFile(H){try{let $=await hY.readFile(H);return M$H($)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(H,$){try{if($.length===0)try{await hY.unlink(H)}catch{}else{await hY.mkdir(HWH(),{recursive:!0});let A=$.map((L)=>yH(L)).join(` `;await hY.appendFile(H,A,"utf8")}catch(A){r(A)}}async deleteFile(H){try{await hY.unlink(H)}catch{}}async retryPreviousBatches(){try{if(!IID.existsSync(HWH()))return;let H=`${AID}${j$()}.`,$=(await hY.readdir(HWH())).filter((A)=>A.startsWith(H)&&A.endsWith(".json")).filter((A)=>!A.includes($ID));for(let A of $){let L=oW$.join(HWH(),A);this.retryFileInBackground(L)}}catch(H){r(H)}}async retryFileInBackground(H){let $=await this.loadEventsFromFile(H);if($.length===0){await this.deleteFile(H);return}let A=await this.sendEventsInBatches($);if(A.length===0)await this.deleteFile(H);else await this.saveEventsToFile(H,A)}async export(H,$){if(this.isShutdown){$({code:A0H.ExportResultCode.FAILED,error:Error("Exporter has been shutdown")});return}let A=this.doExport(H,$);this.pendingExports.push(A),A.finally(()=>{let L=this.pendingExports.indexOf(A);if(L>-1)this.pendingExports.splice(L,1)})}async doExport(H,$){try{let A=H.filter((D)=>D.instrumentationScope?.name==="com.anthropic.claude_code.events");if(A.length===0){$({code:A0H.ExportResultCode.SUCCESS});return}let L=this.transformLogsToEvents(A).events;if(L.length===0){$({code:A0H.ExportResultCode.SUCCESS});return}let I=await this.sendEventsInBatches(L);if(I.length>0){await this.queueFailedEvents(I),this.scheduleBackoffRetry();let D=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:"";$({code:A0H.ExportResultCode.FAILED,error:Error(`Failed to export ${I.length} events${D}`)});return}if(this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying)this.retryFailedEvents();$({code:A0H.ExportResultCode.SUCCESS})}catch(A){r(A),$({code:A0H.ExportResultCode.FAILED,error:A instanceof Error?A:Error("Unknown export error")})}}async sendEventsInBatches(H){let $=[];for(let I=0;I0)await new Promise((B)=>setTimeout(B,this.batchDelayMs))}if(A.length>0&&L)this.lastExportErrorContext=L;return A}async queueFailedEvents(H){let $=this.getCurrentBatchFilePath();await this.appendEventsToFile($,H);let A=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:"",L=`1P event logging: ${H.length} events failed to export${A}`;r(Error(L))}scheduleBackoffRetry(){if(this.backoffRetryTimer||this.isRetrying||this.isShutdown)return;let H=this.backoffAttempt+1,$=Math.min(this.baseBackoffDelayMs*H*H,this.maxBackoffDelayMs);this.backoffRetryTimer=setTimeout(()=>{this.backoffRetryTimer=null,this.retryFailedEvents()},$)}async retryFailedEvents(){let H=this.getCurrentBatchFilePath();while(!this.isShutdown){let $=await this.loadEventsFromFile(H);if($.length===0)break;this.isRetrying=!0,this.backoffAttempt++,await this.deleteFile(H);let A=await this.sendEventsInBatches($);if(this.isRetrying=!1,A.length>0){await this.saveEventsToFile(H,A),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){if(this.backoffAttempt=0,this.backoffRetryTimer)clearTimeout(this.backoffRetryTimer),this.backoffRetryTimer=null}async sendBatchWithRetry(H){let $={"Content-Type":"application/json","User-Agent":sG(),"x-service-name":"claude-code"},L=!(XG(!0)||tI());if(!L&&nL()){let f=dD();if(f&&pk(f.expiresAt))L=!0}let I=L?{headers:{},error:"trust not established or Oauth token expired"}:eG(),D=!I.error,B=D?{...$,...I.headers}:$;try{let f=await nA.post(this.endpoint,H,{timeout:this.timeout,headers:B});this.logSuccess(H.events.length,D,f.data);return}catch(f){if(D&&nA.isAxiosError(f)&&f.response?.status===401){let E=await nA.post(this.endpoint,H,{timeout:this.timeout,headers:$});this.logSuccess(H.events.length,!1,E.data);return}throw f}}logSuccess(H,$,A){}hrTimeToDate(H){let[$,A]=H;return new Date($*1000+A/1e6)}transformLogsToEvents(H){let $=[];for(let A of H){let L=A.attributes||{};if(L.event_type==="GrowthbookExperimentEvent"){let G=this.hrTimeToDate(A.hrTime);$.push({event_type:"GrowthbookExperimentEvent",event_data:EPA.toJSON({event_id:L.event_id,timestamp:G,experiment_id:L.experiment_id,variation_id:L.variation_id,environment:L.environment,user_attributes:L.user_attributes,experiment_metadata:L.experiment_metadata,device_id:L.device_id,session_id:L.session_id})});continue}let I=L.event_name||A.body||"unknown",D=L.core_metadata,B=L.user_metadata,f=L.event_metadata||{};if(!D){$.push({event_type:"ClaudeCodeInternalEvent",event_data:aW$.toJSON({event_id:L.event_id,event_name:I,client_timestamp:this.hrTimeToDate(A.hrTime),session_id:j$(),additional_metadata:yH({transform_error:"core_metadata attribute is missing"})})});continue}let E=WqI(D,B,f),M={...E.additional};$.push({event_type:"ClaudeCodeInternalEvent",event_data:aW$.toJSON({event_id:L.event_id,event_name:I,client_timestamp:this.hrTimeToDate(A.hrTime),device_id:L.user_id,email:B?.email,...E.core,env:E.env,process:E.process,additional_metadata:Object.keys(M).length>0?yH(M):void 0})})}return{events:$}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush()}async forceFlush(){await Promise.all(this.pendingExports)}}function Hv9(H){if(!nA.isAxiosError(H))return H instanceof Error?H.message:String(H);let $=[],A=H.response?.headers?.["request-id"];if(A)$.push(`request-id=${A}`);if(H.response?.status)$.push(`status=${H.response.status}`);if(H.code)$.push(`code=${H.code}`);if(H.message)$.push(H.message);return $.join(", ")}var A0H,LID,IID,hY,oW$,$ID,AID="1p_failed_events.";var DID=K(()=>{w1();E$();_$();nM();_Q();EI();Hq();R4();g$();vA();eLD();HID();NA();Z$();A0H=b(Kf(),1),LID=require("crypto"),IID=require("fs"),hY=require("fs/promises"),oW$=b(require("path")),$ID=LID.randomUUID()});var EID={};XA(EID,{shutdown1PEventLogging:()=>eW$,shouldSampleEvent:()=>sW$,logGrowthBookExperimentTo1P:()=>UPA,logEventTo1P:()=>H7$,is1PEventLoggingEnabled:()=>AWH,initialize1PEventLogging:()=>fv9,getEventSamplingConfig:()=>fID});function fID(){return rm($v9,{})}function sW$(H){let A=fID()[H];if(!A)return null;let L=A.sample_rate;if(typeof L!=="number"||L<0||L>1)return null;if(L>=1)return null;if(L<=0)return 0;return Math.random(){await $WH?.forceFlush()}),process.on("beforeExit",async()=>{await $WH?.forceFlush()})}var GPA,BID,tW$,$v9="tengu_event_sampling_config",_vH=null,$WH=null,Iv9=5000,Dv9=200,Bv9=8192;var YvH=K(()=>{vA();Fo();SD();IPA();Z9();ZE();R4();E$();hc();_$();ELH();Z$();DID();GPA=require("crypto"),BID=b(sQH(),1),tW$=b(rBH(),1)});function MID(H){return H.replace(/[A-Z]/g,($)=>`_${$.toLowerCase()}`)}async function A7$(){if(CvH.length===0)return;let H=[...CvH];CvH=[];try{await nA.post(Ev9,H,{headers:{"Content-Type":"application/json","DD-API-KEY":Mv9},timeout:Xv9})}catch($){r($ instanceof Error?$:Error(String($)))}}function Kv9(){if(iT)return;iT=setTimeout(()=>{iT=null,A7$()},Pv9()).unref()}async function XPA(){if(iT)clearTimeout(iT),iT=null;await A7$()}async function JPA(H,$){if(sI()!=="firstParty")return;let A=$7$;if(A===null)A=await Qv9();if(!A||!Jv9.has(H))return;try{let L=await VKH({model:$.model}),{envContext:I,...D}=L,B={...D,...I,...$,userBucket:Vv9()};if(typeof B.toolName==="string"&&B.toolName.startsWith("mcp__"))B.toolName="mcp";if(typeof B.model==="string"){let G=JK(B.model.replace(/\[1m]$/i,""));B.model=G in w9$?G:"other"}if(typeof B.version==="string")B.version=B.version.replace(/^(\d+\.\d+\.\d+-dev\.\d{8})\.t\d+\.sha[a-f0-9]+$/,"$1");if(B.status!==void 0&&B.status!==null){let G=String(B.status);B.http_status=G;let U=G.charAt(0);if(U>="1"&&U<="5")B.http_status_range=`${U}xx`;delete B.status}let f=B,M={ddsource:"nodejs",ddtags:Fv9.filter((G)=>f[G]!==void 0&&f[G]!==null).map((G)=>`${MID(G)}:${f[G]}`).join(","),message:H,service:"claude-code",hostname:"claude-code",env:"external"};for(let[G,U]of Object.entries(B))if(U!==void 0&&U!==null)M[MID(G)]=U;if(CvH.push(M),CvH.length>=Uv9){if(iT)clearTimeout(iT),iT=null;A7$()}else Kv9()}catch(L){r(L instanceof Error?L:Error(String(L)))}}function Pv9(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||"",10)||Gv9}var GID,Ev9="https://http-intake.logs.us5.datadoghq.com/api/v2/logs",Mv9="pubbbf48e6d78dae54bceaa4acf463299bf",Gv9=15000,Uv9=100,Xv9=5000,Jv9,Fv9,CvH,iT=null,$7$=null,Qv9,Wv9=30,Vv9;var FPA=K(()=>{w1();tD();_$();vA();aI();W5H();oM();R4();Fo();GID=require("crypto"),Jv9=new Set(["tengu_api_error","tengu_api_success","tengu_cancel","tengu_compact_failed","tengu_exit","tengu_flicker","tengu_init","tengu_model_fallback_triggered","tengu_oauth_error","tengu_oauth_success","tengu_oauth_token_refresh_failure","tengu_oauth_token_refresh_success","tengu_oauth_token_refresh_lock_acquiring","tengu_oauth_token_refresh_lock_acquired","tengu_oauth_token_refresh_starting","tengu_oauth_token_refresh_completed","tengu_oauth_token_refresh_lock_releasing","tengu_oauth_token_refresh_lock_released","tengu_query_error","tengu_session_quality_classification","tengu_tool_use_error","tengu_tool_use_granted_in_prompt_permanent","tengu_tool_use_granted_in_prompt_temporary","tengu_tool_use_rejected_in_prompt","tengu_tool_use_success"]),Fv9=["arch","clientType","errorType","http_status_range","http_status","model","platform","provider","subscriptionType","toolName","userBucket","userType","version","versionBase"];CvH=[];Qv9=o$(async()=>{if(NP())return $7$=!1,!1;try{let H=async()=>{if(iT)clearTimeout(iT),iT=null;await A7$()};return process.on("beforeExit",H),$7$=!0,!0}catch(H){return r(H instanceof Error?H:Error(String(H))),$7$=!1,!1}});Vv9=o$(()=>{let H=ux(),$=GID.createHash("sha256").update(H).digest("hex");return parseInt($.slice(0,8),16)%Wv9})});function KPA(){if(!process.stdout.isTTY)return;try{L0H.writeSync(1,x5H),L0H.writeSync(1,YLH),L0H.writeSync(1,a5H),L0H.writeSync(1,TO),L0H.writeSync(1,k1$)}catch{}}function QPA(){if(process.stdout.isTTY&&Mk()&&!uZ())try{let H=j$();if(!ZvH(H))return;let $=qvH(H),A;if($)A=`"${$.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;else A=H;L0H.writeSync(1,oH.dim(` claude --resume ${A} `))}catch{}}function L7$(H){if(wvH!==void 0)clearTimeout(wvH),wvH=void 0;try{process.exit(H)}catch($){process.kill(process.pid,"SIGKILL")}throw Error("unreachable")}function L9(H=0,$="other",A){process.exitCode=H,w0(H,$,A).catch((L)=>{N(`Graceful shutdown failed: ${L}`,{level:"error"}),KPA(),QPA(),L7$(H)})}async function w0(H=0,$="other",A){if(UID)return;UID=!0,wvH=setTimeout(()=>{L7$(H)},5000),wvH.unref(),process.exitCode=H;try{let{executeSessionEndHooks:I}=await Promise.resolve().then(() => (_3(),JID));await I($,A)}catch{}let L;try{let I=(async()=>{try{await dlA()}catch{}})();await Promise.race([I,new Promise((D,B)=>{L=setTimeout(()=>B(Error("Cleanup timeout")),2000)})]),clearTimeout(L),await eW$(),await XPA(),KPA(),QPA(),L7$(H)}catch{clearTimeout(L),await eW$(),await XPA(),KPA(),QPA(),L7$(H)}}var L0H,XID,UID=!1,wvH;var UU=K(()=>{r0();tD();E$();ZE();YvH();FPA();CLH();Jy();t5H();Z6();z$();g$();rB();L0H=require("fs");XID=o$(()=>{process.on("SIGINT",()=>{EL("info","shutdown_signal",{signal:"SIGINT"}),w0(0)}),process.on("SIGTERM",()=>{EL("info","shutdown_signal",{signal:"SIGTERM"}),w0(143)}),process.on("SIGHUP",()=>{EL("info","shutdown_signal",{signal:"SIGHUP"}),w0(129)}),process.on("uncaughtException",(H)=>{EL("error","uncaught_exception",{error_name:H.name,error_message:H.message.slice(0,2000)}),c("tengu_uncaught_exception",{error_name:H.name})}),process.on("unhandledRejection",(H)=>{let $=H instanceof Error?H.name:typeof H==="string"?"string":"unknown",A=H instanceof Error?{error_name:H.name,error_message:H.message.slice(0,2000),error_stack:H.stack?.slice(0,4000)}:{error_message:String(H).slice(0,2000)};EL("error","unhandled_rejection",A),c("tengu_unhandled_rejection",{error_name:$})})})});async function I7$(H){try{return await H()}catch($){if(nA.isAxiosError($)&&$.response?.status===401){c("tengu_grove_oauth_401_received",{});let A=dD()?.accessToken;if(A)return await A4H(A),await H()}throw $}}async function LWH(){try{return{success:!0,data:(await I7$(()=>{let $=eG();if($.error)throw Error(`Failed to get auth headers: ${$.error}`);return nA.get(`${XD().BASE_API_URL}/api/oauth/account/settings`,{headers:{...$.headers,"User-Agent":sG()}})})).data}}catch(H){return r(H),{success:!1}}}async function WPA(){try{await I7$(()=>{let H=eG();if(H.error)throw Error(`Failed to get auth headers: ${H.error}`);return nA.post(`${XD().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...H.headers,"User-Agent":sG()}})})}catch(H){r(H)}}async function D7$(H){try{await I7$(()=>{let $=eG();if($.error)throw Error(`Failed to get auth headers: ${$.error}`);return nA.patch(`${XD().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:H},{headers:{...$.headers,"User-Agent":sG()}})})}catch($){r($)}}async function IWH(){if(!jD$())return!1;let H=T9()?.accountUuid;if(!H)return!1;let A=M$().groveConfigCache?.[H],L=Date.now();if(!A)return N("Grove: No cache, fetching config in background (dialog skipped this session)"),FID(H),!1;if(L-A.timestamp>_v9)return N("Grove: Cache stale, returning cached data and refreshing in background"),FID(H),A.grove_enabled;return N("Grove: Using fresh cached config"),A.grove_enabled}async function FID(H){try{let $=await Wo();if(!$.success)return;let A=$.data.grove_enabled;AA((L)=>({...L,groveConfigCache:{...L.groveConfigCache,[H]:{grove_enabled:A,timestamp:Date.now()}}}))}catch($){N(`Grove: Failed to fetch and store config: ${$}`)}}var _v9=86400000,Wo;var DWH=K(()=>{w1();_Q();_$();qE();E$();z$();EI();vA();tD();Wo=o$(async()=>{try{let H=await I7$(()=>{let D=eG();if(D.error)throw Error(`Failed to get auth headers: ${D.error}`);return nA.get(`${XD().BASE_API_URL}/api/claude_code_grove`,{headers:{...D.headers,"User-Agent":Gn()},timeout:3000})}),{grove_enabled:$,domain_excluded:A,notice_is_grace_period:L,notice_reminder_frequency:I}=H.data;return{success:!0,data:{grove_enabled:$,domain_excluded:A??!1,notice_is_grace_period:L??!0,notice_reminder_frequency:I}}}catch(H){return N(`Failed to fetch Grove notice config: ${H}`),{success:!1}}})});var BYE,KID;var QID=K(()=>{mI();BYE=S.object({checksum:S.string(),version:S.string().optional()}),KID=S.object({uuid:S.string(),checksum:S.string(),settings:S.record(S.string(),S.unknown())})});function WID({isDisabled:H=!1,visibleOptionCount:$=5,options:A,defaultValue:L=[],onChange:I,onCancel:D,onFocus:B,focusValue:f,submitButtonText:E,onSubmit:M,onDownFromLastItem:G,onUpFromFirstItem:U,initialFocusLast:X}){let[J,F]=I0H.useState(L),[Q,W]=I0H.useState(!1),[P,C]=I0H.useState(()=>{let O=new Map;return A.forEach((j)=>{if(j.type==="input"&&j.initialValue)O.set(j.value,j.initialValue)}),O}),Y=I0H.useCallback((O)=>{let j=typeof O==="function"?O(J):O;F(j),I?.(j)},[J,I]),Z=X4$({visibleOptionCount:$,options:A,initialFocusValue:X?A[A.length-1]?.value:void 0,onFocus:B,focusValue:f});FY("multi-select");let q=I0H.useCallback((O,j)=>{C((y)=>{let g=new Map(y);return g.set(O,j),g});let u=A.find((y)=>y.value===O);if(u&&u.type==="input")u.onChange(j);Y((y)=>{if(j){if(!y.includes(O))return[...y,O];return y}else return y.filter((g)=>g!==O)})},[A,Y]);return WL((O,j,u)=>{let y=fFH(O),h=A.find((d)=>d.value===Z.focusedValue)?.type==="input";if(h){if(!(j.upArrow||j.downArrow||j.escape||j.tab||j.return||j.ctrl&&(O==="n"||O==="p"||j.return)))return}let p=A[A.length-1]?.value;if(j.tab&&!j.shift){if(E&&M&&Z.focusedValue===p&&!Q)W(!0);else if(!Q)Z.focusNextOption();return}if(j.tab&&j.shift){if(E&&M&&Q)W(!1),Z.focusOption(p);else Z.focusPreviousOption();return}if(j.downArrow||j.ctrl&&O==="n"||!j.ctrl&&!j.shift&&O==="j"){if(Q&&G)G();else if(E&&M&&Z.focusedValue===p&&!Q)W(!0);else if(!E&&G&&Z.focusedValue===p)G();else if(!Q)Z.focusNextOption();return}if(j.upArrow||j.ctrl&&O==="p"||!j.ctrl&&!j.shift&&O==="k"){if(E&&M&&Q)W(!1),Z.focusOption(p);else if(U&&Z.focusedValue===A[0]?.value)U();else Z.focusPreviousOption();return}if(j.pageDown){Z.focusNextPage();return}if(j.pageUp){Z.focusPreviousPage();return}if(j.return||K4$(O)===" "){if(j.ctrl&&j.return&&h&&M){M();return}if(Q&&M){M();return}if(Z.focusedValue!==void 0){let d=J.includes(Z.focusedValue)?J.filter((k)=>k!==Z.focusedValue):[...J,Z.focusedValue];Y(d)}return}if(/^[0-9]+$/.test(y)){let d=parseInt(y)-1;if(d>=0&&dGH!==k):[...J,k];Y(n)}return}if(j.escape)D(),u.stopImmediatePropagation()},{isActive:!H}),{...Z,selectedValues:J,inputValues:P,isSubmitFocused:Q,updateInputValue:q,onCancel:D}}var I0H;var VID=K(()=>{xH();Dx();w5A();I0H=b(s(),1)});function PID({isDisabled:H=!1,visibleOptionCount:$=5,options:A,defaultValue:L=[],onCancel:I,onChange:D,onFocus:B,focusValue:f,submitButtonText:E,onSubmit:M,onDownFromLastItem:G,onUpFromFirstItem:U,initialFocusLast:X,onOpenEditor:J,hideIndexes:F=!1,onImagePaste:Q,pastedContents:W,onRemoveImage:P}){let C=WID({isDisabled:H,visibleOptionCount:$,options:A,defaultValue:L,onChange:D,onCancel:I,onFocus:B,focusValue:f,submitButtonText:E,onSubmit:M,onDownFromLastItem:G,onUpFromFirstItem:U,initialFocusLast:X}),Y=A.length.toString().length;return Y3.default.createElement(x,{flexDirection:"column"},Y3.default.createElement(x,{flexDirection:"column"},C.visibleOptions.map((Z,q)=>{let O=!H&&C.focusedValue===Z.value&&!C.isSubmitFocused,j=C.selectedValues.includes(Z.value),u=Z.index===C.visibleFromIndex,y=Z.index===C.visibleToIndex-1,g=C.visibleToIndex0,p=C.visibleFromIndex+q+1;if(Z.type==="input"){let d=C.inputValues.get(Z.value)||"";return Y3.default.createElement(x,{key:String(Z.value),gap:1},Y3.default.createElement(UFH,{option:Z,isFocused:O,isSelected:!1,shouldShowDownArrow:g&&y,shouldShowUpArrow:h&&u,maxIndexWidth:Y,index:p,inputValue:d,onInputChange:(k)=>{C.updateInputValue(Z.value,k)},onSubmit:()=>{},onExit:()=>{I()},layout:"compact",onOpenEditor:J,onImagePaste:Q,pastedContents:W,onRemoveImage:P},Y3.default.createElement(V,{color:j?"success":void 0},"[",j?pH.tick:" ","]"," ")))}return Y3.default.createElement(x,{key:String(Z.value),gap:1},Y3.default.createElement(ur,{isFocused:O,isSelected:!1,shouldShowDownArrow:g&&y,shouldShowUpArrow:h&&u,description:Z.description},!F&&Y3.default.createElement(V,{dimColor:!0},`${p}.`.padEnd(Y)),Y3.default.createElement(V,{color:!F&&j?"success":void 0},"[",j?pH.tick:" ","]"),Y3.default.createElement(V,{color:O?"suggestion":void 0},Z.label)))})),E&&M&&Y3.default.createElement(x,{marginTop:0,gap:1},C.isSubmitFocused?Y3.default.createElement(V,{color:"suggestion"},pH.pointer):Y3.default.createElement(V,null," "),Y3.default.createElement(x,{marginLeft:3},Y3.default.createElement(V,{color:C.isSubmitFocused?"suggestion":void 0,bold:!0},E))))}var Y3;var _ID=K(()=>{jI();xH();x5A();G4$();VID();Y3=b(s(),1)});var l8=K(()=>{N1();_ID()});function BWH({title:H,subtitle:$,color:A="permission",workerBadge:L}){return HS.createElement(x,{flexDirection:"column"},HS.createElement(x,{flexDirection:"row",gap:1},HS.createElement(V,{bold:!0,color:A},H),L&&HS.createElement(V,{dimColor:!0},"\xB7 ","@",L.name)),$!=null&&(typeof $==="string"?HS.createElement(V,{dimColor:!0,wrap:"truncate-start"},$):$))}var HS;var B7$=K(()=>{xH();HS=b(s(),1)});function wG({title:H,subtitle:$,color:A="permission",titleColor:L,innerPaddingX:I=1,workerBadge:D,titleRight:B,children:f}){return $S.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:A,borderLeft:!1,borderRight:!1,borderBottom:!1,marginTop:1},$S.createElement(x,{paddingX:1,flexDirection:"column"},$S.createElement(x,{justifyContent:"space-between"},$S.createElement(BWH,{title:H,subtitle:$,color:L,workerBadge:D}),B)),$S.createElement(x,{flexDirection:"column",paddingX:I},f))}var $S;var Xw=K(()=>{xH();B7$();$S=b(s(),1)});var YID,D0H;var f7$=K(()=>{YID=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","otelHeadersHelper","statusLine"],D0H=new Set(["ANTHROPIC_CUSTOM_HEADERS","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_BASH_NO_LOGIN","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_VERTEX","DISABLE_AUTOUPDATER","DISABLE_BUG_COMMAND","DISABLE_COST_WARNINGS","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","ENABLE_EXPERIMENTAL_MCP_CLI","ENABLE_TOOL_SEARCH","MAX_MCP_OUTPUT_TOKENS","MAX_THINKING_TOKENS","MCP_TIMEOUT","MCP_TOOL_TIMEOUT","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_LOGS_HEADERS","OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE","OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_LOG_USER_PROMPTS","OTEL_LOGS_EXPORT_INTERVAL","OTEL_LOGS_EXPORTER","OTEL_METRIC_EXPORT_INTERVAL","OTEL_METRICS_EXPORTER","OTEL_METRICS_INCLUDE_ACCOUNT_UUID","OTEL_METRICS_INCLUDE_SESSION_ID","OTEL_METRICS_INCLUDE_VERSION","OTEL_RESOURCE_ATTRIBUTES","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_HAIKU_4_5"])});function fWH(H){if(!H)return{shellSettings:{},envVars:{},hasHooks:!1};let $={};for(let I of YID){let D=H[I];if(typeof D==="string"&&D.length>0)$[I]=D}let A={};if(H.env&&typeof H.env==="object"){for(let[I,D]of Object.entries(H.env))if(typeof D==="string"&&D.length>0){if(!D0H.has(I.toUpperCase()))A[I]=D}}let L=H.hooks!==void 0&&H.hooks!==null&&typeof H.hooks==="object"&&Object.keys(H.hooks).length>0;return{shellSettings:$,envVars:A,hasHooks:L,hooks:L?H.hooks:void 0}}function E7$(H){return Object.keys(H.shellSettings).length>0||Object.keys(H.envVars).length>0||H.hasHooks}function CID(H,$){let A=fWH(H),L=fWH($);if(!E7$(L))return!1;if(!E7$(A))return!0;let I=yH({shellSettings:A.shellSettings,envVars:A.envVars,hooks:A.hooks}),D=yH({shellSettings:L.shellSettings,envVars:L.envVars,hooks:L.hooks});return I!==D}function wID(H){let $=[];for(let A of Object.keys(H.shellSettings))$.push(A);for(let A of Object.keys(H.envVars))$.push(A);if(H.hasHooks)$.push("hooks");return $}var VPA=K(()=>{f7$();Z$()});function ZID({settings:H,onAccept:$,onReject:A}){let L=fWH(H),I=wID(L),D=zB();BA("confirm:no",A,{context:"Confirmation"});function B(f){if(f==="exit"){A();return}$()}return S7.default.createElement(wG,{color:"warning",titleColor:"warning",title:"Managed settings require approval"},S7.default.createElement(x,{flexDirection:"column",gap:1,paddingTop:1},S7.default.createElement(V,null,"Your organization has configured managed settings that could allow execution of arbitrary code or interception of your prompts and responses."),S7.default.createElement(x,{flexDirection:"column"},S7.default.createElement(V,{dimColor:!0},"Settings requiring approval:"),I.map((f,E)=>S7.default.createElement(x,{key:E,paddingLeft:2},S7.default.createElement(V,null,S7.default.createElement(V,{dimColor:!0},"\xB7 "),S7.default.createElement(V,null,f))))),S7.default.createElement(V,null,"Only accept if you trust your organization's IT administration and expect these settings to be configured."),S7.default.createElement(QA,{options:[{label:"Yes, I trust these settings",value:"accept"},{label:"No, exit Claude Code",value:"exit"}],onChange:(f)=>B(f),onCancel:()=>B("exit")}),S7.default.createElement(V,{dimColor:!0},D.pending?S7.default.createElement(S7.default.Fragment,null,"Press ",D.keyName," again to exit"):S7.default.createElement(S7.default.Fragment,null,"Enter to confirm \xB7 Esc to exit"))))}var S7;var qID=K(()=>{xH();l8();Xw();UM();$I();VPA();S7=b(s(),1)});function Yv9(){if(Vo!==null)return Vo;if(process.stdin.isTTY){Vo=void 0;return}if(A$(!1)){Vo=void 0;return}if(process.argv.includes("mcp")){Vo=void 0;return}try{let H=TID.openSync("/dev/tty","r"),$=new zID.ReadStream(H);return $.isTTY=!0,Vo=$,Vo}catch(H){r(H),Vo=void 0;return}}function ZG(H=!1){let $=Yv9(),A={exitOnCtrlC:H};if($)A.stdin=$;return A}var TID,zID,Vo=null;var sv=K(()=>{NA();_$();TID=require("fs"),zID=require("tty")});function wv9(H,$){let{addNotification:A,removeNotification:L}=wB();PJ.useEffect(()=>{if(H.length===0){L("keybinding-config-warning");return}let D=H.filter((E)=>E.severity==="error").length,B=H.filter((E)=>E.severity==="warning").length,f;if(D>0&&B>0)f=`Found ${D} keybinding error${D>1?"s":""} and ${B} warning${B>1?"s":""}`;else if(D>0)f=`Found ${D} keybinding error${D>1?"s":""}`;else f=`Found ${B} keybinding warning${B>1?"s":""}`;f+=" \xB7 /doctor for details",A({key:"keybinding-config-warning",text:f,color:D>0?"error":"warning",priority:D>0?"immediate":"high",timeoutMs:60000})},[H,$,A,L])}function hE({children:H}){let[{bindings:$,warnings:A},L]=PJ.useState(()=>{let W=wNH();return N(`[keybindings] KeybindingSetup initialized with ${W.bindings.length} bindings, ${W.warnings.length} warnings`),W}),[I,D]=PJ.useState(!1);wv9(A,I);let B=PJ.useRef(null),[f,E]=PJ.useState(null),M=PJ.useRef(null),G=PJ.useRef(new Map),U=PJ.useRef(new Set),X=PJ.useCallback((W)=>{U.current.add(W)},[]),J=PJ.useCallback((W)=>{U.current.delete(W)},[]),F=PJ.useCallback(()=>{if(M.current)clearTimeout(M.current),M.current=null},[]),Q=PJ.useCallback((W)=>{if(F(),W!==null)M.current=setTimeout(()=>{N("[keybindings] Chord timeout - cancelling"),B.current=null,E(null)},Cv9);B.current=W,E(W)},[F]);return PJ.useEffect(()=>{vAI();let W=hAI((P)=>{D(!0),L(P),N(`[keybindings] Reloaded: ${P.bindings.length} bindings, ${P.warnings.length} warnings`)});return()=>{W(),F()}},[F]),PJ.default.createElement(I8$,{bindings:$,pendingChordRef:B,pendingChord:f,setPendingChord:Q,activeContexts:U.current,registerActiveContext:X,unregisterActiveContext:J,handlerRegistryRef:G},PJ.default.createElement(Zv9,{bindings:$,pendingChordRef:B,setPendingChord:Q,activeContexts:U.current,handlerRegistryRef:G}),H)}function Zv9({bindings:H,pendingChordRef:$,setPendingChord:A,activeContexts:L,handlerRegistryRef:I}){let D=PJ.useCallback((B,f,E)=>{let M=I.current,G=new Set;if(M)for(let F of M.values())for(let Q of F)G.add(Q.context);let U=[...G,...L,"Global"],X=$.current!==null,J=A8$(B,f,U,H,$.current);switch(J.type){case"chord_started":A(J.pending),E.stopImmediatePropagation();break;case"match":{if(A(null),X){let F=new Set(U);if(M){let Q=M.get(J.action);if(Q&&Q.size>0){for(let W of Q)if(F.has(W.context)){W.handler(),E.stopImmediatePropagation();break}}}}break}case"chord_cancelled":A(null);break;case"unbound":A(null);break;case"none":break}},[H,$,A,L,I]);return WL(D),null}var PJ,Cv9=1000;var AS=K(()=>{xH();iu();nu();E$();bE();L8$();PJ=b(s(),1)});async function NID(H,$){if(!$||!E7$(fWH($)))return"no_check_needed";if(!CID(H,$))return"no_check_needed";if(!Mk())return"no_check_needed";return c("tengu_managed_settings_security_dialog_shown",{}),new Promise((A)=>{(async()=>{let{unmount:L}=await A8(M7$.default.createElement(i8,null,M7$.default.createElement(hE,null,M7$.default.createElement(ZID,{settings:$,onAccept:()=>{c("tengu_managed_settings_security_dialog_accepted",{}),L(),A("approved")},onReject:()=>{c("tengu_managed_settings_security_dialog_rejected",{}),L(),A("rejected")}}))),ZG(!1))})()})}function OID(H){if(H==="rejected")return L9(1),!1;return!0}var M7$;var xID=K(()=>{xH();qID();pL();g$();z$();UU();VPA();sv();AS();M7$=b(s(),1)});function jID(){if(B0H)return;if(aR())B0H=new Promise((H)=>{am=H,setTimeout(()=>{if(am)N("Remote settings: Loading promise timed out, resolving anyway"),am(),am=null},zv9)})}function Nv9(){return`${XD().BASE_API_URL}/api/claude_code/settings`}function _PA(H){if(Array.isArray(H))return H.map(_PA);if(H!==null&&typeof H==="object"){let $={};for(let A of Object.keys(H).sort())$[A]=_PA(H[A]);return $}return H}function Ov9(H){let $=_PA(H),A=yH($);return`sha256:${SID.createHash("sha256").update(A).digest("hex")}`}function YPA(){return aR()}async function RID(){if(B0H)await B0H}function xv9(){try{let{key:$}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});if($)return{headers:{"x-api-key":$}}}catch{}let H=dD();if(H?.accessToken)return{headers:{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}};return{headers:{},error:"No authentication available"}}async function Sv9(H){let $=null;for(let A=1;A<=PPA+1;A++){if($=await jv9(H),$.success)return $;if($.skipRetry)return $;if(A>PPA)return $;let L=Rg(A);N(`Remote settings: Retry ${A}/${PPA} after ${L}ms`),await $x(L)}return $}async function jv9(H){try{await iW();let $=xv9();if($.error)return{success:!1,error:"Authentication required for remote settings",skipRetry:!0};let A=Nv9(),L={...$.headers,"User-Agent":sG()};if(H)L["If-None-Match"]=`"${H}"`;let I=await nA.get(A,{headers:L,timeout:qv9,validateStatus:(f)=>f===200||f===304||f===404});if(I.status===304)return N("Remote settings: Using cached settings (304)"),{success:!0,settings:null,checksum:H};if(I.status===404)return N("Remote settings: No settings found (404)"),{success:!0,settings:{},checksum:void 0};let D=KID.safeParse(I.data);if(!D.success)return N(`Remote settings: Invalid response format - ${D.error.message}`),{success:!1,error:"Invalid remote settings format"};let B=tZ.safeParse(D.data.settings);if(!B.success)return N(`Remote settings: Settings validation failed - ${B.error.message}`),{success:!1,error:"Invalid settings structure"};return N("Remote settings: Fetched successfully"),{success:!0,settings:B.data,checksum:D.data.checksum}}catch($){if(nA.isAxiosError($)){let A=$;if(A.response?.status===404)return{success:!0,settings:{},checksum:""};if(A.response?.status===401||A.response?.status===403)return{success:!1,error:"Not authorized for remote settings",skipRetry:!0};if(A.code==="ECONNABORTED")return{success:!1,error:"Remote settings request timeout"};if(A.code==="ECONNREFUSED"||A.code==="ENOTFOUND")return{success:!1,error:"Cannot connect to server"}}return{success:!1,error:$ instanceof Error?$.message:"Unknown error"}}}function Rv9(H){try{let $=xqH();d_($,yH(H,null,2),{encoding:"utf-8",mode:384}),N(`Remote settings: Saved to ${$}`)}catch($){N(`Remote settings: Failed to save - ${$ instanceof Error?$.message:"unknown error"}`)}}function CPA(){vID(),XmL(),B0H=null,am=null;try{let H=xqH();if(EWH.existsSync(H))EWH.unlinkSync(H)}catch{}}async function wPA(){if(!aR())return null;let H=e$A(),$=H?Ov9(H):void 0;try{let A=await Sv9($);if(!A.success){if(H)return N("Remote settings: Using stale cache after fetch failure"),I4H(H),H;return null}if(A.settings===null&&H)return N("Remote settings: Cache still valid (304 Not Modified)"),I4H(H),H;let L=A.settings||{};if(Object.keys(L).length>0){let D=await NID(H,L);if(!OID(D))return N("Remote settings: User rejected new settings, using cached settings"),H;return I4H(L),Rv9(L),N("Remote settings: Applied new settings successfully"),L}I4H(L);try{let D=xqH();if(EWH.existsSync(D))EWH.unlinkSync(D),N("Remote settings: Deleted cached file (404 response)")}catch(D){N(`Remote settings: Failed to delete cached file - ${D instanceof Error?D.message:"unknown error"}`)}return L}catch{if(H)return N("Remote settings: Using stale cache after error"),I4H(H),H;return null}}async function yID(){if(aR()&&!B0H)B0H=new Promise((H)=>{am=H});try{let H=await wPA();if(aR())vv9();if(H!==null)E5(),AF.notifyChange("policySettings")}finally{if(am)am(),am=null}}async function G7$(){if(CPA(),!aR()){E5(),AF.notifyChange("policySettings");return}await wPA(),N("Remote settings: Refreshed after auth change"),E5(),AF.notifyChange("policySettings")}async function yv9(){if(!aR())return;let H=s$A(),$=H?yH(H):null;try{await wPA();let A=s$A();if((A?yH(A):null)!==$)N("Remote settings: Changed during background poll"),E5(),AF.notifyChange("policySettings")}catch{}}function vv9(){if(TvH!==null)return;if(!aR())return;TvH=setInterval(()=>{yv9()},Tv9),PB(async()=>vID())}function vID(){if(TvH!==null)clearInterval(TvH),TvH=null}var SID,EWH,qv9=1e4,PPA=5,Tv9=3600000,TvH=null,B0H=null,am=null,zv9=30000;var zvH=K(()=>{w1();_Q();E$();qE();EI();bk();QID();rD();IDH();Ng();gk();ZE();xID();Z$();HAA();SID=require("crypto"),EWH=require("fs")});var U7$=z((NvH)=>{Object.defineProperty(NvH,"__esModule",{value:!0});NvH.AggregationTemporality=void 0;var hv9;(function(H){H[H.DELTA=0]="DELTA",H[H.CUMULATIVE=1]="CUMULATIVE"})(hv9=NvH.AggregationTemporality||(NvH.AggregationTemporality={}))});var _o=z((Po)=>{Object.defineProperty(Po,"__esModule",{value:!0});Po.DataPointType=Po.InstrumentType=void 0;var bv9;(function(H){H.COUNTER="COUNTER",H.GAUGE="GAUGE",H.HISTOGRAM="HISTOGRAM",H.UP_DOWN_COUNTER="UP_DOWN_COUNTER",H.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",H.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",H.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(bv9=Po.InstrumentType||(Po.InstrumentType={}));var kv9;(function(H){H[H.HISTOGRAM=0]="HISTOGRAM",H[H.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",H[H.GAUGE=2]="GAUGE",H[H.SUM=3]="SUM"})(kv9=Po.DataPointType||(Po.DataPointType={}))});var LS=z((k4)=>{Object.defineProperty(k4,"__esModule",{value:!0});k4.equalsCaseInsensitive=k4.binarySearchUB=k4.setEquals=k4.FlatMap=k4.isPromiseAllSettledRejectionResult=k4.PromiseAllSettled=k4.callWithTimeout=k4.TimeoutError=k4.instrumentationScopeId=k4.hashAttributes=k4.isNotNullish=void 0;function uv9(H){return H!==void 0&&H!==null}k4.isNotNullish=uv9;function gv9(H){let $=Object.keys(H);if($.length===0)return"";return $=$.sort(),JSON.stringify($.map((A)=>[A,H[A]]))}k4.hashAttributes=gv9;function mv9(H){return`${H.name}:${H.version??""}:${H.schemaUrl??""}`}k4.instrumentationScopeId=mv9;class X7$ extends Error{constructor(H){super(H);Object.setPrototypeOf(this,X7$.prototype)}}k4.TimeoutError=X7$;function pv9(H,$){let A,L=new Promise(function(D,B){A=setTimeout(function(){B(new X7$("Operation timed out."))},$)});return Promise.race([H,L]).then((I)=>{return clearTimeout(A),I},(I)=>{throw clearTimeout(A),I})}k4.callWithTimeout=pv9;async function dv9(H){return Promise.all(H.map(async($)=>{try{return{status:"fulfilled",value:await $}}catch(A){return{status:"rejected",reason:A}}}))}k4.PromiseAllSettled=dv9;function cv9(H){return H.status==="rejected"}k4.isPromiseAllSettledRejectionResult=cv9;function lv9(H,$){let A=[];return H.forEach((L)=>{A.push(...$(L))}),A}k4.FlatMap=lv9;function iv9(H,$){if(H.size!==$.size)return!1;for(let A of H)if(!$.has(A))return!1;return!0}k4.setEquals=iv9;function nv9(H,$){let A=0,L=H.length-1,I=H.length;while(L>=A){let D=A+Math.trunc((L-A)/2);if(H[D]<$)A=D+1;else I=D,L=D-1}return I}k4.binarySearchUB=nv9;function rv9(H,$){return H.toLowerCase()===$.toLowerCase()}k4.equalsCaseInsensitive=rv9});var MWH=z((OvH)=>{Object.defineProperty(OvH,"__esModule",{value:!0});OvH.AggregatorKind=void 0;var av9;(function(H){H[H.DROP=0]="DROP",H[H.SUM=1]="SUM",H[H.LAST_VALUE=2]="LAST_VALUE",H[H.HISTOGRAM=3]="HISTOGRAM",H[H.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(av9=OvH.AggregatorKind||(OvH.AggregatorKind={}))});var bID=z((J7$)=>{Object.defineProperty(J7$,"__esModule",{value:!0});J7$.DropAggregator=void 0;var ov9=MWH();class hID{kind=ov9.AggregatorKind.DROP;createAccumulation(){return}merge(H,$){return}diff(H,$){return}toMetricData(H,$,A,L){return}}J7$.DropAggregator=hID});var uID=z((GWH)=>{Object.defineProperty(GWH,"__esModule",{value:!0});GWH.HistogramAggregator=GWH.HistogramAccumulation=void 0;var tv9=MWH(),xvH=_o(),sv9=LS();function ev9(H){let $=H.map(()=>0);return $.push(0),{buckets:{boundaries:H,counts:$},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}class SvH{startTime;_boundaries;_recordMinMax;_current;constructor(H,$,A=!0,L=ev9($)){this.startTime=H,this._boundaries=$,this._recordMinMax=A,this._current=L}record(H){if(Number.isNaN(H))return;if(this._current.count+=1,this._current.sum+=H,this._recordMinMax)this._current.min=Math.min(H,this._current.min),this._current.max=Math.max(H,this._current.max),this._current.hasMinMax=!0;let $=(0,sv9.binarySearchUB)(this._boundaries,H);this._current.buckets.counts[$]+=1}setStartTime(H){this.startTime=H}toPointValue(){return this._current}}GWH.HistogramAccumulation=SvH;class kID{_boundaries;_recordMinMax;kind=tv9.AggregatorKind.HISTOGRAM;constructor(H,$){this._boundaries=H,this._recordMinMax=$}createAccumulation(H){return new SvH(H,this._boundaries,this._recordMinMax)}merge(H,$){let A=H.toPointValue(),L=$.toPointValue(),I=A.buckets.counts,D=L.buckets.counts,B=Array(I.length);for(let M=0;M{let B=D.toPointValue(),f=H.type===xvH.InstrumentType.GAUGE||H.type===xvH.InstrumentType.UP_DOWN_COUNTER||H.type===xvH.InstrumentType.OBSERVABLE_GAUGE||H.type===xvH.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:I,startTime:D.startTime,endTime:L,value:{min:B.hasMinMax?B.min:void 0,max:B.hasMinMax?B.max:void 0,sum:!f?B.sum:void 0,buckets:B.buckets,count:B.count}}})}}}GWH.HistogramAggregator=kID});var gID=z((F7$)=>{Object.defineProperty(F7$,"__esModule",{value:!0});F7$.Buckets=void 0;class ZPA{backing;indexBase;indexStart;indexEnd;constructor(H=new qPA,$=0,A=0,L=0){this.backing=H,this.indexBase=$,this.indexStart=A,this.indexEnd=L}get offset(){return this.indexStart}get length(){if(this.backing.length===0)return 0;if(this.indexEnd===this.indexStart&&this.at(0)===0)return 0;return this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(H,$)=>this.at($))}at(H){let $=this.indexBase-this.indexStart;if(H<$)H+=this.backing.length;return H-=$,this.backing.countAt(H)}incrementBucket(H,$){this.backing.increment(H,$)}decrementBucket(H,$){this.backing.decrement(H,$)}trim(){for(let H=0;H=0;H--)if(this.at(H)!==0){this.indexEnd-=this.length-H-1;break}this._rotate()}downscale(H){this._rotate();let $=1+this.indexEnd-this.indexStart,A=1<>=H,this.indexEnd>>=H,this.indexBase=this.indexStart}clone(){return new ZPA(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let H=this.indexBase-this.indexStart;if(H===0)return;else if(H>0)this.backing.reverse(0,this.backing.length),this.backing.reverse(0,H),this.backing.reverse(H,this.backing.length);else this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+H);this.indexBase=this.indexStart}_relocateBucket(H,$){if(H===$)return;this.incrementBucket(H,this.backing.emptyBucket($))}}F7$.Buckets=ZPA;class qPA{_counts;constructor(H=[0]){this._counts=H}get length(){return this._counts.length}countAt(H){return this._counts[H]}growTo(H,$,A){let L=Array(H).fill(0);L.splice(A,this._counts.length-$,...this._counts.slice($)),L.splice(0,$,...this._counts.slice(0,$)),this._counts=L}reverse(H,$){let A=Math.floor((H+$)/2)-H;for(let L=0;L=$)this._counts[H]-=$;else this._counts[H]=0}clone(){return new qPA([...this._counts])}}});var zPA=z((bY)=>{Object.defineProperty(bY,"__esModule",{value:!0});bY.getSignificand=bY.getNormalBase2=bY.MIN_VALUE=bY.MAX_NORMAL_EXPONENT=bY.MIN_NORMAL_EXPONENT=bY.SIGNIFICAND_WIDTH=void 0;bY.SIGNIFICAND_WIDTH=52;var Hh9=2146435072,$h9=1048575,TPA=1023;bY.MIN_NORMAL_EXPONENT=-TPA+1;bY.MAX_NORMAL_EXPONENT=TPA;bY.MIN_VALUE=Math.pow(2,-1022);function Ah9(H){let $=new DataView(new ArrayBuffer(8));return $.setFloat64(0,H),(($.getUint32(0)&Hh9)>>20)-TPA}bY.getNormalBase2=Ah9;function Lh9(H){let $=new DataView(new ArrayBuffer(8));$.setFloat64(0,H);let A=$.getUint32(0),L=$.getUint32(4);return(A&$h9)*Math.pow(2,32)+L}bY.getSignificand=Lh9});var K7$=z((UWH)=>{Object.defineProperty(UWH,"__esModule",{value:!0});UWH.nextGreaterSquare=UWH.ldexp=void 0;function Ih9(H,$){if(H===0||H===Number.POSITIVE_INFINITY||H===Number.NEGATIVE_INFINITY||Number.isNaN(H))return H;return H*Math.pow(2,$)}UWH.ldexp=Ih9;function Dh9(H){return H--,H|=H>>1,H|=H>>2,H|=H>>4,H|=H>>8,H|=H>>16,H++,H}UWH.nextGreaterSquare=Dh9});var W7$=z((Q7$)=>{Object.defineProperty(Q7$,"__esModule",{value:!0});Q7$.MappingError=void 0;class mID extends Error{}Q7$.MappingError=mID});var cID=z((V7$)=>{Object.defineProperty(V7$,"__esModule",{value:!0});V7$.ExponentMapping=void 0;var XWH=zPA(),Bh9=K7$(),pID=W7$();class dID{_shift;constructor(H){this._shift=-H}mapToIndex(H){if(H>this._shift}lowerBoundary(H){let $=this._minNormalLowerBoundaryIndex();if(H<$)throw new pID.MappingError(`underflow: ${H} is < minimum lower boundary: ${$}`);let A=this._maxNormalLowerBoundaryIndex();if(H>A)throw new pID.MappingError(`overflow: ${H} is > maximum lower boundary: ${A}`);return Bh9.ldexp(1,H<>this._shift;if(this._shift<2)H--;return H}_maxNormalLowerBoundaryIndex(){return XWH.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(H,$){return Math.floor(H*Math.pow(2,-$))}}V7$.ExponentMapping=dID});var rID=z((P7$)=>{Object.defineProperty(P7$,"__esModule",{value:!0});P7$.LogarithmMapping=void 0;var JWH=zPA(),lID=K7$(),iID=W7$();class nID{_scale;_scaleFactor;_inverseFactor;constructor(H){this._scale=H,this._scaleFactor=lID.ldexp(Math.LOG2E,H),this._inverseFactor=lID.ldexp(Math.LN2,-H)}mapToIndex(H){if(H<=JWH.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(JWH.getSignificand(H)===0)return(JWH.getNormalBase2(H)<=A)return A;return $}lowerBoundary(H){let $=this._maxNormalLowerBoundaryIndex();if(H>=$){if(H===$)return 2*Math.exp((H-(1< maximum lower boundary: ${$}`)}let A=this._minNormalLowerBoundaryIndex();if(H<=A){if(H===A)return JWH.MIN_VALUE;else if(H===A-1)return Math.exp((H+(1<{Object.defineProperty(_7$,"__esModule",{value:!0});_7$.getMapping=void 0;var fh9=cID(),Eh9=rID(),Mh9=W7$(),aID=-10,oID=20,Gh9=Array.from({length:31},(H,$)=>{if($>10)return new Eh9.LogarithmMapping($-10);return new fh9.ExponentMapping($-10)});function Uh9(H){if(H>oID||H= ${aID} && <= ${oID}, got: ${H}`);return Gh9[H+10]}_7$.getMapping=Uh9});var $DD=z((KWH)=>{Object.defineProperty(KWH,"__esModule",{value:!0});KWH.ExponentialHistogramAggregator=KWH.ExponentialHistogramAccumulation=void 0;var Xh9=MWH(),jvH=_o(),Jh9=kB(),sID=gID(),eID=tID(),Fh9=K7$();class FWH{low;high;static combine(H,$){return new FWH(Math.min(H.low,$.low),Math.max(H.high,$.high))}constructor(H,$){this.low=H,this.high=$}}var Kh9=20,Qh9=160,NPA=2;class Y7${startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(H,$=Qh9,A=!0,L=0,I=0,D=0,B=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,E=new sID.Buckets,M=new sID.Buckets,G=(0,eID.getMapping)(Kh9)){if(this.startTime=H,this._maxSize=$,this._recordMinMax=A,this._sum=L,this._count=I,this._zeroCount=D,this._min=B,this._max=f,this._positive=E,this._negative=M,this._mapping=G,this._maxSizethis._max)this._max=H;if(H0)this._updateBuckets(this._positive,H,$);else this._updateBuckets(this._negative,-H,$)}merge(H){if(this._count===0)this._min=H.min,this._max=H.max;else if(H.count!==0){if(H.minthis.max)this._max=H.max}this.startTime=H.startTime,this._sum+=H.sum,this._count+=H.count,this._zeroCount+=H.zeroCount;let $=this._minScale(H);this._downscale(this.scale-$),this._mergeBuckets(this.positive,H,H.positive,$),this._mergeBuckets(this.negative,H,H.negative,$)}diff(H){this._min=1/0,this._max=-1/0,this._sum-=H.sum,this._count-=H.count,this._zeroCount-=H.zeroCount;let $=this._minScale(H);this._downscale(this.scale-$),this._diffBuckets(this.positive,H,H.positive,$),this._diffBuckets(this.negative,H,H.negative,$)}clone(){return new Y7$(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(H,$,A){let L=this._mapping.mapToIndex($),I=!1,D=0,B=0;if(H.length===0)H.indexStart=L,H.indexEnd=H.indexStart,H.indexBase=H.indexStart;else if(L=this._maxSize)I=!0,B=L,D=H.indexEnd;else if(L>H.indexEnd&&L-H.indexStart>=this._maxSize)I=!0,B=H.indexStart,D=L;if(I){let f=this._changeScale(D,B);this._downscale(f),L=this._mapping.mapToIndex($)}this._incrementIndexBy(H,L,A)}_incrementIndexBy(H,$,A){if(A===0)return;if(H.length===0)H.indexStart=H.indexEnd=H.indexBase=$;if($=H.backing.length)this._grow(H,I+1);H.indexStart=$}else if($>H.indexEnd){let I=$-H.indexStart;if(I>=H.backing.length)this._grow(H,I+1);H.indexEnd=$}let L=$-H.indexBase;if(L<0)L+=H.backing.length;H.incrementBucket(L,A)}_grow(H,$){let A=H.backing.length,L=H.indexBase-H.indexStart,I=A-L,D=(0,Fh9.nextGreaterSquare)($);if(D>this._maxSize)D=this._maxSize;let B=D-L;H.backing.growTo(D,I,B)}_changeScale(H,$){let A=0;while(H-$>=this._maxSize)H>>=1,$>>=1,A++;return A}_downscale(H){if(H===0)return;if(H<0)throw Error(`impossible change of scale: ${this.scale}`);let $=this._mapping.scale-H;this._positive.downscale(H),this._negative.downscale(H),this._mapping=(0,eID.getMapping)($)}_minScale(H){let $=Math.min(this.scale,H.scale),A=FWH.combine(this._highLowAtScale(this.positive,this.scale,$),this._highLowAtScale(H.positive,H.scale,$)),L=FWH.combine(this._highLowAtScale(this.negative,this.scale,$),this._highLowAtScale(H.negative,H.scale,$));return Math.min($-this._changeScale(A.high,A.low),$-this._changeScale(L.high,L.low))}_highLowAtScale(H,$,A){if(H.length===0)return new FWH(0,-1);let L=$-A;return new FWH(H.indexStart>>L,H.indexEnd>>L)}_mergeBuckets(H,$,A,L){let I=A.offset,D=$.scale-L;for(let B=0;B>D,A.at(B))}_diffBuckets(H,$,A,L){let I=A.offset,D=$.scale-L;for(let B=0;B>D)-H.indexBase;if(E<0)E+=H.backing.length;H.decrementBucket(E,A.at(B))}H.trim()}}KWH.ExponentialHistogramAccumulation=Y7$;class HDD{_maxSize;_recordMinMax;kind=Xh9.AggregatorKind.EXPONENTIAL_HISTOGRAM;constructor(H,$){this._maxSize=H,this._recordMinMax=$}createAccumulation(H){return new Y7$(H,this._maxSize,this._recordMinMax)}merge(H,$){let A=$.clone();return A.merge(H),A}diff(H,$){let A=$.clone();return A.diff(H),A}toMetricData(H,$,A,L){return{descriptor:H,aggregationTemporality:$,dataPointType:jvH.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:A.map(([I,D])=>{let B=D.toPointValue(),f=H.type===jvH.InstrumentType.GAUGE||H.type===jvH.InstrumentType.UP_DOWN_COUNTER||H.type===jvH.InstrumentType.OBSERVABLE_GAUGE||H.type===jvH.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:I,startTime:D.startTime,endTime:L,value:{min:B.hasMinMax?B.min:void 0,max:B.hasMinMax?B.max:void 0,sum:!f?B.sum:void 0,positive:{offset:B.positive.offset,bucketCounts:B.positive.bucketCounts},negative:{offset:B.negative.offset,bucketCounts:B.negative.bucketCounts},count:B.count,scale:B.scale,zeroCount:B.zeroCount}}})}}}KWH.ExponentialHistogramAggregator=HDD});var LDD=z((QWH)=>{Object.defineProperty(QWH,"__esModule",{value:!0});QWH.LastValueAggregator=QWH.LastValueAccumulation=void 0;var Wh9=MWH(),RvH=Kf(),Vh9=_o();class yvH{startTime;_current;sampleTime;constructor(H,$=0,A=[0,0]){this.startTime=H,this._current=$,this.sampleTime=A}record(H){this._current=H,this.sampleTime=(0,RvH.millisToHrTime)(Date.now())}setStartTime(H){this.startTime=H}toPointValue(){return this._current}}QWH.LastValueAccumulation=yvH;class ADD{kind=Wh9.AggregatorKind.LAST_VALUE;createAccumulation(H){return new yvH(H)}merge(H,$){let A=(0,RvH.hrTimeToMicroseconds)($.sampleTime)>=(0,RvH.hrTimeToMicroseconds)(H.sampleTime)?$:H;return new yvH(H.startTime,A.toPointValue(),A.sampleTime)}diff(H,$){let A=(0,RvH.hrTimeToMicroseconds)($.sampleTime)>=(0,RvH.hrTimeToMicroseconds)(H.sampleTime)?$:H;return new yvH($.startTime,A.toPointValue(),A.sampleTime)}toMetricData(H,$,A,L){return{descriptor:H,aggregationTemporality:$,dataPointType:Vh9.DataPointType.GAUGE,dataPoints:A.map(([I,D])=>{return{attributes:I,startTime:D.startTime,endTime:L,value:D.toPointValue()}})}}}QWH.LastValueAggregator=ADD});var DDD=z((WWH)=>{Object.defineProperty(WWH,"__esModule",{value:!0});WWH.SumAggregator=WWH.SumAccumulation=void 0;var Ph9=MWH(),_h9=_o();class f0H{startTime;monotonic;_current;reset;constructor(H,$,A=0,L=!1){this.startTime=H,this.monotonic=$,this._current=A,this.reset=L}record(H){if(this.monotonic&&H<0)return;this._current+=H}setStartTime(H){this.startTime=H}toPointValue(){return this._current}}WWH.SumAccumulation=f0H;class IDD{monotonic;kind=Ph9.AggregatorKind.SUM;constructor(H){this.monotonic=H}createAccumulation(H){return new f0H(H,this.monotonic)}merge(H,$){let A=H.toPointValue(),L=$.toPointValue();if($.reset)return new f0H($.startTime,this.monotonic,L,$.reset);return new f0H(H.startTime,this.monotonic,A+L)}diff(H,$){let A=H.toPointValue(),L=$.toPointValue();if(this.monotonic&&A>L)return new f0H($.startTime,this.monotonic,L,!0);return new f0H($.startTime,this.monotonic,L-A)}toMetricData(H,$,A,L){return{descriptor:H,aggregationTemporality:$,dataPointType:_h9.DataPointType.SUM,dataPoints:A.map(([I,D])=>{return{attributes:I,startTime:D.startTime,endTime:L,value:D.toPointValue()}}),isMonotonic:this.monotonic}}}WWH.SumAggregator=IDD});var GDD=z((SF)=>{Object.defineProperty(SF,"__esModule",{value:!0});SF.SumAggregator=SF.SumAccumulation=SF.LastValueAggregator=SF.LastValueAccumulation=SF.ExponentialHistogramAggregator=SF.ExponentialHistogramAccumulation=SF.HistogramAggregator=SF.HistogramAccumulation=SF.DropAggregator=void 0;var Yh9=bID();Object.defineProperty(SF,"DropAggregator",{enumerable:!0,get:function(){return Yh9.DropAggregator}});var BDD=uID();Object.defineProperty(SF,"HistogramAccumulation",{enumerable:!0,get:function(){return BDD.HistogramAccumulation}});Object.defineProperty(SF,"HistogramAggregator",{enumerable:!0,get:function(){return BDD.HistogramAggregator}});var fDD=$DD();Object.defineProperty(SF,"ExponentialHistogramAccumulation",{enumerable:!0,get:function(){return fDD.ExponentialHistogramAccumulation}});Object.defineProperty(SF,"ExponentialHistogramAggregator",{enumerable:!0,get:function(){return fDD.ExponentialHistogramAggregator}});var EDD=LDD();Object.defineProperty(SF,"LastValueAccumulation",{enumerable:!0,get:function(){return EDD.LastValueAccumulation}});Object.defineProperty(SF,"LastValueAggregator",{enumerable:!0,get:function(){return EDD.LastValueAggregator}});var MDD=DDD();Object.defineProperty(SF,"SumAccumulation",{enumerable:!0,get:function(){return MDD.SumAccumulation}});Object.defineProperty(SF,"SumAggregator",{enumerable:!0,get:function(){return MDD.SumAggregator}})});var UDD=z(($E)=>{Object.defineProperty($E,"__esModule",{value:!0});$E.DEFAULT_AGGREGATION=$E.EXPONENTIAL_HISTOGRAM_AGGREGATION=$E.HISTOGRAM_AGGREGATION=$E.LAST_VALUE_AGGREGATION=$E.SUM_AGGREGATION=$E.DROP_AGGREGATION=$E.DefaultAggregation=$E.ExponentialHistogramAggregation=$E.ExplicitBucketHistogramAggregation=$E.HistogramAggregation=$E.LastValueAggregation=$E.SumAggregation=$E.DropAggregation=void 0;var Ch9=kB(),E0H=GDD(),ev=_o();class C7${static DEFAULT_INSTANCE=new E0H.DropAggregator;createAggregator(H){return C7$.DEFAULT_INSTANCE}}$E.DropAggregation=C7$;class vvH{static MONOTONIC_INSTANCE=new E0H.SumAggregator(!0);static NON_MONOTONIC_INSTANCE=new E0H.SumAggregator(!1);createAggregator(H){switch(H.type){case ev.InstrumentType.COUNTER:case ev.InstrumentType.OBSERVABLE_COUNTER:case ev.InstrumentType.HISTOGRAM:return vvH.MONOTONIC_INSTANCE;default:return vvH.NON_MONOTONIC_INSTANCE}}}$E.SumAggregation=vvH;class w7${static DEFAULT_INSTANCE=new E0H.LastValueAggregator;createAggregator(H){return w7$.DEFAULT_INSTANCE}}$E.LastValueAggregation=w7$;class Z7${static DEFAULT_INSTANCE=new E0H.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1000,2500,5000,7500,1e4],!0);createAggregator(H){return Z7$.DEFAULT_INSTANCE}}$E.HistogramAggregation=Z7$;class OPA{_recordMinMax;_boundaries;constructor(H,$=!0){if(this._recordMinMax=$,H==null)throw Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");H=H.concat(),H=H.sort((I,D)=>I-D);let A=H.lastIndexOf(-1/0),L=H.indexOf(1/0);if(L===-1)L=void 0;this._boundaries=H.slice(A+1,L)}createAggregator(H){return new E0H.HistogramAggregator(this._boundaries,this._recordMinMax)}}$E.ExplicitBucketHistogramAggregation=OPA;class xPA{_maxSize;_recordMinMax;constructor(H=160,$=!0){this._maxSize=H,this._recordMinMax=$}createAggregator(H){return new E0H.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}}$E.ExponentialHistogramAggregation=xPA;class SPA{_resolve(H){switch(H.type){case ev.InstrumentType.COUNTER:case ev.InstrumentType.UP_DOWN_COUNTER:case ev.InstrumentType.OBSERVABLE_COUNTER:case ev.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return $E.SUM_AGGREGATION;case ev.InstrumentType.GAUGE:case ev.InstrumentType.OBSERVABLE_GAUGE:return $E.LAST_VALUE_AGGREGATION;case ev.InstrumentType.HISTOGRAM:{if(H.advice.explicitBucketBoundaries)return new OPA(H.advice.explicitBucketBoundaries);return $E.HISTOGRAM_AGGREGATION}}return Ch9.diag.warn(`Unable to recognize instrument type: ${H.type}`),$E.DROP_AGGREGATION}createAggregator(H){return this._resolve(H).createAggregator(H)}}$E.DefaultAggregation=SPA;$E.DROP_AGGREGATION=new C7$;$E.SUM_AGGREGATION=new vvH;$E.LAST_VALUE_AGGREGATION=new w7$;$E.HISTOGRAM_AGGREGATION=new Z7$;$E.EXPONENTIAL_HISTOGRAM_AGGREGATION=new xPA;$E.DEFAULT_AGGREGATION=new SPA});var hvH=z((U0H)=>{Object.defineProperty(U0H,"__esModule",{value:!0});U0H.toAggregation=U0H.AggregationType=void 0;var M0H=UDD(),G0H;(function(H){H[H.DEFAULT=0]="DEFAULT",H[H.DROP=1]="DROP",H[H.SUM=2]="SUM",H[H.LAST_VALUE=3]="LAST_VALUE",H[H.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",H[H.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(G0H=U0H.AggregationType||(U0H.AggregationType={}));function wh9(H){switch(H.type){case G0H.DEFAULT:return M0H.DEFAULT_AGGREGATION;case G0H.DROP:return M0H.DROP_AGGREGATION;case G0H.SUM:return M0H.SUM_AGGREGATION;case G0H.LAST_VALUE:return M0H.LAST_VALUE_AGGREGATION;case G0H.EXPONENTIAL_HISTOGRAM:{let $=H;return new M0H.ExponentialHistogramAggregation($.options?.maxSize,$.options?.recordMinMax)}case G0H.EXPLICIT_BUCKET_HISTOGRAM:{let $=H;if($.options==null)return M0H.HISTOGRAM_AGGREGATION;else return new M0H.ExplicitBucketHistogramAggregation($.options?.boundaries,$.options?.recordMinMax)}default:throw Error("Unsupported Aggregation")}}U0H.toAggregation=wh9});var jPA=z((VWH)=>{Object.defineProperty(VWH,"__esModule",{value:!0});VWH.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=VWH.DEFAULT_AGGREGATION_SELECTOR=void 0;var Zh9=U7$(),qh9=hvH(),Th9=(H)=>{return{type:qh9.AggregationType.DEFAULT}};VWH.DEFAULT_AGGREGATION_SELECTOR=Th9;var zh9=(H)=>Zh9.AggregationTemporality.CUMULATIVE;VWH.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=zh9});var RPA=z((T7$)=>{Object.defineProperty(T7$,"__esModule",{value:!0});T7$.MetricReader=void 0;var XDD=kB(),q7$=LS(),JDD=jPA();class FDD{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(H){this._aggregationSelector=H?.aggregationSelector??JDD.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=H?.aggregationTemporalitySelector??JDD.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=H?.metricProducers??[],this._cardinalitySelector=H?.cardinalitySelector}setMetricProducer(H){if(this._sdkMetricProducer)throw Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=H,this.onInitialized()}selectAggregation(H){return this._aggregationSelector(H)}selectAggregationTemporality(H){return this._aggregationTemporalitySelector(H)}selectCardinalityLimit(H){return this._cardinalitySelector?this._cardinalitySelector(H):2000}onInitialized(){}async collect(H){if(this._sdkMetricProducer===void 0)throw Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw Error("MetricReader is shutdown");let[$,...A]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:H?.timeoutMillis}),...this._metricProducers.map((B)=>B.collect({timeoutMillis:H?.timeoutMillis}))]),L=$.errors.concat((0,q7$.FlatMap)(A,(B)=>B.errors)),I=$.resourceMetrics.resource,D=$.resourceMetrics.scopeMetrics.concat((0,q7$.FlatMap)(A,(B)=>B.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:I,scopeMetrics:D},errors:L}}async shutdown(H){if(this._shutdown){XDD.diag.error("Cannot call shutdown twice.");return}if(H?.timeoutMillis==null)await this.onShutdown();else await(0,q7$.callWithTimeout)(this.onShutdown(),H.timeoutMillis);this._shutdown=!0}async forceFlush(H){if(this._shutdown){XDD.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(H?.timeoutMillis==null){await this.onForceFlush();return}await(0,q7$.callWithTimeout)(this.onForceFlush(),H.timeoutMillis)}}T7$.MetricReader=FDD});var WDD=z((N7$)=>{Object.defineProperty(N7$,"__esModule",{value:!0});N7$.PeriodicExportingMetricReader=void 0;var yPA=kB(),z7$=Kf(),Nh9=RPA(),KDD=LS();class QDD extends Nh9.MetricReader{_interval;_exporter;_exportInterval;_exportTimeout;constructor(H){super({aggregationSelector:H.exporter.selectAggregation?.bind(H.exporter),aggregationTemporalitySelector:H.exporter.selectAggregationTemporality?.bind(H.exporter),metricProducers:H.metricProducers});if(H.exportIntervalMillis!==void 0&&H.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(H.exportTimeoutMillis!==void 0&&H.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(H.exportTimeoutMillis!==void 0&&H.exportIntervalMillis!==void 0&&H.exportIntervalMillis0)yPA.diag.error("PeriodicExportingMetricReader: metrics collection errors",...$);if(H.resource.asyncAttributesPending)try{await H.resource.waitForAsyncAttributes?.()}catch(L){yPA.diag.debug("Error while resolving async portion of resource: ",L),(0,z7$.globalErrorHandler)(L)}if(H.scopeMetrics.length===0)return;let A=await z7$.internal._export(this._exporter,H);if(A.code!==z7$.ExportResultCode.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${A.error})`)}onInitialized(){if(this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=="number")this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){if(this._interval)clearInterval(this._interval);await this.onForceFlush(),await this._exporter.shutdown()}}N7$.PeriodicExportingMetricReader=QDD});var _DD=z((O7$)=>{Object.defineProperty(O7$,"__esModule",{value:!0});O7$.InMemoryMetricExporter=void 0;var VDD=Kf();class PDD{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(H){this._aggregationTemporality=H}export(H,$){if(this._shutdown){setTimeout(()=>$({code:VDD.ExportResultCode.FAILED}),0);return}this._metrics.push(H),setTimeout(()=>$({code:VDD.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(H){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}O7$.InMemoryMetricExporter=PDD});var CDD=z((x7$)=>{Object.defineProperty(x7$,"__esModule",{value:!0});x7$.ConsoleMetricExporter=void 0;var YDD=Kf(),Oh9=jPA();class vPA{_shutdown=!1;_temporalitySelector;constructor(H){this._temporalitySelector=H?.temporalitySelector??Oh9.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(H,$){if(this._shutdown){setImmediate($,{code:YDD.ExportResultCode.FAILED});return}return vPA._sendMetrics(H,$)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(H){return this._temporalitySelector(H)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(H,$){for(let A of H.scopeMetrics)for(let L of A.metrics)console.dir({descriptor:L.descriptor,dataPointType:L.dataPointType,dataPoints:L.dataPoints},{depth:null});$({code:YDD.ExportResultCode.SUCCESS})}}x7$.ConsoleMetricExporter=vPA});var ZDD=z((S7$)=>{Object.defineProperty(S7$,"__esModule",{value:!0});S7$.ViewRegistry=void 0;class wDD{_registeredViews=[];addView(H){this._registeredViews.push(H)}findViews(H,$){return this._registeredViews.filter((L)=>{return this._matchInstrument(L.instrumentSelector,H)&&this._matchMeter(L.meterSelector,$)})}_matchInstrument(H,$){return(H.getType()===void 0||$.type===H.getType())&&H.getNameFilter().match($.name)&&H.getUnitFilter().match($.unit)}_matchMeter(H,$){return H.getNameFilter().match($.name)&&($.version===void 0||H.getVersionFilter().match($.version))&&($.schemaUrl===void 0||H.getSchemaUrlFilter().match($.schemaUrl))}}S7$.ViewRegistry=wDD});var bvH=z((Hh)=>{Object.defineProperty(Hh,"__esModule",{value:!0});Hh.isValidName=Hh.isDescriptorCompatibleWith=Hh.createInstrumentDescriptorWithView=Hh.createInstrumentDescriptor=void 0;var qDD=kB(),xh9=LS();function Sh9(H,$,A){if(!TDD(H))qDD.diag.warn(`Invalid metric name: "${H}". The metric name should be a ASCII string with a length no greater than 255 characters.`);return{name:H,type:$,description:A?.description??"",unit:A?.unit??"",valueType:A?.valueType??qDD.ValueType.DOUBLE,advice:A?.advice??{}}}Hh.createInstrumentDescriptor=Sh9;function jh9(H,$){return{name:H.name??$.name,description:H.description??$.description,type:$.type,unit:$.unit,valueType:$.valueType,advice:$.advice}}Hh.createInstrumentDescriptorWithView=jh9;function Rh9(H,$){return(0,xh9.equalsCaseInsensitive)(H.name,$.name)&&H.unit===$.unit&&H.type===$.type&&H.valueType===$.valueType}Hh.isDescriptorCompatibleWith=Rh9;var yh9=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function TDD(H){return H.match(yh9)!=null}Hh.isValidName=TDD});var j7$=z((NX)=>{Object.defineProperty(NX,"__esModule",{value:!0});NX.isObservableInstrument=NX.ObservableUpDownCounterInstrument=NX.ObservableGaugeInstrument=NX.ObservableCounterInstrument=NX.ObservableInstrument=NX.HistogramInstrument=NX.GaugeInstrument=NX.CounterInstrument=NX.UpDownCounterInstrument=NX.SyncInstrument=void 0;var PWH=kB(),vh9=Kf();class _WH{_writableMetricStorage;_descriptor;constructor(H,$){this._writableMetricStorage=H,this._descriptor=$}_record(H,$={},A=PWH.context.active()){if(typeof H!=="number"){PWH.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${H}`);return}if(this._descriptor.valueType===PWH.ValueType.INT&&!Number.isInteger(H)){if(PWH.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),H=Math.trunc(H),!Number.isInteger(H))return}this._writableMetricStorage.record(H,$,A,(0,vh9.millisToHrTime)(Date.now()))}}NX.SyncInstrument=_WH;class zDD extends _WH{add(H,$,A){this._record(H,$,A)}}NX.UpDownCounterInstrument=zDD;class NDD extends _WH{add(H,$,A){if(H<0){PWH.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${H}`);return}this._record(H,$,A)}}NX.CounterInstrument=NDD;class ODD extends _WH{record(H,$,A){this._record(H,$,A)}}NX.GaugeInstrument=ODD;class xDD extends _WH{record(H,$,A){if(H<0){PWH.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${H}`);return}this._record(H,$,A)}}NX.HistogramInstrument=xDD;class YWH{_observableRegistry;_metricStorages;_descriptor;constructor(H,$,A){this._observableRegistry=A,this._descriptor=H,this._metricStorages=$}addCallback(H){this._observableRegistry.addCallback(H,this)}removeCallback(H){this._observableRegistry.removeCallback(H,this)}}NX.ObservableInstrument=YWH;class SDD extends YWH{}NX.ObservableCounterInstrument=SDD;class jDD extends YWH{}NX.ObservableGaugeInstrument=jDD;class RDD extends YWH{}NX.ObservableUpDownCounterInstrument=RDD;function hh9(H){return H instanceof YWH}NX.isObservableInstrument=hh9});var vDD=z((R7$)=>{Object.defineProperty(R7$,"__esModule",{value:!0});R7$.Meter=void 0;var X0H=bvH(),J0H=j7$(),F0H=_o();class yDD{_meterSharedState;constructor(H){this._meterSharedState=H}createGauge(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.GAUGE,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.GaugeInstrument(L,A)}createHistogram(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.HISTOGRAM,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.HistogramInstrument(L,A)}createCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.COUNTER,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.CounterInstrument(L,A)}createUpDownCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.UP_DOWN_COUNTER,$),L=this._meterSharedState.registerMetricStorage(A);return new J0H.UpDownCounterInstrument(L,A)}createObservableGauge(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.OBSERVABLE_GAUGE,$),L=this._meterSharedState.registerAsyncMetricStorage(A);return new J0H.ObservableGaugeInstrument(A,L,this._meterSharedState.observableRegistry)}createObservableCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.OBSERVABLE_COUNTER,$),L=this._meterSharedState.registerAsyncMetricStorage(A);return new J0H.ObservableCounterInstrument(A,L,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(H,$){let A=(0,X0H.createInstrumentDescriptor)(H,F0H.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,$),L=this._meterSharedState.registerAsyncMetricStorage(A);return new J0H.ObservableUpDownCounterInstrument(A,L,this._meterSharedState.observableRegistry)}addBatchObservableCallback(H,$){this._meterSharedState.observableRegistry.addBatchCallback(H,$)}removeBatchObservableCallback(H,$){this._meterSharedState.observableRegistry.removeBatchCallback(H,$)}}R7$.Meter=yDD});var hPA=z((y7$)=>{Object.defineProperty(y7$,"__esModule",{value:!0});y7$.MetricStorage=void 0;var bh9=bvH();class hDD{_instrumentDescriptor;constructor(H){this._instrumentDescriptor=H}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(H){this._instrumentDescriptor=(0,bh9.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:H,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}y7$.MetricStorage=hDD});var kvH=z((CWH)=>{Object.defineProperty(CWH,"__esModule",{value:!0});CWH.AttributeHashMap=CWH.HashMap=void 0;var kh9=LS();class bPA{_hash;_valueMap=new Map;_keyMap=new Map;constructor(H){this._hash=H}get(H,$){return $??=this._hash(H),this._valueMap.get($)}getOrDefault(H,$){let A=this._hash(H);if(this._valueMap.has(A))return this._valueMap.get(A);let L=$();if(!this._keyMap.has(A))this._keyMap.set(A,H);return this._valueMap.set(A,L),L}set(H,$,A){if(A??=this._hash(H),!this._keyMap.has(A))this._keyMap.set(A,H);this._valueMap.set(A,$)}has(H,$){return $??=this._hash(H),this._valueMap.has($)}*keys(){let H=this._keyMap.entries(),$=H.next();while($.done!==!0)yield[$.value[1],$.value[0]],$=H.next()}*entries(){let H=this._valueMap.entries(),$=H.next();while($.done!==!0)yield[this._keyMap.get($.value[0]),$.value[1],$.value[0]],$=H.next()}get size(){return this._valueMap.size}}CWH.HashMap=bPA;class bDD extends bPA{constructor(){super(kh9.hashAttributes)}}CWH.AttributeHashMap=bDD});var uPA=z((v7$)=>{Object.defineProperty(v7$,"__esModule",{value:!0});v7$.DeltaMetricProcessor=void 0;var uh9=LS(),kPA=kvH();class kDD{_aggregator;_activeCollectionStorage=new kPA.AttributeHashMap;_cumulativeMemoStorage=new kPA.AttributeHashMap;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;constructor(H,$){this._aggregator=H,this._cardinalityLimit=($??2000)-1,this._overflowHashCode=(0,uh9.hashAttributes)(this._overflowAttributes)}record(H,$,A,L){let I=this._activeCollectionStorage.get($);if(!I){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(L))?.record(H);return}I=this._aggregator.createAccumulation(L),this._activeCollectionStorage.set($,I)}I?.record(H)}batchCumulate(H,$){Array.from(H.entries()).forEach(([A,L,I])=>{let D=this._aggregator.createAccumulation($);D?.record(L);let B=D;if(this._cumulativeMemoStorage.has(A,I)){let f=this._cumulativeMemoStorage.get(A,I);B=this._aggregator.diff(f,D)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit){if(A=this._overflowAttributes,I=this._overflowHashCode,this._cumulativeMemoStorage.has(A,I)){let f=this._cumulativeMemoStorage.get(A,I);B=this._aggregator.diff(f,D)}}if(this._activeCollectionStorage.has(A,I)){let f=this._activeCollectionStorage.get(A,I);B=this._aggregator.merge(f,B)}this._cumulativeMemoStorage.set(A,D,I),this._activeCollectionStorage.set(A,B,I)})}collect(){let H=this._activeCollectionStorage;return this._activeCollectionStorage=new kPA.AttributeHashMap,H}}v7$.DeltaMetricProcessor=kDD});var gPA=z((h7$)=>{Object.defineProperty(h7$,"__esModule",{value:!0});h7$.TemporalMetricProcessor=void 0;var gh9=U7$(),mh9=kvH();class uvH{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(H,$){this._aggregator=H,$.forEach((A)=>{this._unreportedAccumulations.set(A,[])})}buildMetrics(H,$,A,L){this._stashAccumulations(A);let I=this._getMergedUnreportedAccumulations(H),D=I,B;if(this._reportHistory.has(H)){let E=this._reportHistory.get(H),M=E.collectionTime;if(B=E.aggregationTemporality,B===gh9.AggregationTemporality.CUMULATIVE)D=uvH.merge(E.accumulations,I,this._aggregator);else D=uvH.calibrateStartTime(E.accumulations,I,M)}else B=H.selectAggregationTemporality($.type);this._reportHistory.set(H,{accumulations:D,collectionTime:L,aggregationTemporality:B});let f=ph9(D);if(f.length===0)return;return this._aggregator.toMetricData($,B,f,L)}_stashAccumulations(H){let $=this._unreportedAccumulations.keys();for(let A of $){let L=this._unreportedAccumulations.get(A);if(L===void 0)L=[],this._unreportedAccumulations.set(A,L);L.push(H)}}_getMergedUnreportedAccumulations(H){let $=new mh9.AttributeHashMap,A=this._unreportedAccumulations.get(H);if(this._unreportedAccumulations.set(H,[]),A===void 0)return $;for(let L of A)$=uvH.merge($,L,this._aggregator);return $}static merge(H,$,A){let L=H,I=$.entries(),D=I.next();while(D.done!==!0){let[B,f,E]=D.value;if(H.has(B,E)){let M=H.get(B,E),G=A.merge(M,f);L.set(B,G,E)}else L.set(B,f,E);D=I.next()}return L}static calibrateStartTime(H,$,A){for(let[L,I]of H.keys())$.get(L,I)?.setStartTime(A);return $}}h7$.TemporalMetricProcessor=uvH;function ph9(H){return Array.from(H.entries())}});var gDD=z((b7$)=>{Object.defineProperty(b7$,"__esModule",{value:!0});b7$.AsyncMetricStorage=void 0;var dh9=hPA(),ch9=uPA(),lh9=gPA(),ih9=kvH();class uDD extends dh9.MetricStorage{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(H,$,A,L,I){super(H);this._attributesProcessor=A,this._aggregationCardinalityLimit=I,this._deltaMetricStorage=new ch9.DeltaMetricProcessor($,this._aggregationCardinalityLimit),this._temporalMetricStorage=new lh9.TemporalMetricProcessor($,L)}record(H,$){let A=new ih9.AttributeHashMap;Array.from(H.entries()).forEach(([L,I])=>{A.set(this._attributesProcessor.process(L),I)}),this._deltaMetricStorage.batchCumulate(A,$)}collect(H,$){let A=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(H,this._instrumentDescriptor,A,$)}}b7$.AsyncMetricStorage=uDD});var lDD=z((kY)=>{Object.defineProperty(kY,"__esModule",{value:!0});kY.getConflictResolutionRecipe=kY.getDescriptionResolutionRecipe=kY.getTypeConflictResolutionRecipe=kY.getUnitConflictResolutionRecipe=kY.getValueTypeConflictResolutionRecipe=kY.getIncompatibilityDetails=void 0;function nh9(H,$){let A="";if(H.unit!==$.unit)A+=` - Unit '${H.unit}' does not match '${$.unit}' `)++I;if(++A===L)throw M("comment");q=O,O=U(A)}while(q!=="*"||O!=="/");if(++A,u)X(j,A-2,y),y=!0;Z=!0}else return"/"}}while(Z);var g=A;OYA.lastIndex=0;var h=OYA.test(U(g++));if(!h)while(g{_fD.exports=Lp;Lp.filename=null;Lp.defaults={keepCase:!1};var Wc9=xYA(),QfD=v3$(),WfD=S3$(),VfD=xo(),Vc9=q3$(),PfD=Z0H(),Pc9=XS(),_c9=z3$(),Yc9=T3$(),Cc9=So(),wc9=q0H(),SYA=aQ(),Zc9=/^[1-9][0-9]*$/,qc9=/^-?[1-9][0-9]*$/,Tc9=/^0[x][0-9a-fA-F]+$/,zc9=/^-?0[x][0-9a-fA-F]+$/,Nc9=/^0[0-7]+$/,Oc9=/^-?0[0-7]+$/,xc9=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Kh=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Qh=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function Lp(H,$,A){if(!($ instanceof QfD))A=$,$=new QfD;if(!A)A=Lp.defaults;var L=A.preferTrailingComment||!1,I=Wc9(H,A.alternateCommentMode||!1),D=I.next,B=I.push,f=I.peek,E=I.skip,M=I.cmnt,G=!0,U,X,J,F="proto2",Q=$,W=[],P={},C=A.keepCase?function(EH){return EH}:SYA.camelCase;function Y(){W.forEach((EH)=>{EH._edition=F,Object.keys(P).forEach(($H)=>{if(EH.getOption($H)!==void 0)return;EH.setOption($H,P[$H],!0)})})}function Z(EH,$H,FH){var YH=Lp.filename;if(!FH)Lp.filename=null;return Error("illegal "+($H||"token")+" '"+EH+"' ("+(YH?YH+", ":"")+"line "+I.line+")")}function q(){var EH=[],$H;do{if(($H=D())!=='"'&&$H!=="'")throw Z($H);EH.push(D()),E($H),$H=f()}while($H==='"'||$H==="'");return EH.join("")}function O(EH){var $H=D();switch($H){case"'":case'"':return B($H),q();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return u($H,!0)}catch(FH){if(EH&&Qh.test($H))return $H;throw Z($H,"value")}}function j(EH,$H){var FH,YH;do if($H&&((FH=f())==='"'||FH==="'")){var qH=q();if(EH.push(qH),F>=2023)throw Z(qH,"id")}else try{EH.push([YH=y(D()),E("to",!0)?y(D()):YH])}catch(hH){if($H&&Qh.test(FH)&&F>=2023)EH.push(FH);else throw hH}while(E(",",!0));var bH={options:void 0};bH.setOption=function(hH,PH){if(this.options===void 0)this.options={};this.options[hH]=PH},n(bH,function(PH){if(PH==="option")t(bH,PH),E(";");else throw Z(PH)},function(){CH(bH)})}function u(EH,$H){var FH=1;if(EH.charAt(0)==="-")FH=-1,EH=EH.substring(1);switch(EH){case"inf":case"INF":case"Inf":return FH*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(Zc9.test(EH))return FH*parseInt(EH,10);if(Tc9.test(EH))return FH*parseInt(EH,16);if(Nc9.test(EH))return FH*parseInt(EH,8);if(xc9.test(EH))return FH*parseFloat(EH);throw Z(EH,"number",$H)}function y(EH,$H){switch(EH){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!$H&&EH.charAt(0)==="-")throw Z(EH,"id");if(qc9.test(EH))return parseInt(EH,10);if(zc9.test(EH))return parseInt(EH,16);if(Oc9.test(EH))return parseInt(EH,8);throw Z(EH,"id")}function g(){if(U!==void 0)throw Z("package");if(U=D(),!Qh.test(U))throw Z(U,"name");Q=Q.define(U),E(";")}function h(){var EH=f(),$H;switch(EH){case"weak":$H=J||(J=[]),D();break;case"public":D();default:$H=X||(X=[]);break}EH=q(),E(";"),$H.push(EH)}function p(){if(E("="),F=q(),F<2023)throw Z(F,"syntax");E(";")}function d(){if(E("="),F=q(),!["2023"].includes(F))throw Z(F,"edition");E(";")}function k(EH,$H){switch($H){case"option":return t(EH,$H),E(";"),!0;case"message":return GH(EH,$H),!0;case"enum":return QH(EH,$H),!0;case"service":return OH(EH,$H),!0;case"extend":return e(EH,$H),!0}return!1}function n(EH,$H,FH){var YH=I.line;if(EH){if(typeof EH.comment!=="string")EH.comment=M();EH.filename=Lp.filename}if(E("{",!0)){var qH;while((qH=D())!=="}")$H(qH);E(";",!0)}else{if(FH)FH();if(E(";"),EH&&(typeof EH.comment!=="string"||L))EH.comment=M(YH)||EH.comment}}function GH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"type name");var FH=new WfD($H);if(n(FH,function(qH){if(k(FH,qH))return;switch(qH){case"map":WH(FH,qH);break;case"required":if(F!=="proto2")throw Z(qH);case"repeated":HH(FH,qH);break;case"optional":if(F==="proto3")HH(FH,"proto3_optional");else if(F!=="proto2")throw Z(qH);else HH(FH,"optional");break;case"oneof":wH(FH,qH);break;case"extensions":j(FH.extensions||(FH.extensions=[]));break;case"reserved":j(FH.reserved||(FH.reserved=[]),!0);break;default:if(F==="proto2"||!Qh.test(qH))throw Z(qH);B(qH),HH(FH,"optional");break}}),EH.add(FH),EH===Q)W.push(FH)}function HH(EH,$H,FH){var YH=D();if(YH==="group"){BH(EH,$H);return}while(YH.endsWith(".")||f().startsWith("."))YH+=D();if(!Qh.test(YH))throw Z(YH,"type");var qH=D();if(!Kh.test(qH))throw Z(qH,"name");qH=C(qH),E("=");var bH=new VfD(qH,y(D()),YH,$H,FH);if(n(bH,function(gH){if(gH==="option")t(bH,gH),E(";");else throw Z(gH)},function(){CH(bH)}),$H==="proto3_optional"){var hH=new PfD("_"+qH);bH.setOption("proto3_optional",!0),hH.add(bH),EH.add(hH)}else EH.add(bH);if(EH===Q)W.push(bH)}function BH(EH,$H){if(F>=2023)throw Z("group");var FH=D();if(!Kh.test(FH))throw Z(FH,"name");var YH=SYA.lcFirst(FH);if(FH===YH)FH=SYA.ucFirst(FH);E("=");var qH=y(D()),bH=new WfD(FH);bH.group=!0;var hH=new VfD(YH,qH,FH,$H);hH.filename=Lp.filename,n(bH,function(gH){switch(gH){case"option":t(bH,gH),E(";");break;case"required":case"repeated":HH(bH,gH);break;case"optional":if(F==="proto3")HH(bH,"proto3_optional");else HH(bH,"optional");break;case"message":GH(bH,gH);break;case"enum":QH(bH,gH);break;case"reserved":j(bH.reserved||(bH.reserved=[]),!0);break;default:throw Z(gH)}}),EH.add(bH).add(hH)}function WH(EH){E("<");var $H=D();if(wc9.mapKey[$H]===void 0)throw Z($H,"type");E(",");var FH=D();if(!Qh.test(FH))throw Z(FH,"type");E(">");var YH=D();if(!Kh.test(YH))throw Z(YH,"name");E("=");var qH=new Vc9(C(YH),y(D()),$H,FH);n(qH,function(hH){if(hH==="option")t(qH,hH),E(";");else throw Z(hH)},function(){CH(qH)}),EH.add(qH)}function wH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"name");var FH=new PfD(C($H));n(FH,function(qH){if(qH==="option")t(FH,qH),E(";");else B(qH),HH(FH,"optional")}),EH.add(FH)}function QH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"name");var FH=new Pc9($H);if(n(FH,function(qH){switch(qH){case"option":t(FH,qH),E(";");break;case"reserved":if(j(FH.reserved||(FH.reserved=[]),!0),FH.reserved===void 0)FH.reserved=[];break;default:TH(FH,qH)}}),EH.add(FH),EH===Q)W.push(FH)}function TH(EH,$H){if(!Kh.test($H))throw Z($H,"name");E("=");var FH=y(D(),!0),YH={options:void 0};YH.getOption=function(qH){return this.options[qH]},YH.setOption=function(qH,bH){Cc9.prototype.setOption.call(YH,qH,bH)},YH.setParsedOption=function(){return},n(YH,function(bH){if(bH==="option")t(YH,bH),E(";");else throw Z(bH)},function(){CH(YH)}),EH.add($H,FH,YH.comment,YH.parsedOptions||YH.options)}function t(EH,$H){var FH,YH,qH=!0;if($H==="option")$H=D();while($H!=="="){if($H==="("){var bH=D();E(")"),$H="("+bH+")"}if(qH){if(qH=!1,$H.includes(".")&&!$H.includes("(")){var hH=$H.split(".");FH=hH[0]+".",$H=hH[1];continue}FH=$H}else YH=YH?YH+=$H:$H;$H=D()}var PH=YH?FH.concat(YH):FH,gH=IH(EH,PH);YH=YH&&YH[0]==="."?YH.slice(1):YH,FH=FH&&FH[FH.length-1]==="."?FH.slice(0,-1):FH,MH(EH,FH,gH,YH)}function IH(EH,$H){if(E("{",!0)){var FH={};while(!E("}",!0)){if(!Kh.test(DH=D()))throw Z(DH,"name");if(DH===null)throw Z(DH,"end of input");var YH,qH=DH;if(E(":",!0),f()==="{")YH=IH(EH,$H+"."+DH);else if(f()==="["){YH=[];var bH;if(E("[",!0)){do bH=O(!0),YH.push(bH);while(E(",",!0));if(E("]"),typeof bH<"u")KH(EH,$H+"."+DH,bH)}}else YH=O(!0),KH(EH,$H+"."+DH,YH);var hH=FH[qH];if(hH)YH=[].concat(hH).concat(YH);FH[qH]=YH,E(",",!0),E(";",!0)}return FH}var PH=O(!0);return KH(EH,$H,PH),PH}function KH(EH,$H,FH){if(Q===EH&&/^features\./.test($H)){P[$H]=FH;return}if(EH.setOption)EH.setOption($H,FH)}function MH(EH,$H,FH,YH){if(EH.setParsedOption)EH.setParsedOption($H,FH,YH)}function CH(EH){if(E("[",!0)){do t(EH,"option");while(E(",",!0));E("]")}return EH}function OH(EH,$H){if(!Kh.test($H=D()))throw Z($H,"service name");var FH=new _c9($H);if(n(FH,function(qH){if(k(FH,qH))return;if(qH==="rpc")LH(FH,qH);else throw Z(qH)}),EH.add(FH),EH===Q)W.push(FH)}function LH(EH,$H){var FH=M(),YH=$H;if(!Kh.test($H=D()))throw Z($H,"name");var qH=$H,bH,hH,PH,gH;if(E("("),E("stream",!0))hH=!0;if(!Qh.test($H=D()))throw Z($H);if(bH=$H,E(")"),E("returns"),E("("),E("stream",!0))gH=!0;if(!Qh.test($H=D()))throw Z($H);PH=$H,E(")");var vH=new Yc9(qH,YH,bH,PH,hH,gH);vH.comment=FH,n(vH,function(K$){if(K$==="option")t(vH,K$),E(";");else throw Z(K$)}),EH.add(vH)}function e(EH,$H){if(!Qh.test($H=D()))throw Z($H,"reference");var FH=$H;n(null,function(qH){switch(qH){case"required":case"repeated":HH(EH,qH,FH);break;case"optional":if(F==="proto3")HH(EH,"proto3_optional",FH);else HH(EH,"optional",FH);break;default:if(F==="proto2"||!Qh.test(qH))throw Z(qH);B(qH),HH(EH,"optional",FH);break}})}var DH;while((DH=D())!==null)switch(DH){case"package":if(!G)throw Z(DH);g();break;case"import":if(!G)throw Z(DH);h();break;case"syntax":if(!G)throw Z(DH);p();break;case"edition":if(!G)throw Z(DH);d();break;case"option":t(Q,DH),E(";",!0);break;default:if(k(Q,DH)){G=!1;continue}throw Z(DH)}return Y(),Lp.filename=null,{package:U,imports:X,weakImports:J,root:$}}});var ZfD=z((vZE,wfD)=>{wfD.exports=FS;var Sc9=/\/|\./;function FS(H,$){if(!Sc9.test(H))H="google/protobuf/"+H+".proto",$={nested:{google:{nested:{protobuf:{nested:$}}}}};FS[H]=$}FS("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var CfD;FS("duration",{Duration:CfD={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});FS("timestamp",{Timestamp:CfD});FS("empty",{Empty:{fields:{}}});FS("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});FS("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});FS("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});FS.get=function($){return FS[$]||null}});var TfD=z((hZE,qfD)=>{var Ro=qfD.exports=XfD();Ro.build="full";Ro.tokenize=xYA();Ro.parse=YfD();Ro.common=ZfD();Ro.Root._configure(Ro.Type,Ro.parse,Ro.common)});var g3$=z((bZE,zfD)=>{zfD.exports=TfD()});var jYA=z((kZE,jc9)=>{jc9.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536000000,536000000]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1000,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1000,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1000,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536000000,536000000]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var yfD=z((c1,RfD)=>{var Ww=g3$();RfD.exports=c1=Ww.descriptor=Ww.Root.fromJSON(jYA()).lookup(".google.protobuf");var{Namespace:NfD,Root:YhH,Enum:Ip,Type:Wh,Field:yo,MapField:Rc9,OneOf:m3$,Service:ChH,Method:p3$}=Ww;YhH.fromDescriptor=function($){if(typeof $.length==="number")$=c1.FileDescriptorSet.decode($);var A=new YhH;if($.file){var L,I;for(var D=0,B;D<$.file.length;++D){if(I=A,(L=$.file[D]).package&&L.package.length)I=A.define(L.package);var f=dc9(L);if(L.name&&L.name.length)A.files.push(I.filename=L.name);if(L.messageType)for(B=0;B{lc9.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var hfD=z((gZE,ic9)=>{ic9.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var bfD=z((mZE,nc9)=>{nc9.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var mfD=z((vo)=>{Object.defineProperty(vo,"__esModule",{value:!0});vo.addCommonProtos=vo.loadProtosWithOptionsSync=vo.loadProtosWithOptions=void 0;var kfD=require("fs"),ufD=require("path"),oWH=g3$();function gfD(H,$){let A=H.resolvePath;H.resolvePath=(L,I)=>{if(ufD.isAbsolute(I))return I;for(let D of $){let B=ufD.join(D,I);try{return kfD.accessSync(B,kfD.constants.R_OK),B}catch(f){continue}}return process.emitWarning(`${I} not found in any of the include paths ${$}`),A(L,I)}}async function rc9(H,$){let A=new oWH.Root;if($=$||{},$.includeDirs){if(!Array.isArray($.includeDirs))return Promise.reject(Error("The includeDirs option must be an array"));gfD(A,$.includeDirs)}let L=await A.load(H,$);return L.resolveAll(),L}vo.loadProtosWithOptions=rc9;function ac9(H,$){let A=new oWH.Root;if($=$||{},$.includeDirs){if(!Array.isArray($.includeDirs))throw Error("The includeDirs option must be an array");gfD(A,$.includeDirs)}let L=A.loadSync(H,$);return L.resolveAll(),L}vo.loadProtosWithOptionsSync=ac9;function oc9(){let H=vfD(),$=jYA(),A=hfD(),L=bfD();oWH.common("api",H.nested.google.nested.protobuf.nested),oWH.common("descriptor",$.nested.google.nested.protobuf.nested),oWH.common("source_context",A.nested.google.nested.protobuf.nested),oWH.common("type",L.nested.google.nested.protobuf.nested)}vo.addCommonProtos=oc9});var pfD=z((whH,yYA)=>{(function(H,$){function A(L){return"default"in L?L.default:L}if(typeof define==="function"&&define.amd)define([],function(){var L={};return $(L),A(L)});else if(typeof whH==="object"){if($(whH),typeof yYA==="object")yYA.exports=A(whH)}else(function(){var L={};$(L),H.Long=A(L)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:whH,function(H){Object.defineProperty(H,"__esModule",{value:!0}),H.default=void 0;var $=null;try{$=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function A(d,k,n){this.low=d|0,this.high=k|0,this.unsigned=!!n}A.prototype.__isLong__,Object.defineProperty(A.prototype,"__isLong__",{value:!0});function L(d){return(d&&d.__isLong__)===!0}function I(d){var k=Math.clz32(d&-d);return d?31-k:k}A.isLong=L;var D={},B={};function f(d,k){var n,GH,HH;if(k){if(d>>>=0,HH=0<=d&&d<256){if(GH=B[d],GH)return GH}if(n=M(d,0,!0),HH)B[d]=n;return n}else{if(d|=0,HH=-128<=d&&d<128){if(GH=D[d],GH)return GH}if(n=M(d,d<0?-1:0,!1),HH)D[d]=n;return n}}A.fromInt=f;function E(d,k){if(isNaN(d))return k?Z:Y;if(k){if(d<0)return Z;if(d>=W)return y}else{if(d<=-P)return g;if(d+1>=P)return u}if(d<0)return E(-d,k).neg();return M(d%Q|0,d/Q|0,k)}A.fromNumber=E;function M(d,k,n){return new A(d,k,n)}A.fromBits=M;var G=Math.pow;function U(d,k,n){if(d.length===0)throw Error("empty string");if(typeof k==="number")n=k,k=!1;else k=!!k;if(d==="NaN"||d==="Infinity"||d==="+Infinity"||d==="-Infinity")return k?Z:Y;if(n=n||10,n<2||360)throw Error("interior hyphen");else if(GH===0)return U(d.substring(1),k,n).neg();var HH=E(G(n,8)),BH=Y;for(var WH=0;WH>>0:this.low},h.toNumber=function(){if(this.unsigned)return(this.high>>>0)*Q+(this.low>>>0);return this.high*Q+(this.low>>>0)},h.toString=function(k){if(k=k||10,k<2||36>>0,t=TH.toString(k);if(WH=QH,WH.isZero())return t+wH;else{while(t.length<6)t="0"+t;wH=""+t+wH}}},h.getHighBits=function(){return this.high},h.getHighBitsUnsigned=function(){return this.high>>>0},h.getLowBits=function(){return this.low},h.getLowBitsUnsigned=function(){return this.low>>>0},h.getNumBitsAbs=function(){if(this.isNegative())return this.eq(g)?64:this.neg().getNumBitsAbs();var k=this.high!=0?this.high:this.low;for(var n=31;n>0;n--)if((k&1<>21;if(!k)return!0;if(this.unsigned)return!1;return k===-1&&!(this.low===0&&this.high===-2097152)},h.isZero=function(){return this.high===0&&this.low===0},h.eqz=h.isZero,h.isNegative=function(){return!this.unsigned&&this.high<0},h.isPositive=function(){return this.unsigned||this.high>=0},h.isOdd=function(){return(this.low&1)===1},h.isEven=function(){return(this.low&1)===0},h.equals=function(k){if(!L(k))k=X(k);if(this.unsigned!==k.unsigned&&this.high>>>31===1&&k.high>>>31===1)return!1;return this.high===k.high&&this.low===k.low},h.eq=h.equals,h.notEquals=function(k){return!this.eq(k)},h.neq=h.notEquals,h.ne=h.notEquals,h.lessThan=function(k){return this.comp(k)<0},h.lt=h.lessThan,h.lessThanOrEqual=function(k){return this.comp(k)<=0},h.lte=h.lessThanOrEqual,h.le=h.lessThanOrEqual,h.greaterThan=function(k){return this.comp(k)>0},h.gt=h.greaterThan,h.greaterThanOrEqual=function(k){return this.comp(k)>=0},h.gte=h.greaterThanOrEqual,h.ge=h.greaterThanOrEqual,h.compare=function(k){if(!L(k))k=X(k);if(this.eq(k))return 0;var n=this.isNegative(),GH=k.isNegative();if(n&&!GH)return-1;if(!n&&GH)return 1;if(!this.unsigned)return this.sub(k).isNegative()?-1:1;return k.high>>>0>this.high>>>0||k.high===this.high&&k.low>>>0>this.low>>>0?-1:1},h.comp=h.compare,h.negate=function(){if(!this.unsigned&&this.eq(g))return g;return this.not().add(q)},h.neg=h.negate,h.add=function(k){if(!L(k))k=X(k);var n=this.high>>>16,GH=this.high&65535,HH=this.low>>>16,BH=this.low&65535,WH=k.high>>>16,wH=k.high&65535,QH=k.low>>>16,TH=k.low&65535,t=0,IH=0,KH=0,MH=0;return MH+=BH+TH,KH+=MH>>>16,MH&=65535,KH+=HH+QH,IH+=KH>>>16,KH&=65535,IH+=GH+wH,t+=IH>>>16,IH&=65535,t+=n+WH,t&=65535,M(KH<<16|MH,t<<16|IH,this.unsigned)},h.subtract=function(k){if(!L(k))k=X(k);return this.add(k.neg())},h.sub=h.subtract,h.multiply=function(k){if(this.isZero())return this;if(!L(k))k=X(k);if($){var n=$.mul(this.low,this.high,k.low,k.high);return M(n,$.get_high(),this.unsigned)}if(k.isZero())return this.unsigned?Z:Y;if(this.eq(g))return k.isOdd()?g:Y;if(k.eq(g))return this.isOdd()?g:Y;if(this.isNegative())if(k.isNegative())return this.neg().mul(k.neg());else return this.neg().mul(k).neg();else if(k.isNegative())return this.mul(k.neg()).neg();if(this.lt(C)&&k.lt(C))return E(this.toNumber()*k.toNumber(),this.unsigned);var GH=this.high>>>16,HH=this.high&65535,BH=this.low>>>16,WH=this.low&65535,wH=k.high>>>16,QH=k.high&65535,TH=k.low>>>16,t=k.low&65535,IH=0,KH=0,MH=0,CH=0;return CH+=WH*t,MH+=CH>>>16,CH&=65535,MH+=BH*t,KH+=MH>>>16,MH&=65535,MH+=WH*TH,KH+=MH>>>16,MH&=65535,KH+=HH*t,IH+=KH>>>16,KH&=65535,KH+=BH*TH,IH+=KH>>>16,KH&=65535,KH+=WH*QH,IH+=KH>>>16,KH&=65535,IH+=GH*t+HH*TH+BH*QH+WH*wH,IH&=65535,M(MH<<16|CH,IH<<16|KH,this.unsigned)},h.mul=h.multiply,h.divide=function(k){if(!L(k))k=X(k);if(k.isZero())throw Error("division by zero");if($){if(!this.unsigned&&this.high===-2147483648&&k.low===-1&&k.high===-1)return this;var n=(this.unsigned?$.div_u:$.div_s)(this.low,this.high,k.low,k.high);return M(n,$.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Z:Y;var GH,HH,BH;if(!this.unsigned){if(this.eq(g))if(k.eq(q)||k.eq(j))return g;else if(k.eq(g))return q;else{var WH=this.shr(1);if(GH=WH.div(k).shl(1),GH.eq(Y))return k.isNegative()?q:j;else return HH=this.sub(k.mul(GH)),BH=GH.add(HH.div(k)),BH}else if(k.eq(g))return this.unsigned?Z:Y;if(this.isNegative()){if(k.isNegative())return this.neg().div(k.neg());return this.neg().div(k).neg()}else if(k.isNegative())return this.div(k.neg()).neg();BH=Y}else{if(!k.unsigned)k=k.toUnsigned();if(k.gt(this))return Z;if(k.gt(this.shru(1)))return O;BH=Z}HH=this;while(HH.gte(k)){GH=Math.max(1,Math.floor(HH.toNumber()/k.toNumber()));var wH=Math.ceil(Math.log(GH)/Math.LN2),QH=wH<=48?1:G(2,wH-48),TH=E(GH),t=TH.mul(k);while(t.isNegative()||t.gt(HH))GH-=QH,TH=E(GH,this.unsigned),t=TH.mul(k);if(TH.isZero())TH=q;BH=BH.add(TH),HH=HH.sub(t)}return BH},h.div=h.divide,h.modulo=function(k){if(!L(k))k=X(k);if($){var n=(this.unsigned?$.rem_u:$.rem_s)(this.low,this.high,k.low,k.high);return M(n,$.get_high(),this.unsigned)}return this.sub(this.div(k).mul(k))},h.mod=h.modulo,h.rem=h.modulo,h.not=function(){return M(~this.low,~this.high,this.unsigned)},h.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},h.clz=h.countLeadingZeros,h.countTrailingZeros=function(){return this.low?I(this.low):I(this.high)+32},h.ctz=h.countTrailingZeros,h.and=function(k){if(!L(k))k=X(k);return M(this.low&k.low,this.high&k.high,this.unsigned)},h.or=function(k){if(!L(k))k=X(k);return M(this.low|k.low,this.high|k.high,this.unsigned)},h.xor=function(k){if(!L(k))k=X(k);return M(this.low^k.low,this.high^k.high,this.unsigned)},h.shiftLeft=function(k){if(L(k))k=k.toInt();if((k&=63)===0)return this;else if(k<32)return M(this.low<>>32-k,this.unsigned);else return M(0,this.low<>>k|this.high<<32-k,this.high>>k,this.unsigned);else return M(this.high>>k-32,this.high>=0?0:-1,this.unsigned)},h.shr=h.shiftRight,h.shiftRightUnsigned=function(k){if(L(k))k=k.toInt();if((k&=63)===0)return this;if(k<32)return M(this.low>>>k|this.high<<32-k,this.high>>>k,this.unsigned);if(k===32)return M(this.high,0,this.unsigned);return M(this.high>>>k-32,0,this.unsigned)},h.shru=h.shiftRightUnsigned,h.shr_u=h.shiftRightUnsigned,h.rotateLeft=function(k){var n;if(L(k))k=k.toInt();if((k&=63)===0)return this;if(k===32)return M(this.high,this.low,this.unsigned);if(k<32)return n=32-k,M(this.low<>>n,this.high<>>n,this.unsigned);return k-=32,n=32-k,M(this.high<>>n,this.low<>>n,this.unsigned)},h.rotl=h.rotateLeft,h.rotateRight=function(k){var n;if(L(k))k=k.toInt();if((k&=63)===0)return this;if(k===32)return M(this.high,this.low,this.unsigned);if(k<32)return n=32-k,M(this.high<>>k,this.low<>>k,this.unsigned);return k-=32,n=32-k,M(this.low<>>k,this.high<>>k,this.unsigned)},h.rotr=h.rotateRight,h.toSigned=function(){if(!this.unsigned)return this;return M(this.low,this.high,!1)},h.toUnsigned=function(){if(this.unsigned)return this;return M(this.low,this.high,!0)},h.toBytes=function(k){return k?this.toBytesLE():this.toBytesBE()},h.toBytesLE=function(){var k=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,k&255,k>>>8&255,k>>>16&255,k>>>24]},h.toBytesBE=function(){var k=this.high,n=this.low;return[k>>>24,k>>>16&255,k>>>8&255,k&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},A.fromBytes=function(k,n,GH){return GH?A.fromBytesLE(k,n):A.fromBytesBE(k,n)},A.fromBytesLE=function(k,n){return new A(k[0]|k[1]<<8|k[2]<<16|k[3]<<24,k[4]|k[5]<<8|k[6]<<16|k[7]<<24,n)},A.fromBytesBE=function(k,n){return new A(k[4]<<24|k[5]<<16|k[6]<<8|k[7],k[0]<<24|k[1]<<16|k[2]<<8|k[3],n)},typeof BigInt==="function")A.fromBigInt=function(k,n){var GH=Number(BigInt.asIntN(32,k)),HH=Number(BigInt.asIntN(32,k>>BigInt(32)));return M(GH,HH,n)},A.fromValue=function(k,n){if(typeof k==="bigint")return fromBigInt(k,n);return X(k,n)},h.toBigInt=function(){var k=BigInt(this.low>>>0),n=BigInt(this.unsigned?this.high>>>0:this.high);return n<{Object.defineProperty(NK,"__esModule",{value:!0});NK.loadFileDescriptorSetFromObject=NK.loadFileDescriptorSetFromBuffer=NK.fromJSON=NK.loadSync=NK.load=NK.IdempotencyLevel=NK.isAnyExtension=NK.Long=void 0;var tc9=q8D(),Vh=g3$(),kYA=yfD(),uYA=mfD(),sc9=pfD();NK.Long=sc9;function ec9(H){return"@type"in H&&typeof H["@type"]==="string"}NK.isAnyExtension=ec9;var dfD;(function(H){H.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",H.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",H.IDEMPOTENT="IDEMPOTENT"})(dfD=NK.IdempotencyLevel||(NK.IdempotencyLevel={}));var cfD={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function Hl9(H,$){if(H==="")return $;else return H+"."+$}function $l9(H){return H instanceof Vh.Service||H instanceof Vh.Type||H instanceof Vh.Enum}function Al9(H){return H instanceof Vh.Namespace||H instanceof Vh.Root}function lfD(H,$){let A=Hl9($,H.name);if($l9(H))return[[A,H]];else if(Al9(H)&&typeof H.nested<"u")return Object.keys(H.nested).map((L)=>{return lfD(H.nested[L],A)}).reduce((L,I)=>L.concat(I),[]);return[]}function vYA(H,$){return function(L){return H.toObject(H.decode(L),$)}}function hYA(H){return function(A){if(Array.isArray(A))throw Error(`Failed to serialize message: expected object with ${H.name} structure, got array instead`);let L=H.fromObject(A);return H.encode(L).finish()}}function Ll9(H){return(H||[]).reduce(($,A)=>{for(let[L,I]of Object.entries(A))switch(L){case"uninterpreted_option":$.uninterpreted_option.push(A.uninterpreted_option);break;default:$[L]=I}return $},{deprecated:!1,idempotency_level:dfD.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function Il9(H,$,A,L){let{resolvedRequestType:I,resolvedResponseType:D}=H;return{path:"/"+$+"/"+H.name,requestStream:!!H.requestStream,responseStream:!!H.responseStream,requestSerialize:hYA(I),requestDeserialize:vYA(I,A),responseSerialize:hYA(D),responseDeserialize:vYA(D,A),originalName:tc9(H.name),requestType:bYA(I,A,L),responseType:bYA(D,A,L),options:Ll9(H.parsedOptions)}}function Dl9(H,$,A,L){let I={};for(let D of H.methodsArray)I[D.name]=Il9(D,$,A,L);return I}function bYA(H,$,A){let L=H.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:L.$type.toObject(L,cfD),fileDescriptorProtos:A,serialize:hYA(H),deserialize:vYA(H,$)}}function Bl9(H,$){let A=H.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:A.$type.toObject(A,cfD),fileDescriptorProtos:$}}function fl9(H,$,A,L){if(H instanceof Vh.Service)return Dl9(H,$,A,L);else if(H instanceof Vh.Type)return bYA(H,A,L);else if(H instanceof Vh.Enum)return Bl9(H,L);else throw Error("Type mismatch in reflection object handling")}function d3$(H,$){let A={};H.resolveAll();let I=H.toDescriptor("proto3").file.map((D)=>Buffer.from(kYA.FileDescriptorProto.encode(D).finish()));for(let[D,B]of lfD(H,""))A[D]=fl9(B,D,$,I);return A}function ifD(H,$){$=$||{};let A=Vh.Root.fromDescriptor(H);return A.resolveAll(),d3$(A,$)}function El9(H,$){return(0,uYA.loadProtosWithOptions)(H,$).then((A)=>{return d3$(A,$)})}NK.load=El9;function Ml9(H,$){let A=(0,uYA.loadProtosWithOptionsSync)(H,$);return d3$(A,$)}NK.loadSync=Ml9;function Gl9(H,$){$=$||{};let A=Vh.Root.fromJSON(H);return A.resolveAll(),d3$(A,$)}NK.fromJSON=Gl9;function Ul9(H,$){let A=kYA.FileDescriptorSet.decode(H);return ifD(A,$)}NK.loadFileDescriptorSetFromBuffer=Ul9;function Xl9(H,$){let A=kYA.FileDescriptorSet.fromObject(H);return ifD(A,$)}NK.loadFileDescriptorSetFromObject=Xl9;(0,uYA.addCommonProtos)()});var ho=z((JU)=>{var __dirname="/home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(JU,"__esModule",{value:!0});JU.registerChannelzSocket=JU.registerChannelzServer=JU.registerChannelzSubchannel=JU.registerChannelzChannel=JU.ChannelzCallTrackerStub=JU.ChannelzCallTracker=JU.ChannelzChildrenTrackerStub=JU.ChannelzChildrenTracker=JU.ChannelzTrace=JU.ChannelzTraceStub=void 0;JU.unregisterChannelzRef=Wl9;JU.getChannelzHandlers=IED;JU.getChannelzServiceDefinition=DED;JU.setup=Nl9;var l3$=require("net"),z0H=b1D(),ZhH=xP(),qhH=B8(),Jl9=cY(),Fl9=K3$(),Kl9=P3$();function mYA(H){return{channel_id:H.id,name:H.name}}function pYA(H){return{subchannel_id:H.id,name:H.name}}function Ql9(H){return{server_id:H.id}}function i3$(H){return{socket_id:H.id,name:H.name}}var nfD=32,dYA=100;class tfD{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Ph(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}}JU.ChannelzTraceStub=tfD;class sfD{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(H,$,A){let L=new Date;if(this.events.push({description:$,severity:H,timestamp:L,childChannel:(A===null||A===void 0?void 0:A.kind)==="channel"?A:void 0,childSubchannel:(A===null||A===void 0?void 0:A.kind)==="subchannel"?A:void 0}),this.events.length>=nfD*2)this.events=this.events.slice(nfD);this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Ph(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map((H)=>{return{description:H.description,severity:H.severity,timestamp:Ph(H.timestamp),channel_ref:H.childChannel?mYA(H.childChannel):null,subchannel_ref:H.childSubchannel?pYA(H.childSubchannel):null}})}}}JU.ChannelzTrace=sfD;class cYA{constructor(){this.channelChildren=new z0H.OrderedMap,this.subchannelChildren=new z0H.OrderedMap,this.socketChildren=new z0H.OrderedMap,this.trackerMap={["channel"]:this.channelChildren,["subchannel"]:this.subchannelChildren,["socket"]:this.socketChildren}}refChild(H){let $=this.trackerMap[H.kind],A=$.find(H.id);if(A.equals($.end()))$.setElement(H.id,{ref:H,count:1},A);else A.pointer[1].count+=1}unrefChild(H){let $=this.trackerMap[H.kind],A=$.getElementByKey(H.id);if(A!==void 0){if(A.count-=1,A.count===0)$.eraseElementByKey(H.id)}}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}}JU.ChannelzChildrenTracker=cYA;class efD extends cYA{refChild(){}unrefChild(){}}JU.ChannelzChildrenTrackerStub=efD;class lYA{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}}JU.ChannelzCallTracker=lYA;class HED extends lYA{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}}JU.ChannelzCallTrackerStub=HED;var Dp={["channel"]:new z0H.OrderedMap,["subchannel"]:new z0H.OrderedMap,["server"]:new z0H.OrderedMap,["socket"]:new z0H.OrderedMap},n3$=(H)=>{let $=1;function A(){return $++}let L=Dp[H];return(I,D,B)=>{let f=A(),E={id:f,name:I,kind:H};if(B)L.setElement(f,{ref:E,getInfo:D});return E}};JU.registerChannelzChannel=n3$("channel");JU.registerChannelzSubchannel=n3$("subchannel");JU.registerChannelzServer=n3$("server");JU.registerChannelzSocket=n3$("socket");function Wl9(H){Dp[H.kind].eraseElementByKey(H.id)}function Vl9(H){let $=Number.parseInt(H,16);return[$/256|0,$%256]}function rfD(H){if(H==="")return[];let $=H.split(":").map((L)=>Vl9(L));return[].concat(...$)}function Pl9(H){return(0,l3$.isIPv6)(H)&&H.toLowerCase().startsWith("::ffff:")&&(0,l3$.isIPv4)(H.substring(7))}function afD(H){return Buffer.from(Uint8Array.from(H.split(".").map(($)=>Number.parseInt($))))}function _l9(H){if((0,l3$.isIPv4)(H))return afD(H);else if(Pl9(H))return afD(H.substring(7));else if((0,l3$.isIPv6)(H)){let $,A,L=H.indexOf("::");if(L===-1)$=H,A="";else $=H.substring(0,L),A=H.substring(L+2);let I=Buffer.from(rfD($)),D=Buffer.from(rfD(A)),B=Buffer.alloc(16-I.length-D.length,0);return Buffer.concat([I,B,D])}else return null}function $ED(H){switch(H){case ZhH.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case ZhH.ConnectivityState.IDLE:return{state:"IDLE"};case ZhH.ConnectivityState.READY:return{state:"READY"};case ZhH.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case ZhH.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Ph(H){if(!H)return null;let $=H.getTime();return{seconds:$/1000|0,nanos:$%1000*1e6}}function AED(H){let $=H.getInfo(),A=[],L=[];return $.children.channels.forEach((I)=>{A.push(mYA(I[1].ref))}),$.children.subchannels.forEach((I)=>{L.push(pYA(I[1].ref))}),{ref:mYA(H.ref),data:{target:$.target,state:$ED($.state),calls_started:$.callTracker.callsStarted,calls_succeeded:$.callTracker.callsSucceeded,calls_failed:$.callTracker.callsFailed,last_call_started_timestamp:Ph($.callTracker.lastCallStartedTimestamp),trace:$.trace.getTraceMessage()},channel_ref:A,subchannel_ref:L}}function Yl9(H,$){let A=parseInt(H.request.channel_id,10),L=Dp.channel.getElementByKey(A);if(L===void 0){$({code:qhH.Status.NOT_FOUND,details:"No channel data found for id "+A});return}$(null,{channel:AED(L)})}function Cl9(H,$){let A=parseInt(H.request.max_results,10)||dYA,L=[],I=parseInt(H.request.start_channel_id,10),D=Dp.channel,B;for(B=D.lowerBound(I);!B.equals(D.end())&&L.length{A.push(i3$(L[1].ref))}),{ref:Ql9(H.ref),data:{calls_started:$.callTracker.callsStarted,calls_succeeded:$.callTracker.callsSucceeded,calls_failed:$.callTracker.callsFailed,last_call_started_timestamp:Ph($.callTracker.lastCallStartedTimestamp),trace:$.trace.getTraceMessage()},listen_socket:A}}function wl9(H,$){let A=parseInt(H.request.server_id,10),I=Dp.server.getElementByKey(A);if(I===void 0){$({code:qhH.Status.NOT_FOUND,details:"No server data found for id "+A});return}$(null,{server:LED(I)})}function Zl9(H,$){let A=parseInt(H.request.max_results,10)||dYA,L=parseInt(H.request.start_server_id,10),I=Dp.server,D=[],B;for(B=I.lowerBound(L);!B.equals(I.end())&&D.length{D.push(i3$(f[1].ref))});let B={ref:pYA(L.ref),data:{target:I.target,state:$ED(I.state),calls_started:I.callTracker.callsStarted,calls_succeeded:I.callTracker.callsSucceeded,calls_failed:I.callTracker.callsFailed,last_call_started_timestamp:Ph(I.callTracker.lastCallStartedTimestamp),trace:I.trace.getTraceMessage()},socket_ref:D};$(null,{subchannel:B})}function ofD(H){var $;if((0,Jl9.isTcpSubchannelAddress)(H))return{address:"tcpip_address",tcpip_address:{ip_address:($=_l9(H.host))!==null&&$!==void 0?$:void 0,port:H.port}};else return{address:"uds_address",uds_address:{filename:H.path}}}function Tl9(H,$){var A,L,I,D,B;let f=parseInt(H.request.socket_id,10),E=Dp.socket.getElementByKey(f);if(E===void 0){$({code:qhH.Status.NOT_FOUND,details:"No socket data found for id "+f});return}let M=E.getInfo(),G=M.security?{model:"tls",tls:{cipher_suite:M.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(A=M.security.cipherSuiteStandardName)!==null&&A!==void 0?A:void 0,other_name:(L=M.security.cipherSuiteOtherName)!==null&&L!==void 0?L:void 0,local_certificate:(I=M.security.localCertificate)!==null&&I!==void 0?I:void 0,remote_certificate:(D=M.security.remoteCertificate)!==null&&D!==void 0?D:void 0}}:null,U={ref:i3$(E.ref),local:M.localAddress?ofD(M.localAddress):null,remote:M.remoteAddress?ofD(M.remoteAddress):null,remote_name:(B=M.remoteName)!==null&&B!==void 0?B:void 0,security:G,data:{keep_alives_sent:M.keepAlivesSent,streams_started:M.streamsStarted,streams_succeeded:M.streamsSucceeded,streams_failed:M.streamsFailed,last_local_stream_created_timestamp:Ph(M.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Ph(M.lastRemoteStreamCreatedTimestamp),messages_received:M.messagesReceived,messages_sent:M.messagesSent,last_message_received_timestamp:Ph(M.lastMessageReceivedTimestamp),last_message_sent_timestamp:Ph(M.lastMessageSentTimestamp),local_flow_control_window:M.localFlowControlWindow?{value:M.localFlowControlWindow}:null,remote_flow_control_window:M.remoteFlowControlWindow?{value:M.remoteFlowControlWindow}:null}};$(null,{socket:U})}function zl9(H,$){let A=parseInt(H.request.server_id,10),L=Dp.server.getElementByKey(A);if(L===void 0){$({code:qhH.Status.NOT_FOUND,details:"No server data found for id "+A});return}let I=parseInt(H.request.start_socket_id,10),D=parseInt(H.request.max_results,10)||dYA,f=L.getInfo().sessionChildren.sockets,E=[],M;for(M=f.lowerBound(I);!M.equals(f.end())&&E.length{Object.defineProperty(iYA,"__esModule",{value:!0});iYA.getNextCallNumber=xl9;var Ol9=0;function xl9(){return Ol9++}});var nYA=z((a3$)=>{Object.defineProperty(a3$,"__esModule",{value:!0});a3$.CompressionAlgorithms=void 0;var BED;(function(H){H[H.identity=0]="identity",H[H.deflate=1]="deflate",H[H.gzip=2]="gzip"})(BED||(a3$.CompressionAlgorithms=BED={}))});var rYA=z((o3$)=>{Object.defineProperty(o3$,"__esModule",{value:!0});o3$.BaseFilter=void 0;class fED{async sendMetadata(H){return H}receiveMetadata(H){return H}async sendMessage(H){return H}async receiveMessage(H){return H}receiveTrailers(H){return H}}o3$.BaseFilter=fED});var oYA=z((eWH)=>{Object.defineProperty(eWH,"__esModule",{value:!0});eWH.CompressionFilterFactory=eWH.CompressionFilter=void 0;var t3$=require("zlib"),MED=nYA(),tWH=B8(),Sl9=rYA(),jl9=qG(),Rl9=(H)=>{return typeof H==="number"&&typeof MED.CompressionAlgorithms[H]==="string"};class ThH{async writeMessage(H,$){let A=H;if($)A=await this.compressMessage(A);let L=Buffer.allocUnsafe(A.length+5);return L.writeUInt8($?1:0,0),L.writeUInt32BE(A.length,1),A.copy(L,5),L}async readMessage(H){let $=H.readUInt8(0)===1,A=H.slice(5);if($)A=await this.decompressMessage(A);return A}}class sWH extends ThH{async compressMessage(H){return H}async writeMessage(H,$){let A=Buffer.allocUnsafe(H.length+5);return A.writeUInt8(0,0),A.writeUInt32BE(H.length,1),H.copy(A,5),A}decompressMessage(H){return Promise.reject(Error('Received compressed message but "grpc-encoding" header was identity'))}}class GED extends ThH{constructor(H){super();this.maxRecvMessageLength=H}compressMessage(H){return new Promise(($,A)=>{t3$.deflate(H,(L,I)=>{if(L)A(L);else $(I)})})}decompressMessage(H){return new Promise(($,A)=>{let L=0,I=[],D=t3$.createInflate();D.on("data",(B)=>{if(I.push(B),L+=B.byteLength,this.maxRecvMessageLength!==-1&&L>this.maxRecvMessageLength)D.destroy(),A({code:tWH.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),D.on("end",()=>{$(Buffer.concat(I))}),D.write(H),D.end()})}}class UED extends ThH{constructor(H){super();this.maxRecvMessageLength=H}compressMessage(H){return new Promise(($,A)=>{t3$.gzip(H,(L,I)=>{if(L)A(L);else $(I)})})}decompressMessage(H){return new Promise(($,A)=>{let L=0,I=[],D=t3$.createGunzip();D.on("data",(B)=>{if(I.push(B),L+=B.byteLength,this.maxRecvMessageLength!==-1&&L>this.maxRecvMessageLength)D.destroy(),A({code:tWH.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),D.on("end",()=>{$(Buffer.concat(I))}),D.write(H),D.end()})}}class XED extends ThH{constructor(H){super();this.compressionName=H}compressMessage(H){return Promise.reject(Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(H){return Promise.reject(Error(`Compression method not supported: ${this.compressionName}`))}}function EED(H,$){switch(H){case"identity":return new sWH;case"deflate":return new GED($);case"gzip":return new UED($);default:return new XED(H)}}class aYA extends Sl9.BaseFilter{constructor(H,$){var A,L,I;super();this.sharedFilterConfig=$,this.sendCompression=new sWH,this.receiveCompression=new sWH,this.currentCompressionAlgorithm="identity";let D=H["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(A=H["grpc.max_receive_message_length"])!==null&&A!==void 0?A:tWH.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(L=H["grpc.max_send_message_length"])!==null&&L!==void 0?L:tWH.DEFAULT_MAX_SEND_MESSAGE_LENGTH,D!==void 0)if(Rl9(D)){let B=MED.CompressionAlgorithms[D],f=(I=$.serverSupportedEncodingHeader)===null||I===void 0?void 0:I.split(",");if(!f||f.includes(B))this.currentCompressionAlgorithm=B,this.sendCompression=EED(this.currentCompressionAlgorithm,-1)}else jl9.log(tWH.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${D}`)}async sendMetadata(H){let $=await H;if($.set("grpc-accept-encoding","identity,deflate,gzip"),$.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity")$.remove("grpc-encoding");else $.set("grpc-encoding",this.currentCompressionAlgorithm);return $}receiveMetadata(H){let $=H.get("grpc-encoding");if($.length>0){let L=$[0];if(typeof L==="string")this.receiveCompression=EED(L,this.maxReceiveMessageLength)}H.remove("grpc-encoding");let A=H.get("grpc-accept-encoding")[0];if(A){if(this.sharedFilterConfig.serverSupportedEncodingHeader=A,!A.split(",").includes(this.currentCompressionAlgorithm))this.sendCompression=new sWH,this.currentCompressionAlgorithm="identity"}return H.remove("grpc-accept-encoding"),H}async sendMessage(H){var $;let A=await H;if(this.maxSendMessageLength!==-1&&A.message.length>this.maxSendMessageLength)throw{code:tWH.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let L;if(this.sendCompression instanceof sWH)L=!1;else L=((($=A.flags)!==null&&$!==void 0?$:0)&2)===0;return{message:await this.sendCompression.writeMessage(A.message,L),flags:A.flags}}async receiveMessage(H){return this.receiveCompression.readMessage(await H)}}eWH.CompressionFilter=aYA;class JED{constructor(H,$){this.options=$,this.sharedFilterConfig={}}createFilter(){return new aYA(this.options,this.sharedFilterConfig)}}eWH.CompressionFilterFactory=JED});var zhH=z((tYA)=>{Object.defineProperty(tYA,"__esModule",{value:!0});tYA.restrictControlPlaneStatusCode=vl9;var _h=B8(),yl9=[_h.Status.OK,_h.Status.INVALID_ARGUMENT,_h.Status.NOT_FOUND,_h.Status.ALREADY_EXISTS,_h.Status.FAILED_PRECONDITION,_h.Status.ABORTED,_h.Status.OUT_OF_RANGE,_h.Status.DATA_LOSS];function vl9(H,$){if(yl9.includes(H))return{code:_h.Status.INTERNAL,details:`Invalid status from control plane: ${H} ${_h.Status[H]} ${$}`};else return{code:H,details:$}}});var H7H=z((N0H)=>{Object.defineProperty(N0H,"__esModule",{value:!0});N0H.minDeadline=hl9;N0H.getDeadlineTimeoutString=kl9;N0H.getRelativeTimeout=gl9;N0H.deadlineToString=ml9;N0H.formatDateDifference=pl9;function hl9(...H){let $=1/0;for(let A of H){let L=A instanceof Date?A.getTime():A;if(L<$)$=L}return $}var bl9=[["m",1],["S",1000],["M",60000],["H",3600000]];function kl9(H){let $=new Date().getTime();if(H instanceof Date)H=H.getTime();let A=Math.max(H-$,0);for(let[L,I]of bl9){let D=A/I;if(D<1e8)return String(Math.ceil(D))+L}throw Error("Deadline is too far in the future")}var ul9=2147483647;function gl9(H){let $=H instanceof Date?H.getTime():H,A=new Date().getTime(),L=$-A;if(L<0)return 0;else if(L>ul9)return 1/0;else return L}function ml9(H){if(H instanceof Date)return H.toISOString();else{let $=new Date(H);if(Number.isNaN($.getTime()))return""+H;else return $.toISOString()}}function pl9(H,$){return(($.getTime()-H.getTime())/1000).toFixed(3)+"s"}});var s3$=z(($7H)=>{Object.defineProperty($7H,"__esModule",{value:!0});$7H.FilterStackFactory=$7H.FilterStack=void 0;class sYA{constructor(H){this.filters=H}sendMetadata(H){let $=H;for(let A=0;A=0;A--)$=this.filters[A].receiveMetadata($);return $}sendMessage(H){let $=H;for(let A=0;A=0;A--)$=this.filters[A].receiveMessage($);return $}receiveTrailers(H){let $=H;for(let A=this.filters.length-1;A>=0;A--)$=this.filters[A].receiveTrailers($);return $}push(H){this.filters.unshift(...H)}getFilters(){return this.filters}}$7H.FilterStack=sYA;class eYA{constructor(H){this.factories=H}push(H){this.factories.unshift(...H)}clone(){return new eYA([...this.factories])}createFilter(){return new sYA(this.factories.map((H)=>H.createFilter()))}}$7H.FilterStackFactory=eYA});var QED=z((HV$)=>{Object.defineProperty(HV$,"__esModule",{value:!0});HV$.SingleSubchannelChannel=void 0;var dl9=r3$(),NhH=ho(),cl9=oYA(),ll9=xP(),OhH=B8(),il9=zhH(),nl9=H7H(),rl9=s3$(),HCA=rQ(),al9=BS(),e3$=OP();class FED{constructor(H,$,A,L,I){var D,B;this.subchannel=H,this.method=$,this.options=L,this.callNumber=I,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let f=this.method.split("/"),E="";if(f.length>=2)E=f[1];let M=(B=(D=(0,e3$.splitHostPort)(this.options.host))===null||D===void 0?void 0:D.host)!==null&&B!==void 0?B:"localhost";this.serviceUrl=`https://${M}/${E}`;let G=(0,nl9.getRelativeTimeout)(L.deadline);if(G!==1/0)if(G<=0)this.cancelWithStatus(OhH.Status.DEADLINE_EXCEEDED,"Deadline exceeded");else setTimeout(()=>{this.cancelWithStatus(OhH.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},G);this.filterStack=A.createFilter()}cancelWithStatus(H,$){if(this.childCall)this.childCall.cancelWithStatus(H,$);else this.pendingStatus={code:H,details:$,metadata:new HCA.Metadata}}getPeer(){var H,$;return($=(H=this.childCall)===null||H===void 0?void 0:H.getPeer())!==null&&$!==void 0?$:this.subchannel.getAddress()}async start(H,$){if(this.pendingStatus){$.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==ll9.ConnectivityState.READY){$.onReceiveStatus({code:OhH.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new HCA.Metadata});return}let A=await this.filterStack.sendMetadata(Promise.resolve(H)),L;try{L=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(D){let B=D,{code:f,details:E}=(0,il9.restrictControlPlaneStatusCode)(typeof B.code==="number"?B.code:OhH.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${B.message}`);$.onReceiveStatus({code:f,details:E,metadata:new HCA.Metadata});return}L.merge(A);let I={onReceiveMetadata:async(D)=>{$.onReceiveMetadata(await this.filterStack.receiveMetadata(D))},onReceiveMessage:async(D)=>{this.readFilterPending=!0;let B=await this.filterStack.receiveMessage(D);if(this.readFilterPending=!1,$.onReceiveMessage(B),this.pendingStatus)$.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async(D)=>{let B=await this.filterStack.receiveTrailers(D);if(this.readFilterPending)this.pendingStatus=B;else $.onReceiveStatus(B)}};if(this.childCall=this.subchannel.createCall(L,this.options.host,this.method,I),this.readPending)this.childCall.startRead();if(this.pendingMessage)this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message);if(this.halfClosePending&&!this.writeFilterPending)this.childCall.halfClose()}async sendMessageWithContext(H,$){this.writeFilterPending=!0;let A=await this.filterStack.sendMessage(Promise.resolve({message:$,flags:H.flags}));if(this.writeFilterPending=!1,this.childCall){if(this.childCall.sendMessageWithContext(H,A.message),this.halfClosePending)this.childCall.halfClose()}else this.pendingMessage={context:H,message:A.message}}startRead(){if(this.childCall)this.childCall.startRead();else this.readPending=!0}halfClose(){if(this.childCall&&!this.writeFilterPending)this.childCall.halfClose();else this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(H){throw Error("Method not implemented.")}getAuthContext(){if(this.childCall)return this.childCall.getAuthContext();else return null}}class KED{constructor(H,$,A){if(this.subchannel=H,this.target=$,this.channelzEnabled=!1,this.channelzTrace=new NhH.ChannelzTrace,this.callTracker=new NhH.ChannelzCallTracker,this.childrenTracker=new NhH.ChannelzChildrenTracker,this.channelzEnabled=A["grpc.enable_channelz"]!==0,this.channelzRef=(0,NhH.registerChannelzChannel)((0,e3$.uriToString)($),()=>({target:`${(0,e3$.uriToString)($)} (${H.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled)this.childrenTracker.refChild(H.getChannelzRef());this.filterStackFactory=new rl9.FilterStackFactory([new cl9.CompressionFilterFactory(this,A)])}close(){if(this.channelzEnabled)this.childrenTracker.unrefChild(this.subchannel.getChannelzRef());(0,NhH.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,e3$.uriToString)(this.target)}getConnectivityState(H){throw Error("Method not implemented.")}watchConnectivityState(H,$,A){throw Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(H,$){let A={deadline:$,host:(0,al9.getDefaultAuthority)(this.target),flags:OhH.Propagate.DEFAULTS,parentCall:null};return new FED(this.subchannel,H,this.filterStackFactory,A,(0,dl9.getNextCallNumber)())}}HV$.SingleSubchannelChannel=KED});var VED=z((AV$)=>{Object.defineProperty(AV$,"__esModule",{value:!0});AV$.Subchannel=void 0;var uM=xP(),ol9=uWH(),$CA=qG(),$V$=B8(),tl9=OP(),sl9=cY(),Yh=ho(),el9=QED(),Hi9="subchannel",$i9=2147483647;class WED{constructor(H,$,A,L,I){var D;this.channelTarget=H,this.subchannelAddress=$,this.options=A,this.connector=I,this.connectivityState=uM.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let B={initialDelay:A["grpc.initial_reconnect_backoff_ms"],maxDelay:A["grpc.max_reconnect_backoff_ms"]};if(this.backoffTimeout=new ol9.BackoffTimeout(()=>{this.handleBackoffTimer()},B),this.backoffTimeout.unref(),this.subchannelAddressString=(0,sl9.subchannelAddressToString)($),this.keepaliveTime=(D=A["grpc.keepalive_time_ms"])!==null&&D!==void 0?D:-1,A["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new Yh.ChannelzTraceStub,this.callTracker=new Yh.ChannelzCallTrackerStub,this.childrenTracker=new Yh.ChannelzChildrenTrackerStub,this.streamTracker=new Yh.ChannelzCallTrackerStub;else this.channelzTrace=new Yh.ChannelzTrace,this.callTracker=new Yh.ChannelzCallTracker,this.childrenTracker=new Yh.ChannelzChildrenTracker,this.streamTracker=new Yh.ChannelzCallTracker;this.channelzRef=(0,Yh.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(A,void 0,2)),this.secureConnector=L._createSecureConnector(H,A)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(H){$CA.trace($V$.LogVerbosity.DEBUG,Hi9,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+H)}refTrace(H){$CA.trace($V$.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+H)}handleBackoffTimer(){if(this.continueConnecting)this.transitionToState([uM.ConnectivityState.TRANSIENT_FAILURE],uM.ConnectivityState.CONNECTING);else this.transitionToState([uM.ConnectivityState.TRANSIENT_FAILURE],uM.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let H=this.options;if(H["grpc.keepalive_time_ms"]){let $=Math.min(this.keepaliveTime,$i9);H=Object.assign(Object.assign({},H),{"grpc.keepalive_time_ms":$})}this.connector.connect(this.subchannelAddress,this.secureConnector,H).then(($)=>{if(this.transitionToState([uM.ConnectivityState.CONNECTING],uM.ConnectivityState.READY)){if(this.transport=$,this.channelzEnabled)this.childrenTracker.refChild($.getChannelzRef());$.addDisconnectListener((A)=>{if(this.transitionToState([uM.ConnectivityState.READY],uM.ConnectivityState.IDLE),A&&this.keepaliveTime>0)this.keepaliveTime*=2,$CA.log($V$.LogVerbosity.ERROR,`Connection to ${(0,tl9.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`)})}else $.shutdown()},($)=>{this.transitionToState([uM.ConnectivityState.CONNECTING],uM.ConnectivityState.TRANSIENT_FAILURE,`${$}`)})}transitionToState(H,$,A){var L,I;if(H.indexOf(this.connectivityState)===-1)return!1;if(A)this.trace(uM.ConnectivityState[this.connectivityState]+" -> "+uM.ConnectivityState[$]+' with error "'+A+'"');else this.trace(uM.ConnectivityState[this.connectivityState]+" -> "+uM.ConnectivityState[$]);if(this.channelzEnabled)this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+uM.ConnectivityState[$]);let D=this.connectivityState;switch(this.connectivityState=$,$){case uM.ConnectivityState.READY:this.stopBackoff();break;case uM.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case uM.ConnectivityState.TRANSIENT_FAILURE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());if((L=this.transport)===null||L===void 0||L.shutdown(),this.transport=null,!this.backoffTimeout.isRunning())process.nextTick(()=>{this.handleBackoffTimer()});break;case uM.ConnectivityState.IDLE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());(I=this.transport)===null||I===void 0||I.shutdown(),this.transport=null;break;default:throw Error(`Invalid state: unknown ConnectivityState ${$}`)}for(let B of this.stateListeners)B(this,D,$,this.keepaliveTime,A);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){if(this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0)this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,Yh.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([uM.ConnectivityState.CONNECTING,uM.ConnectivityState.READY],uM.ConnectivityState.IDLE)})}unrefIfOneRef(){if(this.refcount===1)return this.unref(),!0;return!1}createCall(H,$,A,L){if(!this.transport)throw Error("Cannot create call, subchannel not READY");let I;if(this.channelzEnabled)this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),I={onCallEnd:(D)=>{if(D.code===$V$.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()}};else I={};return this.transport.createCall(H,$,A,L,I)}startConnecting(){process.nextTick(()=>{if(!this.transitionToState([uM.ConnectivityState.IDLE],uM.ConnectivityState.CONNECTING)){if(this.connectivityState===uM.ConnectivityState.TRANSIENT_FAILURE)this.continueConnecting=!0}})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(H){this.stateListeners.add(H)}removeConnectivityStateListener(H){this.stateListeners.delete(H)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([uM.ConnectivityState.TRANSIENT_FAILURE],uM.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(H){}removeHealthStateWatcher(H){}getRealSubchannel(){return this}realSubchannelEquals(H){return H.getRealSubchannel()===this}throttleKeepalive(H){if(H>this.keepaliveTime)this.keepaliveTime=H}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){if(!this.subchannelChannel)this.subchannelChannel=new el9.SingleSubchannelChannel(this,this.channelTarget,this.options);return this.subchannelChannel}addDataWatcher(H){throw Error("Not implemented")}getOrCreateDataProducer(H,$){let A=this.dataProducers.get(H);if(A)return A;let L=$(this);return this.dataProducers.set(H,L),L}removeDataProducer(H){this.dataProducers.delete(H)}}AV$.Subchannel=WED});var PED=z((LV$)=>{var ACA;Object.defineProperty(LV$,"__esModule",{value:!0});LV$.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;LV$.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((ACA=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&ACA!==void 0?ACA:"false")==="true"});var DCA=z((O0H)=>{Object.defineProperty(O0H,"__esModule",{value:!0});O0H.DEFAULT_PORT=void 0;O0H.setup=Mi9;var _ED=BS(),LCA=require("dns"),Ai9=k_A(),ICA=B8(),A7H=Y0H(),Li9=rQ(),Ii9=qG(),Di9=B8(),bo=OP(),YED=require("net"),Bi9=uWH(),CED=PED(),fi9="dns_resolver";function Ch(H){Ii9.trace(Di9.LogVerbosity.DEBUG,fi9,H)}O0H.DEFAULT_PORT=443;var Ei9=30000;class wED{constructor(H,$,A){var L,I,D;if(this.target=H,this.listener=$,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new LCA.promises.Resolver,Ch("Resolver constructed for target "+(0,bo.uriToString)(H)),H.authority)this.alternativeResolver.setServers([H.authority]);let B=(0,bo.splitHostPort)(H.path);if(B===null)this.ipResult=null,this.dnsHostname=null,this.port=null;else if((0,YED.isIPv4)(B.host)||(0,YED.isIPv6)(B.host))this.ipResult=[{addresses:[{host:B.host,port:(L=B.port)!==null&&L!==void 0?L:O0H.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null;else this.ipResult=null,this.dnsHostname=B.host,this.port=(I=B.port)!==null&&I!==void 0?I:O0H.DEFAULT_PORT;if(this.percentage=Math.random()*100,A["grpc.service_config_disable_resolution"]===1)this.isServiceConfigEnabled=!1;this.defaultResolutionError={code:ICA.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,bo.uriToString)(this.target)}`,metadata:new Li9.Metadata};let f={initialDelay:A["grpc.initial_reconnect_backoff_ms"],maxDelay:A["grpc.max_reconnect_backoff_ms"]};this.backoff=new Bi9.BackoffTimeout(()=>{if(this.continueResolving)this.startResolutionWithBackoff()},f),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(D=A["grpc.dns_min_time_between_resolutions_ms"])!==null&&D!==void 0?D:Ei9,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){if(!this.returnedIpResult)Ch("Returning IP address for target "+(0,bo.uriToString)(this.target)),setImmediate(()=>{this.listener((0,A7H.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0;this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)Ch("Failed to parse DNS address "+(0,bo.uriToString)(this.target)),setImmediate(()=>{this.listener((0,A7H.statusOrFromError)({code:ICA.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,bo.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;Ch("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let H=this.dnsHostname;if(this.pendingLookupPromise=this.lookup(H),this.pendingLookupPromise.then(($)=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,A7H.statusOrFromValue)($.map((I)=>({addresses:[I]})));let A="["+$.map((I)=>I.host+":"+I.port).join(",")+"]";Ch("Resolved addresses for target "+(0,bo.uriToString)(this.target)+": "+A);let L=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(L)},($)=>{if(this.pendingLookupPromise===null)return;Ch("Resolution error for target "+(0,bo.uriToString)(this.target)+": "+$.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,A7H.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,"")}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null)this.pendingTxtPromise=this.resolveTxt(H),this.pendingTxtPromise.then(($)=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let A;try{if(A=(0,Ai9.extractAndSelectServiceConfig)($,this.percentage),A)this.latestServiceConfigResult=(0,A7H.statusOrFromValue)(A);else this.latestServiceConfigResult=null}catch(L){this.latestServiceConfigResult=(0,A7H.statusOrFromError)({code:ICA.Status.UNAVAILABLE,details:`Parsing service config failed with error ${L.message}`})}if(this.latestLookupResult!==null)this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},($)=>{})}}handleHealthStatus(H){if(H)this.backoff.stop(),this.backoff.reset();else this.continueResolving=!0}async lookup(H){if(CED.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){Ch("Using alternative DNS resolver.");let A=await Promise.allSettled([this.alternativeResolver.resolve4(H),this.alternativeResolver.resolve6(H)]);if(A.every((L)=>L.status==="rejected"))throw Error(A[0].reason);return A.reduce((L,I)=>{return I.status==="fulfilled"?[...L,...I.value]:L},[]).map((L)=>({host:L,port:+this.port}))}return(await LCA.promises.lookup(H,{all:!0})).map((A)=>({host:A.address,port:+this.port}))}async resolveTxt(H){if(CED.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)return Ch("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(H);return LCA.promises.resolveTxt(H)}startNextResolutionTimer(){var H,$;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{if(this.stopNextResolutionTimer(),this.continueResolving)this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),($=(H=this.nextResolutionTimer).unref)===null||$===void 0||$.call(H),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){if(this.pendingLookupPromise===null)this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution()}updateResolution(){if(this.pendingLookupPromise===null)if(this.isNextResolutionTimerRunning||this.backoff.isRunning()){if(this.isNextResolutionTimerRunning)Ch('resolution update delayed by "min time between resolutions" rate limit');else Ch("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString());this.continueResolving=!0}else this.startResolutionWithBackoff()}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(H){return H.path}}function Mi9(){(0,_ED.registerResolver)("dns",wED),(0,_ED.registerDefaultScheme)("dns")}});var BCA=z((jhH)=>{Object.defineProperty(jhH,"__esModule",{value:!0});jhH.parseCIDR=TED;jhH.mapProxyName=Pi9;jhH.getProxiedConnection=_i9;var xhH=qG(),L7H=B8(),qED=require("net"),Gi9=require("http"),Ui9=qG(),ZED=cY(),ShH=OP(),Xi9=require("url"),Ji9=DCA(),Fi9="proxy";function I7H(H){Ui9.trace(L7H.LogVerbosity.DEBUG,Fi9,H)}function Ki9(){let H="",$="";if(process.env.grpc_proxy)$="grpc_proxy",H=process.env.grpc_proxy;else if(process.env.https_proxy)$="https_proxy",H=process.env.https_proxy;else if(process.env.http_proxy)$="http_proxy",H=process.env.http_proxy;else return{};let A;try{A=new Xi9.URL(H)}catch(f){return(0,xhH.log)(L7H.LogVerbosity.ERROR,`cannot parse value of "${$}" env var`),{}}if(A.protocol!=="http:")return(0,xhH.log)(L7H.LogVerbosity.ERROR,`"${A.protocol}" scheme not supported in proxy URI`),{};let L=null;if(A.username)if(A.password)(0,xhH.log)(L7H.LogVerbosity.INFO,"userinfo found in proxy URI"),L=decodeURIComponent(`${A.username}:${A.password}`);else L=A.username;let{hostname:I,port:D}=A;if(D==="")D="80";let B={address:`${I}:${D}`};if(L)B.creds=L;return I7H("Proxy server "+B.address+" set by environment variable "+$),B}function Qi9(){let H=process.env.no_grpc_proxy,$="no_grpc_proxy";if(!H)H=process.env.no_proxy,$="no_proxy";if(H)return I7H("No proxy server list set by environment variable "+$),H.split(",");else return[]}function TED(H){let $=H.split("/");if($.length!==2)return null;let A=parseInt($[1],10);if(!(0,qED.isIPv4)($[0])||Number.isNaN(A)||A<0||A>32)return null;return{ip:zED($[0]),prefixLength:A}}function zED(H){return H.split(".").reduce(($,A)=>($<<8)+parseInt(A,10),0)}function Wi9(H,$){let A=H.ip,L=-1<<32-H.prefixLength;return(zED($)&L)===(A&L)}function Vi9(H){for(let $ of Qi9()){let A=TED($);if((0,qED.isIPv4)(H)&&A&&Wi9(A,H))return!0;else if(H.endsWith($))return!0}return!1}function Pi9(H,$){var A;let L={target:H,extraOptions:{}};if(((A=$["grpc.enable_http_proxy"])!==null&&A!==void 0?A:1)===0)return L;if(H.scheme==="unix")return L;let I=Ki9();if(!I.address)return L;let D=(0,ShH.splitHostPort)(H.path);if(!D)return L;let B=D.host;if(Vi9(B))return I7H("Not using proxy for target in no_proxy list: "+(0,ShH.uriToString)(H)),L;let f={"grpc.http_connect_target":(0,ShH.uriToString)(H)};if(I.creds)f["grpc.http_connect_creds"]=I.creds;return{target:{scheme:"dns",path:I.address},extraOptions:f}}function _i9(H,$){var A;if(!("grpc.http_connect_target"in $))return Promise.resolve(null);let L=$["grpc.http_connect_target"],I=(0,ShH.parseUri)(L);if(I===null)return Promise.resolve(null);let D=(0,ShH.splitHostPort)(I.path);if(D===null)return Promise.resolve(null);let B=`${D.host}:${(A=D.port)!==null&&A!==void 0?A:Ji9.DEFAULT_PORT}`,f={method:"CONNECT",path:B},E={Host:B};if((0,ZED.isTcpSubchannelAddress)(H))f.host=H.host,f.port=H.port;else f.socketPath=H.path;if("grpc.http_connect_creds"in $)E["Proxy-Authorization"]="Basic "+Buffer.from($["grpc.http_connect_creds"]).toString("base64");f.headers=E;let M=(0,ZED.subchannelAddressToString)(H);return I7H("Using proxy "+M+" to connect to "+f.path),new Promise((G,U)=>{let X=Gi9.request(f);X.once("connect",(J,F,Q)=>{if(X.removeAllListeners(),F.removeAllListeners(),J.statusCode===200){if(I7H("Successfully connected to "+f.path+" through proxy "+M),Q.length>0)F.unshift(Q);I7H("Successfully established a plaintext connection to "+f.path+" through proxy "+M),G(F)}else(0,xhH.log)(L7H.LogVerbosity.ERROR,"Failed to connect to "+f.path+" through proxy "+M+" with status "+J.statusCode),U()}),X.once("error",(J)=>{X.removeAllListeners(),(0,xhH.log)(L7H.LogVerbosity.ERROR,"Failed to connect to proxy "+M+" with error "+J.message),U()}),X.end()})}});var fCA=z((IV$)=>{Object.defineProperty(IV$,"__esModule",{value:!0});IV$.StreamDecoder=void 0;var wh;(function(H){H[H.NO_DATA=0]="NO_DATA",H[H.READING_SIZE=1]="READING_SIZE",H[H.READING_MESSAGE=2]="READING_MESSAGE"})(wh||(wh={}));class NED{constructor(H){this.maxReadMessageLength=H,this.readState=wh.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(H){let $=0,A,L=[];while($this.maxReadMessageLength)throw Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=wh.READING_MESSAGE;else{let I=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=wh.NO_DATA,L.push(I)}}break;case wh.READING_MESSAGE:if(A=Math.min(H.length-$,this.readMessageRemaining),this.readPartialMessage.push(H.slice($,$+A)),this.readMessageRemaining-=A,$+=A,this.readMessageRemaining===0){let I=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),D=Buffer.concat(I,this.readMessageSize+5);this.readState=wh.NO_DATA,L.push(D)}break;default:throw Error("Unexpected read state")}return L}}IV$.StreamDecoder=NED});var xED=z((DV$)=>{Object.defineProperty(DV$,"__esModule",{value:!0});DV$.Http2SubchannelCall=void 0;var Bp=require("http2"),Yi9=require("os"),gM=B8(),fp=rQ(),Ci9=fCA(),wi9=qG(),Zi9=B8(),qi9="subchannel_call";function Ti9(H){for(let[$,A]of Object.entries(Yi9.constants.errno))if(A===H)return $;return"Unknown system error "+H}function ECA(H){let $=`Received HTTP status code ${H}`,A;switch(H){case 400:A=gM.Status.INTERNAL;break;case 401:A=gM.Status.UNAUTHENTICATED;break;case 403:A=gM.Status.PERMISSION_DENIED;break;case 404:A=gM.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:A=gM.Status.UNAVAILABLE;break;default:A=gM.Status.UNKNOWN}return{code:A,details:$,metadata:new fp.Metadata}}class OED{constructor(H,$,A,L,I){var D;this.http2Stream=H,this.callEventTracker=$,this.listener=A,this.transport=L,this.callId=I,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let B=(D=L.getOptions()["grpc.max_receive_message_length"])!==null&&D!==void 0?D:gM.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Ci9.StreamDecoder(B),H.on("response",(f,E)=>{let M="";for(let G of Object.keys(f))M+="\t\t"+G+": "+f[G]+` `)+1)));this.lastActivityTimestamp=new Date}trace(H,$){(0,QV$.trace)($!==null&&$!==void 0?$:uo.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,WV$.uriToString)(this.target)+" "+H)}callRefTimerRef(){var H,$,A,L;if(!this.callRefTimer)this.callRefTimer=setInterval(()=>{},Cn9);if(!(($=(H=this.callRefTimer).hasRef)===null||$===void 0?void 0:$.call(H)))this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(L=(A=this.callRefTimer).ref)===null||L===void 0||L.call(A)}callRefTimerUnref(){var H,$,A;if(!((H=this.callRefTimer)===null||H===void 0?void 0:H.hasRef)||this.callRefTimer.hasRef())this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(A=($=this.callRefTimer)===null||$===void 0?void 0:$.unref)===null||A===void 0||A.call($)}removeConnectivityStateWatcher(H){let $=this.connectivityStateWatchers.findIndex((A)=>A===H);if($>=0)this.connectivityStateWatchers.splice($,1)}updateState(H){if((0,QV$.trace)(uo.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,WV$.uriToString)(this.target)+" "+Hz.ConnectivityState[this.connectivityState]+" -> "+Hz.ConnectivityState[H]),this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Hz.ConnectivityState[H]);this.connectivityState=H,this.channelzInfoTracker.state=H;let $=this.connectivityStateWatchers.slice();for(let A of $)if(H!==A.currentState){if(A.timer)clearTimeout(A.timer);this.removeConnectivityStateWatcher(A),A.callback()}if(H!==Hz.ConnectivityState.TRANSIENT_FAILURE)this.currentResolutionError=null}throttleKeepalive(H){if(H>this.keepaliveTime){this.keepaliveTime=H;for(let $ of this.wrappedSubchannels)$.throttleKeepalive(H)}}addWrappedSubchannel(H){this.wrappedSubchannels.add(H)}removeWrappedSubchannel(H){this.wrappedSubchannels.delete(H)}doPick(H,$){return this.currentPicker.pick({metadata:H,extraPickInfo:$})}queueCallForPick(H){this.pickQueue.push(H),this.callRefTimerRef()}getConfig(H,$){if(this.connectivityState!==Hz.ConnectivityState.SHUTDOWN)this.resolvingLoadBalancer.exitIdle();if(this.configSelector)return{type:"SUCCESS",config:this.configSelector.invoke(H,$,this.randomChannelId)};else if(this.currentResolutionError)return{type:"ERROR",error:this.currentResolutionError};else return{type:"NONE"}}queueCallForConfig(H){this.configSelectionQueue.push(H),this.callRefTimerRef()}enterIdle(){if(this.resolvingLoadBalancer.destroy(),this.updateState(Hz.ConnectivityState.IDLE),this.currentPicker=new KCA.QueuePicker(this.resolvingLoadBalancer),this.idleTimer)clearTimeout(this.idleTimer),this.idleTimer=null;if(this.callRefTimer)clearInterval(this.callRefTimer),this.callRefTimer=null}startIdleTimeout(H){var $,A;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let I=new Date().valueOf()-this.lastActivityTimestamp.valueOf();if(I>=this.idleTimeoutMs)this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle();else this.startIdleTimeout(this.idleTimeoutMs-I)},H),(A=($=this.idleTimer).unref)===null||A===void 0||A.call($)}maybeStartIdleTimer(){if(this.connectivityState!==Hz.ConnectivityState.SHUTDOWN&&!this.idleTimer)this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){if(this.channelzEnabled)this.channelzInfoTracker.callTracker.addCallStarted();this.callCount+=1}onCallEnd(H){if(this.channelzEnabled)if(H.code===uo.Status.OK)this.channelzInfoTracker.callTracker.addCallSucceeded();else this.channelzInfoTracker.callTracker.addCallFailed();this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(H,$,A,L,I){let D=(0,JCA.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+D+'] method="'+$+'"'),new Wn9.LoadBalancingCall(this,H,$,A,L,I,D)}createRetryingCall(H,$,A,L,I){let D=(0,JCA.getNextCallNumber)();return this.trace("createRetryingCall ["+D+'] method="'+$+'"'),new FCA.RetryingCall(this,H,$,A,L,I,D,this.retryBufferTracker,VV$.get(this.getTarget()))}createResolvingCall(H,$,A,L,I){let D=(0,JCA.getNextCallNumber)();this.trace("createResolvingCall ["+D+'] method="'+H+'", deadline='+(0,Vn9.deadlineToString)($));let B={deadline:$,flags:I!==null&&I!==void 0?I:uo.Propagate.DEFAULTS,host:A!==null&&A!==void 0?A:this.defaultAuthority,parentCall:L},f=new Pn9.ResolvingCall(this,H,B,this.filterStackFactory.clone(),D);return this.onCallStart(),f.addStatusWatcher((E)=>{this.onCallEnd(E)}),f}close(){var H;this.resolvingLoadBalancer.destroy(),this.updateState(Hz.ConnectivityState.SHUTDOWN),this.currentPicker=new aED;for(let $ of this.configSelectionQueue)$.cancelWithStatus(uo.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let $ of this.pickQueue)$.cancelWithStatus(uo.Status.UNAVAILABLE,"Channel closed before call started");if(this.pickQueue=[],this.callRefTimer)clearInterval(this.callRefTimer);if(this.idleTimer)clearTimeout(this.idleTimer);if(this.channelzEnabled)(0,bhH.unregisterChannelzRef)(this.channelzRef);this.subchannelPool.unrefUnusedSubchannels(),(H=this.configSelector)===null||H===void 0||H.unref(),this.configSelector=null}getTarget(){return(0,WV$.uriToString)(this.target)}getConnectivityState(H){let $=this.connectivityState;if(H)this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer();return $}watchConnectivityState(H,$,A){if(this.connectivityState===Hz.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");let L=null;if($!==1/0){let D=$ instanceof Date?$:new Date($),B=new Date;if($===-1/0||D<=B){process.nextTick(A,Error("Deadline passed without connectivity state change"));return}L=setTimeout(()=>{this.removeConnectivityStateWatcher(I),A(Error("Deadline passed without connectivity state change"))},D.getTime()-B.getTime())}let I={currentState:H,callback:A,timer:L};this.connectivityStateWatchers.push(I)}getChannelzRef(){return this.channelzRef}createCall(H,$,A,L,I){if(typeof H!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof $==="number"||$ instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Hz.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");return this.createResolvingCall(H,$,A,L,I)}getOptions(){return this.options}}R0H.InternalChannel=tED});var r_A=z((PV$)=>{Object.defineProperty(PV$,"__esModule",{value:!0});PV$.ChannelImplementation=void 0;var zn9=kWH(),Nn9=QCA();class sED{constructor(H,$,A){if(typeof H!=="string")throw TypeError("Channel target must be a string");if(!($ instanceof zn9.ChannelCredentials))throw TypeError("Channel credentials must be a ChannelCredentials object");if(A){if(typeof A!=="object")throw TypeError("Channel options must be an object")}this.internalChannel=new Nn9.InternalChannel(H,$,A)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(H){return this.internalChannel.getConnectivityState(H)}watchConnectivityState(H,$,A){this.internalChannel.watchConnectivityState(H,$,A)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(H,$,A,L,I){if(typeof H!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof $==="number"||$ instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(H,$,A,L,I)}}PV$.ChannelImplementation=sED});var IMD=z((KS)=>{Object.defineProperty(KS,"__esModule",{value:!0});KS.ServerDuplexStreamImpl=KS.ServerWritableStreamImpl=KS.ServerReadableStreamImpl=KS.ServerUnaryCallImpl=void 0;KS.serverErrorToStatus=PCA;var On9=require("events"),WCA=require("stream"),VCA=B8(),eED=rQ();function PCA(H,$){var A;let L={code:VCA.Status.UNKNOWN,details:"message"in H?H.message:"Unknown Error",metadata:(A=$!==null&&$!==void 0?$:H.metadata)!==null&&A!==void 0?A:null};if("code"in H&&typeof H.code==="number"&&Number.isInteger(H.code)){if(L.code=H.code,"details"in H&&typeof H.details==="string")L.details=H.details}return L}class HMD extends On9.EventEmitter{constructor(H,$,A,L){super();this.path=H,this.call=$,this.metadata=A,this.request=L,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}KS.ServerUnaryCallImpl=HMD;class $MD extends WCA.Readable{constructor(H,$,A){super({objectMode:!0});this.path=H,this.call=$,this.metadata=A,this.cancelled=!1}_read(H){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}KS.ServerReadableStreamImpl=$MD;class AMD extends WCA.Writable{constructor(H,$,A,L){super({objectMode:!0});this.path=H,this.call=$,this.metadata=A,this.request=L,this.pendingStatus={code:VCA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new eED.Metadata,this.on("error",(I)=>{this.pendingStatus=PCA(I),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(H,$,A){this.call.sendMessage(H,A)}_final(H){var $;H(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:($=this.pendingStatus.metadata)!==null&&$!==void 0?$:this.trailingMetadata}))}end(H){if(H)this.trailingMetadata=H;return super.end()}}KS.ServerWritableStreamImpl=AMD;class LMD extends WCA.Duplex{constructor(H,$,A){super({objectMode:!0});this.path=H,this.call=$,this.metadata=A,this.pendingStatus={code:VCA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new eED.Metadata,this.on("error",(L)=>{this.pendingStatus=PCA(L),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(H){this.call.sendMetadata(H)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(H){this.call.startRead()}_write(H,$,A){this.call.sendMessage(H,A)}_final(H){var $;H(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:($=this.pendingStatus.metadata)!==null&&$!==void 0?$:this.trailingMetadata}))}end(H){if(H)this.trailingMetadata=H;return super.end()}}KS.ServerDuplexStreamImpl=LMD});var _V$=z((f7H)=>{Object.defineProperty(f7H,"__esModule",{value:!0});f7H.ServerCredentials=void 0;f7H.createCertificateProviderServerCredentials=xn9;f7H.createServerCredentialsWithInterceptors=Sn9;var _CA=j_A();class B7H{constructor(H,$){this.serverConstructorOptions=H,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=$!==null&&$!==void 0?$:null}_addWatcher(H){this.watchers.add(H)}_removeWatcher(H){this.watchers.delete(H)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(H){this.latestContextOptions=H;for(let $ of this.watchers)$(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new YCA}static createSsl(H,$,A=!1){var L;if(H!==null&&!Buffer.isBuffer(H))throw TypeError("rootCerts must be null or a Buffer");if(!Array.isArray($))throw TypeError("keyCertPairs must be an array");if(typeof A!=="boolean")throw TypeError("checkClientCertificate must be a boolean");let I=[],D=[];for(let B=0;B<$.length;B++){let f=$[B];if(f===null||typeof f!=="object")throw TypeError(`keyCertPair[${B}] must be an object`);if(!Buffer.isBuffer(f.private_key))throw TypeError(`keyCertPair[${B}].private_key must be a Buffer`);if(!Buffer.isBuffer(f.cert_chain))throw TypeError(`keyCertPair[${B}].cert_chain must be a Buffer`);I.push(f.cert_chain),D.push(f.private_key)}return new CCA({requestCert:A,ciphers:_CA.CIPHER_SUITES},{ca:(L=H!==null&&H!==void 0?H:(0,_CA.getDefaultRootsData)())!==null&&L!==void 0?L:void 0,cert:I,key:D})}}f7H.ServerCredentials=B7H;class YCA extends B7H{constructor(){super(null)}_getSettings(){return null}_equals(H){return H instanceof YCA}}class CCA extends B7H{constructor(H,$){super(H,$);this.options=Object.assign(Object.assign({},H),$)}_equals(H){if(this===H)return!0;if(!(H instanceof CCA))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(H.options.ca)){if(!this.options.ca.equals(H.options.ca))return!1}else if(this.options.ca!==H.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(H.options.cert)){if(this.options.cert.length!==H.options.cert.length)return!1;for(let $=0;${Object.defineProperty(Ep,"__esModule",{value:!0});Ep.durationMessageToDuration=jn9;Ep.msToDuration=Rn9;Ep.durationToMs=yn9;Ep.isDuration=vn9;Ep.isDurationMessage=hn9;Ep.parseDuration=kn9;Ep.durationToString=un9;function jn9(H){return{seconds:Number.parseInt(H.seconds),nanos:H.nanos}}function Rn9(H){return{seconds:H/1000|0,nanos:H%1000*1e6|0}}function yn9(H){return H.seconds*1000+H.nanos/1e6|0}function vn9(H){return typeof H.seconds==="number"&&typeof H.nanos==="number"}function hn9(H){return typeof H.seconds==="string"&&typeof H.nanos==="number"}var bn9=/^(\d+)(?:\.(\d+))?s$/;function kn9(H){let $=H.match(bn9);if(!$)return null;return{seconds:Number.parseInt($[1],10),nanos:$[2]?Number.parseInt($[2].padEnd(9,"0"),10):0}}function un9(H){if(H.nanos===0)return`${H.seconds}s`;let $;if(H.nanos%1e6===0)$=1e6;else if(H.nanos%1000===0)$=1000;else $=1;return`${H.seconds}.${H.nanos/$}s`}});var CV$=z((Vw)=>{var __dirname="/home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(Vw,"__esModule",{value:!0});Vw.OrcaOobMetricsSubchannelWrapper=Vw.GRPC_METRICS_HEADER=Vw.ServerMetricRecorder=Vw.PerRequestMetricRecorder=void 0;Vw.createOrcaClient=GMD;Vw.createMetricsReader=in9;var gn9=P3$(),qCA=khH(),mn9=kWH(),pn9=hhH(),DMD=B8(),dn9=uWH(),cn9=xP(),BMD=null;function YV$(){if(BMD)return BMD;let H=gYA().loadSync,$=H("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,gn9.loadPackageDefinition)($)}class EMD{constructor(){this.message={}}recordRequestCostMetric(H,$){if(!this.message.request_cost)this.message.request_cost={};this.message.request_cost[H]=$}recordUtilizationMetric(H,$){if(!this.message.utilization)this.message.utilization={};this.message.utilization[H]=$}recordNamedMetric(H,$){if(!this.message.named_metrics)this.message.named_metrics={};this.message.named_metrics[H]=$}recordCPUUtilizationMetric(H){this.message.cpu_utilization=H}recordMemoryUtilizationMetric(H){this.message.mem_utilization=H}recordApplicationUtilizationMetric(H){this.message.application_utilization=H}recordQpsMetric(H){this.message.rps_fractional=H}recordEpsMetric(H){this.message.eps=H}serialize(){return YV$().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}}Vw.PerRequestMetricRecorder=EMD;var ln9=30000;class MMD{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:(H)=>{let $=H.request.report_interval?(0,qCA.durationToMs)((0,qCA.durationMessageToDuration)(H.request.report_interval)):ln9,A=setInterval(()=>{H.write(this.message)},$);H.on("cancelled",()=>{clearInterval(A)})}}}putUtilizationMetric(H,$){if(!this.message.utilization)this.message.utilization={};this.message.utilization[H]=$}setAllUtilizationMetrics(H){this.message.utilization=Object.assign({},H)}deleteUtilizationMetric(H){var $;($=this.message.utilization)===null||$===void 0||delete $[H]}setCpuUtilizationMetric(H){this.message.cpu_utilization=H}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(H){this.message.application_utilization=H}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(H){this.message.rps_fractional=H}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(H){this.message.eps=H}deleteEpsMetric(){delete this.message.eps}addToServer(H){let $=YV$().xds.service.orca.v3.OpenRcaService.service;H.addService($,this.serviceImplementation)}}Vw.ServerMetricRecorder=MMD;function GMD(H){return new(YV$()).xds.service.orca.v3.OpenRcaService("unused",mn9.ChannelCredentials.createInsecure(),{channelOverride:H})}Vw.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var fMD="grpc_orca_load_report";function in9(H,$){return(A,L,I)=>{let D=I.getOpaque(fMD);if(D)H(D);else{let B=I.get(Vw.GRPC_METRICS_HEADER);if(B.length>0)D=YV$().xds.data.orca.v3.OrcaLoadReport.deserialize(B[0]),H(D),I.setOpaque(fMD,D)}if($)$(A,L,I)}}var UMD="orca_oob_metrics";class XMD{constructor(H,$){this.metricsListener=H,this.intervalMs=$,this.dataProducer=null}setSubchannel(H){let $=H.getOrCreateDataProducer(UMD,nn9);this.dataProducer=$,$.addDataWatcher(this)}destroy(){var H;(H=this.dataProducer)===null||H===void 0||H.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(H){this.metricsListener(H)}}class JMD{constructor(H){this.subchannel=H,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new dn9.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let $=H.getChannel();this.client=GMD($),H.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(H){this.dataWatchers.add(H),this.updateMetricsSubscription()}removeDataWatcher(H){var $;if(this.dataWatchers.delete(H),this.dataWatchers.size===0)this.subchannel.removeDataProducer(UMD),($=this.metricsCall)===null||$===void 0||$.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener);else this.updateMetricsSubscription()}updateMetricsSubscription(){var H;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==cn9.ConnectivityState.READY)return;let $=Math.min(...Array.from(this.dataWatchers).map((A)=>A.getInterval()));if(!this.metricsCall||$!==this.currentInterval){(H=this.metricsCall)===null||H===void 0||H.cancel(),this.currentInterval=$;let A=this.client.streamCoreMetrics({report_interval:(0,qCA.msToDuration)($)});this.metricsCall=A,A.on("data",(L)=>{this.dataWatchers.forEach((I)=>{I.onMetricsUpdate(L)})}),A.on("error",(L)=>{if(this.metricsCall=null,L.code===DMD.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}if(L.code===DMD.Status.CANCELLED)return;this.backoffTimer.runOnce()})}}}class FMD extends pn9.BaseSubchannelWrapper{constructor(H,$,A){super(H);this.addDataWatcher(new XMD($,A))}getWrappedSubchannel(){return this.child}}Vw.OrcaOobMetricsSubchannelWrapper=FMD;function nn9(H){return new JMD(H)}});var OCA=z(($z)=>{Object.defineProperty($z,"__esModule",{value:!0});$z.BaseServerInterceptingCall=$z.ServerInterceptingCall=$z.ResponderBuilder=$z.ServerListenerBuilder=void 0;$z.isInterceptingServerListener=on9;$z.getServerInterceptingCall=$r9;var qV$=rQ(),lY=B8(),E7H=require("http2"),KMD=r6$(),QMD=require("zlib"),rn9=fCA(),YMD=qG(),an9=require("tls"),WMD=CV$(),CMD="server_call";function y0H(H){YMD.trace(lY.LogVerbosity.DEBUG,CMD,H)}class wMD{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(H){return this.metadata=H,this}withOnReceiveMessage(H){return this.message=H,this}withOnReceiveHalfClose(H){return this.halfClose=H,this}withOnCancel(H){return this.cancel=H,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}}$z.ServerListenerBuilder=wMD;function on9(H){return H.onReceiveMetadata!==void 0&&H.onReceiveMetadata.length===1}class ZMD{constructor(H,$){this.listener=H,this.nextListener=$,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){if(this.hasPendingMessage)this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1}processPendingHalfClose(){if(this.hasPendingHalfClose)this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1}onReceiveMetadata(H){if(this.cancelled)return;this.processingMetadata=!0,this.listener.onReceiveMetadata(H,($)=>{if(this.processingMetadata=!1,this.cancelled)return;this.nextListener.onReceiveMetadata($),this.processPendingMessage(),this.processPendingHalfClose()})}onReceiveMessage(H){if(this.cancelled)return;this.processingMessage=!0,this.listener.onReceiveMessage(H,($)=>{if(this.processingMessage=!1,this.cancelled)return;if(this.processingMetadata)this.pendingMessage=$,this.hasPendingMessage=!0;else this.nextListener.onReceiveMessage($),this.processPendingHalfClose()})}onReceiveHalfClose(){if(this.cancelled)return;this.listener.onReceiveHalfClose(()=>{if(this.cancelled)return;if(this.processingMetadata||this.processingMessage)this.hasPendingHalfClose=!0;else this.nextListener.onReceiveHalfClose()})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}}class qMD{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(H){return this.start=H,this}withSendMetadata(H){return this.metadata=H,this}withSendMessage(H){return this.message=H,this}withSendStatus(H){return this.status=H,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}}$z.ResponderBuilder=qMD;var wV$={onReceiveMetadata:(H,$)=>{$(H)},onReceiveMessage:(H,$)=>{$(H)},onReceiveHalfClose:(H)=>{H()},onCancel:()=>{}},ZV$={start:(H)=>{H()},sendMetadata:(H,$)=>{$(H)},sendMessage:(H,$)=>{$(H)},sendStatus:(H,$)=>{$(H)}};class TMD{constructor(H,$){var A,L,I,D;this.nextCall=H,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(A=$===null||$===void 0?void 0:$.start)!==null&&A!==void 0?A:ZV$.start,sendMetadata:(L=$===null||$===void 0?void 0:$.sendMetadata)!==null&&L!==void 0?L:ZV$.sendMetadata,sendMessage:(I=$===null||$===void 0?void 0:$.sendMessage)!==null&&I!==void 0?I:ZV$.sendMessage,sendStatus:(D=$===null||$===void 0?void 0:$.sendStatus)!==null&&D!==void 0?D:ZV$.sendStatus}}processPendingMessage(){if(this.pendingMessageCallback)this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null}processPendingStatus(){if(this.pendingStatus)this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null}start(H){this.responder.start(($)=>{var A,L,I,D;let B={onReceiveMetadata:(A=$===null||$===void 0?void 0:$.onReceiveMetadata)!==null&&A!==void 0?A:wV$.onReceiveMetadata,onReceiveMessage:(L=$===null||$===void 0?void 0:$.onReceiveMessage)!==null&&L!==void 0?L:wV$.onReceiveMessage,onReceiveHalfClose:(I=$===null||$===void 0?void 0:$.onReceiveHalfClose)!==null&&I!==void 0?I:wV$.onReceiveHalfClose,onCancel:(D=$===null||$===void 0?void 0:$.onCancel)!==null&&D!==void 0?D:wV$.onCancel},f=new ZMD(B,H);this.nextCall.start(f)})}sendMetadata(H){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(H,($)=>{this.processingMetadata=!1,this.nextCall.sendMetadata($),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(H,$){if(this.processingMessage=!0,!this.sentMetadata)this.sendMetadata(new qV$.Metadata);this.responder.sendMessage(H,(A)=>{if(this.processingMessage=!1,this.processingMetadata)this.pendingMessage=A,this.pendingMessageCallback=$;else this.nextCall.sendMessage(A,$)})}sendStatus(H){this.responder.sendStatus(H,($)=>{if(this.processingMetadata||this.processingMessage)this.pendingStatus=$;else this.nextCall.sendStatus($)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}}$z.ServerInterceptingCall=TMD;var zMD="grpc-accept-encoding",zCA="grpc-encoding",VMD="grpc-message",PMD="grpc-status",TCA="grpc-timeout",tn9=/(\d{1,8})\s*([HMSmun])/,sn9={H:3600000,M:60000,S:1000,m:1,u:0.001,n:0.000001},en9={[zMD]:"identity,deflate,gzip",[zCA]:"identity"},_MD={[E7H.constants.HTTP2_HEADER_STATUS]:E7H.constants.HTTP_STATUS_OK,[E7H.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},Hr9={waitForTrailers:!0};class NCA{constructor(H,$,A,L,I){var D,B;if(this.stream=H,this.callEventTracker=A,this.handler=L,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=lY.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=lY.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new WMD.PerRequestMetricRecorder,this.stream.once("error",(U)=>{}),this.stream.once("close",()=>{var U;if(y0H("Request to method "+((U=this.handler)===null||U===void 0?void 0:U.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:lY.Status.CANCELLED,details:"Stream closed before sending status",metadata:null});this.notifyOnCancel()}),this.stream.on("data",(U)=>{this.handleDataFrame(U)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in I)this.maxSendMessageSize=I["grpc.max_send_message_length"];if("grpc.max_receive_message_length"in I)this.maxReceiveMessageSize=I["grpc.max_receive_message_length"];this.host=(D=$[":authority"])!==null&&D!==void 0?D:$.host,this.decoder=new rn9.StreamDecoder(this.maxReceiveMessageSize);let f=qV$.Metadata.fromHttp2Headers($);if(YMD.isTracerEnabled(CMD))y0H("Request to "+this.handler.path+" received headers "+JSON.stringify(f.toJSON()));let E=f.get(TCA);if(E.length>0)this.handleTimeoutHeader(E[0]);let M=f.get(zCA);if(M.length>0)this.incomingEncoding=M[0];f.remove(TCA),f.remove(zCA),f.remove(zMD),f.remove(E7H.constants.HTTP2_HEADER_ACCEPT_ENCODING),f.remove(E7H.constants.HTTP2_HEADER_TE),f.remove(E7H.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=f;let G=(B=H.session)===null||B===void 0?void 0:B.socket;this.connectionInfo={localAddress:G===null||G===void 0?void 0:G.localAddress,localPort:G===null||G===void 0?void 0:G.localPort,remoteAddress:G===null||G===void 0?void 0:G.remoteAddress,remotePort:G===null||G===void 0?void 0:G.remotePort},this.shouldSendMetrics=!!I["grpc.server_call_metric_recording"]}handleTimeoutHeader(H){let $=H.toString().match(tn9);if($===null){let I={code:lY.Status.INTERNAL,details:`Invalid ${TCA} value "${H}"`,metadata:null};process.nextTick(()=>{this.sendStatus(I)});return}let A=+$[1]*sn9[$[2]]|0,L=new Date;this.deadline=L.setMilliseconds(L.getMilliseconds()+A),this.deadlineTimer=setTimeout(()=>{let I={code:lY.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(I)},A)}checkCancelled(){if(!this.cancelled&&(this.stream.destroyed||this.stream.closed))this.notifyOnCancel(),this.cancelled=!0;return this.cancelled}notifyOnCancel(){if(this.cancelNotified)return;if(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var H;(H=this.listener)===null||H===void 0||H.onCancel()}),this.deadlineTimer)clearTimeout(this.deadlineTimer);this.stream.resume()}maybeSendMetadata(){if(!this.metadataSent)this.sendMetadata(new qV$.Metadata)}serializeMessage(H){let $=this.handler.serialize(H),A=$.byteLength,L=Buffer.allocUnsafe(A+5);return L.writeUInt8(0,0),L.writeUInt32BE(A,1),$.copy(L,5),L}decompressMessage(H,$){let A=H.subarray(5);if($==="identity")return A;else if($==="deflate"||$==="gzip"){let L;if($==="deflate")L=QMD.createInflate();else L=QMD.createGunzip();return new Promise((I,D)=>{let B=0,f=[];L.on("data",(E)=>{if(f.push(E),B+=E.byteLength,this.maxReceiveMessageSize!==-1&&B>this.maxReceiveMessageSize)L.destroy(),D({code:lY.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`})}),L.on("end",()=>{I(Buffer.concat(f))}),L.write(A),L.end()})}else return Promise.reject({code:lY.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${$}"`})}async decompressAndMaybePush(H){if(H.type!=="COMPRESSED")throw Error(`Invalid queue entry type: ${H.type}`);let A=H.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",L;try{L=await this.decompressMessage(H.compressedMessage,A)}catch(I){this.sendStatus(I);return}try{H.parsedMessage=this.handler.deserialize(L)}catch(I){this.sendStatus({code:lY.Status.INTERNAL,details:`Error deserializing request: ${I.message}`});return}H.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let H=this.readQueue.shift();if(H.type==="READABLE")this.listener.onReceiveMessage(H.parsedMessage);else this.listener.onReceiveHalfClose()}}handleDataFrame(H){var $;if(this.checkCancelled())return;y0H("Request to "+this.handler.path+" received data frame of size "+H.length);let A;try{A=this.decoder.write(H)}catch(L){this.sendStatus({code:lY.Status.RESOURCE_EXHAUSTED,details:L.message});return}for(let L of A){this.stream.pause();let I={type:"COMPRESSED",compressedMessage:L,parsedMessage:null};this.readQueue.push(I),this.decompressAndMaybePush(I),($=this.callEventTracker)===null||$===void 0||$.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(H){if(y0H("Request to "+this.handler.path+" start called"),this.checkCancelled())return;this.listener=H,H.onReceiveMetadata(this.metadata)}sendMetadata(H){if(this.checkCancelled())return;if(this.metadataSent)return;this.metadataSent=!0;let $=H?H.toHttp2Headers():null,A=Object.assign(Object.assign(Object.assign({},_MD),en9),$);this.stream.respond(A,Hr9)}sendMessage(H,$){if(this.checkCancelled())return;let A;try{A=this.serializeMessage(H)}catch(L){this.sendStatus({code:lY.Status.INTERNAL,details:`Error serializing response: ${(0,KMD.getErrorMessage)(L)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&A.length-5>this.maxSendMessageSize){this.sendStatus({code:lY.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${A.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),y0H("Request to "+this.handler.path+" sent data frame of size "+A.length),this.stream.write(A,(L)=>{var I;if(L){this.sendStatus({code:lY.Status.INTERNAL,details:`Error writing message: ${(0,KMD.getErrorMessage)(L)}`,metadata:null});return}(I=this.callEventTracker)===null||I===void 0||I.addMessageSent(),$()})}sendStatus(H){var $,A,L;if(this.checkCancelled())return;y0H("Request to method "+(($=this.handler)===null||$===void 0?void 0:$.path)+" ended with status code: "+lY.Status[H.code]+" details: "+H.details);let I=(L=(A=H.metadata)===null||A===void 0?void 0:A.clone())!==null&&L!==void 0?L:new qV$.Metadata;if(this.shouldSendMetrics)I.set(WMD.GRPC_METRICS_HEADER,this.metricsRecorder.serialize());if(this.metadataSent)if(!this.wantTrailers)this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(H);let D=Object.assign({[PMD]:H.code,[VMD]:encodeURI(H.details)},I.toHttp2Headers());this.stream.sendTrailers(D),this.notifyOnCancel()}),this.stream.end();else this.notifyOnCancel();else{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(H);let D=Object.assign(Object.assign({[PMD]:H.code,[VMD]:encodeURI(H.details)},_MD),I.toHttp2Headers());this.stream.respond(D,{endStream:!0}),this.notifyOnCancel()}}startRead(){if(y0H("Request to "+this.handler.path+" startRead called"),this.checkCancelled())return;if(this.isReadPending=!0,this.readQueue.length===0){if(!this.receivedHalfClose)this.stream.resume()}else this.maybePushNextMessage()}getPeer(){var H;let $=(H=this.stream.session)===null||H===void 0?void 0:H.socket;if($===null||$===void 0?void 0:$.remoteAddress)if($.remotePort)return`${$.remoteAddress}:${$.remotePort}`;else return $.remoteAddress;else return"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var H;if(((H=this.stream.session)===null||H===void 0?void 0:H.socket)instanceof an9.TLSSocket){let $=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:$.raw?$:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}}$z.BaseServerInterceptingCall=NCA;function $r9(H,$,A,L,I,D){let B={path:I.path,requestStream:I.type==="clientStream"||I.type==="bidi",responseStream:I.type==="serverStream"||I.type==="bidi",requestDeserialize:I.deserialize,responseSerialize:I.serialize},f=new NCA($,A,L,I,D);return H.reduce((E,M)=>{return M(B,E)},f)}});var yMD=z((mo)=>{var Ar9=mo&&mo.__runInitializers||function(H,$,A){var L=arguments.length>2;for(var I=0;I<$.length;I++)A=L?$[I].call(H,A):$[I].call(H);return L?A:void 0},Lr9=mo&&mo.__esDecorate||function(H,$,A,L,I,D){function B(P){if(P!==void 0&&typeof P!=="function")throw TypeError("Function expected");return P}var f=L.kind,E=f==="getter"?"get":f==="setter"?"set":"value",M=!$&&H?L.static?H:H.prototype:null,G=$||(M?Object.getOwnPropertyDescriptor(M,L.name):{}),U,X=!1;for(var J=A.length-1;J>=0;J--){var F={};for(var Q in L)F[Q]=Q==="access"?{}:L[Q];for(var Q in L.access)F.access[Q]=L.access[Q];F.addInitializer=function(P){if(X)throw TypeError("Cannot add initializers after decoration has completed");D.push(B(P||null))};var W=(0,A[J])(f==="accessor"?{get:G.get,set:G.set}:G[E],F);if(f==="accessor"){if(W===void 0)continue;if(W===null||typeof W!=="object")throw TypeError("Object expected");if(U=B(W.get))G.get=U;if(U=B(W.set))G.set=U;if(U=B(W.init))I.unshift(U)}else if(U=B(W))if(f==="field")I.unshift(U);else G[E]=U}if(M)Object.defineProperty(M,L.name,G);X=!0};Object.defineProperty(mo,"__esModule",{value:!0});mo.Server=void 0;var iY=require("http2"),Ir9=require("util"),CJ=B8(),U7H=IMD(),xCA=_V$(),NMD=BS(),G7H=qG(),go=cY(),QS=OP(),OK=ho(),OMD=OCA(),M7H=2147483647,SCA=2147483647,Dr9=20000,xMD=2147483647,{HTTP2_HEADER_PATH:SMD}=iY.constants,Br9="server",jMD=Buffer.from("max_age");function RMD(H){G7H.trace(CJ.LogVerbosity.DEBUG,"server_call",H)}function fr9(){}function Er9(H){return function($,A){return Ir9.deprecate($,H)}}function jCA(H){return{code:CJ.Status.UNIMPLEMENTED,details:`The server does not implement the method ${H}`}}function Mr9(H,$){let A=jCA($);switch(H){case"unary":return(L,I)=>{I(A,null)};case"clientStream":return(L,I)=>{I(A,null)};case"serverStream":return(L)=>{L.emit("error",A)};case"bidi":return(L)=>{L.emit("error",A)};default:throw Error(`Invalid handlerType ${H}`)}}var Gr9=(()=>{var H;let $=[],A;return H=class{constructor(I){var D,B,f,E,M,G;if(this.boundPorts=(Ar9(this,$),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=I!==null&&I!==void 0?I:{},this.options["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new OK.ChannelzTraceStub,this.callTracker=new OK.ChannelzCallTrackerStub,this.listenerChildrenTracker=new OK.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new OK.ChannelzChildrenTrackerStub;else this.channelzTrace=new OK.ChannelzTrace,this.callTracker=new OK.ChannelzCallTracker,this.listenerChildrenTracker=new OK.ChannelzChildrenTracker,this.sessionChildrenTracker=new OK.ChannelzChildrenTracker;if(this.channelzRef=(0,OK.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(D=this.options["grpc.max_connection_age_ms"])!==null&&D!==void 0?D:M7H,this.maxConnectionAgeGraceMs=(B=this.options["grpc.max_connection_age_grace_ms"])!==null&&B!==void 0?B:M7H,this.keepaliveTimeMs=(f=this.options["grpc.keepalive_time_ms"])!==null&&f!==void 0?f:SCA,this.keepaliveTimeoutMs=(E=this.options["grpc.keepalive_timeout_ms"])!==null&&E!==void 0?E:Dr9,this.sessionIdleTimeout=(M=this.options["grpc.max_connection_idle_ms"])!==null&&M!==void 0?M:xMD,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options)this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"];else this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER;if("grpc.max_concurrent_streams"in this.options)this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]};this.interceptors=(G=this.options.interceptors)!==null&&G!==void 0?G:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(I){var D,B,f;let E=this.sessions.get(I),M=I.socket,G=M.remoteAddress?(0,go.stringToSubchannelAddress)(M.remoteAddress,M.remotePort):null,U=M.localAddress?(0,go.stringToSubchannelAddress)(M.localAddress,M.localPort):null,X;if(I.encrypted){let F=M,Q=F.getCipher(),W=F.getCertificate(),P=F.getPeerCertificate();X={cipherSuiteStandardName:(D=Q.standardName)!==null&&D!==void 0?D:null,cipherSuiteOtherName:Q.standardName?null:Q.name,localCertificate:W&&"raw"in W?W.raw:null,remoteCertificate:P&&"raw"in P?P.raw:null}}else X=null;return{remoteAddress:G,localAddress:U,security:X,remoteName:null,streamsStarted:E.streamTracker.callsStarted,streamsSucceeded:E.streamTracker.callsSucceeded,streamsFailed:E.streamTracker.callsFailed,messagesSent:E.messagesSent,messagesReceived:E.messagesReceived,keepAlivesSent:E.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:E.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:E.lastMessageSentTimestamp,lastMessageReceivedTimestamp:E.lastMessageReceivedTimestamp,localFlowControlWindow:(B=I.state.localWindowSize)!==null&&B!==void 0?B:null,remoteFlowControlWindow:(f=I.state.remoteWindowSize)!==null&&f!==void 0?f:null}}trace(I){G7H.trace(CJ.LogVerbosity.DEBUG,Br9,"("+this.channelzRef.id+") "+I)}keepaliveTrace(I){G7H.trace(CJ.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+I)}addProtoService(){throw Error("Not implemented. Use addService() instead")}addService(I,D){if(I===null||typeof I!=="object"||D===null||typeof D!=="object")throw Error("addService() requires two objects as arguments");let B=Object.keys(I);if(B.length===0)throw Error("Cannot add an empty service to a server");B.forEach((f)=>{let E=I[f],M;if(E.requestStream)if(E.responseStream)M="bidi";else M="clientStream";else if(E.responseStream)M="serverStream";else M="unary";let G=D[f],U;if(G===void 0&&typeof E.originalName==="string")G=D[E.originalName];if(G!==void 0)U=G.bind(D);else U=Mr9(M,f);if(this.register(E.path,U,E.responseSerialize,E.requestDeserialize,M)===!1)throw Error(`Method handler for ${E.path} already provided.`)})}removeService(I){if(I===null||typeof I!=="object")throw Error("removeService() requires object as argument");Object.keys(I).forEach((B)=>{let f=I[B];this.unregister(f.path)})}bind(I,D){throw Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(I){return(0,OK.registerChannelzSocket)((0,go.subchannelAddressToString)(I),()=>{return{localAddress:I,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}},this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(I){(0,OK.unregisterChannelzRef)(I)}createHttp2Server(I){let D;if(I._isSecure()){let B=I._getConstructorOptions(),f=I._getSecureContextOptions(),E=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),B),f),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),M=f!==null;this.trace("Initial credentials valid: "+M),D=iY.createSecureServer(E),D.prependListener("connection",(U)=>{if(!M)this.trace("Dropped connection from "+JSON.stringify(U.address())+" due to unloaded credentials"),U.destroy()}),D.on("secureConnection",(U)=>{U.on("error",(X)=>{this.trace("An incoming TLS connection closed with error: "+X.message)})});let G=(U)=>{if(U){let X=D;try{X.setSecureContext(U)}catch(J){G7H.log(CJ.LogVerbosity.ERROR,"Failed to set secure context with error "+J.message),U=null}}M=U!==null,this.trace("Post-update credentials valid: "+M)};I._addWatcher(G),D.on("close",()=>{I._removeWatcher(G)})}else D=iY.createServer(this.commonServerOptions);return D.setTimeout(0,fr9),this._setupHandlers(D,I._getInterceptors()),D}bindOneAddress(I,D){this.trace("Attempting to bind "+(0,go.subchannelAddressToString)(I));let B=this.createHttp2Server(D.credentials);return new Promise((f,E)=>{let M=(G)=>{this.trace("Failed to bind "+(0,go.subchannelAddressToString)(I)+" with error "+G.message),f({port:"port"in I?I.port:1,error:G.message})};B.once("error",M),B.listen(I,()=>{let G=B.address(),U;if(typeof G==="string")U={path:G};else U={host:G.address,port:G.port};let X=this.experimentalRegisterListenerToChannelz(U);this.listenerChildrenTracker.refChild(X),this.http2Servers.set(B,{channelzRef:X,sessions:new Set,ownsChannelzRef:!0}),D.listeningServers.add(B),this.trace("Successfully bound "+(0,go.subchannelAddressToString)(U)),f({port:"port"in U?U.port:1}),B.removeListener("error",M)})})}async bindManyPorts(I,D){if(I.length===0)return{count:0,port:0,errors:[]};if((0,go.isTcpSubchannelAddress)(I[0])&&I[0].port===0){let B=await this.bindOneAddress(I[0],D);if(B.error){let f=await this.bindManyPorts(I.slice(1),D);return Object.assign(Object.assign({},f),{errors:[B.error,...f.errors]})}else{let f=I.slice(1).map((G)=>(0,go.isTcpSubchannelAddress)(G)?{host:G.host,port:B.port}:G),E=await Promise.all(f.map((G)=>this.bindOneAddress(G,D))),M=[B,...E];return{count:M.filter((G)=>G.error===void 0).length,port:B.port,errors:M.filter((G)=>G.error).map((G)=>G.error)}}}else{let B=await Promise.all(I.map((f)=>this.bindOneAddress(f,D)));return{count:B.filter((f)=>f.error===void 0).length,port:B[0].port,errors:B.filter((f)=>f.error).map((f)=>f.error)}}}async bindAddressList(I,D){let B=await this.bindManyPorts(I,D);if(B.count>0){if(B.count{let f=!1,E=(G,U,X,J)=>{if(f)return!0;if(f=!0,!G.ok)return B(Error(G.error.details)),!0;let F=[].concat(...G.value.map((Q)=>Q.addresses));if(F.length===0)return B(Error(`No addresses resolved for port ${I}`)),!0;return D(F),!0};(0,NMD.createResolver)(I,E,this.options).updateResolution()})}async bindPort(I,D){let B=await this.resolvePort(I);if(D.cancelled)throw this.completeUnbind(D),Error("bindAsync operation cancelled by unbind call");let f=await this.bindAddressList(B,D);if(D.cancelled)throw this.completeUnbind(D),Error("bindAsync operation cancelled by unbind call");return f}normalizePort(I){let D=(0,QS.parseUri)(I);if(D===null)throw Error(`Could not parse port "${I}"`);let B=(0,NMD.mapUriDefaultScheme)(D);if(B===null)throw Error(`Could not get a default scheme for port "${I}"`);return B}bindAsync(I,D,B){if(this.shutdown)throw Error("bindAsync called after shutdown");if(typeof I!=="string")throw TypeError("port must be a string");if(D===null||!(D instanceof xCA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(typeof B!=="function")throw TypeError("callback must be a function");this.trace("bindAsync port="+I);let f=this.normalizePort(I),E=(X,J)=>{process.nextTick(()=>B(X,J))},M=this.boundPorts.get((0,QS.uriToString)(f));if(M){if(!D._equals(M.credentials)){E(Error(`${I} already bound with incompatible credentials`),0);return}if(M.cancelled=!1,M.completionPromise)M.completionPromise.then((X)=>B(null,X),(X)=>B(X,0));else E(null,M.portNumber);return}M={mapKey:(0,QS.uriToString)(f),originalUri:f,completionPromise:null,cancelled:!1,portNumber:0,credentials:D,listeningServers:new Set};let G=(0,QS.splitHostPort)(f.path),U=this.bindPort(f,M);if(M.completionPromise=U,(G===null||G===void 0?void 0:G.port)===0)U.then((X)=>{let J={scheme:f.scheme,authority:f.authority,path:(0,QS.combineHostPort)({host:G.host,port:X})};M.mapKey=(0,QS.uriToString)(J),M.completionPromise=null,M.portNumber=X,this.boundPorts.set(M.mapKey,M),B(null,X)},(X)=>{B(X,0)});else this.boundPorts.set(M.mapKey,M),U.then((X)=>{M.completionPromise=null,M.portNumber=X,B(null,X)},(X)=>{B(X,0)})}registerInjectorToChannelz(){return(0,OK.registerChannelzSocket)("injector",()=>{return{localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}},this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(I,D,B=!1){if(I===null||!(I instanceof xCA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(this.channelzEnabled)this.listenerChildrenTracker.refChild(D);let f=this.createHttp2Server(I),E=new Set;return this.http2Servers.set(f,{channelzRef:D,sessions:E,ownsChannelzRef:B}),{injectConnection:(M)=>{f.emit("connection",M)},drain:(M)=>{var G,U;for(let X of E)this.closeSession(X);(U=(G=setTimeout(()=>{for(let X of E)X.destroy(iY.constants.NGHTTP2_CANCEL)},M)).unref)===null||U===void 0||U.call(G)},destroy:()=>{this.closeServer(f);for(let M of E)this.closeSession(M)}}}createConnectionInjector(I){if(I===null||!(I instanceof xCA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");let D=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(I,D,!0)}closeServer(I,D){this.trace("Closing server with address "+JSON.stringify(I.address()));let B=this.http2Servers.get(I);I.close(()=>{if(B&&B.ownsChannelzRef)this.listenerChildrenTracker.unrefChild(B.channelzRef),(0,OK.unregisterChannelzRef)(B.channelzRef);this.http2Servers.delete(I),D===null||D===void 0||D()})}closeSession(I,D){var B;this.trace("Closing session initiated by "+((B=I.socket)===null||B===void 0?void 0:B.remoteAddress));let f=this.sessions.get(I),E=()=>{if(f)this.sessionChildrenTracker.unrefChild(f.ref),(0,OK.unregisterChannelzRef)(f.ref);D===null||D===void 0||D()};if(I.closed)queueMicrotask(E);else I.close(E)}completeUnbind(I){for(let D of I.listeningServers){let B=this.http2Servers.get(D);if(this.closeServer(D,()=>{I.listeningServers.delete(D)}),B)for(let f of B.sessions)this.closeSession(f)}this.boundPorts.delete(I.mapKey)}unbind(I){this.trace("unbind port="+I);let D=this.normalizePort(I),B=(0,QS.splitHostPort)(D.path);if((B===null||B===void 0?void 0:B.port)===0)throw Error("Cannot unbind port 0");let f=this.boundPorts.get((0,QS.uriToString)(D));if(f)if(this.trace("unbinding "+f.mapKey+" originally bound as "+(0,QS.uriToString)(f.originalUri)),f.completionPromise)f.cancelled=!0;else this.completeUnbind(f)}drain(I,D){var B,f;this.trace("drain port="+I+" graceTimeMs="+D);let E=this.normalizePort(I),M=(0,QS.splitHostPort)(E.path);if((M===null||M===void 0?void 0:M.port)===0)throw Error("Cannot drain port 0");let G=this.boundPorts.get((0,QS.uriToString)(E));if(!G)return;let U=new Set;for(let X of G.listeningServers){let J=this.http2Servers.get(X);if(J)for(let F of J.sessions)U.add(F),this.closeSession(F,()=>{U.delete(F)})}(f=(B=setTimeout(()=>{for(let X of U)X.destroy(iY.constants.NGHTTP2_CANCEL)},D)).unref)===null||f===void 0||f.call(B)}forceShutdown(){for(let I of this.boundPorts.values())I.cancelled=!0;this.boundPorts.clear();for(let I of this.http2Servers.keys())this.closeServer(I);this.sessions.forEach((I,D)=>{this.closeSession(D),D.destroy(iY.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,OK.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(I,D,B,f,E){if(this.handlers.has(I))return!1;return this.handlers.set(I,{func:D,serialize:B,deserialize:f,type:E,path:I}),!0}unregister(I){return this.handlers.delete(I)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every((I)=>!I.listening))throw Error("server must be bound in order to start");if(this.started===!0)throw Error("server is already started");this.started=!0}tryShutdown(I){var D;let B=(M)=>{(0,OK.unregisterChannelzRef)(this.channelzRef),I(M)},f=0;function E(){if(f--,f===0)B()}this.shutdown=!0;for(let[M,G]of this.http2Servers.entries()){f++;let U=G.channelzRef.name;this.trace("Waiting for server "+U+" to close"),this.closeServer(M,()=>{this.trace("Server "+U+" finished closing"),E()});for(let X of G.sessions.keys()){f++;let J=(D=X.socket)===null||D===void 0?void 0:D.remoteAddress;this.trace("Waiting for session "+J+" to close"),this.closeSession(X,()=>{this.trace("Session "+J+" finished closing"),E()})}}if(f===0)B()}addHttp2Port(){throw Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(I,D){let B=D[iY.constants.HTTP2_HEADER_CONTENT_TYPE];if(typeof B!=="string"||!B.startsWith("application/grpc"))return I.respond({[iY.constants.HTTP2_HEADER_STATUS]:iY.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1;return!0}_retrieveHandler(I){RMD("Received call to method "+I+" at address "+this.serverAddressString);let D=this.handlers.get(I);if(D===void 0)return RMD("No handler registered for method "+I+". Sending UNIMPLEMENTED status."),null;return D}_respondWithError(I,D,B=null){var f,E;let M=Object.assign({"grpc-status":(f=I.code)!==null&&f!==void 0?f:CJ.Status.INTERNAL,"grpc-message":I.details,[iY.constants.HTTP2_HEADER_STATUS]:iY.constants.HTTP_STATUS_OK,[iY.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(E=I.metadata)===null||E===void 0?void 0:E.toHttp2Headers());D.respond(M,{endStream:!0}),this.callTracker.addCallFailed(),B===null||B===void 0||B.streamTracker.addCallFailed()}_channelzHandler(I,D,B){this.onStreamOpened(D);let f=this.sessions.get(D.session);if(this.callTracker.addCallStarted(),f===null||f===void 0||f.streamTracker.addCallStarted(),!this._verifyContentType(D,B)){this.callTracker.addCallFailed(),f===null||f===void 0||f.streamTracker.addCallFailed();return}let E=B[SMD],M=this._retrieveHandler(E);if(!M){this._respondWithError(jCA(E),D,f);return}let G={addMessageSent:()=>{if(f)f.messagesSent+=1,f.lastMessageSentTimestamp=new Date},addMessageReceived:()=>{if(f)f.messagesReceived+=1,f.lastMessageReceivedTimestamp=new Date},onCallEnd:(X)=>{if(X.code===CJ.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()},onStreamEnd:(X)=>{if(f)if(X)f.streamTracker.addCallSucceeded();else f.streamTracker.addCallFailed()}},U=(0,OMD.getServerInterceptingCall)([...I,...this.interceptors],D,B,G,M,this.options);if(!this._runHandlerForCall(U,M))this.callTracker.addCallFailed(),f===null||f===void 0||f.streamTracker.addCallFailed(),U.sendStatus({code:CJ.Status.INTERNAL,details:`Unknown handler type: ${M.type}`})}_streamHandler(I,D,B){if(this.onStreamOpened(D),this._verifyContentType(D,B)!==!0)return;let f=B[SMD],E=this._retrieveHandler(f);if(!E){this._respondWithError(jCA(f),D,null);return}let M=(0,OMD.getServerInterceptingCall)([...I,...this.interceptors],D,B,null,E,this.options);if(!this._runHandlerForCall(M,E))M.sendStatus({code:CJ.Status.INTERNAL,details:`Unknown handler type: ${E.type}`})}_runHandlerForCall(I,D){let{type:B}=D;if(B==="unary")Ur9(I,D);else if(B==="clientStream")Xr9(I,D);else if(B==="serverStream")Jr9(I,D);else if(B==="bidi")Fr9(I,D);else return!1;return!0}_setupHandlers(I,D){if(I===null)return;let B=I.address(),f="null";if(B)if(typeof B==="string")f=B;else f=B.address+":"+B.port;this.serverAddressString=f;let E=this.channelzEnabled?this._channelzHandler:this._streamHandler,M=this.channelzEnabled?this._channelzSessionHandler(I):this._sessionHandler(I);I.on("stream",E.bind(this,D)),I.on("session",M)}_sessionHandler(I){return(D)=>{var B,f;(B=this.http2Servers.get(I))===null||B===void 0||B.sessions.add(D);let E=null,M=null,G=null,U=!1,X=this.enableIdleTimeout(D);if(this.maxConnectionAgeMs!==M7H){let P=this.maxConnectionAgeMs/10,C=Math.random()*P*2-P;E=setTimeout(()=>{var Y,Z;U=!0,this.trace("Connection dropped by max connection age: "+((Y=D.socket)===null||Y===void 0?void 0:Y.remoteAddress));try{D.goaway(iY.constants.NGHTTP2_NO_ERROR,2147483647,jMD)}catch(q){D.destroy();return}if(D.close(),this.maxConnectionAgeGraceMs!==M7H)M=setTimeout(()=>{D.destroy()},this.maxConnectionAgeGraceMs),(Z=M.unref)===null||Z===void 0||Z.call(M)},this.maxConnectionAgeMs+C),(f=E.unref)===null||f===void 0||f.call(E)}let J=()=>{if(G)clearTimeout(G),G=null},F=()=>{return!D.destroyed&&this.keepaliveTimeMs0},Q,W=()=>{var P;if(!F())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),G=setTimeout(()=>{J(),Q()},this.keepaliveTimeMs),(P=G.unref)===null||P===void 0||P.call(G)};Q=()=>{var P;if(!F())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let C="";try{if(!D.ping((Z,q,O)=>{if(J(),Z)this.keepaliveTrace("Ping failed with error: "+Z.message),U=!0,D.close();else this.keepaliveTrace("Received ping response"),W()}))C="Ping returned false"}catch(Y){C=(Y instanceof Error?Y.message:"")||"Unknown error"}if(C){this.keepaliveTrace("Ping send failed: "+C),this.trace("Connection dropped due to ping send error: "+C),U=!0,D.close();return}G=setTimeout(()=>{J(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),U=!0,D.close()},this.keepaliveTimeoutMs),(P=G.unref)===null||P===void 0||P.call(G)},W(),D.on("close",()=>{var P,C;if(!U)this.trace(`Connection dropped by client ${(P=D.socket)===null||P===void 0?void 0:P.remoteAddress}`);if(E)clearTimeout(E);if(M)clearTimeout(M);if(J(),X!==null)clearTimeout(X.timeout),this.sessionIdleTimeouts.delete(D);(C=this.http2Servers.get(I))===null||C===void 0||C.sessions.delete(D)})}}_channelzSessionHandler(I){return(D)=>{var B,f,E,M;let G=(0,OK.registerChannelzSocket)((f=(B=D.socket)===null||B===void 0?void 0:B.remoteAddress)!==null&&f!==void 0?f:"unknown",this.getChannelzSessionInfo.bind(this,D),this.channelzEnabled),U={ref:G,streamTracker:new OK.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(E=this.http2Servers.get(I))===null||E===void 0||E.sessions.add(D),this.sessions.set(D,U);let X=`${D.socket.remoteAddress}:${D.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+X),this.trace("Connection established by client "+X),this.sessionChildrenTracker.refChild(G);let J=null,F=null,Q=null,W=!1,P=this.enableIdleTimeout(D);if(this.maxConnectionAgeMs!==M7H){let O=this.maxConnectionAgeMs/10,j=Math.random()*O*2-O;J=setTimeout(()=>{var u;W=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+X);try{D.goaway(iY.constants.NGHTTP2_NO_ERROR,2147483647,jMD)}catch(y){D.destroy();return}if(D.close(),this.maxConnectionAgeGraceMs!==M7H)F=setTimeout(()=>{D.destroy()},this.maxConnectionAgeGraceMs),(u=F.unref)===null||u===void 0||u.call(F)},this.maxConnectionAgeMs+j),(M=J.unref)===null||M===void 0||M.call(J)}let C=()=>{if(Q)clearTimeout(Q),Q=null},Y=()=>{return!D.destroyed&&this.keepaliveTimeMs0},Z,q=()=>{var O;if(!Y())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),Q=setTimeout(()=>{C(),Z()},this.keepaliveTimeMs),(O=Q.unref)===null||O===void 0||O.call(Q)};Z=()=>{var O;if(!Y())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let j="";try{if(!D.ping((y,g,h)=>{if(C(),y)this.keepaliveTrace("Ping failed with error: "+y.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+y.message+" return in "+g),W=!0,D.close();else this.keepaliveTrace("Received ping response"),q()}))j="Ping returned false"}catch(u){j=(u instanceof Error?u.message:"")||"Unknown error"}if(j){this.keepaliveTrace("Ping send failed: "+j),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+j),W=!0,D.close();return}U.keepAlivesSent+=1,Q=setTimeout(()=>{C(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+X),W=!0,D.close()},this.keepaliveTimeoutMs),(O=Q.unref)===null||O===void 0||O.call(Q)},q(),D.on("close",()=>{var O;if(!W)this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+X);if(this.sessionChildrenTracker.unrefChild(G),(0,OK.unregisterChannelzRef)(G),J)clearTimeout(J);if(F)clearTimeout(F);if(C(),P!==null)clearTimeout(P.timeout),this.sessionIdleTimeouts.delete(D);(O=this.http2Servers.get(I))===null||O===void 0||O.sessions.delete(D),this.sessions.delete(D)})}}enableIdleTimeout(I){var D,B;if(this.sessionIdleTimeout>=xMD)return null;let f={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,I),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,I)};(B=(D=f.timeout).unref)===null||B===void 0||B.call(D),this.sessionIdleTimeouts.set(I,f);let{socket:E}=I;return this.trace("Enable idle timeout for "+E.remoteAddress+":"+E.remotePort),f}onIdleTimeout(I,D){let{socket:B}=D,f=I.sessionIdleTimeouts.get(D);if(f!==void 0&&f.activeStreams===0)if(Date.now()-f.lastIdle>=I.sessionIdleTimeout)I.trace("Session idle timeout triggered for "+(B===null||B===void 0?void 0:B.remoteAddress)+":"+(B===null||B===void 0?void 0:B.remotePort)+" last idle at "+f.lastIdle),I.closeSession(D);else f.timeout.refresh()}onStreamOpened(I){let D=I.session,B=this.sessionIdleTimeouts.get(D);if(B)B.activeStreams+=1,I.once("close",B.onClose)}onStreamClose(I){var D,B;let f=this.sessionIdleTimeouts.get(I);if(f){if(f.activeStreams-=1,f.activeStreams===0)f.lastIdle=Date.now(),f.timeout.refresh(),this.trace("Session onStreamClose"+((D=I.socket)===null||D===void 0?void 0:D.remoteAddress)+":"+((B=I.socket)===null||B===void 0?void 0:B.remotePort)+" at "+f.lastIdle)}}},(()=>{let L=typeof Symbol==="function"&&Symbol.metadata?Object.create(null):void 0;if(A=[Er9("Calling start() is no longer necessary. It can be safely omitted.")],Lr9(H,null,A,{kind:"method",name:"start",static:!1,private:!1,access:{has:(I)=>("start"in I),get:(I)=>I.start},metadata:L},null,$),L)Object.defineProperty(H,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:L})})(),H})();mo.Server=Gr9;async function Ur9(H,$){let A;function L(B,f,E,M){if(B){H.sendStatus((0,U7H.serverErrorToStatus)(B,E));return}H.sendMessage(f,()=>{H.sendStatus({code:CJ.Status.OK,details:"OK",metadata:E!==null&&E!==void 0?E:null})})}let I,D=null;H.start({onReceiveMetadata(B){I=B,H.startRead()},onReceiveMessage(B){if(D){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${$.path}`,metadata:null});return}D=B,H.startRead()},onReceiveHalfClose(){if(!D){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${$.path}`,metadata:null});return}A=new U7H.ServerWritableStreamImpl($.path,H,I,D);try{$.func(A,L)}catch(B){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${B.message}`,metadata:null})}},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled")}})}function Xr9(H,$){let A;function L(I,D,B,f){if(I){H.sendStatus((0,U7H.serverErrorToStatus)(I,B));return}H.sendMessage(D,()=>{H.sendStatus({code:CJ.Status.OK,details:"OK",metadata:B!==null&&B!==void 0?B:null})})}H.start({onReceiveMetadata(I){A=new U7H.ServerDuplexStreamImpl($.path,H,I);try{$.func(A,L)}catch(D){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${D.message}`,metadata:null})}},onReceiveMessage(I){A.push(I)},onReceiveHalfClose(){A.push(null)},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled"),A.destroy()}})}function Jr9(H,$){let A,L,I=null;H.start({onReceiveMetadata(D){L=D,H.startRead()},onReceiveMessage(D){if(I){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${$.path}`,metadata:null});return}I=D,H.startRead()},onReceiveHalfClose(){if(!I){H.sendStatus({code:CJ.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${$.path}`,metadata:null});return}A=new U7H.ServerWritableStreamImpl($.path,H,L,I);try{$.func(A)}catch(D){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${D.message}`,metadata:null})}},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled"),A.destroy()}})}function Fr9(H,$){let A;H.start({onReceiveMetadata(L){A=new U7H.ServerDuplexStreamImpl($.path,H,L);try{$.func(A)}catch(I){H.sendStatus({code:CJ.Status.UNKNOWN,details:`Server method handler threw error ${I.message}`,metadata:null})}},onReceiveMessage(L){A.push(L)},onReceiveHalfClose(){A.push(null)},onCancel(){if(A)A.cancelled=!0,A.emit("cancelled","cancelled"),A.destroy()}})}});var hMD=z((TV$)=>{Object.defineProperty(TV$,"__esModule",{value:!0});TV$.StatusBuilder=void 0;class vMD{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(H){return this.code=H,this}withDetails(H){return this.details=H,this}withMetadata(H){return this.metadata=H,this}build(){let H={};if(this.code!==null)H.code=this.code;if(this.details!==null)H.details=this.details;if(this.metadata!==null)H.metadata=this.metadata;return H}}TV$.StatusBuilder=vMD});var mhH=z((Zh)=>{Object.defineProperty(Zh,"__esModule",{value:!0});Zh.LeafLoadBalancer=Zh.PickFirstLoadBalancer=Zh.PickFirstLoadBalancingConfig=void 0;Zh.shuffled=mMD;Zh.setup=Cr9;var RCA=zo(),wJ=xP(),po=sm(),bMD=cY(),Kr9=qG(),Qr9=B8(),kMD=cY(),uMD=require("net"),Wr9=Y0H(),Vr9="pick_first";function uhH(H){Kr9.trace(Qr9.LogVerbosity.DEBUG,Vr9,H)}var ghH="pick_first",Pr9=250;class X7H{constructor(H){this.shuffleAddressList=H}getLoadBalancerName(){return ghH}toJsonObject(){return{[ghH]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(H){if("shuffleAddressList"in H&&typeof H.shuffleAddressList!=="boolean")throw Error("pick_first config field shuffleAddressList must be a boolean if provided");return new X7H(H.shuffleAddressList===!0)}}Zh.PickFirstLoadBalancingConfig=X7H;class gMD{constructor(H){this.subchannel=H}pick(H){return{pickResultType:po.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}}function mMD(H){let $=H.slice();for(let A=$.length-1;A>1;A--){let L=Math.floor(Math.random()*(A+1)),I=$[A];$[A]=$[L],$[L]=I}return $}function _r9(H){if(H.length===0)return[];let $=[],A=[],L=[],I=(0,kMD.isTcpSubchannelAddress)(H[0])&&(0,uMD.isIPv6)(H[0].host);for(let f of H)if((0,kMD.isTcpSubchannelAddress)(f)&&(0,uMD.isIPv6)(f.host))A.push(f);else L.push(f);let D=I?A:L,B=I?L:A;for(let f=0;f{this.onSubchannelStateUpdate($,A,L,D)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every((H)=>H.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every((H)=>H.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var H;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let $=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker({details:$}),$)}else this.updateState(wJ.ConnectivityState.READY,new gMD(this.currentPick),null);else if(((H=this.latestAddressList)===null||H===void 0?void 0:H.length)===0){let $=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker({details:$}),$)}else if(this.children.length===0)this.updateState(wJ.ConnectivityState.IDLE,new po.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let $=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker({details:$}),$)}else this.updateState(wJ.ConnectivityState.CONNECTING,new po.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(!this.allChildrenHaveReportedTF())return;if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:H}of this.children)H.startConnecting();this.calculateAndReportNewState()}removeCurrentPick(){if(this.currentPick!==null)this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null}onSubchannelStateUpdate(H,$,A,L){var I;if((I=this.currentPick)===null||I===void 0?void 0:I.realSubchannelEquals(H)){if(A!==wJ.ConnectivityState.READY)this.removeCurrentPick(),this.calculateAndReportNewState();return}for(let[D,B]of this.children.entries())if(H.realSubchannelEquals(B.subchannel)){if(A===wJ.ConnectivityState.READY)this.pickSubchannel(B.subchannel);if(A===wJ.ConnectivityState.TRANSIENT_FAILURE){if(B.hasReportedTransientFailure=!0,L)this.lastError=L;if(this.maybeEnterStickyTransientFailureMode(),D===this.currentSubchannelIndex)this.startNextSubchannelConnecting(D+1)}B.subchannel.startConnecting();return}}startNextSubchannelConnecting(H){clearTimeout(this.connectionDelayTimeout);for(let[$,A]of this.children.entries())if($>=H){let L=A.subchannel.getConnectivityState();if(L===wJ.ConnectivityState.IDLE||L===wJ.ConnectivityState.CONNECTING){this.startConnecting($);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(H){var $,A;if(clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=H,this.children[H].subchannel.getConnectivityState()===wJ.ConnectivityState.IDLE)uhH("Start connecting to subchannel with address "+this.children[H].subchannel.getAddress()),process.nextTick(()=>{var L;(L=this.children[H])===null||L===void 0||L.subchannel.startConnecting()});this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(H+1)},Pr9),(A=($=this.connectionDelayTimeout).unref)===null||A===void 0||A.call($)}pickSubchannel(H){uhH("Pick subchannel with address "+H.getAddress()),this.stickyTransientFailureMode=!1,H.ref(),this.channelControlHelper.addChannelzChild(H.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),H.addConnectivityStateListener(this.subchannelStateListener),H.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=H,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(H,$,A){uhH(wJ.ConnectivityState[this.currentState]+" -> "+wJ.ConnectivityState[H]),this.currentState=H,this.channelControlHelper.updateState(H,$,A)}resetSubchannelList(){for(let H of this.children)H.subchannel.removeConnectivityStateListener(this.subchannelStateListener),H.subchannel.unref(),this.channelControlHelper.removeChannelzChild(H.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(H,$){uhH("connectToAddressList(["+H.map((L)=>(0,bMD.subchannelAddressToString)(L))+"])");let A=H.map((L)=>({subchannel:this.channelControlHelper.createSubchannel(L,$),hasReportedTransientFailure:!1}));for(let{subchannel:L}of A)if(L.getConnectivityState()===wJ.ConnectivityState.READY){this.pickSubchannel(L);return}for(let{subchannel:L}of A)L.ref(),this.channelControlHelper.addChannelzChild(L.getChannelzRef());this.resetSubchannelList(),this.children=A;for(let{subchannel:L}of this.children)L.addConnectivityStateListener(this.subchannelStateListener);for(let L of this.children)if(L.subchannel.getConnectivityState()===wJ.ConnectivityState.TRANSIENT_FAILURE)L.hasReportedTransientFailure=!0;this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(H,$,A,L){if(!($ instanceof X7H))return!1;if(!H.ok){if(this.children.length===0&&this.currentPick===null)this.channelControlHelper.updateState(wJ.ConnectivityState.TRANSIENT_FAILURE,new po.UnavailablePicker(H.error),H.error.details);return!0}let I=H.value;if(this.reportHealthStatus=A[pMD],$.getShuffleAddressList())I=mMD(I);let D=[].concat(...I.map((f)=>f.addresses));uhH("updateAddressList(["+D.map((f)=>(0,bMD.subchannelAddressToString)(f))+"])");let B=_r9(D);if(this.latestAddressList=B,this.latestOptions=A,this.connectToAddressList(B,A),this.latestResolutionNote=L,D.length>0)return!0;else return this.lastError="No addresses resolved",!1}exitIdle(){if(this.currentState===wJ.ConnectivityState.IDLE&&this.latestAddressList)this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return ghH}}Zh.PickFirstLoadBalancer=zV$;var Yr9=new X7H(!1);class dMD{constructor(H,$,A,L){this.endpoint=H,this.options=A,this.resolutionNote=L,this.latestState=wJ.ConnectivityState.IDLE;let I=(0,RCA.createChildChannelControlHelper)($,{updateState:(D,B,f)=>{this.latestState=D,this.latestPicker=B,$.updateState(D,B,f)}});this.pickFirstBalancer=new zV$(I),this.latestPicker=new po.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,Wr9.statusOrFromValue)([this.endpoint]),Yr9,Object.assign(Object.assign({},this.options),{[pMD]:!0}),this.resolutionNote)}updateEndpoint(H,$){if(this.options=$,this.endpoint=H,this.latestState!==wJ.ConnectivityState.IDLE)this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}}Zh.LeafLoadBalancer=dMD;function Cr9(){(0,RCA.registerLoadBalancerType)(ghH,zV$,X7H),(0,RCA.registerDefaultLoadBalancerType)(ghH)}});var lMD=z((OV$)=>{Object.defineProperty(OV$,"__esModule",{value:!0});OV$.FileWatcherCertificateProvider=void 0;var wr9=require("fs"),Zr9=qG(),qr9=B8(),Tr9=require("util"),zr9="certificate_provider";function NV$(H){Zr9.trace(qr9.LogVerbosity.DEBUG,zr9,H)}var yCA=(0,Tr9.promisify)(wr9.readFile);class cMD{constructor(H){if(this.config=H,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,H.certificateFile===void 0!==(H.privateKeyFile===void 0))throw Error("certificateFile and privateKeyFile must be set or unset together");if(H.certificateFile===void 0&&H.caCertificateFile===void 0)throw Error("At least one of certificateFile and caCertificateFile must be set");NV$("File watcher constructed with config "+JSON.stringify(H))}updateCertificates(){if(this.fileResultPromise)return;this.fileResultPromise=Promise.allSettled([this.config.certificateFile?yCA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?yCA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?yCA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([H,$,A])=>{if(!this.refreshTimer)return;if(NV$("File watcher read certificates certificate "+H.status+", privateKey "+$.status+", CA certificate "+A.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,H.status==="fulfilled"&&$.status==="fulfilled")this.latestIdentityUpdate={certificate:H.value,privateKey:$.value};else this.latestIdentityUpdate=null;if(A.status==="fulfilled")this.latestCaUpdate={caCertificate:A.value};else this.latestCaUpdate=null;for(let L of this.identityListeners)L(this.latestIdentityUpdate);for(let L of this.caListeners)L(this.latestCaUpdate)}),NV$("File watcher initiated certificate update")}maybeStartWatchingFiles(){if(!this.refreshTimer){let H=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;if(H>this.config.refreshIntervalMs)this.updateCertificates();if(H>this.config.refreshIntervalMs*2)this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0;this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),NV$("File watcher started watching")}}maybeStopWatchingFiles(){if(this.caListeners.size===0&&this.identityListeners.size===0){if(this.fileResultPromise=null,this.refreshTimer)clearInterval(this.refreshTimer),this.refreshTimer=null}}addCaCertificateListener(H){if(this.caListeners.add(H),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0)process.nextTick(H,this.latestCaUpdate)}removeCaCertificateListener(H){this.caListeners.delete(H),this.maybeStopWatchingFiles()}addIdentityCertificateListener(H){if(this.identityListeners.add(H),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0)process.nextTick(H,this.latestIdentityUpdate)}removeIdentityCertificateListener(H){this.identityListeners.delete(H),this.maybeStopWatchingFiles()}}OV$.FileWatcherCertificateProvider=cMD});var bCA=z((BD)=>{Object.defineProperty(BD,"__esModule",{value:!0});BD.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=BD.createCertificateProviderChannelCredentials=BD.FileWatcherCertificateProvider=BD.createCertificateProviderServerCredentials=BD.createServerCredentialsWithInterceptors=BD.BaseSubchannelWrapper=BD.registerAdminService=BD.FilterStackFactory=BD.BaseFilter=BD.statusOrFromError=BD.statusOrFromValue=BD.PickResultType=BD.QueuePicker=BD.UnavailablePicker=BD.ChildLoadBalancerHandler=BD.EndpointMap=BD.endpointHasAddress=BD.endpointToString=BD.subchannelAddressToString=BD.LeafLoadBalancer=BD.isLoadBalancerNameRegistered=BD.parseLoadBalancingConfig=BD.selectLbConfigFromList=BD.registerLoadBalancerType=BD.createChildChannelControlHelper=BD.BackoffTimeout=BD.parseDuration=BD.durationToMs=BD.splitHostPort=BD.uriToString=BD.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=BD.createResolver=BD.registerResolver=BD.log=BD.trace=void 0;var iMD=qG();Object.defineProperty(BD,"trace",{enumerable:!0,get:function(){return iMD.trace}});Object.defineProperty(BD,"log",{enumerable:!0,get:function(){return iMD.log}});var vCA=BS();Object.defineProperty(BD,"registerResolver",{enumerable:!0,get:function(){return vCA.registerResolver}});Object.defineProperty(BD,"createResolver",{enumerable:!0,get:function(){return vCA.createResolver}});Object.defineProperty(BD,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return vCA.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var nMD=OP();Object.defineProperty(BD,"uriToString",{enumerable:!0,get:function(){return nMD.uriToString}});Object.defineProperty(BD,"splitHostPort",{enumerable:!0,get:function(){return nMD.splitHostPort}});var rMD=khH();Object.defineProperty(BD,"durationToMs",{enumerable:!0,get:function(){return rMD.durationToMs}});Object.defineProperty(BD,"parseDuration",{enumerable:!0,get:function(){return rMD.parseDuration}});var Nr9=uWH();Object.defineProperty(BD,"BackoffTimeout",{enumerable:!0,get:function(){return Nr9.BackoffTimeout}});var phH=zo();Object.defineProperty(BD,"createChildChannelControlHelper",{enumerable:!0,get:function(){return phH.createChildChannelControlHelper}});Object.defineProperty(BD,"registerLoadBalancerType",{enumerable:!0,get:function(){return phH.registerLoadBalancerType}});Object.defineProperty(BD,"selectLbConfigFromList",{enumerable:!0,get:function(){return phH.selectLbConfigFromList}});Object.defineProperty(BD,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return phH.parseLoadBalancingConfig}});Object.defineProperty(BD,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return phH.isLoadBalancerNameRegistered}});var Or9=mhH();Object.defineProperty(BD,"LeafLoadBalancer",{enumerable:!0,get:function(){return Or9.LeafLoadBalancer}});var xV$=cY();Object.defineProperty(BD,"subchannelAddressToString",{enumerable:!0,get:function(){return xV$.subchannelAddressToString}});Object.defineProperty(BD,"endpointToString",{enumerable:!0,get:function(){return xV$.endpointToString}});Object.defineProperty(BD,"endpointHasAddress",{enumerable:!0,get:function(){return xV$.endpointHasAddress}});Object.defineProperty(BD,"EndpointMap",{enumerable:!0,get:function(){return xV$.EndpointMap}});var xr9=U3$();Object.defineProperty(BD,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return xr9.ChildLoadBalancerHandler}});var hCA=sm();Object.defineProperty(BD,"UnavailablePicker",{enumerable:!0,get:function(){return hCA.UnavailablePicker}});Object.defineProperty(BD,"QueuePicker",{enumerable:!0,get:function(){return hCA.QueuePicker}});Object.defineProperty(BD,"PickResultType",{enumerable:!0,get:function(){return hCA.PickResultType}});var aMD=Y0H();Object.defineProperty(BD,"statusOrFromValue",{enumerable:!0,get:function(){return aMD.statusOrFromValue}});Object.defineProperty(BD,"statusOrFromError",{enumerable:!0,get:function(){return aMD.statusOrFromError}});var Sr9=rYA();Object.defineProperty(BD,"BaseFilter",{enumerable:!0,get:function(){return Sr9.BaseFilter}});var jr9=s3$();Object.defineProperty(BD,"FilterStackFactory",{enumerable:!0,get:function(){return jr9.FilterStackFactory}});var Rr9=K3$();Object.defineProperty(BD,"registerAdminService",{enumerable:!0,get:function(){return Rr9.registerAdminService}});var yr9=hhH();Object.defineProperty(BD,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return yr9.BaseSubchannelWrapper}});var oMD=_V$();Object.defineProperty(BD,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return oMD.createServerCredentialsWithInterceptors}});Object.defineProperty(BD,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return oMD.createCertificateProviderServerCredentials}});var vr9=lMD();Object.defineProperty(BD,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return vr9.FileWatcherCertificateProvider}});var hr9=kWH();Object.defineProperty(BD,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return hr9.createCertificateProviderChannelCredentials}});var br9=QCA();Object.defineProperty(BD,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return br9.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var sMD=z((kCA)=>{Object.defineProperty(kCA,"__esModule",{value:!0});kCA.setup=gr9;var kr9=BS(),ur9=Y0H();class tMD{constructor(H,$,A){this.listener=$,this.hasReturnedResult=!1,this.endpoints=[];let L;if(H.authority==="")L="/"+H.path;else L=H.path;this.endpoints=[{addresses:[{path:L}]}]}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(this.listener,(0,ur9.statusOrFromValue)(this.endpoints),{},null,"")}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(H){return"localhost"}}function gr9(){(0,kr9.registerResolver)("unix",tMD)}});var IGD=z((dCA)=>{Object.defineProperty(dCA,"__esModule",{value:!0});dCA.setup=lr9;var eMD=require("net"),HGD=Y0H(),SV$=B8(),uCA=rQ(),$GD=BS(),mr9=cY(),AGD=OP(),pr9=qG(),dr9="ip_resolver";function LGD(H){pr9.trace(SV$.LogVerbosity.DEBUG,dr9,H)}var gCA="ipv4",mCA="ipv6",cr9=443;class pCA{constructor(H,$,A){var L;this.listener=$,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,LGD("Resolver constructed for target "+(0,AGD.uriToString)(H));let I=[];if(!(H.scheme===gCA||H.scheme===mCA)){this.error={code:SV$.Status.UNAVAILABLE,details:`Unrecognized scheme ${H.scheme} in IP resolver`,metadata:new uCA.Metadata};return}let D=H.path.split(",");for(let B of D){let f=(0,AGD.splitHostPort)(B);if(f===null){this.error={code:SV$.Status.UNAVAILABLE,details:`Failed to parse ${H.scheme} address ${B}`,metadata:new uCA.Metadata};return}if(H.scheme===gCA&&!(0,eMD.isIPv4)(f.host)||H.scheme===mCA&&!(0,eMD.isIPv6)(f.host)){this.error={code:SV$.Status.UNAVAILABLE,details:`Failed to parse ${H.scheme} address ${B}`,metadata:new uCA.Metadata};return}I.push({host:f.host,port:(L=f.port)!==null&&L!==void 0?L:cr9})}this.endpoints=I.map((B)=>({addresses:[B]})),LGD("Parsed "+H.scheme+" address list "+I.map(mr9.subchannelAddressToString))}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(()=>{if(this.error)this.listener((0,HGD.statusOrFromError)(this.error),{},null,"");else this.listener((0,HGD.statusOrFromValue)(this.endpoints),{},null,"")})}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(H){return H.path.split(",")[0]}}function lr9(){(0,$GD.registerResolver)(gCA,pCA),(0,$GD.registerResolver)(mCA,pCA)}});var MGD=z((chH)=>{Object.defineProperty(chH,"__esModule",{value:!0});chH.RoundRobinLoadBalancer=void 0;chH.setup=tr9;var fGD=zo(),y7=xP(),dhH=sm(),ir9=qG(),nr9=B8(),DGD=cY(),rr9=mhH(),ar9="round_robin";function BGD(H){ir9.trace(nr9.LogVerbosity.DEBUG,ar9,H)}var jV$="round_robin";class RV${getLoadBalancerName(){return jV$}constructor(){}toJsonObject(){return{[jV$]:{}}}static createFromJson(H){return new RV$}}class EGD{constructor(H,$=0){this.children=H,this.nextIndex=$}pick(H){let $=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,$.pick(H)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}}function or9(H,$){return[...H.slice($),...H.slice(0,$)]}class cCA{constructor(H){this.channelControlHelper=H,this.children=[],this.currentState=y7.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,fGD.createChildChannelControlHelper)(H,{updateState:($,A,L)=>{if(this.currentState===y7.ConnectivityState.READY&&$!==y7.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(L)this.lastError=L;this.calculateAndUpdateState()}})}countChildrenWithState(H){return this.children.filter(($)=>$.getConnectivityState()===H).length}calculateAndUpdateState(){if(this.updatesPaused)return;if(this.countChildrenWithState(y7.ConnectivityState.READY)>0){let H=this.children.filter((A)=>A.getConnectivityState()===y7.ConnectivityState.READY),$=0;if(this.currentReadyPicker!==null){let A=this.currentReadyPicker.peekNextEndpoint();if($=H.findIndex((L)=>(0,DGD.endpointEqual)(L.getEndpoint(),A)),$<0)$=0}this.updateState(y7.ConnectivityState.READY,new EGD(H.map((A)=>({endpoint:A.getEndpoint(),picker:A.getPicker()})),$),null)}else if(this.countChildrenWithState(y7.ConnectivityState.CONNECTING)>0)this.updateState(y7.ConnectivityState.CONNECTING,new dhH.QueuePicker(this),null);else if(this.countChildrenWithState(y7.ConnectivityState.TRANSIENT_FAILURE)>0){let H=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(y7.ConnectivityState.TRANSIENT_FAILURE,new dhH.UnavailablePicker({details:H}),H)}else this.updateState(y7.ConnectivityState.IDLE,new dhH.QueuePicker(this),null);for(let H of this.children)if(H.getConnectivityState()===y7.ConnectivityState.IDLE)H.exitIdle()}updateState(H,$,A){if(BGD(y7.ConnectivityState[this.currentState]+" -> "+y7.ConnectivityState[H]),H===y7.ConnectivityState.READY)this.currentReadyPicker=$;else this.currentReadyPicker=null;this.currentState=H,this.channelControlHelper.updateState(H,$,A)}resetSubchannelList(){for(let H of this.children)H.destroy();this.children=[]}updateAddressList(H,$,A,L){if(!($ instanceof RV$))return!1;if(!H.ok){if(this.children.length===0)this.updateState(y7.ConnectivityState.TRANSIENT_FAILURE,new dhH.UnavailablePicker(H.error),H.error.details);return!0}let I=Math.random()*H.value.length|0,D=or9(H.value,I);if(this.resetSubchannelList(),D.length===0){let B=`No addresses resolved. Resolution note: ${L}`;this.updateState(y7.ConnectivityState.TRANSIENT_FAILURE,new dhH.UnavailablePicker({details:B}),B)}BGD("Connect to endpoint list "+D.map(DGD.endpointToString)),this.updatesPaused=!0,this.children=D.map((B)=>new rr9.LeafLoadBalancer(B,this.childChannelControlHelper,A,L));for(let B of this.children)B.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return jV$}}chH.RoundRobinLoadBalancer=cCA;function tr9(){(0,fGD.registerLoadBalancerType)(jV$,cCA,RV$)}});var KGD=z((h0H)=>{var lCA;Object.defineProperty(h0H,"__esModule",{value:!0});h0H.OutlierDetectionLoadBalancer=h0H.OutlierDetectionLoadBalancingConfig=void 0;h0H.setup=Ea9;var sr9=xP(),GGD=B8(),v0H=khH(),UGD=bCA(),er9=zo(),Ha9=U3$(),$a9=sm(),iCA=cY(),Aa9=hhH(),La9=qG(),Ia9="outlier_detection";function tQ(H){La9.trace(GGD.LogVerbosity.DEBUG,Ia9,H)}var aCA="outlier_detection",Da9=((lCA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&lCA!==void 0?lCA:"true")==="true",Ba9={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},fa9={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function J7H(H,$,A,L){if($ in H&&H[$]!==void 0&&typeof H[$]!==A){let I=L?`${L}.${$}`:$;throw Error(`outlier detection config ${I} parse error: expected ${A}, got ${typeof H[$]}`)}}function nCA(H,$,A){let L=A?`${A}.${$}`:$;if($ in H&&H[$]!==void 0){if(!(0,v0H.isDuration)(H[$]))throw Error(`outlier detection config ${L} parse error: expected Duration, got ${typeof H[$]}`);if(!(H[$].seconds>=0&&H[$].seconds<=315576000000&&H[$].nanos>=0&&H[$].nanos<=999999999))throw Error(`outlier detection config ${L} parse error: values out of range for non-negative Duaration`)}}function yV$(H,$,A){let L=A?`${A}.${$}`:$;if(J7H(H,$,"number",A),$ in H&&H[$]!==void 0&&!(H[$]>=0&&H[$]<=100))throw Error(`outlier detection config ${L} parse error: value out of range for percentage (0-100)`)}class lhH{constructor(H,$,A,L,I,D,B){if(this.childPolicy=B,B.getLoadBalancerName()==="pick_first")throw Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=H!==null&&H!==void 0?H:1e4,this.baseEjectionTimeMs=$!==null&&$!==void 0?$:30000,this.maxEjectionTimeMs=A!==null&&A!==void 0?A:300000,this.maxEjectionPercent=L!==null&&L!==void 0?L:10,this.successRateEjection=I?Object.assign(Object.assign({},Ba9),I):null,this.failurePercentageEjection=D?Object.assign(Object.assign({},fa9),D):null}getLoadBalancerName(){return aCA}toJsonObject(){var H,$;return{outlier_detection:{interval:(0,v0H.msToDuration)(this.intervalMs),base_ejection_time:(0,v0H.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,v0H.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(H=this.successRateEjection)!==null&&H!==void 0?H:void 0,failure_percentage_ejection:($=this.failurePercentageEjection)!==null&&$!==void 0?$:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(H){var $;if(nCA(H,"interval"),nCA(H,"base_ejection_time"),nCA(H,"max_ejection_time"),yV$(H,"max_ejection_percent"),"success_rate_ejection"in H&&H.success_rate_ejection!==void 0){if(typeof H.success_rate_ejection!=="object")throw Error("outlier detection config success_rate_ejection must be an object");J7H(H.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),yV$(H.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),J7H(H.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),J7H(H.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in H&&H.failure_percentage_ejection!==void 0){if(typeof H.failure_percentage_ejection!=="object")throw Error("outlier detection config failure_percentage_ejection must be an object");yV$(H.failure_percentage_ejection,"threshold","failure_percentage_ejection"),yV$(H.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),J7H(H.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),J7H(H.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in H)||!Array.isArray(H.child_policy))throw Error("outlier detection config child_policy must be an array");let A=(0,er9.selectLbConfigFromList)(H.child_policy);if(!A)throw Error("outlier detection config child_policy: no valid recognized policy found");return new lhH(H.interval?(0,v0H.durationToMs)(H.interval):null,H.base_ejection_time?(0,v0H.durationToMs)(H.base_ejection_time):null,H.max_ejection_time?(0,v0H.durationToMs)(H.max_ejection_time):null,($=H.max_ejection_percent)!==null&&$!==void 0?$:null,H.success_rate_ejection,H.failure_percentage_ejection,A)}}h0H.OutlierDetectionLoadBalancingConfig=lhH;class XGD extends Aa9.BaseSubchannelWrapper{constructor(H,$){super(H);this.mapEntry=$,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0){if(this.mapEntry){let H=this.mapEntry.subchannelWrappers.indexOf(this);if(H>=0)this.mapEntry.subchannelWrappers.splice(H,1)}}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}}function rCA(){return{success:0,failure:0}}class JGD{constructor(){this.activeBucket=rCA(),this.inactiveBucket=rCA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=rCA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}}class FGD{constructor(H,$){this.wrappedPicker=H,this.countCalls=$}pick(H){let $=this.wrappedPicker.pick(H);if($.pickResultType===$a9.PickResultType.COMPLETE){let A=$.subchannel,L=A.getMapEntry();if(L){let I=$.onCallEnded;if(this.countCalls)I=(D,B,f)=>{var E;if(D===GGD.Status.OK)L.counter.addSuccess();else L.counter.addFailure();(E=$.onCallEnded)===null||E===void 0||E.call($,D,B,f)};return Object.assign(Object.assign({},$),{subchannel:A.getWrappedSubchannel(),onCallEnded:I})}else return Object.assign(Object.assign({},$),{subchannel:A.getWrappedSubchannel()})}else return $}}class oCA{constructor(H){this.entryMap=new iCA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new Ha9.ChildLoadBalancerHandler((0,UGD.createChildChannelControlHelper)(H,{createSubchannel:($,A)=>{let L=H.createSubchannel($,A),I=this.entryMap.getForSubchannelAddress($),D=new XGD(L,I);if((I===null||I===void 0?void 0:I.currentEjectionTimestamp)!==null)D.eject();return I===null||I===void 0||I.subchannelWrappers.push(D),D},updateState:($,A,L)=>{if($===sr9.ConnectivityState.READY)H.updateState($,new FGD(A,this.isCountingEnabled()),L);else H.updateState($,A,L)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let H=0;for(let $ of this.entryMap.values())if($.currentEjectionTimestamp!==null)H+=1;return H*100/this.entryMap.size}runSuccessRateCheck(H){if(!this.latestConfig)return;let $=this.latestConfig.getSuccessRateEjectionConfig();if(!$)return;tQ("Running success rate check");let A=$.request_volume,L=0,I=[];for(let[G,U]of this.entryMap.entries()){let X=U.counter.getLastSuccesses(),J=U.counter.getLastFailures();if(tQ("Stats for "+(0,iCA.endpointToString)(G)+": successes="+X+" failures="+J+" targetRequestVolume="+A),X+J>=A)L+=1,I.push(X/(X+J))}if(tQ("Found "+L+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+I+"]"),L<$.minimum_hosts)return;let D=I.reduce((G,U)=>G+U)/I.length,B=0;for(let G of I){let U=G-D;B+=U*U}let f=B/I.length,E=Math.sqrt(f),M=D-E*($.stdev_factor/1000);tQ("stdev="+E+" ejectionThreshold="+M);for(let[G,U]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let X=U.counter.getLastSuccesses(),J=U.counter.getLastFailures();if(X+Jthis.runChecks(),H),(A=($=this.ejectionTimer).unref)===null||A===void 0||A.call($)}runChecks(){let H=new Date;if(tQ("Ejection timer running"),this.switchAllBuckets(),!this.latestConfig)return;this.timerStartTime=H,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(H),this.runFailurePercentageCheck(H);for(let[$,A]of this.entryMap.entries())if(A.currentEjectionTimestamp===null){if(A.ejectionTimeMultiplier>0)A.ejectionTimeMultiplier-=1}else{let L=this.latestConfig.getBaseEjectionTimeMs(),I=this.latestConfig.getMaxEjectionTimeMs(),D=new Date(A.currentEjectionTimestamp.getTime());if(D.setMilliseconds(D.getMilliseconds()+Math.min(L*A.ejectionTimeMultiplier,Math.max(L,I))),D{Object.defineProperty(hV$,"__esModule",{value:!0});hV$.PriorityQueue=void 0;var F7H=0,tCA=(H)=>Math.floor(H/2),vV$=(H)=>H*2+1,ihH=(H)=>H*2+2;class QGD{constructor(H=($,A)=>$>A){this.comparator=H,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[F7H]}push(...H){return H.forEach(($)=>{this.heap.push($),this.siftUp()}),this.size()}pop(){let H=this.peek(),$=this.size()-1;if($>F7H)this.swap(F7H,$);return this.heap.pop(),this.siftDown(),H}replace(H){let $=this.peek();return this.heap[F7H]=H,this.siftDown(),$}greater(H,$){return this.comparator(this.heap[H],this.heap[$])}swap(H,$){[this.heap[H],this.heap[$]]=[this.heap[$],this.heap[H]]}siftUp(){let H=this.size()-1;while(H>F7H&&this.greater(H,tCA(H)))this.swap(H,tCA(H)),H=tCA(H)}siftDown(){let H=F7H;while(vV$(H){Object.defineProperty(rhH,"__esModule",{value:!0});rhH.WeightedRoundRobinLoadBalancingConfig=void 0;rhH.setup=Pa9;var sQ=xP(),Ma9=B8(),Pw=khH(),_GD=zo(),Ga9=mhH(),Ua9=qG(),YGD=CV$(),K7H=sm(),Xa9=WGD(),VGD=cY(),Ja9="weighted_round_robin";function sCA(H){Ua9.trace(Ma9.LogVerbosity.DEBUG,Ja9,H)}var eCA="weighted_round_robin",Fa9=1e4,Ka9=1e4,Qa9=180000,Wa9=1000,Va9=1;function PGD(H,$,A){if($ in H&&H[$]!==void 0&&typeof H[$]!==A)throw Error(`weighted round robin config ${$} parse error: expected ${A}, got ${typeof H[$]}`)}function bV$(H,$){if($ in H&&H[$]!==void 0&&H[$]!==null){let A;if((0,Pw.isDuration)(H[$]))A=H[$];else if((0,Pw.isDurationMessage)(H[$]))A=(0,Pw.durationMessageToDuration)(H[$]);else if(typeof H[$]==="string"){let L=(0,Pw.parseDuration)(H[$]);if(!L)throw Error(`weighted round robin config ${$}: failed to parse duration string ${H[$]}`);A=L}else throw Error(`weighted round robin config ${$}: expected duration, got ${typeof H[$]}`);return(0,Pw.durationToMs)(A)}return null}class nhH{constructor(H,$,A,L,I,D){this.enableOobLoadReport=H!==null&&H!==void 0?H:!1,this.oobLoadReportingPeriodMs=$!==null&&$!==void 0?$:Fa9,this.blackoutPeriodMs=A!==null&&A!==void 0?A:Ka9,this.weightExpirationPeriodMs=L!==null&&L!==void 0?L:Qa9,this.weightUpdatePeriodMs=Math.max(I!==null&&I!==void 0?I:Wa9,100),this.errorUtilizationPenalty=D!==null&&D!==void 0?D:Va9}getLoadBalancerName(){return eCA}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,Pw.durationToString)((0,Pw.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(H){if(PGD(H,"enable_oob_load_report","boolean"),PGD(H,"error_utilization_penalty","number"),H.error_utilization_penalty<0)throw Error("weighted round robin config error_utilization_penalty < 0");return new nhH(H.enable_oob_load_report,bV$(H,"oob_load_reporting_period"),bV$(H,"blackout_period"),bV$(H,"weight_expiration_period"),bV$(H,"weight_update_period"),H.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}}rhH.WeightedRoundRobinLoadBalancingConfig=nhH;class CGD{constructor(H,$){this.metricsHandler=$,this.queue=new Xa9.PriorityQueue((I,D)=>I.deadlineI.weight>0),L;if(A.length<2)L=1;else{let I=0;for(let{weight:D}of A)I+=D;L=I/A.length}for(let I of H){let D=I.weight>0?1/I.weight:L;this.queue.push({endpointName:I.endpointName,picker:I.picker,period:D,deadline:Math.random()*D})}}pick(H){let $=this.queue.pop();this.queue.push(Object.assign(Object.assign({},$),{deadline:$.deadline+$.period}));let A=$.picker.pick(H);if(A.pickResultType===K7H.PickResultType.COMPLETE)if(this.metricsHandler)return Object.assign(Object.assign({},A),{onCallEnded:(0,YGD.createMetricsReader)((L)=>this.metricsHandler(L,$.endpointName),A.onCallEnded)});else{let L=A.subchannel;return Object.assign(Object.assign({},A),{subchannel:L.getWrappedSubchannel()})}else return A}}class wGD{constructor(H){this.channelControlHelper=H,this.latestConfig=null,this.children=new Map,this.currentState=sQ.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(H){let $=0;for(let A of this.children.values())if(A.child.getConnectivityState()===H)$+=1;return $}updateWeight(H,$){var A,L;let{rps_fractional:I,application_utilization:D}=$;if(D>0&&I>0)D+=$.eps/I*((L=(A=this.latestConfig)===null||A===void 0?void 0:A.getErrorUtilizationPenalty())!==null&&L!==void 0?L:0);let B=D===0?0:I/D;if(B===0)return;let f=new Date;if(H.nonEmptySince===null)H.nonEmptySince=f;H.lastUpdated=f,H.weight=B}getWeight(H){if(!this.latestConfig)return 0;let $=new Date().getTime();if($-H.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return H.nonEmptySince=null,0;let A=this.latestConfig.getBlackoutPeriodMs();if(A>0&&(H.nonEmptySince===null||$-H.nonEmptySince.getTime()0){let H=[];for(let[A,L]of this.children){if(L.child.getConnectivityState()!==sQ.ConnectivityState.READY)continue;H.push({endpointName:A,picker:L.child.getPicker(),weight:this.getWeight(L)})}sCA("Created picker with weights: "+H.map((A)=>A.endpointName+":"+A.weight).join(","));let $;if(!this.latestConfig.getEnableOobLoadReport())$=(A,L)=>{let I=this.children.get(L);if(I)this.updateWeight(I,A)};else $=null;this.updateState(sQ.ConnectivityState.READY,new CGD(H,$),null)}else if(this.countChildrenWithState(sQ.ConnectivityState.CONNECTING)>0)this.updateState(sQ.ConnectivityState.CONNECTING,new K7H.QueuePicker(this),null);else if(this.countChildrenWithState(sQ.ConnectivityState.TRANSIENT_FAILURE)>0){let H=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(sQ.ConnectivityState.TRANSIENT_FAILURE,new K7H.UnavailablePicker({details:H}),H)}else this.updateState(sQ.ConnectivityState.IDLE,new K7H.QueuePicker(this),null);for(let{child:H}of this.children.values())if(H.getConnectivityState()===sQ.ConnectivityState.IDLE)H.exitIdle()}updateState(H,$,A){sCA(sQ.ConnectivityState[this.currentState]+" -> "+sQ.ConnectivityState[H]),this.currentState=H,this.channelControlHelper.updateState(H,$,A)}updateAddressList(H,$,A,L){var I,D;if(!($ instanceof nhH))return!1;if(!H.ok){if(this.children.size===0)this.updateState(sQ.ConnectivityState.TRANSIENT_FAILURE,new K7H.UnavailablePicker(H.error),H.error.details);return!0}if(H.value.length===0){let E=`No addresses resolved. Resolution note: ${L}`;return this.updateState(sQ.ConnectivityState.TRANSIENT_FAILURE,new K7H.UnavailablePicker({details:E}),E),!1}sCA("Connect to endpoint list "+H.value.map(VGD.endpointToString));let B=new Date,f=new Set;this.updatesPaused=!0,this.latestConfig=$;for(let E of H.value){let M=(0,VGD.endpointToString)(E);f.add(M);let G=this.children.get(M);if(!G)G={child:new Ga9.LeafLoadBalancer(E,(0,_GD.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(U,X,J)=>{if(this.currentState===sQ.ConnectivityState.READY&&U!==sQ.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(U===sQ.ConnectivityState.READY)G.nonEmptySince=null;if(J)this.lastError=J;this.calculateAndUpdateState()},createSubchannel:(U,X)=>{let J=this.channelControlHelper.createSubchannel(U,X);if(G===null||G===void 0?void 0:G.oobMetricsListener)return new YGD.OrcaOobMetricsSubchannelWrapper(J,G.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs());else return J}}),A,L),lastUpdated:B,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(M,G);if($.getEnableOobLoadReport())G.oobMetricsListener=(U)=>{this.updateWeight(G,U)};else G.oobMetricsListener=null}for(let[E,M]of this.children)if(f.has(E))M.child.startConnecting();else M.child.destroy(),this.children.delete(E);if(this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer);return this.weightUpdateTimer=(D=(I=setInterval(()=>{if(this.currentState===sQ.ConnectivityState.READY)this.calculateAndUpdateState()},$.getWeightUpdatePeriodMs())).unref)===null||D===void 0?void 0:D.call(I),!0}exitIdle(){}resetBackoff(){}destroy(){for(let H of this.children.values())H.child.destroy();if(this.children.clear(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer)}getTypeName(){return eCA}}function Pa9(){(0,_GD.registerLoadBalancerType)(eCA,wGD,nhH)}});var ahH=z((HD)=>{Object.defineProperty(HD,"__esModule",{value:!0});HD.experimental=HD.ServerMetricRecorder=HD.ServerInterceptingCall=HD.ResponderBuilder=HD.ServerListenerBuilder=HD.addAdminServicesToServer=HD.getChannelzHandlers=HD.getChannelzServiceDefinition=HD.InterceptorConfigurationError=HD.InterceptingCall=HD.RequesterBuilder=HD.ListenerBuilder=HD.StatusBuilder=HD.getClientChannel=HD.ServerCredentials=HD.Server=HD.setLogVerbosity=HD.setLogger=HD.load=HD.loadObject=HD.CallCredentials=HD.ChannelCredentials=HD.waitForClientReady=HD.closeClient=HD.Channel=HD.makeGenericClientConstructor=HD.makeClientConstructor=HD.loadPackageDefinition=HD.Client=HD.compressionAlgorithms=HD.propagate=HD.connectivityState=HD.status=HD.logVerbosity=HD.Metadata=HD.credentials=void 0;var kV$=H3$();Object.defineProperty(HD,"CallCredentials",{enumerable:!0,get:function(){return kV$.CallCredentials}});var _a9=r_A();Object.defineProperty(HD,"Channel",{enumerable:!0,get:function(){return _a9.ChannelImplementation}});var Ya9=nYA();Object.defineProperty(HD,"compressionAlgorithms",{enumerable:!0,get:function(){return Ya9.CompressionAlgorithms}});var Ca9=xP();Object.defineProperty(HD,"connectivityState",{enumerable:!0,get:function(){return Ca9.ConnectivityState}});var uV$=kWH();Object.defineProperty(HD,"ChannelCredentials",{enumerable:!0,get:function(){return uV$.ChannelCredentials}});var qGD=n_A();Object.defineProperty(HD,"Client",{enumerable:!0,get:function(){return qGD.Client}});var H2A=B8();Object.defineProperty(HD,"logVerbosity",{enumerable:!0,get:function(){return H2A.LogVerbosity}});Object.defineProperty(HD,"status",{enumerable:!0,get:function(){return H2A.Status}});Object.defineProperty(HD,"propagate",{enumerable:!0,get:function(){return H2A.Propagate}});var TGD=qG(),$2A=P3$();Object.defineProperty(HD,"loadPackageDefinition",{enumerable:!0,get:function(){return $2A.loadPackageDefinition}});Object.defineProperty(HD,"makeClientConstructor",{enumerable:!0,get:function(){return $2A.makeClientConstructor}});Object.defineProperty(HD,"makeGenericClientConstructor",{enumerable:!0,get:function(){return $2A.makeClientConstructor}});var wa9=rQ();Object.defineProperty(HD,"Metadata",{enumerable:!0,get:function(){return wa9.Metadata}});var Za9=yMD();Object.defineProperty(HD,"Server",{enumerable:!0,get:function(){return Za9.Server}});var qa9=_V$();Object.defineProperty(HD,"ServerCredentials",{enumerable:!0,get:function(){return qa9.ServerCredentials}});var Ta9=hMD();Object.defineProperty(HD,"StatusBuilder",{enumerable:!0,get:function(){return Ta9.StatusBuilder}});HD.credentials={combineChannelCredentials:(H,...$)=>{return $.reduce((A,L)=>A.compose(L),H)},combineCallCredentials:(H,...$)=>{return $.reduce((A,L)=>A.compose(L),H)},createInsecure:uV$.ChannelCredentials.createInsecure,createSsl:uV$.ChannelCredentials.createSsl,createFromSecureContext:uV$.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:kV$.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:kV$.CallCredentials.createFromGoogleCredential,createEmpty:kV$.CallCredentials.createEmpty};var za9=(H)=>H.close();HD.closeClient=za9;var Na9=(H,$,A)=>H.waitForReady($,A);HD.waitForClientReady=Na9;var Oa9=(H,$)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};HD.loadObject=Oa9;var xa9=(H,$,A)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};HD.load=xa9;var Sa9=(H)=>{TGD.setLogger(H)};HD.setLogger=Sa9;var ja9=(H)=>{TGD.setLoggerVerbosity(H)};HD.setLogVerbosity=ja9;var Ra9=(H)=>{return qGD.Client.prototype.getChannel.call(H)};HD.getClientChannel=Ra9;var gV$=l_A();Object.defineProperty(HD,"ListenerBuilder",{enumerable:!0,get:function(){return gV$.ListenerBuilder}});Object.defineProperty(HD,"RequesterBuilder",{enumerable:!0,get:function(){return gV$.RequesterBuilder}});Object.defineProperty(HD,"InterceptingCall",{enumerable:!0,get:function(){return gV$.InterceptingCall}});Object.defineProperty(HD,"InterceptorConfigurationError",{enumerable:!0,get:function(){return gV$.InterceptorConfigurationError}});var zGD=ho();Object.defineProperty(HD,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return zGD.getChannelzServiceDefinition}});Object.defineProperty(HD,"getChannelzHandlers",{enumerable:!0,get:function(){return zGD.getChannelzHandlers}});var ya9=K3$();Object.defineProperty(HD,"addAdminServicesToServer",{enumerable:!0,get:function(){return ya9.addAdminServicesToServer}});var A2A=OCA();Object.defineProperty(HD,"ServerListenerBuilder",{enumerable:!0,get:function(){return A2A.ServerListenerBuilder}});Object.defineProperty(HD,"ResponderBuilder",{enumerable:!0,get:function(){return A2A.ResponderBuilder}});Object.defineProperty(HD,"ServerInterceptingCall",{enumerable:!0,get:function(){return A2A.ServerInterceptingCall}});var va9=CV$();Object.defineProperty(HD,"ServerMetricRecorder",{enumerable:!0,get:function(){return va9.ServerMetricRecorder}});var ha9=bCA();HD.experimental=ha9;var ba9=DCA(),ka9=sMD(),ua9=IGD(),ga9=mhH(),ma9=MGD(),pa9=KGD(),da9=ZGD(),ca9=ho();(()=>{ba9.setup(),ka9.setup(),ua9.setup(),ga9.setup(),ma9.setup(),pa9.setup(),da9.setup(),ca9.setup()})()});var NGD=z((mV$)=>{Object.defineProperty(mV$,"__esModule",{value:!0});mV$.createServiceClientConstructor=void 0;var la9=ahH();function ia9(H,$){let A={export:{path:H,requestStream:!1,responseStream:!1,requestSerialize:(L)=>{return L},requestDeserialize:(L)=>{return L},responseSerialize:(L)=>{return L},responseDeserialize:(L)=>{return L}}};return la9.makeGenericClientConstructor(A,$)}mV$.createServiceClientConstructor=ia9});var ohH=z((Az)=>{Object.defineProperty(Az,"__esModule",{value:!0});Az.createOtlpGrpcExporterTransport=Az.GrpcExporterTransport=Az.createEmptyMetadata=Az.createSslCredentials=Az.createInsecureCredentials=void 0;var na9=$1D(),OGD=`OTel-OTLP-Exporter-JavaScript/${na9.VERSION}`;function ra9(H){if(H)return`${H} ${OGD}`;return OGD}var aa9=0,oa9=2;function ta9(H){return H==="gzip"?oa9:aa9}function sa9(){let{credentials:H}=ahH();return H.createInsecure()}Az.createInsecureCredentials=sa9;function ea9(H,$,A){let{credentials:L}=ahH();return L.createSsl(H,$,A)}Az.createSslCredentials=ea9;function Ho9(){let{Metadata:H}=ahH();return new H}Az.createEmptyMetadata=Ho9;class L2A{_parameters;_client;_metadata;constructor(H){this._parameters=H}shutdown(){this._client?.close()}send(H,$){let A=Buffer.from(H);if(this._client==null){let{createServiceClientConstructor:L}=NGD();try{this._metadata=this._parameters.metadata()}catch(D){return Promise.resolve({status:"failure",error:D})}let I=L(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new I(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":ta9(this._parameters.compression),"grpc.primary_user_agent":ra9(this._parameters.userAgent)})}catch(D){return Promise.resolve({status:"failure",error:D})}}return new Promise((L)=>{let I=Date.now()+$;if(this._metadata==null)return L({error:Error("metadata was null"),status:"failure"});this._client.export(A,this._metadata,{deadline:I},(D,B)=>{if(D)L({status:"failure",error:D});else L({data:B,status:"success"})})})}}Az.GrpcExporterTransport=L2A;function $o9(H){return new L2A(H)}Az.createOtlpGrpcExporterTransport=$o9});var yGD=z((co)=>{Object.defineProperty(co,"__esModule",{value:!0});co.getOtlpGrpcDefaultConfiguration=co.mergeOtlpGrpcConfigurationWithDefaults=co.validateAndNormalizeUrl=void 0;var jGD=Lh(),thH=ohH(),Ao9=require("url"),xGD=kB();function RGD(H){if(H=H.trim(),!H.match(/^([\w]{1,8}):\/\//))H=`https://${H}`;let A=new Ao9.URL(H);if(A.protocol==="unix:")return H;if(A.pathname&&A.pathname!=="/")xGD.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored.");if(A.protocol!==""&&!A.protocol?.match(/^(http)s?:$/))xGD.diag.warn("URL protocol should be http(s)://. Using http://.");return A.host}co.validateAndNormalizeUrl=RGD;function SGD(H,$){for(let[A,L]of Object.entries($.getMap()))if(H.get(A).length<1)H.set(A,L)}function Lo9(H,$,A){let L=H.url??$.url??A.url;return{...(0,jGD.mergeOtlpSharedConfigurationWithDefaults)(H,$,A),metadata:()=>{let I=A.metadata();return SGD(I,H.metadata?.().clone()??(0,thH.createEmptyMetadata)()),SGD(I,$.metadata?.()??(0,thH.createEmptyMetadata)()),I},url:RGD(L),credentials:H.credentials??$.credentials?.(L)??A.credentials(L),userAgent:H.userAgent}}co.mergeOtlpGrpcConfigurationWithDefaults=Lo9;function Io9(){return{...(0,jGD.getSharedConfigurationDefaults)(),metadata:()=>(0,thH.createEmptyMetadata)(),url:"http://localhost:4317",credentials:(H)=>{if(H.startsWith("http://"))return()=>(0,thH.createInsecureCredentials)();else return()=>(0,thH.createSslCredentials)()}}}co.getOtlpGrpcDefaultConfiguration=Io9});var uGD=z((pV$)=>{Object.defineProperty(pV$,"__esModule",{value:!0});pV$.getOtlpGrpcConfigurationFromEnv=void 0;var vGD=Kf(),shH=ohH(),Do9=om(),Bo9=require("fs"),fo9=require("path"),bGD=kB();function I2A(H,$){if(H!=null&&H!=="")return H;if($!=null&&$!=="")return $;return}function Eo9(H){let $=process.env[`OTEL_EXPORTER_OTLP_${H}_HEADERS`]?.trim(),A=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),L=(0,vGD.parseKeyPairsIntoRecord)($),I=(0,vGD.parseKeyPairsIntoRecord)(A);if(Object.keys(L).length===0&&Object.keys(I).length===0)return;let D=Object.assign({},I,L),B=(0,shH.createEmptyMetadata)();for(let[f,E]of Object.entries(D))B.set(f,E);return B}function Mo9(H){let $=Eo9(H);if($==null)return;return()=>$}function Go9(H){let $=process.env[`OTEL_EXPORTER_OTLP_${H}_ENDPOINT`]?.trim(),A=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return I2A($,A)}function Uo9(H){let $=process.env[`OTEL_EXPORTER_OTLP_${H}_INSECURE`]?.toLowerCase().trim(),A=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return I2A($,A)==="true"}function D2A(H,$,A){let L=process.env[H]?.trim(),I=process.env[$]?.trim(),D=I2A(L,I);if(D!=null)try{return Bo9.readFileSync(fo9.resolve(process.cwd(),D))}catch{bGD.diag.warn(A);return}else return}function Xo9(H){return D2A(`OTEL_EXPORTER_OTLP_${H}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function Jo9(H){return D2A(`OTEL_EXPORTER_OTLP_${H}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function hGD(H){return D2A(`OTEL_EXPORTER_OTLP_${H}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function kGD(H){let $=Jo9(H),A=Xo9(H),L=hGD(H),I=$!=null&&A!=null;if(L!=null&&!I)return bGD.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,shH.createSslCredentials)(hGD(H));return(0,shH.createSslCredentials)(L,$,A)}function Fo9(H){if(Uo9(H))return(0,shH.createInsecureCredentials)();return kGD(H)}function Ko9(H){return{...(0,Do9.getSharedConfigurationFromEnvironment)(H),metadata:Mo9(H),url:Go9(H),credentials:($)=>{if($.startsWith("http://"))return()=>{return(0,shH.createInsecureCredentials)()};else if($.startsWith("https://"))return()=>{return kGD(H)};return()=>{return Fo9(H)}}}}pV$.getOtlpGrpcConfigurationFromEnv=Ko9});var mGD=z((dV$)=>{Object.defineProperty(dV$,"__esModule",{value:!0});dV$.convertLegacyOtlpGrpcOptions=void 0;var Qo9=kB(),gGD=yGD(),Wo9=ohH(),Vo9=uGD();function Po9(H,$){if(H.headers)Qo9.diag.warn("Headers cannot be set when using grpc");let A=H.credentials;return(0,gGD.mergeOtlpGrpcConfigurationWithDefaults)({url:H.url,metadata:()=>{return H.metadata??(0,Wo9.createEmptyMetadata)()},compression:H.compression,timeoutMillis:H.timeoutMillis,concurrencyLimit:H.concurrencyLimit,credentials:A!=null?()=>A:void 0,userAgent:H.userAgent},(0,Vo9.getOtlpGrpcConfigurationFromEnv)($),(0,gGD.getOtlpGrpcDefaultConfiguration)())}dV$.convertLegacyOtlpGrpcOptions=Po9});var pGD=z((cV$)=>{Object.defineProperty(cV$,"__esModule",{value:!0});cV$.createOtlpGrpcExportDelegate=void 0;var _o9=Lh(),Yo9=ohH();function Co9(H,$,A,L){return(0,_o9.createOtlpNetworkExportDelegate)(H,$,(0,Yo9.createOtlpGrpcExporterTransport)({address:H.url,compression:H.compression,credentials:H.credentials,metadata:H.metadata,userAgent:H.userAgent,grpcName:A,grpcPath:L}))}cV$.createOtlpGrpcExportDelegate=Co9});var lV$=z((Q7H)=>{Object.defineProperty(Q7H,"__esModule",{value:!0});Q7H.createOtlpGrpcExportDelegate=Q7H.convertLegacyOtlpGrpcOptions=void 0;var wo9=mGD();Object.defineProperty(Q7H,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return wo9.convertLegacyOtlpGrpcOptions}});var Zo9=pGD();Object.defineProperty(Q7H,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return Zo9.createOtlpGrpcExportDelegate}})});var lGD=z((iV$)=>{Object.defineProperty(iV$,"__esModule",{value:!0});iV$.OTLPMetricExporter=void 0;var qo9=c6$(),dGD=lV$(),To9=Eh();class cGD extends qo9.OTLPMetricExporterBase{constructor(H){super((0,dGD.createOtlpGrpcExportDelegate)((0,dGD.convertLegacyOtlpGrpcOptions)(H??{},"METRICS"),To9.ProtobufMetricsSerializer,"MetricsExportService","/opentelemetry.proto.collector.metrics.v1.MetricsService/Export"),H)}}iV$.OTLPMetricExporter=cGD});var iGD=z((nV$)=>{Object.defineProperty(nV$,"__esModule",{value:!0});nV$.OTLPMetricExporter=void 0;var zo9=lGD();Object.defineProperty(nV$,"OTLPMetricExporter",{enumerable:!0,get:function(){return zo9.OTLPMetricExporter}})});var E2A=z((oV$)=>{Object.defineProperty(oV$,"__esModule",{value:!0});oV$.PrometheusSerializer=void 0;var No9=kB(),b0H=Yo(),nGD=Kf();function aV$(H){return H.replace(/\\/g,"\\\\").replace(/\n/g,"\\n")}function rGD(H=""){if(typeof H!=="string")H=JSON.stringify(H);return aV$(H).replace(/"/g,"\\\"")}var Oo9=/[^a-z0-9_]/gi,xo9=/_{2,}/g;function f2A(H){return H.replace(Oo9,"_").replace(xo9,"_")}function B2A(H,$){if(!H.endsWith("_total")&&$.dataPointType===b0H.DataPointType.SUM&&$.isMonotonic)H=H+"_total";return H}function So9(H){if(H===1/0)return"+Inf";else if(H===-1/0)return"-Inf";else return`${H}`}function jo9(H){switch(H.dataPointType){case b0H.DataPointType.SUM:if(H.isMonotonic)return"counter";return"gauge";case b0H.DataPointType.GAUGE:return"gauge";case b0H.DataPointType.HISTOGRAM:return"histogram";default:return"untyped"}}function rV$(H,$,A,L,I){let D=!1,B="";for(let[f,E]of Object.entries($)){let M=f2A(f);D=!0,B+=`${B.length>0?",":""}${M}="${rGD(E)}"`}if(I)for(let[f,E]of Object.entries(I)){let M=f2A(f);D=!0,B+=`${B.length>0?",":""}${M}="${rGD(E)}"`}if(D)H+=`{${B}}`;return`${H} ${So9(A)}${L!==void 0?" "+String(L):""} `}}oV$.PrometheusSerializer=aGD});var oGD=z((tV$)=>{Object.defineProperty(tV$,"__esModule",{value:!0});tV$.PrometheusExporter=void 0;var ehH=kB(),yo9=Kf(),M2A=Yo(),vo9=require("http"),ho9=E2A(),bo9=require("url");class Mp extends M2A.MetricReader{static DEFAULT_OPTIONS={host:void 0,port:9464,endpoint:"/metrics",prefix:"",appendTimestamp:!1,withResourceConstantLabels:void 0,withoutTargetInfo:!1};_host;_port;_baseUrl;_endpoint;_server;_prefix;_appendTimestamp;_serializer;_startServerPromise;constructor(H={},$=()=>{}){super({aggregationSelector:(I)=>{return{type:M2A.AggregationType.DEFAULT}},aggregationTemporalitySelector:(I)=>M2A.AggregationTemporality.CUMULATIVE,metricProducers:H.metricProducers});this._host=H.host||process.env.OTEL_EXPORTER_PROMETHEUS_HOST||Mp.DEFAULT_OPTIONS.host,this._port=H.port||Number(process.env.OTEL_EXPORTER_PROMETHEUS_PORT)||Mp.DEFAULT_OPTIONS.port,this._prefix=H.prefix||Mp.DEFAULT_OPTIONS.prefix,this._appendTimestamp=typeof H.appendTimestamp==="boolean"?H.appendTimestamp:Mp.DEFAULT_OPTIONS.appendTimestamp;let A=H.withResourceConstantLabels||Mp.DEFAULT_OPTIONS.withResourceConstantLabels,L=H.withoutTargetInfo||Mp.DEFAULT_OPTIONS.withoutTargetInfo;if(this._server=(0,vo9.createServer)(this._requestHandler).unref(),this._serializer=new ho9.PrometheusSerializer(this._prefix,this._appendTimestamp,A,L),this._baseUrl=`http://${this._host}:${this._port}/`,this._endpoint=(H.endpoint||Mp.DEFAULT_OPTIONS.endpoint).replace(/^([^/])/,"/$1"),H.preventServerStart!==!0)this.startServer().then($,(I)=>{ehH.diag.error(I),$(I)});else if($)queueMicrotask($)}async onForceFlush(){}onShutdown(){return this.stopServer()}stopServer(){if(!this._server)return ehH.diag.debug("Prometheus stopServer() was called but server was never started."),Promise.resolve();else return new Promise((H)=>{this._server.close(($)=>{if(!$)ehH.diag.debug("Prometheus exporter was stopped");else if($.code!=="ERR_SERVER_NOT_RUNNING")(0,yo9.globalErrorHandler)($);H()})})}startServer(){return this._startServerPromise??=new Promise((H,$)=>{this._server.once("error",$),this._server.listen({port:this._port,host:this._host},()=>{ehH.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`),H()})}),this._startServerPromise}getMetricsRequestHandler(H,$){this._exportMetrics($)}_requestHandler=(H,$)=>{if(H.url!=null&&new bo9.URL(H.url,this._baseUrl).pathname===this._endpoint)this._exportMetrics($);else this._notFound($)};_exportMetrics=(H)=>{H.statusCode=200,H.setHeader("content-type","text/plain"),this.collect().then(($)=>{let{resourceMetrics:A,errors:L}=$;if(L.length)ehH.diag.error("PrometheusExporter: metrics collection errors",...L);H.end(this._serializer.serialize(A))},($)=>{H.end(`# failed to export metrics: ${$}`)})};_notFound=(H)=>{H.statusCode=404,H.end()}}tV$.PrometheusExporter=Mp});var tGD=z((W7H)=>{Object.defineProperty(W7H,"__esModule",{value:!0});W7H.PrometheusSerializer=W7H.PrometheusExporter=void 0;var ko9=oGD();Object.defineProperty(W7H,"PrometheusExporter",{enumerable:!0,get:function(){return ko9.PrometheusExporter}});var uo9=E2A();Object.defineProperty(W7H,"PrometheusSerializer",{enumerable:!0,get:function(){return uo9.PrometheusSerializer}})});var sGD,eGD,sV$,V7H;var HUD=K(()=>{sGD=b(Lh(),1),eGD=b(Eh(),1),sV$=b(om(),1);V7H=class V7H extends sGD.OTLPExporterBase{constructor(H={}){super(sV$.createOtlpHttpExportDelegate(sV$.convertLegacyHttpOptions(H,"LOGS","v1/logs",{"Content-Type":"application/x-protobuf"}),eGD.ProtobufLogsSerializer))}}});var $UD=K(()=>{HUD()});var AUD=K(()=>{$UD()});var LUD=K(()=>{AUD()});var BUD=z((eV$)=>{Object.defineProperty(eV$,"__esModule",{value:!0});eV$.OTLPLogExporter=void 0;var IUD=lV$(),go9=Eh(),mo9=Lh();class DUD extends mo9.OTLPExporterBase{constructor(H={}){super((0,IUD.createOtlpGrpcExportDelegate)((0,IUD.convertLegacyOtlpGrpcOptions)(H,"LOGS"),go9.ProtobufLogsSerializer,"LogsExportService","/opentelemetry.proto.collector.logs.v1.LogsService/Export"))}}eV$.OTLPLogExporter=DUD});var fUD=z((HP$)=>{Object.defineProperty(HP$,"__esModule",{value:!0});HP$.OTLPLogExporter=void 0;var po9=BUD();Object.defineProperty(HP$,"OTLPLogExporter",{enumerable:!0,get:function(){return po9.OTLPLogExporter}})});var EUD,MUD,$P$,k0H;var GUD=K(()=>{EUD=b(Lh(),1),MUD=b(Eh(),1),$P$=b(om(),1);k0H=class k0H extends EUD.OTLPExporterBase{constructor(H={}){super($P$.createOtlpHttpExportDelegate($P$.convertLegacyHttpOptions(H,"LOGS","v1/logs",{"Content-Type":"application/json"}),MUD.JsonLogsSerializer))}}});var UUD=K(()=>{GUD()});var XUD=K(()=>{UUD()});var JUD=K(()=>{XUD()});var FUD="exception";class G2A{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:nY.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(H){let $=Date.now();if(this._spanContext=H.spanContext,this._performanceStartTime=FU.otperformance.now(),this._performanceOffset=$-(this._performanceStartTime+FU.getTimeOrigin()),this._startTimeProvided=H.startTime!=null,this._spanLimits=H.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=H.spanProcessor,this.name=H.name,this.parentSpanContext=H.parentSpanContext,this.kind=H.kind,this.links=H.links||[],this.startTime=this._getTime(H.startTime??$),this.resource=H.resource,this.instrumentationScope=H.scope,H.attributes!=null)this.setAttributes(H.attributes);this._spanProcessor.onStart(this,H.context)}spanContext(){return this._spanContext}setAttribute(H,$){if($==null||this._isSpanEnded())return this;if(H.length===0)return nY.diag.warn(`Invalid attribute key: ${H}`),this;if(!FU.isAttributeValue($))return nY.diag.warn(`Invalid attribute value set for key: ${H}`),this;let{attributeCountLimit:A}=this._spanLimits;if(A!==void 0&&Object.keys(this.attributes).length>=A&&!Object.prototype.hasOwnProperty.call(this.attributes,H))return this._droppedAttributesCount++,this;return this.attributes[H]=this._truncateToSize($),this}setAttributes(H){for(let[$,A]of Object.entries(H))this.setAttribute($,A);return this}addEvent(H,$,A){if(this._isSpanEnded())return this;let{eventCountLimit:L}=this._spanLimits;if(L===0)return nY.diag.warn("No events allowed."),this._droppedEventsCount++,this;if(L!==void 0&&this.events.length>=L){if(this._droppedEventsCount===0)nY.diag.debug("Dropping extra events.");this.events.shift(),this._droppedEventsCount++}if(FU.isTimeInput($)){if(!FU.isTimeInput(A))A=$;$=void 0}let I=FU.sanitizeAttributes($);return this.events.push({name:H,attributes:I,time:this._getTime(A),droppedAttributesCount:0}),this}addLink(H){return this.links.push(H),this}addLinks(H){return this.links.push(...H),this}setStatus(H){if(this._isSpanEnded())return this;if(this.status={...H},this.status.message!=null&&typeof H.message!=="string")nY.diag.warn(`Dropping invalid status.message of type '${typeof H.message}', expected 'string'`),delete this.status.message;return this}updateName(H){if(this._isSpanEnded())return this;return this.name=H,this}end(H){if(this._isSpanEnded()){nY.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}if(this._ended=!0,this.endTime=this._getTime(H),this._duration=FU.hrTimeDuration(this.startTime,this.endTime),this._duration[0]<0)nY.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0];if(this._droppedEventsCount>0)nY.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);this._spanProcessor.onEnd(this)}_getTime(H){if(typeof H==="number"&&H<=FU.otperformance.now())return FU.hrTime(H+this._performanceOffset);if(typeof H==="number")return FU.millisToHrTime(H);if(H instanceof Date)return FU.millisToHrTime(H.getTime());if(FU.isTimeInputHrTime(H))return H;if(this._startTimeProvided)return FU.millisToHrTime(Date.now());let $=FU.otperformance.now()-this._performanceStartTime;return FU.addHrTimes(this.startTime,FU.millisToHrTime($))}isRecording(){return this._ended===!1}recordException(H,$){let A={};if(typeof H==="string")A[qh.ATTR_EXCEPTION_MESSAGE]=H;else if(H){if(H.code)A[qh.ATTR_EXCEPTION_TYPE]=H.code.toString();else if(H.name)A[qh.ATTR_EXCEPTION_TYPE]=H.name;if(H.message)A[qh.ATTR_EXCEPTION_MESSAGE]=H.message;if(H.stack)A[qh.ATTR_EXCEPTION_STACKTRACE]=H.stack}if(A[qh.ATTR_EXCEPTION_TYPE]||A[qh.ATTR_EXCEPTION_MESSAGE])this.addEvent(FUD,A,$);else nY.diag.warn(`Failed to record an exception ${H}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let H=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);nY.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,H)}return this._ended}_truncateToLimitUtil(H,$){if(H.length<=$)return H;return H.substring(0,$)}_truncateToSize(H){let $=this._attributeValueLengthLimit;if($<=0)return nY.diag.warn(`Attribute value limit must be positive, got ${$}`),H;if(typeof H==="string")return this._truncateToLimitUtil(H,$);if(Array.isArray(H))return H.map((A)=>typeof A==="string"?this._truncateToLimitUtil(A,$):A);return H}}var nY,FU,qh;var KUD=K(()=>{nY=b(kB(),1),FU=b(Kf(),1),qh=b(rBH(),1)});var Gp;var AP$=K(()=>{(function(H){H[H.NOT_RECORD=0]="NOT_RECORD",H[H.RECORD=1]="RECORD",H[H.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Gp||(Gp={}))});class u0H{shouldSample(){return{decision:Gp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}var U2A=K(()=>{AP$()});class Up{shouldSample(){return{decision:Gp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}var X2A=K(()=>{AP$()});class P7H{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(H){if(this._root=H.root,!this._root)QUD.globalErrorHandler(Error("ParentBasedSampler must have a root sampler configured")),this._root=new Up;this._remoteParentSampled=H.remoteParentSampled??new Up,this._remoteParentNotSampled=H.remoteParentNotSampled??new u0H,this._localParentSampled=H.localParentSampled??new Up,this._localParentNotSampled=H.localParentNotSampled??new u0H}shouldSample(H,$,A,L,I,D){let B=g0H.trace.getSpanContext(H);if(!B||!g0H.isSpanContextValid(B))return this._root.shouldSample(H,$,A,L,I,D);if(B.isRemote){if(B.traceFlags&g0H.TraceFlags.SAMPLED)return this._remoteParentSampled.shouldSample(H,$,A,L,I,D);return this._remoteParentNotSampled.shouldSample(H,$,A,L,I,D)}if(B.traceFlags&g0H.TraceFlags.SAMPLED)return this._localParentSampled.shouldSample(H,$,A,L,I,D);return this._localParentNotSampled.shouldSample(H,$,A,L,I,D)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}var g0H,QUD;var WUD=K(()=>{U2A();X2A();g0H=b(kB(),1),QUD=b(Kf(),1)});class LP${_ratio;_upperBound;constructor(H=0){this._ratio=H,this._ratio=this._normalize(H),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(H,$){return{decision:VUD.isValidTraceId($)&&this._accumulate($)=1?1:H<=0?0:H}_accumulate(H){let $=0;for(let A=0;A>>0}return $}}var VUD;var PUD=K(()=>{AP$();VUD=b(kB(),1)});function BP$(){return{sampler:J2A(),forceFlushTimeoutMillis:30000,generalLimits:{attributeValueLengthLimit:Lz.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Lz.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:Lz.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function J2A(){let H=Lz.getStringFromEnv("OTEL_TRACES_SAMPLER")??Th.ParentBasedAlwaysOn;switch(H){case Th.AlwaysOn:return new Up;case Th.AlwaysOff:return new u0H;case Th.ParentBasedAlwaysOn:return new P7H({root:new Up});case Th.ParentBasedAlwaysOff:return new P7H({root:new u0H});case Th.TraceIdRatio:return new LP$(_UD());case Th.ParentBasedTraceIdRatio:return new P7H({root:new LP$(_UD())});default:return DP$.diag.error(`OTEL_TRACES_SAMPLER value "${H}" invalid, defaulting to "${Th.ParentBasedAlwaysOn}".`),new P7H({root:new Up})}}function _UD(){let H=Lz.getNumberFromEnv("OTEL_TRACES_SAMPLER_ARG");if(H==null)return DP$.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${IP$}.`),IP$;if(H<0||H>1)return DP$.diag.error(`OTEL_TRACES_SAMPLER_ARG=${H} was given, but it is out of range ([0..1]), defaulting to ${IP$}.`),IP$;return H}var DP$,Lz,Th,IP$=1;var F2A=K(()=>{U2A();X2A();WUD();PUD();DP$=b(kB(),1),Lz=b(Kf(),1);(function(H){H.AlwaysOff="always_off",H.AlwaysOn="always_on",H.ParentBasedAlwaysOff="parentbased_always_off",H.ParentBasedAlwaysOn="parentbased_always_on",H.ParentBasedTraceIdRatio="parentbased_traceidratio",H.TraceIdRatio="traceidratio"})(Th||(Th={}))});function YUD(H){let $={sampler:J2A()},A=BP$(),L=Object.assign({},A,$,H);return L.generalLimits=Object.assign({},A.generalLimits,H.generalLimits||{}),L.spanLimits=Object.assign({},A.spanLimits,H.spanLimits||{}),L}function CUD(H){let $=Object.assign({},H.spanLimits);return $.attributeCountLimit=H.spanLimits?.attributeCountLimit??H.generalLimits?.attributeCountLimit??HbH.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??HbH.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??do9,$.attributeValueLengthLimit=H.spanLimits?.attributeValueLengthLimit??H.generalLimits?.attributeValueLengthLimit??HbH.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??HbH.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??co9,Object.assign({},H,{spanLimits:$})}var HbH,do9=128,co9=1/0;var K2A=K(()=>{F2A();HbH=b(Kf(),1)});class Q2A{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(H,$){if(this._exporter=H,this._maxExportBatchSize=typeof $?.maxExportBatchSize==="number"?$.maxExportBatchSize:rY.getNumberFromEnv("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof $?.maxQueueSize==="number"?$.maxQueueSize:rY.getNumberFromEnv("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof $?.scheduledDelayMillis==="number"?$.scheduledDelayMillis:rY.getNumberFromEnv("OTEL_BSP_SCHEDULE_DELAY")??5000,this._exportTimeoutMillis=typeof $?.exportTimeoutMillis==="number"?$.exportTimeoutMillis:rY.getNumberFromEnv("OTEL_BSP_EXPORT_TIMEOUT")??30000,this._shutdownOnce=new rY.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)Xp.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}onStart(H,$){}onEnd(H){if(this._shutdownOnce.isCalled)return;if((H.spanContext().traceFlags&Xp.TraceFlags.SAMPLED)===0)return;this._addToBuffer(H)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>{return this.onShutdown()}).then(()=>{return this._flushAll()}).then(()=>{return this._exporter.shutdown()})}_addToBuffer(H){if(this._finishedSpans.length>=this._maxQueueSize){if(this._droppedSpansCount===0)Xp.diag.debug("maxQueueSize reached, dropping spans");this._droppedSpansCount++;return}if(this._droppedSpansCount>0)Xp.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0;this._finishedSpans.push(H),this._maybeStartTimer()}_flushAll(){return new Promise((H,$)=>{let A=[],L=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let I=0,D=L;I{H()}).catch($)})}_flushOneBatch(){if(this._clearTimer(),this._finishedSpans.length===0)return Promise.resolve();return new Promise((H,$)=>{let A=setTimeout(()=>{$(Error("Timeout"))},this._exportTimeoutMillis);Xp.context.with(rY.suppressTracing(Xp.context.active()),()=>{let L;if(this._finishedSpans.length<=this._maxExportBatchSize)L=this._finishedSpans,this._finishedSpans=[];else L=this._finishedSpans.splice(0,this._maxExportBatchSize);let I=()=>this._exporter.export(L,(B)=>{if(clearTimeout(A),B.code===rY.ExportResultCode.SUCCESS)H();else $(B.error??Error("BatchSpanProcessor: span export failed"))}),D=null;for(let B=0,f=L.length;B{rY.globalErrorHandler(B),$(B)})})})}_maybeStartTimer(){if(this._isExporting)return;let H=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{if(this._isExporting=!1,this._finishedSpans.length>0)this._clearTimer(),this._maybeStartTimer()}).catch(($)=>{this._isExporting=!1,rY.globalErrorHandler($)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return H();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>H(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}}var Xp,rY;var wUD=K(()=>{Xp=b(kB(),1),rY=b(Kf(),1)});var m0H;var ZUD=K(()=>{wUD();m0H=class m0H extends Q2A{onShutdown(){}}});class _7H{generateTraceId=qUD(16);generateSpanId=qUD(8)}function qUD(H){return function(){for(let A=0;A>>0,A*4);for(let A=0;A0)break;else if(A===H-1)fP$[H-1]=1;return fP$.toString("hex",0,H)}}var fP$;var TUD=K(()=>{fP$=Buffer.allocUnsafe(16)});var zUD=K(()=>{ZUD();TUD()});var W2A=K(()=>{zUD()});class V2A{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(H,$,A,L){let I=YUD($);this._sampler=I.sampler,this._generalLimits=I.generalLimits,this._spanLimits=I.spanLimits,this._idGenerator=$.idGenerator||new _7H,this._resource=A,this._spanProcessor=L,this.instrumentationScope=H}startSpan(H,$={},A=u4.context.active()){if($.root)A=u4.trace.deleteSpan(A);let L=u4.trace.getSpan(A);if(Y7H.isTracingSuppressed(A))return u4.diag.debug("Instrumentation suppressed, returning Noop Span"),u4.trace.wrapSpanContext(u4.INVALID_SPAN_CONTEXT);let I=L?.spanContext(),D=this._idGenerator.generateSpanId(),B,f,E;if(!I||!u4.trace.isSpanContextValid(I))f=this._idGenerator.generateTraceId();else f=I.traceId,E=I.traceState,B=I;let M=$.kind??u4.SpanKind.INTERNAL,G=($.links??[]).map((P)=>{return{context:P.context,attributes:Y7H.sanitizeAttributes(P.attributes)}}),U=Y7H.sanitizeAttributes($.attributes),X=this._sampler.shouldSample(A,f,H,M,U,G);E=X.traceState??E;let J=X.decision===u4.SamplingDecision.RECORD_AND_SAMPLED?u4.TraceFlags.SAMPLED:u4.TraceFlags.NONE,F={traceId:f,spanId:D,traceFlags:J,traceState:E};if(X.decision===u4.SamplingDecision.NOT_RECORD)return u4.diag.debug("Recording is off, propagating context in a non-recording span"),u4.trace.wrapSpanContext(F);let Q=Y7H.sanitizeAttributes(Object.assign(U,X.attributes));return new G2A({resource:this._resource,scope:this.instrumentationScope,context:A,spanContext:F,name:H,kind:M,links:G,parentSpanContext:B,attributes:Q,startTime:$.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(H,$,A,L){let I,D,B;if(arguments.length<2)return;else if(arguments.length===2)B=$;else if(arguments.length===3)I=$,B=A;else I=$,D=A,B=L;let f=D??u4.context.active(),E=this.startSpan(H,I,f),M=u4.trace.setSpan(f,E);return u4.context.with(M,B,void 0,E)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}var u4,Y7H;var NUD=K(()=>{KUD();K2A();W2A();u4=b(kB(),1),Y7H=b(Kf(),1)});class P2A{_spanProcessors;constructor(H){this._spanProcessors=H}forceFlush(){let H=[];for(let $ of this._spanProcessors)H.push($.forceFlush());return new Promise(($)=>{Promise.all(H).then(()=>{$()}).catch((A)=>{OUD.globalErrorHandler(A||Error("MultiSpanProcessor: forceFlush failed")),$()})})}onStart(H,$){for(let A of this._spanProcessors)A.onStart(H,$)}onEnd(H){for(let $ of this._spanProcessors)$.onEnd(H)}shutdown(){let H=[];for(let $ of this._spanProcessors)H.push($.shutdown());return new Promise(($,A)=>{Promise.all(H).then(()=>{$()},A)})}}var OUD;var xUD=K(()=>{OUD=b(Kf(),1)});class $bH{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(H={}){let $=SUD.merge({},BP$(),CUD(H));this._resource=$.resource??jUD.defaultResource(),this._config=Object.assign({},$,{resource:this._resource});let A=[];if(H.spanProcessors?.length)A.push(...H.spanProcessors);this._activeSpanProcessor=new P2A(A)}getTracer(H,$,A){let L=`${H}@${$||""}:${A?.schemaUrl||""}`;if(!this._tracers.has(L))this._tracers.set(L,new V2A({name:H,version:$,schemaUrl:A?.schemaUrl},this._config,this._resource,this._activeSpanProcessor));return this._tracers.get(L)}forceFlush(){let H=this._config.forceFlushTimeoutMillis,$=this._activeSpanProcessor._spanProcessors.map((A)=>{return new Promise((L)=>{let I,D=setTimeout(()=>{L(Error(`Span processor did not completed within timeout period of ${H} ms`)),I=p0H.timeout},H);A.forceFlush().then(()=>{if(clearTimeout(D),I!==p0H.timeout)I=p0H.resolved,L(I)}).catch((B)=>{clearTimeout(D),I=p0H.error,L(B)})})});return new Promise((A,L)=>{Promise.all($).then((I)=>{let D=I.filter((B)=>B!==p0H.resolved);if(D.length>0)L(D);else A()}).catch((I)=>L([I]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}var SUD,jUD,p0H;var RUD=K(()=>{NUD();F2A();xUD();K2A();SUD=b(Kf(),1),jUD=b(sQH(),1);(function(H){H[H.resolved=0]="resolved",H[H.timeout=1]="timeout",H[H.error=2]="error",H[H.unresolved=3]="unresolved"})(p0H||(p0H={}))});class EP${export(H,$){return this._sendSpans(H,$)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(H){return{resource:{attributes:H.resource.attributes},instrumentationScope:H.instrumentationScope,traceId:H.spanContext().traceId,parentSpanContext:H.parentSpanContext,traceState:H.spanContext().traceState?.serialize(),name:H.name,id:H.spanContext().spanId,kind:H.kind,timestamp:AbH.hrTimeToMicroseconds(H.startTime),duration:AbH.hrTimeToMicroseconds(H.duration),attributes:H.attributes,status:H.status,events:H.events,links:H.links}}_sendSpans(H,$){for(let A of H)console.dir(this._exportInfo(A),{depth:3});if($)return $({code:AbH.ExportResultCode.SUCCESS})}}var AbH;var yUD=K(()=>{AbH=b(Kf(),1)});var vUD=K(()=>{RUD();W2A();yUD()});var hUD,bUD,MP$,C7H;var kUD=K(()=>{hUD=b(Lh(),1),bUD=b(Eh(),1),MP$=b(om(),1);C7H=class C7H extends hUD.OTLPExporterBase{constructor(H={}){super(MP$.createOtlpHttpExportDelegate(MP$.convertLegacyHttpOptions(H,"TRACES","v1/traces",{"Content-Type":"application/x-protobuf"}),bUD.ProtobufTraceSerializer))}}});var uUD=K(()=>{kUD()});var gUD=K(()=>{uUD()});var mUD=K(()=>{gUD()});var cUD=z((GP$)=>{Object.defineProperty(GP$,"__esModule",{value:!0});GP$.OTLPTraceExporter=void 0;var pUD=lV$(),lo9=Eh(),io9=Lh();class dUD extends io9.OTLPExporterBase{constructor(H={}){super((0,pUD.createOtlpGrpcExportDelegate)((0,pUD.convertLegacyOtlpGrpcOptions)(H,"TRACES"),lo9.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}}GP$.OTLPTraceExporter=dUD});var lUD=z((UP$)=>{Object.defineProperty(UP$,"__esModule",{value:!0});UP$.OTLPTraceExporter=void 0;var no9=cUD();Object.defineProperty(UP$,"OTLPTraceExporter",{enumerable:!0,get:function(){return no9.OTLPTraceExporter}})});var iUD,nUD,XP$,d0H;var rUD=K(()=>{iUD=b(Lh(),1),nUD=b(Eh(),1),XP$=b(om(),1);d0H=class d0H extends iUD.OTLPExporterBase{constructor(H={}){super(XP$.createOtlpHttpExportDelegate(XP$.convertLegacyHttpOptions(H,"TRACES","v1/traces",{"Content-Type":"application/json"}),nUD.JsonTraceSerializer))}}});var aUD=K(()=>{rUD()});var oUD=K(()=>{aUD()});var tUD=K(()=>{oUD()});class _2A{error(H,...$){r(Error(H))}warn(H,...$){r(Error(H))}info(H,...$){return}debug(H,...$){return}verbose(H,...$){return}}var sUD=K(()=>{_$()});async function ao9(){let H=eG();if(H.error)throw N(`Metrics opt-out check failed: ${H.error}`),Error(`Auth error: ${H.error}`);let $={"Content-Type":"application/json","User-Agent":sG(),...H.headers};try{let L=await nA.get("https://api.anthropic.com/api/claude_code/organizations/metrics_enabled",{headers:$,timeout:5000});return N(`Metrics opt-out API response: enabled=${L.data.metrics_logging_enabled}, vcsLinking=${L.data.vcs_account_linking_enabled}`),{enabled:L.data.metrics_logging_enabled,vcsAccountLinkingEnabled:L.data.vcs_account_linking_enabled,hasError:!1}}catch(A){return N(`Failed to check metrics opt-out status: ${A instanceof Error?A.message:String(A)}`),r(A),{enabled:!1,vcsAccountLinkingEnabled:!1,hasError:!0}}}async function JP$(){try{return await oo9()}catch(H){return N("Metrics check failed, defaulting to disabled"),{enabled:!1,vcsAccountLinkingEnabled:!1,hasError:!0}}}var ro9=3600000,oo9;var Y2A=K(()=>{w1();wwH();_Q();E$();_$();oo9=zGH(ao9,ro9)});class w2A{endpoint;timeout;pendingExports=[];isShutdown=!1;constructor(H={}){this.endpoint="https://api.anthropic.com/api/claude_code/metrics",this.timeout=H.timeout||5000}async export(H,$){if(this.isShutdown){$({code:c0H.ExportResultCode.FAILED,error:Error("Exporter has been shutdown")});return}let A=this.doExport(H,$);this.pendingExports.push(A),A.finally(()=>{let L=this.pendingExports.indexOf(A);if(L>-1)this.pendingExports.splice(L,1)})}async doExport(H,$){try{if(!(XG(!0)||tI())){N("BigQuery metrics export: trust not established, skipping"),$({code:c0H.ExportResultCode.SUCCESS});return}if(!(await JP$()).enabled){N("Metrics export disabled by organization setting"),$({code:c0H.ExportResultCode.SUCCESS});return}let I=this.transformMetricsForInternal(H),D=eG();if(D.error){N(`Metrics export failed: ${D.error}`),$({code:c0H.ExportResultCode.FAILED,error:Error(D.error)});return}let B={"Content-Type":"application/json","User-Agent":sG(),...D.headers},f=await nA.post(this.endpoint,I,{timeout:this.timeout,headers:B});N("BigQuery metrics exported successfully"),N(`BigQuery API Response: ${yH(f.data,null,2)}`),$({code:c0H.ExportResultCode.SUCCESS})}catch(A){N(`BigQuery metrics export failed: ${A instanceof Error?A.message:String(A)}`),r(A),$({code:c0H.ExportResultCode.FAILED,error:A instanceof Error?A:Error("Unknown export error")})}}transformMetricsForInternal(H){let $=H.resource.attributes,A={"service.name":$["service.name"]||"claude-code","service.version":$["service.version"]||"unknown","os.type":$["os.type"]||"unknown","os.version":$["os.version"]||"unknown","host.arch":$["host.arch"]||"unknown","aggregation.temporality":this.selectAggregationTemporality()===C2A.AggregationTemporality.DELTA?"delta":"cumulative"};if($["wsl.version"])A["wsl.version"]=$["wsl.version"];if(nL()){A["user.customer_type"]="claude_ai";let I=f0();if(I)A["user.subscription_type"]=I}else A["user.customer_type"]="api";return{resource_attributes:A,metrics:H.scopeMetrics.flatMap((I)=>I.metrics.map((D)=>({name:D.descriptor.name,description:D.descriptor.description,unit:D.descriptor.unit,data_points:this.extractDataPoints(D)})))}}extractDataPoints(H){return(H.dataPoints||[]).filter((A)=>typeof A.value==="number").map((A)=>({attributes:this.convertAttributes(A.attributes),value:A.value,timestamp:this.hrTimeToISOString(A.endTime||A.startTime||[Date.now()/1000,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),N("BigQuery metrics exporter shutdown complete")}async forceFlush(){await Promise.all(this.pendingExports),N("BigQuery metrics exporter flush complete")}convertAttributes(H){let $={};if(H){for(let[A,L]of Object.entries(H))if(L!==void 0&&L!==null)$[A]=String(L)}return $}hrTimeToISOString(H){let[$,A]=H;return new Date($*1000+A/1e6).toISOString()}selectAggregationTemporality(){return C2A.AggregationTemporality.DELTA}}var C2A,c0H;var eUD=K(()=>{w1();E$();_$();_Q();Y2A();EI();vA();g$();Z$();C2A=b(Yo(),1),c0H=b(Kf(),1)});var z2A={};XA(z2A,{isTelemetryEnabled:()=>FP$,initializeTelemetry:()=>It9,flushTelemetry:()=>Dt9,bootstrapTelemetry:()=>f4D});function f4D(){if(!process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE)process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="delta"}function so9(){let H=(process.env.OTEL_METRICS_EXPORTER||"").trim().split(",").filter(Boolean),$=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||to9.toString()),A=[];for(let L of H)if(L==="console"){let I=new LbH.ConsoleMetricExporter,D=I.export.bind(I);I.export=(B,f)=>{if(B.resource&&B.resource.attributes)N(` `);return D(B,f)},A.push(I)}else if(L==="otlp"){let I=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),D=T2A();switch(I){case"grpc":A.push(new H4D.OTLPMetricExporter);break;case"http/json":A.push(new $4D.OTLPMetricExporter(D));break;case"http/protobuf":A.push(new jWH(D));break;default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${I}`)}}else if(L==="prometheus")A.push(new A4D.PrometheusExporter);else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${L}`);return A.map((L)=>{if("export"in L)return new q2A.PeriodicExportingMetricReader({exporter:L,exportIntervalMillis:$});return L})}function eo9(){let H=(process.env.OTEL_LOGS_EXPORTER||"").trim().split(",").filter(Boolean),$=[];for(let A of H)if(A==="console")$.push(new lW$);else if(A==="otlp"){let L=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),I=T2A();switch(L){case"grpc":$.push(new L4D.OTLPLogExporter);break;case"http/json":$.push(new k0H(I));break;case"http/protobuf":$.push(new V7H(I));break;default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${L}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${A}`);return $}function Ht9(){let H=(process.env.OTEL_TRACES_EXPORTER||"").trim().split(",").filter(Boolean),$=[];for(let A of H)if(A==="console")$.push(new EP$);else if(A==="otlp"){let L=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),I=T2A();switch(L){case"grpc":$.push(new I4D.OTLPTraceExporter);break;case"http/json":$.push(new d0H(I));break;case"http/protobuf":$.push(new C7H(I));break;default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${L}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${A}`);return $}function FP$(){return A$(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function $t9(){let H=new w2A;return new q2A.PeriodicExportingMetricReader({exporter:H,exportIntervalMillis:300000})}function At9(){let H=f0(),$=nL()&&(H==="enterprise"||H==="team");return EmL()||$}function Lt9(H){let $=process.env.BETA_TRACING_ENDPOINT;if(!$)return;let A={url:`${$}/v1/traces`},L={url:`${$}/v1/logs`},I=new d0H(A),D=new m0H(I,{scheduledDelayMillis:B4D}),B=new $bH({resource:H,spanProcessors:[D]});l0H.trace.setGlobalTracerProvider(B),llH(B);let f=new k0H(L),E=new $0H({resource:H,processors:[new lm(f,{scheduledDelayMillis:D4D})]});fvH.setGlobalLoggerProvider(E),plH(E);let M=fvH.getLogger("com.anthropic.claude_code.events",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION);dlH(M),process.on("beforeExit",async()=>{await E?.forceFlush(),await B?.forceFlush()}),process.on("exit",()=>{E?.forceFlush(),B?.forceFlush()})}function It9(){_0("telemetry_init_start"),f4D(),l0H.diag.setLogger(new _2A,l0H.DiagLogLevel.ERROR),WhI();let H=[];if(FP$())H.push(...so9());if(At9())H.push($t9());let $=oA(),A={[lo.ATTR_SERVICE_NAME]:"claude-code",[lo.ATTR_SERVICE_VERSION]:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION};if($==="wsl"){let X=U$H();if(X)A["wsl.version"]=X}let L=WS.resourceFromAttributes(A),I=WS.resourceFromAttributes(WS.osDetector.detect().attributes||{}),D=WS.hostDetector.detect(),B=D.attributes?.[lo.SEMRESATTRS_HOST_ARCH]?{[lo.SEMRESATTRS_HOST_ARCH]:D.attributes[lo.SEMRESATTRS_HOST_ARCH]}:{},f=WS.resourceFromAttributes(B),E=WS.resourceFromAttributes(WS.envDetector.detect().attributes||{}),M=L.merge(I).merge(f).merge(E);if(zF()){Lt9(M);let X=new LbH.MeterProvider({resource:M,views:[],readers:H});return clH(X),PB(async()=>{let F=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||"2000");try{jyH();let Q=bYH(),W=WHH(),P=[];if(Q)P.push(Q.forceFlush());if(W)P.push(W.forceFlush());await Promise.all(P);let C=[X.shutdown()];if(Q)C.push(Q.shutdown());if(W)C.push(W.shutdown());await Promise.race([Promise.all(C),new Promise((Y,Z)=>setTimeout(()=>Z(Error("OpenTelemetry shutdown timeout")),F))])}catch{}}),X.getMeter("com.anthropic.claude_code",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)}let G=new LbH.MeterProvider({resource:M,views:[],readers:H});if(clH(G),FP$()){let X=eo9();if(X.length>0){let J=new $0H({resource:M,processors:X.map((Q)=>new lm(Q,{scheduledDelayMillis:parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||D4D.toString())}))});fvH.setGlobalLoggerProvider(J),plH(J);let F=fvH.getLogger("com.anthropic.claude_code.events",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION);dlH(F),process.on("beforeExit",async()=>{await J?.forceFlush(),await WHH()?.forceFlush()}),process.on("exit",()=>{J?.forceFlush(),WHH()?.forceFlush()})}}if(FP$()&&p6A()){let X=Ht9();if(X.length>0){let J=X.map((Q)=>new m0H(Q,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||B4D.toString())})),F=new $bH({resource:M,spanProcessors:J});l0H.trace.setGlobalTracerProvider(F),llH(F)}}return PB(async()=>{let X=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||"2000");try{jyH();let J=[G.shutdown()],F=bYH();if(F)J.push(F.shutdown());let Q=WHH();if(Q)J.push(Q.shutdown());await Promise.race([Promise.all(J),new Promise((W,P)=>setTimeout(()=>P(Error("OpenTelemetry shutdown timeout")),X))])}catch(J){if(J instanceof Error&&J.message.includes("timeout"))N(` `,{level:"error"});throw J}}),G.getMeter("com.anthropic.claude_code",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)}async function Dt9(){let H=Hj$();if(!H)return;let $=parseInt(process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS||"5000");try{let A=[H.forceFlush()],L=bYH();if(L)A.push(L.forceFlush());let I=WHH();if(I)A.push(I.forceFlush());await Promise.race([Promise.all(A),new Promise((D,B)=>setTimeout(()=>B(Error("OpenTelemetry flush timeout")),$))]),N("Telemetry flushed successfully")}catch(A){if(A instanceof Error&&A.message.includes("timeout"))N(`Telemetry flush timed out after ${$}ms. Some metrics may not be exported.`,{level:"warn"});else N(`Telemetry flush failed: ${A instanceof Error?A.message:String(A)}`,{level:"error"})}}function Bt9(){let H={},$=process.env.OTEL_EXPORTER_OTLP_HEADERS;if($)for(let A of $.split(",")){let[L,...I]=A.split("=");if(L&&I.length>0)H[L.trim()]=I.join("=").trim()}return H}function T2A(){let H=Ku(),$=sN(),A=VL(),L={},I=Bt9();if(A?.otelHeadersHelper)L.headers=async()=>{let f=GmL();return{...I,...f}};else if(Object.keys(I).length>0)L.headers=async()=>I;let D=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!H||D&&JqH(D)){if($)L.httpAgentOptions=$;return L}let B=(f)=>{return $?new Z2A.HttpsProxyAgent(H,{cert:$.cert,key:$.key,passphrase:$.passphrase}):new Z2A.HttpsProxyAgent(H)};return L.httpAgentOptions=B,L}var l0H,LbH,H4D,$4D,A4D,q2A,L4D,I4D,WS,lo,Z2A,to9=60000,D4D=5000,B4D=5000;var N2A=K(()=>{qVA();H1D();IPA();LUD();JUD();vUD();mUD();tUD();sUD();eUD();ZE();nR();EI();g$();Lo();OK$();Z9();EI();mL();E$();hc();H4H();NA();Z$();SyH();l0H=b(kB(),1),LbH=b(Yo(),1),H4D=b(iGD(),1),$4D=b(c6$(),1),A4D=b(tGD(),1),q2A=b(Yo(),1),L4D=b(fUD(),1),I4D=b(lUD(),1),WS=b(sQH(),1),lo=b(rBH(),1),Z2A=b(UqH(),1)});var E4D={};XA(E4D,{performLogout:()=>KP$,clearAuthRelatedCaches:()=>IbH,call:()=>ft9});async function KP$({clearOnboarding:H=!1}){let{flushTelemetry:$}=await Promise.resolve().then(() => (N2A(),z2A));await $(),await BmL(),hW().delete(),IbH(),AA((L)=>{let I={...L};if(H){if(I.hasCompletedOnboarding=!1,I.subscriptionNoticeCount=0,I.hasAvailableSubscription=!1,I.customApiKeyResponses?.approved)I.customApiKeyResponses={...I.customApiKeyResponses,approved:[]}}return I.oauthAccount=void 0,I})}async function ft9(){await KP$({clearOnboarding:!0});let H=O2A.createElement(V,null,"Successfully logged out from your Anthropic account.");return setTimeout(()=>{L9(0,"logout")},200),H}var O2A,IbH=()=>{dD.cache?.clear?.(),CeH(),nm.cache?.clear?.(),M4D(),Wo.cache?.clear?.(),CPA(),r4A()};var QP$=K(()=>{vA();xH();EI();KeH();$q();ELH();UU();DWH();zvH();XY();SD();O2A=b(s(),1)});class DbH{codeVerifier;authCodeListener=null;port=null;manualAuthCodeResolver=null;constructor(){this.codeVerifier=XrI()}async startOAuthFlow(H,$){this.authCodeListener=new _VA,this.port=await this.authCodeListener.start();let A=JrI(this.codeVerifier),L=FrI(),I={codeChallenge:A,state:L,port:this.port,loginWithClaudeAi:$?.loginWithClaudeAi,inferenceOnly:$?.inferenceOnly,orgUUID:$?.orgUUID},D=sd$({...I,isManual:!0}),B=sd$({...I,isManual:!1}),f=await this.waitForAuthorizationCode(L,async()=>{await H(D),await HE(B)}),E=this.authCodeListener?.hasPendingResponse()??!1;c("tengu_oauth_auth_code_received",{automatic:E});try{let M=await d1L(f,L,this.codeVerifier,this.port,!E,$?.expiresIn);await KP$({clearOnboarding:!1});let G=await ed$(M.access_token);if(M.account)Hc$({accountUuid:M.account.uuid,emailAddress:M.account.email_address,organizationUuid:M.organization?.uuid,displayName:G.displayName,hasExtraUsageEnabled:G.hasExtraUsageEnabled??void 0,billingType:G.billingType??void 0,subscriptionCreatedAt:G.subscriptionCreatedAt});if(E){let U=VeH(M.scope);this.authCodeListener?.handleSuccessRedirect(U)}return this.formatTokens(M,G.subscriptionType,G.rateLimitTier)}catch(M){if(E)this.authCodeListener?.handleErrorRedirect();throw M}finally{this.authCodeListener?.close()}}async waitForAuthorizationCode(H,$){return new Promise((A,L)=>{this.manualAuthCodeResolver=A,this.authCodeListener?.waitForAuthorization(H,$).then((I)=>{this.manualAuthCodeResolver=null,A(I)}).catch((I)=>{this.manualAuthCodeResolver=null,L(I)})})}handleManualAuthCodeInput(H){if(this.manualAuthCodeResolver)this.manualAuthCodeResolver(H.authorizationCode),this.manualAuthCodeResolver=null,this.authCodeListener?.close()}formatTokens(H,$,A){return{accessToken:H.access_token,refreshToken:H.refresh_token,expiresAt:Date.now()+H.expires_in*1000,scopes:VeH(H.scope),subscriptionType:$,rateLimitTier:A}}cleanup(){this.authCodeListener?.close(),this.manualAuthCodeResolver=null}}var x2A=K(()=>{F3();UrI();KrI();Hq();QP$();z$()});async function Et9(){try{if(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY))return!0;return await nA.get("https://api.anthropic.com/api/hello",{timeout:5000,headers:{"Cache-Control":"no-cache"}}),!0}catch(H){if(!(H instanceof tsA))return!0;return H.code!=="EHOSTUNREACH"}}function S2A(){let[H,$]=WP$.useState(null);return WP$.useEffect(()=>{let A=!0;if(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return;let L=async()=>{if(!A)return;let D=await Et9();if(A)$(D)};L();let I=setInterval(L,Mt9);return()=>{A=!1,clearInterval(I)}},[]),{isConnected:H}}var WP$,Mt9=30000;var G4D=K(()=>{w1();NA();WP$=b(s(),1)});class w7H{activeOperations=new Set;lastUserActivityTime=0;lastCLIRecordedTime=Date.now();isCLIActive=!1;USER_ACTIVITY_TIMEOUT_MS=5000;static instance=null;static getInstance(){if(!w7H.instance)w7H.instance=new w7H;return w7H.instance}recordUserActivity(){if(!this.isCLIActive&&this.lastUserActivityTime!==0){let $=(Date.now()-this.lastUserActivityTime)/1000;if($>0){let A=mlH();if(A){let L=this.USER_ACTIVITY_TIMEOUT_MS/1000;if($0){let L=mlH();if(L)L.add(A,{type:"cli"})}this.lastCLIRecordedTime=$,this.isCLIActive=!1}}async trackOperation(H,$){this.startCLIActivity(H);try{return await $()}finally{this.endCLIActivity(H)}}getActivityStates(){return{isUserActive:(Date.now()-this.lastUserActivityTime)/1000{g$();BbH=w7H.getInstance()});function U4D(){let $=GB().spinnerVerbs;if(!$)return i0H;if($.mode==="replace")return $.verbs.length>0?$.verbs:i0H;return[...i0H,...$.verbs]}var i0H;var VP$=K(()=>{mL();i0H=["Accomplishing","Actioning","Actualizing","Architecting","Baking","Beaming","Beboppin'","Befuddling","Billowing","Blanching","Bloviating","Boogieing","Boondoggling","Booping","Bootstrapping","Brewing","Burrowing","Calculating","Canoodling","Caramelizing","Cascading","Catapulting","Cerebrating","Channeling","Channelling","Choreographing","Churning","Clauding","Coalescing","Cogitating","Combobulating","Composing","Computing","Concocting","Considering","Contemplating","Cooking","Crafting","Creating","Crunching","Crystallizing","Cultivating","Deciphering","Deliberating","Determining","Dilly-dallying","Discombobulating","Doing","Doodling","Drizzling","Ebbing","Effecting","Elucidating","Embellishing","Enchanting","Envisioning","Evaporating","Fermenting","Fiddle-faddling","Finagling","Flamb\xE9ing","Flibbertigibbeting","Flowing","Flummoxing","Fluttering","Forging","Forming","Frolicking","Frosting","Gallivanting","Galloping","Garnishing","Generating","Germinating","Gitifying","Grooving","Gusting","Harmonizing","Hashing","Hatching","Herding","Honking","Hullaballooing","Hyperspacing","Ideating","Imagining","Improvising","Incubating","Inferring","Infusing","Ionizing","Jitterbugging","Julienning","Kneading","Leavening","Levitating","Lollygagging","Manifesting","Marinating","Meandering","Metamorphosing","Misting","Moonwalking","Moseying","Mulling","Mustering","Musing","Nebulizing","Nesting","Newspapering","Noodling","Nucleating","Orbiting","Orchestrating","Osmosing","Perambulating","Percolating","Perusing","Philosophising","Photosynthesizing","Pollinating","Pondering","Pontificating","Pouncing","Precipitating","Prestidigitating","Processing","Proofing","Propagating","Puttering","Puzzling","Quantumizing","Razzle-dazzling","Razzmatazzing","Recombobulating","Reticulating","Roosting","Ruminating","Saut\xE9ing","Scampering","Schlepping","Scurrying","Seasoning","Shenaniganing","Shimmying","Simmering","Skedaddling","Sketching","Slithering","Smooshing","Sock-hopping","Spelunking","Spinning","Sprouting","Stewing","Sublimating","Swirling","Swooping","Symbioting","Synthesizing","Tempering","Thinking","Thundering","Tinkering","Tomfoolering","Topsy-turvying","Transfiguring","Transmuting","Twisting","Undulating","Unfurling","Unravelling","Vibing","Waddling","Wandering","Warping","Whatchamacalliting","Whirlpooling","Whirring","Whisking","Wibbling","Working","Wrangling","Zesting","Zigzagging"]});function io({todos:H,isStandalone:$=!1}){if(H.length===0)return null;let A=g4.createElement(g4.Fragment,null,H.map((L,I)=>{let D=L.status==="completed"?pH.checkboxOn:pH.checkboxOff;return g4.createElement(x,{key:I},g4.createElement(V,{dimColor:L.status==="completed"},D," "),g4.createElement(V,{bold:L.status==="in_progress",dimColor:L.status==="completed",strikethrough:L.status==="completed"},L.content))}));if($)return g4.createElement(x,{flexDirection:"column",marginTop:1,marginLeft:2},g4.createElement(x,null,g4.createElement(V,{bold:!0,dimColor:!0},"Todos"),g4.createElement(V,{dimColor:!0}," \xB7 ",g4.createElement(s$,{shortcut:"ctrl+t",action:"hide todos",bold:!0}))),A);return g4.createElement(x,{flexDirection:"column"},A)}var g4;var fbH=K(()=>{xH();jI();lB();g4=b(s(),1)});function PP$(H,$){let A=parseInt(H.id,10),L=parseInt($.id,10);if(!isNaN(A)&&!isNaN(L))return A-L;return H.id.localeCompare($.id)}function _P$({tasks:H,isStandalone:$=!1}){let A=J$((h)=>h.teamContext),L=J$((h)=>h.tasks),I=Object.values(L).some((h)=>b4(h)&&h.status==="running"),[,D]=uB.useState(0),{rows:B,columns:f}=QL(),E=B<=10?0:Math.min(10,Math.max(3,B-14)),M=new Set(H.filter((h)=>h.status==="completed").map((h)=>h.id)),G=Date.now();for(let h of M)if(!J4D.has(h))Z7H.set(h,G);for(let h of Z7H.keys())if(!M.has(h))Z7H.delete(h);if(J4D=M,uB.useEffect(()=>{if(Z7H.size===0)return;let h=Date.now(),p=1/0;for(let k of Z7H.values()){let n=k+X4D;if(n>h&&nD((k)=>k+1),p-h);return()=>clearTimeout(d)},[H]),!HU())return null;if(H.length===0)return null;let U={};if(dL()&&A?.teammates){for(let h of Object.values(A.teammates))if(h.color){let p=b5[h.color];if(p)U[h.name]=p}}let X={},J=new Set;if(dL()){for(let h of Object.values(L))if(b4(h)&&h.status==="running"){J.add(h.identity.agentName),J.add(h.identity.agentId);let p=h.progress?.recentActivities,d=(p&&kv(p))??h.progress?.lastActivity?.activityDescription;if(d)X[h.identity.agentName]=d,X[h.identity.agentId]=d}}let F=H.filter((h)=>h.status==="completed").length,Q=H.filter((h)=>h.status==="pending").length,W=H.length-F-Q,P=new Set(H.filter((h)=>h.status!=="completed").map((h)=>h.id)),C=[],Y=[];for(let h of H.filter((p)=>p.status==="completed")){let p=Z7H.get(h.id);if(p&&G-ph.status==="in_progress").sort(PP$),q=H.filter((h)=>h.status==="pending").sort((h,p)=>{let d=h.blockedBy.some((n)=>P.has(n)),k=p.blockedBy.some((n)=>P.has(n));if(d!==k)return d?1:-1;return PP$(h,p)}),O=[...C,...Z,...q,...Y],j=O.slice(0,E),u=O.slice(E),y="";if(u.length>0){let h=[],p=u.filter((n)=>n.status==="pending").length,d=u.filter((n)=>n.status==="in_progress").length,k=u.filter((n)=>n.status==="completed").length;if(d>0)h.push(`${d} in progress`);if(p>0)h.push(`${p} pending`);if(k>0)h.push(`${k} completed`);y=` \u2026 +${h.join(", ")}`}let g=uB.createElement(uB.Fragment,null,j.map((h)=>uB.createElement(Ut9,{key:h.id,task:h,ownerColor:h.owner?U[h.owner]:void 0,openBlockers:h.blockedBy.filter((p)=>P.has(p)),activity:h.owner?X[h.owner]:void 0,ownerActive:h.owner?J.has(h.owner):!1,columns:f})),E>0&&y&&uB.createElement(V,{dimColor:!0},y));if($)return uB.createElement(x,{flexDirection:"column",marginTop:1,marginLeft:2},uB.createElement(x,null,uB.createElement(V,{dimColor:!0},uB.createElement(V,{bold:!0},H.length)," tasks (",uB.createElement(V,{bold:!0},F)," done, ",W>0&&uB.createElement(uB.Fragment,null,uB.createElement(V,{bold:!0},W)," in progress, "),uB.createElement(V,{bold:!0},Q)," open)"),uB.createElement(V,{dimColor:!0}," \xB7 ",uB.createElement(s$,{shortcut:"ctrl+t",action:I?"show teammates":"hide tasks",bold:!0}))),g);return uB.createElement(x,{flexDirection:"column"},g)}function Gt9(H){switch(H){case"completed":return{icon:pH.tick,color:"success"};case"in_progress":return{icon:pH.squareSmallFilled,color:"claude"};case"pending":return{icon:pH.squareSmall,color:void 0}}}function F4D(H,$){if(GI(H)<=$)return H;let A=H;while(GI(A+"\u2026")>$&&A.length>0)A=A.slice(0,-1);return A+"\u2026"}function Ut9({task:H,ownerColor:$,openBlockers:A,activity:L,ownerActive:I,columns:D}){let B=H.status==="completed",f=H.status==="in_progress",E=A.length>0,{icon:M,color:G}=Gt9(H.status),U=f&&!E&&L,X=D>=60&&H.owner&&I,J=X?GI(` (@${H.owner})`):0,F=Math.max(15,D-15-J),Q=F4D(H.subject,F),W=Math.max(15,D-15),P=L?F4D(L,W):void 0;return uB.createElement(x,{flexDirection:"column"},uB.createElement(x,null,uB.createElement(V,{color:G},M," "),uB.createElement(V,{bold:f,strikethrough:B,dimColor:B||E},Q),X&&uB.createElement(V,{dimColor:!0}," (",$?uB.createElement(V,{color:$},"@",H.owner):`@${H.owner}`,")"),E&&uB.createElement(V,{dimColor:!0}," ",pH.pointerSmall," blocked by"," ",[...A].sort((C,Y)=>parseInt(C,10)-parseInt(Y,10)).map((C)=>`#${C}`).join(", "))),U&&P&&uB.createElement(x,null,uB.createElement(V,{dimColor:!0}," ",P,pH.ellipsis)))}var uB,X4D=30000,Z7H,J4D;var R2A=K(()=>{xH();jI();JG();pL();q7();BNH();lB();T8();OB();hx();DJ();uB=b(s(),1);Z7H=new Map,J4D=new Set});function wP$(){let H=J$((A)=>A.teamContext),[,$]=YP$.useState(0);if(YP$.useEffect(()=>{if(!HU()||H&&!tW(H))return;X7A();let A=null,L=null,I=null,D=null;function B(){let U=sW(),X=GF(U).filter((F)=>!F.metadata?._internal);q7H=X;let J=X.some((F)=>F.status!=="completed");if(J||X.length===0){if(n0H=null,A)clearTimeout(A),A=null}else if(n0H===null)n0H=Date.now(),A=setTimeout(()=>{let F=GF(U);if(F.length>0&&F.every((W)=>W.status==="completed"))m9$(U),q7H=[],n0H=null;$((W)=>W+1)},K4D);if($((F)=>F+1),I)clearTimeout(I),I=null;if(J)I=setTimeout(f,Jt9)}function f(){if(L)clearTimeout(L);L=setTimeout(B,Xt9)}B();let E=soL(f),M=sW(),G=jq(M);if(CP$.existsSync(G))try{D=CP$.watch(G,f)}catch{}return()=>{if(q7H=void 0,n0H=null,E(),D)D.close();if(I)clearTimeout(I);if(L)clearTimeout(L);if(A)clearTimeout(A)}},[H]),!q7H||q7H.length===0)return;if(n0H!==null&&Date.now()-n0H>=K4D)return;return q7H}var YP$,CP$,K4D=5000,Xt9=50,Jt9=5000,n0H=null,q7H=void 0;var y2A=K(()=>{JG();jv();XE();pL();YP$=b(s(),1),CP$=require("fs")});function EbH(){if(process.env.TERM==="xterm-ghostty")return["\xB7","\u2722","\u2733","\u2736","\u273B","*"];return["\xB7","\u2722","*","\u2736","\u273B","\u273D"]}function Jp(H,$,A){return{r:Math.round(H.r+($.r-H.r)*A),g:Math.round(H.g+($.g-H.g)*A),b:Math.round(H.b+($.b-H.b)*A)}}function no(H){return`rgb(${H.r},${H.g},${H.b})`}function r0H(H){let $=Q4D.get(H);if($!==void 0)return $;let A=H.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/),L=A?{r:parseInt(A[1],10),g:parseInt(A[2],10),b:parseInt(A[3],10)}:null;return Q4D.set(H,L),L}var Q4D;var T7H=K(()=>{Q4D=new Map});var Ft9;var W4D=K(()=>{xH();Ky();T7H();Ft9=b(s(),1)});function h2A({char:H,index:$,glimmerIndex:A,messageColor:L,shimmerColor:I}){let D=$===A,B=Math.abs($-A)===1;return v2A.createElement(V,{color:D||B?I:L},H)}var v2A;var ZP$=K(()=>{xH();v2A=b(s(),1)});function b2A({message:H,mode:$,isConnected:A,messageColor:L,glimmerIndex:I,flashOpacity:D,shimmerColor:B,stalledIntensity:f=0}){let[E]=_I(),M=c6(E);if(!H)return null;if(A===!1)return gB.createElement(V,{color:L},H," ");if(f>0){let Q=M[L],W=Q?r0H(Q):null;if(W){let C=Jp(W,Kt9,f),Y=no(C);return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:Y},H),gB.createElement(V,{color:Y}," "))}let P=f>0.5?"error":L;return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:P},H),gB.createElement(V,{color:P}," "))}if($==="tool-use"){let Q=M[L],W=M[B],P=Q?r0H(Q):null,C=W?r0H(W):null;if(P&&C){let Z=Jp(P,C,D);return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:no(Z)},H),gB.createElement(V,{color:L}," "))}let Y=D>0.5?B:L;return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:Y},H),gB.createElement(V,{color:L}," "))}let G=I-1,U=I+1;if(G>=H.length||U<0)return gB.createElement(gB.Fragment,null,gB.createElement(V,{color:L},H),gB.createElement(V,{color:L}," "));let X=G>0?H.slice(0,G):"",J=H.slice(Math.max(0,G),U+1),F=U+1{xH();Ky();T7H();gB=b(s(),1),Kt9={r:171,g:43,b:63}});function MbH({frame:H,messageColor:$,stalledIntensity:A=0,isConnected:L,reducedMotion:I=!1,time:D=0}){let[B]=_I(),f=c6(B);if(I){let M=Math.floor(D/(Wt9/2))%2===1;return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:$,dimColor:M},Qt9))}let E=_4D[H%_4D.length];if(L===!1)return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:$},E));if(A>0){let M=f[$],G=M?r0H(M):null;if(G){let X=Jp(G,Vt9,A);return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:no(X)},E))}let U=A>0.5?"error":$;return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:U},E))}return ZJ.createElement(x,{flexWrap:"wrap",height:1,width:2},ZJ.createElement(V,{color:$},E))}var ZJ,P4D,_4D,Qt9="\u25CF",Wt9=2000,Vt9;var k2A=K(()=>{xH();Ky();T7H();ZJ=b(s(),1),P4D=EbH(),_4D=[...P4D,...[...P4D].reverse()],Vt9={r:171,g:43,b:63}});function GbH(H,$,A,L){let I=H==="requesting"?50:200,[D,B]=DT(I);if(A===!1||L)return[D,-100];let f=Math.floor(B/I),E=$.length+20;if(H==="requesting")return[D,f%E-10];return[D,$.length+10-f%E]}var qP$=K(()=>{xH()});function u2A(H,$,A=!1,L=!1){let I=z7H.useRef(H),D=z7H.useRef($),B=z7H.useRef(H),f=z7H.useRef(0),E=z7H.useRef(H);if($>D.current)I.current=H,D.current=$,f.current=0,E.current=H;let M;if(A)M=0,I.current=H;else if($>0)M=H-I.current;else M=H-B.current;let G=M>3000&&!A,U=G?Math.min((M-3000)/2000,1):0;if(!L&&(U>0||f.current>0)){let J=H-E.current;if(J>=50){let F=Math.floor(J/50),Q=f.current;for(let W=0;W{z7H=b(s(),1)});var C4D=K(()=>{W4D();ZP$();V4D();k2A();qP$();Y4D();T7H()});function _w(H,$){return`${H}@${$}`}function a0H(H){let $=H.indexOf("@");if($===-1)return null;return{agentName:H.slice(0,$),teamName:H.slice($+1)}}function N7H(H,$){let A=Date.now();return`${H}-${A}@${$}`}function w4D(H){return H.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()}function TP$(H){return ro.join(P6(),w4D(H))}function yF(H){let $=ro.join(TP$(H),"config.json");if(!Kp.existsSync($))return null;try{let A=Kp.readFileSync($,"utf-8");return DA(A)}catch(A){return N(`[TeammateTool] Failed to read team file for ${H}: ${A instanceof Error?A.message:String(A)}`),null}}function UbH(H,$){let A=TP$(H);Kp.mkdirSync(A,{recursive:!0});let L=ro.join(A,"config.json");iL(L,yH($,null,2))}function O7H(H,$){let A=$.agentId||$.name;if(!A)return N("[TeammateTool] removeTeammateFromTeamFile called with no identifier"),!1;let L=yF(H);if(!L)return N(`[TeammateTool] Cannot remove teammate ${A}: failed to read team file for "${H}"`),!1;let I=L.members.length;if(L.members=L.members.filter((D)=>{if($.agentId&&D.agentId===$.agentId)return!1;if($.name&&D.name===$.name)return!1;return!0}),L.members.length===I)return N(`[TeammateTool] Teammate ${A} not found in team file for "${H}"`),!1;return UbH(H,L),N(`[TeammateTool] Removed teammate from team file: ${A}`),!0}function Pt9(H){return yF(H)?.hiddenPaneIds??[]}function Z4D(H,$){return Pt9(H).includes($)}function q4D(H,$){let A=yF(H);if(!A)return!1;let L=A.members.findIndex((I)=>I.tmuxPaneId===$);if(L===-1)return!1;if(A.members.splice(L,1),A.hiddenPaneIds){let I=A.hiddenPaneIds.indexOf($);if(I!==-1)A.hiddenPaneIds.splice(I,1)}return UbH(H,A),N(`[TeammateTool] Removed member with pane ${$} from team ${H}`),!0}function T4D(H,$){let A=yF(H);if(!A)return!1;let L=A.members.findIndex((I)=>I.agentId===$);if(L===-1)return!1;return A.members.splice(L,1),UbH(H,A),N(`[TeammateTool] Removed member ${$} from team ${H}`),!0}function XbH(H,$,A){let L=yF(H);if(!L)return!1;let I=L.members.find((B)=>B.name===$);if(!I)return N(`[TeammateTool] Cannot set member mode: member ${$} not found in team ${H}`),!1;if(I.mode===A)return!0;let D=L.members.map((B)=>B.name===$?{...B,mode:A}:B);return UbH(H,{...L,members:D}),N(`[TeammateTool] Set member ${$} in team ${H} to mode: ${A}`),!0}function z4D(H,$){if(!tf())return;let A=$??g9(),L=g1();if(A&&L)XbH(A,L,H)}function N4D(H,$){let A=yF(H);if(!A)return!1;let L=new Map($.map((B)=>[B.memberName,B.mode])),I=!1,D=A.members.map((B)=>{let f=L.get(B.name);if(f!==void 0&&B.mode!==f)return I=!0,{...B,mode:f};return B});if(I)UbH(H,{...A,members:D}),N(`[TeammateTool] Set ${$.length} member modes in team ${H}`);return!0}async function zP$(H,$,A){let L=TP$(H),I=ro.join(L,"config.json"),D;try{let f=await Fp.readFile(I,"utf-8");D=DA(f)}catch{N(`[TeammateTool] Cannot set member active: team ${H} not found`);return}let B=D.members.find((f)=>f.name===$);if(!B){N(`[TeammateTool] Cannot set member active: member ${$} not found in team ${H}`);return}if(B.isActive===A)return;B.isActive=A,await Fp.mkdir(L,{recursive:!0}),await Fp.writeFile(I,yH(D,null,2)),N(`[TeammateTool] Set member ${$} in team ${H} to ${A?"active":"idle"}`)}async function _t9(H){let $=ro.join(H,".git"),A=null;try{let I=Kp.readFileSync($,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(I&&I[1]){let D=I[1],B=ro.join(D,"..","..");A=ro.join(B,"..")}}catch{}if(A){let L=await pD(cB(),["worktree","remove","--force",H],{cwd:A});if(L.code===0){N(`[TeammateTool] Removed worktree via git: ${H}`);return}if(L.stderr?.includes("not a working tree")){N(`[TeammateTool] Worktree already removed: ${H}`);return}N(`[TeammateTool] git worktree remove failed, falling back to rm: ${L.stderr}`)}try{Kp.rmSync(H,{recursive:!0,force:!0}),N(`[TeammateTool] Removed worktree directory manually: ${H}`)}catch(L){N(`[TeammateTool] Failed to remove worktree ${H}: ${L instanceof Error?L.message:String(L)}`)}}async function O4D(H){let $=w4D(H),A=yF(H),L=[];if(A){for(let B of A.members)if(B.worktreePath)L.push(B.worktreePath)}for(let B of L)await _t9(B);let I=TP$(H);try{await Fp.rm(I,{recursive:!0,force:!0}),N(`[TeammateTool] Cleaned up team directory: ${I}`)}catch(B){N(`[TeammateTool] Failed to clean up team directory ${I}: ${B instanceof Error?B.message:String(B)}`)}let D=jq($);try{await Fp.rm(D,{recursive:!0,force:!0}),N(`[TeammateTool] Cleaned up tasks directory: ${D}`),C5H()}catch(B){N(`[TeammateTool] Failed to clean up tasks directory ${D}: ${B instanceof Error?B.message:String(B)}`)}}var ro,Kp,Fp,zOE;var aY=K(()=>{mI();NA();Z$();E$();Z$();XE();B0();JG();t8();ro=require("path"),Kp=require("fs"),Fp=require("fs/promises"),zOE=S.strictObject({operation:S.enum(["spawnTeam","cleanup"]).describe("Operation: spawnTeam to create a team, cleanup to remove team and task directories."),agent_type:S.string().optional().describe('Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.'),team_name:S.string().optional().describe("Name for the new team to create (required for spawnTeam)."),description:S.string().optional().describe("Team description/purpose (only used with spawnTeam).")})});var x7H;var NP$=K(()=>{x7H=["Baked","Brewed","Churned","Cogitated","Cooked","Crunched","Saut\xE9ed","Worked"]});async function S7H(H,$){let{name:A,teamName:L,prompt:I,color:D,planModeRequired:B,model:f}=H,{setAppState:E}=$,M=_w(A,L),G=Zm("in_process_teammate");N(`[spawnInProcessTeammate] Spawning ${M} (taskId: ${G})`);try{let U=nD(),X=j$(),J={agentId:M,agentName:A,teamName:L,color:D,planModeRequired:B,parentSessionId:X},F=u9$({agentId:M,agentName:A,teamName:L,color:D,planModeRequired:B,parentSessionId:X,abortController:U});if(Om())jK$(M,A,X);let Q=`${A}: ${I.substring(0,50)}${I.length>50?"...":""}`,W=Z5H(L,{subject:A,description:I.substring(0,100),status:"in_progress",blocks:[],blockedBy:[],metadata:{_internal:!0}}),P={...wP(G,"in_process_teammate",Q),type:"in_process_teammate",status:"running",identity:J,prompt:I,model:f,abortController:U,awaitingPlanApproval:!1,spinnerVerb:QV(i0H),pastTenseVerb:QV(x7H),permissionMode:B?"plan":"default",isIdle:!1,shutdownRequested:!1,lastReportedToolCount:0,lastReportedTokenCount:0,pendingUserMessages:[],messages:[],localTaskId:W},C=PB(async()=>{N(`[spawnInProcessTeammate] Cleanup called for ${M}`),U.abort()});return P.unregisterCleanup=C,qP(P,E),N(`[spawnInProcessTeammate] Registered ${M} in AppState`),{success:!0,agentId:M,taskId:G,abortController:U,teammateContext:F}}catch(U){let X=U instanceof Error?U.message:"Unknown error during spawn";return N(`[spawnInProcessTeammate] Failed to spawn ${M}: ${X}`),{success:!1,agentId:M,error:X}}}function OP$(H,$){let A=!1,L=null,I=null;if($((D)=>{let B=D.tasks[H];if(!B||B.type!=="in_process_teammate")return D;let f=B;L=f.identity.teamName,I=f.identity.agentId,f.abortController.abort(),f.unregisterCleanup?.(),A=!0,f.onIdleCallbacks?.forEach((M)=>M());let E=D.teamContext;if(D.teamContext&&D.teamContext.teammates&&I){let{[I]:M,...G}=D.teamContext.teammates;E={...D.teamContext,teammates:G}}return{...D,teamContext:E,tasks:{...D.tasks,[H]:{...f,status:"killed",endTime:Date.now(),onIdleCallbacks:[]}}}}),L&&I)T4D(L,I);return A}var xP$=K(()=>{KBH();eE();h2();bx();ZE();E$();JG();g$();aY();SyH();yHH();VP$();NP$()});var x4D={};XA(x4D,{requestTeammateShutdown:()=>g2A,markTeammateIdle:()=>Ct9,markTeammateAwaitingPlanApproval:()=>Zt9,markTeammateActive:()=>wt9,injectUserMessageToTeammate:()=>m2A,getRunningTeammatesForTeam:()=>Nt9,getAllInProcessTeammateTasks:()=>Yw,findTeammateTaskByAgentId:()=>ao,failTeammateTask:()=>zt9,enqueueTeammateNotification:()=>Yt9,completeTeammateTask:()=>Tt9,clearTeammatePlanApproval:()=>qt9,appendTeammateMessage:()=>SP$,InProcessTeammateTask:()=>JbH});function Yt9(H,$,A,L,I){let D=$.agentName,B=A==="completed"?`Teammate "${D}" completed their task.`:A==="failed"?`Teammate "${D}" failed: ${L||"Unknown error"}`:A==="killed"?`Teammate "${D}" was stopped.`:`Teammate "${D}" is idle and ready for new work.`,f=vM(H),E=`<${G5}> `).filter((E)=>E.trim());for(let E=f.length-1;E>=0&&$.length<3;E--){let M=f[E];if(!M)continue;let G=M.length>A?M.slice(0,A-1)+"\u2026":M;$.push(G)}}}}return $.reverse()}function y4D(H,$){if(GI(H)<=$)return H;let A=H;while(GI(A+"\u2026")>$&&A.length>0)A=A.slice(0,-1);return A+"\u2026"}function v4D({teammate:H,isLast:$,isSelected:A,isForegrounded:L,allIdle:I,showPreview:D}){let[B]=R7H.useState(()=>H.spinnerVerb??QV(i0H)),[f]=R7H.useState(()=>H.pastTenseVerb??QV(x7H)),E=A||L,M=E?$?"\u2558\u2550":"\u255E\u2550":$?"\u2514\u2500":"\u251C\u2500",G=v7(H.identity.color),{columns:U}=QL(),X=R7H.useRef(null),J=R7H.useRef(null);if(H.isIdle&&X.current===null)X.current=Date.now();else if(!H.isIdle)X.current=null;if(!I&&J.current!==null)J.current=null;let F=j7H(X.current??Date.now(),H.isIdle&&!I);if(I&&J.current===null)J.current=of(Date.now()-H.startTime);let Q=I?J.current??(()=>{throw Error(`frozenDurationRef is null for idle teammate ${H.identity.agentName}`)})():F,W=8,P=`@${H.identity.agentName}`,C=GI(P),Y=H.progress?.toolUseCount??0,Z=H.progress?.tokenCount??0,q=` \xB7 ${Y} tool ${Y===1?"use":"uses"} \xB7 ${a0(Z)} tokens`,O=GI(q),j=` \xB7 ${KbH}`,u=GI(j),g=GI(" \xB7 enter to view"),h=25,p=U-W-C-2,d=U>=60&&p>=h,k=d?C+2:0,n=U-W-k,GH=A&&!L&&n>g+O+h+5,HH=E&&n>u+(GH?g:0)+O+h+5,BH=n>O+h+5,WH=(BH?O:0)+(HH?u:0)+(GH?g:0),wH=Math.max(h,n-WH-1),QH=(()=>{let KH=H.progress?.recentActivities;if(KH&&KH.length>0){let CH=kv(KH);if(CH)return y4D(CH,wH)}let MH=H.progress?.lastActivity?.activityDescription;if(MH)return y4D(MH,wH);return B})(),TH=()=>{if(H.shutdownRequested)return h8.createElement(V,{dimColor:!0},"[stopping]");if(H.awaitingPlanApproval)return h8.createElement(V,{color:"warning"},"[awaiting approval]");if(H.isIdle){if(I)return h8.createElement(V,{dimColor:!0},f," for ",Q);return h8.createElement(V,{dimColor:!0},"Idle for ",F)}if(E)return null;return h8.createElement(V,{dimColor:!0},QH?.endsWith("\u2026")?QH:`${QH}\u2026`)},t=D?Rt9(H.messages):[],IH=$?" ":"\u2502 ";return h8.createElement(x,{flexDirection:"column"},h8.createElement(x,{paddingLeft:3},h8.createElement(V,{color:A?"suggestion":void 0,bold:A},A?pH.pointer:" "),h8.createElement(V,{dimColor:!A},M," "),d&&h8.createElement(V,{color:A?"suggestion":G},"@",H.identity.agentName),d&&h8.createElement(V,{dimColor:!A},": "),TH(),BH&&h8.createElement(V,{dimColor:!0}," ","\xB7 ",Y," tool ",Y===1?"use":"uses"," \xB7"," ",a0(Z)," tokens"),HH&&h8.createElement(V,{dimColor:!0}," \xB7 ",KbH),GH&&h8.createElement(V,{dimColor:!0}," \xB7 enter to view")),t.map((KH,MH)=>h8.createElement(x,{key:MH,paddingLeft:3},h8.createElement(V,{dimColor:!0}," "),h8.createElement(V,{dimColor:!0},IH," "),h8.createElement(V,{dimColor:!0},KH))))}var h8,R7H;var h4D=K(()=>{jI();xH();yHH();Wp();Q9();NP$();RP$();Q9();DJ();hx();OB();VP$();h8=b(s(),1),R7H=b(s(),1)});function p2A({selectedIndex:H,isInSelectionMode:$,allIdle:A,leaderVerb:L,leaderTokenCount:I,leaderIdleText:D}){let B=J$((P)=>P.tasks),f=J$((P)=>P.viewingAgentTaskId),E=J$((P)=>P.showTeammateMessagePreview),M=void 0,G=Yw(B).filter((P)=>P.status==="running").sort((P,C)=>P.identity.agentName.localeCompare(C.identity.agentName));if(G.length===0)return null;let U=f===void 0,X=$&&H===-1,J=U||X,F="cyan_FOR_SUBAGENTS_ONLY",Q=$===!0&&H===G.length;return Af.createElement(x,{flexDirection:"column",marginTop:1},!!1&&Af.createElement(x,{paddingLeft:3},Af.createElement(V,{color:X?"suggestion":void 0,bold:J},X?pH.pointer:" "),Af.createElement(V,{dimColor:!J,bold:J},J?"\u2552\u2550":"\u250C\u2500"," "),Af.createElement(V,{bold:J,color:X?"suggestion":F},"team-lead"),!U&&L&&Af.createElement(V,{dimColor:!0},": ",L,"\u2026"),!U&&!L&&D&&Af.createElement(V,{dimColor:!0},": ",D),I!==void 0&&I>0&&Af.createElement(V,{dimColor:!J}," ","\xB7 ",a0(I)," tokens"),J&&Af.createElement(V,{dimColor:!0}," \xB7 ",KbH),X&&!U&&Af.createElement(V,{dimColor:!0}," \xB7 enter to view")),G.map((P,C)=>Af.createElement(v4D,{key:P.id,teammate:P,isLast:!$&&C===G.length-1,isSelected:$&&H===C,isForegrounded:f===P.id,allIdle:A,showPreview:E})),$&&Af.createElement(yt9,{isSelected:Q}))}function yt9({isSelected:H}){return Af.createElement(x,{paddingLeft:3},Af.createElement(V,{color:H?"suggestion":void 0,bold:H},H?pH.pointer:" "),Af.createElement(V,{dimColor:!H,bold:H},H?"\u2558\u2550":"\u2514\u2500"," "),Af.createElement(V,{dimColor:!H,bold:H},"hide"),H&&Af.createElement(V,{dimColor:!0}," \xB7 enter to collapse"))}var Af;var d2A=K(()=>{jI();xH();pL();Iz();Q9();h4D();Af=b(s(),1)});function u4D({mode:H,loadingStartTimeRef:$,totalPausedMsRef:A,pauseStartTimeRef:L,spinnerTip:I,responseLengthRef:D,overrideColor:B,overrideShimmerColor:f,overrideMessage:E,spinnerSuffix:M,verbose:G,todos:U,hasActiveTools:X=!1}){let[J,F]=DT(50),Q=L.current!==null?L.current-$.current-A.current:Date.now()-$.current-A.current,P=lQ().prefersReducedMotion??!1,C=J$((sA)=>sA.tasks),Y=J$((sA)=>sA.viewingAgentTaskId),Z=J$((sA)=>sA.expandedView),q=Z==="tasks",O=Z==="teammates",j=J$((sA)=>sA.selectedIPAgentIndex),u=J$((sA)=>sA.viewSelectionMode),y=Y?RT({viewingAgentTaskId:Y,tasks:C}):void 0,{isConnected:g}=S2A(),{columns:h}=QL(),p=wP$(),[d,k]=Cw.useState(null),n=Cw.useRef(null);Cw.useEffect(()=>{let sA=null,_D=null;if(H==="thinking"){if(n.current===null)n.current=Date.now(),k("thinking")}else if(n.current!==null){let M9=Date.now()-n.current,g8=Date.now()-n.current,v9=Math.max(0,2000-g8);n.current=null;let QI=()=>{k(M9),_D=setTimeout(()=>k(null),2000)};if(v9>0)sA=setTimeout(QI,v9);else QI()}return()=>{if(sA)clearTimeout(sA);if(_D)clearTimeout(_D)}},[H]);let GH=HU()?p?.find((sA)=>sA.status!=="pending"&&sA.status!=="completed"):U?.find((sA)=>sA.status==="in_progress"),HH=HU()?bt9(p):U?.find((sA)=>sA.status==="pending"),[BH]=Cw.useState(()=>QV(U4D())),WH=E??GH?.activeForm??BH,QH=(y&&!y.isIdle?y.spinnerVerb??BH:WH)+"\u2026",TH=D.current,{isStalled:t,stalledIntensity:IH}=u2A(F,TH,X,P),KH=P?0:g===!1?4:Math.floor(F/120),MH=H==="requesting"?50:200,CH=QH.length+20,OH=Math.floor(F/MH),LH=P?-100:g===!1||t?-100:H==="requesting"?OH%CH-10:QH.length+10-OH%CH,e=P?0:H==="tool-use"?(Math.sin(F/1000*Math.PI)+1)/2:0,DH=Cw.useRef(0);if(P)DH.current=TH;else{let sA=TH-DH.current;if(sA>0){let _D;if(sA<70)_D=3;else if(sA<200)_D=Math.max(8,Math.ceil(sA*0.15));else _D=50;DH.current=Math.min(DH.current+_D,TH)}}let EH=DH.current;Cw.useEffect(()=>{let sA="spinner-"+H;return BbH.startCLIActivity(sA),()=>{BbH.endCLIActivity(sA)}},[H]);let $H=GI(QH)+2,FH=d==="thinking"?"thinking":typeof d==="number"?`thought for ${Math.max(1,Math.round(d/1000))}s`:null,YH=FH?GI(FH):0,qH=Math.round(EH/4),bH=Yw(C).filter((sA)=>sA.status==="running"),hH=bH.length>0,PH=hH&&bH.every((sA)=>sA.isIdle),gH=0;if(!O){for(let sA of Object.values(C))if(b4(sA)&&sA.status==="running"){if(sA.progress?.tokenCount)gH+=sA.progress.tokenCount}}let vH=Cw.useRef(Date.now()-Q);Cw.useEffect(()=>{let sA=Date.now()-Q;if(!hH||sAK$(Date.now()-vH.current),hH?100:null);let KA=Cw.useRef(hH);if(KA.current&&!hH)vH.current=Date.now()-Q,K$(Q);KA.current=hH;let UA=hH?Math.max(Q,tH):Q,U$=of(UA),hA=GI(U$),iA=y&&!y.isIdle?y.progress?.tokenCount??0:qH+gH,rH=a0(iA),G$=hH?`${rH} tokens`:`${pH.arrowDown} ${rH} tokens`,b$=GI(G$),ZA=qH,n$=GI(" \xB7 "),fA=d!==null,UH=G||hH||UA>vt9,_H=h-$H-5,aH=fA&&_H>YH,f$=aH?YH+n$:0,I$=UH&&_H>f$+hA,$$=f$+(I$?hA+n$:0),e$=UH&&_H>$$+b$,x$=aH&&d==="thinking"&&!M&&!I$&&!e$,zA=[...M?[eL.createElement(V,{dimColor:!0,key:"suffix"},M)]:[],...I$?[eL.createElement(V,{dimColor:!0,key:"elapsedTime"},U$)]:[],...e$?[eL.createElement(x,{flexDirection:"row",key:"tokens"},!hH&&eL.createElement(ht9,{mode:H}),eL.createElement(V,{dimColor:!0},rH," tokens"))]:[],...aH&&FH?[d==="thinking"?eL.createElement(j4D,{key:"thinking",text:x$?`(${FH})`:FH}):eL.createElement(V,{dimColor:!0,key:"thinking"},FH)]:[]];if(g===!1)zA.push(eL.createElement(x,{key:"offline"},eL.createElement(V,{color:"error",bold:!0},"offline")));let gA=g===!1?"inactive":"claude",HI="claudeShimmer",AI=B??gA,qB=f??HI,RB=y&&!y.isIdle?eL.createElement(eL.Fragment,null,eL.createElement(V,{dimColor:!0},"(esc to interrupt "),eL.createElement(V,{color:v7(y.identity.color)},y.identity.agentName),eL.createElement(V,{dimColor:!0},")")):!y&&zA.length>0?x$?eL.createElement(rA,null,zA):eL.createElement(eL.Fragment,null,eL.createElement(V,{dimColor:!0},"("),eL.createElement(rA,null,zA),eL.createElement(V,{dimColor:!0},")")):null;if(y?.isIdle){let sA=PH?`${qzH} Worked for ${of(Date.now()-y.startTime)}`:`${qzH} Idle`;return eL.createElement(x,{flexDirection:"column",width:"100%",alignItems:"flex-start"},eL.createElement(x,{flexDirection:"row",flexWrap:"wrap",marginTop:1,width:"100%"},eL.createElement(V,{dimColor:!0},sA)),O&&hH&&eL.createElement(p2A,{selectedIndex:j,isInSelectionMode:u==="selecting-agent",allIdle:PH,leaderVerb:WH,leaderTokenCount:ZA}))}return eL.createElement(x,{ref:J,flexDirection:"column",width:"100%",alignItems:"flex-start"},eL.createElement(x,{flexDirection:"row",flexWrap:"wrap",marginTop:1,width:"100%"},eL.createElement(MbH,{frame:KH,messageColor:AI,stalledIntensity:B?0:IH,isConnected:g,reducedMotion:P,time:F}),eL.createElement(b2A,{message:QH,mode:H,isConnected:g,messageColor:AI,glimmerIndex:LH,flashOpacity:e,shimmerColor:qB,stalledIntensity:B?0:IH}),RB),O&&hH?eL.createElement(p2A,{selectedIndex:j,isInSelectionMode:u==="selecting-agent",allIdle:PH,leaderVerb:WH,leaderTokenCount:ZA}):q&&p&&p.length>0?eL.createElement(x,{width:"100%",flexDirection:"column"},eL.createElement(HA,null,eL.createElement(_P$,{tasks:p}))):q&&U&&U.length>0?eL.createElement(x,{width:"100%",flexDirection:"column"},eL.createElement(HA,null,eL.createElement(io,{todos:U}))):HH||I?eL.createElement(x,{width:"100%"},eL.createElement(HA,null,eL.createElement(V,{dimColor:!0},HH?`Next: ${"subject"in HH?HH.subject:HH.content}`:`Tip: ${I}`))):null)}function ht9({mode:H}){switch(H){case"tool-input":case"tool-use":case"responding":case"thinking":return eL.createElement(x,{width:2},eL.createElement(V,{dimColor:!0},pH.arrowDown));case"requesting":return eL.createElement(x,{width:2},eL.createElement(V,{dimColor:!0},pH.arrowUp))}}function vD(){let[H,$]=DT(120),{isConnected:A}=S2A(),I=lQ().prefersReducedMotion??!1,D=I?0:Math.floor($/120)%k4D.length,B=A===!1?"inactive":"text";if(I){let f=Math.floor($/1000)%2===1;return eL.createElement(x,{ref:H,flexWrap:"wrap",height:1,width:2},eL.createElement(V,{color:B,dimColor:f},"\u25CF"))}return eL.createElement(x,{ref:H,flexWrap:"wrap",height:1,width:2},eL.createElement(V,{color:B},k4D[D]))}function bt9(H){if(!H)return;let $=H.filter((L)=>L.status==="pending");if($.length===0)return;let A=new Set(H.filter((L)=>L.status!=="completed").map((L)=>L.id));return $.find((L)=>!L.blockedBy.some((I)=>A.has(I)))??$[0]}var eL,Cw,b4D,k4D,vt9=30000;var JM=K(()=>{xH();yHH();Q9();s6();jI();G4D();j2A();VP$();iB();fbH();R2A();y2A();JG();pL();OB();eB();C4D();um();Iz();UBH();Wp();p6();R4D();d2A();DJ();xH();eL=b(s(),1),Cw=b(s(),1),b4D=EbH(),k4D=[...b4D,...[...b4D].reverse()]});var QbH=z((y7H)=>{function kt9(H,$,A){if(A===void 0)A=Array.prototype;if(H&&typeof A.find==="function")return A.find.call(H,$);for(var L=0;L{var a4D=QbH(),zh=a4D.find,WbH=a4D.NAMESPACE;function gt9(H){return H!==""}function mt9(H){return H?H.split(/[\t\n\f\r ]+/).filter(gt9):[]}function pt9(H,$){if(!H.hasOwnProperty($))H[$]=!0;return H}function p4D(H){if(!H)return[];var $=mt9(H);return Object.keys($.reduce(pt9,{}))}function dt9(H){return function($){return H&&H.indexOf($)!==-1}}function PbH(H,$){for(var A in H)if(Object.prototype.hasOwnProperty.call(H,A))$[A]=H[A]}function tY(H,$){var A=H.prototype;if(!(A instanceof $)){let I=function(){};var L=I;I.prototype=$.prototype,I=new I,PbH(A,I),H.prototype=A=I}if(A.constructor!=H){if(typeof H!="function")console.error("unknown Class:"+H);A.constructor=H}}var sY={},VS=sY.ELEMENT_NODE=1,h7H=sY.ATTRIBUTE_NODE=2,yP$=sY.TEXT_NODE=3,o4D=sY.CDATA_SECTION_NODE=4,t4D=sY.ENTITY_REFERENCE_NODE=5,ct9=sY.ENTITY_NODE=6,s4D=sY.PROCESSING_INSTRUCTION_NODE=7,e4D=sY.COMMENT_NODE=8,H5D=sY.DOCUMENT_NODE=9,$5D=sY.DOCUMENT_TYPE_NODE=10,Pp=sY.DOCUMENT_FRAGMENT_NODE=11,lt9=sY.NOTATION_NODE=12,w3={},eQ={},BSE=w3.INDEX_SIZE_ERR=(eQ[1]="Index size error",1),fSE=w3.DOMSTRING_SIZE_ERR=(eQ[2]="DOMString size error",2),oY=w3.HIERARCHY_REQUEST_ERR=(eQ[3]="Hierarchy request error",3),ESE=w3.WRONG_DOCUMENT_ERR=(eQ[4]="Wrong document",4),MSE=w3.INVALID_CHARACTER_ERR=(eQ[5]="Invalid character",5),GSE=w3.NO_DATA_ALLOWED_ERR=(eQ[6]="No data allowed",6),USE=w3.NO_MODIFICATION_ALLOWED_ERR=(eQ[7]="No modification allowed",7),A5D=w3.NOT_FOUND_ERR=(eQ[8]="Not found",8),XSE=w3.NOT_SUPPORTED_ERR=(eQ[9]="Not supported",9),d4D=w3.INUSE_ATTRIBUTE_ERR=(eQ[10]="Attribute in use",10),JSE=w3.INVALID_STATE_ERR=(eQ[11]="Invalid state",11),FSE=w3.SYNTAX_ERR=(eQ[12]="Syntax error",12),KSE=w3.INVALID_MODIFICATION_ERR=(eQ[13]="Invalid modification",13),QSE=w3.NAMESPACE_ERR=(eQ[14]="Invalid namespace",14),WSE=w3.INVALID_ACCESS_ERR=(eQ[15]="Invalid access",15);function qJ(H,$){if($ instanceof Error)var A=$;else if(A=this,Error.call(this,eQ[H]),this.message=eQ[H],Error.captureStackTrace)Error.captureStackTrace(this,qJ);if(A.code=H,$)this.message=this.message+": "+$;return A}qJ.prototype=Error.prototype;PbH(w3,qJ);function Vp(){}Vp.prototype={length:0,item:function(H){return H>=0&&H=0){var I=$.length-1;while(L0},lookupPrefix:function(H){var $=this;while($){var A=$._nsMap;if(A){for(var L in A)if(Object.prototype.hasOwnProperty.call(A,L)&&A[L]===H)return L}$=$.nodeType==h7H?$.ownerDocument:$.parentNode}return null},lookupNamespaceURI:function(H){var $=this;while($){var A=$._nsMap;if(A){if(Object.prototype.hasOwnProperty.call(A,H))return A[H]}$=$.nodeType==h7H?$.ownerDocument:$.parentNode}return null},isDefaultNamespace:function(H){var $=this.lookupPrefix(H);return $==null}};function D5D(H){return H=="<"&&"<"||H==">"&&">"||H=="&"&&"&"||H=='"'&&"""||"&#"+H.charCodeAt()+";"}PbH(sY,FM);PbH(sY,FM.prototype);function VbH(H,$){if($(H))return!0;if(H=H.firstChild)do if(VbH(H,$))return!0;while(H=H.nextSibling)}function _bH(){this.ownerDocument=this}function it9(H,$,A){H&&H._inc++;var L=A.namespaceURI;if(L===WbH.XMLNS)$._nsMap[A.prefix?A.localName:""]=A.value}function B5D(H,$,A,L){H&&H._inc++;var I=A.namespaceURI;if(I===WbH.XMLNS)delete $._nsMap[A.prefix?A.localName:""]}function r2A(H,$,A){if(H&&H._inc){H._inc++;var L=$.childNodes;if(A)L[L.length++]=A;else{var I=$.firstChild,D=0;while(I)L[D++]=I,I=I.nextSibling;L.length=D,delete L[L.length]}}}function f5D(H,$){var{previousSibling:A,nextSibling:L}=$;if(A)A.nextSibling=L;else H.firstChild=L;if(L)L.previousSibling=A;else H.lastChild=A;return $.parentNode=null,$.previousSibling=null,$.nextSibling=null,r2A(H.ownerDocument,H),$}function nt9(H){return H&&(H.nodeType===FM.DOCUMENT_NODE||H.nodeType===FM.DOCUMENT_FRAGMENT_NODE||H.nodeType===FM.ELEMENT_NODE)}function rt9(H){return H&&(Nh(H)||a2A(H)||_p(H)||H.nodeType===FM.DOCUMENT_FRAGMENT_NODE||H.nodeType===FM.COMMENT_NODE||H.nodeType===FM.PROCESSING_INSTRUCTION_NODE)}function _p(H){return H&&H.nodeType===FM.DOCUMENT_TYPE_NODE}function Nh(H){return H&&H.nodeType===FM.ELEMENT_NODE}function a2A(H){return H&&H.nodeType===FM.TEXT_NODE}function i4D(H,$){var A=H.childNodes||[];if(zh(A,Nh)||_p($))return!1;var L=zh(A,_p);return!($&&L&&A.indexOf(L)>A.indexOf($))}function n4D(H,$){var A=H.childNodes||[];function L(D){return Nh(D)&&D!==$}if(zh(A,L))return!1;var I=zh(A,_p);return!($&&I&&A.indexOf(I)>A.indexOf($))}function at9(H,$,A){if(!nt9(H))throw new qJ(oY,"Unexpected parent node type "+H.nodeType);if(A&&A.parentNode!==H)throw new qJ(A5D,"child not in parent");if(!rt9($)||_p($)&&H.nodeType!==FM.DOCUMENT_NODE)throw new qJ(oY,"Unexpected node type "+$.nodeType+" for parent node type "+H.nodeType)}function ot9(H,$,A){var L=H.childNodes||[],I=$.childNodes||[];if($.nodeType===FM.DOCUMENT_FRAGMENT_NODE){var D=I.filter(Nh);if(D.length>1||zh(I,a2A))throw new qJ(oY,"More than one element or text in fragment");if(D.length===1&&!i4D(H,A))throw new qJ(oY,"Element in fragment can not be inserted before doctype")}if(Nh($)){if(!i4D(H,A))throw new qJ(oY,"Only one element can be added and only after doctype")}if(_p($)){if(zh(L,_p))throw new qJ(oY,"Only one doctype is allowed");var B=zh(L,Nh);if(A&&L.indexOf(B)1||zh(I,a2A))throw new qJ(oY,"More than one element or text in fragment");if(D.length===1&&!n4D(H,A))throw new qJ(oY,"Element in fragment can not be inserted before doctype")}if(Nh($)){if(!n4D(H,A))throw new qJ(oY,"Only one element can be added and only after doctype")}if(_p($)){let E=function(M){return _p(M)&&M!==A};var f=E;if(zh(L,E))throw new qJ(oY,"Only one doctype is allowed");var B=zh(L,Nh);if(A&&L.indexOf(B)0)VbH(A.documentElement,function(I){if(I!==A&&I.nodeType===VS){var D=I.getAttribute("class");if(D){var B=H===D;if(!B){var f=p4D(D);B=$.every(dt9(f))}if(B)L.push(I)}}});return L})},createElement:function(H){var $=new o0H;$.ownerDocument=this,$.nodeName=H,$.tagName=H,$.localName=H,$.childNodes=new Vp;var A=$.attributes=new vP$;return A._ownerElement=$,$},createDocumentFragment:function(){var H=new uP$;return H.ownerDocument=this,H.childNodes=new Vp,H},createTextNode:function(H){var $=new o2A;return $.ownerDocument=this,$.appendData(H),$},createComment:function(H){var $=new t2A;return $.ownerDocument=this,$.appendData(H),$},createCDATASection:function(H){var $=new s2A;return $.ownerDocument=this,$.appendData(H),$},createProcessingInstruction:function(H,$){var A=new HwA;return A.ownerDocument=this,A.tagName=A.nodeName=A.target=H,A.nodeValue=A.data=$,A},createAttribute:function(H){var $=new bP$;return $.ownerDocument=this,$.name=H,$.nodeName=H,$.localName=H,$.specified=!0,$},createEntityReference:function(H){var $=new e2A;return $.ownerDocument=this,$.nodeName=H,$},createElementNS:function(H,$){var A=new o0H,L=$.split(":"),I=A.attributes=new vP$;if(A.childNodes=new Vp,A.ownerDocument=this,A.nodeName=$,A.tagName=$,A.namespaceURI=H,L.length==2)A.prefix=L[0],A.localName=L[1];else A.localName=$;return I._ownerElement=A,A},createAttributeNS:function(H,$){var A=new bP$,L=$.split(":");if(A.ownerDocument=this,A.nodeName=$,A.name=$,A.namespaceURI=H,A.specified=!0,L.length==2)A.prefix=L[0],A.localName=L[1];else A.localName=$;return A}};tY(_bH,FM);function o0H(){this._nsMap={}}o0H.prototype={nodeType:VS,hasAttribute:function(H){return this.getAttributeNode(H)!=null},getAttribute:function(H){var $=this.getAttributeNode(H);return $&&$.value||""},getAttributeNode:function(H){return this.attributes.getNamedItem(H)},setAttribute:function(H,$){var A=this.ownerDocument.createAttribute(H);A.value=A.nodeValue=""+$,this.setAttributeNode(A)},removeAttribute:function(H){var $=this.getAttributeNode(H);$&&this.removeAttributeNode($)},appendChild:function(H){if(H.nodeType===Pp)return this.insertBefore(H,null);else return tt9(this,H)},setAttributeNode:function(H){return this.attributes.setNamedItem(H)},setAttributeNodeNS:function(H){return this.attributes.setNamedItemNS(H)},removeAttributeNode:function(H){return this.attributes.removeNamedItem(H.nodeName)},removeAttributeNS:function(H,$){var A=this.getAttributeNodeNS(H,$);A&&this.removeAttributeNode(A)},hasAttributeNS:function(H,$){return this.getAttributeNodeNS(H,$)!=null},getAttributeNS:function(H,$){var A=this.getAttributeNodeNS(H,$);return A&&A.value||""},setAttributeNS:function(H,$,A){var L=this.ownerDocument.createAttributeNS(H,$);L.value=L.nodeValue=""+A,this.setAttributeNode(L)},getAttributeNodeNS:function(H,$){return this.attributes.getNamedItemNS(H,$)},getElementsByTagName:function(H){return new b7H(this,function($){var A=[];return VbH($,function(L){if(L!==$&&L.nodeType==VS&&(H==="*"||L.tagName==H))A.push(L)}),A})},getElementsByTagNameNS:function(H,$){return new b7H(this,function(A){var L=[];return VbH(A,function(I){if(I!==A&&I.nodeType===VS&&(H==="*"||I.namespaceURI===H)&&($==="*"||I.localName==$))L.push(I)}),L})}};_bH.prototype.getElementsByTagName=o0H.prototype.getElementsByTagName;_bH.prototype.getElementsByTagNameNS=o0H.prototype.getElementsByTagNameNS;tY(o0H,FM);function bP$(){}bP$.prototype.nodeType=h7H;tY(bP$,FM);function YbH(){}YbH.prototype={data:"",substringData:function(H,$){return this.data.substring(H,H+$)},appendData:function(H){H=this.data+H,this.nodeValue=this.data=H,this.length=H.length},insertData:function(H,$){this.replaceData(H,0,$)},appendChild:function(H){throw Error(eQ[oY])},deleteData:function(H,$){this.replaceData(H,$,"")},replaceData:function(H,$,A){var L=this.data.substring(0,H),I=this.data.substring(H+$);A=L+A+I,this.nodeValue=this.data=A,this.length=A.length}};tY(YbH,FM);function o2A(){}o2A.prototype={nodeName:"#text",nodeType:yP$,splitText:function(H){var $=this.data,A=$.substring(H);$=$.substring(0,H),this.data=this.nodeValue=$,this.length=$.length;var L=this.ownerDocument.createTextNode(A);if(this.parentNode)this.parentNode.insertBefore(L,this.nextSibling);return L}};tY(o2A,YbH);function t2A(){}t2A.prototype={nodeName:"#comment",nodeType:e4D};tY(t2A,YbH);function s2A(){}s2A.prototype={nodeName:"#cdata-section",nodeType:o4D};tY(s2A,YbH);function kP$(){}kP$.prototype.nodeType=$5D;tY(kP$,FM);function M5D(){}M5D.prototype.nodeType=lt9;tY(M5D,FM);function G5D(){}G5D.prototype.nodeType=ct9;tY(G5D,FM);function e2A(){}e2A.prototype.nodeType=t4D;tY(e2A,FM);function uP$(){}uP$.prototype.nodeName="#document-fragment";uP$.prototype.nodeType=Pp;tY(uP$,FM);function HwA(){}HwA.prototype.nodeType=s4D;tY(HwA,FM);function U5D(){}U5D.prototype.serializeToString=function(H,$,A){return X5D.call(H,$,A)};FM.prototype.toString=X5D;function X5D(H,$){var A=[],L=this.nodeType==9&&this.documentElement||this,I=L.prefix,D=L.namespaceURI;if(D&&I==null){var I=L.lookupPrefix(D);if(I==null)var B=[{namespace:D,prefix:null}]}return v7H(this,A,H,$,B),A.join("")}function r4D(H,$,A){var L=H.prefix||"",I=H.namespaceURI;if(!I)return!1;if(L==="xml"&&I===WbH.XML||I===WbH.XMLNS)return!1;var D=A.length;while(D--){var B=A[D];if(B.prefix===L)return B.namespace!==I}return!0}function l2A(H,$,A){H.push(" ",$,'="',A.replace(/[<>&"\t\n\r]/g,D5D),'"')}function v7H(H,$,A,L,I){if(!I)I=[];if(L)if(H=L(H),H){if(typeof H=="string"){$.push(H);return}}else return;switch(H.nodeType){case VS:var D=H.attributes,B=D.length,P=H.firstChild,f=H.tagName;A=WbH.isHTML(H.namespaceURI)||A;var E=f;if(!A&&!H.prefix&&H.namespaceURI){var M;for(var G=0;G=0;U--){var X=I[U];if(X.prefix===""&&X.namespace===H.namespaceURI){M=X.namespace;break}}if(M!==H.namespaceURI)for(var U=I.length-1;U>=0;U--){var X=I[U];if(X.namespace===H.namespaceURI){if(X.prefix)E=X.prefix+":"+f;break}}}$.push("<",E);for(var J=0;J"),A&&/^script$/i.test(f))while(P){if(P.data)$.push(P.data);else v7H(P,$,A,L,I.slice());P=P.nextSibling}else while(P)v7H(P,$,A,L,I.slice()),P=P.nextSibling;$.push("")}else $.push("/>");return;case H5D:case Pp:var P=H.firstChild;while(P)v7H(P,$,A,L,I.slice()),P=P.nextSibling;return;case h7H:return l2A($,H.name,H.value);case yP$:return $.push(H.data.replace(/[<&>]/g,D5D));case o4D:return $.push("");case e4D:return $.push("");case $5D:var{publicId:C,systemId:Y}=H;if($.push("")}else if(Y&&Y!=".")$.push(" SYSTEM ",Y,">");else{var Z=H.internalSubset;if(Z)$.push(" [",Z,"]");$.push(">")}return;case s4D:return $.push("");case t4D:return $.push("&",H.nodeName,";");default:$.push("??",H.nodeName)}}function J5D(H,$,A){var L;switch($.nodeType){case VS:L=$.cloneNode(!1),L.ownerDocument=H;case Pp:break;case h7H:A=!0;break}if(!L)L=$.cloneNode(!1);if(L.ownerDocument=H,L.parentNode=null,A){var I=$.firstChild;while(I)L.appendChild(J5D(H,I,A)),I=I.nextSibling}return L}function i2A(H,$,A){var L=new $.constructor;for(var I in $)if(Object.prototype.hasOwnProperty.call($,I)){var D=$[I];if(typeof D!="object"){if(D!=L[I])L[I]=D}}if($.childNodes)L.childNodes=new Vp;switch(L.ownerDocument=H,L.nodeType){case VS:var B=$.attributes,f=L.attributes=new vP$,E=B.length;f._ownerElement=L;for(var M=0;M{var K5D=QbH().freeze;CbH.XML_ENTITIES=K5D({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});CbH.HTML_ENTITIES=K5D({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\uD835\uDD38",aopf:"\uD835\uDD52",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\uD835\uDC9C",ascr:"\uD835\uDCB6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\uD835\uDD05",bfr:"\uD835\uDD1F",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\uD835\uDD39",bopf:"\uD835\uDD53",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\uD835\uDCB7",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\uD835\uDD20",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\uD835\uDD54",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\uD835\uDC9E",cscr:"\uD835\uDCB8",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\uD835\uDD07",dfr:"\uD835\uDD21",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\uD835\uDD3B",dopf:"\uD835\uDD55",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\uD835\uDC9F",dscr:"\uD835\uDCB9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\uD835\uDD08",efr:"\uD835\uDD22",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\uD835\uDD3C",eopf:"\uD835\uDD56",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\uD835\uDD09",ffr:"\uD835\uDD23",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\uD835\uDD3D",fopf:"\uD835\uDD57",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\uD835\uDCBB",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\uD835\uDD0A",gfr:"\uD835\uDD24",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\uD835\uDD3E",gopf:"\uD835\uDD58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\uD835\uDCA2",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\uD835\uDD25",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\uD835\uDD59",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\uD835\uDCBD",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\uD835\uDD26",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\uD835\uDD40",iopf:"\uD835\uDD5A",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\uD835\uDCBE",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\uD835\uDD0D",jfr:"\uD835\uDD27",jmath:"\u0237",Jopf:"\uD835\uDD41",jopf:"\uD835\uDD5B",Jscr:"\uD835\uDCA5",jscr:"\uD835\uDCBF",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\uD835\uDD0E",kfr:"\uD835\uDD28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\uD835\uDD42",kopf:"\uD835\uDD5C",Kscr:"\uD835\uDCA6",kscr:"\uD835\uDCC0",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\uD835\uDD0F",lfr:"\uD835\uDD29",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\uD835\uDD43",lopf:"\uD835\uDD5D",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\uD835\uDCC1",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\uD835\uDD10",mfr:"\uD835\uDD2A",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\uD835\uDD44",mopf:"\uD835\uDD5E",mp:"\u2213",Mscr:"\u2133",mscr:"\uD835\uDCC2",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` `,Z.offset=(j=Y.offset)!=null?j:0,Z.width=(u=Y.width)!=null?u:0,Z.dontPrettyTextNodes=(y=(g=Y.dontPrettyTextNodes)!=null?g:Y.dontprettytextnodes)!=null?y:0,Z.spaceBeforeSlash=(h=(p=Y.spaceBeforeSlash)!=null?p:Y.spacebeforeslash)!=null?h:"",Z.spaceBeforeSlash===!0)Z.spaceBeforeSlash=" ";return Z.suppressPrettyCount=0,Z.user={},Z.state=$.None,Z}indent(Y,Z,q){var O;if(!Z.pretty||Z.suppressPrettyCount)return"";else if(Z.pretty){if(O=(q||0)+Z.offset+1,O>0)return Array(O).join(Z.indent)}return""}endline(Y,Z,q){if(!Z.pretty||Z.suppressPrettyCount)return"";else return Z.newline}attribute(Y,Z,q){var O;if(this.openAttribute(Y,Z,q),Z.pretty&&Z.width>0)O=Y.name+'="'+Y.value+'"';else O=" "+Y.name+'="'+Y.value+'"';return this.closeAttribute(Y,Z,q),O}cdata(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}comment(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}declaration(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+"",O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}docType(Y,Z,q){var O,j,u,y,g;if(q||(q=0),this.openNode(Y,Z,q),Z.state=$.OpenTag,y=this.indent(Y,Z,q),y+="0){y+=" [",y+=this.endline(Y,Z,q),Z.state=$.InsideTag,g=Y.children;for(j=0,u=g.length;j",y+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),y}element(Y,Z,q){var O,j,u,y,g,h,p,d,k,n,GH,HH,BH,WH,wH,QH,TH,t,IH;if(q||(q=0),HH=!1,this.openNode(Y,Z,q),Z.state=$.OpenTag,BH=this.indent(Y,Z,q)+"<"+Y.name,Z.pretty&&Z.width>0){d=BH.length,wH=Y.attribs;for(GH in wH){if(!P.call(wH,GH))continue;if(O=wH[GH],WH=this.attribute(O,Z,q),j=WH.length,d+j>Z.width)IH=this.indent(Y,Z,q+1)+WH,BH+=this.endline(Y,Z,q)+IH,d=IH.length;else IH=" "+WH,BH+=IH,d+=IH.length}}else{QH=Y.attribs;for(GH in QH){if(!P.call(QH,GH))continue;O=QH[GH],BH+=this.attribute(O,Z,q)}}if(y=Y.children.length,g=y===0?null:Y.children[0],y===0||Y.children.every(function(KH){return(KH.type===H.Text||KH.type===H.Raw||KH.type===H.CData)&&KH.value===""}))if(Z.allowEmpty)BH+=">",Z.state=$.CloseTag,BH+=""+this.endline(Y,Z,q);else Z.state=$.CloseTag,BH+=Z.spaceBeforeSlash+"/>"+this.endline(Y,Z,q);else if(Z.pretty&&y===1&&(g.type===H.Text||g.type===H.Raw||g.type===H.CData)&&g.value!=null)BH+=">",Z.state=$.InsideTag,Z.suppressPrettyCount++,HH=!0,BH+=this.writeChildNode(g,Z,q+1),Z.suppressPrettyCount--,HH=!1,Z.state=$.CloseTag,BH+=""+this.endline(Y,Z,q);else{if(Z.dontPrettyTextNodes){TH=Y.children;for(h=0,k=TH.length;h"+this.endline(Y,Z,q),Z.state=$.InsideTag,t=Y.children;for(p=0,n=t.length;p",HH)Z.suppressPrettyCount--;BH+=this.endline(Y,Z,q),Z.state=$.None}return this.closeNode(Y,Z,q),BH}writeChildNode(Y,Z,q){switch(Y.type){case H.CData:return this.cdata(Y,Z,q);case H.Comment:return this.comment(Y,Z,q);case H.Element:return this.element(Y,Z,q);case H.Raw:return this.raw(Y,Z,q);case H.Text:return this.text(Y,Z,q);case H.ProcessingInstruction:return this.processingInstruction(Y,Z,q);case H.Dummy:return"";case H.Declaration:return this.declaration(Y,Z,q);case H.DocType:return this.docType(Y,Z,q);case H.AttributeDeclaration:return this.dtdAttList(Y,Z,q);case H.ElementDeclaration:return this.dtdElement(Y,Z,q);case H.EntityDeclaration:return this.dtdEntity(Y,Z,q);case H.NotationDeclaration:return this.dtdNotation(Y,Z,q);default:throw Error("Unknown XML node type: "+Y.constructor.name)}}processingInstruction(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+"",O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}raw(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q),Z.state=$.InsideTag,O+=Y.value,Z.state=$.CloseTag,O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}text(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q),Z.state=$.InsideTag,O+=Y.value,Z.state=$.CloseTag,O+=this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdAttList(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdElement(Y,Z,q){var O;return this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdEntity(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}dtdNotation(Y,Z,q){var O;if(this.openNode(Y,Z,q),Z.state=$.OpenTag,O=this.indent(Y,Z,q)+""+this.endline(Y,Z,q),Z.state=$.None,this.closeNode(Y,Z,q),O}openNode(Y,Z,q){}closeNode(Y,Z,q){}openAttribute(Y,Z,q){}closeAttribute(Y,Z,q){}}}).call(mXD)});var I_$=z((dXD,cXD)=>{(function(){var H,$;$=GwA(),cXD.exports=H=class extends ${constructor(L){super(L)}document(L,I){var D,B,f,E,M;I=this.filterOptions(I),E="",M=L.children;for(B=0,f=M.length;B{(function(){var H,$,A,L,I,D,B,f;({isPlainObject:f}=Oh()),A=BwA(),$=r5D(),I=ww(),H=TJ(),B=MwA(),D=I_$(),iXD.exports=L=function(){class E extends I{constructor(M){super(null);if(this.name="#document",this.type=H.Document,this.documentURI=null,this.domConfig=new $,M||(M={}),!M.writer)M.writer=new D;this.options=M,this.stringify=new B(M)}end(M){var G={};if(!M)M=this.options.writer;else if(f(M))G=M,M=this.options.writer;return M.document(this,M.filterOptions(G))}toString(M){return this.options.writer.document(this,this.options.writer.filterOptions(M))}createElement(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createComment(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(M){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(M){throw Error("This DOM method is not implemented."+this.debugInfo())}importNode(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(M,G){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementById(M){throw Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(M){throw Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw Error("This DOM method is not implemented."+this.debugInfo())}renameNode(M,G,U){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createEvent(M){throw Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(M,G,U){throw Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(M,G,U){throw Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(E.prototype,"implementation",{value:new A}),Object.defineProperty(E.prototype,"doctype",{get:function(){var M,G,U,X;X=this.children;for(G=0,U=X.length;G{(function(){var H,$,A,L,I,D,B,f,E,M,G,U,X,J,F,Q,W,P,C,Y,Z,q,O,j={}.hasOwnProperty;({isObject:q,isFunction:Z,isPlainObject:O,getValue:Y}=Oh()),H=TJ(),U=UwA(),J=iP$(),L=nP$(),I=rP$(),Q=$_$(),C=A_$(),F=L_$(),M=aP$(),G=H_$(),D=oP$(),f=tP$(),B=sP$(),E=eP$(),A=fwA(),P=MwA(),W=I_$(),$=ObH(),rXD.exports=X=class{constructor(y,g,h){var p;if(this.name="?xml",this.type=H.Document,y||(y={}),p={},!y.writer)y.writer=new W;else if(O(y.writer))p=y.writer,y.writer=new W;this.options=y,this.writer=y.writer,this.writerOptions=this.writer.filterOptions(p),this.stringify=new P(y),this.onDataCallback=g||function(){},this.onEndCallback=h||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}createChildNode(y){var g,h,p,d,k,n,GH,HH;switch(y.type){case H.CData:this.cdata(y.value);break;case H.Comment:this.comment(y.value);break;case H.Element:p={},GH=y.attribs;for(h in GH){if(!j.call(GH,h))continue;g=GH[h],p[h]=g.value}this.node(y.name,p);break;case H.Dummy:this.dummy();break;case H.Raw:this.raw(y.value);break;case H.Text:this.text(y.value);break;case H.ProcessingInstruction:this.instruction(y.target,y.value);break;default:throw Error("This XML node type is not supported in a JS object: "+y.constructor.name)}HH=y.children;for(k=0,n=HH.length;k=0)this.up();return this.onEnd()}openCurrent(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)}openNode(y){var g,h,p,d;if(!y.isOpen){if(!this.root&&this.currentLevel===0&&y.type===H.Element)this.root=y;if(h="",y.type===H.Element){this.writerOptions.state=$.OpenTag,h=this.writer.indent(y,this.writerOptions,this.currentLevel)+"<"+y.name,d=y.attribs;for(p in d){if(!j.call(d,p))continue;g=d[p],h+=this.writer.attribute(g,this.writerOptions,this.currentLevel)}h+=(y.children?">":"/>")+this.writer.endline(y,this.writerOptions,this.currentLevel),this.writerOptions.state=$.InsideTag}else{if(this.writerOptions.state=$.OpenTag,h=this.writer.indent(y,this.writerOptions,this.currentLevel)+"";h+=this.writer.endline(y,this.writerOptions,this.currentLevel)}return this.onData(h,this.currentLevel),y.isOpen=!0}}closeNode(y){var g;if(!y.isClosed){if(g="",this.writerOptions.state=$.CloseTag,y.type===H.Element)g=this.writer.indent(y,this.writerOptions,this.currentLevel)+""+this.writer.endline(y,this.writerOptions,this.currentLevel);else g=this.writer.indent(y,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(y,this.writerOptions,this.currentLevel);return this.writerOptions.state=$.None,this.onData(g,this.currentLevel),y.isClosed=!0}}onData(y,g){return this.documentStarted=!0,this.onDataCallback(y,g+1)}onEnd(){return this.documentCompleted=!0,this.onEndCallback()}debugInfo(y){if(y==null)return"";else return"node: <"+y+">"}ele(){return this.element(...arguments)}nod(y,g,h){return this.node(y,g,h)}txt(y){return this.text(y)}dat(y){return this.cdata(y)}com(y){return this.comment(y)}ins(y,g){return this.instruction(y,g)}dec(y,g,h){return this.declaration(y,g,h)}dtd(y,g,h){return this.doctype(y,g,h)}e(y,g,h){return this.element(y,g,h)}n(y,g,h){return this.node(y,g,h)}t(y){return this.text(y)}d(y){return this.cdata(y)}c(y){return this.comment(y)}r(y){return this.raw(y)}i(y,g){return this.instruction(y,g)}att(){if(this.currentNode&&this.currentNode.type===H.DocType)return this.attList(...arguments);else return this.attribute(...arguments)}a(){if(this.currentNode&&this.currentNode.type===H.DocType)return this.attList(...arguments);else return this.attribute(...arguments)}ent(y,g){return this.entity(y,g)}pent(y,g){return this.pEntity(y,g)}not(y,g){return this.notation(y,g)}}}).call(nXD)});var sXD=z((oXD,tXD)=>{(function(){var H,$,A,L,I={}.hasOwnProperty;H=TJ(),L=GwA(),$=ObH(),tXD.exports=A=class extends L{constructor(B,f){super(f);this.stream=B}endline(B,f,E){if(B.isLastRootNode&&f.state===$.CloseTag)return"";else return super.endline(B,f,E)}document(B,f){var E,M,G,U,X,J,F,Q,W;F=B.children;for(M=G=0,X=F.length;G0){this.stream.write(" ["),this.stream.write(this.endline(B,f,E)),f.state=$.InsideTag,X=B.children;for(G=0,U=X.length;G"),this.stream.write(this.endline(B,f,E)),f.state=$.None,this.closeNode(B,f,E)}element(B,f,E){var M,G,U,X,J,F,Q,W,P,C,Y,Z,q,O,j,u;if(E||(E=0),this.openNode(B,f,E),f.state=$.OpenTag,Y=this.indent(B,f,E)+"<"+B.name,f.pretty&&f.width>0){Q=Y.length,q=B.attribs;for(P in q){if(!I.call(q,P))continue;if(M=q[P],Z=this.attribute(M,f,E),G=Z.length,Q+G>f.width)u=this.indent(B,f,E+1)+Z,Y+=this.endline(B,f,E)+u,Q=u.length;else u=" "+Z,Y+=u,Q+=u.length}}else{O=B.attribs;for(P in O){if(!I.call(O,P))continue;M=O[P],Y+=this.attribute(M,f,E)}}if(this.stream.write(Y),X=B.children.length,J=X===0?null:B.children[0],X===0||B.children.every(function(y){return(y.type===H.Text||y.type===H.Raw||y.type===H.CData)&&y.value===""}))if(f.allowEmpty)this.stream.write(">"),f.state=$.CloseTag,this.stream.write("");else f.state=$.CloseTag,this.stream.write(f.spaceBeforeSlash+"/>");else if(f.pretty&&X===1&&(J.type===H.Text||J.type===H.Raw||J.type===H.CData)&&J.value!=null)this.stream.write(">"),f.state=$.InsideTag,f.suppressPrettyCount++,C=!0,this.writeChildNode(J,f,E+1),f.suppressPrettyCount--,C=!1,f.state=$.CloseTag,this.stream.write("");else{this.stream.write(">"+this.endline(B,f,E)),f.state=$.InsideTag,j=B.children;for(F=0,W=j.length;F")}return this.stream.write(this.endline(B,f,E)),f.state=$.None,this.closeNode(B,f,E)}processingInstruction(B,f,E){return this.stream.write(super.processingInstruction(B,f,E))}raw(B,f,E){return this.stream.write(super.raw(B,f,E))}text(B,f,E){return this.stream.write(super.text(B,f,E))}dtdAttList(B,f,E){return this.stream.write(super.dtdAttList(B,f,E))}dtdElement(B,f,E){return this.stream.write(super.dtdElement(B,f,E))}dtdEntity(B,f,E){return this.stream.write(super.dtdEntity(B,f,E))}dtdNotation(B,f,E){return this.stream.write(super.dtdNotation(B,f,E))}}}).call(oXD)});var HJD=z((eXD,eo)=>{(function(){var H,$,A,L,I,D,B,f,E;({assign:f,isFunction:E}=Oh()),A=BwA(),L=UwA(),I=aXD(),B=I_$(),D=sXD(),H=TJ(),$=ObH(),eo.exports.create=function(M,G,U,X){var J,F;if(M==null)throw Error("Root element needs a name.");if(X=f({},G,U,X),J=new L(X),F=J.element(M),!X.headless){if(J.declaration(X),X.pubID!=null||X.sysID!=null)J.dtd(X)}return F},eo.exports.begin=function(M,G,U){if(E(M))[G,U]=[M,G],M={};if(G)return new I(M,G,U);else return new L(M)},eo.exports.stringWriter=function(M){return new B(M)},eo.exports.streamWriter=function(M,G){return new D(M,G)},eo.exports.implementation=new A,eo.exports.nodeType=H,eo.exports.writerState=$}).call(eXD)});var IJD=z((LJD)=>{var $JD=G8A(),Ks9=HJD();LJD.build=Vs9;function Qs9(H){function $(A){return A<10?"0"+A:A}return H.getUTCFullYear()+"-"+$(H.getUTCMonth()+1)+"-"+$(H.getUTCDate())+"T"+$(H.getUTCHours())+":"+$(H.getUTCMinutes())+":"+$(H.getUTCSeconds())+"Z"}var Ws9=Object.prototype.toString;function AJD(H){var $=Ws9.call(H).match(/\[object (.*)\]/);return $?$[1]:$}function Vs9(H,$){var A={version:"1.0",encoding:"UTF-8"},L={pubid:"-//Apple//DTD PLIST 1.0//EN",sysid:"http://www.apple.com/DTDs/PropertyList-1.0.dtd"},I=Ks9.create("plist");if(I.dec(A.version,A.encoding,A.standalone),I.dtd(L.pubid,L.sysid),I.att("version","1.0"),XwA(H,I),!$)$={};return $.pretty=$.pretty!==!1,I.end($)}function XwA(H,$){var A,L,I,D=AJD(H);if(D=="Undefined")return;else if(Array.isArray(H)){$=$.ele("array");for(L=0;L{var DJD=h5D();Object.keys(DJD).forEach(function(H){JwA[H]=DJD[H]});var BJD=IJD();Object.keys(BJD).forEach(function(H){JwA[H]=BJD[H]})});async function xh(H,$){let L=M$().preferredNotifChannel;await FwA(H);let I=await Ps9(L,H,$);c("tengu_notification_method_used",{configured_channel:L,method_used:I,term:OA.terminal})}async function Ps9(H,$,A){let L=$.title||MJD;try{switch(H){case"auto":return _s9($,A);case"iterm2":return A.notifyITerm2($),"iterm2";case"iterm2_with_bell":return A.notifyITerm2($),A.notifyBell(),"iterm2_with_bell";case"kitty":return A.notifyKitty({...$,title:L,id:GJD()}),"kitty";case"terminal_bell":return A.notifyBell(),"terminal_bell";case"notifications_disabled":return"disabled";default:return"none"}}catch{return"error"}}async function _s9(H,$){let A=H.title||MJD;switch(OA.terminal){case"Apple_Terminal":{if(await Ys9())return $.notifyBell(),"terminal_bell";return"no_method_available"}case"iTerm.app":return $.notifyITerm2(H),"iterm2";case"kitty":return $.notifyKitty({...H,title:A,id:GJD()}),"kitty";case"ghostty":return $.notifyGhostty({...H,title:A}),"ghostty";default:return"no_method_available"}}function GJD(){return Math.floor(Math.random()*1e4)}async function Ys9(){try{if(OA.terminal!=="Apple_Terminal")return!1;let $=(await jA("osascript",["-e",'tell application "Terminal" to name of current settings of front window'])).stdout.trim();if(!$)return!1;let A=await jA("defaults",["export","com.apple.Terminal","-"]);if(A.code!==0)return!1;let D=EJD.default.parse(A.stdout)?.["Window Settings"]?.[$];if(!D)return!1;return D.Bell===!1}catch(H){return r(H instanceof Error?H:Error(String(H))),!1}}var EJD,MJD="Claude Code";var xbH=K(()=>{vA();B0();z$();Z1();_$();_3();EJD=b(fJD(),1)});async function UJD(H,$,A){try{let L=eG();if(L.error)return;let I={"Content-Type":"application/json","User-Agent":sG(),...L.headers},D={vcs_type:"github",vcs_host:$,vcs_username:H,git_user_email:A},B="https://api.anthropic.com/api/claude_code/link_vcs_account";await nA.post(B,D,{headers:I,timeout:5000})}catch(L){}}var XJD=K(()=>{w1();_Q()});async function Cs9(){try{let H=await jA("gh",["auth","status","--active","--json","hosts"],{useCwd:!1,timeout:5000});if(H.code!==0||!H.stdout.trim())return null;let A=DA(H.stdout)?.hosts;if(!A||typeof A!=="object")return null;for(let[L,I]of Object.entries(A)){if(!Array.isArray(I)||I.length===0)continue;let D=I[0];if(D?.login)return{username:D.login,hostname:L}}return null}catch(H){return null}}async function ws9(){try{let H=await jA(cB(),["config","--get","user.email"],{useCwd:!1,timeout:5000});if(H.code===0&&H.stdout.trim())return H.stdout.trim();return null}catch(H){return null}}async function KwA(){if(!XG(!0)&&!tI())return;if($O())return;if(!0){let I=await JP$();if(I.hasError||!I.vcsAccountLinkingEnabled)return}let[A,L]=await Promise.all([Cs9(),ws9()]);if(A||L)UJD(A?.username??"",A?.hostname??"",L??"")}var JJD=K(()=>{B0();XJD();EI();Y2A();vA();g$();Z$();t8()});var KJD={};XA(KJD,{ConsoleOAuthFlow:()=>s0H});function s0H({onDone:H,startingMessage:$,mode:A="login",forceLoginMethod:L}){let I=VL()||{},D=L??I.forceLoginMethod,B=I.forceLoginOrgUUID,f=D==="claudeai"?"Login method pre-selected: Subscription Plan (Claude Pro/Max)":D==="console"?"Login method pre-selected: API Usage Billing (Anthropic Console)":null,E=Vy(),[M,G]=MI.useState(()=>{if(A==="setup-token")return{state:"ready_to_start"};if(D==="claudeai"||D==="console")return{state:"ready_to_start"};return{state:"idle"}}),[U,X]=MI.useState(""),[J,F]=MI.useState(0),[Q]=MI.useState(()=>new DbH),[W,P]=MI.useState(()=>{return A==="setup-token"||D==="claudeai"}),[C,Y]=MI.useState(!1),[Z,q]=MI.useState(!1),O=QL().columns-FJD.length-1;MI.useEffect(()=>{if(D==="claudeai")c("tengu_oauth_claudeai_forced",{});else if(D==="console")c("tengu_oauth_console_forced",{})},[D]),MI.useEffect(()=>{if(M.state==="about_to_retry")setTimeout(()=>{G(M.nextState)},1000)},[M]),BA("confirm:yes",()=>{c("tengu_oauth_success",{loginWithClaudeAi:W}),H()},{context:"Confirmation",isActive:M.state==="success"&&A!=="setup-token"}),BA("confirm:yes",()=>{G({state:"idle"})},{context:"Confirmation",isActive:M.state==="platform_setup"}),BA("confirm:yes",()=>{if(M.state==="error"&&M.toRetry)X(""),G({state:"about_to_retry",nextState:M.toRetry})},{context:"Confirmation",isActive:M.state==="error"&&!!M.toRetry}),MI.useEffect(()=>{if(U==="c"&&M.state==="waiting_for_login"&&C&&!Z)K3(M.url).then((h)=>{if(h)q(!0),setTimeout(()=>q(!1),2000)}),X("")},[U,M,C,Z]);async function j(h,p){try{let[d,k]=h.split("#");if(!d||!k){G({state:"error",message:"Invalid code. Please make sure the full code was copied",toRetry:{state:"waiting_for_login",url:p}});return}c("tengu_oauth_manual_entry",{}),Q.handleManualAuthCodeInput({authorizationCode:d,state:k})}catch(d){r(d instanceof Error?d:Error(String(d))),G({state:"error",message:d.message,toRetry:{state:"waiting_for_login",url:p}})}}let u=MI.useCallback(async()=>{try{c("tengu_oauth_flow_start",{loginWithClaudeAi:W});let h=await Q.startOAuthFlow(async(p)=>{G({state:"waiting_for_login",url:p}),setTimeout(()=>Y(!0),3000)},{loginWithClaudeAi:W,inferenceOnly:A==="setup-token",expiresIn:A==="setup-token"?31536000:void 0,orgUUID:B}).catch((p)=>{let d=p.message.includes("Token exchange failed");throw G({state:"error",message:d?"Failed to exchange authorization code for access token. Please try again.":p.message,toRetry:A==="setup-token"?{state:"ready_to_start"}:{state:"idle"}}),c("tengu_oauth_token_exchange_error",{error:p.message}),p});if(A==="setup-token")G({state:"success",token:h.accessToken});else{let p=OqH(h);if(p.warning)c("tengu_oauth_storage_warning",{warning:p.warning});if(await l1L(h.accessToken).catch((d)=>{throw G({state:"error",message:"Failed to fetch user roles: "+d.message,toRetry:{state:"idle"}}),c("tengu_oauth_user_roles_error",{error:d.message}),d}),mk(h.scopes))await OoL(),IbH(),G({state:"success"}),xh({message:"Claude Code login successful",notificationType:"auth_success"},E),KwA();else if(G({state:"creating_api_key"}),await i1L(h.accessToken).catch((k)=>{throw G({state:"error",message:"Failed to create API key: "+k.message,toRetry:{state:"idle"}}),c("tengu_oauth_api_key_error",{error:k.message}),k}))IbH(),G({state:"success"}),xh({message:"Claude Code login successful",notificationType:"auth_success"},E),KwA();else G({state:"error",message:"Unable to create API key. The server accepted the request but didn't return a key.",toRetry:{state:"idle"}}),c("tengu_oauth_api_key_error",{error:"server_returned_no_key"})}}catch(h){let p=h.message;c("tengu_oauth_error",{error:p})}},[Q,Y,W,A,B]),y=MI.useRef(!1);MI.useEffect(()=>{if(M.state==="ready_to_start"&&!y.current)y.current=!0,process.nextTick(()=>{u(),y.current=!1})},[M.state,u]),MI.useEffect(()=>{if(A==="setup-token"&&M.state==="success"){let h=setTimeout(async()=>{c("tengu_oauth_success",{loginWithClaudeAi:W}),H()},500);return()=>clearTimeout(h)}},[A,M,W,H]),MI.useEffect(()=>{return()=>{Q.cleanup()}},[Q]);function g(){switch(M.state){case"idle":return MI.default.createElement(x,{flexDirection:"column",gap:1,marginTop:1},MI.default.createElement(V,{bold:!0},$?$:"Claude Code can be used with your Claude subscription or billed based on API usage through your Console account."),MI.default.createElement(V,null,"Select login method:"),MI.default.createElement(x,null,MI.default.createElement(QA,{options:[{label:MI.default.createElement(V,null,"Claude account with subscription \xB7"," ",MI.default.createElement(V,{dimColor:!0},"Pro, Max, Team, or Enterprise"),` `),value:"claudeai"},{label:MI.default.createElement(V,null,"Anthropic Console account \xB7"," ",MI.default.createElement(V,{dimColor:!0},"API usage billing"),` `),value:"platform"}],onCancel:()=>{},onChange:(h)=>{if(h==="platform")c("tengu_oauth_platform_selected",{}),G({state:"platform_setup"});else if(G({state:"ready_to_start"}),h==="claudeai")c("tengu_oauth_claudeai_selected",{}),P(!0);else c("tengu_oauth_console_selected",{}),P(!1)}})));case"platform_setup":return MI.default.createElement(x,{flexDirection:"column",gap:1,marginTop:1},MI.default.createElement(V,{bold:!0},"Using 3rd-party platforms"),MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,null,"Claude Code supports Amazon Bedrock, Microsoft Foundry, and Vertex AI. Set the required environment variables, then restart Claude Code."),MI.default.createElement(V,null,"If you are part of an enterprise organization, contact your administrator for setup instructions."),MI.default.createElement(x,{flexDirection:"column",marginTop:1},MI.default.createElement(V,{bold:!0},"Documentation:"),MI.default.createElement(V,null,"\xB7 Amazon Bedrock:"," ",MI.default.createElement(dI,{url:"https://code.claude.com/docs/en/amazon-bedrock"},"https://code.claude.com/docs/en/amazon-bedrock")),MI.default.createElement(V,null,"\xB7 Microsoft Foundry:"," ",MI.default.createElement(dI,{url:"https://code.claude.com/docs/en/microsoft-foundry"},"https://code.claude.com/docs/en/microsoft-foundry")),MI.default.createElement(V,null,"\xB7 Vertex AI:"," ",MI.default.createElement(dI,{url:"https://code.claude.com/docs/en/google-vertex-ai"},"https://code.claude.com/docs/en/google-vertex-ai"))),MI.default.createElement(x,{marginTop:1},MI.default.createElement(V,{dimColor:!0},"Press ",MI.default.createElement(V,{bold:!0},"Enter")," to go back to login options."))));case"waiting_for_login":return MI.default.createElement(x,{flexDirection:"column",gap:1},f&&MI.default.createElement(x,null,MI.default.createElement(V,{dimColor:!0},f)),!C&&MI.default.createElement(x,null,MI.default.createElement(vD,null),MI.default.createElement(V,null,"Opening browser to sign in\u2026")),C&&MI.default.createElement(x,null,MI.default.createElement(V,null,FJD),MI.default.createElement(W9,{value:U,onChange:X,onSubmit:(h)=>j(h,M.url),cursorOffset:J,onChangeCursorOffset:F,columns:O})));case"creating_api_key":return MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(x,null,MI.default.createElement(vD,null),MI.default.createElement(V,null,"Creating API key for Claude Code\u2026")));case"about_to_retry":return MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,{color:"permission"},"Retrying\u2026"));case"success":return MI.default.createElement(x,{flexDirection:"column"},A==="setup-token"&&M.token?null:MI.default.createElement(MI.default.Fragment,null,T9()?.emailAddress?MI.default.createElement(V,{dimColor:!0},"Logged in as"," ",MI.default.createElement(V,null,T9()?.emailAddress)):null,MI.default.createElement(V,{color:"success"},"Login successful. Press ",MI.default.createElement(V,{bold:!0},"Enter")," to continue\u2026")));case"error":return MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,{color:"error"},"OAuth error: ",M.message),M.toRetry&&MI.default.createElement(x,{marginTop:1},MI.default.createElement(V,{color:"permission"},"Press ",MI.default.createElement(V,{bold:!0},"Enter")," to retry.")));default:return null}}return MI.default.createElement(x,{flexDirection:"column",gap:1},M.state==="waiting_for_login"&&C&&MI.default.createElement(x,{flexDirection:"column",key:"urlToCopy",gap:1,paddingBottom:1},MI.default.createElement(x,{paddingX:1},MI.default.createElement(V,{dimColor:!0},"Browser didn't open? Use the url below to sign in"," "),Z?MI.default.createElement(V,{color:"success"},"(Copied!)"):MI.default.createElement(V,{dimColor:!0},MI.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),MI.default.createElement(dI,{url:M.url},MI.default.createElement(V,{dimColor:!0},M.url))),A==="setup-token"&&M.state==="success"&&M.token&&MI.default.createElement(x,{key:"tokenOutput",flexDirection:"column",gap:1,paddingTop:1},MI.default.createElement(V,{color:"success"},"\u2713 Long-lived authentication token created successfully!"),MI.default.createElement(x,{flexDirection:"column",gap:1},MI.default.createElement(V,null,"Your OAuth token (valid for 1 year):"),MI.default.createElement(V,{color:"warning"},M.token),MI.default.createElement(V,{dimColor:!0},"Store this token securely. You won't be able to see it again."),MI.default.createElement(V,{dimColor:!0},"Use this token by setting: export CLAUDE_CODE_OAUTH_TOKEN="))),MI.default.createElement(x,{paddingLeft:1,flexDirection:"column",gap:1},g()))}var MI,FJD="Paste code here if prompted > ";var SbH=K(()=>{xH();$I();pm();lB();S5();x2A();Hq();EI();z$();OB();_$();JM();xbH();TLH();N1();QP$();mL();aI();JJD();MI=b(s(),1)});function Ht(){let H=J$((A)=>A.mainLoopModel),$=J$((A)=>A.mainLoopModelForSession);return QJD.useMemo(()=>{return m8($??H??J5H())},[$,H])}var QJD;var jbH=K(()=>{aI();pL();QJD=b(s(),1)});var WJD=()=>{};var VJD=()=>{};var QwA=()=>{};function RbH(H,$,A){$.split&&($=$.split("."));var L=0,I=$.length,D=H,B,f;while(L{C2();PS=function(H){qi($,H);function $(A,L){var I=H.call(this,"".concat(A," ").concat(L))||this;return I.field=A,I}return $}(Error)});function D_$(H){return typeof H==="string"}function VwA(H){return H!==void 0&&H!==null}function PwA(H){return Object.prototype.toString.call(H).slice(8,-1).toLowerCase()==="object"}function Zs9(H){var $=".userId/anonymousId/previousId/groupId",A=function(I){var D,B,f;return(f=(B=(D=I.userId)!==null&&D!==void 0?D:I.anonymousId)!==null&&B!==void 0?B:I.groupId)!==null&&f!==void 0?f:I.previousId},L=A(H);if(!VwA(L))throw new PS($,_JD);else if(!D_$(L))throw new PS($,_wA)}function qs9(H){if(!VwA(H))throw new PS("Event",_JD);if(typeof H!=="object")throw new PS("Event",YwA)}function Ts9(H){if(!D_$(H.type))throw new PS(".type",_wA)}function zs9(H){if(!D_$(H.event))throw new PS(".event",_wA)}function Ns9(H){if(!PwA(H.properties))throw new PS(".properties",YwA)}function Os9(H){if(!PwA(H.traits))throw new PS(".traits",YwA)}function YJD(H){if(qs9(H),Ts9(H),H.type==="track")zs9(H),Ns9(H);if(["group","identify"].includes(H.type))Os9(H);Zs9(H)}var _wA="is not a string",YwA="is not an object",_JD="is nil";var CwA=K(()=>{WwA()});var CJD;var wJD=K(()=>{C2();CwA();QwA();CJD=function(){function H($){this.user=$.user,this.createMessageId=$.createMessageId}return H.prototype.track=function($,A,L,I){return this.normalize(q9(q9({},this.baseEvent()),{event:$,type:"track",properties:A!==null&&A!==void 0?A:{},options:q9({},L),integrations:q9({},I)}))},H.prototype.page=function($,A,L,I,D){var B,f={type:"page",properties:q9({},L),options:q9({},I),integrations:q9({},D)};if($!==null)f.category=$,f.properties=(B=f.properties)!==null&&B!==void 0?B:{},f.properties.category=$;if(A!==null)f.name=A;return this.normalize(q9(q9({},this.baseEvent()),f))},H.prototype.screen=function($,A,L,I,D){var B={type:"screen",properties:q9({},L),options:q9({},I),integrations:q9({},D)};if($!==null)B.category=$;if(A!==null)B.name=A;return this.normalize(q9(q9({},this.baseEvent()),B))},H.prototype.identify=function($,A,L,I){return this.normalize(q9(q9({},this.baseEvent()),{type:"identify",userId:$,traits:A!==null&&A!==void 0?A:{},options:q9({},L),integrations:I}))},H.prototype.group=function($,A,L,I){return this.normalize(q9(q9({},this.baseEvent()),{type:"group",traits:A!==null&&A!==void 0?A:{},options:q9({},L),integrations:q9({},I),groupId:$}))},H.prototype.alias=function($,A,L,I){var D={userId:$,type:"alias",options:q9({},L),integrations:q9({},I)};if(A!==null)D.previousId=A;if($===void 0)return this.normalize(q9(q9({},D),this.baseEvent()));return this.normalize(q9(q9({},this.baseEvent()),D))},H.prototype.baseEvent=function(){var $={integrations:{},options:{}};if(!this.user)return $;var A=this.user;if(A.id())$.userId=A.id();if(A.anonymousId())$.anonymousId=A.anonymousId();return $},H.prototype.context=function($){var A,L=["userId","anonymousId","timestamp"];delete $.integrations;var I=Object.keys($),D=(A=$.context)!==null&&A!==void 0?A:{},B={};return I.forEach(function(f){if(f==="context")return;if(L.includes(f))RbH(B,f,$[f]);else RbH(D,f,$[f])}),[D,B]},H.prototype.normalize=function($){var A,L,I=Object.keys((A=$.integrations)!==null&&A!==void 0?A:{}).reduce(function(J,F){var Q,W;return q9(q9({},J),(Q={},Q[F]=Boolean((W=$.integrations)===null||W===void 0?void 0:W[F]),Q))},{});$.options=PJD($.options||{},function(J,F){return F!==void 0});var D=q9(q9({},I),(L=$.options)===null||L===void 0?void 0:L.integrations),B=$.options?this.context($.options):[],f=B[0],E=B[1],M=$.options,G=xvL($,["options"]),U=q9(q9(q9({timestamp:new Date},G),{integrations:D,context:f}),E),X=q9(q9({},U),{messageId:this.createMessageId()});return YJD(X),X},H}()});function wwA(H,$){return new Promise(function(A,L){var I=setTimeout(function(){L(Error("Promise timed out"))},$);H.then(function(D){return clearTimeout(I),A(D)}).catch(L)})}function xs9(H){return new Promise(function($){return setTimeout($,H)})}function ZJD(H,$,A){var L=function(){try{return Promise.resolve($(H))}catch(I){return Promise.reject(I)}};return xs9(A).then(function(){return wwA(L(),1000)}).catch(function(I){H===null||H===void 0||H.log("warn","Callback Error",{error:I}),H===null||H===void 0||H.stats.increment("callback_error")}).then(function(){return H})}var qJD=function(){var H,$,A=new Promise(function(L,I){H=L,$=I});return{resolve:H,reject:$,promise:A}};var TJD=()=>{};var $t;var zJD=K(()=>{$t=function(){function H($){var A;this.callbacks={},this.warned=!1,this.maxListeners=(A=$===null||$===void 0?void 0:$.maxListeners)!==null&&A!==void 0?A:10}return H.prototype.warnIfPossibleMemoryLeak=function($){if(this.warned)return;if(this.maxListeners&&this.callbacks[$].length>this.maxListeners)console.warn("Event Emitter: Possible memory leak detected; ".concat(String($)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0},H.prototype.on=function($,A){if(!this.callbacks[$])this.callbacks[$]=[A];else this.callbacks[$].push(A),this.warnIfPossibleMemoryLeak($);return this},H.prototype.once=function($,A){var L=this,I=function(){var D=[];for(var B=0;B{zJD()});var c7H=K(()=>{TJD();NJD()});function ybH(H){var $=Math.random()+1,A=H.minTimeout,L=A===void 0?500:A,I=H.factor,D=I===void 0?2:I,B=H.attempt,f=H.maxTimeout,E=f===void 0?1/0:f;return Math.min($*L*Math.pow(D,B),E)}var ZwA="onRemoveFromFuture",OJD;var qwA=K(()=>{C2();c7H();OJD=function(H){qi($,H);function $(A,L,I){var D=H.call(this)||this;return D.future=[],D.maxAttempts=A,D.queue=L,D.seen=I!==null&&I!==void 0?I:{},D}return $.prototype.push=function(){var A=this,L=[];for(var I=0;IA.maxAttempts||A.includes(B))return!1;return A.queue.push(B),!0});return this.queue=this.queue.sort(function(B,f){return A.getAttempts(B)-A.getAttempts(f)}),D},$.prototype.pushWithBackoff=function(A){var L=this;if(this.getAttempts(A)===0)return this.push(A)[0];var I=this.updateAttempts(A);if(I>this.maxAttempts||this.includes(A))return!1;var D=ybH({attempt:I-1});return setTimeout(function(){L.queue.push(A),L.future=L.future.filter(function(B){return B.id!==A.id}),L.emit(ZwA)},D),this.future.push(A),!0},$.prototype.getAttempts=function(A){var L;return(L=this.seen[A.id])!==null&&L!==void 0?L:0},$.prototype.updateAttempts=function(A){return this.seen[A.id]=this.getAttempts(A)+1,this.getAttempts(A)},$.prototype.includes=function(A){return this.queue.includes(A)||this.future.includes(A)||Boolean(this.queue.find(function(L){return L.id===A.id}))||Boolean(this.future.find(function(L){return L.id===A.id}))},$.prototype.pop=function(){return this.queue.shift()},Object.defineProperty($.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),$}($t)});function H9H(){var H=0,$,A="";if(!B_$||e0H+16>256){B_$=Array(H=256);while(H--)B_$[H]=256*Math.random()|0;H=e0H=0}for(;H<16;H++){if($=B_$[e0H+H],H==6)A+=f_$[$&15|64];else if(H==8)A+=f_$[$&63|128];else A+=f_$[$];if(H&1&&H>1&&H<11)A+="-"}return e0H++,A}var e0H=256,f_$,B_$;var TwA=K(()=>{f_$=[];while(e0H--)f_$[e0H]=(e0H+256).toString(16).substring(1)});var xJD;var SJD=K(()=>{C2();xJD=function(){function H(){this._logs=[]}return H.prototype.log=function($,A,L){var I=new Date;this._logs.push({level:$,message:A,time:I,extras:L})},Object.defineProperty(H.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),H.prototype.flush=function(){if(this.logs.length>1){var $=this._logs.reduce(function(A,L){var I,D,B,f=q9(q9({},L),{json:JSON.stringify(L.extras,null," "),extras:L.extras});delete f.time;var E=(B=(D=L.time)===null||D===void 0?void 0:D.toISOString())!==null&&B!==void 0?B:"";if(A[E])E="".concat(E,"-").concat(Math.random());return q9(q9({},A),(I={},I[E]=f,I))},{});if(console.table)console.table($);else console.log($)}else this.logs.forEach(function(A){var{level:L,message:I,extras:D}=A;if(L==="info"||L==="debug")console.log(I,D!==null&&D!==void 0?D:"");else console[L](I,D!==null&&D!==void 0?D:"")});this._logs=[]},H}()});var Ss9=function(H){var $={gauge:"g",counter:"c"};return $[H]},js9,jJD;var zwA=K(()=>{C2();js9=function(){function H(){this.metrics=[]}return H.prototype.increment=function($,A,L){if(A===void 0)A=1;this.metrics.push({metric:$,value:A,tags:L!==null&&L!==void 0?L:[],type:"counter",timestamp:Date.now()})},H.prototype.gauge=function($,A,L){this.metrics.push({metric:$,value:A,tags:L!==null&&L!==void 0?L:[],type:"gauge",timestamp:Date.now()})},H.prototype.flush=function(){var $=this.metrics.map(function(A){return q9(q9({},A),{tags:A.tags.join(",")})});if(console.table)console.table($);else console.log($);this.metrics=[]},H.prototype.serialize=function(){return this.metrics.map(function($){return{m:$.metric,v:$.value,t:$.tags,k:Ss9($.type),e:$.timestamp}})},H}(),jJD=function(H){qi($,H);function $(){return H!==null&&H.apply(this,arguments)||this}return $.prototype.gauge=function(){var A=[];for(var L=0;L{TwA();SJD();zwA();l7H=function(){function H($){var A,L,I;this.retry=(A=$.retry)!==null&&A!==void 0?A:!0,this.type=(L=$.type)!==null&&L!==void 0?L:"plugin Error",this.reason=(I=$.reason)!==null&&I!==void 0?I:""}return H}(),$9H=function(){function H($,A,L,I){if(A===void 0)A=H9H();if(L===void 0)L=new jJD;if(I===void 0)I=new xJD;this.attempts=0,this.event=$,this._id=A,this.logger=I,this.stats=L}return H.system=function(){},H.prototype.isSame=function($){return $.id===this.id},H.prototype.cancel=function($){if($)throw $;throw new l7H({reason:"Context Cancel"})},H.prototype.log=function($,A,L){this.logger.log($,A,L)},Object.defineProperty(H.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),H.prototype.updateEvent=function($,A){var L;if($.split(".")[0]==="integrations"){var I=$.split(".")[1];if(((L=this.event.integrations)===null||L===void 0?void 0:L[I])===!1)return this.event}return RbH(this.event,$,A),this.event},H.prototype.failedDelivery=function(){return this._failedDelivery},H.prototype.setFailedDelivery=function($){this._failedDelivery=$},H.prototype.logs=function(){return this.logger.logs},H.prototype.flush=function(){this.logger.flush(),this.stats.flush()},H.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},H}()});function RJD(H,$){var A={};return H.forEach(function(L){var I,D=void 0;if(typeof $==="string"){var B=L[$];D=typeof B!=="string"?JSON.stringify(B):B}else if($ instanceof Function)D=$(L);if(D===void 0)return;A[D]=wHA(wHA([],(I=A[D])!==null&&I!==void 0?I:[],!0),[L],!1)}),A}var yJD=K(()=>{C2()});var vJD=function(H){return typeof H==="object"&&H!==null&&"then"in H&&typeof H.then==="function"};var hJD=function(){var H,$,A=0;return{done:function(){return H},run:function(L){var I=L();if(vJD(I)){if(++A===1)H=new Promise(function(D){return $=D});I.finally(function(){return--A===0&&$()})}return I}}};var bJD=()=>{};function Rs9(H){return OV(this,void 0,void 0,function(){var $;return xV(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),[4,H()];case 1:return[2,A.sent()];case 2:return $=A.sent(),[2,Promise.reject($)];case 3:return[2]}})})}function vbH(H,$){H.log("debug","plugin",{plugin:$.name});var A=new Date().getTime(),L=$[H.event.type];if(L===void 0)return Promise.resolve(H);var I=Rs9(function(){return L.apply($,[H])}).then(function(D){var B=new Date().getTime()-A;return D.stats.gauge("plugin_time",B,["plugin:".concat($.name)]),D}).catch(function(D){if(D instanceof l7H&&D.type==="middleware_cancellation")throw D;if(D instanceof l7H)return H.log("warn",D.type,{plugin:$.name,error:D}),D;return H.log("error","plugin Error",{plugin:$.name,error:D}),H.stats.increment("plugin_error",1,["plugin:".concat($.name)]),D});return I}function kJD(H,$){return vbH(H,$).then(function(A){if(A instanceof $9H)return A;H.log("debug","Context canceled"),H.stats.increment("context_canceled"),H.cancel(A)})}var NwA=K(()=>{C2();E_$()});var uJD;var gJD=K(()=>{C2();yJD();qwA();E_$();c7H();bJD();NwA();uJD=function(H){qi($,H);function $(A){var L=H.call(this)||this;return L.criticalTasks=hJD(),L.plugins=[],L.failedInitializations=[],L.flushing=!1,L.queue=A,L.queue.on(ZwA,function(){L.scheduleFlush(0)}),L}return $.prototype.register=function(A,L,I){return OV(this,void 0,void 0,function(){var D=this;return xV(this,function(B){switch(B.label){case 0:return[4,Promise.resolve(L.load(A,I)).then(function(){D.plugins.push(L)}).catch(function(f){if(L.type==="destination"){D.failedInitializations.push(L.name),console.warn(L.name,f),A.log("warn","Failed to load destination",{plugin:L.name,error:f});return}throw f})];case 1:return B.sent(),[2]}})})},$.prototype.deregister=function(A,L,I){return OV(this,void 0,void 0,function(){var D;return xV(this,function(B){switch(B.label){case 0:if(B.trys.push([0,3,,4]),!L.unload)return[3,2];return[4,Promise.resolve(L.unload(A,I))];case 1:B.sent(),B.label=2;case 2:return this.plugins=this.plugins.filter(function(f){return f.name!==L.name}),[3,4];case 3:return D=B.sent(),A.log("warn","Failed to unload destination",{plugin:L.name,error:D}),[3,4];case 4:return[2]}})})},$.prototype.dispatch=function(A){return OV(this,void 0,void 0,function(){var L;return xV(this,function(I){return A.log("debug","Dispatching"),A.stats.increment("message_dispatched"),this.queue.push(A),L=this.subscribeToDelivery(A),this.scheduleFlush(0),[2,L]})})},$.prototype.subscribeToDelivery=function(A){return OV(this,void 0,void 0,function(){var L=this;return xV(this,function(I){return[2,new Promise(function(D){var B=function(f,E){if(f.isSame(A))if(L.off("flush",B),E)D(f);else D(f)};L.on("flush",B)})]})})},$.prototype.dispatchSingle=function(A){return OV(this,void 0,void 0,function(){var L=this;return xV(this,function(I){return A.log("debug","Dispatching"),A.stats.increment("message_dispatched"),this.queue.updateAttempts(A),A.attempts=1,[2,this.deliver(A).catch(function(D){var B=L.enqueuRetry(D,A);if(!B)return A.setFailedDelivery({reason:D}),A;return L.subscribeToDelivery(A)})]})})},$.prototype.isEmpty=function(){return this.queue.length===0},$.prototype.scheduleFlush=function(A){var L=this;if(A===void 0)A=500;if(this.flushing)return;this.flushing=!0,setTimeout(function(){L.flush().then(function(){setTimeout(function(){if(L.flushing=!1,L.queue.length)L.scheduleFlush(0)},0)})},A)},$.prototype.deliver=function(A){return OV(this,void 0,void 0,function(){var L,I,D,B;return xV(this,function(f){switch(f.label){case 0:return[4,this.criticalTasks.done()];case 1:f.sent(),L=Date.now(),f.label=2;case 2:return f.trys.push([2,4,,5]),[4,this.flushOne(A)];case 3:return A=f.sent(),I=Date.now()-L,this.emit("delivery_success",A),A.stats.gauge("delivered",I),A.log("debug","Delivered",A.event),[2,A];case 4:throw D=f.sent(),B=D,A.log("error","Failed to deliver",B),this.emit("delivery_failure",A,B),A.stats.increment("delivery_failed"),D;case 5:return[2]}})})},$.prototype.enqueuRetry=function(A,L){var I=!(A instanceof l7H)||A.retry;if(!I)return!1;return this.queue.pushWithBackoff(L)},$.prototype.flush=function(){return OV(this,void 0,void 0,function(){var A,L,I;return xV(this,function(D){switch(D.label){case 0:if(this.queue.length===0)return[2,[]];if(A=this.queue.pop(),!A)return[2,[]];A.attempts=this.queue.getAttempts(A),D.label=1;case 1:return D.trys.push([1,3,,4]),[4,this.deliver(A)];case 2:return A=D.sent(),this.emit("flush",A,!0),[3,4];case 3:if(L=D.sent(),I=this.enqueuRetry(L,A),!I)A.setFailedDelivery({reason:L}),this.emit("flush",A,!1);return[2,[]];case 4:return[2,[A]]}})})},$.prototype.isReady=function(){return!0},$.prototype.availableExtensions=function(A){var L=this.plugins.filter(function(J){var F,Q,W;if(J.type!=="destination"&&J.name!=="Segment.io")return!0;var P=void 0;return(F=J.alternativeNames)===null||F===void 0||F.forEach(function(C){if(A[C]!==void 0)P=A[C]}),(W=(Q=A[J.name])!==null&&Q!==void 0?Q:P)!==null&&W!==void 0?W:(J.name==="Segment.io"?!0:A.All)!==!1}),I=RJD(L,"type"),D=I.before,B=D===void 0?[]:D,f=I.enrichment,E=f===void 0?[]:f,M=I.destination,G=M===void 0?[]:M,U=I.after,X=U===void 0?[]:U;return{before:B,enrichment:E,destinations:G,after:X}},$.prototype.flushOne=function(A){var L,I;return OV(this,void 0,void 0,function(){var D,B,f,E,M,G,F,U,X,J,F,Q,W,P,C;return xV(this,function(Y){switch(Y.label){case 0:if(!this.isReady())throw Error("Not ready");if(A.attempts>1)this.emit("delivery_retry",A);D=this.availableExtensions((L=A.event.integrations)!==null&&L!==void 0?L:{}),B=D.before,f=D.enrichment,E=0,M=B,Y.label=1;case 1:if(!(E{};function pJD(H,$,A,L){return OV(this,void 0,void 0,function(){var I,D;return xV(this,function(B){switch(B.label){case 0:if(A.emit("dispatch_start",H),I=Date.now(),!$.isEmpty())return[3,2];return[4,$.dispatchSingle(H)];case 1:return D=B.sent(),[3,4];case 2:return[4,$.dispatch(H)];case 3:D=B.sent(),B.label=4;case 4:if(!(L===null||L===void 0?void 0:L.callback))return[3,6];return[4,ZJD(D,L.callback,ys9(I,L.timeout))];case 5:D=B.sent(),B.label=6;case 6:if(L===null||L===void 0?void 0:L.debug)D.flush();return[2,D]}})})}var ys9=function(H,$){var A=Date.now()-H;return Math.max(($!==null&&$!==void 0?$:300)-A,0)};var dJD=K(()=>{C2()});function cJD(H){var $=H.constructor.prototype;for(var A=0,L=Object.getOwnPropertyNames($);A{WJD();VJD();QwA();wJD();qwA();E_$();gJD();mJD();dJD();WwA();CwA();zwA();NwA()});var lJD=(H)=>{if(!H.writeKey)throw new PS("writeKey","writeKey is missing.")};var iJD=K(()=>{At()});var M_$="1.3.0";var vs9=(H)=>H.replace(/\/$/,""),nJD=(H,$)=>{return vs9(new URL($||"",H).href)};var OwA=K(()=>{TwA()});class xwA{constructor(H){this.id=H9H(),this.items=[],this.sizeInBytes=0,this.maxEventCount=Math.max(1,H)}tryAdd(H){if(this.length===this.maxEventCount)return{success:!1,message:`Event limit of ${this.maxEventCount} has been exceeded.`};let $=this.calculateSize(H.context);if($>rJD*1024)return{success:!1,message:`Event exceeds maximum event size of ${rJD} KB`};if(this.sizeInBytes+$>aJD*1024)return{success:!1,message:`Event has caused batch size to exceed ${aJD} KB`};return this.items.push(H),this.sizeInBytes+=$,{success:!0}}get length(){return this.items.length}calculateSize(H){return Buffer.byteLength(JSON.stringify(H.event),"utf8")}getEvents(){return this.items.map(({context:$})=>$.event)}getContexts(){return this.items.map((H)=>H.context)}resolveEvents(){this.items.forEach(({resolver:H,context:$})=>H($))}}var rJD=32,aJD=480;var oJD=K(()=>{OwA()});var tJD,sJD=(H)=>{return tJD.Buffer.from(H).toString("base64")};var eJD=K(()=>{tJD=require("buffer")});function hs9(H){return new Promise(($)=>setTimeout($,H))}function hbH(){}class SwA{constructor({host:H,path:$,maxRetries:A,flushAt:L,flushInterval:I,writeKey:D,httpRequestTimeout:B,httpClient:f,disable:E},M){this._emitter=M,this._maxRetries=A,this._flushAt=Math.max(L,1),this._flushInterval=I,this._auth=sJD(`${D}:`),this._url=nJD(H??"https://api.segment.io",$??"/v1/batch"),this._httpRequestTimeout=B??1e4,this._disable=Boolean(E),this._httpClient=f}createBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout);let H=new xwA(this._flushAt);return this._batch=H,this.pendingFlushTimeout=setTimeout(()=>{if(H===this._batch)this._batch=void 0;if(this.pendingFlushTimeout=void 0,H.length)this.send(H).catch(hbH)},this._flushInterval),H}clearBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout),this._batch=void 0}flush(H){if(!H)return;if(this._flushPendingItemsCount=H,!this._batch)return;if(this._batch.length===H)this.send(this._batch).catch(hbH),this.clearBatch()}enqueue(H){let $=this._batch??this.createBatch(),{promise:A,resolve:L}=qJD(),I={context:H,resolver:L};if($.tryAdd(I).success){let E=$.length===this._flushPendingItemsCount;if($.length===this._flushAt||E)this.send($).catch(hbH),this.clearBatch();return A}if($.length)this.send($).catch(hbH),this.clearBatch();let B=this.createBatch(),f=B.tryAdd(I);if(f.success){if(B.length===this._flushPendingItemsCount)this.send(B).catch(hbH),this.clearBatch();return A}else return H.setFailedDelivery({reason:Error(f.message)}),Promise.resolve(H)}async send(H){if(this._flushPendingItemsCount)this._flushPendingItemsCount-=H.length;let $=H.getEvents(),A=this._maxRetries+1,L=0;while(L=200&&B.status<300){H.resolveEvents();return}else if(B.status===400){HFD(H,Error(`[${B.status}] ${B.statusText}`));return}else I=Error(`[${B.status}] ${B.statusText}`)}catch(D){I=D}if(L===A){HFD(H,I);return}await hs9(ybH({attempt:L,minTimeout:25,maxTimeout:1000}))}}}function HFD(H,$){H.getContexts().forEach((A)=>A.setFailedDelivery({reason:$})),H.resolveEvents()}var $FD=K(()=>{At();c7H();oJD();eJD()});var G_$=()=>{if(typeof process==="object"&&process&&typeof process.env==="object"&&process.env&&typeof process.version==="string")return"node";if(typeof window==="object")return"browser";if(typeof WebSocketPair<"u")return"cloudflare-worker";if(typeof EdgeRuntime==="string")return"vercel-edge";if(typeof WorkerGlobalScope<"u"&&typeof importScripts==="function")return"web-worker";return"unknown"};function bs9(H){H.updateEvent("context.library.name","@segment/analytics-node"),H.updateEvent("context.library.version",M_$);let $=G_$();if($==="node")H.updateEvent("_metadata.nodeVersion",process.version);H.updateEvent("_metadata.jsRuntime",$)}function ks9(H){function $(A){return bs9(A),H.enqueue(A)}return{name:"Segment.io",type:"destination",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),alias:$,group:$,identify:$,page:$,screen:$,track:$}}var AFD=(H,$)=>{let A=new SwA(H,$);return{publisher:A,plugin:ks9(A)}};var LFD=K(()=>{$FD()});var IFD=()=>{return`node-next-${Date.now()}-${H9H()}`};var DFD=K(()=>{OwA()});var jwA;var BFD=K(()=>{At();DFD();jwA=class jwA extends CJD{constructor(){super({createMessageId:IFD})}}});var A9H;var U_$=K(()=>{At();A9H=class A9H extends $9H{static system(){return new this({type:"track",event:"system"})}}});var us9=(H)=>($)=>{let A=$.failedDelivery();return A?H(A.reason,$):H(void 0,$)},fFD=async(H,$,A,L)=>{try{let I=new A9H(H),D=await pJD(I,$,A,{...L?{callback:us9(L)}:{}}),B=D.failedDelivery();if(B)A.emit("error",{code:"delivery_failure",reason:B.reason,ctx:D});else A.emit(H.type,D)}catch(I){A.emit("error",{code:"unknown",reason:I})}};var EFD=K(()=>{At();U_$()});var RwA;var MFD=K(()=>{c7H();RwA=class RwA extends $t{}});var GFD,ywA;var UFD=K(()=>{At();GFD=class GFD extends OJD{constructor(){super(1,[])}getAttempts(H){return H.attempts??0}updateAttempts(H){return H.attempts=this.getAttempts(H)+1,this.getAttempts(H)}};ywA=class ywA extends uJD{constructor(){super(new GFD)}}});var XFD,JFD,FFD=(H)=>{if(G_$()==="cloudflare-worker")return[];let $=new(globalThis.AbortController||JFD),A=setTimeout(()=>{$.abort()},H);return A?.unref?.(),[$.signal,A]};var KFD=K(()=>{c7H();XFD=class XFD{constructor(){this.onabort=null,this.aborted=!1,this.eventEmitter=new $t}toString(){return"[object AbortSignal]"}get[Symbol.toStringTag](){return"AbortSignal"}removeEventListener(...H){this.eventEmitter.off(...H)}addEventListener(...H){this.eventEmitter.on(...H)}dispatchEvent(H){let $={type:H,target:this},A=`on${H}`;if(typeof this[A]==="function")this[A]($);this.eventEmitter.emit(H,$)}};JFD=class JFD{constructor(){this.signal=new XFD}abort(){if(this.signal.aborted)return;this.signal.aborted=!0,this.signal.dispatchEvent("abort")}toString(){return"[object AbortController]"}get[Symbol.toStringTag](){return"AbortController"}}});var QFD=async(...H)=>{if(globalThis.fetch)return globalThis.fetch(...H);else if(typeof EdgeRuntime!=="string")return(await import("node-fetch")).default(...H);else throw Error("Invariant: an edge runtime that does not support fetch should not exist")};class bbH{constructor(H){this._fetch=H??QFD}async makeRequest(H){let[$,A]=FFD(H.httpRequestTimeout),L={url:H.url,method:H.method,headers:H.headers,body:JSON.stringify(H.data),signal:$};return this._fetch(H.url,L).finally(()=>clearTimeout(A))}}var vwA=K(()=>{KFD()});var kbH;var hwA=K(()=>{At();iJD();LFD();BFD();EFD();MFD();U_$();UFD();vwA();kbH=class kbH extends RwA{constructor(H){super();this._isClosed=!1,this._pendingEvents=0,this._isFlushing=!1,lJD(H),this._eventFactory=new jwA,this._queue=new ywA;let $=H.flushInterval??1e4;this._closeAndFlushDefaultTimeout=$*1.25;let{plugin:A,publisher:L}=AFD({writeKey:H.writeKey,host:H.host,path:H.path,maxRetries:H.maxRetries??3,flushAt:H.flushAt??H.maxEventsInBatch??15,httpRequestTimeout:H.httpRequestTimeout,disable:H.disable,flushInterval:$,httpClient:typeof H.httpClient==="function"?new bbH(H.httpClient):H.httpClient??new bbH},this);this._publisher=L,this.ready=this.register(A).then(()=>{return}),this.emit("initialize",H),cJD(this)}get VERSION(){return M_$}closeAndFlush({timeout:H=this._closeAndFlushDefaultTimeout}={}){return this.flush({timeout:H,close:!0})}async flush({timeout:H,close:$=!1}={}){if(this._isFlushing){console.warn("Overlapping flush calls detected. Please wait for the previous flush to finish before calling .flush again");return}else this._isFlushing=!0;if($)this._isClosed=!0;this._publisher.flush(this._pendingEvents);let A=new Promise((L)=>{if(!this._pendingEvents)L();else this.once("drained",()=>{L()})}).finally(()=>{this._isFlushing=!1});return H?wwA(A,H).catch(()=>{return}):A}_dispatch(H,$){if(this._isClosed){this.emit("call_after_close",H);return}this._pendingEvents++,fFD(H,this._queue,this,$).catch((A)=>A).finally(()=>{if(this._pendingEvents--,!this._pendingEvents)this.emit("drained")})}alias({userId:H,previousId:$,context:A,timestamp:L,integrations:I},D){let B=this._eventFactory.alias(H,$,{context:A,integrations:I,timestamp:L});this._dispatch(B,D)}group({timestamp:H,groupId:$,userId:A,anonymousId:L,traits:I={},context:D,integrations:B},f){let E=this._eventFactory.group($,I,{context:D,anonymousId:L,userId:A,timestamp:H,integrations:B});this._dispatch(E,f)}identify({userId:H,anonymousId:$,traits:A={},context:L,timestamp:I,integrations:D},B){let f=this._eventFactory.identify(H,A,{context:L,anonymousId:$,userId:H,timestamp:I,integrations:D});this._dispatch(f,B)}page({userId:H,anonymousId:$,category:A,name:L,properties:I,context:D,timestamp:B,integrations:f},E){let M=this._eventFactory.page(A??null,L??null,I,{context:D,anonymousId:$,userId:H,timestamp:B,integrations:f});this._dispatch(M,E)}screen({userId:H,anonymousId:$,category:A,name:L,properties:I,context:D,timestamp:B,integrations:f},E){let M=this._eventFactory.screen(A??null,L??null,I,{context:D,anonymousId:$,userId:H,timestamp:B,integrations:f});this._dispatch(M,E)}track({userId:H,anonymousId:$,event:A,properties:L,context:I,timestamp:D,integrations:B},f){let E=this._eventFactory.track(A,L,{context:I,userId:H,anonymousId:$,timestamp:D,integrations:B});this._dispatch(E,f)}register(...H){return this._queue.criticalTasks.run(async()=>{let $=A9H.system(),A=H.map((L)=>this._queue.register($,L,this));await Promise.all(A),this.emit("register",H.map((L)=>L.name))})}async deregister(...H){let $=A9H.system(),A=H.map((L)=>{let I=this._queue.plugins.find((D)=>D.name===L);if(I)return this._queue.deregister($,I,this);else $.log("warn",`plugin ${L} not found`)});await Promise.all(A),this.emit("deregister",H)}}});var WFD=K(()=>{hwA();U_$();vwA();hwA()});function ms9(){return gs9.production}async function ps9(){if(NP())return!1;return!0}async function bwA(H,$){let A=await VFD();if(!A)return;try{let L=uwA(),I=T9(),D=await VKH({model:$.model}),B=QqI(D,$),f={anonymousId:L,event:H,properties:B};if(I){let E=nm(!0);f.userId=E.deviceId,f.properties.accountUuid=I.accountUuid,f.properties.organizationUuid=I.organizationUuid}A.track(f)}catch(L){r(L instanceof Error?L:Error(String(L)))}}async function PFD(H){let $=await VFD();if(!$)return;try{let A=uwA(),L=T9(),I={anonymousId:A,traits:H};if(L){let D=nm(!0);I.userId=D.deviceId}$.identify(I)}catch(A){r(A instanceof Error?A:Error(String(A)))}}var gs9,X_$=null,VFD;var kwA=K(()=>{WFD();tD();ELH();vA();_$();EI();R4();Fo();gs9={production:"LKJN8LsLERHEOXkw487o7qCTFOrGPimI",development:"b64sf1kxwDGe1PiSAlv5ixuH0f509RKK"};VFD=o$(async()=>{if(!await ps9())return null;try{return X_$=new kbH({writeKey:ms9()}),process.on("beforeExit",async()=>{await X_$?.closeAndFlush()}),process.on("exit",()=>{X_$?.closeAndFlush()}),X_$}catch($){return r($ instanceof Error?$:Error(String($))),null}})});var _FD={};XA(_FD,{call:()=>cs9,Login:()=>i7H});function ds9(){let H=T9();if(!H)return{};return{email:H.emailAddress,account_uuid:H.accountUuid,organization_uuid:H.organizationUuid}}async function cs9(H,$){return Z3.createElement(i7H,{onDone:async(A)=>{if($.onChangeAPIKey(),$.setMessages(YFD),A)MEH(),PFD(ds9()),G7$(),vU$(),$.setAppState((L)=>({...L,authVersion:L.authVersion+1}));H(A?"Login successful":"Login interrupted")}})}function i7H(H){let $=Ht(),A=zB(()=>H.onDone(!1,$));return BA("confirm:no",()=>H.onDone(!1,$),{context:"Confirmation"}),Z3.createElement(x,{flexDirection:"column",marginTop:1},Z3.createElement(s0H,{onDone:()=>H.onDone(!0,$),startingMessage:H.startingMessage}),Z3.createElement(x,{marginLeft:1},Z3.createElement(V,{dimColor:!0},A.pending?Z3.createElement(Z3.Fragment,null,"Press ",A.keyName," again to exit"):"")))}var Z3;var J_$=K(()=>{SbH();UM();xH();$I();jbH();g$();_L();kwA();EI();zvH();XY();Z3=b(s(),1)});async function _S(){let H=C$();if(ubH.has(H))return ubH.get(H)??null;try{let $=await WwH();if(N(`Git remote URL: ${$}`),!$)return N("No git remote URL found"),ubH.set(H,null),null;let A=L9H($);return N(`Parsed repository: ${A} from URL: ${$}`),ubH.set(H,A),A}catch($){return N(`Error detecting repository: ${$}`),ubH.set(H,null),null}}function L9H(H){let $=H.trim(),A=/github\.com[:/]([^/]+)\/([^/]+)$/,L=$.match(A);if(L&&L[1]&&L[2]){let I=L[1],D=L[2].replace(/\.git$/,""),B=`${I}/${D}`;return N(`Parsed repository: ${B} from ${$}`),B}if(!$.includes("://")&&!$.includes("@")&&$.includes("/")){let I=$.split("/");if(I.length===2&&I[0]&&I[1]){let D=I[1].replace(/\.git$/,"");return`${I[0]}/${D}`}}return N(`Could not parse repository from: ${$}`),null}var ubH;var I9H=K(()=>{t8();E$();PI();ubH=new Map});function ls9(H){if(!nA.isAxiosError(H))return!1;if(!H.response)return!0;if(H.response.status>=500)return!0;return!1}async function is9(H,$){let A;for(let L=0;L<=gwA;L++)try{return await nA.get(H,$)}catch(I){if(A=I,!ls9(I))throw I;if(L>=gwA)throw N(`Teleport request failed after ${L+1} attempts: ${I instanceof Error?I.message:String(I)}`),I;let D=wFD[L]??2000;N(`Teleport request failed (attempt ${L+1}/${gwA+1}), retrying in ${D}ms: ${I instanceof Error?I.message:String(I)}`),await new Promise((B)=>setTimeout(B,D))}throw A}async function Zw(){let H=dD()?.accessToken;if(H===void 0)throw Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let $=await jR();if(!$)throw Error("Unable to get organization UUID");return{accessToken:H,orgUUID:$}}async function ZFD(){let{accessToken:H,orgUUID:$}=await Zw(),A=`${XD().BASE_API_URL}/v1/sessions`;try{let L={...xK(H),"x-organization-uuid":$},I=await is9(A,{headers:L});if(I.status!==200)throw Error(`Failed to fetch code sessions: ${I.statusText}`);return I.data.data.map((B)=>{let f=B.session_context.sources.find((M)=>M.type==="git_repository"),E=null;if(f?.url){let M=L9H(f.url);if(M){let[G,U]=M.split("/");if(G&&U)E={name:U,owner:{login:G},default_branch:f.revision||void 0}}}return{id:B.id,title:B.title||"Untitled",description:"",status:B.session_status,repo:E,turns:[],created_at:B.created_at,updated_at:B.updated_at}})}catch(L){let I=L instanceof Error?L:Error(String(L));throw r(I),L}}function xK(H){return{Authorization:`Bearer ${H}`,"Content-Type":"application/json","anthropic-version":"2023-06-01"}}async function gbH(H){let{accessToken:$,orgUUID:A}=await Zw(),L=`${XD().BASE_API_URL}/v1/sessions/${H}`,I={...xK($),"x-organization-uuid":A},D=await nA.get(L,{headers:I,timeout:15000,validateStatus:(B)=>B<500});if(D.status!==200){let f=D.data?.error?.message;if(D.status===404)throw Error(`Session not found: ${H}`);if(D.status===401)throw Error("Session expired. Please run /login to sign in again.");throw Error(f||`Failed to fetch session: ${D.status} ${D.statusText}`)}return D.data}function mwA(H){return H.session_context.outcomes?.find((A)=>A.type==="git_repository")?.git_info?.branches[0]}async function F_$(H,$){try{let{accessToken:A,orgUUID:L}=await Zw(),I=`${XD().BASE_API_URL}/v1/sessions/${H}/events`,D={...xK(A),"x-organization-uuid":L},f={events:[{uuid:CFD.randomUUID(),session_id:H,type:"user",parent_tool_use_id:null,message:{role:"user",content:$}}]};N(`[sendEventToRemoteSession] Sending event to session ${H}`);let E=await nA.post(I,f,{headers:D,validateStatus:(M)=>M<500});if(E.status===200||E.status===201)return N(`[sendEventToRemoteSession] Successfully sent event to session ${H}`),!0;return N(`[sendEventToRemoteSession] Failed with status ${E.status}: ${yH(E.data)}`),!1}catch(A){return N(`[sendEventToRemoteSession] Error: ${A instanceof Error?A.message:String(A)}`),!1}}var CFD,wFD,gwA,ns9,VvE;var YS=K(()=>{qE();EI();w1();Hq();_$();E$();I9H();mI();Z$();CFD=require("crypto"),wFD=[2000,4000,8000,16000],gwA=wFD.length;ns9=QD.object({id:QD.string(),title:QD.string(),description:QD.string(),status:QD.enum(["idle","working","waiting","completed","archived","cancelled","rejected"]),repo:QD.object({name:QD.string(),owner:QD.object({login:QD.string()}),default_branch:QD.string().optional()}).nullable(),turns:QD.array(QD.string()),created_at:QD.string(),updated_at:QD.string()}),VvE=QD.array(ns9)});async function qFD(H){let{accessToken:$,orgUUID:A}=await Zw(),L={...xK($),"x-organization-uuid":A},I=`${XD().BASE_API_URL}/api/oauth/organizations/${A}/admin_requests`;return(await nA.post(I,H,{headers:L})).data}async function TFD(H,$){let{accessToken:A,orgUUID:L}=await Zw(),I={...xK(A),"x-organization-uuid":L},D=`${XD().BASE_API_URL}/api/oauth/organizations/${L}/admin_requests/me?request_type=${H}`;for(let f of $)D+=`&statuses=${f}`;return(await nA.get(D,{headers:I})).data}var zFD=K(()=>{w1();qE();YS()});var OFD={};XA(OFD,{call:()=>pwA});async function pwA(H,$){if(!M$().hasVisitedExtraUsage)AA((E)=>({...E,hasVisitedExtraUsage:!0}));let A=f0(),L=A==="team"||A==="enterprise",I=my(),D=$T(),B=T9()?.hasExtraUsageEnabled===!0;if(!I&&L){if(D){try{let E=await TFD("limit_increase",["pending","dismissed"]);if(E&&E.length>0)return H("You have already submitted a request for extra usage to your admin."),null}catch(E){r(E)}try{return await qFD({request_type:"limit_increase",details:null}),H(B?"Request sent to your admin to increase extra usage.":"Request sent to your admin to enable extra usage."),null}catch(E){r(E)}}return H("Please contact your admin to manage extra usage settings."),null}let f=L?"https://claude.ai/admin-settings/usage":"https://claude.ai/settings/usage";try{return await HE(f),NFD.default.createElement(i7H,{startingMessage:"Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.",onDone:(E)=>{$.onChangeAPIKey(),H(E?"Login successful":"Login interrupted")}})}catch(E){r(E),H(`Failed to open browser. Please visit ${f} to see your extra usage.`)}return null}var NFD;var dwA=K(()=>{_$();EI();F3();J_$();vA();zFD();NFD=b(s(),1)});var rs9,Lt;var mbH=K(()=>{EI();vA();rs9={type:"local-jsx",name:"extra-usage",description:"Configure extra usage to keep working when limits are hit",isEnabled:()=>{if(process.env.DISABLE_EXTRA_USAGE_COMMAND)return!1;if(!HO())return!1;if($T())return!0;let H=f0();return H==="pro"||H==="max"},isHidden:!1,load:()=>Promise.resolve().then(() => (dwA(),OFD)),userFacingName(){return"extra-usage"}},Lt=rs9});function as9({shouldShowUpsell:H,isMax20x:$,isExtraUsageCommandEnabled:A,shouldAutoOpenRateLimitOptionsMenu:L,isTeamOrEnterprise:I,isC4WNotificationsEnabled:D,hasBillingAccess:B}){if(!H)return null;if($){if(A)return"/extra-usage to finish what you\u2019re working on.";return"/login to switch to an API usage-billed account."}if(L)return"Opening your options\u2026";if(!I&&!A)return"/upgrade to increase your usage limit.";if(I){if(!A)return null;if(B)return"/extra-usage to finish what you\u2019re working on.";if(D)return"/extra-usage to request more usage from your admin.";return"Contact your admin to request extra usage."}return"/upgrade or /extra-usage to finish what you\u2019re working on."}function xFD({text:H,onOpenRateLimitOptions:$}){let A=f0(),L=Ri(),I=$T(),D=A==="pro"||A==="max",B=A==="team"||A==="enterprise",f=L==="default_claude_max_20x",E=(jGH()||nL())&&(D||I),M=E&&!f,[G,U]=n7H.useState(!1),X=Zr(),J=X.status==="rejected"&&X.resetsAt!==void 0,F=M&&!G&&J&&$;n7H.useEffect(()=>{if(F)U(!0),$()},[F,$]);let Q=n7H.useMemo(()=>{let W=as9({shouldShowUpsell:E,isMax20x:f,isExtraUsageCommandEnabled:Lt.isEnabled(),shouldAutoOpenRateLimitOptionsMenu:!!F,isTeamOrEnterprise:B,isC4WNotificationsEnabled:I,hasBillingAccess:my()});if(!W)return null;return pbH.default.createElement(V,{dimColor:!0},W)},[E,f,B,I,F]);return pbH.default.createElement(HA,null,pbH.default.createElement(x,{flexDirection:"column"},pbH.default.createElement(V,{color:"error"},H),G?null:Q))}var pbH,n7H;var SFD=K(()=>{EI();ESH();xH();iB();mbH();vA();py();pbH=b(s(),1),n7H=b(s(),1)});function os9(){let H=b1L();return yf.default.createElement(HA,null,yf.default.createElement(x,{flexDirection:"column"},yf.default.createElement(V,{color:"error"},zU$),H&&yf.default.createElement(V,{dimColor:!0},"\xB7 Run in another terminal: security unlock-keychain")))}function jFD({param:{text:H},addMargin:$,shouldShowDot:A,onOpenRateLimitOptions:L}){if(K_$(H))return null;if(qWI(H))return yf.default.createElement(xFD,{text:H,onOpenRateLimitOptions:L});switch(H){case LDH:return null;case jg:{let I=pBH("warning");return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},"Context limit reached \xB7 /compact or /clear to continue",I?` \xB7 ${I}`:""))}case TU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},"Credit balance too low \xB7 Add funds: https://platform.claude.com/settings/billing"));case zU$:return yf.default.createElement(os9,null);case NU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},NU$));case OU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},OU$));case xU$:return yf.default.createElement(HA,{height:1},yf.default.createElement(V,{color:"error"},xU$,process.env.API_TIMEOUT_MS&&yf.default.createElement(yf.default.Fragment,null," ","(API_TIMEOUT_MS=",process.env.API_TIMEOUT_MS,"ms, try increasing it)")));case ADH:return yf.default.createElement(HA,null,yf.default.createElement(x,{flexDirection:"column",gap:1},yf.default.createElement(V,{color:"error"},"We are experiencing high demand for Opus 4."),yf.default.createElement(V,null,"To continue immediately, use /model to switch to"," ",hV(Oq())," and continue coding.")));case D9H:return yf.default.createElement(HA,{height:1},yf.default.createElement(Iv,null));default:if(H.startsWith(x5))return yf.default.createElement(HA,null,yf.default.createElement(V,{color:"error"},H===x5?`${x5}: Please wait a moment and try again.`:H));return yf.default.createElement(x,{alignItems:"flex-start",flexDirection:"row",justifyContent:"space-between",marginTop:$?1:0,width:"100%"},yf.default.createElement(x,{flexDirection:"row"},A&&yf.default.createElement(x,{minWidth:2},yf.default.createElement(V,{color:"text"},Zf)),yf.default.createElement(x,{flexDirection:"column"},yf.default.createElement(VJ,null,H))))}}var yf;var RFD=K(()=>{xH();ry();_L();p6();nx();iB();aI();dQ$();Cp();zFH();B4A();TwH();SFD();yf=b(s(),1)});function Q_$({param:{text:H},addMargin:$}){let A=VD(H,"bash-input");if(!A)return null;return wp.createElement(x,{flexDirection:"column",marginTop:$?1:0,width:"100%"},wp.createElement(x,null,wp.createElement(V,{backgroundColor:"bashMessageBackgroundColor",color:"bashBorder"},"!"),wp.createElement(V,{backgroundColor:"bashMessageBackgroundColor",color:"text"}," ",A," ")))}var wp;var cwA=K(()=>{xH();_L();wp=b(s(),1)});function yFD({addMargin:H,param:{text:$}}){let A=VD($,C6),L=VD($,"command-args"),I=VD($,"skill-format")==="true";if(!A)return null;if(I)return h7.createElement(x,{flexDirection:"column",marginTop:H?1:0,width:"100%"},h7.createElement(V,{backgroundColor:"userMessageBackground"},h7.createElement(V,{color:"subtle"},pH.pointer," "),h7.createElement(V,{color:"text"},"Skill(",A,") ")));let D=`/${[A,L].filter(Boolean).join(" ")}`;return h7.createElement(x,{flexDirection:"column",marginTop:H?1:0,width:"100%"},h7.createElement(V,{backgroundColor:"userMessageBackground"},h7.createElement(V,{color:"subtle"},pH.pointer," "),h7.createElement(V,{color:"text"},D," ")))}var h7;var vFD=K(()=>{jI();xH();_L();EE();h7=b(s(),1)});function hFD(H,$,A){return H.split(` }`;var b1=hmA(function(){return n1(nH,fB+"return "+RL).apply(H,X$)});if(b1.source=RL,ix$(b1))throw b1;return b1}function R4B(T){return CE(T).toLowerCase()}function y4B(T){return CE(T).toUpperCase()}function v4B(T,R,l){if(T=CE(T),T&&(l||R===H))return $X(T);if(!T||!(R=DV(R)))return T;var fH=wW(T),jH=wW(R),nH=M_(fH,jH),X$=Oj(fH,jH)+1;return xZ(fH,nH,X$).join("")}function h4B(T,R,l){if(T=CE(T),T&&(l||R===H))return T.slice(0,rd(T)+1);if(!T||!(R=DV(R)))return T;var fH=wW(T),jH=Oj(fH,wW(R))+1;return xZ(fH,0,jH).join("")}function b4B(T,R,l){if(T=CE(T),T&&(l||R===H))return T.replace(M9,"");if(!T||!(R=DV(R)))return T;var fH=wW(T),jH=M_(fH,wW(R));return xZ(fH,jH).join("")}function k4B(T,R){var l=u,fH=y;if(B5(R)){var jH="separator"in R?R.separator:jH;l="length"in R?C1(R.length):l,fH="omission"in R?DV(R.omission):fH}T=CE(T);var nH=T.length;if(TZ(T)){var X$=wW(T);nH=X$.length}if(l>=nH)return T;var q$=l-tK(fH);if(q$<1)return fH;var t$=X$?xZ(X$,0,q$).join(""):T.slice(0,q$);if(jH===H)return t$+fH;if(X$)q$+=t$.length-q$;if(nx$(jH)){if(T.slice(q$).search(jH)){var GL,KL=t$;if(!jH.global)jH=gb(jH.source,CE(WB.exec(jH))+"g");jH.lastIndex=0;while(GL=jH.exec(KL))var RL=GL.index;t$=t$.slice(0,RL===H?q$:RL)}}else if(T.indexOf(DV(jH),q$)!=q$){var nI=t$.lastIndexOf(jH);if(nI>-1)t$=t$.slice(0,nI)}return t$+fH}function u4B(T){return T=CE(T),T&&e$.test(T)?T.replace(I$,u8H):T}var g4B=Ic(function(T,R,l){return T+(l?" ":"")+R.toUpperCase()}),ox$=zcH("toUpperCase");function vmA(T,R,l){if(T=CE(T),R=l?H:R,R===H)return G_(T)?oE(T):vb(T);return T.match(R)||[]}var hmA=Y1(function(T,R){try{return qU(T,H,R)}catch(l){return ix$(l)?l:new u0(l)}}),m4B=fN(function(T,R){return aE(R,function(l){l=CM(l),OZ(T,l,RZ(T[l],T))}),T});function p4B(T){var R=T==null?0:T.length,l=sB();return T=!R?[]:hD(T,function(fH){if(typeof fH[1]!="function")throw new dJ(I);return[l(fH[0]),fH[1]]}),Y1(function(fH){var jH=-1;while(++jHGH)return[];var l=WH,fH=iJ(T,WH);R=sB(R),T-=WH;var jH=a8(fH,R);while(++l0||R<0))return new _1(l);if(T<0)l=l.takeRight(-T);else if(T)l=l.drop(T);if(R!==H)R=C1(R),l=R<0?l.dropRight(-R):l.take(R-T);return l},_1.prototype.takeRightWhile=function(T){return this.reverse().takeWhile(T).reverse()},_1.prototype.toArray=function(){return this.take(WH)},uC(_1.prototype,function(T,R){var l=/^(?:filter|find|map|reject)|While$/.test(R),fH=/^(?:head|last)$/.test(R),jH=iH[fH?"take"+(R=="last"?"Right":""):R],nH=fH||/^find/.test(R);if(!jH)return;iH.prototype[R]=function(){var X$=this.__wrapped__,q$=fH?[1]:arguments,t$=X$ instanceof _1,GL=q$[0],KL=t$||ND(X$),RL=function(Z8){var o8=jH.apply(iH,b9([Z8],q$));return fH&&nI?o8[0]:o8};if(KL&&l&&typeof GL=="function"&&GL.length!=1)t$=KL=!1;var nI=this.__chain__,fB=!!this.__actions__.length,O0=nH&&!nI,b1=t$&&!fB;if(!nH&&KL){X$=b1?X$:new _1(this);var x0=T.apply(X$,q$);return x0.__actions__.push({func:$HH,args:[RL],thisArg:H}),new aF(x0,nI)}if(O0&&b1)return T.apply(this,q$);return x0=this.thru(RL),O0?fH?x0.value()[0]:x0.value():x0}}),aE(["pop","push","shift","sort","splice","unshift"],function(T){var R=ez[T],l=/^(?:push|sort|unshift)$/.test(T)?"tap":"thru",fH=/^(?:pop|shift)$/.test(T);iH.prototype[T]=function(){var jH=arguments;if(fH&&!this.__chain__){var nH=this.value();return R.apply(ND(nH)?nH:[],jH)}return this[l](function(X$){return R.apply(ND(X$)?X$:[],jH)})}}),uC(_1.prototype,function(T,R){var l=iH[R];if(l){var fH=l.name+"";if(!C8.call(kC,fH))kC[fH]=[];kC[fH].push({name:R,func:l})}}),kC[EfH(H,Q).name]=[{name:"wrapper",func:H}],_1.prototype.clone=idH,_1.prototype.reverse=ndH,_1.prototype.value=rdH,iH.prototype.at=rJ,iH.prototype.chain=IX,iH.prototype.commit=Q6,iH.prototype.next=pC,iH.prototype.plant=dx$,iH.prototype.reverse=qfH,iH.prototype.toJSON=iH.prototype.valueOf=iH.prototype.value=TfH,iH.prototype.first=iH.prototype.head,sK)iH.prototype[sK]=Vc;return iH},zZ=J_H();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)rE._=zZ,define(function(){return zZ});else if(mJ)(mJ.exports=zZ)._=zZ,vC._=zZ;else rE._=zZ}).call(r7H)});function ts9(){return cFD.sample(["Got it.","Good to know.","Noted."])}function iFD({text:H,addMargin:$}){let A=VD(H,"user-memory-input"),L=lFD.useMemo(()=>ts9(),[]);if(!A)return null;return Tw.createElement(x,{flexDirection:"column",marginTop:$?1:0,width:"100%"},Tw.createElement(x,null,Tw.createElement(V,{color:"remember",backgroundColor:"memoryBackgroundColor"},"#"),Tw.createElement(V,{backgroundColor:"memoryBackgroundColor",color:"text"}," ",A," ")),Tw.createElement(HA,{height:1},Tw.createElement(V,{dimColor:!0},L)))}var Tw,cFD,lFD;var nFD=K(()=>{xH();_L();iB();Tw=b(s(),1),cFD=b(dFD(),1),lFD=b(s(),1)});function cbH({elapsedTimeSeconds:H,timeoutMs:$}){if(H===void 0&&!$)return null;let A=$?of($,{hideTrailingZeros:!0}):void 0;if(H===void 0)return W_$.default.createElement(V,{dimColor:!0},`(timeout ${A})`);let L=of(H*1000);if(A)return W_$.default.createElement(V,{dimColor:!0},`(${L} \xB7 timeout ${A})`);return W_$.default.createElement(V,{dimColor:!0},`(${L})`)}var W_$;var iwA=K(()=>{xH();Q9();W_$=b(s(),1)});function ss9(H){if(!H.match(/([\s\S]*?)<\/sandbox_violations>/))return{cleanedStderr:H};return{cleanedStderr:o4$(H).trim()}}function es9(H){let $=H.match(rFD);if(!$)return{cleanedStderr:H,cwdResetWarning:null};let A=$[1]??null;return{cleanedStderr:H.replace(rFD,"").trim(),cwdResetWarning:A}}function f9H({content:{stdout:H,stderr:$,isImage:A,returnCodeInterpretation:L,backgroundTaskId:I},verbose:D,timeoutMs:B}){let{cleanedStderr:f}=ss9($),{cleanedStderr:E,cwdResetWarning:M}=es9(f);if(A)return SP.default.createElement(HA,{height:1},SP.default.createElement(V,{dimColor:!0},"[Image data detected and sent to Claude]"));return SP.default.createElement(x,{flexDirection:"column"},H!==""?SP.default.createElement(Dv,{content:H,verbose:D}):null,E.trim()!==""?SP.default.createElement(Dv,{content:E,verbose:D,isError:!0}):null,M?SP.default.createElement(HA,null,SP.default.createElement(V,{dimColor:!0},M)):null,H===""&&E.trim()===""&&!M?SP.default.createElement(HA,{height:1},SP.default.createElement(V,{dimColor:!0},I?SP.default.createElement(SP.default.Fragment,null,"Running in the background"," ",SP.default.createElement(s$,{shortcut:"\u2193",action:"manage",parens:!0})):L||"(No content)")):null,B&&SP.default.createElement(HA,null,SP.default.createElement(cbH,{timeoutMs:B})))}var SP,rFD;var V_$=K(()=>{xH();OFH();iB();lB();iwA();SP=b(s(),1),rFD=/(?:^|\n)(Shell cwd was reset to .+)$/});function aFD({content:H,verbose:$}){let A=VD(H,"bash-stdout")??"",L=VD(H,"bash-stderr")??"";return nwA.createElement(f9H,{content:{stdout:A,stderr:L},verbose:!!$})}var nwA;var oFD=K(()=>{V_$();_L();nwA=b(s(),1)});function sFD({content:H}){let $=VD(H,"local-command-stdout"),A=VD(H,"local-command-stderr");if(!$&&!A)return b7.createElement(HA,null,b7.createElement(V,{dimColor:!0},qw));let L=[];if($?.trim())L.push(b7.createElement(tFD,{key:"stdout"},$.trim()));if(A?.trim())L.push(b7.createElement(tFD,{key:"stderr",isError:!0},A.trim()));return L}function tFD({children:H,isError:$}){return b7.createElement(x,{flexDirection:"row"},b7.createElement(V,{color:$?"error":"text"}," \u23BF "),b7.createElement(x,{flexDirection:"column",flexGrow:1},b7.createElement(VJ,null,H)))}var b7;var eFD=K(()=>{_L();xH();iB();nx();b7=b(s(),1)});function E9H({param:{text:H},addMargin:$}){let A=VD(H,"background-task-input");if(!A)return null;return Zp.createElement(x,{flexDirection:"column",marginTop:$?1:0,width:"100%"},Zp.createElement(x,null,Zp.createElement(V,{color:"background"},"&"),Zp.createElement(V,{dimColor:!0}," ",A)))}var Zp;var rwA=K(()=>{xH();_L();Zp=b(s(),1)});function HKD({content:H}){let $=VD(H,"background-task-output")??"";return lbH.createElement(HA,null,lbH.createElement(V,{dimColor:!0},$))}var lbH;var $KD=K(()=>{xH();_L();iB();lbH=b(s(),1)});function o7H(){return`claude-swarm-${process.pid}`}var kE="team-lead",eY="claude-swarm",a7H="swarm-view",q3="tmux",awA="claude-hidden",t7H="CLAUDE_CODE_TEAMMATE_COMMAND";var AKD,He9,HbE,$bE,$e9,AbE,LbE,Ae9,Le9,Ie9,De9,LKD,Be9,fe9,IbE,DbE,s7H,owA,twA,swA,BbE,e7H,Ee9,fbE,jP,Me9,Ge9,Ue9,Xe9,Je9,Fe9,Ke9,Qe9,We9,Ve9,Pe9,_e9,Ye9,Ce9,we9,Ze9,qe9,EbE,Te9,ze9,Ne9,Oe9,xe9,Se9,je9,Re9,ye9,ve9,he9,MbE,GbE,UbE,XbE,be9,JbE,FbE,KbE,QbE,ke9,ue9,ge9,SK,IKD,me9,pe9,DKD,de9,ce9,le9,WbE,VbE,BKD,ie9,ne9,re9,ae9,oe9,te9,se9,ee9,HH1,$H1,AH1,LH1,IH1,DH1,BH1,PbE;var fKD=K(()=>{mI();AKD=S.object({inputTokens:S.number(),outputTokens:S.number(),cacheReadInputTokens:S.number(),cacheCreationInputTokens:S.number(),webSearchRequests:S.number(),costUSD:S.number(),contextWindow:S.number(),maxOutputTokens:S.number()}),He9=S.literal("json_schema"),HbE=S.object({type:He9}),$bE=S.object({type:S.literal("json_schema"),schema:S.record(S.string(),S.unknown())}),$e9=S.enum(["user","project","org","temporary"]),AbE=S.enum(["local","user","project"]).describe("Config scope for settings."),LbE=S.literal("context-1m-2025-08-07"),Ae9=S.object({type:S.literal("stdio").optional(),command:S.string(),args:S.array(S.string()).optional(),env:S.record(S.string(),S.string()).optional()}),Le9=S.object({type:S.literal("sse"),url:S.string(),headers:S.record(S.string(),S.string()).optional()}),Ie9=S.object({type:S.literal("http"),url:S.string(),headers:S.record(S.string(),S.string()).optional()}),De9=S.object({type:S.literal("sdk"),name:S.string()}),LKD=S.union([Ae9,Le9,Ie9,De9]),Be9=S.object({type:S.literal("claudeai-proxy"),url:S.string(),id:S.string()}),fe9=S.union([LKD,Be9]),IbE=S.object({name:S.string().describe("Server name as configured"),status:S.enum(["connected","failed","needs-auth","pending","disabled"]).describe("Current connection status"),serverInfo:S.object({name:S.string(),version:S.string()}).optional().describe("Server information (available when connected)"),error:S.string().optional().describe("Error message (available when status is 'failed')"),config:fe9.optional().describe("Server configuration (includes URL for HTTP/SSE servers)"),scope:S.string().optional().describe("Configuration scope (e.g., project, user, local, claudeai, managed)"),tools:S.array(S.object({name:S.string(),description:S.string().optional(),annotations:S.object({readOnly:S.boolean().optional(),destructive:S.boolean().optional(),openWorld:S.boolean().optional()}).optional()})).optional().describe("Tools provided by this server (available when connected)")}).describe("Status information for an MCP server connection."),DbE=S.object({added:S.array(S.string()).describe("Names of servers that were added"),removed:S.array(S.string()).describe("Names of servers that were removed"),errors:S.record(S.string(),S.string()).describe("Map of server names to error messages for servers that failed to connect")}).describe("Result of a setMcpServers operation."),s7H=S.enum(["userSettings","projectSettings","localSettings","session","cliArg"]),owA=S.enum(["allow","deny","ask"]),twA=S.object({toolName:S.string(),ruleContent:S.string().optional()}),swA=S.discriminatedUnion("type",[S.object({type:S.literal("addRules"),rules:S.array(twA),behavior:owA,destination:s7H}),S.object({type:S.literal("replaceRules"),rules:S.array(twA),behavior:owA,destination:s7H}),S.object({type:S.literal("removeRules"),rules:S.array(twA),behavior:owA,destination:s7H}),S.object({type:S.literal("setMode"),mode:S.lazy(()=>e7H),destination:s7H}),S.object({type:S.literal("addDirectories"),directories:S.array(S.string()),destination:s7H}),S.object({type:S.literal("removeDirectories"),directories:S.array(S.string()),destination:s7H})]),BbE=S.union([S.object({behavior:S.literal("allow"),updatedInput:S.record(S.string(),S.unknown()).optional(),updatedPermissions:S.array(swA).optional(),toolUseID:S.string().optional()}),S.object({behavior:S.literal("deny"),message:S.string(),interrupt:S.boolean().optional(),toolUseID:S.string().optional()})]),e7H=S.enum(["default","acceptEdits","bypassPermissions","plan","delegate","dontAsk"]).describe("Permission mode for controlling how tool executions are handled. 'default' - Standard behavior, prompts for dangerous operations. 'acceptEdits' - Auto-accept file edit operations. 'bypassPermissions' - Bypass all permission checks (requires allowDangerouslySkipPermissions). 'plan' - Planning mode, no actual tool execution. 'delegate' - Delegate mode, restricts team leader to only Teammate and Task tools. 'dontAsk' - Don't prompt for permissions, deny if not pre-approved."),Ee9=["PreToolUse","PostToolUse","PostToolUseFailure","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","SubagentStart","SubagentStop","PreCompact","PermissionRequest","Setup","TeammateIdle","TaskCompleted"],fbE=S.enum(Ee9),jP=S.object({session_id:S.string(),transcript_path:S.string(),cwd:S.string(),permission_mode:S.string().optional()}),Me9=jP.and(S.object({hook_event_name:S.literal("PreToolUse"),tool_name:S.string(),tool_input:S.unknown(),tool_use_id:S.string()})),Ge9=jP.and(S.object({hook_event_name:S.literal("PermissionRequest"),tool_name:S.string(),tool_input:S.unknown(),permission_suggestions:S.array(swA).optional()})),Ue9=jP.and(S.object({hook_event_name:S.literal("PostToolUse"),tool_name:S.string(),tool_input:S.unknown(),tool_response:S.unknown(),tool_use_id:S.string()})),Xe9=jP.and(S.object({hook_event_name:S.literal("PostToolUseFailure"),tool_name:S.string(),tool_input:S.unknown(),tool_use_id:S.string(),error:S.string(),is_interrupt:S.boolean().optional()})),Je9=jP.and(S.object({hook_event_name:S.literal("Notification"),message:S.string(),title:S.string().optional(),notification_type:S.string()})),Fe9=jP.and(S.object({hook_event_name:S.literal("UserPromptSubmit"),prompt:S.string()})),Ke9=jP.and(S.object({hook_event_name:S.literal("SessionStart"),source:S.enum(["startup","resume","clear","compact"]),agent_type:S.string().optional(),model:S.string().optional()})),Qe9=jP.and(S.object({hook_event_name:S.literal("Setup"),trigger:S.enum(["init","maintenance"])})),We9=jP.and(S.object({hook_event_name:S.literal("Stop"),stop_hook_active:S.boolean()})),Ve9=jP.and(S.object({hook_event_name:S.literal("SubagentStart"),agent_id:S.string(),agent_type:S.string()})),Pe9=jP.and(S.object({hook_event_name:S.literal("SubagentStop"),stop_hook_active:S.boolean(),agent_id:S.string(),agent_transcript_path:S.string(),agent_type:S.string()})),_e9=jP.and(S.object({hook_event_name:S.literal("PreCompact"),trigger:S.enum(["manual","auto"]),custom_instructions:S.string().nullable()})),Ye9=jP.and(S.object({hook_event_name:S.literal("TeammateIdle"),teammate_name:S.string(),team_name:S.string()})),Ce9=jP.and(S.object({hook_event_name:S.literal("TaskCompleted"),task_id:S.string(),task_subject:S.string(),task_description:S.string().optional(),teammate_name:S.string().optional(),team_name:S.string().optional()})),we9=["clear","logout","prompt_input_exit","other","bypass_permissions_disabled"],Ze9=S.enum(we9),qe9=jP.and(S.object({hook_event_name:S.literal("SessionEnd"),reason:Ze9})),EbE=S.union([Me9,Ue9,Xe9,Je9,Fe9,Ke9,qe9,We9,Ve9,Pe9,_e9,Ge9,Qe9,Ye9,Ce9]),Te9=S.object({async:S.literal(!0),asyncTimeout:S.number().optional()}),ze9=S.object({hookEventName:S.literal("PreToolUse"),permissionDecision:S.enum(["allow","deny","ask"]).optional(),permissionDecisionReason:S.string().optional(),updatedInput:S.record(S.string(),S.unknown()).optional(),additionalContext:S.string().optional()}),Ne9=S.object({hookEventName:S.literal("UserPromptSubmit"),additionalContext:S.string().optional()}),Oe9=S.object({hookEventName:S.literal("SessionStart"),additionalContext:S.string().optional()}),xe9=S.object({hookEventName:S.literal("Setup"),additionalContext:S.string().optional()}),Se9=S.object({hookEventName:S.literal("SubagentStart"),additionalContext:S.string().optional()}),je9=S.object({hookEventName:S.literal("PostToolUse"),additionalContext:S.string().optional(),updatedMCPToolOutput:S.unknown().optional()}),Re9=S.object({hookEventName:S.literal("PostToolUseFailure"),additionalContext:S.string().optional()}),ye9=S.object({hookEventName:S.literal("Notification"),additionalContext:S.string().optional()}),ve9=S.object({hookEventName:S.literal("PermissionRequest"),decision:S.union([S.object({behavior:S.literal("allow"),updatedInput:S.record(S.string(),S.unknown()).optional(),updatedPermissions:S.array(swA).optional()}),S.object({behavior:S.literal("deny"),message:S.string().optional(),interrupt:S.boolean().optional()})])}),he9=S.object({continue:S.boolean().optional(),suppressOutput:S.boolean().optional(),stopReason:S.string().optional(),decision:S.enum(["approve","block"]).optional(),systemMessage:S.string().optional(),reason:S.string().optional(),hookSpecificOutput:S.union([ze9,Ne9,Oe9,xe9,Se9,je9,Re9,ye9,ve9]).optional()}),MbE=S.union([Te9,he9]),GbE=S.object({name:S.string().describe("Skill name (without the leading slash)"),description:S.string().describe("Description of what the skill does"),argumentHint:S.string().describe('Hint for skill arguments (e.g., "")')}).describe("Information about an available skill (invoked via /command syntax)."),UbE=S.object({value:S.string().describe("Model identifier to use in API calls"),displayName:S.string().describe("Human-readable display name"),description:S.string().describe("Description of the model's capabilities")}).describe("Information about an available model."),XbE=S.object({email:S.string().optional(),organization:S.string().optional(),subscriptionType:S.string().optional(),tokenSource:S.string().optional(),apiKeySource:S.string().optional()}).describe("Information about the logged in user's account."),be9=S.union([S.string(),S.record(S.string(),LKD)]),JbE=S.object({description:S.string().describe("Natural language description of when to use this agent"),tools:S.array(S.string()).optional().describe("Array of allowed tool names. If omitted, inherits all tools from parent"),disallowedTools:S.array(S.string()).optional().describe("Array of tool names to explicitly disallow for this agent"),prompt:S.string().describe("The agent's system prompt"),model:S.enum(["sonnet","opus","haiku","inherit"]).optional().describe("Model to use for this agent. If omitted or 'inherit', uses the main model"),mcpServers:S.array(be9).optional(),criticalSystemReminder_EXPERIMENTAL:S.string().optional().describe("Experimental: Critical reminder added to system prompt"),skills:S.array(S.string()).optional().describe("Array of skill names to preload into the agent context"),maxTurns:S.number().int().positive().optional().describe("Maximum number of agentic turns (API round-trips) before stopping")}).describe("Definition for a custom subagent that can be invoked via the Task tool."),FbE=S.enum(["user","project","local"]).describe("Source for loading filesystem-based settings. 'user' - Global user settings (~/.claude/settings.json). 'project' - Project settings (.claude/settings.json). 'local' - Local settings (.claude/settings.local.json)."),KbE=S.object({type:S.literal("local").describe("Plugin type. Currently only 'local' is supported"),path:S.string().describe("Absolute or relative path to the plugin directory")}).describe("Configuration for loading a plugin."),QbE=S.object({canRewind:S.boolean(),error:S.string().optional(),filesChanged:S.array(S.string()).optional(),insertions:S.number().optional(),deletions:S.number().optional()}).describe("Result of a rewindFiles operation."),ke9=S.unknown(),ue9=S.unknown(),ge9=S.unknown(),SK=S.string(),IKD=S.unknown(),me9=S.enum(["authentication_failed","billing_error","rate_limit","invalid_request","server_error","unknown"]),pe9=S.union([S.literal("compacting"),S.null()]),DKD=S.object({type:S.literal("user"),message:ke9,parent_tool_use_id:S.string().nullable(),isSynthetic:S.boolean().optional(),tool_use_result:S.unknown().optional()}),de9=DKD.extend({uuid:SK.optional(),session_id:S.string()}),ce9=DKD.extend({uuid:SK,session_id:S.string(),isReplay:S.literal(!0)}),le9=S.object({type:S.literal("assistant"),message:ue9,parent_tool_use_id:S.string().nullable(),error:me9.optional(),uuid:SK,session_id:S.string()}),WbE=S.object({type:S.literal("streamlined_text"),text:S.string().describe("Text content preserved from the assistant message"),session_id:S.string(),uuid:SK}).describe("@internal Streamlined text message - replaces SDKAssistantMessage in streamlined output. Text content preserved, thinking and tool_use blocks removed."),VbE=S.object({type:S.literal("streamlined_tool_use_summary"),tool_summary:S.string().describe('Summary of tool calls (e.g., "Read 2 files, wrote 1 file")'),session_id:S.string(),uuid:SK}).describe("@internal Streamlined tool use summary - replaces tool_use blocks in streamlined output with a cumulative summary string."),BKD=S.object({tool_name:S.string(),tool_use_id:S.string(),tool_input:S.record(S.string(),S.unknown())}),ie9=S.object({type:S.literal("result"),subtype:S.literal("success"),duration_ms:S.number(),duration_api_ms:S.number(),is_error:S.boolean(),num_turns:S.number(),result:S.string(),stop_reason:S.string().nullable(),total_cost_usd:S.number(),usage:IKD,modelUsage:S.record(S.string(),AKD),permission_denials:S.array(BKD),structured_output:S.unknown().optional(),uuid:SK,session_id:S.string()}),ne9=S.object({type:S.literal("result"),subtype:S.enum(["error_during_execution","error_max_turns","error_max_budget_usd","error_max_structured_output_retries"]),duration_ms:S.number(),duration_api_ms:S.number(),is_error:S.boolean(),num_turns:S.number(),stop_reason:S.string().nullable(),total_cost_usd:S.number(),usage:IKD,modelUsage:S.record(S.string(),AKD),permission_denials:S.array(BKD),errors:S.array(S.string()),uuid:SK,session_id:S.string()}),re9=S.union([ie9,ne9]),ae9=S.object({type:S.literal("system"),subtype:S.literal("init"),agents:S.array(S.string()).optional(),apiKeySource:$e9,betas:S.array(S.string()).optional(),claude_code_version:S.string(),cwd:S.string(),tools:S.array(S.string()),mcp_servers:S.array(S.object({name:S.string(),status:S.string()})),model:S.string(),permissionMode:e7H,slash_commands:S.array(S.string()),output_style:S.string(),skills:S.array(S.string()),plugins:S.array(S.object({name:S.string(),path:S.string()})),uuid:SK,session_id:S.string()}),oe9=S.object({type:S.literal("stream_event"),event:ge9,parent_tool_use_id:S.string().nullable(),uuid:SK,session_id:S.string()}),te9=S.object({type:S.literal("system"),subtype:S.literal("compact_boundary"),compact_metadata:S.object({trigger:S.enum(["manual","auto"]),pre_tokens:S.number()}),uuid:SK,session_id:S.string()}),se9=S.object({type:S.literal("system"),subtype:S.literal("status"),status:pe9,permissionMode:e7H.optional(),uuid:SK,session_id:S.string()}),ee9=S.object({type:S.literal("system"),subtype:S.literal("hook_started"),hook_id:S.string(),hook_name:S.string(),hook_event:S.string(),uuid:SK,session_id:S.string()}),HH1=S.object({type:S.literal("system"),subtype:S.literal("hook_progress"),hook_id:S.string(),hook_name:S.string(),hook_event:S.string(),stdout:S.string(),stderr:S.string(),output:S.string(),uuid:SK,session_id:S.string()}),$H1=S.object({type:S.literal("system"),subtype:S.literal("hook_response"),hook_id:S.string(),hook_name:S.string(),hook_event:S.string(),output:S.string(),stdout:S.string(),stderr:S.string(),exit_code:S.number().optional(),outcome:S.enum(["success","error","cancelled"]),uuid:SK,session_id:S.string()}),AH1=S.object({type:S.literal("tool_progress"),tool_use_id:S.string(),tool_name:S.string(),parent_tool_use_id:S.string().nullable(),elapsed_time_seconds:S.number(),uuid:SK,session_id:S.string()}),LH1=S.object({type:S.literal("auth_status"),isAuthenticating:S.boolean(),output:S.array(S.string()),error:S.string().optional(),uuid:SK,session_id:S.string()}),IH1=S.object({type:S.literal("system"),subtype:S.literal("files_persisted"),files:S.array(S.object({filename:S.string(),file_id:S.string()})),failed:S.array(S.object({filename:S.string(),error:S.string()})),processed_at:S.string(),uuid:SK,session_id:S.string()}),DH1=S.object({type:S.literal("system"),subtype:S.literal("task_notification"),task_id:S.string(),status:S.enum(["completed","failed","stopped"]),output_file:S.string(),summary:S.string(),uuid:SK,session_id:S.string()}),BH1=S.object({type:S.literal("tool_use_summary"),summary:S.string(),preceding_tool_use_ids:S.array(S.string()),uuid:SK,session_id:S.string()}),PbE=S.union([le9,de9,ce9,re9,ae9,oe9,te9,se9,ee9,HH1,$H1,AH1,LH1,DH1,IH1,BH1])});var FKD={};XA(FKD,{writeToMailbox:()=>K8,sendShutdownRequestToMailbox:()=>Y_$,readUnreadMessages:()=>M9H,readMailbox:()=>qp,markMessagesAsReadByPredicate:()=>DZA,markMessagesAsRead:()=>rbH,markMessageAsReadByIndex:()=>nbH,isTeammate:()=>tf,isTeamPermissionUpdate:()=>q_$,isTaskCompletedNotification:()=>XH1,isTaskAssignment:()=>Z_$,isStructuredProtocolMessage:()=>N_$,isShutdownRequest:()=>Dt,isShutdownRejected:()=>w_$,isShutdownApproved:()=>RP,isSandboxPermissionResponse:()=>sbH,isSandboxPermissionRequest:()=>__$,isPlanApprovalResponse:()=>$6H,isPlanApprovalRequest:()=>C_$,isPermissionResponse:()=>G9H,isPermissionRequest:()=>tbH,isModeSetRequest:()=>z_$,isIdleNotification:()=>obH,getTeamName:()=>g9,getMailboxPath:()=>fH1,getLastPeerDmSummary:()=>ebH,getInboxPath:()=>It,getAgentName:()=>g1,getAgentId:()=>FK,formatTeammateMessages:()=>GH1,createTaskCompletedNotification:()=>UH1,createShutdownRequestMessage:()=>H6H,createShutdownRejectedMessage:()=>IZA,createShutdownApprovedMessage:()=>LZA,createSandboxPermissionResponseMessage:()=>AZA,createSandboxPermissionRequestMessage:()=>$ZA,createPermissionResponseMessage:()=>HZA,createPermissionRequestMessage:()=>ewA,createModeSetRequestMessage:()=>T_$,createIdleNotification:()=>abH,clearMailbox:()=>MH1,ShutdownRequestMessageSchema:()=>GKD,ShutdownRejectedMessageSchema:()=>XKD,ShutdownApprovedMessageSchema:()=>UKD,PlanApprovalResponseMessageSchema:()=>MKD,PlanApprovalRequestMessageSchema:()=>EKD,ModeSetRequestMessageSchema:()=>JKD});function It(H,$){let A=$||g9()||"default",L=w5H(A),I=w5H(H),D=P_$.join(P6(),L,"inboxes"),B=P_$.join(D,`${I}.json`);return N(`[TeammateMailbox] getInboxPath: agent=${H}, team=${A}, fullPath=${B}`),B}function fH1(H){return It(H)}function EH1(H){let $=H||g9()||"default",A=w5H($),L=P_$.join(P6(),A,"inboxes");if(!zw.existsSync(L))zw.mkdirSync(L,{recursive:!0}),N(`[TeammateMailbox] Created inbox directory: ${L}`)}function qp(H,$){let A=It(H,$);if(N(`[TeammateMailbox] readMailbox: path=${A}`),!zw.existsSync(A))return N("[TeammateMailbox] readMailbox: file does not exist"),[];try{let L=zw.readFileSync(A,"utf-8"),I=DA(L);return N(`[TeammateMailbox] readMailbox: read ${I.length} message(s)`),I}catch(L){return N(`Failed to read inbox for ${H}: ${L}`),r(L instanceof Error?L:Error(String(L))),[]}}function M9H(H,$){let A=qp(H,$),L=A.filter((I)=>!I.read);return N(`[TeammateMailbox] readUnreadMessages: ${L.length} unread of ${A.length} total`),L}function K8(H,$,A){EH1(A);let L=It(H,A),I=`${L}.lock`;if(N(`[TeammateMailbox] writeToMailbox: recipient=${H}, from=${$.from}, path=${L}`),!zw.existsSync(L))iL(L,"[]","utf-8"),N("[TeammateMailbox] writeToMailbox: created new inbox file");let D;try{D=ibH.lockSync(L,{lockfilePath:I});let B=qp(H,A),f={...$,read:!1};B.push(f),iL(L,yH(B,null,2),"utf-8"),N(`[TeammateMailbox] Wrote message to ${H}'s inbox from ${$.from}`)}catch(B){N(`Failed to write to inbox for ${H}: ${B}`),r(B instanceof Error?B:Error(String(B)))}finally{if(D)D()}}function nbH(H,$,A){let L=It(H,$);if(N(`[TeammateMailbox] markMessageAsReadByIndex called: agentName=${H}, teamName=${$}, index=${A}, path=${L}`),!zw.existsSync(L)){N(`[TeammateMailbox] markMessageAsReadByIndex: file does not exist at ${L}`);return}let I=`${L}.lock`,D;try{N("[TeammateMailbox] markMessageAsReadByIndex: acquiring lock..."),D=ibH.lockSync(L,{lockfilePath:I}),N("[TeammateMailbox] markMessageAsReadByIndex: lock acquired");let B=qp(H,$);if(N(`[TeammateMailbox] markMessageAsReadByIndex: read ${B.length} messages after lock`),A<0||A>=B.length){N(`[TeammateMailbox] markMessageAsReadByIndex: index ${A} out of bounds (${B.length} messages)`);return}let f=B[A];if(!f||f.read){N("[TeammateMailbox] markMessageAsReadByIndex: message already read or missing");return}B[A]={...f,read:!0},iL(L,yH(B,null,2),"utf-8"),N(`[TeammateMailbox] markMessageAsReadByIndex: marked message at index ${A} as read`)}catch(B){N(`[TeammateMailbox] markMessageAsReadByIndex FAILED for ${H}: ${B}`),r(B instanceof Error?B:Error(String(B)))}finally{if(D)D(),N("[TeammateMailbox] markMessageAsReadByIndex: lock released")}}function rbH(H,$){let A=It(H,$);if(N(`[TeammateMailbox] markMessagesAsRead called: agentName=${H}, teamName=${$}, path=${A}`),!zw.existsSync(A)){N(`[TeammateMailbox] markMessagesAsRead: file does not exist at ${A}`);return}let L=`${A}.lock`,I;try{N("[TeammateMailbox] markMessagesAsRead: acquiring lock..."),I=ibH.lockSync(A,{lockfilePath:L}),N("[TeammateMailbox] markMessagesAsRead: lock acquired");let D=qp(H,$);if(N(`[TeammateMailbox] markMessagesAsRead: read ${D.length} messages after lock`),D.length===0){N("[TeammateMailbox] markMessagesAsRead: no messages to mark");return}let B=D.filter((U)=>!U.read).length;N(`[TeammateMailbox] markMessagesAsRead: ${B} unread of ${D.length} total`);let f=D.map((U)=>({...U,read:!0}));iL(A,yH(f,null,2),"utf-8"),N(`[TeammateMailbox] markMessagesAsRead: WROTE ${B} message(s) as read to ${A}`);let E=zw.readFileSync(A,"utf-8"),G=DA(E).filter((U)=>!U.read).length;N(`[TeammateMailbox] markMessagesAsRead: VERIFY - ${G} still unread after write`)}catch(D){N(`[TeammateMailbox] markMessagesAsRead FAILED for ${H}: ${D}`),r(D instanceof Error?D:Error(String(D)))}finally{if(I)I(),N("[TeammateMailbox] markMessagesAsRead: lock released")}}function MH1(H,$){let A=It(H,$);if(!zw.existsSync(A))return;try{iL(A,"[]","utf-8"),N(`[TeammateMailbox] Cleared inbox for ${H}`)}catch(L){N(`Failed to clear inbox for ${H}: ${L}`),r(L instanceof Error?L:Error(String(L)))}}function GH1(H){return H.map(($)=>{let A=$.color?` color="${$.color}"`:"",L=$.summary?` summary="${$.summary}"`:"";return`<${sX} teammate_id="${$.from}"${A}${L}> `)}function abH(H,$){return{type:"idle_notification",from:H,timestamp:new Date().toISOString(),idleReason:$?.idleReason,summary:$?.summary,completedTaskId:$?.completedTaskId,completedStatus:$?.completedStatus,failureReason:$?.failureReason}}function obH(H){try{let $=DA(H);if($&&$.type==="idle_notification")return $}catch{}return null}function UH1(H,$,A){return{type:"task_completed",from:H,taskId:$,taskSubject:A,timestamp:new Date().toISOString()}}function XH1(H){try{let $=DA(H);if($&&$.type==="task_completed")return $}catch{}return null}function ewA(H){return{type:"permission_request",request_id:H.request_id,agent_id:H.agent_id,tool_name:H.tool_name,tool_use_id:H.tool_use_id,description:H.description,input:H.input,permission_suggestions:H.permission_suggestions||[]}}function HZA(H){if(H.subtype==="error")return{type:"permission_response",request_id:H.request_id,subtype:"error",error:H.error||"Permission denied"};return{type:"permission_response",request_id:H.request_id,subtype:"success",response:{updated_input:H.updated_input,permission_updates:H.permission_updates}}}function tbH(H){try{let $=DA(H);if($&&$.type==="permission_request")return $}catch{}return null}function G9H(H){try{let $=DA(H);if($&&$.type==="permission_response")return $}catch{}return null}function $ZA(H){return{type:"sandbox_permission_request",requestId:H.requestId,workerId:H.workerId,workerName:H.workerName,workerColor:H.workerColor,hostPattern:{host:H.host},createdAt:Date.now()}}function AZA(H){return{type:"sandbox_permission_response",requestId:H.requestId,host:H.host,allow:H.allow,timestamp:new Date().toISOString()}}function __$(H){try{let $=DA(H);if($&&$.type==="sandbox_permission_request")return $}catch{}return null}function sbH(H){try{let $=DA(H);if($&&$.type==="sandbox_permission_response")return $}catch{}return null}function H6H(H){return{type:"shutdown_request",requestId:H.requestId,from:H.from,reason:H.reason,timestamp:new Date().toISOString()}}function LZA(H){return{type:"shutdown_approved",requestId:H.requestId,from:H.from,timestamp:new Date().toISOString(),paneId:H.paneId,backendType:H.backendType}}function IZA(H){return{type:"shutdown_rejected",requestId:H.requestId,from:H.from,reason:H.reason,timestamp:new Date().toISOString()}}function Y_$(H,$,A){let L=$||g9(),I=g1()||kE,D=N7H("shutdown",H),B=H6H({requestId:D,from:I,reason:A});return K8(H,{from:I,text:yH(B),timestamp:new Date().toISOString(),color:q4()},L),{requestId:D,target:H}}function Dt(H){try{let $=GKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function C_$(H){try{let $=EKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function RP(H){try{let $=UKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function w_$(H){try{let $=XKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function $6H(H){try{let $=MKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function Z_$(H){try{let $=DA(H);if($&&$.type==="task_assignment")return $}catch{}return null}function q_$(H){try{let $=DA(H);if($&&$.type==="team_permission_update")return $}catch{}return null}function T_$(H){return{type:"mode_set_request",mode:H.mode,from:H.from}}function z_$(H){try{let $=JKD.safeParse(DA(H));if($.success)return $.data}catch{}return null}function N_$(H){try{let $=DA(H);if(!$||typeof $!=="object"||!("type"in $))return!1;let A=$.type;return A==="permission_request"||A==="permission_response"||A==="sandbox_permission_request"||A==="sandbox_permission_response"||A==="shutdown_request"||A==="shutdown_approved"||A==="team_permission_update"||A==="mode_set_request"||A==="plan_approval_request"||A==="plan_approval_response"}catch{return!1}}function DZA(H,$,A){let L=It(H,A);if(!zw.existsSync(L))return;let I=`${L}.lock`,D;try{D=ibH.lockSync(L,{lockfilePath:I});let B=qp(H,A);if(B.length===0)return;let f=B.map((E)=>!E.read&&$(E)?{...E,read:!0}:E);iL(L,yH(f,null,2),"utf-8")}catch(B){r(B instanceof Error?B:Error(String(B)))}finally{if(D)try{D()}catch{}}}function ebH(H){for(let $=H.length-1;$>=0;$--){let A=H[$];if(!A)continue;if(A.type==="user"&&typeof A.message.content==="string")break;if(A.type!=="assistant")continue;for(let L of A.message.content)if(L.type==="tool_use"&&L.name===vv&&typeof L.input==="object"&&L.input!==null&&"type"in L.input&&L.input.type==="message"&&"recipient"in L.input&&typeof L.input.recipient==="string"&&L.input.recipient.toLowerCase()!==kE.toLowerCase()){let I=L.input.recipient,D="summary"in L.input&&typeof L.input.summary==="string"?L.input.summary:("content"in L.input)&&typeof L.input.content==="string"?L.input.content.slice(0,80):void 0;if(D)return`[to ${I}] ${D}`}}return}var zw,P_$,ibH,EKD,MKD,GKD,UKD,XKD,JKD;var sU=K(()=>{Z$();NA();mI();_$();EE();E$();XE();JG();fKD();Z$();zw=require("fs"),P_$=require("path"),ibH=b(zk(),1);EKD=S.object({type:S.literal("plan_approval_request"),from:S.string(),timestamp:S.string(),planFilePath:S.string(),planContent:S.string(),requestId:S.string()}),MKD=S.object({type:S.literal("plan_approval_response"),requestId:S.string(),approved:S.boolean(),feedback:S.string().optional(),timestamp:S.string(),permissionMode:e7H.optional()}),GKD=S.object({type:S.literal("shutdown_request"),requestId:S.string(),from:S.string(),reason:S.string().optional(),timestamp:S.string()}),UKD=S.object({type:S.literal("shutdown_approved"),requestId:S.string(),from:S.string(),timestamp:S.string(),paneId:S.string().optional(),backendType:S.string().optional()}),XKD=S.object({type:S.literal("shutdown_rejected"),requestId:S.string(),from:S.string(),reason:S.string(),timestamp:S.string()});JKD=S.object({type:S.literal("mode_set_request"),mode:e7H,from:S.string()})});function JH1({request:H}){return FE.createElement(x,{flexDirection:"column",marginY:1},FE.createElement(x,{borderStyle:"round",borderColor:"warning",flexDirection:"column",paddingX:1,paddingY:1},FE.createElement(x,{marginBottom:1},FE.createElement(V,{color:"warning",bold:!0},"Shutdown request from ",H.from)),H.reason&&FE.createElement(x,null,FE.createElement(V,null,"Reason: ",H.reason))))}function FH1({response:H}){return FE.createElement(x,{flexDirection:"column",marginY:1},FE.createElement(x,{borderStyle:"round",borderColor:"subtle",flexDirection:"column",paddingX:1,paddingY:1},FE.createElement(V,{color:"subtle",bold:!0},"Shutdown rejected by ",H.from),FE.createElement(x,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1},FE.createElement(V,null,"Reason: ",H.reason)),FE.createElement(x,{marginTop:1},FE.createElement(V,{dimColor:!0},"Teammate is continuing to work. You may request shutdown again later."))))}function KKD(H){let $=Dt(H);if($)return FE.createElement(JH1,{request:$});if(RP(H))return null;let A=w_$(H);if(A)return FE.createElement(FH1,{response:A});return null}function QKD(H){let $=Dt(H);if($)return`[Shutdown Request from ${$.from}]${$.reason?` ${$.reason}`:""}`;let A=RP(H);if(A)return`[Shutdown Approved] ${A.from} is now exiting`;let L=w_$(H);if(L)return`[Shutdown Rejected] ${L.from}: ${L.reason}`;return null}var FE;var BZA=K(()=>{xH();sU();FE=b(s(),1)});function KH1({assignment:H}){return jK.createElement(x,{flexDirection:"column",marginY:1},jK.createElement(x,{borderStyle:"round",borderColor:"cyan_FOR_SUBAGENTS_ONLY",flexDirection:"column",paddingX:1,paddingY:1},jK.createElement(x,{marginBottom:1},jK.createElement(V,{color:"cyan_FOR_SUBAGENTS_ONLY",bold:!0},"Task #",H.taskId," assigned by ",H.assignedBy)),jK.createElement(x,null,jK.createElement(V,{bold:!0},H.subject)),H.description&&jK.createElement(x,{marginTop:1},jK.createElement(V,{dimColor:!0},H.description))))}function WKD(H){let $=Z_$(H);if($)return jK.createElement(KH1,{assignment:$});return null}function VKD(H){let $=Z_$(H);if($)return`[Task Assigned] #${$.taskId} - ${$.subject}`;return null}var jK;var fZA=K(()=>{xH();sU();jK=b(s(),1)});function QH1({request:H}){return I9.createElement(x,{flexDirection:"column",marginY:1},I9.createElement(x,{borderStyle:"round",borderColor:"planMode",flexDirection:"column",paddingX:1},I9.createElement(x,{marginBottom:1},I9.createElement(V,{color:"planMode",bold:!0},"Plan Approval Request from ",H.from)),I9.createElement(x,{borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:1,marginBottom:1},I9.createElement(VJ,null,H.planContent)),I9.createElement(V,{dimColor:!0},"Plan file: ",H.planFilePath)))}function WH1({response:H,senderName:$}){if(H.approved)return I9.createElement(x,{flexDirection:"column",marginY:1},I9.createElement(x,{borderStyle:"round",borderColor:"success",flexDirection:"column",paddingX:1,paddingY:1},I9.createElement(x,null,I9.createElement(V,{color:"success",bold:!0},"\u2713 Plan Approved by ",$)),I9.createElement(x,{marginTop:1},I9.createElement(V,null,"You can now proceed with implementation. Your plan mode restrictions have been lifted."))));return I9.createElement(x,{flexDirection:"column",marginY:1},I9.createElement(x,{borderStyle:"round",borderColor:"error",flexDirection:"column",paddingX:1,paddingY:1},I9.createElement(x,null,I9.createElement(V,{color:"error",bold:!0},"\u2717 Plan Rejected by ",$)),H.feedback&&I9.createElement(x,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1},I9.createElement(V,null,"Feedback: ",H.feedback)),I9.createElement(x,{marginTop:1},I9.createElement(V,{dimColor:!0},"Please revise your plan based on the feedback and call ExitPlanMode again."))))}function O_$(H,$){let A=C_$(H);if(A)return I9.createElement(QH1,{request:A});let L=$6H(H);if(L)return I9.createElement(WH1,{response:L,senderName:$});return null}function VH1(H){let $=C_$(H);if($)return`[Plan Approval Request from ${$.from}]`;let A=$6H(H);if(A)if(A.approved)return"[Plan Approved] You can now proceed with implementation";else return`[Plan Rejected] ${A.feedback||"Please revise your plan"}`;return null}function PH1(H){let $=["Agent idle"];if(H.completedTaskId){let A=H.completedStatus||"completed";$.push(`Task ${H.completedTaskId} ${A}`)}if(H.summary)$.push(`Last DM: ${H.summary}`);return $.join(" \xB7 ")}function PKD(H){let $=VH1(H);if($)return $;let A=QKD(H);if(A)return A;let L=obH(H);if(L)return PH1(L);let I=VKD(H);if(I)return I;try{let D=DA(H);if(D?.type==="teammate_terminated"&&D.message)return D.message}catch{}return H}var I9;var EZA=K(()=>{xH();nx();sU();Z$();BZA();fZA();I9=b(s(),1)});function _H1(H){let $=[],A=new RegExp(`<${sX}\\s+teammate_id="([^"]+)"(?:\\s+color="([^"]+)")?(?:\\s+summary="([^"]+)")?>\\n?([\\s\\S]*?)\\n?<\\/${sX}>`,"g");for(let L of H.matchAll(A))if(L[1]&&L[4])$.push({teammateId:L[1],color:L[2],summary:L[3],content:L[4].trim()});return $}function YH1(H){if(H==="leader")return"leader";return H}function _KD({addMargin:H,param:{text:$},isTranscriptMode:A}){let L=_H1($).filter((I)=>{if(RP(I.content))return!1;try{if(DA(I.content)?.type==="teammate_terminated")return!1}catch{}return!0});if(L.length===0)return null;return S1.createElement(x,{flexDirection:"column",marginTop:H?1:0,width:"100%"},L.map((I,D)=>{let B=v7(I.color),f=YH1(I.teammateId),E=O_$(I.content,f);if(E)return S1.createElement(S1.Fragment,{key:D},E);let M=KKD(I.content);if(M)return S1.createElement(S1.Fragment,{key:D},M);let G=WKD(I.content);if(G)return S1.createElement(S1.Fragment,{key:D},G);let U=null;try{U=DA(I.content)}catch{}if(U?.type==="idle_notification")return null;if(U?.type==="task_completed"){let X=U;return S1.createElement(x,{key:D,flexDirection:"column",marginTop:1},S1.createElement(V,{color:B},`@${f}${pH.pointer}`),S1.createElement(HA,null,S1.createElement(V,{color:"success"},"\u2713"),S1.createElement(V,null," ","Completed task #",X.taskId,X.taskSubject&&S1.createElement(V,{dimColor:!0}," (",X.taskSubject,")"))))}return S1.createElement(CH1,{key:D,displayName:f,inkColor:B,content:I.content,summary:I.summary,isTranscriptMode:A})}))}function CH1({displayName:H,inkColor:$,content:A,summary:L,isTranscriptMode:I}){return S1.createElement(x,{flexDirection:"column",marginTop:1},S1.createElement(x,null,S1.createElement(V,{color:$},`@${H}${pH.pointer}`),L&&S1.createElement(V,null," ",L)),I&&S1.createElement(x,{paddingLeft:2},S1.createElement(V,null,S1.createElement(m9,null,A))))}var S1;var YKD=K(()=>{xH();jI();Wp();EE();Z$();EZA();BZA();sU();fZA();iB();S1=b(s(),1)});function wH1(H){switch(H){case"completed":return"success";case"failed":return"error";case"killed":return"warning";default:return"text"}}function CKD({addMargin:H,param:{text:$}}){let A=VD($,"summary");if(!A)return null;let L=VD($,"status"),I=wH1(L);return U9H.createElement(x,{marginTop:H?1:0},U9H.createElement(V,null,U9H.createElement(V,{color:I},Zf)," ",A))}var U9H;var wKD=K(()=>{xH();p6();_L();U9H=b(s(),1)});function x_$({addMargin:H,planContent:$}){return Tp.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:"planMode",marginTop:H?1:0,paddingX:1},Tp.createElement(x,{marginBottom:1},Tp.createElement(V,{bold:!0,color:"planMode"},"Plan to implement")),Tp.createElement(VJ,null,$))}var Tp;var MZA=K(()=>{xH();nx();Tp=b(s(),1)});function X9H({addMargin:H,param:$,verbose:A,thinkingMetadata:L,planContent:I,isTranscriptMode:D}){if($.text.trim()===qw)return null;if(I)return zG.createElement(x_$,{addMargin:H,planContent:I});if(VD($.text,jN))return null;if($.text.startsWith(""))return zG.createElement(HKD,{content:$.text});if($.text.startsWith(""))return zG.createElement(Q_$,{addMargin:H,param:$});if($.text.includes(""))return zG.createElement(E9H,{addMargin:H,param:$});if($.text.includes(`<${C6}>`))return zG.createElement(yFD,{addMargin:H,param:$});if($.text.includes(""))return zG.createElement(iFD,{addMargin:H,text:$.text});if(dL()&&$.text.includes(`<${sX}`))return zG.createElement(_KD,{addMargin:H,param:$,isTranscriptMode:D});if($.text.includes(`<${G5}`))return zG.createElement(CKD,{addMargin:H,param:$});return zG.createElement(mFD,{addMargin:H,param:$,thinkingMetadata:L})}var zG;var S_$=K(()=>{cwA();vFD();pFD();nFD();zFH();_L();iB();oFD();eFD();rwA();$KD();T8();YKD();wKD();EE();MZA();_L();zG=b(s(),1)});function j_$({imageId:H,addMargin:$}){let A=H?`[Image #${H}]`:"[Image]",L=H?V4$(H):null,I=L&&e2()?CS.createElement(dI,{url:ZKD.pathToFileURL(L).href},CS.createElement(V,null,A)):CS.createElement(V,null,A);if($)return CS.createElement(x,{marginTop:1},I);return CS.createElement(HA,null,I)}var CS,ZKD;var GZA=K(()=>{xH();rJH();gr();jr();iB();CS=b(s(),1),ZKD=require("url")});function R_$({param:{thinking:H},addMargin:$=!1,isTranscriptMode:A,hideInTranscript:L=!1}){let I=C0("app:toggleTranscript","Global","ctrl+o"),D=!1;if(!H)return null;if(L)return null;let B=A,f="\u2234 Thinking";if(!B)return J9H.default.createElement(x,{marginTop:$?1:0},J9H.default.createElement(V,{dimColor:!0,italic:!0},f," (",I," to expand)"));return J9H.default.createElement(x,{flexDirection:"column",gap:1,marginTop:$?1:0,width:"100%"},J9H.default.createElement(V,{dimColor:!0,italic:!0},f,"\u2026"),J9H.default.createElement(x,{paddingLeft:2},J9H.default.createElement(VJ,{dimColor:!0},H)))}var J9H;var UZA=K(()=>{xH();nx();FG();vA();J9H=b(s(),1)});function qKD({addMargin:H=!1}){return XZA.default.createElement(x,{marginTop:H?1:0},XZA.default.createElement(V,{dimColor:!0,italic:!0},"\u273B Thinking\u2026"))}var XZA;var TKD=K(()=>{xH();XZA=b(s(),1)});function NKD({attachment:H,verbose:$}){let A=C0("app:toggleTranscript","Global","ctrl+o");if(H.files.length===0)return null;let L=H.files.reduce((D,B)=>D+B.diagnostics.length,0),I=H.files.length;if($)return Nw.default.createElement(x,{flexDirection:"column"},H.files.map((D,B)=>Nw.default.createElement(Nw.default.Fragment,{key:B},Nw.default.createElement(HA,null,Nw.default.createElement(V,{dimColor:!0,wrap:"wrap"},Nw.default.createElement(V,{bold:!0},zKD.relative(C$(),D.uri.replace("file://","").replace("_claude_fs_right:","")))," ",Nw.default.createElement(V,{dimColor:!0},D.uri.startsWith("file://")?"(file://)":D.uri.startsWith("_claude_fs_right:")?"(claude_fs_right)":`(${D.uri.split(":")[0]})`),":")),D.diagnostics.map((f,E)=>Nw.default.createElement(HA,{key:E},Nw.default.createElement(V,{dimColor:!0,wrap:"wrap"}," ",wS.getSeveritySymbol(f.severity)," [Line ",f.range.start.line+1,":",f.range.start.character+1,"] ",f.message,f.code?` [${f.code}]`:"",f.source?` (${f.source})`:""))))));else return Nw.default.createElement(HA,null,Nw.default.createElement(V,{dimColor:!0,wrap:"wrap"},"Found ",Nw.default.createElement(V,{bold:!0},L)," new diagnostic"," ",L===1?"issue":"issues"," in ",I," ",I===1?"file":"files"," (",A," to expand)"))}var Nw,zKD;var OKD=K(()=>{xH();PI();iB();F9H();FG();Nw=b(s(),1),zKD=require("path")});function xKD({attachment:H,addMargin:$,verbose:A,isTranscriptMode:L}){let I=J$((D)=>D.tasks);if(dL()&&H.type==="teammate_mailbox"){let D=H.messages.filter((B)=>{if(RP(B.text))return!1;try{let f=DA(B.text);return f?.type!=="idle_notification"&&f?.type!=="teammate_terminated"}catch{return!0}});if(D.length===0)return null;return PD.default.createElement(x,{flexDirection:"column"},D.map((B,f)=>{let E=null;try{E=DA(B.text)}catch{}if(E?.type==="task_assignment")return PD.default.createElement(x,{key:f,paddingLeft:2},PD.default.createElement(V,null,Zf," "),PD.default.createElement(V,null,"Task assigned: "),PD.default.createElement(V,{bold:!0},"#",E.taskId),PD.default.createElement(V,null," - ",E.subject),PD.default.createElement(V,{dimColor:!0}," (from ",E.assignedBy||B.from,")"));let M=O_$(B.text,B.from);if(M)return PD.default.createElement(PD.default.Fragment,{key:f},M);let G=v7(B.color),U=PKD(B.text)??B.text;return PD.default.createElement(ZH1,{key:f,displayName:B.from,inkColor:G,content:U,summary:B.summary,isTranscriptMode:L})}))}switch(H.type){case"directory":return PD.default.createElement(vF,null,"Listed directory"," ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.path)+ZS.sep));case"file":case"already_read_file":if(H.content.type==="notebook")return PD.default.createElement(vF,null,"Read ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," (",H.content.file.cells.length," cells)");return PD.default.createElement(vF,null,"Read ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," (",H.content.type==="text"?`${H.content.file.numLines}${H.truncated?"+":""} lines`:GM(H.content.file.originalSize),")");case"compact_file_reference":return PD.default.createElement(vF,null,"Referenced file"," ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename)));case"pdf_reference":return PD.default.createElement(vF,null,"Referenced PDF"," ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," (",H.pageCount," pages)");case"selected_lines_in_ide":return PD.default.createElement(vF,null,"\u29C9 Selected"," ",PD.default.createElement(V,{bold:!0},H.lineEnd-H.lineStart+1)," ","lines from ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.filename))," ","in ",H.ideName);case"nested_memory":return PD.default.createElement(vF,null,"Loaded ",PD.default.createElement(V,{bold:!0},ZS.relative(C$(),H.path)));case"dynamic_skill":{let D=ZS.relative(C$(),H.skillDir),B=H.skillNames.length;return PD.default.createElement(vF,null,"Loaded"," ",PD.default.createElement(V,{bold:!0},B," skill",B!==1?"s":"")," ","from ",PD.default.createElement(V,{bold:!0},D))}case"skill_listing":{if(H.isInitial)return null;return PD.default.createElement(vF,null,PD.default.createElement(V,{bold:!0},H.skillCount)," skill",H.skillCount!==1?"s":""," available")}case"queued_command":{let D=typeof H.prompt==="string"?H.prompt:K9H(H.prompt)||"",B=H.imagePasteIds&&H.imagePasteIds.length>0;return PD.default.createElement(x,{flexDirection:"column"},PD.default.createElement(X9H,{addMargin:$,param:{text:D,type:"text"},verbose:A}),B&&H.imagePasteIds?.map((f)=>PD.default.createElement(j_$,{key:f,imageId:f})))}case"todo":if(H.context==="post-compact")return PD.default.createElement(vF,null,"Todo list read (",H.itemCount," ",H.itemCount===1?"item":"items",")");return null;case"plan_file_reference":return PD.default.createElement(vF,null,"Plan file referenced (",V9(H.planFilePath),")");case"invoked_skills":{if(H.skills.length===0)return null;let D=H.skills.map((B)=>B.name).join(", ");return PD.default.createElement(vF,null,"Skills restored (",D,")")}case"diagnostics":return PD.default.createElement(NKD,{attachment:H,verbose:A});case"mcp_resource":return PD.default.createElement(vF,null,"Read MCP resource ",PD.default.createElement(V,{bold:!0},H.name)," from"," ",H.server);case"command_permissions":return null;case"async_hook_response":{if(H.hookEvent==="SessionStart"&&!A)return null;return PD.default.createElement(vF,null,"Async hook ",PD.default.createElement(V,{bold:!0},H.hookEvent)," completed")}case"hook_blocking_error":{if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,{color:"error"},H.hookName," hook returned blocking error")}case"hook_non_blocking_error":{if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,{color:"error"},H.hookName," hook error")}case"hook_error_during_execution":if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,null,H.hookName," hook warning");case"hook_success":return null;case"hook_stopped_continuation":if(H.hookEvent==="Stop"||H.hookEvent==="SubagentStop")return null;return PD.default.createElement(vF,{color:"warning"},H.hookName," hook stopped continuation: ",H.message);case"hook_system_message":return PD.default.createElement(vF,null,H.hookName," says: ",H.content);case"hook_permission_decision":{let D=H.decision==="allow"?"Allowed":"Denied";return PD.default.createElement(vF,null,D," by ",PD.default.createElement(V,{bold:!0},H.hookEvent)," hook")}case"task_status":{if(v8()&&H.status==="killed")return null;if(dL()){let B=I[H.taskId];if(H.taskType==="in_process_teammate"&&B?.type==="in_process_teammate"){let f=v7(B.identity.color),E=H.status==="completed"?"shut down gracefully":H.status;return PD.default.createElement(x,{flexDirection:"row",width:"100%",marginTop:1},PD.default.createElement(V,{dimColor:!0},Zf," "),PD.default.createElement(V,{dimColor:!0},"Teammate"," ",PD.default.createElement(V,{color:f,bold:!0,dimColor:!1},"@",B.identity.agentName)," ",E))}}let D=H.status==="completed"?"completed in background":H.status==="killed"?"stopped":H.status;return PD.default.createElement(x,{flexDirection:"row",width:"100%",marginTop:1},PD.default.createElement(V,{dimColor:!0},Zf," "),PD.default.createElement(V,{dimColor:!0},'Task "',PD.default.createElement(V,{bold:!0},H.description),'"'," ",D))}case"task_progress":return null;case"teammate_shutdown_batch":return PD.default.createElement(x,{flexDirection:"row",width:"100%",marginTop:1},PD.default.createElement(V,{dimColor:!0},Zf," "),PD.default.createElement(V,{dimColor:!0},H.count," teammate",H.count===1?"":"s"," shut down gracefully"));case"agent_mention":case"budget_usd":case"critical_system_reminder":case"delegate_mode":case"delegate_mode_exit":case"edited_image_file":case"edited_text_file":case"hook_additional_context":case"hook_cancelled":case"opened_file_in_ide":case"output_style":case"plan_mode":case"plan_mode_exit":case"plan_mode_reentry":case"structured_output":case"team_context":case"todo_reminder":case"ultramemory":case"token_usage":return null}}function ZH1({displayName:H,inkColor:$,content:A,summary:L,isTranscriptMode:I}){return PD.default.createElement(x,{flexDirection:"column",marginTop:1},PD.default.createElement(x,null,PD.default.createElement(V,{color:$},`@${H}${pH.pointer}`),L&&PD.default.createElement(V,null," ",L)),I&&PD.default.createElement(x,{paddingLeft:2},PD.default.createElement(V,null,PD.default.createElement(m9,null,A))))}function vF({dimColor:H=!0,children:$,color:A}){return PD.default.createElement(HA,null,PD.default.createElement(V,{color:A,dimColor:H,wrap:"wrap"},$))}var PD,ZS;var SKD=K(()=>{xH();pL();rD();iB();PI();S_$();OKD();_L();GZA();Wp();Z$();T8();w7();EZA();p6();jI();sU();PD=b(s(),1),ZS=require("path")});function Dz(H){if(H.status!=="running"&&H.status!=="pending")return!1;if("isBackgrounded"in H&&H.isBackgrounded===!1)return!1;return!0}function jKD({message:{retryAttempt:H,error:$,retryInMs:A,maxRetries:L}}){let[I,D]=y_$.useState(0);if(VF(()=>D((f)=>f+1000),1000),y_$.useEffect(()=>D(0),[]),H<4)return null;let B=Math.max(0,Math.round((A-I)/1000));return zp.createElement(HA,null,zp.createElement(x,{flexDirection:"column"},zp.createElement(V,{color:"error"},LU$($)),zp.createElement(V,{dimColor:!0},"Retrying in ",B," ",B===1?"second":"seconds","\u2026 (attempt"," ",H,"/",L,")",process.env.API_TIMEOUT_MS?` \xB7 API_TIMEOUT_MS=${process.env.API_TIMEOUT_MS}ms, try increasing it`:"")))}var zp,y_$;var RKD=K(()=>{iB();xH();Ng();s6();zp=b(s(),1),y_$=b(s(),1)});function vKD({message:H,addMargin:$,verbose:A}){if(H.subtype==="turn_duration")return D9.createElement(zH1,{message:H,addMargin:$});if(H.subtype==="thinking")return null;if(H.subtype!=="stop_hook_summary"&&!A&&H.level==="info")return null;if(H.subtype==="api_error")return D9.createElement(jKD,{message:H});if(H.subtype==="stop_hook_summary")return D9.createElement(qH1,{message:H,addMargin:$,verbose:A});let I=H.content;return D9.createElement(x,{flexDirection:"row",width:"100%"},D9.createElement(TH1,{content:I,addMargin:$,dot:H.level!=="info",color:H.level==="warning"?"warning":void 0,dimColor:H.level==="info"}))}function qH1({message:H,addMargin:$,verbose:A}){let{hookCount:L,hookInfos:I,hookErrors:D,preventedContinuation:B,stopReason:f}=H,{columns:E}=QL();if(D.length===0&&!B)return null;return D9.createElement(x,{flexDirection:"row",marginTop:$?1:0,width:"100%"},D9.createElement(x,{minWidth:2},D9.createElement(V,null,Zf)),D9.createElement(x,{flexDirection:"column",width:E-10},D9.createElement(V,null,"Ran ",D9.createElement(V,{bold:!0},L)," stop"," ",L===1?"hook":"hooks"),A&&I.length>0&&I.map((M,G)=>D9.createElement(V,{key:`cmd-${G}`},"\u23BF \xA0",M.command==="prompt"?`prompt: ${M.promptText||""}`:`command: ${M.command}`)),B&&f&&D9.createElement(V,null,"\u23BF \xA0",f),D.length>0&&D.map((M,G)=>D9.createElement(V,{key:G},"\u23BF \xA0Stop hook error: ",M))))}function TH1({content:H,addMargin:$,dot:A,color:L,dimColor:I}){let{columns:D}=QL();return D9.createElement(x,{flexDirection:"row",marginTop:$?1:0,width:"100%"},A&&D9.createElement(x,{minWidth:2},D9.createElement(V,{color:L,dimColor:I},Zf)),D9.createElement(x,{flexDirection:"column",width:D-10},D9.createElement(V,{color:L,dimColor:I,wrap:"wrap"},H.trim())))}function zH1({message:H,addMargin:$}){let[A]=yKD.useState(()=>QV(x7H)??"Worked"),L=J$((f)=>f.tasks);if(!(M$().showTurnDuration??!0))return null;let D=of(H.durationMs),B=Object.values(L).filter(Dz).length;return D9.createElement(x,{flexDirection:"row",marginTop:$?1:0,width:"100%"},D9.createElement(x,{minWidth:2},D9.createElement(V,{dimColor:!0},qzH)),D9.createElement(V,{dimColor:!0},A," for ",D,B>0&&` \xB7 ${B} ${B===1?"agent":"agents"} running in the background`))}var D9,yKD;var hKD=K(()=>{xH();yHH();p6();NP$();OB();pL();RKD();Q9();vA();D9=b(s(),1),yKD=b(s(),1)});function bKD(){let H=C0("app:toggleTranscript","Global","ctrl+o");return HkH.createElement(x,{marginY:1},HkH.createElement(V,{dimColor:!0},"\u273B Conversation compacted (",H," for history)"))}var HkH;var kKD=K(()=>{xH();FG();HkH=b(s(),1)});var NH1;var uKD=K(()=>{xH();p6();OB();NH1=b(s(),1)});function gKD({message:H,tools:$,lookups:A,inProgressToolUseIDs:L,shouldAnimate:I}){let D=$.find((M)=>M.name===H.toolName);if(!D?.renderGroupedToolUse)return null;let B=new Map;for(let M of H.results)for(let G of M.message.content)if(G.type==="tool_result")B.set(G.tool_use_id,{param:G,output:M.toolUseResult});let f=H.messages.map((M)=>{let G=M.message.content[0],U=B.get(G.id);return{param:G,isResolved:A.resolvedToolUseIDs.has(G.id),isError:A.erroredToolUseIDs.has(G.id),isInProgress:L.has(G.id),progressMessages:kr(A.progressMessagesByToolUseID.get(G.id)??[]),result:U}}),E=f.some((M)=>M.isInProgress);return D.renderGroupedToolUse(f,{shouldAnimate:I&&E,tools:$})}var mKD=()=>{};function OH1({content:H,tools:$,lookups:A,inProgressToolUseIDs:L,shouldAnimate:I,theme:D}){let B=$.find((C)=>C.name===H.name);if(!B)return null;let f=A.resolvedToolUseIDs.has(H.id),E=A.erroredToolUseIDs.has(H.id),M=L.has(H.id),G=A.toolResultByToolUseID.get(H.id),U=G?.type==="user"?G.toolUseResult:void 0,X=B.outputSchema?.safeParse(U),J=X?.success?X.data:void 0,F=B.inputSchema.safeParse(H.input),Q=F.success?F.data:void 0,W=B.userFacingName(Q),P=Q?B.renderToolUseMessage(Q,{theme:D,verbose:!1}):null;return uE.default.createElement(x,{key:H.id,flexDirection:"column",marginTop:1},uE.default.createElement(x,{flexDirection:"row"},uE.default.createElement(mBH,{shouldAnimate:I&&M,isUnresolved:!f,isError:E}),uE.default.createElement(V,{bold:!0},W),P&&uE.default.createElement(V,null,"(",P,")"),Q&&B.renderToolUseTag?.(Q)),f&&!E&&J!==void 0&&uE.default.createElement(x,null,B.renderToolResultMessage(J,[],{verbose:!1,tools:$,theme:D})))}function pKD({message:H,inProgressToolUseIDs:$,shouldAnimate:A,verbose:L,tools:I,lookups:D,isActiveGroup:B}){let{searchCount:f,readCount:E,replCount:M,memorySearchCount:G,memoryReadCount:U,memoryWriteCount:X,messages:J}=H,[F]=_I(),Q=MQH(H).some((Y)=>D.erroredToolUseIDs.has(Y)),W=G>0||U>0||X>0,P=f>0||E>0||M>0;if(L){let Y=[];for(let Z of J)if(Z.type==="assistant")Y.push(Z);else if(Z.type==="grouped_tool_use")Y.push(...Z.messages);return uE.default.createElement(x,{flexDirection:"column"},Y.map((Z)=>{let q=Z.message.content[0];if(q?.type!=="tool_use")return null;return uE.default.createElement(OH1,{key:q.id,content:q,tools:I,lookups:D,inProgressToolUseIDs:$,shouldAnimate:A,theme:F})}))}if(!W&&!P)return null;let C=[];if(U>0){let Y=B?C.length===0?"Recalling":"recalling":C.length===0?"Recalled":"recalled";C.push(uE.default.createElement(V,{key:"mem-read"},Y," ",uE.default.createElement(V,{bold:!0},U)," ",U===1?"memory":"memories"))}if(G>0){let Y=B?C.length===0?"Searching":"searching":C.length===0?"Searched":"searched";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-ms"},", "));C.push(uE.default.createElement(V,{key:"mem-search"},`${Y} memories`))}if(X>0){let Y=B?C.length===0?"Writing":"writing":C.length===0?"Wrote":"wrote";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-mw"},", "));C.push(uE.default.createElement(V,{key:"mem-write"},Y," ",uE.default.createElement(V,{bold:!0},X)," ",X===1?"memory":"memories"))}if(f>0){let Y=B?C.length===0?"Searching for":"searching for":C.length===0?"Searched for":"searched for";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-s"},", "));C.push(uE.default.createElement(V,{key:"search"},Y," ",uE.default.createElement(V,{bold:!0},f)," ",f===1?"pattern":"patterns"))}if(E>0){let Y=B?C.length===0?"Reading":"reading":C.length===0?"Read":"read";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-r"},", "));C.push(uE.default.createElement(V,{key:"read"},Y," ",uE.default.createElement(V,{bold:!0},E)," ",E===1?"file":"files"))}if(M>0){let Y=B?"REPL'ing":"REPL'd";if(C.length>0)C.push(uE.default.createElement(V,{key:"comma-repl"},", "));C.push(uE.default.createElement(V,{key:"repl"},Y," ",uE.default.createElement(V,{bold:!0},M)," ",M===1?"time":"times"))}if(B)C.push(uE.default.createElement(V,{key:"ellipsis"},"\u2026"));return uE.default.createElement(x,{flexDirection:"row",marginTop:1},uE.default.createElement(mBH,{shouldAnimate:!!B,isUnresolved:!!B,isError:Q}),uE.default.createElement(V,null,C," ",uE.default.createElement(Bx,null)))}var uE;var dKD=K(()=>{xH();pQ$();lr();hx();uE=b(s(),1)});function cKD({message:H,screen:$}){let A=$==="transcript",L=$kH(H)||"",I=H.summarizeMetadata;if(I)return c0.createElement(x,{flexDirection:"column",marginTop:1},c0.createElement(x,{flexDirection:"row"},c0.createElement(x,{minWidth:2},c0.createElement(V,{color:"text"},Zf)),c0.createElement(x,{flexDirection:"column"},c0.createElement(V,{bold:!0},"Summarized conversation"),!A&&c0.createElement(HA,null,c0.createElement(x,{flexDirection:"column"},c0.createElement(V,{dimColor:!0},"Summarized ",I.messagesSummarized," messages from this point"),I.userContext&&c0.createElement(V,{dimColor:!0},"Context: ","\u201C",I.userContext,"\u201D"),c0.createElement(V,{dimColor:!0},c0.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand history",parens:!0})))),A&&c0.createElement(HA,null,c0.createElement(V,null,L)))));return c0.createElement(x,{flexDirection:"column",marginTop:1},c0.createElement(x,{flexDirection:"row"},c0.createElement(x,{minWidth:2},c0.createElement(V,{color:"text"},Zf)),c0.createElement(x,{flexDirection:"column"},c0.createElement(V,{bold:!0},"Compact summary",!A&&c0.createElement(V,{dimColor:!0}," ",c0.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand",parens:!0}))))),A&&c0.createElement(HA,null,c0.createElement(V,null,L)))}var c0;var lKD=K(()=>{xH();_L();p6();iB();j0();c0=b(s(),1)});function xH1({message:H,lookups:$,addMargin:A,tools:L,commands:I,verbose:D,inProgressToolUseIDs:B,progressMessagesForMessage:f,shouldAnimate:E,shouldShowDot:M,style:G,width:U,isTranscriptMode:X,onOpenRateLimitOptions:J,isActiveCollapsedGroup:F,isUserContinuation:Q=!1,lastThinkingBlockId:W,latestBashOutputUUID:P}){switch(H.type){case"attachment":return j1.createElement(xKD,{addMargin:A,attachment:H.attachment,verbose:D,isTranscriptMode:X});case"assistant":return j1.createElement(x,{flexDirection:"column",width:"100%"},H.message.content.map((C,Y)=>j1.createElement(jH1,{key:Y,param:C,addMargin:A,tools:L,commands:I,verbose:D,inProgressToolUseIDs:B,progressMessagesForMessage:f,shouldAnimate:E,shouldShowDot:M,width:U,inProgressToolCallCount:B.size,isTranscriptMode:X,lookups:$,onOpenRateLimitOptions:J,thinkingBlockId:`${H.uuid}:${Y}`,lastThinkingBlockId:W})));case"user":{if(H.isCompactSummary)return j1.createElement(cKD,{message:H,screen:X?"transcript":"prompt"});let C=0,Y=P===H.uuid,Z=j1.createElement(x,{flexDirection:"column",width:"100%"},H.message.content.map((q,O)=>{let j;if(q.type==="image")j=H.imagePasteIds?.[C],C++;return j1.createElement(SH1,{key:O,message:H,addMargin:A,tools:L,progressMessagesForMessage:f,param:q,style:G,verbose:D,imageIndex:j??C,isUserContinuation:Q,lookups:$,isTranscriptMode:X})}));return Y?j1.createElement(a_I,null,Z):Z}case"system":if(H.subtype==="compact_boundary")return j1.createElement(bKD,null);if(H.subtype==="microcompact_boundary")return null;if(H.subtype==="local_command")return j1.createElement(X9H,{addMargin:A,param:{type:"text",text:H.content},verbose:D});return j1.createElement(vKD,{message:H,addMargin:A,verbose:D});case"grouped_tool_use":return j1.createElement(gKD,{message:H,tools:L,lookups:$,inProgressToolUseIDs:B,shouldAnimate:E});case"collapsed_read_search":return j1.createElement(pKD,{message:H,inProgressToolUseIDs:B,shouldAnimate:E,verbose:D,tools:L,lookups:$,isActiveGroup:F})}}function SH1({message:H,addMargin:$,tools:A,progressMessagesForMessage:L,param:I,style:D,verbose:B,imageIndex:f,isUserContinuation:E,lookups:M,isTranscriptMode:G}){let{columns:U}=QL();switch(I.type){case"text":return j1.createElement(X9H,{addMargin:$,param:I,verbose:B,thinkingMetadata:H.thinkingMetadata,planContent:H.planContent,isTranscriptMode:G});case"image":return j1.createElement(j_$,{imageId:f,addMargin:$&&!E});case"tool_result":return j1.createElement($rI,{param:I,message:H,lookups:M,progressMessagesForMessage:L,style:D,tools:A,verbose:B,width:U-5});default:return}}function jH1({param:H,addMargin:$,tools:A,commands:L,verbose:I,inProgressToolUseIDs:D,progressMessagesForMessage:B,shouldAnimate:f,shouldShowDot:E,width:M,inProgressToolCallCount:G,isTranscriptMode:U,lookups:X,onOpenRateLimitOptions:J,thinkingBlockId:F,lastThinkingBlockId:Q}){switch(H.type){case"tool_use":return j1.createElement(BrI,{param:H,addMargin:$,tools:A,commands:L,verbose:I,inProgressToolUseIDs:D,progressMessagesForMessage:B,shouldAnimate:f,shouldShowDot:E,inProgressToolCallCount:G,lookups:X});case"text":return j1.createElement(jFD,{param:H,addMargin:$,shouldShowDot:E,width:M,onOpenRateLimitOptions:J});case"redacted_thinking":if(!U)return null;return j1.createElement(qKD,{addMargin:$});case"thinking":{if(!U)return null;return j1.createElement(R_$,{addMargin:$,param:H,isTranscriptMode:U,hideInTranscript:U&&!(!Q||F===Q)&&!0})}default:return r(Error(`Unable to render message type: ${H.type}`)),null}}function RH1(H,$){if(H.message.uuid!==$.message.uuid)return!1;if(H.lastThinkingBlockId!==$.lastThinkingBlockId)return!1;let A=H.latestBashOutputUUID===H.message.uuid,L=$.latestBashOutputUUID===$.message.uuid;if(A!==L)return!1;if(H.isStatic&&$.isStatic)return!0;return!1}var j1,Bz;var A6H=K(()=>{xH();_$();vA();ArI();frI();RFD();S_$();GZA();UZA();TKD();OB();SKD();hKD();kKD();uKD();mKD();dKD();DXA();lKD();j1=b(s(),1);Bz=j1.memo(xH1,RH1)});function iKD({agentType:H,description:$,descriptionColor:A,taskDescription:L,toolUseCount:I,tokens:D,color:B,isLast:f,isResolved:E,isError:M,isAsync:G=!1,shouldAnimate:U,lastToolInfo:X,hideType:J=!1}){let F=f?"\u2514\u2500":"\u251C\u2500",Q=G&&E,W=()=>{if(!E)return X||"Initializing\u2026";if(Q)return F1.createElement(V,null,L??"Running in the background"," ",F1.createElement(s$,{shortcut:"shift+\u2191",action:"manage",parens:!0}));return"Done"};return F1.createElement(x,{flexDirection:"column"},F1.createElement(x,{paddingLeft:3},F1.createElement(V,{dimColor:!E},F," ",J?F1.createElement(V,{bold:!0},$||H):F1.createElement(F1.Fragment,null,F1.createElement(V,{bold:!0,backgroundColor:B,color:B?"inverseText":void 0},H),$&&F1.createElement(F1.Fragment,null," (",F1.createElement(V,{backgroundColor:A,color:A?"inverseText":void 0},$),")")),!Q&&F1.createElement(F1.Fragment,null," \xB7 ",I," tool ",I===1?"use":"uses",D!==null&&F1.createElement(F1.Fragment,null," \xB7 ",a0(D)," tokens")))),F1.createElement(x,{paddingLeft:3,flexDirection:"row"},F1.createElement(V,{dimColor:!E},f?" ":"\u2502"),F1.createElement(HA,null,F1.createElement(V,{dimColor:!0},W()))))}var F1;var nKD=K(()=>{xH();Q9();iB();lB();F1=b(s(),1)});function aKD(H,$){let A=H.data.message;if(A.type==="assistant")return JyH(A.message.content[0],$);if(A.type==="user"){let L=A.message.content[0];if(L?.type==="tool_result"){let I=L.tool_use_id;for(let D of H.data.normalizedMessages)if(D.type==="assistant"){let B=D.message.content.find((f)=>f.type==="tool_use"&&f.id===I);if(B)return JyH(B,$)}}}return null}function vH1(H,$,A){return H.map((B)=>({type:"original",message:B}));function D(B){if(I&&(I.searchCount>0||I.readCount>0||I.replCount>0))L.push({type:"summary",searchCount:I.searchCount,readCount:I.readCount,replCount:I.replCount,uuid:`summary-${I.startUuid}`,isActive:B});I=null}}function AkH({prompt:H,dim:$=!1}){return kA.createElement(x,{flexDirection:"column"},kA.createElement(V,{color:"success",bold:!0},"Prompt:"),kA.createElement(x,{paddingLeft:2},kA.createElement(VJ,null,H)))}function JZA({content:H}){return kA.createElement(x,{flexDirection:"column"},kA.createElement(V,{color:"success",bold:!0},"Response:"),H.map(($,A)=>kA.createElement(x,{key:A,paddingLeft:2,marginTop:A===0?0:1},kA.createElement(VJ,null,$.text))))}function oKD(H,$,{tools:A,verbose:L,theme:I}){if(H.status==="async_launched"){let{prompt:Q}=H;return kA.createElement(x,{flexDirection:"column"},kA.createElement(HA,{height:1},kA.createElement(V,null,"Backgrounded agent",!L&&kA.createElement(V,{dimColor:!0}," (",kA.createElement(rA,null,kA.createElement(s$,{shortcut:"shift+\u2191",action:"manage"}),Q&&kA.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand"})),")"))),L&&Q&&kA.createElement(HA,null,kA.createElement(AkH,{prompt:Q,theme:I})))}if(H.status!=="completed")return null;let{agentId:D,totalDurationMs:B,totalToolUseCount:f,totalTokens:E,usage:M,content:G,prompt:U}=H,J=`Done (${[f===1?"1 tool use":`${f} tool uses`,a0(E)+" tokens",of(B)].join(" \xB7 ")})`,F=PT({content:J,usage:M});return kA.createElement(x,{flexDirection:"column"},!1,L&&U&&kA.createElement(HA,null,kA.createElement(AkH,{prompt:U,theme:I})),L?kA.createElement(dSH,null,$.map((Q)=>kA.createElement(HA,{key:Q.uuid},kA.createElement(Bz,{message:Q.data.message,lookups:Sh,addMargin:!1,tools:A,commands:[],verbose:L,inProgressToolUseIDs:new Set,progressMessagesForMessage:$,shouldAnimate:!1,shouldShowDot:!1,isTranscriptMode:!1,isStatic:!0})))):null,L&&G&&G.length>0&&kA.createElement(HA,null,kA.createElement(JZA,{content:G,theme:I})),kA.createElement(HA,{height:1},kA.createElement(Bz,{message:F,lookups:Sh,addMargin:!1,tools:A,commands:[],verbose:L,inProgressToolUseIDs:new Set,progressMessagesForMessage:[],shouldAnimate:!1,shouldShowDot:!1,isTranscriptMode:!1,isStatic:!0})))}function tKD({description:H,prompt:$}){if(v8())return null;if(!H||!$)return null;return H}function sKD(H){let $=[];if(H.resume)$.push(kA.createElement(x,{key:"resume",flexWrap:"nowrap",marginLeft:1},kA.createElement(V,{dimColor:!0},"resuming ",H.resume)));if(H.model){let A=m8(H.model),L=X1();if(A!==L)$.push(kA.createElement(x,{key:"model",flexWrap:"nowrap",marginLeft:1},kA.createElement(V,{dimColor:!0},hV(A))))}if($.length===0)return null;return kA.createElement(kA.Fragment,null,$)}function L6H(H,{tools:$,verbose:A,terminalSize:L,inProgressToolCallCount:I}){if(!H.length)return kA.createElement(HA,{height:1},kA.createElement(V,{dimColor:!0},kH1));let D=(I??1)*hH1+bH1,B=!A&&L&&L.rows&&L.rows{let X=H.filter((Q)=>{return Q.data.message.message.content.some((P)=>P.type==="tool_use")}).length,J=[...H].reverse().find((Q)=>Q.data.message.type==="assistant"),F=null;if(J?.data.message.type==="assistant"){let Q=J.data.message.message.usage;F=(Q.cache_creation_input_tokens??0)+(Q.cache_read_input_tokens??0)+Q.input_tokens+Q.output_tokens}return{toolUseCount:X,tokens:F}};if(B){let{toolUseCount:X,tokens:J}=f();return kA.createElement(HA,{height:1},kA.createElement(V,{dimColor:!0},"In progress\u2026 \xB7 ",kA.createElement(V,{bold:!0},X)," tool"," ",X===1?"use":"uses",J&&` \xB7 ${a0(J)} tokens`," \xB7"," ",kA.createElement(VA,{action:"app:toggleTranscript",context:"Global",fallback:"ctrl+o",description:"expand",parens:!0})))}let E=vH1(H,$,!0),M=A?E:E.slice(-yH1),G=E.length-M.length,U=H[0]?.data.prompt;return kA.createElement(HA,null,kA.createElement(x,{flexDirection:"column"},kA.createElement(dSH,null,A&&U&&kA.createElement(x,{marginBottom:1},kA.createElement(AkH,{prompt:U})),M.map((X)=>{if(X.type==="summary"){let J=kF$(X.searchCount,X.readCount,X.isActive,X.replCount);return kA.createElement(x,{key:X.uuid,height:1,overflow:"hidden"},kA.createElement(V,{dimColor:!0},J))}return kA.createElement(x,{key:X.message.uuid,height:1,overflow:"hidden"},kA.createElement(Bz,{message:X.message.data.message,lookups:Sh,addMargin:!1,tools:$,commands:[],verbose:A,inProgressToolUseIDs:new Set,progressMessagesForMessage:H,shouldAnimate:!1,shouldShowDot:!1,style:"condensed",isTranscriptMode:!1,isStatic:!0}))})),G>0&&kA.createElement(V,{dimColor:!0},"+",G," more tool ",G===1?"use":"uses"," ",kA.createElement(Bx,null))))}function eKD(H,{progressMessagesForMessage:$,tools:A,verbose:L}){let I=$[0]?.data?.agentId;return kA.createElement(kA.Fragment,null,!1,L6H($,{tools:A,verbose:L}),kA.createElement(L8,null))}function HQD(H,{progressMessagesForMessage:$,tools:A,verbose:L}){return kA.createElement(kA.Fragment,null,L6H($,{tools:A,verbose:L}),kA.createElement(s9,{result:H,verbose:L}))}function uH1(H){let $=H.filter((I)=>{let D=I.data.message;return D.type==="user"&&D.message.content.some((B)=>B.type==="tool_result")}).length,A=[...H].reverse().find((I)=>I.data.message.type==="assistant"),L=null;if(A?.data.message.type==="assistant"){let I=A.data.message.message.usage;L=(I.cache_creation_input_tokens??0)+(I.cache_read_input_tokens??0)+I.input_tokens+I.output_tokens}return{toolUseCount:$,tokens:L}}function $QD(H,$){if(v8())return null;let{shouldAnimate:A,tools:L}=$,I=H.map(({param:U,isResolved:X,isError:J,progressMessages:F,result:Q})=>{let W=uH1(F),P=gH1(F,L),C=QZA.safeParse(U.input),Y=Q?.output?.status==="teammate_spawned",Z,q,O,j,u;if(Y&&C.success&&C.data.name){Z=`@${C.data.name}`;let p=C.data.subagent_type;q=rKD(p)?p:void 0,u=C.data.description,j=rKD(p)?zBH(p):void 0}else Z=C.success?FZA(C.data):"Task",q=C.success?C.data.description:void 0,O=C.success?KZA(C.data):void 0,u=void 0;let y=C.success&&"run_in_background"in C.data&&C.data.run_in_background===!0,g=Q?.output?.status==="async_launched",h=y||g||Y;return{id:U.id,agentType:Z,description:q,toolUseCount:W.toolUseCount,tokens:W.tokens,isResolved:X,isError:J,isAsync:h,color:O,descriptionColor:j,lastToolInfo:P,taskDescription:u}}),D=H.some((U)=>!U.isResolved),B=H.some((U)=>U.isError),f=!D,E=I.length>0&&I.every((U)=>U.agentType===I[0]?.agentType),M=E?I[0]?.agentType:null,G=I.every((U)=>U.isAsync);return kA.createElement(x,{flexDirection:"column",marginTop:1},kA.createElement(x,{flexDirection:"row"},kA.createElement(mBH,{shouldAnimate:A&&D,isUnresolved:D,isError:B}),kA.createElement(V,null,f?kA.createElement(kA.Fragment,null,kA.createElement(V,{bold:!0},H.length)," ",M?`${M} agents`:"agents"," ",G?"launched":"finished"):kA.createElement(kA.Fragment,null,"Running ",kA.createElement(V,{bold:!0},H.length)," ",M?`${M} agents`:"agents","\u2026")," "),kA.createElement(Bx,null)),I.map((U,X)=>kA.createElement(iKD,{key:U.id,agentType:U.agentType,description:U.description,descriptionColor:U.descriptionColor,taskDescription:U.taskDescription,toolUseCount:U.toolUseCount,tokens:U.tokens,color:U.color,isLast:X===I.length-1,isResolved:U.isResolved,isError:U.isError,isAsync:U.isAsync,shouldAnimate:A,lastToolInfo:U.lastToolInfo,hideType:E})))}function FZA(H){if(H?.subagent_type&&H.subagent_type!==vyH.agentType){if(H.subagent_type==="worker")return"Task";return H.subagent_type}return"Task"}function KZA(H){if(!H?.subagent_type)return;return zBH(H.subagent_type)}function gH1(H,$){let A=0,L=0;for(let D=H.length-1;D>=0;D--){let B=H[D],f=aKD(B,$);if(f&&(f.isSearch||f.isRead)){if(B.data.message.type==="user"){if(f.isSearch)A++;else if(f.isRead)L++}}else break}if(A+L>=2)return kF$(A,L,!0);let I=[...H].reverse().find((D)=>{let B=D.data.message;return B.type==="user"&&B.message.content.some((f)=>f.type==="tool_result")});if(I?.data.message.type==="user"){let D=I.data.message.message.content.find((B)=>B.type==="tool_result");if(D?.type==="tool_result"){let B=D.tool_use_id,f=H.find((E)=>{let M=E.data.message;return M.type==="assistant"&&M.message.content.some((G)=>G.type==="tool_use"&&G.id===B)});if(f?.data.message.type==="assistant"){let E=f.data.message.message.content.find((M)=>M.type==="tool_use"&&M.id===B);if(E?.type==="tool_use"){let M=$.find((J)=>J.name===E.name);if(!M)return E.name;let G=E.input,U=M.inputSchema.safeParse(G),X=M.userFacingName(U.success?U.data:void 0);if(M.getToolUseSummary){let J=M.getToolUseSummary(U.success?U.data:void 0);if(J)return`${X}: ${J}`}return X}}}}return null}function rKD(H){return!!H&&H!==vyH.agentType&&H!=="worker"}var kA,yH1=3,hH1=9,bH1=7,kH1="Initializing\u2026";var v_$=K(()=>{xH();_F();j5();Q9();nx();iB();A6H();_L();L3A();w7();q7();lr();lB();j0();eB();pQ$();nKD();iK$();TQH();rD();hx();aI();kA=b(s(),1)});function AQD(H){let $=H.trim();if(!$.startsWith("/"))return null;let L=$.slice(1).split(" ");if(!L[0])return null;let I=L[0],D=!1,B=1;if(L.length>1&&L[1]==="(MCP)")I=I+" (MCP)",D=!0,B=2;let f=L.slice(B).join(" ");return{commandName:I,args:f,isMcp:D}}function h_$(H,$,A,L,I){let D=0;for(let B of TR){let f=A[B];if(!f)continue;for(let E of f)for(let M of E.hooks){let G=M.once?()=>{N(`Removing one-shot hook for event ${B} in skill '${L}'`),qPI(H,$,B,M)}:void 0;T4$(H,$,B,E.matcher||"",M,G,I),D++}}if(D>0)N(`Registered ${D} hooks from skill '${L}'`)}var WZA=K(()=>{KGH();pg();E$()});function b_$(H){let A=M$().skillUsage?.[H],L=Date.now(),I=(A?.usageCount??0)+1;if(!A||A.usageCount!==I||A.lastUsedAt!==L)AA((D)=>({...D,skillUsage:{...D.skillUsage,[H]:{usageCount:I,lastUsedAt:L}}}))}function k_$(H){let A=M$().skillUsage?.[H];if(!A)return 0;let L=(Date.now()-A.lastUsedAt)/86400000,I=Math.pow(0.5,L/7);return A.usageCount*Math.max(I,0.1)}var u_$=K(()=>{vA()});async function mH1(H,$,A,L,I,D){let B=hT();c("tengu_slash_command_forked",{command_name:H.name});let{skillContent:f,modifiedGetAppState:E,baseAgent:M,promptMessages:G}=await m_$(H,$,A),U=[],X=[];N(`Executing forked slash command /${H.name} with agent ${M.agentType}`);let J=[],F=`forked-command-${H.name}`,Q=0,W=(Z)=>{return Q++,{type:"progress",data:{message:Z,normalizedMessages:X,type:"agent_progress",prompt:f,agentId:B},parentToolUseID:F,toolUseID:`${F}-${Q}`,timestamp:new Date().toISOString(),uuid:IQD.randomUUID()}},P=()=>{I({jsx:L6H(J,{tools:A.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};P();try{for await(let Z of fz({agentDefinition:M,promptMessages:G,toolUseContext:{...A,getAppState:E},canUseTool:D,isAsync:!1,querySource:"agent:custom",model:H.model,availableTools:A.options.tools})){U.push(Z);let q=g5([Z]);if(X.push(...q),Z.type==="assistant"){let O=b4$(Z);if(O>0)A.setResponseLength((u)=>u+O);let j=q[0];if(j&&j.type==="assistant")J.push(W(Z)),P()}if(Z.type==="user"){let O=q[0];if(O&&O.type==="user")J.push(W(O)),P()}}}finally{I(null)}let C=p_$(U,"Command completed");return N(`Forked slash command /${H.name} completed with agent ${B}`),{messages:[R$({content:yP({inputString:`/${H.userFacingName()} ${$}`.trim(),precedingInputBlocks:L})}),R$({content:` Then start a tmux session with: tmux new-session -s claude`;case"linux":case"wsl":return`To use agent swarms, install tmux: Then start a tmux session with: tmux new-session -s claude`;case"windows":return`To use agent swarms, you need tmux which requires WSL (Windows Subsystem for Linux). Then start a tmux session with: tmux new-session -s claude`;default:return`To use agent swarms, install tmux using your system's package manager. Then start a tmux session with: tmux new-session -s claude`}}function aZA(H){switch(H){case"tmux":return DY$();case"iterm2":return GWD()}}function F6H(){return J6H}function Z$1(){return QkH()}function vh(){if(tI())return N("[BackendRegistry] isInProcessEnabled: true (non-interactive session)"),!0;let H=Z$1(),$;if(H==="in-process")$=!0;else if(H==="tmux")$=!1;else $=!e_$();return N(`[BackendRegistry] isInProcessEnabled: ${$} (mode=${H}, insideTmux=${e_$()})`),$}function UWD(){if(!LY$)LY$=pQD();return LY$}async function q$1(H=!1){if(H&&vh())return N("[BackendRegistry] Using in-process executor"),UWD();return N("[BackendRegistry] Using pane backend executor"),T$1()}async function T$1(){if(!IY$){let H=await Ut();IY$=tQD(H.backend),N(`[BackendRegistry] Created PaneBackendExecutor wrapping ${H.backend.type}`)}return IY$}function z$1(){J6H=null,Uz=null,LY$=null,IY$=null,iZA=!1}var J6H=null,Uz=null,iZA=!1,LY$=null,IY$=null,nZA=null,rZA=null;var jS=K(()=>{dQD();sQD();yh();E$();hZA();Z9();U6H();g$()});async function eZA(){if(!oZA)oZA=await Ut();return oZA.backend}function Rp(H){let $=tZA.get(H);if($)return $;let A=h5[sZA%h5.length];return tZA.set(H,A),sZA++,A}function JWD(){tZA.clear(),sZA=0}async function FWD(){let{isInsideTmux:H}=await Promise.resolve().then(() => (yh(),lQD));return H()}async function KWD(H,$){return(await eZA()).createTeammatePaneInSwarmView(H,$)}async function QWD(H,$=!1){return(await eZA()).enablePaneBorderStatus(H,$)}async function WWD(H,$,A=!1){return(await eZA()).sendCommandToPane(H,$,A)}var tZA,sZA=0,oZA=null;var WkH=K(()=>{q7();jS();tZA=new Map});function VWD({onDone:H,tmuxAvailable:$}){let[A,L]=K6H.useState("initial"),[I,D]=K6H.useState(null),[B,f]=K6H.useState(null),E=zB();K6H.useEffect(()=>{eQD().then((Z)=>{D(Z)})},[]);let M=y0.useCallback(()=>{H("cancelled")},[H]);BA("confirm:no",M,{context:"Confirmation",isActive:A!=="installing"&&A!=="verifying"}),WL((Z,q)=>{if(A==="api-instructions"&&q.return)L("verifying"),yZA().then((O)=>{if(O.success)vZA(),L("success"),setTimeout(()=>H("installed"),1500);else f(O.error||"Verification failed"),L("failed")})});async function G(){if(!I){f("No Python package manager found (uvx, pipx, or pip)"),L("failed");return}L("installing");let Z=await HWD(I);if(Z.success)L("api-instructions");else f(Z.error||"Installation failed"),L("install-failed")}function U(){AWD(!0),H("use-tmux")}let X=()=>{switch(A){case"initial":return J();case"installing":return F();case"install-failed":return Q();case"api-instructions":return W();case"verifying":return P();case"success":return C();case"failed":return Y();default:return null}};function J(){let Z=[{label:"Install it2 now",value:"install",description:I?`Uses ${I} to install the it2 CLI tool`:"Requires Python (uvx, pipx, or pip)"}];if($)Z.push({label:"Use tmux instead",value:"tmux",description:"Opens teammates in a separate tmux session"});return Z.push({label:"Cancel",value:"cancel",description:"Skip teammate spawning for now"}),y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,null,"To use native iTerm2 split panes for teammates, you need the"," ",y0.default.createElement(V,{bold:!0},"it2")," CLI tool."),y0.default.createElement(V,{dimColor:!0},"This enables teammates to appear as split panes within your current window."),y0.default.createElement(x,{marginTop:1},y0.default.createElement(QA,{options:Z,onChange:(q)=>{switch(q){case"install":G();break;case"tmux":U();break;case"cancel":H("cancelled");break}},onCancel:()=>H("cancelled")})))}function F(){return y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(x,null,y0.default.createElement(vD,null),y0.default.createElement(V,null," Installing it2 using ",I,"\u2026")),y0.default.createElement(V,{dimColor:!0},"This may take a moment."))}function Q(){let Z=[{label:"Try again",value:"retry",description:"Retry the installation"}];if($)Z.push({label:"Use tmux instead",value:"tmux",description:"Falls back to tmux for teammate panes"});return Z.push({label:"Cancel",value:"cancel",description:"Skip teammate spawning for now"}),y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,{color:"error"},"Installation failed"),B&&y0.default.createElement(V,{dimColor:!0},B),y0.default.createElement(V,{dimColor:!0},"You can try installing manually:"," ",I==="uvx"?"uv tool install it2":I==="pipx"?"pipx install it2":"pip install --user it2"),y0.default.createElement(x,{marginTop:1},y0.default.createElement(QA,{options:Z,onChange:(q)=>{switch(q){case"retry":G();break;case"tmux":U();break;case"cancel":H("cancelled");break}},onCancel:()=>H("cancelled")})))}function W(){let Z=$WD();return y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,{color:"success"},"\u2713 it2 installed successfully"),y0.default.createElement(x,{flexDirection:"column",marginTop:1},Z.map((q,O)=>y0.default.createElement(V,{key:O},q))),y0.default.createElement(x,{marginTop:1},y0.default.createElement(V,{dimColor:!0},"Press Enter when ready to verify\u2026")))}function P(){return y0.default.createElement(x,null,y0.default.createElement(vD,null),y0.default.createElement(V,null," Verifying it2 can communicate with iTerm2\u2026"))}function C(){return y0.default.createElement(x,{flexDirection:"column"},y0.default.createElement(V,{color:"success"},"\u2713 iTerm2 split pane support is ready"),y0.default.createElement(V,{dimColor:!0},"Teammates will now appear as split panes."))}function Y(){let Z=[{label:"Try again",value:"retry",description:"Verify the connection again"}];if($)Z.push({label:"Use tmux instead",value:"tmux",description:"Falls back to tmux for teammate panes"});return Z.push({label:"Cancel",value:"cancel",description:"Skip teammate spawning for now"}),y0.default.createElement(x,{flexDirection:"column",gap:1},y0.default.createElement(V,{color:"error"},"Verification failed"),B&&y0.default.createElement(V,{dimColor:!0},B),y0.default.createElement(V,null,"Make sure:"),y0.default.createElement(x,{flexDirection:"column",paddingLeft:2},y0.default.createElement(V,null,"\u2022 Python API is enabled in iTerm2 preferences"),y0.default.createElement(V,null,"\u2022 You may need to restart iTerm2 after enabling")),y0.default.createElement(x,{marginTop:1},y0.default.createElement(QA,{options:Z,onChange:(q)=>{switch(q){case"retry":L("verifying"),yZA().then((O)=>{if(O.success)vZA(),L("success"),setTimeout(()=>H("installed"),1500);else f(O.error||"Verification failed"),L("failed")});break;case"tmux":U();break;case"cancel":H("cancelled");break}},onCancel:()=>H("cancelled")})))}return y0.default.createElement(x,{flexDirection:"column"},y0.default.createElement(Uf,{dividerColor:"permission"}),y0.default.createElement(x,{marginX:1,flexDirection:"column",gap:1,paddingBottom:1},y0.default.createElement(V,{bold:!0,color:"permission"},"iTerm2 Split Pane Setup"),X(),A!=="installing"&&A!=="verifying"&&A!=="success"&&y0.default.createElement(V,{dimColor:!0,italic:!0},E.pending?y0.default.createElement(y0.default.Fragment,null,"Press ",E.keyName," again to exit"):y0.default.createElement(y0.default.Fragment,null,"Esc to cancel"))))}var y0,K6H;var PWD=K(()=>{xH();UM();$I();l8();JM();e6();hZA();y0=b(s(),1),K6H=b(s(),1)});async function N$1(H){return(await jA(q3,["has-session","-t",H])).code===0}async function O$1(H){if(!await N$1(H)){let A=await jA(q3,["new-session","-d","-s",H]);if(A.code!==0)throw Error(`Failed to create tmux session '${H}': ${A.stderr||"Unknown error"}`)}}function YWD(H){return H.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()}function $qA(H){return H.replace(/@/g,"-")}function CWD(){if(process.env[t7H])return process.env[t7H];return U8()?process.execPath:process.argv[1]}function wWD(H){let $=[],{planModeRequired:A,permissionMode:L}=H||{};if(A);else if(L==="bypassPermissions"||Gk())$.push("--dangerously-skip-permissions");else if(L==="acceptEdits")$.push("--permission-mode acceptEdits");let I=C_();if(I)$.push(`--model ${wI([I])}`);let D=xc();if(D)$.push(`--settings ${wI([D])}`);let B=YHH();for(let f of B)$.push(`--plugin-dir ${wI([f])}`);return $.join(" ")}function ZWD(H){return BY$.join(P6(),YWD(H))}function Y9H(H){let $=BY$.join(ZWD(H),"config.json");if(!Q6H.existsSync($))return null;try{let A=Q6H.readFileSync($,"utf-8");return DA(A)}catch(A){return N(`[spawnTeammate] Failed to read team file for ${H}: ${A instanceof Error?A.message:String(A)}`),null}}function AqA(H,$){let A=ZWD(H);Q6H.mkdirSync(A,{recursive:!0});let L=BY$.join(A,"config.json");iL(L,yH($,null,2))}function LqA(H,$){if(!$)return H;let A=Y9H($);if(!A)return H;let L=new Set(A.members.map((D)=>D.name.toLowerCase()));if(!L.has(H.toLowerCase()))return H;let I=2;while(L.has(`${H}-${I}`.toLowerCase()))I++;return`${H}-${I}`}async function x$1(H,$){let{setAppState:A,getAppState:L}=$,{name:I,prompt:D,agent_type:B,cwd:f,plan_mode_required:E}=H,M=H.model??HqA;if(!I||!D)throw Error("name and prompt are required for spawn operation");let G=await L(),U=H.team_name||G.teamContext?.teamName;if(!U)throw Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context.");let X=LqA(I,U),J=$qA(X),F=_w(J,U),Q=f||C$(),W=await Ut();if(W.needsIt2Setup&&$.setToolJSX){let d=await Mt(),k=await new Promise((n)=>{$.setToolJSX({jsx:_WD.default.createElement(VWD,{onDone:n,tmuxAvailable:d}),shouldHidePromptInput:!0})});if($.setToolJSX(null),k==="cancelled")throw Error("Teammate spawn cancelled - iTerm2 setup required");if(k==="installed"){let{resetBackendDetection:n}=await Promise.resolve().then(() => (jS(),XWD));n()}}let P=await FWD(),C=Rp(F),{paneId:Y,isFirstTeammate:Z}=await KWD(J,C);if(Z&&P)await QWD();let q=CWD(),O=[`--agent-id ${wI([F])}`,`--agent-name ${wI([J])}`,`--team-name ${wI([U])}`,`--agent-color ${wI([C])}`,`--parent-session-id ${wI([j$()])}`,E?"--plan-mode-required":"",B?`--agent-type ${wI([B])}`:""].filter(Boolean).join(" "),j=wWD({planModeRequired:E,permissionMode:G.toolPermissionContext.mode});if(M)j=j.split(" ").filter((d,k,n)=>d!=="--model"&&n[k-1]!=="--model").join(" "),j=j?`${j} --model ${wI([M])}`:`--model ${wI([M])}`;let u=j?` ${j}`:"",y=`cd ${wI([Q])} && CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 ${wI([q])} ${O}${u}`;await WWD(Y,y,!P);let g=P?"current":eY,h=P?"current":"swarm-view";A((d)=>({...d,teamContext:{...d.teamContext,teamName:U??d.teamContext?.teamName??"default",teamFilePath:d.teamContext?.teamFilePath??"",leadAgentId:d.teamContext?.leadAgentId??"",teammates:{...d.teamContext?.teammates||{},[F]:{name:J,agentType:B,color:C,tmuxSessionName:g,tmuxPaneId:Y,cwd:Q,spawnedAt:Date.now()}}}})),qWD(A,{teammateId:F,sanitizedName:J,teamName:U,teammateColor:C,prompt:D,plan_mode_required:E,paneId:Y,insideTmux:P});let p=Y9H(U);if(!p)throw Error(`Team "${U}" does not exist. Call spawnTeam first to create the team.`);return p.members.push({agentId:F,name:J,agentType:B,model:M,prompt:D,color:C,planModeRequired:E,joinedAt:Date.now(),tmuxPaneId:Y,cwd:Q,subscriptions:[],backendType:W.backend.type}),AqA(U,p),K8(J,{from:kE,text:D,timestamp:new Date().toISOString()},U),{data:{teammate_id:F,agent_id:F,agent_type:B,model:M,name:J,color:C,tmux_session_name:g,tmux_window_name:h,tmux_pane_id:Y,team_name:U,is_splitpane:!0,plan_mode_required:E}}}async function S$1(H,$){let{setAppState:A,getAppState:L}=$,{name:I,prompt:D,agent_type:B,cwd:f,plan_mode_required:E}=H,M=H.model??HqA;if(!I||!D)throw Error("name and prompt are required for spawn operation");let G=await L(),U=H.team_name||G.teamContext?.teamName;if(!U)throw Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context.");let X=LqA(I,U),J=$qA(X),F=_w(J,U),Q=`teammate-${YWD(J)}`,W=f||C$();await O$1(eY);let P=Rp(F),C=await jA(q3,["new-window","-t",eY,"-n",Q,"-P","-F","#{pane_id}"]);if(C.code!==0)throw Error(`Failed to create tmux window: ${C.stderr}`);let Y=C.stdout.trim(),Z=CWD(),q=[`--agent-id ${wI([F])}`,`--agent-name ${wI([J])}`,`--team-name ${wI([U])}`,`--agent-color ${wI([P])}`,`--parent-session-id ${wI([j$()])}`,E?"--plan-mode-required":"",B?`--agent-type ${wI([B])}`:""].filter(Boolean).join(" "),O=wWD({planModeRequired:E,permissionMode:G.toolPermissionContext.mode});if(M)O=O.split(" ").filter((h,p,d)=>h!=="--model"&&d[p-1]!=="--model").join(" "),O=O?`${O} --model ${wI([M])}`:`--model ${wI([M])}`;let j=O?` ${O}`:"",u=`cd ${wI([W])} && CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 ${wI([Z])} ${q}${j}`,y=await jA(q3,["send-keys","-t",`${eY}:${Q}`,u,"Enter"]);if(y.code!==0)throw Error(`Failed to send command to tmux window: ${y.stderr}`);A((h)=>({...h,teamContext:{...h.teamContext,teamName:U??h.teamContext?.teamName??"default",teamFilePath:h.teamContext?.teamFilePath??"",leadAgentId:h.teamContext?.leadAgentId??"",teammates:{...h.teamContext?.teammates||{},[F]:{name:J,agentType:B,color:P,tmuxSessionName:eY,tmuxPaneId:Y,cwd:W,spawnedAt:Date.now()}}}})),qWD(A,{teammateId:F,sanitizedName:J,teamName:U,teammateColor:P,prompt:D,plan_mode_required:E,paneId:Y,insideTmux:!1});let g=Y9H(U);if(!g)throw Error(`Team "${U}" does not exist. Call spawnTeam first to create the team.`);return g.members.push({agentId:F,name:J,agentType:B,model:M,prompt:D,color:P,planModeRequired:E,joinedAt:Date.now(),tmuxPaneId:Y,cwd:W,subscriptions:[],backendType:"tmux"}),AqA(U,g),K8(J,{from:kE,text:D,timestamp:new Date().toISOString()},U),{data:{teammate_id:F,agent_id:F,agent_type:B,model:M,name:J,color:P,tmux_session_name:eY,tmux_window_name:Q,tmux_pane_id:Y,team_name:U,is_splitpane:!1,plan_mode_required:E}}}function qWD(H,{teammateId:$,sanitizedName:A,teamName:L,teammateColor:I,prompt:D,plan_mode_required:B,paneId:f,insideTmux:E}){let M=Zm("in_process_teammate"),G=`${A}: ${D.substring(0,50)}${D.length>50?"...":""}`,U=new AbortController,X={...wP(M,"in_process_teammate",G),type:"in_process_teammate",status:"running",identity:{agentId:$,agentName:A,teamName:L,color:I,planModeRequired:B??!1,parentSessionId:j$()},prompt:D,abortController:U,awaitingPlanApproval:!1,permissionMode:B?"plan":"default",isIdle:!1,shutdownRequested:!1,lastReportedToolCount:0,lastReportedTokenCount:0,pendingUserMessages:[]};qP(X,H),U.signal.addEventListener("abort",()=>{let F=!E?["-L",o7H(),"kill-pane","-t",f]:["kill-pane","-t",f];jA(q3,F)})}async function j$1(H,$){let{setAppState:A,getAppState:L}=$,{name:I,prompt:D,agent_type:B,plan_mode_required:f}=H,E=H.model??HqA;if(!I||!D)throw Error("name and prompt are required for spawn operation");let M=await L(),G=H.team_name||M.teamContext?.teamName;if(!G)throw Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context.");let U=LqA(I,G),X=$qA(U),J=_w(X,G),F=Rp(J),Q;if(B){let Z=$.options.agentDefinitions.activeAgents.find((q)=>q.agentType===B);if(Z&&rK$(Z))Q=Z;N(`[handleSpawnInProcess] agent_type=${B}, found=${!!Q}`)}let P=await S7H({name:X,teamName:G,prompt:D,color:F,planModeRequired:f??!1,model:E},$);if(!P.success)throw Error(P.error??"Failed to spawn in-process teammate");if(N(`[handleSpawnInProcess] spawn result: taskId=${P.taskId}, hasContext=${!!P.teammateContext}, hasAbort=${!!P.abortController}`),P.taskId&&P.teammateContext&&P.abortController)s_$({identity:{agentId:J,agentName:X,teamName:G,color:F,planModeRequired:f??!1,parentSessionId:P.teammateContext.parentSessionId},taskId:P.taskId,prompt:D,description:H.description,agentDefinition:Q,teammateContext:P.teammateContext,toolUseContext:$,abortController:P.abortController}),N(`[handleSpawnInProcess] Started agent execution for ${J}`);A((Y)=>{let Z=!Y.teamContext?.leadAgentId,q=Z?_w(kE,G):Y.teamContext.leadAgentId,O=Y.teamContext?.teammates||{},j=Z?{[q]:{name:kE,agentType:kE,color:Rp(q),tmuxSessionName:"in-process",tmuxPaneId:"leader",cwd:C$(),spawnedAt:Date.now()}}:{};return{...Y,teamContext:{...Y.teamContext,teamName:G??Y.teamContext?.teamName??"default",teamFilePath:Y.teamContext?.teamFilePath??"",leadAgentId:q,teammates:{...O,...j,[J]:{name:X,agentType:B,color:F,tmuxSessionName:"in-process",tmuxPaneId:"in-process",cwd:C$(),spawnedAt:Date.now()}}}}});let C=Y9H(G);if(!C)throw Error(`Team "${G}" does not exist. Call spawnTeam first to create the team.`);return C.members.push({agentId:J,name:X,agentType:B,model:E,prompt:D,color:F,planModeRequired:f,joinedAt:Date.now(),tmuxPaneId:"in-process",cwd:C$(),subscriptions:[],backendType:"in-process"}),AqA(G,C),{data:{teammate_id:J,agent_id:J,agent_type:B,model:E,name:X,color:F,tmux_session_name:"in-process",tmux_window_name:"in-process",tmux_pane_id:"in-process",team_name:G,is_splitpane:!1,plan_mode_required:f}}}async function R$1(H,$){if(vh())return j$1(H,$);if(H.use_splitpane!==!1)return x$1(H,$);return S$1(H,$)}async function TWD(H,$){return R$1(H,$)}var BY$,Q6H,_WD,HqA;var IqA=K(()=>{NA();Z$();WkH();B0();EX();PI();sU();E$();jS();xP$();xZA();yh();PWD();g$();$4H();Z$();kT();KBH();bx();BY$=require("path"),Q6H=require("fs"),_WD=b(s(),1),HqA=wAH.firstParty});function p$1(H){let $=0,A=g5(H);for(let L of A)if(L.type==="assistant"){for(let I of L.message.content)if(I.type==="tool_use")$++}return $}function BqA(H,$,A){let{prompt:L,resolvedAgentModel:I,isBuiltInAgent:D,startTime:B,agentType:f}=A,E=$C(H);if(E===void 0)throw Error("No assistant messages found");let M=E.message.content.filter((X)=>X.type==="text"),G=kSH(E.message.usage),U=p$1(H);return c("tengu_agent_tool_completed",{agent_type:f,model:I,prompt_char_count:L.length,response_char_count:M.length,assistant_message_count:H.length,total_tool_uses:U,duration_ms:Date.now()-B,total_tokens:G,is_built_in_agent:D}),{agentId:$,content:M,totalDurationMs:Date.now()-B,totalTokens:G,totalToolUseCount:U,usage:E.message.usage}}function d$1(H,$){if(!dL())return;return H.team_name||$.teamContext?.teamName}var EqA,y$1=2000,fY$,v$1="Optional model to use for this agent. If not specified, inherits from parent. Prefer haiku for quick, straightforward tasks to minimize cost and latency.",h$1,b$1,zWD,QZA,k$1,u$1,g$1,m$1,qQH;var iK$=K(()=>{SHH();mI();yW();XJ();_L();thI();q7();aI();lG();NA();T8();z$();ft();$3();_L();v_$();oa();YP();kT();OBH();tG();YZA();dx();rB();ZZA();E$();Ow();tjH();CQD();XE();IqA();h2();g7();EqA=b(s(),1),fY$=A$(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS),h$1=S.object({description:S.string().describe("A short (3-5 word) description of the task"),prompt:S.string().describe("The task for the agent to perform"),subagent_type:S.string().describe("The type of specialized agent to use for this task"),model:S.enum(["sonnet","opus","haiku"]).optional().describe(v$1),resume:S.string().optional().describe("Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript."),run_in_background:S.boolean().optional().describe(`Set to true to run this agent in the background. The tool result will include an output_file path - use ${$B} tool or ${WD} tail to check on output.`),max_turns:S.number().int().positive().optional().describe("Maximum number of agentic turns (API round-trips) before stopping. Used internally for warmup.")}),b$1=S.object({name:S.string().optional().describe("Name for the spawned agent"),team_name:S.string().optional().describe("Team name for spawning. Uses current team context if omitted."),mode:o0L.optional().describe('Permission mode for spawned teammate (e.g., "plan" to require plan approval).')}),zWD=h$1.merge(b$1),QZA=fY$?zWD.omit({run_in_background:!0}):zWD,k$1=S.object({agentId:S.string(),content:S.array(S.object({type:S.literal("text"),text:S.string()})),totalToolUseCount:S.number(),totalDurationMs:S.number(),totalTokens:S.number(),usage:S.object({input_tokens:S.number(),output_tokens:S.number(),cache_creation_input_tokens:S.number().nullable(),cache_read_input_tokens:S.number().nullable(),server_tool_use:S.object({web_search_requests:S.number(),web_fetch_requests:S.number()}).nullable(),service_tier:S.enum(["standard","priority","batch"]).nullable(),cache_creation:S.object({ephemeral_1h_input_tokens:S.number(),ephemeral_5m_input_tokens:S.number()}).nullable()})}),u$1=k$1.extend({status:S.literal("completed"),prompt:S.string()}),g$1=S.object({status:S.literal("async_launched"),agentId:S.string().describe("The ID of the async agent"),description:S.string().describe("The description of the task"),prompt:S.string().describe("The prompt for the agent"),outputFile:S.string().describe("Path to the output file for checking agent progress")}),m$1=S.union([u$1,g$1,$bI]);qQH={async prompt({agents:H,tools:$,getToolPermissionContext:A,allowedAgentTypes:L}){let I=await A(),D=[];for(let M of $)if(M.name?.startsWith("mcp__")){let U=M.name.split("__")[1];if(U&&!D.includes(U))D.push(U)}let B=FbI(H,D),f=fqA(B,I,E0);return await ohI(f,!1,L)},name:E0,maxResultSizeChars:1e5,async description(){return"Launch a new task"},inputSchema:QZA,outputSchema:m$1,async call({prompt:H,subagent_type:$,description:A,model:L,resume:I,run_in_background:D,max_turns:B,name:f,team_name:E,mode:M},G,U,X,J){let F=Date.now(),Q=await G.getAppState(),W=Q.toolPermissionContext.mode;if(E&&!dL())throw Error("Agent Teams is not yet available on your plan.");let P=d$1({team_name:E},Q);if(oW()&&P){if(f)throw Error("In-process teammates cannot spawn other teammates. Only the team leader can spawn teammates.");if(D===!0)throw Error("In-process teammates cannot spawn background agents. Use run_in_background=false for synchronous subagents.")}if(P&&f){if($){let WH=G.options.agentDefinitions.activeAgents.find((wH)=>wH.agentType===$);if(WH?.color)NBH($,WH.color)}let HH=await TWD({name:f,prompt:H,description:A,team_name:P,use_splitpane:!0,plan_mode_required:M==="plan",model:L,agent_type:$},G);return{data:{status:"teammate_spawned",prompt:H,...HH.data}}}let C=G.options.agentDefinitions.activeAgents,{allowedAgentTypes:Y}=G.options.agentDefinitions,Z=fqA(Y?C.filter((HH)=>Y.includes(HH.agentType)):C,Q.toolPermissionContext,E0),q=Z.find((HH)=>HH.agentType===$);if(!q){if(C.find((BH)=>BH.agentType===$)){let BH=MqA(Q.toolPermissionContext,E0,$);throw Error(`Agent type '${$}' has been denied by permission rule '${E0}(${$})' from ${BH?.source??"settings"}.`)}throw Error(`Agent type '${$}' not found. Available agents: ${Z.map((BH)=>BH.agentType).join(", ")}`)}if(q.requiredMcpServers?.length){let HH=[];for(let BH of Q.mcp.tools)if(BH.name?.startsWith("mcp__")){let wH=BH.name.split("__")[1];if(wH&&!HH.includes(wH))HH.push(wH)}if(!E3A(q,HH)){let BH=q.requiredMcpServers.filter((WH)=>!HH.some((wH)=>wH.toLowerCase().includes(WH.toLowerCase())));throw Error(`Agent '${$}' requires MCP servers matching: ${BH.join(", ")}. MCP servers with tools: ${HH.length>0?HH.join(", "):"none"}. Use /mcp to configure and authenticate the required MCP servers.`)}}if(q.color)NBH($,q.color);let O=j9$(q.model,G.options.mainLoopModel,L,W,q.agentType);c("tengu_agent_tool_selected",{agent_type:q.agentType,model:O,source:q.source,color:q.color,is_built_in_agent:TK(q)});let j;if(I){let HH=Q.tasks[I];if(HH&&HH.status==="running")throw Error(`Cannot resume agent ${I}: it is still running. Use TaskStop to stop it first, or wait for it to complete.`);let BH=await B6H(ZP(I));if(!BH)throw Error(`No transcript found for agent ID: ${I}`);j=PkH(_kH(GY$(BH)))}let u=q?.forkContext?G.messages:void 0,y;try{let HH=Array.from(Q.toolPermissionContext.additionalWorkingDirectories.keys()),BH=q.getSystemPrompt({toolUseContext:G});if(q.memory)c("tengu_agent_memory_loaded",{...{},scope:q.memory,isMainLoopAgent:!1});y=await IkH([BH],O,HH)}catch(HH){N(`Failed to get system prompt for agent ${q.agentType}: ${HH instanceof Error?HH.message:String(HH)}`)}let g=q?.forkContext?AbI(H,X):[R$({content:H})],h={prompt:H,resolvedAgentModel:O,isBuiltInAgent:TK(q),startTime:F,agentType:q.agentType},p=!1,d=(D===!0||p)&&!fY$,k={...Q.toolPermissionContext,mode:q.permissionMode??"acceptEdits"},n=EY$(k,Q.mcp.tools),GH={agentDefinition:q,promptMessages:j?[...j,...g]:g,toolUseContext:G,canUseTool:U,forkContextMessages:u,isAsync:d,...p?{canShowPermissionPrompts:!0}:{},querySource:G.options.querySource??UQD(q.agentType,TK(q)),model:L,maxTurns:B,override:y?{systemPrompt:y}:void 0,availableTools:n};if(d){let HH=I||hT(),BH=VyI({agentId:HH,description:A,prompt:H,selectedAgent:q,setAppState:G.setAppState,parentAbortController:G.abortController}),WH={agentId:HH,parentSessionId:Xn(),agentType:"subagent",subagentName:q.agentType,isBuiltIn:TK(q)};return WKH(WH,async()=>{let wH;try{let QH=[],TH=FyH(),t=QyH(G.options.tools);for await(let MH of fz({...GH,override:{...GH.override,agentId:ZP(BH.agentId),abortController:BH.abortController},onCacheSafeParams:p?(CH)=>{let{stop:OH}=YQD(BH.agentId,ZP(BH.agentId),CH,G.setAppState);wH=OH}:void 0}))QH.push(MH),GQH(TH,MH,t,G.options.tools),m7A(BH.agentId,KyH(TH),G.setAppState);wH?.();let IH=BqA(QH,BH.agentId,h),KH=IH.content.filter((MH)=>MH.type==="text").map((MH)=>MH.text).join(` IMPORTANT: Do not update the env unless explicitly instructed to do so.`,errorCode:10};return null}var N6D=K(()=>{xd$();BM()});function _t(H,$,A){return}function x6D(H){let $=H.find((A)=>A.name==="claude-vscode");if($&&$.type==="connected"){O6D=$,$.client.setNotificationHandler(iA1,async(L)=>{let{eventName:I,eventData:D}=L.params;c(`tengu_vscode_${I}`,D)});let A={tengu_vscode_review_upsell:cf("tengu_vscode_review_upsell"),tengu_vscode_onboarding:cf("tengu_vscode_onboarding"),tengu_quiet_fern:NL("tengu_quiet_fern",!1),tengu_penguins_enabled:NL("tengu_penguins_enabled",!1)};$.client.notification({method:"experiment_gates",params:{gates:A}})}}var iA1,O6D=null;var N6H=K(()=>{mI();z$();SD();E$();iA1=S.object({method:S.literal("log_event"),params:S.object({eventName:S.string(),eventData:S.object({}).passthrough()})})});function gE(){if(tI())return nA1();return M$().fileCheckpointingEnabled!==!1&&!A$(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING)}function nA1(){return A$(process.env.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING)&&!A$(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING)}async function Ct(H,$,A){if(!gE())return;H((L)=>{try{let I=L.snapshots.at(-1);if(!I)return r(Error("FileHistory: Missing most recent snapshot")),c("tengu_file_history_track_edit_failed",{}),L;let D=h6D($);if(I.trackedFileBackups[D])return L;let B=L.trackedFiles.has(D)?L.trackedFiles:new Set(L.trackedFiles).add(D),E=!zH().existsSync($),M=E?dqA(null,1):dqA($,1),G=THH(I);G.trackedFileBackups[D]=M;let U={...L,snapshots:[...L.snapshots.slice(0,-1),G],trackedFiles:B};return b6D(U),OkH(A,G,!0).catch((X)=>{r(Error(`FileHistory: Failed to record snapshot: ${X}`))}),c("tengu_file_history_track_edit_success",{isNewFile:E,version:M.version}),N(`FileHistory: Tracked file modification for ${$}`),U}catch(I){return r(I),c("tengu_file_history_track_edit_failed",{}),L}})}async function O6H(H,$){if(!gE())return;H((A)=>{try{let L=zH(),I=new Date,D={},B=A.snapshots.at(-1);if(B){N(`FileHistory: Making snapshot for message ${$}`);for(let M of A.trackedFiles)try{let G=lqA(M);if(!L.existsSync(G)){let U=B.trackedFileBackups[M],X=U?U.version+1:1;D[M]={backupFileName:null,version:X,backupTime:new Date},c("tengu_file_history_backup_deleted_file",{version:X}),N(`FileHistory: Missing tracked file: ${M}`)}else{let U=B.trackedFileBackups[M];if(U&&U.backupFileName!==null&&!v6D(G,U.backupFileName)){D[M]=U;continue}let X=U?U.version+1:1,J=dqA(G,X);D[M]=J}}catch(G){r(G),c("tengu_file_history_backup_file_failed",{})}}let f={messageId:$,trackedFileBackups:D,timestamp:I},E={...A,snapshots:[...A.snapshots,f]};return b6D(E),tA1(A,E),OkH($,f,!1).catch((M)=>{r(Error(`FileHistory: Failed to record snapshot: ${M}`))}),N(`FileHistory: Added snapshot for ${$}, tracking ${A.trackedFiles.size} files`),c("tengu_file_history_snapshot_success",{trackedFilesCount:A.trackedFiles.size,snapshotCount:E.snapshots.length}),E}catch(L){return r(L),c("tengu_file_history_snapshot_failed",{}),A}})}async function RY$(H,$){if(!gE())return;let A=null;if(H((L)=>{let I=L;try{let D=L.snapshots.findLast((f)=>f.messageId===$);if(!D)return r(Error(`FileHistory: Snapshot for ${$} not found`)),c("tengu_file_history_rewind_failed",{trackedFilesCount:I.trackedFiles.size,snapshotFound:!1}),A=Error("The selected snapshot was not found"),I;N(`FileHistory: [Rewind] Rewinding to snapshot for ${$}`);let B=y6D(I,D,!1);N(`FileHistory: [Rewind] Finished rewinding to ${$}`),c("tengu_file_history_rewind_success",{trackedFilesCount:I.trackedFiles.size,filesChangedCount:B?.filesChanged?.length})}catch(D){A=D,r(D),c("tengu_file_history_rewind_failed",{trackedFilesCount:I.trackedFiles.size,snapshotFound:!0})}return I}),A)throw A}function yY$(H,$){if(!gE())return!1;return H.snapshots.some((A)=>A.messageId===$)}function vY$(H,$){if(!gE())return;let A=H.snapshots.findLast((L)=>L.messageId===$);if(!A)return;return y6D(H,A,!0)}function y6D(H,$,A){let L=zH(),I=[],D=0,B=0;for(let f of H.trackedFiles)try{let E=lqA(f),M=$.trackedFileBackups[f],G=M?M.backupFileName:oA1(f,H);if(G===void 0)r(Error("FileHistory: Error finding the backup file to apply")),c("tengu_file_history_rewind_restore_file_failed",{dryRun:A});else if(G===null){if(L.existsSync(E)){if(A){let U=S6D(E,void 0);D+=U?.insertions||0,B+=U?.deletions||0}else L.unlinkSync(E),N(`FileHistory: [Rewind] Deleted ${E}`);I.push(E)}}else if(A){let U=S6D(E,G);if(D+=U?.insertions||0,B+=U?.deletions||0,U?.insertions||U?.deletions)I.push(E)}else if(v6D(E,G))aA1(E,G),N(`FileHistory: [Rewind] Restored ${E} from ${G}`),I.push(E)}catch(E){r(E),c("tengu_file_history_rewind_restore_file_failed",{dryRun:A})}return{filesChanged:I,insertions:D,deletions:B}}function v6D(H,$){let A=zH(),L=Yt($);try{let I=A.existsSync(H),D=A.existsSync(L);if(I!==D)return!0;else if(!I)return!1;let B=A.statSync(H),f=A.statSync(L);if(B.mode!==f.mode||B.size!==f.size)return!0;if(B.mtimeMs{if(X.added)L+=X.count||0;if(X.removed)I+=X.count||0})}catch(D){r(Error(`FileHistory: Error generating diffStats: ${D}`))}return{filesChanged:A,insertions:L,deletions:I}}function rA1(H,$){return`${j6D.createHash("sha256").update(H).digest("hex").slice(0,16)}@v${$}`}function Yt(H,$){let A=UL();return Xz.join(A,"file-history",$||j$(),H)}function dqA(H,$){let A=H!==null?rA1(H,$):null;if(H&&A){let L=zH(),I=Yt(A),D=Xz.dirname(I);if(!L.existsSync(D))L.mkdirSync(D);let B=L.readFileSync(H,{encoding:"utf-8"});iL(I,B,{encoding:"utf-8",flush:!0});let f=L.statSync(H),E=f.mode;cqA.chmodSync(I,E),c("tengu_file_history_backup_file_created",{version:$,fileSize:f.size})}return{backupFileName:A,version:$,backupTime:new Date}}function aA1(H,$){let A=zH(),L=Yt($);if(!A.existsSync(L)){c("tengu_file_history_rewind_restore_file_failed",{}),r(Error(`FileHistory: [Rewind] Backup file not found: ${L}`));return}let I=A.readFileSync(L,{encoding:"utf-8"}),D=Xz.dirname(H);if(!A.existsSync(D))A.mkdirSync(D);iL(H,I,{encoding:"utf-8",flush:!0});let B=A.statSync(L).mode;cqA.chmodSync(H,B)}function oA1(H,$){for(let A of $.snapshots){let L=A.trackedFileBackups[H];if(L!==void 0&&L.version===1)return L.backupFileName}return}function h6D(H){if(!Xz.isAbsolute(H))return H;let $=zL();if(H.startsWith($))return Xz.relative($,H);return H}function lqA(H){if(Xz.isAbsolute(H))return H;return Xz.join(zL(),H)}function hY$(H,$){if(!gE())return;let A=[],L=new Set;for(let I of H){let D={};for(let[B,f]of Object.entries(I.trackedFileBackups)){let E=h6D(B);L.add(E),D[E]=f}A.push({...I,trackedFileBackups:D})}$({snapshots:A,trackedFiles:L})}async function bY$(H){if(!gE())return;let $=H.fileHistorySnapshots;if(!$||H.messages.length===0)return;let L=H.messages[H.messages.length-1]?.sessionId;if(!L){r(Error("FileHistory: Failed to copy backups on restore (no previous session id)"));return}let I=j$();if(L===I){N(`FileHistory: No need to copy file history for resuming with same session id: ${I}`);return}try{for(let D of $){let B=!1;for(let[f,E]of Object.entries(D.trackedFileBackups)){if(!E.backupFileName)continue;let M=zH(),G=Yt(E.backupFileName,L),U=Yt(E.backupFileName,I);if(M.existsSync(U))continue;if(!M.existsSync(G)){r(Error(`FileHistory: Failed to copy backup ${E.backupFileName} on restore (backup file does not exist in ${L})`)),B=!0;break}let X=Xz.dirname(U);if(!M.existsSync(X))M.mkdirSync(X);try{M.linkSync(G,U)}catch{r(Error("FileHistory: Error hard linking backup file from previous session"));try{M.copyFileSync(G,U)}catch{B=!0,r(Error("FileHistory: Error copying over backup from previous session"))}}N(`FileHistory: Copied backup ${E.backupFileName} from session ${L} to ${I}`)}if(!B)OkH(D.messageId,D,!1).catch((f)=>{r(Error("FileHistory: Failed to record copy backup snapshot"))});else c("tengu_file_history_resume_copy_failed",{numSnapshots:$.length})}}catch(D){r(D)}}function tA1(H,$){let A=H.snapshots.at(-1),L=$.snapshots.at(-1);if(!L)return;let I=zH();for(let D of $.trackedFiles){let B=lqA(D),f=A?.trackedFileBackups[D],E=L.trackedFileBackups[D];if(f?.backupFileName===E?.backupFileName&&f?.version===E?.version)continue;let M=null;if(f?.backupFileName)try{let U=Yt(f.backupFileName);if(I.existsSync(U))M=I.readFileSync(U,{encoding:"utf-8"})}catch{}let G=null;if(E?.backupFileName)try{let U=Yt(E.backupFileName);if(I.existsSync(U))G=I.readFileSync(U,{encoding:"utf-8"})}catch{}else if(E?.backupFileName===null)G=null;if(M!==G)_t(B,M,G)}}function b6D(H){if(sA1)console.error(R6D.inspect(H,!1,5))}var j6D,Xz,R6D,cqA,sA1=!1;var AC=K(()=>{DL();Z$();E$();g$();Z$();_$();rB();NA();qFH();z$();vA();N6H();j6D=require("crypto"),Xz=require("path"),R6D=require("util"),cqA=require("fs")});function Jz(H,$){return H.flatMap((A,L)=>L?[$(L),A]:[A])}function u6D({patch:H,dim:$,width:A}){let[L]=_I(),I=k6D.useMemo(()=>IL1(H.lines,H.oldStart,A,$,L),[H.lines,H.oldStart,A,$,L]);return p7.createElement(x,{flexDirection:"column",flexGrow:1},I.map((D,B)=>p7.createElement(x,{key:B},D)))}function HL1(H){return H.map(($)=>{if($.startsWith("+"))return{code:$.slice(1),i:0,type:"add",originalCode:$.slice(1)};if($.startsWith("-"))return{code:$.slice(1),i:0,type:"remove",originalCode:$.slice(1)};return{code:$.slice(1),i:0,type:"nochange",originalCode:$.slice(1)}})}function $L1(H){let $=[],A=0;while(A0&&B.length>0){let f=Math.min(I.length,B.length);for(let E=0;EO.added||O.removed).reduce((O,j)=>O+j.value.length,0)/J>eA1||L)return null;let W=D==="add"?"+":"-",P=W.length,C=Math.max(1,$-A-1-P),Y=[],Z=[],q=0;if(X.forEach((O,j)=>{let u=!1,y;if(D==="add"){if(O.added)u=!0,y="diffAddedWord";else if(!O.removed)u=!0}else if(D==="remove"){if(O.removed)u=!0,y="diffRemovedWord";else if(!O.added)u=!0}if(!u)return;k2(O.value,C,"wrap").split(` ${D}`;return{filename:H,status:"added",additions:I,deletions:0,changes:I,patch:B}}catch{return null}}var M3D,G3D,qt,gY$=5000,HTA=50,XL1=1e6,JL1=400,FL1=500,eqA=3000;var jkH=K(()=>{PI();B0();t8();M3D=require("fs"),G3D=require("fs/promises"),qt=require("path")});function Tt(H,$){switch(H){case"policySettings":return KM.join(v_(),".claude",$);case"userSettings":return KM.join(UL(),$);case"projectSettings":return`.claude/${$}`;case"plugin":return"plugin";default:return""}}function R6H(H){let $=[H.name,H.description,H.whenToUse].filter(Boolean).join(" ");return JE($)}function CL1(H){try{return K3D.realpathSync(H)}catch{return null}}function pY$(H){return H===!0||H==="true"}function Q3D(H,$){if(!H.hooks)return;let A=oZ.safeParse(H.hooks);if(!A.success){N(`Invalid hooks in skill '${$}': ${A.error.message}`);return}return A.data}function W3D({skillName:H,displayName:$,description:A,hasUserSpecifiedDescription:L,markdownContent:I,allowedTools:D,argumentHint:B,argumentNames:f,whenToUse:E,version:M,model:G,disableModelInvocation:U,userInvocable:X,source:J,baseDir:F,loadedFrom:Q,hooks:W,executionContext:P,agent:C}){return{type:"prompt",name:H,description:A,hasUserSpecifiedDescription:L,allowedTools:D,argumentHint:B,argNames:f.length>0?f:void 0,whenToUse:E,version:M,model:G,disableModelInvocation:U,userInvocable:X,context:P,agent:C,contentLength:I.length,isEnabled:()=>!0,isHidden:!X,progressMessage:"running",userFacingName(){return $||H},source:J,loadedFrom:Q,hooks:W,skillRoot:F,async getPromptForCommand(Y,Z){let q=F?`Base directory for this skill: ${F} ${I}`:I;return q=sKH(q,Y,!0,f),q=q.replace(/\$\{CLAUDE_SESSION_ID\}/g,j$()),q=await Qa(q,{...Z,async getAppState(){let O=await Z.getAppState();return{...O,toolPermissionContext:{...O.toolPermissionContext,alwaysAllowRules:{...O.toolPermissionContext.alwaysAllowRules,command:D}}}}},`/${H}`),[{type:"text",text:q}]}}}async function RkH(H,$){let A=zH(),L=[];try{let I=A.readdirSync(H);for(let D of I)try{if(D.isDirectory()||D.isSymbolicLink()){let B=KM.join(H,D.name),f=KM.join(B,"SKILL.md");try{let E=A.readFileSync(f,{encoding:"utf-8"}),{frontmatter:M,content:G}=MK(E,f),U=D.name,X=M.description??Wm(G,"Skill"),J=xx(M["allowed-tools"]),F=M["user-invocable"]===void 0?!0:pY$(M["user-invocable"]),Q=pY$(M["disable-model-invocation"]),W=M.model==="inherit"?void 0:M.model?m8(M.model):void 0,P=Q3D(M,U),C=M.context==="fork"?"fork":void 0,Y=M.agent,Z=mRH(M.arguments);L.push({skill:W3D({skillName:U,displayName:M.name,description:X,hasUserSpecifiedDescription:!!M.description,markdownContent:G,allowedTools:J,argumentHint:M["argument-hint"],argumentNames:Z,whenToUse:M.when_to_use,version:M.version,model:W,disableModelInvocation:Q,userInvocable:F,source:$,baseDir:B,loadedFrom:"skills",hooks:P,executionContext:C,agent:Y}),filePath:f})}catch{}}}catch(B){r(B instanceof Error?B:Error(String(B)))}}catch(I){let D=I.code;if(D!=="ENOENT"&&D!=="EACCES"&&D!=="EPERM")r(I instanceof Error?I:Error(String(I)))}return L}function $TA(H){return/^skill\.md$/i.test(KM.basename(H))}function wL1(H){let $=new Map;for(let L of H){let I=KM.dirname(L.filePath),D=$.get(I)??[];D.push(L),$.set(I,D)}let A=[];for(let[L,I]of $){let D=I.filter((B)=>$TA(B.filePath));if(D.length>0){let B=D[0];if(D.length>1)N(`Multiple skill files found in ${L}, using ${KM.basename(B.filePath)}`);A.push(B)}else A.push(...I)}return A}function V3D(H,$){let A=$.endsWith(KM.sep)?$.slice(0,-1):$;if(H===A)return"";let L=H.slice(A.length+1);return L?L.split(KM.sep).join(":"):""}function ZL1(H,$){let A=KM.dirname(H),L=KM.dirname(A),I=KM.basename(A),D=V3D(L,$);return D?`${D}:${I}`:I}function qL1(H,$){let A=KM.basename(H),L=KM.dirname(H),I=A.replace(/\.md$/,""),D=V3D(L,$);return D?`${D}:${I}`:I}function TL1(H){return $TA(H.filePath)?ZL1(H.filePath,H.baseDir):qL1(H.filePath,H.baseDir)}async function zL1(H){try{let $=await Rm("commands",H),A=wL1($),L=[];for(let{baseDir:I,filePath:D,frontmatter:B,content:f,source:E}of A)try{let M=B.description??Wm(f,"Custom command"),G=xx(B["allowed-tools"]),U=B["user-invocable"]===void 0?!0:pY$(B["user-invocable"]),X=pY$(B["disable-model-invocation"]),J=B.model==="inherit"?void 0:B.model?m8(B.model):void 0,F=B.context==="fork"?"fork":void 0,Q=B.agent,P=$TA(D)?KM.dirname(D):void 0,C=TL1({baseDir:I,filePath:D,frontmatter:B,content:f,source:E}),Y=Q3D(B,C),Z=mRH(B.arguments);L.push({skill:W3D({skillName:C,displayName:void 0,description:M,hasUserSpecifiedDescription:!!B.description,markdownContent:f,allowedTools:G,argumentHint:B["argument-hint"],argumentNames:Z,whenToUse:B.when_to_use,version:B.version,model:J,disableModelInvocation:X,userInvocable:U,source:E,baseDir:P,loadedFrom:"commands_DEPRECATED",hooks:Y,executionContext:F,agent:Q}),filePath:D})}catch(M){r(M instanceof Error?M:Error(String(M)))}return L}catch($){return r($ instanceof Error?$:Error(String($))),[]}}function dY$(){ATA.cache?.clear?.(),Rm.cache?.clear?.()}function _3D(H){P3D.push(H)}function y6H(H,$){let A=zH(),L=$.endsWith(KM.sep)?$.slice(0,-1):$,I=[];for(let D of H){let B=KM.dirname(D);while(B.startsWith(L+KM.sep)){let f=KM.join(B,".claude","skills");if(!F3D.has(f))try{A.statSync(f),I.push(f),F3D.add(f)}catch{}let E=KM.dirname(B);if(E===B)break;B=E}}return I.sort((D,B)=>B.split(KM.sep).length-D.split(KM.sep).length)}async function v6H(H){if(H.length===0)return;let $=new Set(ykH.keys()),A=await Promise.all(H.map((I)=>RkH(I,"projectSettings")));for(let I=A.length-1;I>=0;I--)for(let{skill:D}of A[I]??[])if(D.type==="prompt")ykH.set(D.name,D);let L=A.flat().length;if(L>0){let I=[...ykH.keys()].filter((D)=>!$.has(D));if(N(`[skills] Dynamically discovered ${L} skills from ${H.length} directories`),I.length>0)c("tengu_dynamic_skills_changed",{source:"file_operation",previousCount:$.size,newCount:ykH.size,addedCount:I.length,directoryCount:H.length})}for(let I of P3D)try{I()}catch(D){r(D instanceof Error?D:Error(String(D)))}}function Y3D(){return Array.from(ykH.values())}var K3D,KM,ATA,F3D,ykH,P3D;var zt=K(()=>{tD();_$();E$();z$();qKH();Vm();DL();Vu();NA();y$H();W4();aI();bk();Aw();g$();pRH();K3D=require("fs"),KM=require("path");ATA=o$(async(H)=>{let $=KM.join(UL(),"skills"),A=KM.join(v_(),".claude","skills"),L=LTA("skills",H);N(`Loading skills from: managed=${A}, user=${$}, project=[${L.join(", ")}]`);let[I,D,B]=await Promise.all([RkH(A,"policySettings"),HF("userSettings")?RkH($,"userSettings"):Promise.resolve([]),HF("projectSettings")?Promise.all(L.map((F)=>RkH(F,"projectSettings"))):Promise.resolve([])]),f=CN(),E=HF("projectSettings")?await Promise.all(f.map((F)=>RkH(KM.join(F,".claude","skills"),"projectSettings"))):[],M=await zL1(H),G=[...I,...D,...B.flat(),...E.flat(),...M],U=new Map,X=[];for(let{skill:F,filePath:Q}of G){if(F.type!=="prompt")continue;let W=CL1(Q);if(W===null){X.push(F);continue}let P=U.get(W);if(P!==void 0){N(`Skipping duplicate skill '${F.name}' from ${F.source} (same file already loaded from ${P})`);continue}U.set(W,F.source),X.push(F)}let J=G.length-X.length;if(J>0)N(`Deduplicated ${J} skills (same file)`);return N(`Loaded ${X.length} unique skills (managed: ${I.length}, user: ${D.length}, project: ${B.flat().length}, additional: ${E.flat().length}, legacy commands: ${M.length})`),X});F3D=new Set,ykH=new Map,P3D=[]});var Nt,S3;var T9H=K(()=>{z$();e4$();rD();PI();g$();tg();bWD();JBH();BM();ZM();DL();F9H();Pt();NkH();_$();E$();s4$();N6D();AC();N6H();sqA();SD();jkH();zt();Nt=require("path"),S3={name:TB,maxResultSizeChars:1e5,strict:!0,async description(){return"A tool for editing files"},async prompt(){return hWD()},userFacingName:uY$,getToolUseSummary:tqA,getActivityDescription(H){let $=tqA(H);return $?`Editing ${$}`:"Editing file"},isEnabled(){return!0},inputSchema:t4$,outputSchema:FYI,isConcurrencySafe(){return!1},isReadOnly(){return!1},getPath(H){return H.file_path},async checkPermissions(H,$){let A=await $.getAppState();return z9H(S3,H,A.toolPermissionContext)},renderToolUseMessage:I3D,renderToolUseProgressMessage:D3D,renderToolResultMessage:B3D,renderToolUseRejectedMessage:f3D,renderToolUseErrorMessage:E3D,async validateInput({file_path:H,old_string:$,new_string:A,replace_all:L=!1},I){if($===A)return{result:!1,behavior:"ask",message:"No changes to make: old_string and new_string are exactly the same.",errorCode:1};let D=xD(H),B=await I.getAppState();if($W(D,B.toolPermissionContext,"edit","deny")!==null)return{result:!1,behavior:"ask",message:"File is in a directory that is denied by your permission settings.",errorCode:2};let E=zH();if(E.existsSync(D)&&$===""){if(E.readFileSync(D,{encoding:eJ(D)}).replaceAll(`\r String: ${$}`,meta:{isFilePathAbsolute:String(Nt.isAbsolute(H)),actualOldString:U},errorCode:9};let J=z6D(D,G,()=>{return L?G.replaceAll(U,A):G.replace(U,A)});if(J!==null)return J;return{result:!0,meta:{actualOldString:U}}},inputsEquivalent(H,$){return hRI({file_path:H.file_path,edits:[{old_string:H.old_string,new_string:H.new_string,replace_all:H.replace_all??!1}]},{file_path:$.file_path,edits:[{old_string:$.old_string,new_string:$.new_string,replace_all:$.replace_all??!1}]})},async call({file_path:H,old_string:$,new_string:A,replace_all:L=!1},{readFileState:I,userModified:D,updateFileHistoryState:B,dynamicSkillDirTriggers:f},E,M){let G=zH(),U=xD(H),X=C$(),J=y6H([U],X);if(J.length>0){for(let u of J)f?.add(u);v6H(J).catch(()=>{})}await bp.beforeFileEdited(U);let F=G.existsSync(U)?$J(U):"";if(G.existsSync(U)){let u=x3(U),y=I.get(U);if(!y||u>y.timestamp){if(!y&&NL("tengu_marble_kite",!1));else if(!(y&&y.offset===void 0&&y.limit===void 0&&F===y.content))throw Error(QzH)}}if(gE())await Ct(B,U,M.uuid);let Q=XBH(F,$)||$,{patch:W,updatedFile:P}=QF$({filePath:U,fileContents:F,oldString:Q,newString:A,replaceAll:L}),C=Nt.dirname(U);G.mkdirSync(C);let Y=G.existsSync(U)?kp(U):"LF",Z=G.existsSync(U)?eJ(U):"utf8";Ot(U,P,Z,Y);let q=hp();if(q)OY$(`file://${U}`),q.changeFile(U,P).catch((u)=>{N(`LSP: Failed to notify server of file change for ${U}: ${u.message}`),r(u)}),q.saveFile(U).catch((u)=>{N(`LSP: Failed to notify server of file save for ${U}: ${u.message}`),r(u)});if(_t(U,F,P),I.set(U,{content:P,timestamp:x3(U),offset:void 0,limit:void 0}),U.endsWith(`${Nt.sep}CLAUDE.md`))c("tengu_write_claudemd",{});tSH(W),Ex({operation:"edit",tool:"FileEditTool",filePath:U});let O;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"&&!0&&NL("tengu_quartz_lantern",!1)){let u=Date.now(),y=await mY$(U);if(y)O=y;c("tengu_tool_use_diff_computed",{isEditTool:!0,durationMs:Date.now()-u,hasDiff:!!y})}return{data:{filePath:H,oldString:Q,newString:A,originalFile:F,structuredPatch:W,userModified:D??!1,replaceAll:L,...O&&{gitDiff:O}}}},mapToolResultToToolResultBlockParam({filePath:H,oldString:$,newString:A,userModified:L,replaceAll:I},D){let B=L?". The user modified your proposed changes before accepting them. ":"";if(I)return{tool_use_id:D,type:"tool_result",content:`The file ${H} has been updated${B}. All occurrences of '${$}' were successfully replaced with '${A}'.`};return{tool_use_id:D,type:"tool_result",content:`The file ${H} has been updated successfully${B}.`}}}});var C3D="Replace the contents of a specific cell in a Jupyter notebook.",w3D="Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number.";function q3D({notebook_path:H,cell_id:$,new_source:A,cell_type:L,edit_mode:I="replace",verbose:D}){let B=I==="delete"?"delete":`${I} cell in`;return d7.createElement(HA,null,d7.createElement(x,{flexDirection:"column"},d7.createElement(x,{flexDirection:"row"},d7.createElement(V,{color:"subtle"},"User rejected ",B," "),d7.createElement(V,{bold:!0,color:"subtle"},D?H:Z3D.relative(C$(),H)),d7.createElement(V,{color:"subtle"}," at cell ",$)),I!=="delete"&&d7.createElement(x,{marginTop:1,flexDirection:"column"},d7.createElement(IC,{code:A,filePath:L==="markdown"?"file.md":"file.py",dim:!0}))))}var Z3D,d7;var T3D=K(()=>{xH();PI();iB();q9H();Z3D=require("path"),d7=b(s(),1)});function ITA(H){if(!H?.notebook_path)return null;return V9(H.notebook_path)}function z3D({notebook_path:H,cell_id:$,new_source:A,cell_type:L,edit_mode:I},{verbose:D}){if(!H||!A||!L)return null;let B=D?H:V9(H);if(D)return Q8.createElement(Q8.Fragment,null,Q8.createElement(yw,{filePath:H},B),`@${$}, content: ${A.slice(0,30)}\u2026, cell_type: ${L}, edit_mode: ${I??"replace"}`);return Q8.createElement(Q8.Fragment,null,Q8.createElement(yw,{filePath:H},B),`@${$}`)}function N3D(H,{verbose:$}){return Q8.createElement(q3D,{notebook_path:H.notebook_path,cell_id:H.cell_id,new_source:H.new_source,cell_type:H.cell_type,edit_mode:H.edit_mode,verbose:$})}function O3D(H,{verbose:$}){if(!$&&typeof H==="string"&&VD(H,"tool_use_error"))return Q8.createElement(HA,null,Q8.createElement(V,{color:"error"},"Error editing notebook"));return Q8.createElement(s9,{result:H,verbose:$})}function x3D(){return null}function S3D({cell_id:H,new_source:$,error:A}){if(A)return Q8.createElement(HA,null,Q8.createElement(V,{color:"error"},A));return Q8.createElement(HA,null,Q8.createElement(x,{flexDirection:"column"},Q8.createElement(V,null,"Updated cell ",Q8.createElement(V,{bold:!0},H),":"),Q8.createElement(x,{marginLeft:2},Q8.createElement(IC,{code:$,filePath:"notebook.py"}))))}var Q8;var j3D=K(()=>{xH();j6H();q9H();T3D();iB();j5();_L();rD();Q8=b(s(),1)});var xt,NL1,OL1,up;var hkH=K(()=>{mI();lY$();rD();nM();PI();BM();DL();AC();j3D();Z$();xt=require("path"),NL1=S.strictObject({notebook_path:S.string().describe("The absolute path to the Jupyter notebook file to edit (must be absolute, not relative)"),cell_id:S.string().optional().describe("The ID of the cell to edit. When inserting a new cell, the new cell will be inserted after the cell with this ID, or at the beginning if not specified."),new_source:S.string().describe("The new source for the cell"),cell_type:S.enum(["code","markdown"]).optional().describe("The type of the cell (code or markdown). If not specified, it defaults to the current cell type. If using edit_mode=insert, this is required."),edit_mode:S.enum(["replace","insert","delete"]).optional().describe("The type of edit to make (replace, insert, delete). Defaults to replace.")}),OL1=S.object({new_source:S.string().describe("The new source code that was written to the cell"),cell_id:S.string().optional().describe("The ID of the cell that was edited"),cell_type:S.enum(["code","markdown"]).describe("The type of the cell"),language:S.string().describe("The programming language of the notebook"),edit_mode:S.string().describe("The edit mode that was used"),error:S.string().optional().describe("Error message if the operation failed"),notebook_path:S.string().describe("The path to the notebook file"),original_file:S.string().describe("The original notebook content before modification"),updated_file:S.string().describe("The updated notebook content after modification")}),up={name:aW,maxResultSizeChars:1e5,shouldDefer:!0,async description(){return C3D},async prompt(){return w3D},userFacingName(){return"Edit Notebook"},getToolUseSummary:ITA,getActivityDescription(H){let $=ITA(H);return $?`Editing notebook ${$}`:"Editing notebook"},isEnabled(){return!0},inputSchema:NL1,outputSchema:OL1,isConcurrencySafe(){return!1},isReadOnly(){return!1},getPath(H){return H.notebook_path},async checkPermissions(H,$){let A=await $.getAppState();return z9H(up,H,A.toolPermissionContext)},mapToolResultToToolResultBlockParam({cell_id:H,edit_mode:$,new_source:A,error:L},I){if(L)return{tool_use_id:I,type:"tool_result",content:L,is_error:!0};switch($){case"replace":return{tool_use_id:I,type:"tool_result",content:`Updated cell ${H} with ${A}`};case"insert":return{tool_use_id:I,type:"tool_result",content:`Inserted cell ${H} with ${A}`};case"delete":return{tool_use_id:I,type:"tool_result",content:`Deleted cell ${H}`};default:return{tool_use_id:I,type:"tool_result",content:"Unknown edit mode"}}},renderToolUseMessage:z3D,renderToolUseRejectedMessage:N3D,renderToolUseErrorMessage:O3D,renderToolUseProgressMessage:x3D,renderToolResultMessage:S3D,async validateInput({notebook_path:H,cell_type:$,cell_id:A,edit_mode:L="replace"}){let I=xt.isAbsolute(H)?H:xt.resolve(C$(),H),D=zH();if(!D.existsSync(I))return{result:!1,message:"Notebook file does not exist.",errorCode:1};if(xt.extname(I)!==".ipynb")return{result:!1,message:"File must be a Jupyter notebook (.ipynb file). For editing other file types, use the FileEdit tool.",errorCode:2};if(L!=="replace"&&L!=="insert"&&L!=="delete")return{result:!1,message:"Edit mode must be replace, insert, or delete.",errorCode:4};if(L==="insert"&&!$)return{result:!1,message:"Cell type is required when using edit_mode=insert.",errorCode:5};let B=eJ(I),f=D.readFileSync(I,{encoding:B}),E=q1(f);if(!E)return{result:!1,message:"Notebook is not valid JSON.",errorCode:6};if(!A){if(L!=="insert")return{result:!1,message:"Cell ID must be specified when not inserting a new cell.",errorCode:7}}else if(E.cells.findIndex((G)=>G.id===A)===-1){let G=vkH(A);if(G!==void 0){if(!E.cells[G])return{result:!1,message:`Cell with index ${G} does not exist in notebook.`,errorCode:7}}else return{result:!1,message:`Cell with ID "${A}" not found in notebook.`,errorCode:8}}return{result:!0}},async call({notebook_path:H,new_source:$,cell_id:A,cell_type:L,edit_mode:I},{updateFileHistoryState:D},B,f){let E=xt.isAbsolute(H)?H:xt.resolve(C$(),H);if(gE())await Ct(D,E,f.uuid);try{let M=eJ(E),G=zH().readFileSync(E,{encoding:M}),U=DA(G),X;if(!A)X=0;else{if(X=U.cells.findIndex((Y)=>Y.id===A),X===-1){let Y=vkH(A);if(Y!==void 0)X=Y}if(I==="insert")X+=1}let J=I;if(J==="replace"&&X===U.cells.length){if(J="insert",!L)L="code"}let F=U.metadata.language_info?.name??"python",Q=void 0;if(U.nbformat>4||U.nbformat===4&&U.nbformat_minor>=5){if(J==="insert")Q=Math.random().toString(36).substring(2,15);else if(A!==null)Q=A}if(J==="delete")U.cells.splice(X,1);else if(J==="insert"){let Y;if(L==="markdown")Y={cell_type:"markdown",id:Q,source:$,metadata:{}};else Y={cell_type:"code",id:Q,source:$,metadata:{},execution_count:null,outputs:[]};U.cells.splice(X,0,Y)}else{let Y=U.cells[X];if(Y.source=$,Y.cell_type==="code")Y.execution_count=null,Y.outputs=[];if(L&&L!==Y.cell_type)Y.cell_type=L}let W=kp(E),P=yH(U,null,1);return Ot(E,P,M,W),{data:{new_source:$,cell_type:L??"code",language:F,edit_mode:J??"replace",cell_id:Q||void 0,error:"",notebook_path:E,original_file:G,updated_file:P}}}catch(M){if(M instanceof Error)return{data:{new_source:$,cell_type:L??"code",language:"python",edit_mode:"replace",error:M.message,cell_id:A,notebook_path:E,original_file:"",updated_file:""}};return{data:{new_source:$,cell_type:L??"code",language:"python",edit_mode:"replace",error:"Unknown error occurred while editing notebook",cell_id:A,notebook_path:E,original_file:"",updated_file:""}}}}}});var h6H=z((coE,R3D)=>{R3D.exports=N9H;N9H.CAPTURING_PHASE=1;N9H.AT_TARGET=2;N9H.BUBBLING_PHASE=3;function N9H(H,$){if(this.type="",this.target=null,this.currentTarget=null,this.eventPhase=N9H.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,H)this.type=H;if($)for(var A in $)this[A]=$[A]}N9H.prototype=Object.create(Object.prototype,{constructor:{value:N9H},stopPropagation:{value:function(){this._propagationStopped=!0}},stopImmediatePropagation:{value:function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0}},preventDefault:{value:function(){if(this.cancelable)this.defaultPrevented=!0}},initEvent:{value:function($,A,L){if(this._initialized=!0,this._dispatching)return;this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=$,this.bubbles=A,this.cancelable=L}}})});var BTA=z((loE,v3D)=>{var y3D=h6H();v3D.exports=DTA;function DTA(){y3D.call(this),this.view=null,this.detail=0}DTA.prototype=Object.create(y3D.prototype,{constructor:{value:DTA},initUIEvent:{value:function(H,$,A,L,I){this.initEvent(H,$,A),this.view=L,this.detail=I}}})});var ETA=z((ioE,b3D)=>{var h3D=BTA();b3D.exports=fTA;function fTA(){h3D.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}fTA.prototype=Object.create(h3D.prototype,{constructor:{value:fTA},initMouseEvent:{value:function(H,$,A,L,I,D,B,f,E,M,G,U,X,J,F){switch(this.initEvent(H,$,A,L,I),this.screenX=D,this.screenY=B,this.clientX=f,this.clientY=E,this.ctrlKey=M,this.altKey=G,this.shiftKey=U,this.metaKey=X,this.button=J,J){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break}this.relatedTarget=F}},getModifierState:{value:function(H){switch(H){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return!1}}}})});var rY$=z((noE,u3D)=>{u3D.exports=nY$;var xL1=1,SL1=3,jL1=4,RL1=5,yL1=7,vL1=8,hL1=9,bL1=11,kL1=12,uL1=13,gL1=14,mL1=15,pL1=17,dL1=18,cL1=19,lL1=20,iL1=21,nL1=22,rL1=23,aL1=24,oL1=25,tL1=[null,"INDEX_SIZE_ERR",null,"HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR",null,"NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INUSE_ATTRIBUTE_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR",null,"TYPE_MISMATCH_ERR","SECURITY_ERR","NETWORK_ERR","ABORT_ERR","URL_MISMATCH_ERR","QUOTA_EXCEEDED_ERR","TIMEOUT_ERR","INVALID_NODE_TYPE_ERR","DATA_CLONE_ERR"],sL1=[null,"INDEX_SIZE_ERR (1): the index is not in the allowed range",null,"HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model","WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required","INVALID_CHARACTER_ERR (5): the string contains invalid characters",null,"NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified","NOT_FOUND_ERR (8): the object can not be found here","NOT_SUPPORTED_ERR (9): this operation is not supported","INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute","INVALID_STATE_ERR (11): the object is in an invalid state","SYNTAX_ERR (12): the string did not match the expected pattern","INVALID_MODIFICATION_ERR (13): the object can not be modified in this way","NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML","INVALID_ACCESS_ERR (15): the object does not support the operation or argument",null,"TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type","SECURITY_ERR (18): the operation is insecure","NETWORK_ERR (19): a network error occurred","ABORT_ERR (20): the user aborted an operation","URL_MISMATCH_ERR (21): the given URL does not match another URL","QUOTA_EXCEEDED_ERR (22): the quota has been exceeded","TIMEOUT_ERR (23): a timeout occurred","INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation","DATA_CLONE_ERR (25): the object can not be cloned."],k3D={INDEX_SIZE_ERR:xL1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:SL1,WRONG_DOCUMENT_ERR:jL1,INVALID_CHARACTER_ERR:RL1,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:yL1,NOT_FOUND_ERR:vL1,NOT_SUPPORTED_ERR:hL1,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:bL1,SYNTAX_ERR:kL1,INVALID_MODIFICATION_ERR:uL1,NAMESPACE_ERR:gL1,INVALID_ACCESS_ERR:mL1,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:pL1,SECURITY_ERR:dL1,NETWORK_ERR:cL1,ABORT_ERR:lL1,URL_MISMATCH_ERR:iL1,QUOTA_EXCEEDED_ERR:nL1,TIMEOUT_ERR:rL1,INVALID_NODE_TYPE_ERR:aL1,DATA_CLONE_ERR:oL1};function nY$(H){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=H,this.message=sL1[H],this.name=tL1[H]}nY$.prototype.__proto__=Error.prototype;for(bkH in k3D)iY$={value:k3D[bkH]},Object.defineProperty(nY$,bkH,iY$),Object.defineProperty(nY$.prototype,bkH,iY$);var iY$,bkH});var aY$=z((g3D)=>{g3D.isApiWritable=!globalThis.__domino_frozen__});var SX=z((WE)=>{var xX=rY$(),zJ=xX,eL1=aY$().isApiWritable;WE.NAMESPACE={HTML:"http://www.w3.org/1999/xhtml",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};WE.IndexSizeError=function(){throw new xX(zJ.INDEX_SIZE_ERR)};WE.HierarchyRequestError=function(){throw new xX(zJ.HIERARCHY_REQUEST_ERR)};WE.WrongDocumentError=function(){throw new xX(zJ.WRONG_DOCUMENT_ERR)};WE.InvalidCharacterError=function(){throw new xX(zJ.INVALID_CHARACTER_ERR)};WE.NoModificationAllowedError=function(){throw new xX(zJ.NO_MODIFICATION_ALLOWED_ERR)};WE.NotFoundError=function(){throw new xX(zJ.NOT_FOUND_ERR)};WE.NotSupportedError=function(){throw new xX(zJ.NOT_SUPPORTED_ERR)};WE.InvalidStateError=function(){throw new xX(zJ.INVALID_STATE_ERR)};WE.SyntaxError=function(){throw new xX(zJ.SYNTAX_ERR)};WE.InvalidModificationError=function(){throw new xX(zJ.INVALID_MODIFICATION_ERR)};WE.NamespaceError=function(){throw new xX(zJ.NAMESPACE_ERR)};WE.InvalidAccessError=function(){throw new xX(zJ.INVALID_ACCESS_ERR)};WE.TypeMismatchError=function(){throw new xX(zJ.TYPE_MISMATCH_ERR)};WE.SecurityError=function(){throw new xX(zJ.SECURITY_ERR)};WE.NetworkError=function(){throw new xX(zJ.NETWORK_ERR)};WE.AbortError=function(){throw new xX(zJ.ABORT_ERR)};WE.UrlMismatchError=function(){throw new xX(zJ.URL_MISMATCH_ERR)};WE.QuotaExceededError=function(){throw new xX(zJ.QUOTA_EXCEEDED_ERR)};WE.TimeoutError=function(){throw new xX(zJ.TIMEOUT_ERR)};WE.InvalidNodeTypeError=function(){throw new xX(zJ.INVALID_NODE_TYPE_ERR)};WE.DataCloneError=function(){throw new xX(zJ.DATA_CLONE_ERR)};WE.nyi=function(){throw Error("NotYetImplemented")};WE.shouldOverride=function(){throw Error("Abstract function; should be overriding in subclass.")};WE.assert=function(H,$){if(!H)throw Error("Assertion failed: "+($||"")+` `,this.references=[];return $}};v3.emphasis={filter:["em","i"],replacement:function(H,$,A){if(!H.trim())return"";return A.emDelimiter+H+A.emDelimiter}};v3.strong={filter:["strong","b"],replacement:function(H,$,A){if(!H.trim())return"";return A.strongDelimiter+H+A.strongDelimiter}};v3.code={filter:function(H){var $=H.previousSibling||H.nextSibling,A=H.parentNode.nodeName==="PRE"&&!$;return H.nodeName==="CODE"&&!A},replacement:function(H){if(!H)return"";H=H.replace(/\r?\n|\r/g," ");var $=/^`|^ .*?[^ ].* $|`$/.test(H)?" ":"",A="`",L=H.match(/`+/gm)||[];while(L.indexOf(A)!==-1)A=A+"`";return A+$+H+$+A}};v3.image={filter:"img",replacement:function(H,$){var A=NC$($.getAttribute("alt")),L=$.getAttribute("src")||"",I=NC$($.getAttribute("title")),D=I?' "'+I+'"':"";return L?"!["+A+"]("+L+D+")":""}};c_D.prototype={add:function(H,$){this.array.unshift($)},keep:function(H){this._keep.unshift({filter:H,replacement:this.keepReplacement})},remove:function(H){this._remove.unshift({filter:H,replacement:function(){return""}})},forNode:function(H){if(H.isBlank)return this.blankRule;var $;if($=CzA(this.array,H,this.options))return $;if($=CzA(this._keep,H,this.options))return $;if($=CzA(this._remove,H,this.options))return $;return this.defaultRule},forEach:function(H){for(var $=0;$/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];OC$.prototype={turndown:function(H){if(!hB1(H))throw TypeError(H+" is not a string, or an element/document/fragment node.");if(H==="")return"";var $=i_D.call(this,new qB1(H,this.options));return yB1.call(this,$)},use:function(H){if(Array.isArray(H))for(var $=0;${xC$=new Set(["platform.claude.com","code.claude.com","modelcontextprotocol.io","github.com/anthropics","agentskills.io","docs.python.org","en.cppreference.com","docs.oracle.com","learn.microsoft.com","developer.mozilla.org","go.dev","pkg.go.dev","www.php.net","docs.swift.org","kotlinlang.org","ruby-doc.org","doc.rust-lang.org","www.typescriptlang.org","react.dev","angular.io","vuejs.org","nextjs.org","expressjs.com","nodejs.org","bun.sh","jquery.com","getbootstrap.com","tailwindcss.com","d3js.org","threejs.org","redux.js.org","webpack.js.org","jestjs.io","reactrouter.com","docs.djangoproject.com","flask.palletsprojects.com","fastapi.tiangolo.com","pandas.pydata.org","numpy.org","www.tensorflow.org","pytorch.org","scikit-learn.org","matplotlib.org","requests.readthedocs.io","jupyter.org","laravel.com","symfony.com","wordpress.org","docs.spring.io","hibernate.org","tomcat.apache.org","gradle.org","maven.apache.org","asp.net","dotnet.microsoft.com","nuget.org","blazor.net","reactnative.dev","docs.flutter.dev","developer.apple.com","developer.android.com","keras.io","spark.apache.org","huggingface.co","www.kaggle.com","www.mongodb.com","redis.io","www.postgresql.org","dev.mysql.com","www.sqlite.org","graphql.org","prisma.io","docs.aws.amazon.com","cloud.google.com","learn.microsoft.com","kubernetes.io","www.docker.com","www.terraform.io","www.ansible.com","vercel.com/docs","docs.netlify.com","devcenter.heroku.com/","cypress.io","selenium.dev","docs.unity.com","docs.unrealengine.com","git-scm.com","nginx.org","httpd.apache.org"])});function t_D(H){try{let $=new URL(H),A=$.hostname,L=$.pathname;for(let I of xC$)if(I.includes("/")){let[D,...B]=I.split("/"),f="/"+B.join("/");if(A===D&&L.startsWith(f))return!0}else if(A===I)return!0;return!1}catch{return!1}}function mB1(H){if(H.length>uB1)return!1;let $;try{$=new URL(H)}catch{return!1}if($.username||$.password)return!1;if($.hostname.split(".").length<2)return!1;return!0}async function pB1(H){try{let $=await nA.get(`https://api.anthropic.com/api/web/domain_info?domain=${encodeURIComponent(H)}`);if($.status===200)return $.data.can_fetch===!0?{status:"allowed"}:{status:"blocked"};return{status:"check_failed",error:Error(`Domain check returned status ${$.status}`)}}catch($){return r($),{status:"check_failed",error:$}}}function dB1(H,$){try{let A=new URL(H),L=new URL($);if(L.protocol!==A.protocol)return!1;if(L.port!==A.port)return!1;if(L.username||L.password)return!1;let I=(f)=>f.replace(/^www\./,""),D=I(A.hostname),B=I(L.hostname);return D===B}catch(A){return!1}}async function s_D(H,$,A){try{return await nA.get(H,{signal:$,maxRedirects:0,responseType:"arraybuffer",maxContentLength:gB1,headers:{Accept:"text/markdown, text/html, */*"}})}catch(L){if(nA.isAxiosError(L)&&L.response&&[301,302,307,308].includes(L.response.status)){let I=L.response.headers.location;if(!I)throw Error("Redirect missing Location header");let D=new URL(I,H).toString();if(A(H,D))return s_D(D,$,A);else return{type:"redirect",originalUrl:H,redirectUrl:D,statusCode:L.response.status}}throw L}}function cB1(H){return"type"in H&&H.type==="redirect"}async function e_D(H,$){if(!mB1(H))throw Error("Invalid URL");let A=o_D.get(H);if(A)return{bytes:A.bytes,code:A.code,codeText:A.codeText,content:A.content,contentType:A.contentType};let L,I=H;try{if(L=new URL(H),L.protocol==="http:")L.protocol="https:",I=L.toString();let G=L.hostname;if(!VL().skipWebFetchPreflight)switch((await pB1(G)).status){case"allowed":break;case"blocked":throw new OzA(G);case"check_failed":throw new xzA(G)}}catch(G){if(r(G),G instanceof OzA||G instanceof xzA)throw G}let D=await s_D(I,$.signal,dB1);if(cB1(D))return D;let B=Buffer.from(D.data).toString("utf-8"),f=D.headers["content-type"]??"",E=Buffer.byteLength(B),M;if(f.includes("text/html"))M=new r_D().turndown(B);else M=B;return o_D.set(H,{bytes:E,code:D.status,codeText:D.statusText,content:M,contentType:f}),{code:D.status,codeText:D.statusText,content:M,contentType:f,bytes:E}}async function HYD(H,$,A,L,I){let D=$.length>SC$?$.slice(0,SC$)+` [Content truncated due to length...]`:$,B=jaL(D,H,I),f=await OQ({systemPrompt:[],userPrompt:B,signal:A,options:{querySource:"web_fetch_apply",agents:[],isNonInteractiveSession:L,hasAppendSystemPrompt:!1,mcpTools:[]}});if(A.aborted)throw new HM;let{content:E}=f.message;if(E.length>0){let M=E[0];if("text"in M)return M.text}return"No response from model"}var OzA,xzA,bB1=900000,kB1=52428800,o_D,uB1=2000,gB1=10485760,SC$=1e5;var $YD=K(()=>{w1();CwH();a_D();dU();z$();lG();_$();mL();NzA();OzA=class OzA extends Error{constructor(H){super(`Claude Code is unable to fetch from ${H}`);this.name="DomainBlockedError"}};xzA=class xzA extends Error{constructor(H){super(`Unable to verify if domain ${H} is safe to fetch. This may be due to network restrictions or enterprise security policies blocking claude.ai.`);this.name="DomainCheckFailedError"}};o_D=new gN({maxSize:kB1,sizeCalculation:(H)=>Buffer.byteLength(H.content),ttl:bB1})});function AYD({url:H,prompt:$},{verbose:A}){if(!H)return null;if(A)return`url: "${H}"${A&&$?`, prompt: "${$}"`:""}`;return H}function LYD(){return fC.default.createElement(L8,null)}function IYD(H,{verbose:$}){return fC.default.createElement(s9,{result:H,verbose:$})}function DYD(){return fC.default.createElement(HA,{height:1},fC.default.createElement(V,{dimColor:!0},"Fetching\u2026"))}function BYD({bytes:H,code:$,codeText:A,result:L},I,{verbose:D}){let B=GM(H);if(D)return fC.default.createElement(x,{flexDirection:"column"},fC.default.createElement(HA,{height:1},fC.default.createElement(V,null,"Received ",fC.default.createElement(V,{bold:!0},B)," (",$," ",A,")")),fC.default.createElement(x,{flexDirection:"column"},fC.default.createElement(V,null,L)));return fC.default.createElement(HA,{height:1},fC.default.createElement(V,null,"Received ",fC.default.createElement(V,{bold:!0},B)," (",$," ",A,")"))}function SzA(H){if(!H?.url)return null;return e8(H.url,fx)}var fC;var fYD=K(()=>{xH();iB();_F();j5();rD();Q9();fC=b(s(),1)});function nB1(H){try{let $=IW.inputSchema.safeParse(H);if(!$.success)return`input:${H.toString()}`;let{url:A}=$.data;return`domain:${new URL(A).hostname}`}catch{return`input:${H.toString()}`}}function EYD(H){return[{type:"addRules",destination:"localSettings",rules:[{toolName:w4,ruleContent:H}],behavior:"allow"}]}var lB1,iB1,IW;var s6H=K(()=>{mI();ia();$YD();XJ();NzA();fYD();lB1=S.strictObject({url:S.string().url().describe("The URL to fetch content from"),prompt:S.string().describe("The prompt to run on the fetched content")}),iB1=S.object({bytes:S.number().describe("Size of the fetched content in bytes"),code:S.number().describe("HTTP response code"),codeText:S.string().describe("HTTP response code text"),result:S.string().describe("Processed result from applying the prompt to the content"),durationMs:S.number().describe("Time taken to fetch and process the content"),url:S.string().describe("The URL that was fetched")});IW={name:w4,maxResultSizeChars:1e5,async description(H){let{url:$}=H;try{return`Claude wants to fetch content from ${new URL($).hostname}`}catch{return"Claude wants to fetch content from this URL"}},userFacingName(){return"Fetch"},getToolUseSummary:SzA,getActivityDescription(H){let $=SzA(H);return $?`Fetching ${$}`:"Fetching web page"},isEnabled(){return!0},inputSchema:lB1,outputSchema:iB1,isConcurrencySafe(){return!0},isReadOnly(){return!0},async checkPermissions(H,$){let L=(await $.getAppState()).toolPermissionContext;try{let{url:E}=H,M=new URL(E),G=M.hostname,U=M.pathname;for(let X of xC$)if(X.includes("/")){let[J,...F]=X.split("/"),Q="/"+F.join("/");if(G===J&&U.startsWith(Q))return{behavior:"allow",updatedInput:H,decisionReason:{type:"other",reason:"Preapproved host and path"}}}else if(G===X)return{behavior:"allow",updatedInput:H,decisionReason:{type:"other",reason:"Preapproved host"}}}catch{}let I=nB1(H),D=RS(L,IW,"deny").get(I);if(D)return{behavior:"deny",message:`${IW.name} denied access to ${I}.`,decisionReason:{type:"rule",rule:D}};let B=RS(L,IW,"ask").get(I);if(B)return{behavior:"ask",message:`Claude requested permissions to use ${IW.name}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:B},suggestions:EYD(I)};let f=RS(L,IW,"allow").get(I);if(f)return{behavior:"allow",updatedInput:H,decisionReason:{type:"rule",rule:f}};return{behavior:"ask",message:`Claude requested permissions to use ${IW.name}, but you haven't granted it yet.`,suggestions:EYD(I)}},async prompt({tools:H}){if(H.some(($)=>$.name===C7))return`IMPORTANT: WebFetch WILL FAIL for authenticated or private URLs. Before using this tool, check if the URL points to an authenticated service (e.g. Google Docs, Confluence, Jira, GitHub). If so, you MUST use ${C7} first to find a specialized tool that provides authenticated access. `)}},renderToolUseMessage(H){let{block:$=!0}=H;if(!$)return"non-blocking";return""},renderToolUseTag(H){if(!H.task_id)return null;return f8.default.createElement(V,{dimColor:!0}," ",H.task_id)},renderToolUseProgressMessage(H){let A=H[H.length-1]?.data;return f8.default.createElement(x,{flexDirection:"column"},A?.taskDescription&&f8.default.createElement(V,null,"\xA0\xA0",A.taskDescription),f8.default.createElement(V,null,"\xA0\xA0\xA0\xA0\xA0Waiting for task"," ",f8.default.createElement(V,{dimColor:!0},"(esc to give additional instructions)")))},renderToolResultMessage(H,$,{verbose:A,theme:L}){return f8.default.createElement(H01,{content:H,verbose:A,theme:L})},renderToolUseRejectedMessage(){return f8.default.createElement(L8,null)},renderToolUseErrorMessage(H,{verbose:$}){return f8.default.createElement(s9,{result:H,verbose:$})}}});function $01(H){let $=0,A=0;for(let L of H)if(typeof L!=="string")$++,A+=L.content.length;return{searchCount:$,totalResultCount:A}}function WYD({query:H,allowed_domains:$,blocked_domains:A},{verbose:L}){if(!H)return null;let I="";if(H)I+=`"${H}"`;if(L){if($&&$.length>0)I+=`, only allowing domains: ${$.join(", ")}`;if(A&&A.length>0)I+=`, blocking domains: ${A.join(", ")}`}return I}function VYD(){return uh.default.createElement(L8,null)}function PYD(H,{verbose:$}){return uh.default.createElement(s9,{result:H,verbose:$})}function _YD(H){if(H.length===0)return null;let $=H[H.length-1];if(!$?.data)return null;let A=$.data;switch(A.type){case"query_update":return uh.default.createElement(HA,null,uh.default.createElement(V,{dimColor:!0},"Searching: ",A.query));case"search_results_received":return uh.default.createElement(HA,null,uh.default.createElement(V,{dimColor:!0},"Found ",A.resultCount,' results for "',A.query,'"'));default:return null}}function YYD(H){let{searchCount:$}=$01(H.results),A=H.durationSeconds>=1?`${Math.round(H.durationSeconds)}s`:`${Math.round(H.durationSeconds*1000)}ms`;return uh.default.createElement(x,{justifyContent:"space-between",width:"100%"},uh.default.createElement(HA,{height:1},uh.default.createElement(V,null,"Did ",$," search",$!==1?"es":""," in ",A)))}function hzA(H){if(!H?.query)return null;return e8(H.query,fx)}var uh;var CYD=K(()=>{xH();iB();_F();j5();Q9();uh=b(s(),1)});function f01(H,$,A){let L=[],I="",D=!0;for(let B of H){if(B.type==="server_tool_use"){if(D){if(D=!1,I.trim().length>0)L.push(I.trim());I=""}continue}if(B.type==="web_search_tool_result"){if(!Array.isArray(B.content)){let E=`Web search error: ${B.content.error_code}`;r(Error(E)),L.push(E);continue}let f=B.content.map((E)=>({title:E.title,url:E.url}));L.push({tool_use_id:B.tool_use_id,content:f})}if(B.type==="text")if(D)I+=B.text;else D=!0,I=B.text}if(I.length)L.push(I.trim());return{query:$,results:L,durationSeconds:A}}var A01,L01,I01,D01,B01=(H)=>{return{type:"web_search_20250305",name:"web_search",allowed_domains:H.allowed_domains,blocked_domains:H.blocked_domains,max_uses:8}},vC$;var bzA=K(()=>{mI();Mn();dU();_L();aI();SD();oM();_$();CYD();Z$();A01=S.strictObject({query:S.string().min(2).describe("The search query to use"),allowed_domains:S.array(S.string()).optional().describe("Only include search results from these domains"),blocked_domains:S.array(S.string()).optional().describe("Never include search results from these domains")}),L01=S.object({title:S.string().describe("The title of the search result"),url:S.string().describe("The URL of the search result")}),I01=S.object({tool_use_id:S.string().describe("ID of the tool use"),content:S.array(L01).describe("Array of search hits")}),D01=S.object({query:S.string().describe("The search query that was executed"),results:S.array(S.union([I01,S.string()])).describe("Search results and/or text commentary from the model"),durationSeconds:S.number().describe("Time taken to complete the search operation")});vC$={name:v2,maxResultSizeChars:1e5,async description(H){return`Claude wants to search the web for: ${H.query}`},userFacingName(){return"Web Search"},getToolUseSummary:hzA,getActivityDescription(H){let $=hzA(H);return $?`Searching for ${$}`:"Searching the web"},isEnabled(){let H=sI(),$=X1();if(H==="firstParty")return!0;if(H==="vertex")return $.includes("claude-opus-4")||$.includes("claude-sonnet-4")||$.includes("claude-haiku-4");if(H==="foundry")return!0;return!1},inputSchema:A01,outputSchema:D01,isConcurrencySafe(){return!0},isReadOnly(){return!0},async checkPermissions(H){return{behavior:"passthrough",message:"WebSearchTool requires permission."}},async prompt(){return $oL()},renderToolUseMessage:WYD,renderToolUseRejectedMessage:VYD,renderToolUseErrorMessage:PYD,renderToolUseProgressMessage:_YD,renderToolResultMessage:YYD,async validateInput(H){let{query:$,allowed_domains:A,blocked_domains:L}=H;if(!$.length)return{result:!1,message:"Error: Missing query",errorCode:1};if(A?.length&&L?.length)return{result:!1,message:"Error: Cannot specify both allowed_domains and blocked_domains in the same request",errorCode:2};return{result:!0}},async call(H,$,A,L,I){let D=performance.now(),{query:B}=H,f=R$({content:"Perform a web search for the query: "+B}),E=B01(H),M=NL("tengu_plum_vx3",!1),G=await $.getAppState(),U=e6H({messages:[f],systemPrompt:["You are an assistant for performing a web search tool use"],maxThinkingTokens:M?0:$.options.maxThinkingTokens,tools:[],signal:$.abortController.signal,options:{getToolPermissionContext:async()=>G.toolPermissionContext,model:M?LJ():$.options.mainLoopModel,toolChoice:M?{type:"tool",name:"web_search"}:void 0,isNonInteractiveSession:$.options.isNonInteractiveSession,hasAppendSystemPrompt:!!$.options.appendSystemPrompt,extraToolSchemas:[E],querySource:"web_search_tool",agents:$.options.agentDefinitions.activeAgents,mcpTools:[],agentId:$.agentId,effortValue:G.effortValue}}),X=[],J=null,F="",Q=0,W=new Map;for await(let O of U){if(X.push(O),O.type==="stream_event"&&O.event?.type==="content_block_start"){let j=O.event.content_block;if(j&&j.type==="server_tool_use"){J=j.id,F="";continue}}if(J&&O.type==="stream_event"&&O.event?.type==="content_block_delta"){let j=O.event.delta;if(j?.type==="input_json_delta"&&j.partial_json){F+=j.partial_json;try{let u=F.match(/"query"\s*:\s*"((?:[^"\\]|\\.)*)"/);if(u&&u[1]){let y=DA('"'+u[1]+'"');if(!W.has(J)||W.get(J)!==y){if(W.set(J,y),Q++,I)I({toolUseID:`search-progress-${Q}`,data:{type:"query_update",query:y}})}}}catch{}}}if(O.type==="stream_event"&&O.event?.type==="content_block_start"){let j=O.event.content_block;if(j&&j.type==="web_search_tool_result"){let u=j.tool_use_id,y=W.get(u)||B,g=j.content;if(Q++,I)I({toolUseID:u||`search-progress-${Q}`,data:{type:"search_results_received",resultCount:Array.isArray(g)?g.length:0,query:y}})}}}let C=X.filter((O)=>O.type==="assistant").flatMap((O)=>O.message.content),Z=(performance.now()-D)/1000;return{data:f01(C,B,Z)}},mapToolResultToToolResultBlockParam(H,$){let{query:A,results:L}=H,I=`Web search results for query: "${A}" `):"Unknown error";return lp.createElement(V,{color:"error"},$)}function SCD(){return null}function jCD(H){return null}function RCD(H){return lp.createElement(V,{dimColor:!0},"Loaded ",lp.createElement(V,{bold:!0},H)," ",H===1?"tool":"tools"," \xB7"," ","/context")}var lp;var yCD=K(()=>{xH();_F();lp=b(s(),1)});function k01(H){return H.map(($)=>$.name).sort().join(",")}function u01(H){let $=k01(H);if(vCD!==$)N("ToolSearchTool: cache invalidated - deferred tools changed"),nzA.cache.clear?.(),vCD=$}function izA(H,$,A){return{data:{matches:H,query:$,total_deferred_tools:A}}}function hCD(H){if(H.startsWith("mcp__")){let A=H.replace(/^mcp__/,"").toLowerCase();return{parts:A.split("__").flatMap((I)=>I.split("_")).filter(Boolean),full:A.replace(/__/g," ").replace(/_/g," "),isMcp:!0}}let $=H.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").toLowerCase().split(/\s+/).filter(Boolean);return{parts:$,full:$.join(" "),isMcp:!1}}function bCD(H,$){return new RegExp(`\\b${$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(H)}async function g01(H,$,A,L){let I=H.toLowerCase().trim(),D=$.find((X)=>X.name.toLowerCase()===I);if(D)return[D.name];if(I.startsWith("mcp__")&&I.length>5){let X=$.filter((J)=>J.name.toLowerCase().startsWith(I)).slice(0,L).map((J)=>J.name);if(X.length>0)return X}let B=I.split(/\s+/).filter((X)=>X.length>0),f=[],E=[];for(let X of B)if(X.startsWith("+")&&X.length>1)f.push(X.slice(1));else E.push(X);let M=$;if(f.length>0)M=(await Promise.all($.map(async(J)=>{let F=hCD(J.name),W=(await nzA(J.name,A)).toLowerCase();return f.every((C)=>F.parts.includes(C)||F.parts.some((Y)=>Y.includes(C))||bCD(W,C))?J:null}))).filter((J)=>J!==null);let G=f.length>0?[...f,...E]:B;return(await Promise.all(M.map(async(X)=>{let J=hCD(X.name),Q=(await nzA(X.name,A)).toLowerCase(),W=0;for(let P of G){if(J.parts.includes(P))W+=J.isMcp?12:10;else if(J.parts.some((C)=>C.includes(P)))W+=J.isMcp?6:5;if(J.full.includes(P)&&W===0)W+=3;if(bCD(Q,P))W+=2}return{name:X.name,score:W}}))).filter((X)=>X.score>0).sort((X,J)=>J.score-X.score).slice(0,L).map((X)=>X.name)}var h01,b01,vCD=null,nzA,pC$;var rzA=K(()=>{mI();ia();yCD();GT();E$();z$();tD();h01=S.object({query:S.string().describe('Query to find deferred tools. Use "select:" for direct selection, or keywords to search.'),max_results:S.number().optional().default(5).describe("Maximum number of results to return (default: 5)")}),b01=S.object({matches:S.array(S.string()),query:S.string(),total_deferred_tools:S.number()});nzA=o$(async(H,$)=>{let A=$.find((L)=>L.name===H);if(!A)return"";return A.prompt({getToolPermissionContext:async()=>({mode:"default",additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1}),tools:$,agents:[]})},(H)=>H);pC$={isEnabled(){return Sm()},isConcurrencySafe(){return!0},isReadOnly(){return!0},name:C7,maxResultSizeChars:1e5,async description(H,{tools:$}){return OF$($)},async prompt({tools:H}){return OF$(H)},inputSchema:h01,outputSchema:b01,async call(H,{options:{tools:$},addNotification:A}){let{query:L,max_results:I=5}=H,D=$.filter(U3);u01(D);function B(G){if(G.length===0)return;A?.({key:`tool-search-${Date.now()}`,jsx:RCD(G.length),priority:"immediate",timeoutMs:3000})}function f(G,U){c("tengu_tool_search_outcome",{query:L,queryType:U,matchCount:G.length,totalDeferredTools:D.length,maxResults:I,hasMatches:G.length>0})}let E=L.match(/^select:(.+)$/i);if(E){let G=E[1].trim(),U=D.find((X)=>X.name===G);if(!U)return N(`ToolSearchTool: select failed - tool not found: ${G}`),f([],"select"),izA([],L,D.length);return N(`ToolSearchTool: selected "${G}"`),f([U.name],"select"),B([U.name]),izA([U.name],L,D.length)}let M=await g01(L,D,$,I);return N(`ToolSearchTool: keyword search for "${L}", found ${M.length} matches`),f(M,"keyword"),B(M),izA(M,L,D.length)},async checkPermissions(H){return{behavior:"allow",updatedInput:H}},renderToolUseMessage:NCD,userFacingName:()=>"",renderToolUseRejectedMessage:OCD,renderToolUseErrorMessage:xCD,renderToolUseProgressMessage:SCD,renderToolResultMessage:jCD,mapToolResultToToolResultBlockParam(H,$){if(H.matches.length===0)return{type:"tool_result",tool_use_id:$,content:"No matching deferred tools found"};return{type:"tool_result",tool_use_id:$,content:H.matches.map((A)=>({type:"tool_reference",tool_name:A}))}}}});function kCD(){if(process.env.CLAUDE_CODE_PLAN_V2_AGENT_COUNT){let A=parseInt(process.env.CLAUDE_CODE_PLAN_V2_AGENT_COUNT,10);if(!isNaN(A)&&A>0&&A<=10)return A}let H=f0(),$=Ri();if(H==="max"&&$==="default_claude_max_20x")return 3;if(H==="enterprise"||H==="team")return 3;return 1}function uCD(){if(process.env.CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT){let H=parseInt(process.env.CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT,10);if(!isNaN(H)&&H>0&&H<=10)return H}return 3}function c5(){let H=process.env.CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE;if(A$(H))return!0;if(BE(H))return!1;return NL("tengu_plan_mode_interview_phase",!1)}var b9H=K(()=>{SD();EI();NA()});function p01(){let H=c5()?"":m01;return`Use this tool proactively when you're about to start a non-trivial implementation task. Getting user sign-off on your approach before writing code prevents wasted effort and ensures alignment. This tool transitions you into plan mode where you can explore the codebase and design an implementation approach for user approval. Remember: DO NOT write or edit any files yet. This is a read-only exploration and planning phase.`,tool_use_id:$}}}});var ozA,tzA,rCD;var szA=K(()=>{ozA=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","notifications_disabled"],tzA=["normal","vim"],rCD=["auto","tmux","in-process"]});function l01(H){let $=H.find((I)=>I.role==="user");if(!$)return"";let A=$.content;if(typeof A==="string")return A;let L=A.find((I)=>I.type==="text");return L?.type==="text"?L.text:""}async function k9H(H){let{model:$,system:A,messages:L,tools:I,tool_choice:D,output_format:B,max_tokens:f=1024,maxRetries:E=2,signal:M,skipSystemPromptPrefix:G,temperature:U,thinking:X}=H,J=await eO({maxRetries:E,model:$}),F=[...U2($)];if(B&&!F.includes(Oc))F.push(Oc);let Q=l01(L),W=IBA(Q,{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION),P=h9$(W),C=[P?{type:"text",text:P}:null,...G?[]:[{type:"text",text:v9$({isNonInteractive:!1,hasAppendSystemPrompt:!1})}],...Array.isArray(A)?A:A?[{type:"text",text:A}]:[]].filter((q)=>q!==null),Y=X?{type:"enabled",budget_tokens:X}:void 0;return await J.beta.messages.create({model:vu($),max_tokens:f,system:C,messages:L,...I&&{tools:I},...D&&{tool_choice:D},...B&&{output_config:{format:B}},...U!==void 0&&{temperature:U},...Y&&{thinking:Y},...F.length>0&&{betas:F},metadata:qr()},{signal:M})}var GuH=K(()=>{fSH();dU();$q();JHH();b9$();DBA();aI()});async function dC$(H){let $=H.trim();if(!$)return{valid:!1,error:"Model name cannot be empty"};let A=$.toLowerCase();if(V5H.includes(A))return{valid:!0};if(aCD.has($))return{valid:!0};try{return await k9H({model:$,max_tokens:1,maxRetries:0,messages:[{role:"user",content:[{type:"text",text:"Hi",cache_control:{type:"ephemeral"}}]}]}),aCD.set($,!0),{valid:!0}}catch(L){return i01(L,$)}}function i01(H,$){if(H instanceof yAH)return{valid:!1,error:`Model '${$}' not found`};if(H instanceof JD){if(H instanceof RAH)return{valid:!1,error:"Authentication failed. Please check your API credentials."};if(H instanceof k6)return{valid:!1,error:"Network error. Please check your internet connection."};let L=H.error;if(L&&typeof L==="object"&&"type"in L&&L.type==="not_found_error"&&"message"in L&&typeof L.message==="string"&&L.message.includes("model:"))return{valid:!1,error:`Model '${$}' not found`};return{valid:!1,error:`API error: ${H.message}`}}return{valid:!1,error:`Unable to validate model: ${H instanceof Error?H.message:String(H)}`}}var aCD;var ezA=K(()=>{aI();GuH();n_();aCD=new Map});var n01;var HNA=K(()=>{Ky();szA();ezA();aI();n01={theme:{source:"global",type:"string",description:"Color theme for the UI",options:asL},editorMode:{source:"global",type:"string",description:"Key binding mode",options:tzA},verbose:{source:"global",type:"boolean",description:"Show detailed debug output",appStateKey:"verbose"},preferredNotifChannel:{source:"global",type:"string",description:"Preferred notification channel",options:ozA},autoCompactEnabled:{source:"global",type:"boolean",description:"Auto-compact when context is full"},fileCheckpointingEnabled:{source:"global",type:"boolean",description:"Enable file checkpointing for code rewind"},showTurnDuration:{source:"global",type:"boolean",description:'Show turn duration message after responses (e.g., "Cooked for 1m 6s")'},todoFeatureEnabled:{source:"global",type:"boolean",description:"Enable todo/task tracking"},model:{source:"settings",type:"string",description:"Override the default model",appStateKey:"mainLoopModel",getOptions:()=>{try{return fLH().filter((H)=>H.value!==null).map((H)=>H.value)}catch{return["sonnet","opus","haiku"]}},validateOnWrite:(H)=>dC$(String(H)),formatOnRead:(H)=>H===null?"default":H},alwaysThinkingEnabled:{source:"settings",type:"boolean",description:"Enable extended thinking (false to disable)",appStateKey:"thinkingEnabled"},"permissions.defaultMode":{source:"settings",type:"string",description:"Default permission mode for tool usage",options:["default","plan","acceptEdits","dontAsk"]},language:{source:"settings",type:"string",description:'Preferred language for Claude responses (e.g., "japanese", "spanish")'},teammateMode:{source:"global",type:"string",description:'How to spawn teammates: "tmux" for traditional tmux, "in-process" for same process, "auto" to choose automatically',options:rCD},...{}}});var oCD=K(()=>{HNA();aI()});var a01;var tCD=K(()=>{xH();j5();iB();Z$();a01=b(s(),1)});var mAM,pAM;var sCD=K(()=>{mI();oCD();HNA();tCD();vA();mL();z$();_$();Z$();zF$();mAM=S.strictObject({setting:S.string().describe('The setting key (e.g., "theme", "model", "permissions.defaultMode")'),value:S.union([S.string(),S.boolean(),S.number()]).optional().describe("The new value. Omit to get current value.")}),pAM=S.object({success:S.boolean(),operation:S.enum(["get","set"]).optional(),setting:S.string().optional(),value:S.unknown().optional(),previousValue:S.unknown().optional(),newValue:S.unknown().optional(),error:S.string().optional()})});function H2D(){let H=dL()?" and potentially assigned to teammates":"",$=dL()?"- New tasks are created with status 'open' and no owner - use TaskUpdate with the `owner` parameter to assign them\n":"";return`Use this tool to create a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user. - **Custom agents** defined in \`.claude/agents/\` may have their own tool restrictions. Check their descriptions to understand what they can and cannot do. - A team file at \`~/.claude/teams/{team-name}.json\` - A corresponding task list directory at \`~/.claude/tasks/{team-name}/\` - **Team config location**: \`~/.claude/teams/{team-name}/config.json\` Use the Read tool to read ~/.claude/teams/{team-name}/config.json Teams share a task list that all teammates can access at \`~/.claude/tasks/{team-name}/\`. - Removes the team directory (\`~/.claude/teams/{team-name}/\`) - Removes the task directory (\`~/.claude/tasks/{team-name}/\`) `).map((M)=>M.trim()).filter(Boolean)}catch(B){return N(`File suggestion helper failed: ${B}`,{level:"error"}),[]}}async function x91({hook:H,messages:$,hookName:A,toolUseID:L,hookEvent:I,timeoutMs:D,signal:B}){let f=H.timeout??D,{signal:E,cleanup:M}=yT(AbortSignal.timeout(f),B);try{if(E.aborted)return M(),{outcome:"cancelled",hook:H};let G=await new Promise((U,X)=>{let J=()=>X(Error("Function hook cancelled"));E.addEventListener("abort",J),Promise.resolve(H.callback($,E)).then((F)=>{E.removeEventListener("abort",J),U(F)}).catch((F)=>{E.removeEventListener("abort",J),X(F)})});if(M(),G)return{outcome:"success",hook:H};return{blockingError:{blockingError:H.errorMessage,command:"function"},outcome:"blocking",hook:H}}catch(G){if(M(),G instanceof Error&&(G.message==="Function hook cancelled"||G.name==="AbortError"))return{outcome:"cancelled",hook:H};return r(G instanceof Error?G:Error(String(G))),{message:QB({type:"hook_error_during_execution",hookName:A,toolUseID:L,hookEvent:I,content:G instanceof Error?G.message:"Function hook execution error"}),outcome:"non_blocking_error",hook:H}}}async function S91({toolUseID:H,hook:$,hookEvent:A,hookInput:L,signal:I,hookIndex:D,toolUseContext:B}){let f=B?{getAppState:B.getAppState,setAppState:B.setAppState}:void 0,E=await $.callback(L,H,I,D,f);if(qBH(E))return{outcome:"success",hook:$};return{...xwD({json:E,command:"callback",hookName:`${A}:Callback`,toolUseID:H,hookEvent:A,expectedHookEvent:A,stdout:void 0,stderr:void 0,exitCode:void 0}),outcome:"success",hook:$}}function TwD(H){return H.map(({hook:$})=>{if($.type==="command")return{type:"command",command:$.command};else if($.type==="prompt")return{type:"prompt",prompt:$.prompt};else if($.type==="function")return{type:"function",name:"function"};else if($.type==="callback")return{type:"callback",name:"callback"};return{type:"unknown"}})}var zwD,EC,n7=600000;var _3=K(()=>{n7A();PI();r7A();iF$();Z9();g$();vA();XDH();rB();mL();z$();sa();UQ();Lo();n6A();r0();Av();E$();_$();RyH();gK$();uK$();J3();TBH();ahI();ZwD();pg();Z$();zwD=require("child_process"),EC=require("crypto")});async function r7(H,{sessionId:$,agentType:A,model:L,forceSyncExecution:I}={}){let D=[],B=[];if(dg())N("Skipping plugin hooks - allowManagedHooksOnly is enabled");else try{await da()}catch(E){let M=E instanceof Error?Error(`Failed to load plugin hooks during ${H}: ${E.message}`):Error(`Failed to load plugin hooks during ${H}: ${String(E)}`);if(E instanceof Error&&E.stack)M.stack=E.stack;r(M);let G=E instanceof Error?E.message:String(E),U="";if(G.includes("Failed to clone")||G.includes("network")||G.includes("ETIMEDOUT")||G.includes("ENOTFOUND"))U="This appears to be a network issue. Check your internet connection and try again.";else if(G.includes("Permission denied")||G.includes("EACCES")||G.includes("EPERM"))U="This appears to be a permissions issue. Check file permissions on ~/.claude/plugins/";else if(G.includes("Invalid")||G.includes("parse")||G.includes("JSON")||G.includes("schema"))U="This appears to be a configuration issue. Check your plugin settings in .claude/settings.json";else U="Please fix the plugin configuration or remove problematic plugins from your settings.";N(`Warning: Failed to load plugin hooks. SessionStart hooks from plugins will not execute. Error: ${G}. ${U}`,{level:"warn"})}let f=A??lYH();for await(let E of PNA(H,$,f,L,void 0,void 0,I)){if(E.message)D.push(E.message);if(E.additionalContexts&&E.additionalContexts.length>0)B.push(...E.additionalContexts)}if(B.length>0){let E=QB({type:"hook_additional_context",content:B,hookName:"SessionStart",toolUseID:"SessionStart",hookEvent:"SessionStart"});D.push(E)}return D}async function nC$(H,{forceSyncExecution:$}={}){let A=[],L=[];if(dg())N("Skipping plugin hooks - allowManagedHooksOnly is enabled");else try{await da()}catch(I){let D=I instanceof Error?I.message:String(I);N(`Warning: Failed to load plugin hooks. Setup hooks from plugins will not execute. Error: ${D}`,{level:"warn"})}for await(let I of _NA(H,void 0,void 0,$)){if(I.message)A.push(I.message);if(I.additionalContexts&&I.additionalContexts.length>0)L.push(...I.additionalContexts)}if(L.length>0){let I=QB({type:"hook_additional_context",content:L,hookName:"Setup",toolUseID:"Setup",hookEvent:"Setup"});A.push(I)}return A}var bt=K(()=>{_3();aRH();_$();E$();J3();XDH();g$()});function j91(H){if(H.type!=="attachment")return H;let $=H.attachment;if($.type==="new_file")return{...H,attachment:{...$,type:"file"}};if($.type==="new_directory")return{...H,attachment:{...$,type:"directory"}};return H}function QuH(H){try{let $=H.map(j91),A=new Set(qR);for(let f of $)if(f.type==="user"&&f.permissionMode!==void 0&&!A.has(f.permissionMode))f.permissionMode=void 0;let L=GY$($),I=_kH(L),D=PkH(I);if(D[D.length-1]?.type==="user")D.push(PT({content:LDH}));return D}catch($){throw r($),$}}function R91(H){for(let $ of H){if($.type!=="attachment")continue;if($.attachment.type!=="invoked_skills")continue;for(let A of $.attachment.skills)if(A.name&&A.path&&A.content)cYH(A.name,A.path,A.content)}}async function kt(H,$){try{let A=null,L=null,I;if(H===void 0)A=await TNA(0);else if($){L=[];for(let B of await G$H($)){if(B.type==="assistant"||B.type==="user"){let f=y91(B);if(f)L.push(f)}I=B.session_id}}else if(typeof H==="string")A=await qNA(H),I=H;else A=H;if(!A&&!L)return null;if(A){if(Qz(A))A=await cS(A);if(!I)I=mM(A);if(BF$(A),I)EF$(A,Z7(I));bY$(A),L=A.messages}R91(L),L=QuH(L);let D=await r7("resume",{sessionId:I});return L.push(...D),{messages:L,fileHistorySnapshots:A?.fileHistorySnapshots,attributionSnapshots:A?.attributionSnapshots,sessionId:I,agentName:A?.agentName,agentColor:A?.agentColor,agentSetting:A?.agentSetting,customTitle:A?.customTitle,tag:A?.tag,mode:A?.mode,fullPath:A?.fullPath}}catch(A){throw r(A),A}}function y91(H){if(H.type==="assistant")return{type:H.type,message:H.message,uuid:ZNA.randomUUID(),timestamp:new Date().toISOString(),requestId:void 0};else if(H.type==="user")return{type:H.type,message:H.message,uuid:ZNA.randomUUID(),timestamp:new Date().toISOString()};return}var ZNA;var I3H=K(()=>{_$();rB();_L();jv();gQ();Fd$();nM();bt();AC();g$();ZNA=require("crypto")});function jwD({onStashAndContinue:H,onCancel:$}){let[A,L]=u9H.useState(null),I=A!==null?[...A.tracked,...A.untracked]:[],[D,B]=u9H.useState(!0),[f,E]=u9H.useState(!1),[M,G]=u9H.useState(null);u9H.useEffect(()=>{(async()=>{try{let Q=await Zd$();L(Q)}catch(Q){let W=Q instanceof Error?Q.message:String(Q);N(`Error getting changed files: ${W}`,{level:"error"}),G("Failed to get changed files")}finally{B(!1)}})()},[]);let U=async()=>{E(!0);try{if(N("Stashing changes before teleport..."),await y9L("Teleport auto-stash"))N("Successfully stashed changes"),H();else G("Failed to stash changes")}catch(F){let Q=F instanceof Error?F.message:String(F);N(`Error stashing changes: ${Q}`,{level:"error"}),G("Failed to stash changes")}finally{E(!1)}},X=(F)=>{if(F==="stash")U();else $()};if(D)return RX.default.createElement(x,{flexDirection:"column",padding:1},RX.default.createElement(x,{marginBottom:1},RX.default.createElement(vD,null),RX.default.createElement(V,null," Checking git status",pH.ellipsis)));if(M)return RX.default.createElement(x,{flexDirection:"column",padding:1},RX.default.createElement(V,{bold:!0,color:"error"},"Error: ",M),RX.default.createElement(x,{marginTop:1},RX.default.createElement(V,{dimColor:!0},"Press "),RX.default.createElement(V,{bold:!0},"Escape"),RX.default.createElement(V,{dimColor:!0}," to cancel")));let J=I.length>8;return RX.default.createElement(BL,{title:"Working Directory Has Changes",onCancel:$,borderDimColor:!0},RX.default.createElement(V,null,"Teleport will switch git branches. The following changes were found:"),RX.default.createElement(x,{flexDirection:"column",paddingLeft:2},I.length>0?J?RX.default.createElement(V,null,I.length," files changed"):I.map((F,Q)=>RX.default.createElement(V,{key:Q},F)):RX.default.createElement(V,{dimColor:!0},"No changes detected")),RX.default.createElement(V,null,"Would you like to stash these changes and continue with teleport?"),f?RX.default.createElement(x,null,RX.default.createElement(vD,null),RX.default.createElement(V,null," Stashing changes...")):RX.default.createElement(QA,{options:[{label:"Stash changes and continue",value:"stash"},{label:"Exit",value:"exit"}],onChange:X}))}var RX,u9H;var RwD=K(()=>{xH();t8();E$();JM();l8();jI();bB();RX=b(s(),1),u9H=b(s(),1)});async function D3H(){let H=dD()?.accessToken;if(!H)throw Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let $=await jR();if(!$)throw Error("Unable to get organization UUID");let A=`${XD().BASE_API_URL}/v1/environment_providers`;try{let L={...xK(H),"x-organization-uuid":$},I=await nA.get(A,{headers:L,timeout:15000});if(I.status!==200)throw Error(`Failed to fetch environments: ${I.status} ${I.statusText}`);return I.data.environments}catch(L){let I=L instanceof Error?L:Error(String(L));throw r(I),Error(`Failed to fetch environments: ${I.message}`)}}var rC$=K(()=>{w1();qE();EI();Hq();_$();YS()});async function aC$(){if(!nL())return!1;return iW()}async function ywD(){return await R$H({ignoreUntracked:!0})}async function vwD(){try{return(await D3H()).length>0}catch(H){return N(`checkHasRemoteEnvironment failed: ${H instanceof Error?H.message:String(H)}`),!1}}async function hwD(){return await _S()!==null}async function bwD(H,$){try{let A=dD()?.accessToken;if(!A)return N("checkGithubAppInstalled: No access token found, assuming app not installed"),!1;let L=await jR();if(!L)return N("checkGithubAppInstalled: No org UUID found, assuming app not installed"),!1;let I=`${XD().BASE_API_URL}/api/oauth/organizations/${L}/code/repos/${H}/${$}`,D={...xK(A),"x-organization-uuid":L};N(`Checking GitHub app installation for ${H}/${$}`);let B=await nA.get(I,{headers:D,timeout:15000});if(B.status===200){if(B.data.status){let f=B.data.status.app_installed;return N(`GitHub app ${f?"is":"is not"} installed on ${H}/${$}`),f}return N(`GitHub app is not installed on ${H}/${$} (status is null)`),!1}return N(`checkGithubAppInstalled: Unexpected response status ${B.status}`),!1}catch(A){if(nA.isAxiosError(A)){let L=A.response?.status;if(L&&L>=400&&L<500)return N(`checkGithubAppInstalled: Got ${L} error, app likely not installed on ${H}/${$}`),!1}return N(`checkGithubAppInstalled error: ${A instanceof Error?A.message:String(A)}`),!1}}var zNA=K(()=>{t8();EI();I9H();rC$();Hq();qE();YS();w1();E$()});function oC$({onComplete:H,errorsToIgnore:$=new Set}){let[A,L]=bF.useState(null),[I,D]=bF.useState(!1),B=bF.useCallback(async()=>{let X=await NNA(),J=new Set(Array.from(X).filter((F)=>!$.has(F)));if(J.size===0){H();return}if(J.has("needsLogin"))L("needsLogin");else if(J.has("needsGitStash"))L("needsGitStash")},[H,$]);bF.useEffect(()=>{B()},[B]);let f=bF.useCallback(()=>{L9(0)},[]),E=bF.useCallback(()=>{D(!1),B()},[B]),M=bF.useCallback(()=>{D(!0)},[D]),G=bF.useCallback((X)=>{if(X==="login")M();else f()},[M,f]),U=bF.useCallback(()=>{B()},[B]);if(!A)return null;switch(A){case"needsGitStash":return bF.default.createElement(jwD,{onStashAndContinue:U,onCancel:f});case"needsLogin":{if(I)return bF.default.createElement(s0H,{onDone:E,mode:"login",forceLoginMethod:"claudeai"});return bF.default.createElement(BL,{title:"Log in to Claude",onCancel:f,borderDimColor:!0},bF.default.createElement(x,{flexDirection:"column"},bF.default.createElement(V,{dimColor:!0},"Teleport requires a Claude.ai account."),bF.default.createElement(V,{dimColor:!0},"Your Claude Pro/Max subscription will be used by Claude Code.")),bF.default.createElement(QA,{options:[{label:"Login with Claude account",value:"login"},{label:"Exit",value:"exit"}],onChange:G}))}}}async function NNA(){let H=new Set,[$,A]=await Promise.all([aC$(),ywD()]);if($)H.add("needsLogin");if(!A)H.add("needsGitStash");return H}var bF;var ONA=K(()=>{xH();bB();l8();SbH();RwD();UU();zNA();bF=b(s(),1)});function uwD(H){let $=kwD.get(H);if(!$)$=rR(async(A,L,I)=>await h91(H,A,L,I)),kwD.set(H,$);return $}async function h91(H,$,A,L){for(let I=1;I<=tC$;I++){try{let B=sC$.get(H),f={...L};if(B)f["Last-Uuid"]=B;let E=await nA.put(A,$,{headers:f,validateStatus:(M)=>M<500});if(E.status===200||E.status===201)return sC$.set(H,$.uuid),N(`Successfully persisted session log entry for session ${H}`),!0;if(E.status===409){if(E.headers["x-last-uuid"]===$.uuid)return sC$.set(H,$.uuid),N(`Session entry ${$.uuid} already present on server, recovering from stale state`),EL("info","session_persist_recovered_from_409"),!0;let U=E.data.error?.message||"Concurrent modification detected";return r(Error(`Session persistence conflict: UUID mismatch for session ${H}, entry ${$.uuid}. ${U}`)),EL("error","session_persist_fail_concurrent_modification"),!1}if(E.status===401)return N("Session token expired or invalid"),EL("error","session_persist_fail_bad_token"),!1;N(`Failed to persist session log: ${E.status} ${E.statusText}`),EL("error","session_persist_fail_status",{status:E.status,attempt:I})}catch(B){let f=B;r(Error(`Error persisting session log: ${f.message}`)),EL("error","session_persist_fail_status",{status:f.status,attempt:I})}if(I===tC$)return N(`Remote persistence failed after ${tC$} attempts`),EL("error","session_persist_error_retries_exhausted",{attempt:I}),!1;let D=Math.min(v91*Math.pow(2,I-1),8000);N(`Remote persistence attempt ${I}/${tC$} failed, retrying in ${D}ms\u2026`),await new Promise((B)=>setTimeout(B,D))}return!1}async function gwD(H,$,A){let L=wY();if(!L)return N("No session token available for session persistence"),EL("error","session_persist_fail_jwt_no_token"),!1;let I={Authorization:`Bearer ${L}`,"Content-Type":"application/json"};return await uwD(H)($,A,I)}async function mwD(H,$){try{let{accessToken:A,orgUUID:L}=await Zw(),I=`${XD().BASE_API_URL}/v1/session_ingress/session/${H}`,D={...xK(A),"x-organization-uuid":L};return await uwD(H)($,I,D)}catch(A){return N(`Failed to get OAuth credentials: ${A instanceof Error?A.message:String(A)}`),EL("error","session_persist_fail_oauth_no_token"),!1}}async function pwD(H,$){let A=wY();if(!A)return N("No session token available for fetching session logs"),EL("error","session_get_fail_no_token"),null;let L={Authorization:`Bearer ${A}`},I=await cwD(H,$,L);if(I&&I.length>0){let D=I[I.length-1];if(D&&"uuid"in D&&D.uuid)sC$.set(H,D.uuid)}return I}async function dwD(H,$,A){let L=`${XD().BASE_API_URL}/v1/session_ingress/session/${H}`;N(`[session-ingress] Fetching session logs from: ${L}`);let I={...xK($),"x-organization-uuid":A};return await cwD(H,L,I)}async function cwD(H,$,A){try{let L=await nA.get($,{headers:A,timeout:20000,validateStatus:(I)=>I<500});if(L.status===200){let I=L.data;if(!I||typeof I!=="object"||!Array.isArray(I.loglines))return r(Error(`Invalid session logs response format: ${yH(I)}`)),EL("error","session_get_fail_invalid_response"),null;let D=I.loglines;return N(`Fetched ${D.length} session logs for session ${H}`),D}if(L.status===404)return N(`No existing logs for session ${H}`),EL("warn","session_get_no_logs_for_session"),[];if(L.status===401)throw N("Auth token expired or invalid"),EL("error","session_get_fail_bad_token"),Error("Your session has expired. Please run /login to sign in again.");return N(`Failed to fetch session logs: ${L.status} ${L.statusText}`),EL("error","session_get_fail_status",{status:L.status}),null}catch(L){let I=L;return r(Error(`Error fetching session logs: ${I.message}`)),EL("error","session_get_fail_status",{status:I.status}),null}}var sC$,tC$=10,v91=500,kwD;var eC$=K(()=>{w1();_$();E$();Ga();qE();YS();Z6();Z$();sC$=new Map,kwD=new Map});function k91(H){if(H===null)return a7("Session resumed","suggestion");let $=H instanceof AK?H.formattedMessage:H.message;return a7(`Session resumed without branch: ${$}`,"warning")}function u91(){return R$({content:`This session is being continued from another machine. Application state may have changed. The updated working directory is ${zL()}`,isMeta:!0})}async function m91(H,$){let A=H.length>75?`${H.slice(0,75)}\u2026`:H,L="claude/task";try{let I=g91.replace("{description}",H),B=(await OQ({systemPrompt:[],userPrompt:I,outputFormat:{type:"json_schema",schema:{type:"object",properties:{title:{type:"string"},branch:{type:"string"}},required:["title","branch"],additionalProperties:!1}},signal:$,options:{querySource:"teleport_generate_title",agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content[0];if(B?.type!=="text")return{title:A,branchName:"claude/task"};let f=q1(B.text.trim()),E=S.object({title:S.string(),branch:S.string()}).safeParse(f);if(E.success)return{title:E.data.title||A,branchName:E.data.branch||"claude/task"};return{title:A,branchName:"claude/task"}}catch(I){return r(Error(`Error generating title and branch: ${I}`)),{title:A,branchName:"claude/task"}}}async function A2$(){if(!await R$H({ignoreUntracked:!0}))throw c("tengu_teleport_error_git_not_clean",{}),new AK("Git working directory is not clean. Please commit or stash your changes before using --teleport.",oH.red(`Error: Git working directory is not clean. Please commit or stash your changes before using --teleport. `));await d91(H)}async function H2$(){let{stdout:H}=await jA(cB(),["branch","--show-current"]);return H.trim()}function B3H(H,$){return[...QuH(H),u91(),k91($)]}async function f3H(H){try{let $=await H2$();if(N(`Current branch before teleport: '${$}'`),H){N(`Switching to branch '${H}'...`),await p91(H),await c91(H);let L=await H2$();N(`Branch after checkout: '${L}'`)}else N("No branch specified, staying on current branch");return{branchName:await H2$(),branchError:null}}catch($){let A=await H2$(),L=$ instanceof Error?$:Error(String($));return{branchName:A,branchError:L}}}async function xNA(H){let $=await _S(),A=H.session_context.sources.find((I)=>I.type==="git_repository");if(!A?.url)return N($?"Session has no associated repository, proceeding without validation":"Session has no repo requirement and not in git directory, proceeding"),{status:"no_repo_required"};let L=L9H(A.url);if(!L)return{status:"no_repo_required"};if(N(`Session is for repository: ${L}, current repo: ${$??"none"}`),!$)return{status:"not_in_repo",sessionRepo:L,currentRepo:null};if($.toLowerCase()===L.toLowerCase())return{status:"match",sessionRepo:L,currentRepo:$};return{status:"mismatch",sessionRepo:L,currentRepo:$}}async function ut(H,$){if(!PK("allow_remote_sessions"))throw Error("Remote sessions are disabled by your organization's policy.");N(`Resuming code session ID: ${H}`);try{let A=dD()?.accessToken;if(!A)throw c("tengu_teleport_resume_error",{error_type:"no_access_token"}),Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let L=await jR();if(!L)throw c("tengu_teleport_resume_error",{error_type:"no_org_uuid"}),Error("Unable to get organization UUID for constructing session URL");$?.("validating");let I=await gbH(H),D=await xNA(I);switch(D.status){case"match":case"no_repo_required":break;case"not_in_repo":throw c("tengu_teleport_error_repo_not_in_git_dir_sessions_api",{sessionId:H}),new AK(`You must run claude --teleport ${H} from a checkout of ${D.sessionRepo}.`,oH.red(`You must run claude --teleport ${H} from a checkout of ${oH.bold(D.sessionRepo)}. `));case"mismatch":throw c("tengu_teleport_error_repo_mismatch_sessions_api",{sessionId:H}),new AK(`You must run claude --teleport ${H} from a checkout of ${D.sessionRepo}. This repo is ${D.currentRepo}.`,oH.red(`You must run claude --teleport ${H} from a checkout of ${oH.bold(D.sessionRepo)}. You should keep it short and simple, ideally no more than 4 words. The branch should always start with "claude/" and should be all lower case, with words separated by dashes. Example 1: {"title": "Fix login button not working on mobile", "branch": "claude/fix-mobile-login-button"} Example 2: {"title": "Update README with installation instructions", "branch": "claude/update-readme"} Example 3: {"title": "Improve performance of data processing script", "branch": "claude/improve-data-processing"} Please generate a title and branch name for this session.`;var ip=K(()=>{B0();t8();I3H();r0();lG();E$();nM();mI();_$();xH();pL();sv();ONA();EI();Hq();w1();qE();EI();I9H();dU();aI();z$();_L();g$();XY();YS();rC$();mL();eC$();rB();Z$();AS();lwD=require("crypto"),$2$=b(s(),1)});async function rwD(){let H=[];if(!PK("allow_remote_sessions"))return H.push({type:"policy_blocked"}),H;let[$,A,L,I]=await Promise.all([aC$(),vwD(),hwD(),_S()]);if($)H.push({type:"not_logged_in"});if(!A)H.push({type:"no_remote_environment"});if(!L)H.push({type:"not_in_git_repo"});if(I){let[D,B]=I.split("/");if(D&&B){if(!await bwD(D,B))H.push({type:"github_app_not_installed"})}}return H}var awD=K(()=>{zNA();I9H();XY()});async function L2$(){let H=await rwD();if(H.length>0)return{eligible:!1,errors:H};return{eligible:!0}}function I2$(H){switch(H.type){case"not_logged_in":return"Please run /login and sign in with your Claude.ai account (not Console).";case"no_remote_environment":return"No environments available, please ensure you've gone through onboarding at claude.ai/code";case"not_in_git_repo":return"Background tasks require a git repository. Initialize git or run from a git repository.";case"github_app_not_installed":return`The Claude GitHub app must be installed on this repository first. https://github.com/apps/claude/installations/new`;case"policy_blocked":return"Remote sessions are disabled by your organization's policy."}}function n91(H,$,A,L){let I=A==="completed"?"completed successfully":A==="failed"?"failed":"was stopped",D=vM(H),B=`<${G5}> `)}if(d1(H,$.setAppState,(X)=>({...X,status:M==="starting"?"running":M,log:f.log,todoList:r91(f.log),deltaSummarySinceLastFlushToAttachment:U,endTime:E?Date.now():void 0})),E){let X=E.subtype==="success"?"completed":"failed";n91(H,B.title,X,$.setAppState);return}}catch(D){r(D instanceof Error?D:Error(String(D)))}if(A)setTimeout(I,L)};return I(),()=>{A=!1}}function m9H(H){return i4$(H,process.env.SESSION_INGRESS_URL)}function twD(H){return`claude --teleport ${H}`}var np,owD;var H3H=K(()=>{xH();KBH();_$();E$();CP();bx();YP();ip();dU();_L();q5H();awD();Z$();EE();np=b(s(),1);owD={name:"RemoteAgentTask",type:"remote_agent",async spawn(H,$){let{command:A,title:L}=H,{abortController:I}=$;N(`RemoteAgentTask spawning: ${L}`);let D=await g9H({initialMessage:A,description:L,signal:I.signal});if(!D)throw Error("Failed to create remote session");let{taskId:B,cleanup:f}=fuH({session:{id:D.id,title:D.title||L},command:A,context:$});return{taskId:B,cleanup:f}},async kill(H,$){d1(H,$.setAppState,(A)=>{if(A.status!=="running")return A;return{...A,status:"killed",endTime:Date.now()}}),N(`RemoteAgentTask ${H} marked as killed (local only)`)},renderStatus(H){let $=H,A=$.status,L=$.title;return np.createElement(x,null,np.createElement(V,{color:A==="running"?"warning":A==="completed"?"success":A==="failed"?"error":"inactive"},"[",A,"] ",L))},renderOutput(H){return np.createElement(x,null,np.createElement(V,null,H))},getProgressMessage(H){let A=H.deltaSummarySinceLastFlushToAttachment;if(!A)return null;return`Remote task ${H.id} progress: ${A}. Read ${H.outputFile} to see full output.`}}});function t91(){return[UQH,gF$,owD]}function IuH(H){return t91().find(($)=>$.type===H)}var RzA=K(()=>{_BH();oa();H3H()});function d1(H,$,A){$((L)=>{let I=L.tasks?.[H];if(!I)return L;return{...L,tasks:{...L.tasks,[H]:A(I)}}})}function qP(H,$){$((A)=>({...A,tasks:{...A.tasks,[H.id]:H}}))}function swD(H){if(H.type==="local_bash"){let $=H;return{...$,lastReportedStdoutLines:$.stdoutLineCount,lastReportedStderrLines:$.stderrLineCount}}if(H.type==="local_agent"){let $=H;return{...$,lastReportedToolCount:$.progress?.toolUseCount??0,lastReportedTokenCount:$.progress?.tokenCount??0}}return H}function ewD(H){let $=[],A=[],L={},I=H.tasks??{};for(let D of Object.values(I)){if(D.notified&&D.status!=="running")continue;let B=null;if(D.status==="running"){let f=y7A(D.id,D.outputOffset);if(f.content){let{content:G}=DuH(f.content,D.id);B=G,L[D.id]={...D,outputOffset:f.newOffset}}let M=IuH(D.type)?.getProgressMessage(D)??null;if(M)A.push({type:"task_progress",taskId:D.id,taskType:D.type,message:M})}if(D.status!=="running"&&D.status!=="pending"&&!D.notified){let f=y7A(D.id,D.outputOffset);if(f.content){let{content:E}=DuH(f.content,D.id);B=E}$.push({type:"task_status",taskId:D.id,taskType:D.type,status:D.status,description:D.description,deltaSummary:B}),L[D.id]={...L[D.id]??D,notified:!0,outputOffset:f.newOffset}}}return{attachments:$,progressAttachments:A,updatedTasks:L}}var bx=K(()=>{YP();CP();RzA();yzA();EE()});async function $ZD(H){try{let L=(await zH().stat(H)).size;if(L===0)return{success:!1,error:{reason:"empty",message:`PDF file is empty: ${H}`}};if(L>SJH)return{success:!1,error:{reason:"too_large",message:`PDF file exceeds maximum allowed size of ${GM(SJH)}.`}};let I=(await E3H.readFile(H)).toString("base64");return{success:!0,data:{type:"pdf",file:{filePath:H,base64:I,originalSize:L}}}}catch($){return{success:!1,error:{reason:"unknown",message:$ instanceof Error?$.message:String($)}}}}async function B2$(H){let{code:$,stdout:A}=await jA("pdfinfo",[H],{timeout:1e4,useCwd:!1});if($!==0)return null;let L=/^Pages:\s+(\d+)/m.exec(A);if(!L)return null;let I=parseInt(L[1],10);return isNaN(I)?null:I}async function s91(){if(D2$!==void 0)return D2$;let{code:H,stderr:$}=await jA("pdftoppm",["-v"],{timeout:5000,useCwd:!1});return D2$=H===0||$.length>0,D2$}async function jNA(H,$){try{let I=(await zH().stat(H)).size;if(I===0)return{success:!1,error:{reason:"empty",message:`PDF file is empty: ${H}`}};if(I>G4A)return{success:!1,error:{reason:"too_large",message:`PDF file exceeds maximum allowed size for text extraction (${GM(G4A)}).`}};if(!await s91())return{success:!1,error:{reason:"unavailable",message:"pdftoppm is not installed. Install poppler-utils (e.g. `brew install poppler` or `apt-get install poppler-utils`) to enable PDF page rendering."}};let B=HZD.randomUUID(),f=SNA.join(_KH(),`pdf-${B}`);await E3H.mkdir(f,{recursive:!0});let E=SNA.join(f,"page"),M=["-jpeg","-r","100"];if($?.firstPage)M.push("-f",String($.firstPage));if($?.lastPage&&$.lastPage!==1/0)M.push("-l",String($.lastPage));M.push(H,E);let{code:G,stderr:U}=await jA("pdftoppm",M,{timeout:120000,useCwd:!1});if(G!==0){if(/password/i.test(U))return{success:!1,error:{reason:"password_protected",message:"PDF is password-protected. Please provide an unprotected version."}};if(/damaged|corrupt|invalid/i.test(U))return{success:!1,error:{reason:"corrupted",message:"PDF file is corrupted or invalid."}};return{success:!1,error:{reason:"unknown",message:`pdftoppm failed: ${U}`}}}let J=(await E3H.readdir(f)).filter((W)=>W.endsWith(".jpg")).sort();if(J.length===0)return{success:!1,error:{reason:"corrupted",message:"pdftoppm produced no output pages. The PDF may be invalid."}};let Q=J.length;return{success:!0,data:{type:"parts",file:{filePath:H,originalSize:I,outputDir:f,count:Q}}}}catch(A){return{success:!1,error:{reason:"unknown",message:A instanceof Error?A.message:String(A)}}}}var HZD,SNA,E3H,D2$;var RNA=K(()=>{DL();rD();Bm();B0();aIH();HZD=require("crypto"),SNA=require("path"),E3H=require("fs/promises")});async function A11(H,$,A,L,I,D){if(A$(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS))return[];let B=nD();setTimeout(()=>{B.abort()},1000);let f={...$,abortController:B},E=!$.agentId,M=H?[xG("at_mentioned_files",()=>Q11(H,f)),xG("mcp_resources",()=>V11(H,f)),xG("agent_mentions",()=>Promise.resolve(W11(H,$.options.agentDefinitions.activeAgents)))]:[],G=await Promise.all(M),U=[xG("changed_files",()=>P11(f)),xG("nested_memory",()=>_11(f)),xG("dynamic_skill",()=>Y11(f)),xG("skill_listing",()=>C11(f)),xG("ultra_claude_md",async()=>X11(I)),xG("plan_mode",()=>B11(I,$)),xG("plan_mode_exit",()=>f11($)),xG("delegate_mode",()=>E11($)),xG("delegate_mode_exit",()=>Promise.resolve(M11())),xG("todo_reminders",()=>HU()?v11(I,$):R11(I,$)),...dL()?[...D==="session_memory"?[]:[xG("teammate_mailbox",async()=>u11($))],xG("team_context",async()=>g11(I??[]))]:[],xG("critical_system_reminder",()=>Promise.resolve(G11($)))],X=E?[xG("ide_selection",async()=>J11(A,$)),xG("ide_opened_file",async()=>K11(A,$)),xG("output_style",async()=>Promise.resolve(U11())),xG("diagnostics",async()=>O11($)),xG("lsp_diagnostics",async()=>x11($)),xG("unified_tasks",async()=>b11($,I)),xG("async_hook_responses",async()=>k11()),xG("token_usage",async()=>Promise.resolve(m11(I??[],$.options.mainLoopModel))),xG("budget_usd",async()=>Promise.resolve(p11($.options.maxBudgetUsd))),xG("verify_plan_reminder",async()=>c11(I,$)),xG("queued_commands",async()=>Promise.resolve(L11(L)))]:[],[J,F]=await Promise.all([Promise.all(U),Promise.all(X)]);return[...G.flat(),...J.flat(),...F.flat()]}async function xG(H,$){let A=Date.now();try{let L=await $(),I=Date.now()-A,D=L.reduce((B,f)=>{return B+yH(f).length},0);if(Math.random()<0.05)c("tengu_attachment_compute_duration",{label:H,duration_ms:I,attachment_size_bytes:D,attachment_count:L.length});return L}catch(L){let I=Date.now()-A;if(Math.random()<0.05)c("tengu_attachment_compute_duration",{label:H,duration_ms:I,error:!0});return r(L),pZ(`Attachment error in ${H}`,L),[]}}function L11(H){if(!H)return[];return H.filter(($)=>$.mode==="prompt").map(($)=>({type:"queued_command",prompt:$.value,source_uuid:$.uuid,imagePasteIds:$.imagePasteIds}))}function I11(H){let $=0,A=!1;for(let L=H.length-1;L>=0;L--){let I=H[L];if(I?.type==="assistant"){if(VuH(I))continue;$++}else if(I?.type==="attachment"&&(I.attachment.type==="plan_mode"||I.attachment.type==="plan_mode_reentry")){A=!0;break}}return{turnCount:$,foundPlanModeAttachment:A}}function D11(H){let $=0;for(let A=H.length-1;A>=0;A--){let L=H[A];if(L?.type==="attachment"){if(L.attachment.type==="plan_mode_exit")break;if(L.attachment.type==="plan_mode")$++}}return $}async function B11(H,$){if((await $.getAppState()).toolPermissionContext.mode!=="plan")return[];if(H&&H.length>0){let{turnCount:M,foundPlanModeAttachment:G}=I11(H);if(G&&M0)yD("at-mentions");let L=await $.getAppState();return(await Promise.all(A.map(async(D)=>{try{let{filename:B,lineStart:f,lineEnd:E}=T11(D),M=xD(B);if(M3H(M,L.toolPermissionContext))return null;try{if(zH().statSync(M).isDirectory())try{let U=await aD.call({command:`ls ${wI([M])}`,description:`Lists files in ${M}`},$);c("tengu_at_mention_extracting_directory_success",{});let X=U.data.stdout;return{type:"directory",path:M,content:X}}catch{return null}}catch{}return await hNA(M,$,"tengu_at_mention_extracting_filename_success","tengu_at_mention_extracting_filename_error","at-mention",{offset:f,limit:E&&f?E-f+1:void 0})}catch{c("tengu_at_mention_extracting_filename_error",{})}}))).filter(Boolean)}function W11(H,$){let A=q11(H);if(A.length===0)return[];return A.map((I)=>{let D=I.replace("agent-",""),B=$.find((f)=>f.agentType===D);if(!B)return c("tengu_at_mention_agent_not_found",{}),null;return c("tengu_at_mention_agent_success",{}),{type:"agent_mention",agentType:B.agentType}}).filter((I)=>I!==null)}async function V11(H,$){let A=Z11(H);if(A.length===0)return[];let L=$.options.mcpClients||[];return(await Promise.all(A.map(async(D)=>{try{let[B,...f]=D.split(":"),E=f.join(":");if(!B||!E)return c("tengu_at_mention_mcp_resource_error",{}),null;let M=L.find((X)=>X.name===B);if(!M||M.type!=="connected")return c("tengu_at_mention_mcp_resource_error",{}),null;let U=($.options.mcpResources?.[B]||[]).find((X)=>X.uri===E);if(!U)return c("tengu_at_mention_mcp_resource_error",{}),null;try{let X=await M.client.readResource({uri:E});return c("tengu_at_mention_mcp_resource_success",{}),{type:"mcp_resource",server:B,uri:E,name:U.name||E,description:U.description,content:X}}catch(X){return c("tengu_at_mention_mcp_resource_error",{}),r(X),null}}catch{return c("tengu_at_mention_mcp_resource_error",{}),null}}))).filter((D)=>D!==null)}async function P11(H){let $=await H.getAppState();return(await Promise.all(yx(H.readFileState).map(async(L)=>{let I=H.readFileState.get(L);if(!I)return null;if(I.offset!==void 0||I.limit!==void 0)return null;let D=xD(L);if(M3H(D,$.toolPermissionContext))return null;try{if(x3(D)<=I.timestamp)return null;let B={file_path:D};if(!(await k8.validateInput(B,H)).result)return null;let E=await k8.call(B,H),M=H.agentId??j$();if(D===ca(M)){if(!H.options.tools.some((U)=>U.name===hu))return null;let G=Sv(M);return{type:"todo",content:G,itemCount:G.length,context:"file-watch"}}if(E.data.type==="text"){if(S7A(I.content,E.data.file.content)==="")return null;return{type:"edited_text_file",filename:D,snippet:S7A(I.content,E.data.file.content)}}if(E.data.type==="image")try{let G=await bNA(D);return{type:"edited_image_file",filename:D,content:G}}catch(G){return r(G),c("tengu_watched_file_compression_failed",{file:D}),null}}catch{return c("tengu_watched_file_stat_error",{}),null}}))).filter((L)=>L!==null)}async function _11(H){let $=await H.getAppState(),A=[];if(H.nestedMemoryAttachmentTriggers&&H.nestedMemoryAttachmentTriggers.size>0){for(let L of H.nestedMemoryAttachmentTriggers){let I=IZD(L,H,$);A.push(...I)}H.nestedMemoryAttachmentTriggers.clear()}return A}async function Y11(H){let $=[];if(H.dynamicSkillDirTriggers&&H.dynamicSkillDirTriggers.size>0){let A=zH();for(let L of H.dynamicSkillDirTriggers){let I=[];try{let D=A.readdirSync(L);for(let B of D)if(B.isDirectory()||B.isSymbolicLink()){let f=Wz.resolve(L,B.name,"SKILL.md");try{A.statSync(f),I.push(B.name)}catch{}}}catch{}if(I.length>0)$.push({type:"dynamic_skill",skillDir:L,skillNames:I})}H.dynamicSkillDirTriggers.clear()}return $}function rp(){WuH.clear()}async function C11(H){let $=oJ(),L=(await Mw($)).filter((f)=>!WuH.has(f.name));if(L.length===0)return[];let I=WuH.size===0;for(let f of L)WuH.add(f.name);N(`Sending ${L.length} skills via attachment (${I?"initial":"dynamic"}, ${WuH.size} total sent)`);let D=JV(H.options.mainLoopModel,V6());return[{type:"skill_listing",content:rjI(L,D),skillCount:L.length,isInitial:I}]}function w11(H){let $=/(^|\s)@"([^"]+)"/g,A=/(^|\s)@([^\s]+)\b/g,L=[],I=[],D;while((D=$.exec(H))!==null)if(D[2]&&!D[2].endsWith(" (agent)"))L.push(D[2]);return(H.match(A)||[]).forEach((f)=>{let E=f.slice(f.indexOf("@")+1);if(!E.startsWith('"'))I.push(E)}),[...new Set([...L,...I])]}function Z11(H){let $=/(^|\s)@([^\s]+:[^\s]+)\b/g,A=H.match($)||[];return[...new Set(A.map((L)=>L.slice(L.indexOf("@")+1)))]}function q11(H){let $=[],A=/(^|\s)@"([\w:.@-]+) \(agent\)"/g,L;while((L=A.exec(H))!==null)if(L[2])$.push(L[2]);let I=/(^|\s)@(agent-[\w:.@-]+)/g,D=H.match(I)||[];for(let B of D)$.push(B.slice(B.indexOf("@")+1));return[...new Set($)]}function T11(H){let $=H.match(/^([^#]+)(?:#L(\d+)(?:-(\d+))?)?$/);if(!$)return{filename:H};let[,A,L,I]=$,D=L?parseInt(L,10):void 0,B=I?parseInt(I,10):D;return{filename:A??H,lineStart:D,lineEnd:B}}function z11(H){let $=0,A=!1;for(let L=H.length-1;L>=0;L--){let I=H[L];if(I?.type==="attachment"&&I.attachment.type==="ultramemory"){A=!0;break}if(I?.type==="assistant")$+=l5A(I)}return A?$:null}function N11(H){if(!H||H.length===0)return!0;let $=z11(H);if($===null)return!0;return $>=e91.TOKEN_COOLDOWN}async function O11(H){let $=await bp.getNewDiagnostics();if($.length===0)return[];return[{type:"diagnostics",files:$,isNew:!0}]}async function x11(H){N("LSP Diagnostics: getLSPDiagnosticAttachments called");try{let $=P6D();if($.length===0)return[];N(`LSP Diagnostics: Found ${$.length} pending diagnostic set(s)`);let A=$.map(({files:L})=>({type:"diagnostics",files:L,isNew:!0}));if($.length>0)_6D(),N(`LSP Diagnostics: Cleared ${$.length} delivered diagnostic(s) from registry`);return N(`LSP Diagnostics: Returning ${A.length} diagnostic attachment(s)`),A}catch($){let A=$ instanceof Error?$:Error(String($));return r(Error(`Failed to get LSP diagnostic attachments: ${A.message}`)),[]}}async function*I6H(H,$,A,L,I,D){let B=await A11(H,$,A,L,I,D);if(B.length===0)return;c("tengu_attachments",{attachment_types:B.map((f)=>f.type)});for(let f of B)yield QB(f)}async function S11(H){let $=Wz.parse(H).ext.toLowerCase();if(!sAH($))return null;try{let A=zH().statSync(H),L=await B2$(H),I=L??Math.ceil(A.size/102400);if(I>AU$)return c("tengu_pdf_reference_attachment",{pageCount:I,fileSize:A.size,hadPdfinfo:L!==null}),{type:"pdf_reference",filename:H,pageCount:I,fileSize:A.size}}catch{}return null}async function hNA(H,$,A,L,I,D){let{offset:B,limit:f}=D??{},E=await $.getAppState();if(M3H(H,E.toolPermissionContext))return null;if(I==="at-mention"&&!M2$(H)){let G=Wz.parse(H).ext.toLowerCase();if(!sAH(G))try{let U=zH().statSync(H);return c("tengu_attachment_file_too_large",{size_bytes:U.size,mode:I}),null}catch{}}if(I==="at-mention"){let G=await S11(H);if(G)return G}let M=$.readFileState.get(H);if(M&&I==="at-mention")try{let G=x3(H);if(M.timestamp<=G&&G===M.timestamp)return c(A,{}),{type:"already_read_file",filename:H,content:{type:"text",file:{filePath:H,content:M.content,numLines:M.content.split(` Technical details: ${M.message}`)}throw Error(`Failed to download marketplace from ${H}: ${M instanceof Error?M.message:String(M)}`)}Pz(L,"Validating marketplace data");let f=VGH.safeParse(B.data);if(!f.success)throw new S_(`Invalid marketplace schema from URL: ${f.error.issues.map((M)=>`${M.path.join(".")}: ${M.message}`).join(", ")}`,H,B.data);Pz(L,"Saving marketplace to cache");let E=yX.join($,"..");I.mkdirSync(E),iL($,yH(f.data,null,2),{encoding:"utf-8",flush:!0})}function A81(H){return H.source==="github"?H.repo.replace("/","-"):H.source==="npm"?H.package.replace("@","").replace("/","-"):H.source==="file"?yX.basename(H.path).replace(".json",""):H.source==="directory"?yX.basename(H.path):"temp_"+Date.now()}function MZD(H,$){let L=zH().readFileSync(H,{encoding:"utf-8"}),I=DA(L),D=$.safeParse(I);if(!D.success)throw new S_(`Invalid schema: ${D.error?.issues.map((B)=>`${B.path.join(".")}: ${B.message}`).join(", ")}`,H,I);return D.data}async function gNA(H,$){let A=zH(),L=BZD();A.mkdirSync(L);let I,D,B=!1,f=A81(H);try{switch(H.source){case"url":{I=yX.join(L,`${f}.json`),B=!0,await EZD(H.url,I,H.headers,$),D=I;break}case"github":{let U=`git@github.com:${H.repo}.git`,X=`https://github.com/${H.repo}.git`;I=yX.join(L,f),B=!0;let J=null;if(await s11()){Pz($,`Cloning via SSH: ${U}`);try{await U3H(U,I,H.ref,$)}catch(Q){if(J=Q instanceof Error?Q:Error(String(Q)),r(J),Pz($,`SSH clone failed, retrying with HTTPS: ${X}`),N(`SSH clone failed for ${H.repo} despite SSH being configured, falling back to HTTPS`,{level:"info"}),A.existsSync(I))A.rmSync(I,{recursive:!0,force:!0});try{await U3H(X,I,H.ref,$),J=null}catch(W){J=W instanceof Error?W:Error(String(W)),r(J)}}}else{Pz($,`SSH not configured, cloning via HTTPS: ${X}`),N(`SSH not configured for GitHub, using HTTPS for ${H.repo}`,{level:"info"});try{await U3H(X,I,H.ref,$)}catch(Q){if(J=Q instanceof Error?Q:Error(String(Q)),r(J),Pz($,`HTTPS clone failed, retrying with SSH: ${U}`),N(`HTTPS clone failed for ${H.repo} (${J.message}), falling back to SSH`,{level:"info"}),A.existsSync(I))A.rmSync(I,{recursive:!0,force:!0});try{await U3H(U,I,H.ref,$),J=null}catch(W){J=W instanceof Error?W:Error(String(W)),r(J)}}}if(J)throw J;D=yX.join(I,H.path||".claude-plugin/marketplace.json");break}case"git":{I=yX.join(L,f),B=!0,await U3H(H.url,I,H.ref,$),D=yX.join(I,H.path||".claude-plugin/marketplace.json");break}case"npm":throw Error("NPM marketplace sources not yet implemented");case"file":{D=H.path,I=yX.dirname(yX.dirname(H.path)),B=!1;break}case"directory":{D=yX.join(H.path,".claude-plugin","marketplace.json"),I=H.path,B=!1;break}default:throw Error("Unsupported marketplace source type")}if(!A.existsSync(D))throw Error(`Marketplace file not found at ${D}`);let E=MZD(D,VGH),M=yX.join(L,E.name),G=H.source==="file"||H.source==="directory";if(I!==M&&!G)try{if(A.existsSync(M)){try{$?.("Cleaning up old marketplace cache\u2026")}catch(U){N(`Progress callback error: ${U instanceof Error?U.message:String(U)}`,{level:"warn"})}A.rmSync(M,{recursive:!0,force:!0})}A.renameSync(I,M),I=M,B=!1}catch(U){let X=U instanceof Error?U.message:String(U);throw Error(`Failed to finalize marketplace cache. Please manually delete the directory at ${M} if it exists and try again. git@your-github-host.com:${H.repo}.git`;throw Error(M)}let{marketplace:A,cachePath:L}=await gNA(H,$),I=F9L(A.name,H);if(I)throw Error(I);let D=await l1();if(D[A.name])throw Error(`Marketplace '${A.name}' is already installed. Please remove it first using '/plugin marketplace remove ${A.name}' if you want to re-install it.`);return D[A.name]={source:H,installLocation:L,lastUpdated:new Date().toISOString()},await J3H(D),N(`Added marketplace source: ${A.name}`),{name:A.name}}async function F2$(H){let $=await l1();if(!$[H])throw Error(`Marketplace '${H}' not found`);delete $[H],await J3H($);let A=zH(),L=BZD(),I=yX.join(L,H);if(A.existsSync(I))A.rmSync(I,{recursive:!0,force:!0});let D=yX.join(L,`${H}.json`);if(A.existsSync(D))A.rmSync(D,{force:!0});let B=["userSettings","projectSettings","localSettings"];for(let E of B){let M=ZI(E);if(!M)continue;let G=!1,U={};if(M.extraKnownMarketplaces?.[H]){let X={...M.extraKnownMarketplaces};X[H]=void 0,U.extraKnownMarketplaces=X,G=!0}if(M.enabledPlugins){let X=`@${H}`,J={...M.enabledPlugins},F=!1;for(let Q in J)if(Q.endsWith(X))J[Q]=void 0,F=!0;if(F)U.enabledPlugins=J,G=!0}if(G){let X=II(E,U);if(X.error)r(X.error),N(`Failed to clean up marketplace '${H}' from ${E} settings: ${X.error.message}`);else N(`Cleaned up marketplace '${H}' from ${E} settings`)}}let f=OqI(H);for(let E of f)G3H(E);N(`Removed marketplace source: ${H}`)}function X2$(H){let $=zH();try{let A=H;if($.existsSync(H)&&$.statSync(H).isDirectory()){let L=yX.join(H,".claude-plugin","marketplace.json");if($.existsSync(L))A=L;else throw Error(`Invalid cached directory at ${H}: missing .claude-plugin/marketplace.json`)}if(!$.existsSync(A))throw Error(`Marketplace file not found at ${A}`);return MZD(A,VGH)}catch(A){if(A instanceof S_)throw A;throw A}}function L81(H){let $=zH(),A=J2$();if(!$.existsSync(A))return null;try{let L=$.readFileSync(A,{encoding:"utf-8"}),D=DA(L)[H];if(!D)return null;return X2$(D.installLocation)}catch{return null}}function mNA(H){let $=H.split("@");if($.length!==2)return null;let A=$[0],L=$[1],I=zH(),D=J2$();if(!I.existsSync(D))return null;try{let B=I.readFileSync(D,{encoding:"utf-8"}),E=DA(B)[L];if(!E)return null;let M=L81(L);if(!M)return null;let G=M.plugins.find((U)=>U.name===A);if(!G)return null;return{entry:G,marketplaceInstallLocation:E.installLocation}}catch{return null}}async function ZK(H){let $=mNA(H);if($)return $;let A=H.split("@");if(A.length!==2)return null;let L=A[0],I=A[1];try{let B=(await l1())[I];if(!B)return null;let E=(await GP(I)).plugins.find((M)=>M.name===L);if(!E)return null;return{entry:E,marketplaceInstallLocation:B.installLocation}}catch(D){return N(`Could not find plugin ${H}: ${D instanceof Error?D.message:String(D)}`,{level:"debug"}),null}}async function GZD(){let H=await l1();for(let[$,A]of Object.entries(H))try{await gNA(A.source),H[$].lastUpdated=new Date().toISOString()}catch(L){N(`Failed to refresh marketplace ${$}: ${L instanceof Error?L.message:String(L)}`,{level:"error"})}await J3H(H)}async function gt(H,$,A){let L=await l1(),I=L[H];if(!I)throw Error(`Marketplace '${H}' not found. Available marketplaces: ${Object.keys(L).join(", ")}`);GP.cache?.delete?.(H);try{let{installLocation:D,source:B}=I;if(B.source==="github"||B.source==="git"){let f=B.source==="github"?A$(process.env.CLAUDE_CODE_REMOTE)?`https://github.com/${B.repo}.git`:`git@github.com:${B.repo}.git`:B.url;await U3H(f,D,B.ref,$,A);try{X2$(D)}catch{let E=B.source==="github"?B.repo:B.url;throw Error(`The marketplace.json file is no longer present in this repository. ${H==="claude-code-plugins"?`We've deprecated "claude-code-plugins" in favor of "claude-plugins-official".`:"This marketplace may have been deprecated or moved to a new location."} You can remove this marketplace with: claude plugin marketplace remove "${H}"`)}}else if(B.source==="url")await EZD(B.url,D,B.headers,$);else if(B.source==="file"||B.source==="directory")Pz($,"Validating local marketplace"),X2$(D);else throw Error("Unsupported marketplace source type for refresh");L[H].lastUpdated=new Date().toISOString(),await J3H(L),N(`Successfully refreshed marketplace: ${H}`)}catch(D){let B=D instanceof Error?D.message:String(D);throw N(`Failed to refresh marketplace ${H}: ${B}`,{level:"error"}),Error(`Failed to refresh marketplace '${H}': ${B}`)}}async function UZD(H,$){let A=await l1(),L=A[H];if(!L)throw Error(`Marketplace '${H}' not found. Available marketplaces: ${Object.keys(A).join(", ")}`);if(L.autoUpdate===$)return;A[H]={...L,autoUpdate:$},await J3H(A),N(`Set autoUpdate=${$} for marketplace: ${H}`)}var yX,fZD,GP;var y4=K(()=>{w1();tD();NA();ejH();DL();Z$();E$();_$();B0();lG();mL();UQ();Ja();Z$();Q7();Vz();t8();yX=require("path");fZD={GIT_TERMINAL_PROMPT:"0",GIT_ASKPASS:""};GP=o$(async(H)=>{let $=await l1(),A=$[H];if(!A)throw Error(`Marketplace '${H}' not found in configuration. Available marketplaces: ${Object.keys($).join(", ")}`);try{return X2$(A.installLocation)}catch(I){N(`Cache corrupted or missing for marketplace ${H}, re-fetching from source: ${I instanceof Error?I.message:String(I)}`,{level:"warn"})}let{marketplace:L}=await gNA(A.source);return $[H].lastUpdated=new Date().toISOString(),await J3H($),L})});async function ap(H,$,A,L,I){if(A?.version)return N(`Using manifest version for ${H}: ${A.version}`),A.version;if(I)return N(`Using provided version for ${H}: ${I}`),I;if(L){let D=await I81(L);if(D){let B=D.substring(0,12);return N(`Using git SHA for ${H}: ${B}`),B}}return N(`No version found for ${H}, using 'unknown'`),"unknown"}async function I81(H){return KwH(H)}var K2$=K(()=>{B0();E$();j$H()});function JZD(){return new Date().toISOString()}function pNA(H,$){let A=gw.resolve(H,$),L=gw.resolve(H)+gw.sep;if(!A.startsWith(L)&&A!==gw.resolve(H))throw Error(`Path traversal detected: "${$}" would escape the base directory`);return A}async function mw(H,$,A="user",L,I){let D=typeof $.source==="string"&&I?I:$.source,B=await l9H(D,{manifest:$}),f=I||B.path,E=await dX$(f),M=JZD(),G=await ap(H,$.source,B.manifest,f,$.version),U=Pv(H,G),X=B.path;if(B.path!==U){if(c9H.mkdirSync(gw.dirname(U),{recursive:!0}),c9H.existsSync(U))c9H.rmSync(U,{recursive:!0,force:!0});let J=B.path.endsWith(gw.sep)?B.path:B.path+gw.sep;if(U.startsWith(J)){let Q=gw.join(XZD.tmpdir(),`claude-plugin-temp-${Date.now()}`);await Q2$.rename(B.path,Q),c9H.mkdirSync(gw.dirname(U),{recursive:!0}),await Q2$.rename(Q,U)}else await Q2$.rename(B.path,U);X=U}return nKA(H,{version:G,installedAt:M,lastUpdated:M,installPath:X,gitCommitSha:E},A,L),X}function FZD(H,$="user",A){let L=JZD();nKA(H.pluginId,{version:H.version||"unknown",installedAt:L,lastUpdated:L,installPath:H.installPath},$,A)}async function _uH({pluginId:H,entry:$,marketplaceName:A,scope:L="user"}){try{let I=Wv(L),D=L!=="user"?C$():void 0,B,{source:f}=$;if(NR(f)){let G=await ZK(H);if(G)B=pNA(G.marketplaceInstallLocation,f)}await mw(H,$,L,D,B);let M={...ZI(I)?.enabledPlugins,[H]:!0};return II(I,{enabledPlugins:M}),c("tengu_plugin_installed",{plugin_id:H,marketplace_name:A}),SG(),{success:!0,message:`\u2713 Installed ${$.name}. Restart Claude Code to load new plugins.`}}catch(I){let D=I instanceof Error?I.message:String(I);return r(I instanceof Error?I:Error(`Failed to install plugin: ${String(I)}`)),{success:!1,error:`Failed to install: ${D}`}}}var Q2$,c9H,gw,XZD;var op=K(()=>{UQ();Q7();_X();y4();hDH();mL();PI();Vz();z$();_$();K2$();Q2$=require("fs/promises"),c9H=require("fs"),gw=require("path"),XZD=require("os")});function Mm(){return G0.join(Dw(),"cache")}function Pv(H,$){let A=Mm(),[L,I]=H.split("@"),D=(I||"unknown").replace(/[^a-zA-Z0-9\-_]/g,"-"),B=(L||H).replace(/[^a-zA-Z0-9\-_]/g,"-"),f=$.replace(/[^a-zA-Z0-9\-_.]/g,"-");return G0.join(A,D,B,f)}function YuH(H,$){let A=zH();if(!A.existsSync($))A.mkdirSync($);let L=A.readdirSync(H);for(let I of L){let D=G0.join(H,I.name),B=G0.join($,I.name);if(I.isDirectory())YuH(D,B);else if(I.isFile())A.copyFileSync(D,B);else if(I.isSymbolicLink()){let f=A.readlinkSync(D),E;try{E=A.realpathSync(D)}catch{A.symlinkSync(f,B);continue}let M;try{M=A.realpathSync(H)}catch{M=H}let G=M.endsWith(G0.sep)?M:M+G0.sep;if(E.startsWith(G)||E===M){let U=G0.relative(M,E),X=G0.join($,U),J=G0.relative(G0.dirname(B),X);A.symlinkSync(J,B)}else A.symlinkSync(E,B)}}}async function W2$(H,$,A,L,I){let D=zH(),B=Pv($,A);if(D.existsSync(B)&&!D.isDirEmptySync(B))return N(`Plugin ${$} version ${A} already cached at ${B}`),B;if(D.existsSync(B)&&D.isDirEmptySync(B))N(`Removing empty cache directory for ${$} at ${B}`),D.rmdirSync(B);if(D.mkdirSync(G0.dirname(B)),L&&typeof L.source==="string"&&I){let E=pNA(I,L.source);if(D.existsSync(E))N(`Copying source directory ${L.source} for plugin ${$}`),YuH(E,B);else throw Error(`Plugin source directory not found: ${E} (from entry.source: ${L.source})`)}else N(`Copying plugin ${$} to versioned cache (fallback to full copy)`),YuH(H,B);let f=G0.join(B,".git");if(D.existsSync(f))D.rmSync(f,{recursive:!0,force:!0});if(D.isDirEmptySync(B))throw Error(`Failed to copy plugin ${$} to versioned cache: destination is empty after copy`);return N(`Successfully cached plugin ${$} at ${B}`),B}function D81(H){try{let $=new URL(H);if(!["https:","http:","file:"].includes($.protocol)){if(!/^git@[a-zA-Z0-9.-]+:/.test(H))throw Error(`Invalid git URL protocol: ${$.protocol}. Only HTTPS, HTTP, file:// and SSH (git@) URLs are supported.`)}return H}catch{if(/^git@[a-zA-Z0-9.-]+:/.test(H))return H;throw Error(`Invalid git URL: ${H}`)}}async function B81(H,$){let A=zH(),L=G0.join(Dw(),"npm-cache");A.mkdirSync(L);let I=G0.join(L,"node_modules",H);if(!A.existsSync(I)){N(`Installing npm package ${H} to cache`);let B=await jA("npm",["install",H,"--prefix",L],{useCwd:!1});if(B.code!==0)throw Error(`Failed to install npm package: ${B.stderr}`)}YuH(I,$),N(`Copied npm package ${H} from cache to ${$}`)}async function f81(H,$,A,L){let I=["clone","--depth","1","--recurse-submodules","--shallow-submodules"];if(A)I.push("--branch",A);if(L)I.push("--no-checkout");I.push(H,$);let D=await jA(cB(),I);if(D.code!==0)throw Error(`Failed to clone repository: ${D.stderr}`);if(L){if((await pD(cB(),["fetch","--depth","1","origin",L],{cwd:$})).code!==0){N(`Shallow fetch of SHA ${L} failed, falling back to unshallow fetch`);let E=await pD(cB(),["fetch","--unshallow"],{cwd:$});if(E.code!==0)throw Error(`Failed to fetch commit ${L}: ${E.stderr}`)}let f=await pD(cB(),["checkout",L],{cwd:$});if(f.code!==0)throw Error(`Failed to checkout commit ${L}: ${f.stderr}`)}}async function WZD(H,$,A,L){let I=D81(H);await f81(I,$,A,L);let D=A?` (ref: ${A})`:"";N(`Cloned repository from ${I}${D} to ${$}`)}async function E81(H,$,A,L){if(!/^[a-zA-Z0-9-_.]+\/[a-zA-Z0-9-_.]+$/.test(H))throw Error(`Invalid GitHub repository format: ${H}. Expected format: owner/repo`);let I=A$(process.env.CLAUDE_CODE_REMOTE)?`https://github.com/${H}.git`:`git@github.com:${H}.git`;return WZD(I,$,A,L)}async function M81(H,$){let A=zH();if(!A.existsSync(H))throw Error(`Source path does not exist: ${H}`);YuH(H,$);let L=G0.join($,".git");if(A.existsSync(L))A.rmSync(L,{recursive:!0,force:!0})}function G81(H){let $=Date.now(),A=Math.random().toString(36).substring(2,8),L;if(typeof H==="string")L="local";else switch(H.source){case"npm":L="npm";break;case"pip":L="pip";break;case"github":L="github";break;case"url":L="git";break;default:L="unknown"}return`temp_${L}_${$}_${A}`}async function l9H(H,$){let A=zH(),L=Mm();A.mkdirSync(L);let I=G81(H),D=G0.join(L,I),B=!1;try{if(N(`Caching plugin from source: ${yH(H)} to temporary path ${D}`),B=!0,typeof H==="string")await M81(H,D);else switch(H.source){case"npm":await B81(H.package,D);break;case"github":await E81(H.repo,D,H.ref,H.sha);break;case"url":await WZD(H.url,D,H.ref,H.sha);break;case"pip":throw Error("Python package plugins are not yet supported");default:throw Error("Unsupported plugin source type")}}catch(X){if(B&&A.existsSync(D)){N(`Cleaning up failed installation at ${D}`);try{A.rmSync(D,{recursive:!0,force:!0})}catch(J){N(`Failed to clean up installation: ${J}`,{level:"error"})}}throw X}let f=G0.join(D,".claude-plugin","plugin.json"),E=G0.join(D,"plugin.json"),M;if(A.existsSync(f))try{let X=A.readFileSync(f,{encoding:"utf-8"}),J=DA(X),F=S$H.safeParse(J);if(F.success)M=F.data;else{let Q=F.error.issues.map((W)=>`${W.path.join(".")}: ${W.message}`).join(", ");throw N(`Invalid manifest at ${f}: ${Q}`,{level:"error"}),Error(`Plugin has an invalid manifest file at ${f}. Validation errors: ${Q}`)}}catch(X){if(X instanceof Error&&X.message.includes("invalid manifest file"))throw X;let J=X instanceof Error?X.message:String(X);throw N(`Failed to parse manifest at ${f}: ${J}`,{level:"error"}),Error(`Plugin has a corrupt manifest file at ${f}. JSON parse error: ${J}`)}else if(A.existsSync(E))try{let X=A.readFileSync(E,{encoding:"utf-8"}),J=DA(X),F=S$H.safeParse(J);if(F.success)M=F.data;else{let Q=F.error.issues.map((W)=>`${W.path.join(".")}: ${W.message}`).join(", ");throw N(`Invalid legacy manifest at ${E}: ${Q}`,{level:"error"}),Error(`Plugin has an invalid manifest file at ${E}. Validation errors: ${Q}`)}}catch(X){if(X instanceof Error&&X.message.includes("invalid manifest file"))throw X;let J=X instanceof Error?X.message:String(X);throw N(`Failed to parse legacy manifest at ${E}: ${J}`,{level:"error"}),Error(`Plugin has a corrupt manifest file at ${E}. JSON parse error: ${J}`)}else M=$?.manifest||{name:I,description:`Plugin cached from ${typeof H==="string"?H:H.source}`};let G=M.name.replace(/[^a-zA-Z0-9-_]/g,"-"),U=G0.join(L,G);if(A.existsSync(U))N(`Removing old cached version at ${U}`),A.rmSync(U,{recursive:!0,force:!0});return A.renameSync(D,U),N(`Successfully cached plugin ${M.name} to ${U}`),{path:U,manifest:M}}function V2$(H,$,A){let L=zH();if(!L.existsSync(H))return{name:$,description:`Plugin from ${A}`};try{let I=L.readFileSync(H,{encoding:"utf-8"}),D=DA(I),B=S$H.safeParse(D);if(B.success)return B.data;let f=B.error.issues.map((E)=>`${E.path.join(".")}: ${E.message}`).join(", ");throw N(`Plugin ${$} has an invalid manifest file at ${H}. Validation errors: ${f}`,{level:"error"}),Error(`Plugin ${$} has an invalid manifest file at ${H}. Please check the file for syntax errors.`)}}function KZD(H,$){let A=zH();if(!A.existsSync(H))throw Error(`Hooks file not found at ${H} for plugin ${$}. If the manifest declares hooks, the file must exist.`);let L=A.readFileSync(H,{encoding:"utf-8"}),I=DA(L);return Q9L.parse(I).hooks}function VZD(H,$,A,L,I=!0){let D=zH(),B=[],f=G0.join(H,".claude-plugin","plugin.json"),E=V2$(f,L,$),M={name:E.name,manifest:E,path:H,source:$,repository:$,enabled:A},G=G0.join(H,"commands");if(!E.commands&&D.existsSync(G))M.commandsPath=G;if(E.commands){let P=Object.values(E.commands)[0];if(typeof E.commands==="object"&&!Array.isArray(E.commands)&&P&&typeof P==="object"&&(("source"in P)||("content"in P))){let C={},Y=[];for(let[Z,q]of Object.entries(E.commands)){if(!q||typeof q!=="object")continue;if(q.source){let O=G0.join(H,q.source);if(D.existsSync(O))Y.push(O),C[Z]=q;else N(`Command ${Z} path ${q.source} specified in manifest but not found at ${O} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${O} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:O,component:"commands"})}else if(q.content)C[Z]=q}if(Y.length>0)M.commandsPaths=Y;if(Object.keys(C).length>0)M.commandsMetadata=C}else{let C=Array.isArray(E.commands)?E.commands:[E.commands],Y=[];for(let Z of C){if(typeof Z!=="string"){N(`Unexpected command format in manifest for ${E.name}`,{level:"error"});continue}let q=G0.join(H,Z);if(D.existsSync(q))Y.push(q);else N(`Command path ${Z} specified in manifest but not found at ${q} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${q} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:q,component:"commands"})}if(Y.length>0)M.commandsPaths=Y}}let U=G0.join(H,"agents");if(!E.agents&&D.existsSync(U))M.agentsPath=U;if(E.agents){let P=Array.isArray(E.agents)?E.agents:[E.agents],C=[];for(let Y of P){let Z=G0.join(H,Y);if(D.existsSync(Z))C.push(Z);else N(`Agent path ${Y} specified in manifest but not found at ${Z} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Z} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Z,component:"agents"})}if(C.length>0)M.agentsPaths=C}let X=G0.join(H,"skills");if(!E.skills&&D.existsSync(X))M.skillsPath=X;if(E.skills){let P=Array.isArray(E.skills)?E.skills:[E.skills],C=[];for(let Y of P){let Z=G0.join(H,Y);if(D.existsSync(Z))C.push(Z);else N(`Skill path ${Y} specified in manifest but not found at ${Z} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Z} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Z,component:"skills"})}if(C.length>0)M.skillsPaths=C}let J=G0.join(H,"output-styles");if(!E.outputStyles&&D.existsSync(J))M.outputStylesPath=J;if(E.outputStyles){let P=Array.isArray(E.outputStyles)?E.outputStyles:[E.outputStyles],C=[];for(let Y of P){let Z=G0.join(H,Y);if(D.existsSync(Z))C.push(Z);else N(`Output style path ${Y} specified in manifest but not found at ${Z} for ${E.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Z} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Z,component:"output-styles"})}if(C.length>0)M.outputStylesPaths=C}let F,Q=new Set,W=G0.join(H,"hooks","hooks.json");if(D.existsSync(W))try{F=KZD(W,E.name);try{Q.add(D.realpathSync(W))}catch{Q.add(W)}N(`Loaded hooks from standard location for plugin ${E.name}: ${W}`)}catch(P){let C=P instanceof Error?P.message:String(P);N(`Failed to load hooks for ${E.name}: ${C}`,{level:"error"}),r(P instanceof Error?P:Error(C)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:W,reason:C})}if(E.hooks){let P=Array.isArray(E.hooks)?E.hooks:[E.hooks];for(let C of P)if(typeof C==="string"){let Y=G0.join(H,C);if(!D.existsSync(Y)){N(`Hooks file ${C} specified in manifest but not found at ${Y} for ${E.name}`,{level:"error"}),r(Error(`Plugin component file not found: ${Y} for ${E.name}`)),B.push({type:"path-not-found",source:$,plugin:E.name,path:Y,component:"hooks"});continue}let Z;try{Z=D.realpathSync(Y)}catch{Z=Y}if(Q.has(Z)){if(N(`Skipping duplicate hooks file for plugin ${E.name}: ${C} (resolves to already-loaded file: ${Z})`),I){let q=`Duplicate hooks file detected: ${C} resolves to already-loaded file ${Z}. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.`;r(Error(q)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:Y,reason:q})}continue}try{let q=KZD(Y,E.name);try{F=QZD(F,q),Q.add(Z),N(`Loaded and merged hooks from manifest for plugin ${E.name}: ${C}`)}catch(O){let j=O instanceof Error?O.message:String(O);N(`Failed to merge hooks from ${C} for ${E.name}: ${j}`,{level:"error"}),r(O instanceof Error?O:Error(j)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:Y,reason:`Failed to merge: ${j}`})}}catch(q){let O=q instanceof Error?q.message:String(q);N(`Failed to load hooks from ${C} for ${E.name}: ${O}`,{level:"error"}),r(q instanceof Error?q:Error(O)),B.push({type:"hook-load-failed",source:$,plugin:E.name,hookPath:Y,reason:O})}}else if(typeof C==="object")F=QZD(F,C)}if(F)M.hooksConfig=F;return{plugin:M,errors:B}}function QZD(H,$){if(!H)return $;let A={...H};for(let[L,I]of Object.entries($))if(!A[L])A[L]=I;else A[L]=[...A[L]||[],...I];return A}async function U81(){let $=VL().enabledPlugins||{},A=[],L=[],I=Object.entries($).filter(([B,f])=>{return x$H.safeParse(B).success&&f!==void 0}),D=await l1();for(let[B,f]of I)try{let[E,M]=B.split("@"),G=D[M];if(G&&!vDH(G.source)){let J=$RH(G.source),F=yDH()||[];L.push({type:"marketplace-blocked-by-policy",source:B,plugin:E,marketplace:M,blockedByBlocklist:J,allowedSources:J?[]:F.map((Q)=>ZKH(Q))});continue}let U=mNA(B);if(!U){L.push({type:"plugin-not-found",source:B,pluginId:E,marketplace:M});continue}let X=await X81(U.entry,U.marketplaceInstallLocation,B,f===!0,L);if(X)A.push(X)}catch(E){let M=E instanceof Error?E:Error(String(E));r(M),L.push({type:"generic-error",source:B,error:M.message})}return{plugins:A,errors:L}}async function X81(H,$,A,L,I){N(`Loading plugin ${H.name} from source: ${yH(H.source)}`);let D=zH(),B=[],f;if(typeof H.source==="string"){let X=D.statSync($).isDirectory()?$:G0.join($,".."),J=G0.join(X,H.source);if(!D.existsSync(J)){let F=Error(`Plugin path not found: ${J}`);return N(`Plugin path not found: ${J}`,{level:"error"}),r(F),I.push({type:"generic-error",source:A,error:`Plugin directory not found at path: ${J}. Check that the marketplace entry has the correct path.`}),null}try{let F=G0.join(J,".claude-plugin","plugin.json"),Q;try{Q=V2$(F,H.name,H.source)}catch{}let W=await ap(A,H.source,Q,X,H.version);f=await W2$(J,A,W,H,X),N(`Copied local plugin ${H.name} to versioned cache: ${f}`)}catch(F){let Q=F instanceof Error?F.message:String(F);N(`Failed to copy plugin ${H.name} to versioned cache: ${Q}. Using marketplace path.`,{level:"warn"}),f=J}}else try{let X=await ap(A,H.source,void 0,void 0,H.version),J=Pv(A,X);if(D.existsSync(J))N(`Using versioned cached plugin ${H.name} from ${J}`),f=J;else{let F=await l9H(H.source,{manifest:{name:H.name}}),Q=await ap(A,H.source,F.manifest,F.path,H.version);if(f=await W2$(F.path,A,Q,H,void 0),F.path!==f)D.rmSync(F.path,{recursive:!0,force:!0})}}catch(X){let J=X instanceof Error?X.message:String(X);return N(`Failed to cache plugin ${H.name}: ${J}`,{level:"error"}),r(X instanceof Error?X:Error(J)),I.push({type:"generic-error",source:A,error:`Failed to download/cache plugin ${H.name}: ${J}`}),null}let E=G0.join(f,".claude-plugin","plugin.json"),M=D.existsSync(E),{plugin:G,errors:U}=VZD(f,A,L,H.name,H.strict??!0);if(B.push(...U),typeof H.source==="object"&&"sha"in H.source&&H.source.sha)G.sha=H.source.sha;if(!M){if(G.manifest={...H,id:void 0,source:void 0,strict:void 0},G.name=G.manifest.name,H.commands){let X=Object.values(H.commands)[0];if(typeof H.commands==="object"&&!Array.isArray(H.commands)&&X&&typeof X==="object"&&(("source"in X)||("content"in X))){let J={},F=[];for(let[Q,W]of Object.entries(H.commands)){if(!W||typeof W!=="object"||!W.source)continue;let P=G0.join(f,W.source);if(D.existsSync(P))F.push(P),J[Q]=W;else N(`Command ${Q} path ${W.source} from marketplace entry not found at ${P} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${P} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:P,component:"commands"})}if(F.length>0)G.commandsPaths=F,G.commandsMetadata=J}else{let J=Array.isArray(H.commands)?H.commands:[H.commands],F=[];for(let Q of J){if(typeof Q!=="string"){N(`Unexpected command format in marketplace entry for ${H.name}`,{level:"error"});continue}let W=G0.join(f,Q);if(D.existsSync(W))F.push(W);else N(`Command path ${Q} from marketplace entry not found at ${W} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${W} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:W,component:"commands"})}if(F.length>0)G.commandsPaths=F}}if(H.agents){let X=Array.isArray(H.agents)?H.agents:[H.agents],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Agent path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"agents"})}if(J.length>0)G.agentsPaths=J}if(H.skills){N(`Processing ${Array.isArray(H.skills)?H.skills.length:1} skill paths for plugin ${H.name}`);let X=Array.isArray(H.skills)?H.skills:[H.skills],J=[];for(let F of X){let Q=G0.join(f,F);if(N(`Checking skill path: ${F} -> ${Q} (exists: ${D.existsSync(Q)})`),D.existsSync(Q))J.push(Q);else N(`Skill path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"skills"})}if(N(`Found ${J.length} valid skill paths for plugin ${H.name}, setting skillsPaths`),J.length>0)G.skillsPaths=J}else N(`Plugin ${H.name} has no entry.skills defined`);if(H.outputStyles){let X=Array.isArray(H.outputStyles)?H.outputStyles:[H.outputStyles],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Output style path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"output-styles"})}if(J.length>0)G.outputStylesPaths=J}if(H.hooks)G.hooksConfig=H.hooks}else if(!H.strict&&M&&(H.commands||H.agents||H.skills||H.hooks||H.outputStyles)){let X=Error(`Plugin ${H.name} has both plugin.json and marketplace manifest entries for commands/agents/skills/hooks/outputStyles. This is a conflict.`);return N(`Plugin ${H.name} has both plugin.json and marketplace manifest entries for commands/agents/skills/hooks/outputStyles. This is a conflict.`,{level:"error"}),r(X),I.push({type:"generic-error",source:A,error:`Plugin ${H.name} has conflicting manifests: both plugin.json and marketplace entry specify components. Set strict: true in marketplace entry or remove component specs from one location.`}),null}else if(M){if(H.commands){let X=Object.values(H.commands)[0];if(typeof H.commands==="object"&&!Array.isArray(H.commands)&&X&&typeof X==="object"&&(("source"in X)||("content"in X))){let J={...G.commandsMetadata||{}},F=[];for(let[Q,W]of Object.entries(H.commands)){if(!W||typeof W!=="object"||!W.source)continue;let P=G0.join(f,W.source);if(D.existsSync(P))F.push(P),J[Q]=W;else N(`Command ${Q} path ${W.source} from marketplace entry not found at ${P} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${P} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:P,component:"commands"})}if(F.length>0)G.commandsPaths=[...G.commandsPaths||[],...F],G.commandsMetadata=J}else{let J=Array.isArray(H.commands)?H.commands:[H.commands],F=[];for(let Q of J){if(typeof Q!=="string"){N(`Unexpected command format in marketplace entry for ${H.name}`,{level:"error"});continue}let W=G0.join(f,Q);if(D.existsSync(W))F.push(W);else N(`Command path ${Q} from marketplace entry not found at ${W} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${W} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:W,component:"commands"})}if(F.length>0)G.commandsPaths=[...G.commandsPaths||[],...F]}}if(H.agents){let X=Array.isArray(H.agents)?H.agents:[H.agents],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Agent path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"agents"})}if(J.length>0)G.agentsPaths=[...G.agentsPaths||[],...J]}if(H.skills){let X=Array.isArray(H.skills)?H.skills:[H.skills],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Skill path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"skills"})}if(J.length>0)G.skillsPaths=[...G.skillsPaths||[],...J]}if(H.outputStyles){let X=Array.isArray(H.outputStyles)?H.outputStyles:[H.outputStyles],J=[];for(let F of X){let Q=G0.join(f,F);if(D.existsSync(Q))J.push(Q);else N(`Output style path ${F} from marketplace entry not found at ${Q} for ${H.name}`,{level:"warn"}),r(Error(`Plugin component file not found: ${Q} for ${H.name}`)),B.push({type:"path-not-found",source:A,plugin:H.name,path:Q,component:"output-styles"})}if(J.length>0)G.outputStylesPaths=[...G.outputStylesPaths||[],...J]}if(H.hooks)G.hooksConfig={...G.hooksConfig||{},...H.hooks}}return I.push(...B),G}async function J81(H){if(H.length===0)return{plugins:[],errors:[]};let $=[],A=[],L=zH();for(let[I,D]of H.entries())try{let B=G0.resolve(D);if(!L.existsSync(B)){N(`Plugin path does not exist: ${B}, skipping`,{level:"warn"}),A.push({type:"path-not-found",source:`inline[${I}]`,path:B,component:"commands"});continue}let f=G0.basename(B),{plugin:E,errors:M}=VZD(B,`${f}@inline`,!0,f);E.source=`${E.name}@inline`,E.repository=`${E.name}@inline`,$.push(E),A.push(...M),N(`Loaded inline plugin from path: ${E.name}`)}catch(B){let f=B instanceof Error?B.message:String(B);N(`Failed to load session plugin from ${D}: ${f}`,{level:"warn"}),A.push({type:"generic-error",source:`inline[${I}]`,error:`Failed to load plugin: ${f}`})}if($.length>0)N(`Loaded ${$.length} session-only plugins from --plugin-dir`);return{plugins:$,errors:A}}function Sx(){xf.cache?.clear?.()}var G0,xf;var _X=K(()=>{tD();DL();g$();UQ();E$();_$();mL();y4();Ja();B0();NA();ejH();K2$();yE();op();Z$();t8();G0=require("path");xf=o$(async()=>{let H=await U81(),$=[...H.plugins],A=[...H.errors],L=YHH();if(L.length>0){let D=await J81(L);$.push(...D.plugins),A.push(...D.errors)}N(`Found ${$.length} plugins (${$.filter((D)=>D.enabled).length} enabled, ${$.filter((D)=>!D.enabled).length} disabled)`);let I=$.filter((D)=>D.enabled);if(I.length>0)yD("plugins");return{enabled:I,disabled:$.filter((D)=>!D.enabled),errors:A}})});function _ZD(){let H=oA(),$=mh.homedir(),A=[];for(let L of P2$){let I=CuH[L],D;switch(H){case"macos":D=I.macos.dataPath;break;case"linux":case"wsl":D=I.linux.dataPath;break;case"windows":{if(I.windows.dataPath.length>0){let B=I.windows.useRoaming?pw.join($,"AppData","Roaming"):pw.join($,"AppData","Local");A.push({browser:L,path:pw.join(B,...I.windows.dataPath)})}continue}}if(D&&D.length>0)A.push({browser:L,path:pw.join($,...D)})}return A}function YZD(){let H=oA(),$=mh.homedir(),A=[];for(let L of P2$){let I=CuH[L];switch(H){case"macos":if(I.macos.nativeMessagingPath.length>0)A.push({browser:L,path:pw.join($,...I.macos.nativeMessagingPath)});break;case"linux":case"wsl":if(I.linux.nativeMessagingPath.length>0)A.push({browser:L,path:pw.join($,...I.linux.nativeMessagingPath)});break;case"windows":break}}return A}function CZD(){let H=[];for(let $ of P2$){let A=CuH[$];if(A.windows.registryKey)H.push({browser:$,key:A.windows.registryKey})}return H}async function F81(){let H=oA();for(let $ of P2$){let A=CuH[$];switch(H){case"macos":{let L=`/Applications/${A.macos.appName}.app`;try{return await dNA.access(L),N(`[Claude in Chrome] Detected browser: ${A.name}`),$}catch{}break}case"linux":{for(let L of A.linux.binaries)if(await x_(L).catch(()=>null))return N(`[Claude in Chrome] Detected browser: ${A.name}`),$;break}case"windows":{let L=mh.homedir();if(A.windows.dataPath.length>0){let I=A.windows.useRoaming?pw.join(L,"AppData","Roaming"):pw.join(L,"AppData","Local"),D=pw.join(I,...A.windows.dataPath);try{return await dNA.access(D),N(`[Claude in Chrome] Detected browser: ${A.name}`),$}catch{}}break}}}return null}function F3H(H){return E1(H)===dw}function ZZD(H){wZD.add(H)}function qZD(H){return wZD.has(H)}async function _2$(H){let $=oA(),A=await F81();if(!A)return N("[Claude in Chrome] No compatible browser found"),!1;let L=CuH[A];switch($){case"macos":{let{code:I}=await jA("open",["-a",L.macos.appName,H]);return I===0}case"windows":{let{code:I}=await jA("rundll32",["url,OpenURL",H]);return I===0}case"linux":{for(let I of L.linux.binaries){let{code:D}=await jA(I,[H]);if(D===0)return!0}return!1}default:return!1}}function wuH(){return`/tmp/claude-mcp-browser-bridge-${cNA()}`}function Y2$(){if(mh.platform()==="win32")return`\\\\.\\pipe\\${K81()}`;return pw.join(wuH(),`${process.pid}.sock`)}function TZD(){let H=[],$=wuH();try{let D=PZD.readdirSync($);for(let B of D)if(B.endsWith(".sock"))H.push(pw.join($,B))}catch{}let A=`claude-mcp-browser-bridge-${cNA()}`,L=pw.join(mh.tmpdir(),A),I=`/tmp/${A}`;if(!H.includes(L))H.push(L);if(L!==I&&!H.includes(I))H.push(I);return H}function K81(){return`claude-mcp-browser-bridge-${cNA()}`}function cNA(){try{return mh.userInfo().username||"default"}catch{return process.env.USER||process.env.USERNAME||"default"}}var mh,pw,dNA,PZD,dw="claude-in-chrome",CuH,P2$,wZD;var nS=K(()=>{Z9();B0();E$();Zk();mh=require("os"),pw=require("path"),dNA=require("fs/promises"),PZD=require("fs"),CuH={chrome:{name:"Google Chrome",macos:{appName:"Google Chrome",dataPath:["Library","Application Support","Google","Chrome"],nativeMessagingPath:["Library","Application Support","Google","Chrome","NativeMessagingHosts"]},linux:{binaries:["google-chrome","google-chrome-stable"],dataPath:[".config","google-chrome"],nativeMessagingPath:[".config","google-chrome","NativeMessagingHosts"]},windows:{dataPath:["Google","Chrome","User Data"],registryKey:"HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts"}},brave:{name:"Brave",macos:{appName:"Brave Browser",dataPath:["Library","Application Support","BraveSoftware","Brave-Browser"],nativeMessagingPath:["Library","Application Support","BraveSoftware","Brave-Browser","NativeMessagingHosts"]},linux:{binaries:["brave-browser","brave"],dataPath:[".config","BraveSoftware","Brave-Browser"],nativeMessagingPath:[".config","BraveSoftware","Brave-Browser","NativeMessagingHosts"]},windows:{dataPath:["BraveSoftware","Brave-Browser","User Data"],registryKey:"HKCU\\Software\\BraveSoftware\\Brave-Browser\\NativeMessagingHosts"}},arc:{name:"Arc",macos:{appName:"Arc",dataPath:["Library","Application Support","Arc","User Data"],nativeMessagingPath:["Library","Application Support","Arc","User Data","NativeMessagingHosts"]},linux:{binaries:[],dataPath:[],nativeMessagingPath:[]},windows:{dataPath:["Arc","User Data"],registryKey:"HKCU\\Software\\ArcBrowser\\Arc\\NativeMessagingHosts"}},chromium:{name:"Chromium",macos:{appName:"Chromium",dataPath:["Library","Application Support","Chromium"],nativeMessagingPath:["Library","Application Support","Chromium","NativeMessagingHosts"]},linux:{binaries:["chromium","chromium-browser"],dataPath:[".config","chromium"],nativeMessagingPath:[".config","chromium","NativeMessagingHosts"]},windows:{dataPath:["Chromium","User Data"],registryKey:"HKCU\\Software\\Chromium\\NativeMessagingHosts"}},edge:{name:"Microsoft Edge",macos:{appName:"Microsoft Edge",dataPath:["Library","Application Support","Microsoft Edge"],nativeMessagingPath:["Library","Application Support","Microsoft Edge","NativeMessagingHosts"]},linux:{binaries:["microsoft-edge","microsoft-edge-stable"],dataPath:[".config","microsoft-edge"],nativeMessagingPath:[".config","microsoft-edge","NativeMessagingHosts"]},windows:{dataPath:["Microsoft","Edge","User Data"],registryKey:"HKCU\\Software\\Microsoft\\Edge\\NativeMessagingHosts"}},vivaldi:{name:"Vivaldi",macos:{appName:"Vivaldi",dataPath:["Library","Application Support","Vivaldi"],nativeMessagingPath:["Library","Application Support","Vivaldi","NativeMessagingHosts"]},linux:{binaries:["vivaldi","vivaldi-stable"],dataPath:[".config","vivaldi"],nativeMessagingPath:[".config","vivaldi","NativeMessagingHosts"]},windows:{dataPath:["Vivaldi","User Data"],registryKey:"HKCU\\Software\\Vivaldi\\NativeMessagingHosts"}},opera:{name:"Opera",macos:{appName:"Opera",dataPath:["Library","Application Support","com.operasoftware.Opera"],nativeMessagingPath:["Library","Application Support","com.operasoftware.Opera","NativeMessagingHosts"]},linux:{binaries:["opera"],dataPath:[".config","opera"],nativeMessagingPath:[".config","opera","NativeMessagingHosts"]},windows:{dataPath:["Opera Software","Opera Stable"],registryKey:"HKCU\\Software\\Opera Software\\Opera Stable\\NativeMessagingHosts",useRoaming:!0}}},P2$=["chrome","brave","arc","edge","chromium","vivaldi","opera"];wZD=new Set});function zZD(){ZuH.cache.clear?.()}var Q81="tengu_claudeai_mcp_connectors",W81=5000,V81="mcp-servers-2025-12-04",ZuH;var lNA=K(()=>{tD();w1();qE();z$();EI();E$();NA();SD();ZuH=o$(async()=>{try{N("[claudeai-mcp] Checking gate (cached)...");let H=cf(Q81);if(N(`[claudeai-mcp] Gate returned: ${H}`),!H)return N("[claudeai-mcp] Disabled via gate"),c("tengu_claudeai_mcp_eligibility",{state:"disabled_gate"}),{};if(BE(process.env.ENABLE_CLAUDEAI_MCP_SERVERS))return N("[claudeai-mcp] Disabled via env var"),c("tengu_claudeai_mcp_eligibility",{state:"disabled_env_var"}),{};let $=dD();if(!$?.accessToken)return N("[claudeai-mcp] No access token"),c("tengu_claudeai_mcp_eligibility",{state:"no_oauth_token"}),{};if(!$.scopes?.includes("user:mcp_servers"))return N(`[claudeai-mcp] Missing user:mcp_servers scope (scopes=${$.scopes?.join(",")||"none"})`),c("tengu_claudeai_mcp_eligibility",{state:"missing_scope"}),{};let L=`${XD().BASE_API_URL}/v1/mcp_servers?limit=1000`;N(`[claudeai-mcp] Fetching from ${L}`);let I=await nA.get(L,{headers:{Authorization:`Bearer ${$.accessToken}`,"Content-Type":"application/json","anthropic-beta":V81,"anthropic-version":"2023-06-01"},timeout:W81}),D={},B=new Set;for(let f of I.data.data){let E=`claude.ai ${f.display_name}`,M=E,G=E1(M),U=1;while(B.has(G))U++,M=`${E} (${U})`,G=E1(M);B.add(G),D[M]={type:"claudeai-proxy",url:f.url,id:f.id,scope:"claudeai"}}return N(`[claudeai-mcp] Fetched ${Object.keys(D).length} servers`),c("tengu_claudeai_mcp_eligibility",{state:"eligible"}),D}catch{return N("[claudeai-mcp] Fetch failed"),{}}})});function C2$(){return tp.join(v_(),"managed-mcp.json")}function quH(H,$){if(!H)return{};let A={};for(let[L,I]of Object.entries(H))A[L]={...I,scope:$};return A}function NZD(H){let $=tp.join(C$(),".mcp.json");d_($,yH(H,null,2),{encoding:"utf8"})}function OZD(H){if(H.type!==void 0&&H.type!=="stdio")return null;let $=H;return[$.command,...$.args]}function xZD(H,$){if(H.length!==$.length)return!1;return H.every((A,L)=>A===$[L])}function SZD(H){return"url"in H?H.url:null}function P81(H){let A=H.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${A}$`)}function jZD(H,$){return P81($).test(H)}function RZD(H,$){let A=GB();if(!A.deniedMcpServers)return!1;for(let L of A.deniedMcpServers)if(PGH(L)&&L.serverName===H)return!0;if($){let L=OZD($);if(L){for(let D of A.deniedMcpServers)if(lsH(D)&&xZD(D.serverCommand,L))return!0}let I=SZD($);if(I){for(let D of A.deniedMcpServers)if(isH(D)&&jZD(I,D.serverUrl))return!0}}return!1}function iNA(H,$){if(RZD(H,$))return!1;let A=GB();if(!A.allowedMcpServers)return!0;if(A.allowedMcpServers.length===0)return!1;let L=A.allowedMcpServers.some(lsH),I=A.allowedMcpServers.some(isH);if($){let D=OZD($),B=SZD($);if(D)if(L){for(let f of A.allowedMcpServers)if(lsH(f)&&xZD(f.serverCommand,D))return!0;return!1}else{for(let f of A.allowedMcpServers)if(PGH(f)&&f.serverName===H)return!0;return!1}else if(B)if(I){for(let f of A.allowedMcpServers)if(isH(f)&&jZD(B,f.serverUrl))return!0;return!1}else{for(let f of A.allowedMcpServers)if(PGH(f)&&f.serverName===H)return!0;return!1}else{for(let f of A.allowedMcpServers)if(PGH(f)&&f.serverName===H)return!0;return!1}}for(let D of A.allowedMcpServers)if(PGH(D)&&D.serverName===H)return!0;return!1}function _81(H){let $=[];function A(I){let{expanded:D,missingVars:B}=YKH(I);return $.push(...B),D}let L;switch(H.type){case void 0:case"stdio":{let I=H;L={...I,command:A(I.command),args:I.args.map(A),env:I.env?RHH(I.env,A):void 0};break}case"sse":case"http":case"ws":{let I=H;L={...I,url:A(I.url),headers:I.headers?RHH(I.headers,A):void 0};break}case"sse-ide":case"ws-ide":L=H;break;case"sdk":L=H;break;case"claudeai-proxy":L=H;break}return{expanded:L,missingVars:[...new Set($)]}}function mt(H,$,A){if(H.match(/[^a-zA-Z0-9_-]/))throw Error(`Invalid name ${H}. Names can only contain letters, numbers, hyphens, and underscores.`);if(F3H(H))throw Error(`Cannot add MCP server "${H}": this name is reserved.`);if(zuH())throw Error("Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers");let L=zR.safeParse($);if(!L.success){let D=L.error.issues.map((B)=>`${B.path.join(".")}: ${B.message}`).join(", ");throw Error(`Invalid configuration: ${D}`)}let I=L.data;if(RZD(H,I))throw Error(`Cannot add MCP server "${H}": server is explicitly blocked by enterprise policy`);if(!iNA(H,I))throw Error(`Cannot add MCP server "${H}": not allowed by enterprise policy`);switch(A){case"project":{let{servers:D}=nNA();if(D[H])throw Error(`MCP server ${H} already exists in .mcp.json`);break}case"user":{if(M$().mcpServers?.[H])throw Error(`MCP server ${H} already exists in user config`);break}case"local":{if(Mf().mcpServers?.[H])throw Error(`MCP server ${H} already exists in local config`);break}case"dynamic":throw Error("Cannot add MCP server to scope: dynamic");case"enterprise":throw Error("Cannot add MCP server to scope: enterprise");case"claudeai":throw Error("Cannot add MCP server to scope: claudeai")}switch(A){case"project":{let{servers:D}=nNA(),B={};for(let[E,M]of Object.entries(D)){let{scope:G,...U}=M;B[E]=U}B[H]=I;let f={mcpServers:B};try{NZD(f)}catch(E){throw Error(`Failed to write to .mcp.json: ${E}`)}break}case"user":{AA((D)=>({...D,mcpServers:{...D.mcpServers,[H]:I}}));break}case"local":{MM((D)=>({...D,mcpServers:{...D.mcpServers,[H]:I}}));break}default:throw Error(`Cannot add MCP server to scope: ${A}`)}}function rNA(H,$){switch($){case"project":{let{servers:A}=nNA();if(!A[H])throw Error(`No MCP server found with name: ${H} in .mcp.json`);let L={};for(let[D,B]of Object.entries(A))if(D!==H){let{scope:f,...E}=B;L[D]=E}let I={mcpServers:L};try{NZD(I)}catch(D){throw Error(`Failed to remove from .mcp.json: ${D}`)}break}case"user":{if(!M$().mcpServers?.[H])throw Error(`No user-scoped MCP server found with name: ${H}`);AA((L)=>{let{[H]:I,...D}=L.mcpServers??{};return{...L,mcpServers:D}});break}case"local":{if(!Mf().mcpServers?.[H])throw Error(`No project-local MCP server found with name: ${H}`);MM((L)=>{let{[H]:I,...D}=L.mcpServers??{};return{...L,mcpServers:D}});break}default:throw Error(`Cannot remove MCP server from scope: ${$}`)}}function nNA(){if(!HF("projectSettings"))return{servers:{},errors:[]};let H=zH(),$=tp.join(C$(),".mcp.json");if(!H.existsSync($))return{servers:{},errors:[]};let{config:A,errors:L}=K3H({filePath:$,expandVars:!0,scope:"project"});return{servers:A?.mcpServers?quH(A.mcpServers,"project"):{},errors:L||[]}}function OJ(H){let $={project:"projectSettings",user:"userSettings",local:"localSettings"};if(H in $&&!HF($[H]))return{servers:{},errors:[]};switch(H){case"project":{let A=zH(),L={},I=[],D=[],B=C$();while(B!==tp.parse(B).root)D.push(B),B=tp.dirname(B);for(let f of D.reverse()){let E=tp.join(f,".mcp.json");if(!A.existsSync(E))continue;let{config:M,errors:G}=K3H({filePath:E,expandVars:!0,scope:"project"});if(M?.mcpServers)Object.assign(L,quH(M.mcpServers,H));if(G.length>0)I.push(...G)}return{servers:L,errors:I}}case"user":{let A=M$().mcpServers;if(!A)return{servers:{},errors:[]};let{config:L,errors:I}=TuH({configObject:{mcpServers:A},expandVars:!0,scope:"user"});return{servers:quH(L?.mcpServers,H),errors:I}}case"local":{let A=Mf().mcpServers;if(!A)return{servers:{},errors:[]};let{config:L,errors:I}=TuH({configObject:{mcpServers:A},expandVars:!0,scope:"local"});return{servers:quH(L?.mcpServers,H),errors:I}}case"enterprise":{let A=C2$();if(!zH().existsSync(A))return{servers:{},errors:[]};let{config:I,errors:D}=K3H({filePath:A,expandVars:!0,scope:"enterprise"});return{servers:quH(I?.mcpServers,H),errors:D}}}}function Mz(H){let{servers:$}=OJ("enterprise"),{servers:A}=OJ("user"),{servers:L}=OJ("project"),{servers:I}=OJ("local");if($[H])return $[H];if(I[H])return I[H];if(L[H])return L[H];if(A[H])return A[H];return null}async function Q3H(){let{servers:H}=OJ("enterprise");if(zuH()){let G={};for(let[U,X]of Object.entries(H)){if(!iNA(U,X))continue;G[U]=X}return{servers:G,errors:[]}}let{servers:$}=OJ("user"),{servers:A}=OJ("project"),{servers:L}=OJ("local"),I={},D=await xf(),B=[];if(D.errors.length>0)for(let G of D.errors)if(G.type==="mcp-config-invalid"||G.type==="mcpb-download-failed"||G.type==="mcpb-extract-failed"||G.type==="mcpb-invalid-manifest"){let U=`Plugin MCP loading error - ${G.type}: ${UP(G)}`;r(Error(U))}else{let U=G.type;N(`Plugin not available for MCP: ${G.source} - error type: ${U}`)}for(let G of D.enabled){let U=await jjI(G,B);if(U)Object.assign(I,U)}if(B.length>0)for(let G of B){let U=`Plugin MCP server error - ${G.type}: ${UP(G)}`;r(Error(U))}let f={};for(let[G,U]of Object.entries(A))if(w2$(G)==="approved")f[G]=U;let E=Object.assign({},I,$,f,L),M={};for(let[G,U]of Object.entries(E)){if(!iNA(G,U))continue;M[G]=U}return{servers:M,errors:B}}async function ph(){let{servers:H,errors:$}=await Q3H();if(zuH())return{servers:H,errors:$};let A=await ZuH();return{servers:Object.assign({},A,H),errors:$}}function TuH(H){let{configObject:$,expandVars:A,scope:L,filePath:I}=H,D=G9L.safeParse($);if(!D.success)return{config:null,errors:D.error.issues.map((E)=>({...I&&{file:I},path:E.path.join("."),message:"Does not adhere to MCP server configuration schema",mcpErrorMetadata:{scope:L,severity:"fatal"}}))};let B=[],f={};for(let[E,M]of Object.entries(D.data.mcpServers)){let G=M;if(A){let{expanded:U,missingVars:X}=_81(M);if(X.length>0)B.push({...I&&{file:I},path:`mcpServers.${E}`,message:`Missing environment variables: ${X.join(", ")}`,suggestion:`Set the following environment variables: ${X.join(", ")}`,mcpErrorMetadata:{scope:L,serverName:E,severity:"warning"}});G=U}if(oA()==="windows"&&(!G.type||G.type==="stdio")&&(G.command==="npx"||G.command.endsWith("\\npx")||G.command.endsWith("/npx")))B.push({...I&&{file:I},path:`mcpServers.${E}`,message:"Windows requires 'cmd /c' wrapper to execute npx",suggestion:'Change command to "cmd" with args ["/c", "npx", ...]. See: https://code.claude.com/docs/en/mcp#configure-mcp-servers',mcpErrorMetadata:{scope:L,serverName:E,severity:"warning"}});f[E]=G}return{config:{mcpServers:f},errors:B}}function K3H(H){let{filePath:$,expandVars:A,scope:L}=H,I=zH();if(!I.existsSync($))return{config:null,errors:[{file:$,path:"",message:`MCP config file not found: ${$}`,suggestion:"Check that the file path is correct",mcpErrorMetadata:{scope:L,severity:"fatal"}}]};let D;try{D=I.readFileSync($,{encoding:"utf8"})}catch(f){return{config:null,errors:[{file:$,path:"",message:`Failed to read file: ${f}`,suggestion:"Check file permissions and ensure the file exists",mcpErrorMetadata:{scope:L,severity:"fatal"}}]}}let B=q1(D);if(!B)return{config:null,errors:[{file:$,path:"",message:"MCP config is not a valid JSON",suggestion:"Fix the JSON syntax errors in the file",mcpErrorMetadata:{scope:L,severity:"fatal"}}]};return TuH({configObject:B,expandVars:A,scope:L,filePath:$})}function zuH(){let{config:H}=K3H({filePath:C2$(),expandVars:!0,scope:"enterprise"});return H!==null}function yZD(H){return Object.values(H).every(($)=>$.type==="sdk"&&$.name==="claude-vscode")}function NuH(H){return(Mf().disabledMcpServers||[]).includes(H)}function W3H(H,$){MM((A)=>{let L=A.disabledMcpServers||[];if($)L=L.filter((I)=>I!==H);else if(!L.includes(H))L=[...L,H];return{...A,disabledMcpServers:L}})}var tp;var T3=K(()=>{vA();DL();nM();YiH();PI();rD();O$H();kF();Z9();y$H();mL();bk();W4();_$();E$();_X();nS();tJ$();lNA();Z$();tp=require("path")});function dh(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>L.name?.startsWith(A))}function Z2$(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>L.name?.startsWith(A))}function aNA(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>!L.name?.startsWith(A))}function oNA(H,$){let A=`mcp__${E1($)}__`;return H.filter((L)=>!L.name?.startsWith(A))}function tNA(H,$){let A={...H};return delete A[$],A}function hZD(H,$){return eF(H)?.serverName===$}function cw(H){return H.name?.startsWith("mcp__")||H.isMcp===!0}function b3(H){let $=zH();switch(H){case"user":{let A=SW(),L=$.existsSync(A);return`${A}${L?"":" (file does not exist)"}`}case"project":{let A=vZD.join(C$(),".mcp.json"),L=$.existsSync(A);return`${A}${L?"":" (file does not exist)"}`}case"local":return`${SW()} [project: ${C$()}]`;case"dynamic":return"Dynamically configured";case"enterprise":{let A=C2$(),L=$.existsSync(A);return`${A}${L?"":" (file does not exist)"}`}case"claudeai":return"claude.ai";default:return H}}function OuH(H){switch(H){case"local":return"Local config (private to you in this project)";case"project":return"Project config (shared via .mcp.json)";case"user":return"User config (available in all your projects)";case"dynamic":return"Dynamic config (from command line)";case"enterprise":return"Enterprise config (managed by your organization)";case"claudeai":return"claude.ai config";default:return H}}function V3H(H){if(!H)return"local";if(!Wd$.options.includes(H))throw Error(`Invalid scope: ${H}. Must be one of: ${Wd$.options.join(", ")}`);return H}function bZD(H){if(!H)return"stdio";if(H!=="stdio"&&H!=="sse"&&H!=="http")throw Error(`Invalid transport type: ${H}. Must be one of: stdio, sse, http`);return H}function sNA(H){let $={};for(let A of H){let L=A.indexOf(":");if(L===-1)throw Error(`Invalid header format: "${A}". Expected format: "Header-Name: value"`);let I=A.substring(0,L).trim(),D=A.substring(L+1).trim();if(!I)throw Error(`Invalid header: "${A}". Header name cannot be empty.`);$[I]=D}return $}function w2$(H){let $=VL(),A=E1(H);if($?.disabledMcpjsonServers?.some((L)=>E1(L)===A))return"rejected";if($?.enabledMcpjsonServers?.some((L)=>E1(L)===A)||$?.enableAllProjectMcpServers)return"approved";if(M$().bypassPermissionsModeAccepted&&HF("projectSettings"))return"approved";if(tI()&&HF("projectSettings"))return"approved";return"pending"}function eNA(H){if(!cw({name:H}))return null;let $=eF(H);if(!$)return null;let A=Mz($.serverName);if(!A&&$.serverName.startsWith("claude_ai_"))return"claudeai";return A?.scope??null}function Y81(H){return H.type==="stdio"||H.type===void 0}function C81(H){return H.type==="sse"}function w81(H){return H.type==="http"}function Z81(H){return H.type==="ws"}function kZD(H){let $=new Map;for(let L of H){if(!L.mcpServers?.length)continue;for(let I of L.mcpServers){if(typeof I==="string")continue;let D=Object.entries(I);if(D.length!==1)continue;let[B,f]=D[0],E=$.get(B);if(E){if(!E.sourceAgents.includes(L.agentType))E.sourceAgents.push(L.agentType)}else $.set(B,{config:{...f,name:B},sourceAgents:[L.agentType]})}}let A=[];for(let[L,{config:I,sourceAgents:D}]of $)if(Y81(I))A.push({name:L,sourceAgents:D,transport:"stdio",command:I.command,needsAuth:!1});else if(C81(I))A.push({name:L,sourceAgents:D,transport:"sse",url:I.url,needsAuth:!0});else if(w81(I))A.push({name:L,sourceAgents:D,transport:"http",url:I.url,needsAuth:!0});else if(Z81(I))A.push({name:L,sourceAgents:D,transport:"ws",url:I.url,needsAuth:!1});return A.sort((L,I)=>L.name.localeCompare(I.name))}function vX(H){if(!("url"in H)||typeof H.url!=="string")return;try{let $=new URL(H.url);return $.search="",$.toString().replace(/\/$/,"")}catch{return}}var vZD;var kF=K(()=>{mL();O$H();Z1();PI();DL();T3();tC();W4();g$();vA();vZD=require("path")});function uZD(H){let $=H.trim(),A=$.split(/\s+/)[0]?.toLowerCase();if(!A)return;if(A==="npx"||A==="bunx"){let L=$.split(/\s+/)[1]?.toLowerCase();if(L&&L in HOA)return HOA[L]}return HOA[A]}function gZD(H){for(let{pattern:$,tool:A}of q81)if($.test(H))return A;return}var HOA,q81;var $OA=K(()=>{HOA={src:"sourcegraph",cody:"cody",aider:"aider",tabby:"tabby",tabnine:"tabnine",augment:"augment",pieces:"pieces",qodo:"qodo",aide:"aide",hound:"hound",seagoat:"seagoat",bloop:"bloop",gitloop:"gitloop",q:"amazon-q",gemini:"gemini"},q81=[{pattern:/^sourcegraph$/i,tool:"sourcegraph"},{pattern:/^cody$/i,tool:"cody"},{pattern:/^openctx$/i,tool:"openctx"},{pattern:/^aider$/i,tool:"aider"},{pattern:/^continue$/i,tool:"continue"},{pattern:/^github[-_]?copilot$/i,tool:"github-copilot"},{pattern:/^copilot$/i,tool:"github-copilot"},{pattern:/^cursor$/i,tool:"cursor"},{pattern:/^tabby$/i,tool:"tabby"},{pattern:/^codeium$/i,tool:"codeium"},{pattern:/^tabnine$/i,tool:"tabnine"},{pattern:/^augment[-_]?code$/i,tool:"augment"},{pattern:/^augment$/i,tool:"augment"},{pattern:/^windsurf$/i,tool:"windsurf"},{pattern:/^aide$/i,tool:"aide"},{pattern:/^codestory$/i,tool:"aide"},{pattern:/^pieces$/i,tool:"pieces"},{pattern:/^qodo$/i,tool:"qodo"},{pattern:/^amazon[-_]?q$/i,tool:"amazon-q"},{pattern:/^gemini[-_]?code[-_]?assist$/i,tool:"gemini"},{pattern:/^gemini$/i,tool:"gemini"},{pattern:/^hound$/i,tool:"hound"},{pattern:/^seagoat$/i,tool:"seagoat"},{pattern:/^bloop$/i,tool:"bloop"},{pattern:/^gitloop$/i,tool:"gitloop"},{pattern:/^claude[-_]?context$/i,tool:"claude-context"},{pattern:/^code[-_]?index[-_]?mcp$/i,tool:"code-index-mcp"},{pattern:/^code[-_]?index$/i,tool:"code-index-mcp"},{pattern:/^local[-_]?code[-_]?search$/i,tool:"local-code-search"},{pattern:/^codebase$/i,tool:"autodev-codebase"},{pattern:/^autodev[-_]?codebase$/i,tool:"autodev-codebase"},{pattern:/^code[-_]?context$/i,tool:"claude-context"}]});class T2${ws;started=!1;opened;isBun=typeof Bun<"u";constructor(H){this.ws=H;if(this.opened=new Promise(($,A)=>{if(this.ws.readyState===q2$)$();else if(this.isBun){let L=this.ws,I=()=>{L.removeEventListener("open",I),L.removeEventListener("error",D),$()},D=(B)=>{L.removeEventListener("open",I),L.removeEventListener("error",D),EL("error","mcp_websocket_connect_fail"),A(B)};L.addEventListener("open",I),L.addEventListener("error",D)}else{let L=this.ws;L.on("open",()=>{$()}),L.on("error",(I)=>{EL("error","mcp_websocket_connect_fail"),A(I)})}}),this.isBun){let $=this.ws;$.addEventListener("message",this.onBunMessage),$.addEventListener("error",this.onBunError),$.addEventListener("close",this.onBunClose)}else{let $=this.ws;$.on("message",this.onNodeMessage),$.on("error",this.onNodeError),$.on("close",this.onNodeClose)}}onclose;onerror;onmessage;onBunMessage=(H)=>{try{let $=typeof H.data==="string"?H.data:String(H.data),A=DA($),L=Mx.parse(A);this.onmessage?.(L)}catch($){this.handleError($)}};onBunError=()=>{this.handleError(Error("WebSocket error"))};onBunClose=()=>{this.handleCloseCleanup()};onNodeMessage=(H)=>{try{let $=DA(H.toString("utf-8")),A=Mx.parse($);this.onmessage?.(A)}catch($){this.handleError($)}};onNodeError=(H)=>{this.handleError(H)};onNodeClose=()=>{this.handleCloseCleanup()};handleError(H){EL("error","mcp_websocket_message_fail"),this.onerror?.(H instanceof Error?H:Error("Failed to process message"))}handleCloseCleanup(){if(this.onclose?.(),this.isBun){let H=this.ws;H.removeEventListener("message",this.onBunMessage),H.removeEventListener("error",this.onBunError),H.removeEventListener("close",this.onBunClose)}else{let H=this.ws;H.off("message",this.onNodeMessage),H.off("error",this.onNodeError),H.off("close",this.onNodeClose)}}async start(){if(this.started)throw Error("Start can only be called once per transport.");if(await this.opened,this.ws.readyState!==q2$)throw EL("error","mcp_websocket_start_not_opened"),Error("WebSocket is not open. Cannot start transport.");this.started=!0}async close(){if(this.ws.readyState===q2$||this.ws.readyState===T81)this.ws.close();this.handleCloseCleanup()}async send(H){if(this.ws.readyState!==q2$)throw EL("error","mcp_websocket_send_not_opened"),Error("WebSocket is not open. Cannot send message.");let $=yH(H);try{if(this.isBun)this.ws.send($);else await new Promise((A,L)=>{this.ws.send($,(I)=>{if(I)L(I);else A()})})}catch(A){throw this.handleError(A),A}}}var T81=0,q2$=1;var mZD=K(()=>{CK();Z6();Z$()});var pZD="",dZD="";function SuH({ratio:H,width:$,fillColor:A,emptyColor:L}){let I=Math.min(1,Math.max(0,H)),D=Math.floor(I*$),B=[xuH[xuH.length-1].repeat(D)];if(D<$){let f=I*$-D,E=Math.floor(f*xuH.length);B.push(xuH[E]);let M=$-D-1;if(M>0)B.push(xuH[0].repeat(M))}return cZD.default.createElement(V,{color:A,backgroundColor:L},B.join(""))}var cZD,xuH;var AOA=K(()=>{xH();cZD=b(s(),1),xuH=[" ","\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u2588"]});function lZD(H){if(Object.keys(H).length===0)return"";return Object.entries(H).map(([$,A])=>`${$}: ${yH(A)}`).join(", ")}function iZD(){return U0.createElement(L8,null)}function nZD(H,{verbose:$}){return U0.createElement(s9,{result:H,verbose:$})}function rZD(H){let $=H.at(-1);if(!$?.data)return U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},"Running\u2026"));let{progress:A,total:L,progressMessage:I}=$.data;if(A===void 0)return U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},"Running\u2026"));if(L!==void 0&&L>0){let D=Math.min(1,Math.max(0,A/L)),B=Math.round(D*100);return U0.createElement(HA,null,U0.createElement(x,{flexDirection:"column"},I&&U0.createElement(V,{dimColor:!0},I),U0.createElement(x,{flexDirection:"row",gap:1},U0.createElement(SuH,{ratio:D,width:20}),U0.createElement(V,{dimColor:!0},B,"%"))))}return U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},I??`Processing\u2026 ${A}`))}function z2$(H,$,{verbose:A}){let L=H,I=xKA(L),B=I>z81?`${pH.warning} Large MCP response (~${a0(I)} tokens), this can fill up context quickly`:null,f;if(Array.isArray(L)){let E=L.map((M,G)=>{if(M.type==="image")return U0.createElement(x,{key:G,justifyContent:"space-between",overflowX:"hidden",width:"100%"},U0.createElement(HA,{height:1},U0.createElement(V,null,"[Image]")));let U=M.type==="text"&&"text"in M&&M.text!==null&&M.text!==void 0?String(M.text):"";return U0.createElement(Dv,{key:G,content:U,verbose:A})});f=U0.createElement(x,{flexDirection:"column",width:"100%"},E)}else if(!L)f=U0.createElement(x,{justifyContent:"space-between",overflowX:"hidden",width:"100%"},U0.createElement(HA,{height:1},U0.createElement(V,{dimColor:!0},"(No content)")));else f=U0.createElement(Dv,{content:L,verbose:A});if(B)return U0.createElement(x,{flexDirection:"column"},U0.createElement(HA,{height:1},U0.createElement(V,{color:"warning"},B)),f);return f}var U0,z81=1e4;var LOA=K(()=>{xH();_F();j5();OFH();iB();Q9();jI();vX$();Z$();AOA();U0=b(s(),1)});var N81,O81,aZD;var oZD=K(()=>{mI();LOA();N81=S.object({}).passthrough(),O81=S.string().describe("MCP tool execution result"),aZD={isMcp:!0,isEnabled(){return!0},isConcurrencySafe(){return!1},isReadOnly(){return!1},isDestructive(){return!1},isOpenWorld(){return!1},name:"mcp",maxResultSizeChars:1e5,async description(){return dZD},async prompt(){return pZD},inputSchema:N81,outputSchema:O81,async call(){return{data:""}},async checkPermissions(){return{behavior:"passthrough",message:"MCPTool requires permission."}},renderToolUseMessage:lZD,userFacingName:()=>"mcp",renderToolUseRejectedMessage:iZD,renderToolUseErrorMessage:nZD,renderToolUseProgressMessage:rZD,renderToolResultMessage:z2$,mapToolResultToToolResultBlockParam(H,$){return{tool_use_id:$,type:"tool_result",content:H}}}});var IOA=z((P3H)=>{function tZD(){var H={};return H["align-content"]=!1,H["align-items"]=!1,H["align-self"]=!1,H["alignment-adjust"]=!1,H["alignment-baseline"]=!1,H.all=!1,H["anchor-point"]=!1,H.animation=!1,H["animation-delay"]=!1,H["animation-direction"]=!1,H["animation-duration"]=!1,H["animation-fill-mode"]=!1,H["animation-iteration-count"]=!1,H["animation-name"]=!1,H["animation-play-state"]=!1,H["animation-timing-function"]=!1,H.azimuth=!1,H["backface-visibility"]=!1,H.background=!0,H["background-attachment"]=!0,H["background-clip"]=!0,H["background-color"]=!0,H["background-image"]=!0,H["background-origin"]=!0,H["background-position"]=!0,H["background-repeat"]=!0,H["background-size"]=!0,H["baseline-shift"]=!1,H.binding=!1,H.bleed=!1,H["bookmark-label"]=!1,H["bookmark-level"]=!1,H["bookmark-state"]=!1,H.border=!0,H["border-bottom"]=!0,H["border-bottom-color"]=!0,H["border-bottom-left-radius"]=!0,H["border-bottom-right-radius"]=!0,H["border-bottom-style"]=!0,H["border-bottom-width"]=!0,H["border-collapse"]=!0,H["border-color"]=!0,H["border-image"]=!0,H["border-image-outset"]=!0,H["border-image-repeat"]=!0,H["border-image-slice"]=!0,H["border-image-source"]=!0,H["border-image-width"]=!0,H["border-left"]=!0,H["border-left-color"]=!0,H["border-left-style"]=!0,H["border-left-width"]=!0,H["border-radius"]=!0,H["border-right"]=!0,H["border-right-color"]=!0,H["border-right-style"]=!0,H["border-right-width"]=!0,H["border-spacing"]=!0,H["border-style"]=!0,H["border-top"]=!0,H["border-top-color"]=!0,H["border-top-left-radius"]=!0,H["border-top-right-radius"]=!0,H["border-top-style"]=!0,H["border-top-width"]=!0,H["border-width"]=!0,H.bottom=!1,H["box-decoration-break"]=!0,H["box-shadow"]=!0,H["box-sizing"]=!0,H["box-snap"]=!0,H["box-suppress"]=!0,H["break-after"]=!0,H["break-before"]=!0,H["break-inside"]=!0,H["caption-side"]=!1,H.chains=!1,H.clear=!0,H.clip=!1,H["clip-path"]=!1,H["clip-rule"]=!1,H.color=!0,H["color-interpolation-filters"]=!0,H["column-count"]=!1,H["column-fill"]=!1,H["column-gap"]=!1,H["column-rule"]=!1,H["column-rule-color"]=!1,H["column-rule-style"]=!1,H["column-rule-width"]=!1,H["column-span"]=!1,H["column-width"]=!1,H.columns=!1,H.contain=!1,H.content=!1,H["counter-increment"]=!1,H["counter-reset"]=!1,H["counter-set"]=!1,H.crop=!1,H.cue=!1,H["cue-after"]=!1,H["cue-before"]=!1,H.cursor=!1,H.direction=!1,H.display=!0,H["display-inside"]=!0,H["display-list"]=!0,H["display-outside"]=!0,H["dominant-baseline"]=!1,H.elevation=!1,H["empty-cells"]=!1,H.filter=!1,H.flex=!1,H["flex-basis"]=!1,H["flex-direction"]=!1,H["flex-flow"]=!1,H["flex-grow"]=!1,H["flex-shrink"]=!1,H["flex-wrap"]=!1,H.float=!1,H["float-offset"]=!1,H["flood-color"]=!1,H["flood-opacity"]=!1,H["flow-from"]=!1,H["flow-into"]=!1,H.font=!0,H["font-family"]=!0,H["font-feature-settings"]=!0,H["font-kerning"]=!0,H["font-language-override"]=!0,H["font-size"]=!0,H["font-size-adjust"]=!0,H["font-stretch"]=!0,H["font-style"]=!0,H["font-synthesis"]=!0,H["font-variant"]=!0,H["font-variant-alternates"]=!0,H["font-variant-caps"]=!0,H["font-variant-east-asian"]=!0,H["font-variant-ligatures"]=!0,H["font-variant-numeric"]=!0,H["font-variant-position"]=!0,H["font-weight"]=!0,H.grid=!1,H["grid-area"]=!1,H["grid-auto-columns"]=!1,H["grid-auto-flow"]=!1,H["grid-auto-rows"]=!1,H["grid-column"]=!1,H["grid-column-end"]=!1,H["grid-column-start"]=!1,H["grid-row"]=!1,H["grid-row-end"]=!1,H["grid-row-start"]=!1,H["grid-template"]=!1,H["grid-template-areas"]=!1,H["grid-template-columns"]=!1,H["grid-template-rows"]=!1,H["hanging-punctuation"]=!1,H.height=!0,H.hyphens=!1,H.icon=!1,H["image-orientation"]=!1,H["image-resolution"]=!1,H["ime-mode"]=!1,H["initial-letters"]=!1,H["inline-box-align"]=!1,H["justify-content"]=!1,H["justify-items"]=!1,H["justify-self"]=!1,H.left=!1,H["letter-spacing"]=!0,H["lighting-color"]=!0,H["line-box-contain"]=!1,H["line-break"]=!1,H["line-grid"]=!1,H["line-height"]=!1,H["line-snap"]=!1,H["line-stacking"]=!1,H["line-stacking-ruby"]=!1,H["line-stacking-shift"]=!1,H["line-stacking-strategy"]=!1,H["list-style"]=!0,H["list-style-image"]=!0,H["list-style-position"]=!0,H["list-style-type"]=!0,H.margin=!0,H["margin-bottom"]=!0,H["margin-left"]=!0,H["margin-right"]=!0,H["margin-top"]=!0,H["marker-offset"]=!1,H["marker-side"]=!1,H.marks=!1,H.mask=!1,H["mask-box"]=!1,H["mask-box-outset"]=!1,H["mask-box-repeat"]=!1,H["mask-box-slice"]=!1,H["mask-box-source"]=!1,H["mask-box-width"]=!1,H["mask-clip"]=!1,H["mask-image"]=!1,H["mask-origin"]=!1,H["mask-position"]=!1,H["mask-repeat"]=!1,H["mask-size"]=!1,H["mask-source-type"]=!1,H["mask-type"]=!1,H["max-height"]=!0,H["max-lines"]=!1,H["max-width"]=!0,H["min-height"]=!0,H["min-width"]=!0,H["move-to"]=!1,H["nav-down"]=!1,H["nav-index"]=!1,H["nav-left"]=!1,H["nav-right"]=!1,H["nav-up"]=!1,H["object-fit"]=!1,H["object-position"]=!1,H.opacity=!1,H.order=!1,H.orphans=!1,H.outline=!1,H["outline-color"]=!1,H["outline-offset"]=!1,H["outline-style"]=!1,H["outline-width"]=!1,H.overflow=!1,H["overflow-wrap"]=!1,H["overflow-x"]=!1,H["overflow-y"]=!1,H.padding=!0,H["padding-bottom"]=!0,H["padding-left"]=!0,H["padding-right"]=!0,H["padding-top"]=!0,H.page=!1,H["page-break-after"]=!1,H["page-break-before"]=!1,H["page-break-inside"]=!1,H["page-policy"]=!1,H.pause=!1,H["pause-after"]=!1,H["pause-before"]=!1,H.perspective=!1,H["perspective-origin"]=!1,H.pitch=!1,H["pitch-range"]=!1,H["play-during"]=!1,H.position=!1,H["presentation-level"]=!1,H.quotes=!1,H["region-fragment"]=!1,H.resize=!1,H.rest=!1,H["rest-after"]=!1,H["rest-before"]=!1,H.richness=!1,H.right=!1,H.rotation=!1,H["rotation-point"]=!1,H["ruby-align"]=!1,H["ruby-merge"]=!1,H["ruby-position"]=!1,H["shape-image-threshold"]=!1,H["shape-outside"]=!1,H["shape-margin"]=!1,H.size=!1,H.speak=!1,H["speak-as"]=!1,H["speak-header"]=!1,H["speak-numeral"]=!1,H["speak-punctuation"]=!1,H["speech-rate"]=!1,H.stress=!1,H["string-set"]=!1,H["tab-size"]=!1,H["table-layout"]=!1,H["text-align"]=!0,H["text-align-last"]=!0,H["text-combine-upright"]=!0,H["text-decoration"]=!0,H["text-decoration-color"]=!0,H["text-decoration-line"]=!0,H["text-decoration-skip"]=!0,H["text-decoration-style"]=!0,H["text-emphasis"]=!0,H["text-emphasis-color"]=!0,H["text-emphasis-position"]=!0,H["text-emphasis-style"]=!0,H["text-height"]=!0,H["text-indent"]=!0,H["text-justify"]=!0,H["text-orientation"]=!0,H["text-overflow"]=!0,H["text-shadow"]=!0,H["text-space-collapse"]=!0,H["text-transform"]=!0,H["text-underline-position"]=!0,H["text-wrap"]=!0,H.top=!1,H.transform=!1,H["transform-origin"]=!1,H["transform-style"]=!1,H.transition=!1,H["transition-delay"]=!1,H["transition-duration"]=!1,H["transition-property"]=!1,H["transition-timing-function"]=!1,H["unicode-bidi"]=!1,H["vertical-align"]=!1,H.visibility=!1,H["voice-balance"]=!1,H["voice-duration"]=!1,H["voice-family"]=!1,H["voice-pitch"]=!1,H["voice-range"]=!1,H["voice-rate"]=!1,H["voice-stress"]=!1,H["voice-volume"]=!1,H.volume=!1,H["white-space"]=!1,H.widows=!1,H.width=!0,H["will-change"]=!1,H["word-break"]=!0,H["word-spacing"]=!0,H["word-wrap"]=!0,H["wrap-flow"]=!1,H["wrap-through"]=!1,H["writing-mode"]=!1,H["z-index"]=!1,H}function x81(H,$,A){}function S81(H,$,A){}var j81=/javascript\s*\:/img;function R81(H,$){if(j81.test($))return"";return $}P3H.whiteList=tZD();P3H.getDefaultWhiteList=tZD;P3H.onAttr=x81;P3H.onIgnoreAttr=S81;P3H.safeAttrValue=R81});var DOA=z((QEM,sZD)=>{sZD.exports={indexOf:function(H,$){var A,L;if(Array.prototype.indexOf)return H.indexOf($);for(A=0,L=H.length;A{var juH=DOA();function y81(H,$){if(H=juH.trimRight(H),H[H.length-1]!==";")H+=";";var A=H.length,L=!1,I=0,D=0,B="";function f(){if(!L){var G=juH.trim(H.slice(I,D)),U=G.indexOf(":");if(U!==-1){var X=juH.trim(G.slice(0,U)),J=juH.trim(G.slice(U+1));if(X){var F=$(I,B.length,X,J,G);if(F)B+=F+"; "}}}I=D+1}for(;D{KeH();z$();JX$();ljH();GKA();F3();w1();_$();kF();Z9();Z$();k2$=require("http"),jqD=require("url"),GOA=b(OqD(),1),u2$=require("crypto"),Pf1=["state","nonce","code_challenge","code_verifier","code"];Y3H=class Y3H extends Error{constructor(){super("Authentication was cancelled");this.name="AuthenticationCancelledError"}};Yf1=oA()==="windows"?{min:39152,max:49151}:{min:49152,max:65535}});function Zf1(H){return H.scope==="project"||H.scope==="local"}async function qf1(H,$){if(!$.headersHelper)return null;if("scope"in $&&Zf1($)&&!tI()){if(!XG(!0)){let L=Error(`Security: headersHelper for MCP server '${H}' executed before workspace trust is confirmed. If you see this message, post in ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.FEEDBACK_CHANNEL}.`);return pZ("MCP headersHelper invoked before trust check",L),c("tengu_mcp_headersHelper_missing_trust",{}),null}}try{TA(H,"Executing headersHelper to get dynamic headers");let A=await pD($.headersHelper,[],{shell:!0,timeout:1e4});if(A.code!==0||!A.stdout)throw Error(`headersHelper for MCP server '${H}' did not return a valid value`);let L=A.stdout.trim(),I=DA(L);if(typeof I!=="object"||I===null||Array.isArray(I))throw Error(`headersHelper for MCP server '${H}' must return a JSON object with string key-value pairs`);for(let[D,B]of Object.entries(I))if(typeof B!=="string")throw Error(`headersHelper for MCP server '${H}' returned non-string value for key "${D}": ${typeof B}`);return TA(H,`Successfully retrieved ${Object.keys(I).length} headers from headersHelper`),I}catch(A){return ME(H,`Error getting headers from headersHelper: ${A instanceof Error?A.message:String(A)}`),r(Error(`Error getting MCP headers from headersHelper for server '${H}': ${A instanceof Error?A.message:String(A)}`)),null}}async function p2$(H,$){let A=$.headers||{},L=await qf1(H,$)||{};return{...A,...L}}var vqD=K(()=>{B0();vA();_$();E$();z$();g$();Z$()});class KOA{serverName;sendMcpMessage;isClosed=!1;onclose;onerror;onmessage;constructor(H,$){this.serverName=H;this.sendMcpMessage=$}async start(){}async send(H){if(this.isClosed)throw Error("Transport is closed");let $=await this.sendMcpMessage(this.serverName,H);if(this.onmessage)this.onmessage($)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function zf1(H,$,A){let L=H.tabId;if(typeof L==="number")ZZD(L);let I=[];switch($){case"navigate":if(typeof H.url==="string")try{let D=new URL(H.url);I.push(D.hostname)}catch{I.push(vuH(H.url,30))}break;case"find":if(typeof H.query==="string")I.push(`pattern: ${vuH(H.query,30)}`);break;case"computer":if(typeof H.action==="string"){let D=H.action;if(D==="left_click"||D==="right_click"||D==="double_click"||D==="middle_click")if(typeof H.ref==="string")I.push(`${D} on ${H.ref}`);else if(Array.isArray(H.coordinate))I.push(`${D} at (${H.coordinate.join(", ")})`);else I.push(D);else if(D==="type"&&typeof H.text==="string")I.push(`type "${vuH(H.text,15)}"`);else if(D==="key"&&typeof H.text==="string")I.push(`key ${H.text}`);else if(D==="scroll"&&typeof H.scroll_direction==="string")I.push(`scroll ${H.scroll_direction}`);else if(D==="wait"&&typeof H.duration==="number")I.push(`wait ${H.duration}s`);else if(D==="left_click_drag")I.push("drag");else I.push(D)}break;case"gif_creator":if(typeof H.action==="string")I.push(`${H.action}`);break;case"resize_window":if(typeof H.width==="number"&&typeof H.height==="number")I.push(`${H.width}x${H.height}`);break;case"read_console_messages":if(typeof H.pattern==="string")I.push(`pattern: ${vuH(H.pattern,20)}`);if(H.onlyErrors===!0)I.push("errors only");break;case"read_network_requests":if(typeof H.urlPattern==="string")I.push(`pattern: ${vuH(H.urlPattern,20)}`);break;case"shortcuts_execute":if(typeof H.shortcutId==="string")I.push(`shortcut_id: ${H.shortcutId}`);break;case"javascript_tool":if(A&&typeof H.text==="string")return H.text;return"";case"tabs_create_mcp":case"tabs_context_mcp":case"form_input":case"shortcuts_list":case"read_page":case"upload_image":case"get_page_text":case"update_plan":return""}return I.join(", ")||null}function Nf1(H){if(!e2())return null;if(typeof H!=="object"||H===null||!("tabId"in H))return null;let $=typeof H.tabId==="number"?H.tabId:typeof H.tabId==="string"?parseInt(H.tabId,10):NaN;if(isNaN($))return null;let A=`${Tf1}${$}`;return rS.createElement(V,null," ",rS.createElement(dI,{url:A},rS.createElement(V,{color:"subtle"},"[View Tab]")))}function Of1(H,$,A){if(A)return z2$(H,[],{verbose:A});let L=null;switch($){case"navigate":L="Navigation completed";break;case"tabs_create_mcp":L="Tab created";break;case"tabs_context_mcp":L="Tabs read";break;case"form_input":L="Input completed";break;case"computer":L="Action completed";break;case"resize_window":L="Window resized";break;case"find":L="Search completed";break;case"gif_creator":L="GIF action completed";break;case"read_console_messages":L="Console messages retrieved";break;case"read_network_requests":L="Network requests retrieved";break;case"shortcuts_list":L="Shortcuts retrieved";break;case"shortcuts_execute":L="Shortcut executed";break;case"javascript_tool":L="Script executed";break;case"read_page":L="Page read";break;case"upload_image":L="Image uploaded";break;case"get_page_text":L="Page text retrieved";break;case"update_plan":L="Plan updated";break}if(L)return rS.createElement(HA,{height:1},rS.createElement(V,{dimColor:!0},L));return null}function hqD(H){return{userFacingName($){return`Claude in Chrome[${H.replace(/_mcp$/,"")}]`},renderToolUseMessage($,{verbose:A}){return zf1($,H,A)},renderToolUseTag($){return Nf1($)},renderToolResultMessage($,A,{verbose:L}){if(!xf1($))return null;return Of1($,H,L)}}}function vuH(H,$){return H.length>$?H.slice(0,$)+"\u2026":H}function xf1(H){return typeof H==="object"&&H!==null}var rS,Tf1="https://clau.de/chrome/tab/";var bqD=K(()=>{xH();iB();jr();LOA();nS();rS=b(s(),1)});async function kqD(H,$){return new(await import("ws")).default(H,["mcp"],$)}function d2$(){return parseInt(process.env.MCP_TIMEOUT||"",10)||30000}function QOA(H){return async($,A)=>{if((A?.method??"GET").toUpperCase()==="GET")return H($,A);let I=AbortSignal.timeout(mqD);if(!A?.signal)return H($,{...A,signal:I});let D=new AbortController,B=()=>D.abort();A.signal.addEventListener("abort",B),I.addEventListener("abort",B);let f=()=>{A.signal?.removeEventListener("abort",B),I.removeEventListener("abort",B)};if(A.signal.aborted)D.abort();try{let E=await H($,{...A,signal:D.signal});return f(),E}catch(E){throw f(),E}}}function VOA(){return parseInt(process.env.MCP_SERVER_CONNECTION_BATCH_SIZE||"",10)||3}function jf1(){return parseInt(process.env.MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE||"",10)||20}function uqD(H){return!H.type||H.type==="stdio"||H.type==="sdk"}function yf1(H){return!H.name.startsWith("mcp__ide__")||Rf1.includes(H.name)}function WOA(H,$){return`${H}-${yH($)}`}async function lh(H,$){let A=WOA(H,$);try{let L=await Gz(H,$);if(L.type==="connected")await L.cleanup()}catch{}Gz.cache.delete(A)}async function A3H(H){if(H.config.type==="sdk")return H;let $=await Gz(H.name,H.config);if($.type!=="connected")throw new nZ(`MCP server "${H.name}" is not connected`,"MCP server not connected");return $}function pqD(H,$){if(H.type!==$.type)return!1;let{scope:A,...L}=H,{scope:I,...D}=$;return yH(L)===yH(D)}async function Vx(H,$,A){return(await cqD({client:A,tool:H,args:$,signal:nD().signal})).content}async function ih(H,$){try{await lh(H,$);let A=await Gz(H,$);if(A.type!=="connected")return{client:A,tools:[],commands:[]};let L=!!A.capabilities?.resources,[I,D,B]=await Promise.all([zS(A),buH(A),L?huH(A):Promise.resolve([])]),f=[];if(L){if(![dp,cp].some((M)=>I.some((G)=>G.name===M.name)))f.push(dp,cp)}return{client:A,tools:[...I,...f],commands:D,resources:B.length>0?B:void 0}}catch(A){return ME(H,`Error during reconnection: ${A instanceof Error?A.message:String(A)}`),{client:{name:H,type:"failed",config:$},tools:[],commands:[]}}}async function gqD(H,$,A){for(let L=0;LQ.type==="stdio").length,B=L.filter(([F,Q])=>Q.type==="sse").length,f=L.filter(([F,Q])=>Q.type==="http").length,E=L.filter(([F,Q])=>Q.type==="sse-ide").length,M=L.filter(([F,Q])=>Q.type==="ws-ide").length,G=L.filter(([F,Q])=>uqD(Q)),U=L.filter(([F,Q])=>!uqD(Q)),X={totalServers:I,stdioCount:D,sseCount:B,httpCount:f,sseIdeCount:E,wsIdeCount:M},J=async([F,Q])=>{try{if(NuH(F)){H({client:{name:F,type:"disabled",config:Q},tools:[],commands:[]});return}let W=await Gz(F,Q,X);if(W.type!=="connected"){H({client:W,tools:[],commands:[]});return}let P=!!W.capabilities?.resources,[C,Y,Z]=await Promise.all([zS(W),buH(W),P?huH(W):Promise.resolve([])]),q=[];if(P&&!A)A=!0,q.push(dp,cp);H({client:W,tools:[...C,...q],commands:Y,resources:Z.length>0?Z:void 0})}catch(W){ME(F,`Error fetching tools/commands/resources: ${W instanceof Error?W.message:String(W)}`),H({client:{name:F,type:"failed",config:Q},tools:[],commands:[]})}};await Promise.all([gqD(G,VOA(),J),gqD(U,jf1(),J)])}async function dqD(H,$){switch(H.type){case"text":return[{type:"text",text:H.text}];case"image":{let A=Buffer.from(String(H.data),"base64"),L=await $DH(A,void 0,H.mimeType);return[{type:"image",source:{data:L.base64,media_type:L.mediaType,type:"base64"}}]}case"resource":{let A=H.resource,L=`[Resource from ${$} at ${A.uri}] `;if("text"in A)return[{type:"text",text:`${L}${A.text}`}];else if("blob"in A)if(Sf1.has(A.mimeType??"")){let D=Buffer.from(A.blob,"base64"),B=await $DH(D,void 0,A.mimeType),f=[];if(L)f.push({type:"text",text:L});return f.push({type:"image",source:{data:B.base64,media_type:B.mediaType,type:"base64"}}),f}else return[{type:"text",text:`${L}Base64 data (${A.mimeType||"unknown type"}) ${A.blob}`}];return[]}case"resource_link":{let A=H,L=`[Resource link: ${A.name}] ${A.uri}`;if(A.description)L+=` (${A.description})`;return[{type:"text",text:L}]}default:return[]}}function c2$(H,$=2){if(H===null)return"null";if(Array.isArray(H)){if(H.length===0)return"[]";return`[${c2$(H[0],$-1)}]`}if(typeof H==="object"){if($<=0)return"{...}";let L=Object.entries(H).slice(0,10).map(([D,B])=>`${D}: ${c2$(B,$-1)}`),I=Object.keys(H).length>10?", ...":"";return`{${L.join(", ")}${I}}`}return typeof H}async function POA(H,$,A){if(H&&typeof H==="object"){if("toolResult"in H)return{content:String(H.toolResult),type:"toolResult"};if("structuredContent"in H&&H.structuredContent!==void 0)return{content:yH(H.structuredContent),type:"structuredContent",schema:c2$(H.structuredContent)};if("content"in H&&Array.isArray(H.content)){let I=(await Promise.all(H.content.map((D)=>dqD(D,A)))).flat();return{content:I,type:"contentArray",schema:c2$(I)}}}let L=`MCP server "${A}" tool "${$}": unexpected response format`;throw ME(A,L),new nZ(L,"MCP tool unexpected response format")}function vf1(H){if(!H||typeof H==="string")return!1;return H.some(($)=>$.type==="image")}async function hf1(H,$,A){let{content:L,type:I,schema:D}=await POA(H,$,A);if(A==="ide")return L;if(!await ojH(L))return L;if(BE(process.env.ENABLE_MCP_LARGE_OUTPUT_FILES))return await SKA(L);if(!L)return L;if(vf1(L))return await SKA(L);let B=Date.now(),f=`mcp-${E1(A)}-${E1($)}-${B}`,E=typeof L==="string"?L:yH(L,null,2),M=await jDH(E,f);if(RDH(M))return`Error: result (${E.length.toLocaleString()} characters) exceeds maximum allowed tokens. Failed to save output to file: ${M.error}. If this MCP server provides pagination or filtering tools, use them to retrieve specific portions of the data.`;let G=hX$(I,D);return bX$(M.filepath,M.originalSize,G)}async function cqD({client:{client:H,name:$},tool:A,args:L,meta:I,signal:D,onProgress:B}){let f=Date.now(),E,M;try{if(TA($,`Calling MCP tool: ${A}`),E=setInterval(()=>{let C=Date.now()-f,Z=`${Math.floor(C/1000)}s`;TA($,`Tool '${A}' still running (${Z} elapsed)`)},30000),DqI())M=setInterval(()=>{IqI()},50000);let G=dt(),U,X=new Promise((C,Y)=>{U=setTimeout(()=>{Y(new nZ(`MCP server "${$}" tool "${A}" timed out after ${Math.floor(G/1000)}s`,"MCP tool timeout"))},G)}),J=await Promise.race([H.callTool({name:A,arguments:L,_meta:I},fP,{signal:D,timeout:G,onprogress:B?(C)=>{B({type:"mcp_progress",status:"progress",serverName:$,toolName:A,progress:C.progress,total:C.total,progressMessage:C.message})}:void 0}),X]).finally(()=>{if(U)clearTimeout(U)});if("isError"in J&&J.isError){let C="Unknown error";if("content"in J&&Array.isArray(J.content)&&J.content.length>0){let Y=J.content[0];if(Y&&typeof Y==="object"&&"text"in Y)C=Y.text}else if("error"in J)C=String(J.error);throw ME($,C),new nZ(C,"MCP tool returned error")}let F=Date.now()-f,Q=F<1000?`${F}ms`:F<60000?`${Math.floor(F/1000)}s`:`${Math.floor(F/60000)}m ${Math.floor(F%60000/1000)}s`;TA($,`Tool '${A}' completed successfully in ${Q}`);let W=gZD($);if(W)c("tengu_code_indexing_tool_used",{tool:W,source:"mcp",success:!0});return{content:await hf1(J,A,$),_meta:J._meta,structuredContent:J.structuredContent}}catch(G){if(E!==void 0)clearInterval(E);if(M!==void 0)clearInterval(M);let U=Date.now()-f;if(G instanceof Error&&G.name!=="AbortError")TA($,`Tool '${A}' failed after ${Math.floor(U/1000)}s: ${G.message}`);if(G instanceof Error){if(("code"in G?G.code:void 0)===401||G instanceof xQ)throw TA($,"Tool call returned 401 Unauthorized - token may have expired"),c("tengu_mcp_tool_call_auth_error",{}),new l2$($,`MCP server "${$}" requires re-authorization (token expired)`)}if(!(G instanceof Error)||G.name!=="AbortError")throw G;return{content:void 0}}finally{if(E!==void 0)clearInterval(E);if(M!==void 0)clearInterval(M)}}function bf1(H){if(H.message.content[0]?.type!=="tool_use")return;return H.message.content[0].id}async function lqD(H,$){let A=[],L=[],I=await Promise.allSettled(Object.entries(H).map(async([D,B])=>{let f=new KOA(D,$),E=new fX$({name:"claude-code",version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION??"unknown"},{capabilities:{}});try{await E.connect(f);let M=E.getServerCapabilities(),G={type:"connected",name:D,capabilities:M||{},client:E,config:{...B,scope:"dynamic"},cleanup:async()=>{await E.close()}},U=[];if(M?.tools){let X=await zS(G);U.push(...X)}return{client:G,tools:U}}catch(M){return ME(D,`Failed to connect SDK MCP server: ${M}`),{client:{type:"failed",name:D,config:{...B,scope:"user"}},tools:[]}}}));for(let D of I)if(D.status==="fulfilled")A.push(D.value.client),L.push(...D.value.tools);return{clients:A,tools:L}}var l2$,Sf1,mqD=60000,Rf1,Gz,zS,huH,buH,n2$;var f3=K(()=>{tD();BZI();MZI();zZI();OZI();CK();HrA();_$();lG();_Q();z$();nU();g$();EI();qE();ZE();Ga();vX$();jKA();Bm();NA();kF();$OA();mZD();H4H();nR();eE();LT();oZD();gC$();mC$();n9H();T3();vqD();ljH();BW();nS();bqD();Z$();l2$=class l2$ extends Error{serverName;constructor(H,$){super($);this.name="McpAuthError",this.serverName=H}};Sf1=new Set(["image/jpeg","image/png","image/gif","image/webp"]);Rf1=["mcp__ide__executeCode","mcp__ide__getDiagnostics"];Gz=o$(async(H,$,A)=>{let L=Date.now();try{let I,D=wY();if($.type==="sse"){let y=new i9H(H,$),g=await p2$(H,$),h={authProvider:y,fetch:QOA(xDH()),requestInit:{headers:{"User-Agent":Un(),...g}}};h.eventSourceInit={fetch:async(p,d)=>{let k={},n=await y.tokens();if(n)k.Authorization=`Bearer ${n.access_token}`;let GH=_AH();return fetch(p,{...d,...GH,headers:{"User-Agent":Un(),...k,...d?.headers,...g,Accept:"text/event-stream"}})}},I=new ZX$(new URL($.url),h),TA(H,"SSE transport initialized, awaiting connection")}else if($.type==="sse-ide"){TA(H,`Setting up SSE-IDE transport to ${$.url}`);let y=_AH(),g=y.dispatcher?{eventSourceInit:{fetch:async(h,p)=>{return fetch(h,{...p,...y,headers:{"User-Agent":Un(),...p?.headers}})}}}:{};I=new ZX$(new URL($.url),Object.keys(g).length>0?g:void 0)}else if($.type==="ws-ide"){let y=k$A(),g={"User-Agent":Un(),...$.authToken&&{"X-Claude-Code-Ide-Authorization":$.authToken}},h;if(typeof Bun<"u")h=new globalThis.WebSocket($.url,{protocols:["mcp"],headers:g,proxy:PAH($.url),tls:y||void 0});else h=await kqD($.url,{headers:g,agent:VAH($.url),...y||{}});I=new T2$(h)}else if($.type==="ws"){TA(H,`Initializing WebSocket transport to ${$.url}`);let y=await p2$(H,$),g=k$A(),h={"User-Agent":Un(),...D&&{Authorization:`Bearer ${D}`},...y},p=Object.fromEntries(Object.entries(h).map(([k,n])=>k.toLowerCase()==="authorization"?[k,"[REDACTED]"]:[k,n]));TA(H,`WebSocket transport options: ${yH({url:$.url,headers:p,hasSessionAuth:!!D})}`);let d;if(typeof Bun<"u")d=new globalThis.WebSocket($.url,{protocols:["mcp"],headers:h,proxy:PAH($.url),tls:g||void 0});else d=await kqD($.url,{headers:h,agent:VAH($.url),...g||{}});I=new T2$(d)}else if($.type==="http"){TA(H,`Initializing HTTP transport to ${$.url}`),TA(H,`Node version: ${process.version}, Platform: linux`),TA(H,`Environment: ${yH({NODE_OPTIONS:process.env.NODE_OPTIONS||"not set",UV_THREADPOOL_SIZE:process.env.UV_THREADPOOL_SIZE||"default",HTTP_PROXY:process.env.HTTP_PROXY||"not set",HTTPS_PROXY:process.env.HTTPS_PROXY||"not set",NO_PROXY:process.env.NO_PROXY||"not set"})}`);let y=new i9H(H,$),g=await p2$(H,$),h=_AH();TA(H,`Proxy options: ${h.dispatcher?"custom dispatcher":"default"}`);let p={authProvider:y,fetch:QOA(xDH()),requestInit:{...h,headers:{"User-Agent":Un(),...D&&{Authorization:`Bearer ${D}`},...g}}},d=p.requestInit?.headers?Object.fromEntries(Object.entries(p.requestInit.headers).map(([k,n])=>k.toLowerCase()==="authorization"?[k,"[REDACTED]"]:[k,n])):void 0;TA(H,`HTTP transport options: ${yH({url:$.url,headers:d,hasAuthProvider:!!y,timeoutMs:mqD})}`),I=new qX$(new URL($.url),p),TA(H,"HTTP transport created successfully")}else if($.type==="sdk")throw Error("SDK servers should be handled in print.ts");else if($.type==="claudeai-proxy"){if(TA(H,`Initializing claude.ai proxy transport for server ${$.id}`),!dD())throw Error("No claude.ai OAuth token found");let g=XD(),h=`${g.MCP_PROXY_URL}${g.MCP_PROXY_PATH.replace("{server_id}",$.id)}`;TA(H,`Using claude.ai proxy at ${h}`);let p=async(n,GH)=>{await iW();let HH=dD();if(!HH)throw Error("No claude.ai OAuth token available");let BH=new Headers(GH?.headers);return BH.set("Authorization",`Bearer ${HH.accessToken}`),globalThis.fetch(n,{...GH,headers:BH})},d=_AH(),k={fetch:QOA(p),requestInit:{...d,headers:{"User-Agent":Un(),"X-Mcp-Client-Session-Id":j$()}}};I=new qX$(new URL(h),k),TA(H,"claude.ai proxy transport created successfully")}else if($.type==="stdio"||!$.type){let y=process.env.CLAUDE_CODE_SHELL_PREFIX||$.command,g=process.env.CLAUDE_CODE_SHELL_PREFIX?[[$.command,...$.args].join(" ")]:$.args;I=new nFA({command:y,args:g,env:{...process.env,...$.env},stderr:"pipe"})}else throw Error(`Unsupported server type: ${$.type}. claude.ai MCP servers require ENABLE_CLAUDEAI_MCP_SERVERS=true.`);let B,f="";if($.type==="stdio"||!$.type){let y=I;if(y.stderr)B=(g)=>{f+=g.toString()},y.stderr.on("data",B)}let E=new fX$({name:"claude-code",version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION??"unknown"},{capabilities:{roots:{},...{}}});if($.type==="http")TA(H,"Client created, setting up request handler");if(E.setRequestHandler(hXA,async()=>{return TA(H,"Received ListRoots request from server"),{roots:[{uri:`file://${zL()}`}]}}),TA(H,`Starting connection with timeout of ${d2$()}ms`),$.type==="http"){TA(H,`Testing basic HTTP connectivity to ${$.url}`);try{let y=new URL($.url);if(TA(H,`Parsed URL: host=${y.hostname}, port=${y.port||"default"}, protocol=${y.protocol}`),y.hostname==="127.0.0.1"||y.hostname==="localhost")TA(H,`Using loopback address: ${y.hostname}`)}catch(y){TA(H,`Failed to parse URL: ${y}`)}}let M=E.connect(I),G=new Promise((y,g)=>{let h=setTimeout(()=>{let p=Date.now()-L;TA(H,`Connection timeout triggered after ${p}ms (limit: ${d2$()}ms)`),I.close().catch(()=>{}),g(new nZ(`MCP server "${H}" connection timed out after ${d2$()}ms`,"MCP connection timeout"))},d2$());M.then(()=>{clearTimeout(h)},(p)=>{clearTimeout(h)})});try{if(await Promise.race([M,G]),f)ME(H,`Server stderr: ${f}`);let y=Date.now()-L;TA(H,`Successfully connected to ${$.type} server in ${y}ms`)}catch(y){let g=Date.now()-L;if($.type==="sse"&&y instanceof Error){if(TA(H,`SSE Connection failed after ${g}ms: ${yH({url:$.url,error:y.message,errorType:y.constructor.name,stack:y.stack})}`),ME(H,y),y instanceof xQ)return c("tengu_mcp_server_needs_auth",{transportType:"sse",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,"Authentication required for SSE server"),{name:H,type:"needs-auth",config:$}}else if($.type==="http"&&y instanceof Error){let h=y;if(TA(H,`HTTP Connection failed after ${g}ms: ${y.message} (code: ${h.code||"none"}, errno: ${h.errno||"none"})`),ME(H,y),y instanceof xQ)return c("tengu_mcp_server_needs_auth",{transportType:"http",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,"Authentication required for HTTP server"),{name:H,type:"needs-auth",config:$}}else if($.type==="claudeai-proxy"&&y instanceof Error){if(TA(H,`claude.ai proxy connection failed after ${g}ms: ${y.message}`),ME(H,y),y.code===401)return c("tengu_mcp_server_needs_auth",{transportType:"claudeai-proxy",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,"Authentication required for claude.ai proxy server"),{name:H,type:"needs-auth",config:$}}else if($.type==="sse-ide"||$.type==="ws-ide")c("tengu_mcp_ide_server_connection_failed",{connectionDurationMs:g});if(I.close().catch(()=>{}),f)ME(H,`Server stderr: ${f}`);throw y}let U=E.getServerCapabilities(),X=E.getServerVersion(),J=E.getInstructions();if(TA(H,`Connection established with capabilities: ${yH({hasTools:!!U?.tools,hasPrompts:!!U?.prompts,hasResources:!!U?.resources,serverVersion:X||"unknown"})}`),$.type==="sse-ide"||$.type==="ws-ide"){let y=Date.now()-L;c("tengu_mcp_ide_server_connection_succeeded",{connectionDurationMs:y,serverVersion:X});try{rZI(E)}catch(g){ME(H,`Failed to send ide_connected notification: ${g}`)}}let F=Date.now(),Q=!1,W=E.onerror,P=E.onclose,C=0,Y=3,Z=(y)=>{return y.includes("ECONNRESET")||y.includes("ETIMEDOUT")||y.includes("EPIPE")||y.includes("EHOSTUNREACH")||y.includes("ECONNREFUSED")||y.includes("Body Timeout Error")||y.includes("terminated")};E.onerror=(y)=>{let g=Date.now()-F;Q=!0;let h=$.type||"stdio";if(TA(H,`${h.toUpperCase()} connection dropped after ${Math.floor(g/1000)}s uptime`),y.message)if(y.message.includes("ECONNRESET"))TA(H,"Connection reset - server may have crashed or restarted");else if(y.message.includes("ETIMEDOUT"))TA(H,"Connection timeout - network issue or server unresponsive");else if(y.message.includes("ECONNREFUSED"))TA(H,"Connection refused - server may be down");else if(y.message.includes("EPIPE"))TA(H,"Broken pipe - server closed connection unexpectedly");else if(y.message.includes("EHOSTUNREACH"))TA(H,"Host unreachable - network connectivity issue");else if(y.message.includes("ESRCH"))TA(H,"Process not found - stdio server process terminated");else if(y.message.includes("spawn"))TA(H,"Failed to spawn process - check command and permissions");else TA(H,`Connection error: ${y.message}`);if(h==="sse"||h==="http"||h==="claudeai-proxy")if(Z(y.message)){if(C++,TA(H,`Terminal connection error ${C}/${Y}`),C>=Y)TA(H,"Max consecutive errors reached, triggering reconnection via onclose"),C=0,E.onclose?.()}else C=0;if(W)W(y)},E.onclose=()=>{let y=Date.now()-F,g=$.type??"unknown";TA(H,`${g.toUpperCase()} connection closed after ${Math.floor(y/1000)}s (${Q?"with errors":"cleanly"})`);let h=WOA(H,$);if(Gz.cache.delete(h),TA(H,"Cleared connection cache for reconnection"),P)P()};let q=async()=>{if(B&&($.type==="stdio"||!$.type))I.stderr?.off("data",B);if($.type==="stdio")try{let g=I.pid;if(g){TA(H,"Sending SIGINT to MCP server process");try{process.kill(g,"SIGINT")}catch(h){TA(H,`Error sending SIGINT: ${h}`);return}await new Promise(async(h)=>{let p=!1,d=setInterval(()=>{try{process.kill(g,0)}catch{if(!p)p=!0,clearInterval(d),clearTimeout(k),TA(H,"MCP server process exited cleanly"),h()}},50),k=setTimeout(()=>{if(!p)p=!0,clearInterval(d),TA(H,"Cleanup timeout reached, stopping process monitoring"),h()},600);try{if(await new Promise((n)=>setTimeout(n,100)),!p){try{process.kill(g,0),TA(H,"SIGINT failed, sending SIGTERM to MCP server process");try{process.kill(g,"SIGTERM")}catch(n){TA(H,`Error sending SIGTERM: ${n}`),p=!0,clearInterval(d),clearTimeout(k),h();return}}catch{p=!0,clearInterval(d),clearTimeout(k),h();return}if(await new Promise((n)=>setTimeout(n,400)),!p)try{process.kill(g,0),TA(H,"SIGTERM failed, sending SIGKILL to MCP server process");try{process.kill(g,"SIGKILL")}catch(n){TA(H,`Error sending SIGKILL: ${n}`)}}catch{p=!0,clearInterval(d),clearTimeout(k),h()}}if(!p)p=!0,clearInterval(d),clearTimeout(k),h()}catch{if(!p)p=!0,clearInterval(d),clearTimeout(k),h()}})}}catch(y){TA(H,`Error terminating process: ${y}`)}try{await E.close()}catch(y){TA(H,`Error closing client: ${y}`)}},O=PB(q),j=async()=>{O?.(),await q()},u=Date.now()-L;return c("tengu_mcp_server_connection_succeeded",{connectionDurationMs:u,transportType:$.type??"stdio",totalServers:A?.totalServers,stdioCount:A?.stdioCount,sseCount:A?.sseCount,httpCount:A?.httpCount,sseIdeCount:A?.sseIdeCount,wsIdeCount:A?.wsIdeCount,...vX($)?{mcpServerBaseUrl:vX($)}:{}}),{name:H,client:E,type:"connected",capabilities:U??{},serverInfo:X,instructions:J,config:$,cleanup:j}}catch(I){let D=Date.now()-L;return c("tengu_mcp_server_connection_failed",{connectionDurationMs:D,totalServers:A?.totalServers||1,stdioCount:A?.stdioCount||($.type==="stdio"?1:0),sseCount:A?.sseCount||($.type==="sse"?1:0),httpCount:A?.httpCount||($.type==="http"?1:0),sseIdeCount:A?.sseIdeCount||($.type==="sse-ide"?1:0),wsIdeCount:A?.wsIdeCount||($.type==="ws-ide"?1:0),transportType:$.type??"stdio",...vX($)?{mcpServerBaseUrl:vX($)}:{}}),TA(H,`Connection failed after ${D}ms: ${I instanceof Error?I.message:String(I)}`),ME(H,`Connection failed: ${I instanceof Error?I.message:String(I)}`),{name:H,type:"failed",config:$,error:I instanceof Error?I.message:String(I)}}},WOA);zS=o$(async(H)=>{if(H.type!=="connected")return[];try{if(!H.capabilities?.tools)return[];let $=await H.client.request({method:"tools/list"},fjH),A=Ua($.tools),L=H.config.type==="sdk"&&A$(process.env.CLAUDE_AGENT_SDK_MCP_NO_PREFIX);return A.map((I)=>({...aZD,name:L?I.name:`mcp__${E1(H.name)}__${E1(I.name)}`,originalMcpToolName:I.name,isMcp:!0,async description(){return I.description??""},async prompt(){return I.description??""},isConcurrencySafe(){return I.annotations?.readOnlyHint??!1},isReadOnly(){return I.annotations?.readOnlyHint??!1},isDestructive(){return I.annotations?.destructiveHint??!1},isOpenWorld(){return I.annotations?.openWorldHint??!1},inputJSONSchema:I.inputSchema,async checkPermissions(){return{behavior:"passthrough",message:"MCPTool requires permission.",suggestions:[{type:"addRules",rules:[{toolName:L?I.name:`mcp__${E1(H.name)}__${E1(I.name)}`,ruleContent:void 0}],behavior:"allow",destination:"localSettings"}]}},async call(D,B,f,E,M){let G=bf1(E),U=G?{"claudecode/toolUseId":G}:{};if(M&&G)M({toolUseID:G,data:{type:"mcp_progress",status:"started",serverName:H.name,toolName:I.name}});let X=Date.now();try{let J=await A3H(H),F=await cqD({client:J,tool:I.name,args:D,meta:U,signal:B.abortController.signal,onProgress:M&&G?(Q)=>{M({toolUseID:G,data:Q})}:void 0});if(M&&G)M({toolUseID:G,data:{type:"mcp_progress",status:"completed",serverName:H.name,toolName:I.name,elapsedTimeMs:Date.now()-X}});return{data:F.content,...F._meta||F.structuredContent?{mcpMeta:{...F._meta&&{_meta:F._meta},...F.structuredContent&&{structuredContent:F.structuredContent}}}:{}}}catch(J){if(M&&G)M({toolUseID:G,data:{type:"mcp_progress",status:"failed",serverName:H.name,toolName:I.name,elapsedTimeMs:Date.now()-X}});if(J instanceof Error&&!(J instanceof nZ)){let F=J.constructor.name;if(F==="Error")throw new nZ(J.message,J.message.slice(0,200));if(F==="McpError"&&"code"in J&&typeof J.code==="number")throw new nZ(J.message,`McpError ${J.code}`)}throw J}},userFacingName(){let D=I.annotations?.title||I.name;return`${H.name} - ${D} (MCP)`},...F3H(H.name)?hqD(I.name):{}})).filter(yf1)}catch($){return ME(H.name,`Failed to fetch tools: ${$ instanceof Error?$.message:String($)}`),[]}}),huH=o$(async(H)=>{if(H.type!=="connected")return[];try{if(!H.capabilities?.resources)return[];let $=await H.client.request({method:"resources/list"},PDH);if(!$.resources)return[];return $.resources.map((A)=>({...A,server:H.name}))}catch($){return ME(H.name,`Failed to fetch resources: ${$ instanceof Error?$.message:String($)}`),[]}}),buH=o$(async(H)=>{if(H.type!=="connected")return[];try{if(!H.capabilities?.prompts)return[];let $=await H.client.request({method:"prompts/list"},DjH);if(!$.prompts)return[];return Ua($.prompts).map((L)=>{let I=Object.values(L.arguments??{}).map((D)=>D.name);return{type:"prompt",name:"mcp__"+E1(H.name)+"__"+L.name,description:L.description??"",hasUserSpecifiedDescription:!!L.description,contentLength:0,isEnabled:()=>!0,isHidden:!1,isMcp:!0,progressMessage:"running",userFacingName(){return`${H.name}:${L.name} (MCP)`},argNames:I,source:"mcp",async getPromptForCommand(D){let B=D.split(" ");try{let f=await A3H(H),E=await f.client.getPrompt({name:L.name,arguments:enA(I,B)});return(await Promise.all(E.messages.map((G)=>dqD(G.content,f.name)))).flat()}catch(f){throw ME(H.name,`Error running command '${L.name}': ${f instanceof Error?f.message:String(f)}`),f}}}})}catch($){return ME(H.name,`Failed to fetch commands: ${$ instanceof Error?$.message:String($)}`),[]}});n2$=o$(async(H)=>{return new Promise(($)=>{let A=0,L=0;if(A=Object.keys(H).length,A===0){$({clients:[],tools:[],commands:[]});return}let I=[],D=[],B=[];i2$((f)=>{if(I.push(f.client),D.push(...f.tools),B.push(...f.commands),L++,L>=A){let E=B.reduce((M,G)=>{let U=G.name.length+(G.description??"").length+(G.argumentHint??"").length;return M+U},0);c("tengu_mcp_tools_commands_loaded",{tools_count:D.length,commands_count:B.length,commands_metadata_length:E}),$({clients:I,tools:D,commands:B})}},H).catch((f)=>{ME("prefetchAllMcpResources",`Failed to get MCP resources: ${f instanceof Error?f.message:String(f)}`),$({clients:[],tools:[],commands:[]})})})})});class wS{static instance;baseline=new Map;initialized=!1;mcpClient;lastProcessedTimestamps=new Map;rightFileDiagnosticsState=new Map;static getInstance(){if(!wS.instance)wS.instance=new wS;return wS.instance}initialize(H){if(this.initialized)return;this.mcpClient=H,this.initialized=!0}async shutdown(){this.initialized=!1,this.baseline.clear()}reset(){this.baseline.clear(),this.rightFileDiagnosticsState.clear()}normalizeFileUri(H){let $=["file://","_claude_fs_right:","_claude_fs_left:"],A=H;for(let L of $)if(H.startsWith(L)){A=H.slice(L.length);break}return r2$(A)}async ensureFileOpened(H){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return;try{await Vx("openFile",{filePath:H,preview:!1,startText:"",endText:"",selectToEndOfLine:!1,makeFrontmost:!1},this.mcpClient)}catch($){r($)}}async beforeFileEdited(H){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return;let $=Date.now();try{let A=await Vx("getDiagnostics",{uri:`file://${H}`},this.mcpClient),L=this.parseDiagnosticResult(A)[0];if(L){if(!rqD(this.normalizeFileUri(H),this.normalizeFileUri(L.uri))){r(new nqD(`Diagnostics file path mismatch: expected ${H}, got ${L.uri})`));return}let I=this.normalizeFileUri(H);this.baseline.set(I,L.diagnostics),this.lastProcessedTimestamps.set(I,$)}else{let I=this.normalizeFileUri(H);this.baseline.set(I,[]),this.lastProcessedTimestamps.set(I,$)}}catch(A){}}async getNewDiagnostics(){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return[];let H=[];try{let I=await Vx("getDiagnostics",{},this.mcpClient);H=this.parseDiagnosticResult(I)}catch(I){return[]}let $=H.filter((I)=>this.baseline.has(this.normalizeFileUri(I.uri))).filter((I)=>I.uri.startsWith("file://")),A=new Map;H.filter((I)=>this.baseline.has(this.normalizeFileUri(I.uri))).filter((I)=>I.uri.startsWith("_claude_fs_right:")).forEach((I)=>{A.set(this.normalizeFileUri(I.uri),I)});let L=[];for(let I of $){let D=this.normalizeFileUri(I.uri),B=this.baseline.get(D)||[],f=A.get(D),E=I;if(f){let G=this.rightFileDiagnosticsState.get(D);if(!G||!this.areDiagnosticArraysEqual(G,f.diagnostics))E=f;this.rightFileDiagnosticsState.set(D,f.diagnostics)}let M=E.diagnostics.filter((G)=>!B.some((U)=>this.areDiagnosticsEqual(G,U)));if(M.length>0)L.push({uri:I.uri,diagnostics:M});this.baseline.set(D,E.diagnostics)}return L}parseDiagnosticResult(H){if(Array.isArray(H)){let $=H.find((A)=>A.type==="text");if($&&"text"in $)return DA($.text)}return[]}areDiagnosticsEqual(H,$){return H.message===$.message&&H.severity===$.severity&&H.source===$.source&&H.code===$.code&&H.range.start.line===$.range.start.line&&H.range.start.character===$.range.start.character&&H.range.end.line===$.range.end.line&&H.range.end.character===$.range.end.character}areDiagnosticArraysEqual(H,$){if(H.length!==$.length)return!1;return H.every((A)=>$.some((L)=>this.areDiagnosticsEqual(A,L)))&&$.every((A)=>H.some((L)=>this.areDiagnosticsEqual(L,A)))}isLinterDiagnostic(H){let $=["eslint","eslint-plugin","tslint","prettier","stylelint","jshint","standardjs","xo","rome","biome","deno-lint","rubocop","pylint","flake8","black","ruff","clippy","rustfmt","golangci-lint","gofmt","swiftlint","detekt","ktlint","checkstyle","pmd","sonarqube","sonarjs"];if(!H.source)return!1;let A=H.source.toLowerCase();return $.some((L)=>A.includes(L))}async handleQueryStart(H){if(!this.initialized){let $=CY(H);if($)this.initialize($)}else this.reset()}static formatDiagnosticsSummary(H){let A=H.map((L)=>{let I=L.uri.split("/").pop()||L.uri,D=L.diagnostics.map((B)=>{return` ${wS.getSeveritySymbol(B.severity)} [Line ${B.range.start.line+1}:${B.range.start.character+1}] ${B.message}${B.code?` [${B.code}]`:""}${B.source?` (${B.source})`:""}`}).join(` `)!==Z.content)throw Error(QzH)}else throw Error(QzH)}let J=X?eJ(f):"utf-8",F=X?M.readFileSync(f,{encoding:J}):null;if(gE())await Ct(L,f,B.uuid);let Q=X?kp(f):await ITD();M.mkdirSync(E),Ot(f,$,J,Q);let W=hp();if(W)OY$(`file://${f}`),W.changeFile(f,$).catch((Y)=>{N(`LSP: Failed to notify server of file change for ${f}: ${Y.message}`),r(Y)}),W.saveFile(f).catch((Y)=>{N(`LSP: Failed to notify server of file save for ${f}: ${Y.message}`),r(Y)});if(_t(f,F,$),A.set(f,{content:$,timestamp:x3(f),offset:void 0,limit:void 0}),f.endsWith(`${a2$.sep}CLAUDE.md`))c("tengu_write_claudemd",{});let P;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"&&!0&&NL("tengu_quartz_lantern",!1)){let Y=Date.now(),Z=await mY$(f);if(Z)P=Z;c("tengu_tool_use_diff_computed",{isWriteTool:!0,durationMs:Date.now()-Y,hasDiff:!!Z})}if(F){let Y=Iw({filePath:H,fileContents:F,edits:[{old_string:F,new_string:$,replace_all:!1}]}),Z={type:"update",filePath:H,content:$,structuredPatch:Y,originalFile:F,...P&&{gitDiff:P}};return tSH(Y),Ex({operation:"write",tool:"FileWriteTool",filePath:f,type:"update"}),{data:Z}}let C={type:"create",filePath:H,content:$,structuredPatch:[],originalFile:null,...P&&{gitDiff:P}};return tSH([],$),Ex({operation:"write",tool:"FileWriteTool",filePath:f,type:"create"}),{data:C}},mapToolResultToToolResultBlockParam({filePath:H,content:$,type:A},L){switch(A){case"create":return{tool_use_id:L,type:"tool_result",content:`File created successfully at: ${H}`};case"update":{if(NL("tengu_file_write_optimization",!1))return{tool_use_id:L,type:"tool_result",content:`The file ${H} has been overwritten successfully.`};return{tool_use_id:L,type:"tool_result",content:`The file ${H} has been updated. Here's the result of running \`cat -n\` on a snippet of the edited file: - IMPORTANT: For temporary files, use \`/tmp/claude/\` as your temporary directory - The TMPDIR environment variable is automatically set to \`/tmp/claude\` when running in sandbox mode - Do NOT use \`/tmp\` directly - use \`/tmp/claude/\` or rely on TMPDIR instead - Most programs that respect TMPDIR will automatically use \`/tmp/claude/\``}function cf1(){if(A$(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS))return"";return"\n - You can use the `run_in_background` parameter to run the command in the background. Only use this if you don't need the result immediately and are OK being notified when the command completes later. You do not need to check the output right away - you'll be notified when it finishes. You do not need to use '&' at the end of the command when using this parameter."}function GTD(){return`Executes a given bash command with optional timeout. Working directory persists between commands; shell state (everything else) does not. The shell environment is initialized from the user's profile (bash or zsh). ${U}`);else N("No stdout output captured");if(X)N(`stderr output (${X.length} chars): ${X}`);else N("No stderr output captured");r(Error(`Failed to create shell snapshot: ${G.message}`));let F=J?.signal?Iw$.constants.signals[J.signal]:void 0;c("tengu_shell_snapshot_failed",{stderr_length:X?.length||0,has_error_code:!!J?.code,error_signal_number:F,error_killed:J?.killed}),A(void 0)}else if(Yz.existsSync(E)){let J=Yz.statSync(E).size;N(`Shell snapshot created successfully (${J} bytes)`),PB(async()=>{try{if(Yz.existsSync(E))zH().unlinkSync(E),N(`Cleaned up session snapshot: ${E}`)}catch(F){N(`Error cleaning up session snapshot: ${F}`)}}),A(E)}else{N(`Shell snapshot file not found after creation: ${E}`),N(`Checking if parent directory still exists: ${f}`);let J=Yz.existsSync(f);if(N(`Parent directory exists: ${J}`),J)try{let F=zH().readdirSync(f);N(`Directory contains ${F.length} files`)}catch(F){N(`Could not read directory contents: ${F}`)}c("tengu_shell_unknown_error",{}),A(void 0)}})}catch(L){if(N(`Unexpected error during snapshot creation: ${L}`),L instanceof Error)N(`Error stack trace: ${L.stack}`);r(L instanceof Error?L:Error(String(L))),c("tengu_shell_snapshot_error",{}),A(void 0)}})};var _TD=K(()=>{EX();O_();_$();z$();NA();ZE();DL();Z9();E$();CR();PI();iMH();BW();Yz=require("fs"),VTD=require("child_process"),Lw$=require("path"),Iw$=b(require("os"))});function YTD(){return null}function NOA(H){try{return wTD.accessSync(H,ct.constants.X_OK),!0}catch($){try{return Bw$.execFileSync(H,["--version"],{timeout:1000,stdio:"ignore"}),!0}catch{return!1}}}function IE1(H){if(process.env.CLAUDE_CODE_SHELL_PREFIX)return"{ shopt -u extglob || setopt NO_EXTENDED_GLOB; } >/dev/null 2>&1 || true";if(H.includes("bash"))return"shopt -u extglob 2>/dev/null || true";else if(H.includes("zsh"))return"setopt NO_EXTENDED_GLOB 2>/dev/null || true";return null}async function DE1(){let H=process.env.CLAUDE_CODE_SHELL;if(H)if((H.includes("bash")||H.includes("zsh"))&&NOA(H))return N(`Using shell override: ${H}`),H;else N(`CLAUDE_CODE_SHELL="${H}" is not a valid bash/zsh path, falling back to detection`);let $=process.env.SHELL,A=$&&($.includes("bash")||$.includes("zsh")),L=$?.includes("bash"),[I,D]=await Promise.all([x_("zsh"),x_("bash")]),B=["/bin","/usr/bin","/usr/local/bin","/opt/homebrew/bin"],E=(L?["bash","zsh"]:["zsh","bash"]).flatMap((G)=>B.map((U)=>`${U}/${G}`));if(L){if(D)E.unshift(D);if(I)E.push(I)}else{if(I)E.unshift(I);if(D)E.push(D)}if(A&&NOA($))E.unshift($);let M=E.find((G)=>G&&NOA(G));if(!M){let G="No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL environment variable set.";throw r(Error(G)),Error(G)}return M}async function BE1(){let H=await DE1(),$;try{$=await PTD(H)}catch(A){N(`Failed to create shell snapshot: ${A}`),$=void 0}return{binShell:H,snapshotFilePath:$}}async function Ew$(H,$,A,L,I,D,B,f){let E=A||LE1,{binShell:M,snapshotFilePath:G}=await OOA();if(L)M=L,G=void 0;let U=Math.floor(Math.random()*65536).toString(16).padStart(4,"0"),X=CTD.tmpdir();if(oA()==="windows")X=PR(X);let J=Dw$.join(process.env.CLAUDE_CODE_TMPDIR||"/tmp",xOA()),F=B?Dw$.join(J,`cwd-${U}`):Dw$.join(X,`claude-${U}-cwd`),Q=XTD(H),W=UTD(H,Q);if(!B&&H.includes("|")&&Q)W=KTD(H);let P=[];if(G){if(!ct.existsSync(G))N(`Snapshot file missing, recreating: ${G}`),OOA.cache?.clear?.(),G=(await OOA()).snapshotFilePath;if(G){let u=oA()==="windows"?PR(G):G;P.push(`source ${wI([u])}`)}}let C=ayI();if(C)P.push(C);let Y=IE1(M);if(Y)P.push(Y);P.push(`eval ${W}`),P.push(`pwd -P >| ${F}`);let Z=P.join(" && ");if(process.env.CLAUDE_CODE_SHELL_PREFIX)Z=cF$(process.env.CLAUDE_CODE_SHELL_PREFIX,Z);let q=GtH();if($.aborted)return lyI();if(B){Z=await vL.wrapWithSandbox(Z,M,void 0,$);try{zH().mkdirSync(J,{mode:448})}catch(u){N(`Failed to create ${J} directory: ${u}`)}}let O=A$(process.env.CLAUDE_BASH_NO_LOGIN)&&G!==void 0,j=["-c",...O?[]:["-l"],Z];if(O)N("Spawning shell without login (-l flag skipped)");try{let u=YTD(),y=Bw$.spawn(M,j,{env:{...process.env,SHELL:M,GIT_EDITOR:"true",CLAUDECODE:"1",...{},...B?{TMPDIR:J,CLAUDE_CODE_TMPDIR:J}:{},...u?{TMUX:u}:{}},cwd:q,detached:!0,windowsHide:!0}),g=dF$(y,$,E,I,f);return g.result.then(async(h)=>{if(h&&!D&&!h.backgroundTaskId)try{MC(ct.readFileSync(F,{encoding:"utf8"}).trim(),q)}catch{c("tengu_shell_set_cwd",{success:!1})}try{ct.unlinkSync(F)}catch{}}),g}catch(u){return N(`Shell exec error: ${u instanceof Error?u.message:String(u)}`),{status:"killed",background:()=>null,kill:()=>{},cleanup:()=>{},result:Promise.resolve({code:126,stdout:"",stderr:u instanceof Error?u.message:String(u),interrupted:!1})}}}function MC(H,$){let A=fw$.isAbsolute(H)?H:fw$.resolve($||zH().cwd(),H);if(!zH().existsSync(A))throw Error(`Path "${A}" does not exist`);let L=zH().realpathSync(A);hS$(L);try{c("tengu_shell_set_cwd",{success:!0})}catch(I){}}var ct,Bw$,fw$,Dw$,CTD,wTD,LE1=1800000,OOA;var nh=K(()=>{EX();r7A();JTD();Zk();_$();z$();n7A();DL();g$();iMH();Z9();E$();QTD();_TD();tD();PI();EM();iF$();BM();NA();ct=require("fs"),Bw$=require("child_process"),fw$=require("path"),Dw$=require("path/posix"),CTD=b(require("os")),wTD=require("fs");OOA=o$(BE1)});function SOA(H){let $=H.split(` Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file. `)}`)));else if(!D.headers.location)throw iw$({status:D.statusCode},`HTTP ${D.statusCode} redirect with no location header`);else{let B=nw$.resolve(H,D.headers.location);dOD(B,$,A).then(L,I)}else L(D.body||Buffer.alloc(0))}).catch((D)=>{I(new pOD(iw$(D,`Error downloading ${H.href}`),H.href))})})}function j41(H,$){return new Promise((A,L)=>{let D=(H.protocol==="https:"?S41:x41).get({hostname:H.hostname,port:H.port,path:H.path,auth:H.auth,protocol:H.protocol,headers:$.headers||{},withCredentials:$.withCredentials});if(typeof D.setTimeout==="function")D.setTimeout($.timeout);D.on("timeout",()=>{D.abort()}),D.on("error",L),D.once("response",(B)=>{B.body=Buffer.alloc(0),B.on("data",(f)=>{B.body=Buffer.concat([B.body,Buffer.from(f)])}),B.on("error",L),B.on("end",()=>{A(B)})})})}});var rOD=z((SFM,nOD)=>{var R41=PND(),y41=yOD(),v41=hOD(),h41=kOD(),b41=mOD(),k41=lOD();nOD.exports=dxA;function dxA(H){pxA(this,dxA.defaults),pxA(this,H)}dxA.defaults={parse:{json:R41,yaml:y41,text:v41,binary:h41},resolve:{file:b41,http:k41,external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1}};function pxA(H,$){if(iOD($)){let A=Object.keys($);for(let L=0;L{var aOD=rOD();oOD.exports=u41;function u41(H){let $,A,L,I;if(H=Array.prototype.slice.call(H),typeof H[H.length-1]==="function")I=H.pop();if(typeof H[0]==="string")if($=H[0],typeof H[2]==="object")A=H[1],L=H[2];else A=void 0,L=H[1];else $="",A=H[0],L=H[1];if(!(L instanceof aOD))L=new aOD(L);return{path:$,schema:A,options:L,callback:I}}});var $xD=z((RFM,HxD)=>{var sOD=R3H(),g41=nuH(),m41=BxA(),LgH=Cz(),{isHandledError:p41}=sS();HxD.exports=d41;function d41(H,$){if(!$.resolve.external)return Promise.resolve();try{let A=cxA(H.schema,H.$refs._root$Ref.path+"#",H.$refs,$);return Promise.all(A)}catch(A){return Promise.reject(A)}}function cxA(H,$,A,L,I){I=I||new Set;let D=[];if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!I.has(H))if(I.add(H),sOD.isExternal$Ref(H))D.push(eOD(H,$,A,L));else for(let B of Object.keys(H)){let f=g41.join($,B),E=H[B];if(sOD.isExternal$Ref(E))D.push(eOD(E,f,A,L));else D=D.concat(cxA(E,f,A,L,I))}return D}async function eOD(H,$,A,L){let I=LgH.resolve($,H.$ref),D=LgH.stripHash(I);if(H=A._$refs[D],H)return Promise.resolve(H.value);try{let B=await m41(I,A,L),f=cxA(B,D+"#",A,L);return Promise.all(f)}catch(B){if(!L.continueOnError||!p41(B))throw B;if(A._$refs[D])B.source=decodeURI(LgH.stripHash($)),B.path=LgH.safePointerToPath(LgH.getHash($));return[]}}});var IxD=z((yFM,LxD)=>{var rw$=R3H(),IgH=nuH(),lxA=Cz();LxD.exports=c41;function c41(H,$){let A=[];ixA(H,"schema",H.$refs._root$Ref.path+"#","#",0,A,H.$refs,$),l41(A)}function ixA(H,$,A,L,I,D,B,f){let E=$===null?H:H[$];if(E&&typeof E==="object"&&!ArrayBuffer.isView(E))if(rw$.isAllowed$Ref(E))AxD(H,$,A,L,I,D,B,f);else{let M=Object.keys(E).sort((G,U)=>{if(G==="definitions")return-1;else if(U==="definitions")return 1;else return G.length-U.length});for(let G of M){let U=IgH.join(A,G),X=IgH.join(L,G),J=E[G];if(rw$.isAllowed$Ref(J))AxD(E,G,A,X,I,D,B,f);else ixA(E,G,U,X,I,D,B,f)}}}function AxD(H,$,A,L,I,D,B,f){let E=$===null?H:H[$],M=lxA.resolve(A,E.$ref),G=B._resolve(M,L,f);if(G===null)return;let U=IgH.parse(L).length,X=lxA.stripHash(G.path),J=lxA.getHash(G.path),F=X!==B._root$Ref.path,Q=rw$.isExtended$Ref(E);I+=G.indirections;let W=i41(D,H,$);if(W)if(U{if(I.file!==D.file)return I.file{var nxA=R3H(),DxD=nuH(),{ono:r41}=it(),a41=Cz();ExD.exports=o41;function o41(H,$){let A=rxA(H.schema,H.$refs._root$Ref.path,"#",new Set,new Set,new Map,H.$refs,$);H.$refs.circular=A.circular,H.schema=A.value}function rxA(H,$,A,L,I,D,B,f){let E,M={value:H,circular:!1},G=f.dereference.excludedPathMatcher;if(f.dereference.circular==="ignore"||!I.has(H)){if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!G(A)){if(L.add(H),I.add(H),nxA.isAllowed$Ref(H,f))E=BxD(H,$,A,L,I,D,B,f),M.circular=E.circular,M.value=E.value;else for(let U of Object.keys(H)){let X=DxD.join($,U),J=DxD.join(A,U);if(G(J))continue;let F=H[U],Q=!1;if(nxA.isAllowed$Ref(F,f)){if(E=BxD(F,X,J,L,I,D,B,f),Q=E.circular,H[U]!==E.value)H[U]=E.value}else if(!L.has(F)){if(E=rxA(F,X,J,L,I,D,B,f),Q=E.circular,H[U]!==E.value)H[U]=E.value}else Q=fxD(X,B,f);M.circular=M.circular||Q}L.delete(H)}}return M}function BxD(H,$,A,L,I,D,B,f){let E=a41.resolve($,H.$ref),M=D.get(E);if(M){let Q=Object.keys(H);if(Q.length>1){let W={};for(let P of Q)if(P!=="$ref"&&!(P in M.value))W[P]=H[P];return{circular:M.circular,value:Object.assign({},M.value,W)}}return M}let G=B._resolve(E,$,f);if(G===null)return{circular:!1,value:null};let U=G.circular,X=U||L.has(G.value);X&&fxD($,B,f);let J=nxA.dereference(H,G.value);if(!X){let Q=rxA(J,G.path,A,L,I,D,B,f);X=Q.circular,J=Q.value}if(X&&!U&&f.dereference.circular==="ignore")J=H;if(U)J.$ref=A;let F={circular:X,value:J};if(Object.keys(H).length===1)D.set(E,F);return F}function fxD(H,$,A){if($.circular=!0,!A.dereference.circular)throw r41.reference(`Circular $ref pointer found at ${H}`);return!0}});var UxD=z((hFM,GxD)=>{function t41(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function($){setTimeout($,0)}}GxD.exports=t41()});var FxD=z((bFM,JxD)=>{var XxD=UxD();JxD.exports=function($,A){if($){A.then(function(L){XxD(function(){$(null,L)})},function(L){XxD(function(){$(L)})});return}else return A}});var VxD=z((kFM,eh)=>{var WxD=UND(),s41=BxA(),aw$=tOD(),e41=$xD(),H51=IxD(),$51=MxD(),g3H=Cz(),{JSONParserError:A51,InvalidPointerError:L51,MissingPointerError:I51,ResolverError:D51,ParserError:B51,UnmatchedParserError:f51,UnmatchedResolverError:E51,isHandledError:M51,JSONParserErrorGroup:KxD}=sS(),Hj=FxD(),{ono:QxD}=it();eh.exports=sh;eh.exports.default=sh;eh.exports.JSONParserError=A51;eh.exports.InvalidPointerError=L51;eh.exports.MissingPointerError=I51;eh.exports.ResolverError=D51;eh.exports.ParserError=B51;eh.exports.UnmatchedParserError=f51;eh.exports.UnmatchedResolverError=E51;function sh(){this.schema=null,this.$refs=new WxD}sh.parse=function($,A,L,I){let B=new this;return B.parse.apply(B,arguments)};sh.prototype.parse=async function($,A,L,I){let D=aw$(arguments),B;if(!D.path&&!D.schema){let M=QxD(`Expected a file path, URL, or object. Got ${D.path||D.schema}`);return Hj(D.callback,Promise.reject(M))}this.schema=null,this.$refs=new WxD;let f="http";if(g3H.isFileSystemPath(D.path))D.path=g3H.fromFileSystemPath(D.path),f="file";if(D.path=g3H.resolve(g3H.cwd(),D.path),D.schema&&typeof D.schema==="object"){let M=this.$refs._add(D.path);M.value=D.schema,M.pathType=f,B=Promise.resolve(D.schema)}else B=s41(D.path,this.$refs,D.options);let E=this;try{let M=await B;if(M!==null&&typeof M==="object"&&!Buffer.isBuffer(M))return E.schema=M,Hj(D.callback,Promise.resolve(E.schema));else if(D.options.continueOnError)return E.schema=null,Hj(D.callback,Promise.resolve(E.schema));else throw QxD.syntax(`"${E.$refs._root$Ref.path||M}" is not a valid JSON Schema`)}catch(M){if(!D.options.continueOnError||!M51(M))return Hj(D.callback,Promise.reject(M));if(this.$refs._$refs[g3H.stripHash(D.path)])this.$refs._$refs[g3H.stripHash(D.path)].addError(M);return Hj(D.callback,Promise.resolve(null))}};sh.resolve=function($,A,L,I){let B=new this;return B.resolve.apply(B,arguments)};sh.prototype.resolve=async function($,A,L,I){let D=this,B=aw$(arguments);try{return await this.parse(B.path,B.schema,B.options),await e41(D,B.options),axA(D),Hj(B.callback,Promise.resolve(D.$refs))}catch(f){return Hj(B.callback,Promise.reject(f))}};sh.bundle=function($,A,L,I){let B=new this;return B.bundle.apply(B,arguments)};sh.prototype.bundle=async function($,A,L,I){let D=this,B=aw$(arguments);try{return await this.resolve(B.path,B.schema,B.options),H51(D,B.options),axA(D),Hj(B.callback,Promise.resolve(D.schema))}catch(f){return Hj(B.callback,Promise.reject(f))}};sh.dereference=function($,A,L,I){let B=new this;return B.dereference.apply(B,arguments)};sh.prototype.dereference=async function($,A,L,I){let D=this,B=aw$(arguments);try{return await this.resolve(B.path,B.schema,B.options),$51(D,B.options),axA(D),Hj(B.callback,Promise.resolve(D.schema))}catch(f){return Hj(B.callback,Promise.reject(f))}};function axA(H){if(KxD.getParserErrors(H).length>0)throw new KxD(H)}});function A1H({mainThreadAgentDefinition:H,toolUseContext:$,customSystemPrompt:A,defaultSystemPrompt:L,appendSystemPrompt:I,overrideSystemPrompt:D}){if(D)return[D];let B=H?TK(H)?H.getSystemPrompt({toolUseContext:{options:$.options}}):H.getSystemPrompt():void 0;if(H?.memory)c("tengu_agent_memory_loaded",{...{},scope:H.memory,isMainLoopAgent:!0});return[...B?[B]:A?[A]:L,...I?[I]:[]]}var ow$=K(()=>{kT();z$();NA()});async function DgH(H,$){try{let A=await bSH(H,$);if(A!==null)return A;N(`countTokensWithFallback: API returned null, trying haiku fallback (${$.length} tools)`)}catch(A){N(`countTokensWithFallback: API failed: ${A instanceof Error?A.message:String(A)}`),r(A instanceof Error?A:Error(String(A)))}try{let A=await sPI(H,$);if(A===null)N(`countTokensWithFallback: haiku fallback also returned null (${$.length} tools)`);return A}catch(A){return N(`countTokensWithFallback: haiku fallback failed: ${A instanceof Error?A.message:String(A)}`),r(A instanceof Error?A:Error(String(A))),null}}async function $d(H,$,A,L){let I=await Promise.all(H.map((B)=>ew$(B,{getToolPermissionContext:$,tools:H,agents:A?.activeAgents??[],model:L}))),D=await DgH([],I);if(D===null||D===0){let B=H.map((f)=>f.name).join(", ");N(`countToolDefinitionTokens returned ${D} for ${H.length} tools: ${B.slice(0,100)}${B.length>100?"...":""}`)}return D??0}async function G51(H){let $=await k5(),A=[...H,...Object.values($)];if(A.length<1)return 0;return(await Promise.all(A.filter((I)=>I.length>0).map((I)=>DgH([{role:"user",content:I}],[])))).reduce((I,D)=>I+(D||0),0)}async function U51(){let H=QJ(),$=[],A=0;if(H.length<1)return{memoryFileDetails:[],claudeMdTokens:0};let L=await Promise.all(H.map(async(I)=>{let D=await DgH([{role:"user",content:I.content}],[]);return{file:I,tokens:D||0}}));for(let{file:I,tokens:D}of L)A+=D,$.push({path:I.path,type:I.type,tokens:D});return{claudeMdTokens:A,memoryFileDetails:$}}async function X51(H,$,A,L,I){let D=H.filter((Q)=>!Q.isMcp);if(D.length<1)return{builtInToolTokens:0,deferredBuiltinDetails:[],deferredBuiltinTokens:0};let{isToolSearchEnabled:B}=await Promise.resolve().then(() => (GT(),sxA)),{isDeferredTool:f}=await Promise.resolve().then(() => (ia(),IyI)),E=await B(L??"",H,$,A?.activeAgents??[],"analyzeBuiltIn"),M=D.filter((Q)=>!f(Q)),G=D.filter((Q)=>f(Q)),U=M.length>0?await $d(M,$,A,L):0,X=[],J=0,F=0;if(G.length>0&&E){let Q=new Set;if(I){let P=new Set(G.map((C)=>C.name));for(let C of I)if(C.type==="assistant"){for(let Y of C.message.content)if("type"in Y&&Y.type==="tool_use"&&"name"in Y&&typeof Y.name==="string"&&P.has(Y.name))Q.add(Y.name)}}let W=await Promise.all(G.map((P)=>$d([P],$,A,L)));for(let[P,C]of G.entries()){let Y=Math.max(0,(W[P]||0)-tw$),Z=Q.has(C.name);if(X.push({name:C.name,tokens:Y,isLoaded:Z}),F+=Y,Z)J+=Y}}else if(G.length>0){let Q=await $d(G,$,A,L);return{builtInToolTokens:U+Q,deferredBuiltinDetails:[],deferredBuiltinTokens:0}}return{builtInToolTokens:U+J,deferredBuiltinDetails:X,deferredBuiltinTokens:F-J}}function PxD(H){return H.find(($)=>$.name===WJ)}async function J51(H,$,A){let L=await ajI(C$()),I=PxD(H);if(!I)return{slashCommandTokens:0,commandInfo:{totalCommands:0,includedCommands:0}};return{slashCommandTokens:await $d([I],$,A),commandInfo:{totalCommands:L.totalCommands,includedCommands:L.includedCommands}}}async function F51(H,$,A){try{let L=await ojI(C$()),I=PxD(H);if(!I)return{skillTokens:0,skillInfo:{totalSkills:0,includedSkills:0,skillFrontmatter:[]}};let D=await $d([I],$,A),B=L.map((f)=>({name:f.userFacingName(),source:f.type==="prompt"?f.source:"plugin",tokens:R6H(f)}));return{skillTokens:D,skillInfo:{totalSkills:L.length,includedSkills:L.length,skillFrontmatter:B}}}catch(L){return r(L instanceof Error?L:Error("Failed to count skill tokens")),{skillTokens:0,skillInfo:{totalSkills:0,includedSkills:0,skillFrontmatter:[]}}}}async function BgH(H,$,A,L,I){let D=H.filter((Q)=>Q.isMcp),B=[],E=(await Promise.all(D.map((Q)=>$d([Q],$,A,L)))).map((Q)=>Math.max(0,(Q||0)-tw$)),M=E.reduce((Q,W)=>Q+W,0),{isToolSearchEnabled:G}=await Promise.resolve().then(() => (GT(),sxA)),U=await G(L,H,$,A?.activeAgents??[],"analyzeMcp"),X=new Set;if(U&&I){let Q=new Set(D.map((W)=>W.name));for(let W of I)if(W.type==="assistant"){for(let P of W.message.content)if("type"in P&&P.type==="tool_use"&&"name"in P&&typeof P.name==="string"&&Q.has(P.name))X.add(P.name)}}for(let[Q,W]of D.entries())B.push({name:W.name,serverName:W.name.split("__")[1]||"unknown",tokens:E[Q],isLoaded:X.has(W.name)});let J=0,F=0;for(let Q of B)if(Q.isLoaded)J+=Q.tokens;else if(U)F+=Q.tokens;return{mcpToolTokens:U?J:M,mcpToolDetails:B,deferredToolTokens:F,loadedMcpToolNames:X}}async function _xD(H,$,A){let L=H.filter((I)=>!I.isMcp);if(L.length===0)return 0;return $d(L,$,A)}async function K51(H){let $=H.activeAgents.filter((D)=>D.source!=="built-in"),A=[],L=0,I=await Promise.all($.map((D)=>DgH([{role:"user",content:[D.agentType,D.whenToUse].join(" ")}],[])));for(let[D,B]of $.entries()){let f=I[D]||0;L+=f||0,A.push({agentType:B.agentType,source:B.source,tokens:f||0})}return{agentTokens:L,agentDetails:A}}async function Q51(H){let $=await rh(H),A={totalTokens:0,toolCallTokens:0,toolResultTokens:0,attachmentTokens:0,assistantMessageTokens:0,userMessageTokens:0,toolCallsByType:new Map,toolResultsByType:new Map,attachmentsByType:new Map},L=await DgH(JJ($.messages).map((I)=>{if(I.type==="assistant")return{role:"assistant",content:I.message.content};return I.message}),[]);return A.totalTokens=L??0,A}async function sw$(H,$,A,L,I,D,B,f,E){let M=BLH({permissionMode:(await A()).mode,mainLoopModel:$}),G=JV(M,V6()),U=await HC(L,M),X=A1H({mainThreadAgentDefinition:f,toolUseContext:B??{options:{}},customSystemPrompt:B?.options.customSystemPrompt,defaultSystemPrompt:U,appendSystemPrompt:B?.options.appendSystemPrompt}),[J,{claudeMdTokens:F,memoryFileDetails:Q},{builtInToolTokens:W,deferredBuiltinDetails:P,deferredBuiltinTokens:C},{mcpToolTokens:Y,mcpToolDetails:Z,deferredToolTokens:q},{agentTokens:O,agentDetails:j},{slashCommandTokens:u,commandInfo:y},g]=await Promise.all([G51(X),U51(),X51(L,A,I,M,H),BgH(L,A,I,M,H),K51(I),J51(L,A,I),Q51(H)]),p=(await F51(L,A,I)).skillInfo,d=p.skillFrontmatter.reduce((vH,tH)=>vH+tH.tokens,0),k=g.totalTokens,n=ep(),GH=n?d9H($)-rOA:void 0,HH=[];if(J>0)HH.push({name:"System prompt",tokens:J,color:"promptBorder"});let BH=W-d;if(BH>0)HH.push({name:"System tools",tokens:BH,color:"inactive"});if(Y>0)HH.push({name:"MCP tools",tokens:Y,color:"cyan_FOR_SUBAGENTS_ONLY"});if(q>0)HH.push({name:"MCP tools (deferred)",tokens:q,color:"inactive",isDeferred:!0});if(C>0)HH.push({name:"System tools (deferred)",tokens:C,color:"inactive",isDeferred:!0});if(O>0)HH.push({name:"Custom agents",tokens:O,color:"permission"});if(F>0)HH.push({name:"Memory files",tokens:F,color:"claude"});if(d>0)HH.push({name:"Skills",tokens:d,color:"warning"});if(k!==null&&k>0)HH.push({name:"Messages",tokens:k,color:"purple_FOR_SUBAGENTS_ONLY"});let WH=HH.reduce((vH,tH)=>vH+(tH.isDeferred?0:tH.tokens),0),wH=0;if(n&&GH!==void 0)wH=G-GH,HH.push({name:oxA,tokens:wH,color:"inactive"});else if(!n)wH=aOA,HH.push({name:txA,tokens:wH,color:"inactive"});let QH=Math.max(0,G-WH-wH);HH.push({name:"Free space",tokens:QH,color:"promptBorder"});let TH=WH,t=v4$(E??H),KH=(t?t.input_tokens+t.cache_creation_input_tokens+t.cache_read_input_tokens:null)??TH,MH=D&&D<80,CH=G>=1e6?MH?5:20:MH?5:10,OH=G>=1e6?10:MH?5:10,LH=CH*OH,DH=HH.filter((vH)=>!vH.isDeferred).map((vH)=>({...vH,squares:vH.name==="Free space"?Math.round(vH.tokens/G*LH):Math.max(1,Math.round(vH.tokens/G*LH)),percentageOfTotal:Math.round(vH.tokens/G*100)}));function EH(vH){let tH=[],K$=vH.tokens/G*LH,KA=Math.floor(K$),UA=K$-KA;for(let U$=0;U$0)hA=UA;tH.push({color:vH.color,isFilled:!0,categoryName:vH.name,tokens:vH.tokens,percentage:vH.percentageOfTotal,squareFullness:hA})}return tH}let $H=[],FH=DH.find((vH)=>vH.name===oxA||vH.name===txA),YH=DH.filter((vH)=>vH.name!==oxA&&vH.name!==txA&&vH.name!=="Free space");for(let vH of YH){let tH=EH(vH);for(let K$ of tH)if($H.lengthvH.name==="Free space"),hH=LH-qH;while($H.length0?{totalCommands:y.totalCommands,includedCommands:y.includedCommands,tokens:u}:void 0,skills:d>0?{totalSkills:p.totalSkills,includedSkills:p.includedSkills,tokens:d,skillFrontmatter:p.skillFrontmatter}:void 0,autoCompactThreshold:GH,isAutoCompactEnabled:n,messageBreakdown:gH,apiUsage:t}}var oxA="Autocompact buffer",txA="Compact buffer",tw$=500;var m3H=K(()=>{nC();g$();bT();Aw();$3();Ow();ow$();mQ();lt();_L();$s();aI();oRH();PI();jp();_$();E$();zt();Z$()});function P51(H,$){let A=V51[H];if(!A||A.length===0)return $;let L={...$},I=L.properties;if(I&&typeof I==="object"){let D={...I};for(let B of A)delete D[B];L.properties=D}return L}async function ew$(H,$){let A=cf("tengu_tool_pear"),L="inputJSONSchema"in H&&H.inputJSONSchema?H.inputJSONSchema:t9H(H.inputSchema);if(!dL())L=P51(H.name,L);let I={name:H.name,description:await H.prompt({getToolPermissionContext:$.getToolPermissionContext,tools:$.tools,agents:$.agents,allowedAgentTypes:$.allowedAgentTypes}),input_schema:L};if(A&&H.strict===!0&&$.model&&Ac$($.model))I.strict=!0;if($.betas?.includes(vlH)&&H.input_examples)I.input_examples=H.input_examples;if($.deferLoading)I.defer_loading=!0;if($.cacheControl)I.cache_control=$.cacheControl;return I}function CxD(H){let[$]=exA(H),A=$?.text;c("tengu_sysprompt_block",{snippet:A?.slice(0,20),length:A?.length??0,hash:A?YxD.createHash("sha256").update(A).digest("hex"):""})}function exA(H,$){let A=sI()==="firstParty"&&(A$(process.env.CLAUDE_CODE_FORCE_GLOBAL_CACHE)||NL("tengu_system_prompt_global_cache",!1));if(A&&$?.skipGlobalCacheForSystemPrompt){c("tengu_sysprompt_using_tool_based_cache",{promptBlockCount:H.length});let E,M,G=[];for(let J of H){if(!J)continue;if(J===p3H)continue;if(J.startsWith("x-anthropic-billing-header"))E=J;else if(y9$.has(J))M=J;else G.push(J)}let U=[];if(E)U.push({text:E,cacheScope:null});if(M)U.push({text:M,cacheScope:null});let X=G.join(` `,isMeta:!0}),...H]}async function ZxD(H,$){if(NP())return;let[{tools:A},L,I,D]=await Promise.all([n2$(H),yK($),u5(),k5()]),B=D.gitStatus?.length??0,f=I.claudeMd?.length??0,E=B+f,M=nD();setTimeout(()=>M.abort(),1000);let G=C$(),U=jFH($),X=SFH(U,G),J=await btH(G,M.signal,X),F=0,Q=0,W=0,P=0,C=0,Y=L.filter((q)=>!q.isMcp);F=A.length,P=Y.length;let Z=new Set;for(let q of A){let O=q.name.split("__");if(O.length>=3&&O[1])Z.add(O[1])}Q=Z.size;try{let q=CwD($,A);if(A.length>0){let O=X1(),{mcpToolTokens:j}=await BgH(q,async()=>$,null,O);W=j}if(Y.length>0)C=await _xD(q,async()=>$,null)}catch{}c("tengu_context_size",{git_status_size:B,claude_md_size:f,total_context_size:E,project_file_count_rounded:J,mcp_tools_count:F,mcp_servers_count:Q,mcp_tools_tokens:W,non_mcp_tools_count:P,non_mcp_tools_tokens:C})}function qxD(H,$,A){switch(H.name){case xY:{let L=uQ(A);if(L)return{...$,plan:L};return $}case aD.name:{let L=aD.inputSchema.parse($),{command:I,timeout:D,description:B}=L,f=I.replace(`cd ${C$()} && `,"");if(f=f.replace(/\\\\;/g,"\\;"),/^echo\s+["']?[^|&;><]*["']?$/i.test(f.trim()))c("tengu_bash_tool_simple_echo",{});let E="run_in_background"in L?L.run_in_background:void 0;return{command:f,description:B,...D?{timeout:D}:{},...B?{description:B}:{},...E?{run_in_background:E}:{},..."dangerouslyDisableSandbox"in L&&L.dangerouslyDisableSandbox?{dangerouslyDisableSandbox:L.dangerouslyDisableSandbox}:{}}}case S3.name:{let L=S3.inputSchema.parse($),{file_path:I,edits:D}=vRI({file_path:L.file_path,edits:[{old_string:L.old_string,new_string:L.new_string,replace_all:L.replace_all}]});return{replace_all:D[0].replace_all,file_path:I,old_string:D[0].old_string,new_string:D[0].new_string}}case h3.name:{let L=h3.inputSchema.parse($);return{file_path:L.file_path,content:x7A(L.content)}}case fQH:{let L=$,I=L.task_id??L.agentId??L.bash_id,D=L.timeout??(typeof L.wait_up_to==="number"?L.wait_up_to*1000:void 0);return{task_id:I??"",block:L.block??!0,timeout:D??30000}}default:return $}}function TxD(H,$){switch(H.name){case xY:{if($&&typeof $==="object"&&"plan"in $){let{plan:A,...L}=$;return L}return $}default:return $}}var YxD,W51,V51;var $s=K(()=>{NA();Ow$();SD();b9$();z$();_L();CR();PI();BM();zQ();T9H();JBH();ht();eE();T8();gQ();Z$();E$();m3H();aI();oM();$q();JHH();f3();bT();g7();Fo();Ow();SD();YxD=require("crypto"),W51=b(VxD(),1),V51={[xY]:["launchSwarm","teammateCount"],[E0]:["name","team_name","mode"]}});function $Z$(){if(!HSA)HSA=require("perf_hooks").performance;return HSA}function Y51(){let H=$Z$(),$=H.getEntriesByType("mark");for(let A of $)if(A.name.startsWith(EgH))H.clearMarks(A.name)}function ASA(){if(!tI())return;if(!$SA)return;if(fgH++,Y51(),$Z$().mark(`${EgH}turn_start`),HZ$)N(`[headlessProfiler] Started turn ${fgH}`)}function L1H(H){if(!tI())return;if(!$SA)return;let $=$Z$();if($.mark(`${EgH}${H}`),HZ$)N(`[headlessProfiler] Checkpoint: ${H} at ${$.now().toFixed(1)}ms`)}function LSA(){if(!tI())return;if(!$SA)return;let A=$Z$().getEntriesByType("mark").filter((G)=>G.name.startsWith(EgH));if(A.length===0)return;let L=new Map;for(let G of A){let U=G.name.slice(EgH.length);L.set(U,G.startTime)}let I=L.get("turn_start");if(I===void 0)return;let D={turn_number:fgH},B=L.get("system_message_yielded");if(B!==void 0&&fgH===0)D.time_to_system_message_ms=Math.round(B);let f=L.get("query_started");if(f!==void 0)D.time_to_query_start_ms=Math.round(f-I);let E=L.get("first_chunk");if(E!==void 0)D.time_to_first_response_ms=Math.round(E-I);let M=L.get("api_request_sent");if(f!==void 0&&M!==void 0)D.query_overhead_ms=Math.round(M-f);if(D.checkpoint_count=A.length,process.env.CLAUDE_CODE_ENTRYPOINT)D.entrypoint=process.env.CLAUDE_CODE_ENTRYPOINT;if(zxD)c("tengu_headless_latency",D);if(HZ$)N(`[headlessProfiler] Turn ${fgH} metrics: ${yH(D)}`)}var HZ$,_51=0.05,zxD,$SA,HSA=null,EgH="headless_",fgH=-1;var MgH=K(()=>{E$();z$();g$();Z$();HZ$=process.env.CLAUDE_CODE_PROFILE_STARTUP==="1",zxD=Math.random()<_51,$SA=HZ$||zxD});function AZ$(H){NxD.push(H)}async function OxD(H,$,A,L,I,D){let B={messages:H,systemPrompt:$,userContext:A,systemContext:L,toolUseContext:I,querySource:D};for(let f of NxD)try{await f(B)}catch(E){r(E instanceof Error?E:Error(`Post-sampling hook failed: ${E}`))}}var NxD;var GgH=K(()=>{_$();NxD=[]});var UgH;var ISA=K(()=>{UgH=class UgH{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(H){this.returned=H}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((H,$)=>{this.readResolve=H,this.readReject=$})}enqueue(H){if(this.readResolve){let $=this.readResolve;this.readResolve=void 0,this.readReject=void 0,$({done:!1,value:H})}else this.queue.push(H)}done(){if(this.isDone=!0,this.readResolve){let H=this.readResolve;this.readResolve=void 0,this.readReject=void 0,H({done:!0,value:void 0})}}error(H){if(this.hasError=H,this.readReject){let $=this.readReject;this.readResolve=void 0,this.readReject=void 0,$(H)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}});function c3H(H){if(H instanceof HM)return H.message||yY;if(!(H instanceof Error))return String(H);let A=DSA(H).filter(Boolean).join(` `)}function lxD(){if(!FgH)return;N(N51())}var FgH,USA,pxD=0,GSA=null,MSA=null;var l3H=K(()=>{E$();FgH=process.env.CLAUDE_CODE_PROFILE_QUERY==="1",USA=new Map});function x51(){return parseInt(process.env.CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY||"",10)||10}async function*IZ$(H,$,A,L){let I=L;for(let{isConcurrencySafe:D,blocks:B}of S51(H,I))if(D){let f={};for await(let E of R51(B,$,A,I)){if(E.contextModifier){let{toolUseID:M,modifyContext:G}=E.contextModifier;if(!f[M])f[M]=[];f[M].push(G)}yield{message:E.message,newContext:I}}for(let E of B){let M=f[E.id];if(!M)continue;for(let G of M)I=G(I)}yield{newContext:I}}else for await(let f of j51(B,$,A,I)){if(f.newContext)I=f.newContext;yield{message:f.message,newContext:I}}}function S51(H,$){return H.reduce((A,L)=>{let I=$.options.tools.find((f)=>f.name===L.name),D=I?.inputSchema.safeParse(L.input),B=D?.success?(()=>{try{return Boolean(I?.isConcurrencySafe(D.data))}catch{return!1}})():!1;if(B&&A[A.length-1]?.isConcurrencySafe)A[A.length-1].blocks.push(L);else A.push({isConcurrencySafe:B,blocks:[L]});return A},[])}async function*j51(H,$,A,L){let I=L;for(let D of H){L.setInProgressToolUseIDs((B)=>new Set([...B,D.id]));for await(let B of XgH(D,$.find((f)=>f.message.content.some((E)=>E.type==="tool_use"&&E.id===D.id)),A,I)){if(B.contextModifier)I=B.contextModifier.modifyContext(I);yield{message:B.message,newContext:I}}ixD(L,D.id)}}async function*R51(H,$,A,L){yield*mK$(H.map(async function*(I){L.setInProgressToolUseIDs((D)=>new Set([...D,I.id])),yield*XgH(I,$.find((D)=>D.message.content.some((B)=>B.type==="tool_use"&&B.id===I.id)),A,L),ixD(L,I.id)}),x51())}function ixD(H,$){H.setInProgressToolUseIDs((A)=>new Set([...A].filter((L)=>L!==$)))}var JSA=K(()=>{TBH();fSA()});function DZ$(H){return async($)=>{try{if(!await H.shouldRun($))return;let L=nxD.randomUUID(),I=H.buildMessages($);$.queryMessageCount=I.length;let D=H.systemPrompt?[H.systemPrompt]:$.systemPrompt,f=H.useTools??!0?$.toolUseContext.options.tools:[],E=H.getModel(),M=await xm({messages:I,systemPrompt:D,maxThinkingTokens:0,tools:f,signal:nD().signal,options:{getToolPermissionContext:async()=>{return(await $.toolUseContext.getAppState()).toolPermissionContext},model:E,toolChoice:void 0,isNonInteractiveSession:$.toolUseContext.options.isNonInteractiveSession,hasAppendSystemPrompt:!!$.toolUseContext.options.appendSystemPrompt,temperatureOverride:0,agents:$.toolUseContext.options.agentDefinitions.activeAgents,querySource:H.name,mcpTools:[],agentId:$.toolUseContext.agentId}}),G=M.message.content.filter((U)=>U.type==="text").map((U)=>U.text).join("").trim();try{let U=H.parseResponse(G,$);H.logResult({type:"success",queryName:H.name,result:U,messageId:M.message.id,model:E,uuid:L},$)}catch(U){H.logResult({type:"error",queryName:H.name,error:U,uuid:L},$)}}catch(A){r(A instanceof Error?A:Error(`API query hook ${H.name} failed`))}}}var nxD;var FSA=K(()=>{dU();eE();_$();nxD=require("crypto")});async function rxD(){return}async function axD(H){if(KSA)await KSA(H)}var KSA=null;var QSA=K(()=>{FSA();_L();z$();SD();aI();w7();$s()});function oxD(){y51=[]}var y51;var txD=K(()=>{y51=[]});async function sxD(){return}function b51(){oxD(),h51="",AA((H)=>({...H,coachingTipsThisSession:0}))}function exD(){return M$().coachingMode??"off"}var v51=!1,h51="";var KgH=K(()=>{qS();_L();g$();vA();z$();_$();txD()});async function*HSD(H,$,A,L,I,D,B,f,E,M,G,U,X){let J=Date.now(),F={messages:[...H,...$],systemPrompt:A,userContext:L,systemContext:I,toolUseContext:B,querySource:f};if(axD(F),process.env.CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION!=="false")ASD(F);try{let Q=[],P=(await B.getAppState()).toolPermissionContext.mode,C=QNA(P,B.abortController.signal,void 0,G??!1,B.agentId,B,[...H,...$],B.agentType),Y="",Z=0,q=!1,O="",j=!1,u=[],y=[];for await(let g of C){if(g.message){if(yield g.message,g.message.type==="progress"&&g.message.toolUseID){Y=g.message.toolUseID,Z++;let h=g.message.data;if(h.command)y.push({command:h.command,promptText:h.promptText})}if(g.message.type==="attachment"){let h=g.message.attachment;if("hookEvent"in h&&(h.hookEvent==="Stop"||h.hookEvent==="SubagentStop")){if(h.type==="hook_non_blocking_error")u.push(h.stderr||`Exit code ${h.exitCode}`),j=!0;else if(h.type==="hook_error_during_execution")u.push(h.content),j=!0;else if(h.type==="hook_success"){if(h.stdout&&h.stdout.trim()||h.stderr&&h.stderr.trim())j=!0}}}}if(g.blockingError){let h=R$({content:MNA(g.blockingError),isMeta:!0});Q.push(h),yield h,j=!0,u.push(g.blockingError.blockingError)}if(g.preventContinuation)q=!0,O=g.stopReason||"Stop hook prevented continuation",yield QB({type:"hook_stopped_continuation",message:O,hookName:"Stop",toolUseID:Y,hookEvent:"Stop"});if(B.abortController.signal.aborted){c("tengu_pre_stop_hooks_cancelled",{queryChainId:B.queryTracking?.chainId,queryDepth:B.queryTracking?.depth}),yield n3H({toolUse:!1});return}}if(Z>0){if(yield LSD(Z,y,u,q,O,j,"suggestion",Y),u.length>0){let g=CQ("app:toggleTranscript","Global","ctrl+o");B.addNotification?.({key:"stop-hook-error",text:`Stop hook error occurred \xB7 ${g} to see`,priority:"immediate"})}}if(q)return;if(Q.length>0){yield*vP({messages:[...H,...$,...Q],systemPrompt:A,userContext:L,systemContext:I,canUseTool:D,toolUseContext:B,autoCompactTracking:E,fallbackModel:M,stopHookActive:!0,querySource:f,maxTurns:U,turnCount:X});return}if(tf()){let g=g1()??"",h=g9()??"",p=[],d=sW(),n=GF(d).filter((HH)=>HH.status==="in_progress"&&HH.owner===g);for(let HH of n){let BH=XuH(HH.id,HH.subject,HH.description,g,h,P,B.abortController.signal,void 0,B);for await(let WH of BH){if(WH.message)yield WH.message;if(WH.blockingError){let wH=R$({content:UuH(WH.blockingError),isMeta:!0});p.push(wH),yield wH}if(B.abortController.signal.aborted)return}}let GH=WNA(g,h,P,B.abortController.signal);for await(let HH of GH){if(HH.message)yield HH.message;if(HH.blockingError){let BH=R$({content:GNA(HH.blockingError),isMeta:!0});p.push(BH),yield BH}if(B.abortController.signal.aborted)return}if(p.length>0)yield*vP({messages:[...H,...$,...p],systemPrompt:A,userContext:L,systemContext:I,canUseTool:D,toolUseContext:B,autoCompactTracking:E,fallbackModel:M,stopHookActive:!0,querySource:f,maxTurns:U,turnCount:X})}}catch(Q){let W=Date.now()-J;c("tengu_stop_hook_error",{duration:W,queryChainId:B.queryTracking?.chainId,queryDepth:B.queryTracking?.depth}),yield a7(`Stop hook failed: ${Q instanceof Error?Q.message:String(Q)}`,"warning")}}var $SD=K(()=>{z$();_L();J3();_3();XE();JG();QSA();FG();i3H();KgH();W9H()});function*WSA(H,$){for(let A of H){let L=A.message.content.filter((I)=>I.type==="tool_use");for(let I of L)yield R$({content:[{type:"tool_result",content:$,is_error:!0,tool_use_id:I.id}],toolUseResult:$,sourceToolAssistantUUID:A.uuid})}}async function*vP({messages:H,systemPrompt:$,userContext:A,systemContext:L,canUseTool:I,toolUseContext:D,autoCompactTracking:B,fallbackModel:f,stopHookActive:E,querySource:M,maxOutputTokensOverride:G,maxOutputTokensRecoveryCount:U=0,maxTurns:X,turnCount:J=1,pendingToolUseSummary:F}){if(yield{type:"stream_request_start"},_9("query_fn_entry"),!D.agentId)L1H("query_started");let Q=D.queryTracking?{chainId:D.queryTracking.chainId,depth:D.queryTracking.depth+1}:{chainId:VSA.randomUUID(),depth:0},W=Q.chainId;D={...D,queryTracking:Q};let P=[...GC(H)],C=B;_9("query_microcompact_start");let Y=await rh(P,void 0,D);if(P=Y.messages,Y.compactionInfo?.boundaryMessage)yield Y.compactionInfo.boundaryMessage;_9("query_microcompact_end");let Z=wxD($,L);_9("query_autocompact_start");let{compactionResult:q}=await OzD(P,D,{systemPrompt:$,userContext:A,systemContext:L,toolUseContext:D,forkContextMessages:P},M);if(_9("query_autocompact_end"),q){let{preCompactTokenCount:MH,postCompactTokenCount:CH,compactionUsage:OH}=q;if(c("tengu_auto_compact_succeeded",{originalMessageCount:H.length,compactedMessageCount:q.summaryMessages.length+q.attachments.length+q.hookResults.length,preCompactTokenCount:MH,postCompactTokenCount:CH,compactionInputTokens:OH?.input_tokens,compactionOutputTokens:OH?.output_tokens,compactionCacheReadTokens:OH?.cache_read_input_tokens??0,compactionCacheCreationTokens:OH?.cache_creation_input_tokens??0,compactionTotalTokens:OH?OH.input_tokens+(OH.cache_creation_input_tokens??0)+(OH.cache_read_input_tokens??0)+OH.output_tokens:0,queryChainId:W,queryDepth:Q.depth}),!C?.compacted)C={compacted:!0,turnId:VSA.randomUUID(),turnCounter:0};let LH=Et(q);for(let e of LH)yield e;P=LH,ZzD()}D={...D,messages:P};let O=[],j=[];_9("query_setup_start");let y=cf("tengu_streaming_tool_execution2")?new JgH(D.options.tools,I,D):null,g=await D.getAppState(),h=g.toolPermissionContext.mode,p=BLH({permissionMode:h,mainLoopModel:D.options.mainLoopModel,exceeds200kTokens:h==="plan"&&h4$(P)});_9("query_setup_end");let d=void 0;if(!q){let{isAtBlockingLimit:MH}=sp(UT(P),D.options.mainLoopModel);if(MH){yield qf({content:jg,error:"invalid_request"});return}}let k=!0;_9("query_api_loop_start");try{while(k){k=!1;try{let MH=!1;_9("query_api_streaming_start");for await(let CH of e6H({messages:d3H(P,A),systemPrompt:Z,maxThinkingTokens:D.options.maxThinkingTokens,tools:D.options.tools,signal:D.abortController.signal,options:{async getToolPermissionContext(){return(await D.getAppState()).toolPermissionContext},model:p,...cD()?{fastMode:g.fastMode}:{},toolChoice:void 0,isNonInteractiveSession:D.options.isNonInteractiveSession,fallbackModel:f,onStreamingFallback:()=>{MH=!0},querySource:M,agents:D.options.agentDefinitions.activeAgents,allowedAgentTypes:D.options.agentDefinitions.allowedAgentTypes,hasAppendSystemPrompt:!!D.options.appendSystemPrompt,maxOutputTokensOverride:G,fetchOverride:d,mcpTools:g.mcp.tools,queryTracking:Q,effortValue:g.effortValue,agentId:D.agentId}})){if(MH){for(let OH of O)yield{type:"tombstone",message:OH};if(c("tengu_orphaned_messages_tombstoned",{orphanedMessageCount:O.length,queryChainId:W,queryDepth:Q.depth}),O.length=0,j.length=0,y)y.discard(),y=new JgH(D.options.tools,I,D)}if(yield CH,CH.type==="assistant"){if(O.push(CH),y&&!D.abortController.signal.aborted){let OH=CH.message.content.filter((LH)=>LH.type==="tool_use");for(let LH of OH)y.addTool(LH,CH)}}if(y&&!D.abortController.signal.aborted){for(let OH of y.getCompletedResults())if(OH.message)yield OH.message,j.push(...JJ([OH.message],D.options.tools).filter((LH)=>LH.type==="user"))}}_9("query_api_streaming_end")}catch(MH){if(MH instanceof jU$&&f){if(p=f,k=!0,yield*WSA(O,"Model fallback triggered"),O.length=0,j.length=0,y)y.discard(),y=new JgH(D.options.tools,I,D);D.options.mainLoopModel=f,c("tengu_model_fallback_triggered",{original_model:MH.originalModel,fallback_model:f,entrypoint:"cli",queryChainId:W,queryDepth:Q.depth}),yield a7(`Model fallback triggered: switching from ${MH.originalModel} to ${MH.fallbackModel}`,"info");continue}throw MH}}}catch(MH){r(MH instanceof Error?MH:Error(String(MH)));let CH=MH instanceof Error?MH.message:String(MH);if(c("tengu_query_error",{assistantMessages:O.length,toolUses:O.flatMap((OH)=>OH.message.content.filter((LH)=>LH.type==="tool_use")).length,queryChainId:W,queryDepth:Q.depth}),MH instanceof lJH||MH instanceof eIH){yield qf({content:MH.message});return}yield*WSA(O,CH),yield n3H({toolUse:!1}),pZ("Query error",MH);return}if(O.length>0)OxD([...P,...O],$,A,L,D,M);if(O.some((MH)=>MH.message.content.some((CH)=>CH.type==="text"&&hzD(CH.text))))c("tengu_model_response_keyword_detected",{is_overly_agreeable:!0,queryChainId:W,queryDepth:Q.depth});if(D.abortController.signal.aborted){if(y){for await(let MH of y.getRemainingResults())if(MH.message)yield MH.message}else yield*WSA(O,"Interrupted by user");yield n3H({toolUse:!1});return}let GH=O.flatMap((MH)=>MH.message.content.filter((CH)=>CH.type==="tool_use"));if(F){let MH=await F;if(MH)yield MH}if(!O.length||!GH.length){if(O[O.length-1]?.apiError==="max_output_tokens"&&UOH.type==="user"))}BH={...y.getUpdatedContext(),queryTracking:Q}}else{c("tengu_streaming_tool_execution_not_used",{tool_count:GH.length,queryChainId:W,queryDepth:Q.depth});for await(let MH of IZ$(GH,O,I,D)){if(MH.message){if(yield MH.message,MH.message.type==="attachment"&&MH.message.attachment.type==="hook_stopped_continuation")HH=!0;j.push(...JJ([MH.message],D.options.tools).filter((CH)=>CH.type==="user"))}if(MH.newContext)BH={...MH.newContext,queryTracking:Q}}}_9("query_tool_execution_end");let WH;if(A$(process.env.CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES)&&GH.length>0&&!D.abortController.signal.aborted){let MH=O[O.length-1],CH;if(MH){let e=MH.message.content.filter((DH)=>DH.type==="text");if(e.length>0){let DH=e[e.length-1];if(DH&&"text"in DH)CH=DH.text}}let OH=GH.map((e)=>e.id),LH=GH.map((e)=>{let DH=j.find(($H)=>$H.type==="user"&&Array.isArray($H.message.content)&&$H.message.content.some((FH)=>FH.type==="tool_result"&&FH.tool_use_id===e.id)),EH=DH?.type==="user"&&Array.isArray(DH.message.content)?DH.message.content.find(($H)=>$H.type==="tool_result"&&$H.tool_use_id===e.id):void 0;return{name:e.name,input:e.input,output:EH&&"content"in EH?EH.content:null}});WH=jzD({tools:LH,signal:D.abortController.signal,isNonInteractiveSession:D.options.isNonInteractiveSession,lastAssistantText:CH}).then((e)=>{if(e)return ISD(e,OH);return null}).catch(()=>null)}if(D.abortController.signal.aborted){yield n3H({toolUse:!0});let MH=J+1;if(X&&MH>X)yield QB({type:"max_turns_reached",maxTurns:X,turnCount:MH});return}if(HH)return;if(C?.compacted)C.turnCounter++,c("tengu_post_autocompact_turn",{turnId:C.turnId,turnCounter:C.turnCounter,queryChainId:W,queryDepth:Q.depth});c("tengu_query_before_attachments",{messagesForQueryCount:P.length,assistantMessagesCount:O.length,toolResultsCount:j.length,queryChainId:W,queryDepth:Q.depth});let QH=(await BH.getAppState()).queuedCommands;for await(let MH of I6H(null,BH,null,QH,[...P,...O,...j],M))yield MH,j.push(MH);let TH=QH.filter((MH)=>MH.mode==="prompt");if(TH.length>0)aRI(TH,BH.setAppState);let t=j.filter((MH)=>MH.type==="attachment"&&MH.attachment.type==="edited_text_file").length;c("tengu_query_after_attachments",{totalToolResultsCount:j.length,fileChangeAttachmentCount:t,queryChainId:W,queryDepth:Q.depth});let IH={...BH,queryTracking:Q},KH=J+1;if(X&&KH>X){yield QB({type:"max_turns_reached",maxTurns:X,turnCount:KH});return}_9("query_recursive_call"),yield*vP({messages:[...P,...O,...j],systemPrompt:$,userContext:A,systemContext:L,canUseTool:I,toolUseContext:IH,autoCompactTracking:C,fallbackModel:f,stopHookActive:E,querySource:M,maxTurns:X,turnCount:KH,pendingToolUseSummary:WH})}var VSA,k51=3;var W9H=K(()=>{dU();IDH();jp();lt();Cp();SD();z$();ZU$();LT();NA();_$();ry();E$();_L();RzD();$s();J3();CP();g$();MgH();aI();$3();GgH();TQH();gxD();l3H();JSA();$SD();AJ();VSA=require("crypto")});function u51(H){if(H instanceof JD){let $=H.error;if($?.error?.message)return $.error.message}return H instanceof Error?H.message:String(H)}function PSA(H){let $=new Set;H.forEach((A,L)=>$.add(L));for(let[A,L]of Object.entries(g51))if(L.prefixes?.some((I)=>Array.from($).some((D)=>D.startsWith(I))))return A;return}function _SA(){return{...process.env.ANTHROPIC_BASE_URL?{baseUrl:process.env.ANTHROPIC_BASE_URL}:{},...process.env.ANTHROPIC_MODEL?{envModel:process.env.ANTHROPIC_MODEL}:{},...process.env.ANTHROPIC_SMALL_FAST_MODEL?{envSmallFastModel:process.env.ANTHROPIC_SMALL_FAST_MODEL}:{}}}function DSD(){if(!{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.BUILD_TIME)return;let H=new Date({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.BUILD_TIME).getTime();if(isNaN(H))return;return Math.floor((Date.now()-H)/60000)}function BSD({model:H,messagesLength:$,temperature:A,betas:L,permissionMode:I,querySource:D,queryTracking:B,effortValue:f,fastMode:E}){c("tengu_api_query",{model:H,messagesLength:$,temperature:A,provider:SR(),buildAgeMins:DSD(),...L?.length?{betas:L.join(",")}:{},permissionMode:I,querySource:D,...B?{queryChainId:B.chainId,queryDepth:B.depth}:{},effortValue:f,fastMode:E,..._SA()})}function YSA({error:H,model:$,messageCount:A,messageTokens:L,durationMs:I,durationMsIncludingRetries:D,attempt:B,requestId:f,didFallBackToNonStreaming:E,promptCategory:M,headers:G,queryTracking:U,querySource:X,llmSpan:J,fastMode:F}){let Q=void 0;if(H instanceof JD&&H.headers)Q=PSA(H.headers);else if(G)Q=PSA(G);let W=u51(H),P=H instanceof JD?String(H.status):void 0,C=G3I(H),Y=MSH(H);if(Y){let q=Y.isSSLError?" (SSL error)":"";N(`Connection error details: code=${Y.code}${q}, message=${Y.message}`,{level:"error"})}r(H),c("tengu_api_error",{model:$,error:W,status:P,errorType:C,messageCount:A,messageTokens:L,durationMs:I,durationMsIncludingRetries:D,attempt:B,provider:SR(),requestId:f||void 0,didFallBackToNonStreaming:E,...M?{promptCategory:M}:{},...Q?{gateway:Q}:{},...U?{queryChainId:U.chainId,queryDepth:U.depth}:{},...X?{querySource:X}:{},fastMode:F,..._SA()}),pQ("api_error",{model:$,error:W,status_code:String(P),duration_ms:String(I),attempt:String(B)}),d6A(J,{success:!1,statusCode:P?parseInt(P):void 0,error:W,attempt:B});let Z=rlH();if(Z?.isTeleported&&!Z.hasLoggedFirstMessage)c("tengu_teleport_first_message_error",{session_id:Z.sessionId,error_type:C}),alH()}function m51({model:H,preNormalizedModel:$,messageCount:A,messageTokens:L,usage:I,durationMs:D,durationMsIncludingRetries:B,attempt:f,ttftMs:E,requestId:M,stopReason:G,costUSD:U,didFallBackToNonStreaming:X,querySource:J,gateway:F,queryTracking:Q,permissionMode:W,globalCacheStrategy:P,textContentLength:C,fastMode:Y}){let Z=tI(),q=process.argv.includes("-p")||process.argv.includes("--print");c("tengu_api_success",{model:H,...$!==H?{preNormalizedModel:$}:{},messageCount:A,messageTokens:L,inputTokens:I.input_tokens,outputTokens:I.output_tokens,cachedInputTokens:I.cache_read_input_tokens??0,uncachedInputTokens:I.cache_creation_input_tokens??0,durationMs:D,durationMsIncludingRetries:B,attempt:f,ttftMs:E??void 0,buildAgeMins:DSD(),provider:SR(),requestId:M??void 0,stop_reason:G??void 0,costUSD:U,didFallBackToNonStreaming:X,isNonInteractiveSession:Z,print:q,isTTY:process.stdout.isTTY??!1,querySource:J,...F?{gateway:F}:{},...Q?{queryChainId:Q.chainId,queryDepth:Q.depth}:{},permissionMode:W,...P?{globalCacheStrategy:P}:{},...C!==void 0?{textContentLength:C}:{},fastMode:Y,..._SA()})}function fSD({model:H,preNormalizedModel:$,start:A,startIncludingRetries:L,ttftMs:I,usage:D,attempt:B,messageCount:f,messageTokens:E,requestId:M,stopReason:G,didFallBackToNonStreaming:U,querySource:X,headers:J,costUSD:F,queryTracking:Q,permissionMode:W,newMessages:P,llmSpan:C,globalCacheStrategy:Y,fastMode:Z}){let q=J?PSA(J):void 0,O=P?P.reduce((d,k)=>d+k.message.content.reduce((n,GH)=>n+(GH.type==="text"?GH.text.length:0),0),0):void 0,j=Date.now()-A,u=Date.now()-L;kS$(u,j),m51({model:H,preNormalizedModel:$,messageCount:f,messageTokens:E,usage:D,durationMs:j,durationMsIncludingRetries:u,attempt:B,ttftMs:I,requestId:M,stopReason:G,costUSD:F,didFallBackToNonStreaming:U,querySource:X,gateway:q,queryTracking:Q,permissionMode:W,globalCacheStrategy:Y,textContentLength:O,fastMode:Z}),pQ("api_request",{model:H,input_tokens:String(D.input_tokens),output_tokens:String(D.output_tokens),cache_read_tokens:String(D.cache_read_input_tokens),cache_creation_tokens:String(D.cache_creation_input_tokens),cost_usd:String(F),duration_ms:String(j)});let y,g,h;if(zF()&&P)y=P.flatMap((d)=>d.message.content.filter((k)=>k.type==="text").map((k)=>k.text)).join(` `))return!0;let A=$.indexOf("#");if(A!==-1&&!(A>0&&$[A-1]==="s"))return!0;if(/^!/.test($)||/[/\d$]!/.test($))return!0;if(/\d\s*~\s*\d|,\s*~\s*\d|\$\s*~\s*\d/.test($))return!0;if(/^,/.test($))return!0;if(/,\s*[+-]/.test($))return!0;if(/s\\/.test($)||/\\[|#%@]/.test($))return!0;if(/\\\/.*[wW]/.test($))return!0;if(/\/[^/]*\s+[wWeE]/.test($))return!0;if(/^s\//.test($)&&!/^s\/[^/]*\/[^/]*\/[^/]*$/.test($))return!0;if(/^s./.test($)&&/[wWeE]$/.test($)){if(!/^s([^\\\n]).*?\1.*?\1[^wWeE]*$/.test($))return!0}if(/^[wW]\s*\S+/.test($)||/^\d+\s*[wW]\s*\S+/.test($)||/^\$\s*[wW]\s*\S+/.test($)||/^\/[^/]*\/[IMim]*\s*[wW]\s*\S+/.test($)||/^\d+,\d+\s*[wW]\s*\S+/.test($)||/^\d+,\$\s*[wW]\s*\S+/.test($)||/^\/[^/]*\/[IMim]*,\/[^/]*\/[IMim]*\s*[wW]\s*\S+/.test($))return!0;if(/^e/.test($)||/^\d+\s*e/.test($)||/^\$\s*e/.test($)||/^\/[^/]*\/[IMim]*\s*e/.test($)||/^\d+,\d+\s*e/.test($)||/^\d+,\$\s*e/.test($)||/^\/[^/]*\/[IMim]*,\/[^/]*\/[IMim]*\s*e/.test($))return!0;let L=$.match(/s([^\\\n]).*?\1.*?\1(.*?)$/);if(L){let D=L[2]||"";if(D.includes("w")||D.includes("W"))return!0;if(D.includes("e")||D.includes("E"))return!0}if($.match(/y([^\\\n])/)){if(/[wWeE]/.test($))return!0}return!1}function USD(H,$){let A=gF(H.command);for(let L of A){let I=L.trim();if(I.split(/\s+/)[0]!=="sed")continue;let B=$.mode==="acceptEdits";if(!WgH(I,{allowFileWrites:B}))return{behavior:"ask",message:"sed command requires approval (contains potentially dangerous operations)",decisionReason:{type:"other",reason:"sed command contains operations that require explicit approval (e.g., write commands, execute commands)"}}}return{behavior:"passthrough",message:"No dangerous sed operations detected"}}var EZ$=K(()=>{g3();EX()});function QX1(){return KX1}function JSD(H,$){switch($){case"none":return!1;case"number":return/^\d+$/.test(H);case"string":return!0;case"char":return H.length===1;case"{}":return H==="{}";case"EOF":return H==="EOF";default:return!1}}function VX1(H){let $=TE(H,(M)=>`$${M}`);if(!$.success)return!1;let A=$.tokens.map((M)=>{if(typeof M!=="string"){if(M=M,M.op==="glob")return M.pattern}return M});if(A.some((M)=>typeof M!=="string"))return!1;let I=A;if(I.length===0)return!1;let D,B=0,f=QX1();for(let[M]of Object.entries(f)){let G=M.split(" ");if(I.length>=G.length){let U=!0;for(let X=0;X1&&XSD.test(M)){let[G,...U]=M.split("="),X=U.join("=");if(!G)return!1;let J=D.safeFlags[G];if(!J){if(I[0]==="git"&&G.match(/^-\d+$/)){E++;continue}if((I[0]==="grep"||I[0]==="rg")&&G.startsWith("-")&&!G.startsWith("--")&&G.length>2){let F=G.substring(0,2),Q=G.substring(2);if(D.safeFlags[F]&&/^\d+$/.test(Q)){let W=D.safeFlags[F];if(W==="number"||W==="string")if(JSD(Q,W)){E++;continue}else return!1}}if(G.startsWith("-")&&!G.startsWith("--")&&G.length>2){for(let F=1;F=I.length||I[E+1]&&I[E+1].startsWith("-")&&I[E+1].length>1&&XSD.test(I[E+1]))return!1;F=I[E+1]||"",E+=2}if(J==="string"&&F.startsWith("-"))if(G==="--sort"&&I[0]==="git"&&F.match(/^-[a-zA-Z]/));else return!1;if(!JSD(F,J))return!1}}else E++}if(D.regex&&!D.regex.test(H))return!1;if(!D.regex&&/`/.test(H))return!1;if(!D.regex&&(I[0]==="rg"||I[0]==="grep")&&/[\n\r]/.test(H))return!1;if(D.additionalCommandIsDangerousCallback&&D.additionalCommandIsDangerousCallback(H))return!1;return!0}function PX1(H){return new RegExp(`^${H}(?:\\s|$)[^<>()$\`|{}&;\\n\\r]*$`)}function JZ$(H){if(oA()!=="windows")return!1;if(/\\\\[a-zA-Z0-9._\-:[\]%]+(?:@(?:\d+|ssl))?\\/i.test(H))return!0;if(/\/\/[a-zA-Z0-9._\-:[\]%]+(?:@(?:\d+|ssl))?\//i.test(H))return!0;if(/@SSL@\d+/i.test(H)||/@\d+@SSL/i.test(H))return!0;if(/DavWWWRoot/i.test(H))return!0;if(/^\\\\(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\\/]/.test(H)||/^\/\/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\\/]/.test(H))return!0;if(/^\\\\(\[[\da-fA-F:]+\])[\\/]/.test(H)||/^\/\/(\[[\da-fA-F:]+\])[\\/]/.test(H))return!0;return!1}function CX1(H){let $=!1,A=!1,L=!1;for(let I=0;I&1"))$=$.slice(0,-5).trim();if(JZ$($))return!1;if(CX1($))return!1;if(VX1($))return!0;for(let A of YX1)if(A.test($)){if($.includes("git")&&/\s-c[\s=]/.test($))return!1;if($.includes("git")&&/\s--exec-path[\s=]/.test($))return!1;if($.includes("git")&&/\s--config-env[\s=]/.test($))return!1;return!0}return!1}function ZX1(H){return/^git(?:\s|$)/.test(H)}function qX1(H){return gF(H).some(($)=>ZX1($.trim()))}function TX1(){let H=zH(),$=C$(),A=r3H.join($,".git");try{if(H.existsSync(A)){let B=H.statSync(A);if(B.isFile())return!1;if(B.isDirectory()){let f=r3H.join(A,"HEAD");if(H.existsSync(f))return!1}}}catch{}let L=r3H.join($,"HEAD"),I=r3H.join($,"objects"),D=r3H.join($,"refs");try{let B=H.existsSync(L),f=H.existsSync(I)&&H.statSync(I).isDirectory(),E=H.existsSync(D)&&H.statSync(D).isDirectory();return B||f||E}catch{return!1}}function FZ$(H,$){let{command:A}=H;if(!TE(A,(B)=>`$${B}`).success)return{behavior:"passthrough",message:"Command cannot be parsed, requires further permission checks"};if(Hb(A).behavior!=="passthrough")return{behavior:"passthrough",message:"Command is not read-only, requires further permission checks"};if(JZ$(A))return{behavior:"ask",message:"Command contains Windows UNC path that could be vulnerable to WebDAV attacks"};let I=qX1(A);if($&&I)return{behavior:"passthrough",message:"Compound commands with cd and git require permission checks for enhanced security"};if(I&&TX1())return{behavior:"passthrough",message:"Git commands in directories with bare repository structure require permission checks for enhanced security"};if(gF(A).every((B)=>{if(Hb(B).behavior!=="passthrough")return!1;return wX1(B)}))return{behavior:"allow",updatedInput:H};return{behavior:"passthrough",message:"Command is not read-only, requires further permission checks"}}var r3H,XSD,VgH,MZ$,GZ$,UZ$,XZ$,PgH,wSA,ZSA,KX1,WX1,_X1,YX1;var KZ$=K(()=>{g3();EX();fZ$();EZ$();Z9();PI();DL();r3H=require("path"),XSD=/^-[a-zA-Z0-9_-]/,VgH={"--all":"none","--branches":"none","--tags":"none","--remotes":"none"},MZ$={"--since":"string","--after":"string","--until":"string","--before":"string"},GZ$={"--oneline":"none","--graph":"none","--decorate":"none","--no-decorate":"none","--date":"string","--relative-date":"none"},UZ$={"--max-count":"number","-n":"number"},XZ$={"--stat":"none","--numstat":"none","--shortstat":"none","--name-only":"none","--name-status":"none"},PgH={"--color":"none","--no-color":"none"},wSA={"--patch":"none","-p":"none","--no-patch":"none","--no-ext-diff":"none","-s":"none"},ZSA={"--author":"string","--committer":"string","--grep":"string"},KX1={xargs:{safeFlags:{"-I":"{}","-i":"none","-n":"number","-P":"number","-L":"number","-s":"number","-E":"EOF","-e":"EOF","-0":"none","-t":"none","-r":"none","-x":"none","-d":"char"}},"git diff":{safeFlags:{...XZ$,...PgH,"--dirstat":"none","--summary":"none","--patch-with-stat":"none","--word-diff":"none","--word-diff-regex":"string","--color-words":"none","--no-renames":"none","--no-ext-diff":"none","--check":"none","--ws-error-highlight":"string","--full-index":"none","--binary":"none","--abbrev":"number","--break-rewrites":"none","--find-renames":"none","--find-copies":"none","--find-copies-harder":"none","--irreversible-delete":"none","--diff-algorithm":"string","--histogram":"none","--patience":"none","--minimal":"none","--ignore-space-at-eol":"none","--ignore-space-change":"none","--ignore-all-space":"none","--ignore-blank-lines":"none","--inter-hunk-context":"number","--function-context":"none","--exit-code":"none","--quiet":"none","--cached":"none","--staged":"none","--pickaxe-regex":"none","--pickaxe-all":"none","--no-index":"none","--relative":"string","--diff-filter":"string","-p":"none","-u":"none","-s":"none","-M":"none","-C":"none","-B":"none","-D":"none","-l":"none","-S":"none","-G":"none","-O":"none","-R":"none"}},"git log":{safeFlags:{...GZ$,...VgH,...MZ$,...UZ$,...XZ$,...PgH,...wSA,...ZSA,"--abbrev-commit":"none","--full-history":"none","--dense":"none","--sparse":"none","--simplify-merges":"none","--ancestry-path":"none","--source":"none","--first-parent":"none","--merges":"none","--no-merges":"none","--reverse":"none","--walk-reflogs":"none","--skip":"number","--max-age":"number","--min-age":"number","--no-min-parents":"none","--no-max-parents":"none","--follow":"none","--no-walk":"none","--left-right":"none","--cherry-mark":"none","--cherry-pick":"none","--boundary":"none","--topo-order":"none","--date-order":"none","--author-date-order":"none","--pretty":"string","--format":"string","--diff-filter":"string","-S":"string","-G":"string","--pickaxe-regex":"none","--pickaxe-all":"none"}},"git show":{safeFlags:{...GZ$,...XZ$,...PgH,...wSA,"--abbrev-commit":"none","--word-diff":"none","--word-diff-regex":"string","--color-words":"none","--pretty":"string","--format":"string","--first-parent":"none","--raw":"none","--diff-filter":"string","-m":"none","--quiet":"none"}},"git shortlog":{safeFlags:{...VgH,...MZ$,"-s":"none","--summary":"none","-n":"none","--numbered":"none","-e":"none","--email":"none","-c":"none","--committer":"none","--group":"string","--format":"string","--no-merges":"none","--author":"string"}},"git reflog":{safeFlags:{...GZ$,...VgH,...MZ$,...UZ$,...ZSA}},"git stash list":{safeFlags:{...GZ$,...VgH,...UZ$}},"git ls-remote":{safeFlags:{"--branches":"none","-b":"none","--tags":"none","-t":"none","--heads":"none","-h":"none","--refs":"none","--quiet":"none","-q":"none","--exit-code":"none","--get-url":"none","--symref":"none","--sort":"string","--server-option":"string","-o":"string"}},"git status":{safeFlags:{"--short":"none","-s":"none","--branch":"none","-b":"none","--porcelain":"none","--long":"none","--verbose":"none","-v":"none","--untracked-files":"string","-u":"string","--ignored":"none","--ignore-submodules":"string","--column":"none","--no-column":"none","--ahead-behind":"none","--no-ahead-behind":"none","--renames":"none","--no-renames":"none","--find-renames":"string","-M":"string"}},"git blame":{safeFlags:{...PgH,"-L":"string","--porcelain":"none","-p":"none","--line-porcelain":"none","--incremental":"none","--root":"none","--show-stats":"none","--show-name":"none","--show-number":"none","-n":"none","--show-email":"none","-e":"none","-f":"none","--date":"string","-w":"none","--ignore-rev":"string","--ignore-revs-file":"string","-M":"none","-C":"none","--score-debug":"none","--abbrev":"number","-s":"none","-l":"none","-t":"none"}},"git ls-files":{safeFlags:{"--cached":"none","-c":"none","--deleted":"none","-d":"none","--modified":"none","-m":"none","--others":"none","-o":"none","--ignored":"none","-i":"none","--stage":"none","-s":"none","--killed":"none","-k":"none","--unmerged":"none","-u":"none","--directory":"none","--no-empty-directory":"none","--eol":"none","--full-name":"none","--abbrev":"number","--debug":"none","-z":"none","-t":"none","-v":"none","-f":"none","--exclude":"string","-x":"string","--exclude-from":"string","-X":"string","--exclude-per-directory":"string","--exclude-standard":"none","--error-unmatch":"none","--recurse-submodules":"none"}},"git config --get":{safeFlags:{"--local":"none","--global":"none","--system":"none","--worktree":"none","--default":"string","--type":"string","--bool":"none","--int":"none","--bool-or-int":"none","--path":"none","--expiry-date":"none","-z":"none","--null":"none","--name-only":"none","--show-origin":"none","--show-scope":"none"}},"git remote show":{safeFlags:{"-n":"none"},regex:/^git remote show(?:\s+-n)?\s+[a-zA-Z0-9_-]+$/},"git remote":{safeFlags:{"-v":"none","--verbose":"none"},regex:/^git remote(?:\s+(?:-v|--verbose))?$/},"git merge-base":{safeFlags:{"--is-ancestor":"none","--fork-point":"none","--octopus":"none","--independent":"none","--all":"none"}},"git rev-parse":{safeFlags:{"--verify":"none","--short":"string","--abbrev-ref":"none","--symbolic":"none","--symbolic-full-name":"none","--show-toplevel":"none","--show-cdup":"none","--show-prefix":"none","--git-dir":"none","--git-common-dir":"none","--absolute-git-dir":"none","--show-superproject-working-tree":"none","--is-inside-work-tree":"none","--is-inside-git-dir":"none","--is-bare-repository":"none","--is-shallow-repository":"none","--is-shallow-update":"none","--path-prefix":"none"}},"git rev-list":{safeFlags:{...VgH,...MZ$,...UZ$,...ZSA,"--count":"none","--reverse":"none","--first-parent":"none","--ancestry-path":"none","--merges":"none","--no-merges":"none","--min-parents":"number","--max-parents":"number","--no-min-parents":"none","--no-max-parents":"none","--skip":"number","--max-age":"number","--min-age":"number","--walk-reflogs":"none","--oneline":"none","--abbrev-commit":"none","--pretty":"string","--format":"string","--abbrev":"number","--full-history":"none","--dense":"none","--sparse":"none","--source":"none","--graph":"none"}},"git describe":{safeFlags:{"--tags":"none","--match":"string","--exclude":"string","--long":"none","--abbrev":"number","--always":"none","--contains":"none","--first-match":"none","--exact-match":"none","--candidates":"number","--dirty":"none","--broken":"none"}},"git cat-file":{safeFlags:{"-t":"none","-s":"none","-p":"none","-e":"none","--batch-check":"none","--allow-undetermined-type":"none"}},"git for-each-ref":{safeFlags:{"--format":"string","--sort":"string","--count":"number","--contains":"string","--no-contains":"string","--merged":"string","--no-merged":"string","--points-at":"string"}},"git grep":{safeFlags:{"-e":"string","-E":"none","--extended-regexp":"none","-G":"none","--basic-regexp":"none","-F":"none","--fixed-strings":"none","-P":"none","--perl-regexp":"none","-i":"none","--ignore-case":"none","-v":"none","--invert-match":"none","-w":"none","--word-regexp":"none","-n":"none","--line-number":"none","-c":"none","--count":"none","-l":"none","--files-with-matches":"none","-L":"none","--files-without-match":"none","-h":"none","-H":"none","--heading":"none","--break":"none","--full-name":"none","--color":"none","--no-color":"none","-o":"none","--only-matching":"none","-A":"number","--after-context":"number","-B":"number","--before-context":"number","-C":"number","--context":"number","--and":"none","--or":"none","--not":"none","--max-depth":"number","--untracked":"none","--no-index":"none","--recurse-submodules":"none","--cached":"none","--threads":"number","-q":"none","--quiet":"none"}},"git stash show":{safeFlags:{...XZ$,...PgH,...wSA,"--word-diff":"none","--word-diff-regex":"string","--diff-filter":"string","--abbrev":"number"}},"git worktree list":{safeFlags:{"--porcelain":"none","-v":"none","--verbose":"none","--expire":"string"}},"git tag":{safeFlags:{"-l":"none","--list":"none","-n":"number","--contains":"string","--no-contains":"string","--merged":"string","--no-merged":"string","--sort":"string","--format":"string","--points-at":"string","--column":"none","--no-column":"none","-i":"none","--ignore-case":"none"}},"git branch":{safeFlags:{"-l":"none","--list":"none","-a":"none","--all":"none","-r":"none","--remotes":"none","-v":"none","-vv":"none","--verbose":"none","--color":"none","--no-color":"none","--column":"none","--no-column":"none","--abbrev":"number","--no-abbrev":"none","--contains":"string","--no-contains":"string","--merged":"none","--no-merged":"none","--points-at":"string","--sort":"string","--show-current":"none","-i":"none","--ignore-case":"none"},additionalCommandIsDangerousCallback:(H)=>{let $=H.split(/\s+/),A=new Set(["--contains","--no-contains","--points-at","--sort","--abbrev"]),L=new Set(["--merged","--no-merged"]),I=2,D="";while(I<$.length){let B=$[I];if(!B){I++;continue}if(B.startsWith("-"))if(B.includes("="))D=B.split("=")[0]||"",I++;else if(A.has(B))D=B,I+=2;else D=B,I++;else{let f=$.slice(2,I),E=f.includes("-l")||f.includes("--list"),M=L.has(D);if(!E&&!M)return!0;I++}}return!1}},file:{safeFlags:{"--brief":"none","-b":"none","--mime":"none","-i":"none","--mime-type":"none","--mime-encoding":"none","--apple":"none","--check-encoding":"none","-c":"none","--exclude":"string","--exclude-quiet":"string","--print0":"none","-0":"none","-f":"string","-F":"string","--separator":"string","--help":"none","--version":"none","-v":"none","--no-dereference":"none","-h":"none","--dereference":"none","-L":"none","--magic-file":"string","-m":"string","--keep-going":"none","-k":"none","--list":"none","-l":"none","--no-buffer":"none","-n":"none","--preserve-date":"none","-p":"none","--raw":"none","-r":"none","-s":"none","--special-files":"none","--uncompress":"none","-z":"none"}},sed:{safeFlags:{"--expression":"string","-e":"string","--quiet":"none","--silent":"none","-n":"none","--regexp-extended":"none","-r":"none","--posix":"none","-E":"none","--line-length":"number","-l":"number","--zero-terminated":"none","-z":"none","--separate":"none","-s":"none","--unbuffered":"none","-u":"none","--debug":"none","--help":"none","--version":"none"},additionalCommandIsDangerousCallback:(H)=>!WgH(H)},"pip list":{safeFlags:{"--outdated":"none","-o":"none","--uptodate":"none","-u":"none","--editable":"none","-e":"none","--local":"none","-l":"none","--user":"none","--pre":"none","--format":"string","--not-required":"none","--exclude-editable":"none","--include-editable":"none","--exclude":"string","--help":"none","-h":"none","--version":"none","-V":"none","--verbose":"none","-v":"none","--quiet":"none","-q":"none","--no-color":"none","--no-input":"none","--disable-pip-version-check":"none","--no-python-version-warning":"none"}},sort:{safeFlags:{"--ignore-leading-blanks":"none","-b":"none","--dictionary-order":"none","-d":"none","--ignore-case":"none","-f":"none","--general-numeric-sort":"none","-g":"none","--human-numeric-sort":"none","-h":"none","--ignore-nonprinting":"none","-i":"none","--month-sort":"none","-M":"none","--numeric-sort":"none","-n":"none","--random-sort":"none","-R":"none","--reverse":"none","-r":"none","--sort":"string","--stable":"none","-s":"none","--unique":"none","-u":"none","--version-sort":"none","-V":"none","--zero-terminated":"none","-z":"none","--key":"string","-k":"string","--field-separator":"string","-t":"string","--check":"none","-c":"none","--check-char-order":"none","-C":"none","--merge":"none","-m":"none","--buffer-size":"string","-S":"string","--parallel":"number","--batch-size":"number","--help":"none","--version":"none"}},man:{safeFlags:{"-a":"none","--all":"none","-d":"none","-f":"none","--whatis":"none","-h":"none","-k":"none","--apropos":"none","-l":"string","-w":"none","-S":"string","-s":"string"}},help:{safeFlags:{"-d":"none","-m":"none","-s":"none"}},"npm list":{safeFlags:{"--all":"none","-a":"none","--json":"none","--long":"none","-l":"none","--global":"none","-g":"none","--depth":"number","--omit":"string","--include":"string","--link":"none","--workspace":"string","-w":"string","--workspaces":"none","-ws":"none"}},"mcp-cli servers":{safeFlags:{"--json":"none"}},"mcp-cli tools":{safeFlags:{"--json":"none"}},"mcp-cli info":{safeFlags:{"--json":"none"}},"mcp-cli grep":{safeFlags:{"--json":"none","-i":"none","--ignore-case":"none"}},"mcp-cli resources":{safeFlags:{"--json":"none"}},"mcp-cli read":{safeFlags:{"--json":"none"}},netstat:{safeFlags:{"-a":"none","-L":"none","-l":"none","-n":"none","-f":"string","-g":"none","-i":"none","-I":"string","-s":"none","-r":"none","-m":"none","-v":"none"}},ps:{safeFlags:{"-e":"none","-A":"none","-a":"none","-d":"none","-N":"none","--deselect":"none","-f":"none","-F":"none","-l":"none","-j":"none","-y":"none","-w":"none","-ww":"none","--width":"number","-c":"none","-H":"none","--forest":"none","--headers":"none","--no-headers":"none","-n":"string","--sort":"string","-L":"none","-T":"none","-m":"none","-C":"string","-G":"string","-g":"string","-p":"string","--pid":"string","-q":"string","--quick-pid":"string","-s":"string","--sid":"string","-t":"string","--tty":"string","-U":"string","-u":"string","--user":"string","--help":"none","--info":"none","-V":"none","--version":"none"},additionalCommandIsDangerousCallback:(H)=>{return/\s[a-zA-Z]*e[a-zA-Z]*(?:\s|$)/.test(H)}},base64:{safeFlags:{"-d":"none","-D":"none","--decode":"none","-b":"number","--break":"number","-w":"number","--wrap":"number","-i":"string","--input":"string","--ignore-garbage":"none","-h":"none","--help":"none","--version":"none"}},grep:{safeFlags:{"-e":"string","--regexp":"string","-f":"string","--file":"string","-F":"none","--fixed-strings":"none","-G":"none","--basic-regexp":"none","-E":"none","--extended-regexp":"none","-P":"none","--perl-regexp":"none","-i":"none","--ignore-case":"none","--no-ignore-case":"none","-v":"none","--invert-match":"none","-w":"none","--word-regexp":"none","-x":"none","--line-regexp":"none","-c":"none","--count":"none","--color":"string","--colour":"string","-L":"none","--files-without-match":"none","-l":"none","--files-with-matches":"none","-m":"number","--max-count":"number","-o":"none","--only-matching":"none","-q":"none","--quiet":"none","--silent":"none","-s":"none","--no-messages":"none","-b":"none","--byte-offset":"none","-H":"none","--with-filename":"none","-h":"none","--no-filename":"none","--label":"string","-n":"none","--line-number":"none","-T":"none","--initial-tab":"none","-u":"none","--unix-byte-offsets":"none","-Z":"none","--null":"none","-z":"none","--null-data":"none","-A":"number","--after-context":"number","-B":"number","--before-context":"number","-C":"number","--context":"number","--group-separator":"string","--no-group-separator":"none","-a":"none","--text":"none","--binary-files":"string","-D":"string","--devices":"string","-d":"string","--directories":"string","--exclude":"string","--exclude-from":"string","--exclude-dir":"string","--include":"string","-r":"none","--recursive":"none","-R":"none","--dereference-recursive":"none","--line-buffered":"none","-U":"none","--binary":"none","--help":"none","-V":"none","--version":"none"}},rg:{safeFlags:{"-e":"string","--regexp":"string","-f":"string","-i":"none","--ignore-case":"none","-S":"none","--smart-case":"none","-F":"none","--fixed-strings":"none","-w":"none","--word-regexp":"none","-v":"none","--invert-match":"none","-c":"none","--count":"none","-l":"none","--files-with-matches":"none","--files-without-match":"none","-n":"none","--line-number":"none","-o":"none","--only-matching":"none","-A":"number","--after-context":"number","-B":"number","--before-context":"number","-C":"number","--context":"number","-H":"none","-h":"none","--heading":"none","--no-heading":"none","-q":"none","--quiet":"none","--column":"none","-g":"string","--glob":"string","-t":"string","--type":"string","-T":"string","--type-not":"string","--type-list":"none","--hidden":"none","--no-ignore":"none","-u":"none","-m":"number","--max-count":"number","-d":"number","--max-depth":"number","-a":"none","--text":"none","-z":"none","-L":"none","--follow":"none","--color":"string","--json":"none","--stats":"none","--help":"none","--version":"none","--debug":"none","--":"none"}},sha256sum:{safeFlags:{"-b":"none","--binary":"none","-t":"none","--text":"none","-c":"none","--check":"none","--ignore-missing":"none","--quiet":"none","--status":"none","--strict":"none","-w":"none","--warn":"none","--tag":"none","-z":"none","--zero":"none","--help":"none","--version":"none"}},sha1sum:{safeFlags:{"-b":"none","--binary":"none","-t":"none","--text":"none","-c":"none","--check":"none","--ignore-missing":"none","--quiet":"none","--status":"none","--strict":"none","-w":"none","--warn":"none","--tag":"none","-z":"none","--zero":"none","--help":"none","--version":"none"}},md5sum:{safeFlags:{"-b":"none","--binary":"none","-t":"none","--text":"none","-c":"none","--check":"none","--ignore-missing":"none","--quiet":"none","--status":"none","--strict":"none","-w":"none","--warn":"none","--tag":"none","-z":"none","--zero":"none","--help":"none","--version":"none"}},tree:{safeFlags:{"-a":"none","-d":"none","-l":"none","-f":"none","-x":"none","-L":"number","-R":"none","-P":"string","-I":"string","--gitignore":"none","--gitfile":"string","--ignore-case":"none","--matchdirs":"none","--metafirst":"none","--prune":"none","--info":"none","--infofile":"string","--noreport":"none","--charset":"string","--filelimit":"number","-q":"none","-N":"none","-Q":"none","-p":"none","-u":"none","-g":"none","-s":"none","-h":"none","--si":"none","--du":"none","-D":"none","--timefmt":"string","-F":"none","--inodes":"none","--device":"none","-v":"none","-t":"none","-c":"none","-U":"none","-r":"none","--dirsfirst":"none","--filesfirst":"none","--sort":"string","-i":"none","-A":"none","-S":"none","-n":"none","-C":"none","-X":"none","-J":"none","-H":"string","--nolinks":"none","--hintro":"string","--houtro":"string","-T":"string","--hyperlink":"none","--scheme":"string","--authority":"string","--fromfile":"none","--fromtabfile":"none","--fflinks":"none","--help":"none","--version":"none"}},date:{safeFlags:{"-d":"string","--date":"string","-r":"string","--reference":"string","-u":"none","--utc":"none","--universal":"none","-I":"none","--iso-8601":"string","-R":"none","--rfc-email":"none","--rfc-3339":"string","--debug":"none","--help":"none","--version":"none"},additionalCommandIsDangerousCallback:(H)=>{let $=TE(H,(D)=>`$${D}`);if(!$.success)return!0;let A=$.tokens.map((D)=>{if(typeof D==="string")return D;if("pattern"in D)return D.pattern;return}).filter((D)=>D!==void 0),L=new Set(["-d","--date","-r","--reference","--iso-8601","--rfc-3339"]),I=1;while(I{let $=TE(H,(L)=>`$${L}`);if(!$.success)return!0;return $.tokens.map((L)=>typeof L==="string"?L:("pattern"in L)?L.pattern:void 0).filter((L)=>L!==void 0).some((L)=>L==="--watch"||L==="-w")}},"docker compose ps":{safeFlags:{"--format":"string","--filter":"string","--quiet":"none","-q":"none","--services":"none","--status":"string","--all":"none","-a":"none","--no-trunc":"none","--orphans":"none"}},"docker compose logs":{safeFlags:{"--follow":"none","-f":"none","--tail":"string","-n":"string","--timestamps":"none","-t":"none","--no-color":"none","--no-log-prefix":"none","--since":"string","--until":"string"}},"docker compose top":{safeFlags:{}},"docker compose config":{safeFlags:{"--format":"string","--services":"none","--volumes":"none","--profiles":"none"}},"docker logs":{safeFlags:{"--follow":"none","-f":"none","--tail":"string","-n":"string","--timestamps":"none","-t":"none","--since":"string","--until":"string","--details":"none"}},"docker inspect":{safeFlags:{"--format":"string","-f":"string","--type":"string","--size":"none","-s":"none"}}};WX1=["echo","printf","wc","grep","head","tail"];_X1=["cal","uptime","cat","head","tail","wc","stat","strings","hexdump","od","nl","id","uname","free","df","du","locale","groups","nproc","docker ps","docker images","basename","dirname","realpath","cut","paste","tr","column","tac","rev","fold","expand","unexpand","readlink","diff","true","false","sleep","which","type"],YX1=new Set([..._X1.map(PX1),/^echo(?:\s+(?:'[^']*'|"[^"$<>\n\r]*"|[^|;&`$(){}><#\\!"'\s]+))*(?:\s+2>&1)?\s*$/,/^claude -h$/,/^claude --help$/,/^uniq(?:\s+(?:-[a-zA-Z]+|--[a-zA-Z-]+(?:=\S+)?|-[fsw]\s+\d+))*(?:\s|$)\s*$/,/^pwd$/,/^whoami$/,/^node -v$/,/^npm -v$/,/^python --version$/,/^python3 --version$/,/^history(?:\s+\d+)?\s*$/,/^alias$/,/^arch(?:\s+(?:--help|-h))?\s*$/,/^ip addr$/,/^ifconfig(?:\s+[a-zA-Z][a-zA-Z0-9_-]*)?\s*$/,/^jq(?!\s+.*(?:-f\b|--from-file|--rawfile|--slurpfile|--run-tests|-L\b|--library-path|\benv\b|\$ENV\b))(?:\s+(?:-[a-zA-Z]+|--[a-zA-Z-]+(?:=\S+)?))*(?:\s+'[^'`]*'|\s+"[^"`]*"|\s+[^-\s'"][^\s]*)+\s*$/,/^cd(?:\s+(?:'[^']*'|"[^"]*"|[^\s;|&`$(){}><#\\]+))?$/,/^ls(?:\s+[^<>()$`|{}&;\n\r]*)?$/,/^find(?:\s+(?:\\[()]|(?!-delete\b|-exec\b|-execdir\b|-ok\b|-okdir\b|-fprint0?\b|-fls\b|-fprintf\b)[^<>()$`|{}&;\n\r\s]|\s)+)?$/])});function FSD(H){if(!H)return!1;if(H.type==="assistant"){let $=_6(H.message.content);return $?.type==="text"||$?.type==="thinking"||$?.type==="redacted_thinking"}if(H.type==="user"){let $=H.message.content;if(!Array.isArray($)||$.length===0)return!1;return $.every((A)=>("type"in A)&&A.type==="tool_result")}return!1}function*qSA(H){switch(H.type){case"assistant":for(let $ of g5([H])){if(!Is($))continue;yield{type:"assistant",message:$.message,parent_tool_use_id:null,session_id:j$(),uuid:$.uuid,error:$.error}}return;case"progress":if(H.data.type==="agent_progress")for(let $ of g5([H.data.message]))switch($.type){case"assistant":if(!Is($))break;yield{type:"assistant",message:$.message,parent_tool_use_id:H.parentToolUseID,session_id:j$(),uuid:$.uuid,error:$.error};break;case"user":yield{type:"user",message:$.message,parent_tool_use_id:H.parentToolUseID,session_id:j$(),uuid:$.uuid,isSynthetic:$.isMeta||$.isVisibleInTranscriptOnly,tool_use_result:$.mcpMeta?{content:$.toolUseResult,...$.mcpMeta}:$.toolUseResult};break}else if(H.data.type==="bash_progress"){if(!A$(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_CONTAINER_ID)break;let $=H.parentToolUseID,A=Date.now(),L=_gH.get($)||0;if(A-L>=OX1){if(_gH.size>=NX1){let D=_gH.keys().next().value;if(D!==void 0)_gH.delete(D)}_gH.set($,A),yield{type:"tool_progress",tool_use_id:H.toolUseID,tool_name:"Bash",parent_tool_use_id:H.parentToolUseID,elapsed_time_seconds:H.data.elapsedTimeSeconds,session_id:j$(),uuid:H.uuid}}}break;case"user":for(let $ of g5([H]))yield{type:"user",message:$.message,parent_tool_use_id:null,session_id:j$(),uuid:$.uuid,isSynthetic:$.isMeta||$.isVisibleInTranscriptOnly,tool_use_result:$.mcpMeta?{content:$.toolUseResult,...$.mcpMeta}:$.toolUseResult};return;default:}}async function*KSD(H,$,A,L){let I=!uZ(),{permissionResult:D,assistantMessage:B}=H,{toolUseID:f}=D;if(!f)return;let E=B.message.content,M;if(Array.isArray(E)){for(let W of E)if(W.type==="tool_use"&&W.id===f){M=W;break}}if(!M)return;let{name:G,input:U}=M;if(!$.find((W)=>W.name===G))return;let J={...M,input:D.behavior==="allow"?D.updatedInput:U},F=async()=>({...D,decisionReason:{type:"mode",mode:"default"}});if(A.push(B),I)await $j(A);yield{...B,session_id:j$(),parent_tool_use_id:null};for await(let W of IZ$([J],[B],F,L))if(W.message){if(A.push(W.message),I)await $j(A);yield{...W.message,session_id:j$(),parent_tool_use_id:null}}}function D1H(H,$,A=zX1){let L=_m(A),I=new Map,D=new Map;for(let B of H)if(B.type==="assistant"&&Array.isArray(B.message.content)){for(let f of B.message.content)if(f.type==="tool_use"&&f.name===$B){let E=f.input;if(E?.file_path&&E?.offset===void 0&&E?.limit===void 0){let M=xD(E.file_path,$);I.set(f.id,M)}}else if(f.type==="tool_use"&&f.name===U1){let E=f.input;if(E?.file_path&&E?.content){let M=xD(E.file_path,$);D.set(f.id,{filePath:M,content:E.content})}}}for(let B of H)if(B.type==="user"&&Array.isArray(B.message.content)){for(let f of B.message.content)if(f.type==="tool_result"&&f.tool_use_id){let E=I.get(f.tool_use_id);if(E&&typeof f.content==="string"){let X=f.content.replace(/[\s\S]*?<\/system-reminder>/g,"").split(` `):"- (no user messages yet)";return iX1.replace("{human_messages}",A)}async function jSA(H,$,A,L){let I=L??Ls(H),D=A==="coordinator"?nX1(H.messages):rX1[A],B=async()=>({behavior:"deny",message:"No tools needed for suggestion",decisionReason:{type:"other",reason:"suggestion only"}}),f=await xw({promptMessages:[R$({content:D})],cacheSafeParams:I,canUseTool:B,querySource:"prompt_suggestion",forkLabel:"prompt_suggestion",overrides:{abortController:$},skipTranscript:!0}),E=f.messages.find((G)=>G.type==="assistant"),M=E?.type==="assistant"?E.requestId??null:null;for(let G of f.messages){if(G.type!=="assistant")continue;let U=G.message.content.find((X)=>X.type==="text");if(U?.type==="text"&&U.text.trim())return{suggestion:U.text.trim(),generationRequestId:M}}return{suggestion:null,generationRequestId:M}}function RSA(H,$){if(!H)return Aj("empty",void 0,$),!0;let A=H.toLowerCase(),L=H.trim().split(/\s+/).length,I=[["done",()=>A==="done"],["error_message",()=>A.startsWith("api error:")||A.startsWith("prompt is too long")||A.startsWith("request timed out")||A.startsWith("invalid api key")||A.startsWith("image was too large")],["prefixed_label",()=>/^\w+:\s/.test(H)],["too_few_words",()=>{if(L>=2)return!1;if(H.startsWith("/"))return!1;return!new Set(["yes","yeah","yep","yea","yup","sure","ok","okay","push","commit","deploy","stop","continue","check","exit","quit","no"]).has(A)}],["too_many_words",()=>L>12],["too_long",()=>H.length>=100],["multiple_sentences",()=>/[.!?]\s+[A-Z]/.test(H)],["has_formatting",()=>/[\n*]|\*\*/.test(H)],["evaluative",()=>/thanks|thank you|looks good|sounds good|that works|that worked|that's all|nice|great|perfect|makes sense|awesome|excellent/.test(A)],["claude_voice",()=>/^(let me|i'll|i've|i'm|i can|i would|i think|i notice|here's|here is|here are|that's|this is|this will|you can|you should|you could|sure,|of course|certainly)/i.test(H)]];for(let[D,B]of I)if(B())return Aj(D,H,$),!0;return!1}function Aj(H,$,A){let L=A??YZ$();c("tengu_prompt_suggestion",{outcome:"suppressed",reason:H,prompt_id:L,coordinator_mode:v8(),...!1})}var mX1="tengu_plank_river_frost",E1H=null,pX1=0.5,cX1=`[SUGGESTION MODE: Suggest what the user might naturally type next into Claude Code.] ${H}`,I=await xw({promptMessages:[R$({content:L})],cacheSafeParams:{...$,toolUseContext:A},canUseTool:async()=>({behavior:"deny",message:"Side questions cannot use tools",decisionReason:{type:"other",reason:"side_question"}}),querySource:"side_question",forkLabel:"side_question",maxTurns:1}),B=I.messages.find((E)=>E.type==="assistant")?.message?.content?.find((E)=>E.type==="text");return{response:B&&B.type==="text"?B.text.trim():null,usage:I.totalUsage}}var QJ1;var aSA=K(()=>{qS();_L();QJ1=/^\/btw\b/gi});var LjD={};XA(LjD,{call:()=>VJ1});function WJ1({question:H,context:$,onDone:A}){let[L,I]=IVH.useState(null),[D,B]=IVH.useState(null),[f,E]=IVH.useState(0);return VF(()=>E((M)=>M+1),L||D?null:80),WL((M,G)=>{if(G.escape||G.return||M===" ")A(void 0,{display:"skip"})}),IVH.useEffect(()=>{let M=nD();async function G(){try{let[U,X,J]=await Promise.all([HC($.options.tools,$.options.mainLoopModel,[],$.options.mcpClients),u5(),k5()]),F=await AjD({question:H,cacheSafeParams:{systemPrompt:U,userContext:X,systemContext:J,toolUseContext:$,forkContextMessages:$.messages}});if(!M.signal.aborted)if(F.response)I(F.response);else B("No response received")}catch(U){if(!M.signal.aborted)B(U.message||"Failed to get response")}}return G(),()=>{M.abort()}},[H,$]),jG.createElement(x,{flexDirection:"column",paddingLeft:2,marginTop:1},jG.createElement(x,null,jG.createElement(V,{color:"warning",bold:!0},"/btw"," "),jG.createElement(V,{dimColor:!0},H)),jG.createElement(x,{marginTop:1,marginLeft:2},D?jG.createElement(V,{color:"error"},D):L?jG.createElement(V,null,L):jG.createElement(x,null,jG.createElement(MbH,{frame:f,messageColor:"warning"}),jG.createElement(V,{color:"warning"},"Answering..."))),(L||D)&&jG.createElement(x,{marginTop:1},jG.createElement(V,{dimColor:!0},"Press Space, Enter, or Escape to dismiss")))}async function VJ1(H,$,A){let L=A?.trim();if(!L)return H("Usage: /btw ",{display:"system"}),null;return jG.createElement(WJ1,{question:L,context:$,onDone:H})}var jG,IVH;var IjD=K(()=>{xH();aSA();Ow();bT();k2A();s6();eE();jG=b(s(),1),IVH=b(s(),1)});var PJ1,oSA;var DjD=K(()=>{PJ1={type:"local-jsx",name:"btw",description:"Ask a quick side question without interrupting the main conversation",isEnabled:()=>process.env.ENABLE_BTW==="true",isHidden:!1,immediate:!0,argumentHint:"",load:()=>Promise.resolve().then(() => (IjD(),LjD)),userFacingName(){return"btw"}},oSA=PJ1});var BjD=()=>{};var fjD=()=>{};function DVH(H){let $=H;return $=$.replace(/"(sk-ant[^\s"']{24,})"/g,'"[REDACTED_API_KEY]"'),$=$.replace(/(?{let $={...H};if($&&typeof $.error==="string")$.error=DVH($.error);return $})}async function YJ1(){try{let H=v5();return await UjD.readFile(H,"utf-8")}catch{return null}}function XjD({abortSignal:H,messages:$,initialDescription:A,onDone:L,backgroundTasks:I={}}){let[D,B]=nw.useState("userInput"),[f,E]=nw.useState(0),[M,G]=nw.useState(A??""),[U,X]=nw.useState(null),[J,F]=nw.useState(null),[Q,W]=nw.useState({isGit:!1,gitState:null}),[P,C]=nw.useState(null),Y=QL().columns-4;nw.useEffect(()=>{async function O(){let j=await z6(),u=null;if(j)u=await v9L();W({isGit:j,gitState:u})}O()},[]);let Z=nw.useCallback(async()=>{B("submitting"),F(null),X(null);let O=MjD(),u=$C($)?.requestId??null,y=tSA($),g=sSA(I),h=[...new Set([...y,...g])],[p,d]=await Promise.all([HjA(h),YJ1()]),k=eSA(I),n={...p,...k},GH={latestAssistantMessageId:u,message_count:$.length,datetime:new Date().toISOString(),description:M,platform:OA.platform,gitRepo:Q.isGit,terminal:OA.terminal,version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,transcript:JJ($),errors:O,lastApiRequest:Mj$(),...Object.keys(n).length>0&&{subagentTranscripts:n},...d&&{rawTranscriptJsonl:d}},[HH,BH]=await Promise.all([ZJ1(GH,H),wJ1(M,H)]);if(C(BH),HH.success){if(HH.feedbackId)X(HH.feedbackId),c("tengu_bug_report_submitted",{feedback_id:HH.feedbackId,last_assistant_message_id:u});B("done")}else{if(HH.isZdrOrg)F("Feedback collection is not available for organizations with custom data retention policies.");else F("Could not submit feedback. Please try again later.");B("userInput")}},[M,Q.isGit,$]),q=nw.useCallback(()=>{if(D==="done"){if(J)L("Error submitting feedback / bug report",{display:"system"});else L("Feedback / bug report submitted",{display:"system"});return}L("Feedback / bug report cancelled",{display:"system"})},[D,J,L]);return BA("confirm:no",()=>{},{context:"Confirmation",isActive:D==="userInput"}),WL((O,j)=>{if(D==="done"){if(j.return&&P){let u=CJ1(U??"",P,M,MjD());HE(u)}if(J)L("Error submitting feedback / bug report",{display:"system"});else L("Feedback / bug report submitted",{display:"system"});return}if(J&&D!=="userInput"){L("Error submitting feedback / bug report",{display:"system"});return}if(D==="consent"&&(j.return||O===" "))Z()}),vI.createElement(BL,{title:"Submit Feedback / Bug Report",onCancel:q,inputGuide:(O)=>O.pending?vI.createElement(V,null,"Press ",O.keyName," again to exit"):D==="userInput"?vI.createElement(rA,null,vI.createElement(s$,{shortcut:"Enter",action:"continue"}),vI.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})):D==="consent"?vI.createElement(rA,null,vI.createElement(s$,{shortcut:"Enter",action:"submit"}),vI.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})):null},D==="userInput"&&vI.createElement(x,{flexDirection:"column",gap:1},vI.createElement(V,null,"Describe the issue below:"),vI.createElement(W9,{value:M,onChange:(O)=>{if(G(O),J)F(null)},columns:Y,onSubmit:()=>B("consent"),onExitMessage:()=>L("Feedback cancelled",{display:"system"}),cursorOffset:f,onChangeCursorOffset:E}),J&&vI.createElement(x,{flexDirection:"column",gap:1},vI.createElement(V,{color:"error"},J),vI.createElement(V,{dimColor:!0},"Edit and press Enter to retry, or Esc to cancel"))),D==="consent"&&vI.createElement(x,{flexDirection:"column"},vI.createElement(V,null,"This report will include:"),vI.createElement(x,{marginLeft:2,flexDirection:"column"},vI.createElement(V,null,"- Your feedback / bug description:"," ",vI.createElement(V,{dimColor:!0},M)),vI.createElement(V,null,"- Environment info:"," ",vI.createElement(V,{dimColor:!0},OA.platform,", ",OA.terminal,", v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)),Q.gitState&&vI.createElement(V,null,"- Git repo metadata:"," ",vI.createElement(V,{dimColor:!0},Q.gitState.branchName,Q.gitState.commitHash?`, ${Q.gitState.commitHash.slice(0,7)}`:"",Q.gitState.remoteUrl?` @ ${Q.gitState.remoteUrl}`:"",!Q.gitState.isHeadOnRemote&&", not synced",!Q.gitState.isClean&&", has local changes")),vI.createElement(V,null,"- Current session transcript")),vI.createElement(x,{marginTop:1},vI.createElement(V,{wrap:"wrap",dimColor:!0},"We will use your feedback to debug related issues or to improve"," ","Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future).")),vI.createElement(x,{marginTop:1},vI.createElement(V,null,"Press ",vI.createElement(V,{bold:!0},"Enter")," to confirm and submit."))),D==="submitting"&&vI.createElement(x,{flexDirection:"row",gap:1},vI.createElement(V,null,"Submitting report\u2026")),D==="done"&&vI.createElement(x,{flexDirection:"column"},J?vI.createElement(V,{color:"error"},J):vI.createElement(V,{color:"success"},"Thank you for your report!"),U&&vI.createElement(V,{dimColor:!0},"Feedback ID: ",U),vI.createElement(x,{marginTop:1},vI.createElement(V,null,"Press "),vI.createElement(V,{bold:!0},"Enter "),vI.createElement(V,null,"to open your browser and draft a GitHub issue, or any other key to close."))))}function CJ1(H,$,A,L){let I=DVH($),B=`**Bug Description** - Version: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION||"unknown"} `)[0]||"";if($.length<=60&&$.length>5)return $;let A=$.slice(0,60);if($.length>60){let L=A.lastIndexOf(" ");if(L>30)A=A.slice(0,L);A+="..."}return A.length<10?"Bug Report":A}function SZ$(H){if(H instanceof Error){let $=Error(DVH(H.message));if(H.stack)$.stack=DVH(H.stack);r($)}else{let $=DVH(String(H));r(Error($))}}async function ZJ1(H,$){try{await iW();let A=eG();if(A.error)return{success:!1};let L={"Content-Type":"application/json","User-Agent":Gn(),...A.headers},I=await nA.post("https://api.anthropic.com/api/claude_cli_feedback",{content:yH(H)},{headers:L,timeout:30000,signal:$});if(I.status===200){let D=I.data;if(D?.feedback_id)return{success:!0,feedbackId:D.feedback_id};return SZ$(Error("Failed to submit feedback: request did not return feedback_id")),{success:!1}}return SZ$(Error("Failed to submit feedback:"+I.status)),{success:!1}}catch(A){if(nA.isCancel(A))return{success:!1};if(nA.isAxiosError(A)&&A.response?.status===403){let L=A.response.data;if(L?.error?.type==="permission_error"&&L?.error?.message?.includes("Custom data retention settings"))return SZ$(Error("Cannot submit feedback because custom data retention settings are enabled")),{success:!1,isZdrOrg:!0}}return SZ$(A),{success:!1}}}var vI,nw,UjD,EjD=7250,_J1="https://github.com/anthropics/claude-code/issues";var JjD=K(()=>{xH();$I();S5();_$();Z1();t8();OB();_Q();EI();z$();dU();ry();F3();w1();_L();g$();rB();Z$();bB();lB();eB();j0();vI=b(s(),1),nw=b(s(),1),UjD=require("fs/promises")});var KjD={};XA(KjD,{renderFeedbackComponent:()=>FjD,call:()=>qJ1});function FjD(H,$,A,L="",I={}){return $jA.createElement(XjD,{abortSignal:$,messages:A,initialDescription:L,onDone:H,backgroundTasks:I})}async function qJ1(H,$,A){let L=A||"";return FjD(H,$.abortController.signal,$.messages,L)}var $jA;var QjD=K(()=>{JjD();$jA=b(s(),1)});var TJ1,AjA;var WjD=K(()=>{NA();XY();TJ1={aliases:["bug"],type:"local-jsx",name:"feedback",description:"Submit feedback about Claude Code",argumentHint:"[report]",isEnabled:()=>!(A$(process.env.CLAUDE_CODE_USE_BEDROCK)||A$(process.env.CLAUDE_CODE_USE_VERTEX)||A$(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.DISABLE_FEEDBACK_COMMAND||process.env.DISABLE_BUG_COMMAND||process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC||!1||!PK("allow_product_feedback")),isHidden:!1,load:()=>Promise.resolve().then(() => (QjD(),KjD)),userFacingName(){return"feedback"}},AjA=TJ1});function Ad(H){return!Array.isArray?qjD(H)==="[object Array]":Array.isArray(H)}function NJ1(H){if(typeof H=="string")return H;let $=H+"";return $=="0"&&1/H==-zJ1?"-0":$}function OJ1(H){return H==null?"":NJ1(H)}function Ab(H){return typeof H==="string"}function wjD(H){return typeof H==="number"}function xJ1(H){return H===!0||H===!1||SJ1(H)&&qjD(H)=="[object Boolean]"}function ZjD(H){return typeof H==="object"}function SJ1(H){return ZjD(H)&&H!==null}function rw(H){return H!==void 0&&H!==null}function LjA(H){return!H.trim().length}function qjD(H){return H==null?H===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(H)}class TjD{constructor(H){this._keys=[],this._keyMap={};let $=0;H.forEach((A)=>{let L=zjD(A);this._keys.push(L),this._keyMap[L.id]=L,$+=L.weight}),this._keys.forEach((A)=>{A.weight/=$})}get(H){return this._keyMap[H]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function zjD(H){let $=null,A=null,L=null,I=1,D=null;if(Ab(H)||Ad(H))L=H,$=PjD(H),A=IjA(H);else{if(!VjD.call(H,"name"))throw Error(vJ1("name"));let B=H.name;if(L=B,VjD.call(H,"weight")){if(I=H.weight,I<=0)throw Error(hJ1(B))}$=PjD(B),A=IjA(B),D=H.getFn}return{path:$,id:A,weight:I,src:L,getFn:D}}function PjD(H){return Ad(H)?H:H.split(".")}function IjA(H){return Ad(H)?H.join("."):H}function bJ1(H,$){let A=[],L=!1,I=(D,B,f)=>{if(!rw(D))return;if(!B[f])A.push(D);else{let E=B[f],M=D[E];if(!rw(M))return;if(f===B.length-1&&(Ab(M)||wjD(M)||xJ1(M)))A.push(OJ1(M));else if(Ad(M)){L=!0;for(let G=0,U=M.length;G{this._keysMap[$.id]=A})}create(){if(this.isCreated||!this.docs.length)return;if(this.isCreated=!0,Ab(this.docs[0]))this.docs.forEach((H,$)=>{this._addString(H,$)});else this.docs.forEach((H,$)=>{this._addObject(H,$)});this.norm.clear()}add(H){let $=this.size();if(Ab(H))this._addString(H,$);else this._addObject(H,$)}removeAt(H){this.records.splice(H,1);for(let $=H,A=this.size();${let D=L.getFn?L.getFn(H):this.getFn(H,L.path);if(!rw(D))return;if(Ad(D)){let B=[],f=[{nestedArrIndex:-1,value:D}];while(f.length){let{nestedArrIndex:E,value:M}=f.pop();if(!rw(M))continue;if(Ab(M)&&!LjA(M)){let G={v:M,i:E,n:this.norm.get(M)};B.push(G)}else if(Ad(M))M.forEach((G,U)=>{f.push({nestedArrIndex:U,value:G})})}A.$[I]=B}else if(Ab(D)&&!LjA(D)){let B={v:D,n:this.norm.get(D)};A.$[I]=B}}),this.records.push(A)}toJSON(){return{keys:this.keys,records:this.records}}}function NjD(H,$,{getFn:A=j9.getFn,fieldNormWeight:L=j9.fieldNormWeight}={}){let I=new yZ$({getFn:A,fieldNormWeight:L});return I.setKeys(H.map(zjD)),I.setSources($),I.create(),I}function cJ1(H,{getFn:$=j9.getFn,fieldNormWeight:A=j9.fieldNormWeight}={}){let{keys:L,records:I}=H,D=new yZ$({getFn:$,fieldNormWeight:A});return D.setKeys(L),D.setIndexRecords(I),D}function jZ$(H,{errors:$=0,currentLocation:A=0,expectedLocation:L=0,distance:I=j9.distance,ignoreLocation:D=j9.ignoreLocation}={}){let B=$/H.length;if(D)return B;let f=Math.abs(L-A);if(!I)return f?1:B;return B+f/I}function lJ1(H=[],$=j9.minMatchCharLength){let A=[],L=-1,I=-1,D=0;for(let B=H.length;D=$)A.push([L,I]);L=-1}}if(H[D-1]&&D-L>=$)A.push([L,D-1]);return A}function iJ1(H,$,A,{location:L=j9.location,distance:I=j9.distance,threshold:D=j9.threshold,findAllMatches:B=j9.findAllMatches,minMatchCharLength:f=j9.minMatchCharLength,includeMatches:E=j9.includeMatches,ignoreLocation:M=j9.ignoreLocation}={}){if($.length>G1H)throw Error(yJ1(G1H));let G=$.length,U=H.length,X=Math.max(0,Math.min(L,U)),J=D,F=X,Q=f>1||E,W=Q?Array(U):[],P;while((P=H.indexOf($,F))>-1){let j=jZ$($,{currentLocation:P,expectedLocation:X,distance:I,ignoreLocation:M});if(J=Math.min(j,J),F=P+G,Q){let u=0;while(u=g;k-=1){let n=k-1,GH=A[H.charAt(n)];if(Q)W[n]=+!!GH;if(p[k]=(p[k+1]<<1|1)&GH,j)p[k]|=(C[k+1]|C[k])<<1|1|C[k+1];if(p[k]&q){if(Y=jZ$($,{errors:j,currentLocation:n,expectedLocation:X,distance:I,ignoreLocation:M}),Y<=J){if(J=Y,F=n,F<=X)break;g=Math.max(1,2*X-F)}}}if(jZ$($,{errors:j+1,currentLocation:X,expectedLocation:X,distance:I,ignoreLocation:M})>J)break;C=p}let O={isMatch:F>=0,score:Math.max(0.001,Y)};if(Q){let j=lJ1(W,f);if(!j.length)O.isMatch=!1;else if(E)O.indices=j}return O}function nJ1(H){let $={};for(let A=0,L=H.length;A{this.chunks.push({pattern:U,alphabet:nJ1(U),startIndex:X})},G=this.pattern.length;if(G>G1H){let U=0,X=G%G1H,J=G-X;while(U{let{isMatch:W,score:P,indices:C}=iJ1(H,J,F,{location:L+Q,distance:I,threshold:D,findAllMatches:B,minMatchCharLength:f,includeMatches:A,ignoreLocation:E});if(W)U=!0;if(G+=P,W&&C)M=[...M,...C]});let X={isMatch:U,score:U?G/this.chunks.length:1};if(U&&A)X.indices=M;return X}}class Ld{constructor(H){this.pattern=H}static isMultiMatch(H){return _jD(H,this.multiRegex)}static isSingleMatch(H){return _jD(H,this.singleRegex)}search(){}}function _jD(H,$){let A=H.match($);return A?A[1]:null}function oJ1(H,$={}){return H.split(aJ1).map((A)=>{let L=A.trim().split(rJ1).filter((D)=>D&&!!D.trim()),I=[];for(let D=0,B=L.length;D{let D=Object.keys(I),B=eJ1(I);if(!B&&D.length>1&&!MjA(I))return L(CjD(I));if(HF1(I)){let E=B?I[EjA.PATH]:D[0],M=B?I[EjA.PATTERN]:I[E];if(!Ab(M))throw Error(RJ1(E));let G={keyId:IjA(E),pattern:M};if(A)G.searcher=fjA(M,$);return G}let f={children:[],operator:D[0]};return D.forEach((E)=>{let M=I[E];if(Ad(M))M.forEach((G)=>{f.children.push(L(G))})}),f};if(!MjA(H))H=CjD(H);return L(H)}function $F1(H,{ignoreFieldNorm:$=j9.ignoreFieldNorm}){H.forEach((A)=>{let L=1;A.matches.forEach(({key:I,norm:D,score:B})=>{let f=I?I.weight:null;L*=Math.pow(B===0&&f?Number.EPSILON:B,(f||1)*($?1:D))}),A.score=L})}function AF1(H,$){let A=H.matches;if($.matches=[],!rw(A))return;A.forEach((L)=>{if(!rw(L.indices)||!L.indices.length)return;let{indices:I,value:D}=L,B={indices:I,value:D};if(L.key)B.key=L.key.src;if(L.idx>-1)B.refIndex=L.idx;$.matches.push(B)})}function LF1(H,$){$.score=H.score}function IF1(H,$,{includeMatches:A=j9.includeMatches,includeScore:L=j9.includeScore}={}){let I=[];if(A)I.push(AF1);if(L)I.push(LF1);return H.map((D)=>{let{idx:B}=D,f={item:$[B],refIndex:B};if(I.length)I.forEach((E)=>{E(D,f)});return f})}class FC{constructor(H,$={},A){this.options={...j9,...$},this.options.useExtendedSearch,this._keyStore=new TjD(this.options.keys),this.setCollection(H,A)}setCollection(H,$){if(this._docs=H,$&&!($ instanceof yZ$))throw Error(jJ1);this._myIndex=$||NjD(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(H){if(!rw(H))return;this._docs.push(H),this._myIndex.add(H)}remove(H=()=>!1){let $=[];for(let A=0,L=this._docs.length;A-1)f=f.slice(0,$);return IF1(f,this._docs,{includeMatches:A,includeScore:L})}_searchStringList(H){let $=fjA(H,this.options),{records:A}=this._myIndex,L=[];return A.forEach(({v:I,i:D,n:B})=>{if(!rw(I))return;let{isMatch:f,score:E,indices:M}=$.searchIn(I);if(f)L.push({item:I,idx:D,matches:[{score:E,value:I,norm:B,indices:M}]})}),L}_searchLogical(H){let $=hjD(H,this.options),A=(B,f,E)=>{if(!B.children){let{keyId:G,searcher:U}=B,X=this._findMatches({key:this._keyStore.get(G),value:this._myIndex.getValueForItemAtKeyId(f,G),searcher:U});if(X&&X.length)return[{idx:E,item:f,matches:X}];return[]}let M=[];for(let G=0,U=B.children.length;G{if(rw(B)){let E=A($,B,f);if(E.length){if(!I[f])I[f]={idx:f,item:B,matches:[]},D.push(I[f]);E.forEach(({matches:M})=>{I[f].matches.push(...M)})}}}),D}_searchObjectList(H){let $=fjA(H,this.options),{keys:A,records:L}=this._myIndex,I=[];return L.forEach(({$:D,i:B})=>{if(!rw(D))return;let f=[];if(A.forEach((E,M)=>{f.push(...this._findMatches({key:E,value:D[M],searcher:$}))}),f.length)I.push({idx:B,item:D,matches:f})}),I}_findMatches({key:H,value:$,searcher:A}){if(!rw($))return[];let L=[];if(Ad($))$.forEach(({v:I,i:D,n:B})=>{if(!rw(I))return;let{isMatch:f,score:E,indices:M}=A.searchIn(I);if(f)L.push({score:E,key:H,value:I,idx:D,norm:B,indices:M})});else{let{v:I,n:D}=$,{isMatch:B,score:f,indices:E}=A.searchIn(I);if(B)L.push({score:f,key:H,value:I,norm:D,indices:E})}return L}}var zJ1=1/0,jJ1="Incorrect 'index' type",RJ1=(H)=>`Invalid value for key ${H}`,yJ1=(H)=>`Pattern length exceeds max of ${H}.`,vJ1=(H)=>`Missing ${H} property in key`,hJ1=(H)=>`Property 'weight' in key '${H}' must be a positive integer`,VjD,kJ1,uJ1,gJ1,mJ1,j9,pJ1,G1H=32,OjD,xjD,SjD,jjD,RjD,yjD,UjA,XjA,DjA,YjD,rJ1,aJ1="|",tJ1,BjA,RZ$,EjA,MjA=(H)=>!!(H[RZ$.AND]||H[RZ$.OR]),eJ1=(H)=>!!H[EjA.PATH],HF1=(H)=>!Ad(H)&&ZjD(H)&&!MjA(H),CjD=(H)=>({[RZ$.AND]:Object.keys(H).map(($)=>({[$]:H[$]}))});var zgH=K(()=>{VjD=Object.prototype.hasOwnProperty;kJ1={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},uJ1={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(H,$)=>H.score===$.score?H.idx<$.idx?-1:1:H.score<$.score?-1:1},gJ1={location:0,threshold:0.6,distance:100},mJ1={useExtendedSearch:!1,getFn:bJ1,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},j9={...uJ1,...kJ1,...gJ1,...mJ1},pJ1=/[^ ]+/g;OjD=class OjD extends Ld{constructor(H){super(H)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(H){let $=H===this.pattern;return{isMatch:$,score:$?0:1,indices:[0,this.pattern.length-1]}}};xjD=class xjD extends Ld{constructor(H){super(H)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(H){let A=H.indexOf(this.pattern)===-1;return{isMatch:A,score:A?0:1,indices:[0,H.length-1]}}};SjD=class SjD extends Ld{constructor(H){super(H)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(H){let $=H.startsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,this.pattern.length-1]}}};jjD=class jjD extends Ld{constructor(H){super(H)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(H){let $=!H.startsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,H.length-1]}}};RjD=class RjD extends Ld{constructor(H){super(H)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(H){let $=H.endsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[H.length-this.pattern.length,H.length-1]}}};yjD=class yjD extends Ld{constructor(H){super(H)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(H){let $=!H.endsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,H.length-1]}}};UjA=class UjA extends Ld{constructor(H,{location:$=j9.location,threshold:A=j9.threshold,distance:L=j9.distance,includeMatches:I=j9.includeMatches,findAllMatches:D=j9.findAllMatches,minMatchCharLength:B=j9.minMatchCharLength,isCaseSensitive:f=j9.isCaseSensitive,ignoreLocation:E=j9.ignoreLocation}={}){super(H);this._bitapSearch=new GjA(H,{location:$,threshold:A,distance:L,includeMatches:I,findAllMatches:D,minMatchCharLength:B,isCaseSensitive:f,ignoreLocation:E})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(H){return this._bitapSearch.searchIn(H)}};XjA=class XjA extends Ld{constructor(H){super(H)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(H){let $=0,A,L=[],I=this.pattern.length;while((A=H.indexOf(this.pattern,$))>-1)$=A+I,L.push([A,$-1]);let D=!!L.length;return{isMatch:D,score:D?0:1,indices:L}}};DjA=[OjD,XjA,SjD,jjD,yjD,RjD,xjD,UjA],YjD=DjA.length,rJ1=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;tJ1=new Set([UjA.type,XjA.type]);BjA=[];RZ$={AND:"$and",OR:"$or"},EjA={PATH:"$path",PATTERN:"$val"};FC.version="7.0.0";FC.createIndex=NjD;FC.parseIndex=cJ1;FC.config=j9;FC.parseQuery=hjD;sJ1(vjD)});var JjA={};XA(JjA,{default:()=>BF1,FileIndex:()=>DF1});var vZ$,DF1,BF1;var FjA=K(()=>{try{vZ$=pmA()}catch(H){vZ$=null}DF1=vZ$?.FileIndex,BF1=vZ$?.FileIndex});async function fF1(){if(hZ$)return null;if(NgH)return NgH;if(U8())try{return NgH=new(await Promise.resolve().then(() => (FjA(),JjA))).FileIndex,NgH}catch(H){return hZ$=!0,N(`[FileIndex] Rust module unavailable, falling back to Fuse.js: ${H instanceof Error?H.message:String(H)}`),r(H),null}else return hZ$=!0,N("[FileIndex] Not in bundled mode, using Fuse.js fallback"),null}function gjD(){NgH=null,hZ$=!1,EVH=null,MVH=[],U1H=null,_jA=0,OgH=null,QjA=null,bZ$=null,BVH=[],WjA=null,VjA=null}async function MF1(){let H=C$();if(QjA===H&&OgH!==null)return OgH;return OgH=XQ(H)!==null,QjA=H,OgH}function bjD(H,$,A){if(A===$)return H;return H.map((L)=>{let I=xJ.join($,L);return xJ.relative(A,I)})}function GF1(H){if(H.length===0)return;let $=PjA(H);if(EVH&&BVH.length>0){let A=PjA(BVH),L=[...BVH,...A,...H,...$];try{EVH.loadFromFileList(L),N(`[FileIndex] rebuilt Rust index with ${BVH.length} tracked + ${H.length} untracked files`)}catch(I){N(`[FileIndex] failed to rebuild Rust index: ${I}`)}}else{let A=[...H,...$],L=new Set(MVH);for(let I of A)if(!L.has(I))MVH.push(I);N(`[FileIndex] merged ${H.length} untracked files into JS cache`)}}function kjD(H,$){let A=`${H}:${$}`;if(VjA===A)return WjA;let L=zH(),I=[".ignore",".rgignore"],D=[...new Set([H,$])],B=ujD.default(),f=!1;for(let M of D)for(let G of I){let U=xJ.join(M,G);if(L.existsSync(U))try{let X=L.readFileSync(U,{encoding:"utf8"});B.add(X),f=!0,N(`[FileIndex] loaded ignore patterns from ${U}`)}catch{}}let E=f?B:null;return WjA=E,VjA=A,E}async function UF1(H,$){let A=Date.now();if(N("[FileIndex] getFilesUsingGit called"),!await MF1())return N("[FileIndex] not a git repo, returning null"),null;try{let L=XQ(C$());if(!L)return N("[FileIndex] git rev-parse --show-toplevel failed, falling back to ripgrep"),null;let I=C$(),D=Date.now(),B=await pD(cB(),["ls-files","--recurse-submodules"],{timeout:5000,abortSignal:H,cwd:L});if(N(`[FileIndex] git ls-files (tracked) took ${Date.now()-D}ms`),B.code!==0)return N(`[FileIndex] git ls-files failed (code=${B.code}, stderr=${B.stderr}), falling back to ripgrep`),null;let f=B.stdout.trim().split(` `))}}catch(D){if(A.signal.aborted)throw Error("Compaction canceled.");else if(D instanceof Error&&D.message===guH)throw Error(guH);else throw r(D instanceof Error?D:Error(String(D))),Error(`Error during compaction: ${D}`)}};var IRD=K(()=>{bT();mQ();Cp();Ow();mZ$();ow$();lt();Cw$();Nw$();q3H();_$();r0();dQ$();yE();FG()});var zF1,DRD;var BRD=K(()=>{NA();zF1={type:"local",name:"compact",description:"Clear conversation history but keep a summary in context. Optional: /compact [instructions for summarization]",isEnabled:()=>!A$(process.env.DISABLE_COMPACT),isHidden:!1,supportsNonInteractive:!0,argumentHint:"",load:()=>Promise.resolve().then(() => (IRD(),LRD)),userFacingName(){return"compact"}},DRD=zF1});function Zz({title:H,color:$,defaultTab:A,children:L,hidden:I,useFullWidth:D,selectedTab:B,onTabChange:f,banner:E,disableNavigation:M}){let{columns:G}=QL(),U=L.map((g)=>[g.props.id??g.props.title,g.props.title]),X=A?U.findIndex((g)=>A===g[0]):0,J=B!==void 0,[F,Q]=X1H.useState(X!==-1?X:0),W=J?U.findIndex((g)=>g[0]===B):-1,P=J?W!==-1?W:0:F,C=(g)=>{let h=(P+U.length+g)%U.length,p=U[h]?.[0];if(J&&f&&p)f(p);else Q(h)};bI({"tabs:next":()=>C(1),"tabs:previous":()=>C(-1)},{context:"Tabs",isActive:!I&&!M});let Y="(\u2190/\u2192 or tab to cycle)",Z=H?H.length+1:0,q=U.reduce((g,[,h])=>g+(h?.length??0)+2+1,0),O=Y.length,j=Z+q+O,u=D?Math.max(0,G-j-2):0,y=D?G-2:void 0;return ow.default.createElement(xjA.Provider,{value:{selectedTab:U[P][0],width:y}},ow.default.createElement(x,{flexDirection:"column"},!I&&ow.default.createElement(ow.default.Fragment,null,ow.default.createElement(V,{color:$},"\u2500".repeat(G-2)),ow.default.createElement(x,{flexDirection:"row",gap:1,paddingLeft:1},H!==void 0&&ow.default.createElement(V,{bold:!0,color:$},H),U.map(([g,h],p)=>ow.default.createElement(V,{key:g,backgroundColor:$&&P===p?$:void 0,color:$&&P===p?"inverseText":void 0,bold:P===p}," ",h," ")),ow.default.createElement(V,{dimColor:!0},"(\u2190/\u2192 or tab to cycle)"),u>0&&ow.default.createElement(V,null," ".repeat(u)))),E,ow.default.createElement(x,{width:y,paddingLeft:1,marginTop:I?0:1},L)))}function WU({title:H,id:$,children:A}){let{selectedTab:L,width:I}=X1H.useContext(xjA);if(L!==($??H))return null;return ow.default.createElement(x,{width:I},A)}function fRD(){let{width:H}=X1H.useContext(xjA);return H}var ow,X1H,xjA;var J1H=K(()=>{xH();$I();OB();ow=b(s(),1),X1H=b(s(),1),xjA=X1H.createContext({selectedTab:void 0,width:void 0})});function ERD({context:H,flat:$}={}){let A=QJ(),L=[];if(H?.readFileState)yx(H.readFileState).forEach((B)=>{let f=H.readFileState.get(B);if(f&&B.endsWith("/CLAUDE.md")&&!A.some((E)=>E.path===B))L.push({path:B,content:f.content,type:"Project",isNested:!0})});let I=[...A,...L];if(I.length===0)return null;if($)return SJ.createElement(x,{flexDirection:"row",columnGap:1,flexWrap:"wrap"},I.map((B,f)=>{let E=V9(B.path),M=B.isNested?"nested":kOA(B.type),G=f{let E=V9(B.path),M=B.isNested?"nested: ":`${kOA(B.type)}: `,G=B.parent?(D.get(B.parent)??0)+1:0;if(D.set(B.path,G),G===0)return SJ.createElement(V,{key:f},SJ.createElement(V,{dimColor:!0}," L "),`${M}${E}`);else{let U=" ".repeat(G-1);return SJ.createElement(V,{key:f}," ".repeat(M.length+2),U,SJ.createElement(V,{dimColor:!0}," L "),E)}}))}var SJ;var MRD=K(()=>{xH();mQ();rD();uOA();Y7();SJ=b(s(),1)});function cZ$(H){return{env:H?.env??process.env,home:H?.homedir??GRD.homedir()}}function lZ$(H){let{env:$,home:A}=cZ$(H);return $.XDG_STATE_HOME??SgH.join(A,".local","state")}function URD(H){let{env:$,home:A}=cZ$(H);return $.XDG_CACHE_HOME??SgH.join(A,".cache")}function XRD(H){let{env:$,home:A}=cZ$(H);return $.XDG_DATA_HOME??SgH.join(A,".local","share")}function JRD(H){let{home:$}=cZ$(H);return SgH.join($,".local","bin")}var GRD,SgH;var SjA=K(()=>{GRD=require("os"),SgH=require("path")});function QRD(){return(process.argv[1]||"").includes("/.claude/local/node_modules/")}async function NF1(){try{if(!zH().existsSync(Es))zH().mkdirSync(Es);if(!zH().existsSync(FRD))iL(FRD,yH({name:"claude-local",version:"0.0.1",private:!0},null,2),{encoding:"utf8",flush:!1});let H=GVH.join(Es,"claude");if(!zH().existsSync(H)){let $=`#!/bin/sh exec "${Es}/node_modules/.bin/claude" "$@"`;iL(H,$,{encoding:"utf8",flush:!1}),await jA("chmod",["+x",H])}return!0}catch(H){return r(H instanceof Error?H:Error(String(H))),!1}}async function jgH(H,$){try{if(!await NF1())return"install_failed";let A=$?$:H==="stable"?"stable":"latest",L=await pD("npm",["install",`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${A}`],{cwd:Es,maxBuffer:1e6});if(L.code!==0){let I=Error(`Failed to install Claude CLI package: ${L.stderr}`);return r(I),L.code===190?"in_progress":"install_failed"}return AA((I)=>({...I,installMethod:"local"})),"success"}catch(A){return r(A instanceof Error?A:Error(String(A))),"install_failed"}}function Ms(){return zH().existsSync(GVH.join(Es,"node_modules",".bin","claude"))}function UVH(){let H=process.env.SHELL||"";if(H.includes("zsh"))return"zsh";if(H.includes("bash"))return"bash";if(H.includes("fish"))return"fish";return"unknown"}var GVH,Es,FRD,KRD;var F1H=K(()=>{B0();_$();vA();DL();NA();Z$();Z$();GVH=require("path"),Es=GVH.join(UL(),"local"),FRD=GVH.join(Es,"package.json"),KRD=GVH.join(Es,"claude")});function Gs(){let H=process.env.ZDOTDIR||RgH.homedir();return{zsh:iZ$.join(H,".zshrc"),bash:iZ$.join(RgH.homedir(),".bashrc"),fish:iZ$.join(RgH.homedir(),".config/fish/config.fish")}}function nZ$(H){let $=!1;return{filtered:H.filter((L)=>{if(WRD.test(L)){let I=L.match(/alias\s+claude\s*=\s*["']([^"']+)["']/);if(!I)I=L.match(/alias\s+claude\s*=\s*([^#\n]+)/);if(I&&I[1]){if(I[1].trim()===KRD)return $=!0,!1}}return!0}),hadAlias:$}}function ygH(H){let $=zH();try{if(!$.existsSync(H))return null;return $.readFileSync(H,{encoding:"utf8"}).split(` `),{encoding:"utf8",flush:!0})}function jjA(){let H=Gs();for(let $ of Object.values(H)){let A=ygH($);if(!A)continue;for(let L of A)if(WRD.test(L)){let I=L.match(/alias\s+claude=["']?([^"'\s]+)/);if(I&&I[1])return I[1]}}return null}function VRD(){let H=jjA();if(!H)return null;let $=zH(),A=H.startsWith("~")?H.replace("~",RgH.homedir()):H;try{if($.existsSync(A)){let L=$.statSync(A);if(L.isFile()||L.isSymbolicLink())return H}}catch{}return null}var RgH,iZ$,WRD;var aZ$=K(()=>{DL();F1H();Z$();RgH=require("os"),iZ$=require("path"),WRD=/^\s*alias\s+claude\s*=/});async function CRD(){try{let H=await aS("tengu_version_config",{minVersion:"0.0.0"});if(H.minVersion&&sZ$.lt({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,H.minVersion))console.error(` It looks like your version of Claude Code (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}) needs an update. claude update `),L9(1)}catch(H){r(H)}}function JVH(H){let A=GB()?.minimumVersion;if(!A)return!1;let L=!sZ$.gte(H,A,{loose:!0});if(L)N(`Skipping update to ${H} - below minimumVersion ${A}`);return L}function K1H(){return _RD.join(UL(),".update.lock")}function SF1(){try{if(!zH().existsSync(UL()))zH().mkdirSync(UL());if(zH().existsSync(K1H())){let H=zH().statSync(K1H());if(Date.now()-H.mtimeMs$.abort(),5000);let A=H==="stable"?"stable":"latest",L=await pD("npm",["view",`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${A}`,"version","--prefer-online"],{abortSignal:$.signal,cwd:XVH.homedir()});if(L.code!==0){if(N(`npm view failed with code ${L.code}`),L.stderr)N(`npm stderr: ${L.stderr.trim()}`);else N("npm stderr: (empty)");if(L.stdout)N(`npm stdout: ${L.stdout.trim()}`);return null}return L.stdout.trim()}async function wRD(){let H=nD();setTimeout(()=>H.abort(),5000);let $=await pD("npm",["view",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL,"dist-tags","--json","--prefer-online"],{abortSignal:H.signal,cwd:XVH.homedir()});if($.code!==0)return N(`npm view dist-tags failed with code ${$.code}`),{latest:null,stable:null};try{let A=DA($.stdout.trim());return{latest:typeof A.latest==="string"?A.latest:null,stable:typeof A.stable==="string"?A.stable:null}}catch(A){return N(`Failed to parse dist-tags: ${A}`),{latest:null,stable:null}}}async function tZ$(H){try{return(await nA.get(`${OF1}/${H}`,{timeout:5000,responseType:"text"})).data.trim()}catch($){return N(`Failed to fetch ${H} from GCS: ${$}`),null}}async function ZRD(){let[H,$]=await Promise.all([tZ$("latest"),tZ$("stable")]);return{latest:H,stable:$}}async function vgH(H){if(!SF1())return r(new oZ$("Another process is currently installing an update")),c("tengu_auto_updater_lock_contention",{pid:process.pid,currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}),"in_progress";try{if(yF1(),!OA.isRunningWithBun()&&OA.isNpmFromWindowsPath())return r(Error("Windows NPM detected in WSL environment")),c("tengu_auto_updater_windows_npm_in_wsl",{currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}),console.error(` 3. Try updating again with 'claude update' `),"install_failed";let{hasPermissions:$}=await RjA();if(!$)return"no_permissions";let A=H?`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${H}`:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL,L=OA.isRunningWithBun()?"bun":"npm",I=await pD(L,["install","-g",A],{cwd:XVH.homedir()});if(I.code!==0){let D=new oZ$(`Failed to install new version of claude: ${I.stdout} ${I.stderr}`);return r(D),"install_failed"}return AA((D)=>({...D,installMethod:"global"})),"success"}finally{jF1()}}function yF1(){let H=Gs();for(let[,$]of Object.entries(H))try{let A=ygH($);if(!A)continue;let{filtered:L,hadAlias:I}=nZ$(A);if(I)rZ$($,L),N(`Removed claude alias from ${$}`)}catch(A){N(`Failed to remove alias from ${$}: ${A}`,{level:"error"})}}var PRD,_RD,sZ$,XVH,YRD,OF1="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases",oZ$,xF1=300000;var Us=K(()=>{z$();SD();eE();vA();E$();Z1();NA();lG();B0();Z$();DL();UU();_$();mL();aZ$();Z$();w1();PRD=require("fs"),_RD=require("path"),sZ$=b(OO(),1),XVH=require("os"),YRD=require("fs");oZ$=class oZ$ extends M2H{}});async function vF1(H="latest",$,A){let L=Date.now();try{let I=await nA.get(`${$}/${H}`,{timeout:30000,responseType:"text",...A}),D=Date.now()-L;return c("tengu_version_check_success",{latency_ms:D}),I.data.trim()}catch(I){let D=Date.now()-L,B=I instanceof Error?I.message:String(I),f;if(nA.isAxiosError(I)&&I.response)f=I.response.status;c("tengu_version_check_failure",{latency_ms:D,http_status:f,is_timeout:B.includes("timeout")});let E=Error(`Failed to fetch version from ${$}/${H}: ${B}`);throw r(E),E}}async function vjA(H){if(/^v?\d+\.\d+\.\d+(-\S+)?$/.test(H))return H.startsWith("v")?H.slice(1):H;let $=H;if($!=="stable"&&$!=="latest")throw Error(`Invalid channel: ${H}. Use 'stable' or 'latest'`);return vF1($,NRD)}async function bF1(H,$,A,L={}){let I;for(let D=1;D<=yjA;D++){let B=new AbortController,f,E=()=>{if(f)clearTimeout(f),f=void 0},M=()=>{E(),f=setTimeout(()=>{B.abort()},hF1)};try{M();let G=await nA.get(H,{timeout:300000,responseType:"arraybuffer",signal:B.signal,onDownloadProgress:()=>{M()},...L});E();let U=TRD.createHash("sha256");U.update(G.data);let X=U.digest("hex");if(X!==$)throw Error(`Checksum mismatch: expected ${$}, got ${X}`);(await import("fs")).writeFileSync(A,Buffer.from(G.data)),zRD.chmodSync(A,493);return}catch(G){E();let U=nA.isCancel(G);if(U)I=new ORD;else I=G instanceof Error?G:Error(String(G));if(U&&DsetTimeout(X,1000));continue}throw I}}throw I??Error("Download failed after all retries")}async function kF1(H,$,A,L){let I=zH();if(I.existsSync($))I.rmSync($,{recursive:!0,force:!0});let D=Bd(),B=Date.now();c("tengu_binary_download_attempt",{});let f;try{f=(await nA.get(`${A}/${H}/manifest.json`,{timeout:1e4,responseType:"json",...L})).data}catch(J){let F=Date.now()-B,Q=J instanceof Error?J.message:String(J),W;if(nA.isAxiosError(J)&&J.response)W=J.response.status;throw c("tengu_binary_manifest_fetch_failure",{latency_ms:F,http_status:W,is_timeout:Q.includes("timeout")}),r(Error(`Failed to fetch manifest from ${A}/${H}/manifest.json: ${Q}`)),J}let E=f.platforms[D];if(!E)throw c("tengu_binary_platform_not_found",{}),Error(`Platform ${D} not found in manifest for version ${H}`);let M=E.checksum,G=eZ$(D),U=`${A}/${H}/${D}/${G}`;I.mkdirSync($);let X=qRD.join($,G);try{await bF1(U,M,X,L||{});let J=Date.now()-B;c("tengu_binary_download_success",{latency_ms:J})}catch(J){let F=Date.now()-B,Q=J instanceof Error?J.message:String(J),W;if(nA.isAxiosError(J)&&J.response)W=J.response.status;throw c("tengu_binary_download_failure",{latency_ms:F,http_status:W,is_timeout:Q.includes("timeout"),is_checksum_mismatch:Q.includes("Checksum mismatch")}),r(Error(`Failed to download binary from ${U}: ${Q}`)),J}}async function xRD(H,$){return await kF1(H,$,NRD),"binary"}var qRD,TRD,zRD,NRD="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases",hF1=60000,yjA=3,ORD;var SRD=K(()=>{w1();DL();B0();E$();z$();hjA();_$();Z$();Z$();qRD=require("path"),TRD=require("crypto"),zRD=require("fs");ORD=class ORD extends Error{constructor(){super("Download stalled: no data received for 60 seconds");this.name="StallTimeoutError"}}});function $q$(H,$){return $.includes(H.id)||H.idLike.some((A)=>$.includes(A))}function Aq$(){let H=oA();if(H!=="macos"&&H!=="linux"&&H!=="wsl")return!1;let $=process.execPath||process.argv[0]||"";if($.includes("/Caskroom/"))return N(`Detected Homebrew cask installation: ${$}`),!0;return!1}function bjA(){if(oA()!=="windows")return!1;let $=process.execPath||process.argv[0]||"",A=[/Microsoft[/\\]WinGet[/\\]Packages/i,/Microsoft[/\\]WinGet[/\\]Links/i];for(let L of A)if(L.test($))return N(`Detected winget installation: ${$}`),!0;return!1}var jRD,Hq$,kjA,ujA,gjA,mjA,FVH;var Lq$=K(()=>{Z9();E$();B0();tD();jRD=require("fs/promises"),Hq$=o$(async()=>{try{let H=await jRD.readFile("/etc/os-release","utf8"),$=H.match(/^ID=["']?(\S+?)["']?\s*$/m),A=H.match(/^ID_LIKE=["']?(.+?)["']?\s*$/m);return{id:$?.[1]??"",idLike:A?.[1]?.split(" ")??[]}}catch{return null}});kjA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["arch"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("pacman",["-Qo",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected pacman installation: ${L.stdout.trim()}`),!0;return!1}),ujA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["debian"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("dpkg",["-S",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected deb installation: ${L.stdout.trim()}`),!0;return!1}),gjA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["fedora","rhel","suse"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("rpm",["-qf",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected rpm installation: ${L.stdout.trim()}`),!0;return!1}),mjA=o$(async()=>{if(oA()!=="linux")return!1;let $=await Hq$();if($&&!$q$($,["alpine"]))return!1;let A=process.execPath||process.argv[0]||"",L=await jA("apk",["info","--who-owns",A],{timeout:5000,useCwd:!1});if(L.code===0&&L.stdout)return N(`Detected apk installation: ${L.stdout.trim()}`),!0;return!1}),FVH=o$(async()=>{if(Aq$())return"homebrew";if(bjA())return"winget";if(await kjA())return"pacman";if(await mjA())return"apk";if(await ujA())return"deb";if(await gjA())return"rpm";return"unknown"})});function uF1(){let H=process.argv[1]||"",$=process.execPath||process.argv[0]||"";if(oA()==="windows")H=H.split(H4.win32.sep).join(H4.posix.sep),$=$.split(H4.win32.sep).join(H4.posix.sep);return[H,$]}async function Lb(){let[H]=uF1();if(U8()){if(Aq$()||bjA()||await kjA()||await ujA()||await gjA()||await mjA())return"package-manager";return"native"}if(QRD())return"npm-local";if(["/usr/local/lib/node_modules","/usr/lib/node_modules","/opt/homebrew/lib/node_modules","/opt/homebrew/bin","/usr/local/bin","/.nvm/versions/node/"].some((I)=>H.includes(I)))return"npm-global";if(H.includes("/npm/")||H.includes("/nvm/"))return"npm-global";let A=await fE("npm config get prefix",{shell:!0,reject:!1}),L=A.exitCode===0?A.stdout.trim():null;if(L&&H.startsWith(L))return"npm-global";return"unknown"}async function gF1(){if(U8()){let H=zH();try{return H.realpathSync(process.execPath)}catch{}try{let $=await x_("claude");if($)return $}catch{}if(H.existsSync(H4.join(Xs.homedir(),".local/bin/claude")))return H4.join(Xs.homedir(),".local/bin/claude");return"native"}try{return process.argv[0]||"unknown"}catch{return"unknown"}}function hgH(){try{if(U8())return process.execPath||"unknown";return process.argv[1]||"unknown"}catch{return"unknown"}}async function mF1(){let H=zH(),$=[],A=H4.join(Xs.homedir(),".claude","local");if(Ms())$.push({type:"npm-local",path:A});let L=["@anthropic-ai/claude-code"];if({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL!=="@anthropic-ai/claude-code")L.push({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL);let I=await jA("npm",["-g","config","get","prefix"]);if(I.code===0&&I.stdout){let f=I.stdout.trim(),E=oA()==="windows",M=E?H4.join(f,"claude"):H4.join(f,"bin","claude");if(H.existsSync(M)){let G=!1;try{if(H.realpathSync(M).includes("/Caskroom/"))G=Aq$()}catch{}if(!G)$.push({type:"npm-global",path:M})}else for(let G of L){let U=E?H4.join(f,"node_modules",G):H4.join(f,"lib","node_modules",G);if(H.existsSync(U))$.push({type:"npm-global-orphan",path:U})}}let D=H4.join(Xs.homedir(),".local","bin","claude");if(H.existsSync(D))$.push({type:"native",path:D});if(M$().installMethod==="native"){let f=H4.join(Xs.homedir(),".local","share","claude");if(H.existsSync(f)&&!$.some((E)=>E.type==="native"))$.push({type:"native",path:f})}return $}async function pF1(H){let $=[],A=M$();if(H==="development")return $;if(H==="native"){let B=(process.env.PATH||"").split(H4.delimiter),f=Xs.homedir(),E=H4.join(f,".local","bin"),M=E;if(oA()==="windows")M=E.split(H4.win32.sep).join(H4.posix.sep);if(!B.some((U)=>{let X=U;if(oA()==="windows")X=U.split(H4.win32.sep).join(H4.posix.sep);let J=X.replace(/\/+$/,""),F=U.replace(/[/\\]+$/,"");return J===M||F==="~/.local/bin"||F==="$HOME/.local/bin"}))if(oA()==="windows"){let X=E.split(H4.posix.sep).join(H4.win32.sep);$.push({issue:`Native installation exists but ${X} is not in your PATH`,fix:"Add it by opening: System Properties \u2192 Environment Variables \u2192 Edit User PATH \u2192 New \u2192 Add the path above. Then restart your terminal."})}else{let X=UVH(),F=Gs()[X],Q=F?F.replace(Xs.homedir(),"~"):"your shell config file";$.push({issue:"Native installation exists but ~/.local/bin is not in your PATH",fix:`Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${Q} then open a new terminal or run: source ${Q}`})}}if(!A$(process.env.DISABLE_INSTALLATION_CHECKS)){if(H==="npm-local"&&A.installMethod!=="local")$.push({issue:`Running from local installation but config install method is '${A.installMethod}'`,fix:"Consider using native installation: claude install"});if(H==="native"&&A.installMethod!=="native")$.push({issue:`Running native installation but config install method is '${A.installMethod}'`,fix:"Run claude install to update configuration"})}if(H==="npm-global"&&Ms())$.push({issue:"Local installation exists but not being used",fix:"Consider using native installation: claude install"});let L=jjA(),I=VRD();if(H==="npm-local"){if(!await x_("claude")&&!I)if(L)$.push({issue:"Local installation not accessible",fix:`Alias exists but points to invalid target: ${L}. Update alias: alias claude="~/.claude/local/claude"`});else $.push({issue:"Local installation not accessible",fix:'Create alias: alias claude="~/.claude/local/claude"'})}return $}function dF1(){if(oA()!=="linux")return[];let H=[],$=vL.getLinuxGlobPatternWarnings();if($.length>0){let A=$.slice(0,3).join(", "),L=$.length-3,I=L>0?`${A} (${L} more)`:A;H.push({issue:"Glob patterns in sandbox permission rules are not fully supported on Linux",fix:`Found ${$.length} pattern(s): ${I}. On Linux, glob patterns in Edit/Read rules will be ignored.`})}return H}async function W1H(){let H=await Lb(),$={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION?{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION:"unknown",A=await gF1(),L=hgH(),I=await mF1(),D=await pF1(H);if(D.push(...dF1()),H==="native"){let J=I.filter((Q)=>Q.type==="npm-global"||Q.type==="npm-global-orphan"||Q.type==="npm-local"),F=oA()==="windows";for(let Q of J)if(Q.type==="npm-global"){let W="npm -g uninstall @anthropic-ai/claude-code";if({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL!=="@anthropic-ai/claude-code")W+=` && npm -g uninstall ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}`;D.push({issue:`Leftover npm global installation at ${Q.path}`,fix:`Run: ${W}`})}else if(Q.type==="npm-global-orphan")D.push({issue:`Orphaned npm global package at ${Q.path}`,fix:F?`Run: rmdir /s /q "${Q.path}"`:`Run: rm -rf ${Q.path}`});else if(Q.type==="npm-local")D.push({issue:`Leftover npm local installation at ${Q.path}`,fix:F?`Run: rmdir /s /q "${Q.path}"`:`Run: rm -rf ${Q.path}`})}let f=M$().installMethod||"not set",E=null;if(H==="npm-global"){if(E=(await RjA()).hasPermissions,!E&&!KVH())D.push({issue:"Insufficient permissions for auto-updates",fix:"Do one of: (1) Re-install node without sudo, or (2) Use `claude install` for native installation"})}let M=mDL(),G={working:M.working??!0,mode:M.mode,systemPath:M.mode==="system"?M.path:null},U=H==="package-manager"?await FVH():void 0;return{installationType:H,version:$,installationPath:A,invokedBinary:L,configInstallMethod:f,autoUpdates:(()=>{let J=KVH();return J?`disabled (${J})`:"enabled"})(),hasUpdatePermissions:E,multipleInstallations:I,warnings:D,packageManager:U,ripgrepStatus:G}}var Xs,H4;var Ib=K(()=>{DL();PI();F1H();vA();Us();aZ$();Z9();B0();O_();CR();EM();NA();Lq$();Zk();Xs=require("os"),H4=require("path")});function V1H(){if(A$(void 0))return!0;if(BE(void 0))return!1;return NL("tengu_pid_based_version_locking",!1)}function Iq$(H){if(H<=1)return!1;try{return process.kill(H,0),!0}catch{return!1}}function lF1(H,$){if(!Iq$(H))return!1;if(H===process.pid)return!0;try{let A=SZI(H);if(!A)return!0;let L=A.toLowerCase(),I=$.toLowerCase();return L.includes("claude")||L.includes(I)}catch{return!0}}function bgH(H){let $=zH();try{if(!$.existsSync(H))return null;let A=$.readFileSync(H,{encoding:"utf8"});if(!A||A.trim()==="")return null;let L=DA(A);if(typeof L.pid!=="number"||!L.version||!L.execPath)return null;return L}catch{return null}}function Dq$(H){let $=bgH(H);if(!$)return!1;let{pid:A,execPath:L}=$;if(!Iq$(A))return!1;if(!lF1(A,L))return N(`Lock PID ${A} is running but does not appear to be Claude - treating as stale`),!1;let I=zH();try{let D=I.statSync(H);if(Date.now()-D.mtimeMs>cF1){if(!Iq$(A))return!1}}catch{}return!0}function iF1(H,$){let A=zH(),L=`${H}.tmp.${process.pid}.${Date.now()}`;try{iL(L,yH($,null,2),{encoding:"utf8",flush:!0}),A.renameSync(L,H)}catch(I){try{if(A.existsSync(L))A.unlinkSync(L)}catch{}throw I}}async function RRD(H,$){let A=zH(),L=kgH.basename(H);if(Dq$($)){let D=bgH($);return N(`Cannot acquire lock for ${L} - held by PID ${D?.pid}`),null}let I={pid:process.pid,version:L,execPath:process.execPath,acquiredAt:Date.now()};try{if(iF1($,I),bgH($)?.pid!==process.pid)return null;return N(`Acquired PID lock for ${L} (PID ${process.pid})`),()=>{try{if(bgH($)?.pid===process.pid)A.unlinkSync($),N(`Released PID lock for ${L}`)}catch(B){N(`Failed to release lock for ${L}: ${B}`)}}}catch(D){return N(`Failed to acquire lock for ${L}: ${D}`),null}}async function yRD(H,$){let A=await RRD(H,$);if(!A)return!1;let L=()=>{try{A()}catch{}};return process.on("exit",L),process.on("SIGINT",L),process.on("SIGTERM",L),!0}async function vRD(H,$,A){let L=await RRD(H,$);if(!L)return!1;try{return await A(),!0}finally{L()}}function pjA(H){let $=zH(),A=[];if(!$.existsSync(H))return A;try{let L=$.readdirStringSync(H).filter((I)=>I.endsWith(".lock"));for(let I of L){let D=kgH.join(H,I),B=bgH(D);if(B)A.push({version:B.version,pid:B.pid,isProcessRunning:Iq$(B.pid),execPath:B.execPath,acquiredAt:new Date(B.acquiredAt),lockFilePath:D})}}catch(L){r(L instanceof Error?L:Error(`Failed to get lock info: ${L}`))}return A}function Bq$(H){let $=zH(),A=0;if(!$.existsSync(H))return 0;try{let L=$.readdirStringSync(H).filter((I)=>I.endsWith(".lock"));for(let I of L){let D=kgH.join(H,I);try{if($.lstatSync(D).isDirectory())$.rmSync(D,{recursive:!0,force:!0}),A++,N(`Cleaned up legacy directory lock: ${I}`);else if(!Dq$(D))$.unlinkSync(D),A++,N(`Cleaned up stale lock: ${I}`)}catch{}}}catch(L){r(L instanceof Error?L:Error(`Failed to cleanup stale locks: ${L}`))}return A}var kgH,cF1=7200000;var djA=K(()=>{DL();E$();_$();TX$();SD();NA();Z$();Z$();kgH=require("path")});function Bd(){let H=OA.platform,$="x64";if(H==="linux"&&YY.isMuslEnvironment())return"linux-x64-musl";return`${H}-x64`}function eZ$(H){return H.startsWith("win32")?"claude.exe":"claude"}function Fs(){let H=Bd(),$=eZ$(H);return{versions:B9.join(XRD(),"claude","versions"),staging:B9.join(URD(),"claude","staging"),locks:B9.join(lZ$(),"claude","locks"),executable:B9.join(JRD(),$)}}async function Js(H){try{let $=await $D.stat(H);if(!$.isFile()||$.size===0)return!1;return await $D.access(H,m3.constants.X_OK),!0}catch{return!1}}async function bRD(H){let $=Fs(),A=[$.versions,$.staging,$.locks];await Promise.all(A.map((D)=>$D.mkdir(D,{recursive:!0})));let L=B9.dirname($.executable);await $D.mkdir(L,{recursive:!0});let I=B9.join($.versions,H);try{await $D.stat(I)}catch{await $D.writeFile(I,"",{encoding:"utf8"})}return{stagingPath:B9.join($.staging,H),installPath:I}}async function nF1(H,$,A=0){let L=Fs(),I=njA(L,H);if(await $D.mkdir(L.locks,{recursive:!0}),V1H()){let B=0,f=A+1,E=A>0?1000:100,M=A>0?5000:500;while(B{try{await $()}catch(U){throw r(U instanceof Error?U:Error(String(U))),U}}))return c("tengu_version_lock_acquired",{is_pid_based:!0,is_lifetime_lock:!1,attempts:B+1}),!0;if(B++,BsetTimeout(X,U))}}return c("tengu_version_lock_failed",{is_pid_based:!0,is_lifetime_lock:!1,attempts:f}),fq$(H,Error("Lock held by another process")),!1}let D=null;try{try{D=await Eq$.default.lock(H,{stale:ijA,retries:{retries:A,minTimeout:A>0?1000:100,maxTimeout:A>0?5000:500},lockfilePath:I,onCompromised:(B)=>{N(`NON-FATAL: Version lock was compromised during operation: ${B.message}`,{level:"info"})}})}catch(B){return c("tengu_version_lock_failed",{is_pid_based:!1,is_lifetime_lock:!1}),fq$(H,B),!1}try{return await $(),c("tengu_version_lock_acquired",{is_pid_based:!1,is_lifetime_lock:!1}),!0}catch(B){throw r(B instanceof Error?B:Error(String(B))),B}}finally{if(D)await D()}}async function kRD(H,$){await $D.mkdir(B9.dirname($),{recursive:!0});let A=`${$}.tmp.${process.pid}.${Date.now()}`;try{await $D.copyFile(H,A),await $D.chmod(A,493),await $D.rename(A,$),N(`Atomically installed binary to ${$}`)}catch(L){try{await $D.unlink(A)}catch{}throw L}}async function rF1(H,$){try{let A=B9.join(H,"node_modules","@anthropic-ai"),I=(await $D.readdir(A)).find((B)=>B.startsWith("claude-cli-native-"));if(!I)throw c("tengu_native_install_package_failure",{stage_find_package:!0,error_package_not_found:!0}),Error("Could not find platform-specific native package");let D=B9.join(A,I,"cli");try{await $D.stat(D)}catch{throw c("tengu_native_install_package_failure",{stage_binary_exists:!0,error_binary_not_found:!0}),Error("Native binary not found in staged package")}await kRD(D,$),await $D.rm(H,{recursive:!0,force:!0}),c("tengu_native_install_package_success",{})}catch(A){let L=A instanceof Error?A.message:String(A);if(!L.includes("Could not find platform-specific")&&!L.includes("Native binary not found"))c("tengu_native_install_package_failure",{stage_atomic_move:!0,error_move_failed:!0});throw r(A instanceof Error?A:Error(L)),A}}async function aF1(H,$){try{let A=Bd(),L=eZ$(A),I=B9.join(H,L);try{await $D.stat(I)}catch{throw c("tengu_native_install_binary_failure",{stage_binary_exists:!0,error_binary_not_found:!0}),Error("Staged binary not found")}await kRD(I,$),await $D.rm(H,{recursive:!0,force:!0}),c("tengu_native_install_binary_success",{})}catch(A){let L=A instanceof Error?A.message:String(A);if(!L.includes("Staged binary not found"))c("tengu_native_install_binary_failure",{stage_atomic_move:!0,error_move_failed:!0});throw r(A instanceof Error?A:Error(L)),A}}async function oF1(H,$,A){if(A==="npm")await rF1(H,$);else await aF1(H,$)}async function tF1(H,$){let{stagingPath:A,installPath:L}=await bRD(H),{executable:I}=Fs(),D=`${A}.${process.pid}.${Date.now()}`,B=!await uRD(H)||$;if(B){N($?`Force reinstalling native installer version ${H}`:`Downloading native installer version ${H}`);let f=await xRD(H,D);await oF1(D,L,f)}else N(`Version ${H} already installed, updating symlink`);if(await eF1(I),await HK1(I,L),!await Js(I)){let f=!1;try{await $D.stat(L),f=!0}catch{}throw Error(`Failed to create executable at ${I}. Source file exists: ${f}. Check write permissions to ${I}.`)}return B}async function uRD(H){let{installPath:$}=await bRD(H);return Js($)}async function sF1(H,$=!1){let A=Date.now(),L=await vjA(H),{executable:I}=Fs();if(N(`Checking for native installer update to version ${L}`),!$&&L==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION&&await uRD(L)&&await Js(I))return N(`Found ${L} at ${I}, skipping install`),c("tengu_native_update_complete",{latency_ms:Date.now()-A,was_new_install:!1,was_force_reinstall:!1,was_already_running:!0}),{success:!0};if(!$&&JVH(L))return c("tengu_native_update_skipped_minimum_version",{latency_ms:Date.now()-A,target_version:L}),{success:!0};let D=!1,B;return D=await tF1(L,$),B=Date.now()-A,c("tengu_native_update_complete",{latency_ms:B,was_new_install:D,was_force_reinstall:$}),N(`Successfully updated to version ${L}`),{success:!0}}async function eF1(H){try{if((await $D.stat(H)).isDirectory()){if((await $D.readdir(H)).length===0)await $D.rmdir(H),N(`Removed empty directory at ${H}`)}}catch($){N(`Could not remove empty directory at ${H}: ${$}`)}}async function HK1(H,$){if(Bd().startsWith("win32"))try{let B=B9.dirname(H);await $D.mkdir(B,{recursive:!0});let f=!1;try{await $D.stat(H),f=!0}catch{}if(f){try{let M=await $D.stat(H),G=await $D.stat($);if(M.size===G.size)return!1}catch{}let E=`${H}.old.${Date.now()}`;await $D.rename(H,E);try{await $D.copyFile($,H);try{await $D.unlink(E)}catch{}}catch(M){try{await $D.rename(E,H)}catch(G){let U=Error(`Failed to restore old executable: ${G}`,{cause:M});throw r(U),U}throw M}}else{try{await $D.stat($)}catch{throw Error(`Source file does not exist: ${$}`)}await $D.copyFile($,H)}return!0}catch(B){return r(Error(`Failed to copy executable from ${$} to ${H}: ${B}`)),!1}let I=B9.dirname(H);try{await $D.mkdir(I,{recursive:!0}),N(`Created directory ${I} for symlink`)}catch(B){return r(Error(`Failed to create directory ${I}: ${B}`)),!1}try{let B=!1;try{await $D.stat(H),B=!0}catch{}if(B){try{let f=await $D.readlink(H),E=B9.resolve(B9.dirname(H),f),M=B9.resolve($);if(E===M)return!1}catch{}await $D.unlink(H)}}catch(B){r(Error(`Failed to check/remove existing symlink: ${B}`))}let D=`${H}.tmp.${process.pid}.${Date.now()}`;try{return await $D.symlink($,D),await $D.rename(D,H),N(`Atomically updated symlink ${H} -> ${$}`),!0}catch(B){try{await $D.unlink(D)}catch{}return r(Error(`Failed to create symlink from ${H} to ${$}: ${B}`)),!1}}async function Db(H=!1){if(A$(process.env.DISABLE_INSTALLATION_CHECKS))return[];let $=await Lb();if($==="development")return[];let A=M$();if(!(H||$==="native"||A.installMethod==="native"))return[];let I=Fs(),D=[],B=B9.dirname(I.executable),f=B9.resolve(B),M=Bd().startsWith("win32");if(!m3.existsSync(B))D.push({message:`installMethod is native, but directory ${B} does not exist`,userActionRequired:!0,type:"error"});if(!m3.existsSync(I.executable))D.push({message:`installMethod is native, but claude command not found at ${I.executable}`,userActionRequired:!0,type:"error"});else if(!M)try{let U=await $D.readlink(I.executable),X=B9.resolve(B9.dirname(I.executable),U);if(!m3.existsSync(X))D.push({message:`Claude symlink points to non-existent file: ${U}`,userActionRequired:!0,type:"error"});else if(!await Js(X))D.push({message:`Claude symlink points to invalid binary: ${U}`,userActionRequired:!0,type:"error"})}catch{if(!await Js(I.executable))D.push({message:`${I.executable} exists but is not a valid Claude binary`,userActionRequired:!0,type:"error"})}else if(!await Js(I.executable))D.push({message:`${I.executable} exists but is not a valid Claude binary`,userActionRequired:!0,type:"error"});if(!(process.env.PATH||"").split(B9.delimiter).some((U)=>{try{let X=B9.resolve(U);if(M)return X.toLowerCase()===f.toLowerCase();return X===f}catch{return!1}}))if(M){let U=B.replace(/\//g,"\\");D.push({message:`Native installation exists but ${U} is not in your PATH. Add it by opening: System Properties \u2192 Environment Variables \u2192 Edit User PATH \u2192 New \u2192 Add the path above. Then restart your terminal.`,userActionRequired:!0,type:"path"})}else{let U=UVH(),J=Gs()[U],F=J?J.replace(ljA.homedir(),"~"):"your shell config file";D.push({message:`Native installation exists but ~/.local/bin is not in your PATH. Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${F} && source ${F}`,userActionRequired:!0,type:"path"})}return D}async function fd(H,$=!1){let A=await vjA(H),L=await sF1(H,$);if(!L.success)return{latestVersion:null,wasUpdated:!1,lockFailed:L.lockFailed,lockHolderPid:L.lockHolderPid};if(A||L.success){if(M$().installMethod!=="native")AA((D)=>({...D,installMethod:"native",autoUpdates:!1,autoUpdatesProtectedForNative:!0})),N('Native installer: Set installMethod to "native" and disabled legacy auto-updater for protection')}return ugH(),{latestVersion:A,wasUpdated:L.success,lockFailed:!1}}async function $K1(H){try{if(m3.existsSync(H)){let $=await $D.readlink(H),A=B9.resolve(B9.dirname(H),$);if(m3.existsSync(A)&&await Js(A))return A}}catch{}return null}function njA(H,$){let A=B9.basename($);return B9.join(H.locks,`${A}.lock`)}async function rjA(){let H=Fs();if(!process.execPath.includes(H.versions))return;try{let $=B9.resolve(process.execPath),A=njA(H,$);if(await $D.mkdir(H.locks,{recursive:!0}),!m3.existsSync($)){N(`Cannot lock current version - file does not exist: ${$}`,{level:"info"});return}if(V1H()){if(!await yRD($,A)){c("tengu_version_lock_failed",{is_pid_based:!0,is_lifetime_lock:!0}),fq$($,Error("Lock already held by another process"));return}c("tengu_version_lock_acquired",{is_pid_based:!0,is_lifetime_lock:!0}),N(`Acquired PID lock on running version: ${$}`)}else{let L;try{L=await Eq$.default.lock($,{stale:ijA,retries:0,lockfilePath:A,onCompromised:(I)=>{N(`NON-FATAL: Lock on running version was compromised: ${I.message}`,{level:"info"})}}),c("tengu_version_lock_acquired",{is_pid_based:!1,is_lifetime_lock:!0}),N(`Acquired mtime-based lock on running version: ${$}`),PB(async()=>{try{await L?.()}catch{}})}catch(I){c("tengu_version_lock_failed",{is_pid_based:!1,is_lifetime_lock:!0}),fq$($,I);return}}}catch($){N(`NON-FATAL: Failed to lock current version during execution ${$ instanceof Error?$.message:String($)}`,{level:"info"})}}function fq$(H,$){let A=`NON-FATAL: Lock acquisition failed for ${H} (expected in multi-process scenarios)`,L=$ instanceof Error?Error(A,{cause:$}):Error(`${A}: ${$}`);r(L)}async function ugH(){await Promise.resolve();let H=Fs();if(Bd().startsWith("win32"))try{let A=B9.dirname(H.executable);if(m3.existsSync(A)){let I=(await $D.readdir(A)).filter((B)=>B.startsWith("claude.exe.old.")&&B.match(/claude\.exe\.old\.\d+$/)),D=0;for(let B of I)try{let f=B9.join(A,B);await $D.unlink(f),D++}catch{}if(D>0)N(`Cleaned up ${D} old Windows executables on startup`)}}catch(A){N(`Failed to clean up old Windows executables: ${A}`)}if(m3.existsSync(H.staging))try{let A=await $D.readdir(H.staging),L=Date.now()-3600000,I=0;for(let D of A){let B=B9.join(H.staging,D);try{if((await $D.stat(B)).mtime.getTime()0)N(`Cleaned up ${I} orphaned staging directories`),c("tengu_native_staging_cleanup",{cleaned_count:I})}catch(A){N(`Failed to clean up staging directories: ${A}`)}if(m3.existsSync(H.versions))try{let A=await $D.readdir(H.versions),L=Date.now()-3600000,I=0;for(let D of A)if(D.match(/\.tmp\.\d+\.\d+$/)){let B=B9.join(H.versions,D);try{if((await $D.stat(B)).mtime.getTime()0)N(`Cleaned up ${I} orphaned temp install files`),c("tengu_native_temp_files_cleanup",{cleaned_count:I})}catch(A){N(`Failed to clean up temp install files: ${A}`)}if(V1H()&&m3.existsSync(H.locks)){let A=Bq$(H.locks);if(A>0)N(`Cleaned up ${A} stale version locks`),c("tengu_native_stale_locks_cleanup",{cleaned_count:A})}if(!m3.existsSync(H.versions))return;try{let A=await $D.readdir(H.versions),L=[];for(let J of A){let F=B9.join(H.versions,J);try{let Q=await $D.stat(F);if(Q.isFile()&&(Q.size===0||await Js(F)))L.push(J)}catch{}}let I=process.execPath,D=I&&I.includes(H.versions)?B9.resolve(I):null,B=new Set([...D?[D]:[]]),f=await $K1(H.executable);if(f)B.add(f);for(let J of L){let F=B9.resolve(H.versions,J);if(B.has(F))continue;let Q=njA(H,F),W=!1;if(V1H())W=Dq$(Q);else try{W=await Eq$.default.check(F,{stale:ijA,lockfilePath:Q})}catch{W=!1}if(W)B.add(F),N(`Protecting locked version from cleanup: ${J}`)}let E=[];for(let J of L){let F=B9.resolve(H.versions,J);if(B.has(F))continue;try{let Q=await $D.stat(F);E.push({name:J,path:F,mtime:Q.mtime})}catch{}}E.sort((J,F)=>F.mtime.getTime()-J.mtime.getTime());let M=E.slice(cjA);if(M.length===0){c("tengu_native_version_cleanup",{total_count:L.length,deleted_count:0,protected_count:B.size,retained_count:cjA,lock_failed_count:0,error_count:0});return}let G=0,U=0,X=0;await Promise.all(M.map(async(J)=>{try{if(await nF1(J.path,async()=>{await $D.unlink(J.path)}))G++;else U++,N(`Skipping deletion of ${J.name} - locked by another process`)}catch(F){X++,r(Error(`Failed to delete version ${J.name}: ${F}`))}})),c("tengu_native_version_cleanup",{total_count:L.length,deleted_count:G,protected_count:B.size,retained_count:cjA,lock_failed_count:U,error_count:X})}catch(A){r(Error(`Version cleanup failed: ${A}`))}}async function AK1(H){let $=H;if((await $D.lstat(H)).isSymbolicLink())$=await $D.realpath(H);return $.endsWith(".js")||$.includes("node_modules")}async function ggH(){let H=Fs();try{if(!m3.existsSync(H.executable))return;if(await AK1(H.executable)){N(`Skipping removal of ${H.executable} - appears to be npm-managed`);return}await $D.unlink(H.executable),N(`Removed claude symlink at ${H.executable}`)}catch($){r(Error(`Failed to remove claude symlink: ${$}`))}}function mgH(){let H=[],$=Gs();for(let[A,L]of Object.entries($))try{let I=ygH(L);if(!I)continue;let{filtered:D,hadAlias:B}=nZ$(I);if(B)rZ$(L,D),H.push({message:`Removed claude alias from ${L}. Run: unalias claude`,userActionRequired:!0,type:"alias"}),N(`Cleaned up claude alias from ${A} config`)}catch(I){r(I instanceof Error?I:Error(String(I))),H.push({message:`Failed to clean up ${L}: ${I}`,userActionRequired:!1,type:"error"})}return H}async function LK1(H){try{let $=await pD("npm",["config","get","prefix"]);if($.code!==0||!$.stdout)return{success:!1,error:"Failed to get npm global prefix"};let A=$.stdout.trim(),L=!1;async function I(D,B){try{return await $D.stat(D),await $D.unlink(D),N(`Manually removed ${B}: ${D}`),!0}catch{return!1}}if(Bd()==="windows"){let D=B9.join(A,"claude.cmd"),B=B9.join(A,"claude.ps1"),f=B9.join(A,"claude");if(await I(D,"bin script"))L=!0;if(await I(B,"PowerShell script"))L=!0;if(await I(f,"bin executable"))L=!0}else{let D=B9.join(A,"bin","claude");if(await I(D,"bin symlink"))L=!0}if(L){N(`Successfully removed ${H} manually`);let D=Bd()==="windows"?B9.join(A,"node_modules",H):B9.join(A,"lib","node_modules",H);return{success:!0,warning:`${H} executables removed, but node_modules directory was left intact for safety. You may manually delete it later at: ${D}`}}else return{success:!1}}catch($){return N(`Manual removal failed: ${$}`,{level:"error"}),{success:!1,error:`Manual removal failed: ${$}`}}}async function hRD(H){let{code:$,stderr:A}=await pD("npm",["uninstall","-g",H],{cwd:process.cwd()});if($===0)return N(`Removed global npm installation of ${H}`),{success:!0};else if(A&&!A.includes("npm ERR! code E404")){if(A.includes("npm error code ENOTEMPTY")){N(`Failed to uninstall global npm package ${H}: ${A}`,{level:"error"}),N("Attempting manual removal due to ENOTEMPTY error");let L=await LK1(H);if(L.success)return{success:!0,warning:L.warning};else if(L.error)return{success:!1,error:`Failed to remove global npm installation of ${H}: ${A}. Manual removal also failed: ${L.error}`}}return N(`Failed to uninstall global npm package ${H}: ${A}`,{level:"error"}),{success:!1,error:`Failed to remove global npm installation of ${H}: ${A}`}}return{success:!1}}async function pgH(){let H=[],$=[],A=0,L=await hRD("@anthropic-ai/claude-code");if(L.success){if(A++,L.warning)$.push(L.warning)}else if(L.error)H.push(L.error);if({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL!=="@anthropic-ai/claude-code"){let D=await hRD({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL);if(D.success){if(A++,D.warning)$.push(D.warning)}else if(D.error)H.push(D.error)}let I=B9.join(ljA.homedir(),".claude","local");if(m3.existsSync(I))try{await $D.rm(I,{recursive:!0,force:!0}),A++,N(`Removed local installation at ${I}`)}catch(D){H.push(`Failed to remove ${I}: ${D}`),N(`Failed to remove local installation: ${D}`,{level:"error"})}return{removed:A,errors:H,warnings:$}}var B9,ljA,Eq$,m3,$D,cjA=2,ijA=604800000;var hjA=K(()=>{Z1();Ma();B0();_$();ZE();z$();E$();SjA();vA();aZ$();F1H();Us();SRD();Ib();NA();djA();B9=require("path"),ljA=require("os"),Eq$=b(zk(),1),m3=require("fs"),$D=require("fs/promises")});var Lj=K(()=>{hjA()});function Ed(){let H=ZAH(),A=["user","project","local"].flatMap((L)=>OJ(L).errors);return{settings:H.settings,errors:[...H.errors,...A]}}var dgH=K(()=>{mL();T3()});function gRD(){return[]}function mRD(H,$=null,A){let L=H?.find((I)=>I.name==="ide");if($){let I=PX($.ideType),D=Wx($.ideType)?"plugin":"extension";if($.error)return[{label:"IDE",value:P1H.createElement(V,null,ZL("error",A)(pH.cross)," Error installing ",I," ",D,": ",$.error,` `,"Please restart your IDE and try again.")}];if($.installed)if(L&&L.type==="connected")if($.installedVersion!==L.serverInfo?.version)return[{label:"IDE",value:`Connected to ${I} ${D} version ${$.installedVersion} (server version: ${L.serverInfo?.version})`}];else return[{label:"IDE",value:`Connected to ${I} ${D} version ${$.installedVersion}`}];else return[{label:"IDE",value:`Installed ${I} ${D}`}]}else if(L){let I=NKA(L)??"IDE";if(L.type==="connected")return[{label:"IDE",value:`Connected to ${I} extension`}];else return[{label:"IDE",value:`${ZL("error",A)(pH.cross)} Not connected to ${I}`}]}return[]}function pRD(H=[],$){let A=H.filter((L)=>L.name!=="ide");if(!A.length)return[];return[{label:"MCP servers",value:P1H.createElement(x,{flexDirection:"row",flexWrap:"wrap",columnGap:1,flexShrink:99},A.map((L,I)=>{let D="";if(L.type==="connected")D=ZL("success",$)(pH.tick);else if(L.type==="pending")D=ZL("inactive",$)(pH.radioOff);else if(L.type==="needs-auth")D=ZL("warning",$)(pH.triangleUpOutline);else if(L.type==="failed")D=ZL("error",$)(pH.cross);else D=ZL("error",$)(pH.cross);let B=I{let I=V9(L.path);A.push(`Large ${I} will impact performance (${a0(L.content.length)} chars > ${a0(Cm)})`)}),$&&$.content.length>HQH)A.push(`CLAUDE.md entries marked as IMPORTANT exceed ${a0(HQH)} characters (${a0($.content.length)} chars)`);return A}function cRD(){return[{label:"Setting sources",value:Pl().filter((L)=>{let I=ZI(L);return I!==null&&Object.keys(I).length>0}).map((L)=>{if(L==="policySettings"){let I=QmL();if(I===null)return null;return I==="remote"?"Enterprise managed settings (remote)":"Enterprise managed settings (local)"}return rDL(L)}).filter((L)=>L!==null)}]}async function lRD(){return(await Db()).map(($)=>$.message)}async function iRD(){let H=await W1H(),$=[],{errors:A}=Ed();if(A.length>0){let I=Array.from(new Set(A.map((D)=>D.file))).join(", ");$.push(`Found invalid settings files: ${I}. They will be ignored.`)}if(H.warnings.forEach((L)=>{$.push(L.issue)}),H.hasUpdatePermissions===!1)$.push("No write permissions for auto-updates (requires sudo)");return $}function nRD(){let H=RD$();if(!H)return[];let $=[];if(H.subscription)$.push({label:"Login method",value:`${H.subscription} Account`});if(H.tokenSource)$.push({label:"Auth token",value:H.tokenSource});if(H.apiKeySource)$.push({label:"API key",value:H.apiKeySource});if(H.organization&&!process.env.IS_DEMO)$.push({label:"Organization",value:H.organization});if(H.email&&!process.env.IS_DEMO)$.push({label:"Email",value:H.email});return $}function rRD(){let H=sI(),$=[];if(H!=="firstParty"){let I={bedrock:"AWS Bedrock",vertex:"Google Vertex AI",foundry:"Microsoft Foundry"}[H];$.push({label:"API provider",value:I})}if(H==="firstParty"){let I=process.env.ANTHROPIC_BASE_URL;if(I)$.push({label:"Anthropic base URL",value:I})}else if(H==="bedrock"){let I=process.env.BEDROCK_BASE_URL;if(I)$.push({label:"Bedrock base URL",value:I});if($.push({label:"AWS region",value:NHH()}),A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH))$.push({value:"AWS auth skipped"})}else if(H==="vertex"){let I=process.env.VERTEX_BASE_URL;if(I)$.push({label:"Vertex base URL",value:I});let D=process.env.ANTHROPIC_VERTEX_PROJECT_ID;if(D)$.push({label:"GCP project",value:D});if($.push({label:"Default region",value:wN()}),A$(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH))$.push({value:"GCP auth skipped"})}else if(H==="foundry"){let I=process.env.ANTHROPIC_FOUNDRY_BASE_URL;if(I)$.push({label:"Microsoft Foundry base URL",value:I});let D=process.env.ANTHROPIC_FOUNDRY_RESOURCE;if(D)$.push({label:"Microsoft Foundry resource",value:D});if(A$(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH))$.push({value:"Microsoft Foundry auth skipped"})}let A=Ku();if(A)$.push({label:"Proxy",value:A});let L=sN();if(process.env.NODE_EXTRA_CA_CERTS)$.push({label:"Additional CA cert(s)",value:process.env.NODE_EXTRA_CA_CERTS});if(L){if(L.cert&&process.env.CLAUDE_CODE_CLIENT_CERT)$.push({label:"mTLS client cert",value:process.env.CLAUDE_CODE_CLIENT_CERT});if(L.key&&process.env.CLAUDE_CODE_CLIENT_KEY)$.push({label:"mTLS client key",value:process.env.CLAUDE_CODE_CLIENT_KEY})}return $}function aRD(H){let $=_O(H);if(H===null&&nL()){let A=x9$();if(Wq())$=`${oH.bold("Default")} ${A}`;else $=`${oH.bold("Sonnet")} ${A}`}return $}var P1H;var oRD=K(()=>{xH();Lj();EI();nU();mQ();Q9();rD();oM();aI();r0();Ib();NA();nR();H4H();mL();dgH();EM();jI();EI();W4();P1H=b(s(),1)});function IK1(){let H=j$(),A=qvH(H)??Q1.createElement(V,{dimColor:!0},"/rename to add a name");return[{label:"Version",value:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION},{label:"Session name",value:A},{label:"Session ID",value:H},{label:"cwd",value:C$()},...nRD(),...rRD()]}function DK1({mainLoopModel:H,mcp:$,theme:A,context:L}){return[{label:"Model",value:aRD(H)},...mRD($.clients,L.options.ideInstallationStatus,A),...pRD($.clients,A),{label:"Memory",value:Q1.createElement(ERD,{context:L,flat:!0})},...gRD(),...cRD()]}async function BK1(){return[...await lRD(),...await iRD(),...dRD()]}function fK1({value:H}){if(Array.isArray(H))return Q1.createElement(x,{flexWrap:"wrap",columnGap:1,flexShrink:99},H.map(($,A)=>{return Q1.createElement(V,{key:A},$,AE.mainLoopModel),A=J$((E)=>E.mcp),[L,I]=Q1.useState([]),[D,B]=Q1.useState([]),[f]=_I();return Q1.useEffect(()=>{async function E(){let M=[IK1(),DK1({mainLoopModel:$,mcp:A,theme:f,context:H})],G=await BK1();I(M),B(G)}E()},[$,A,f,H]),Q1.createElement(x,{flexDirection:"column"},Q1.createElement(x,{flexDirection:"column",gap:1,marginTop:1},L.map((E,M)=>E.length>0&&Q1.createElement(x,{key:M,flexDirection:"column"},E.map(({label:G,value:U},X)=>Q1.createElement(x,{key:X,flexDirection:"row",gap:1,flexShrink:0},G!==void 0&&Q1.createElement(V,{bold:!0},G,":"),Q1.createElement(fK1,{value:U}))))),D.length>0&&Q1.createElement(x,{flexDirection:"column",paddingBottom:1},Q1.createElement(V,{bold:!0},"System Diagnostics"),D.map((E,M)=>Q1.createElement(x,{key:M,flexDirection:"row",gap:1,paddingX:1},Q1.createElement(V,{color:"error"},pH.warning),typeof E==="string"?Q1.createElement(V,{wrap:"wrap"},E):E)))),Q1.createElement(V,{dimColor:!0},Q1.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))}var Q1;var sRD=K(()=>{xH();jI();pL();g$();MRD();oRD();PI();rB();j0();Q1=b(s(),1)});function QVH({onThemeSelect:H,showIntroText:$=!1,helpText:A="",showHelpTextBelow:L=!1,hideEscToCancel:I=!1,skipExitHandling:D=!1,onCancel:B}){let[f]=_I(),{columns:E}=QL(),M=iqA(),G=M===null?a6D(f):null,{setPreviewTheme:U,savePreview:X,cancelPreview:J}=v0A(),F=J$((Z)=>Z.settings.syntaxHighlightingDisabled)??!1,Q=zI();D8$("ThemePicker");let W=C0("theme:toggleSyntaxHighlighting","ThemePicker","ctrl+t");BA("theme:toggleSyntaxHighlighting",()=>{if(M===null){let Z=!F;II("userSettings",{syntaxHighlightingDisabled:Z}),Q((q)=>({...q,settings:{...q.settings,syntaxHighlightingDisabled:Z}}))}},{context:"ThemePicker"});let P=zB(D?()=>{}:void 0),Y=P0.createElement(x,{flexDirection:"column",gap:1},P0.createElement(x,{flexDirection:"column",gap:1,marginX:1},$?P0.createElement(V,null,"Let's get started."):P0.createElement(V,{bold:!0,color:"permission"},"Theme"),P0.createElement(x,{flexDirection:"column"},P0.createElement(V,{bold:!0},"Choose the text style that looks best with your terminal"),A&&!L&&P0.createElement(V,{dimColor:!0},A)),P0.createElement(QA,{options:[{label:"Dark mode",value:"dark"},{label:"Light mode",value:"light"},{label:"Dark mode (colorblind-friendly)",value:"dark-daltonized"},{label:"Light mode (colorblind-friendly)",value:"light-daltonized"},{label:"Dark mode (ANSI colors only)",value:"dark-ansi"},{label:"Light mode (ANSI colors only)",value:"light-ansi"}],onFocus:(Z)=>{U(Z)},onChange:(Z)=>{X(),H(Z)},onCancel:D?()=>{J(),B?.()}:async()=>{J(),await w0(0)},visibleOptionCount:6,defaultValue:f,defaultFocusValue:f})),P0.createElement(x,{flexDirection:"column",width:"100%"},P0.createElement(x,{flexDirection:"column",borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:"dashed",borderColor:"subtle",borderDimColor:!0},P0.createElement(LC,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[" function greet() {",'- console.log("Hello, World!");','+ console.log("Hello, Claude!");'," }"]},dim:!1,filePath:"demo.js",firstLine:null,width:E})),P0.createElement(V,{dimColor:!0}," ",M==="env"?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:M==="build"?"Syntax highlighting available only in native build":F?`Syntax highlighting disabled (${W} to enable)`:G?`Syntax theme: ${G.theme}${G.source?` (from ${G.source})`:""} (${W} to disable)`:`Syntax highlighting enabled (${W} to disable)`)));if(!$)return P0.createElement(P0.Fragment,null,P0.createElement(x,{flexDirection:"column"},Y),P0.createElement(x,{marginX:1,marginTop:1},L&&A&&P0.createElement(x,{marginLeft:3},P0.createElement(V,{dimColor:!0},A)),!I&&P0.createElement(x,null,P0.createElement(V,{dimColor:!0,italic:!0},P.pending?P0.createElement(P0.Fragment,null,"Press ",P.keyName," again to exit"):P0.createElement(rA,null,P0.createElement(s$,{shortcut:"Enter",action:"select"}),P0.createElement(s$,{shortcut:"Esc",action:"cancel"}))))));return Y}var P0;var Mq$=K(()=>{xH();l8();Zt();UM();UU();xH();OB();lB();eB();Z9H();mL();pL();$I();FG();iu();P0=b(s(),1)});function Ks(){return NL("tengu_workout2",!1)}function cgH(H){return H.toLowerCase().includes("opus-4-6")}function eRD(H){if(H===void 0||H===null||H==="")return;let $=typeof H==="number"?H:parseInt(String(H),10);if(!isNaN($)&&MK1($))return $;if(typeof H==="string"&&EK1.includes(H))return H;return}function HyD(){let H=GB();return eRD(H.effortLevel)}function $yD(){return eRD(process.env.CLAUDE_CODE_EFFORT_LEVEL)}function MK1(H){return Number.isInteger(H)}function AyD(H){if(typeof H==="string")return H;return"high"}var EK1;var Gq$=K(()=>{SD();mL();EK1=["low","medium","high","max"]});function WVH({initial:H,sessionModel:$,onSelect:A,onCancel:L,isStandaloneCommand:I,showPenguinsNotice:D}){let B=zI(),f=H===null?Uq$:H,E=10,M=zB(),G=J$((k)=>cD()?k.fastMode:!1),U=J$((k)=>k.effortValue),X=KC.useRef(U!==void 0?AyD(U):"high"),[J,F]=KC.useState(X.current),[Q,W]=KC.useState(!1),[P,C]=KC.useState(f),Y=KC.useMemo(()=>fLH(G??!1),[G]),Z=KC.useMemo(()=>{if(H!==null&&!Y.some((k)=>k.value===H))return[...Y,{value:H,label:_O(H),description:"Current model"}];return Y},[Y,H]),q=KC.useMemo(()=>Z.map((k)=>({...k,value:k.value===null?Uq$:k.value})),[Z]),O=KC.useMemo(()=>q.some((k)=>k.value===f)?f:q[0]?.value??void 0,[q,f]),j=Math.min(10,q.length),u=Math.max(0,q.length-j),y=q.find((k)=>k.value===P)?.label,g=Ks()&&LyD(P),h=KC.useCallback(()=>{if(g)F((k)=>ByD(k,"left")),W(!0)},[g]),p=KC.useCallback(()=>{if(g)F((k)=>ByD(k,"right")),W(!0)},[g]);bI({"modelPicker:decreaseEffort":h,"modelPicker:increaseEffort":p},{context:"ModelPicker",isActive:Ks()});function d(k){if(Ks()){c("tengu_model_command_menu_effort",{effort:J});let GH=J==="high"?void 0:J;II("userSettings",{effortLevel:GH}),B((HH)=>({...HH,effortValue:GH}))}if(k===Uq$){A(null,void 0);return}let n=Ks()&&Q&&LyD(k)?J:void 0;A(k,n)}return cI.createElement(x,{flexDirection:"column",width:"100%"},I&&cI.createElement(Uf,{dividerColor:"permission",dividerDimColor:!1}),cI.createElement(x,{flexDirection:"column",paddingX:I?1:0},cI.createElement(x,{flexDirection:"column"},cI.createElement(x,{marginBottom:1,flexDirection:"column"},cI.createElement(V,{color:"remember",bold:!0},"Select model"),cI.createElement(V,{dimColor:!0},"Switch between Claude models. Applies to this session and future Claude Code sessions. For other/previous model names, specify with --model."),$&&cI.createElement(V,{dimColor:!0},"Currently using ",_O($)," for this session (set by plan mode). Selecting a model will undo this.")),cI.createElement(x,{flexDirection:"column",marginBottom:1},cI.createElement(x,{flexDirection:"column"},cI.createElement(QA,{defaultValue:f,defaultFocusValue:O,options:q,onChange:d,onFocus:C,onCancel:L??(()=>{}),visibleOptionCount:j})),u>0&&cI.createElement(x,{paddingLeft:3},cI.createElement(V,{dimColor:!0},"and ",u," more\u2026"))),Ks()&&cI.createElement(x,{marginBottom:1,flexDirection:"column"},g?cI.createElement(V,{dimColor:!0},cI.createElement(IyD,{effort:J})," ",Fk(J)," ","effort",J==="high"?" (default)":""," ",cI.createElement(V,{color:"subtle"},"\u2190 \u2192 to adjust")):cI.createElement(V,{color:"subtle"},cI.createElement(IyD,{effort:void 0})," Effort not supported",y?` for ${y}`:"")),cD()?D?cI.createElement(x,{marginBottom:1},cI.createElement(V,{dimColor:!0},"Fast mode is ",cI.createElement(V,{bold:!0},"ON")," and available with"," ",VO," only (/fast). Switching to other models turn off fast mode.",cI.createElement(DyD,null))):Z4()&&!zq()?cI.createElement(x,{marginBottom:1},cI.createElement(V,{dimColor:!0},"Use ",cI.createElement(V,{bold:!0},"/fast")," to turn on Fast mode (",VO," only).",cI.createElement(DyD,null))):null:null),I&&cI.createElement(V,{dimColor:!0,italic:!0},M.pending?cI.createElement(cI.Fragment,null,"Press ",M.keyName," again to exit"):cI.createElement(rA,null,cI.createElement(s$,{shortcut:"Enter",action:"confirm"}),cI.createElement(VA,{action:"select:cancel",context:"Select",fallback:"Esc",description:"exit"})))))}function LyD(H){if(!H)return!1;if(H===Uq$)return cgH(xq());return cgH(m8(H))}function IyD({effort:H}){let $=["low","medium","high"],A=H?$.indexOf(H)+1:0;return cI.createElement(cI.Fragment,null,$.map((L,I)=>cI.createElement(V,{key:I,color:I{xH();$I();eYH();aI();Gq$();mL();pL();l8();UM();e6();lB();j0();eB();z$();AJ();cI=b(s(),1),KC=b(s(),1)});function Jq$({onDone:H,isStandaloneDialog:$,externalIncludes:A}){Bb.default.useEffect(()=>{c("tengu_claude_md_includes_dialog_shown",{})},[]);let L=ajA.useCallback((D)=>{if(D==="no")c("tengu_claude_md_external_includes_dialog_declined",{}),MM((B)=>({...B,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!0}));else c("tengu_claude_md_external_includes_dialog_accepted",{}),MM((B)=>({...B,hasClaudeMdExternalIncludesApproved:!0,hasClaudeMdExternalIncludesWarningShown:!0}));H()},[H]),I=ajA.useCallback(()=>{L("no")},[L]);return Bb.default.createElement(BL,{title:"Allow external CLAUDE.md file imports?",color:"warning",onCancel:I,hideBorder:!$,hideInputGuide:!$},Bb.default.createElement(V,null,"This project's CLAUDE.md imports files outside the current working directory. Never allow this for third-party repositories."),A&&A.length>0&&Bb.default.createElement(x,{flexDirection:"column"},Bb.default.createElement(V,{dimColor:!0},"External imports:"),A.map((D,B)=>Bb.default.createElement(V,{key:B,dimColor:!0}," ",D.path))),Bb.default.createElement(V,{dimColor:!0},"Important: Only use Claude Code with files you trust. Accessing untrusted files may pose security risks"," ",Bb.default.createElement(dI,{url:"https://code.claude.com/docs/en/security"})," "),Bb.default.createElement(QA,{options:[{label:"Yes, allow external imports",value:"yes"},{label:"No, disable external imports",value:"no"}],onChange:(D)=>L(D)}))}var Bb,ajA;var ojA=K(()=>{xH();l8();vA();z$();xH();bB();Bb=b(s(),1),ajA=b(s(),1)});function fyD({currentVersion:H,onChoice:$}){function A(I){$(I)}function L(){$("cancel")}return lgH.default.createElement(BL,{title:"Switch to Stable Channel",onCancel:L,color:"permission",hideBorder:!0,hideInputGuide:!0},lgH.default.createElement(V,null,"The stable channel may have an older version than what you're currently running (",H,")."),lgH.default.createElement(V,{dimColor:!0},"How would you like to handle this?"),lgH.default.createElement(QA,{options:[{label:"Allow possible downgrade to stable version",value:"downgrade"},{label:`Stay on current version (${H}) until stable catches up`,value:"stay"}],onChange:A}))}var lgH;var EyD=K(()=>{xH();l8();bB();lgH=b(s(),1)});function MyD(H){return Object.entries(H).map(([$,A])=>({label:A?.name??GK1,value:$,description:A?.description??UK1}))}function Fq$({initialStyle:H,onComplete:$,onCancel:A,isStandaloneCommand:L}){let[I,D]=_1H.useState([]),[B,f]=_1H.useState(!0);_1H.useEffect(()=>{Y1H(C$()).then((M)=>{let G=MyD(M);D(G),f(!1)}).catch(()=>{let M=MyD(V9H);D(M),f(!1)})},[]);let E=_1H.useCallback((M)=>{$(M)},[$]);return tw.createElement(BL,{title:"Preferred output style",onCancel:A,borderDimColor:!0,hideInputGuide:!L,hideBorder:!L},tw.createElement(x,{flexDirection:"column",gap:1},tw.createElement(x,{marginTop:1},tw.createElement(V,{dimColor:!0},"This changes how Claude Code communicates with you")),B?tw.createElement(V,{dimColor:!0},"Loading output styles\u2026"):tw.createElement(QA,{options:I,onChange:E,visibleOptionCount:10,defaultValue:H})))}var tw,_1H,GK1="Default",UK1="Claude completes coding tasks efficiently and provides concise responses";var tjA=K(()=>{xH();N1();jh();PI();bB();tw=b(s(),1),_1H=b(s(),1)});function GyD({initialLanguage:H,onComplete:$,onCancel:A}){let[L,I]=sjA.useState(H),[D,B]=sjA.useState((H??"").length);BA("confirm:no",A,{context:"Settings"});function f(){let E=L?.trim();$(E||void 0)}return C1H.default.createElement(x,{flexDirection:"column",gap:1},C1H.default.createElement(V,null,"Enter your preferred response language:"),C1H.default.createElement(x,{flexDirection:"row",gap:1},C1H.default.createElement(V,null,pH.pointer),C1H.default.createElement(W9,{value:L??"",onChange:I,onSubmit:f,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, \u65E5\u672C\u8A9E, Espa\xF1ol${pH.ellipsis}`,columns:60,cursorOffset:D,onChangeCursorOffset:B})),C1H.default.createElement(V,{dimColor:!0},"Leave empty for default (English)"))}var C1H,sjA;var UyD=K(()=>{xH();S5();jI();$I();C1H=b(s(),1),sjA=b(s(),1)});function fb({query:H,placeholder:$="Search\u2026",isFocused:A,isTerminalFocused:L,prefix:I="\u2315",width:D,cursorOffset:B}){let f=B??H.length;return fW.default.createElement(x,{flexShrink:0,borderStyle:"round",borderColor:A?"suggestion":void 0,borderDimColor:!A,paddingX:1,width:D},fW.default.createElement(V,{dimColor:!A},I," ",A?fW.default.createElement(fW.default.Fragment,null,H?L?fW.default.createElement(fW.default.Fragment,null,fW.default.createElement(V,null,H.slice(0,f)),fW.default.createElement(V,{inverse:!0},f{xH();fW=b(s(),1)});function XK1(H,$){if(H.ctrl&&($==="k"||$==="u"||$==="w"))return!0;if(H.meta&&H.backspace)return!0;return!1}function JK1(H,$){return(H.ctrl||H.meta)&&$==="y"}function Eb({isActive:H,onExit:$,onExitUp:A,columns:L,passthroughCtrlKeys:I=[],initialQuery:D=""}){let{columns:B}=QL(),f=L??B,[E,M]=igH.useState(D),[G,U]=igH.useState(D.length),X=igH.useCallback((J)=>{M(J),U(J.length)},[]);return WL((J,F)=>{let Q=o0.fromText(E,f,G);if(F.ctrl&&I.includes(J.toLowerCase()))return;if(!XK1(F,J))zSH();if(!JK1(F,J))NSH();if(F.return||F.downArrow){$();return}if(F.upArrow){if(A)A();return}if(F.escape){if(E.length>0)M(""),U(0);else $();return}if(F.backspace){if(F.meta){let{cursor:P,killed:C}=Q.deleteWordBefore();bg(C,"prepend"),M(P.text),U(P.offset);return}if(E.length===0){$();return}let W=Q.backspace();M(W.text),U(W.offset);return}if(F.delete){let W=Q.del();M(W.text),U(W.offset);return}if(F.leftArrow&&(F.ctrl||F.meta||F.fn)){let W=Q.prevWord();U(W.offset);return}if(F.rightArrow&&(F.ctrl||F.meta||F.fn)){let W=Q.nextWord();U(W.offset);return}if(F.leftArrow){let W=Q.left();U(W.offset);return}if(F.rightArrow){let W=Q.right();U(W.offset);return}if(F.home){U(0);return}if(F.end){U(E.length);return}if(F.ctrl){switch(J.toLowerCase()){case"a":U(0);return;case"e":U(E.length);return;case"b":U(Q.left().offset);return;case"f":U(Q.right().offset);return;case"d":{let W=Q.del();M(W.text),U(W.offset);return}case"h":{if(E.length===0){$();return}let W=Q.backspace();M(W.text),U(W.offset);return}case"k":{let{cursor:W,killed:P}=Q.deleteToLineEnd();bg(P,"append"),M(W.text),U(W.offset);return}case"u":{let{cursor:W,killed:P}=Q.deleteToLineStart();bg(P,"prepend"),M(W.text),U(W.offset);return}case"w":{let{cursor:W,killed:P}=Q.deleteWordBefore();bg(P,"prepend"),M(W.text),U(W.offset);return}case"y":{let W=rU$();if(W.length>0){let P=Q.offset,C=Q.insert(W);aU$(P,W.length),M(C.text),U(C.offset)}return}}return}if(F.meta){switch(J.toLowerCase()){case"b":U(Q.prevWord().offset);return;case"f":U(Q.nextWord().offset);return;case"d":{let W=Q.deleteWordAfter();M(W.text),U(W.offset);return}case"y":{let W=oU$();if(W){let{text:P,start:C,length:Y}=W,Z=E.slice(0,C),q=E.slice(C+Y),O=Z+P+q,j=C+P.length;tU$(P.length),M(O),U(j)}return}}return}if(F.tab)return;if(J){let W=Q.insert(J);M(W.text),U(W.offset)}},{isActive:H}),{query:E,setQuery:X,cursorOffset:G}}var igH;var PVH=K(()=>{xH();eJH();OB();igH=b(s(),1)});function XyD({onClose:H,context:$,setTabsHidden:A,setIsWarning:L,setHideMargin:I,onSearchModeChange:D}){let[B,f]=_I(),[E,M]=pP.useState(M$()),[G,U]=pP.useState(exD()),X=p$.useRef(M$()),[J,F]=pP.useState(GB()),Q=p$.useRef(GB()),[W,P]=pP.useState(J?.outputStyle||HW),C=p$.useRef(W),[Y,Z]=pP.useState(J?.language),q=p$.useRef(Y),[O,j]=pP.useState(0),[u,y]=pP.useState(!0),g=pP.useCallback((PH)=>{y(PH),D?.(PH)},[D]),h=u,p=EJ(),d=J$((PH)=>PH.mainLoopModel),k=J$((PH)=>PH.verbose),n=J$((PH)=>PH.thinkingEnabled),GH=J$((PH)=>cD()?PH.fastMode:!1),HH=J$((PH)=>PH.promptSuggestionEnabled),BH=zI(),[WH,wH]=pP.useState({}),QH=p$.useRef(n),[TH,t]=pP.useState(!1),[IH,KH]=pP.useState(null),{query:MH,setQuery:CH,cursorOffset:OH}=Eb({isActive:h&&IH===null,onExit:()=>{g(!1)}}),LH=SX$($.options.mcpClients),e=!A$(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),DH=z7A(),EH=KVH();async function $H(PH){c("tengu_config_model_changed",{from_model:d,to_model:PH}),BH((vH)=>({...vH,mainLoopModel:PH})),wH((vH)=>{let tH=_O(PH);if("model"in vH){let{model:K$,...KA}=vH;return{...KA,model:tH}}return{...vH,model:tH}})}function FH(PH){AA((gH)=>({...gH,verbose:PH})),M({...M$(),verbose:PH}),BH((gH)=>({...gH,verbose:PH})),wH((gH)=>{if("verbose"in gH){let{verbose:vH,...tH}=gH;return tH}return{...gH,verbose:PH}})}let YH=[{id:"autoCompactEnabled",label:"Auto-compact",value:E.autoCompactEnabled,type:"boolean",onChange(PH){AA((gH)=>({...gH,autoCompactEnabled:PH})),M({...M$(),autoCompactEnabled:PH}),c("tengu_auto_compact_setting_changed",{enabled:PH})}},{id:"spinnerTipsEnabled",label:"Show tips",value:J?.spinnerTipsEnabled??!0,type:"boolean",onChange(PH){II("localSettings",{spinnerTipsEnabled:PH}),F((gH)=>({...gH,spinnerTipsEnabled:PH})),c("tengu_tips_setting_changed",{enabled:PH})}},{id:"prefersReducedMotion",label:"Reduce motion",value:J?.prefersReducedMotion??!1,type:"boolean",onChange(PH){II("localSettings",{prefersReducedMotion:PH}),F((gH)=>({...gH,prefersReducedMotion:PH})),c("tengu_reduce_motion_setting_changed",{enabled:PH})}},{id:"thinkingEnabled",label:"Thinking mode",value:n??!0,type:"boolean",onChange(PH){BH((gH)=>({...gH,thinkingEnabled:PH})),II("userSettings",{alwaysThinkingEnabled:PH?void 0:!1}),c("tengu_thinking_toggled",{enabled:PH})}},...cD()&&Z4()?[{id:"fastMode",label:`Fast mode (${VO} only)`,value:!!GH,type:"boolean",onChange(PH){if(eAH(),II("userSettings",{fastMode:PH?!0:void 0}),PH)BH((gH)=>({...gH,mainLoopModel:YzH,mainLoopModelForSession:null,fastMode:!0})),wH((gH)=>({...gH,model:YzH,"Fast mode":"ON"}));else BH((gH)=>({...gH,fastMode:!1})),wH((gH)=>({...gH,"Fast mode":"OFF"}))}}]:[],...NL("tengu_chomp_inflection",!0)?[{id:"promptSuggestionEnabled",label:"Prompt suggestions",value:HH,type:"boolean",onChange(PH){BH((gH)=>({...gH,promptSuggestionEnabled:PH})),II("userSettings",{promptSuggestionEnabled:PH?void 0:!1})}}]:[],...[],...e?[{id:"fileCheckpointingEnabled",label:"Rewind code (checkpoints)",value:E.fileCheckpointingEnabled,type:"boolean",onChange(PH){AA((gH)=>({...gH,fileCheckpointingEnabled:PH})),M({...M$(),fileCheckpointingEnabled:PH}),c("tengu_file_history_snapshots_setting_changed",{enabled:PH})}}]:[],{id:"verbose",label:"Verbose output",value:k,type:"boolean",onChange:FH},{id:"terminalProgressBarEnabled",label:"Terminal progress bar",value:E.terminalProgressBarEnabled,type:"boolean",onChange(PH){AA((gH)=>({...gH,terminalProgressBarEnabled:PH})),M({...M$(),terminalProgressBarEnabled:PH}),c("tengu_terminal_progress_bar_setting_changed",{enabled:PH})}},{id:"defaultPermissionMode",label:"Default permission mode",value:J?.permissions?.defaultMode||"default",options:(()=>{let PH=["default","plan"],gH=dL()?["bypassPermissions"]:["bypassPermissions","delegate"];return[...PH,...z$H.filter((vH)=>!PH.includes(vH)&&!gH.includes(vH))]})(),type:"enum",onChange(PH){let gH=N$H(hN(PH)),vH=II("userSettings",{permissions:{...J?.permissions,defaultMode:gH}});if(vH.error){r(vH.error);return}F((tH)=>({...tH,permissions:{...tH?.permissions,defaultMode:gH}})),wH((tH)=>({...tH,defaultPermissionMode:PH})),c("tengu_config_changed",{setting:"defaultPermissionMode",value:PH})}},{id:"respectGitignore",label:"Respect .gitignore in file picker",value:E.respectGitignore,type:"boolean",onChange(PH){AA((gH)=>({...gH,respectGitignore:PH})),M({...M$(),respectGitignore:PH}),c("tengu_respect_gitignore_setting_changed",{enabled:PH})}},EH?{id:"autoUpdatesChannel",label:"Auto-update channel",value:"disabled",type:"managedEnum",onChange(){}}:{id:"autoUpdatesChannel",label:"Auto-update channel",value:J?.autoUpdatesChannel??"latest",type:"managedEnum",onChange(){}},{id:"theme",label:"Theme",value:B,type:"managedEnum",onChange:f},{id:"notifChannel",label:"Notifications",value:E.preferredNotifChannel,options:["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"],type:"enum",onChange(PH){AA((gH)=>({...gH,preferredNotifChannel:PH})),M({...M$(),preferredNotifChannel:PH})}},{id:"outputStyle",label:"Output style",value:W,type:"managedEnum",onChange:()=>{}},{id:"language",label:"Language",value:Y??"Default (English)",type:"managedEnum",onChange:()=>{}},{id:"editorMode",label:"Editor mode",value:E.editorMode==="emacs"?"normal":E.editorMode||"normal",options:["normal","vim"],type:"enum",onChange(PH){AA((gH)=>({...gH,editorMode:PH})),M({...M$(),editorMode:PH}),c("tengu_editor_mode_changed",{mode:PH,source:"config_panel"})}},...[],...NL("tengu_code_diff_cli",!1)?[{id:"codeDiffFooterEnabled",label:"Show code diff footer",value:E.codeDiffFooterEnabled??!0,type:"boolean",onChange(PH){AA((gH)=>{if(gH.codeDiffFooterEnabled===PH)return gH;return{...gH,codeDiffFooterEnabled:PH}}),M({...M$(),codeDiffFooterEnabled:PH}),c("tengu_code_diff_footer_setting_changed",{enabled:PH})}}]:[],...NL("tengu_pr_status_cli",!1)?[{id:"prStatusFooterEnabled",label:"Show PR status footer",value:E.prStatusFooterEnabled??!0,type:"boolean",onChange(PH){AA((gH)=>{if(gH.prStatusFooterEnabled===PH)return gH;return{...gH,prStatusFooterEnabled:PH}}),M({...M$(),prStatusFooterEnabled:PH}),c("tengu_pr_status_footer_setting_changed",{enabled:PH})}}]:[],{id:"model",label:"Model",value:d===null?"Default (recommended)":d,type:"managedEnum",onChange:$H},...LH?[{id:"diffTool",label:"Diff tool",value:E.diffTool??"auto",options:["terminal","auto"],type:"enum",onChange(PH){AA((gH)=>({...gH,diffTool:PH})),M({...M$(),diffTool:PH}),c("tengu_diff_tool_changed",{tool:PH,source:"config_panel"})}}]:[],...!ZF()?[{id:"autoConnectIde",label:"Auto-connect to IDE (external terminal)",value:E.autoConnectIde??!1,type:"boolean",onChange(PH){AA((gH)=>({...gH,autoConnectIde:PH})),M({...M$(),autoConnectIde:PH}),c("tengu_auto_connect_ide_changed",{enabled:PH,source:"config_panel"})}}]:[],...ZF()?[{id:"autoInstallIdeExtension",label:"Auto-install IDE extension",value:E.autoInstallIdeExtension??!0,type:"boolean",onChange(PH){AA((gH)=>({...gH,autoInstallIdeExtension:PH})),M({...M$(),autoInstallIdeExtension:PH}),c("tengu_auto_install_ide_extension_changed",{enabled:PH,source:"config_panel"})}}]:[],{id:"claudeInChromeDefaultEnabled",label:"Claude in Chrome enabled by default",value:E.claudeInChromeDefaultEnabled??!0,type:"boolean",onChange(PH){AA((gH)=>({...gH,claudeInChromeDefaultEnabled:PH})),M({...M$(),claudeInChromeDefaultEnabled:PH}),c("tengu_claude_in_chrome_setting_changed",{enabled:PH})}},...dL()?(()=>{let PH=SZA();return[{id:"teammateMode",label:PH?`Teammate mode [overridden: ${PH}]`:"Teammate mode",value:E.teammateMode??"auto",options:["auto","tmux","in-process"],type:"enum",onChange(vH){if(vH!=="auto"&&vH!=="tmux"&&vH!=="in-process")return;jZA(vH),AA((tH)=>({...tH,teammateMode:vH})),M({...M$(),teammateMode:vH}),c("tengu_teammate_mode_changed",{mode:vH})}}]})():[],...DH?[{id:"showExternalIncludesDialog",label:"External CLAUDE.md includes",value:(()=>{if(Mf().hasClaudeMdExternalIncludesApproved)return"true";else return"false"})(),type:"managedEnum",onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY?[{id:"apiKey",label:p$.createElement(V,null,"Use custom API key:"," ",p$.createElement(V,{bold:!0},Z2(process.env.ANTHROPIC_API_KEY))),searchText:"Use custom API key",value:Boolean(process.env.ANTHROPIC_API_KEY&&E.customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY))),type:"boolean",onChange(PH){AA((gH)=>{let vH={...gH};if(!vH.customApiKeyResponses)vH.customApiKeyResponses={approved:[],rejected:[]};if(!vH.customApiKeyResponses.approved)vH.customApiKeyResponses={...vH.customApiKeyResponses,approved:[]};if(!vH.customApiKeyResponses.rejected)vH.customApiKeyResponses={...vH.customApiKeyResponses,rejected:[]};if(process.env.ANTHROPIC_API_KEY){let tH=Z2(process.env.ANTHROPIC_API_KEY);if(PH)vH.customApiKeyResponses={...vH.customApiKeyResponses,approved:[...(vH.customApiKeyResponses.approved??[]).filter((K$)=>K$!==tH),tH],rejected:(vH.customApiKeyResponses.rejected??[]).filter((K$)=>K$!==tH)};else vH.customApiKeyResponses={...vH.customApiKeyResponses,approved:(vH.customApiKeyResponses.approved??[]).filter((K$)=>K$!==tH),rejected:[...(vH.customApiKeyResponses.rejected??[]).filter((K$)=>K$!==tH),tH]}}return vH}),M(M$())}}]:[]],qH=p$.useMemo(()=>{if(!MH)return YH;let PH=MH.toLowerCase();return YH.filter((gH)=>{if(gH.id.toLowerCase().includes(PH))return!0;return("searchText"in gH?gH.searchText:gH.label).toLowerCase().includes(PH)})},[YH,MH]);p$.useEffect(()=>{if(O>=qH.length)j(Math.max(0,qH.length-1))},[qH.length,O]);let bH=pP.useCallback(()=>{if(IH!==null)return;let PH=Object.entries(WH).map(([tH,K$])=>{return c("tengu_config_changed",{key:tH,value:K$}),`Set ${tH} to ${oH.bold(K$)}`}),gH=Boolean(process.env.ANTHROPIC_API_KEY&&X.current.customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY))),vH=Boolean(process.env.ANTHROPIC_API_KEY&&E.customApiKeyResponses?.approved?.includes(Z2(process.env.ANTHROPIC_API_KEY)));if(gH!==vH)PH.push(`${vH?"Enabled":"Disabled"} custom API key`),c("tengu_config_changed",{key:"env.ANTHROPIC_API_KEY",value:vH});if(E.theme!==X.current.theme)PH.push(`Set theme to ${oH.bold(E.theme)}`);if(E.preferredNotifChannel!==X.current.preferredNotifChannel)PH.push(`Set notifications to ${oH.bold(E.preferredNotifChannel)}`);if(W!==C.current)PH.push(`Set output style to ${oH.bold(W)}`);if(Y!==q.current)PH.push(`Set response language to ${oH.bold(Y??"Default (English)")}`);if(E.editorMode!==X.current.editorMode)PH.push(`Set editor mode to ${oH.bold(E.editorMode||"emacs")}`);if(E.diffTool!==X.current.diffTool)PH.push(`Set diff tool to ${oH.bold(E.diffTool)}`);if(E.autoConnectIde!==X.current.autoConnectIde)PH.push(`${E.autoConnectIde?"Enabled":"Disabled"} auto-connect to IDE`);if(E.autoInstallIdeExtension!==X.current.autoInstallIdeExtension)PH.push(`${E.autoInstallIdeExtension?"Enabled":"Disabled"} auto-install IDE extension`);if(E.autoCompactEnabled!==X.current.autoCompactEnabled)PH.push(`${E.autoCompactEnabled?"Enabled":"Disabled"} auto-compact`);if(E.respectGitignore!==X.current.respectGitignore)PH.push(`${E.respectGitignore?"Enabled":"Disabled"} respect .gitignore in file picker`);if(E.terminalProgressBarEnabled!==X.current.terminalProgressBarEnabled)PH.push(`${E.terminalProgressBarEnabled?"Enabled":"Disabled"} terminal progress bar`);if(J?.autoUpdatesChannel!==Q.current?.autoUpdatesChannel)PH.push(`Set auto-update channel to ${oH.bold(J?.autoUpdatesChannel??"latest")}`);if(PH.length>0)H(PH.join(` `));else H("Config dialog dismissed",{display:"system"})},[IH,WH,E,d,W,Y,J?.autoUpdatesChannel,cD()?J?.fastMode:void 0,H]);BA("confirm:no",bH,{context:"Settings",isActive:IH===null});let hH=pP.useCallback(()=>{let PH=qH[O];if(!PH||!PH.onChange)return;if(PH.type==="boolean"){if(PH.onChange(!PH.value),PH.id==="thinkingEnabled"){if(!PH.value===QH.current)t(!1);else if($.messages.some((tH)=>tH.type==="assistant"))t(!0)}return}if(PH.id==="theme"||PH.id==="model"||PH.id==="showExternalIncludesDialog"||PH.id==="outputStyle"||PH.id==="language")switch(PH.id){case"theme":KH(0),A(!0),I(!0);return;case"model":KH(1),A(!0);return;case"showExternalIncludesDialog":KH(2),A(!0),L(!0);return;case"outputStyle":KH(3),A(!0);return;case"language":KH(5),A(!0);return}if(PH.id==="autoUpdatesChannel"){if(EH){KH(6),A(!0);return}if((J?.autoUpdatesChannel??"latest")==="latest")KH(4),A(!0);else II("userSettings",{autoUpdatesChannel:"latest",minimumVersion:void 0}),F((vH)=>({...vH,autoUpdatesChannel:"latest",minimumVersion:void 0})),c("tengu_autoupdate_channel_changed",{channel:"latest"});return}if(PH.type==="enum"){let vH=(PH.options.indexOf(PH.value)+1)%PH.options.length;PH.onChange(PH.options[vH]);return}},[EH,qH,O,J?.autoUpdatesChannel,A,I,L]);return bI({"select:previous":()=>{if(t(!1),O===0)g(!0);else j((PH)=>Math.max(0,PH-1))},"select:next":()=>{t(!1),j((PH)=>Math.min(qH.length-1,PH+1))},"select:accept":hH,"settings:search":()=>{g(!0),CH("")}},{context:"Settings",isActive:IH===null&&!h}),WL((PH,gH)=>{if(gH.escape){if(MH.length>0)CH("");else g(!1);return}if(gH.return||gH.downArrow)g(!1),j(0)},{isActive:h&&IH===null}),WL((PH,gH)=>{if(!gH.ctrl&&!gH.meta&&PH.length>0&&!/^\s+$/.test(PH))g(!0),CH(PH)},{isActive:!h&&IH===null}),p$.createElement(x,{flexDirection:"column",width:"100%"},IH===0?p$.createElement(p$.Fragment,null,p$.createElement(QVH,{initialTheme:B,onThemeSelect:(PH)=>{f(PH),KH(null),I(!1),A(!1)},onCancel:()=>{KH(null),I(!1),A(!1)},hideEscToCancel:!0,skipExitHandling:!0}),p$.createElement(x,{marginLeft:1},p$.createElement(V,{dimColor:!0,italic:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"select"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))))):IH===1?p$.createElement(p$.Fragment,null,p$.createElement(WVH,{initial:d,onSelect:(PH,gH)=>{$H(PH),KH(null),A(!1)},onCancel:()=>{KH(null),A(!1)},showPenguinsNotice:cD()?GH&&UK(d)&&Z4():!1}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))):IH===2?p$.createElement(p$.Fragment,null,p$.createElement(Jq$,{onDone:()=>{KH(null),A(!1),L(!1)},externalIncludes:fyH()}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"disable external includes"})))):IH===3?p$.createElement(p$.Fragment,null,p$.createElement(Fq$,{initialStyle:W,onComplete:(PH)=>{P(PH??HW),KH(null),A(!1),II("localSettings",{outputStyle:PH}),c("tengu_output_style_changed",{style:PH??HW,source:"config_panel",settings_source:"localSettings"})},onCancel:()=>{KH(null),A(!1)}}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))):IH===5?p$.createElement(p$.Fragment,null,p$.createElement(GyD,{initialLanguage:Y,onComplete:(PH)=>{Z(PH),KH(null),A(!1),II("userSettings",{language:PH}),c("tengu_language_changed",{language:PH??"default",source:"config_panel"})},onCancel:()=>{KH(null),A(!1)}}),p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(s$,{shortcut:"Enter",action:"confirm"}),p$.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))):IH===6?p$.createElement(BL,{title:"Enable Auto-Updates",onCancel:()=>{KH(null),A(!1)},hideBorder:!0,hideInputGuide:!0},EH!=="config"?p$.createElement(p$.Fragment,null,p$.createElement(V,null,"Auto-updates are controlled by an environment variable and cannot be changed here."),p$.createElement(V,{dimColor:!0},"Unset"," ",EH?.includes("NONESSENTIAL")?"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC":"DISABLE_AUTOUPDATER"," ","to re-enable auto-updates.")):p$.createElement(QA,{options:[{label:"Enable with latest channel",value:"latest"},{label:"Enable with stable channel",value:"stable"}],onChange:(PH)=>{KH(null),A(!1),AA((gH)=>({...gH,autoUpdates:!0})),M({...M$(),autoUpdates:!0}),II("userSettings",{autoUpdatesChannel:PH,minimumVersion:void 0}),F((gH)=>({...gH,autoUpdatesChannel:PH,minimumVersion:void 0})),c("tengu_autoupdate_enabled",{channel:PH})}})):IH===4?p$.createElement(fyD,{currentVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,onChoice:(PH)=>{if(KH(null),A(!1),PH==="cancel")return;let gH={autoUpdatesChannel:"stable"};if(PH==="stay")gH.minimumVersion={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION;II("userSettings",gH),F((vH)=>({...vH,...gH})),c("tengu_autoupdate_channel_changed",{channel:"stable",minimum_version_set:PH==="stay"})}}):p$.createElement(x,{flexDirection:"column",marginY:1,gap:1},p$.createElement(V,null,"Configure Claude Code preferences"),p$.createElement(fb,{query:MH,isFocused:h,isTerminalFocused:p,cursorOffset:OH,placeholder:"Search settings..."}),p$.createElement(x,{flexDirection:"column"},qH.length===0?p$.createElement(V,{dimColor:!0,italic:!0},'No settings match "',MH,'"'):qH.map((PH,gH)=>{let vH=gH===O;return p$.createElement(p$.Fragment,{key:PH.id},p$.createElement(x,null,p$.createElement(x,{width:44},p$.createElement(V,{color:vH?"suggestion":void 0},vH?pH.pointer:" "," ",PH.label)),p$.createElement(x,{key:vH?"selected":"unselected"},PH.type==="boolean"?p$.createElement(p$.Fragment,null,p$.createElement(V,{color:vH?"suggestion":void 0},PH.value.toString()),TH&&PH.id==="thinkingEnabled"&&p$.createElement(V,{color:"warning"}," ","Changing thinking mode mid-conversation will increase latency and may reduce quality.")):PH.id==="theme"?p$.createElement(V,{color:vH?"suggestion":void 0},(()=>{return{dark:"Dark mode",light:"Light mode","dark-daltonized":"Dark mode (colorblind-friendly)","light-daltonized":"Light mode (colorblind-friendly)","dark-ansi":"Dark mode (ANSI colors only)","light-ansi":"Light mode (ANSI colors only)"}[PH.value.toString()]||PH.value.toString()})()):PH.id==="notifChannel"?p$.createElement(V,{color:vH?"suggestion":void 0},(()=>{switch(PH.value.toString()){case"auto":return"Auto";case"iterm2":return p$.createElement(p$.Fragment,null,"iTerm2 ",p$.createElement(V,{dimColor:!0},"(OSC 9)"));case"terminal_bell":return p$.createElement(p$.Fragment,null,"Terminal Bell ",p$.createElement(V,{dimColor:!0},"(\\a)"));case"kitty":return p$.createElement(p$.Fragment,null,"Kitty ",p$.createElement(V,{dimColor:!0},"(OSC 99)"));case"ghostty":return p$.createElement(p$.Fragment,null,"Ghostty ",p$.createElement(V,{dimColor:!0},"(OSC 777)"));case"iterm2_with_bell":return"iTerm2 w/ Bell";case"notifications_disabled":return"Disabled";default:return PH.value.toString()}})()):PH.id==="defaultPermissionMode"?p$.createElement(V,{color:vH?"suggestion":void 0},vk(PH.value)):PH.id==="autoUpdatesChannel"&&EH?p$.createElement(x,{flexDirection:"column"},p$.createElement(V,{color:vH?"suggestion":void 0},"disabled"),p$.createElement(V,{dimColor:!0},"(",EH,")")):p$.createElement(V,{color:vH?"suggestion":void 0},PH.value.toString()))))})),h?p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(V,null,"Type to filter"),p$.createElement(s$,{shortcut:"Enter/\u2193",action:"select"}),p$.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"clear"}))):p$.createElement(V,{dimColor:!0},p$.createElement(rA,null,p$.createElement(VA,{action:"select:accept",context:"Settings",fallback:"Enter/Space",description:"change"}),p$.createElement(VA,{action:"settings:search",context:"Settings",fallback:"/",description:"search"}),p$.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))))}var p$,pP;var JyD=K(()=>{xH();$I();jI();vA();ZqH();vA();r0();yW();_$();z$();Mq$();pL();Xq$();aI();ojA();EyD();bB();l8();tjA();UyD();mQ();lB();j0();eB();VVH();nU();mL();jh();NA();KgH();SD();T8();U6H();PVH();AJ();p$=b(s(),1),pP=b(s(),1)});async function FyD(){if(!nL())return{};let H=dD();if(H&&pk(H.expiresAt))return null;let $=eG();if($.error)throw Error(`Auth error: ${$.error}`);let A={"Content-Type":"application/json","User-Agent":sG(),...$.headers},L=`${XD().BASE_API_URL}/api/oauth/usage`;return(await nA.get(L,{headers:A,timeout:5000})).data}var KyD=K(()=>{w1();_Q();qE();EI();Hq()});function ngH(){if(!NL("tengu_copper_lantern",!1))return!1;if(!HO())return!1;let H=f0();if(H!=="pro"&&H!=="max")return!1;if(M$().hasVisitedExtraUsage)return!1;let A=T9();if(A?.subscriptionCreatedAt){let L=rm("tengu_copper_lantern_config",{meridian:"2026-02-05T07:59:00Z"});if(new Date(A.subscriptionCreatedAt)>=new Date(L.meridian))return!1}return!0}function KK1(){if((M$().opus46FeedSeenCount??0)>=FK1)return!1;return!0}function QK1(){if(!NL("tengu_silver_lantern",!1))return null;if(ngH())return cD()?"promo-copper":"promo";if(KK1())return"launch-only";return null}function Kq$(){let[H]=QyD.useState(()=>QK1());return H}function Qq$(){let $=(M$().opus46FeedSeenCount??0)+1;AA((A)=>({...A,opus46FeedSeenCount:$})),c("tengu_opus46_feed_shown",{seen_count:$})}function WK1(H){switch(H){case"promo-copper":return cD()&&Z4()?"Opus 4.6 is here \xB7 $50 free extra usage \xB7 Try fast mode or use it when you hit a limit /extra-usage to enable":"Opus 4.6 is here \xB7 $50 free extra usage \xB7 /extra-usage to enable";case"promo":return"Opus 4.6 is here \xB7 $50 free extra usage \xB7 /extra-usage to enable";case"launch-only":return"Opus 4.6 is here \xB7 Most capable for ambitious work"}}function VK1(H){switch(H){case"promo-copper":case"promo":return 39;case"launch-only":return 0}}function WyD({variant:H,maxWidth:$}){let A=WK1(H),L=$?e8(A,$):A,I=VK1(H);if(I>0&&I0)return Ij.createElement(V,{dimColor:!0},Ij.createElement(V,{color:"claude"},L));return Ij.createElement(V,{dimColor:!0},L)}var Ij,QyD,FK1=3;var rgH=K(()=>{xH();vA();EI();SD();z$();AJ();Q9();Ij=b(s(),1),QyD=b(s(),1)});function VyD({title:H,limit:$,maxWidth:A,showTimeInReset:L=!0,extraSubtext:I}){let{utilization:D,resets_at:B}=$;if(D===null)return null;let f=`${Math.floor(D)}% used`,E;if(B)E=`Resets ${WoL(B,!0,L)}`;if(I)if(E)E=`${I} \xB7 ${E}`;else E=I;let M=50;if(A>=M+12)return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,{bold:!0},H),KI.createElement(x,{flexDirection:"row",gap:1},KI.createElement(SuH,{ratio:D/100,width:M,fillColor:"rate_limit_fill",emptyColor:"rate_limit_empty"}),KI.createElement(V,null,f)),E&&KI.createElement(V,{dimColor:!0},E));else return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,null,KI.createElement(V,{bold:!0},H),E&&KI.createElement(KI.Fragment,null,KI.createElement(V,null," "),KI.createElement(V,{dimColor:!0},"\xB7 ",E))),KI.createElement(SuH,{ratio:D/100,width:A,fillColor:"rate_limit_fill",emptyColor:"rate_limit_empty"}),KI.createElement(V,null,f))}function PyD(){let[H,$]=_VH.useState(null),[A,L]=_VH.useState(null),[I,D]=_VH.useState(!0),{columns:B}=QL(),f=B-2,E=Math.min(f,80),M=KI.useCallback(async()=>{D(!0),L(null);try{let U=await FyD();$(U)}catch(U){r(U);let X=U,J=X.response?.data?yH(X.response.data):void 0;L(J?`Failed to load usage data: ${J}`:"Failed to load usage data")}finally{D(!1)}},[]);if(_VH.useEffect(()=>{M()},[M]),BA("settings:retry",()=>{M()},{context:"Settings",isActive:!!A&&!I}),A)return KI.createElement(x,{flexDirection:"column",marginTop:1,gap:1},KI.createElement(V,{color:"error"},"Error: ",A),KI.createElement(V,{dimColor:!0},KI.createElement(rA,null,KI.createElement(VA,{action:"settings:retry",context:"Settings",fallback:"r",description:"retry"}),KI.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"}))));if(!H)return KI.createElement(x,{flexDirection:"column",marginTop:1,gap:1},KI.createElement(V,{dimColor:!0},"Loading usage data\u2026"),KI.createElement(V,{dimColor:!0},KI.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})));let G=[{title:"Current session",limit:H.five_hour},{title:"Current week (all models)",limit:H.seven_day},{title:"Current week (Sonnet only)",limit:H.seven_day_sonnet}];return KI.createElement(x,{flexDirection:"column",marginTop:1,gap:1,width:"100%"},G.some(({limit:U})=>U)||KI.createElement(V,{dimColor:!0},"/usage is only available for subscription plans."),G.map(({title:U,limit:X})=>X&&KI.createElement(VyD,{key:U,title:U,limit:X,maxWidth:E})),H.extra_usage&&KI.createElement(PK1,{extraUsage:H.extra_usage,maxWidth:E}),ngH()?cD()&&Z4()?KI.createElement(V,{dimColor:!0},KI.createElement(V,{color:"claude"},"$50 free extra usage")," \xB7 for fast mode or when you hit limits /extra-usage to enable"):KI.createElement(V,{dimColor:!0},KI.createElement(V,{color:"claude"},"$50 free extra usage")," \xB7 /extra-usage to enable"):null,KI.createElement(V,{dimColor:!0},KI.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))}function PK1({extraUsage:H,maxWidth:$}){let A=f0();if(!(A==="pro"||A==="max"))return!1;if(!H.is_enabled){if(Lt.isEnabled())return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,{bold:!0},ejA),KI.createElement(V,{dimColor:!0},"Extra usage not enabled \u2022 /extra-usage to enable"));return null}if(H.monthly_limit===null)return KI.createElement(x,{flexDirection:"column"},KI.createElement(V,{bold:!0},ejA),KI.createElement(V,{dimColor:!0},"Unlimited"));if(typeof H.used_credits!=="number"||typeof H.utilization!=="number")return null;let I=ZzH(H.used_credits/100,2),D=ZzH(H.monthly_limit/100,2),B=new Date,f=new Date(B.getFullYear(),B.getMonth()+1,1);return KI.createElement(VyD,{title:ejA,limit:{utilization:H.utilization,resets_at:f.toISOString()},showTimeInReset:!1,extraSubtext:`${I} / ${D} spent`,maxWidth:$})}var KI,_VH,ejA="Extra usage";var _yD=K(()=>{xH();OB();KyD();_$();AOA();j0();eB();$I();mbH();Nq();EI();Q9();Z$();rgH();AJ();KI=b(s(),1),_VH=b(s(),1)});function YVH({onClose:H,context:$,defaultTab:A}){let[L,I]=w1H.useState(!1),[D,B]=w1H.useState(!1),[f,E]=w1H.useState(!1),[M,G]=w1H.useState(A==="Config"),U=w1H.useCallback(()=>{if(L)return;H("Status dialog dismissed",{display:"system"})},[L,H]);return BA("confirm:no",U,{context:"Settings",isActive:!L}),jJ.createElement(x,{flexDirection:"column"},jJ.createElement(Uf,{dividerColor:D?"warning":"permission",dividerDimColor:!D}),jJ.createElement(x,{marginX:f?0:1},jJ.createElement(Zz,{title:"Settings:",color:"permission",defaultTab:A,hidden:L,disableNavigation:M},[jJ.createElement(WU,{key:"status",title:"Status"},jJ.createElement(tRD,{context:$})),jJ.createElement(WU,{key:"config",title:"Config"},jJ.createElement(XyD,{context:$,onClose:H,setTabsHidden:I,setIsWarning:B,setHideMargin:E,onSearchModeChange:G})),jJ.createElement(WU,{key:"usage",title:"Usage"},jJ.createElement(PyD,null))])))}var jJ,w1H;var Wq$=K(()=>{xH();$I();e6();J1H();sRD();JyD();_yD();jJ=b(s(),1),w1H=b(s(),1)});var YyD={};XA(YyD,{call:()=>_K1});var HRA,_K1=async(H,$)=>{return HRA.createElement(YVH,{onClose:H,context:$,defaultTab:"Config"})};var CyD=K(()=>{Wq$();HRA=b(s(),1)});var YK1,wyD;var ZyD=K(()=>{YK1={aliases:["settings"],type:"local-jsx",name:"config",description:"Open config panel",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (CyD(),YyD)),userFacingName(){return"config"}},wyD=YK1});function CK1(H){return`${Math.round(H/1000)}k`}function qyD(H){let $=new Map;for(let L of H){let I=ktH(L.source),D=$.get(I)||[];D.push(L),$.set(I,D)}for(let[L,I]of $.entries())$.set(L,I.sort((D,B)=>B.tokens-D.tokens));let A=new Map;for(let L of wK1){let I=$.get(L);if(I)A.set(L,I)}return A}function TyD({data:H}){let{categories:$,totalTokens:A,rawMaxTokens:L,percentage:I,gridRows:D,model:B,memoryFiles:f,mcpTools:E,deferredBuiltinTools:M,agents:G,skills:U,messageBreakdown:X}=H,J=$.filter((P)=>P.tokens>0&&P.name!=="Free space"&&P.name!==Vq$&&!P.isDeferred),F=$.some((P)=>P.isDeferred&&P.name.includes("MCP")),Q=M.length>0,W=$.find((P)=>P.name===Vq$);return JA.createElement(x,{flexDirection:"column",paddingLeft:1},JA.createElement(V,{bold:!0},"Context Usage"),JA.createElement(x,{flexDirection:"row",gap:2},JA.createElement(x,{flexDirection:"column",flexShrink:0},D.map((P,C)=>JA.createElement(x,{key:C,flexDirection:"row",marginLeft:-1},P.map((Y,Z)=>{if(Y.categoryName==="Free space")return JA.createElement(V,{key:Z,dimColor:!0},"\u26F6 ");if(Y.categoryName===Vq$)return JA.createElement(V,{key:Z,color:Y.color},"\u26DD ");return JA.createElement(V,{key:Z,color:Y.color},Y.squareFullness>=0.7?"\u26C1 ":"\u26C0 ")})))),JA.createElement(x,{flexDirection:"column",gap:0,flexShrink:0},JA.createElement(V,{dimColor:!0},B," \xB7 ",Math.round(A/1000),"k/",Math.round(L/1000),"k tokens (",I,"%)"),JA.createElement(V,null," "),JA.createElement(V,{dimColor:!0,italic:!0},"Estimated usage by category"),J.map((P,C)=>{let Y=XK(P.tokens),Z=P.isDeferred?"N/A":`${(P.tokens/L*100).toFixed(1)}%`,q=P.name===Vq$,O=P.name,j=P.isDeferred?" ":q?"\u26DD":"\u26C1";return JA.createElement(x,{key:C},JA.createElement(V,{color:P.color},j),JA.createElement(V,null," ",O,": "),JA.createElement(V,{dimColor:!0},Y," tokens (",Z,")"))}),($.find((P)=>P.name==="Free space")?.tokens??0)>0&&JA.createElement(x,null,JA.createElement(V,{dimColor:!0},"\u26F6"),JA.createElement(V,null," Free space: "),JA.createElement(V,{dimColor:!0},CK1($.find((P)=>P.name==="Free space")?.tokens||0)," ","(",(($.find((P)=>P.name==="Free space")?.tokens||0)/L*100).toFixed(1),"%)")),W&&W.tokens>0&&JA.createElement(x,null,JA.createElement(V,{color:W.color},"\u26DD"),JA.createElement(V,{dimColor:!0}," ",W.name,": "),JA.createElement(V,{dimColor:!0},XK(W.tokens)," tokens (",(W.tokens/L*100).toFixed(1),"%)")))),JA.createElement(x,{flexDirection:"column",marginLeft:-1},E.length>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"MCP tools"),JA.createElement(V,{dimColor:!0}," ","\xB7 /mcp",F?" (loaded on-demand)":"")),E.some((P)=>P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Loaded"),E.filter((P)=>P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",P.name,": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),F&&E.some((P)=>!P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Available"),E.filter((P)=>!P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,{dimColor:!0},"\u2514 ",P.name)))),!F&&E.map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",P.name,": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),Q&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Deferred system tools"),JA.createElement(V,{dimColor:!0}," (loaded on-demand)")),M.some((P)=>P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Loaded"),M.filter((P)=>P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",P.name,": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),M.some((P)=>!P.isLoaded)&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},"Available"),M.filter((P)=>!P.isLoaded).map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,{dimColor:!0},"\u2514 ",P.name))))),G.length>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Custom agents"),JA.createElement(V,{dimColor:!0}," \xB7 /agents")),Array.from(qyD(G).entries()).map(([P,C])=>JA.createElement(x,{key:P,flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},P),C.map((Y,Z)=>JA.createElement(x,{key:Z},JA.createElement(V,null,"\u2514 ",Y.agentType,": "),JA.createElement(V,{dimColor:!0},XK(Y.tokens)," tokens")))))),f.length>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Memory files"),JA.createElement(V,{dimColor:!0}," \xB7 /memory")),f.map((P,C)=>JA.createElement(x,{key:C},JA.createElement(V,null,"\u2514 ",V9(P.path),": "),JA.createElement(V,{dimColor:!0},XK(P.tokens)," tokens")))),U&&U.tokens>0&&JA.createElement(x,{flexDirection:"column",marginTop:1},JA.createElement(x,null,JA.createElement(V,{bold:!0},"Skills"),JA.createElement(V,{dimColor:!0}," \xB7 /skills")),Array.from(qyD(U.skillFrontmatter).entries()).map(([P,C])=>JA.createElement(x,{key:P,flexDirection:"column",marginTop:1},JA.createElement(V,{dimColor:!0},P),C.map((Y,Z)=>JA.createElement(x,{key:Z},JA.createElement(V,null,"\u2514 ",Y.name,": "),JA.createElement(V,{dimColor:!0},XK(Y.tokens)," tokens")))))),X&&!1))}var JA,Vq$="Autocompact buffer",wK1;var zyD=K(()=>{xH();W4();rD();Q9();JA=b(s(),1);wK1=["Project","User","Managed","Plugin","Built-in"]});function ZK1({children:H}){let{exit:$}=wSH();return OyD.useLayoutEffect(()=>{let A=setTimeout($,0);return()=>clearTimeout(A)},[$]),Qs.createElement(Qs.Fragment,null,H)}function TK1(H){let $=H.indexOf(NyD);if($===-1)return H;let A=$+NyD.length,L=H.indexOf(qK1,A);if(L===-1)return H;return H.slice(A,L)}function $RA(H){return new Promise(async($)=>{let A="",L=new xyD.PassThrough;L.on("data",(D)=>{A+=D.toString()}),await(await A8(Qs.createElement(ZK1,null,H),{stdout:L,debug:!0})).waitUntilExit(),await $(TK1(A))})}async function CVH(H){let $=await $RA(H);return $U($)}var Qs,OyD,xyD,NyD="\x1B[?2026h",qK1="\x1B[?2026l";var agH=K(()=>{xH();yq();Qs=b(s(),1),OyD=b(s(),1),xyD=require("stream")});var SyD={};XA(SyD,{call:()=>zK1});async function zK1(H,$){let{messages:A,getAppState:L,options:{mainLoopModel:I,tools:D}}=$;yD("context");let B=GC(A),{messages:f}=await rh(B),E=process.stdout.columns||80,M=await L(),G=await sw$(f,I,async()=>M.toolPermissionContext,D,M.agentDefinitions,E,$,void 0,B),U=await $RA(ARA.createElement(TyD,{data:G}));return H(U),null}var ARA;var jyD=K(()=>{zyD();m3H();agH();lt();_L();yE();ARA=b(s(),1)});var RyD={};XA(RyD,{call:()=>NK1});async function NK1(H,$){let{messages:A,getAppState:L,options:{mainLoopModel:I,tools:D,agentDefinitions:B}}=$,f=GC(A),{messages:E}=await rh(f),M=await L(),G=await sw$(E,I,async()=>M.toolPermissionContext,D,B,void 0,$,void 0,f);return{type:"text",value:OK1(G)}}function OK1(H){let{categories:$,totalTokens:A,rawMaxTokens:L,percentage:I,model:D,memoryFiles:B,mcpTools:f,agents:E,skills:M,messageBreakdown:G}=H,U=`## Context Usage `)}var tgH;var lyD=K(()=>{jI();xH();tgH={branch:pH.lineUpDownRight,lastBranch:pH.lineUpRight,line:pH.lineVertical,empty:" "}});function jK1(H){let $={};return H.forEach((A)=>{if(!A.path){$[""]=A.message;return}let L=A.path.split("."),I=A.path;if(A.invalidValue!==null&&A.invalidValue!==void 0&&L.length>0){let D=[];for(let B=0;B{let B=D.file||"(file not specified)";if(!I[B])I[B]=[];return I[B].push(D),I},{}),L=Object.keys(A).sort();return hK.createElement(x,{flexDirection:"column"},L.map((I)=>{let D=A[I]||[];D.sort((M,G)=>{if(!M.path&&G.path)return-1;if(M.path&&!G.path)return 1;return(M.path||"").localeCompare(G.path||"")});let B=jK1(D),f=new Map;D.forEach((M)=>{if(M.suggestion||M.docLink){let G=`${M.suggestion||""}|${M.docLink||""}`;if(!f.has(G))f.set(G,{suggestion:M.suggestion,docLink:M.docLink})}});let E=cyD(B,{showValues:!0,themeName:$,treeCharColors:{treeChar:"inactive",key:"text",value:"inactive"}});return hK.createElement(x,{key:I,flexDirection:"column"},hK.createElement(V,null,I),hK.createElement(x,{marginLeft:1},hK.createElement(V,{dimColor:!0},E)),f.size>0&&hK.createElement(x,{flexDirection:"column",marginTop:1},Array.from(f.values()).map((M,G)=>hK.createElement(x,{key:`suggestion-pair-${G}`,flexDirection:"column",marginBottom:1},M.suggestion&&hK.createElement(V,{dimColor:!0,wrap:"wrap"},M.suggestion),M.docLink&&hK.createElement(V,{dimColor:!0,wrap:"wrap"},"Learn more: ",M.docLink)))))}))}var hK;var BRA=K(()=>{xH();inA();lyD();hK=b(s(),1)});function RK1({scope:H,parsingErrors:$,warnings:A}){let L=$.length>0,I=A.length>0;if(!L&&!I)return null;return $4.default.createElement(x,{flexDirection:"column",marginTop:1},$4.default.createElement(x,null,(L||I)&&$4.default.createElement(V,{color:L?"error":"warning"},"[",L?"Failed to parse":"Contains warnings","]"," "),$4.default.createElement(V,null,OuH(H))),$4.default.createElement(x,null,$4.default.createElement(V,{dimColor:!0},"Location: "),$4.default.createElement(V,{dimColor:!0},b3(H))),$4.default.createElement(x,{marginLeft:1,flexDirection:"column"},$.map((D,B)=>{let f=D.mcpErrorMetadata?.serverName;return $4.default.createElement(x,{key:`error-${B}`},$4.default.createElement(V,null,$4.default.createElement(V,{dimColor:!0},"\u2514 "),$4.default.createElement(V,{color:"error"},"[Error]"),$4.default.createElement(V,{dimColor:!0}," ",f&&`[${f}] `,D.path&&D.path!==""?`${D.path}: `:"",D.message)))}),A.map((D,B)=>{let f=D.mcpErrorMetadata?.serverName;return $4.default.createElement(x,{key:`warning-${B}`},$4.default.createElement(V,null,$4.default.createElement(V,{dimColor:!0},"\u2514 "),$4.default.createElement(V,{color:"warning"},"[Warning]"),$4.default.createElement(V,{dimColor:!0}," ",f&&`[${f}] `,D.path&&D.path!==""?`${D.path}: `:"",D.message)))})))}function wq$(){let H=OJ("user"),$=OJ("project"),A=OJ("local"),L=OJ("enterprise"),I=[{scope:"user",config:H},{scope:"project",config:$},{scope:"local",config:A},{scope:"enterprise",config:L}],D=I.some(({config:f})=>Cq$(f.errors,"fatal").length>0),B=I.some(({config:f})=>Cq$(f.errors,"warning").length>0);if(!D&&!B)return null;return $4.default.createElement(x,{flexDirection:"column",marginTop:1,marginBottom:1},$4.default.createElement(V,{bold:!0},"MCP Config Diagnostics"),$4.default.createElement(x,{marginTop:1},$4.default.createElement(V,{dimColor:!0},"For help configuring MCP servers, see:"," ",$4.default.createElement(dI,{url:"https://code.claude.com/docs/en/mcp"},"https://code.claude.com/docs/en/mcp"))),I.map(({scope:f,config:E})=>$4.default.createElement(RK1,{key:f,scope:f,parsingErrors:Cq$(E.errors,"fatal"),warnings:Cq$(E.errors,"warning")})))}function Cq$(H,$){return H.filter((A)=>A.mcpErrorMetadata?.severity===$)}var $4;var fRA=K(()=>{xH();T3();kF();xH();$4=b(s(),1)});function iyD(){if(!m2())return null;let H=bAI();if(H.length===0)return null;let $=H.filter((L)=>L.severity==="error"),A=H.filter((L)=>L.severity==="warning");return RJ.default.createElement(x,{flexDirection:"column",marginTop:1,marginBottom:1},RJ.default.createElement(V,{bold:!0,color:$.length>0?"error":"warning"},"Keybinding Configuration Issues"),RJ.default.createElement(x,null,RJ.default.createElement(V,{dimColor:!0},"Location: "),RJ.default.createElement(V,{dimColor:!0},OLH())),RJ.default.createElement(x,{marginLeft:1,flexDirection:"column",marginTop:1},$.map((L,I)=>RJ.default.createElement(x,{key:`error-${I}`,flexDirection:"column"},RJ.default.createElement(x,null,RJ.default.createElement(V,{dimColor:!0},"\u2514 "),RJ.default.createElement(V,{color:"error"},"[Error]"),RJ.default.createElement(V,{dimColor:!0}," ",L.message)),L.suggestion&&RJ.default.createElement(x,{marginLeft:3},RJ.default.createElement(V,{dimColor:!0},"\u2192 ",L.suggestion)))),A.map((L,I)=>RJ.default.createElement(x,{key:`warning-${I}`,flexDirection:"column"},RJ.default.createElement(x,null,RJ.default.createElement(V,{dimColor:!0},"\u2514 "),RJ.default.createElement(V,{color:"warning"},"[Warning]"),RJ.default.createElement(V,{dimColor:!0}," ",L.message)),L.suggestion&&RJ.default.createElement(x,{marginLeft:3},RJ.default.createElement(V,{dimColor:!0},"\u2192 ",L.suggestion))))))}var RJ;var nyD=K(()=>{xH();nu();RJ=b(s(),1)});function ryD(){return fj$().map(($)=>({name:$.name,value:process.env[$.name],...$.validate(process.env[$.name])})).filter(($)=>$.status!=="valid")}var ayD=K(()=>{g$()});function sgH(H){if(!H)return 0;return H.activeAgents.filter(($)=>$.source!=="built-in").reduce(($,A)=>{let L=`${A.agentType}: ${A.whenToUse}`;return $+JE(L)},0)}var Z1H=15000;var ERA=K(()=>{Aw()});async function yK1(){let H=MBH();if(H.length===0)return null;let $=H.sort((L,I)=>I.content.length-L.content.length).map((L)=>`${L.path}: ${L.content.length.toLocaleString()} chars`);return{type:"claudemd_files",severity:"warning",message:H.length===1?`Large CLAUDE.md file detected (${H[0].content.length.toLocaleString()} chars > ${Cm.toLocaleString()})`:`${H.length} large CLAUDE.md files detected (each > ${Cm.toLocaleString()} chars)`,details:$,currentValue:H.length,threshold:Cm}}async function vK1(H){if(!H)return null;let $=sgH(H);if($<=Z1H)return null;let A=H.activeAgents.filter((I)=>I.source!=="built-in").map((I)=>{let D=`${I.agentType}: ${I.whenToUse}`;return{name:I.agentType,tokens:JE(D)}}).sort((I,D)=>D.tokens-I.tokens),L=A.slice(0,5).map((I)=>`${I.name}: ~${I.tokens.toLocaleString()} tokens`);if(A.length>5)L.push(`(${A.length-5} more custom agents)`);return{type:"agent_descriptions",severity:"warning",message:`Large agent descriptions (~${$.toLocaleString()} tokens > ${Z1H.toLocaleString()})`,details:L,currentValue:$,threshold:Z1H}}async function hK1(H,$,A){let L=H.filter((I)=>I.isMcp);if(L.length===0)return null;if(eU())return null;try{let I=X1(),{mcpToolTokens:D,mcpToolDetails:B}=await BgH(H,$,A,I);if(D<=ZVH)return null;let f=new Map;for(let G of B){let X=G.name.split("__")[1]||"unknown",J=f.get(X)||{count:0,tokens:0};f.set(X,{count:J.count+1,tokens:J.tokens+G.tokens})}let E=Array.from(f.entries()).sort((G,U)=>U[1].tokens-G[1].tokens),M=E.slice(0,5).map(([G,U])=>`${G}: ${U.count} tools (~${U.tokens.toLocaleString()} tokens)`);if(E.length>5)M.push(`(${E.length-5} more servers)`);return{type:"mcp_tools",severity:"warning",message:`Large MCP tools context (~${D.toLocaleString()} tokens > ${ZVH.toLocaleString()})`,details:M,currentValue:D,threshold:ZVH}}catch(I){let D=L.reduce((B,f)=>{let E=(f.name?.length||0)+f.description.length;return B+JE(E.toString())},0);if(D<=ZVH)return null;return{type:"mcp_tools",severity:"warning",message:`Large MCP tools context (~${D.toLocaleString()} tokens estimated > ${ZVH.toLocaleString()})`,details:[`${L.length} MCP tools detected (token count estimated)`],currentValue:D,threshold:ZVH}}}async function bK1(H){let $=await H(),A=vL.isSandboxingEnabled()&&vL.isAutoAllowBashIfSandboxedEnabled(),L=XFH($,{sandboxAutoAllowEnabled:A});if(L.length===0)return null;let I=L.flatMap((D)=>[`${X8(D.rule.ruleValue)}: ${D.reason}`,` Fix: ${D.fix}`]);return{type:"unreachable_rules",severity:"warning",message:`${L.length} unreachable permission rule${L.length===1?"":"s"} detected`,details:I,currentValue:L.length,threshold:0}}async function oyD(H,$,A){let[L,I,D,B]=await Promise.all([yK1(),vK1($),hK1(H,A,$),bK1(A)]);return{claudeMdWarning:L,agentWarning:I,mcpWarning:D,unreachableRulesWarning:B}}var ZVH=25000;var tyD=K(()=>{mQ();ERA();m3H();Aw();BW();aI();Z4$();EM()});function syD(){if(!vL.isSupportedPlatform())return null;if(!vL.isSandboxEnabledInSettings())return null;let H=vL.checkDependencies(),$=H.errors.length>0,A=H.warnings.length>0;if(!$&&!A)return null;return Ws.default.createElement(x,{flexDirection:"column"},Ws.default.createElement(V,{bold:!0},"Sandbox"),Ws.default.createElement(V,null,"\u2514 Status: ",Ws.default.createElement(V,{color:$?"error":"warning"},$?"Missing dependencies":"Available (with warnings)")),H.errors.map((D,B)=>Ws.default.createElement(V,{key:B,color:"error"},"\u2514 ",D)),H.warnings.map((D,B)=>Ws.default.createElement(V,{key:B,color:"warning"},"\u2514 ",D)),$&&Ws.default.createElement(V,{dimColor:!0},"\u2514 Run /sandbox for install instructions"))}var Ws;var eyD=K(()=>{xH();EM();Ws=b(s(),1)});var HvD={};XA(HvD,{Doctor:()=>MRA});function kK1({promise:H}){let $=lL.use(H);if(!$.latest)return lL.default.createElement(V,{dimColor:!0},"\u2514 Failed to fetch versions");return lL.default.createElement(lL.default.Fragment,null,$.stable&&lL.default.createElement(V,null,"\u2514 Stable version: ",$.stable),lL.default.createElement(V,null,"\u2514 Latest version: ",$.latest))}function MRA({onDone:H}){let $=J$((Z)=>Z.agentDefinitions),A=J$((Z)=>Z.mcp.tools),L=J$((Z)=>Z.toolPermissionContext),I=J$((Z)=>Z.plugins.errors);zB();let D=Dj.useMemo(()=>{return A||[]},[A]),[B,f]=Dj.useState(null),[E,M]=Dj.useState(null),[G,U]=Dj.useState(null),[X,J]=Dj.useState(null),F=_q$(),Q=Dj.useMemo(()=>W1H().then((Z)=>{return(Z.installationType==="native"?ZRD:wRD)().catch(()=>({latest:null,stable:null}))}),[]),W=GB()?.autoUpdatesChannel??"latest",P=F.filter((Z)=>Z.mcpErrorMetadata===void 0),C=Dj.useMemo(()=>ryD(),[]);Dj.useEffect(()=>{W1H().then(f),(async()=>{let Z=zH(),q=Zq$.join(UL(),"agents"),O=Zq$.join(zL(),".claude","agents"),{activeAgents:j,allAgents:u,failedFiles:y}=$,g={activeAgents:j.map((p)=>({agentType:p.agentType,source:p.source})),userAgentsDir:q,projectAgentsDir:O,userDirExists:Z.existsSync(q),projectDirExists:Z.existsSync(O),failedFiles:y};M(g);let h=await oyD(D,{activeAgents:j,allAgents:u,failedFiles:y},async()=>L);if(U(h),V1H()){let p=Zq$.join(lZ$(),"claude","locks"),d=Bq$(p),k=pjA(p);J({enabled:!0,locks:k,locksDir:p,staleLocksCleaned:d})}else J({enabled:!1,locks:[],locksDir:"",staleLocksCleaned:0})})()},[L,D,$]);let Y=lL.useCallback(()=>{H("Claude Code diagnostics dismissed",{display:"system"})},[H]);if(bI({"confirm:yes":Y,"confirm:no":Y},{context:"Confirmation"}),!B)return lL.default.createElement(x,{paddingX:1,paddingTop:1},lL.default.createElement(V,{dimColor:!0},"Checking installation status\u2026"));return lL.default.createElement(x,{flexDirection:"column",gap:1,paddingX:1,paddingTop:1},lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Diagnostics"),lL.default.createElement(V,null,"\u2514 Currently running: ",B.installationType," (",B.version,")"),B.packageManager&&lL.default.createElement(V,null,"\u2514 Package manager: ",B.packageManager),lL.default.createElement(V,null,"\u2514 Path: ",B.installationPath),lL.default.createElement(V,null,"\u2514 Invoked: ",B.invokedBinary),lL.default.createElement(V,null,"\u2514 Config install method: ",B.configInstallMethod),lL.default.createElement(V,null,"\u2514 Search: ",B.ripgrepStatus.working?"OK":"Not working"," (",B.ripgrepStatus.mode==="builtin"?U8()?"bundled":"vendor":B.ripgrepStatus.systemPath||"system",")"),B.recommendation&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null),lL.default.createElement(V,{color:"warning"},"Recommendation: ",B.recommendation.split(` `)[1])),B.multipleInstallations.length>1&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null),lL.default.createElement(V,{color:"warning"},"Warning: Multiple installations found"),B.multipleInstallations.map((Z,q)=>lL.default.createElement(V,{key:q},"\u2514 ",Z.type," at ",Z.path))),B.warnings.length>0&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null),B.warnings.map((Z,q)=>lL.default.createElement(x,{key:q,flexDirection:"column"},lL.default.createElement(V,{color:"warning"},"Warning: ",Z.issue),lL.default.createElement(V,null,"Fix: ",Z.fix)))),P.length>0&&lL.default.createElement(x,{flexDirection:"column",marginTop:1,marginBottom:1},lL.default.createElement(V,{bold:!0},"Invalid Settings"),lL.default.createElement(Yq$,{errors:P}))),lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Updates"),lL.default.createElement(V,null,"\u2514 Auto-updates:"," ",B.packageManager?"Managed by package manager":B.autoUpdates),B.hasUpdatePermissions!==null&&lL.default.createElement(V,null,"\u2514 Update permissions:"," ",B.hasUpdatePermissions?"Yes":"No (requires sudo)"),lL.default.createElement(V,null,"\u2514 Auto-update channel: ",W),lL.default.createElement(lL.Suspense,{fallback:null},lL.default.createElement(kK1,{promise:Q}))),lL.default.createElement(syD,null),lL.default.createElement(wq$,null),lL.default.createElement(iyD,null),C.length>0&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Environment Variables"),C.map((Z,q)=>lL.default.createElement(V,{key:q},"\u2514 ",Z.name,":"," ",lL.default.createElement(V,{color:Z.status==="capped"?"warning":"error"},Z.message)))),X?.enabled&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Version Locks"),X.staleLocksCleaned>0&&lL.default.createElement(V,{dimColor:!0},"\u2514 Cleaned ",X.staleLocksCleaned," stale lock(s)"),X.locks.length===0?lL.default.createElement(V,{dimColor:!0},"\u2514 No active version locks"):X.locks.map((Z,q)=>lL.default.createElement(V,{key:q},"\u2514 ",Z.version,": PID ",Z.pid," ",Z.isProcessRunning?lL.default.createElement(V,null,"(running)"):lL.default.createElement(V,{color:"warning"},"(stale)")))),E?.failedFiles&&E.failedFiles.length>0&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0,color:"error"},"Agent Parse Errors"),lL.default.createElement(V,{color:"error"},"\u2514 Failed to parse ",E.failedFiles.length," agent file(s):"),E.failedFiles.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z.path,": ",Z.error))),I.length>0&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0,color:"error"},"Plugin Errors"),lL.default.createElement(V,{color:"error"},"\u2514 ",I.length," plugin error(s) detected:"),I.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z.source||"unknown","plugin"in Z&&Z.plugin?` [${Z.plugin}]`:"",":"," ",UP(Z)))),G?.unreachableRulesWarning&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0,color:"warning"},"Unreachable Permission Rules"),lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.unreachableRulesWarning.message)),G.unreachableRulesWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z))),G&&(G.claudeMdWarning||G.agentWarning||G.mcpWarning)&&lL.default.createElement(x,{flexDirection:"column"},lL.default.createElement(V,{bold:!0},"Context Usage Warnings"),G.claudeMdWarning&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.claudeMdWarning.message)),lL.default.createElement(V,null," ","\u2514 Files:"),G.claudeMdWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z))),G.agentWarning&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.agentWarning.message)),lL.default.createElement(V,null," ","\u2514 Top contributors:"),G.agentWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z))),G.mcpWarning&&lL.default.createElement(lL.default.Fragment,null,lL.default.createElement(V,null,"\u2514"," ",lL.default.createElement(V,{color:"warning"},pH.warning," ",G.mcpWarning.message)),lL.default.createElement(V,null," ","\u2514 MCP servers:"),G.mcpWarning.details.map((Z,q)=>lL.default.createElement(V,{key:q,dimColor:!0}," ","\u2514 ",Z)))),lL.default.createElement(x,null,lL.default.createElement(Pq$,null)))}var lL,Dj,Zq$;var GRA=K(()=>{xH();$I();UM();jI();Ib();Us();mL();IRA();DRA();BRA();fRA();nyD();g$();DL();NA();ayD();tyD();djA();SjA();pL();eyD();lL=b(s(),1),Dj=b(s(),1),Zq$=require("path")});var AvD={};XA(AvD,{call:()=>uK1});var $vD,uK1=(H,$,A)=>{return Promise.resolve($vD.default.createElement(MRA,{onDone:H}))};var LvD=K(()=>{GRA();$vD=b(s(),1)});var gK1,IvD;var DvD=K(()=>{gK1={name:"doctor",description:"Diagnose and verify your Claude Code installation and settings",isEnabled:()=>!process.env.DISABLE_DOCTOR_COMMAND,isHidden:!1,userFacingName(){return"doctor"},type:"local-jsx",load:()=>Promise.resolve().then(() => (LvD(),AvD))},IvD=gK1});var BvD=()=>{};function mK1(H){return!!EtH(H)}async function Mb(H){let $=Bj();if(!$)throw Error("No editor available");SN(`${$} "${H}"`,{stdio:"inherit"})}var Bj;var Gb=K(()=>{H2H();tD();Zk();Bj=o$(()=>{if(process.env.VISUAL?.trim())return process.env.VISUAL.trim();if(process.env.EDITOR?.trim())return process.env.EDITOR.trim();return["code","vi","nano"].find(($)=>mK1($))})});function fvD(H){return XQ(H)!==null}var EvD=K(()=>{DL();Td$();t8()});function GvD({onSelect:H,onCancel:$,title:A,renderDetails:L}){let I=QJ(),D=URA.join(UL(),"CLAUDE.md"),B=URA.join(zL(),"CLAUDE.md"),f=I.some((P)=>P.path===D),E=I.some((P)=>P.path===B),M=[...I.map((P)=>({...P,exists:!0})),...f?[]:[{path:D,type:"User",content:"",exists:!1}],...E?[]:[{path:B,type:"Project",content:"",exists:!1}]],G=new Map,U=M.map((P)=>{let C=V9(P.path),Y=P.exists?"":" (new)",Z=P.parent?(G.get(P.parent)??0)+1:0;G.set(P.path,Z);let q=Z>0?" ".repeat(Z-1):"",O;if(P.type==="User"&&!P.isNested&&P.path===D)O="User memory";else if(P.type==="Project"&&!P.isNested&&P.path===B)O="Project memory";else if(Z>0)O=`${q}L ${C}${Y}`;else O=`${C}`;let j,u=fvD(zL());if(P.type==="User"&&!P.isNested)j="Saved in ~/.claude/CLAUDE.md";else if(P.type==="Project"&&!P.isNested&&P.path===B)j=`${u?"Checked in at":"Saved in"} ./CLAUDE.md`;else if(P.type,P.type==="AutoMem")j=`${Pm()} entrypoint`;else if(P.parent)j="@-imported";else if(P.isNested)j="dynamically loaded";else j="";return{label:O,value:P.path,description:j}}),X=qq$&&U.some((P)=>P.value===qq$)?qq$:U[0]?.value||"",[J,F]=MvD.useState(X),W=M.find((P)=>P.path===J)?.type;return zB(),BA("confirm:no",$,{context:"Confirmation"}),sw.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:"remember",padding:1,width:"100%"},sw.createElement(x,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},sw.createElement(V,{color:"remember",bold:!0},A||"Select memory file to edit:")),sw.createElement(x,{flexDirection:"column",paddingX:1},sw.createElement(QA,{defaultFocusValue:X,options:U,onFocus:(P)=>F(P),onChange:(P)=>{qq$=P,H(P)},onCancel:$})),L&&sw.createElement(x,{marginTop:1,flexDirection:"column"},L(J,W)))}var sw,MvD,URA,qq$;var UvD=K(()=>{xH();l8();UM();$I();mQ();G3();rD();EvD();g$();NA();sw=b(s(),1),MvD=b(s(),1),URA=require("path")});function FvD(H){let $=XvD.homedir(),A=C$(),L=H.startsWith($)?"~"+H.slice($.length):null,I=H.startsWith(A)?"./"+JvD.relative(A,H):null;if(L&&I)return L.length<=I.length?L:I;return L||I||H}var XvD,JvD,pK1;var KvD=K(()=>{xH();PI();XvD=require("os"),JvD=require("path"),pK1=b(s(),1)});var QvD={};XA(QvD,{call:()=>cK1});function dK1({onDone:H}){XRA.useState(()=>{QJ.cache.clear?.()});let{columns:$}=QL(),A=async(E)=>{yD("memory-mode");try{if(E.includes(UL())){let J=UL();if(!zH().existsSync(J))zH().mkdirSync(J)}if(!zH().existsSync(E))iL(E,"",{encoding:"utf8",flush:!0});await Mb(E);let M="default",G="";if(process.env.VISUAL)M="$VISUAL",G=process.env.VISUAL;else if(process.env.EDITOR)M="$EDITOR",G=process.env.EDITOR;let U=M!=="default"?`Using ${M}="${G}".`:"",X=U?`> ${U} To change editor, set $EDITOR or $VISUAL environment variable.`:"> To use a different editor, set the $EDITOR or $VISUAL environment variable.";H(`Opened memory file at ${FvD(E)} ${X}`,{display:"system"})}catch(M){r(M instanceof Error?M:Error(String(M))),H(`Error opening memory file: ${M}`)}},L=()=>{H("Cancelled memory editing",{display:"system"})},D=[].length,[B,f]=XRA.useState(!1);return WL((E,M)=>{}),BA("confirm:no",()=>{f(!1)},{context:"Confirmation",isActive:!1}),ew.createElement(x,{flexDirection:"column"},ew.createElement(x,{marginTop:1,marginBottom:1},ew.createElement(V,{dimColor:!0},"Learn more: ",ew.createElement(dI,{url:"https://code.claude.com/docs/en/memory"}))),!1,!1,!1,!B&&ew.createElement(GvD,{title:"Select memory to edit:",onSelect:A,onCancel:L}))}var ew,XRA,cK1=async(H)=>{return ew.createElement(dK1,{onDone:H})};var WvD=K(()=>{NA();_$();Gb();DL();Z$();UvD();KvD();xH();$I();xH();mQ();yE();OB();ew=b(s(),1),XRA=b(s(),1)});var lK1,VvD;var PvD=K(()=>{lK1={type:"local-jsx",name:"memory",description:"Edit Claude memory files",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (WvD(),QvD)),userFacingName(){return this.name}},VvD=lK1});var iK1,nK1,q1H;var Tq$=K(()=>{Z1();iK1={ghostty:"Ghostty",kitty:"Kitty","iTerm.app":"iTerm2",WezTerm:"WezTerm"},nK1={type:"local-jsx",name:"terminal-setup",userFacingName(){return"terminal-setup"},description:OA.terminal==="Apple_Terminal"?"Enable Option+Enter key binding for newlines and visual bell":"Install Shift+Enter key binding for newlines",isEnabled:()=>!0,isHidden:OA.terminal!==null&&OA.terminal in iK1,load:()=>Promise.resolve().then(() => (BDH(),jVI))},q1H=nK1});function Vs(){return M$().editorMode==="vim"}function _vD(){if(OA.terminal,q1H.isEnabled()&&F5A())return"shift + \u23CE for newline";return K5A()?"\\\u23CE for newline":"backslash (\\) + return (\u23CE) for newline"}var qVH=K(()=>{Tq$();BDH();vA();Z1()});function Ps(H){return H.replace(/\+/g," + ")}function zq$(H){let{dimColor:$,fixedWidth:A,gap:L,paddingX:I}=H,D=Ps(C0("app:toggleTranscript","Global","ctrl+o")),B=Ps(C0("app:toggleTodos","Global","ctrl+t")),f=Ps(C0("chat:undo","Chat","ctrl+_")),E=Ps(C0("chat:stash","Chat","ctrl+s")),M=Ps(C0("chat:cycleMode","Chat","shift+tab")),G=Ps(C0("chat:modelPicker","Chat","alt+p")),U=Ps(C0("chat:externalEditor","Chat","ctrl+g")),X=Ps(C0("app:toggleTerminal","Global","meta+j")),J=null;return uI.createElement(x,{paddingX:I,flexDirection:"row",gap:L},uI.createElement(x,{flexDirection:"column",width:A?24:void 0},uI.createElement(x,null,uI.createElement(V,{dimColor:$},"! for bash mode")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},"/ for commands")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},"@ for file paths")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},"& for background")),process.env.ENABLE_BTW==="true"&&uI.createElement(x,null,uI.createElement(V,{dimColor:$},"/btw for side question"))),uI.createElement(x,{flexDirection:"column",width:A?35:void 0},uI.createElement(x,null,uI.createElement(V,{dimColor:$},"double tap esc to clear input")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},M," to auto-accept edits")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},D," for verbose output")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},B," to toggle tasks")),null,uI.createElement(x,null,uI.createElement(V,{dimColor:$},_vD()))),uI.createElement(x,{flexDirection:"column"},uI.createElement(x,null,uI.createElement(V,{dimColor:$},f," to undo")),rIL&&uI.createElement(x,null,uI.createElement(V,{dimColor:$},"ctrl + z to suspend")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},e3H.displayText.replace("+"," + ")," to paste images")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},G," to switch model")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},E," to stash prompt")),uI.createElement(x,null,uI.createElement(V,{dimColor:$},U," to edit in $EDITOR")),m2()&&uI.createElement(x,null,uI.createElement(V,{dimColor:$},"/keybindings to customize"))))}var uI;var JRA=K(()=>{xH();ZgH();Z9();qVH();FG();nu();SD();uI=b(s(),1)});function YvD(){return dP.createElement(x,{flexDirection:"column",paddingY:1,gap:1},dP.createElement(x,null,dP.createElement(V,null,"Claude understands your codebase, makes edits with your permission, and executes commands \u2014 right from your terminal.")),dP.createElement(x,{flexDirection:"column"},dP.createElement(x,null,dP.createElement(V,{bold:!0},"Shortcuts")),dP.createElement(zq$,{gap:2,fixedWidth:!0})))}var dP;var CvD=K(()=>{xH();JRA();dP=b(s(),1)});function FRA({commands:H,maxHeight:$,title:A,onCancel:L,emptyMessage:I}){let D=Math.max(1,Math.floor(($-6)/2)),B=wvD.useMemo(()=>[...H].sort((f,E)=>f.name.localeCompare(E.name)).map((f)=>({label:`/${f.name}`,value:f.name,description:TVH(f)})),[H]);return p3.createElement(x,{flexDirection:"column",paddingY:1},H.length===0&&I?p3.createElement(V,{dimColor:!0},I):p3.createElement(p3.Fragment,null,p3.createElement(V,null,A),p3.createElement(x,{marginTop:1},p3.createElement(QA,{options:B,visibleOptionCount:D,onCancel:L,disableSelection:!0,hideIndexes:!0,layout:"compact-vertical"}))))}var p3,wvD;var ZvD=K(()=>{xH();h4();N1();p3=b(s(),1),wvD=b(s(),1)});function qvD({onClose:H,commands:$}){let{rows:A}=QL(),L=Math.floor(A/2),I=()=>H("Help dialog dismissed",{display:"system"});BA("help:dismiss",I,{context:"Help"});let D=zB(I),B=C0("help:dismiss","Help","esc"),f=Np(),E=$.filter((X)=>f.has(X.name)&&!X.isHidden),M=[],G=$.filter((X)=>!f.has(X.name)&&!X.isHidden),U=[W8.createElement(WU,{key:"general",title:"general"},W8.createElement(YvD,null))];return U.push(W8.createElement(WU,{key:"commands",title:"commands"},W8.createElement(FRA,{commands:E,maxHeight:L,title:"Browse default commands:",onCancel:I}))),U.push(W8.createElement(WU,{key:"custom",title:"custom-commands"},W8.createElement(FRA,{commands:G,maxHeight:L,title:"Browse custom commands:",emptyMessage:"No custom commands found",onCancel:I}))),W8.createElement(x,{flexDirection:"column",height:L},W8.createElement(Uf,{dividerColor:"professionalBlue"}),W8.createElement(x,{paddingX:1,flexDirection:"column"},W8.createElement(Zz,{title:`Claude Code v${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}`,color:"professionalBlue",defaultTab:"general"},U),W8.createElement(x,{marginTop:1},W8.createElement(V,null,"For more help:"," ",W8.createElement(dI,{url:"https://code.claude.com/docs/en/overview"}))),W8.createElement(x,{marginTop:1},W8.createElement(V,{dimColor:!0},D.pending?W8.createElement(W8.Fragment,null,"Press ",D.keyName," again to exit"):W8.createElement(V,{italic:!0},B," to cancel")))))}var W8;var TvD=K(()=>{xH();e6();J1H();CvD();ZvD();h4();OB();UM();$I();FG();xH();W8=b(s(),1)});var zvD={};XA(zvD,{call:()=>rK1});var KRA,rK1=async(H,{options:{commands:$}})=>{return KRA.createElement(qvD,{commands:$,onClose:H})};var NvD=K(()=>{TvD();KRA=b(s(),1)});var aK1,QRA;var OvD=K(()=>{aK1={type:"local-jsx",name:"help",description:"Show help and available commands",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (NvD(),zvD)),userFacingName(){return"help"}},QRA=aK1});function xvD({onComplete:H}){let $=Nq$.useCallback(async(L)=>{let I=L==="yes";AA((D)=>({...D,autoConnectIde:I,hasIdeAutoConnectDialogBeenShown:!0})),H()},[H]);return T1H.default.createElement(BL,{title:"Do you wish to enable auto-connect to IDE?",color:"ide",onCancel:H},T1H.default.createElement(QA,{options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}],onChange:$,defaultValue:"yes"}),T1H.default.createElement(V,{dimColor:!0},"You can also configure this in /config or with the --ide flag"))}function SvD(){let H=M$();return!ZF()&&H.autoConnectIde!==!0&&H.hasIdeAutoConnectDialogBeenShown!==!0}function jvD({onComplete:H}){let $=Nq$.useCallback((I)=>{let D=I==="yes";if(D)AA((B)=>({...B,autoConnectIde:!1}));H(D)},[H]),A=Nq$.useCallback(()=>{H(!1)},[H]);return T1H.default.createElement(BL,{title:"Do you wish to disable auto-connect to IDE?",color:"ide",onCancel:A},T1H.default.createElement(QA,{options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}],onChange:$,defaultValue:"yes"}),T1H.default.createElement(V,{dimColor:!0},"You can also configure this in /config"))}function RvD(){let H=M$();return!ZF()&&H.autoConnectIde===!0}var T1H,Nq$;var yvD=K(()=>{xH();vA();l8();nU();bB();T1H=b(s(),1),Nq$=b(s(),1)});async function vvD(){let{code:H}=await jA("tmux",["-V"]);return H===0}function hvD(){switch(oA()){case"macos":return"Install tmux with: brew install tmux";case"linux":case"wsl":return"Install tmux with: sudo apt install tmux (Debian/Ubuntu) or sudo dnf install tmux (Fedora/RHEL)";case"windows":return"tmux is not natively available on Windows. Consider using WSL or Cygwin.";default:return"Install tmux using your system package manager."}}var zVH=K(()=>{B0();PI();DL();t8();j$H();E$();vA();mL();Z9();yh()});var kvD={};XA(kvD,{formatWorkspaceFolders:()=>WRA,call:()=>eK1});function oK1({availableIDEs:H,unavailableIDEs:$,selectedIDE:A,onClose:L,onSelect:I}){let[D,B]=Ub.useState(A?.port?.toString()??"None"),[f,E]=Ub.useState(!1),[M,G]=Ub.useState(!1),U=Ub.useCallback((F)=>{if(F!=="None"&&SvD())E(!0);else if(F==="None"&&RvD())G(!0);else I(H.find((Q)=>Q.port===parseInt(F)))},[H,I]),X=H.reduce((F,Q)=>{return F[Q.name]=(F[Q.name]||0)+1,F},{}),J=H.map((F)=>{let W=(X[F.name]||0)>1&&F.workspaceFolders.length>0;return{label:F.name,value:F.port.toString(),description:W?WRA(F.workspaceFolders):void 0}}).concat([{label:"None",value:"None",description:void 0}]);if(f)return bK.default.createElement(xvD,{onComplete:()=>U(D)});if(M)return bK.default.createElement(jvD,{onComplete:()=>{I(void 0)}});return bK.default.createElement(BL,{title:"Select IDE",subtitle:"Connect to an IDE for integrated development features.",onCancel:L,color:"ide",borderDimColor:!1},bK.default.createElement(x,{flexDirection:"column"},H.length===0&&bK.default.createElement(V,{dimColor:!0},rjH()?`No available IDEs detected. Please install the plugin and restart your IDE: https://docs.claude.com/s/claude-code-jetbrains`:"No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running."),H.length!==0&&bK.default.createElement(QA,{defaultValue:D,defaultFocusValue:D,options:J,onChange:(F)=>{B(F),U(F)}}),H.length!==0&&!ZF()&&bK.default.createElement(x,{marginTop:1},bK.default.createElement(V,{dimColor:!0},"Tip: You can enable auto-connect to IDE in /config or with the --ide flag")),$.length>0&&bK.default.createElement(x,{flexDirection:"column",marginTop:1},bK.default.createElement(V,{dimColor:!0},"Found ",$.length," other running IDE(s). However, their workspace/project directories do not match the current cwd."),bK.default.createElement(x,{marginTop:1,flexDirection:"column"},$.map((F,Q)=>bK.default.createElement(x,{key:Q,paddingLeft:3},bK.default.createElement(V,{dimColor:!0},"\u2022 ",F.name,": ",WRA(F.workspaceFolders))))))))}async function tK1(H,$){let A=$?.ide;if(!A||A.type!=="sse-ide"&&A.type!=="ws-ide")return null;for(let L of H)if(L.url===A.url)return L;return null}function sK1({runningIDEs:H,onSelectIDE:$,onDone:A}){let[L,I]=Ub.useState(H[0]??""),D=Ub.useCallback((E)=>{$(E)},[$]),B=H.map((E)=>({label:PX(E),value:E}));function f(){A("IDE selection cancelled",{display:"system"})}return bK.default.createElement(BL,{title:"Select IDE to install extension",onCancel:f,color:"ide",borderDimColor:!1},bK.default.createElement(QA,{defaultFocusValue:L,options:B,onChange:(E)=>{I(E),D(E)}}))}async function eK1(H,$,A){c("tengu_ext_ide_command",{}),yD("ide-integration");let{options:{dynamicMcpConfig:L},onChangeDynamicMcpConfig:I}=$,D=await ajH(!0);if(D.length===0&&$.onInstallIDEExtension&&!ZF()){let G=await zKA(),U=(X)=>{if($.onInstallIDEExtension)if($.onInstallIDEExtension(X),Wx(X))H(`Installed plugin to ${oH.bold(PX(X))} This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. \`\`\``}]}},pvD=$Q1});var cvD=()=>{};function AQ1(H){let $=new Set(YNH.map((A)=>zLH(A.key)));return H.map((A)=>{let L={};for(let[I,D]of Object.entries(A.bindings))if(!$.has(zLH(I)))L[I]=D;return{context:A.context,bindings:L}}).filter((A)=>Object.keys(A.bindings).length>0)}function lvD(){let $={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:AQ1(HXH)};return yH($,null,2)+` `}var ivD=K(()=>{B8$();f8$();Z$()});var rvD={};XA(rvD,{call:()=>LQ1});async function LQ1(){if(!m2())return{type:"text",value:"Keybinding customization is not enabled. This feature is currently in preview."};let H=OLH(),$=!1;try{await NVH.stat(H),$=!0}catch{}if(!$){let A=lvD(),L=nvD.dirname(H);await NVH.mkdir(L,{recursive:!0}),await NVH.writeFile(H,A,"utf-8")}try{return await Mb(H),{type:"text",value:$?`Opened ${H} in your editor.`:`Created ${H} with template. Opened in your editor.`}}catch(A){return{type:"text",value:`${$?"Opened":"Created"} ${H}. Could not open in editor: ${A instanceof Error?A.message:String(A)}`}}}var NVH,nvD;var avD=K(()=>{nu();ivD();Gb();NVH=require("fs/promises"),nvD=require("path")});var IQ1,VRA;var ovD=K(()=>{nu();IQ1={name:"keybindings",description:"Open or create your keybindings configuration file",isEnabled:()=>m2(),isHidden:!1,supportsNonInteractive:!1,type:"local",load:()=>Promise.resolve().then(() => (avD(),rvD)),userFacingName:()=>"keybindings"},VRA=IQ1});var tvD=()=>({type:"local-jsx",name:"login",description:HmL()?"Switch Anthropic accounts":"Sign in with your Anthropic account",isEnabled:()=>!process.env.DISABLE_LOGIN_COMMAND,isHidden:!1,load:()=>Promise.resolve().then(() => (J_$(),_FD)),userFacingName(){return"login"}});var svD=K(()=>{EI()});var evD;var HhD=K(()=>{evD={type:"local-jsx",name:"logout",description:"Sign out from your Anthropic account",isEnabled:()=>!process.env.DISABLE_LOGOUT_COMMAND,isHidden:!1,load:()=>Promise.resolve().then(() => (QP$(),E4D)),userFacingName(){return"logout"}}});function AhD(){return $hD.default.createElement(V,null,"Checking GitHub CLI installation\u2026")}var $hD;var LhD=K(()=>{xH();$hD=b(s(),1)});function IhD({currentRepo:H,useCurrentRepo:$,repoUrl:A,onRepoUrlChange:L,onSubmit:I,onToggleUseCurrentRepo:D}){let[B,f]=hX.useState(0),[E,M]=hX.useState(!1),U=QL().columns,X=hX.useCallback(()=>{if(!($?H:A)?.trim()){M(!0);return}I()},[$,H,A,I]);return bI({"confirm:previous":()=>{D(!0),M(!1)},"confirm:next":()=>{D(!1),M(!1)},"confirm:yes":X},{context:"Confirmation"}),hX.default.createElement(hX.default.Fragment,null,hX.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},hX.default.createElement(x,{flexDirection:"column",marginBottom:1},hX.default.createElement(V,{bold:!0},"Install GitHub App"),hX.default.createElement(V,{dimColor:!0},"Select GitHub repository")),H&&hX.default.createElement(x,{marginBottom:1},hX.default.createElement(V,{bold:$,color:$?"permission":void 0},$?"> ":" ","Use current repository: ",H)),hX.default.createElement(x,{marginBottom:1},hX.default.createElement(V,{bold:!$||!H,color:!$||!H?"permission":void 0},!$||!H?"> ":" ",H?"Enter a different repository":"Enter repository")),(!$||!H)&&hX.default.createElement(x,{marginLeft:2,marginBottom:1},hX.default.createElement(W9,{value:A,onChange:(J)=>{L(J),M(!1)},onSubmit:X,focus:!0,placeholder:"Enter a repo as owner/repo or https://github.com/owner/repo\u2026",columns:U,cursorOffset:B,onChangeCursorOffset:f,showCursor:!0}))),E&&hX.default.createElement(x,{marginLeft:3,marginBottom:1},hX.default.createElement(V,{color:"error"},"Please enter a repository name to continue")),hX.default.createElement(x,{marginLeft:3},hX.default.createElement(V,{dimColor:!0},H?"\u2191/\u2193 to select \xB7 ":"","Enter to continue")))}var hX;var DhD=K(()=>{xH();$I();S5();OB();hX=b(s(),1)});var BhD="Add Claude Code GitHub Workflow",Xb="https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md",fhD=`name: Claude Code claude: (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) id: claude uses: anthropics/claude-code-action@v1 # Optional: Add claude_args to customize behavior and configuration # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options # claude_args: '--allowed-tools Bash(gh pr:*)' [Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with: Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment. - **@claude mentions won't work until after the merge is complete** There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action). After merging this PR, let's try mentioning @claude in a comment on any PR to get started!`,MhD=`name: Claude Code Review claude-review: id: claude-review uses: anthropics/claude-code-action@v1 plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options `;function GhD({repoUrl:H,onSubmit:$}){return BA("confirm:yes",$,{context:"Confirmation"}),mF.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},mF.default.createElement(x,{flexDirection:"column",marginBottom:1},mF.default.createElement(V,{bold:!0},"Install the Claude GitHub App")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,null,"Opening browser to install the Claude GitHub App\u2026")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,null,"If your browser doesn't open automatically, visit:")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,{underline:!0},"https://github.com/apps/claude")),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,null,"Please install the app for repository: ",mF.default.createElement(V,{bold:!0},H))),mF.default.createElement(x,{marginBottom:1},mF.default.createElement(V,{dimColor:!0},"Important: Make sure to grant access to this specific repository")),mF.default.createElement(x,null,mF.default.createElement(V,{bold:!0,color:"permission"},"Press Enter once you've installed the app",pH.ellipsis)),mF.default.createElement(x,{marginTop:1},mF.default.createElement(V,{dimColor:!0},"Having trouble? See manual setup instructions at:"," ",mF.default.createElement(V,{color:"claude"},Xb))))}var mF;var UhD=K(()=>{xH();$I();jI();mF=b(s(),1)});function XhD({useExistingSecret:H,secretName:$,onToggleUseExistingSecret:A,onSecretNameChange:L,onSubmit:I}){let[D,B]=c4.useState(0),f=QL(),[E]=_I();return bI({"confirm:previous":()=>A(!0),"confirm:next":()=>A(!1),"confirm:yes":I},{context:"Confirmation"}),c4.default.createElement(c4.default.Fragment,null,c4.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},c4.default.createElement(x,{flexDirection:"column",marginBottom:1},c4.default.createElement(V,{bold:!0},"Install GitHub App"),c4.default.createElement(V,{dimColor:!0},"Setup API key secret")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,{color:"warning"},"ANTHROPIC_API_KEY already exists in repository secrets!")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,"Would you like to:")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,H?ZL("success",E)("> "):" ","Use the existing API key")),c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,!H?ZL("success",E)("> "):" ","Create a new secret with a different name")),!H&&c4.default.createElement(c4.default.Fragment,null,c4.default.createElement(x,{marginBottom:1},c4.default.createElement(V,null,"Enter new secret name (alphanumeric with underscores):")),c4.default.createElement(W9,{value:$,onChange:L,onSubmit:I,focus:!0,placeholder:"e.g., CLAUDE_API_KEY",columns:f.columns,cursorOffset:D,onChangeCursorOffset:B,showCursor:!0}))),c4.default.createElement(x,{marginLeft:3},c4.default.createElement(V,{dimColor:!0},"\u2191/\u2193 to select \xB7 Enter to continue")))}var c4;var JhD=K(()=>{xH();$I();S5();OB();c4=b(s(),1)});function FhD({existingApiKey:H,apiKeyOrOAuthToken:$,onApiKeyChange:A,onSubmit:L,onToggleUseExistingKey:I,onCreateOAuthToken:D,selectedOption:B=H?"existing":D?"oauth":"new",onSelectOption:f}){let[E,M]=bX.useState(0),G=QL(),[U]=_I(),X=bX.useCallback(()=>{if(B==="new"&&D)f?.("oauth");else if(B==="oauth"&&H)f?.("existing"),I(!0)},[B,D,H,f,I]),J=bX.useCallback(()=>{if(B==="existing")f?.(D?"oauth":"new"),I(!1);else if(B==="oauth")f?.("new")},[B,D,f,I]),F=bX.useCallback(()=>{if(B==="oauth"&&D)D();else L()},[B,D,L]);return bI({"confirm:previous":X,"confirm:next":J,"confirm:yes":F},{context:"Confirmation"}),bX.default.createElement(bX.default.Fragment,null,bX.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},bX.default.createElement(x,{flexDirection:"column",marginBottom:1},bX.default.createElement(V,{bold:!0},"Install GitHub App"),bX.default.createElement(V,{dimColor:!0},"Choose API key")),H&&bX.default.createElement(x,{marginBottom:1},bX.default.createElement(V,null,B==="existing"?ZL("success",U)("> "):" ","Use your existing Claude Code API key")),D&&bX.default.createElement(x,{marginBottom:1},bX.default.createElement(V,null,B==="oauth"?ZL("success",U)("> "):" ","Create a long-lived token with your Claude subscription")),bX.default.createElement(x,{marginBottom:1},bX.default.createElement(V,null,B==="new"?ZL("success",U)("> "):" ","Enter a new API key")),B==="new"&&bX.default.createElement(W9,{value:$,onChange:A,onSubmit:L,onPaste:A,focus:!0,placeholder:"sk-ant\u2026 (Create a new key at https://platform.claude.com/settings/keys)",mask:"*",columns:G.columns,cursorOffset:E,onChangeCursorOffset:M,showCursor:!0})),bX.default.createElement(x,{marginLeft:3},bX.default.createElement(V,{dimColor:!0},"\u2191/\u2193 to select \xB7 Enter to continue")))}var bX;var KhD=K(()=>{xH();$I();S5();OB();bX=b(s(),1)});function QhD({currentWorkflowInstallStep:H,secretExists:$,useExistingSecret:A,secretName:L,skipWorkflow:I=!1,selectedWorkflows:D}){let B=I?["Getting repository information",$&&A?"Using existing API key secret":`Setting up ${L} secret`]:["Getting repository information","Creating branch",D.length>1?"Creating workflow files":"Creating workflow file",$&&A?"Using existing API key secret":`Setting up ${L} secret`,"Opening pull request page"];return Md.default.createElement(Md.default.Fragment,null,Md.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},Md.default.createElement(x,{flexDirection:"column",marginBottom:1},Md.default.createElement(V,{bold:!0},"Install GitHub App"),Md.default.createElement(V,{dimColor:!0},"Create GitHub Actions workflow")),B.map((f,E)=>{let M="pending";if(E{xH();Md=b(s(),1)});function VhD({secretExists:H,useExistingSecret:$,secretName:A,skipWorkflow:L=!1}){return VU.default.createElement(VU.default.Fragment,null,VU.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},VU.default.createElement(x,{flexDirection:"column",marginBottom:1},VU.default.createElement(V,{bold:!0},"Install GitHub App"),VU.default.createElement(V,{dimColor:!0},"Success")),!L&&VU.default.createElement(V,{color:"success"},"\u2713 GitHub Actions workflow created!"),H&&$&&VU.default.createElement(x,{marginTop:1},VU.default.createElement(V,{color:"success"},"\u2713 Using existing ANTHROPIC_API_KEY secret")),(!H||!$)&&VU.default.createElement(x,{marginTop:1},VU.default.createElement(V,{color:"success"},"\u2713 API key saved as ",A," secret")),VU.default.createElement(x,{marginTop:1},VU.default.createElement(V,null,"Next steps:")),L?VU.default.createElement(VU.default.Fragment,null,VU.default.createElement(V,null,"1. Install the Claude GitHub App if you haven't already"),VU.default.createElement(V,null,"2. Your workflow file was kept unchanged"),VU.default.createElement(V,null,"3. API key is configured and ready to use")):VU.default.createElement(VU.default.Fragment,null,VU.default.createElement(V,null,"1. A pre-filled PR page has been created"),VU.default.createElement(V,null,"2. Install the Claude GitHub App if you haven't already"),VU.default.createElement(V,null,"3. Merge the PR to enable Claude PR assistance"))),VU.default.createElement(x,{marginLeft:3},VU.default.createElement(V,{dimColor:!0},"Press any key to exit")))}var VU;var PhD=K(()=>{xH();VU=b(s(),1)});function _hD({error:H,errorReason:$,errorInstructions:A}){return kK.default.createElement(kK.default.Fragment,null,kK.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},kK.default.createElement(x,{flexDirection:"column",marginBottom:1},kK.default.createElement(V,{bold:!0},"Install GitHub App")),kK.default.createElement(V,{color:"error"},"Error: ",H),$&&kK.default.createElement(x,{marginTop:1},kK.default.createElement(V,{dimColor:!0},"Reason: ",$)),A&&A.length>0&&kK.default.createElement(x,{flexDirection:"column",marginTop:1},kK.default.createElement(V,{dimColor:!0},"How to fix:"),A.map((L,I)=>kK.default.createElement(x,{key:I,marginLeft:2},kK.default.createElement(V,{dimColor:!0},"\u2022 "),kK.default.createElement(V,null,L)))),kK.default.createElement(x,{marginTop:1},kK.default.createElement(V,{dimColor:!0},"For manual setup instructions, see:"," ",kK.default.createElement(V,{color:"claude"},Xb)))),kK.default.createElement(x,{marginLeft:3},kK.default.createElement(V,{dimColor:!0},"Press any key to exit")))}var kK;var YhD=K(()=>{xH();kK=b(s(),1)});function ChD({repoName:H,onSelectAction:$}){return QC.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},QC.default.createElement(x,{flexDirection:"column",marginBottom:1},QC.default.createElement(V,{bold:!0},"Existing Workflow Found"),QC.default.createElement(V,{dimColor:!0},"Repository: ",H)),QC.default.createElement(x,{flexDirection:"column",marginBottom:1},QC.default.createElement(V,null,"A Claude workflow file already exists at"," ",QC.default.createElement(V,{color:"claude"},".github/workflows/claude.yml")),QC.default.createElement(V,{dimColor:!0},"What would you like to do?")),QC.default.createElement(x,{flexDirection:"column"},QC.default.createElement(QA,{options:[{label:"Update workflow file with latest version",value:"update"},{label:"Skip workflow update (configure secrets only)",value:"skip"},{label:"Exit without making changes",value:"exit"}],onChange:(D)=>{$(D)},onCancel:()=>{$("exit")}})),QC.default.createElement(x,{marginTop:1},QC.default.createElement(V,{dimColor:!0},"View the latest workflow template at:"," ",QC.default.createElement(V,{color:"claude"},"https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml"))))}var QC;var whD=K(()=>{xH();l8();QC=b(s(),1)});function ZhD({warnings:H,onContinue:$}){return BA("confirm:yes",$,{context:"Confirmation"}),o7.default.createElement(o7.default.Fragment,null,o7.default.createElement(x,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},o7.default.createElement(x,{flexDirection:"column",marginBottom:1},o7.default.createElement(V,{bold:!0},pH.warning," Setup Warnings"),o7.default.createElement(V,{dimColor:!0},"We found some potential issues, but you can continue anyway")),H.map((A,L)=>o7.default.createElement(x,{key:L,flexDirection:"column",marginBottom:1},o7.default.createElement(V,{color:"warning",bold:!0},A.title),o7.default.createElement(V,null,A.message),A.instructions.length>0&&o7.default.createElement(x,{flexDirection:"column",marginLeft:2,marginTop:1},A.instructions.map((I,D)=>o7.default.createElement(V,{key:D,dimColor:!0},"\u2022 ",I))))),o7.default.createElement(x,{marginTop:1},o7.default.createElement(V,{bold:!0,color:"permission"},"Press Enter to continue anyway, or Ctrl+C to exit and fix issues")),o7.default.createElement(x,{marginTop:1},o7.default.createElement(V,{dimColor:!0},"You can also try the manual setup steps if needed:"," ",o7.default.createElement(V,{color:"claude"},Xb)))))}var o7;var qhD=K(()=>{xH();$I();jI();o7=b(s(),1)});function zhD({isFocused:H,isSelected:$,children:A}){return ThD.default.createElement(M4$,{isFocused:H,isSelected:$},A)}var ThD;var NhD=K(()=>{C5A();ThD=b(s(),1)});var Oq$;var OhD=K(()=>{Oq$=class Oq$ extends Map{first;last;constructor(H){let $=[],A,L,I,D=0;for(let B of H){let f={...B,previous:I,next:void 0,index:D};if(I)I.next=f;A||=f,L=f,$.push([B.value,f]),D++,I=f}super($);this.first=A,this.last=L}}});var PRA,HZ,DQ1=(H,$)=>{switch($.type){case"focus-next-option":{if(!H.focusedValue)return H;let A=H.optionMap.get(H.focusedValue);if(!A)return H;let L=A.next||H.optionMap.first;if(!L)return H;if(!A.next&&L===H.optionMap.first)return{...H,focusedValue:L.value,visibleFromIndex:0,visibleToIndex:H.visibleOptionCount};if(!(L.index>=H.visibleToIndex))return{...H,focusedValue:L.value};let D=Math.min(H.optionMap.size,H.visibleToIndex+1),B=D-H.visibleOptionCount;return{...H,focusedValue:L.value,visibleFromIndex:B,visibleToIndex:D}}case"focus-previous-option":{if(!H.focusedValue)return H;let A=H.optionMap.get(H.focusedValue);if(!A)return H;let L=A.previous||H.optionMap.last;if(!L)return H;if(!A.previous&&L===H.optionMap.last){let f=H.optionMap.size,E=Math.max(0,f-H.visibleOptionCount);return{...H,focusedValue:L.value,visibleFromIndex:E,visibleToIndex:f}}if(!(L.index<=H.visibleFromIndex))return{...H,focusedValue:L.value};let D=Math.max(0,H.visibleFromIndex-1),B=D+H.visibleOptionCount;return{...H,focusedValue:L.value,visibleFromIndex:D,visibleToIndex:B}}case"toggle-focused-option":{if(!H.focusedValue)return H;if(H.value.includes(H.focusedValue)){let A=new Set(H.value);return A.delete(H.focusedValue),{...H,previousValue:H.value,value:[...A]}}return{...H,previousValue:H.value,value:[...H.value,H.focusedValue]}}case"reset":return $.state}},xhD=({visibleOptionCount:H,defaultValue:$,options:A})=>{let L=typeof H==="number"?Math.min(H,A.length):A.length,I=new Oq$(A),D=$??[];return{optionMap:I,visibleOptionCount:L,focusedValue:I.first?.value,visibleFromIndex:0,visibleToIndex:L,previousValue:D,value:D}},ShD=({visibleOptionCount:H=5,options:$,defaultValue:A,onChange:L,onSubmit:I})=>{let[D,B]=HZ.useReducer(DQ1,{visibleOptionCount:H,defaultValue:A,options:$},xhD),[f,E]=HZ.useState($);if($!==f&&!PRA.isDeepStrictEqual($,f))B({type:"reset",state:xhD({visibleOptionCount:H,defaultValue:A,options:$})}),E($);let M=HZ.useCallback(()=>{B({type:"focus-next-option"})},[]),G=HZ.useCallback(()=>{B({type:"focus-previous-option"})},[]),U=HZ.useCallback(()=>{B({type:"toggle-focused-option"})},[]),X=HZ.useCallback(()=>{I?.(D.value)},[D.value,I]),J=HZ.useMemo(()=>{return $.map((F,Q)=>({...F,index:Q})).slice(D.visibleFromIndex,D.visibleToIndex)},[$,D.visibleFromIndex,D.visibleToIndex]);return HZ.useEffect(()=>{if(!PRA.isDeepStrictEqual(D.previousValue,D.value))L?.(D.value)},[D.previousValue,D.value,$,L]),{focusedValue:D.focusedValue,visibleFromIndex:D.visibleFromIndex,visibleToIndex:D.visibleToIndex,value:D.value,visibleOptions:J,focusNextOption:M,focusPreviousOption:G,toggleFocusedOption:U,submit:X}};var jhD=K(()=>{OhD();PRA=require("util"),HZ=b(s(),1)});var RhD=({isDisabled:H=!1,state:$})=>{WL((A,L)=>{if(L.downArrow||L.ctrl&&A==="n"||!L.ctrl&&!L.shift&&A==="j")$.focusNextOption();if(L.upArrow||L.ctrl&&A==="p"||!L.ctrl&&!L.shift&&A==="k")$.focusPreviousOption();if(A===" ")$.toggleFocusedOption();if(L.return)$.submit()},{isActive:!H})};var yhD=K(()=>{xH()});function xVH({isDisabled:H=!1,visibleOptionCount:$=5,highlightText:A,options:L,defaultValue:I,onChange:D,onSubmit:B}){let f=ShD({visibleOptionCount:$,options:L,defaultValue:I,onChange:D,onSubmit:B});return RhD({isDisabled:H,state:f}),OVH.default.createElement(x,{flexDirection:"column"},f.visibleOptions.map((E)=>{let M=E.label;if(A&&E.label.includes(A)){let G=E.label.indexOf(A);M=OVH.default.createElement(OVH.default.Fragment,null,E.label.slice(0,G),OVH.default.createElement(V,{bold:!0},A),E.label.slice(G+A.length))}return OVH.default.createElement(zhD,{key:E.value,isFocused:!H&&f.focusedValue===E.value,isSelected:f.value.includes(E.value)},M)}))}var OVH;var xq$=K(()=>{xH();NhD();jhD();yhD();OVH=b(s(),1)});function fQ1(H){if(H.pending)return WC.default.createElement(V,null,"Press ",H.keyName," again to exit");return WC.default.createElement(rA,null,WC.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),WC.default.createElement(s$,{shortcut:"Space",action:"toggle"}),WC.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),WC.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))}function vhD({onSubmit:H,defaultSelections:$}){let[A,L]=SVH.useState(!1),I=SVH.useCallback((f)=>{if(f.length===0){L(!0);return}L(!1),H(f)},[H]),D=SVH.useCallback(()=>{L(!1)},[]),B=SVH.useCallback(()=>{L(!0)},[]);return WC.default.createElement(BL,{title:"Select GitHub workflows to install",subtitle:"We'll create a workflow file in your repository for each one you select.",onCancel:B,inputGuide:fQ1},WC.default.createElement(x,null,WC.default.createElement(V,{dimColor:!0},"More workflow examples (issue triage, CI fixes, etc.) at:"," ",WC.default.createElement(dI,{url:"https://github.com/anthropics/claude-code-action/blob/main/examples/"},"https://github.com/anthropics/claude-code-action/blob/main/examples/"))),WC.default.createElement(xVH,{options:BQ1.map((f)=>({label:f.label,value:f.value})),defaultValue:$,onSubmit:I,onChange:D}),A&&WC.default.createElement(x,null,WC.default.createElement(V,{color:"error"},"You must select at least one workflow to continue")))}var WC,SVH,BQ1;var hhD=K(()=>{xH();bB();xq$();lB();j0();eB();WC=b(s(),1),SVH=b(s(),1),BQ1=[{value:"claude",label:"@Claude Code - Tag @claude in issues and PR comments"},{value:"claude-review",label:"Claude Code Review - Automated code review on new PRs"}]});async function EQ1(H,$,A,L,I,D,B){let f=await jA("gh",["api",`repos/${H}/contents/${A}`,"--jq",".sha"]),E=null;if(f.code===0)E=f.stdout.trim();let M=L;if(I==="CLAUDE_CODE_OAUTH_TOKEN")M=L.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,"claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}");else if(I!=="ANTHROPIC_API_KEY")M=L.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,`anthropic_api_key: \${{ secrets.${I} }}`);let G=Buffer.from(M).toString("base64"),U=["api","--method","PUT",`repos/${H}/contents/${A}`,"-f",`message=${E?`"Update ${D}"`:`"${D}"`}`,"-f",`content=${G}`,"-f",`branch=${$}`];if(E)U.push("-f",`sha=${E}`);let X=await jA("gh",U);if(X.code!==0){if(X.stderr.includes("422")&&X.stderr.includes("sha"))throw c("tengu_setup_github_actions_failed",{reason:"failed_to_create_workflow_file",exit_code:X.code,...B}),Error(`Failed to create workflow file ${A}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`);c("tengu_setup_github_actions_failed",{reason:"failed_to_create_workflow_file",exit_code:X.code,...B});let J=` `+"\u2022 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";throw Error(`Failed to create workflow file ${A}: ${X.stderr}${J}`)}}async function bhD(H,$,A,L,I=!1,D,B,f){try{c("tengu_setup_github_actions_started",{skip_workflow:I,has_api_key:!!$,using_default_secret_name:A==="ANTHROPIC_API_KEY",selected_claude_workflow:D.includes("claude"),selected_claude_review_workflow:D.includes("claude-review"),...f});let E=await jA("gh",["api",`repos/${H}`,"--jq",".id"]);if(E.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"repo_not_found",exit_code:E.code,...f}),Error(`Failed to access repository ${H}`);let M=await jA("gh",["api",`repos/${H}`,"--jq",".default_branch"]);if(M.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"failed_to_get_default_branch",exit_code:M.code,...f}),Error(`Failed to get default branch: ${M.stderr}`);let G=M.stdout.trim(),U=await jA("gh",["api",`repos/${H}/git/ref/heads/${G}`,"--jq",".object.sha"]);if(U.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"failed_to_get_branch_sha",exit_code:U.code,...f}),Error(`Failed to get branch SHA: ${U.stderr}`);let X=U.stdout.trim(),J=null;if(!I){L(),J=`add-claude-github-actions-${Date.now()}`;let F=await jA("gh",["api","--method","POST",`repos/${H}/git/refs`,"-f",`ref=refs/heads/${J}`,"-f",`sha=${X}`]);if(F.code!==0)throw c("tengu_setup_github_actions_failed",{reason:"failed_to_create_branch",exit_code:F.code,...f}),Error(`Failed to create branch: ${F.stderr}`);L();let Q=[];if(D.includes("claude"))Q.push({path:".github/workflows/claude.yml",content:fhD,message:"Claude PR Assistant workflow"});if(D.includes("claude-review"))Q.push({path:".github/workflows/claude-code-review.yml",content:MhD,message:"Claude Code Review workflow"});for(let W of Q)await EQ1(H,J,W.path,W.content,A,W.message,f)}if(L(),$){let F=await jA("gh",["secret","set",A,"--body",$,"--repo",H]);if(F.code!==0){c("tengu_setup_github_actions_failed",{reason:"failed_to_set_api_key_secret",exit_code:F.code,...f});let Q=` `+"\u2022 For manual setup \u2192 Visit: https://github.com/anthropics/claude-code-action";throw Error(`Failed to set API key secret: ${F.stderr||"Unknown error"}${Q}`)}}if(!I&&J){L();let F=`https://github.com/${H}/compare/${G}...${J}?quick_pull=1&title=${encodeURIComponent(BhD)}&body=${encodeURIComponent(EhD)}`;await HE(F)}c("tengu_setup_github_actions_completed",{skip_workflow:I,has_api_key:!!$,auth_type:B,using_default_secret_name:A==="ANTHROPIC_API_KEY",selected_claude_workflow:D.includes("claude"),selected_claude_review_workflow:D.includes("claude-review"),...f}),AA((F)=>({...F,githubActionSetupCount:(F.githubActionSetupCount??0)+1}))}catch(E){if(!E||!(E instanceof Error)||!E.message.includes("Failed to"))c("tengu_setup_github_actions_failed",{reason:"unexpected_error",...f});if(E instanceof Error)r(E);throw E}}var khD=K(()=>{B0();F3();z$();_$();vA()});function ghD({onSuccess:H,onCancel:$}){let[A,L]=d3.useState({state:"starting"}),[I]=d3.useState(()=>new DbH),[D,B]=d3.useState(""),[f,E]=d3.useState(0),[M,G]=d3.useState(!1),[U,X]=d3.useState(!1),J=d3.useRef(new Set),F=QL(),Q=Math.max(50,F.columns-uhD.length-4);WL((Y,Z)=>{if(A.state==="error")if(Z.return&&A.toRetry)B(""),E(0),L({state:"about_to_retry",nextState:A.toRetry});else $()});async function W(Y,Z){try{let[q,O]=Y.split("#");if(!q||!O){L({state:"error",message:"Invalid code. Please make sure the full code was copied",toRetry:{state:"waiting_for_login",url:Z}});return}c("tengu_oauth_manual_entry",{}),I.handleManualAuthCodeInput({authorizationCode:q,state:O})}catch(q){r(q instanceof Error?q:Error(String(q))),L({state:"error",message:q.message,toRetry:{state:"waiting_for_login",url:Z}})}}let P=d3.useCallback(async()=>{J.current.forEach((Y)=>clearTimeout(Y)),J.current.clear();try{let Y=await I.startOAuthFlow(async(O)=>{L({state:"waiting_for_login",url:O});let j=setTimeout(()=>G(!0),3000);J.current.add(j)},{loginWithClaudeAi:!0,inferenceOnly:!0,expiresIn:31536000});L({state:"processing"});let Z=OqH(Y);if(Z.warning)c("tengu_oauth_storage_warning",{warning:Z.warning});let q=setTimeout(()=>{L({state:"success",token:Y.accessToken});let O=setTimeout(()=>{H(Y.accessToken)},1000);J.current.add(O)},100);J.current.add(q)}catch(Y){let Z=Y.message;L({state:"error",message:Z,toRetry:{state:"starting"}}),r(Y instanceof Error?Y:Error(String(Y))),c("tengu_oauth_error",{error:Z})}},[I,H]);d3.useEffect(()=>{if(A.state==="starting")P()},[A.state,P]),d3.useEffect(()=>{if(A.state==="about_to_retry"){let Y=setTimeout(()=>{if(A.nextState.state==="waiting_for_login")G(!0);else G(!1);L(A.nextState)},500);J.current.add(Y)}},[A]),d3.useEffect(()=>{if(D==="c"&&A.state==="waiting_for_login"&&M&&!U)K3(A.url).then((Y)=>{if(Y)X(!0),setTimeout(()=>X(!1),2000)}),B("")},[D,A,M,U]),d3.useEffect(()=>{let Y=J.current;return()=>{I.cleanup(),Y.forEach((Z)=>clearTimeout(Z)),Y.clear()}},[I]);function C(){switch(A.state){case"starting":return E8.default.createElement(x,null,E8.default.createElement(vD,null),E8.default.createElement(V,null,"Starting authentication\u2026"));case"waiting_for_login":return E8.default.createElement(x,{flexDirection:"column",gap:1},!M&&E8.default.createElement(x,null,E8.default.createElement(vD,null),E8.default.createElement(V,null,"Opening browser to sign in with your Claude account\u2026")),M&&E8.default.createElement(x,null,E8.default.createElement(V,null,uhD),E8.default.createElement(W9,{value:D,onChange:B,onSubmit:(Y)=>W(Y,A.url),cursorOffset:f,onChangeCursorOffset:E,columns:Q})));case"processing":return E8.default.createElement(x,null,E8.default.createElement(vD,null),E8.default.createElement(V,null,"Processing authentication\u2026"));case"success":return E8.default.createElement(x,{flexDirection:"column",gap:1},E8.default.createElement(V,{color:"success"},"\u2713 Authentication token created successfully!"),E8.default.createElement(V,{dimColor:!0},"Using token for GitHub Actions setup\u2026"));case"error":return E8.default.createElement(x,{flexDirection:"column",gap:1},E8.default.createElement(V,{color:"error"},"OAuth error: ",A.message),A.toRetry?E8.default.createElement(V,{dimColor:!0},"Press Enter to try again, or any other key to cancel"):E8.default.createElement(V,{dimColor:!0},"Press any key to return to API key selection"));case"about_to_retry":return E8.default.createElement(x,{flexDirection:"column",gap:1},E8.default.createElement(V,{color:"permission"},"Retrying\u2026"));default:return null}}return E8.default.createElement(x,{flexDirection:"column",gap:1},A.state==="starting"&&E8.default.createElement(x,{flexDirection:"column",gap:1,paddingBottom:1},E8.default.createElement(V,{bold:!0},"Create Authentication Token"),E8.default.createElement(V,{dimColor:!0},"Creating a long-lived token for GitHub Actions")),A.state!=="success"&&A.state!=="starting"&&A.state!=="processing"&&E8.default.createElement(x,{key:"header",flexDirection:"column",gap:1,paddingBottom:1},E8.default.createElement(V,{bold:!0},"Create Authentication Token"),E8.default.createElement(V,{dimColor:!0},"Creating a long-lived token for GitHub Actions")),A.state==="waiting_for_login"&&M&&E8.default.createElement(x,{flexDirection:"column",key:"urlToCopy",gap:1,paddingBottom:1},E8.default.createElement(x,{paddingX:1},E8.default.createElement(V,{dimColor:!0},"Browser didn't open? Use the url below to sign in"," "),U?E8.default.createElement(V,{color:"success"},"(Copied!)"):E8.default.createElement(V,{dimColor:!0},E8.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),E8.default.createElement(dI,{url:A.url},E8.default.createElement(V,{dimColor:!0},A.url))),E8.default.createElement(x,{paddingLeft:1,flexDirection:"column",gap:1},C()))}var E8,d3,uhD="Paste code here if prompted > ";var mhD=K(()=>{xH();pm();lB();S5();x2A();EI();z$();JM();_$();OB();E8=b(s(),1),d3=b(s(),1)});var phD={};XA(phD,{call:()=>UQ1});function GQ1(H){let[$]=A4.useState(()=>eZ()),[A,L]=A4.useState({...MQ1,useExistingKey:!!$,selectedApiKeyOption:$?"existing":p_()?"oauth":"new"});zB(),A4.default.useEffect(()=>{c("tengu_install_github_app_started",{})},[]);let I=A4.useCallback(async()=>{let O=[];if((await fE("gh --version",{shell:!0,reject:!1})).exitCode!==0)O.push({title:"GitHub CLI not found",message:"GitHub CLI (gh) does not appear to be installed or accessible.",instructions:["Install GitHub CLI from https://cli.github.com/","macOS: brew install gh","Windows: winget install --id GitHub.cli","Linux: See installation instructions at https://github.com/cli/cli#installation"]});let u=await fE("gh auth status -a",{shell:!0,reject:!1});if(u.exitCode!==0)O.push({title:"GitHub CLI not authenticated",message:"GitHub CLI does not appear to be authenticated.",instructions:["Run: gh auth login","Follow the prompts to authenticate with GitHub","Or set up authentication using environment variables or other methods"]});else{let g=u.stdout.match(/Token scopes:.*$/m);if(g){let h=g[0],p=[];if(!h.includes("repo"))p.push("repo");if(!h.includes("workflow"))p.push("workflow");if(p.length>0){L((d)=>({...d,step:"error",error:`GitHub CLI is missing required permissions: ${p.join(", ")}.`,errorReason:"Missing required scopes",errorInstructions:[`Your GitHub CLI authentication is missing the "${p.join('" and "')}" scope${p.length>1?"s":""} needed to manage GitHub Actions and secrets.`,"","To fix this, run:"," gh auth refresh -h github.com -s repo,workflow","","This will add the necessary permissions to manage workflows and secrets."]}));return}}}let y=await h9L()??"";c("tengu_install_github_app_step_completed",{step:"check-gh"}),L((g)=>({...g,warnings:O,currentRepo:y,selectedRepoName:y,useCurrentRepo:!!y,step:O.length>0?"warnings":"choose-repo"}))},[]);A4.default.useEffect(()=>{if(A.step==="check-gh")I()},[A.step,I]);let D=A4.useCallback(async(O,j)=>{L((u)=>({...u,step:"creating",currentWorkflowInstallStep:0}));try{await bhD(A.selectedRepoName,O,j,()=>{L((u)=>({...u,currentWorkflowInstallStep:u.currentWorkflowInstallStep+1}))},A.workflowAction==="skip",A.selectedWorkflows,A.authType,{useCurrentRepo:A.useCurrentRepo,workflowExists:A.workflowExists,secretExists:A.secretExists}),c("tengu_install_github_app_step_completed",{step:"creating"}),L((u)=>({...u,step:"success"}))}catch(u){let y=u instanceof Error?u.message:"Failed to set up GitHub Actions";if(y.includes("workflow file already exists"))c("tengu_install_github_app_error",{reason:"workflow_file_exists"}),L((g)=>({...g,step:"error",error:"A Claude workflow file already exists in this repository.",errorReason:"Workflow file conflict",errorInstructions:["The file .github/workflows/claude.yml already exists","You can either:"," 1. Delete the existing file and run this command again"," 2. Update the existing file manually using the template from:",` ${Xb}`]}));else c("tengu_install_github_app_error",{reason:"setup_github_actions_failed"}),L((g)=>({...g,step:"error",error:y,errorReason:"GitHub Actions setup failed",errorInstructions:[]}))}},[A.selectedRepoName,A.workflowAction,A.selectedWorkflows,A.useCurrentRepo,A.workflowExists,A.secretExists,A.authType]);async function B(){await HE("https://github.com/apps/claude")}async function f(O){try{let j=await jA("gh",["api",`repos/${O}`,"--jq",".permissions.admin"]);if(j.code===0)return{hasAccess:j.stdout.trim()==="true"};if(j.stderr.includes("404")||j.stderr.includes("Not Found"))return{hasAccess:!1,error:"repository_not_found"};return{hasAccess:!1}}catch{return{hasAccess:!1}}}async function E(O){return(await jA("gh",["api",`repos/${O}/contents/.github/workflows/claude.yml`,"--jq",".sha"])).code===0}async function M(){let O=await jA("gh",["secret","list","--app","actions","--repo",A.selectedRepoName]);if(O.code===0)if(O.stdout.split(` `).some((y)=>{return/^ANTHROPIC_API_KEY\s+/.test(y)}))L((y)=>({...y,secretExists:!0,step:"check-existing-secret"}));else if($)L((y)=>({...y,apiKeyOrOAuthToken:$,useExistingKey:!0})),await D($,A.secretName);else L((y)=>({...y,step:"api-key"}));else if($)L((j)=>({...j,apiKeyOrOAuthToken:$,useExistingKey:!0})),await D($,A.secretName);else L((j)=>({...j,step:"api-key"}))}let G=async()=>{if(A.step==="warnings")c("tengu_install_github_app_step_completed",{step:"warnings"}),L((O)=>({...O,step:"install-app"})),setTimeout(()=>{B()},0);else if(A.step==="choose-repo"){let O=A.useCurrentRepo?A.currentRepo:A.selectedRepoName;if(!O.trim())return;let j=[];if(O.includes("github.com")){let g=O.match(/github\.com[:/]([^/]+\/[^/]+)(\.git)?$/);if(!g)j.push({title:"Invalid GitHub URL format",message:"The repository URL format appears to be invalid.",instructions:["Use format: owner/repo or https://github.com/owner/repo","Example: anthropics/claude-cli"]});else O=g[1]?.replace(/\.git$/,"")||""}if(!O.includes("/"))j.push({title:"Repository format warning",message:'Repository should be in format "owner/repo"',instructions:["Use format: owner/repo","Example: anthropics/claude-cli"]});let u=await f(O);if(u.error==="repository_not_found")j.push({title:"Repository not found",message:`Repository ${O} was not found or you don't have access.`,instructions:[`Check that the repository name is correct: ${O}`,"Ensure you have access to this repository",'For private repositories, make sure your GitHub token has the "repo" scope',"You can add the repo scope with: gh auth refresh -h github.com -s repo,workflow"]});else if(!u.hasAccess)j.push({title:"Admin permissions required",message:`You might need admin permissions on ${O} to set up GitHub Actions.`,instructions:["Repository admins can install GitHub Apps and set secrets","Ask a repository admin to run this command if setup fails","Alternatively, you can use the manual setup instructions"]});let y=await E(O);if(j.length>0){let g=[...A.warnings,...j];L((h)=>({...h,selectedRepoName:O,workflowExists:y,warnings:g,step:"warnings"}))}else c("tengu_install_github_app_step_completed",{step:"choose-repo"}),L((g)=>({...g,selectedRepoName:O,workflowExists:y,step:"install-app"})),setTimeout(()=>{B()},0)}else if(A.step==="install-app")if(c("tengu_install_github_app_step_completed",{step:"install-app"}),A.workflowExists)L((O)=>({...O,step:"check-existing-workflow"}));else L((O)=>({...O,step:"select-workflows"}));else if(A.step==="check-existing-workflow")return;else if(A.step==="select-workflows")return;else if(A.step==="check-existing-secret")if(c("tengu_install_github_app_step_completed",{step:"check-existing-secret"}),A.useExistingSecret)await D(null,A.secretName);else await D(A.apiKeyOrOAuthToken,A.secretName);else if(A.step==="api-key"){if(A.selectedApiKeyOption==="oauth")return;let O=A.selectedApiKeyOption==="existing"?$:A.apiKeyOrOAuthToken;if(!O){c("tengu_install_github_app_error",{reason:"api_key_missing"}),L((u)=>({...u,step:"error",error:"API key is required"}));return}L((u)=>({...u,apiKeyOrOAuthToken:O,useExistingKey:A.selectedApiKeyOption==="existing"}));let j=await jA("gh",["secret","list","--app","actions","--repo",A.selectedRepoName]);if(j.code===0)if(j.stdout.split(` For manual setup instructions, see: ${Xb}`)}}),A.step){case"check-gh":return A4.default.createElement(AhD,null);case"warnings":return A4.default.createElement(ZhD,{warnings:A.warnings,onContinue:G});case"choose-repo":return A4.default.createElement(IhD,{currentRepo:A.currentRepo,useCurrentRepo:A.useCurrentRepo,repoUrl:A.selectedRepoName,onRepoUrlChange:U,onToggleUseCurrentRepo:C,onSubmit:G});case"install-app":return A4.default.createElement(GhD,{repoUrl:A.selectedRepoName,onSubmit:G});case"check-existing-workflow":return A4.default.createElement(ChD,{repoName:A.selectedRepoName,onSelectAction:q});case"check-existing-secret":return A4.default.createElement(XhD,{useExistingSecret:A.useExistingSecret,secretName:A.secretName,onToggleUseExistingSecret:Z,onSecretNameChange:P,onSubmit:G});case"api-key":return A4.default.createElement(FhD,{existingApiKey:$,useExistingKey:A.useExistingKey,apiKeyOrOAuthToken:A.apiKeyOrOAuthToken,onApiKeyChange:X,onToggleUseExistingKey:Y,onSubmit:G,onCreateOAuthToken:p_()?F:void 0,selectedOption:A.selectedApiKeyOption,onSelectOption:J});case"creating":return A4.default.createElement(QhD,{currentWorkflowInstallStep:A.currentWorkflowInstallStep,secretExists:A.secretExists,useExistingSecret:A.useExistingSecret,secretName:A.secretName,skipWorkflow:A.workflowAction==="skip",selectedWorkflows:A.selectedWorkflows});case"success":return A4.default.createElement(VhD,{secretExists:A.secretExists,useExistingSecret:A.useExistingSecret,secretName:A.secretName,skipWorkflow:A.workflowAction==="skip"});case"error":return A4.default.createElement(_hD,{error:A.error,errorReason:A.errorReason,errorInstructions:A.errorInstructions});case"select-workflows":return A4.default.createElement(vhD,{defaultSelections:A.selectedWorkflows,onSubmit:(O)=>{if(c("tengu_install_github_app_step_completed",{step:"select-workflows"}),L((j)=>({...j,selectedWorkflows:O})),$)M();else L((j)=>({...j,step:"api-key"}))}});case"oauth-flow":return A4.default.createElement(ghD,{onSuccess:Q,onCancel:W})}}async function UQ1(H){return yD("github-app"),A4.default.createElement(GQ1,{onDone:H})}var A4,MQ1;var dhD=K(()=>{xH();EI();UM();B0();O_();t8();F3();LhD();DhD();UhD();JhD();KhD();WhD();PhD();YhD();whD();qhD();hhD();khD();mhD();z$();yE();A4=b(s(),1),MQ1={step:"check-gh",selectedRepoName:"",currentRepo:"",useCurrentRepo:!1,apiKeyOrOAuthToken:"",useExistingKey:!0,currentWorkflowInstallStep:0,warnings:[],secretExists:!1,secretName:"ANTHROPIC_API_KEY",useExistingSecret:!0,workflowExists:!1,selectedWorkflows:["claude","claude-review"],selectedApiKeyOption:"new",authType:"api_key"}});var XQ1,chD;var lhD=K(()=>{EI();XQ1={type:"local-jsx",name:"install-github-app",description:"Set up Claude GitHub Actions for a repository",isEnabled:()=>!process.env.DISABLE_INSTALL_GITHUB_APP_COMMAND&&!$O(),isHidden:!1,load:()=>Promise.resolve().then(() => (dhD(),phD)),userFacingName(){return"install-github-app"}},chD=XQ1});var nhD={};XA(nhD,{call:()=>JQ1});async function JQ1(){if(yD("slack-app"),c("tengu_install_slack_app_clicked",{}),AA(($)=>({...$,slackAppInstallCount:($.slackAppInstallCount??0)+1})),await HE(ihD))return{type:"text",value:"Opening Slack app installation page in browser\u2026"};else return{type:"text",value:`Couldn't open browser. Visit: ${ihD}`}}var ihD="https://slack.com/marketplace/A08SF47R6P4-claude";var rhD=K(()=>{F3();vA();z$();yE()});var FQ1,ahD;var ohD=K(()=>{FQ1={type:"local",name:"install-slack-app",description:"Install the Claude Slack app",isEnabled:()=>!0,isHidden:!1,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (rhD(),nhD)),userFacingName(){return"install-slack-app"}},ahD=FQ1});var thD=()=>{};function ehD(H){switch(H){case"project":return{label:"Project MCPs",path:b3(H)};case"user":return{label:"User MCPs",path:b3(H)};case"local":return{label:"Local MCPs",path:b3(H)};case"enterprise":return{label:"Enterprise MCPs"};case"dynamic":return{label:"Built-in MCPs",path:"always available"};default:return{label:H}}}function KQ1(H){let $=new Map;for(let A of H){let L=A.scope;if(!$.has(L))$.set(L,[]);$.get(L).push(A)}for(let[,A]of $)A.sort((L,I)=>L.name.localeCompare(I.name));return $}function _RA({servers:H,agentServers:$=[],onSelectServer:A,onSelectAgentServer:L,onComplete:I}){let[D]=_I(),[B,f]=Z0.useState(0),E=Z0.default.useMemo(()=>{let O=H.filter((j)=>j.client.config.type!=="claudeai-proxy");return KQ1(O)},[H]),M=Z0.default.useMemo(()=>H.filter((O)=>O.client.config.type==="claudeai-proxy").sort((O,j)=>O.name.localeCompare(j.name)),[H]),G=Z0.default.useMemo(()=>(E.get("dynamic")??[]).sort((O,j)=>O.name.localeCompare(j.name)),[E]),U=ehD("dynamic"),X=Z0.default.useMemo(()=>{let O=[];for(let j of shD){let u=E.get(j)??[];for(let y of u)O.push({type:"server",server:y})}for(let j of M)O.push({type:"server",server:j});for(let j of $)O.push({type:"agent-server",agentServer:j});for(let j of G)O.push({type:"server",server:j});return O},[E,M,$,G]),J=Z0.useCallback(()=>{I("MCP dialog dismissed",{display:"system"})},[I]),F=Z0.useCallback(()=>{let O=X[B];if(!O)return;if(O.type==="server")A(O.server);else if(O.type==="agent-server"&&L)L(O.agentServer)},[X,B,A,L]);bI({"confirm:previous":()=>f((O)=>O===0?X.length-1:O-1),"confirm:next":()=>f((O)=>O===X.length-1?0:O+1),"confirm:yes":F,"confirm:no":J},{context:"Confirmation"});let Q=(O)=>{return X.findIndex((j)=>j.type==="server"&&j.server===O)},W=(O)=>{return X.findIndex((j)=>j.type==="agent-server"&&j.agentServer===O)},P=QEH(),C=H.some((O)=>O.client.type==="failed");if(H.length===0&&$.length===0)return null;let Y=(O)=>{let j=Q(O),u=B===j,y="",g="";if(O.client.type==="disabled")y=ZL("inactive",D)(pH.radioOff),g="disabled";else if(O.client.type==="connected")y=ZL("success",D)(pH.tick),g="connected";else if(O.client.type==="pending"){y=ZL("inactive",D)(pH.radioOff);let{reconnectAttempt:h,maxReconnectAttempts:p}=O.client;if(h&&p)g=`reconnecting (${h}/${p})\u2026`;else g="connecting\u2026"}else if(O.client.type==="needs-auth")y=ZL("warning",D)(pH.triangleUpOutline),g="needs authentication";else y=ZL("error",D)(pH.cross),g="failed";return Z0.default.createElement(x,{key:`${O.name}-${j}`},Z0.default.createElement(V,{color:u?"suggestion":void 0},u?`${pH.pointer} `:" "),Z0.default.createElement(V,{color:u?"suggestion":void 0},O.name),Z0.default.createElement(V,{dimColor:!u}," \xB7 ",y," "),Z0.default.createElement(V,{dimColor:!u},g))},Z=(O)=>{let j=W(O),u=B===j,y=O.needsAuth?ZL("warning",D)(pH.triangleUpOutline):ZL("inactive",D)(pH.radioOff),g=O.needsAuth?"may need auth":"agent-only";return Z0.default.createElement(x,{key:`agent-${O.name}-${j}`},Z0.default.createElement(V,{color:u?"suggestion":void 0},u?`${pH.pointer} `:" "),Z0.default.createElement(V,{color:u?"suggestion":void 0},O.name),Z0.default.createElement(V,{dimColor:!u}," \xB7 ",y," "),Z0.default.createElement(V,{dimColor:!u},g))},q=H.length+$.length;return Z0.default.createElement(x,{flexDirection:"column"},Z0.default.createElement(wq$,null),Z0.default.createElement(BL,{title:"Manage MCP servers",subtitle:`${q} server${q===1?"":"s"}`,onCancel:J,hideInputGuide:!0},Z0.default.createElement(x,{flexDirection:"column"},shD.map((O)=>{let j=E.get(O);if(!j||j.length===0)return null;let u=ehD(O);return Z0.default.createElement(x,{key:O,flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},u.label),u.path&&Z0.default.createElement(V,{dimColor:!0}," (",u.path,")")),j.map((y)=>Y(y)))}),M.length>0&&Z0.default.createElement(x,{flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},"claude.ai")),M.map((O)=>Y(O))),$.length>0&&Z0.default.createElement(x,{flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},"Agent MCPs")),[...new Set($.flatMap((O)=>O.sourceAgents))].map((O)=>Z0.default.createElement(x,{key:O,flexDirection:"column",marginTop:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{dimColor:!0},"@",O)),$.filter((j)=>j.sourceAgents.includes(O)).map((j)=>Z(j))))),G.length>0&&Z0.default.createElement(x,{flexDirection:"column",marginBottom:1},Z0.default.createElement(x,{paddingLeft:2},Z0.default.createElement(V,{bold:!0},U.label),U.path&&Z0.default.createElement(V,{dimColor:!0}," (",U.path,")")),G.map((O)=>Y(O))),Z0.default.createElement(x,{flexDirection:"column"},C&&Z0.default.createElement(V,{dimColor:!0},P?"\u203B Error logs shown inline with --debug":"\u203B Run claude --debug to see error logs"),Z0.default.createElement(V,{dimColor:!0},Z0.default.createElement(dI,{url:"https://code.claude.com/docs/en/mcp"},"https://code.claude.com/docs/en/mcp")," ","for help")))),Z0.default.createElement(x,{paddingX:1},Z0.default.createElement(V,{dimColor:!0,italic:!0},Z0.default.createElement(rA,null,Z0.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),Z0.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),Z0.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}var Z0,shD;var YRA=K(()=>{xH();$I();E$();jI();fRA();bB();lB();j0();eB();kF();Z0=b(s(),1),shD=["project","local","user","enterprise"]});function Sq$({serverToolsCount:H,serverPromptsCount:$,serverResourcesCount:A}){let L=[];if(H>0)L.push("tools");if(A>0)L.push("resources");if($>0)L.push("prompts");return egH.default.createElement(x,null,egH.default.createElement(V,{bold:!0},"Capabilities: "),egH.default.createElement(V,{color:"text"},L.length>0?egH.default.createElement(rA,null,L):"none"))}var egH;var CRA=K(()=>{xH();eB();egH=b(s(),1)});var HbD=K(()=>{CK();_$();Z$()});function $bD(H){let $="plugin"in H?H.plugin:"no-plugin";return`${H.type}:${H.source}:${$}`}function AbD(H,$){if($.length===0)return;H((A)=>{let L=new Set(A.plugins.errors.map((D)=>$bD(D))),I=$.filter((D)=>!L.has($bD(D)));if(I.length===0)return A;return{...A,plugins:{...A.plugins,errors:[...A.plugins.errors,...I]}}})}function LbD(H,$=!1,A){let L=J$((F)=>F.mcp.clients),I=J$((F)=>F.mcp.tools),D=J$((F)=>F.mcp.resources),B=J$((F)=>F.authVersion),f=zI(),E=cP.useRef(new Map),M=cP.useCallback(({tools:F,commands:Q,resources:W,...P})=>{if(P.type==="disabled"||P.type==="failed")F=F??[],Q=Q??[],W=W??[];f((C)=>{let Y=bc(P.name),q=C.mcp.clients.findIndex((y)=>y.name===P.name)===-1?[...C.mcp.clients,P]:C.mcp.clients.map((y)=>y.name===P.name?P:y),O=F===void 0?C.mcp.tools:[...DR(C.mcp.tools,(y)=>y.name?.startsWith(Y)),...F],j=Q===void 0?C.mcp.commands:[...DR(C.mcp.commands,(y)=>y.name?.startsWith(Y)),...Q],u=W===void 0?C.mcp.resources:{...C.mcp.resources,...W.length>0?{[P.name]:W}:VEH(C.mcp.resources,P.name)};return{...C,mcp:{...C.mcp,clients:q,tools:O,commands:j,resources:u}}})},[f]),G=cP.useCallback(({client:F,tools:Q,commands:W,resources:P})=>{switch(M({...F,tools:Q,commands:W,resources:P}),F.type){case"connected":{if(F.client.onclose=()=>{let C=F.config.type??"stdio";if(lh(F.name,F.config).catch(()=>{N(`Failed to invalidate the server cache: ${F.name}`)}),NuH(F.name)){TA(F.name,"Server is disabled, skipping automatic reconnection");return}if(C!=="stdio"&&C!=="sdk"){let Y=VQ1(C);TA(F.name,`${Y} transport closed/disconnected, attempting automatic reconnection`);let Z=E.current.get(F.name);if(Z)clearTimeout(Z),E.current.delete(F.name);(async()=>{for(let O=1;O<=jVH;O++){if(NuH(F.name)){TA(F.name,"Server disabled during reconnection, stopping retry"),E.current.delete(F.name);return}M({...F,type:"pending",reconnectAttempt:O,maxReconnectAttempts:jVH});let j=Date.now();try{let y=await ih(F.name,F.config),g=Date.now()-j;if(y.client.type==="connected"){TA(F.name,`${Y} reconnection successful after ${g}ms (attempt ${O})`),E.current.delete(F.name),G(y);return}if(TA(F.name,`${Y} reconnection attempt ${O} completed with status: ${y.client.type}`),O===jVH){TA(F.name,`Max reconnection attempts (${jVH}) reached, giving up`),E.current.delete(F.name),G(y);return}}catch(y){let g=Date.now()-j;if(ME(F.name,`${Y} reconnection attempt ${O} failed after ${g}ms: ${y}`),O===jVH){TA(F.name,`Max reconnection attempts (${jVH}) reached, giving up`),E.current.delete(F.name),M({...F,type:"failed"});return}}let u=Math.min(QQ1*Math.pow(2,O-1),WQ1);TA(F.name,`Scheduling reconnection attempt ${O+1} in ${u}ms`),await new Promise((y)=>{let g=setTimeout(y,u);E.current.set(F.name,g)})}})()}else M({...F,type:"failed"})},F.capabilities?.tools?.listChanged)F.client.setNotificationHandler(SXA,async()=>{TA(F.name,"Received tools/list_changed notification, refreshing tools");try{let C=zS.cache.get(F);zS.cache.delete(F);let Y=await zS(F),Z=Y.length;if(C)C.then((q)=>{c("tengu_mcp_list_changed",{type:"tools",previousCount:q.length,newCount:Z})},()=>{c("tengu_mcp_list_changed",{type:"tools",newCount:Z})});else c("tengu_mcp_list_changed",{type:"tools",newCount:Z});M({...F,tools:Y})}catch(C){ME(F.name,`Failed to refresh tools after list_changed notification: ${C instanceof Error?C.message:String(C)}`)}});if(F.capabilities?.prompts?.listChanged)F.client.setNotificationHandler(xXA,async()=>{TA(F.name,"Received prompts/list_changed notification, refreshing prompts"),c("tengu_mcp_list_changed",{type:"prompts"});try{buH.cache.delete(F);let C=await buH(F);M({...F,commands:C})}catch(C){ME(F.name,`Failed to refresh prompts after list_changed notification: ${C instanceof Error?C.message:String(C)}`)}});if(F.capabilities?.resources?.listChanged)F.client.setNotificationHandler(ZXA,async()=>{TA(F.name,"Received resources/list_changed notification, refreshing resources"),c("tengu_mcp_list_changed",{type:"resources"});try{huH.cache.delete(F);let C=await huH(F);M({...F,resources:C})}catch(C){ME(F.name,`Failed to refresh resources after list_changed notification: ${C instanceof Error?C.message:String(C)}`)}});break}case"needs-auth":case"failed":case"pending":case"disabled":case"proxy":break}},[M]),U=j$();cP.useEffect(()=>{async function F(){let{servers:Q,errors:W}=$?{servers:{},errors:[]}:await Q3H(),P={...Q,...H};AbD(f,W),f((C)=>{let Y=new Set(C.mcp.clients.map((q)=>q.name)),Z=Object.entries(P).filter(([q])=>!Y.has(q)).map(([q,O])=>({name:q,type:"pending",config:O}));if(Z.length===0)return C;return{...C,mcp:{...C.mcp,clients:[...C.mcp.clients,...Z]}}})}F().catch((Q)=>{ME("useManageMCPConnections",`Failed to initialize servers as pending: ${Q instanceof Error?Q.message:String(Q)}`)})},[$,H,f,U]),cP.useEffect(()=>{let F=!1;async function Q(){zZD();let{servers:W,errors:P}=$?{servers:{},errors:[]}:await Q3H();if(F)return;AbD(f,P);let C={...W,...H};i2$(G,C).catch((O)=>{ME("useManageMcpConnections",`Failed to get MCP resources: ${O instanceof Error?O.message:String(O)}`)});let Y={};if(!$){if(Y=await ZuH(),F)return;if(Object.keys(Y).length>0)f((O)=>{let j=new Set(O.mcp.clients.map((y)=>y.name)),u=Object.entries(Y).filter(([y])=>!j.has(y)).map(([y,g])=>({name:y,type:"pending",config:g}));if(u.length===0)return O;return{...O,mcp:{...O.mcp,clients:[...O.mcp.clients,...u]}}}),i2$(G,Y).catch((O)=>{ME("useManageMcpConnections",`Failed to get claude.ai MCP resources: ${O instanceof Error?O.message:String(O)}`)})}let Z={...C,...Y},q={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0};for(let O of Object.values(Z))if(O.scope==="enterprise")q.enterprise++;else if(O.scope==="user")q.global++;else if(O.scope==="project")q.project++;else if(O.scope==="local")q.user++;else if(O.scope==="dynamic")q.plugin++;else if(O.scope==="claudeai")q.claudeai++;c("tengu_mcp_servers",q)}return Q(),()=>{F=!0}},[$,H,G,U,B,f]),cP.useEffect(()=>{let F=E.current;return()=>{for(let Q of F.values())clearTimeout(Q);F.clear()}},[]),cP.useEffect(()=>{},[L,f]),cP.useEffect(()=>A?.updateClients(L),[A,L]),cP.useEffect(()=>A?.updateTools(I),[A,I]),cP.useEffect(()=>A?.updateResources(D),[A,D]);let X=cP.useCallback(async(F)=>{let Q=L.find((C)=>C.name===F);if(!Q)throw Error(`MCP server ${F} not found`);let W=E.current.get(F);if(W)clearTimeout(W),E.current.delete(F);let P=await ih(F,Q.config);return G(P),P},[L,G,f]),J=cP.useCallback(async(F)=>{let Q=L.find((P)=>P.name===F);if(!Q)throw Error(`MCP server ${F} not found`);if(Q.type!=="disabled"){let P=E.current.get(F);if(P)clearTimeout(P),E.current.delete(F);if(W3H(F,!1),Q.type==="connected")await lh(F,Q.config);M({name:F,type:"disabled",config:Q.config})}else{W3H(F,!0),M({name:F,type:"pending",config:Q.config});let P=await ih(F,Q.config);G(P)}},[L,M,G,f]);return{reconnectMcpServer:X,toggleMcpServer:J}}function VQ1(H){switch(H){case"http":return"HTTP";case"ws":case"ws-ide":return"WebSocket";default:return"SSE"}}var cP,jVH=5,QQ1=1000,WQ1=30000;var IbD=K(()=>{g$();f3();_$();CK();pL();UR$();XR$();T3();lNA();tC();E$();z$();HbD();cP=b(s(),1)});function RVH(){let H=Gd.useContext(wRA);if(!H)throw Error("useMcpReconnect must be used within MCPConnectionManager");return H.reconnectMcpServer}function _s(){let H=Gd.useContext(wRA);if(!H)throw Error("useMcpToggleEnabled must be used within MCPConnectionManager");return H.toggleMcpServer}function jq$({children:H,dynamicMcpConfig:$,isStrictMcpConfig:A,mcpCliEndpoint:L}){let{reconnectMcpServer:I,toggleMcpServer:D}=LbD($,A,L),B=Gd.useMemo(()=>({reconnectMcpServer:I,toggleMcpServer:D}),[I,D]);return Gd.default.createElement(wRA.Provider,{value:B},H)}var Gd,wRA;var Ys=K(()=>{IbD();Gd=b(s(),1),wRA=Gd.createContext(null)});function Rq$(H,$){switch(H.client.type){case"connected":return{message:`Reconnected to ${$}.`,success:!0};case"needs-auth":return{message:`${$} requires authentication. Use the 'Authenticate' option.`,success:!1};case"failed":return{message:`Failed to reconnect to ${$}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${$}.`,success:!1}}}function HmH(H,$){let A=H instanceof Error?H.message:String(H);return`Error reconnecting to ${$}: ${A}`}function $mH({server:H,serverToolsCount:$,onViewTools:A,onCancel:L,onComplete:I,borderless:D=!1}){let[B]=_I(),f=zB(),E=J$((P)=>P.mcp),M=RVH(),G=_s(),[U,X]=s0.useState(!1),J=s0.default.useCallback(async()=>{let P=H.client.type!=="disabled";try{await G(H.name),L()}catch(C){I(`Failed to ${P?"disable":"enable"} MCP server '${H.name}': ${C instanceof Error?C.message:String(C)}`)}},[H.client.type,H.name,G,L,I]),F=String(H.name).charAt(0).toUpperCase()+String(H.name).slice(1),Q=Z2$(E.commands,H.name).length,W=[];if(H.client.type!=="disabled"&&$>0)W.push({label:"View tools",value:"tools"});if(H.client.type!=="disabled")W.push({label:"Reconnect",value:"reconnectMcpServer"});if(W.push({label:H.client.type!=="disabled"?"Disable":"Enable",value:"toggle-enabled"}),W.length===0)W.push({label:"Back",value:"back"});if(U)return s0.default.createElement(x,{flexDirection:"column",gap:1,padding:1},s0.default.createElement(V,{color:"text"},"Reconnecting to ",s0.default.createElement(V,{bold:!0},H.name)),s0.default.createElement(x,null,s0.default.createElement(vD,null),s0.default.createElement(V,null," Restarting MCP server process")),s0.default.createElement(V,{dimColor:!0},"This may take a few moments."));return s0.default.createElement(x,{flexDirection:"column"},s0.default.createElement(x,{flexDirection:"column",paddingX:1,borderStyle:D?void 0:"round"},s0.default.createElement(x,{marginBottom:1},s0.default.createElement(V,{bold:!0},F," MCP Server")),s0.default.createElement(x,{flexDirection:"column",gap:0},s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Status: "),H.client.type==="disabled"?s0.default.createElement(V,null,ZL("inactive",B)(pH.radioOff)," disabled"):H.client.type==="connected"?s0.default.createElement(V,null,ZL("success",B)(pH.tick)," connected"):H.client.type==="pending"?s0.default.createElement(s0.default.Fragment,null,s0.default.createElement(V,{dimColor:!0},pH.radioOff),s0.default.createElement(V,null," connecting\u2026")):s0.default.createElement(V,null,ZL("error",B)(pH.cross)," failed")),s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Command: "),s0.default.createElement(V,{dimColor:!0},H.config.command)),H.config.args&&H.config.args.length>0&&s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Args: "),s0.default.createElement(V,{dimColor:!0},H.config.args.join(" "))),s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Config location: "),s0.default.createElement(V,{dimColor:!0},b3(Mz(H.name)?.scope??"dynamic"))),H.client.type==="connected"&&s0.default.createElement(Sq$,{serverToolsCount:$,serverPromptsCount:Q,serverResourcesCount:E.resources[H.name]?.length||0}),H.client.type==="connected"&&$>0&&s0.default.createElement(x,null,s0.default.createElement(V,{bold:!0},"Tools: "),s0.default.createElement(V,{dimColor:!0},$," tools"))),W.length>0&&s0.default.createElement(x,{marginTop:1},s0.default.createElement(QA,{options:W,onChange:async(P)=>{if(P==="tools")A();else if(P==="reconnectMcpServer"){X(!0);try{let C=await M(H.name),{message:Y}=Rq$(C,H.name);I?.(Y)}catch(C){I?.(HmH(C,H.name))}finally{X(!1)}}else if(P==="toggle-enabled")await J();else if(P==="back")L()},onCancel:L}))),s0.default.createElement(x,{marginTop:1},s0.default.createElement(V,{dimColor:!0,italic:!0},f.pending?s0.default.createElement(s0.default.Fragment,null,"Press ",f.keyName," again to exit"):s0.default.createElement(rA,null,s0.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),s0.default.createElement(s$,{shortcut:"Enter",action:"select"}),s0.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}var s0;var yq$=K(()=>{xH();l8();UM();eB();lB();j0();jI();pL();kF();T3();CRA();Ys();JM();s0=b(s(),1)});function z1H({server:H,serverToolsCount:$,onViewTools:A,onCancel:L,onComplete:I,borderless:D=!1}){let[B]=_I(),f=zB(),[E,M]=LL.default.useState(!1),[G,U]=LL.default.useState(null),X=J$((LH)=>LH.mcp),J=zI(),[F,Q]=LL.default.useState(null),[W,P]=LL.useState(!1),[C,Y]=LL.useState(null),[Z,q]=LL.useState(!1),[O,j]=LL.useState(null),[u,y]=LL.useState(!1),[g,h]=LL.useState(null),[p,d]=LL.useState(!1),[k,n]=LL.useState(!1),GH=H.isAuthenticated||H.client.type==="connected"&&$>0,HH=RVH(),BH=LL.default.useCallback(async()=>{q(!1),j(null),P(!0);try{let LH=await HH(H.name),e=LH.client.type==="connected";if(c("tengu_claudeai_mcp_auth_completed",{success:e}),e)I?.(`Authentication successful. Connected to ${H.name}.`);else if(LH.client.type==="needs-auth")I?.("Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.");else I?.("Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.")}catch(LH){c("tengu_claudeai_mcp_auth_completed",{success:!1}),I?.(HmH(LH,H.name))}finally{P(!1)}},[HH,H.name,I]),WH=LL.default.useCallback(async()=>{await lh(H.name,{...H.config,scope:H.scope}),J((LH)=>{let e=LH.mcp.clients.map((FH)=>FH.name===H.name?{...FH,type:"needs-auth"}:FH),DH=aNA(LH.mcp.tools,H.name),EH=oNA(LH.mcp.commands,H.name),$H=tNA(LH.mcp.resources,H.name);return{...LH,mcp:{clients:e,tools:DH,commands:EH,resources:$H}}}),c("tengu_claudeai_mcp_clear_auth_completed",{}),I?.(`Disconnected from ${H.name}.`),y(!1),h(null),d(!1)},[H.name,H.config,H.scope,J,I]);BA("confirm:no",()=>{if(C)C.abort();M(!1),Q(null),Y(null)},{context:"Confirmation",isActive:E}),BA("confirm:no",()=>{q(!1),j(null)},{context:"Confirmation",isActive:Z}),BA("confirm:no",()=>{y(!1),h(null),d(!1)},{context:"Confirmation",isActive:u}),WL((LH,e)=>{if(e.return&&Z)BH();if(e.return&&u)if(p)WH();else{let DH=XD(),$H=`${new URL(DH.CLAUDE_AI_AUTHORIZE_URL).origin}/settings/connectors`;h($H),d(!0),HE($H)}if(LH==="c"&&!k){let DH=F||O||g;if(DH)K3(DH).then((EH)=>{if(EH)n(!0),setTimeout(()=>n(!1),2000)})}});let wH=String(H.name).charAt(0).toUpperCase()+String(H.name).slice(1),QH=Z2$(X.commands,H.name).length,TH=_s(),t=LL.default.useCallback(async()=>{let LH=XD(),e=new URL(LH.CLAUDE_AI_AUTHORIZE_URL).origin,EH=T9()?.organizationUuid,$H;if(EH&&H.config.type==="claudeai-proxy"&&H.config.id){let FH=H.config.id.startsWith("mcprs")?"mcpsrv"+H.config.id.slice(5):H.config.id;$H=`${e}/api/organizations/${EH}/mcp/start-auth/${FH}`}else $H=`${e}/settings/connectors`;j($H),q(!0),c("tengu_claudeai_mcp_auth_started",{}),await HE($H)},[H.config]),IH=LL.default.useCallback(()=>{y(!0),c("tengu_claudeai_mcp_clear_auth_started",{})},[]),KH=LL.default.useCallback(async()=>{let LH=H.client.type!=="disabled";try{if(await TH(H.name),H.config.type==="claudeai-proxy")c("tengu_claudeai_mcp_toggle",{new_state:LH?"disabled":"enabled"});L()}catch(e){I?.(`Failed to ${LH?"disable":"enable"} MCP server '${H.name}': ${e instanceof Error?e.message:String(e)}`)}},[H.client.type,H.config.type,H.name,TH,L,I]),MH=LL.default.useCallback(async()=>{if(H.config.type==="claudeai-proxy")return;M(!0),U(null);let LH=new AbortController;Y(LH);try{if(H.isAuthenticated&&H.config)await JOA(H.name,H.config);if(H.config){await m2$(H.name,H.config,Q,LH.signal),c("tengu_mcp_auth_config_authenticate",{wasAuthenticated:H.isAuthenticated});let e=await HH(H.name);if(e.client.type==="connected"){let DH=GH?`Authentication successful. Reconnected to ${H.name}.`:`Authentication successful. Connected to ${H.name}.`;I?.(DH)}else if(e.client.type==="needs-auth")I?.("Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.");else TA(H.name,"Reconnection failed after authentication"),I?.("Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.")}}catch(e){if(e instanceof Error&&!(e instanceof Y3H))U(e.message)}finally{M(!1),Y(null)}},[H.isAuthenticated,H.config,H.name,I,HH,GH]),CH=async()=>{if(H.config.type==="claudeai-proxy")return;if(H.config)await JOA(H.name,H.config),c("tengu_mcp_auth_config_clear",{}),await lh(H.name,{...H.config,scope:H.scope}),J((LH)=>{let e=LH.mcp.clients.map((FH)=>FH.name===H.name?{...FH,type:"failed"}:FH),DH=aNA(LH.mcp.tools,H.name),EH=oNA(LH.mcp.commands,H.name),$H=tNA(LH.mcp.resources,H.name);return{...LH,mcp:{clients:e,tools:DH,commands:EH,resources:$H}}}),I?.(`Authentication cleared for ${H.name}.`)};if(E)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"claude"},"Authenticating with ",H.name,"\u2026"),LL.default.createElement(x,null,LL.default.createElement(vD,null),LL.default.createElement(V,null," A browser window will open for authentication")),F&&LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,null,LL.default.createElement(V,{dimColor:!0},"If your browser doesn't open automatically, copy this URL manually"," "),k?LL.default.createElement(V,{color:"success"},"(Copied!)"):LL.default.createElement(V,{dimColor:!0},LL.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),LL.default.createElement(dI,{url:F})),LL.default.createElement(x,{marginLeft:3},LL.default.createElement(V,{dimColor:!0},"Return here after authenticating in your browser. Press Esc to go back.")));if(Z)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"claude"},"Authenticating with ",H.name,"\u2026"),LL.default.createElement(x,null,LL.default.createElement(vD,null),LL.default.createElement(V,null," A browser window will open for authentication")),O&&LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,null,LL.default.createElement(V,{dimColor:!0},"If your browser doesn't open automatically, copy this URL manually"," "),k?LL.default.createElement(V,{color:"success"},"(Copied!)"):LL.default.createElement(V,{dimColor:!0},LL.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),LL.default.createElement(dI,{url:O})),LL.default.createElement(x,{marginLeft:3,flexDirection:"column"},LL.default.createElement(V,{color:"permission"},"Press ",LL.default.createElement(V,{bold:!0},"Enter")," after authenticating in your browser."),LL.default.createElement(V,{dimColor:!0,italic:!0},LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))));if(u)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"claude"},"Clear authentication for ",H.name),p?LL.default.createElement(LL.default.Fragment,null,LL.default.createElement(V,null,'Find the MCP server in the browser and click "Disconnect".'),g&&LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,null,LL.default.createElement(V,{dimColor:!0},"If your browser didn't open automatically, copy this URL manually"," "),k?LL.default.createElement(V,{color:"success"},"(Copied!)"):LL.default.createElement(V,{dimColor:!0},LL.default.createElement(s$,{shortcut:"c",action:"copy",parens:!0}))),LL.default.createElement(dI,{url:g})),LL.default.createElement(x,{marginLeft:3,flexDirection:"column"},LL.default.createElement(V,{color:"permission"},"Press ",LL.default.createElement(V,{bold:!0},"Enter")," when done."),LL.default.createElement(V,{dimColor:!0,italic:!0},LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))):LL.default.createElement(LL.default.Fragment,null,LL.default.createElement(V,null,'This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".'),LL.default.createElement(x,{marginLeft:3,flexDirection:"column"},LL.default.createElement(V,{color:"permission"},"Press ",LL.default.createElement(V,{bold:!0},"Enter")," to open the browser."),LL.default.createElement(V,{dimColor:!0,italic:!0},LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))));if(W)return LL.default.createElement(x,{flexDirection:"column",gap:1,padding:1},LL.default.createElement(V,{color:"text"},"Connecting to ",LL.default.createElement(V,{bold:!0},H.name),"\u2026"),LL.default.createElement(x,null,LL.default.createElement(vD,null),LL.default.createElement(V,null," Establishing connection to MCP server")),LL.default.createElement(V,{dimColor:!0},"This may take a few moments."));let OH=[];if(H.client.type==="disabled")OH.push({label:"Enable",value:"toggle-enabled"});if(H.client.type==="connected"&&$>0)OH.push({label:"View tools",value:"tools"});if(H.config.type==="claudeai-proxy"){if(H.client.type==="connected")OH.push({label:"Clear authentication",value:"claudeai-clear-auth"});else if(H.client.type!=="disabled")OH.push({label:"Authenticate",value:"claudeai-auth"})}else{if(GH)OH.push({label:"Re-authenticate",value:"reauth"}),OH.push({label:"Clear authentication",value:"clear-auth"});if(!GH)OH.push({label:"Authenticate",value:"auth"})}if(H.client.type!=="disabled"){if(H.client.type!=="needs-auth")OH.push({label:"Reconnect",value:"reconnectMcpServer"});OH.push({label:"Disable",value:"toggle-enabled"})}if(OH.length===0)OH.push({label:"Back",value:"back"});return LL.default.createElement(x,{flexDirection:"column"},LL.default.createElement(x,{flexDirection:"column",paddingX:1,borderStyle:D?void 0:"round"},LL.default.createElement(x,{marginBottom:1},LL.default.createElement(V,{bold:!0},wH," MCP Server")),LL.default.createElement(x,{flexDirection:"column",gap:0},LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Status: "),H.client.type==="disabled"?LL.default.createElement(V,null,ZL("inactive",B)(pH.radioOff)," disabled"):H.client.type==="connected"?LL.default.createElement(V,null,ZL("success",B)(pH.tick)," connected"):H.client.type==="pending"?LL.default.createElement(LL.default.Fragment,null,LL.default.createElement(V,{dimColor:!0},pH.radioOff),LL.default.createElement(V,null," connecting\u2026")):H.client.type==="needs-auth"?LL.default.createElement(V,null,ZL("warning",B)(pH.triangleUpOutline)," needs authentication"):LL.default.createElement(V,null,ZL("error",B)(pH.cross)," failed")),H.transport!=="claudeai-proxy"&&LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Auth: "),GH?LL.default.createElement(V,null,ZL("success",B)(pH.tick)," authenticated"):LL.default.createElement(V,null,ZL("error",B)(pH.cross)," not authenticated")),LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"URL: "),LL.default.createElement(V,{dimColor:!0},H.config.url)),LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Config location: "),LL.default.createElement(V,{dimColor:!0},b3(H.scope))),H.client.type==="connected"&&LL.default.createElement(Sq$,{serverToolsCount:$,serverPromptsCount:QH,serverResourcesCount:X.resources[H.name]?.length||0}),H.client.type==="connected"&&$>0&&LL.default.createElement(x,null,LL.default.createElement(V,{bold:!0},"Tools: "),LL.default.createElement(V,{dimColor:!0},$," tools"))),G&&LL.default.createElement(x,{marginTop:1},LL.default.createElement(V,{color:"error"},"Error: ",G)),OH.length>0&&LL.default.createElement(x,{marginTop:1},LL.default.createElement(QA,{options:OH,onChange:async(LH)=>{switch(LH){case"tools":A();break;case"auth":case"reauth":await MH();break;case"clear-auth":await CH();break;case"claudeai-auth":await t();break;case"claudeai-clear-auth":IH();break;case"reconnectMcpServer":P(!0);try{let e=await HH(H.name);if(H.config.type==="claudeai-proxy")c("tengu_claudeai_mcp_reconnect",{success:e.client.type==="connected"});let{message:DH}=Rq$(e,H.name);I?.(DH)}catch(e){if(H.config.type==="claudeai-proxy")c("tengu_claudeai_mcp_reconnect",{success:!1});I?.(HmH(e,H.name))}finally{P(!1)}break;case"toggle-enabled":await KH();break;case"back":L();break}},onCancel:L}))),LL.default.createElement(x,{marginTop:1},LL.default.createElement(V,{dimColor:!0,italic:!0},f.pending?LL.default.createElement(LL.default.Fragment,null,"Press ",f.keyName," again to exit"):LL.default.createElement(rA,null,LL.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),LL.default.createElement(s$,{shortcut:"Enter",action:"select"}),LL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}var LL;var vq$=K(()=>{xH();$I();l8();z$();UM();eB();lB();j0();jI();n9H();JM();f3();pL();_$();kF();CRA();xH();pm();Ys();F3();qE();EI();LL=b(s(),1)});function AmH({server:H,onSelectTool:$,onBack:A}){let L=J$((B)=>B.mcp.tools),I=Jb.default.useMemo(()=>{if(H.client.type!=="connected")return[];return dh(L,H.name)},[H,L]),D=I.map((B,f)=>{let E=UiH(B.name,H.name),M=B.userFacingName?B.userFacingName({}):E,G=XiH(M),U=B.isReadOnly?.({})??!1,X=B.isDestructive?.({})??!1,J=B.isOpenWorld?.({})??!1,F=[];if(U)F.push("read-only");if(X)F.push("destructive");if(J)F.push("open-world");return{label:G,value:f.toString(),description:F.length>0?F.join(", "):void 0,descriptionColor:X?"error":U?"success":void 0}});return Jb.default.createElement(BL,{title:`Tools for ${H.name}`,subtitle:`${I.length} tool${I.length===1?"":"s"}`,onCancel:A,inputGuide:(B)=>B.pending?Jb.default.createElement(V,null,"Press ",B.keyName," again to exit"):Jb.default.createElement(rA,null,Jb.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),Jb.default.createElement(s$,{shortcut:"Enter",action:"select"}),Jb.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))},I.length===0?Jb.default.createElement(V,{dimColor:!0},"No tools available"):Jb.default.createElement(QA,{options:D,onChange:(B)=>{let f=parseInt(B),E=I[f];if(E)$(E,f)},onCancel:A}))}var Jb;var hq$=K(()=>{xH();l8();kF();tC();pL();bB();eB();lB();j0();Jb=b(s(),1)});function LmH({tool:H,server:$,onBack:A}){let[L,I]=pM.default.useState(""),D=UiH(H.name,$.name),B=H.userFacingName?H.userFacingName({}):D,f=XiH(B),E=H.isReadOnly?.({})??!1,M=H.isDestructive?.({})??!1,G=H.isOpenWorld?.({})??!1;return pM.default.useEffect(()=>{async function X(){try{let J=await H.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:"default",additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]});I(J)}catch{I("Failed to load description")}}X()},[H]),pM.default.createElement(BL,{title:pM.default.createElement(pM.default.Fragment,null,f,E&&pM.default.createElement(V,{color:"success"}," [read-only]"),M&&pM.default.createElement(V,{color:"error"}," [destructive]"),G&&pM.default.createElement(V,{dimColor:!0}," [open-world]")),subtitle:$.name,onCancel:A,inputGuide:(X)=>X.pending?pM.default.createElement(V,null,"Press ",X.keyName," again to exit"):pM.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})},pM.default.createElement(x,{flexDirection:"column"},pM.default.createElement(x,null,pM.default.createElement(V,{bold:!0},"Tool name: "),pM.default.createElement(V,{dimColor:!0},D)),pM.default.createElement(x,null,pM.default.createElement(V,{bold:!0},"Full name: "),pM.default.createElement(V,{dimColor:!0},H.name)),L&&pM.default.createElement(x,{flexDirection:"column",marginTop:1},pM.default.createElement(V,{bold:!0},"Description:"),pM.default.createElement(V,{wrap:"wrap"},L)),H.inputJSONSchema&&H.inputJSONSchema.properties&&Object.keys(H.inputJSONSchema.properties).length>0&&pM.default.createElement(x,{flexDirection:"column",marginTop:1},pM.default.createElement(V,{bold:!0},"Parameters:"),pM.default.createElement(x,{marginLeft:2,flexDirection:"column"},Object.entries(H.inputJSONSchema.properties).map(([X,J])=>{let Q=H.inputJSONSchema?.required?.includes(X);return pM.default.createElement(V,{key:X},"\u2022 ",X,Q&&pM.default.createElement(V,{dimColor:!0}," (required)"),":"," ",pM.default.createElement(V,{dimColor:!0},typeof J==="object"&&J&&"type"in J?String(J.type):"unknown"),typeof J==="object"&&J&&"description"in J&&pM.default.createElement(V,{dimColor:!0}," - ",String(J.description)))})))))}var pM;var bq$=K(()=>{xH();tC();bB();j0();pM=b(s(),1)});function ZRA({agentServer:H,onCancel:$,onComplete:A}){let[L]=_I(),[I,D]=Cs.useState(!1),[B,f]=Cs.useState(null),[E,M]=Cs.useState(null),[G,U]=Cs.useState(null),X=Cs.useCallback(()=>{if(I){if(G)G.abort();D(!1),M(null),U(null)}},[I,G]);BA("confirm:no",X,{context:"Confirmation",isActive:I});let J=Cs.useCallback(async()=>{if(!H.needsAuth||!H.url)return;D(!0),f(null);let W=new AbortController;U(W);try{let P={type:H.transport,url:H.url};await m2$(H.name,P,M,W.signal),A?.(`Authentication successful for ${H.name}. The server will connect when the agent runs.`)}catch(P){if(P instanceof Error&&!(P instanceof Y3H))f(P.message)}finally{D(!1),U(null)}},[H,A]),F=String(H.name).charAt(0).toUpperCase()+String(H.name).slice(1);if(I)return p9.default.createElement(x,{flexDirection:"column",gap:1,padding:1},p9.default.createElement(V,{color:"claude"},"Authenticating with ",H.name,"\u2026"),p9.default.createElement(x,null,p9.default.createElement(vD,null),p9.default.createElement(V,null," A browser window will open for authentication")),E&&p9.default.createElement(x,{flexDirection:"column"},p9.default.createElement(V,{dimColor:!0},"If your browser doesn't open automatically, copy this URL manually:"),p9.default.createElement(dI,{url:E})),p9.default.createElement(x,{marginLeft:3},p9.default.createElement(V,{dimColor:!0},"Return here after authenticating in your browser."," ",p9.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))));let Q=[];if(H.needsAuth)Q.push({label:H.isAuthenticated?"Re-authenticate":"Authenticate",value:"auth"});return Q.push({label:"Back",value:"back"}),p9.default.createElement(BL,{title:`${F} MCP Server`,subtitle:"agent-only",onCancel:$,inputGuide:(W)=>W.pending?p9.default.createElement(V,null,"Press ",W.keyName," again to exit"):p9.default.createElement(rA,null,p9.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),p9.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),p9.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},p9.default.createElement(x,{flexDirection:"column",gap:0},p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Type: "),p9.default.createElement(V,{dimColor:!0},H.transport)),H.url&&p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"URL: "),p9.default.createElement(V,{dimColor:!0},H.url)),H.command&&p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Command: "),p9.default.createElement(V,{dimColor:!0},H.command)),p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Used by: "),p9.default.createElement(V,{dimColor:!0},H.sourceAgents.join(", "))),p9.default.createElement(x,{marginTop:1},p9.default.createElement(V,{bold:!0},"Status: "),p9.default.createElement(V,null,ZL("inactive",L)(pH.radioOff)," not connected (agent-only)")),H.needsAuth&&p9.default.createElement(x,null,p9.default.createElement(V,{bold:!0},"Auth: "),H.isAuthenticated?p9.default.createElement(V,null,ZL("success",L)(pH.tick)," authenticated"):p9.default.createElement(V,null,ZL("warning",L)(pH.triangleUpOutline)," may need authentication"))),p9.default.createElement(x,null,p9.default.createElement(V,{dimColor:!0},"This server connects only when running the agent.")),B&&p9.default.createElement(x,null,p9.default.createElement(V,{color:"error"},"Error: ",B)),p9.default.createElement(x,null,p9.default.createElement(QA,{options:Q,onChange:async(W)=>{switch(W){case"auth":await J();break;case"back":$();break}},onCancel:$})))}var p9,Cs;var qRA=K(()=>{xH();$I();j0();l8();jI();n9H();JM();bB();lB();eB();p9=b(s(),1),Cs=b(s(),1)});function kq$({onComplete:H}){let $=J$((G)=>G.mcp),A=J$((G)=>G.agentDefinitions),L=$.clients,[I,D]=lP.default.useState({type:"list"}),[B,f]=lP.default.useState([]),E=lP.useMemo(()=>kZD(A.allAgents),[A.allAgents]),M=lP.default.useMemo(()=>L.filter((G)=>G.name!=="ide").sort((G,U)=>G.name.localeCompare(U.name)),[L]);switch(lP.default.useEffect(()=>{async function G(){let U=await Promise.all(M.map(async(X)=>{let J=X.config.scope,F=X.config.type==="sse",Q=X.config.type==="http",W=X.config.type==="claudeai-proxy",P=void 0;if(F||Q){let Z=await new i9H(X.name,X.config).tokens(),q=wY()!==null&&X.type==="connected",O=X.type==="connected"&&dh($.tools,X.name).length>0;P=Boolean(Z)||q||O}let C={name:X.name,client:X,scope:J};if(W)return{...C,transport:"claudeai-proxy",isAuthenticated:!1,config:X.config};else if(F)return{...C,transport:"sse",isAuthenticated:P,config:X.config};else if(Q)return{...C,transport:"http",isAuthenticated:P,config:X.config};else return{...C,transport:"stdio",config:X.config}}));f(U)}G()},[M,$.tools]),lP.useEffect(()=>{if(B.length===0&&M.length>0)return;if(B.length===0&&E.length===0)H("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.")},[B.length,M.length,E.length,H]),I.type){case"list":return lP.default.createElement(_RA,{servers:B,agentServers:E,onSelectServer:(G)=>D({type:"server-menu",server:G}),onSelectAgentServer:(G)=>D({type:"agent-server-menu",agentServer:G}),onComplete:H,defaultTab:I.defaultTab});case"server-menu":{let G=dh($.tools,I.server.name),U=I.server.transport==="claudeai-proxy"?"claude.ai":"Claude Code";if(I.server.transport==="stdio")return lP.default.createElement($mH,{server:I.server,serverToolsCount:G.length,onViewTools:()=>D({type:"server-tools",server:I.server}),onCancel:()=>D({type:"list",defaultTab:U}),onComplete:H});else return lP.default.createElement(z1H,{server:I.server,serverToolsCount:G.length,onViewTools:()=>D({type:"server-tools",server:I.server}),onCancel:()=>D({type:"list",defaultTab:U}),onComplete:H})}case"server-tools":return lP.default.createElement(AmH,{server:I.server,onSelectTool:(G,U)=>D({type:"server-tool-detail",server:I.server,toolIndex:U}),onBack:()=>D({type:"server-menu",server:I.server})});case"server-tool-detail":{let U=dh($.tools,I.server.name)[I.toolIndex];if(!U)return D({type:"server-tools",server:I.server}),null;return lP.default.createElement(LmH,{tool:U,server:I.server,onBack:()=>D({type:"server-tools",server:I.server})})}case"agent-server-menu":return lP.default.createElement(ZRA,{agentServer:I.agentServer,onCancel:()=>D({type:"list",defaultTab:"Agents"}),onComplete:H})}}var lP;var DbD=K(()=>{n9H();Ga();pL();kF();YRA();yq$();vq$();hq$();bq$();qRA();lP=b(s(),1)});function TRA({serverName:H,onComplete:$}){let[A]=_I(),L=J$((M)=>M.mcp.clients),I=RVH(),[D,B]=ImH.useState(!0),[f,E]=ImH.useState(null);if(ImH.useEffect(()=>{async function M(){try{if(!L.find((X)=>X.name===H)){E(`MCP server "${H}" not found`),B(!1);return}switch((await I(H)).client.type){case"connected":$(`Successfully reconnected to ${H}`);break;case"needs-auth":E(`${H} requires authentication`),B(!1),$(`${H} requires authentication. Use /mcp to authenticate.`);break;case"pending":case"failed":case"disabled":E(`Failed to reconnect to ${H}`),B(!1),$(`Failed to reconnect to ${H}`);break;case"proxy":$(`${H} is a proxy server and does not require reconnection`);break}}catch(G){let U=G instanceof Error?G.message:String(G);E(U),B(!1),$(`Error: ${U}`)}}M()},[H,I,L,$]),D)return qz.default.createElement(x,{flexDirection:"column",gap:1,padding:1},qz.default.createElement(V,{color:"text"},"Reconnecting to ",qz.default.createElement(V,{bold:!0},H)),qz.default.createElement(x,null,qz.default.createElement(vD,null),qz.default.createElement(V,null," Establishing connection to MCP server")));if(f)return qz.default.createElement(x,{flexDirection:"column",gap:1,padding:1},qz.default.createElement(x,null,qz.default.createElement(V,null,ZL("error",A)(pH.cross)," "),qz.default.createElement(V,{color:"error"},"Failed to reconnect to ",H)),qz.default.createElement(V,{dimColor:!0},"Error: ",f));return null}var qz,ImH;var zRA=K(()=>{xH();JM();Ys();pL();xH();jI();qz=b(s(),1),ImH=b(s(),1)});var BbD=K(()=>{DbD();YRA();yq$();vq$();qRA();hq$();bq$();zRA()});function uq$(H){let $=H.trim(),A=zH(),L=$.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(L?.[1]){let I=L[1],D=L[3];return D?{source:"git",url:I,ref:D}:{source:"git",url:I}}if($.startsWith("http://")||$.startsWith("https://")){let I=$.match(/^([^#]+)(#(.+))?$/),D=I?.[1]||$,B=I?.[3];if(D.endsWith(".git"))return B?{source:"git",url:D,ref:B}:{source:"git",url:D};let f;try{f=new URL(D)}catch(E){return{source:"url",url:D}}if(f.hostname==="github.com"||f.hostname==="www.github.com"){if(f.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let M=D.endsWith(".git")?D:`${D}.git`;return B?{source:"git",url:M,ref:B}:{source:"git",url:M}}}return{source:"url",url:D}}if($.startsWith("./")||$.startsWith("../")||$.startsWith("/")||$.startsWith("~")){let I=fbD.resolve($.startsWith("~")?$.replace(/^~/,EbD.homedir()):$);if(!A.existsSync(I))return{error:`Path does not exist: ${I}`};let D=A.statSync(I);if(D.isFile())if(I.endsWith(".json"))return{source:"file",path:I};else return{error:`File path must point to a .json file (marketplace.json), but got: ${I}`};else if(D.isDirectory())return{source:"directory",path:I};else return{error:`Path is neither a file nor a directory: ${I}`}}if($.includes("/")&&!$.startsWith("@")){if($.includes(":"))return null;let I=$.match(/^([^#]+)(#(.+))?$/),D=I?.[1]||$,B=I?.[3];return B?{source:"github",repo:D,ref:B}:{source:"github",repo:D}}return null}var fbD,EbD;var NRA=K(()=>{DL();fbD=require("path"),EbD=require("os")});function MbD({inputValue:H,setInputValue:$,cursorOffset:A,setCursorOffset:L,error:I,setError:D,result:B,setResult:f,setViewState:E,onAddComplete:M,cliMode:G=!1}){let U=N1H.useRef(!1),[X,J]=N1H.useState(!1),[F,Q]=N1H.useState(""),W=async()=>{let P=H.trim();if(!P){D("Please enter a marketplace source");return}let C=uq$(P);if(!C){D("Invalid marketplace source format. Try: owner/repo, https://..., or ./path");return}if("error"in C){D(C.error);return}D(null);try{J(!0),Q("");let{name:Y}=await uw(C,(q)=>{Q(q)});SG();let Z=C.source;if(C.source==="github")Z=C.repo;if(c("tengu_marketplace_added",{source_type:Z}),M)await M();if(Q(""),J(!1),G)f(`Successfully added marketplace: ${Y}`);else E({type:"browse-marketplace",targetMarketplace:Y})}catch(Y){let Z=Y instanceof Error?Y:Error(String(Y));if(r(Z),D(Z.message),Q(""),J(!1),G)f(`Error: ${Z.message}`);else f(null)}};return N1H.useEffect(()=>{if(H&&!U.current&&!I&&!B)U.current=!0,W()},[]),q0.createElement(x,{flexDirection:"column"},q0.createElement(x,{flexDirection:"column",paddingX:1,borderStyle:"round"},q0.createElement(x,{marginBottom:1},q0.createElement(V,{bold:!0},"Add Marketplace")),q0.createElement(x,{flexDirection:"column"},q0.createElement(V,null,"Enter marketplace source:"),q0.createElement(V,{dimColor:!0},"Examples:"),q0.createElement(V,{dimColor:!0}," \u2022 owner/repo (GitHub)"),q0.createElement(V,{dimColor:!0}," \u2022 git@github.com:owner/repo.git (SSH)"),q0.createElement(V,{dimColor:!0}," \u2022 https://example.com/marketplace.json"),q0.createElement(V,{dimColor:!0}," \u2022 ./path/to/marketplace"),q0.createElement(x,{marginTop:1},q0.createElement(W9,{value:H,onChange:$,onSubmit:W,columns:80,cursorOffset:A,onChangeCursorOffset:L,focus:!0,showCursor:!0}))),X&&q0.createElement(x,{marginTop:1},q0.createElement(vD,null),q0.createElement(V,null,F||"Adding marketplace to configuration\u2026")),I&&q0.createElement(x,{marginTop:1},q0.createElement(V,{color:"error"},I)),B&&q0.createElement(x,{marginTop:1},q0.createElement(V,null,B))),q0.createElement(x,{marginLeft:3},q0.createElement(V,{dimColor:!0,italic:!0},q0.createElement(rA,null,q0.createElement(s$,{shortcut:"Enter",action:"add"}),q0.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})))))}var q0,N1H;var GbD=K(()=>{xH();S5();eB();lB();j0();y4();Vz();z$();NRA();JM();_$();q0=b(s(),1),N1H=b(s(),1)});function UbD({setViewState:H,error:$,setError:A,setResult:L,exitState:I,onManageComplete:D,targetMarketplace:B,action:f}){let[E,M]=iP.useState([]),[G,U]=iP.useState(!0),[X,J]=iP.useState(0),[F,Q]=iP.useState(!1),[W,P]=iP.useState(null),[C,Y]=iP.useState(null),[Z,q]=iP.useState(null),[O,j]=iP.useState("list"),[u,y]=iP.useState(null),[g,h]=iP.useState(0),p=iP.useRef(!1);iP.useEffect(()=>{async function QH(){try{let TH=await l1(),{enabled:t,disabled:IH}=await xf(),KH=[...t,...IH],{marketplaces:MH,failures:CH}=await fm(TH),OH=[];for(let{name:DH,config:EH,data:$H}of MH){let FH=KH.filter((YH)=>YH.source.endsWith(`@${DH}`));OH.push({name:DH,source:HRH(EH.source),lastUpdated:EH.lastUpdated,pluginCount:$H?.plugins.length,installedPlugins:FH,pendingUpdate:!1,pendingRemove:!1,autoUpdate:EwH(DH,EH)})}OH.sort((DH,EH)=>{if(DH.name==="claude-plugin-directory")return-1;if(EH.name==="claude-plugin-directory")return 1;return DH.name.localeCompare(EH.name)}),M(OH);let LH=MH.filter((DH)=>DH.data!==null).length,e=wKH(CH,LH);if(e)if(e.type==="warning")P(e.message);else throw Error(e.message);if(B&&!p.current&&!$){p.current=!0;let DH=OH.findIndex((EH)=>EH.name===B);if(DH>=0){let EH=OH[DH];if(f){J(DH+1);let $H=[...OH];if(f==="update")$H[DH].pendingUpdate=!0;else if(f==="remove")$H[DH].pendingRemove=!0;M($H),setTimeout(()=>{n($H)},100)}else if(EH)J(DH+1),y(EH),j("details")}else if(A)A(`Marketplace not found: ${B}`)}}catch(TH){if(A)A(TH instanceof Error?TH.message:"Failed to load marketplaces");P(TH instanceof Error?TH.message:"Failed to load marketplaces")}finally{U(!1)}}QH()},[B,f,$]);let d=()=>{return E.some((QH)=>QH.pendingUpdate||QH.pendingRemove)},k=()=>{let QH=E.filter((t)=>t.pendingUpdate).length,TH=E.filter((t)=>t.pendingRemove).length;return{updateCount:QH,removeCount:TH}},n=async(QH)=>{let TH=QH||E,t=O==="details";Q(!0),P(null),Y(null),q(null);try{let IH=ZI("userSettings"),KH=0,MH=0;for(let FH of TH){if(FH.pendingRemove){if(FH.installedPlugins&&FH.installedPlugins.length>0){let YH={...IH?.enabledPlugins};for(let qH of FH.installedPlugins){let bH=Qv(qH.name,FH.name);YH[bH]=!1}II("userSettings",{enabledPlugins:YH})}await F2$(FH.name),MH++,c("tengu_marketplace_removed",{marketplace_name:FH.name,plugins_uninstalled:FH.installedPlugins?.length||0});continue}if(FH.pendingUpdate)await gt(FH.name,(YH)=>{q(YH)}),KH++,c("tengu_marketplace_updated",{marketplace_name:FH.name})}if(SG(),D)await D();let CH=await l1(),{enabled:OH,disabled:LH}=await xf(),e=[...OH,...LH],{marketplaces:DH}=await fm(CH),EH=[];for(let{name:FH,config:YH,data:qH}of DH){let bH=e.filter((hH)=>hH.source.endsWith(`@${FH}`));EH.push({name:FH,source:HRH(YH.source),lastUpdated:YH.lastUpdated,pluginCount:qH?.plugins.length,installedPlugins:bH,pendingUpdate:!1,pendingRemove:!1,autoUpdate:EwH(FH,YH)})}if(EH.sort((FH,YH)=>{if(FH.name==="claude-plugin-directory")return-1;if(YH.name==="claude-plugin-directory")return 1;return FH.name.localeCompare(YH.name)}),M(EH),t&&u){let FH=EH.find((YH)=>YH.name===u.name);if(FH)y(FH)}let $H=[];if(KH>0)$H.push(`Updated ${KH} marketplace${KH>1?"s":""}`);if(MH>0)$H.push(`Removed ${MH} marketplace${MH>1?"s":""}`);if($H.length>0){let FH=`${pH.tick} ${$H.join(", ")}`;if(t)Y(FH);else L(FH),setTimeout(()=>{H({type:"menu"})},2000)}else if(!t)H({type:"menu"})}catch(IH){let KH=IH instanceof Error?IH.message:String(IH);if(P(KH),A)A(KH)}finally{Q(!1),q(null)}},GH=async()=>{if(!u)return;let QH=E.map((TH)=>TH.name===u.name?{...TH,pendingRemove:!0}:TH);M(QH),await n(QH)},HH=(QH)=>{if(!QH)return[];let TH=[{label:`Browse plugins (${QH.pluginCount??0})`,value:"browse"},{label:"Update marketplace",secondaryLabel:QH.lastUpdated?`(last updated ${new Date(QH.lastUpdated).toLocaleDateString()})`:void 0,value:"update"}];if(!DmH())TH.push({label:QH.autoUpdate?"Disable auto-update":"Enable auto-update",value:"toggle-auto-update"});return TH.push({label:"Remove marketplace",value:"remove"}),TH},BH=async(QH)=>{let TH=!QH.autoUpdate;try{await UZD(QH.name,TH),M((t)=>t.map((IH)=>IH.name===QH.name?{...IH,autoUpdate:TH}:IH)),y((t)=>t?{...t,autoUpdate:TH}:t)}catch(t){P(t instanceof Error?t.message:"Failed to update setting")}};if(BA("confirm:no",()=>{j("list"),h(0)},{context:"Confirmation",isActive:!F&&(O==="details"||O==="confirm-remove")}),BA("confirm:no",()=>{M((QH)=>QH.map((TH)=>({...TH,pendingUpdate:!1,pendingRemove:!1}))),J(0)},{context:"Confirmation",isActive:!F&&O==="list"&&d()}),BA("confirm:no",()=>{H({type:"menu"})},{context:"Confirmation",isActive:!F&&O==="list"&&!d()}),bI({"select:previous":()=>J((QH)=>Math.max(0,QH-1)),"select:next":()=>{let QH=E.length+1;J((TH)=>Math.min(QH-1,TH+1))},"select:accept":()=>{let QH=X-1;if(X===0)H({type:"add-marketplace"});else if(d())n();else{let TH=E[QH];if(TH)y(TH),j("details"),h(0)}}},{context:"Select",isActive:!F&&O==="list"}),WL((QH)=>{let TH=X-1;if((QH==="u"||QH==="U")&&TH>=0)M((t)=>t.map((IH,KH)=>KH===TH?{...IH,pendingUpdate:!IH.pendingUpdate,pendingRemove:IH.pendingUpdate?IH.pendingRemove:!1}:IH));else if((QH==="r"||QH==="R")&&TH>=0){let t=E[TH];if(t)y(t),j("confirm-remove")}},{isActive:!F&&O==="list"}),bI({"select:previous":()=>h((QH)=>Math.max(0,QH-1)),"select:next":()=>{let QH=HH(u);h((TH)=>Math.min(QH.length-1,TH+1))},"select:accept":()=>{if(!u)return;let TH=HH(u)[g];if(TH?.value==="browse")H({type:"browse-marketplace",targetMarketplace:u.name});else if(TH?.value==="update"){let t=E.map((IH)=>IH.name===u.name?{...IH,pendingUpdate:!0}:IH);M(t),n(t)}else if(TH?.value==="toggle-auto-update")BH(u);else if(TH?.value==="remove")j("confirm-remove")}},{context:"Select",isActive:!F&&O==="details"}),WL((QH)=>{if(QH==="y"||QH==="Y")GH();else if(QH==="n"||QH==="N")j("list"),y(null)},{isActive:!F&&O==="confirm-remove"}),G)return T$.createElement(V,null,"Loading marketplaces\u2026");if(E.length===0)return T$.createElement(x,{flexDirection:"column"},T$.createElement(x,{marginBottom:1},T$.createElement(V,{bold:!0},"Manage marketplaces")),T$.createElement(x,{flexDirection:"row",gap:1},T$.createElement(V,{color:"suggestion"},pH.pointer," +"),T$.createElement(V,{bold:!0,color:"suggestion"},"Add Marketplace")),T$.createElement(x,{marginLeft:3},T$.createElement(V,{dimColor:!0,italic:!0},I.pending?T$.createElement(T$.Fragment,null,"Press ",I.keyName," again to go back"):T$.createElement(rA,null,T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),T$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})))));if(O==="confirm-remove"&&u){let QH=u.installedPlugins?.length||0;return T$.createElement(x,{flexDirection:"column"},T$.createElement(V,{bold:!0,color:"warning"},"Remove marketplace ",T$.createElement(V,{italic:!0},u.name),"?"),T$.createElement(x,{flexDirection:"column"},QH>0&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"warning"},"This will also uninstall ",QH," plugin",QH!==1?"s":""," from this marketplace:")),u.installedPlugins&&u.installedPlugins.length>0&&T$.createElement(x,{flexDirection:"column",marginTop:1,marginLeft:2},u.installedPlugins.map((TH)=>T$.createElement(V,{key:TH.name,dimColor:!0},"\u2022 ",TH.name))),T$.createElement(x,{marginTop:1},T$.createElement(V,null,"Press ",T$.createElement(V,{bold:!0},"y")," to confirm or ",T$.createElement(V,{bold:!0},"n")," to cancel"))))}if(O==="details"&&u){let QH=u.pendingUpdate||F,TH=HH(u);return T$.createElement(x,{flexDirection:"column"},T$.createElement(V,{bold:!0},u.name),T$.createElement(V,{dimColor:!0},u.source),T$.createElement(x,{marginTop:1},T$.createElement(V,null,u.pluginCount||0," available plugin",u.pluginCount!==1?"s":"")),u.installedPlugins&&u.installedPlugins.length>0&&T$.createElement(x,{flexDirection:"column",marginTop:1},T$.createElement(V,{bold:!0},"Installed plugins (",u.installedPlugins.length,"):"),T$.createElement(x,{flexDirection:"column",marginLeft:1},u.installedPlugins.map((t)=>T$.createElement(x,{key:t.name,flexDirection:"row",gap:1},T$.createElement(V,null,pH.bullet),T$.createElement(x,{flexDirection:"column"},T$.createElement(V,null,t.name),T$.createElement(V,{dimColor:!0},t.manifest.description)))))),QH&&T$.createElement(x,{marginTop:1,flexDirection:"column"},T$.createElement(V,{color:"claude"},"Updating marketplace\u2026"),Z&&T$.createElement(V,{dimColor:!0},Z)),!QH&&C&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"claude"},C)),!QH&&W&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"error"},W)),!QH&&T$.createElement(x,{flexDirection:"column",marginTop:1},TH.map((t,IH)=>{if(!t)return null;let KH=IH===g;return T$.createElement(x,{key:t.value},T$.createElement(V,{color:KH?"suggestion":void 0},KH?pH.pointer:" "," ",t.label),t.secondaryLabel&&T$.createElement(V,{dimColor:!0}," ",t.secondaryLabel))})),!QH&&!DmH()&&u.autoUpdate&&T$.createElement(x,{marginTop:1},T$.createElement(V,{dimColor:!0},"Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins.")),T$.createElement(x,{marginLeft:3},T$.createElement(V,{dimColor:!0,italic:!0},QH?T$.createElement(T$.Fragment,null,"Please wait\u2026"):T$.createElement(rA,null,T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),T$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})))))}let{updateCount:WH,removeCount:wH}=k();return T$.createElement(x,{flexDirection:"column"},T$.createElement(x,{marginBottom:1},T$.createElement(V,{bold:!0},"Manage marketplaces")),T$.createElement(x,{flexDirection:"row",gap:1,marginBottom:1},T$.createElement(V,{color:X===0?"suggestion":void 0},X===0?pH.pointer:" "," +"),T$.createElement(V,{bold:!0,color:X===0?"suggestion":void 0},"Add Marketplace")),T$.createElement(x,{flexDirection:"column"},E.map((QH,TH)=>{let t=TH+1===X,IH=[];if(QH.pendingUpdate)IH.push("UPDATE");if(QH.pendingRemove)IH.push("REMOVE");return T$.createElement(x,{key:QH.name,flexDirection:"row",gap:1,marginBottom:1},T$.createElement(V,{color:t?"suggestion":void 0},t?pH.pointer:" "," ",QH.pendingRemove?pH.cross:pH.bullet),T$.createElement(x,{flexDirection:"column",flexGrow:1},T$.createElement(x,{flexDirection:"row",gap:1},T$.createElement(V,{bold:!0,strikethrough:QH.pendingRemove,dimColor:QH.pendingRemove},QH.name==="claude-plugins-official"&&T$.createElement(V,{color:"claude"},"\u273B "),QH.name,QH.name==="claude-plugins-official"&&T$.createElement(V,{color:"claude"}," \u273B")),IH.length>0&&T$.createElement(V,{color:"warning"},"[",IH.join(", "),"]")),T$.createElement(V,{dimColor:!0},QH.source),T$.createElement(V,{dimColor:!0},QH.pluginCount!==void 0&&T$.createElement(T$.Fragment,null,QH.pluginCount," available"),QH.installedPlugins&&QH.installedPlugins.length>0&&T$.createElement(T$.Fragment,null," \u2022 ",QH.installedPlugins.length," installed"),QH.lastUpdated&&T$.createElement(T$.Fragment,null," ","\u2022 Updated"," ",new Date(QH.lastUpdated).toLocaleDateString()))))})),d()&&T$.createElement(x,{marginTop:1,flexDirection:"column"},T$.createElement(V,null,T$.createElement(V,{bold:!0},"Pending changes:")," ",T$.createElement(V,{dimColor:!0},"Enter to apply")),WH>0&&T$.createElement(V,null,"\u2022 Update ",WH," marketplace",WH>1?"s":""),wH>0&&T$.createElement(V,{color:"warning"},"\u2022 Remove ",wH," marketplace",wH>1?"s":"")),F&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"claude"},"Processing changes\u2026")),W&&T$.createElement(x,{marginTop:1},T$.createElement(V,{color:"error"},W)),T$.createElement(PQ1,{exitState:I,hasPendingActions:d()}))}function PQ1({exitState:H,hasPendingActions:$}){if(H.pending)return T$.createElement(x,{marginTop:1},T$.createElement(V,{dimColor:!0,italic:!0},"Press ",H.keyName," again to go back"));return T$.createElement(x,{marginTop:1},T$.createElement(V,{dimColor:!0,italic:!0},T$.createElement(rA,null,$&&T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"apply changes"}),!$&&T$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),!$&&T$.createElement(s$,{shortcut:"u",action:"update"}),!$&&T$.createElement(s$,{shortcut:"r",action:"remove"}),T$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:$?"cancel":"go back"}))))}var T$,iP;var XbD=K(()=>{xH();xH();$I();jI();eB();lB();j0();y4();Vz();z$();_X();Ja();UQ();vA();mL();T$=b(s(),1),iP=b(s(),1)});function O1H({totalItems:H,maxVisible:$=_Q1,selectedIndex:A=0}){let L=H>$,I=$Z.useRef(0),D=$Z.useMemo(()=>{if(!L)return 0;let C=I.current;if(A=C+$){let q=A-$+1;return I.current=q,q}let Y=Math.max(0,H-$),Z=Math.min(C,Y);return I.current=Z,Z},[A,$,L,H]),B=D,f=Math.min(D+$,H),E=$Z.useCallback((C)=>{if(!L)return C;return C.slice(B,f)},[L,B,f]),M=$Z.useCallback((C)=>{return B+C},[B]),G=$Z.useCallback((C)=>{return C>=B&&C{},[]),X=$Z.useCallback(()=>{},[]),J=$Z.useCallback(()=>{},[]),F=$Z.useCallback((C,Y)=>{let Z=Math.max(0,Math.min(C,H-1));Y(Z)},[H]),Q=$Z.useCallback((C,Y)=>{return!1},[]),W=Math.max(1,Math.ceil(H/$));return{currentPage:Math.floor(D/$),totalPages:W,startIndex:B,endIndex:f,needsPagination:L,pageSize:$,getVisibleItems:E,toActualIndex:M,isOnCurrentPage:G,goToPage:U,nextPage:X,prevPage:J,handleSelectionChange:F,handlePageNavigation:Q,scrollPosition:{current:A+1,total:H,canScrollUp:D>0,canScrollDown:D+${$Z=b(s(),1)});function ws(H){if(H.entry.source&&typeof H.entry.source==="object"&&"source"in H.entry.source&&H.entry.source.source==="github"&&typeof H.entry.source==="object"&&"repo"in H.entry.source)return H.entry.source.repo;return null}function yVH(H,$){let A=[{label:"Install for you (user scope)",action:"install-user"},{label:"Install for all collaborators on this repository (project scope)",action:"install-project"},{label:"Install for you, in this repo only (local scope)",action:"install-local"}];if(H)A.push({label:"Open homepage",action:"homepage"});if($)A.push({label:"View on GitHub",action:"github"});return A.push({label:"Back to plugin list",action:"back"}),A}function JbD({hasSelection:H}){return nP.createElement(x,{marginTop:1},nP.createElement(V,{dimColor:!0,italic:!0},nP.createElement(rA,null,H&&nP.createElement(VA,{action:"plugin:install",context:"Plugin",fallback:"i",description:"install",bold:!0}),nP.createElement(VA,{action:"plugin:toggle",context:"Plugin",fallback:"Space",description:"toggle"}),nP.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"details"}),nP.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))))}var nP;var ORA=K(()=>{xH();eB();j0();nP=b(s(),1)});function WbD(){return KbD.join(Dw(),YQ1)}function wQ1(){let H=zH(),$=WbD();try{if(!H.existsSync($))return N("Install counts cache does not exist"),null;let A=H.readFileSync($,{encoding:"utf-8"}),L=DA(A);if(typeof L!=="object"||L===null||!("version"in L)||!("fetchedAt"in L)||!("counts"in L))return N("Install counts cache has invalid structure"),null;let I=L;if(I.version!==xRA)return N(`Install counts cache version mismatch (got ${I.version}, expected ${xRA})`),null;if(typeof I.fetchedAt!=="string"||!Array.isArray(I.counts))return N("Install counts cache has invalid structure"),null;let D=new Date(I.fetchedAt).getTime();if(Number.isNaN(D))return N("Install counts cache has invalid fetchedAt timestamp"),null;if(!I.counts.every((E)=>typeof E==="object"&&E!==null&&typeof E.plugin==="string"&&typeof E.unique_installs==="number"))return N("Install counts cache has malformed entries"),null;if(Date.now()-D>CQ1)return N("Install counts cache is stale (>24h old)"),null;return{version:I.version,fetchedAt:I.fetchedAt,counts:I.counts}}catch(A){return N(`Failed to load install counts cache: ${A instanceof Error?A.message:String(A)}`),null}}function ZQ1(H){let $=zH(),A=WbD(),L=`${A}.${QbD.randomBytes(8).toString("hex")}.tmp`;try{let I=Dw();$.mkdirSync(I);let D=yH(H,null,2);iL(L,D,{encoding:"utf-8",mode:384,flush:!0}),$.renameSync(L,A),N("Install counts cache saved successfully")}catch(I){r(I instanceof Error?I:Error(String(I)));try{if($.existsSync(L))$.unlinkSync(L)}catch{}}}async function qQ1(){N(`Fetching install counts from ${FbD}`);let H=await nA.get(FbD,{timeout:1e4});if(!H.data?.plugins||!Array.isArray(H.data.plugins))throw Error("Invalid response format from install counts API");return H.data.plugins}async function vVH(){let H=wQ1();if(H){N("Using cached install counts");let $=new Map;for(let A of H.counts)$.set(A.plugin,A.unique_installs);return $}try{let $=await qQ1(),A={version:xRA,fetchedAt:new Date().toISOString(),counts:$};ZQ1(A);let L=new Map;for(let I of $)L.set(I.plugin,I.unique_installs);return L}catch($){return r($ instanceof Error?$:Error(String($))),N(`Failed to fetch install counts: ${$ instanceof Error?$.message:String($)}`),null}}function gq$(H){if(H<1000)return String(H);if(H<1e6){let I=(H/1000).toFixed(1);return I.endsWith(".0")?`${I.slice(0,-2)}K`:`${I}K`}let A=(H/1e6).toFixed(1);return A.endsWith(".0")?`${A.slice(0,-2)}M`:`${A}M`}var KbD,QbD,xRA=1,YQ1="install-counts-cache.json",FbD="https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json",CQ1=86400000;var mq$=K(()=>{w1();ejH();DL();Z$();E$();_$();Z$();KbD=require("path"),QbD=require("crypto")});function VbD({error:H,setError:$,result:A,setResult:L,setViewState:I,onInstallComplete:D,targetMarketplace:B,targetPlugin:f}){let[E,M]=uK.useState("marketplace-list"),[G,U]=uK.useState(null),[X,J]=uK.useState(null),[F,Q]=uK.useState([]),[W,P]=uK.useState([]),[C,Y]=uK.useState(!0),[Z,q]=uK.useState(null),[O,j]=uK.useState(0),[u,y]=uK.useState(new Set),[g,h]=uK.useState(new Set),p=O1H({totalItems:W.length,selectedIndex:O}),[d,k]=uK.useState(0),[n,GH]=uK.useState(!1),[HH,BH]=uK.useState(null),[WH,wH]=uK.useState(null),QH=r$.useCallback(()=>{if(E==="plugin-list")if(B)I({type:"manage-marketplaces",targetMarketplace:B});else if(F.length===1)I({type:"menu"});else M("marketplace-list"),U(null),y(new Set);else if(E==="plugin-details")M("plugin-list"),J(null);else I({type:"menu"})},[E,B,I,F.length]);BA("confirm:no",QH,{context:"Confirmation"}),uK.useEffect(()=>{async function MH(){try{let CH=await l1(),{marketplaces:OH,failures:LH}=await fm(CH),e=[];for(let{name:$H,config:FH,data:YH}of OH)if(YH){let qH=YH.plugins.filter((bH)=>K7(Qv(bH.name,$H))).length;e.push({name:$H,totalPlugins:YH.plugins.length,installedCount:qH,source:HRH(FH.source)})}e.sort(($H,FH)=>{if($H.name==="claude-plugin-directory")return-1;if(FH.name==="claude-plugin-directory")return 1;return 0}),Q(e);let DH=OH.filter(($H)=>$H.data!==null).length,EH=wKH(LH,DH);if(EH)if(EH.type==="warning")wH(EH.message+". Showing available marketplaces.");else throw Error(EH.message);if(e.length===1&&!B&&!f){let $H=e[0];if($H)U($H.name),M("plugin-list")}if(f){let $H=null,FH=null;for(let[YH]of Object.entries(CH)){let qH=await GP(YH);if(qH){let bH=qH.plugins.find((hH)=>hH.name===f);if(bH){let hH=Qv(bH.name,YH);$H={entry:bH,marketplaceName:YH,pluginId:hH,isInstalled:K7(hH)},FH=YH;break}}}if($H&&FH){let YH=$H.pluginId;if(K7(YH))$(`Plugin '${YH}' is already installed. Use '/plugin' to manage existing plugins.`);else U(FH),J($H),M("plugin-details")}else $(`Plugin "${f}" not found in any marketplace`)}else if(B)if(e.some((FH)=>FH.name===B))U(B),M("plugin-list");else $(`Marketplace "${B}" not found`)}catch(CH){$(CH instanceof Error?CH.message:"Failed to load marketplaces")}finally{Y(!1)}}MH()},[$,B,f]),uK.useEffect(()=>{if(!G)return;async function MH(CH){Y(!0);try{let OH=await GP(CH);if(!OH)throw Error(`Failed to load marketplace: ${CH}`);let LH=[];for(let e of OH.plugins){let DH=Qv(e.name,CH);LH.push({entry:e,marketplaceName:CH,pluginId:DH,isInstalled:K7(DH)})}try{let e=await vVH();if(q(e),e)LH.sort((DH,EH)=>{let $H=e.get(DH.pluginId)??0,FH=e.get(EH.pluginId)??0;if($H!==FH)return FH-$H;return DH.entry.name.localeCompare(EH.entry.name)});else LH.sort((DH,EH)=>DH.entry.name.localeCompare(EH.entry.name))}catch(e){N(`Failed to fetch install counts: ${e instanceof Error?e.message:String(e)}`),LH.sort((DH,EH)=>DH.entry.name.localeCompare(EH.entry.name))}P(LH),j(0),y(new Set)}catch(OH){$(OH instanceof Error?OH.message:"Failed to load plugins")}finally{Y(!1)}}MH(G)},[G,$]);let TH=async()=>{if(u.size===0)return;let MH=W.filter((e)=>u.has(e.pluginId));h(new Set(MH.map((e)=>e.pluginId)));let CH=0,OH=0,LH=[];for(let e of MH){let DH=await _uH({pluginId:e.pluginId,entry:e.entry,marketplaceName:e.marketplaceName,scope:"user"});if(DH.success)CH++;else OH++,LH.push({name:e.entry.name,reason:DH.error})}if(h(new Set),y(new Set),SG(),OH===0){let e=`\u2713 Installed ${CH} plugin${CH!==1?"s":""}. Restart Claude Code to load new plugins.`;L(e)}else if(CH===0)$(`Failed to install: ${CKH(LH,!0)}`);else{let e=`\u2713 Installed ${CH} of ${CH+OH} plugins. Failed: ${CKH(LH,!1)}. Restart Claude Code to load successfully installed plugins.`;L(e)}if(CH>0){if(D)await D()}I({type:"menu"})},t=async(MH,CH="user")=>{GH(!0),BH(null);let OH=await _uH({pluginId:MH.pluginId,entry:MH.entry,marketplaceName:MH.marketplaceName,scope:CH});if(OH.success){if(L(OH.message),D)await D();I({type:"menu"})}else GH(!1),BH(OH.error)};uK.useEffect(()=>{if(H)L(H)},[H,L]),bI({"select:previous":()=>{if(O>0)j(O-1)},"select:next":()=>{if(O{let MH=F[O];if(MH)U(MH.name),M("plugin-list")}},{context:"Select",isActive:E==="marketplace-list"}),bI({"select:previous":()=>{if(O>0)p.handleSelectionChange(O-1,j)},"select:next":()=>{if(O{if(O===W.length&&u.size>0)TH();else if(O{if(O{if(u.size>0)TH()}},{context:"Plugin",isActive:E==="plugin-list"});let IH=r$.useMemo(()=>{if(!X)return[];let MH=X.entry.homepage,CH=ws(X);return yVH(MH,CH)},[X]);if(bI({"select:previous":()=>{if(d>0)k(d-1)},"select:next":()=>{if(d{if(!X)return;let MH=IH[d]?.action,CH=X.entry.homepage,OH=ws(X);if(MH==="install-user")t(X,"user");else if(MH==="install-project")t(X,"project");else if(MH==="install-local")t(X,"local");else if(MH==="homepage"&&CH)HE(CH);else if(MH==="github"&&OH)HE(`https://github.com/${OH}`);else if(MH==="back")M("plugin-list"),J(null)}},{context:"Select",isActive:E==="plugin-details"&&!!X}),C)return r$.createElement(V,null,"Loading\u2026");if(H)return r$.createElement(V,{color:"error"},H);if(E==="marketplace-list"){if(F.length===0)return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Select marketplace")),r$.createElement(V,null,"No marketplaces configured."),r$.createElement(V,{dimColor:!0},"Add a marketplace first using ","'Add marketplace'","."),r$.createElement(x,{marginTop:1,paddingLeft:1},r$.createElement(V,{dimColor:!0},r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))));return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Select marketplace")),WH&&r$.createElement(x,{marginBottom:1,flexDirection:"column"},r$.createElement(V,{color:"warning"},pH.warning," ",WH)),F.map((MH,CH)=>r$.createElement(x,{key:MH.name,flexDirection:"column",marginBottom:CH0&&` \xB7 ${MH.installedCount} already installed`,MH.source&&` \xB7 ${MH.source}`)))),r$.createElement(x,{marginTop:1},r$.createElement(V,{dimColor:!0,italic:!0},r$.createElement(rA,null,r$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"})))))}if(E==="plugin-details"&&X){let MH=X.entry.homepage,CH=ws(X),OH=yVH(MH,CH);return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Plugin Details")),r$.createElement(x,{flexDirection:"column",marginBottom:1},r$.createElement(V,{bold:!0},X.entry.name),X.entry.version&&r$.createElement(V,{dimColor:!0},"Version: ",X.entry.version),X.entry.description&&r$.createElement(x,{marginTop:1},r$.createElement(V,null,X.entry.description)),X.entry.author&&r$.createElement(x,{marginTop:1},r$.createElement(V,{dimColor:!0},"By:"," ",typeof X.entry.author==="string"?X.entry.author:X.entry.author.name))),r$.createElement(x,{flexDirection:"column",marginBottom:1},r$.createElement(V,{bold:!0},"Will install:"),X.entry.commands&&r$.createElement(V,{dimColor:!0},"\u2022 Commands:"," ",Array.isArray(X.entry.commands)?X.entry.commands.join(", "):Object.keys(X.entry.commands).join(", ")),X.entry.agents&&r$.createElement(V,{dimColor:!0},"\u2022 Agents:"," ",Array.isArray(X.entry.agents)?X.entry.agents.join(", "):Object.keys(X.entry.agents).join(", ")),X.entry.hooks&&r$.createElement(V,{dimColor:!0},"\u2022 Hooks: ",Object.keys(X.entry.hooks).join(", ")),X.entry.mcpServers&&r$.createElement(V,{dimColor:!0},"\u2022 MCP Servers:"," ",Array.isArray(X.entry.mcpServers)?X.entry.mcpServers.join(", "):typeof X.entry.mcpServers==="object"?Object.keys(X.entry.mcpServers).join(", "):"configured"),!X.entry.commands&&!X.entry.agents&&!X.entry.hooks&&!X.entry.mcpServers&&r$.createElement(r$.Fragment,null,typeof X.entry.source==="object"&&"source"in X.entry.source&&(X.entry.source.source==="github"||X.entry.source.source==="url"||X.entry.source.source==="npm"||X.entry.source.source==="pip")?r$.createElement(V,{dimColor:!0},"\u2022 Component summary not available for remote plugin"):r$.createElement(V,{dimColor:!0},"\u2022 Components will be discovered at installation"))),r$.createElement(x,{marginBottom:1},r$.createElement(V,{color:"claude"},pH.warning," "),r$.createElement(V,{dimColor:!0,italic:!0},"Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.")),HH&&r$.createElement(x,{marginBottom:1},r$.createElement(V,{color:"error"},"Error: ",HH)),r$.createElement(x,{flexDirection:"column"},OH.map((LH,e)=>r$.createElement(x,{key:LH.action},d===e&&r$.createElement(V,null,"> "),d!==e&&r$.createElement(V,null," "),r$.createElement(V,{bold:d===e},n&&LH.action==="install"?"Installing\u2026":LH.label)))),r$.createElement(x,{marginTop:1,paddingLeft:1},r$.createElement(V,{dimColor:!0},r$.createElement(rA,null,r$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}if(W.length===0)return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Install plugins")),r$.createElement(V,{dimColor:!0},"No new plugins available to install."),r$.createElement(V,{dimColor:!0},"All plugins from this marketplace are already installed."),r$.createElement(x,{marginLeft:3},r$.createElement(V,{dimColor:!0,italic:!0},r$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))));let KH=p.getVisibleItems(W);return r$.createElement(x,{flexDirection:"column"},r$.createElement(x,{marginBottom:1},r$.createElement(V,{bold:!0},"Install Plugins")),p.scrollPosition.canScrollUp&&r$.createElement(x,null,r$.createElement(V,{dimColor:!0}," ",pH.arrowUp," more above")),KH.map((MH,CH)=>{let OH=p.toActualIndex(CH),LH=O===OH,e=u.has(MH.pluginId),DH=g.has(MH.pluginId),EH=CH===KH.length-1;return r$.createElement(x,{key:MH.pluginId,flexDirection:"column",marginBottom:EH&&!H?0:1},r$.createElement(x,null,r$.createElement(V,{color:LH?"suggestion":void 0},LH?pH.pointer:" "," "),r$.createElement(V,{color:MH.isInstalled?"success":void 0},MH.isInstalled?pH.tick:DH?pH.ellipsis:e?pH.radioOn:pH.radioOff," ",MH.entry.name,MH.entry.category&&r$.createElement(V,{dimColor:!0}," [",MH.entry.category,"]"),MH.entry.tags?.includes("community-managed")&&r$.createElement(V,{dimColor:!0}," [Community Managed]"),MH.isInstalled&&r$.createElement(V,{dimColor:!0}," (installed)"),Z&&r$.createElement(V,{dimColor:!0}," \xB7 ",gq$(Z.get(MH.pluginId)??0)," ","installs"))),MH.entry.description&&r$.createElement(x,{marginLeft:4},r$.createElement(V,{dimColor:!0},MH.entry.description.length>60?MH.entry.description.substring(0,57)+"...":MH.entry.description),MH.entry.version&&r$.createElement(V,{dimColor:!0}," \xB7 v",MH.entry.version)))}),p.scrollPosition.canScrollDown&&r$.createElement(x,null,r$.createElement(V,{dimColor:!0}," ",pH.arrowDown," more below")),H&&r$.createElement(x,{marginTop:1},r$.createElement(V,{color:"error"},pH.cross," ",H)),r$.createElement(JbD,{hasSelection:u.size>0}))}var r$,uK;var PbD=K(()=>{xH();jI();eB();j0();$I();y4();Ja();Vz();E$();F3();op();Q7();BmH();ORA();mq$();r$=b(s(),1),uK=b(s(),1)});function YbD({error:H,setError:$,result:A,setResult:L,setViewState:I,onInstallComplete:D,onSearchModeChange:B,targetPlugin:f}){let[E,M]=i5.useState("plugin-list"),[G,U]=i5.useState(null),[X,J]=i5.useState([]),[F,Q]=i5.useState(!0),[W,P]=i5.useState(null),[C,Y]=i5.useState(!1),Z=i5.useCallback((EH)=>{Y(EH),B?.(EH)},[B]),{query:q,setQuery:O,cursorOffset:j}=Eb({isActive:E==="plugin-list"&&C&&!F,onExit:()=>{Z(!1)}}),u=EJ(),{columns:y}=QL(),g=i5.useMemo(()=>{if(!q)return X;let EH=q.toLowerCase();return X.filter(($H)=>$H.entry.name.toLowerCase().includes(EH)||$H.entry.description?.toLowerCase().includes(EH)||$H.marketplaceName.toLowerCase().includes(EH))},[X,q]),[h,p]=i5.useState(0),[d,k]=i5.useState(new Set),[n,GH]=i5.useState(new Set),HH=O1H({totalItems:g.length,selectedIndex:h});i5.useEffect(()=>{p(0)},[q]);let[BH,WH]=i5.useState(0),[wH,QH]=i5.useState(!1),[TH,t]=i5.useState(null),[IH,KH]=i5.useState(null),[MH,CH]=i5.useState(null);i5.useEffect(()=>{async function EH(){try{let $H=await l1(),{marketplaces:FH,failures:YH}=await fm($H),qH=[];for(let{name:vH,data:tH}of FH)if(tH)for(let K$ of tH.plugins){let KA=Qv(K$.name,vH);qH.push({entry:K$,marketplaceName:vH,pluginId:KA,isInstalled:K7(KA)})}let bH=qH.filter((vH)=>!vH.isInstalled);try{let vH=await vVH();if(P(vH),vH)bH.sort((tH,K$)=>{let KA=vH.get(tH.pluginId)??0,UA=vH.get(K$.pluginId)??0;if(KA!==UA)return UA-KA;return tH.entry.name.localeCompare(K$.entry.name)});else bH.sort((tH,K$)=>tH.entry.name.localeCompare(K$.entry.name))}catch(vH){N(`Failed to fetch install counts: ${vH instanceof Error?vH.message:String(vH)}`),bH.sort((tH,K$)=>tH.entry.name.localeCompare(K$.entry.name))}J(bH);let hH=Object.keys($H).length;if(bH.length===0){let vH=await wqI({configuredMarketplaceCount:hH,failedMarketplaceCount:YH.length});CH(vH)}let PH=FH.filter((vH)=>vH.data!==null).length,gH=wKH(YH,PH);if(gH)if(gH.type==="warning")KH(gH.message+". Showing available plugins.");else throw Error(gH.message);if(f){let vH=qH.find((tH)=>tH.entry.name===f);if(vH)if(vH.isInstalled)$(`Plugin '${vH.pluginId}' is already installed. Use '/plugin' to manage existing plugins.`);else U(vH),M("plugin-details");else $(`Plugin "${f}" not found in any marketplace`)}}catch($H){$($H instanceof Error?$H.message:"Failed to load plugins")}finally{Q(!1)}}EH()},[$,f]);let OH=async()=>{if(d.size===0)return;let EH=X.filter((qH)=>d.has(qH.pluginId));GH(new Set(EH.map((qH)=>qH.pluginId)));let $H=0,FH=0,YH=[];for(let qH of EH)try{let bH;if(typeof qH.entry.source==="string"&&qH.entry.source.startsWith("./")){let gH=await ZK(qH.pluginId);if(gH)bH=_bD.join(gH.marketplaceInstallLocation,qH.entry.source)}await mw(qH.pluginId,qH.entry,"user",void 0,bH);let PH={...ZI("userSettings")?.enabledPlugins,[qH.pluginId]:!0};II("userSettings",{enabledPlugins:PH}),$H++,c("tengu_plugin_installed",{plugin_id:qH.pluginId,marketplace_name:qH.marketplaceName})}catch(bH){FH++;let hH=bH instanceof Error?bH.message:String(bH);YH.push({name:qH.entry.name,reason:hH}),r(bH instanceof Error?bH:Error(`Failed to install ${qH.entry.name}: ${bH}`))}if(GH(new Set),k(new Set),SG(),FH===0){let qH=`\u2713 Installed ${$H} plugin${$H!==1?"s":""}. Restart Claude Code to load new plugins.`;L(qH)}else if($H===0)$(`Failed to install: ${CKH(YH,!0)}`);else{let qH=`\u2713 Installed ${$H} of ${$H+FH} plugins. Failed: ${CKH(YH,!1)}. Restart Claude Code to load successfully installed plugins.`;L(qH)}if($H>0){if(D)await D()}I({type:"menu"})},LH=async(EH,$H="user")=>{QH(!0),t(null);let FH=await _uH({pluginId:EH.pluginId,entry:EH.entry,marketplaceName:EH.marketplaceName,scope:$H});if(FH.success){if(L(FH.message),D)await D();I({type:"menu"})}else QH(!1),t(FH.error)};i5.useEffect(()=>{if(H)L(H)},[H,L]),BA("confirm:no",()=>{M("plugin-list"),U(null)},{context:"Confirmation",isActive:E==="plugin-details"}),BA("confirm:no",()=>{I({type:"menu"})},{context:"Confirmation",isActive:E==="plugin-list"&&!C}),WL((EH,$H)=>{let FH=!$H.ctrl&&!$H.meta;if(!C){if(EH==="/"&&FH)Z(!0),O("");else if(FH&&EH.length>0&&!/^\s+$/.test(EH)&&EH!=="j"&&EH!=="k"&&EH!=="i")Z(!0),O(EH)}},{isActive:E==="plugin-list"&&!F}),bI({"select:previous":()=>{if(h===0)Z(!0);else HH.handleSelectionChange(h-1,p)},"select:next":()=>{if(h{if(h===g.length&&d.size>0)OH();else if(h{if(h{if(d.size>0)OH()}},{context:"Plugin",isActive:E==="plugin-list"&&!C});let e=l$.useMemo(()=>{if(!G)return[];let EH=G.entry.homepage,$H=ws(G);return yVH(EH,$H)},[G]);if(bI({"select:previous":()=>{if(BH>0)WH(BH-1)},"select:next":()=>{if(BH{if(!G)return;let EH=e[BH]?.action,$H=G.entry.homepage,FH=ws(G);if(EH==="install-user")LH(G,"user");else if(EH==="install-project")LH(G,"project");else if(EH==="install-local")LH(G,"local");else if(EH==="homepage"&&$H)HE($H);else if(EH==="github"&&FH)HE(`https://github.com/${FH}`);else if(EH==="back")M("plugin-list"),U(null)}},{context:"Select",isActive:E==="plugin-details"&&!!G}),F)return l$.createElement(V,null,"Loading\u2026");if(H)return l$.createElement(V,{color:"error"},H);if(E==="plugin-details"&&G){let EH=G.entry.homepage,$H=ws(G),FH=yVH(EH,$H);return l$.createElement(x,{flexDirection:"column"},l$.createElement(x,{marginBottom:1},l$.createElement(V,{bold:!0},"Plugin details")),l$.createElement(x,{flexDirection:"column",marginBottom:1},l$.createElement(V,{bold:!0},G.entry.name),l$.createElement(V,{dimColor:!0},"from ",G.marketplaceName),G.entry.version&&l$.createElement(V,{dimColor:!0},"Version: ",G.entry.version),G.entry.description&&l$.createElement(x,{marginTop:1},l$.createElement(V,null,G.entry.description)),G.entry.author&&l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0},"By:"," ",typeof G.entry.author==="string"?G.entry.author:G.entry.author.name))),l$.createElement(x,{marginBottom:1},l$.createElement(V,{color:"claude"},pH.warning," "),l$.createElement(V,{dimColor:!0,italic:!0},"Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.")),TH&&l$.createElement(x,{marginBottom:1},l$.createElement(V,{color:"error"},"Error: ",TH)),l$.createElement(x,{flexDirection:"column"},FH.map((YH,qH)=>l$.createElement(x,{key:YH.action},BH===qH&&l$.createElement(V,null,"> "),BH!==qH&&l$.createElement(V,null," "),l$.createElement(V,{bold:BH===qH},wH&&YH.action.startsWith("install-")?"Installing\u2026":YH.label)))),l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0},l$.createElement(rA,null,l$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),l$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}if(X.length===0)return l$.createElement(x,{flexDirection:"column"},l$.createElement(x,{marginBottom:1},l$.createElement(V,{bold:!0},"Discover plugins")),l$.createElement(zQ1,{reason:MH}),l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0,italic:!0},"Esc to go back")));let DH=HH.getVisibleItems(g);return l$.createElement(x,{flexDirection:"column"},l$.createElement(x,null,l$.createElement(V,{bold:!0},"Discover plugins"),HH.needsPagination&&l$.createElement(V,{dimColor:!0}," ","(",HH.scrollPosition.current,"/",HH.scrollPosition.total,")")),l$.createElement(x,{marginBottom:1},l$.createElement(fb,{query:q,isFocused:C,isTerminalFocused:u,width:y-4,cursorOffset:j})),IH&&l$.createElement(x,{marginBottom:1},l$.createElement(V,{color:"warning"},pH.warning," ",IH)),g.length===0&&q&&l$.createElement(x,{marginBottom:1},l$.createElement(V,{dimColor:!0},'No plugins match "',q,'"')),HH.scrollPosition.canScrollUp&&l$.createElement(x,null,l$.createElement(V,{dimColor:!0}," ",pH.arrowUp," more above")),DH.map((EH,$H)=>{let FH=HH.toActualIndex($H),YH=h===FH,qH=d.has(EH.pluginId),bH=n.has(EH.pluginId),hH=$H===DH.length-1;return l$.createElement(x,{key:`${HH.startIndex}-${EH.pluginId}`,flexDirection:"column",marginBottom:hH&&!H?0:1},l$.createElement(x,null,l$.createElement(V,{color:YH&&!C?"suggestion":void 0},YH&&!C?pH.pointer:" "," "),l$.createElement(V,null,bH?pH.ellipsis:qH?pH.radioOn:pH.radioOff," ",EH.entry.name,l$.createElement(V,{dimColor:!0}," \xB7 ",EH.marketplaceName),EH.entry.tags?.includes("community-managed")&&l$.createElement(V,{dimColor:!0}," [Community Managed]"),W&&l$.createElement(V,{dimColor:!0}," \xB7 ",gq$(W.get(EH.pluginId)??0)," ","installs"))),EH.entry.description&&l$.createElement(x,{marginLeft:4},l$.createElement(V,{dimColor:!0},EH.entry.description.length>60?EH.entry.description.substring(0,57)+"...":EH.entry.description)))}),HH.scrollPosition.canScrollDown&&l$.createElement(x,null,l$.createElement(V,{dimColor:!0}," ",pH.arrowDown," more below")),H&&l$.createElement(x,{marginTop:1},l$.createElement(V,{color:"error"},pH.cross," ",H)),l$.createElement(TQ1,{hasSelection:d.size>0}))}function TQ1({hasSelection:H}){return l$.createElement(x,{marginTop:1},l$.createElement(V,{dimColor:!0,italic:!0},l$.createElement(rA,null,H&&l$.createElement(VA,{action:"plugin:install",context:"Plugin",fallback:"i",description:"install",bold:!0}),l$.createElement(V,null,"type to search"),l$.createElement(VA,{action:"plugin:toggle",context:"Plugin",fallback:"Space",description:"toggle"}),l$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"details"}),l$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}))))}function zQ1({reason:H}){switch(H){case"git-not-installed":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Git is required to install marketplaces."),l$.createElement(V,{dimColor:!0},"Please install git and restart Claude Code."));case"all-blocked-by-policy":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Your organization policy does not allow any external marketplaces."),l$.createElement(V,{dimColor:!0},"Contact your administrator."));case"policy-restricts-sources":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Your organization restricts which marketplaces can be added."),l$.createElement(V,{dimColor:!0},"Switch to the Marketplaces tab to view allowed sources."));case"all-marketplaces-failed":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"Failed to load marketplace data."),l$.createElement(V,{dimColor:!0},"Check your network connection."));case"all-plugins-installed":return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"All available plugins are already installed."),l$.createElement(V,{dimColor:!0},"Check for new plugins later or add more marketplaces."));case"no-marketplaces-configured":default:return l$.createElement(l$.Fragment,null,l$.createElement(V,{dimColor:!0},"No plugins available."),l$.createElement(V,{dimColor:!0},"Add a marketplace first using the Marketplaces tab."))}}var l$,i5,_bD;var CbD=K(()=>{xH();$I();jI();OB();VVH();PVH();y4();Ja();mL();Vz();z$();_$();E$();F3();op();Q7();BmH();ORA();mq$();eB();j0();l$=b(s(),1),i5=b(s(),1),_bD=require("path")});var wbD={};XA(wbD,{settingSourceToScope:()=>OQ1,isPluginActuallyInstalled:()=>xQ1,isPersistableScope:()=>NQ1,installSelectedPlugins:()=>jRA,getInstalledPlugins:()=>kVH,getEnabledPluginsWithScopes:()=>bVH,findMissingPlugins:()=>SRA,filterSkippedPlugins:()=>SQ1,checkPluginErrors:()=>jQ1,checkEnabledPlugins:()=>hVH});async function hVH(){let H=VL(),$=[];if(H.enabledPlugins){for(let[A,L]of Object.entries(H.enabledPlugins))if(A.includes("@")&&L)$.push(A)}return $}function bVH(){let H=new Map,$=[{scope:"managed",source:"policySettings"},{scope:"user",source:"userSettings"},{scope:"project",source:"projectSettings"},{scope:"local",source:"localSettings"},{scope:"flag",source:"flagSettings"}];for(let{scope:A,source:L}of $){let I=ZI(L);if(!I?.enabledPlugins)continue;for(let[D,B]of Object.entries(I.enabledPlugins)){if(!D.includes("@"))continue;if(B===!0)H.set(D,A);else if(B===!1)H.delete(D)}}return N(`Found ${H.size} enabled plugins with scopes: ${Array.from(H.entries()).map(([A,L])=>`${A}(${L})`).join(", ")}`),H}function NQ1(H){return H!=="flag"}function OQ1(H){return gKA[H]}async function kVH(){rKA().catch((A)=>{r(A instanceof Error?A:Error(String(A)))});let H=lKA(),$=Object.keys(H.plugins);return N(`Found ${$.length} installed plugins (V2 format)`),$}function xQ1(H){let{entry:$,marketplaceInstallLocation:A}=H;try{let L=zH();if(typeof $.source==="string"){if(!A)return!1;let f=L.statSync(A).isDirectory()?A:fmH.join(A,".."),E=fmH.join(f,$.source);return L.existsSync(E)}let I=Mm(),D=$.name.replace(/[^a-zA-Z0-9-_]/g,"-"),B=fmH.join(I,D);return L.existsSync(B)}catch(L){return r(L instanceof Error?L:Error(String(L))),N(`Unexpected error checking if plugin ${H.entry.name} is installed: ${L}`),!1}}async function SRA(H){try{let $=await kVH(),A=[];for(let L of H)if(!$.includes(L))try{if(await ZK(L))A.push(L)}catch(I){N(`Failed to check plugin ${L} in marketplace: ${I}`)}return A}catch($){return r($ instanceof Error?$:Error(String($))),[]}}function SQ1(H){let A=VL().skippedPlugins||[];return H.filter((L)=>!A.includes(L))}async function jRA(H,$,A="user"){let L=A!=="user"?C$():void 0,I=Wv(A),D=ZI(I),B={...D?.enabledPlugins},f=[],E=[];for(let M=0;M{mL();y4();_$();E$();_X();mL();DL();UQ();op();hDH();PI();Q7();fmH=require("path")});function pq$(H){if(!t7.includes(H))throw Error(`Invalid scope "${H}". Must be one of: ${t7.join(", ")}`)}function j1H(H){return t7.includes(H)}function Zs(H){return H==="project"||H==="local"?zL():void 0}function RQ1(H,$,A){let L="";if(Object.keys(A?.enabledPlugins||{}).forEach((I)=>{if(I===H||I===$.name||I.startsWith(`${$.name}@`))L=I}),!L)L=H.includes("@")?H:$.name;return L}function yQ1(H,$){let{name:A,marketplace:L}=Fa(H);return $.find((I)=>{if(I.name===H||I.name===A)return!0;if(L&&I.source)return I.name===A&&I.source.includes(`@${L}`);return!1})}function vQ1(H){let{name:$}=Fa(H),A=F7();if(A.plugins[H]?.length)return{pluginId:H,pluginName:$};let L=Object.keys(A.plugins).find((I)=>{let{name:D}=Fa(I);return D===$&&(A.plugins[I]?.length??0)>0});if(L)return{pluginId:L,pluginName:$};return null}function x1H(H){let A=F7().plugins[H];if(!A||A.length===0)return{scope:"user"};let L=zL(),I=A.find((f)=>f.scope==="local"&&f.projectPath===L);if(I)return{scope:I.scope,projectPath:I.projectPath};let D=A.find((f)=>f.scope==="project"&&f.projectPath===L);if(D)return{scope:D.scope,projectPath:D.projectPath};let B=A.find((f)=>f.scope==="user");if(B)return{scope:B.scope};return{scope:A[0].scope,projectPath:A[0].projectPath}}async function ZbD(H,$="user"){pq$($);let{name:A,marketplace:L}=Fa(H),I,D,B;if(L){let W=await ZK(H);if(W)I=W.entry,D=L,B=W.marketplaceInstallLocation}else{let W=await l1();for(let[P,C]of Object.entries(W))try{let Z=(await GP(P)).plugins.find((q)=>q.name===A);if(Z){I=Z,D=P,B=C.installLocation;break}}catch(Y){r(Y instanceof Error?Y:Error(`Failed to load marketplace "${P}": ${Y}`));continue}}if(!I||!D){let W=L?`marketplace "${L}"`:"any configured marketplace";return{success:!1,message:`Plugin "${A}" not found in ${W}`}}let f=I,E=`${f.name}@${D}`,M=Zs($),G,{source:U}=f;if(NR(U)){if(!B)return{success:!1,message:`Cannot install local plugin "${A}" without marketplace install location`};G=gVH.join(B,U)}await mw(E,f,$,M,G);let X=Wv($),F={...ZI(X)?.enabledPlugins,[E]:!0},{error:Q}=II(X,{enabledPlugins:F});if(Q)return{success:!1,message:`Failed to update settings: ${Q.message}`};return SG(),{success:!0,message:`Successfully installed plugin: ${E} (scope: ${$})`,pluginId:E,pluginName:f.name,scope:$}}async function dq$(H,$="user"){pq$($);let{enabled:A,disabled:L}=await xf(),I=[...A,...L],D=yQ1(H,I),B=Wv($),f=ZI(B),E,M;if(D)E=RQ1(H,D,f),M=D.name;else{let C=vQ1(H);if(!C)return{success:!1,message:`Plugin "${H}" not found in installed plugins`};E=C.pluginId,M=C.pluginName}let G=Zs($),X=F7().plugins[E],J=X?.find((C)=>C.scope===$&&C.projectPath===G);if(!J){let{scope:C}=x1H(E);if(C!==$&&X&&X.length>0)return{success:!1,message:`Plugin "${H}" is installed in ${C} scope, not ${$}. Use --scope ${C} to uninstall.`};return{success:!1,message:`Plugin "${H}" is not installed in ${$} scope. Use --scope to specify the correct scope.`}}let F=J.installPath,Q={...f?.enabledPlugins};Q[E]=void 0,II(B,{enabledPlugins:Q}),SG(),zqI(E,$,G);let P=F7().plugins[E];if((!P||P.length===0)&&F)G3H(F);return{success:!0,message:`Successfully uninstalled plugin: ${M} (scope: ${$})`,pluginId:E,pluginName:M,scope:$}}async function RRA(H,$,A){let L=$?"enable":"disable";if(A)pq$(A);let I=F7(),D=bVH(),B=H.includes("@")?H:null,E=Object.keys(I.plugins).find((X)=>{if(B)return X===B;return X.startsWith(`${H}@`)});if(!E)return{success:!1,message:`Plugin "${H}" is not installed`};let M=D.has(E);if($&&M)return{success:!1,message:`Plugin "${H}" is already enabled`};if(!$&&!M)return{success:!1,message:`Plugin "${H}" is already disabled`};let[G]=E.split("@"),U;if(A){let X=Zs(A);U={scope:A,projectPath:X};let J=x1H(E);if(J.scope!==A)return{success:!1,message:`Plugin "${H}" is installed at ${J.scope} scope, not ${A}. Use --scope ${J.scope} or omit --scope to auto-detect.`}}else U=x1H(E);if(!j1H(U.scope))return{success:!1,message:`Managed plugins cannot be ${L}d. They can only be updated.`};try{let X=Wv(U.scope),F=(ZI(X)||{}).enabledPlugins||{},{error:Q}=II(X,{enabledPlugins:{...F,[E]:$}});if(Q)throw Q;SG()}catch(X){return r(X instanceof Error?X:Error(`Failed to ${L} plugin`)),{success:!1,message:X instanceof Error?X.message:`Failed to ${L} plugin`}}return{success:!0,message:`Successfully ${L}d plugin: ${G} (scope: ${U.scope})`,pluginId:E,pluginName:G,scope:U.scope}}async function R1H(H,$){return RRA(H,!0,$)}async function EmH(H,$){return RRA(H,!1,$)}async function qbD(){let H=bVH();if(H.size===0)return{success:!0,message:"No enabled plugins to disable"};let $=[],A=[];for(let[L]of H){let I=await RRA(L,!1);if(I.success)$.push(L);else A.push(`${L}: ${I.message}`)}if(A.length>0)return{success:!1,message:`Disabled ${$.length} plugin${$.length===1?"":"s"}, ${A.length} failed: `)}`};return{success:!0,message:`Disabled ${$.length} plugin${$.length===1?"":"s"}`}}async function mVH(H,$){let{name:A,marketplace:L}=Fa(H),I=L?`${A}@${L}`:H,D=await ZK(H);if(!D)return{success:!1,message:`Plugin "${A}" not found`,pluginId:I,scope:$};let{entry:B,marketplaceInstallLocation:f}=D,M=Ka().plugins[I];if(!M||M.length===0)return{success:!1,message:`Plugin "${A}" is not installed`,pluginId:I,scope:$};let G=Zs($),U=M.find((X)=>X.scope===$&&X.projectPath===G);if(!U){let X=G?`${$} (${G})`:$;return{success:!1,message:`Plugin "${A}" is not installed at scope ${X}`,pluginId:I,scope:$}}return hQ1({pluginId:I,pluginName:A,entry:B,marketplaceInstallLocation:f,installation:U,scope:$,projectPath:G})}async function hQ1({pluginId:H,pluginName:$,entry:A,marketplaceInstallLocation:L,installation:I,scope:D,projectPath:B}){let f=zH(),E=I.version,M,G,U=!1;if(typeof A.source!=="string"){let X=await l9H(A.source,{manifest:{name:A.name}});M=X.path,U=!0,G=await ap(H,A.source,X.manifest,X.path,A.version)}else{if(!f.existsSync(L))return{success:!1,message:`Marketplace directory not found at ${L}`,pluginId:H,scope:D};let X=f.statSync(L).isDirectory()?L:gVH.dirname(L);if(M=gVH.join(X,A.source),!f.existsSync(M))return{success:!1,message:`Plugin source not found at ${M}`,pluginId:H,scope:D};let J,F=gVH.join(M,".claude-plugin","plugin.json");try{J=V2$(F,A.name,A.source)}catch{}G=await ap(H,A.source,J,M,A.version)}try{let X=Pv(H,G);if(I.version===G||I.installPath===X)return{success:!0,message:`${$} is already at the latest version (${G}).`,pluginId:H,newVersion:G,oldVersion:E,alreadyUpToDate:!0,scope:D};if(!f.existsSync(X))await W2$(M,H,G,A);let F=I.installPath;if(NqI(H,D,B,X,G),F&&F!==X){let P=Ka();if(!Object.values(P.plugins).some((Y)=>Y.some((Z)=>Z.installPath===F))&&f.existsSync(F))G3H(F)}let Q=B?`${D} (${B})`:D;return{success:!0,message:`Plugin "${$}" updated from ${E||"unknown"} to ${G} for scope ${Q}. Restart to apply changes.`,pluginId:H,newVersion:G,oldVersion:E,scope:D}}finally{if(U&&M!==Pv(H,G))f.rmSync(M,{recursive:!0,force:!0})}}var gVH,t7,S1H;var pVH=K(()=>{_X();Q7();op();y4();UQ();mL();Vz();hDH();g$();K2$();DL();_$();uVH();gVH=require("path"),t7=["user","project","local"],S1H=["user","project","local","managed"]});function TbD({pluginName:H,serverName:$,configSchema:A,onSave:L,onCancel:I}){let D=Object.keys(A),[B,f]=y1H.useState(0),[E,M]=y1H.useState({}),[G,U]=y1H.useState(""),X=D[B],J=X?A[X]:null;BA("confirm:no",I,{context:"Settings"});let F=y1H.useCallback(()=>{if(B({...Y,[X]:G})),f((Y)=>Y+1),U("")},[B,D.length,X,G]),Q=y1H.useCallback(()=>{if(!X)return;let Y={...E,[X]:G};if(B===D.length-1){let Z={};for(let q of D){let O=Y[q]||"",j=A[q];if(j?.type==="number"){let u=Number(O);Z[q]=isNaN(u)?O:u}else if(j?.type==="boolean")Z[q]=A$(O);else Z[q]=O}L(Z)}else M(Y),f((Z)=>Z+1),U("")},[X,E,G,B,D,A,L]);if(bI({"confirm:nextField":F,"confirm:yes":Q},{context:"Confirmation"}),WL((Y,Z)=>{if(Z.backspace||Z.delete){U((q)=>q.slice(0,-1));return}if(Y&&!Z.ctrl&&!Z.meta&&!Z.tab&&!Z.return)U((q)=>q+Y)}),!J||!X)return null;let W=J.sensitive===!0,P=J.required===!0,C=W?"*".repeat(G.length):G;return VC.default.createElement(BL,{title:`Configure ${$}`,subtitle:`Plugin: ${H}`,onCancel:I,isCancelActive:!1},VC.default.createElement(x,{flexDirection:"column"},VC.default.createElement(V,{bold:!0},J.title||X,P&&VC.default.createElement(V,{color:"error"}," *")),J.description&&VC.default.createElement(V,{dimColor:!0},J.description),VC.default.createElement(x,{marginTop:1},VC.default.createElement(V,null,pH.pointerSmall," "),VC.default.createElement(V,null,C),VC.default.createElement(V,null,"\u2588"))),VC.default.createElement(x,{flexDirection:"column"},VC.default.createElement(V,{dimColor:!0},"Field ",B+1," of ",D.length),B{xH();$I();bB();jI();NA();VC=b(s(),1),y1H=b(s(),1)});function NbD({item:H,isSelected:$}){let[A]=_I();if(H.type==="plugin"){let D,B;if(H.pendingToggle)D=ZL("suggestion",A)(pH.arrowRight),B=H.pendingToggle==="will-enable"?"will enable":"will disable";else if(H.errorCount>0)D=ZL("error",A)(pH.cross),B=`${H.errorCount} error${H.errorCount!==1?"s":""}`;else if(!H.isEnabled)D=ZL("inactive",A)(pH.radioOff),B="disabled";else D=ZL("success",A)(pH.tick),B="enabled";return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"Plugin")),oD.createElement(V,{dimColor:!0}," \xB7 ",H.marketplace),oD.createElement(V,{dimColor:!$}," \xB7 ",D," "),oD.createElement(V,{dimColor:!$},B))}if(H.type==="failed-plugin"){let D=ZL("error",A)(pH.cross),B=`failed to load \xB7 ${H.errorCount} error${H.errorCount!==1?"s":""}`;return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"Plugin")),oD.createElement(V,{dimColor:!0}," \xB7 ",H.marketplace),oD.createElement(V,{dimColor:!$}," \xB7 ",D," "),oD.createElement(V,{dimColor:!$},B))}let L,I;if(H.status==="connected")L=ZL("success",A)(pH.tick),I="connected";else if(H.status==="disabled")L=ZL("inactive",A)(pH.radioOff),I="disabled";else if(H.status==="pending")L=ZL("inactive",A)(pH.radioOff),I="connecting\u2026";else if(H.status==="needs-auth")L=ZL("warning",A)(pH.triangleUpOutline),I="needs auth";else L=ZL("error",A)(pH.cross),I="failed";if(H.indented)return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{dimColor:!$},"\u2514 "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"MCP")),oD.createElement(V,{dimColor:!$}," \xB7 ",L," "),oD.createElement(V,{dimColor:!$},I));return oD.createElement(x,null,oD.createElement(V,{color:$?"suggestion":void 0},$?`${pH.pointer} `:" "),oD.createElement(V,{color:$?"suggestion":void 0},H.name),oD.createElement(V,{dimColor:!$}," ",oD.createElement(V,{backgroundColor:"userMessageBackground"},"MCP")),oD.createElement(V,{dimColor:!$}," \xB7 ",L," "),oD.createElement(V,{dimColor:!$},I))}var oD;var ObD=K(()=>{xH();jI();oD=b(s(),1)});function jbD(H){switch(H.type){case"path-not-found":return`${H.component} path not found: ${H.path}`;case"git-auth-failed":return`Git ${H.authType.toUpperCase()} authentication failed for ${H.gitUrl}`;case"git-timeout":return`Git ${H.operation} timed out for ${H.gitUrl}`;case"network-error":return`Network error accessing ${H.url}${H.details?`: ${H.details}`:""}`;case"manifest-parse-error":return`Failed to parse manifest at ${H.manifestPath}: ${H.parseError}`;case"manifest-validation-error":return`Invalid manifest at ${H.manifestPath}: ${H.validationErrors.join(", ")}`;case"plugin-not-found":return`Plugin '${H.pluginId}' not found in marketplace '${H.marketplace}'`;case"marketplace-not-found":return`Marketplace '${H.marketplace}' not found`;case"marketplace-load-failed":return`Failed to load marketplace '${H.marketplace}': ${H.reason}`;case"repository-scan-failed":return`Failed to scan repository at ${H.repositoryPath}: ${H.reason}`;case"mcp-config-invalid":return`Invalid MCP server config for '${H.serverName}': ${H.validationError}`;case"hook-load-failed":return`Failed to load hooks from ${H.hookPath}: ${H.reason}`;case"component-load-failed":return`Failed to load ${H.component} from ${H.path}: ${H.reason}`;case"mcpb-download-failed":return`Failed to download MCPB from ${H.url}: ${H.reason}`;case"mcpb-extract-failed":return`Failed to extract MCPB ${H.mcpbPath}: ${H.reason}`;case"mcpb-invalid-manifest":return`MCPB manifest invalid at ${H.mcpbPath}: ${H.validationError}`;case"marketplace-blocked-by-policy":return H.blockedByBlocklist?`Marketplace '${H.marketplace}' is blocked by enterprise policy`:`Marketplace '${H.marketplace}' is not in the allowed marketplace list`;case"generic-error":return H.error;default:return"Unknown error"}}function RbD(H){switch(H.type){case"path-not-found":return"Check that the path in your manifest or marketplace config is correct";case"git-auth-failed":return H.authType==="ssh"?"Configure SSH keys or use HTTPS URL instead":"Configure credentials or use SSH URL instead";case"git-timeout":case"network-error":return"Check your internet connection and try again";case"manifest-parse-error":return"Check manifest file syntax in the plugin directory";case"manifest-validation-error":return"Check manifest file follows the required schema";case"plugin-not-found":return`Plugin may not exist in marketplace '${H.marketplace}'`;case"marketplace-not-found":return H.availableMarketplaces.length>0?`Available marketplaces: ${H.availableMarketplaces.join(", ")}`:"Add the marketplace first using /plugin marketplace add";case"mcp-config-invalid":return"Check MCP server configuration in .mcp.json or manifest";case"hook-load-failed":return"Check hooks.json file syntax and structure";case"component-load-failed":return`Check ${H.component} directory structure and file permissions`;case"mcpb-download-failed":return"Check your internet connection and URL accessibility";case"mcpb-extract-failed":return"Verify the MCPB file is valid and not corrupted";case"mcpb-invalid-manifest":return"Contact the plugin author about the invalid manifest";case"marketplace-blocked-by-policy":if(H.blockedByBlocklist)return"This marketplace source is explicitly blocked by your administrator";return H.allowedSources.length>0?`Allowed sources: ${H.allowedSources.join(", ")}`:"Contact your administrator to configure allowed marketplace sources";case"repository-scan-failed":case"marketplace-load-failed":case"generic-error":return null;default:return null}}var xbD,SbD;var ybD=K(()=>{xH();$I();pL();BmH();j0();xbD=b(s(),1),SbD=b(s(),1)});async function vbD(H){try{return(await h1H.readdir(H,{withFileTypes:!0})).filter((A)=>A.isFile()&&A.name.endsWith(".md")).map((A)=>{return v1H.basename(A.name,".md")})}catch($){let A=$ instanceof Error?$.message:String($);return N(`Failed to read plugin components from ${H}: ${A}`,{level:"error"}),r($ instanceof Error?$:Error(`Failed to read plugin components: ${A}`)),[]}}async function bQ1(H){try{let $=await h1H.readdir(H,{withFileTypes:!0}),A=[];for(let L of $)if(L.isDirectory()||L.isSymbolicLink()){let I=v1H.join(H,L.name,"SKILL.md");try{await h1H.access(I),A.push(L.name)}catch{}}return A}catch($){let A=$ instanceof Error?$.message:String($);return N(`Failed to read skill directories from ${H}: ${A}`,{level:"error"}),r($ instanceof Error?$:Error(`Failed to read skill directories: ${A}`)),[]}}function kQ1({plugin:H,marketplace:$}){let[A,L]=QM.useState(null),[I,D]=QM.useState(!0),[B,f]=QM.useState(null);if(QM.useEffect(()=>{async function M(){try{let U=(await GP($)).plugins.find((X)=>X.name===H.name);if(U){let X=[];if(H.commandsPath)X.push(H.commandsPath);if(H.commandsPaths)X.push(...H.commandsPaths);let J=[];for(let Z of X)if(typeof Z==="string"){let q=await vbD(Z);J.push(...q)}let F=[];if(H.agentsPath)F.push(H.agentsPath);if(H.agentsPaths)F.push(...H.agentsPaths);let Q=[];for(let Z of F)if(typeof Z==="string"){let q=await vbD(Z);Q.push(...q)}let W=[];if(H.skillsPath)W.push(H.skillsPath);if(H.skillsPaths)W.push(...H.skillsPaths);let P=[];for(let Z of W)if(typeof Z==="string"){let q=await bQ1(Z);P.push(...q)}let C=[];if(H.hooksConfig)C.push(Object.keys(H.hooksConfig));if(U.hooks)C.push(U.hooks);let Y=[];if(H.mcpServers)Y.push(Object.keys(H.mcpServers));if(U.mcpServers)Y.push(U.mcpServers);L({commands:J.length>0?J:null,agents:Q.length>0?Q:null,skills:P.length>0?P:null,hooks:C.length>0?C:null,mcpServers:Y.length>0?Y:null})}else f(`Plugin ${H.name} not found in marketplace`)}catch(G){f(G instanceof Error?G.message:"Failed to load components")}finally{D(!1)}}M()},[H.name,H.commandsPath,H.commandsPaths,H.agentsPath,H.agentsPaths,H.skillsPath,H.skillsPaths,H.hooksConfig,H.mcpServers,$]),I)return null;if(B)return a$.createElement(x,{flexDirection:"column",marginBottom:1},a$.createElement(V,{bold:!0},"Components:"),a$.createElement(V,{dimColor:!0},"Error: ",B));if(!A)return null;if(!(A.commands||A.agents||A.skills||A.hooks||A.mcpServers))return null;return a$.createElement(x,{flexDirection:"column",marginBottom:1},a$.createElement(V,{bold:!0},"Installed components:"),A.commands?a$.createElement(V,{dimColor:!0},"\u2022 Commands:"," ",typeof A.commands==="string"?A.commands:Array.isArray(A.commands)?A.commands.join(", "):Object.keys(A.commands).join(", ")):null,A.agents?a$.createElement(V,{dimColor:!0},"\u2022 Agents:"," ",typeof A.agents==="string"?A.agents:Array.isArray(A.agents)?A.agents.join(", "):Object.keys(A.agents).join(", ")):null,A.skills?a$.createElement(V,{dimColor:!0},"\u2022 Skills:"," ",typeof A.skills==="string"?A.skills:Array.isArray(A.skills)?A.skills.join(", "):Object.keys(A.skills).join(", ")):null,A.hooks?a$.createElement(V,{dimColor:!0},"\u2022 Hooks:"," ",typeof A.hooks==="string"?A.hooks:Array.isArray(A.hooks)?A.hooks.map(String).join(", "):typeof A.hooks==="object"&&A.hooks!==null?Object.keys(A.hooks).join(", "):String(A.hooks)):null,A.mcpServers?a$.createElement(V,{dimColor:!0},"\u2022 MCP Servers:"," ",typeof A.mcpServers==="string"?A.mcpServers:Array.isArray(A.mcpServers)?A.mcpServers.map(String).join(", "):typeof A.mcpServers==="object"&&A.mcpServers!==null?Object.keys(A.mcpServers).join(", "):String(A.mcpServers)):null)}async function uQ1(H,$){let L=(await GP($))?.plugins.find((I)=>I.name===H);if(L&&typeof L.source==="string")return`Local plugins cannot be updated remotely. To update, modify the source at: ${L.source}`;return null}function hbD({setViewState:H,setResult:$,onManageComplete:A,onSearchModeChange:L,targetPlugin:I,targetMarketplace:D,action:B}){let f=J$((vH)=>vH.mcp.clients),E=J$((vH)=>vH.mcp.tools),M=J$((vH)=>vH.plugins.errors),[G,U]=QM.useState(!1),X=QM.useCallback((vH)=>{U(vH),L?.(vH)},[L]),J=EJ(),{columns:F}=QL(),[Q,W]=QM.useState("plugin-list"),{query:P,setQuery:C,cursorOffset:Y}=Eb({isActive:Q==="plugin-list"&&G,onExit:()=>{X(!1)}}),[Z,q]=QM.useState(null),[O,j]=QM.useState([]),[u,y]=QM.useState([]),[g,h]=QM.useState(!0),[p,d]=QM.useState(!1),[k,n]=QM.useState(new Map),GH=_s(),HH=a$.useCallback(()=>{if(Q==="plugin-details")W("plugin-list"),q(null),LH(null);else if(Q==="configuring")W("plugin-details"),DH(null);else if(typeof Q==="object"&&Q.type==="mcp-detail")W("plugin-list"),LH(null);else if(typeof Q==="object"&&Q.type==="mcp-tools")W({type:"mcp-detail",client:Q.client});else if(typeof Q==="object"&&Q.type==="mcp-tool-detail")W({type:"mcp-tools",client:Q.client});else H({type:"menu"})},[Q,H]);BA("confirm:no",HH,{context:"Confirmation",isActive:Q!=="plugin-list"||!G});let BH=(vH)=>{if(vH.type==="connected")return"connected";if(vH.type==="disabled")return"disabled";if(vH.type==="pending")return"pending";if(vH.type==="needs-auth")return"needs-auth";if(vH.type==="proxy")return"connected";return"failed"},WH=QM.useMemo(()=>{let vH=VL(),tH=new Map;for(let n$ of f)if(n$.name.startsWith("plugin:")){let fA=n$.name.split(":");if(fA.length>=3){let UH=fA[1],_H=fA.slice(2).join(":"),aH=tH.get(UH)||[];aH.push({displayName:_H,client:n$}),tH.set(UH,aH)}}let K$=[];for(let n$ of u){let fA=`${n$.plugin.name}@${n$.marketplace}`,UH=vH?.enabledPlugins?.[fA]!==!1,_H=M.filter((aH)=>("plugin"in aH)&&aH.plugin===n$.plugin.name||aH.source===fA||aH.source.startsWith(`${n$.plugin.name}@`));K$.push({item:{type:"plugin",id:fA,name:n$.plugin.name,description:n$.plugin.manifest.description,marketplace:n$.marketplace,scope:n$.scope||"user",isEnabled:UH,errorCount:_H.length,errors:_H,plugin:n$.plugin,pendingEnable:n$.pendingEnable,pendingUpdate:n$.pendingUpdate,pendingToggle:k.get(fA)},childMcps:tH.get(n$.plugin.name)||[]})}let KA=new Set(K$.map(({item:n$})=>n$.id)),UA=new Set(K$.map(({item:n$})=>n$.name)),U$=new Map;for(let n$ of M){if(KA.has(n$.source)||"plugin"in n$&&typeof n$.plugin==="string"&&UA.has(n$.plugin))continue;let fA=U$.get(n$.source)||[];fA.push(n$),U$.set(n$.source,fA)}let hA=[];for(let[n$,fA]of U$){let UH=n$.split("@"),_H=UH[0]||n$,aH=UH[1]||"unknown";hA.push({type:"failed-plugin",id:n$,name:_H,marketplace:aH,scope:"user",errorCount:fA.length,errors:fA})}let iA=[];for(let n$ of f){if(n$.name==="ide")continue;if(n$.name.startsWith("plugin:"))continue;iA.push({type:"mcp",id:`mcp:${n$.name}`,name:n$.name,description:void 0,scope:n$.config.scope,status:BH(n$),client:n$})}let rH={project:0,local:1,user:2,enterprise:3,managed:4,dynamic:5},G$=[],b$=new Map;for(let{item:n$,childMcps:fA}of K$){let UH=n$.scope;if(!b$.has(UH))b$.set(UH,[]);b$.get(UH).push(n$);for(let{displayName:_H,client:aH}of fA){let f$=n$.scope;if(!b$.has(f$))b$.set(f$,[]);b$.get(f$).push({type:"mcp",id:`mcp:${aH.name}`,name:_H,description:void 0,scope:f$,status:BH(aH),client:aH,indented:!0})}}for(let n$ of iA){let fA=n$.scope;if(!b$.has(fA))b$.set(fA,[]);b$.get(fA).push(n$)}for(let n$ of hA){let fA=n$.scope;if(!b$.has(fA))b$.set(fA,[]);b$.get(fA).push(n$)}let ZA=[...b$.keys()].sort((n$,fA)=>(rH[n$]??99)-(rH[fA]??99));for(let n$ of ZA){let fA=b$.get(n$),UH=[],_H=[],aH=0;while(aHf$[0].name.localeCompare(I$[0].name)),_H.sort((f$,I$)=>f$.name.localeCompare(I$.name));for(let f$ of UH)G$.push(...f$);G$.push(..._H)}return G$},[u,f,M,k]),wH=QM.useMemo(()=>{if(!P)return WH;let vH=P.toLowerCase();return WH.filter((tH)=>tH.name.toLowerCase().includes(vH)||tH.description?.toLowerCase().includes(vH))},[WH,P]),[QH,TH]=QM.useState(0),t=O1H({totalItems:wH.length,selectedIndex:QH,maxVisible:8}),[IH,KH]=QM.useState(0),[MH,CH]=QM.useState(!1),[OH,LH]=QM.useState(null),[e,DH]=QM.useState(null),[EH,$H]=QM.useState(!1),[FH,YH]=QM.useState(!1);QM.useEffect(()=>{if(!Z){YH(!1);return}async function vH(){let tH=Z.plugin.manifest.mcpServers,K$=!1;if(tH)K$=typeof tH==="string"&&OT(tH)||Array.isArray(tH)&&tH.some((KA)=>typeof KA==="string"&&OT(KA));if(!K$)try{let KA=v1H.join(Z.plugin.path,".."),UA=v1H.join(KA,".claude-plugin","marketplace.json"),U$=await h1H.readFile(UA,"utf-8"),iA=DA(U$).plugins?.find((rH)=>rH.name===Z.plugin.name);if(iA?.mcpServers){let rH=iA.mcpServers;K$=typeof rH==="string"&&OT(rH)||Array.isArray(rH)&&rH.some((G$)=>typeof G$==="string"&&OT(G$))}}catch(KA){N(`Failed to read raw marketplace.json: ${KA}`)}YH(K$)}vH()},[Z]),QM.useEffect(()=>{async function vH(){h(!0);try{let{enabled:tH,disabled:K$}=await xf(),KA=[...tH,...K$],UA=VL(),U$={};for(let rH of KA){let G$=rH.source.split("@")[1]||"local";if(!U$[G$])U$[G$]=[];U$[G$].push(rH)}let hA=[];for(let[rH,G$]of Object.entries(U$)){let b$=G$.filter((n$)=>{let fA=`${n$.name}@${rH}`;return UA?.enabledPlugins?.[fA]!==!1}).length,ZA=G$.length-b$;hA.push({name:rH,installedPlugins:G$,enabledCount:b$,disabledCount:ZA})}hA.sort((rH,G$)=>{if(rH.name==="claude-plugin-directory")return-1;if(G$.name==="claude-plugin-directory")return 1;return rH.name.localeCompare(G$.name)}),j(hA);let iA=[];for(let rH of hA)for(let G$ of rH.installedPlugins){let b$=`${G$.name}@${rH.name}`,{scope:ZA}=x1H(b$);iA.push({plugin:G$,marketplace:rH.name,scope:ZA,pendingEnable:void 0,pendingUpdate:!1})}y(iA),TH(0)}finally{h(!1)}}vH()},[]),QM.useEffect(()=>{if(I&&O.length>0&&!g){let vH=D?O.filter((tH)=>tH.name===D):O;for(let tH of vH){let K$=tH.installedPlugins.find((KA)=>KA.name===I);if(K$){let KA=`${K$.name}@${tH.name}`,{scope:UA}=x1H(KA),U$={plugin:K$,marketplace:tH.name,scope:UA,pendingEnable:void 0,pendingUpdate:!1};q(U$),W("plugin-details");break}}}},[I,D,O,g]);let qH=async(vH)=>{if(!Z)return;let tH=Z.scope||"user";if(!j1H(tH)&&vH!=="update"){LH("Managed plugins can only be updated, not enabled, disabled, or uninstalled.");return}CH(!0),LH(null);try{let K$=`${Z.plugin.name}@${Z.marketplace}`,KA=Zs(tH);switch(vH){case"enable":{if(!j1H(tH))break;if(!K7(K$)){let iA=await ZK(K$);if(iA){let{entry:rH,marketplaceInstallLocation:G$}=iA,b$=NR(rH.source)?v1H.join(G$,rH.source):void 0;await mw(K$,rH,tH,KA,b$)}}let hA=await R1H(K$,tH);if(!hA.success)throw Error(hA.message);break}case"disable":{if(!j1H(tH))break;let hA=await EmH(K$,tH);if(!hA.success)throw Error(hA.message);break}case"uninstall":{if(!j1H(tH))break;let hA=await dq$(K$,tH);if(!hA.success)throw Error(hA.message);break}case"update":{let hA=await mVH(K$,tH);if(!hA.success)throw Error(hA.message);if(hA.alreadyUpToDate){if($(`${Z.plugin.name} is already at the latest version (${hA.newVersion}).`),A)await A();H({type:"menu"});return}break}}SG();let U$=`\u2713 ${vH==="enable"?"Enabled":vH==="disable"?"Disabled":vH==="update"?"Updated":"Uninstalled"} ${Z.plugin.name}. Restart Claude Code to apply changes.`;if($(U$),A)await A();H({type:"menu"})}catch(K$){CH(!1);let KA=K$ instanceof Error?K$.message:String(K$);LH(`Failed to ${vH}: ${KA}`),r(K$ instanceof Error?K$:Error(`Failed to ${vH} plugin: ${String(K$)}`))}},bH=a$.useCallback(()=>{if(QH>=wH.length)return;let vH=wH[QH];if(vH?.type==="plugin"){let tH=`${vH.plugin.name}@${vH.marketplace}`,K$=VL(),KA=k.get(tH),UA=K$?.enabledPlugins?.[tH]!==!1,U$=vH.scope||"user";if(j1H(U$)){let hA=new Map(k);if(KA)hA.delete(tH);else hA.set(tH,UA?"will-disable":"will-enable"),(async()=>{try{if(UA)await EmH(tH,U$);else await R1H(tH,U$);SG(),d(!0)}catch(iA){r(iA instanceof Error?iA:Error(String(iA)))}})();n(hA)}}else if(vH?.type==="mcp")GH(vH.client.name)},[QH,wH,k,u,GH]),hH=a$.useCallback(()=>{if(QH>=wH.length)return;let vH=wH[QH];if(vH?.type==="plugin"){let tH=u.find((K$)=>K$.plugin.name===vH.plugin.name&&K$.marketplace===vH.marketplace);if(tH)q(tH),W("plugin-details"),KH(0),LH(null)}else if(vH?.type==="mcp")W({type:"mcp-detail",client:vH.client}),LH(null)},[QH,wH,u]);bI({"select:previous":()=>{if(QH===0)X(!0);else t.handleSelectionChange(QH-1,TH)},"select:next":()=>{if(QH{if(Q!=="plugin-details"||!Z)return[];let vH=VL(),tH=`${Z.plugin.name}@${Z.marketplace}`,K$=vH?.enabledPlugins?.[tH]!==!1,KA=[];if(KA.push({label:K$?"Disable plugin":"Enable plugin",action:()=>void qH(K$?"disable":"enable")}),KA.push({label:Z.pendingUpdate?"Unmark for update":"Mark for update",action:async()=>{try{let UA=await uQ1(Z.plugin.name,Z.marketplace);if(UA){LH(UA);return}let U$=[...u],hA=U$.findIndex((iA)=>iA.plugin.name===Z.plugin.name&&iA.marketplace===Z.marketplace);if(hA!==-1)U$[hA].pendingUpdate=!Z.pendingUpdate,y(U$),q({...Z,pendingUpdate:!Z.pendingUpdate})}catch(UA){LH(UA instanceof Error?UA.message:"Failed to check plugin update availability")}}}),FH)KA.push({label:"Configure",action:async()=>{$H(!0);try{let UA=Z.plugin.manifest.mcpServers,U$=null;if(typeof UA==="string"&&OT(UA))U$=UA;else if(Array.isArray(UA)){for(let rH of UA)if(typeof rH==="string"&&OT(rH)){U$=rH;break}}if(!U$){LH("No MCPB file found in plugin"),$H(!1);return}let hA=`${Z.plugin.name}@${Z.marketplace}`,iA=await uRH(U$,Z.plugin.path,hA,void 0,void 0,!0);if("status"in iA&&iA.status==="needs-config")DH(iA),W("configuring");else LH("Failed to load MCPB for configuration")}catch(UA){let U$=UA instanceof Error?UA.message:String(UA);LH(`Failed to load configuration: ${U$}`)}finally{$H(!1)}}});if(KA.push({label:"Update now",action:()=>void qH("update")}),KA.push({label:"Uninstall",action:()=>void qH("uninstall")}),Z.plugin.manifest.homepage)KA.push({label:"Open homepage",action:()=>void HE(Z.plugin.manifest.homepage)});if(Z.plugin.manifest.repository)KA.push({label:"View on GitHub",action:()=>void HE(Z.plugin.manifest.repository)});return KA.push({label:"Back to plugin list",action:()=>{W("plugin-list"),q(null),LH(null)}}),KA},[Q,Z,FH,u]);if(bI({"select:previous":()=>{if(IH>0)KH(IH-1)},"select:next":()=>{if(IH{if(PH[IH])PH[IH].action()}},{context:"Select",isActive:Q==="plugin-details"&&!!Z}),a$.useEffect(()=>{TH(0)},[P]),WL((vH,tH)=>{let K$=!tH.ctrl&&!tH.meta;if(G)return;if(vH==="/"&&K$)X(!0),C(""),TH(0);else if(K$&&vH.length>0&&!/^\s+$/.test(vH)&&vH!=="j"&&vH!=="k"&&vH!==" ")X(!0),C(vH),TH(0)},{isActive:Q==="plugin-list"}),g)return a$.createElement(V,null,"Loading installed plugins\u2026");if(WH.length===0)return a$.createElement(x,{flexDirection:"column"},a$.createElement(x,{marginBottom:1},a$.createElement(V,{bold:!0},"Manage plugins")),a$.createElement(V,null,"No plugins or MCP servers installed."),a$.createElement(x,{marginTop:1},a$.createElement(V,{dimColor:!0},"Esc to go back")));if(Q==="configuring"&&e&&Z){let K$=function(){DH(null),W("plugin-details")},vH=`${Z.plugin.name}@${Z.marketplace}`;async function tH(KA){if(!e||!Z)return;try{let UA=Z.plugin.manifest.mcpServers,U$=null;if(typeof UA==="string"&&OT(UA))U$=UA;else if(Array.isArray(UA)){for(let hA of UA)if(typeof hA==="string"&&OT(hA)){U$=hA;break}}if(!U$){LH("No MCPB file found"),W("plugin-details");return}await uRH(U$,Z.plugin.path,vH,void 0,KA),LH(null),DH(null),W("plugin-details"),$("Configuration saved. Restart Claude Code for changes to take effect.")}catch(UA){let U$=UA instanceof Error?UA.message:String(UA);LH(`Failed to save configuration: ${U$}`),W("plugin-details")}}return a$.createElement(TbD,{pluginName:Z.plugin.name,serverName:e.manifest.name,configSchema:e.configSchema,onSave:tH,onCancel:K$})}if(Q==="plugin-details"&&Z){let vH=VL(),tH=`${Z.plugin.name}@${Z.marketplace}`,K$=vH?.enabledPlugins?.[tH]!==!1,KA=M.filter((U$)=>("plugin"in U$)&&U$.plugin===Z.plugin.name||U$.source===tH||U$.source.startsWith(`${Z.plugin.name}@`)),UA=KA.length===0?null:a$.createElement(x,{flexDirection:"column",marginBottom:1},a$.createElement(V,{bold:!0,color:"error"},KA.length," error",KA.length!==1?"s":"",":"),KA.map((U$,hA)=>{let iA=RbD(U$);return a$.createElement(x,{key:hA,flexDirection:"column",marginLeft:2},a$.createElement(V,{color:"error"},jbD(U$)),iA&&a$.createElement(V,{dimColor:!0,italic:!0},pH.arrowRight," ",iA))}));return a$.createElement(x,{flexDirection:"column"},a$.createElement(x,null,a$.createElement(V,{bold:!0},Z.plugin.name," @ ",Z.marketplace)),a$.createElement(x,null,a$.createElement(V,{dimColor:!0},"Scope: "),a$.createElement(V,null,Z.scope||"user")),Z.plugin.manifest.version&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0},"Version: "),a$.createElement(V,null,Z.plugin.manifest.version)),Z.plugin.manifest.description&&a$.createElement(x,{marginBottom:1},a$.createElement(V,null,Z.plugin.manifest.description)),Z.plugin.manifest.author&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0},"Author: "),a$.createElement(V,null,Z.plugin.manifest.author.name)),a$.createElement(x,{marginBottom:1},a$.createElement(V,{dimColor:!0},"Status: "),a$.createElement(V,{color:K$?"success":"warning"},K$?"Enabled":"Disabled"),Z.pendingUpdate&&a$.createElement(V,{color:"suggestion"}," \xB7 Marked for update")),a$.createElement(kQ1,{plugin:Z.plugin,marketplace:Z.marketplace}),UA,a$.createElement(x,{marginTop:1,flexDirection:"column"},PH.map((U$,hA)=>{let iA=hA===IH;return a$.createElement(x,{key:hA},iA&&a$.createElement(V,null,pH.pointer," "),!iA&&a$.createElement(V,null," "),a$.createElement(V,{bold:iA,color:U$.label.includes("Uninstall")?"error":U$.label.includes("Update")?"suggestion":void 0},U$.label))})),MH&&a$.createElement(x,{marginTop:1},a$.createElement(V,null,"Processing\u2026")),OH&&a$.createElement(x,{marginTop:1},a$.createElement(V,{color:"error"},OH)),a$.createElement(x,{marginTop:1},a$.createElement(V,{dimColor:!0,italic:!0},a$.createElement(rA,null,a$.createElement(VA,{action:"select:previous",context:"Select",fallback:"\u2191",description:"navigate"}),a$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"select"}),a$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))))}if(typeof Q==="object"&&Q.type==="mcp-detail"){let vH=Q.client,tH=dh(E,vH.name).length,K$=()=>{W({type:"mcp-tools",client:vH})},KA=()=>{W("plugin-list")},UA=(iA)=>{if(iA)$(iA);W("plugin-list")},U$=vH.config.scope,hA=vH.config.type;if(hA==="stdio"){let iA={name:vH.name,client:vH,scope:U$,transport:"stdio",config:vH.config};return a$.createElement($mH,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}else if(hA==="sse"){let iA={name:vH.name,client:vH,scope:U$,transport:"sse",isAuthenticated:void 0,config:vH.config};return a$.createElement(z1H,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}else if(hA==="http"){let iA={name:vH.name,client:vH,scope:U$,transport:"http",isAuthenticated:void 0,config:vH.config};return a$.createElement(z1H,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}else if(hA==="claudeai-proxy"){let iA={name:vH.name,client:vH,scope:U$,transport:"claudeai-proxy",isAuthenticated:void 0,config:vH.config};return a$.createElement(z1H,{server:iA,serverToolsCount:tH,onViewTools:K$,onCancel:KA,onComplete:UA,borderless:!0})}return W("plugin-list"),null}if(typeof Q==="object"&&Q.type==="mcp-tools"){let vH=Q.client,tH=vH.config.scope,K$=vH.config.type,KA;if(K$==="stdio")KA={name:vH.name,client:vH,scope:tH,transport:"stdio",config:vH.config};else if(K$==="sse")KA={name:vH.name,client:vH,scope:tH,transport:"sse",isAuthenticated:void 0,config:vH.config};else if(K$==="http")KA={name:vH.name,client:vH,scope:tH,transport:"http",isAuthenticated:void 0,config:vH.config};else KA={name:vH.name,client:vH,scope:tH,transport:"claudeai-proxy",isAuthenticated:void 0,config:vH.config};return a$.createElement(AmH,{server:KA,onSelectTool:(UA)=>{W({type:"mcp-tool-detail",client:vH,tool:UA})},onBack:()=>W({type:"mcp-detail",client:vH})})}if(typeof Q==="object"&&Q.type==="mcp-tool-detail"){let{client:vH,tool:tH}=Q,K$=vH.config.scope,KA=vH.config.type,UA;if(KA==="stdio")UA={name:vH.name,client:vH,scope:K$,transport:"stdio",config:vH.config};else if(KA==="sse")UA={name:vH.name,client:vH,scope:K$,transport:"sse",isAuthenticated:void 0,config:vH.config};else if(KA==="http")UA={name:vH.name,client:vH,scope:K$,transport:"http",isAuthenticated:void 0,config:vH.config};else UA={name:vH.name,client:vH,scope:K$,transport:"claudeai-proxy",isAuthenticated:void 0,config:vH.config};return a$.createElement(LmH,{tool:tH,server:UA,onBack:()=>W({type:"mcp-tools",client:vH})})}let gH=t.getVisibleItems(wH);return a$.createElement(x,{flexDirection:"column"},a$.createElement(x,{marginBottom:1},a$.createElement(fb,{query:P,isFocused:G,isTerminalFocused:J,width:F-4,cursorOffset:Y})),wH.length===0&&P&&a$.createElement(x,{marginBottom:1},a$.createElement(V,{dimColor:!0},'No items match "',P,'"')),t.scrollPosition.canScrollUp&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0}," ",pH.arrowUp," more above")),gH.map((vH,tH)=>{let KA=t.toActualIndex(tH)===QH&&!G,UA=tH>0?gH[tH-1]:null,U$=!UA||UA.scope!==vH.scope,hA=(iA)=>{switch(iA){case"project":return"Project";case"local":return"Local";case"user":return"User";case"enterprise":return"Enterprise";case"managed":return"Managed";case"dynamic":return"Built-in";default:return iA}};return a$.createElement(a$.Fragment,{key:vH.id},U$&&a$.createElement(x,{marginTop:tH>0?1:0,paddingLeft:2},a$.createElement(V,{dimColor:!0},hA(vH.scope))),a$.createElement(NbD,{item:vH,isSelected:KA}))}),t.scrollPosition.canScrollDown&&a$.createElement(x,null,a$.createElement(V,{dimColor:!0}," ",pH.arrowDown," more below")),a$.createElement(x,{marginTop:1,marginLeft:1},a$.createElement(V,{dimColor:!0,italic:!0},a$.createElement(rA,null,a$.createElement(V,null,"type to search"),a$.createElement(VA,{action:"plugin:toggle",context:"Plugin",fallback:"Space",description:"toggle"}),a$.createElement(VA,{action:"select:accept",context:"Select",fallback:"Enter",description:"details"}),a$.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"})))),p&&a$.createElement(x,{marginLeft:1},a$.createElement(V,{dimColor:!0,italic:!0},"Restart to apply plugin changes")))}var a$,QM,h1H,v1H;var bbD=K(()=>{xH();VVH();PVH();OB();jI();_X();y4();UQ();mL();Vz();F3();_$();E$();Q7();op();pVH();zbD();oWA();BmH();Z$();pL();ObD();yq$();vq$();hq$();bq$();kF();ybD();Ys();eB();j0();$I();a$=b(s(),1),QM=b(s(),1),h1H=b(require("fs/promises")),v1H=b(require("path"))});async function cq$(){let H=VL(),$=new Map;if(H.extraKnownMarketplaces)for(let[A,L]of Object.entries(H.extraKnownMarketplaces))$.set(A,L);return $}async function lq$(H){try{let $=await l1(),A=[];for(let[L]of H)if(!$[L])A.push(L);return A}catch($){return r($ instanceof Error?$:Error(String($))),[]}}var yRA=K(()=>{mL();y4();_$();Z$()});function vRA(H,$,A,L){H((I)=>({...I,plugins:{...I.plugins,installationStatus:{...I.plugins.installationStatus,marketplaces:I.plugins.installationStatus.marketplaces.map((D)=>D.name===$?{...D,status:A,error:L}:D)}}}))}function hRA(H,$,A,L){H((I)=>({...I,plugins:{...I.plugins,installationStatus:{...I.plugins.installationStatus,plugins:I.plugins.installationStatus.plugins.map((D)=>D.id===$?{...D,status:A,error:L}:D)}}}))}async function gQ1(H,$,A){let L=[],I=[];for(let D of H){let B=$.get(D);if(!B)continue;vRA(A,D,"installing");try{await uw(B.source),L.push(D),vRA(A,D,"installed"),X3H(),Sx(),await mQ1(D,A)}catch(f){let E=f instanceof Error?f.message:String(f);I.push({name:D,error:E}),vRA(A,D,"failed",E),r(f instanceof Error?f:Error(String(f)))}}return{installed:L,failed:I}}async function mQ1(H,$){try{let L=(await hVH()).filter((I)=>I.endsWith(`@${H}`));if(L.length>0){let I=await SRA(L);if(I.length>0)N(`Installing ${I.length} plugins from newly installed marketplace ${H}`),await iq$(I,$)}}catch(A){r(A instanceof Error?A:Error(String(A)))}}async function iq$(H,$){let A=[],L=[],I=bVH(),D=new Map;for(let B of H){hRA($,B,"installing");try{let f=await ZK(B);if(!f)throw Error("Plugin not found in any marketplace");let E=I.get(B),{entry:M,marketplaceInstallLocation:G}=f,U=NR(M.source)?kbD.join(G,M.source):void 0;if(E==="flag"){let X=U??M.source;await l9H(X,{manifest:M})}else{let X=E||"user",J=Zs(X);if(await mw(B,M,X,J,U),X!=="managed"){if(VL().enabledPlugins?.[B]!==!0){let W=D.get(X)??{};W[B]=!0,D.set(X,W)}}}A.push(B),hRA($,B,"installed")}catch(f){let E=f instanceof Error?f.message:String(f);L.push({name:B,error:E}),hRA($,B,"failed",E),r(f instanceof Error?f:Error(String(f)))}}for(let[B,f]of D)if(Object.keys(f).length>0){let E=Wv(B),M=ZI(E);II(E,{...M,enabledPlugins:{...M?.enabledPlugins,...f}})}return{installed:A,failed:L}}async function nq$(H){N("performBackgroundPluginInstallations called");try{let $=[],A=[],L=await l1(),I=await cq$();if(I.size>0){N(`Found ${I.size} extra marketplaces in settings`);let f=await lq$(I);if(f.length>0){N(`Installing ${f.length} marketplaces automatically`);for(let E of f){let M=I.get(E);if(M)$.push({name:E,marketplace:M})}}}let D=await hVH(),B=[];if(D.length>0){N(`Found ${D.length} enabled plugins`);let f=await kVH(),E=D.filter((G)=>!f.includes(G));N(`Found ${E.length} missing plugins (not installed): ${E.join(", ")}`);let M=[];for(let G of E){let[,U]=G.split("@");if(!U)M.push(G);else if(U in L||I.has(U)||$.some((X)=>X.name===U))M.push(G);else B.push(G)}if(B.length>0){let G=[...new Set(B.map((U)=>U.split("@")[1]))];N(`Cannot install ${B.length} plugins because their marketplaces are not installed or configured: ${G.join(", ")}`),N(`Uninstallable plugins: ${B.join(", ")}`)}if(M.length>0)N(`Installing ${M.length} plugins automatically`),A.push(...M)}if(N(`Setting installation status: ${$.length} marketplaces, ${A.length} installable plugins, ${B.length} uninstallable plugins`),H((f)=>({...f,plugins:{...f.plugins,installationStatus:{marketplaces:$.map(({name:E})=>({name:E,status:"pending"})),plugins:[...A.map((E)=>{let[M]=E.split("@");return{id:E,name:M||E,status:"pending"}}),...B.map((E)=>{let[M,G]=E.split("@");return{id:E,name:M||E,status:"failed",error:`Marketplace '${G}' is not installed or configured`}})]}}})),$.length>0)gQ1($.map((f)=>f.name),I,H).catch((f)=>{r(f instanceof Error?f:Error(String(f)))});if(A.length>0){let f=A.filter((E)=>{let[,M]=E.split("@");return!$.some((G)=>G.name===M)});if(f.length>0)iq$(f,H).catch((E)=>{r(E instanceof Error?E:Error(String(E)))})}}catch($){r($ instanceof Error?$:Error(String($)))}}var kbD;var rq$=K(()=>{E$();_$();yRA();uVH();hDH();pVH();y4();y4();_X();op();UQ();mL();kbD=require("path")});function AZ({status:H,withSpace:$=!1}){let A=pQ1[H];return ubD.default.createElement(V,{color:A.color,dimColor:!A.color},A.icon,$&&" ")}var ubD,pQ1;var aq$=K(()=>{jI();xH();ubD=b(s(),1),pQ1={success:{icon:pH.tick,color:"success"},error:{icon:pH.cross,color:"error"},warning:{icon:pH.warning,color:"warning"},info:{icon:pH.info,color:"suggestion"},pending:{icon:pH.circle,color:void 0},loading:{icon:"\u2026",color:void 0}}});function dQ1(H){switch(H.type){case"path-not-found":return`${H.component} path not found: ${H.path}`;case"git-auth-failed":return`Git ${H.authType.toUpperCase()} authentication failed for ${H.gitUrl}`;case"git-timeout":return`Git ${H.operation} timed out for ${H.gitUrl}`;case"network-error":return`Network error accessing ${H.url}${H.details?`: ${H.details}`:""}`;case"manifest-parse-error":return`Failed to parse manifest at ${H.manifestPath}: ${H.parseError}`;case"manifest-validation-error":return`Invalid manifest at ${H.manifestPath}: ${H.validationErrors.join(", ")}`;case"plugin-not-found":return`Plugin '${H.pluginId}' not found in marketplace '${H.marketplace}'`;case"marketplace-not-found":return`Marketplace '${H.marketplace}' not found`;case"marketplace-load-failed":return`Failed to load marketplace '${H.marketplace}': ${H.reason}`;case"repository-scan-failed":return`Failed to scan repository at ${H.repositoryPath}: ${H.reason}`;case"mcp-config-invalid":return`Invalid MCP server config for '${H.serverName}': ${H.validationError}`;case"hook-load-failed":return`Failed to load hooks from ${H.hookPath}: ${H.reason}`;case"component-load-failed":return`Failed to load ${H.component} from ${H.path}: ${H.reason}`;case"mcpb-download-failed":return`Failed to download MCPB from ${H.url}: ${H.reason}`;case"mcpb-extract-failed":return`Failed to extract MCPB ${H.mcpbPath}: ${H.reason}`;case"mcpb-invalid-manifest":return`MCPB manifest invalid at ${H.mcpbPath}: ${H.validationError}`;case"marketplace-blocked-by-policy":return H.blockedByBlocklist?`Marketplace '${H.marketplace}' is blocked by enterprise policy`:`Marketplace '${H.marketplace}' is not in the allowed marketplace list`;case"generic-error":return H.error;default:return"Unknown error"}}function gbD(H){switch(H.type){case"path-not-found":return"\u2192 Check that the path in your manifest or marketplace config is correct";case"git-auth-failed":return H.authType==="ssh"?"\u2192 Configure SSH keys or use HTTPS URL instead":"\u2192 Configure credentials or use SSH URL instead";case"git-timeout":case"network-error":return"\u2192 Check your internet connection and try again";case"manifest-parse-error":return"\u2192 Check manifest file syntax in the plugin directory";case"manifest-validation-error":return"\u2192 Check manifest file follows the required schema";case"plugin-not-found":return`\u2192 Plugin may not exist in marketplace '${H.marketplace}'`;case"marketplace-not-found":return H.availableMarketplaces.length>0?`\u2192 Available marketplaces: ${H.availableMarketplaces.join(", ")}`:"\u2192 Add the marketplace first using /plugin marketplace add";case"mcp-config-invalid":return"\u2192 Check MCP server configuration in .mcp.json or manifest";case"hook-load-failed":return"\u2192 Check hooks.json file syntax and structure";case"component-load-failed":return`\u2192 Check ${H.component} directory structure and file permissions`;case"mcpb-download-failed":return"\u2192 Check your internet connection and URL accessibility";case"mcpb-extract-failed":return"\u2192 Verify the MCPB file is valid and not corrupted";case"mcpb-invalid-manifest":return"\u2192 Contact the plugin author about the invalid manifest";case"marketplace-blocked-by-policy":if(H.blockedByBlocklist)return"\u2192 This marketplace source is explicitly blocked by your administrator";return H.allowedSources.length>0?`\u2192 Allowed sources: ${H.allowedSources.join(", ")}`:"\u2192 Contact your administrator to configure allowed marketplace sources";case"repository-scan-failed":case"marketplace-load-failed":case"generic-error":return null;default:return null}}function pbD({onComplete:H}){let $=J$((G)=>G.plugins.installationStatus),A=J$((G)=>G.plugins.errors),L=zI();zB();let I=mbD.useCallback(()=>{L((G)=>({...G,plugins:{...G.plugins,installationStatus:{marketplaces:G.plugins.installationStatus.marketplaces.map((U)=>U.status==="failed"?{...U,status:"pending"}:U),plugins:G.plugins.installationStatus.plugins.map((U)=>U.status==="failed"?{...U,status:"pending"}:U)}}})),nq$(L)},[L]);BA("confirm:no",H,{context:"Confirmation"}),WL((G)=>{if(G==="r"||G==="R")I()});let D={pending:$.marketplaces.filter((G)=>G.status==="pending").length,installing:$.marketplaces.filter((G)=>G.status==="installing").length,installed:$.marketplaces.filter((G)=>G.status==="installed").length,failed:$.marketplaces.filter((G)=>G.status==="failed").length},B={pending:$.plugins.filter((G)=>G.status==="pending").length,installing:$.plugins.filter((G)=>G.status==="installing").length,installed:$.plugins.filter((G)=>G.status==="installed").length,failed:$.plugins.filter((G)=>G.status==="failed").length},f=D.installing>0||B.installing>0||D.pending>0||B.pending>0,E=A.length>0,M=$.marketplaces.length>0||$.plugins.length>0;return wA.createElement(x,{flexDirection:"column"},wA.createElement(x,{marginBottom:1},wA.createElement(V,{bold:!0},E&&!M?"Plugin Loading Errors":"Plugin Status")),$.marketplaces.length>0&&wA.createElement(wA.Fragment,null,wA.createElement(x,{marginBottom:1},wA.createElement(V,{dimColor:!0},"Marketplaces:")),$.marketplaces.map((G)=>wA.createElement(x,{key:G.name,marginLeft:2},G.status==="installing"&&wA.createElement(wA.Fragment,null,wA.createElement(vD,null),wA.createElement(x,{marginLeft:1},wA.createElement(V,null,G.name),wA.createElement(V,{dimColor:!0}," \xB7 Installing\u2026"))),G.status==="pending"&&wA.createElement(V,null,wA.createElement(AZ,{status:"pending",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Pending")),G.status==="installed"&&wA.createElement(V,null,wA.createElement(AZ,{status:"success",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Installed")),G.status==="failed"&&wA.createElement(x,{flexDirection:"column"},wA.createElement(V,null,wA.createElement(AZ,{status:"error",withSpace:!0}),G.name,wA.createElement(V,{color:"error"}," \xB7 Failed")),G.error&&wA.createElement(x,{marginLeft:3},wA.createElement(V,{color:"error",dimColor:!0},G.error)))))),$.plugins.length>0&&wA.createElement(wA.Fragment,null,wA.createElement(x,{marginTop:1,marginBottom:1},wA.createElement(V,{dimColor:!0},"Plugins:")),$.plugins.map((G)=>wA.createElement(x,{key:G.id,marginLeft:2},G.status==="installing"&&wA.createElement(wA.Fragment,null,wA.createElement(vD,null),wA.createElement(x,{marginLeft:1},wA.createElement(V,null,G.name),wA.createElement(V,{dimColor:!0}," \xB7 Installing\u2026"))),G.status==="pending"&&wA.createElement(V,null,wA.createElement(AZ,{status:"pending",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Pending")),G.status==="installed"&&wA.createElement(V,null,wA.createElement(AZ,{status:"success",withSpace:!0}),G.name,wA.createElement(V,{dimColor:!0}," \xB7 Installed")),G.status==="failed"&&wA.createElement(x,{flexDirection:"column"},wA.createElement(V,null,wA.createElement(AZ,{status:"error",withSpace:!0}),G.name,wA.createElement(V,{color:"error"}," \xB7 Failed")),G.error&&wA.createElement(x,{marginLeft:3},wA.createElement(V,{color:"error",dimColor:!0},G.error)))))),$.marketplaces.length===0&&$.plugins.length===0&&A.length===0&&wA.createElement(x,{marginTop:1},wA.createElement(V,{dimColor:!0},"No pending installations or errors")),A.length>0&&wA.createElement(wA.Fragment,null,wA.createElement(x,{marginTop:1,marginBottom:1},wA.createElement(V,{dimColor:!0},"Plugin Loading Errors:")),A.map((G,U)=>{let X="plugin"in G?G.plugin:void 0;return wA.createElement(x,{key:U,marginLeft:2,flexDirection:"column"},wA.createElement(V,null,wA.createElement(AZ,{status:"error",withSpace:!0}),X?wA.createElement(wA.Fragment,null,"Plugin ",wA.createElement(V,{bold:!0},X)," from"," ",wA.createElement(V,{dimColor:!0},G.source)):wA.createElement(V,{dimColor:!0},G.source)),wA.createElement(x,{marginLeft:3},wA.createElement(V,{color:"error",dimColor:!0},dQ1(G))),gbD(G)&&wA.createElement(x,{marginLeft:3,marginTop:1},wA.createElement(V,{dimColor:!0,italic:!0},gbD(G))))})),wA.createElement(x,{marginTop:2},wA.createElement(V,{dimColor:!0},f?"Installing\u2026":wA.createElement(wA.Fragment,null,"Press"," ",D.failed>0||B.failed>0?wA.createElement(wA.Fragment,null,wA.createElement(V,{bold:!0},"r")," to retry failed installations \xB7"," "):null,wA.createElement(V,{bold:!0},"Esc")," to return"))))}var wA,mbD;var dbD=K(()=>{xH();$I();UM();pL();rq$();JM();aq$();wA=b(s(),1),mbD=b(s(),1)});function cQ1(H){let $=Tz.basename(H),A=Tz.basename(Tz.dirname(H));if($==="plugin.json")return"plugin";if($==="marketplace.json")return"marketplace";if(A===".claude-plugin")return"plugin";return"unknown"}function cbD(H){return H.issues.map(($)=>({path:$.path.join(".")||"root",message:$.message,code:$.code}))}function MmH(H,$,A){if(H.includes(".."))A.push({path:$,message:`Path contains ".." which could be a path traversal attempt: ${H}`})}function bRA(H){let $=[],A=[],L=Tz.resolve(H);if(!rP.existsSync(L))return{success:!1,errors:[{path:"file",message:`File not found: ${L}`}],warnings:[],filePath:L,fileType:"plugin"};if(!rP.statSync(L).isFile())return{success:!1,errors:[{path:"file",message:`Path is not a file: ${L}`}],warnings:[],filePath:L,fileType:"plugin"};let D;try{D=rP.readFileSync(L,{encoding:"utf-8"})}catch(E){return{success:!1,errors:[{path:"file",message:`Failed to read file: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"plugin"}}let B;try{B=DA(D)}catch(E){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"plugin"}}if(B&&typeof B==="object"){let E=B;if(E.commands)(Array.isArray(E.commands)?E.commands:[E.commands]).forEach((G,U)=>{if(typeof G==="string")MmH(G,`commands[${U}]`,$)});if(E.agents)(Array.isArray(E.agents)?E.agents:[E.agents]).forEach((G,U)=>{if(typeof G==="string")MmH(G,`agents[${U}]`,$)});if(E.skills)(Array.isArray(E.skills)?E.skills:[E.skills]).forEach((G,U)=>{if(typeof G==="string")MmH(G,`skills[${U}]`,$)})}let f=S$H.safeParse(B);if(!f.success)$.push(...cbD(f.error));if(f.success){let E=f.data;if(!E.version)A.push({path:"version",message:'No version specified. Consider adding a version following semver (e.g., "1.0.0")'});if(!E.description)A.push({path:"description",message:"No description provided. Adding a description helps users understand what your plugin does"});if(!E.author)A.push({path:"author",message:"No author information provided. Consider adding author details for plugin attribution"})}return{success:$.length===0,errors:$,warnings:A,filePath:L,fileType:"plugin"}}function kRA(H){let $=[],A=[],L=Tz.resolve(H);if(!rP.existsSync(L))return{success:!1,errors:[{path:"file",message:`File not found: ${L}`}],warnings:[],filePath:L,fileType:"marketplace"};if(!rP.statSync(L).isFile())return{success:!1,errors:[{path:"file",message:`Path is not a file: ${L}`}],warnings:[],filePath:L,fileType:"marketplace"};let D;try{D=rP.readFileSync(L,{encoding:"utf-8"})}catch(E){return{success:!1,errors:[{path:"file",message:`Failed to read file: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"marketplace"}}let B;try{B=DA(D)}catch(E){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${E instanceof Error?E.message:String(E)}`}],warnings:[],filePath:L,fileType:"marketplace"}}if(B&&typeof B==="object"){let E=B;if(Array.isArray(E.plugins))E.plugins.forEach((M,G)=>{if(M&&typeof M==="object"&&"source"in M){let U=M.source;if(typeof U==="string")MmH(U,`plugins[${G}].source`,$);if(U&&typeof U==="object"&&"path"in U&&typeof U.path==="string")MmH(U.path,`plugins[${G}].source.path`,$)}})}let f=VGH.safeParse(B);if(!f.success)$.push(...cbD(f.error));if(f.success){let E=f.data;if(!E.plugins||E.plugins.length===0)A.push({path:"plugins",message:"Marketplace has no plugins defined"});if(E.plugins)E.plugins.forEach((M,G)=>{if(typeof M.source==="object"&&M.source.source==="npm")A.push({path:`plugins[${G}].source`,message:`Plugin "${M.name}" uses npm source which is not yet fully implemented`});if(E.plugins.filter((X)=>X.name===M.name).length>1)$.push({path:`plugins[${G}].name`,message:`Duplicate plugin name "${M.name}" found in marketplace`})});if(!E.metadata?.description)A.push({path:"metadata.description",message:"No marketplace description provided. Adding a description helps users understand what this marketplace offers"})}return{success:$.length===0,errors:$,warnings:A,filePath:L,fileType:"marketplace"}}function oq$(H){let $=Tz.resolve(H);if(rP.existsSync($)&&rP.statSync($).isDirectory()){let L=Tz.join($,".claude-plugin","marketplace.json"),I=Tz.join($,".claude-plugin","plugin.json");if(rP.existsSync(L))return kRA(L);else if(rP.existsSync(I))return bRA(I);else return{success:!1,errors:[{path:"directory",message:"No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json"}],warnings:[],filePath:$,fileType:"plugin"}}switch(cQ1(H)){case"plugin":return bRA(H);case"marketplace":return kRA(H);case"unknown":{if(!rP.existsSync($))return{success:!1,errors:[{path:"file",message:`File not found: ${$}`}],warnings:[],filePath:$,fileType:"plugin"};try{let L=rP.readFileSync($,{encoding:"utf-8"}),I=DA(L);if(Array.isArray(I.plugins))return kRA(H)}catch{}return bRA(H)}}}var rP,Tz;var uRA=K(()=>{UQ();Z$();rP=b(require("fs")),Tz=b(require("path"))});function ibD({onComplete:H,path:$}){return lbD.useEffect(()=>{async function A(){if(!$){H(`Usage: /plugin validate /plugin validate .claude-plugin/plugin.json When given a directory, automatically validates .claude-plugin/marketplace.json or .claude-plugin/plugin.json (prefers marketplace if both exist). claude plugin validate `);return}try{let L=oq$($),I="";if(I+=`Validating ${L.fileType} manifest: ${L.filePath} `).filter((M)=>M.length>0);return yJ.createElement(x,{flexDirection:"column",paddingX:2},E.map((M,G)=>yJ.createElement(V,{key:G},M)),yJ.createElement(x,{flexDirection:"row",gap:2,marginBottom:1},yJ.createElement(V,null,yJ.createElement(V,{bold:$==="ios",underline:$==="ios"},"iOS"),yJ.createElement(V,{dimColor:!0}," / "),yJ.createElement(V,{bold:$==="android",underline:$==="android"},"Android")),yJ.createElement(V,{dimColor:!0},"(tab to switch, esc to close)")),yJ.createElement(V,{dimColor:!0},D))}async function G61(H){return yJ.createElement(M61,{onDone:H})}var yJ,p1H,SyA,xyA;var DgD=K(()=>{xH();$I();yJ=b(s(),1),p1H=b(s(),1),SyA=b(OyA(),1),xyA={ios:{url:"https://apps.apple.com/app/claude-by-anthropic/id6473753684"},android:{url:"https://play.google.com/store/apps/details?id=com.anthropic.claude"}}});var U61,jyA;var BgD=K(()=>{U61={type:"local-jsx",name:"mobile",aliases:["ios","android"],description:"Show QR code to download the Claude mobile app",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (DgD(),IgD)),userFacingName(){return"mobile"}},jyA=U61});var fgD=()=>{};var EgD=()=>{};function tVH({name:H,description:$,progressMessage:A,pluginName:L,pluginCommand:I,getPromptWhileMarketplaceIsPrivate:D}){return{type:"prompt",name:H,description:$,progressMessage:A,contentLength:0,isEnabled:()=>!0,isHidden:!1,userFacingName(){return H},source:"builtin",async getPromptForCommand(B,f){return D(B,f)}}}var MgD;var GgD=K(()=>{MgD=tVH({name:"pr-comments",description:"Get comments from a GitHub pull request",progressMessage:"fetching PR comments",pluginName:"pr-comments",pluginCommand:"pr-comments",async getPromptWhileMarketplaceIsPrivate(H){return[{type:"text",text:`You are an AI assistant integrated into a git-based version control system. Your task is to fetch and display comments from a GitHub pull request. `);if(I.length===0)continue;let D=I[0];if(!D)continue;let B=D.split(" - ")[0]?.trim()||"";if(!B)continue;let f=I.slice(1).filter((E)=>E.trim().startsWith("- ")).map((E)=>E.trim().substring(2).trim()).filter(Boolean);if(f.length>0)$[B]=f}return $}catch($){return r($ instanceof Error?$:Error("Failed to parse changelog")),{}}}function F61(H,$,A=d1H()){try{let L=XT$(A),I=js.coerce(H),D=$?js.coerce($):null;if(!D||I&&js.gt(I,D,{loose:!0}))return Object.entries(L).filter(([B])=>!D||js.gt(B,D,{loose:!0})).sort(([B],[f])=>js.gt(B,f,{loose:!0})?-1:1).flatMap(([B,f])=>f).filter(Boolean).slice(0,X61)}catch(L){return r(L instanceof Error?L:Error("Failed to get release notes")),[]}return[]}function vyA(H=d1H()){try{let $=XT$(H);return Object.keys($).sort((L,I)=>js.gt(L,I,{loose:!0})?1:-1).map((L)=>{let I=$[L];if(!I||I.length===0)return null;let D=I.filter(Boolean);if(D.length===0)return null;return[L,D]}).filter((L)=>L!==null)}catch($){return r($ instanceof Error?$:Error("Failed to get release notes")),[]}}function JT$(H,$={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION){if(H!==$||!d1H())yyA().catch((I)=>r(I instanceof Error?I:Error("Failed to fetch changelog")));let A=F61($,H);return{hasReleaseNotes:A.length>0,releaseNotes:A}}var js,ZmH,UgD,sVH,X61=5,XgD="https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md",J61="https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md";var eVH=K(()=>{_$();w1();vA();g$();NA();js=b(OO(),1),ZmH=require("path"),UgD=require("fs"),sVH=require("fs/promises")});var KgD={};XA(KgD,{call:()=>K61});function FgD(H){return H.map(([$,A])=>{let L=`Version ${$}:`,I=A.map((D)=>`\u2022 ${D}`).join(` `).filter((E)=>E.startsWith("worktree ")).map((E)=>E.slice(9));c("tengu_worktree_detection",{duration_ms:I,worktree_count:D.length,success:!0});let B=D.find((E)=>H===E||H.startsWith(E+qgD.sep)),f=D.filter((E)=>E!==B).sort((E,M)=>E.localeCompare(M));return B?[B,...f]:f}var qgD;var qmH=K(()=>{B0();z$();t8();qgD=require("path")});function byA(H){if(H.type==="assistant"&&H.message.content[0]?.type==="tool_use"){let $=H.message.content[0];return{messageId:H.message.id,toolUseId:$.id,toolName:$.name}}return null}function TgD(H,$,A=!1){if(A)return{messages:H};let L=new Set($.filter((G)=>G.renderGroupedToolUse).map((G)=>G.name)),I=new Map;for(let G of H){let U=byA(G);if(U&&L.has(U.toolName)){let X=`${U.messageId}:${U.toolName}`,J=I.get(X)??[];J.push(G),I.set(X,J)}}let D=new Map,B=new Set;for(let[G,U]of I)if(U.length>=2){D.set(G,U);for(let X of U){let J=byA(X);if(J)B.add(J.toolUseId)}}let f=new Map;for(let G of H)if(G.type==="user"){for(let U of G.message.content)if(U.type==="tool_result"&&B.has(U.tool_use_id))f.set(U.tool_use_id,G)}let E=[],M=new Set;for(let G of H){let U=byA(G);if(U){let X=`${U.messageId}:${U.toolName}`,J=D.get(X);if(J){if(!M.has(X)){M.add(X);let F=J[0],Q=[];for(let P of J){let C=P.message.content[0].id,Y=f.get(C);if(Y)Q.push(Y)}let W={type:"grouped_tool_use",toolName:U.toolName,messages:J,results:Q,displayMessage:F,uuid:`grouped-${F.uuid}`,timestamp:F.timestamp,messageId:U.messageId};E.push(W)}continue}}if(G.type==="user"){let X=G.message.content.filter((J)=>J.type==="tool_result");if(X.length>0){if(X.every((F)=>B.has(F.tool_use_id)))continue}}E.push(G)}return{messages:E}}function zgD(H){return H.type==="attachment"&&H.attachment.type==="task_status"&&H.attachment.taskType==="in_process_teammate"&&H.attachment.status==="completed"}function NgD(H){let $=[],A=0;while(A=77;return!1}if(A===15&&D!==null){if(L===6&&I===0)return D<58;return!0}if(A===16&&D!==null){if(L===1&&I===0)return D<12;return L===0}if(A>=17)return!1;let B=`${A}.${L}`,f=OgD[B];if(f===void 0){let E=Object.keys(OgD).filter((G)=>G.startsWith(`${A}.`)).map((G)=>parseInt(G.split(".")[1],10)),M=Math.max(...E,0);return L<=M}return I({...$,reactVulnerabilityCache:{detected:H.detected,package:H.package,packageName:H.packageName,version:H.version,packageManager:H.packageManager}})),H}var TmH,zmH,NmH,FT$,OgD;var uyA=K(()=>{PI();nM();vA();TmH=require("path"),zmH=require("fs/promises"),NmH=["19.0.0","19.1.0","19.1.1","19.2.0"],FT$=["react-server-dom-webpack","react-server-dom-parcel","react-server-dom-turbopack"],OgD={"15.0":5,"15.1":9,"15.2":6,"15.3":6,"15.4":8,"15.5":7,"16.0":7}});function vgD(H){return h61.filter(($)=>$.isActive(H))}var YI,ygD,Z61,q61,T61,z61,N61,O61,x61,S61,j61,R61=3,y61="tengu_react_vulnerability_warning",v61,h61;var hgD=K(()=>{xH();mQ();jI();PI();Q9();EI();oM();aI();ERA();nU();PKA();SD();uyA();vA();YI=b(s(),1),ygD=require("path"),Z61={id:"large-memory-files",type:"warning",isActive:()=>{return MBH().length>0},render:()=>{let H=MBH();return YI.createElement(YI.Fragment,null,H.map(($)=>{let A=$.path.startsWith(C$())?ygD.relative(C$(),$.path):$.path;return YI.createElement(x,{key:$.path,flexDirection:"row"},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Large ",YI.createElement(V,{bold:!0},A)," will impact performance (",a0($.content.length)," chars >"," ",a0(Cm),")",YI.createElement(V,{dimColor:!0}," \u2022 /memory to edit")))}))}},q61={id:"ultra-claude-md",type:"warning",isActive:()=>{let H=GBH();return H!==null&&H.content.length>HQH},render:()=>{let H=GBH();if(!H)return null;let $=H.content.length;return YI.createElement(x,{flexDirection:"row",gap:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"CLAUDE.md entries marked as IMPORTANT exceed"," ",HQH," chars (",$," chars)",YI.createElement(V,{dimColor:!0}," \u2022 /memory to edit")))}},T61={id:"claude-ai-external-token",type:"warning",isActive:()=>{let H=ji();return nL()&&(H.source==="ANTHROPIC_AUTH_TOKEN"||H.source==="apiKeyHelper")},render:()=>{let H=ji();return YI.createElement(x,{flexDirection:"row",marginTop:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Auth conflict: Using ",H.source," instead of Claude account subscription token. Either unset ",H.source,", or run `claude /logout`."))}},z61={id:"api-key-conflict",type:"warning",isActive:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return!!NqH()&&(H==="ANTHROPIC_API_KEY"||H==="apiKeyHelper")},render:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0});return YI.createElement(x,{flexDirection:"row",marginTop:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Auth conflict: Using ",H," instead of Anthropic Console key. Either unset ",H,", or run `claude /logout`."))}},N61={id:"both-auth-methods",type:"warning",isActive:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0}),$=ji();return H!=="none"&&$.source!=="none"&&!(H==="apiKeyHelper"&&$.source==="apiKeyHelper")},render:()=>{let{source:H}=Y5({skipRetrievingKeyFromApiKeyHelper:!0}),$=ji();return YI.createElement(x,{flexDirection:"column",marginTop:1},YI.createElement(x,{flexDirection:"row"},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Auth conflict: Both a token (",$.source,") and an API key (",H,") are set. This may lead to unexpected behavior.")),YI.createElement(x,{flexDirection:"column",marginLeft:3},YI.createElement(V,{color:"warning"},"\u2022 Trying to use"," ",$.source==="claude.ai"?"claude.ai":$.source,"?"," ",H==="ANTHROPIC_API_KEY"?'Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.':H==="apiKeyHelper"?"Unset the apiKeyHelper setting.":"claude /logout"),YI.createElement(V,{color:"warning"},"\u2022 Trying to use ",H,"?"," ",$.source==="claude.ai"?"claude /logout to sign out of claude.ai.":`Unset the ${$.source} environment variable.`)))}},O61={id:"sonnet-1m-welcome",type:"info",isActive:(H)=>H.showSonnet1MNotice===!0,render:()=>{return YI.createElement(x,{flexDirection:"column",marginTop:1},YI.createElement(V,{bold:!0},"You now have access to Sonnet 4.5 with 1M context (uses more rate limits than Sonnet on long requests) \u2022 Update in /model"))}},x61={id:"opus-4.6-available",type:"info",isActive:(H)=>H.showOpus46Notice===!0,render:()=>{let $=sI()!=="firstParty",A=f0(),L=A==="max",I=A==="team",D=A==="pro",B=X1().toLowerCase().includes("opus-4-6"),f;if(L||I||D||B)f=YI.createElement(V,{dimColor:!0},"Welcome to Opus 4.6");else if($)f=YI.createElement(V,{dimColor:!0},"/model to try Opus 4.6. Note: you may need to request access from your cloud provider");else f=YI.createElement(V,{dimColor:!0},"/model to try Opus 4.6");return YI.createElement(x,{marginLeft:1},f)}},S61={id:"large-agent-descriptions",type:"warning",isActive:(H)=>{return sgH(H.agentDefinitions)>Z1H},render:(H)=>{let $=sgH(H.agentDefinitions);return YI.createElement(x,{flexDirection:"row"},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},"Large cumulative agent descriptions will impact performance (~",a0($)," tokens >"," ",a0(Z1H),")",YI.createElement(V,{dimColor:!0}," \u2022 /agents to manage")))}},j61={id:"jetbrains-plugin-install",type:"info",isActive:(H)=>{if(!rjH())return!1;if(!(H.config.autoInstallIdeExtension??!0))return!1;let A=FKH();return A!==null&&!vZI(A)},render:()=>{let H=FKH(),$=PX(H);return YI.createElement(x,{flexDirection:"row",gap:1,marginLeft:1},YI.createElement(V,{color:"ide"},pH.arrowUp),YI.createElement(V,null,"Install the ",YI.createElement(V,{color:"ide"},$)," plugin from the JetBrains Marketplace:"," ",YI.createElement(V,{bold:!0},"https://docs.claude.com/s/claude-code-jetbrains")))}},v61={id:"react-vulnerability",type:"warning",isActive:()=>{if(!cf(y61))return!1;if((Mf().reactVulnerabilityWarningCount??0)>=R61)return!1;return kyA()?.detected===!0},render:()=>{let H=kyA();if(!H?.detected||!H.packageManager||!H.packageName)return null;let $=jgD(H.packageManager,H.packageName),A=H.package==="next",L=A?"CVE-2025-66478":"CVE-2025-55182",I=A?`Next.js ${H.version}`:`${H.packageName}@${H.version}`;return YI.createElement(x,{flexDirection:"row",gap:1},YI.createElement(V,{color:"warning"},pH.warning),YI.createElement(V,{color:"warning"},I," has a critical vulnerability (",L,") that could allow attackers to execute arbitrary code on your server. Run `",$,"` to update."))}},h61=[v61,Z61,q61,S61,T61,z61,N61,O61,x61,j61]});function bgD({agentDefinitions:H}={}){let $=Oz.useRef(!1),A=M$(),L=T9()?.organizationUuid,D=(L?A.s1mAccessCache?.[L]:void 0)?.hasAccessNotAsDefault,B=L&&A.hasShownS1MWelcomeV2?.[L],f=nL()&&D&&!B,M=!(L&&A.hasShownOpus46Notice?.[L]),G={config:A,showSonnet1MNotice:f,showOpus46Notice:M,agentDefinitions:H},U=vgD(G);if(Oz.useEffect(()=>{if(!L)return;let X=U.some((F)=>F.id==="sonnet-1m-welcome"),J=U.some((F)=>F.id==="opus-4.6-available");if(X)c("tengu_sonnet_1m_notice_shown",{});if(J)c("tengu_opus_46_notice_shown",{});if(X||J)AA((F)=>({...F,...X&&{hasShownS1MWelcomeV2:{...F.hasShownS1MWelcomeV2,[L]:!0}},...J&&{hasShownOpus46Notice:{...F.hasShownOpus46Notice,[L]:!0}}}))},[U,A,L]),Oz.useEffect(()=>{if($.current)return;if(U.some((J)=>J.id==="react-vulnerability"))$.current=!0,c("tengu_react_vulnerability_notice_shown",{}),MM((J)=>({...J,reactVulnerabilityWarningCount:(J.reactVulnerabilityWarningCount??0)+1}))},[U]),U.length===0)return null;return Oz.createElement(x,{flexDirection:"column",paddingLeft:1},U.map((X)=>Oz.createElement(Oz.Fragment,{key:X.id},X.render(G))))}var Oz;var kgD=K(()=>{xH();vA();hgD();z$();EI();Oz=b(s(),1)});function ugD(H,$){for(let A of H)if(!$.has(A))return!1;return!0}function ggD(H,$=!1){let[A,L]=HPH.useState(1),[I,D]=HPH.useState(-1);return WL((B,f)=>{if(f.escape&&I===-1&&!$)D(0)},{isActive:H}),HPH.useEffect(()=>{if(!H){D(-1),L(0);return}},[H]),HPH.useEffect(()=>{if(I===-1)return;let B=[1,0,1,2,2,1,0,0,0,1,2,2,1];if(I>=B.length){D(-1),L(1);return}L(B[I]);let f=setTimeout(()=>{D((E)=>E+1)},60);return()=>clearTimeout(f)},[I]),A}var HPH;var mgD=K(()=>{xH();HPH=b(s(),1)});function cgD(H){if(H>=70)return"horizontal";return"compact"}function lgD(H,$,A){if($==="horizontal"){let I=A,D=gyA+WT$+QT$+I,B=H-D,f=Math.max(30,B),E=Math.min(I+f+QT$+WT$,H-gyA);if(Eb61)return"Welcome back!";return`Welcome back ${H}!`}function xmH(H,$){if(H.length<=$)return H;let A="/",L="\u2026",I=H.split(A),D=I[0]||"",B=I[I.length-1]||"";if(I.length===1)return H.substring(0,$-L.length)+L;if(D===""&&L.length+A.length+B.length>=$)return`${A}${B.substring(0,$-L.length-A.length)}${L}`;if(D!==""&&L.length*2+A.length+B.length>=$)return`${L}${A}${B.substring(0,$-L.length*2-A.length)}${L}`;if(I.length===2)return`${D.substring(0,$-L.length-A.length-B.length)}${L}${A}${B}`;let f=$-D.length-B.length-L.length-2*A.length;if(f<=0)return`${D.substring(0,Math.max(0,$-B.length-L.length-2*A.length))}${A}${L}${A}${B}`;let E=[];for(let M=I.length-2;M>0;M--){let G=I[M];if(G&&G.length+A.length<=f)E.unshift(G),f-=G.length+A.length;else break}if(E.length===0)return`${D}${A}${L}${A}${B}`;return`${D}${A}${L}${A}${E.join(A)}${A}${B}`}async function ngD(){if(VT$)return VT$;let H=j$();return VT$=CT$(10).then(($)=>{return OmH=$.filter((A)=>{if(A.isSidechain)return!1;if(A.sessionId===H)return!1;if(A.summary?.includes("I apologize"))return!1;let L=A.summary&&A.summary!=="No prompt",I=A.firstPrompt&&A.firstPrompt!=="No prompt";return L||I}).slice(0,3),OmH}).catch(()=>{return OmH=[],OmH}),VT$}function rgD(){return OmH}function _T$(){let H=process.env.DEMO_VERSION??{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,$=bS$(),A=process.env.DEMO_VERSION?"/code/claude":V9(C$()),L=$?`${A} in ${$.replace(/^https?:\/\//,"")}`:A,I=X1(),D=xoL(I),B=nL()?t$A():"API Usage Billing",f=GB().agent;return{version:H,cwd:L,modelDisplayName:D,billingType:B,agentName:f}}function agD(H,$,A){if(H.length+3+$.length>A)return{shouldSplit:!0,truncatedModel:e8(H,A),truncatedBilling:e8($,A)};return{shouldSplit:!1,truncatedModel:e8(H,Math.max(A-$.length-3,10)),truncatedBilling:$}}function ogD(H){let $=d1H();if(!$)return[];let A;try{A=XT$($)}catch{return[]}let L=[],I=Object.keys(A).sort((D,B)=>pgD.gt(D,B,{loose:!0})?-1:1).slice(0,3);for(let D of I){let B=A[D];if(B)L.push(...B)}return L.slice(0,H)}var pgD,dgD=50,b61=20,gyA=4,QT$=1,WT$=2,OmH,VT$=null;var YT$=K(()=>{eVH();Q9();rB();g$();PI();rD();EI();aI();mL();pgD=b(OO(),1);OmH=[]});function myA(){if(OA.terminal==="Apple_Terminal")return u8.createElement(k61,null);return u8.createElement(x,{flexDirection:"column"},u8.createElement(V,null,u8.createElement(V,{color:"clawd_body"}," \u2590"),u8.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u259B\u2588\u2588\u2588\u259C"),u8.createElement(V,{color:"clawd_body"},"\u258C")),u8.createElement(V,null,u8.createElement(V,{color:"clawd_body"},"\u259D\u259C"),u8.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u2588\u2588\u2588\u2588\u2588"),u8.createElement(V,{color:"clawd_body"},"\u259B\u2598")),u8.createElement(V,{color:"clawd_body"}," ","\u2598\u2598 \u259D\u259D"," "))}function k61(){return u8.createElement(x,{flexDirection:"column",alignItems:"center"},u8.createElement(V,null,u8.createElement(V,{color:"clawd_body"},"\u2597"),u8.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),u8.createElement(V,{color:"clawd_body"},"\u2596")),u8.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(7)),u8.createElement(V,{color:"clawd_body"},"\u2598\u2598 \u259D\u259D"))}var u8;var tgD=K(()=>{xH();Z1();u8=b(s(),1)});function sgD(H){let{title:$,lines:A,footer:L,emptyMessage:I,customContent:D}=H,B=$.length;if(D!==void 0)B=Math.max(B,D.width);else if(A.length===0&&I)B=Math.max(B,I.length);else{let E=Math.max(0,...A.map((M)=>M.timestamp?M.timestamp.length:0));for(let M of A){let G=E>0?E:0,U=M.text.length+(G>0?G+2:0);B=Math.max(B,U)}}if(L)B=Math.max(B,L.length);return B}function egD({config:H,actualWidth:$}){let{title:A,lines:L,footer:I,emptyMessage:D,customContent:B}=H,f=" ",E=Math.max(0,...L.map((M)=>M.timestamp?M.timestamp.length:0));return cE.createElement(x,{flexDirection:"column",width:$},cE.createElement(V,{bold:!0,color:"claude"},A),B?cE.createElement(cE.Fragment,null,B.content,I&&cE.createElement(V,{dimColor:!0,italic:!0},e8(I,$))):L.length===0&&D?cE.createElement(V,{dimColor:!0},e8(D,$)):cE.createElement(cE.Fragment,null,L.map((M,G)=>{let U=Math.max(10,$-(E>0?E+2:0));return cE.createElement(V,{key:G},E>0&&cE.createElement(cE.Fragment,null,cE.createElement(V,{dimColor:!0},(M.timestamp||"").padEnd(E))," "),cE.createElement(V,null,e8(M.text,U)))}),I&&cE.createElement(V,{dimColor:!0,italic:!0},e8(I,$))))}var cE;var HmD=K(()=>{xH();Q9();cE=b(s(),1)});function $mD({feeds:H,maxWidth:$}){let A=H.map((D)=>sgD(D)),L=Math.max(...A),I=Math.min(L,$);return Ej.createElement(x,{flexDirection:"column"},H.map((D,B)=>Ej.createElement(Ej.Fragment,{key:B},Ej.createElement(egD,{config:D,actualWidth:I}),B{xH();HmD();e6();Ej=b(s(),1)});async function u61(H="claude_code_guest_pass"){let{accessToken:$,orgUUID:A}=await Zw(),L={...xK($),"x-organization-uuid":A},I=`${XD().BASE_API_URL}/api/oauth/organizations/${A}/referral/eligibility`;return(await nA.get(I,{headers:L,params:{campaign:H},timeout:5000})).data}async function DmD(H="claude_code_guest_pass"){let{accessToken:$,orgUUID:A}=await Zw(),L={...xK($),"x-organization-uuid":A},I=`${XD().BASE_API_URL}/api/oauth/organizations/${A}/referral/redemptions`;return(await nA.get(I,{headers:L,params:{campaign:H},timeout:1e4})).data}function BmD(){return!!(T9()?.organizationUuid&&nL()&&f0()==="max")}function wT$(){if(!BmD())return{eligible:!1,needsRefresh:!1,hasCache:!1};let H=T9()?.organizationUuid;if(!H)return{eligible:!1,needsRefresh:!1,hasCache:!1};let A=M$().passesEligibilityCache?.[H];if(!A)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:L,timestamp:I}=A,B=Date.now()-I>ImD;return{eligible:L,needsRefresh:B,hasCache:!0}}function Rs(H){let $=g61[H.currency]??`${H.currency} `,A=H.amount_minor_units/100,L=A%1===0?A.toString():A.toFixed(2);return`${$}${L}`}function ys(){let H=T9()?.organizationUuid;if(!H)return null;return M$().passesEligibilityCache?.[H]?.referrer_reward??null}function ZT$(){let H=T9()?.organizationUuid;if(!H)return null;return M$().passesEligibilityCache?.[H]?.remaining_passes??null}async function LmD(){if(SmH)return N("Passes: Reusing in-flight eligibility fetch"),SmH;let H=T9()?.organizationUuid;if(!H)return null;return SmH=(async()=>{try{let $=await u61(),A={...$,timestamp:Date.now()};return AA((L)=>({...L,passesEligibilityCache:{...L.passesEligibilityCache,[H]:A}})),N(`Passes eligibility cached for org ${H}: ${$.eligible}`),$}catch($){return N("Failed to fetch and cache passes eligibility"),r($),null}finally{SmH=null}})(),SmH}async function jmH(){if(!BmD())return null;let H=T9()?.organizationUuid;if(!H)return null;let A=M$().passesEligibilityCache?.[H],L=Date.now();if(!A)return N("Passes: No cache, fetching eligibility in background (command unavailable this session)"),LmD(),null;if(L-A.timestamp>ImD){N("Passes: Cache stale, returning cached data and refreshing in background"),LmD();let{timestamp:B,...f}=A;return f}N("Passes: Using fresh cached eligibility data");let{timestamp:I,...D}=A;return D}async function fmD(){jmH()}var ImD=3600000,SmH=null,g61;var Jd=K(()=>{w1();qE();YS();vA();EI();E$();_$();g61={USD:"$",EUR:"\u20AC",GBP:"\xA3",BRL:"R$",CAD:"CA$",AUD:"A$",NZD:"NZ$",SGD:"S$"}});function RmH(H){let $=H.map((A)=>{let L=HLH(A.modified);return{text:(A.summary&&A.summary!=="No prompt"?A.summary:A.firstPrompt)||"",timestamp:L}});return{title:"Recent activity",lines:$,footer:$.length>0?"/resume for more":void 0,emptyMessage:"No recent activity"}}function MmD(H){let $=H.map((L)=>{return{text:L}}),A="Check the Claude Code changelog for updates";return{title:"What's new",lines:$,footer:$.length>0?"/release-notes for more":void 0,emptyMessage:"Check the Claude Code changelog for updates"}}function GmD(H){let A=H.filter(({isEnabled:I})=>I).sort((I,D)=>Number(I.isComplete)-Number(D.isComplete)).map(({text:I,isComplete:D})=>{return{text:`${D?`${pH.tick} `:""}${I}`}}),L=C$()===EmD.homedir()?"Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.":void 0;if(L)A.push({text:L});return{title:"Tips for getting started",lines:A}}function UmD(){let H=ys(),$=H?`Share Claude Code and earn ${Rs(H)} of extra usage`:"Share Claude Code with friends";return{title:"3 guest passes",lines:[],customContent:{content:l4.createElement(l4.Fragment,null,l4.createElement(x,{marginY:1},l4.createElement(V,{color:"claude"},"[\u273B] [\u273B] [\u273B]")),l4.createElement(V,{dimColor:!0},$)),width:48},footer:"/passes"}}function XmD(H){switch(H){case"promo-copper":return{title:cD()&&Z4()?"Opus 4.6 is here \xB7 Try fast mode":"Opus 4.6 is here",lines:[],customContent:{content:l4.createElement(x,{marginY:1},l4.createElement(V,{bold:!0,color:"claude"},"$50 free extra usage")),width:48},footer:"/extra-usage to enable"};case"promo":return{title:"Opus 4.6 is here",lines:[],customContent:{content:l4.createElement(x,{marginY:1},l4.createElement(V,{bold:!0,color:"claude"},"$50 free extra usage")),width:48},footer:"/extra-usage to enable"};case"launch-only":return{title:"Opus 4.6 is here",lines:[],customContent:{content:l4.createElement(x,{marginY:1},l4.createElement(V,null,"Most capable for ambitious work")),width:48},footer:"/model to switch"}}}var l4,EmD;var JmD=K(()=>{Q9();jI();PI();xH();AJ();Jd();l4=b(s(),1),EmD=require("os")});function m61(){let H=ZT$();if(H==null||H<=0)return;let A=M$().passesLastSeenRemaining??0;if(H>A)AA((L)=>({...L,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:H}))}function p61(){let{eligible:H,hasCache:$}=wT$();if(!H||!$)return!1;m61();let A=M$();if((A.passesUpsellSeenCount??0)>=3)return!1;if(A.hasVisitedPasses)return!1;return!0}function qT$(){let[H]=FmD.useState(()=>p61());return H}function TT$(){let $=(M$().passesUpsellSeenCount??0)+1;AA((A)=>({...A,passesUpsellSeenCount:$})),c("tengu_guest_passes_upsell_shown",{seen_count:$})}function KmD(){let H=ys();return Fd.createElement(V,{dimColor:!0},Fd.createElement(V,{color:"claude"},"[\u273B]")," ",Fd.createElement(V,{color:"claude"},"[\u273B]")," ",Fd.createElement(V,{color:"claude"},"[\u273B]")," \xB7"," ",H?`Share Claude Code and earn ${Rs(H)} of extra usage \xB7 /passes`:"3 guest passes at /passes")}var Fd,FmD;var pyA=K(()=>{xH();vA();Jd();z$();Fd=b(s(),1),FmD=b(s(),1)});function d61(){if(OA.terminal==="Apple_Terminal")return lD.createElement(x,{flexDirection:"column",alignItems:"center"},lD.createElement(V,null,lD.createElement(V,{color:"clawd_body"},"\u2597"),lD.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),lD.createElement(V,{color:"clawd_body"},"\u2596")),lD.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(7)),lD.createElement(V,{color:"clawd_body"},"\u2598\u2598 \u259D\u259D"));return lD.createElement(x,{flexDirection:"column"},lD.createElement(V,null,lD.createElement(V,{color:"clawd_body"}," \u2590"),lD.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u259B\u2588\u2588\u2588\u259C"),lD.createElement(V,{color:"clawd_body"},"\u258C")),lD.createElement(V,null,lD.createElement(V,{color:"clawd_body"},"\u259D\u259C"),lD.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u2588\u2588\u2588\u2588\u2588"),lD.createElement(V,{color:"clawd_body"},"\u259B\u2598")),lD.createElement(V,{color:"clawd_body"}," ","\u2598\u2598 \u259D\u259D"," "))}function QmD(){let{columns:H}=QL(),$=J$((u)=>u.agent),[A,{isVisible:L}]=vg(),I=_T$(),D=ymH.useRef(I);if(L)D.current=I;let{version:B,cwd:f,modelDisplayName:E,billingType:M,agentName:G}=D.current,U=$??G,X=qT$(),J=Kq$();ymH.useEffect(()=>{if(X)TT$()},[X]),ymH.useEffect(()=>{if(J&&!X)Qq$()},[J,X]);let F=Math.max(H-15,20),W=e8(B,Math.max(F-"Claude Code v".length,6)),{shouldSplit:P,truncatedModel:C,truncatedBilling:Y}=agD(E,M,F),Z=" \xB7 ",O=U?F-1-U.length-Z.length:F,j=xmH(f,Math.max(O,10));return lD.createElement(x,{ref:A,flexDirection:"row",gap:2,alignItems:"center"},lD.createElement(d61,null),lD.createElement(x,{flexDirection:"column"},lD.createElement(V,null,lD.createElement(V,{bold:!0},"Claude Code")," ",lD.createElement(V,{dimColor:!0},"v",W)),P?lD.createElement(lD.Fragment,null,lD.createElement(V,{dimColor:!0},C),lD.createElement(V,{dimColor:!0},Y)):lD.createElement(V,{dimColor:!0},C," \xB7 ",Y),lD.createElement(V,{dimColor:!0},U?`@${U} \xB7 ${j}`:j),X&&lD.createElement(KmD,null),!X&&J&&lD.createElement(WyD,{variant:J,maxWidth:F})))}var lD,ymH;var WmD=K(()=>{xH();Z1();OB();Q9();YT$();pyA();rgH();pL();lD=b(s(),1),ymH=b(s(),1)});function dyA(){let H=hmH.useMemo(i61,[]),$=hmH.useMemo(()=>M$().lastShownEmergencyTip,[]),A=H.tip&&H.tip!==$;if(hmH.useEffect(()=>{if(A)AA((L)=>{if(L.lastShownEmergencyTip===H.tip)return L;return{...L,lastShownEmergencyTip:H.tip}})},[A,H.tip]),!A)return null;return vmH.createElement(x,{paddingLeft:2,flexDirection:"column"},vmH.createElement(V,{...H.color==="warning"?{color:"warning"}:H.color==="error"?{color:"error"}:{dimColor:!0}},H.tip))}function i61(){return rm(c61,l61)}var vmH,hmH,c61="tengu-top-of-feed-tip",l61;var VmD=K(()=>{xH();SD();vA();vmH=b(s(),1),hmH=b(s(),1);l61={tip:"",color:"dim"}});function PmD({isBeforeFirstMessage:H}){let $=lQ(),A=$.prefersReducedMotion??!1,L=ggD(H,A),I=rgD(),D=M$().oauthAccount?.displayName??"",{columns:B}=QL(),f=wVI(),E=vL.isSandboxingEnabled(),M=qT$(),G=Kq$(),U=J$((MH)=>MH.agent),X=M$(),J;try{J=ogD(3)}catch{J=[]}let F=$.companyAnnouncements,[Q]=vs.useState(()=>F&&F.length>0?X.numStartups===1?F[0]:F[Math.floor(Math.random()*F.length)]:void 0),{hasReleaseNotes:W}=JT$(X.lastReleaseNotesSeen);vs.useEffect(()=>{if(M$().lastReleaseNotesSeen==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)return;if(AA((CH)=>{if(CH.lastReleaseNotesSeen==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)return CH;return{...CH,lastReleaseNotesSeen:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}}),f)ZVI()},[X,f]),vs.useEffect(()=>{if(M&&!f)TT$()},[M,f]),vs.useEffect(()=>{if(G&&!f&&!M)Qq$()},[G,f,M]);let[P,{isVisible:C}]=vg(),Y=_T$(),Z=vs.useRef(Y);if(C)Z.current=Y;let{version:q,cwd:O,modelDisplayName:j,billingType:u,agentName:y}=Z.current,g=U??y,h=e8(j,cyA-20);if(!W&&!f&&!A$(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return PL.createElement(PL.Fragment,null,PL.createElement(x,null),PL.createElement(QmD,null),QEH()&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Debug mode enabled"),PL.createElement(V,{dimColor:!0},"Logging to: ",IR()?"stderr":xHH())),PL.createElement(dyA,null),process.env.CLAUDE_CODE_TMUX_SESSION&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{dimColor:!0},"tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION),PL.createElement(V,{dimColor:!0},process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`)),Q&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},!process.env.IS_DEMO&&X.oauthAccount?.organizationName&&PL.createElement(V,{dimColor:!0},"Message from ",X.oauthAccount.organizationName,":"),PL.createElement(V,null,Q)),!1,!1);let p=cgD(B),d=M$().theme,k=` ${ZL("claude",d)("Claude Code")} ${ZL("inactive",d)(`v${q}`)} `,n=ZL("claude",d)(" Claude Code ");if(p==="compact"){let CH=PT$(D);if(GI(CH)>B-4)CH=PT$(null);let OH=" \xB7 ",LH="@",e=g?B-4-LH.length-g.length-OH.length:B-4,DH=xmH(O,Math.max(e,10));return PL.createElement(PL.Fragment,null,PL.createElement(x,{ref:P,flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:n,position:"top",align:"start",offset:1},paddingX:1,paddingY:1,alignItems:"center",width:B},PL.createElement(V,{bold:!0},CH),PL.createElement(x,{marginY:1},PL.createElement(x,{height:5,flexDirection:"column",justifyContent:"flex-end"},PL.createElement(x,{marginBottom:L},PL.createElement(myA,null)))),PL.createElement(V,{dimColor:!0},h),PL.createElement(V,{dimColor:!0},u),PL.createElement(V,{dimColor:!0},g?`@${g} \xB7 ${DH}`:DH)),E&&PL.createElement(x,{marginTop:1,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Your bash commands will be sandboxed. Disable with /sandbox.")))}let GH=PT$(D),HH=!process.env.IS_DEMO&&X.oauthAccount?.organizationName?`${h} \xB7 ${u} \xB7 ${X.oauthAccount.organizationName}`:`${h} \xB7 ${u}`,BH=" \xB7 ",wH=g?cyA-1-g.length-BH.length:cyA,QH=xmH(O,Math.max(wH,10)),TH=g?`@${g} \xB7 ${QH}`:QH,t=igD(GH,TH,HH),{leftWidth:IH,rightWidth:KH}=lgD(B,p,t);return PL.createElement(PL.Fragment,null,PL.createElement(x,null),PL.createElement(x,{ref:P,flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:k,position:"top",align:"start",offset:3}},PL.createElement(x,{flexDirection:p==="horizontal"?"row":"column",paddingX:1,gap:1},PL.createElement(x,{flexDirection:"column",width:IH,justifyContent:"space-between",alignItems:"center",minHeight:9},PL.createElement(x,{marginTop:1},PL.createElement(V,{bold:!0},GH)),PL.createElement(x,{height:5,flexDirection:"column",justifyContent:"flex-end"},PL.createElement(x,{marginBottom:L},PL.createElement(myA,null))),PL.createElement(x,{flexDirection:"column",alignItems:"center"},PL.createElement(V,{dimColor:!0},HH),PL.createElement(V,{dimColor:!0},TH))),p==="horizontal"&&PL.createElement(Uf,{orientation:"vertical",dividerColor:"claude"}),p==="horizontal"&&PL.createElement($mD,{feeds:f?[GmD(f5A()),RmH(I)]:M?[RmH(I),UmD()]:G?[RmH(I),XmD(G)]:[RmH(I),MmD(J)],maxWidth:KH}))),QEH()&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Debug mode enabled"),PL.createElement(V,{dimColor:!0},"Logging to: ",IR()?"stderr":xHH())),PL.createElement(dyA,null),process.env.CLAUDE_CODE_TMUX_SESSION&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{dimColor:!0},"tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION),PL.createElement(V,{dimColor:!0},process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`)),Q&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},!process.env.IS_DEMO&&X.oauthAccount?.organizationName&&PL.createElement(V,{dimColor:!0},"Message from ",X.oauthAccount.organizationName,":"),PL.createElement(V,null,Q)),E&&PL.createElement(x,{paddingLeft:2,flexDirection:"column"},PL.createElement(V,{color:"warning"},"Your bash commands will be sandboxed. Disable with /sandbox.")),!1,!1)}var PL,vs,cyA=50;var _mD=K(()=>{xH();OB();DJ();mgD();YT$();Q9();rD();tgD();AmD();JmD();e6();vA();um();E$();xSH();WmD();eVH();TQH();NA();hc();VmD();EM();pyA();rgH();pL();PL=b(s(),1),vs=b(s(),1)});function YmD({message:H,isTranscriptMode:$}){if(!($&&H.timestamp&&H.type==="assistant"&&H.message.content.some((I)=>I.type==="text")))return null;let L=new Date(H.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0});return lyA.default.createElement(x,{marginTop:1,minWidth:L.length},lyA.default.createElement(V,{dimColor:!0},L))}var lyA;var CmD=K(()=>{xH();lyA=b(s(),1)});function wmD({message:H,isTranscriptMode:$}){if(!($&&H.type==="assistant"&&H.message.model&&H.message.content.some((L)=>L.type==="text")))return null;return iyA.default.createElement(x,{marginTop:1,marginLeft:1,minWidth:H.message.model.length+8},iyA.default.createElement(V,{dimColor:!0},H.message.model))}var iyA;var ZmD=K(()=>{xH();iyA=b(s(),1)});function n61(H,$){for(let A=$+1;A0?A[$-1]:null,j=H.type==="user"&&O?.type==="user",u=Y?H.displayMessage:Z?FyI(H):H,y=Y||Z?[]:OmD(H,P),g=Y||Z?new Set:NmD(H,P),h=zmD(H,f,B,g,E,P),p=!1;if(M)if(Y)p=H.messages.some((d)=>{let k=d.message.content[0];return k?.type==="tool_use"&&B.has(k.id)});else if(Z)p=JyI(H,B);else{let d=hs(H);p=!d||B.has(d)}return Mj.createElement(x,{key:`${H.uuid}-${J}-${F}`,width:Q,flexDirection:"row",flexWrap:"nowrap",alignItems:"flex-start",justifyContent:"space-between",gap:1},Mj.createElement(Bz,{message:H,lookups:P,addMargin:!0,tools:L,commands:I,verbose:D,inProgressToolUseIDs:B,progressMessagesForMessage:y,shouldAnimate:p,shouldShowDot:!0,isTranscriptMode:C,isStatic:h,onOpenRateLimitOptions:G,isActiveCollapsedGroup:q,isUserContinuation:j,lastThinkingBlockId:U,latestBashOutputUUID:X}),Mj.createElement(YmD,{message:u,isTranscriptMode:C}),Mj.createElement(wmD,{message:u,isTranscriptMode:C}))}function a61(H,$){if(H.type==="grouped_tool_use")return H.messages.some((L)=>{let I=L.message.content[0];return I?.type==="tool_use"&&$.has(I.id)});if(H.type==="collapsed_read_search")return MQH(H).some((I)=>$.has(I));let A=hs(H);return!!A&&$.has(A)}function o61(H,$){if(H.type==="grouped_tool_use")return H.messages.every((L)=>{let I=L.message.content[0];return I?.type==="tool_use"&&$.has(I.id)});if(H.type==="collapsed_read_search")return MQH(H).every((I)=>$.has(I));let A=hs(H);return!A||$.has(A)}function t61(H,$){if(H.message!==$.message)return!1;if(H.screen!==$.screen)return!1;if(H.message.type==="collapsed_read_search"&&$.screen!=="transcript")return!1;if(H.columns!==$.columns)return!1;let A=H.latestBashOutputUUID===H.message.uuid,L=$.latestBashOutputUUID===$.message.uuid;if(A!==L)return!1;if(H.lastThinkingBlockId!==$.lastThinkingBlockId)return!1;let I=a61(H.message,H.streamingToolUseIDs),D=o61(H.message,H.lookups.resolvedToolUseIDs);if(I||!D)return!1;return!0}var Mj,qmD;var TmD=K(()=>{xH();_L();hx();A6H();CmD();ZmD();bmH();Mj=b(s(),1);qmD=Mj.memo(r61,t61)});function H31(H,$){if(H.size!==$.size)return!1;for(let A of H)if(!$.has(A))return!1;return!0}function zmD(H,$,A,L,I,D){if(I==="transcript")return!0;switch(H.type){case"attachment":case"user":case"assistant":{let B=hs(H);if(!B)return!0;if($.has(B))return!1;if(A.has(B))return!1;if(jmD(B,"PostToolUse",D))return!1;return ugD(L,D.resolvedToolUseIDs)}case"system":return H.subtype!=="api_error";case"grouped_tool_use":return H.messages.every((f)=>{let E=f.message.content[0];return E?.type==="tool_use"&&D.resolvedToolUseIDs.has(E.id)});case"collapsed_read_search":return!1}}var i4,PC,s61=null,kmH=10,e61=({messages:H,normalizedMessageHistory:$,tools:A,commands:L,verbose:I,toolJSX:D,toolUseConfirmQueue:B,inProgressToolUseIDs:f,isMessageSelectorVisible:E,conversationId:M,screen:G,screenToggleId:U,streamingToolUses:X,showAllInTranscript:J=!1,agentDefinitions:F,onOpenRateLimitOptions:Q,hideLogo:W=!1,isLoading:P,hidePastThinking:C=!1,streamingThinking:Y})=>{let{columns:Z}=QL(),q=C0("transcript:toggleShowAll","Transcript","Ctrl+E"),O=PC.useMemo(()=>[...$,...g5(H).filter(Is)],[H,$]),j=PC.useMemo(()=>{if(!Y)return!1;if(Y.isStreaming)return!0;if(Y.streamingEndedAt)return Date.now()-Y.streamingEndedAt<30000;return!1},[Y]),u=PC.useMemo(()=>{if(!C)return null;if(j)return"streaming";for(let t=O.length-1;t>=0;t--){let IH=O[t];if(IH?.type==="assistant"){let KH=IH.message.content;for(let MH=KH.length-1;MH>=0;MH--)if(KH[MH]?.type==="thinking")return`${IH.uuid}:${MH}`}else if(IH?.type==="user"){if(!IH.message.content.some((MH)=>MH.type==="tool_result"))return"no-thinking"}}return null},[O,C,j]),y=PC.useMemo(()=>{for(let t=O.length-1;t>=0;t--){let IH=O[t];if(IH?.type==="user"){let KH=IH.message.content;for(let MH of KH)if(MH.type==="text"){let CH=MH.text;if(CH.startsWith("X.filter((t)=>{if(f.has(t.contentBlock.id))return!1;if(O.some((IH)=>IH.type==="assistant"&&IH.message.content[0].type==="tool_use"&&IH.message.content[0].id===t.contentBlock.id))return!1;return!0}),[X,f,O]),h=PC.useMemo(()=>g.flatMap((t)=>g5([PT({content:[t.contentBlock]})])),[g]),p=G==="transcript",d=p&&!J,{renderableMessages:k,lookups:n,hasTruncatedMessages:GH}=PC.useMemo(()=>{let t=I?O:GC(O),IH=xmD(t.filter((e)=>e.type!=="progress").filter((e)=>RmD(e,p)),h),KH=d?IH.slice(-kmH):IH,MH=d&&IH.length>kmH,{messages:CH}=TgD(KH,A,I),OH=NgD(KyI(CH,A)),LH=SmD(O,KH);return{renderableMessages:OH,lookups:LH,hasTruncatedMessages:MH}},[I,O,p,h,d,A]),HH=PC.useMemo(()=>new Set(X.map((t)=>t.contentBlock.id)),[X]),BH=(!D||!!D.shouldContinueAnimation)&&!B.length&&!E,WH=f.size>0,{progress:wH}=Vy(),QH=PC.useRef(null),TH=M$().terminalProgressBarEnabled&&!(s61?.isProactiveActive()??!1);return PC.useEffect(()=>{let t=TH?WH?"indeterminate":"completed":null;if(QH.current===t)return;QH.current=t,wH(t)},[wH,TH,WH]),PC.useEffect(()=>{return()=>wH(null)},[wH]),i4.createElement(i4.Fragment,null,!W&&i4.createElement(x,{flexDirection:"column",gap:1,key:`logo-${M}-${U}`},i4.createElement(PmD,{isBeforeFirstMessage:!1}),i4.createElement(bgD,{agentDefinitions:F})),GH&&i4.createElement(Uf,{key:`truncation-indicator-${M}-${U}`,dividerChar:"\u2500",title:`${q} to show ${oH.bold(n.normalizedMessageCount-kmH)} previous messages`,width:Z}),p&&J&&n.normalizedMessageCount>kmH&&i4.createElement(Uf,{key:`hide-indicator-${M}-${U}`,dividerChar:"\u2500",title:`${q} to hide ${oH.bold(n.normalizedMessageCount-kmH)} previous messages`,width:Z}),k.map((t,IH)=>i4.createElement(qmD,{key:`${t.uuid}-${M}-${U}`,message:t,index:IH,renderableMessages:k,tools:A,commands:L,verbose:I,inProgressToolUseIDs:f,streamingToolUseIDs:HH,screen:G,canAnimate:BH,onOpenRateLimitOptions:Q,lastThinkingBlockId:u,latestBashOutputUUID:y,conversationId:M,screenToggleId:U,columns:Z,isLoading:P,lookups:n})),j&&Y&&i4.createElement(x,{marginTop:1},i4.createElement(R_$,{param:{type:"thinking",thinking:Y.thinking},addMargin:!1,isTranscriptMode:!0,hideInTranscript:!1})))},l1H;var bmH=K(()=>{xH();_L();hx();kgD();OB();e6();r0();_mD();UZA();FG();TLH();vA();TmD();i4=b(s(),1),PC=b(s(),1);l1H=i4.memo(e61,(H,$)=>{let A=Object.keys(H);for(let L of A){if(L==="onOpenRateLimitOptions")continue;if(H[L]!==$[L]){if(L==="streamingToolUses"){let I=H.streamingToolUses,D=$.streamingToolUses;if(I.length===D.length&&I.every((B,f)=>B.contentBlock===D[f]?.contentBlock))continue}if(L==="inProgressToolUseIDs"){if(H31(H.inProgressToolUseIDs,$.inProgressToolUseIDs))continue}if(L==="tools"){let I=H.tools,D=$.tools;if(I.length===D.length&&I.every((B,f)=>B.name===D[f]?.name))continue}return!1}}return!0})});function umH({message:H,bold:$=!1,dimColor:A=!1,subtitle:L}){return $PH.default.createElement(x,{flexDirection:"column"},$PH.default.createElement(x,{flexDirection:"row"},$PH.default.createElement(vD,null),$PH.default.createElement(V,{bold:$,dimColor:A}," ",H)),L&&$PH.default.createElement(V,{dimColor:!0},L))}var $PH;var nyA=K(()=>{xH();JM();$PH=b(s(),1)});function vmD({log:H,onExit:$,onSelect:A}){let[L,I]=s7.default.useState(null),[D,B]=s7.default.useState(!1);s7.default.useEffect(()=>{if(Qz(H))B(!0),cS(H).then((U)=>{I(U),B(!1)});else I(H)},[H]);let f=L??H,E=mM(f)||"",M=vt();BA("confirm:no",$,{context:"Confirmation"});let G=ymD.useCallback(()=>{A(L??H)},[A,L,H]);if(BA("confirm:yes",G,{context:"Confirmation"}),D)return s7.default.createElement(x,{flexDirection:"column",padding:1},s7.default.createElement(umH,{message:"Loading session\u2026"}),s7.default.createElement(V,{dimColor:!0},s7.default.createElement(rA,null,s7.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))));return s7.default.createElement(x,{flexDirection:"column"},s7.default.createElement(l1H,{messages:f.messages,normalizedMessageHistory:[],tools:M,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:E,screen:"transcript",screenToggleId:1,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),s7.default.createElement(x,{flexShrink:0,flexDirection:"column",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",paddingLeft:2},s7.default.createElement(V,null,HLH(f.modified)," \xB7"," ",f.messageCount," messages",f.gitBranch?` \xB7 ${f.gitBranch}`:""),s7.default.createElement(V,{dimColor:!0},s7.default.createElement(rA,null,s7.default.createElement(s$,{shortcut:"Enter",action:"resume"}),s7.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}var s7,ymD;var hmD=K(()=>{xH();Q9();bmH();g7();lB();j0();eB();nyA();rB();$I();s7=b(s(),1),ymD=b(s(),1)});function I31(H,$){if(H===ryA)return ryA.length+gmH;let A=$?Math.min(H.length,$-gmH-ayA):H.length;return Math.max(0,A)+gmH+ayA}function D31(H,$){let A=$-gmH-ayA;if(H.length<=A)return H;if(A<=1)return H.charAt(0);return H.slice(0,A-1)+"\u2026"}function pmD({tabs:H,selectedIndex:$,availableWidth:A,showAllProjects:L=!1}){let I=L?"Resume (All Projects)":"Resume",D=I.length+1,B=Math.max(A31,L31),f=A-D-B-2,E=Math.max(0,Math.min($,H.length-1)),M=Math.max(20,Math.floor(f/2)),G=H.map((C)=>I31(C,M)),U=0,X=H.length;if(G.reduce((C,Y,Z)=>C+Y+(Zf){let C=f-$31,Y=G[E]??0;U=E,X=E+1;while(U>0||X0,q=XU+Y);return i1H.default.createElement(x,{flexDirection:"row",gap:1},i1H.default.createElement(V,{color:"suggestion"},I),F>0&&i1H.default.createElement(V,{dimColor:!0},bmD,F),W.map((C,Y)=>{let q=P[Y]===E,O=C===ryA?C:`#${D31(C,M-gmH)}`;return i1H.default.createElement(V,{key:C,backgroundColor:q?"suggestion":void 0,color:q?"inverseText":void 0,bold:q}," ",O," ")}),Q>0?i1H.default.createElement(V,{dimColor:!0},kmD,Q,umD):i1H.default.createElement(V,{dimColor:!0},gmD))}var i1H,ryA="All",gmH=2,ayA=1,bmD="\u2190 ",kmD="\u2192",umD=" (tab to cycle)",gmD="(tab to cycle)",mmD=2,$31,A31,L31;var dmD=K(()=>{xH();i1H=b(s(),1),$31=bmD.length+mmD+1,A31=kmD.length+mmD+umD.length,L31=gmD.length});function imD(H,$){let A=H.replace(/\s+/g," ").trim();if(A.length<=$)return A;return A.slice(0,$).trim()+"\u2026"}function oyA({before:H,match:$,after:A},L){return oH.dim(H)+L($)+oH.dim(A)}function X31(H,$,A){let L=H.toLowerCase().indexOf($.toLowerCase());if(L===-1)return null;let I=L+$.length,D=Math.max(0,L-A),B=Math.min(H.length,I+A),f=H.slice(D,L),E=H.slice(L,I),M=H.slice(I,B);return{before:(D>0?"\u2026":"")+f.replace(/\s+/g," ").trimStart(),match:E.trim(),after:M.replace(/\s+/g," ").trimEnd()+(B0?B31:I?f31:0,f=L&&D>0?` (+${D} other ${D===1?"session":"sessions"})`:"",E=H.isSidechain?" (sidechain)":"",M=$-B-E.length-f.length;return`${imD(Fl(H),M)}${E}${f}`}function syA(H,$){let{isChild:A=!1,showProjectPath:L=!1}=$||{},I=A?" ":"",D=CzH(H),B=L&&H.projectPath?` \xB7 ${H.projectPath}`:"";return I+D+B}function zT$({logs:H,maxHeight:$=1/0,forceWidth:A,onCancel:L,onSelect:I,onLogsChanged:D,onLoadMore:B,initialSearchQuery:f,showAllProjects:E=!1,onToggleAllProjects:M,onAgenticSearch:G}){let U=QL(),X=A===void 0?U.columns:A,J=zB(L),F=EJ(),Q=Kd(),W=!1,[P]=_I(),C=c6(P),Y=YL.default.useMemo(()=>(IL)=>du(IL,C.warning),[C.warning]),Z=!1,[q,O]=YL.default.useState(null),[j,u]=YL.default.useState(!1),[y,g]=YL.default.useState(!1),[h,p]=YL.default.useState(!1),d=YL.default.useMemo(()=>zL(),[]),[k,n]=YL.default.useState(""),[GH,HH]=YL.default.useState(0),[BH,WH]=YL.default.useState(new Set),[wH,QH]=YL.default.useState(null),[TH,t]=YL.default.useState(1),[IH,KH]=YL.default.useState("list"),[MH,CH]=YL.default.useState(null),OH=YL.default.useRef(null),[LH,e]=YL.default.useState(0),[DH,EH]=YL.default.useState({status:"idle"}),[$H,FH]=YL.default.useState(!1),YH=YL.default.useRef(null),{query:qH,setQuery:bH,cursorOffset:hH}=Eb({isActive:IH==="search"&&DH.status!=="searching",onExit:()=>{KH("list"),c("tengu_session_search_toggled",{enabled:!1})},onExitUp:()=>{KH("list"),c("tengu_session_search_toggled",{enabled:!1})},passthroughCtrlKeys:["n"],initialQuery:f||""}),PH=YL.default.useDeferredValue(qH),[gH,vH]=YL.default.useState("");YL.default.useEffect(()=>{if(!PH){vH("");return}let IL=setTimeout(()=>{vH(PH)},300);return()=>clearTimeout(IL)},[PH]);let[tH,K$]=YL.default.useState(null),[KA,UA]=YL.default.useState(!1);YL.default.useEffect(()=>{vW().then((IL)=>O(IL)),Xd(d).then((IL)=>{p(IL.length>1)})},[d]);let U$=YL.default.useMemo(()=>new Map(H.map((IL)=>[IL,F31(IL)])),[H]),hA=YL.default.useMemo(()=>{return null},[H,U$,!1]),iA=YL.default.useMemo(()=>Q31(H),[H]),rH=iA.length>0,G$=YL.default.useMemo(()=>rH?["All",...iA]:[],[rH,iA]);YL.default.useEffect(()=>{if(G$.length>0&&LH>=G$.length)e(0)},[G$.length,LH]);let b$=G$[LH],ZA=b$==="All"?void 0:b$,n$=rH?1:0,fA=YL.default.useMemo(()=>{let IL=H;if(Q)IL=H.filter((qA)=>{let BB=j$(),WB=mM(qA);if(BB&&WB===BB)return!0;if(qA.customTitle)return!0;if(NT$(qA.messages))return!0;if(qA.firstPrompt||qA.customTitle)return!0;return!1});if(ZA!==void 0)IL=IL.filter((qA)=>qA.tag===ZA);if(j&&q)IL=IL.filter((qA)=>qA.gitBranch===q);if(h&&!y)IL=IL.filter((qA)=>qA.projectPath===d);return IL},[H,Q,ZA,j,q,h,y,d]),UH=YL.default.useMemo(()=>{if(!qH)return fA;let IL=qH.toLowerCase();return fA.filter((qA)=>{let BB=Fl(qA).toLowerCase(),WB=(qA.gitBranch||"").toLowerCase(),GD=(qA.tag||"").toLowerCase(),C9=qA.prNumber?`pr #${qA.prNumber} ${qA.prRepository||""}`.toLowerCase():"";return BB.includes(IL)||WB.includes(IL)||GD.includes(IL)||C9.includes(IL)})},[fA,qH]);YL.default.useEffect(()=>{},[PH,gH,!1]),YL.default.useEffect(()=>{K$(null),UA(!1);return},[gH,hA,!1]);let{filteredLogs:_H,snippets:aH}=YL.default.useMemo(()=>{let IL=new Map,qA=UH;if(tH&&gH&&tH.query===gH){for(let GD of tH.results)if(GD.searchableText){let C9=X31(GD.searchableText,gH,U31);if(C9)IL.set(GD.log,C9)}let BB=new Set(qA.map((GD)=>GD.messages[0]?.uuid)),WB=tH.results.map((GD)=>GD.log).filter((GD)=>!BB.has(GD.messages[0]?.uuid));qA=[...qA,...WB]}return{filteredLogs:qA,snippets:IL}},[UH,tH,gH]),f$=YL.default.useMemo(()=>{if(DH.status==="results"&&DH.results.length>0)return DH.results;return _H},[DH,_H]),I$=Math.max(30,X-4),$$=YL.default.useMemo(()=>{if(!Q)return[];let IL=K31(f$);return Array.from(IL.entries()).map(([qA,BB])=>{let WB=BB[0],GD=f$.indexOf(WB),C9=aH.get(WB),V1=C9?oyA(C9,Y):null;if(BB.length===1){let n8=syA(WB,{showProjectPath:E});return{id:`log:${qA}:0`,value:{log:WB,indexInFiltered:GD},label:tyA(WB,I$),description:V1?`${n8} ${nE}`:C9+V1,dimDescription:!0,value:qA.toString()}})},[Q,f$,Y,I$,E,aH]),x$=wH?.value.log??null,zA=()=>{if(!Q||!x$)return"";let IL=mM(x$);if(!IL)return"";let qA=f$.filter((C9)=>mM(C9)===IL);if(!(qA.length>1))return"";let WB=BH.has(IL);if(qA.indexOf(x$)>0)return"\u2190 to collapse";return WB?"\u2190 to collapse":"\u2192 to expand"},gA=YL.default.useCallback(async()=>{let IL=x$?mM(x$):void 0;if(!x$||!IL){KH("list"),n("");return}if(k.trim()){if(await c1H(IL,k.trim(),x$.fullPath),Q&&D)D()}KH("list"),n("")},[x$,k,D,Q]),HI=YL.default.useCallback(()=>{KH("list"),c("tengu_session_search_toggled",{enabled:!1})},[]),AI=YL.default.useCallback(()=>{KH("search"),c("tengu_session_search_toggled",{enabled:!0})},[]),qB=YL.default.useCallback(async()=>{qH.trim();return},[qH,G,!1,H]);YL.default.useEffect(()=>{if(DH.status!=="idle"&&DH.status!=="searching"){if(DH.status==="results"&&DH.query!==qH||DH.status==="error")EH({status:"idle"})}},[qH,DH]),YL.default.useEffect(()=>{return()=>{YH.current?.abort()}},[]);let RB=YL.default.useRef(DH.status);YL.default.useEffect(()=>{let IL=RB.current;if(RB.current=DH.status,IL==="searching"&&DH.status==="results"){if(Q&&$$.length>0)QH($$[0]);else if(!Q&&f$.length>0){let qA=f$[0];QH({id:"0",value:{log:qA,indexInFiltered:0},label:""})}}},[DH.status,Q,$$,f$]);let sA=YL.default.useCallback((IL)=>{let qA=parseInt(IL,10),BB=f$[qA];if(!BB||OH.current===qA.toString())return;OH.current=qA.toString(),QH({id:qA.toString(),value:{log:BB,indexInFiltered:qA},label:""}),t(qA+1)},[f$]),_D=YL.default.useCallback((IL)=>{QH(IL);let qA=f$.findIndex((BB)=>mM(BB)===mM(IL.value.log));if(qA>=0)t(qA+1)},[f$]);BA("confirm:no",()=>{YH.current?.abort(),EH({status:"idle"}),c("tengu_agentic_search_cancelled",{})},{context:"Confirmation",isActive:IH!=="preview"&&DH.status==="searching"}),BA("confirm:no",()=>{KH("list"),n("")},{context:"Settings",isActive:IH==="rename"&&DH.status!=="searching"}),BA("confirm:no",()=>{bH(""),FH(!1),L?.()},{context:"Confirmation",isActive:IH!=="preview"&&IH!=="rename"&&IH!=="search"&&$H&&DH.status!=="searching"}),WL((IL,qA)=>{if(IH==="preview")return;if(DH.status==="searching")return;if(IH==="rename");else if(IH==="search"){if(IL.toLowerCase()==="n"&&qA.ctrl)HI();else if(qA.return||qA.downArrow)qH.trim()}else{if($H){if(qA.return){qB(),FH(!1);return}else if(qA.downArrow){FH(!1);return}else if(qA.upArrow){KH("search"),FH(!1);return}}if(rH&&qA.tab){let GD=qA.shift?-1:1;e((C9)=>{let V1=(C9+G$.length+GD)%G$.length,G8=G$[V1];return c("tengu_session_tag_filter_changed",{is_all:G8==="All",tag_count:iA.length}),V1});return}let BB=!qA.ctrl&&!qA.meta,WB=IL.toLowerCase();if(WB==="a"&&qA.ctrl&&M)M(),c("tengu_session_all_projects_toggled",{enabled:!E});else if(WB==="b"&&qA.ctrl){let GD=!j;u(GD),c("tengu_session_branch_filter_toggled",{enabled:GD})}else if(WB==="w"&&qA.ctrl&&h){let GD=!y;g(GD),c("tengu_session_worktree_filter_toggled",{enabled:GD})}else if(WB==="/"&&BB)KH("search"),c("tengu_session_search_toggled",{enabled:!0});else if(WB==="r"&&qA.ctrl&&x$)KH("rename"),n(""),c("tengu_session_rename_started",{});else if(WB==="v"&&qA.ctrl&&x$)CH(x$),KH("preview"),c("tengu_session_preview_opened",{messageCount:x$.messageCount});else if(x$&&BB&&IL.length>0&&!/^\s+$/.test(IL))KH("search"),bH(IL),c("tengu_session_search_toggled",{enabled:!0})}},{isActive:!0});let M9=[];if(j&&q)M9.push(q);if(h&&!y)M9.push("current worktree");let QI=8+(M9.length>0&&IH!=="search"?1:0)+n$,DB=2,G9=Math.max(1,Math.floor(($-QI-DB)/3));if(YL.default.useEffect(()=>{if(!B)return;let IL=G9*2;if(TH+IL>=f$.length)B(G9*3)},[TH,G9,f$.length,B]),H.length===0)return null;if(IH==="preview"&&MH&&Q)return YL.default.createElement(vmD,{log:MH,onExit:()=>{KH("list"),CH(null)},onSelect:I});return YL.default.createElement(x,{flexDirection:"column",height:$-1},YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,{color:"suggestion"},"\u2500".repeat(X))),YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,null," ")),rH?YL.default.createElement(pmD,{tabs:G$,selectedIndex:LH,availableWidth:X,showAllProjects:E}):YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,{bold:!0,color:"suggestion"},"Resume Session",IH==="list"&&f$.length>G9&&YL.default.createElement(V,{dimColor:!0}," ","(",TH," of ",f$.length,")"))),YL.default.createElement(fb,{query:qH,isFocused:IH==="search",isTerminalFocused:F,cursorOffset:hH}),M9.length>0&&IH!=="search"&&YL.default.createElement(x,{flexShrink:0,paddingLeft:2},YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,M9))),YL.default.createElement(x,{flexShrink:0},YL.default.createElement(V,null," ")),DH.status==="searching"&&YL.default.createElement(x,{paddingLeft:1,flexShrink:0},YL.default.createElement(vD,null),YL.default.createElement(V,null," Searching\u2026")),DH.status==="results"&&DH.results.length>0&&YL.default.createElement(x,{paddingLeft:1,marginBottom:1,flexShrink:0},YL.default.createElement(V,{dimColor:!0,italic:!0},"Claude found these results:")),DH.status==="results"&&DH.results.length===0&&_H.length===0&&YL.default.createElement(x,{paddingLeft:1,marginBottom:1,flexShrink:0},YL.default.createElement(V,{dimColor:!0,italic:!0},"No matching sessions found.")),DH.status==="error"&&_H.length===0&&YL.default.createElement(x,{paddingLeft:1,marginBottom:1,flexShrink:0},YL.default.createElement(V,{dimColor:!0,italic:!0},"No matching sessions found.")),Boolean(qH.trim())&&G&&!1,DH.status==="searching"?null:IH==="rename"&&x$?YL.default.createElement(x,{paddingLeft:2,flexDirection:"column"},YL.default.createElement(V,{bold:!0},"Rename session:"),YL.default.createElement(x,{paddingTop:1},YL.default.createElement(W9,{value:k,onChange:n,onSubmit:gA,placeholder:Fl(x$,"Enter new session name"),columns:X,cursorOffset:GH,onChangeCursorOffset:HH,showCursor:!0}))):Q?YL.default.createElement(wgD,{nodes:$$,onSelect:(IL)=>{I(IL.value.log)},onFocus:_D,onCancel:L,focusNodeId:wH?.id,visibleOptionCount:G9,layout:"expanded",isDisabled:IH==="search"||$H,hideIndexes:!1,isNodeExpanded:(IL)=>{if(IH==="search"||j)return!0;let qA=typeof IL==="string"&&IL.startsWith("group:")?IL.substring(6):null;return qA?BH.has(qA):!1},onExpand:(IL)=>{let qA=typeof IL==="string"&&IL.startsWith("group:")?IL.substring(6):null;if(qA)WH((BB)=>new Set([...BB,qA])),c("tengu_session_group_expanded",{})},onCollapse:(IL)=>{let qA=typeof IL==="string"&&IL.startsWith("group:")?IL.substring(6):null;if(qA)WH((BB)=>{let WB=new Set(BB);return WB.delete(qA),WB})},onUpFromFirstItem:AI}):YL.default.createElement(QA,{options:e$,onChange:(IL)=>{let qA=parseInt(IL,10),BB=f$[qA];if(BB)I(BB)},visibleOptionCount:G9,onCancel:L,onFocus:sA,defaultFocusValue:wH?.id.toString(),layout:"expanded",isDisabled:IH==="search"||$H,onUpFromFirstItem:AI}),YL.default.createElement(x,{paddingLeft:2},J.pending?YL.default.createElement(V,{dimColor:!0},"Press ",J.keyName," again to exit"):IH==="rename"?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(s$,{shortcut:"Enter",action:"save"}),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))):DH.status==="searching"?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(V,null,"Searching with Claude\u2026"),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))):$H?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(s$,{shortcut:"Enter",action:"search"}),YL.default.createElement(s$,{shortcut:"\u2193",action:"skip"}),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))):IH==="search"?YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,YL.default.createElement(V,null,"Type to Search"),YL.default.createElement(s$,{shortcut:"Enter",action:"select"}),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"clear"}))):YL.default.createElement(V,{dimColor:!0},YL.default.createElement(rA,null,M&&YL.default.createElement(s$,{shortcut:"Ctrl+A",action:`show ${E?"current dir":"all projects"}`}),q&&YL.default.createElement(s$,{shortcut:"Ctrl+B",action:"toggle branch"}),h&&YL.default.createElement(s$,{shortcut:"Ctrl+W",action:`show ${y?"current worktree":"all worktrees"}`}),YL.default.createElement(s$,{shortcut:"Ctrl+V",action:"preview"}),YL.default.createElement(s$,{shortcut:"Ctrl+R",action:"rename"}),YL.default.createElement(V,null,"Type to search"),YL.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}),zA()&&YL.default.createElement(V,null,zA())))))}function J31(H){if(H.type!=="user"&&H.type!=="assistant")return"";let $="message"in H?H.message?.content:void 0;if(!$)return"";if(typeof $==="string")return $;if(Array.isArray($))return $.map((A)=>{if(typeof A==="string")return A;if("text"in A&&typeof A.text==="string")return A.text;return""}).filter(Boolean).join(" ");return""}function F31(H){let A=(H.messages.length<=E31?H.messages:[...H.messages.slice(0,cmD),...H.messages.slice(-cmD)]).map(J31).filter(Boolean).join(" "),I=`${[H.customTitle,H.summary,H.firstPrompt,H.gitBranch,H.tag,H.prNumber?`PR #${H.prNumber}`:void 0,H.prRepository].filter(Boolean).join(" ")} ${A}`.trim();return I.length>lmD?I.slice(0,lmD):I}function K31(H){let $=new Map;for(let A of H){let L=mM(A);if(L){let I=$.get(L);if(I)I.push(A);else $.set(L,[A])}}return $.forEach((A)=>A.sort((L,I)=>new Date(I.modified).getTime()-new Date(L.modified).getTime())),$}function Q31(H){let $=new Set;for(let A of H)if(A.tag)$.add(A.tag);return Array.from($).sort((A,L)=>A.localeCompare(L))}var YL,B31=2,f31=4,E31=2000,cmD=1000,lmD=50000,M31=0.3,G31=60000,U31=50;var eyA=K(()=>{zgH();r0();xH();$I();Ky();Cn();JM();OB();rB();Q9();N1();ZgD();UM();t8();qmH();g$();S5();rB();g$();z$();hmD();_$();eB();lB();j0();dmD();VVH();PVH();YL=b(s(),1)});function OT$(H,$,A){let L=zL();if(!$||!H.projectPath||H.projectPath===L)return{isCrossProject:!1};{let f=mM(H);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${wI([H.projectPath])} && claude --resume ${f}`,projectPath:H.projectPath}}if(A.some((f)=>H.projectPath===f||H.projectPath.startsWith(f+"/")))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:H.projectPath};let D=mM(H);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${wI([H.projectPath])} && claude --resume ${D}`,projectPath:H.projectPath}}var HvA=K(()=>{g$();rB();EX()});function V31(H){if(H.type!=="user"&&H.type!=="assistant")return"";let $="message"in H?H.message?.content:void 0;if(!$)return"";if(typeof $==="string")return $;if(Array.isArray($))return $.map((A)=>{if(typeof A==="string")return A;if("text"in A&&typeof A.text==="string")return A.text;return""}).filter(Boolean).join(" ");return""}function amD(H){if(H.length===0)return"";let A=(H.length<=$vA?H:[...H.slice(0,$vA/2),...H.slice(-$vA/2)]).map(V31).filter(Boolean).join(" ").replace(/\s+/g," ").trim();return A.length>nmD?A.slice(0,nmD)+"\u2026":A}function rmD(H,$){if(Fl(H).toLowerCase().includes($))return!0;if(H.customTitle?.toLowerCase().includes($))return!0;if(H.tag?.toLowerCase().includes($))return!0;if(H.gitBranch?.toLowerCase().includes($))return!0;if(H.summary?.toLowerCase().includes($))return!0;if(H.firstPrompt?.toLowerCase().includes($))return!0;if(H.messages&&H.messages.length>0){if(amD(H.messages).toLowerCase().includes($))return!0}return!1}async function xT$(H,$,A){if(!H.trim()||$.length===0)return[];let L=H.toLowerCase(),I=$.filter((G)=>rmD(G,L)),D;if(I.length>=AvA)D=I.slice(0,AvA);else{let G=$.filter((X)=>!rmD(X,L)),U=AvA-I.length;D=[...I,...G.slice(0,U)]}N(`Agentic search: ${D.length}/${$.length} logs, query="${H}", matching: ${I.length}, with messages: ${D.filter((G)=>G.messages?.length>0).length}`);let B=D.map(async(G)=>{if(Qz(G))try{return await cS(G)}catch(U){return r(U),G}return G}),f=await Promise.all(B);N(`Agentic search: loaded ${f.filter((G)=>G.messages?.length>0).length}/${D.length} logs with transcripts`);let M=`Sessions: `}]}})});var ApD={};XA(ApD,{call:()=>w31});function C31({onDone:H}){let $=J$((B)=>B.remoteSessionUrl),[A,L]=RT$.useState("");if(RT$.useEffect(()=>{if(!$)return;let B=$;async function f(){let E=await $pD.toString(B,{type:"utf8",errorCorrectionLevel:"L"});L(E)}f().catch((E)=>{N("QR code generation failed",E)})},[$]),BA("confirm:no",H,{context:"Confirmation"}),!$)return WM.createElement(x,{flexDirection:"column",paddingX:2},WM.createElement(V,{color:"warning"},"Not in remote mode. Start with `claude --remote` to use this command."),WM.createElement(V,{dimColor:!0},"(press esc to close)"));let I=A.split(` `).filter((B)=>B.length>0),D=I.length===0;return WM.createElement(x,{flexDirection:"column",paddingX:2},WM.createElement(x,{marginBottom:1},WM.createElement(V,{bold:!0},"Remote session")),D?WM.createElement(V,{dimColor:!0},"Generating QR code\u2026"):I.map((B,f)=>WM.createElement(V,{key:f},B)),WM.createElement(x,{marginTop:1},WM.createElement(V,{dimColor:!0},"Open in browser: "),WM.createElement(V,{color:"ide"},$)),WM.createElement(x,{marginTop:1},WM.createElement(V,{dimColor:!0},"(press esc to close)")))}var WM,RT$,$pD,w31=async(H)=>{return WM.createElement(C31,{onDone:H})};var LpD=K(()=>{xH();pL();E$();$I();WM=b(s(),1),RT$=b(s(),1),$pD=b(OyA(),1)});var Z31,BvA;var IpD=K(()=>{g$();Z31={type:"local-jsx",name:"session",aliases:["remote"],description:"Show remote session URL and QR code",isEnabled:()=>ZHH(),get isHidden(){return!ZHH()},load:()=>Promise.resolve().then(() => (LpD(),ApD)),userFacingName(){return"session"}},BvA=Z31});var DpD=()=>{};function q31(H){if(H==="plugin")return"Plugin skills";return`${Fk(Vl(H))} skills`}function BpD({onExit:H,commands:$}){let A=fvA.useMemo(()=>{return $.filter((f)=>f.type==="prompt"&&(f.loadedFrom==="skills"||f.loadedFrom==="commands_DEPRECATED"||f.loadedFrom==="plugin"))},[$]),L=fvA.useMemo(()=>{let f={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[]};for(let E of A){let M=E.source;if(M in f)f[M].push(E)}for(let E of Object.values(f))E.sort((M,G)=>R6H(G)-R6H(M));return f},[A]),I=()=>{H("Skills dialog dismissed",{display:"system"})};if(A.length===0)return PE.createElement(BL,{title:"Skills",subtitle:"No skills found",onCancel:I,hideInputGuide:!0},PE.createElement(V,{dimColor:!0},"Create skills in .claude/skills/ or ~/.claude/skills/"),PE.createElement(V,{dimColor:!0,italic:!0},PE.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"close"})));let D=(f)=>{let E=R6H(f),M=H_I(E),G=f.source==="plugin"?f.pluginInfo?.pluginManifest.name:void 0;return PE.createElement(x,{key:`${f.name}-${f.source}`},PE.createElement(V,null,f.userFacingName()),PE.createElement(V,{dimColor:!0},G?` \xB7 ${G}`:""," \xB7 ",M," description tokens"))},B=(f)=>{let E=L[f];if(E.length===0)return null;let M=q31(f),G=V9(Tt(f,"skills")),U=V9(Tt(f,"commands")),X=E.some((J)=>J.loadedFrom==="commands_DEPRECATED");return PE.createElement(x,{flexDirection:"column",key:f},PE.createElement(x,null,PE.createElement(V,{bold:!0,dimColor:!0},M),G&&PE.createElement(V,{dimColor:!0}," ","(",G,X&&U?`, ${U}`:"",")")),E.map((J)=>D(J)))};return PE.createElement(BL,{title:"Skills",subtitle:`${A.length} skill${A.length===1?"":"s"}`,onCancel:I,hideInputGuide:!0},PE.createElement(x,{flexDirection:"column",gap:1},B("projectSettings"),B("userSettings"),B("policySettings"),B("plugin")),PE.createElement(V,{dimColor:!0,italic:!0},PE.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"close"})))}var PE,fvA;var fpD=K(()=>{xH();eYH();bB();j0();W4();$3();rD();zt();PE=b(s(),1),fvA=b(s(),1)});var EpD={};XA(EpD,{call:()=>T31});async function T31(H,$){return EvA.createElement(BpD,{onExit:H,commands:$.options.commands})}var EvA;var MpD=K(()=>{fpD();EvA=b(s(),1)});var z31,GpD;var UpD=K(()=>{z31={type:"local-jsx",name:"skills",description:"List available skills",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (MpD(),EpD)),userFacingName(){return"skills"}},GpD=z31});var XpD={};XA(XpD,{call:()=>N31});async function N31(H,$){return MvA.createElement(YVH,{onClose:H,context:$,defaultTab:"Status"})}var MvA;var JpD=K(()=>{Wq$();MvA=b(s(),1)});var O31,FpD;var KpD=K(()=>{O31={type:"local-jsx",name:"status",description:"Show Claude Code status including version, model, account, API connectivity, and tool statuses",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (JpD(),XpD)),userFacingName(){return"status"}},FpD=O31});function QpD({shell:H,onDone:$,onKillShell:A,onBack:L}){let{columns:I}=QL(),[D,B]=pmH.useState(0),[f,E]=pmH.useState({stdout:"",stdoutLines:0}),M=()=>$("Shell details dismissed",{display:"system"});bI({"confirm:yes":M},{context:"Confirmation"}),WL((X,J)=>{if(X===" ")$("Shell details dismissed",{display:"system"});else if(J.leftArrow&&L)L();else if(X==="k"&&H.status==="running"&&A)A()});let G=(X)=>{let J=Math.floor((Date.now()-X)/1000),F=Math.floor(J/3600),Q=Math.floor((J-F*3600)/60),W=J-F*3600-Q*60;return`${F>0?`${F}h `:""}${Q>0||F>0?`${Q}m `:""}${W}s`};pmH.useEffect(()=>{let X=WF$(H.id),{totalLines:J,truncatedContent:F}=Mw$(X);if(E({stdout:F,stdoutLines:J}),H.status==="running"){let Q=setTimeout(()=>{B((W)=>W+1)},1000);return()=>clearTimeout(Q)}},[H.id,H.status,D]);let U=H.command.length>280?H.command.substring(0,277)+"\u2026":H.command;return L4.default.createElement(BL,{title:"Shell details",onCancel:M,color:"background",borderDimColor:!1,inputGuide:(X)=>X.pending?L4.default.createElement(V,null,"Press ",X.keyName," again to exit"):L4.default.createElement(rA,null,L&&L4.default.createElement(s$,{shortcut:"\u2190",action:"go back"}),L4.default.createElement(s$,{shortcut:"Esc/Enter/Space",action:"close"}),H.status==="running"&&A&&L4.default.createElement(s$,{shortcut:"k",action:"kill"}))},L4.default.createElement(x,{flexDirection:"column"},L4.default.createElement(V,null,L4.default.createElement(V,{bold:!0},"Status:")," ",H.status==="running"?L4.default.createElement(V,{color:"background"},H.status,H.result?.code!==void 0&&` (exit code: ${H.result.code})`):H.status==="completed"?L4.default.createElement(V,{color:"success"},H.status,H.result?.code!==void 0&&` (exit code: ${H.result.code})`):L4.default.createElement(V,{color:"error"},H.status,H.result?.code!==void 0&&` (exit code: ${H.result.code})`)),L4.default.createElement(V,null,L4.default.createElement(V,{bold:!0},"Runtime:")," ",G(H.startTime)),L4.default.createElement(V,{wrap:"wrap"},L4.default.createElement(V,{bold:!0},"Command:")," ",U)),L4.default.createElement(x,{flexDirection:"column"},L4.default.createElement(V,{bold:!0},"Output:"),f.stdout?L4.default.createElement(L4.default.Fragment,null,L4.default.createElement(x,{borderStyle:"round",borderDimColor:!0,paddingX:1,flexDirection:"column",height:12,maxWidth:I-6},f.stdout.split(` Your final reply must contain the markdown report and nothing else.`,mpD;var ppD=K(()=>{qKH();Vu();Vm();yE();mpD=tVH({name:"security-review",description:"Complete a security review of the pending changes on the current branch",progressMessage:"analyzing code changes for security risks",pluginName:"security-review",pluginCommand:"security-review",async getPromptWhileMarketplaceIsPrivate(H,$){yD("security-review");let A=MK(d31),L=xx(A.frontmatter["allowed-tools"]);return[{type:"text",text:await Qa(A.content,{...$,async getAppState(){let D=await $.getAppState();return{...D,toolPermissionContext:{...D.toolPermissionContext,alwaysAllowRules:{...D.toolPermissionContext.alwaysAllowRules,command:L}}}}},"security-review")}]}})});var dpD={};XA(dpD,{call:()=>c31});var FvA,c31=async(H,$)=>{return FvA.createElement(YVH,{onClose:H,context:$,defaultTab:"Usage"})};var cpD=K(()=>{Wq$();FvA=b(s(),1)});var KvA;var lpD=K(()=>{KvA={type:"local-jsx",name:"usage",description:"Show plan usage limits",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (cpD(),dpD)),userFacingName(){return"usage"}}});var ipD={};XA(ipD,{call:()=>i31});function l31({onDone:H}){let[$,A]=_I();return Wd.createElement(x,{flexDirection:"column"},Wd.createElement(Uf,{dividerColor:"permission",dividerDimColor:!0}),Wd.createElement(QVH,{initialTheme:$,onThemeSelect:(L)=>{A(L),H(`Theme set to ${L}`)},onCancel:()=>{H("Theme picker dismissed",{display:"system"})},skipExitHandling:!0}))}var Wd,i31=async(H,$)=>{return Wd.createElement(l31,{onDone:H})};var npD=K(()=>{xH();Mq$();e6();Wd=b(s(),1)});var n31,QvA;var rpD=K(()=>{n31={type:"local-jsx",name:"theme",description:"Change the theme",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (npD(),ipD)),userFacingName(){return"theme"}},QvA=n31});var apD={};XA(apD,{call:()=>r31});var r31=async()=>{yD("vim-mode");let $=M$().editorMode||"normal";if($==="emacs")$="normal";let A=$==="normal"?"vim":"normal";return AA((L)=>({...L,editorMode:A})),c("tengu_editor_mode_changed",{mode:A,source:"command"}),{type:"text",value:`Editor mode set to ${A}. ${A==="vim"?"Use Escape key to toggle between INSERT and NORMAL modes.":"Using standard (readline) keyboard bindings."}`}};var opD=K(()=>{vA();z$();yE()});var a31,WvA;var tpD=K(()=>{a31={name:"vim",description:"Toggle between Vim and Normal editing modes",isEnabled:()=>!0,isHidden:!1,supportsNonInteractive:!1,type:"local",userFacingName:()=>"vim",load:()=>Promise.resolve().then(() => (opD(),apD))},WvA=a31});var VvA,r1H="claude-plugins-official";var hT$=K(()=>{VvA={source:"github",repo:"anthropics/claude-plugins-official"}});var $dD={};XA($dD,{playAnimation:()=>bT$,call:()=>fV1});function epD(){return r1H}function t31(){return o31}function HdD(){return`thinkback@${epD()}`}async function e31(){let{enabled:H}=await xf(),$=H.find((L)=>L.name==="thinkback"||L.source&&L.source.includes(HdD()));if(!$)return null;let A=IPH.join($.path,"skills",s31);if(DPH.existsSync(A))return A;return null}async function HV1(){return e31()}function bT$(H){let $=IPH.join(H,"player.js");if(!DPH.existsSync($))return{success:!1,message:"Player script not found. The player.js file is missing from the thinkback skill."};let A=qO.get(process.stdout);if(!A)return{success:!1,message:"Failed to access terminal instance"};try{A.pause(),A.suspendStdin(),process.stdout.write("\x1B[?1049h\x1B[?1004l\x1B[0m\x1B[?25l\x1B[2J\x1B[H"),spD.execFileSync("node",[$],{stdio:"inherit",cwd:H})}catch{}finally{process.stdout.write("\x1B[?1049l\x1B[?1004h\x1B[?25l"),A.resumeStdin(),A.resume()}let L=IPH.join(H,"year_in_review.html");if(DPH.existsSync(L)){let I=oA();jA(I==="macos"?"open":I==="windows"?"start":"xdg-open",[L])}return{success:!0,message:"Year in review animation complete!"}}function $V1({onReady:H,onError:$}){let[A,L]=_C.useState({phase:"checking"}),[I,D]=_C.useState("");if(_C.useEffect(()=>{async function f(){try{let E=await l1(),M=epD(),G=t31(),U=HdD(),X=M in E,J=K7(U);if(!X)L({phase:"installing-marketplace"}),N(`Installing marketplace ${G}`),await uw({source:"github",repo:G},(F)=>{D(F)}),SG(),N(`Marketplace ${M} installed`);else if(!J)L({phase:"installing-marketplace"}),D("Updating marketplace\u2026"),N(`Refreshing marketplace ${M}`),await gt(M,(F)=>{D(F)}),X3H(),SG(),N(`Marketplace ${M} refreshed`);if(!J){L({phase:"installing-plugin"}),N(`Installing plugin ${U}`);let F=await jRA([U]);if(F.failed.length>0){let Q=F.failed.map((W)=>`${W.name}: ${W.error}`).join(", ");throw Error(`Failed to install plugin: ${Q}`)}SG(),N(`Plugin ${U} installed`)}else{let{disabled:F}=await xf();if(F.some((W)=>W.name==="thinkback"||W.source?.includes(U))){L({phase:"enabling-plugin"}),N(`Enabling plugin ${U}`);let W=await R1H(U);if(!W.success)throw Error(`Failed to enable plugin: ${W.message}`);SG(),N(`Plugin ${U} enabled`)}}L({phase:"ready"}),H()}catch(E){let M=E instanceof Error?E:Error(String(E));r(M),L({phase:"error",message:M.message}),$(M.message)}}f()},[H,$]),A.phase==="error")return L1.createElement(x,{flexDirection:"column"},L1.createElement(V,{color:"error"},"Error: ",A.message));if(A.phase==="ready")return null;let B=A.phase==="checking"?"Checking thinkback installation\u2026":A.phase==="installing-marketplace"?"Installing marketplace\u2026":A.phase==="enabling-plugin"?"Enabling thinkback plugin\u2026":"Installing thinkback plugin\u2026";return L1.createElement(x,{flexDirection:"column"},L1.createElement(x,null,L1.createElement(vD,null),L1.createElement(V,null,I||B)))}function AV1({onDone:H,onAction:$,skillDir:A}){let[L,I]=_C.useState(!1),D=IPH.join(A,"year_in_review.js"),B=DPH.existsSync(D),f=B?[{label:"Play animation",value:"play",description:"Watch your year in review"},{label:"Edit content",value:"edit",description:"Modify the animation"},{label:"Fix errors",value:"fix",description:"Fix validation or rendering issues"},{label:"Regenerate",value:"regenerate",description:"Create a new animation from scratch"}]:[{label:"Let's go!",value:"regenerate",description:"Generate your personalized animation"}];function E(G){if(I(!0),G==="play")bT$(A),H(void 0,{display:"skip"});else $(G)}function M(){H(void 0,{display:"skip"})}if(L)return null;return L1.createElement(BL,{title:"Think Back on 2025 with Claude Code",subtitle:"Generate your 2025 Claude Code Think Back (takes a few minutes to run)",onCancel:M,color:"claude",borderDimColor:!1},L1.createElement(x,{flexDirection:"column",gap:1},!B&&L1.createElement(x,{flexDirection:"column"},L1.createElement(V,null,"Relive your year of coding with Claude."),L1.createElement(V,{dimColor:!0},"We'll create a personalized ASCII animation celebrating your journey.")),L1.createElement(QA,{options:f,onChange:E,visibleOptionCount:5})))}function BV1({onDone:H}){let[$,A]=_C.useState(!1),[L,I]=_C.useState(null),[D,B]=_C.useState(null),[f,E]=_C.useState(null);function M(){A(!0)}let G=_C.useCallback((X)=>{I(X),H(`Error with thinkback: ${X}. Try running /plugin to manually install the think-back plugin.`,{display:"system"})},[H]);_C.useEffect(()=>{if($&&!D&&!L)HV1().then((X)=>{if(X)N(`Thinkback skill directory: ${X}`),B(X);else G("Could not find thinkback skill directory")})},[$,D,L,G]),_C.useEffect(()=>{if(!D)return;let X=IPH.join(D,"year_in_review.js"),J=DPH.existsSync(X);N(`Checking for ${X}: ${J?"found":"not found"}`),E(J)},[D]);function U(X){H({edit:LV1,fix:IV1,regenerate:DV1}[X],{display:"user",shouldQuery:!0})}if(L)return L1.createElement(x,{flexDirection:"column"},L1.createElement(V,{color:"error"},"Error: ",L),L1.createElement(V,{dimColor:!0},"Try running /plugin to manually install the think-back plugin."));if(!$)return L1.createElement($V1,{onReady:M,onError:G});if(!D||f===null)return L1.createElement(x,null,L1.createElement(vD,null),L1.createElement(V,null,"Loading thinkback skill\u2026"));return L1.createElement(AV1,{onDone:H,onAction:U,skillDir:D})}async function fV1(H){return L1.createElement(BV1,{onDone:H})}var L1,_C,spD,IPH,DPH,o31="anthropics/claude-plugins-official",s31="thinkback",LV1='Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Claude Code year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.',IV1='Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Claude Code year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.',DV1='Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Claude Code year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.';var PvA=K(()=>{xH();bB();d5H();Z9();B0();N1();y4();Q7();uVH();_X();pVH();Vz();JM();E$();_$();hT$();L1=b(s(),1),_C=b(s(),1),spD=require("child_process"),IPH=require("path"),DPH=require("fs")});var EV1,AdD;var LdD=K(()=>{SD();EV1={type:"local-jsx",name:"think-back",description:"Your 2025 Claude Code Year in Review",isEnabled:()=>cf("tengu_thinkback"),isHidden:!1,load:()=>Promise.resolve().then(() => (PvA(),$dD)),userFacingName(){return"think-back"}},AdD=EV1});var DdD={};XA(DdD,{call:()=>UV1});function GV1(){return`thinkback@${r1H}`}async function UV1(){let H=F7(),$=GV1(),A=H.plugins[$];if(!A||A.length===0)return{type:"text",value:"Thinkback plugin not installed. Run /think-back first to install it."};let L=A[0];if(!L?.installPath)return{type:"text",value:"Thinkback plugin installation path not found."};let I=_vA.join(L.installPath,"skills",MV1),D=_vA.join(I,"year_in_review.js");if(!IdD.existsSync(D))return{type:"text",value:"No animation found. Run /think-back first to generate one."};return{type:"text",value:bT$(I).message}}var _vA,IdD,MV1="thinkback";var BdD=K(()=>{PvA();Q7();hT$();_vA=require("path"),IdD=require("fs")});var XV1,fdD;var EdD=K(()=>{SD();XV1={type:"local",name:"thinkback-play",description:"Play the thinkback animation",isEnabled:()=>cf("tengu_thinkback"),isHidden:!0,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (BdD(),DdD)),userFacingName(){return"thinkback-play"}},fdD=XV1});function MdD({onCancel:H,onSubmit:$,ruleBehavior:A}){let[L,I]=YvA.useState(""),[D,B]=YvA.useState(0),f=zB();BA("confirm:no",H,{context:"Settings"});let{columns:E}=QL(),M=E-6,G=(U)=>{let X=U.trim();if(X.length===0)return;let J=T6(X);$(J,A)};return IE.createElement(IE.Fragment,null,IE.createElement(x,{flexDirection:"column",gap:1,borderStyle:"round",paddingLeft:1,paddingRight:1,borderColor:"permission"},IE.createElement(V,{bold:!0,color:"permission"},"Add ",A," permission rule"),IE.createElement(x,{flexDirection:"column"},IE.createElement(V,null,"Permission rules are a tool name, optionally followed by a specifier in parentheses.",IE.createElement(_K,null),"e.g.,"," ",IE.createElement(V,{bold:!0},X8({toolName:IW.name})),IE.createElement(V,{bold:!1}," or "),IE.createElement(V,{bold:!0},X8({toolName:aD.name,ruleContent:"ls:*"}))),IE.createElement(x,{borderDimColor:!0,borderStyle:"round",marginY:1,paddingLeft:1},IE.createElement(W9,{showCursor:!0,value:L,onChange:I,onSubmit:G,placeholder:`Enter permission rule${pH.ellipsis}`,columns:M,cursorOffset:D,onChangeCursorOffset:B})))),IE.createElement(x,{marginLeft:3},f.pending?IE.createElement(V,{dimColor:!0},"Press ",f.keyName," again to exit"):IE.createElement(V,{dimColor:!0},"Enter to submit \xB7 Esc to cancel")))}var IE,YvA;var GdD=K(()=>{xH();$I();UM();OB();s6H();zQ();S5();jI();IE=b(s(),1),YvA=b(s(),1)});function XdD({onExit:H,getToolPermissionContext:$,onRequestAddDirectory:A,onRequestRemoveDirectory:L}){let I=$(),D=YC.useMemo(()=>{return Array.from(I.additionalWorkingDirectories.keys()).map((E)=>({path:E,isCurrent:!1,isDeletable:!0}))},[I.additionalWorkingDirectories]),B=UdD.useCallback((E)=>{if(E==="add-directory"){A();return}let M=D.find((G)=>G.path===E);if(M&&M.isDeletable)L(M.path)},[D,A,L]),f=YC.useMemo(()=>{let E=D.map((M)=>({label:M.path,value:M.path}));return E.push({label:`Add directory${pH.ellipsis}`,value:"add-directory"}),E},[D]);return YC.createElement(x,{flexDirection:"column",marginBottom:1},YC.createElement(x,{flexDirection:"row",marginTop:1,marginLeft:2,gap:1},YC.createElement(V,null,`- ${zL()}`),YC.createElement(V,{dimColor:!0},"(Original working directory)")),YC.createElement(QA,{options:f,onChange:B,onCancel:()=>H("Workspace dialog dismissed",{display:"system"}),visibleOptionCount:Math.min(10,f.length)}))}var YC,UdD;var JdD=K(()=>{xH();N1();jI();g$();YC=b(s(),1),UdD=b(s(),1)});function FdD({directoryPath:H,onRemove:$,onCancel:A,permissionContext:L,setPermissionContext:I}){let D=zB();BA("confirm:no",A,{context:"Confirmation"});let B=CvA.useCallback(()=>{let E=OM(L,{type:"removeDirectories",directories:[H],destination:"session"});I(E),$()},[H,L,I,$]),f=CvA.useCallback((E)=>{if(E==="yes")B();else A()},[B,A]);return _U.createElement(_U.Fragment,null,_U.createElement(x,{flexDirection:"column",borderStyle:"round",paddingLeft:1,paddingRight:1,borderColor:"error"},_U.createElement(V,{bold:!0,color:"error"},"Remove directory from workspace?"),_U.createElement(x,{marginY:1,marginX:2,flexDirection:"column"},_U.createElement(V,{bold:!0},H)),_U.createElement(V,null,"Claude Code will no longer have access to files in this directory."),_U.createElement(x,{marginY:1},_U.createElement(QA,{onChange:f,onCancel:A,options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]}))),_U.createElement(x,{marginLeft:3},D.pending?_U.createElement(V,{dimColor:!0},"Press ",D.keyName," again to exit"):_U.createElement(V,{dimColor:!0},"\u2191/\u2193 to select \xB7 Enter to confirm \xB7 Esc to cancel")))}var _U,CvA;var KdD=K(()=>{xH();UM();$I();N1();C5();_U=b(s(),1),CvA=b(s(),1)});function JV1({rule:H}){return bL.createElement(V,{dimColor:!0},`From ${vSH(H.source)}`)}function FV1(H){switch(H){case"allow":return"allowed";case"deny":return"denied";case"ask":return"ask"}}function KV1({rule:H,onDelete:$,onCancel:A}){let L=zB();BA("confirm:no",A,{context:"Confirmation"});let I=bL.createElement(x,{flexDirection:"column",marginX:2},bL.createElement(V,{bold:!0},X8(H.ruleValue)),bL.createElement(C4$,{ruleValue:H.ruleValue}),bL.createElement(JV1,{rule:H})),D=bL.createElement(x,{marginLeft:3},L.pending?bL.createElement(V,{dimColor:!0},"Press ",L.keyName," again to exit"):bL.createElement(V,{dimColor:!0},"Esc to cancel"));if(H.source==="policySettings")return bL.createElement(bL.Fragment,null,bL.createElement(x,{flexDirection:"column",gap:1,borderStyle:"round",paddingLeft:1,paddingRight:1,borderColor:"permission"},bL.createElement(V,{bold:!0,color:"permission"},"Rule details"),I,bL.createElement(V,{italic:!0},"This rule is configured by managed settings and cannot be modified.",` `));else H("Permissions dialog dismissed",{display:"system"})},lastFocusedRuleKey:M,onUpFromFirstItem:()=>Z(!0),cursorOffset:d})}return bL.createElement(x,{flexDirection:"column",flexShrink:0},bL.createElement(Zz,{title:"Permissions:",color:"permission",defaultTab:$,hidden:!!f||!!U||!!J||Q||!!P,disableNavigation:Y},bL.createElement(WU,{id:"allow",title:"Allow"},bL.createElement(x,{flexDirection:"column",flexShrink:0},bL.createElement(V,null,wH("allow")),QH("allow"))),bL.createElement(WU,{id:"ask",title:"Ask"},bL.createElement(x,{flexDirection:"column"},bL.createElement(V,null,wH("ask")),QH("ask"))),bL.createElement(WU,{id:"deny",title:"Deny"},bL.createElement(x,{flexDirection:"column"},bL.createElement(V,null,wH("deny")),QH("deny"))),bL.createElement(WU,{id:"workspace",title:"Workspace"},bL.createElement(x,{flexDirection:"column"},bL.createElement(V,null,wH("workspace")),QH("workspace")))),bL.createElement(x,{marginTop:1,paddingLeft:1},bL.createElement(V,{dimColor:!0},y.pending?bL.createElement(bL.Fragment,null,"Press ",y.keyName," again to exit"):bL.createElement(bL.Fragment,null,"Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Type to search \xB7 Esc to cancel"))))}var bL,dF;var WdD=K(()=>{xH();$I();N1();UM();XJ();jI();S5A();q4$();GdD();r0();JdD();rSA();KdD();C5();pL();J1H();VVH();PVH();Z$();bL=b(s(),1),dF=b(s(),1)});var PdD={};XA(PdD,{call:()=>WV1});var wvA,WV1=async(H)=>{return wvA.createElement(QdD,{onExit:H})};var _dD=K(()=>{WdD();wvA=b(s(),1)});var VV1,YdD;var CdD=K(()=>{VV1={type:"local-jsx",name:"permissions",aliases:["allowed-tools"],description:"Manage allow & deny tool permission rules",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (_dD(),PdD)),userFacingName(){return"permissions"}},YdD=VV1});var wdD={};XA(wdD,{call:()=>_V1});function PV1({planContent:H,planPath:$,editorName:A}){return vJ.createElement(x,{flexDirection:"column"},vJ.createElement(V,{bold:!0},"Current Plan"),vJ.createElement(V,{dimColor:!0},$),vJ.createElement(x,{marginTop:1},vJ.createElement(V,null,H)),A&&vJ.createElement(x,{marginTop:1},vJ.createElement(V,{dimColor:!0},'"/plan open"'),vJ.createElement(V,{dimColor:!0}," to edit this plan in "),vJ.createElement(V,{bold:!0,dimColor:!0},A)))}async function _V1(H,$,A){let{getAppState:L,setAppState:I}=$,B=(await L()).toolPermissionContext.mode;if(B!=="plan")return _N(B,"plan"),I((F)=>({...F,toolPermissionContext:OM(F.toolPermissionContext,{type:"setMode",mode:"plan",destination:"session"})})),H("Enabled plan mode"),null;let f=uQ(),E=VP();if(!f)return H("Already in plan mode. No plan written yet."),null;if(A.trim().split(/\s+/)[0]==="open")try{return await Mb(E),H(`Opened plan in editor: ${E}`),null}catch(F){return H(`Failed to open plan in editor: ${F}`),null}let G=Bj(),U=G?PX(G):void 0,J=await CVH(vJ.createElement(PV1,{planContent:f,planPath:E,editorName:U}));return H(J),null}var vJ;var ZdD=K(()=>{xH();gQ();Gb();nU();agH();C5();g$();vJ=b(s(),1)});var YV1,ZvA;var qdD=K(()=>{YV1={type:"local-jsx",name:"plan",description:"Enable plan mode or view the current session plan",argumentHint:"[open]",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (ZdD(),wdD)),userFacingName(){return"plan"}},ZvA=YV1});function TdD({cooldown:H}){if(H)return nmH.createElement(V,{color:"promptBorder",dimColor:!0},Ey);return nmH.createElement(V,{color:"penguin"},Ey)}function a1H(H=!0,$=!1){if(!H)return Ey;let A=M$().theme;if($)return oH.dim(ZL("promptBorder",A)(Ey));return ZL("penguin",A)(Ey)}var nmH;var qvA=K(()=>{r0();xH();Cn();vA();p6();nmH=b(s(),1)});var OdD={};XA(OdD,{call:()=>ZV1});function NdD(H,$){if(eAH(),II("userSettings",{fastMode:H?!0:void 0}),H)$((A)=>{let L=!UK(A.mainLoopModel);return{...A,...L?{mainLoopModel:YzH,mainLoopModelForSession:null}:{},fastMode:!0}});else $((A)=>({...A,fastMode:!1}))}function CV1({onDone:H,unavailableReason:$}){let A=J$((Y)=>Y.mainLoopModel),L=J$((Y)=>Y.fastMode),I=zI(),[D,B]=zdD.useState(L??!1),f=hDA(),E=f.status==="cooldown",M=$!==null,G=UK(A)&&(A??"").includes("[1m]"),U=o_(ALH(G,!0)),X=WO(),J=X?o_(G?rDA:nDA):null,F=X?` (${X.discountPercent}% off through ${X.endDate})`:"";function Q(){if(M)return;if(NdD(D,I),D){let Y=a1H(D),Z=!UK(A)?` \xB7 model set to ${VO}`:"";H(`${Y} Fast mode ON${Z} \xB7 ${U}${F}`)}else I((Y)=>({...Y,fastMode:!1})),H("Fast mode OFF")}function W(){let Y=L?`${a1H()} Kept Fast mode ON`:"Kept Fast mode OFF";H(Y,{display:"system"})}function P(){if(M)return;B((Y)=>!Y)}return bI({"confirm:yes":Q,"confirm:nextField":P,"confirm:next":P,"confirm:previous":P,"confirm:cycleMode":P,"confirm:toggle":P},{context:"Confirmation"}),h0.createElement(BL,{title:h0.createElement(V,null,h0.createElement(TdD,{cooldown:E})," Fast mode (research preview)"),subtitle:`High-speed mode for ${VO}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:W,color:"penguin",borderDimColor:!1,inputGuide:(Y)=>Y.pending?h0.createElement(V,null,"Press ",Y.keyName," again to exit"):M?h0.createElement(V,null,"Esc to cancel"):h0.createElement(V,null,"Tab to toggle \xB7 Enter to confirm \xB7 Esc to cancel")},$?h0.createElement(x,{marginLeft:2},h0.createElement(V,{color:"error"},$)):h0.createElement(h0.Fragment,null,h0.createElement(x,{flexDirection:"column",gap:0,marginLeft:2},h0.createElement(x,{flexDirection:"row",gap:2},h0.createElement(V,{bold:!0},"Fast mode"),h0.createElement(V,{color:D?"penguin":void 0,bold:D},D?"ON ":"OFF"),J?h0.createElement(h0.Fragment,null,h0.createElement(V,{dimColor:!0,strikethrough:!0},J),h0.createElement(V,{dimColor:!0},U,F)):h0.createElement(V,{dimColor:!0},U))),E&&f.status==="cooldown"&&h0.createElement(x,{marginLeft:2},h0.createElement(V,{color:"warning"},"You've hit your fast limit"," \xB7 resets in"," ",of(f.resetAt-Date.now(),{hideTrailingZeros:!0})))),h0.createElement(V,{dimColor:!0},"Learn more:"," ",h0.createElement(dI,{url:"https://code.claude.com/docs/en/fast-mode"},"https://code.claude.com/docs/en/fast-mode")))}async function wV1(H,$,A){let L=W9$();if(L)return`Fast mode unavailable: ${L}`;let{mainLoopModel:I}=await $();if(NdD(H,A),H){let D=a1H(!0),B=!UK(I)?` \xB7 model set to ${VO}`:"",f=UK(I)&&(I??"").includes("[1m]"),E=WO(),M=o_(ALH(f,!0)),G=E?` (${E.discountPercent}% off through ${E.endDate})`:"";return`${D} Fast mode ON${B} \xB7 ${M}${G}`}else return"Fast mode OFF"}async function ZV1(H,$,A){if(!cD())return null;let L=300;if(await Promise.race([V9$().then(()=>!1),new Promise((f)=>setTimeout(()=>f(!0),L))]))c("tengu_fast_mode_prefetch_timeout",{});let D=A?.trim().toLowerCase();if(D==="on"||D==="off"){let f=await wV1(D==="on",$.getAppState,$.setAppState);return H(f),null}let B=W9$();return h0.createElement(CV1,{onDone:H,unavailableReason:B})}var h0,zdD;var xdD=K(()=>{xH();pL();AJ();Q9();z$();qvA();bB();mL();$I();W5H();h0=b(s(),1),zdD=b(s(),1)});var qV1,SdD;var jdD=K(()=>{AJ();qV1={type:"local-jsx",name:"fast",get description(){return`Toggle fast mode (${VO} only)`},isEnabled:()=>cD(),get isHidden(){return!cD()},argumentHint:"[on|off]",userFacingName:()=>"fast",load:()=>Promise.resolve().then(() => (xdD(),OdD))},SdD=qV1});function RdD({onDone:H}){let[$,A]=Wb.useState(!0),[L,I]=Wb.useState([]),[D,B]=Wb.useState(!1),[f,E]=Wb.useState(null),[M,G]=Wb.useState(void 0),U=zB(()=>H("Guest passes dialog dismissed",{display:"system"})),X=Wb.useCallback(()=>{H("Guest passes dialog dismissed",{display:"system"})},[H]);if(BA("confirm:no",X,{context:"Confirmation"}),WL((W,P)=>{if(P.return&&f)(async()=>{if(await K3(f))c("tengu_guest_passes_link_copied",{}),H("Referral link copied to clipboard!");else H(dQH(),{display:"system"})})()}),Wb.useEffect(()=>{async function W(){try{let P=await jmH();if(!P||!P.eligible){B(!1),A(!1);return}if(B(!0),P.referral_code_details?.referral_link)E(P.referral_code_details.referral_link);G(P.referrer_reward);let C=P.referral_code_details?.campaign??"claude_code_guest_pass",Y;try{Y=await DmD(C)}catch(j){r(j),B(!1),A(!1);return}let Z=Y.redemptions||[],q=Y.limit||3,O=[];for(let j=0;jW.isAvailable).length,F=[...L].sort((W,P)=>+P.isAvailable-+W.isAvailable),Q=(W)=>{if(!W.isAvailable)return lI.createElement(x,{key:W.passNumber,flexDirection:"column",marginRight:1},lI.createElement(V,{dimColor:!0},"\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2571"),lI.createElement(V,{dimColor:!0}," ) CC \u273B \u250A\u2571"),lI.createElement(V,{dimColor:!0},"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2571"));return lI.createElement(x,{key:W.passNumber,flexDirection:"column",marginRight:1},lI.createElement(V,null,"\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),lI.createElement(V,null," ) CC ",lI.createElement(V,{color:"claude"},"\u273B")," \u250A ( "),lI.createElement(V,null,"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"))};return lI.createElement(x,{flexDirection:"column",marginTop:1,gap:1},lI.createElement(V,{color:"permission"},"Guest passes \xB7 ",J," left"),lI.createElement(x,{flexDirection:"row",marginLeft:2},F.slice(0,3).map((W)=>Q(W))),f&&lI.createElement(x,{marginLeft:2},lI.createElement(V,null,f)),lI.createElement(x,{flexDirection:"column",marginLeft:2},lI.createElement(V,{dimColor:!0},M?`Share a free week of Claude Code with friends. If they love it and subscribe, you'll get ${Rs(M)} of extra usage to keep building. `:"Share a free week of Claude Code with friends. ",lI.createElement(dI,{url:M?"https://support.claude.com/en/articles/13456702-claude-code-guest-passes":"https://support.claude.com/en/articles/12875061-claude-code-guest-passes"},"Terms apply."))),lI.createElement(x,null,lI.createElement(V,{dimColor:!0,italic:!0},U.pending?lI.createElement(lI.Fragment,null,"Press ",U.keyName," again to exit"):lI.createElement(lI.Fragment,null,"Enter to copy link \xB7 Esc to cancel"))))}var lI,Wb;var ydD=K(()=>{xH();$I();Jd();_$();z$();pm();UM();lI=b(s(),1),Wb=b(s(),1)});var vdD={};XA(vdD,{call:()=>TV1});async function TV1(H){let A=!M$().hasVisitedPasses;if(A){let L=ZT$();AA((I)=>({...I,hasVisitedPasses:!0,passesLastSeenRemaining:L??I.passesLastSeenRemaining}))}return c("tengu_guest_passes_visited",{is_first_visit:A}),TvA.createElement(RdD,{onDone:H})}var TvA;var hdD=K(()=>{ydD();vA();z$();Jd();TvA=b(s(),1)});var bdD;var kdD=K(()=>{Jd();bdD={type:"local-jsx",name:"passes",get description(){if(ys())return"Share a free week of Claude Code with friends and earn extra usage";return"Share a free week of Claude Code with friends"},isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (hdD(),vdD)),userFacingName(){return"passes"}}});function udD(H,$,A){if(!H.success||!$.success)return!1;let L=H.data,I=$.data;if(L.grove_enabled!==null)return!1;if(A)return!0;if(!I.notice_is_grace_period)return!0;let B=I.notice_reminder_frequency;if(B!==null&&L.grove_notice_viewed_at)return Math.floor((Date.now()-new Date(L.grove_notice_viewed_at).getTime())/86400000)>=B;else{let f=L.grove_notice_viewed_at;return f===null||f===void 0}}function NV1(){return iI.default.createElement(iI.default.Fragment,null,iI.default.createElement(V,null,"An update to our Consumer Terms and Privacy Policy will take effect on"," ",iI.default.createElement(V,{bold:!0},"October 8, 2025"),". You can accept the updated terms today."),iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,null,"What's changing?"),iI.default.createElement(x,{paddingLeft:1},iI.default.createElement(V,null,iI.default.createElement(V,null,"\u2022 "),iI.default.createElement(V,{bold:!0},"You can help improve Claude "),iI.default.createElement(V,null,"\u2014 Allow the use of your chats and coding sessions to train and improve Anthropic AI models. Change anytime in your Privacy Settings (",iI.default.createElement(dI,{url:"https://claude.ai/settings/data-privacy-controls"}),")."))),iI.default.createElement(x,{paddingLeft:1},iI.default.createElement(V,null,iI.default.createElement(V,null,"\u2022 "),iI.default.createElement(V,{bold:!0},"Updates to data retention "),iI.default.createElement(V,null,"\u2014 To help us improve our AI models and safety protections, we're extending data retention to 5 years.")))),iI.default.createElement(V,null,"Learn more (",iI.default.createElement(dI,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),") or read the updated Consumer Terms (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/terms"}),") and Privacy Policy (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/privacy"}),")"))}function OV1(){return iI.default.createElement(iI.default.Fragment,null,iI.default.createElement(V,null,"We've updated our Consumer Terms and Privacy Policy."),iI.default.createElement(x,{flexDirection:"column",gap:1},iI.default.createElement(V,null,"What's changing?"),iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,{bold:!0},"Help improve Claude"),iI.default.createElement(V,null,"Allow the use of your chats and coding sessions to train and improve Anthropic AI models. You can change this anytime in Privacy Settings"),iI.default.createElement(dI,{url:"https://claude.ai/settings/data-privacy-controls"})),iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,{bold:!0},"How this affects data retention"),iI.default.createElement(V,null,"Turning ON the improve Claude setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime."))),iI.default.createElement(V,null,"Learn more (",iI.default.createElement(dI,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),") or read the updated Consumer Terms (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/terms"}),") and Privacy Policy (",iI.default.createElement(dI,{url:"https://anthropic.com/legal/privacy"}),")"))}function kT$({showIfAlreadyViewed:H,location:$,onDone:A}){let[L,I]=iI.useState(null),[D,B]=iI.useState(null);if(iI.useEffect(()=>{async function G(){let[U,X]=await Promise.all([LWH(),Wo()]),J=X.success?X.data:null;B(J);let F=udD(U,X,H);if(I(F),!F){A("skip_rendering");return}WPA(),c("tengu_grove_policy_viewed",{location:$,dismissable:J?.notice_is_grace_period})}G()},[H,$,A]),L===null)return null;if(!L)return null;async function f(G){switch(G){case"accept_opt_in":{await D7$(!0),c("tengu_grove_policy_submitted",{state:!0,dismissable:D?.notice_is_grace_period});break}case"accept_opt_out":{await D7$(!1),c("tengu_grove_policy_submitted",{state:!1,dismissable:D?.notice_is_grace_period});break}case"defer":c("tengu_grove_policy_dismissed",{state:!0});break;case"escape":c("tengu_grove_policy_escaped",{});break}A(G)}let E=D?.domain_excluded?[{label:"Accept terms \u2022 Help improve Claude: OFF (for emails with your domain)",value:"accept_opt_out"}]:[{label:"Accept terms \u2022 Help improve Claude: ON",value:"accept_opt_in"},{label:"Accept terms \u2022 Help improve Claude: OFF",value:"accept_opt_out"}];function M(){if(D?.notice_is_grace_period){f("defer");return}f("escape")}return iI.default.createElement(BL,{title:"Updates to Consumer Terms and Policies",color:"professionalBlue",borderDimColor:!1,onCancel:M,inputGuide:(G)=>G.pending?iI.default.createElement(V,null,"Press ",G.keyName," again to exit"):iI.default.createElement(rA,null,iI.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),iI.default.createElement(s$,{shortcut:"Esc",action:"cancel"}))},iI.default.createElement(x,{flexDirection:"row"},iI.default.createElement(x,{flexDirection:"column",gap:1,flexGrow:1},D?.notice_is_grace_period?iI.default.createElement(NV1,null):iI.default.createElement(OV1,null)),iI.default.createElement(x,{flexShrink:0},iI.default.createElement(V,{color:"professionalBlue"},zV1))),iI.default.createElement(x,{flexDirection:"column",gap:1},iI.default.createElement(x,{flexDirection:"column"},iI.default.createElement(V,{bold:!0},"Please select how you'd like to continue"),iI.default.createElement(V,null,"Your choice takes effect immediately upon confirmation.")),iI.default.createElement(QA,{options:[...E,...D?.notice_is_grace_period?[{label:"Not now",value:"defer"}]:[]],onChange:(G)=>f(G),onCancel:M})))}function gdD({settings:H,domainExcluded:$,onDone:A}){let[L,I]=iI.useState(H.grove_enabled);iI.default.useEffect(()=>{c("tengu_grove_privacy_settings_viewed",{})},[]),WL(async(B,f)=>{if(!$&&(f.tab||f.return||B===" ")){let E=!L;I(E),await D7$(E)}});let D=iI.default.createElement(V,{color:"error"},"false");if($)D=iI.default.createElement(V,{color:"error"},"false (for emails with your domain)");else if(L)D=iI.default.createElement(V,{color:"success"},"true");return iI.default.createElement(BL,{title:"Data Privacy",color:"professionalBlue",borderDimColor:!1,onCancel:A,inputGuide:(B)=>B.pending?iI.default.createElement(V,null,"Press ",B.keyName," again to exit"):$?iI.default.createElement(s$,{shortcut:"Esc",action:"cancel"}):iI.default.createElement(rA,null,iI.default.createElement(s$,{shortcut:"Enter/Tab/Space",action:"toggle"}),iI.default.createElement(s$,{shortcut:"Esc",action:"cancel"}))},iI.default.createElement(V,null,"Review and manage your privacy settings at"," ",iI.default.createElement(dI,{url:"https://claude.ai/settings/data-privacy-controls"})),iI.default.createElement(x,null,iI.default.createElement(x,{width:44},iI.default.createElement(V,{bold:!0},"Help improve Claude")),iI.default.createElement(x,null,D)))}async function mdD(){let[H,$]=await Promise.all([LWH(),Wo()]);if(udD(H,$,!1)){let L=$.success?$.data:null;if(c("tengu_grove_print_viewed",{dismissable:L?.notice_is_grace_period}),L===null||L.notice_is_grace_period)Tc(` An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms. [ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run \`claude\` to review the updated terms. |______________|`;var uT$=K(()=>{xH();l8();z$();DWH();UU();xH();bB();lB();eB();iI=b(s(),1)});var ddD={};XA(ddD,{call:()=>xV1});async function xV1(H){if(!await IWH())return H(pdD),null;let[A,L]=await Promise.all([LWH(),Wo()]);if(!A.success)return H(pdD),null;let I=A.data,D=L.success?L.data:null;async function B(E){if(E==="escape"||E==="defer"){H("Privacy settings dialog dismissed",{display:"system"});return}await f()}async function f(){let E=await LWH();if(!E.success){H("Unable to retrieve updated privacy settings",{display:"system"});return}let M=E.data,G=M.grove_enabled?"true":"false";if(H(`"Help improve Claude" set to ${G}.`),I.grove_enabled!==null&&I.grove_enabled!==M.grove_enabled)c("tengu_grove_policy_toggled",{state:M.grove_enabled,location:"settings"})}if(I.grove_enabled!==null)return rmH.createElement(gdD,{settings:I,domainExcluded:D?.domain_excluded,onDone:f});return rmH.createElement(kT$,{showIfAlreadyViewed:!0,onDone:B,location:"settings"})}var rmH,pdD="Review and manage your privacy settings at https://claude.ai/settings/data-privacy-controls";var cdD=K(()=>{uT$();DWH();z$();rmH=b(s(),1)});var SV1,ldD;var idD=K(()=>{EI();SV1={type:"local-jsx",name:"privacy-settings",description:"View and update your privacy settings",isEnabled:()=>{return jD$()},isHidden:!1,load:()=>Promise.resolve().then(() => (cdD(),ddD)),userFacingName(){return"privacy-settings"}},ldD=SV1});function ndD({event:H,eventSummary:$,config:A,matcher:L,onSuccess:I,onCancel:D}){let[B,f]=zvA.useState(!1),[E,M]=zvA.useState(null),G=KFH.map(j5A),U=async(X)=>{f(!0),M(null);try{await xPI(H,A,L,X),c("tengu_hook_created",{event:H,source:X,has_matcher:L?1:0}),I()}catch(J){M(J instanceof Error?J.message:"Failed to add hook"),f(!1)}};if(B)return hf.createElement(x,{flexDirection:"column",gap:1},hf.createElement(x,{flexDirection:"row",gap:1},hf.createElement(vD,null),hf.createElement(V,null,"Adding hook configuration\u2026")));if(E)return hf.createElement(BL,{title:"Failed to add hook",onCancel:D,color:"error",borderDimColor:!1},hf.createElement(x,{flexDirection:"column",gap:1},hf.createElement(V,null,E),hf.createElement(QA,{options:[{label:"OK",value:"ok"}],onChange:D})));return hf.createElement(BL,{title:"Save hook configuration",onCancel:D,borderDimColor:!1},hf.createElement(x,{flexDirection:"column",gap:1},hf.createElement(x,{flexDirection:"column",marginX:2},hf.createElement(V,null,"Event: ",H," - ",$),hf.createElement(V,null,"Matcher: ",L),hf.createElement(V,null,A.type==="command"?"Command":"Prompt",":"," ",IP(A))),hf.createElement(V,null,"Where should this hook be saved?"),hf.createElement(QA,{options:G,onChange:(X)=>U(X),visibleOptionCount:3})))}var hf,zvA;var rdD=K(()=>{xH();Av();N1();JM();q4$();bB();z$();hf=b(s(),1),zvA=b(s(),1)});function adD({hookEventMetadata:H,totalHooksCount:$,configDifference:A,restrictedByPolicy:L,onSelectEvent:I,onCancel:D}){let B=`${$} hook${$!==1?"s":""}`;return I4.createElement(BL,{title:"Hooks",subtitle:B,onCancel:D,borderDimColor:!1},I4.createElement(x,{flexDirection:"column",gap:1},L&&I4.createElement(x,{flexDirection:"column"},I4.createElement(V,{color:"suggestion"},pH.info," Hooks Restricted by Policy"),I4.createElement(V,{dimColor:!0},"Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked.")),A&&I4.createElement(x,{flexDirection:"column"},I4.createElement(V,{color:"warning"},pH.warning," Settings Changed"),I4.createElement(V,{dimColor:!0},"Hook settings have been modified outside of this menu. Review the following changes carefully:"),I4.createElement(V,{dimColor:!0},A)),I4.createElement(x,{flexDirection:"column"},I4.createElement(QA,{onChange:(f)=>{if(f==="disable-all")I("disable-all");else I(f)},onCancel:D,options:[...Object.entries(H).map(([f,E])=>({label:`${f} - ${E.summary}`,value:f})),{label:I4.createElement(V,{dimColor:!0},"Disable all hooks"),value:"disable-all"}]}))))}var I4;var odD=K(()=>{xH();N1();jI();bB();I4=b(s(),1)});function tdD({selectedEvent:H,matchersForSelectedEvent:$,hooksByEventAndMatcher:A,eventDescription:L,onSelect:I,onCancel:D}){let B=LZ.useMemo(()=>{return $.map((f)=>{let E=A[H]?.[f]||[],M=Array.from(new Set(E.map((G)=>G.source)));return{matcher:f,sources:M,hookCount:E.length}})},[$,A,H]);return LZ.createElement(BL,{title:`${H} - Tool Matchers`,subtitle:L,onCancel:D,borderDimColor:!1},LZ.createElement(x,{flexDirection:"column"},LZ.createElement(QA,{options:[{label:`+ Add new matcher${pH.ellipsis}`,value:"add-new"},{label:"+ Match all (no filter)",value:"match-all"},...B.map((f)=>{return{label:`[${f.sources.map(RPI).join(", ")}] ${f.matcher}`,value:f.matcher,description:`${f.hookCount} hook${f.hookCount!==1?"s":""}`}})],onChange:(f)=>{if(f==="add-new")I(null);else if(f==="match-all")I("");else I(f)},onCancel:D}),$.length===0&&LZ.createElement(x,{marginLeft:2},LZ.createElement(V,{dimColor:!0},"No matchers configured yet"))))}var LZ;var sdD=K(()=>{xH();jI();Av();N1();bB();LZ=b(s(),1)});function edD({selectedEvent:H,newMatcher:$,onChangeNewMatcher:A,eventDescription:L,matcherMetadata:I,onCancel:D}){let[B,f]=D4.useState($.length);return D4.createElement(BL,{title:`Add new matcher for ${H}`,subtitle:L,onCancel:D,borderDimColor:!1},D4.createElement(x,{flexDirection:"column",gap:1},D4.createElement(x,{flexDirection:"column",gap:1},D4.createElement(V,null,"Possible matcher values for field ",I.fieldToMatch,":"),D4.createElement(V,{dimColor:!0},I.values.join(", "))),D4.createElement(x,{flexDirection:"column"},D4.createElement(V,null,"Matcher:"),D4.createElement(x,{borderStyle:"round",borderDimColor:!0,paddingLeft:1,paddingRight:1},D4.createElement(W9,{value:$,onChange:A,columns:78,showCursor:!0,cursorOffset:B,onChangeCursorOffset:f}))),D4.createElement(x,{flexDirection:"column",gap:1},D4.createElement(V,{dimColor:!0},"Example Matchers:",` `,"\u2022 Web.* (regex pattern)"))))}var D4;var HcD=K(()=>{xH();S5();bB();D4=b(s(),1)});function $cD({selectedEvent:H,selectedMatcher:$,eventDescription:A,fullDescription:L,supportsMatcher:I,command:D,onChangeCommand:B,onCancel:f}){let[E,M]=f9.useState(D.length),{columns:G}=QL(),U=D.trim().split(/\s+/)[0]||"",X=U&&!U.startsWith("/")&&!U.startsWith("~")&&U.includes("/"),J=/\bsudo\b/.test(D);return f9.createElement(BL,{title:"Add new hook",onCancel:f,borderDimColor:!1},f9.createElement(x,{flexDirection:"column",gap:1},f9.createElement(x,{flexDirection:"column"},f9.createElement(V,{dimColor:!0},pH.info," Hooks execute shell commands with your full user permissions. Only use hooks from trusted sources."," ",f9.createElement(dI,{url:"https://code.claude.com/docs/en/hooks"},"Learn more"))),f9.createElement(V,null,"Event: ",f9.createElement(V,{bold:!0},H)," - ",A),L&&f9.createElement(x,null,f9.createElement(V,{dimColor:!0},L)),I&&f9.createElement(V,null,"Matcher: ",f9.createElement(V,{bold:!0},$)),f9.createElement(V,null,"Command:"),f9.createElement(x,{borderStyle:"round",borderDimColor:!0,paddingLeft:1,paddingRight:1},f9.createElement(W9,{value:D,onChange:B,columns:G-8,showCursor:!0,cursorOffset:E,onChangeCursorOffset:M,multiline:!0})),(X||J)&&f9.createElement(x,{flexDirection:"column",gap:0},X&&f9.createElement(V,{color:"warning"},pH.warning," Using a relative path for the executable may be insecure. Consider using an absolute path instead."),J&&f9.createElement(V,{color:"warning"},pH.warning," Using sudo in hooks can be dangerous and may expose your system to security risks.")),f9.createElement(V,{dimColor:!0},"Examples:",f9.createElement(_K,null),`\u2022 jq -r '.tool_input.file_path | select(endswith(".go"))' | xargs -r gofmt -w`,f9.createElement(_K,null),`\u2022 jq -r '"\\(.tool_input.command) - \\(.tool_input.description // "No description")"' >> ~/.claude/bash-command-log.txt`,f9.createElement(_K,null),"\u2022 /usr/local/bin/security_check.sh",f9.createElement(_K,null),"\u2022 python3 ~/hooks/validate_changes.py")))}var f9;var AcD=K(()=>{xH();S5();jI();xH();OB();bB();f9=b(s(),1)});function LcD({selectedMatcher:H,selectedEvent:$,onDelete:A,onCancel:L}){return oP.createElement(BL,{title:"Delete matcher?",onCancel:L,borderDimColor:!1},oP.createElement(x,{flexDirection:"column",gap:1},oP.createElement(x,{flexDirection:"column",marginX:2},oP.createElement(V,{bold:!0},H),oP.createElement(V,{dimColor:!0},"Event: ",$)),oP.createElement(V,null,"This matcher has no hooks configured. Delete it?"),oP.createElement(QA,{onChange:(I)=>I==="yes"?A():L(),onCancel:L,options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]})))}var oP;var IcD=K(()=>{xH();N1();bB();oP=b(s(),1)});function DcD({selectedEvent:H,selectedMatcher:$,hooksForSelectedMatcher:A,hookEventMetadata:L,onSelect:I,onCancel:D}){let B=L.matcherMetadata!==void 0?`${H} - Matcher: ${$}`:H;return Uj.createElement(BL,{title:B,subtitle:L.description,onCancel:D,borderDimColor:!1},Uj.createElement(x,{flexDirection:"column"},Uj.createElement(QA,{options:[{label:`+ Add new hook${pH.ellipsis}`,value:"add-new"},...A.map((f,E)=>({label:f.source==="pluginHook"?`${IP(f.config)} (read-only)`:IP(f.config),value:E.toString(),description:f.source==="pluginHook"?`${R5A(f.source)} - disable ${f.pluginName?f.pluginName:"plugin"} to remove`:R5A(f.source),disabled:f.source==="pluginHook"}))],onChange:(f)=>{if(f==="add-new")I(null);else{let E=parseInt(f,10),M=A[E];if(M)I(M)}},onCancel:D}),A.length===0&&Uj.createElement(x,{marginLeft:2},Uj.createElement(V,{dimColor:!0},"No hooks configured yet"))))}var Uj;var BcD=K(()=>{jI();xH();Av();N1();bB();Uj=b(s(),1)});function fcD({selectedHook:H,eventSupportsMatcher:$,onDelete:A,onCancel:L}){return pK.createElement(BL,{title:"Delete hook?",onCancel:L,borderDimColor:!1},pK.createElement(x,{flexDirection:"column",gap:1},pK.createElement(x,{flexDirection:"column",marginX:2},pK.createElement(V,{bold:!0},IP(H.config)),pK.createElement(V,{dimColor:!0},"Event: ",H.event),$&&pK.createElement(V,{dimColor:!0},"Matcher: ",H.matcher),pK.createElement(V,{dimColor:!0},jPI(H.source))),pK.createElement(V,null,"This will remove the hook configuration from your settings."),pK.createElement(QA,{onChange:(I)=>I==="yes"?A():L(),onCancel:L,options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]})))}var pK;var EcD=K(()=>{xH();Av();N1();bB();pK=b(s(),1)});function gT$(H,$){let A={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCompleted:{}},L=amH($);OPI(H).forEach((D)=>{let B=A[D.event];if(B){let f=L[D.event].matcherMetadata!==void 0?D.matcher||"":"";if(!B[f])B[f]=[];B[f].push(D)}});let I=pYH();if(I)for(let[D,B]of Object.entries(I)){let f=D,E=A[f];if(!E)continue;for(let M of B){let G=M.matcher||"";for(let U of M.hooks)if(U.type==="callback"){if(!E[G])E[G]=[];E[G].push({event:f,config:{type:"command",command:"[Plugin Hook]"},matcher:M.matcher,source:"pluginHook",pluginName:M.pluginName})}else{if(!E[G])E[G]=[];E[G].push({event:f,config:U,matcher:M.matcher,source:"pluginHook",pluginName:M.pluginName})}}}return A}function McD(H,$){let A=Object.keys(H[$]||{});return yPI(A,H,$)}function GcD(H,$,A){let L=A??"";return H[$]?.[L]??[]}function ks(H,$){return amH($)[H].matcherMetadata}function UcD(H,$){return amH($)[H].summary}var amH;var XcD=K(()=>{tD();Av();g$();amH=o$(function(H){return{PreToolUse:{summary:"Before tool execution",description:`Input to command is JSON of tool call arguments. To resume the original: claude -r ${I}`,P=`Forked conversation${Q}. You are now in the fork.${W}`;if($.resume)await $.resume(D,F,"fork"),H(P,{display:"system"});else H(`Forked conversation${Q}. Resume with: /resume ${D}`);return null}catch(D){let B=D instanceof Error?D.message:"Unknown error occurred";return H(`Failed to fork conversation: ${B}`),null}}var ZcD,BPH;var TcD=K(()=>{rB();g$();Z$();nM();yE();z$();ZcD=require("crypto"),BPH=require("fs/promises")});var gV1,zcD;var NcD=K(()=>{gV1={type:"local-jsx",name:"fork",description:"Create a fork of the current conversation at this point",argumentHint:"[name]",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (TcD(),qcD)),userFacingName(){return"fork"}},zcD=gV1});var Vb;var OcD=K(()=>{Vb={FOLDER_NAME:".claude",AGENTS_DIR:"agents"}});function xcD(H,$,A,L,I,D,B){let f=$.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\\\n"),M=A===void 0||A.length===1&&A[0]==="*"?"":` `}function mT$(H){switch(H){case"flagSettings":throw Error(`Cannot get directory path for ${H} agents`);case"userSettings":return Pb.join(UL(),Vb.AGENTS_DIR);case"projectSettings":return Pb.join(C$(),Vb.FOLDER_NAME,Vb.AGENTS_DIR);case"policySettings":return Pb.join(v_(),Vb.FOLDER_NAME,Vb.AGENTS_DIR);case"localSettings":return Pb.join(C$(),Vb.FOLDER_NAME,Vb.AGENTS_DIR)}}function ScD(H){switch(H){case"projectSettings":return Pb.join(".",Vb.FOLDER_NAME,Vb.AGENTS_DIR);default:return mT$(H)}}function OvA(H){let $=mT$(H.source);return Pb.join($,`${H.agentType}.md`)}function pT$(H){if(H.source==="built-in")return"Built-in";if(H.source==="plugin")throw Error("Cannot get file path for plugin agents");let $=mT$(H.source),A=H.filename||H.agentType;return Pb.join($,`${A}.md`)}function jcD(H){if(H.source==="built-in")return"Built-in";let $=ScD(H.source);return Pb.join($,`${H.agentType}.md`)}function RcD(H){if(TK(H))return"Built-in";if(aK$(H))return`Plugin: ${H.plugin||"Unknown"}`;let $=ScD(H.source),A=H.filename||H.agentType;return Pb.join($,`${A}.md`)}function mV1(H){let $=mT$(H),A=zH();if(!A.existsSync($))A.mkdirSync($);return $}async function ycD(H,$,A,L,I,D=!0,B,f,E){if(H==="built-in")throw Error("Cannot save built-in agents");mV1(H);let M=OvA({source:H,agentType:$}),G=zH();if(D&&G.existsSync(M))throw Error(`Agent file already exists: ${M}`);let U=xcD($,A,L,I,B,f,E);iL(M,U,{encoding:"utf-8",flush:!0})}async function vcD(H,$,A,L,I,D,B){if(H.source==="built-in")throw Error("Cannot update built-in agents");let f=pT$(H),E=xcD(H.agentType,$,A,L,I,D,B);iL(f,E,{encoding:"utf-8",flush:!0})}async function hcD(H){if(H.source==="built-in")throw Error("Cannot delete built-in agents");let $=zH(),A=pT$(H);if($.existsSync(A))$.unlinkSync(A)}var Pb;var fPH=K(()=>{DL();PI();Z$();NA();kT();OcD();y$H();Pb=require("path")});function dT$({title:H,titleColor:$="text",subtitle:A,borderColor:L="suggestion",borderDimColor:I=!1,children:D,footer:B,titleSuffix:f}){return us.default.createElement(us.default.Fragment,null,us.default.createElement(x,{borderStyle:"round",borderColor:L,borderDimColor:I,flexDirection:"column"},H&&us.default.createElement(x,{flexDirection:"column",paddingX:1},us.default.createElement(V,{bold:!0,color:$},H,f),A&&us.default.createElement(V,{dimColor:!0},A)),us.default.createElement(x,{paddingX:1,flexDirection:"column"},D)),B)}var us;var xvA=K(()=>{xH();us=b(s(),1)});function gs({title:H,titleColor:$="text",borderColor:A="suggestion",children:L,subtitle:I}){return SvA.createElement(dT$,{title:H,titleColor:$,borderColor:A,subtitle:I},L)}var SvA;var jvA=K(()=>{xvA();SvA=b(s(),1)});function EPH(H){if(H==="all")return"Agents";if(H==="built-in")return"Built-in agents";if(H==="plugin")return"Plugin agents";return Fk(Vl(H))}var cT$=K(()=>{eYH();W4()});function bcD({source:H,agents:$,onBack:A,onSelect:L,onCreateNew:I,changes:D}){let[B,f]=sL.useState(null),[E,M]=sL.useState(!0),G=(C)=>{return{isOverridden:!!C.overriddenBy,overriddenBy:C.overriddenBy||null}},U=()=>{return sL.createElement(x,null,sL.createElement(V,{color:E?"suggestion":void 0},E?`${pH.pointer} `:" "),sL.createElement(V,{color:E?"suggestion":void 0},"Create new agent"))},X=(C)=>{let Y=C.source==="built-in",Z=!Y&&!E&&B?.agentType===C.agentType&&B?.source===C.source,{isOverridden:q,overriddenBy:O}=G(C),j=Y||q,u=!Y&&Z?"suggestion":void 0,y=C.model||z9$();return sL.createElement(x,{key:`${C.agentType}-${C.source}`},sL.createElement(V,{dimColor:j&&!Z,color:u},Y?"":Z?`${pH.pointer} `:" "),sL.createElement(V,{dimColor:j&&!Z,color:u},C.agentType),y&&sL.createElement(V,{dimColor:!0,color:u}," \xB7 ",y==="inherit"?"inherit":y),O&&sL.createElement(V,{dimColor:!Z,color:Z?"warning":void 0}," ",pH.warning," overridden by ",O))},J=sL.useMemo(()=>{let C=$.filter((Y)=>Y.source!=="built-in");if(H==="all")return[...C.filter((Y)=>Y.source==="userSettings"),...C.filter((Y)=>Y.source==="projectSettings"),...C.filter((Y)=>Y.source==="policySettings")];return C},[$,H]);sL.useEffect(()=>{if(!B&&!E&&J.length>0)if(I)M(!0);else f(J[0]||null)},[J,B,E,I]),BA("confirm:no",A,{context:"Confirmation"}),WL((C,Y)=>{if(Y.return){if(E&&I)I();else if(B)L(B);return}if(!Y.upArrow&&!Y.downArrow)return;let Z=!!I,q=J.length+(Z?1:0);if(q===0)return;let O=0;if(!E&&B){let u=J.findIndex((y)=>y.agentType===B.agentType&&y.source===B.source);if(u>=0)O=Z?u+1:u}let j=Y.upArrow?O===0?q-1:O-1:O===q-1?0:O+1;if(Z&&j===0)M(!0),f(null);else{let u=Z?j-1:j,y=J[u];if(y)M(!1),f(y)}});let F=(C="Built-in (always available):")=>{let Y=$.filter((Z)=>Z.source==="built-in");return sL.createElement(x,{flexDirection:"column",marginBottom:1,paddingLeft:2},sL.createElement(V,{bold:!0,dimColor:!0},C),Y.map(X))},Q=(C,Y)=>{if(!Y.length)return null;let Z=Y[0]?.baseDir;return sL.createElement(x,{flexDirection:"column",marginBottom:1},sL.createElement(x,{paddingLeft:2},sL.createElement(V,{bold:!0,dimColor:!0},C),Z&&sL.createElement(V,{dimColor:!0}," (",Z,")")),Y.map((q)=>X(q)))},W=EPH(H);if(!$.length||H!=="built-in"&&!$.some((C)=>C.source!=="built-in"))return sL.createElement(gs,{title:W,subtitle:"No agents found"},I&&sL.createElement(x,{marginY:1},U()),sL.createElement(V,{dimColor:!0},"No agents found. Create specialized subagents that Claude can delegate to."),sL.createElement(V,{dimColor:!0},"Each subagent has its own context window, custom system prompt, and specific tools."),sL.createElement(V,{dimColor:!0},"Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer."),H!=="built-in"&&$.some((C)=>C.source==="built-in")&&sL.createElement(sL.Fragment,null,sL.createElement(x,{marginTop:1},sL.createElement(Uf,null)),F()));return sL.createElement(gs,{title:W,subtitle:`${$.filter((C)=>!C.overriddenBy).length} agents`},D&&D.length>0&&sL.createElement(x,{marginTop:1},sL.createElement(V,{dimColor:!0},D[D.length-1])),sL.createElement(x,{flexDirection:"column",marginTop:1},I&&sL.createElement(x,{marginBottom:1},U()),H==="all"?sL.createElement(sL.Fragment,null,Q("User agents",$.filter((C)=>C.source==="userSettings")),Q("Project agents",$.filter((C)=>C.source==="projectSettings")),Q("Managed agents",$.filter((C)=>C.source==="policySettings")),Q("Plugin agents",$.filter((C)=>C.source==="plugin")),Q("CLI arg agents",$.filter((C)=>C.source==="flagSettings")),(()=>{let C=$.filter((Y)=>Y.source==="built-in");return C.length>0?sL.createElement(x,{flexDirection:"column",marginBottom:1,paddingLeft:2},sL.createElement(V,{dimColor:!0},sL.createElement(V,{bold:!0},"Built-in agents")," (always available)"),C.map(X)):null})()):H==="built-in"?sL.createElement(sL.Fragment,null,sL.createElement(V,{dimColor:!0,italic:!0},"Built-in agents are provided by default and cannot be modified."),sL.createElement(x,{marginTop:1,flexDirection:"column"},$.map((C)=>X(C)))):sL.createElement(sL.Fragment,null,$.filter((C)=>C.source!=="built-in").map((C)=>X(C)),$.some((C)=>C.source==="built-in")&&sL.createElement(sL.Fragment,null,sL.createElement(x,{marginTop:1},sL.createElement(Uf,null)),F()))))}var sL;var kcD=K(()=>{xH();xH();jI();e6();jvA();aI();cT$();$I();sL=b(s(),1)});function yvA({steps:H,initialData:$={},onComplete:A,onCancel:L,children:I,title:D,showStepCounter:B=!0}){let[f,E]=cF.useState(0),[M,G]=cF.useState($),[U,X]=cF.useState(!1),[J,F]=cF.useState([]);zB(),cF.useEffect(()=>{if(U)F([]),A(M)},[U,M,A]);let Q=cF.useCallback(()=>{if(f0)F((O)=>[...O,f]);E((O)=>O+1)}else X(!0)},[f,H.length,J]),W=cF.useCallback(()=>{if(J.length>0){let O=J[J.length-1];if(O!==void 0)F((j)=>j.slice(0,-1)),E(O)}else if(f>0)E((O)=>O-1);else if(L)L()},[f,J,L]),P=cF.useCallback((O)=>{if(O>=0&&O[...j,f]),E(O)},[f,H.length]),C=cF.useCallback(()=>{if(F([]),L)L()},[L]),Y=cF.useCallback((O)=>{G((j)=>({...j,...O}))},[]),Z=cF.useMemo(()=>({currentStepIndex:f,totalSteps:H.length,wizardData:M,setWizardData:G,updateWizardData:Y,goNext:Q,goBack:W,goToStep:P,cancel:C,title:D,showStepCounter:B}),[f,H.length,M,Y,Q,W,P,C,D,B]),q=H[f];if(!q||U)return null;return cF.default.createElement(RvA.Provider,{value:Z},I||cF.default.createElement(q,null))}var cF,RvA;var vvA=K(()=>{UM();cF=b(s(),1),RvA=cF.createContext(null)});function RG(){let H=ucD.useContext(RvA);if(!H)throw Error("useWizard must be used within a WizardProvider");return H}var ucD;var hvA=K(()=>{vvA();ucD=b(s(),1)});function bvA({instructions:H=o1H.default.createElement(rA,null,o1H.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),o1H.default.createElement(s$,{shortcut:"Enter",action:"select"}),o1H.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))}){let $=zB();return o1H.default.createElement(x,{marginLeft:3},o1H.default.createElement(V,{dimColor:!0},$.pending?`Press ${$.keyName} again to exit`:H))}var o1H;var kvA=K(()=>{xH();UM();lB();j0();eB();o1H=b(s(),1)});function n4({title:H,titleColor:$="text",borderColor:A="suggestion",children:L,subtitle:I,footerText:D}){let{currentStepIndex:B,totalSteps:f,title:E,showStepCounter:M}=RG();return uvA.default.createElement(dT$,{title:H||E||"Wizard",titleColor:$,borderColor:A,subtitle:I,titleSuffix:M!==!1?` (${B+1}/${f})`:void 0,footer:uvA.default.createElement(bvA,{instructions:D})},L)}var uvA;var IZ=K(()=>{hvA();kvA();xvA();uvA=b(s(),1)});var CC=K(()=>{vvA();hvA();IZ();kvA()});function gcD(){let{goNext:H,updateWizardData:$,cancel:A}=RG();return ms.default.createElement(n4,{subtitle:"Choose location",footerText:ms.default.createElement(rA,null,ms.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),ms.default.createElement(s$,{shortcut:"Enter",action:"select"}),ms.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))},ms.default.createElement(x,{marginTop:1},ms.default.createElement(QA,{key:"location-select",options:[{label:"Project (.claude/agents/)",value:"projectSettings"},{label:"Personal (~/.claude/agents/)",value:"userSettings"}],onChange:(I)=>{$({location:I}),H()},onCancel:()=>A()})))}var ms;var mcD=K(()=>{xH();N1();IZ();CC();lB();j0();eB();ms=b(s(),1)});function pcD(){let{goNext:H,goBack:$,updateWizardData:A,goToStep:L}=RG();return ps.default.createElement(n4,{subtitle:"Creation method",footerText:ps.default.createElement(rA,null,ps.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),ps.default.createElement(s$,{shortcut:"Enter",action:"select"}),ps.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},ps.default.createElement(x,{marginTop:1},ps.default.createElement(QA,{key:"method-select",options:[{label:"Generate with Claude (recommended)",value:"generate"},{label:"Manual configuration",value:"manual"}],onChange:(D)=>{let B=D;if(A({method:B,wasGenerated:B==="generate"}),B==="generate")H();else L(3)},onCancel:()=>$()})))}var ps;var dcD=K(()=>{xH();N1();IZ();CC();lB();j0();eB();ps=b(s(),1)});async function lcD(H,$,A,L){let I=A.length>0?` `});function ncD(){let{updateWizardData:H,goBack:$,goToStep:A,wizardData:L}=RG(),[I,D]=r4.useState(L.generationPrompt||""),[B,f]=r4.useState(!1),[E,M]=r4.useState(null),[G,U]=r4.useState(I.length),X=Ht(),J=r4.useRef(null),F=r4.useCallback(()=>{if(J.current)J.current.abort(),J.current=null,f(!1),M("Generation cancelled")},[]);BA("confirm:no",F,{context:"Settings",isActive:B});let Q=r4.useCallback(()=>{H({generationPrompt:"",agentType:"",systemPrompt:"",whenToUse:"",generatedAgent:void 0,wasGenerated:!1}),D(""),M(null),$()},[H,$]);BA("confirm:no",Q,{context:"Settings",isActive:!B});let W=async()=>{let C=I.trim();if(!C){M("Please describe what the agent should do");return}M(null),f(!0),H({generationPrompt:C,isGenerating:!0});let Y=nD();J.current=Y;try{let Z=await lcD(C,X,[],Y.signal);H({agentType:Z.identifier,whenToUse:Z.whenToUse,systemPrompt:Z.systemPrompt,generatedAgent:Z,isGenerating:!1,wasGenerated:!0}),A(6)}catch(Z){if(Z instanceof rf);else if(Z instanceof Error&&!Z.message.includes("No assistant message found"))M(Z.message||"Failed to generate agent");H({isGenerating:!1})}finally{f(!1),J.current=null}},P="Describe what this agent should do and when it should be used (be comprehensive for best results)";if(B)return r4.default.createElement(n4,{subtitle:P,footerText:r4.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"cancel"})},r4.default.createElement(x,{marginTop:1,flexDirection:"row",alignItems:"center"},r4.default.createElement(vD,null),r4.default.createElement(V,{color:"suggestion"}," Generating agent from description...")));return r4.default.createElement(n4,{subtitle:P,footerText:r4.default.createElement(rA,null,r4.default.createElement(VA,{action:"confirm:yes",context:"Confirmation",fallback:"Enter",description:"submit"}),r4.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},r4.default.createElement(x,{flexDirection:"column",marginTop:1},E&&r4.default.createElement(x,{marginBottom:1},r4.default.createElement(V,{color:"error"},E)),r4.default.createElement(W9,{value:I,onChange:D,onSubmit:W,placeholder:"e.g., Help me write unit tests for my code...",columns:80,cursorOffset:G,onChangeCursorOffset:U,focus:!0,showCursor:!0})))}var r4;var rcD=K(()=>{xH();$I();S5();IZ();CC();JM();icD();jbH();eE();j0();eB();n_();r4=b(s(),1)});function gvA(H){if(!H)return"Agent type is required";if(!/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(H))return"Agent type must start and end with alphanumeric characters and contain only letters, numbers, and hyphens";if(H.length<3)return"Agent type must be at least 3 characters long";if(H.length>50)return"Agent type must be less than 50 characters";return null}function acD(H,$,A){let L=[],I=[];if(!H.agentType)L.push("Agent type is required");else{let B=gvA(H.agentType);if(B)L.push(B);let f=A.find((E)=>E.agentType===H.agentType&&E.source!==H.source);if(f)L.push(`Agent type "${H.agentType}" already exists in ${EPH(f.source)}`)}if(!H.whenToUse)L.push("Description (description) is required");else if(H.whenToUse.length<10)I.push("Description should be more descriptive (at least 10 characters)");else if(H.whenToUse.length>5000)I.push("Description is very long (over 5000 characters)");if(H.tools!==void 0&&!Array.isArray(H.tools))L.push("Tools must be an array");else{if(H.tools===void 0)I.push("Agent has access to all tools");else if(H.tools.length===0)I.push("No tools selected - agent will have very limited capabilities");let B=Io(H,$,!1);if(B.invalidTools.length>0)L.push(`Invalid tools: ${B.invalidTools.join(", ")}`)}let D=H.getSystemPrompt();if(!D)L.push("System prompt is required");else if(D.length<20)L.push("System prompt is too short (minimum 20 characters)");else if(D.length>1e4)I.push("System prompt is very long (over 10,000 characters)");return{isValid:L.length===0,errors:L,warnings:I}}var mvA=K(()=>{OBH();cT$()});function ocD(H){let{goNext:$,goBack:A,updateWizardData:L,wizardData:I}=RG(),[D,B]=i3.useState(I.agentType||""),[f,E]=i3.useState(null),[M,G]=i3.useState(D.length);return BA("confirm:no",A,{context:"Settings"}),i3.default.createElement(n4,{subtitle:"Agent type (identifier)",footerText:i3.default.createElement(rA,null,i3.default.createElement(s$,{shortcut:"Type",action:"enter text"}),i3.default.createElement(s$,{shortcut:"Enter",action:"continue"}),i3.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},i3.default.createElement(x,{flexDirection:"column",marginTop:1},i3.default.createElement(V,null,"Enter a unique identifier for your agent:"),i3.default.createElement(x,{marginTop:1},i3.default.createElement(W9,{value:D,onChange:B,onSubmit:(X)=>{let J=X.trim(),F=gvA(J);if(F){E(F);return}E(null),L({agentType:J}),$()},placeholder:"e.g., test-runner, tech-lead, etc",columns:60,cursorOffset:M,onChangeCursorOffset:G,focus:!0,showCursor:!0})),f&&i3.default.createElement(x,{marginTop:1},i3.default.createElement(V,{color:"error"},f))))}var i3;var tcD=K(()=>{xH();S5();IZ();CC();mvA();lB();j0();eB();$I();i3=b(s(),1)});function scD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG(),[I,D]=e7.useState(L.systemPrompt||""),[B,f]=e7.useState(I.length),[E,M]=e7.useState(null);return BA("confirm:no",$,{context:"Settings"}),e7.default.createElement(n4,{subtitle:"System prompt",footerText:e7.default.createElement(rA,null,e7.default.createElement(s$,{shortcut:"Type",action:"enter text"}),e7.default.createElement(s$,{shortcut:"Enter",action:"continue"}),e7.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},e7.default.createElement(x,{flexDirection:"column",marginTop:1},e7.default.createElement(V,null,"Enter the system prompt for your agent:"),e7.default.createElement(V,{dimColor:!0},"Be comprehensive for best results"),e7.default.createElement(x,{marginTop:1},e7.default.createElement(W9,{value:I,onChange:D,onSubmit:()=>{let U=I.trim();if(!U){M("System prompt is required");return}M(null),A({systemPrompt:U}),H()},placeholder:"You are a helpful code reviewer who...",columns:80,cursorOffset:B,onChangeCursorOffset:f,focus:!0,showCursor:!0})),E&&e7.default.createElement(x,{marginTop:1},e7.default.createElement(V,{color:"error"},E))))}var e7;var ecD=K(()=>{xH();S5();IZ();CC();lB();j0();eB();$I();e7=b(s(),1)});function HlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG(),[I,D]=n3.useState(L.whenToUse||""),[B,f]=n3.useState(I.length),[E,M]=n3.useState(null);return BA("confirm:no",$,{context:"Settings"}),n3.default.createElement(n4,{subtitle:"Description (tell Claude when to use this agent)",footerText:n3.default.createElement(rA,null,n3.default.createElement(s$,{shortcut:"Type",action:"enter text"}),n3.default.createElement(s$,{shortcut:"Enter",action:"continue"}),n3.default.createElement(VA,{action:"confirm:no",context:"Settings",fallback:"Esc",description:"go back"}))},n3.default.createElement(x,{flexDirection:"column",marginTop:1},n3.default.createElement(V,null,"When should Claude use this agent?"),n3.default.createElement(x,{marginTop:1},n3.default.createElement(W9,{value:I,onChange:D,onSubmit:(U)=>{let X=U.trim();if(!X){M("Description is required");return}M(null),A({whenToUse:X}),H()},placeholder:"e.g., use this agent after you're done writing code...",columns:80,cursorOffset:B,onChangeCursorOffset:f,focus:!0,showCursor:!0})),E&&n3.default.createElement(x,{marginTop:1},n3.default.createElement(V,{color:"error"},E))))}var n3;var $lD=K(()=>{xH();S5();IZ();CC();lB();j0();eB();$I();n3=b(s(),1)});function ds({width:H,color:$,char:A="\u2500",padding:L=0}){let{columns:I}=QL(),D=Math.max(0,(H??I)-L);return AlD.default.createElement(V,{color:$,dimColor:!$},A.repeat(D))}var AlD;var pvA=K(()=>{xH();OB();AlD=b(s(),1)});function dV1(H){let $=new Map;return H.forEach((A)=>{if(cw(A)){let L=eF(A.name);if(L?.serverName){let I=$.get(L.serverName)||[];I.push(A),$.set(L.serverName,I)}}}),Array.from($.entries()).map(([A,L])=>({serverName:A,tools:L})).sort((A,L)=>A.serverName.localeCompare(L.serverName))}function lT$({tools:H,initialTools:$,onComplete:A,onCancel:L}){let I=kX.useMemo(()=>A3A({tools:H,isBuiltIn:!1,isAsync:!1}),[H]),D=!$||$.includes("*")?I.map((g)=>g.name):$,[B,f]=kX.useState(D),[E,M]=kX.useState(0),[G,U]=kX.useState(!1),X=kX.useMemo(()=>{let g=new Set(I.map((h)=>h.name));return B.filter((h)=>g.has(h))},[B,I]),J=new Set(X),F=X.length===I.length&&I.length>0,Q=(g)=>{if(!g)return;f((h)=>h.includes(g)?h.filter((p)=>p!==g):[...h,g])},W=(g,h)=>{f((p)=>{if(h){let d=g.filter((k)=>!p.includes(k));return[...p,...d]}else return p.filter((d)=>!g.includes(d))})},P=()=>{let g=I.map((d)=>d.name),p=X.length===g.length&&g.every((d)=>X.includes(d))?void 0:X;A(p)},C=kX.useMemo(()=>{let g=LlD(),h={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return I.forEach((p)=>{if(cw(p))h.mcp.push(p);else if(g.READ_ONLY.toolNames.has(p.name))h.readOnly.push(p);else if(g.EDIT.toolNames.has(p.name))h.edit.push(p);else if(g.EXECUTION.toolNames.has(p.name))h.execution.push(p);else if(p.name!==E0)h.other.push(p)}),h},[I]),Y=(g)=>{let p=g.filter((d)=>J.has(d.name)).length{let d=g.map((k)=>k.name);W(d,p)}},Z=[];Z.push({id:"continue",label:"Continue",action:P,isContinue:!0}),Z.push({id:"bucket-all",label:`${F?pH.checkboxOn:pH.checkboxOff} All tools`,action:()=>{let g=I.map((h)=>h.name);W(g,!F)}});let q=LlD();[{id:"bucket-readonly",name:q.READ_ONLY.name,tools:C.readOnly},{id:"bucket-edit",name:q.EDIT.name,tools:C.edit},{id:"bucket-execution",name:q.EXECUTION.name,tools:C.execution},{id:"bucket-mcp",name:q.MCP.name,tools:C.mcp},{id:"bucket-other",name:q.OTHER.name,tools:C.other}].forEach(({id:g,name:h,tools:p})=>{if(p.length===0)return;let k=p.filter((n)=>J.has(n.name)).length===p.length;Z.push({id:g,label:`${k?pH.checkboxOn:pH.checkboxOff} ${h}`,action:Y(p)})});let j=Z.length;Z.push({id:"toggle-individual",label:G?"Hide advanced options":"Show advanced options",action:()=>{if(U(!G),G&&E>j)M(j)},isToggle:!0});let u=kX.useMemo(()=>dV1(I),[I]);if(G){if(u.length>0)Z.push({id:"mcp-servers-header",label:"MCP Servers:",action:()=>{},isHeader:!0}),u.forEach(({serverName:g,tools:h})=>{let d=h.filter((k)=>J.has(k.name)).length===h.length;Z.push({id:`mcp-server-${g}`,label:`${d?pH.checkboxOn:pH.checkboxOff} ${g} (${h.length} tool${h.length===1?"":"s"})`,action:()=>{let k=h.map((n)=>n.name);W(k,!d)}})}),Z.push({id:"tools-header",label:"Individual Tools:",action:()=>{},isHeader:!0});I.forEach((g)=>{let h=g.name;if(g.name.startsWith("mcp__")){let p=eF(g.name);h=p?`${p.toolName} (${p.serverName})`:g.name}Z.push({id:`tool-${g.name}`,label:`${J.has(g.name)?pH.checkboxOn:pH.checkboxOff} ${h}`,action:()=>Q(g.name)})})}let y=kX.useCallback(()=>{if(L)L();else A($)},[L,A,$]);return BA("confirm:no",y,{context:"Confirmation"}),WL((g,h)=>{if(h.return){let p=Z[E];if(p&&!p.isHeader)p.action()}else if(h.upArrow){let p=E-1;while(p>0&&Z[p]?.isHeader)p--;M(Math.max(0,p))}else if(h.downArrow){let p=E+1;while(p{let p=h+1===E,d=g.isToggle,k=g.isHeader;return kX.default.createElement(kX.default.Fragment,{key:g.id},d&&kX.default.createElement(ds,{width:40}),k&&h>0&&kX.default.createElement(x,{marginTop:1}),kX.default.createElement(V,{color:k?void 0:p?"suggestion":void 0,dimColor:k,bold:d&&p},k?"":p?`${pH.pointer} `:" ",d?`[ ${g.label} ]`:g.label))}),kX.default.createElement(x,{marginTop:1,flexDirection:"column"},kX.default.createElement(V,{dimColor:!0},F?"All tools selected":`${J.size} of ${I.length} tools selected`)))}var kX,LlD=()=>({READ_ONLY:{name:"Read-only tools",toolNames:new Set([rr.name,og.name,DW.name,k8.name,IW.name,T5.name,vC$.name,jC$.name,yC$.name,dp.name,cp.name])},EDIT:{name:"Edit tools",toolNames:new Set([S3.name,h3.name,up.name])},EXECUTION:{name:"Execution tools",toolNames:new Set([aD.name,void 0].filter(Boolean))},MCP:{name:"MCP tools",toolNames:new Set,isMcp:!0},OTHER:{name:"Other tools",toolNames:new Set}});var dvA=K(()=>{xH();xH();$I();jI();pvA();tC();kF();aSH();xFH();BuH();bw();s6H();q5H();bzA();jzA();vzA();gC$();mC$();T9H();ht();hkH();zQ();OBH();kX=b(s(),1)});function IlD({tools:H}){let{goNext:$,goBack:A,updateWizardData:L,wizardData:I}=RG(),D=(f)=>{L({selectedTools:f}),$()},B=I.selectedTools;return t1H.default.createElement(n4,{subtitle:"Select tools",footerText:t1H.default.createElement(rA,null,t1H.default.createElement(s$,{shortcut:"Enter",action:"toggle selection"}),t1H.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),t1H.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},t1H.default.createElement(lT$,{tools:H,initialTools:B,onComplete:D,onCancel:A}))}var t1H;var DlD=K(()=>{dvA();IZ();CC();lB();j0();eB();t1H=b(s(),1)});function iT$({initialModel:H,onComplete:$,onCancel:A}){let L=xz.useMemo(()=>hoL(),[]),I=xz.useMemo(()=>{if(H&&L.some((D)=>D.value===H))return H;return"sonnet"},[H,L]);return xz.createElement(x,{flexDirection:"column"},xz.createElement(x,{marginBottom:1},xz.createElement(V,{dimColor:!0},"Model determines the agent's reasoning capabilities and speed.")),xz.createElement(QA,{options:L,defaultValue:I,onChange:(D)=>{$(D)},onCancel:()=>A?A():$(H)}))}var xz;var cvA=K(()=>{xH();N1();aI();xz=b(s(),1)});function BlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG(),I=(D)=>{A({selectedModel:D}),H()};return s1H.default.createElement(n4,{subtitle:"Select model",footerText:s1H.default.createElement(rA,null,s1H.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),s1H.default.createElement(s$,{shortcut:"Enter",action:"select"}),s1H.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},s1H.default.createElement(iT$,{initialModel:L.selectedModel,onComplete:I,onCancel:$}))}var s1H;var flD=K(()=>{cvA();IZ();CC();lB();j0();eB();s1H=b(s(),1)});function nT$({agentName:H,currentColor:$="automatic",onConfirm:A}){let[L,I]=ElD.useState(Math.max(0,MPH.findIndex((B)=>B===$)));WL((B,f)=>{if(f.upArrow)I((E)=>E>0?E-1:MPH.length-1);else if(f.downArrow)I((E)=>E{let E=f===L;return DZ.default.createElement(x,{key:B,flexDirection:"row",gap:1},DZ.default.createElement(V,{color:E?"suggestion":void 0},E?pH.pointer:" "),B==="automatic"?DZ.default.createElement(V,{bold:E},"Automatic color"):DZ.default.createElement(x,{gap:1},DZ.default.createElement(V,{backgroundColor:b5[B],color:"inverseText"}," "),DZ.default.createElement(V,{bold:E},B.charAt(0).toUpperCase()+B.slice(1))))})),DZ.default.createElement(x,{marginTop:1},DZ.default.createElement(V,null,"Preview: "),D===void 0||D==="automatic"?DZ.default.createElement(V,{inverse:!0,bold:!0}," ","@",H," "):DZ.default.createElement(V,{backgroundColor:b5[D],color:"inverseText",bold:!0}," ","@",H," ")))}var DZ,ElD,MPH;var lvA=K(()=>{xH();q7();jI();DZ=b(s(),1),ElD=b(s(),1),MPH=["automatic",...h5]});function MlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG();BA("confirm:no",$,{context:"Confirmation"});let I=(D)=>{A({selectedColor:D,finalAgent:{agentType:L.agentType,whenToUse:L.whenToUse,getSystemPrompt:()=>L.systemPrompt,tools:L.selectedTools,...L.selectedModel?{model:L.selectedModel}:{},...D?{color:D}:{},source:L.location}}),H()};return cs.default.createElement(n4,{subtitle:"Choose background color",footerText:cs.default.createElement(rA,null,cs.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),cs.default.createElement(s$,{shortcut:"Enter",action:"select"}),cs.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},cs.default.createElement(x,{marginTop:1},cs.default.createElement(nT$,{agentName:L.agentType||"agent",currentColor:"automatic",onConfirm:I})))}var cs;var GlD=K(()=>{xH();lvA();IZ();CC();lB();j0();eB();$I();cs=b(s(),1)});function UlD(){let{goNext:H,goBack:$,updateWizardData:A,wizardData:L}=RG();BA("confirm:no",$,{context:"Confirmation"});let D=L.location==="userSettings"?[{label:"Enable (~/.claude/agent-memory/) (Recommended)",value:"user"},{label:"None (no persistent memory)",value:"none"},{label:"Project scope (.claude/agent-memory/)",value:"project"},{label:"Local scope (.claude/agent-memory-local/)",value:"local"}]:[{label:"Enable (.claude/agent-memory/) (Recommended)",value:"project"},{label:"None (no persistent memory)",value:"none"},{label:"User scope (~/.claude/agent-memory/)",value:"user"},{label:"Local scope (.claude/agent-memory-local/)",value:"local"}];return ls.default.createElement(n4,{subtitle:"Configure agent memory",footerText:ls.default.createElement(rA,null,ls.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),ls.default.createElement(s$,{shortcut:"Enter",action:"select"}),ls.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}))},ls.default.createElement(x,{marginTop:1},ls.default.createElement(QA,{key:"memory-select",options:D,onChange:(f)=>{let E=f==="none"?void 0:f,M=L.finalAgent?.agentType;A({selectedMemory:E,finalAgent:L.finalAgent?{...L.finalAgent,memory:E,getSystemPrompt:PG()&&E&&M?()=>L.systemPrompt+` `)}`:void 0;$(Y??"Agents dialog dismissed",{display:G.length===0?"system":void 0})},onSelect:(Y)=>L({mode:"agent-menu",agent:Y,previousMode:A}),onCreateNew:()=>L({mode:"create-agent"}),changes:G}),zD.createElement(GPH,null))}case"create-agent":return zD.createElement(WlD,{tools:X,existingAgents:M,onComplete:F,onCancel:()=>L({mode:"list-agents",source:"all"})});case"agent-menu":{let P=E.find((q)=>q.agentType===A.agent.agentType&&q.source===A.agent.source)||A.agent,C=P.source==="built-in",Y=[{label:"View agent",value:"view"},...!C?[{label:"Edit agent",value:"edit"},{label:"Delete agent",value:"delete"}]:[],{label:"Back",value:"back"}],Z=(q)=>{switch(q){case"view":L({mode:"view-agent",agent:P,previousMode:A.previousMode});break;case"edit":L({mode:"edit-agent",agent:P,previousMode:A});break;case"delete":L({mode:"delete-confirm",agent:P,previousMode:A});break;case"back":L(A.previousMode);break}};return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:A.agent.agentType},zD.createElement(x,{flexDirection:"column",marginTop:1},zD.createElement(QA,{options:Y,onChange:Z,onCancel:()=>L(A.previousMode)}),G.length>0&&zD.createElement(x,{marginTop:1},zD.createElement(V,{dimColor:!0},G[G.length-1])))),zD.createElement(GPH,null))}case"view-agent":{let P=E.find((C)=>C.agentType===A.agent.agentType&&C.source===A.agent.source)||A.agent;return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:P.agentType},zD.createElement(YlD,{agent:P,tools:X,allAgents:E,onBack:()=>L({mode:"agent-menu",agent:P,previousMode:A.previousMode})})),zD.createElement(GPH,{instructions:"Press Enter or Esc to go back"}))}case"delete-confirm":{let W=[{label:"Yes, delete",value:"yes"},{label:"No, cancel",value:"no"}];return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:"Delete agent",titleColor:"error",borderColor:"error"},zD.createElement(V,null,"Are you sure you want to delete the agent"," ",zD.createElement(V,{bold:!0},A.agent.agentType),"?"),zD.createElement(x,{marginTop:1},zD.createElement(V,{dimColor:!0},"Source: ",A.agent.source)),zD.createElement(x,{marginTop:1},zD.createElement(QA,{options:W,onChange:(P)=>{if(P==="yes")Q(A.agent);else if("previousMode"in A)L(A.previousMode)},onCancel:()=>{if("previousMode"in A)L(A.previousMode)}}))),zD.createElement(GPH,{instructions:"Press \u2191\u2193 to navigate, Enter to select, Esc to cancel"}))}case"edit-agent":{let P=E.find((C)=>C.agentType===A.agent.agentType&&C.source===A.agent.source)||A.agent;return zD.createElement(zD.Fragment,null,zD.createElement(gs,{title:`Edit agent: ${P.agentType}`},zD.createElement(PlD,{agent:P,tools:X,onSaved:(C)=>{F(C),L(A.previousMode)},onBack:()=>L(A.previousMode)})),zD.createElement(GPH,null))}default:return null}}var zD,ns;var TlD=K(()=>{xH();$I();r0();UM();kT();fPH();N1();kcD();VlD();_lD();ClD();_$();wlD();jvA();pL();ivA();zD=b(s(),1),ns=b(s(),1)});var zlD={};XA(zlD,{call:()=>cV1});async function cV1(H,$){let L=(await $.getAppState()).toolPermissionContext,I=yK(L);return nvA.createElement(qlD,{tools:I,onExit:H})}var nvA;var NlD=K(()=>{TlD();g7();nvA=b(s(),1)});var lV1,OlD;var xlD=K(()=>{lV1={type:"local-jsx",name:"agents",description:"Manage agent configurations",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (NlD(),zlD)),userFacingName(){return"agents"}},OlD=lV1});var SlD={};XA(SlD,{call:()=>iV1});async function iV1(H,$,A){return rvA.createElement(abD,{onComplete:H,args:A})}var rvA;var jlD=K(()=>{gRA();rvA=b(s(),1)});var nV1,RlD;var ylD=K(()=>{nV1={type:"local-jsx",name:"plugin",aliases:["plugins","marketplace"],description:"Manage Claude Code plugins",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (jlD(),SlD)),userFacingName(){return"plugin"}},RlD=nV1});var vlD={};XA(vlD,{call:()=>rV1});async function rV1(H,$){if(yD("rewind"),$.openMessageSelector)$.openMessageSelector();return{type:"skip"}}var hlD=K(()=>{yE()});var aV1,blD;var klD=K(()=>{aV1={description:"Restore the code and/or conversation to a previous point",name:"rewind",aliases:["checkpoint"],userFacingName:()=>"rewind",argumentHint:"",isEnabled:()=>!0,type:"local",isHidden:!1,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (hlD(),vlD))},blD=aV1});var ulD=()=>{};var glD=()=>{};var mlD=()=>{};var plD=K(()=>{g$()});var dlD=()=>{};function clD(){let H=vL.isSandboxingEnabled(),$=vL.checkDependencies(),A=$.warnings.length>0?T0.createElement(x,{marginTop:1,flexDirection:"column"},$.warnings.map((M,G)=>T0.createElement(V,{key:G,dimColor:!0},M))):null;if(!H)return T0.createElement(x,{flexDirection:"column",paddingY:1},T0.createElement(V,{color:"subtle"},"Sandbox is not enabled"),A);let L=vL.getFsReadConfig(),I=vL.getFsWriteConfig(),D=vL.getNetworkRestrictionConfig(),B=vL.getAllowUnixSockets(),f=vL.getExcludedCommands(),E=vL.getLinuxGlobPatternWarnings();return T0.createElement(x,{flexDirection:"column",paddingY:1},T0.createElement(x,{flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Excluded Commands:"),T0.createElement(V,{dimColor:!0},f.length>0?f.join(", "):"None")),L.denyOnly.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Filesystem Read Restrictions:"),T0.createElement(V,{dimColor:!0},"Denied: ",L.denyOnly.join(", "))),I.allowOnly.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Filesystem Write Restrictions:"),T0.createElement(V,{dimColor:!0},"Allowed: ",I.allowOnly.join(", ")),I.denyWithinAllow.length>0&&T0.createElement(V,{dimColor:!0},"Denied within allowed: ",I.denyWithinAllow.join(", "))),(D.allowedHosts&&D.allowedHosts.length>0||D.deniedHosts&&D.deniedHosts.length>0)&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Network Restrictions",PzH()?" (Managed)":"",":"),D.allowedHosts&&D.allowedHosts.length>0&&T0.createElement(V,{dimColor:!0},"Allowed: ",D.allowedHosts.join(", ")),D.deniedHosts&&D.deniedHosts.length>0&&T0.createElement(V,{dimColor:!0},"Denied: ",D.deniedHosts.join(", "))),B&&B.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"permission"},"Allowed Unix Sockets:"),T0.createElement(V,{dimColor:!0},B.join(", "))),E.length>0&&T0.createElement(x,{marginTop:1,flexDirection:"column"},T0.createElement(V,{bold:!0,color:"warning"},"\u26A0 Warning: Glob patterns not fully supported on Linux"),T0.createElement(V,{dimColor:!0},"The following patterns will be ignored:"," ",E.slice(0,3).join(", "),E.length>3&&` (${E.length-3} more)`)),A)}var T0;var llD=K(()=>{xH();EM();T0=b(s(),1)});function ilD({onComplete:H}){let[$]=_I(),A=vL.isSandboxingEnabled(),L=vL.areUnsandboxedCommandsAllowed(),I=vL.areSandboxSettingsLockedByPolicy(),D=L?"open":"closed",B=ZL("success",$)("(current)"),f=[{label:D==="open"?`Allow unsandboxed fallback ${B}`:"Allow unsandboxed fallback",value:"open"},{label:D==="closed"?`Strict sandbox mode ${B}`:"Strict sandbox mode",value:"closed"}];async function E(M){let G=M;await vL.setSandboxSettings({allowUnsandboxedCommands:G==="open"}),H(G==="open"?"\u2713 Unsandboxed fallback allowed - commands can run outside sandbox when necessary":"\u2713 Strict sandbox mode - all commands must run in sandbox or be excluded via the `excludedCommands` option")}if(!A)return GW.default.createElement(x,{flexDirection:"column",paddingY:1},GW.default.createElement(V,{color:"subtle"},"Sandbox is not enabled. Enable sandbox to configure override settings."));if(I)return GW.default.createElement(x,{flexDirection:"column",paddingY:1},GW.default.createElement(V,{color:"subtle"},"Override settings are managed by a higher-priority configuration and cannot be changed locally."),GW.default.createElement(x,{marginTop:1},GW.default.createElement(V,{dimColor:!0},"Current setting:"," ",D==="closed"?"Strict sandbox mode":"Allow unsandboxed fallback")));return GW.default.createElement(x,{flexDirection:"column",paddingY:1},GW.default.createElement(x,{marginBottom:1},GW.default.createElement(V,{bold:!0},"Configure Overrides:")),GW.default.createElement(QA,{options:f,onChange:E,onCancel:()=>H(void 0,{display:"skip"})}),GW.default.createElement(x,{flexDirection:"column",marginTop:1,gap:1},GW.default.createElement(V,{dimColor:!0},GW.default.createElement(V,{bold:!0,dimColor:!0},"Allow unsandboxed fallback:")," ","When a command fails due to sandbox restrictions, Claude can retry with dangerouslyDisableSandbox to run outside the sandbox (falling back to default permissions)."),GW.default.createElement(V,{dimColor:!0},GW.default.createElement(V,{bold:!0,dimColor:!0},"Strict sandbox mode:")," ","All bash commands invoked by the model must run in the sandbox unless they are explicitly listed in excludedCommands."),GW.default.createElement(V,{dimColor:!0},"Learn more:"," ",GW.default.createElement(dI,{url:"https://code.claude.com/docs/en/sandboxing#configure-sandboxing"},"code.claude.com/docs/en/sandboxing#configure-sandboxing"))))}var GW;var nlD=K(()=>{xH();N1();EM();xH();GW=b(s(),1)});function avA({depCheck:H}){let $=H.errors.some((I)=>I.includes("bwrap")),A=H.errors.some((I)=>I.includes("socat")),L=H.warnings.length>0;return hJ.default.createElement(x,{flexDirection:"column",paddingY:1,gap:1},hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,null,"bubblewrap (bwrap):"," ",$?hJ.default.createElement(V,{color:"error"},"not installed"):hJ.default.createElement(V,{color:"success"},"installed")),$&&hJ.default.createElement(V,{dimColor:!0}," ","\xB7 apt install bubblewrap")),hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,null,"socat:"," ",A?hJ.default.createElement(V,{color:"error"},"not installed"):hJ.default.createElement(V,{color:"success"},"installed")),A&&hJ.default.createElement(V,{dimColor:!0}," ","\xB7 apt install socat")),hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,null,"seccomp filter:"," ",L?hJ.default.createElement(V,{color:"warning"},"not installed"):hJ.default.createElement(V,{color:"success"},"installed"),L&&hJ.default.createElement(V,{dimColor:!0}," (required to block unix domain sockets)")),L&&hJ.default.createElement(x,{flexDirection:"column"},hJ.default.createElement(V,{dimColor:!0}," ","\xB7 npm install -g @anthropic-ai/sandbox-runtime"),hJ.default.createElement(V,{dimColor:!0}," ","\xB7 or copy vendor/seccomp/* from sandbox-runtime and set"),hJ.default.createElement(V,{dimColor:!0}," ","sandbox.seccomp.bpfPath and applyPath in settings.json"))))}var hJ;var rlD=K(()=>{xH();hJ=b(s(),1)});function alD({onComplete:H,depCheck:$}){let[A]=_I(),L=vL.isSandboxingEnabled(),I=vL.isAutoAllowBashIfSandboxedEnabled(),D=$.warnings.length>0,f=VL().sandbox?.network?.allowAllUnixSockets,E=D&&!f,G=(()=>{if(!L)return"disabled";if(I)return"auto-allow";return"regular"})(),U=ZL("success",A)("(current)"),X=[{label:G==="auto-allow"?`Sandbox BashTool, with auto-allow ${U}`:"Sandbox BashTool, with auto-allow",value:"auto-allow"},{label:G==="regular"?`Sandbox BashTool, with regular permissions ${U}`:"Sandbox BashTool, with regular permissions",value:"regular"},{label:G==="disabled"?`No Sandbox ${U}`:"No Sandbox",value:"disabled"}];async function J(Y){switch(Y){case"auto-allow":await vL.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!0}),H("\u2713 Sandbox enabled with auto-allow for bash commands");break;case"regular":await vL.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!1}),H("\u2713 Sandbox enabled with regular bash permissions");break;case"disabled":await vL.setSandboxSettings({enabled:!1,autoAllowBashIfSandboxed:!1}),H("\u25CB Sandbox disabled");break}}bI({"confirm:no":()=>H(void 0,{display:"skip"})},{context:"Settings"});let F=yG.default.createElement(WU,{key:"mode",title:"Mode"},yG.default.createElement(x,{flexDirection:"column",paddingY:1},E&&yG.default.createElement(x,{marginBottom:1},yG.default.createElement(V,{color:"warning"},"Cannot block unix domain sockets (see Dependencies tab)")),yG.default.createElement(x,{marginBottom:1},yG.default.createElement(V,{bold:!0},"Configure Mode:")),yG.default.createElement(QA,{options:X,onChange:J,onCancel:()=>H(void 0,{display:"skip"})}),yG.default.createElement(x,{flexDirection:"column",marginTop:1,gap:1},yG.default.createElement(V,{dimColor:!0},yG.default.createElement(V,{bold:!0,dimColor:!0},"Auto-allow mode:")," ","Commands will try to run in the sandbox automatically, and attempts to run outside of the sandbox fallback to regular permissions. Explicit ask/deny rules are always respected."),yG.default.createElement(V,{dimColor:!0},"Learn more:"," ",yG.default.createElement(dI,{url:"https://code.claude.com/docs/en/sandboxing"},"code.claude.com/docs/en/sandboxing"))))),Q=yG.default.createElement(WU,{key:"overrides",title:"Overrides"},yG.default.createElement(ilD,{onComplete:H})),W=yG.default.createElement(WU,{key:"config",title:"Config"},yG.default.createElement(clD,null)),C=$.errors.length>0?[yG.default.createElement(WU,{key:"dependencies",title:"Dependencies"},yG.default.createElement(avA,{depCheck:$}))]:[F,...D?[yG.default.createElement(WU,{key:"dependencies",title:"Dependencies"},yG.default.createElement(avA,{depCheck:$}))]:[],Q,W];return yG.default.createElement(x,{flexDirection:"column"},yG.default.createElement(Zz,{title:"Sandbox:",color:"permission",defaultTab:"Mode"},C))}var yG;var olD=K(()=>{xH();N1();EM();J1H();xH();llD();nlD();rlD();$I();mL();yG=b(s(),1)});var elD={};XA(elD,{call:()=>oV1});async function oV1(H,$,A){let I=VL().theme||"light",D=oA();if(!vL.isSupportedPlatform()){let E=D==="wsl"?"Error: Sandboxing requires WSL2. WSL1 is not supported.":"Error: Sandboxing is currently only supported on macOS, Linux, and WSL2.",M=ZL("error",I)(E);return H(M),null}let B=vL.checkDependencies();if(!vL.isPlatformInEnabledList()){let E=ZL("error",I)(`Error: Sandboxing is disabled for this platform (${D}) via the enabledPlatforms setting.`);return H(E),null}if(vL.areSandboxSettingsLockedByPolicy()){let E=ZL("error",I)("Error: Sandbox settings are overridden by a higher-priority configuration and cannot be changed locally.");return H(E),null}let f=A?.trim()||"";if(!f)return slD.default.createElement(alD,{onComplete:H,depCheck:B});if(f){let M=f.split(" ")[0];if(M==="exclude"){let G=f.slice(8).trim();if(!G){let Q=ZL("error",I)('Error: Please provide a command pattern to exclude (e.g., /sandbox exclude "npm run test:*")');return H(Q),null}let U=G.replace(/^["']|["']$/g,"");maL(U);let X=aM("localSettings"),J=X?tlD.relative(HR(),X):".claude/settings.local.json",F=ZL("success",I)(`Added "${U}" to excluded commands in ${J}`);return H(F),null}else{let G=ZL("error",I)(`Error: Unknown subcommand "${M}". Available subcommand: exclude`);return H(G),null}}return null}var tlD,slD;var HiD=K(()=>{EM();xH();mL();g$();olD();Z9();tlD=b(require("path")),slD=b(s(),1)});var tV1,$iD;var AiD=K(()=>{EM();jI();tV1={name:"sandbox",get description(){let H=vL.isSandboxingEnabled(),$=vL.isAutoAllowBashIfSandboxedEnabled(),A=vL.areUnsandboxedCommandsAllowed(),L=vL.areSandboxSettingsLockedByPolicy(),I=vL.checkDependencies().errors.length===0,D;if(!I)D=pH.warning;else D=H?pH.tick:pH.circle;let B="sandbox disabled";if(H)B=$?"sandbox enabled (auto-allow)":"sandbox enabled",B+=A?", fallback allowed":"";if(L)B+=" (managed)";return`${D} ${B} (\u23CE to configure)`},argumentHint:'exclude "command pattern"',isEnabled:()=>!0,isHidden:!vL.isSupportedPlatform()||!vL.isPlatformInEnabledList(),immediate:!0,type:"local-jsx",userFacingName:()=>"sandbox",load:()=>Promise.resolve().then(() => (HiD(),elD))},$iD=tV1});class ovA{ws=null;connected=!1;authenticated=!1;connecting=!1;reconnectTimer=null;reconnectAttempts=0;pendingCalls=new Map;notificationHandler=null;context;permissionMode="ask";allowedDomains;tabsContextCollectionTimeoutMs=2000;toolCallTimeoutMs=120000;constructor(H){if(this.context=H,H.initialPermissionMode)this.permissionMode=H.initialPermissionMode}async ensureConnected(){let{logger:H,serverName:$}=this.context;if(H.info(`[${$}] ensureConnected called, connected=${this.connected}, authenticated=${this.authenticated}, wsState=${this.ws?.readyState}`),this.connected&&this.authenticated&&this.ws?.readyState===smH.default.OPEN)return H.info(`[${$}] Already connected and authenticated`),!0;if(!this.connecting)H.info(`[${$}] Not connecting, starting connection...`),await this.connect();else H.info(`[${$}] Already connecting, waiting...`);return new Promise((A)=>{let L=setTimeout(()=>{H.info(`[${$}] Connection timeout, connected=${this.connected}, authenticated=${this.authenticated}`),A(!1)},1e4),I=()=>{if(this.connected&&this.authenticated)H.info(`[${$}] Connection successful`),clearTimeout(L),A(!0);else if(!this.connecting)H.info(`[${$}] No longer connecting, giving up`),clearTimeout(L),A(!1);else setTimeout(I,200)};I()})}async callTool(H,$){let{logger:A,serverName:L}=this.context;if(!this.ws||this.ws.readyState!==smH.default.OPEN)throw Error(`[${L}] Bridge not connected`);let I=crypto.randomUUID(),D=H==="tabs_context_mcp";return new Promise((B,f)=>{let E=setTimeout(()=>{let G=this.pendingCalls.get(I);if(G)if(this.pendingCalls.delete(I),D&&G.results.length>0)B(this.mergeTabsResults(G.results));else f(Error(`[${L}] Tool call timed out: ${H}`))},D?this.tabsContextCollectionTimeoutMs:this.toolCallTimeoutMs);this.pendingCalls.set(I,{resolve:B,reject:f,timer:E,results:[],isTabsContext:D});let M={type:"tool_call",tool_use_id:I,client_type:this.context.clientTypeId,tool:H,args:$,permission_mode:this.permissionMode};if(this.allowedDomains?.length)M.allowed_domains=this.allowedDomains;A.debug(`[${L}] Sending tool_call: ${H} (${I.slice(0,8)})`),this.ws.send(JSON.stringify(M))})}isConnected(){return this.connected&&this.authenticated&&this.ws?.readyState===smH.default.OPEN}disconnect(){this.cleanup()}setNotificationHandler(H){this.notificationHandler=H}async setPermissionMode(H,$){this.permissionMode=H,this.allowedDomains=$}async connect(){let{logger:H,serverName:$,bridgeConfig:A}=this.context;if(!A){H.error(`[${$}] No bridge config provided`);return}if(this.connecting)return;this.connecting=!0,this.authenticated=!1,this.closeSocket();let L,I;if(A.devUserId)L=A.devUserId;else{let B=await A.getUserId();if(!B){H.error(`[${$}] No user ID available`),this.connecting=!1,this.context.onAuthenticationError?.();return}if(L=B,I=await A.getOAuthToken(),!I){H.error(`[${$}] No OAuth token available`),this.connecting=!1,this.context.onAuthenticationError?.();return}}let D=`${A.url}/chrome/${L}`;H.info(`[${$}] Connecting to bridge: ${D}`);try{this.ws=new smH.default(D)}catch(B){this.connecting=!1,H.error(`[${$}] Failed to create WebSocket:`,B),this.scheduleReconnect();return}this.ws.on("open",()=>{H.info(`[${$}] WebSocket connected, sending connect`);let B={type:"connect",client_type:this.context.clientTypeId};if(A.devUserId)B.dev_user_id=A.devUserId;else B.oauth_token=I;this.ws?.send(JSON.stringify(B))}),this.ws.on("message",(B)=>{try{let f=JSON.parse(B.toString());H.debug(`[${$}] Bridge received: ${JSON.stringify(f)}`),this.handleMessage(f)}catch(f){H.error(`[${$}] Failed to parse message:`,f)}}),this.ws.on("close",(B)=>{H.info(`[${$}] Bridge connection closed (code: ${B})`),this.connected=!1,this.authenticated=!1,this.connecting=!1,this.scheduleReconnect()}),this.ws.on("error",(B)=>{H.error(`[${$}] Bridge WebSocket error: ${B.message}`),this.connected=!1,this.authenticated=!1,this.connecting=!1})}handleMessage(H){let{logger:$,serverName:A}=this.context;switch(H.type){case"paired":$.info(`[${A}] Paired with Chrome extension`),this.connected=!0,this.authenticated=!0,this.connecting=!1,this.reconnectAttempts=0;break;case"waiting":$.info(`[${A}] Waiting for Chrome extension to connect`),this.connected=!0,this.authenticated=!0,this.connecting=!1,this.reconnectAttempts=0;break;case"peer_connected":$.info(`[${A}] Chrome extension connected`);break;case"peer_disconnected":$.info(`[${A}] Chrome extension disconnected`);break;case"ping":this.ws?.send(JSON.stringify({type:"pong"}));break;case"pong":break;case"tool_result":this.handleToolResult(H);break;case"notification":if(this.notificationHandler)this.notificationHandler({method:H.method,params:H.params});break;case"error":$.error(`[${A}] Bridge error: ${H.error}`);break;default:$.debug(`[${A}] Unknown bridge message type: ${H.type}`)}}handleToolResult(H){let $=H.tool_use_id;if(!$)return;let A=this.pendingCalls.get($);if(!A)return;let L=this.normalizeBridgeResponse(H);if(A.isTabsContext)A.results.push(L);else clearTimeout(A.timer),this.pendingCalls.delete($),A.resolve(L)}normalizeBridgeResponse(H){if(H.result||H.error)return H;if(H.content){if(H.is_error)return{error:{content:H.content}};return{result:{content:H.content}}}return H}mergeTabsResults(H){let $=[];for(let A of H){let D=A.result?.content;if(!D||!Array.isArray(D))continue;for(let B of D)if(B.type==="text"&&B.text)try{let f=JSON.parse(B.text);if(Array.isArray(f))$.push(...f);else if(f?.availableTabs&&Array.isArray(f.availableTabs))$.push(...f.availableTabs)}catch{}}if($.length>0){let A=$.map((L)=>{let I=L;return` \u2022 tabId ${I.tabId}: "${I.title}" (${I.url})`}).join(` * Make sure to click any buttons, links, icons, etc with the cursor tip in the center of the element. Don't click boxes on their edges unless asked.`,inputSchema:{type:"object",properties:{action:{type:"string",enum:["left_click","right_click","type","screenshot","wait","scroll","key","left_click_drag","double_click","triple_click","zoom","scroll_to","hover"],description:"The action to perform:\n* `left_click`: Click the left mouse button at the specified coordinates.\n* `right_click`: Click the right mouse button at the specified coordinates to open context menus.\n* `double_click`: Double-click the left mouse button at the specified coordinates.\n* `triple_click`: Triple-click the left mouse button at the specified coordinates.\n* `type`: Type a string of text.\n* `screenshot`: Take a screenshot of the screen.\n* `wait`: Wait for a specified number of seconds.\n* `scroll`: Scroll up, down, left, or right at the specified coordinates.\n* `key`: Press a specific keyboard key.\n* `left_click_drag`: Drag from start_coordinate to coordinate.\n* `zoom`: Take a screenshot of a specific region for closer inspection.\n* `scroll_to`: Scroll an element into view using its element reference ID from read_page or find tools.\n* `hover`: Move the mouse cursor to the specified coordinates or element without clicking. Useful for revealing tooltips, dropdown menus, or triggering hover states."},coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates. Required for `left_click`, `right_click`, `double_click`, `triple_click`, and `scroll`. For `left_click_drag`, this is the end position."},text:{type:"string",description:'The text to type (for `type` action) or the key(s) to press (for `key` action). For `key` action: Provide space-separated keys (e.g., "Backspace Backspace Delete"). Supports keyboard shortcuts using the platform\'s modifier key (use "cmd" on Mac, "ctrl" on Windows/Linux, e.g., "cmd+a" or "ctrl+a" for select all).'},duration:{type:"number",minimum:0,maximum:30,description:"The number of seconds to wait. Required for `wait`. Maximum 30 seconds."},scroll_direction:{type:"string",enum:["up","down","left","right"],description:"The direction to scroll. Required for `scroll`."},scroll_amount:{type:"number",minimum:1,maximum:10,description:"The number of scroll wheel ticks. Optional for `scroll`, defaults to 3."},start_coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y): The starting coordinates for `left_click_drag`."},region:{type:"array",items:{type:"number"},minItems:4,maxItems:4,description:"(x0, y0, x1, y1): The rectangular region to capture for `zoom`. Coordinates define a rectangle from top-left (x0, y0) to bottom-right (x1, y1) in pixels from the viewport origin. Required for `zoom` action. Useful for inspecting small UI elements like icons, buttons, or text."},repeat:{type:"number",minimum:1,maximum:100,description:"Number of times to repeat the key sequence. Only applicable for `key` action. Must be a positive integer between 1 and 100. Default is 1. Useful for navigation tasks like pressing arrow keys multiple times."},ref:{type:"string",description:'Element reference ID from read_page or find tools (e.g., "ref_1", "ref_2"). Required for `scroll_to` action. Can be used as alternative to `coordinate` for click actions.'},modifiers:{type:"string",description:'Modifier keys for click actions. Supports: "ctrl", "shift", "alt", "cmd" (or "meta"), "win" (or "windows"). Can be combined with "+" (e.g., "ctrl+shift", "cmd+alt"). Optional.'},tabId:{type:"number",description:"Tab ID to execute the action on. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["action","tabId"]}},{name:"navigate",description:"Navigate to a URL, or go forward/back in browser history. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{url:{type:"string",description:'The URL to navigate to. Can be provided with or without protocol (defaults to https://). Use "forward" to go forward in history or "back" to go back in history.'},tabId:{type:"number",description:"Tab ID to navigate. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["url","tabId"]}},{name:"resize_window",description:"Resize the current browser window to specified dimensions. Useful for testing responsive designs or setting up specific screen sizes. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{width:{type:"number",description:"Target window width in pixels"},height:{type:"number",description:"Target window height in pixels"},tabId:{type:"number",description:"Tab ID to get the window for. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["width","height","tabId"]}},{name:"gif_creator",description:"Manage GIF recording and export for browser automation sessions. Control when to start/stop recording browser actions (clicks, scrolls, navigation), then export as an animated GIF with visual overlays (click indicators, action labels, progress bar, watermark). All operations are scoped to the tab's group. When starting recording, take a screenshot immediately after to capture the initial state as the first frame. When stopping recording, take a screenshot immediately before to capture the final state as the last frame. For export, either provide 'coordinate' to drag/drop upload to a page element, or set 'download: true' to download the GIF.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["start_recording","stop_recording","export","clear"],description:"Action to perform: 'start_recording' (begin capturing), 'stop_recording' (stop capturing but keep frames), 'export' (generate and export GIF), 'clear' (discard frames)"},tabId:{type:"number",description:"Tab ID to identify which tab group this operation applies to"},download:{type:"boolean",description:"Always set this to true for the 'export' action only. This causes the gif to be downloaded in the browser."},filename:{type:"string",description:"Optional filename for exported GIF (default: 'recording-[timestamp].gif'). For 'export' action only."},options:{type:"object",description:"Optional GIF enhancement options for 'export' action. Properties: showClickIndicators (bool), showDragPaths (bool), showActionLabels (bool), showProgressBar (bool), showWatermark (bool), quality (number 1-30). All default to true except quality (default: 10).",properties:{showClickIndicators:{type:"boolean",description:"Show orange circles at click locations (default: true)"},showDragPaths:{type:"boolean",description:"Show red arrows for drag actions (default: true)"},showActionLabels:{type:"boolean",description:"Show black labels describing actions (default: true)"},showProgressBar:{type:"boolean",description:"Show orange progress bar at bottom (default: true)"},showWatermark:{type:"boolean",description:"Show Claude logo watermark (default: true)"},quality:{type:"number",description:"GIF compression quality, 1-30 (lower = better quality, slower encoding). Default: 10"}}}},required:["action","tabId"]}},{name:"upload_image",description:"Upload a previously captured screenshot or user-uploaded image to a file input or drag & drop target. Supports two approaches: (1) ref - for targeting specific elements, especially hidden file inputs, (2) coordinate - for drag & drop to visible locations like Google Docs. Provide either ref or coordinate, not both.",inputSchema:{type:"object",properties:{imageId:{type:"string",description:"ID of a previously captured screenshot (from the computer tool's screenshot action) or a user-uploaded image"},ref:{type:"string",description:'Element reference ID from read_page or find tools (e.g., "ref_1", "ref_2"). Use this for file inputs (especially hidden ones) or specific elements. Provide either ref or coordinate, not both.'},coordinate:{type:"array",items:{type:"number"},description:"Viewport coordinates [x, y] for drag & drop to a visible location. Use this for drag & drop targets like Google Docs. Provide either ref or coordinate, not both."},tabId:{type:"number",description:"Tab ID where the target element is located. This is where the image will be uploaded to."},filename:{type:"string",description:'Optional filename for the uploaded file (default: "image.png")'}},required:["imageId","tabId"]}},{name:"get_page_text",description:"Extract raw text content from the page, prioritizing article content. Ideal for reading articles, blog posts, or other text-heavy pages. Returns plain text without HTML formatting. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to extract text from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["tabId"]}},{name:"tabs_context_mcp",title:"Tabs Context",description:"Get context information about the current MCP tab group. Returns all tab IDs inside the group if it exists. CRITICAL: You must get the context at least once before using other browser automation tools so you know what tabs exist. Each new conversation should create its own new tab (using tabs_create_mcp) rather than reusing existing tabs, unless the user explicitly asks to use an existing tab.",inputSchema:{type:"object",properties:{createIfEmpty:{type:"boolean",description:"Creates a new MCP tab group if none exists, creates a new Window with a new tab group containing an empty tab (which can be used for this conversation). If a MCP tab group already exists, this parameter has no effect."}},required:[]}},{name:"tabs_create_mcp",title:"Tabs Create",description:"Creates a new empty tab in the MCP tab group. CRITICAL: You must get the context using tabs_context_mcp at least once before using other browser automation tools so you know what tabs exist.",inputSchema:{type:"object",properties:{},required:[]}},{name:"update_plan",description:"Present a plan to the user for approval before taking actions. The user will see the domains you intend to visit and your approach. Once approved, you can proceed with actions on the approved domains without additional permission prompts.",inputSchema:{type:"object",properties:{domains:{type:"array",items:{type:"string"},description:"List of domains you will visit (e.g., ['github.com', 'stackoverflow.com']). These domains will be approved for the session when the user accepts the plan."},approach:{type:"array",items:{type:"string"},description:"High-level description of what you will do. Focus on outcomes and key actions, not implementation details. Be concise - aim for 3-7 items."}},required:["domains","approach"]}},{name:"read_console_messages",description:"Read browser console messages (console.log, console.error, console.warn, etc.) from a specific tab. Useful for debugging JavaScript errors, viewing application logs, or understanding what's happening in the browser console. Returns console messages from the current domain only. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs. IMPORTANT: Always provide a pattern to filter messages - without a pattern, you may get too many irrelevant messages.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to read console messages from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."},onlyErrors:{type:"boolean",description:"If true, only return error and exception messages. Default is false (return all message types)."},clear:{type:"boolean",description:"If true, clear the console messages after reading to avoid duplicates on subsequent calls. Default is false."},pattern:{type:"string",description:"Regex pattern to filter console messages. Only messages matching this pattern will be returned (e.g., 'error|warning' to find errors and warnings, 'MyApp' to filter app-specific logs). You should always provide a pattern to avoid getting too many irrelevant messages."},limit:{type:"number",description:"Maximum number of messages to return. Defaults to 100. Increase only if you need more results."}},required:["tabId"]}},{name:"read_network_requests",description:"Read HTTP network requests (XHR, Fetch, documents, images, etc.) from a specific tab. Useful for debugging API calls, monitoring network activity, or understanding what requests a page is making. Returns all network requests made by the current page, including cross-origin requests. Requests are automatically cleared when the page navigates to a different domain. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to read network requests from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."},urlPattern:{type:"string",description:"Optional URL pattern to filter requests. Only requests whose URL contains this string will be returned (e.g., '/api/' to filter API calls, 'example.com' to filter by domain)."},clear:{type:"boolean",description:"If true, clear the network requests after reading to avoid duplicates on subsequent calls. Default is false."},limit:{type:"number",description:"Maximum number of requests to return. Defaults to 100. Increase only if you need more results."}},required:["tabId"]}},{name:"shortcuts_list",description:"List all available shortcuts and workflows (shortcuts and workflows are interchangeable). Returns shortcuts with their commands, descriptions, and whether they are workflows. Use shortcuts_execute to run a shortcut or workflow.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to list shortcuts from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."}},required:["tabId"]}},{name:"shortcuts_execute",description:"Execute a shortcut or workflow by running it in a new sidepanel window using the current tab (shortcuts and workflows are interchangeable). Use shortcuts_list first to see available shortcuts. This starts the execution and returns immediately - it does not wait for completion.",inputSchema:{type:"object",properties:{tabId:{type:"number",description:"Tab ID to execute the shortcut on. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID."},shortcutId:{type:"string",description:"The ID of the shortcut to execute"},command:{type:"string",description:"The command name of the shortcut to execute (e.g., 'debug', 'summarize'). Do not include the leading slash."}},required:["tabId"]}}]});class HhA{constructor(H){this._server=H}requestStream(H,$,A){return this._server.requestStream(H,$,A)}async getTask(H,$){return this._server.getTask({taskId:H},$)}async getTaskResult(H,$,A){return this._server.getTaskResult({taskId:H},$,A)}async listTasks(H,$){return this._server.listTasks(H?{cursor:H}:void 0,$)}async cancelTask(H,$){return this._server.cancelTask({taskId:H},$)}}var emH;var $hA=K(()=>{MJA();CK();cFA();sSH();emH=class emH extends UjH{constructor(H,$){var A,L;super($);if(this._serverInfo=H,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(EjH.options.map((I,D)=>[I,D])),this.isMessageIgnored=(I,D)=>{let B=this._loggingLevels.get(D);return B?this.LOG_LEVEL_SEVERITY.get(I)this._oninitialize(I)),this.setNotificationHandler(D5$,()=>{var I;return(I=this.oninitialized)===null||I===void 0?void 0:I.call(this)}),this._capabilities.logging)this.setRequestHandler(jXA,async(I,D)=>{var B;let f=D.sessionId||((B=D.requestInfo)===null||B===void 0?void 0:B.headers["mcp-session-id"])||void 0,{level:E}=I.params,M=EjH.safeParse(E);if(M.success)this._loggingLevels.set(f,M.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new HhA(this)};return this._experimental}registerCapabilities(H){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=P5$(this._capabilities,H)}setRequestHandler(H,$){var A,L,I;let D=yFH(H),B=D===null||D===void 0?void 0:D.method;if(!B)throw Error("Schema is missing a method literal");let f;if(ar(B)){let M=B,G=(A=M._zod)===null||A===void 0?void 0:A.def;f=(L=G===null||G===void 0?void 0:G.value)!==null&&L!==void 0?L:M.value}else{let M=B,G=M._def;f=(I=G===null||G===void 0?void 0:G.value)!==null&&I!==void 0?I:M.value}if(typeof f!=="string")throw Error("Schema method literal must be a string");if(f==="tools/call"){let M=async(G,U)=>{let X=BP(YDH,G);if(!X.success){let W=X.error instanceof Error?X.error.message:String(X.error);throw new KB(V0.InvalidParams,`Invalid tools/call request: ${W}`)}let{params:J}=X.data,F=await Promise.resolve($(G,U));if(J.task){let W=BP(eg,F);if(!W.success){let P=W.error instanceof Error?W.error.message:String(W.error);throw new KB(V0.InvalidParams,`Invalid task creation result: ${P}`)}return W.data}let Q=BP(fP,F);if(!Q.success){let W=Q.error instanceof Error?Q.error.message:String(Q.error);throw new KB(V0.InvalidParams,`Invalid tools/call result: ${W}`)}return Q.data};return super.setRequestHandler(H,M)}return super.setRequestHandler(H,$)}assertCapabilityForMethod(H){var $,A,L;switch(H){case"sampling/createMessage":if(!(($=this._clientCapabilities)===null||$===void 0?void 0:$.sampling))throw Error(`Client does not support sampling (required for ${H})`);break;case"elicitation/create":if(!((A=this._clientCapabilities)===null||A===void 0?void 0:A.elicitation))throw Error(`Client does not support elicitation (required for ${H})`);break;case"roots/list":if(!((L=this._clientCapabilities)===null||L===void 0?void 0:L.roots))throw Error(`Client does not support listing roots (required for ${H})`);break;case"ping":break}}assertNotificationCapability(H){var $,A;switch(H){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${H})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${H})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${H})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${H})`);break;case"notifications/elicitation/complete":if(!((A=($=this._clientCapabilities)===null||$===void 0?void 0:$.elicitation)===null||A===void 0?void 0:A.url))throw Error(`Client does not support URL elicitation (required for ${H})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(H){if(!this._capabilities)return;switch(H){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${H})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${H})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${H})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${H})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${H})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${H})`);break;case"ping":case"initialize":break}}assertTaskCapability(H){var $,A;DX$((A=($=this._clientCapabilities)===null||$===void 0?void 0:$.tasks)===null||A===void 0?void 0:A.requests,H,"Client")}assertTaskHandlerCapability(H){var $;if(!this._capabilities)return;IX$(($=this._capabilities.tasks)===null||$===void 0?void 0:$.requests,H,"Server")}async _oninitialize(H){let $=H.params.protocolVersion;return this._clientCapabilities=H.params.capabilities,this._clientVersion=H.params.clientInfo,{protocolVersion:$5$.includes($)?$:or,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},sg)}async createMessage(H,$){var A,L;if(H.tools||H.toolChoice){if(!((L=(A=this._clientCapabilities)===null||A===void 0?void 0:A.sampling)===null||L===void 0?void 0:L.tools))throw Error("Client does not support sampling tools capability.")}if(H.messages.length>0){let I=H.messages[H.messages.length-1],D=Array.isArray(I.content)?I.content:[I.content],B=D.some((G)=>G.type==="tool_result"),f=H.messages.length>1?H.messages[H.messages.length-2]:void 0,E=f?Array.isArray(f.content)?f.content:[f.content]:[],M=E.some((G)=>G.type==="tool_use");if(B){if(D.some((G)=>G.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!M)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(M){let G=new Set(E.filter((X)=>X.type==="tool_use").map((X)=>X.id)),U=new Set(D.filter((X)=>X.type==="tool_result").map((X)=>X.toolUseId));if(G.size!==U.size||![...G].every((X)=>U.has(X)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(H.tools)return this.request({method:"sampling/createMessage",params:H},yXA,$);return this.request({method:"sampling/createMessage",params:H},MjH,$)}async elicitInput(H,$){var A,L,I,D,B;switch((A=H.mode)!==null&&A!==void 0?A:"form"){case"url":{if(!((I=(L=this._clientCapabilities)===null||L===void 0?void 0:L.elicitation)===null||I===void 0?void 0:I.url))throw Error("Client does not support url elicitation.");let E=H;return this.request({method:"elicitation/create",params:E},bFH,$)}case"form":{if(!((B=(D=this._clientCapabilities)===null||D===void 0?void 0:D.elicitation)===null||B===void 0?void 0:B.form))throw Error("Client does not support form elicitation.");let E=H.mode==="form"?H:{...H,mode:"form"},M=await this.request({method:"elicitation/create",params:E},bFH,$);if(M.action==="accept"&&M.content&&E.requestedSchema)try{let U=this._jsonSchemaValidator.getValidator(E.requestedSchema)(M.content);if(!U.valid)throw new KB(V0.InvalidParams,`Elicitation response content does not match requested schema: ${U.errorMessage}`)}catch(G){if(G instanceof KB)throw G;throw new KB(V0.InternalError,`Error validating elicitation response: ${G instanceof Error?G.message:String(G)}`)}return M}}}createElicitationCompletionNotifier(H,$){var A,L;if(!((L=(A=this._clientCapabilities)===null||A===void 0?void 0:A.elicitation)===null||L===void 0?void 0:L.url))throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:H}},$)}async listRoots(H,$){return this.request({method:"roots/list",params:H},bXA,$)}async sendLoggingMessage(H,$){if(this._capabilities.logging){if(!this.isMessageIgnored(H.level,$))return this.notification({method:"notifications/message",params:H})}}async sendResourceUpdated(H){return this.notification({method:"notifications/resources/updated",params:H})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function sV1(H){return"result"in H||"error"in H}function eV1(H){return"method"in H&&typeof H.method==="string"}class BiD{socket=null;connected=!1;connecting=!1;responseCallback=null;notificationHandler=null;responseBuffer=Buffer.alloc(0);reconnectAttempts=0;maxReconnectAttempts=10;reconnectDelay=1000;reconnectTimer=null;context;disableAutoReconnect=!1;constructor(H){this.context=H}async connect(){let{serverName:H,logger:$}=this.context;if(this.connecting){$.info(`[${H}] Already connecting, skipping duplicate attempt`);return}this.closeSocket(),this.connecting=!0;let A=this.context.getSocketPath?.()??this.context.socketPath;$.info(`[${H}] Attempting to connect to: ${A}`);try{await this.validateSocketSecurity(A)}catch(I){this.connecting=!1,$.info(`[${H}] Security validation failed:`,I);return}this.socket=LiD.createConnection(A);let L=setTimeout(()=>{if(!this.connected)$.info(`[${H}] Connection attempt timed out after 5000ms`),this.closeSocket(),this.scheduleReconnect()},5000);this.socket.on("connect",()=>{clearTimeout(L),this.connected=!0,this.connecting=!1,this.reconnectAttempts=0,$.info(`[${H}] Successfully connected to bridge server`)}),this.socket.on("data",(I)=>{this.responseBuffer=Buffer.concat([this.responseBuffer,I]);while(this.responseBuffer.length>=4){let D=this.responseBuffer.readUInt32LE(0);if(this.responseBuffer.length<4+D)break;let B=this.responseBuffer.slice(4,4+D);this.responseBuffer=this.responseBuffer.slice(4+D);try{let f=JSON.parse(B.toString("utf-8"));if(eV1(f)){if($.info(`[${H}] Received notification: ${f.method}`),this.notificationHandler)this.notificationHandler(f)}else if(sV1(f))$.info(`[${H}] Received tool response: ${f}`),this.handleResponse(f);else $.info(`[${H}] Received unknown message: ${f}`)}catch(f){$.info(`[${H}] Failed to parse message:`,f)}}}),this.socket.on("error",(I)=>{if(clearTimeout(L),$.info(`[${H}] Socket error (code: ${I.code}):`,I),this.connected=!1,this.connecting=!1,I.code&&["ECONNREFUSED","ECONNRESET","EPIPE","ENOENT","EOPNOTSUPP","ECONNABORTED"].includes(I.code))this.scheduleReconnect()}),this.socket.on("close",()=>{clearTimeout(L),this.connected=!1,this.connecting=!1,this.scheduleReconnect()})}scheduleReconnect(){let{serverName:H,logger:$}=this.context;if(this.disableAutoReconnect)return;if(this.reconnectTimer){$.info(`[${H}] Reconnect already scheduled, skipping`);return}this.reconnectAttempts++;let A=100;if(this.reconnectAttempts>A){$.info(`[${H}] Giving up after ${A} attempts. Will retry on next tool call.`),this.reconnectAttempts=0;return}let L=Math.min(this.reconnectDelay*Math.pow(1.5,this.reconnectAttempts-1),30000);if(this.reconnectAttempts<=this.maxReconnectAttempts)$.info(`[${H}] Reconnecting in ${Math.round(L)}ms (attempt ${this.reconnectAttempts})`);else if(this.reconnectAttempts%10===0)$.info(`[${H}] Still polling for native host (attempt ${this.reconnectAttempts})`);this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},L)}handleResponse(H){if(this.responseCallback){let $=this.responseCallback;this.responseCallback=null,$(H)}}setNotificationHandler(H){this.notificationHandler=H}async ensureConnected(){let{serverName:H}=this.context;if(this.connected&&this.socket)return!0;if(!this.socket&&!this.connecting)await this.connect();return new Promise(($,A)=>{let L=null,I=setTimeout(()=>{if(L)clearTimeout(L);A(new Xj(`[${H}] Connection attempt timed out after 5000ms`))},5000),D=()=>{if(this.connected)clearTimeout(I),$(!0);else L=setTimeout(D,500)};D()})}async sendRequest(H,$=30000){let{serverName:A}=this.context;if(!this.socket)throw new Xj(`[${A}] Cannot send request: not connected`);let L=this.socket;return new Promise((I,D)=>{let B=setTimeout(()=>{this.responseCallback=null,D(new Xj(`[${A}] Tool request timed out after ${$}ms`))},$);this.responseCallback=(U)=>{clearTimeout(B),I(U)};let f=JSON.stringify(H),E=Buffer.from(f,"utf-8"),M=Buffer.allocUnsafe(4);M.writeUInt32LE(E.length,0);let G=Buffer.concat([M,E]);L.write(G)})}async callTool(H,$){let A={method:"execute_tool",params:{client_id:this.context.clientTypeId,tool:H,args:$}};return this.sendRequestWithRetry(A)}async sendRequestWithRetry(H){let{serverName:$,logger:A}=this.context;try{return await this.sendRequest(H)}catch(L){if(!(L instanceof Xj))throw L;return A.info(`[${$}] Connection error, forcing reconnect and retrying: ${L.message}`),this.closeSocket(),await this.ensureConnected(),await this.sendRequest(H)}}async setPermissionMode(H,$){}isConnected(){return this.connected}closeSocket(){if(this.socket)this.socket.removeAllListeners(),this.socket.end(),this.socket.destroy(),this.socket=null;this.connected=!1,this.connecting=!1}cleanup(){if(this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;this.closeSocket(),this.reconnectAttempts=0,this.responseBuffer=Buffer.alloc(0),this.responseCallback=null}disconnect(){this.cleanup()}async validateSocketSecurity(H){let{serverName:$,logger:A}=this.context;if(IiD.platform()==="win32")return;try{let L=DiD.dirname(H);if((L.split("/").pop()||"").startsWith("claude-mcp-browser-bridge-"))try{let M=await AhA.promises.stat(L);if(M.isDirectory()){let G=M.mode&511;if(G!==448)throw Error(`[${$}] Insecure socket directory permissions: ${G.toString(8)} (expected 0700). Directory may have been tampered with.`);let U=process.getuid?.();if(U!==void 0&&M.uid!==U)throw Error(`Socket directory not owned by current user (uid: ${U}, dir uid: ${M.uid}). Potential security risk.`)}}catch(M){if(M.code!=="ENOENT")throw M}let B=await AhA.promises.stat(H);if(!B.isSocket())throw Error(`[${$}] Path exists but it's not a socket: ${H}`);let f=B.mode&511;if(f!==384)throw Error(`[${$}] Insecure socket permissions: ${f.toString(8)} (expected 0600). Socket may have been tampered with.`);let E=process.getuid?.();if(E!==void 0&&B.uid!==E)throw Error(`Socket not owned by current user (uid: ${E}, socket uid: ${B.uid}). Potential security risk.`);A.info(`[${$}] Socket security validation passed`)}catch(L){if(L.code==="ENOENT"){A.info(`[${$}] Socket not found, will be created by server`);return}throw L}}}function aT$(H){return new BiD(H)}var AhA,LiD,IiD,DiD,Xj;var oT$=K(()=>{AhA=require("fs"),LiD=require("net"),IiD=require("os"),DiD=require("path");Xj=class Xj extends Error{constructor(H){super(H);this.name="SocketConnectionError"}}});class fiD{clients=new Map;tabRoutes=new Map;context;notificationHandler=null;constructor(H){this.context=H}setNotificationHandler(H){this.notificationHandler=H;for(let $ of this.clients.values())$.setNotificationHandler(H)}async ensureConnected(){let{logger:H,serverName:$}=this.context;this.refreshClients();let A=[];for(let I of this.clients.values())if(!I.isConnected())A.push(I.ensureConnected().catch(()=>!1));if(A.length>0)await Promise.all(A);let L=this.getConnectedClients().length;if(L===0)return H.info(`[${$}] No connected sockets in pool`),!1;return H.info(`[${$}] Socket pool: ${L} connected`),!0}async callTool(H,$){if(H==="tabs_context_mcp")return this.callTabsContext($);let A=$.tabId;if(A!==void 0){let I=this.tabRoutes.get(A);if(I){let D=this.clients.get(I);if(D?.isConnected())return D.callTool(H,$)}}let L=this.getConnectedClients();if(L.length===0)throw new Xj(`[${this.context.serverName}] No connected sockets available`);return L[0].callTool(H,$)}async setPermissionMode(H,$){let A=this.getConnectedClients();await Promise.all(A.map((L)=>L.setPermissionMode(H,$)))}isConnected(){return this.getConnectedClients().length>0}disconnect(){for(let H of this.clients.values())H.disconnect();this.clients.clear(),this.tabRoutes.clear()}getConnectedClients(){return[...this.clients.values()].filter((H)=>H.isConnected())}async callTabsContext(H){let{logger:$,serverName:A}=this.context,L=this.getConnectedClients();if(L.length===0)throw new Xj(`[${A}] No connected sockets available`);if(L.length===1){let B=await L[0].callTool("tabs_context_mcp",H);return this.updateTabRoutes(B,this.getSocketPathForClient(L[0])),B}let I=await Promise.allSettled(L.map(async(B)=>{let f=await B.callTool("tabs_context_mcp",H),E=this.getSocketPathForClient(B);return{result:f,socketPath:E}})),D=[];this.tabRoutes.clear();for(let B of I){if(B.status!=="fulfilled"){$.info(`[${A}] tabs_context_mcp failed on one socket: ${B.reason}`);continue}let{result:f,socketPath:E}=B.value;this.updateTabRoutes(f,E);let M=this.extractTabs(f);if(M)D.push(...M)}if(D.length>0){let B=D.map((f)=>{let E=f;return` \u2022 tabId ${E.tabId}: "${E.title}" (${E.url})`}).join(` You have access to browser automation tools (mcp__claude-in-chrome__*) for interacting with web pages in Chrome. Follow these guidelines for effective browser automation. When performing multi-step browser interactions that the user may want to review or share, use mcp__claude-in-chrome__gif_creator to record them. You can use mcp__claude-in-chrome__read_console_messages to read console output. Console output may be verbose. If you are looking for specific log entries, use the 'pattern' parameter with a regex-compatible pattern. This filters results efficiently and avoids overwhelming output. For example, use pattern: "[MyApp]" to filter for application-specific logs rather than reading all console output. IMPORTANT: Do not trigger JavaScript alerts, confirms, prompts, or browser modal dialogs through your actions. These browser dialogs block all further browser events and will prevent the extension from receiving any subsequent commands. Instead, when possible, use console.log for debugging and then use the mcp__claude-in-chrome__read_console_messages tool to read those log messages. If a page has dialog-triggering elements: 3. Use mcp__claude-in-chrome__javascript_tool to check for and dismiss any existing dialogs before proceeding IMPORTANT: At the start of each browser automation session, call mcp__claude-in-chrome__tabs_context_mcp first to get information about the user's current browser tabs. Use this context to understand what the user might want to work with before creating new tabs. 2. Otherwise, create a new tab with mcp__claude-in-chrome__tabs_create_mcp You have access to browser automation tools (mcp__claude-in-chrome__*) for interacting with web pages in Chrome. Follow these guidelines for effective browser automation. When performing multi-step browser interactions that the user may want to review or share, use mcp__claude-in-chrome__gif_creator to record them. You can use mcp__claude-in-chrome__read_console_messages to read console output. Console output may be verbose. If you are looking for specific log entries, use the 'pattern' parameter with a regex-compatible pattern. This filters results efficiently and avoids overwhelming output. For example, use pattern: "[MyApp]" to filter for application-specific logs rather than reading all console output. IMPORTANT: Do not trigger JavaScript alerts, confirms, prompts, or browser modal dialogs through your actions. These browser dialogs block all further browser events and will prevent the extension from receiving any subsequent commands. Instead, when possible, use console.log for debugging and then use the mcp__claude-in-chrome__read_console_messages tool to read those log messages. If a page has dialog-triggering elements: 3. Use mcp__claude-in-chrome__javascript_tool to check for and dismiss any existing dialogs before proceeding IMPORTANT: At the start of each browser automation session, call mcp__claude-in-chrome__tabs_context_mcp first to get information about the user's current browser tabs. Use this context to understand what the user might want to work with before creating new tabs. 2. Otherwise, create a new tab with mcp__claude-in-chrome__tabs_create_mcp Chrome browser tools are MCP tools that require loading before use. Before calling any mcp__claude-in-chrome__* tool: 1. Use ToolSearch with \`select:mcp__claude-in-chrome__\` to load the specific tool 1. First: ToolSearch with query "select:mcp__claude-in-chrome__tabs_context_mcp" 2. Then: Call mcp__claude-in-chrome__tabs_context_mcp`,DhA='**Browser Automation**: Chrome browser tools are available via the "claude-in-chrome" skill. CRITICAL: Before using any mcp__claude-in-chrome__* tools, invoke the skill by calling the Skill tool with skill: "claude-in-chrome". The skill provides browser automation instructions and enables the tools.';function IP1(){return[LP1]}async function ViD(H,$){if(H.length===0)return $?.("[Claude in Chrome] No browser paths to check"),{isInstalled:!1,browser:null};let A=IP1();for(let{browser:L,path:I}of H){let D=[];try{D=await BhA.readdir(I,{withFileTypes:!0})}catch(f){let E=f.code;if(E==="ENOENT"||E==="EACCES"||E==="EPERM")continue;throw f}let B=D.filter((f)=>f.isDirectory()).filter((f)=>f.name==="Default"||f.name.startsWith("Profile ")).map((f)=>f.name);if(B.length>0)$?.(`[Claude in Chrome] Found ${L} profiles: ${B.join(", ")}`);for(let f of B)for(let E of A){let M=WiD.join(I,f,"Extensions",E);try{return await BhA.readdir(M),$?.(`[Claude in Chrome] Extension ${E} found in ${L} ${f}`),{isInstalled:!0,browser:L}}catch{}}}return $?.("[Claude in Chrome] Extension not found in any browser"),{isInstalled:!1,browser:null}}async function PiD(H,$){return(await ViD(H,$)).isInstalled}var BhA,WiD,LP1="fcoeoabgfenejglbffodgkkbkcdhcgfn";var _iD=K(()=>{BhA=require("fs/promises"),WiD=require("path")});function eT$(H){if(tI()&&H!==!0)return!1;if(H===!0)return!0;if(H===!1)return!1;if(A$(process.env.CLAUDE_CODE_ENABLE_CFC))return!0;if(BE(process.env.CLAUDE_CODE_ENABLE_CFC))return!1;let $=M$();if($.claudeInChromeDefaultEnabled!==void 0)return $.claudeInChromeDefaultEnabled;return!1}function UPH(){if(sT$!==void 0)return sT$;return sT$=Mk()&&EP1()&&NL("tengu_chrome_auto_enable",!1),sT$}function EhA(){let H=U8(),$=e1H.map((I)=>`mcp__claude-in-chrome__${I.name}`),A={};if(Gk())A.CLAUDE_CHROME_PERMISSION_MODE="skip_all_permission_checks";let L=Object.keys(A).length>0;if(H){let I=`"${process.execPath}" --chrome-native-host`;return wiD(I).then((D)=>CiD(D)),{mcpConfig:{[dw]:{type:"stdio",command:process.execPath,args:["--claude-in-chrome-mcp"],scope:"dynamic",...L&&{env:A}}},allowedTools:$,systemPrompt:IhA()}}else{let I=qiD.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/claudeInChrome/setup.ts"),D=_b.join(I,".."),B=_b.join(D,"cli.js");return wiD(`"${process.execPath}" "${B}" --chrome-native-host`).then((E)=>CiD(E)),{mcpConfig:{[dw]:{type:"stdio",command:process.execPath,args:[`${B}`,"--claude-in-chrome-mcp"],scope:"dynamic",...L&&{env:A}}},allowedTools:$,systemPrompt:IhA()}}}function BP1(){if(oA()==="windows"){let $=ZiD.homedir(),A=process.env.APPDATA||_b.join($,"AppData","Local");return[_b.join(A,"Claude Code","ChromeNativeHost")]}return YZD().map(({path:$})=>$)}async function CiD(H){let $=BP1();if($.length===0)throw Error("Claude in Chrome Native Host not supported on this platform");let A={name:fhA,description:"Claude Code Browser Extension Native Host",path:H,type:"stdio",allowed_origins:["chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/",...[]]},L=yH(A,null,2),I=!1;for(let D of $){let B=_b.join(D,YiD);if(await Jj.readFile(B,"utf-8").catch(()=>null)===L)continue;try{await Jj.mkdir(D,{recursive:!0}),await Jj.writeFile(B,L),N(`[Claude in Chrome] Installed native host manifest at: ${B}`),I=!0}catch(E){N(`[Claude in Chrome] Failed to install manifest at ${B}: ${E}`)}}if(oA()==="windows"){let D=_b.join($[0],YiD);fP1(D)}if(I)Vd().then((D)=>{if(D)N("[Claude in Chrome] First-time install detected, opening reconnect page in browser"),_2$(DP1);else N("[Claude in Chrome] First-time install detected, but extension not installed, skipping reconnect")})}function fP1(H){let $=CZD();for(let{browser:A,key:L}of $){let I=`${L}\\${fhA}`;pD("reg",["add",I,"/ve","/t","REG_SZ","/d",H,"/f"]).then((D)=>{if(D.code===0)N(`[Claude in Chrome] Registered native host for ${A} in Windows registry: ${I}`);else N(`[Claude in Chrome] Failed to register native host for ${A} in Windows registry: ${D.stderr}`)})}}async function wiD(H){let $=oA(),A=_b.join(UL(),"chrome"),L=$==="windows"?_b.join(A,"chrome-native-host.bat"):_b.join(A,"chrome-native-host"),I=$==="windows"?`@echo off `;if(await Jj.readFile(L,"utf-8").catch(()=>null)===I)return L;if(await Jj.mkdir(A,{recursive:!0}),await Jj.writeFile(L,I),$!=="windows")await Jj.chmod(L,493);return N(`[Claude in Chrome] Created Chrome native host wrapper script: ${L}`),L}function EP1(){return Vd().then(($)=>{if(M$().cachedChromeExtensionInstalled!==$)AA((L)=>({...L,cachedChromeExtensionInstalled:$}))}),M$().cachedChromeExtensionInstalled??!1}async function Vd(){let H=_ZD();if(H.length===0)return N(`[Claude in Chrome] Unsupported platform for extension detection: ${oA()}`),!1;return PiD(H,N)}var Jj,ZiD,_b,qiD,DP1="https://clau.de/chrome/reconnect",fhA="com.anthropic.claude_code_browser_extension",YiD,sT$=void 0;var H8H=K(()=>{Z9();E$();B0();NA();g$();tT$();nS();vA();Z$();SD();_iD();Jj=require("fs/promises"),ZiD=require("os"),_b=require("path"),qiD=require("url"),YiD=`${fhA}.json`});var TiD={};XA(TiD,{call:()=>JP1});function XP1({onDone:H,isExtensionInstalled:$,configEnabled:A,isClaudeAISubscriber:L,isWSL:I}){let D=J$((O)=>O.mcp.clients),[B,f]=HpH.useState(0),[E,M]=HpH.useState(A??!1),[G,U]=HpH.useState(!1),[X,J]=HpH.useState($),F=!1,W=D.find((O)=>O.name===dw)?.type==="connected";function P(O){_2$(O)}function C(O){switch(O){case"install-extension":f((j)=>j+1),U(!0),P(MP1);break;case"reconnect":f((j)=>j+1),Vd().then((j)=>{if(J(j),j)U(!1)}),P(UP1);break;case"manage-permissions":f((j)=>j+1),P(GP1);break;case"toggle-default":{let j=!E;AA((u)=>({...u,claudeInChromeDefaultEnabled:j})),M(j);break}}}let Y=[],Z=X?"":" (requires extension)";if(!X)Y.push({label:"Install Chrome extension",value:"install-extension"});return Y.push({label:bf.default.createElement(bf.default.Fragment,null,bf.default.createElement(V,null,"Manage permissions"),bf.default.createElement(V,{dimColor:!0},Z)),value:"manage-permissions"},{label:bf.default.createElement(bf.default.Fragment,null,bf.default.createElement(V,null,"Reconnect extension"),bf.default.createElement(V,{dimColor:!0},Z)),value:"reconnect"},{label:`Enabled by default: ${E?"Yes":"No"}`,value:"toggle-default"}),bf.default.createElement(BL,{title:"Claude in Chrome (Beta)",onCancel:()=>H(),color:"chromeYellow"},bf.default.createElement(x,{flexDirection:"column",gap:1},bf.default.createElement(V,null,"Claude in Chrome works with the Chrome extension to let you control your browser directly from Claude Code. Navigate websites, fill forms, capture screenshots, record GIFs, and debug with console logs and network requests."),I&&bf.default.createElement(V,{color:"error"},"Claude in Chrome is not supported in WSL at this time."),!L&&bf.default.createElement(V,{color:"error"},"Claude in Chrome requires a claude.ai subscription."),!(I||!L)&&bf.default.createElement(bf.default.Fragment,null,bf.default.createElement(x,{flexDirection:"column"},bf.default.createElement(V,null,"Status:"," ",W?bf.default.createElement(V,{color:"success"},"Enabled"):bf.default.createElement(V,{color:"inactive"},"Disabled")),bf.default.createElement(V,null,"Extension:"," ",X?bf.default.createElement(V,{color:"success"},"Installed"):bf.default.createElement(V,{color:"warning"},"Not detected"))),bf.default.createElement(QA,{key:B,options:Y,onChange:C,hideIndexes:!0}),G&&bf.default.createElement(V,{color:"warning"},"Once installed, select ",'"Reconnect extension"'," to connect."),bf.default.createElement(V,null,bf.default.createElement(V,{dimColor:!0},"Usage: "),bf.default.createElement(V,null,"claude --chrome"),bf.default.createElement(V,{dimColor:!0}," or "),bf.default.createElement(V,null,"claude --no-chrome")),bf.default.createElement(V,{dimColor:!0},"Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on.")),bf.default.createElement(V,{dimColor:!0},"Learn more: https://code.claude.com/docs/en/chrome")))}async function JP1(H){let $=await Vd(),A=M$(),L=nL(),I=OA.isWslEnvironment();return bf.default.createElement(XP1,{onDone:H,isExtensionInstalled:$,configEnabled:A.claudeInChromeDefaultEnabled,isClaudeAISubscriber:L,isWSL:I})}var bf,HpH,MP1="https://claude.ai/chrome",GP1="https://clau.de/chrome/permissions",UP1="https://clau.de/chrome/reconnect";var ziD=K(()=>{xH();H8H();nS();vA();bB();N1();pL();EI();Z1();F3();NA();bf=b(s(),1),HpH=b(s(),1)});var FP1,NiD;var OiD=K(()=>{g$();FP1={name:"chrome",description:"Claude in Chrome (Beta) settings",isEnabled:()=>!tI(),isHidden:!1,type:"local-jsx",load:()=>Promise.resolve().then(() => (ziD(),TiD)),userFacingName:()=>"chrome"},NiD=FP1});var xiD={};XA(xiD,{call:()=>KP1});async function KP1(){if(await HE("https://www.stickermule.com/claudecode"))return{type:"text",value:"Opening sticker page in browser\u2026"};else return{type:"text",value:"Failed to open browser. Visit: https://www.stickermule.com/claudecode"}}var SiD=K(()=>{F3()});var QP1,MhA;var jiD=K(()=>{QP1={type:"local",name:"stickers",description:"Order Claude Code stickers",isEnabled:()=>!0,isHidden:!1,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (SiD(),xiD)),userFacingName(){return"stickers"}},MhA=QP1});function UW(H){let $={type:"prompt",name:H.name,description:H.description,hasUserSpecifiedDescription:!0,allowedTools:H.allowedTools??[],argumentHint:H.argumentHint,whenToUse:H.whenToUse,model:H.model,disableModelInvocation:H.disableModelInvocation??!1,userInvocable:H.userInvocable??!0,contentLength:0,source:"bundled",loadedFrom:"bundled",hooks:H.hooks,context:H.context,agent:H.agent,isEnabled:H.isEnabled??(()=>!0),isHidden:!(H.userInvocable??!0),progressMessage:"running",userFacingName:()=>H.name,getPromptForCommand:H.getPromptForCommand};RiD.push($)}function yiD(){return[...RiD]}var RiD;var Fj=K(()=>{RiD=[]});var WP1,viD;var hiD=K(()=>{xH();N1();zVH();JM();nh();B0();z$();bB();WP1=b(s(),1),viD=b(s(),1)});var OAG;var biD=K(()=>{hiD();UU();OAG=b(s(),1)});var kiD={};XA(kiD,{call:()=>YP1});function _P1(){return QV(PP1)??"Goodbye!"}async function YP1(H){return H(_P1()),await w0(0,"prompt_input_exit"),null}var VP1,PP1;var uiD=K(()=>{yHH();UU();zVH();biD();VP1=b(s(),1),PP1=["Goodbye!","See ya!","Bye!","Catch you later!"]});var CP1,$pH;var GhA=K(()=>{CP1={type:"local-jsx",name:"exit",aliases:["quit"],description:"Exit the REPL",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (uiD(),kiD)),userFacingName(){return"exit"}},$pH=CP1});function miD({content:H,defaultFilename:$,onDone:A}){let[,L]=rs.useState(null),[I,D]=rs.useState($),[B,f]=rs.useState($.length),[E,M]=rs.useState(!1),{columns:G}=QL(),U=rs.useCallback(()=>{M(!1),L(null)},[]),X=async(P)=>{if(P==="clipboard")if(await K3(H))A({success:!0,message:"Conversation copied to clipboard"});else A({success:!1,message:dQH()});else if(P==="file")L("file"),M(!0)},J=()=>{let P=I.endsWith(".txt")?I:I.replace(/\.[^.]+$/,"")+".txt",C=giD.join(C$(),P);try{iL(C,H,{encoding:"utf-8",flush:!0}),A({success:!0,message:`Conversation exported to: ${P}`})}catch(Y){A({success:!1,message:`Failed to export conversation: ${Y instanceof Error?Y.message:"Unknown error"}`})}},F=rs.useCallback(()=>{if(E)U();else A({success:!1,message:"Export cancelled"})},[E,U,A]),Q=[{label:"Copy to clipboard",value:"clipboard",description:"Copy the conversation to your system clipboard"},{label:"Save to file",value:"file",description:"Save the conversation to a file in the current directory"}];function W(P){if(E)return BZ.default.createElement(rA,null,BZ.default.createElement(s$,{shortcut:"Enter",action:"save"}),BZ.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"go back"}));if(P.pending)return BZ.default.createElement(V,null,"Press ",P.keyName," again to exit");return BZ.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})}return BZ.default.createElement(BL,{title:"Export Conversation",subtitle:"Select export method:",color:"permission",onCancel:F,inputGuide:W},!E?BZ.default.createElement(QA,{options:Q,onChange:X,onCancel:F}):BZ.default.createElement(x,{flexDirection:"column"},BZ.default.createElement(V,null,"Enter filename:"),BZ.default.createElement(x,{flexDirection:"row",gap:1,marginTop:1},BZ.default.createElement(V,null,">"),BZ.default.createElement(W9,{value:I,onChange:D,onSubmit:J,focus:!0,showCursor:!0,columns:G,cursorOffset:B,onChangeCursorOffset:f}))))}var BZ,rs,giD;var piD=K(()=>{xH();N1();S5();PI();Z$();pm();lB();j0();eB();OB();bB();BZ=b(s(),1),rs=b(s(),1),giD=require("path")});function wP1({children:H}){let{bindings:$}=wNH(),A=Yb.useRef(null),L=Yb.useRef(new Map),I=Yb.useRef(new Set).current;return Yb.default.createElement(I8$,{bindings:$,pendingChordRef:A,pendingChord:null,setPendingChord:()=>{},activeContexts:I,registerActiveContext:()=>{},unregisterActiveContext:()=>{},handlerRegistryRef:L},H)}async function diD(H,$=[]){return CVH(Yb.default.createElement(()=>Yb.default.createElement(i8,null,Yb.default.createElement(wP1,null,Yb.default.createElement(l1H,{messages:H,normalizedMessageHistory:[],tools:$,commands:[],verbose:!1,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:"export",screen:"prompt",screenToggleId:0,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}))),null))}var Yb;var ciD=K(()=>{agH();bmH();pL();iu();nu();Yb=b(s(),1)});var aiD={};XA(aiD,{sanitizeFilename:()=>riD,extractFirstPrompt:()=>niD,call:()=>TP1});function ZP1(H){let $=H.getFullYear(),A=String(H.getMonth()+1).padStart(2,"0"),L=String(H.getDate()).padStart(2,"0"),I=String(H.getHours()).padStart(2,"0"),D=String(H.getMinutes()).padStart(2,"0"),B=String(H.getSeconds()).padStart(2,"0");return`${$}-${A}-${L}-${I}${D}${B}`}function niD(H){let $=H.find((I)=>I.type==="user");if(!$||$.type!=="user")return"";let A=$.message?.content,L="";if(typeof A==="string")L=A.trim();else if(Array.isArray(A)){let I=A.find((D)=>D.type==="text");if(I&&"text"in I)L=I.text.trim()}if(L=L.split(` /tag wip`,{display:"system"})},[H]),null}async function hP1(H,$,A){if(A=A?.trim()||"",kMH.includes(A)||bMH.includes(A))return r5.createElement(LnD,{onDone:H});if(!A)return r5.createElement(LnD,{onDone:H});return r5.createElement(vP1,{tagName:A,onDone:H})}var r5;var DnD=K(()=>{xH();g$();rB();r0();EE();N1();bB();z$();r5=b(s(),1)});var bP1,BnD;var fnD=K(()=>{bP1={type:"local-jsx",name:"tag",userFacingName(){return"tag"},description:"Toggle a searchable tag on the current session",isEnabled:()=>!1,isHidden:!1,argumentHint:"",load:()=>Promise.resolve().then(() => (DnD(),InD))},BnD=bP1});var MnD={};XA(MnD,{call:()=>pP1});function kP1({onDone:H}){let A=lQ().outputStyle??HW,L=EnD.useCallback(()=>{c("tengu_output_style_command_menu",{action:"cancel"}),H(`Kept output style as ${oH.bold(A)}`,{display:"system"})},[A,H]);BA("confirm:no",L,{context:"Confirmation"});function I(B){c("tengu_output_style_command_menu",{action:B,from_style:A,to_style:B}),II("localSettings",{outputStyle:B}),H(`Set output style to ${oH.bold(B)}`)}function D(){H(`Kept output style as ${oH.bold(A)}`,{display:"system"})}return Pd.createElement(Fq$,{initialStyle:A,onComplete:I,onCancel:D,isStandaloneCommand:!0})}function uP1(H,$){if(H in $)return H;let A=H.toLowerCase();for(let L of Object.keys($))if(L.toLowerCase()===A)return L;return null}function gP1({args:H,onDone:$}){return Y1H(C$()).then((A)=>{let L=uP1(H,A);if(!L){$(`Invalid output style: ${H}`);return}II("localSettings",{outputStyle:L}),$(`Set output style to ${oH.bold(L)}`)}),null}function mP1({onDone:H}){let $=lQ();return H(`Current output style: ${$.outputStyle??HW}`),null}async function pP1(H,$,A){if(A=A?.trim()||"",kMH.includes(A))return c("tengu_output_style_command_inline_help",{args:A}),Pd.createElement(mP1,{onDone:H});if(bMH.includes(A)){H("Run /output-style to open the output style selection menu, or /output-style [styleName] to set the output style.",{display:"system"});return}if(A)return c("tengu_output_style_command_inline",{args:A}),Pd.createElement(gP1,{args:A,onDone:H});return Pd.createElement(kP1,{onDone:H})}var Pd,EnD;var GnD=K(()=>{tjA();$I();z$();r0();mL();um();jh();PI();EE();Pd=b(s(),1),EnD=b(s(),1)});var dP1,UnD;var XnD=K(()=>{dP1={type:"local-jsx",name:"output-style",userFacingName(){return"output-style"},description:"Set the output style directly or from a selection menu",isEnabled:()=>!0,isHidden:!1,argumentHint:"[style]",load:()=>Promise.resolve().then(() => (GnD(),MnD))},UnD=dP1});async function JnD(){let H=await D3H();if(H.length===0)return{availableEnvironments:[],selectedEnvironment:null,selectedEnvironmentSource:null};let A=VL()?.remote?.defaultEnvironmentId,L=H[0],I=null;if(A){let D=H.find((B)=>B.environment_id===A);if(D){L=D;for(let B=j_.length-1;B>=0;B--){let f=j_[B];if(!f||f==="flagSettings")continue;if(ZI(f)?.remote?.defaultEnvironmentId===A){I=f;break}}}}return{availableEnvironments:H,selectedEnvironment:L,selectedEnvironmentSource:I}}var FnD=K(()=>{mL();W4();rC$()});function KnD({onDone:H}){let[$,A]=as.useState("loading"),[L,I]=as.useState([]),[D,B]=as.useState(null),[f,E]=as.useState(null),[M,G]=as.useState(null);as.useEffect(()=>{async function X(){try{let J=await JnD();I(J.availableEnvironments),B(J.selectedEnvironment),E(J.selectedEnvironmentSource),A(null)}catch(J){let F=J instanceof Error?J.message:String(J);r(J instanceof Error?J:Error(F)),G(F),A(null)}}X()},[]);function U(X){if(X==="cancel"){H();return}A("updating");let J=L.find((F)=>F.environment_id===X);if(!J){H("Error: Selected environment not found");return}II("localSettings",{remote:{defaultEnvironmentId:J.environment_id}}),H(`Set default remote environment to ${oH.bold(J.name)} (${J.environment_id})`)}if($==="loading")return z0.createElement(BL,{title:ApH,onCancel:H,hideInputGuide:!0},z0.createElement(umH,{message:"Loading environments\u2026"}));if(M)return z0.createElement(BL,{title:ApH,onCancel:H},z0.createElement(V,{color:"error"},"Error: ",M));if(!D)return z0.createElement(BL,{title:ApH,subtitle:XhA,onCancel:H},z0.createElement(V,null,"No remote environments available."));if(L.length===1)return z0.createElement(lP1,{environment:D,onDone:H});return z0.createElement(iP1,{environments:L,selectedEnvironment:D,selectedEnvironmentSource:f,loadingState:$,onSelect:U,onCancel:H})}function cP1({environment:H}){return z0.createElement(V,null,pH.tick," Using ",z0.createElement(V,{bold:!0},H.name)," ",z0.createElement(V,{dimColor:!0},"(",H.environment_id,")"))}function lP1({environment:H,onDone:$}){return BA("confirm:yes",$,{context:"Confirmation"}),z0.createElement(BL,{title:ApH,subtitle:XhA,onCancel:$},z0.createElement(cP1,{environment:H}))}function iP1({environments:H,selectedEnvironment:$,selectedEnvironmentSource:A,loadingState:L,onSelect:I,onCancel:D}){let B=A&&A!=="localSettings"?` (from ${Vl(A)} settings)`:"",f=z0.createElement(V,null,"Currently using: ",z0.createElement(V,{bold:!0},$.name),B);return z0.createElement(BL,{title:ApH,subtitle:f,onCancel:D,hideInputGuide:!0},z0.createElement(V,{dimColor:!0},XhA),L==="updating"?z0.createElement(umH,{message:"Updating\u2026"}):z0.createElement(QA,{options:H.map((E)=>({label:z0.createElement(V,null,E.name," ",z0.createElement(V,{dimColor:!0},"(",E.environment_id,")")),value:E.environment_id})),defaultValue:$.environment_id,onChange:I,onCancel:()=>I("cancel"),layout:"compact-vertical"}),z0.createElement(V,{dimColor:!0},z0.createElement(rA,null,z0.createElement(s$,{shortcut:"Enter",action:"select"}),z0.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))))}var z0,as,ApH="Select Remote Environment",XhA="Configure environments at: https://claude.ai/code";var QnD=K(()=>{xH();$I();bB();N1();jI();nyA();FnD();mL();_$();r0();W4();lB();j0();eB();z0=b(s(),1),as=b(s(),1)});var WnD={};XA(WnD,{call:()=>nP1});async function nP1(H){return JhA.createElement(KnD,{onDone:H})}var JhA;var VnD=K(()=>{QnD();JhA=b(s(),1)});var PnD;var _nD=K(()=>{EI();XY();PnD={type:"local-jsx",name:"remote-env",userFacingName(){return"remote-env"},description:"Configure the default remote environment for teleport sessions",isEnabled:()=>nL()&&PK("allow_remote_sessions"),get isHidden(){return!nL()||!PK("allow_remote_sessions")},load:()=>Promise.resolve().then(() => (VnD(),WnD))}});var YnD={};XA(YnD,{call:()=>KhA});async function KhA(H,$){try{if(nL()){let L=dD(),I=!1;if(L?.subscriptionType&&L?.rateLimitTier)I=L.subscriptionType==="max"&&L.rateLimitTier==="default_claude_max_20x";else if(L?.accessToken){let D=await SGH(L.accessToken);I=D?.organization?.organization_type==="claude_max"&&D?.organization?.rate_limit_tier==="default_claude_max_20x"}if(I)return setTimeout(()=>{H("You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account.")},0),null}return await HE("https://claude.ai/upgrade/max"),FhA.createElement(i7H,{startingMessage:"Starting new login following /upgrade. Exit with Ctrl-C to use existing account.",onDone:(L)=>{$.onChangeAPIKey(),H(L?"Login successful":"Login interrupted")}})}catch(A){r(A),setTimeout(()=>{H("Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.")},0)}return null}var FhA;var QhA=K(()=>{_$();EI();F3();J_$();zwH();FhA=b(s(),1)});var rP1,$z$;var WhA=K(()=>{EI();rP1={type:"local-jsx",name:"upgrade",description:"Upgrade to Max for higher rate limits and more Opus",isEnabled:()=>!process.env.DISABLE_UPGRADE_COMMAND&&!$O()&&f0()!=="enterprise",isHidden:!1,load:()=>Promise.resolve().then(() => (QhA(),YnD)),userFacingName(){return"upgrade"}},$z$=rP1});var CnD={};XA(CnD,{call:()=>oP1});function aP1({onDone:H,context:$}){let[A,L]=Lz$.useState(null),I=Zr(),D=f0(),B=Ri(),f=T9()?.hasExtraUsageEnabled===!0,M=D==="max"&&B==="default_claude_max_20x",G=D==="team"||D==="enterprise",U=Lz$.useMemo(()=>{let F=[{label:"Stop and wait for limit to reset",value:"cancel"}];if(Lt.isEnabled()){let Q=my(),W=G&&!Q,P=I.overageDisabledReason==="out_of_credits"||I.overageDisabledReason==="org_level_disabled_until"||I.overageDisabledReason==="org_service_zero_credit_limit";if(W&&P);else{let C=I.overageStatus==="rejected"||I.overageStatus==="allowed_warning",Y;if(W)Y=C?"Request more":"Request extra usage";else Y=f?"Add funds to continue with extra usage":"Switch to extra usage";F.push({label:Y,value:"extra-usage"})}}if(!M&&!G&&$z$.isEnabled())F.push({label:"Upgrade your plan",value:"upgrade"});return F},[M,G,f,I.overageStatus,I.overageDisabledReason]);function X(){c("tengu_rate_limit_options_menu_cancel",{}),H(void 0,{display:"skip"})}function J(F){if(F==="upgrade")c("tengu_rate_limit_options_menu_select_upgrade",{}),KhA(H,$).then((Q)=>{if(Q)L(Q)});else if(F==="extra-usage")c("tengu_rate_limit_options_menu_select_extra_usage",{}),pwA(H,$).then((Q)=>{if(Q)L(Q)});else if(F==="cancel")X()}if(A)return A;return Az$.default.createElement(BL,{title:"What do you want to do?",onCancel:X,color:"suggestion",borderDimColor:!1},Az$.default.createElement(QA,{options:U,onChange:J,visibleOptionCount:U.length}))}async function oP1(H,$){return Az$.default.createElement(aP1,{onDone:H,context:$})}var Az$,Lz$;var wnD=K(()=>{N1();bB();z$();EI();WhA();QhA();mbH();dwA();vA();py();Az$=b(s(),1),Lz$=b(s(),1)});var tP1,ZnD;var qnD=K(()=>{EI();vA();tP1={type:"local-jsx",name:"rate-limit-options",userFacingName(){return"rate-limit-options"},description:"Show options when rate limit is reached",isEnabled:()=>{if(!nL())return!1;if($T())return!0;let H=f0();return H==="pro"||H==="max"},isHidden:!0,load:()=>Promise.resolve().then(() => (wnD(),CnD))},ZnD=tP1});var sP1,VhA;var TnD=K(()=>{sP1={type:"prompt",description:"Set up Claude Code's status line UI",contentLength:0,aliases:[],isEnabled:()=>!0,isHidden:!1,name:"statusline",progressMessage:"setting up statusLine",allowedTools:["Task","Read(~/**)","Edit(~/.claude/settings.json)"],source:"builtin",disableNonInteractive:!0,async getPromptForCommand(H){return[{type:"text",text:`Create a Task with subagent_type "statusline-setup" and the prompt "${H.trim()||"Configure my statusLine from my shell PS1 configuration"}"`}]},userFacingName(){return"statusline"}},VhA=sP1});var znD=()=>{};var NnD=z((Iz$)=>{(function(H){H.black="\x1B[30m",H.red="\x1B[31m",H.green="\x1B[32m",H.yellow="\x1B[33m",H.blue="\x1B[34m",H.magenta="\x1B[35m",H.cyan="\x1B[36m",H.lightgray="\x1B[37m",H.default="\x1B[39m",H.darkgray="\x1B[90m",H.lightred="\x1B[91m",H.lightgreen="\x1B[92m",H.lightyellow="\x1B[93m",H.lightblue="\x1B[94m",H.lightmagenta="\x1B[95m",H.lightcyan="\x1B[96m",H.white="\x1B[97m",H.reset="\x1B[0m";function $(A,L){return L===void 0?A:L+A+H.reset}H.colored=$,H.plot=function(A,L=void 0){if(typeof A[0]=="number")A=[A];L=typeof L<"u"?L:{};let I=typeof L.min<"u"?L.min:A[0][0],D=typeof L.max<"u"?L.max:A[0][0];for(let Z=0;Z0?D-(Z-J)*f/Q:Z,Z-J);Y[Z-J][Math.max(E-q.length,0)]=q,Y[Z-J][E-1]=Z==0?P[0]:P[1]}for(let Z=0;Zy?P[5]:P[6],q),Y[Q-u][j+E]=$(u>y?P[7]:P[8],q);let g=Math.min(u,y),h=Math.max(u,y);for(let p=g+1;p{cnD={30:{r:0,g:0,b:0},31:{r:205,g:49,b:49},32:{r:13,g:188,b:121},33:{r:229,g:229,b:16},34:{r:36,g:114,b:200},35:{r:188,g:63,b:188},36:{r:17,g:168,b:205},37:{r:229,g:229,b:229},90:{r:102,g:102,b:102},91:{r:241,g:76,b:76},92:{r:35,g:209,b:139},93:{r:245,g:245,b:67},94:{r:59,g:142,b:234},95:{r:214,g:112,b:214},96:{r:41,g:184,b:219},97:{r:255,g:255,b:255}},L8H={r:229,g:229,b:229},jhA={r:30,g:30,b:30}});function w_1(){let H=I8H.dirname(rnD.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/screenshotClipboard.ts"));return I8H.join(I8H.dirname(hgH()),"resvg.wasm")}function Z_1(){if(!U8()||typeof Bun>"u"||!Bun.embeddedFiles)return null;for(let H of Bun.embeddedFiles){let $=H.name;if($&&$.endsWith("resvg.wasm"))return H}return null}async function q_1(){if(RhA)return;if(U8()){let A=Z_1();if(A){let L=await A.arrayBuffer();await ShA(new Uint8Array(L)),RhA=!0;return}}let H=w_1();if(!Qj.existsSync(H))throw Error(`resvg WASM file not found at: ${H}`);let $=Qj.readFileSync(H);await ShA($),RhA=!0}async function T_1(){if(Xz$)return[Xz$];let H=oA(),$=[];if(H==="macos")$.push("/System/Library/Fonts/Menlo.ttc","/System/Library/Fonts/Monaco.dfont","/Library/Fonts/Courier New.ttf");else if(H==="linux")$.push("/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf","/usr/share/fonts/TTF/DejaVuSansMono.ttf","/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf","/usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf");else if(H==="windows")$.push("C:\\Windows\\Fonts\\consola.ttf","C:\\Windows\\Fonts\\cour.ttf");for(let A of $)try{if(Qj.existsSync(A))return Xz$=Qj.readFileSync(A),[Xz$]}catch{}return[]}async function anD(H,$){if(!U8())return{success:!1,message:"Screenshot copying is not available in this build"};try{await q_1();let A=I8H.join(nnD.tmpdir(),"claude-code-screenshots");if(!Qj.existsSync(A))Qj.mkdirSync(A,{recursive:!0});let L=Date.now(),I=lnD(H,$),D=I8H.join(A,`screenshot-${L}.png`),B=await T_1(),M=new pnD(I,{fitTo:{mode:"zoom",value:4},font:{fontBuffers:B,defaultFontFamily:"Menlo",monospaceFamily:"Menlo"}}).render().asPng();iL(D,M);let G=await z_1(D);try{Qj.unlinkSync(D)}catch{}return G}catch(A){return r(A instanceof Error?A:Error(String(A))),{success:!1,message:`Failed to copy screenshot: ${A instanceof Error?A.message:"Unknown error"}`}}}async function z_1(H){let $=oA();if($==="macos"){let L=`set the clipboard to (read (POSIX file "${H.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}") as \xABclass PNGf\xBB)`,I=await pD("osascript",["-e",L],{timeout:5000});if(I.code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:`Failed to copy to clipboard: ${I.stderr}`}}if($==="linux"){if((await pD("xclip",["-selection","clipboard","-t","image/png","-i",H],{timeout:5000})).code===0)return{success:!0,message:"Screenshot copied to clipboard"};if((await pD("xsel",["--clipboard","--input","--type","image/png"],{timeout:5000})).code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:"Failed to copy to clipboard. Please install xclip or xsel: sudo apt install xclip"}}if($==="windows"){let A=`Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::SetImage([System.Drawing.Image]::FromFile('${H.replace(/'/g,"''")}'))`,L=await pD("powershell",["-NoProfile","-Command",A],{timeout:5000});if(L.code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:`Failed to copy to clipboard: ${L.stderr}`}}return{success:!1,message:`Screenshot to clipboard is not supported on ${$}`}}var Qj,I8H,nnD,rnD,RhA=!1,Xz$=null;var onD=K(()=>{Z$();dnD();Z9();inD();_$();B0();Ib();Qj=require("fs"),I8H=require("path"),nnD=require("os"),rnD=require("url")});function O_1(H){return new Date(H).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function x_1(H){let $=Jz$.indexOf(H);return Jz$[($+1)%Jz$.length]}function S_1(){return ZhA("all").then((H)=>{if(!H||H.totalSessions===0)return{type:"empty"};return{type:"success",data:H}}).catch((H)=>{return{type:"error",message:H instanceof Error?H.message:"Failed to load stats"}})}function $rD({onClose:H}){let $=JW.useMemo(()=>S_1(),[]);return JL.default.createElement(JW.Suspense,{fallback:JL.default.createElement(x,{marginTop:1},JL.default.createElement(vD,null),JL.default.createElement(V,null," Loading your Claude Code stats\u2026"))},JL.default.createElement(j_1,{allTimePromise:$,onClose:H}))}function j_1({allTimePromise:H,onClose:$}){let A=JW.use(H),[L,I]=JW.useState("all"),[D,B]=JW.useState({}),[f,E]=JW.useState(!1),[M,G]=JW.useState("Overview"),[U,X]=JW.useState(null);JW.useEffect(()=>{if(L==="all")return;if(D[L])return;let W=!1;return E(!0),ZhA(L).then((P)=>{if(!W)B((C)=>({...C,[L]:P})),E(!1)}).catch(()=>{if(!W)E(!1)}),()=>{W=!0}},[L,D]);let J=L==="all"?A.type==="success"?A.data:null:D[L]??(A.type==="success"?A.data:null),F=A.type==="success"?A.data:null,Q=JW.useCallback(()=>{$("Stats dialog dismissed",{display:"system"})},[$]);if(BA("confirm:no",Q,{context:"Confirmation"}),WL((W,P)=>{if(P.ctrl&&(W==="c"||W==="d"))$("Stats dialog dismissed",{display:"system"});if(P.tab)G((C)=>C==="Overview"?"Models":"Overview");if(W==="r"&&!P.ctrl&&!P.meta)I(x_1(L));if(U8()&&P.ctrl&&W==="s"&&J)k_1(J,M,X)}),A.type==="error")return JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"error"},"Failed to load stats: ",A.message));if(A.type==="empty")return JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"warning"},"No stats available yet. Start using Claude Code!"));if(!J||!F)return JL.default.createElement(x,{marginTop:1},JL.default.createElement(vD,null),JL.default.createElement(V,null," Loading stats\u2026"));return JL.default.createElement(x,{flexDirection:"column",marginX:1,marginTop:1},JL.default.createElement(x,{flexDirection:"row",gap:1,marginBottom:1},JL.default.createElement(Zz,{title:"",color:"claude",defaultTab:"Overview"},JL.default.createElement(WU,{title:"Overview"},JL.default.createElement(R_1,{stats:J,allTimeStats:F,dateRange:L,isLoading:f})),JL.default.createElement(WU,{title:"Models"},JL.default.createElement(h_1,{stats:J,dateRange:L,isLoading:f})))),JL.default.createElement(x,{paddingLeft:1},JL.default.createElement(V,{dimColor:!0},"Esc to cancel \xB7 r to cycle dates",U8()&&JL.default.createElement(JL.default.Fragment,null," \xB7 ctrl+s to copy",U?` \xB7 ${U}`:""))))}function ArD({dateRange:H,isLoading:$}){return JL.default.createElement(x,{marginBottom:1,gap:1},JL.default.createElement(x,null,Jz$.map((A,L)=>JL.default.createElement(V,{key:A},L>0&&JL.default.createElement(V,{dimColor:!0}," \xB7 "),A===H?JL.default.createElement(V,{bold:!0,color:"claude"},tnD[A]):JL.default.createElement(V,{dimColor:!0},tnD[A])))),$&&JL.default.createElement(vD,null))}function R_1({stats:H,allTimeStats:$,dateRange:A,isLoading:L}){let{columns:I}=QL(),D=Object.entries(H.modelUsage).sort(([,U],[,X])=>X.inputTokens+X.outputTokens-(U.inputTokens+U.outputTokens)),B=D[0],f=D.reduce((U,[,X])=>U+X.inputTokens+X.outputTokens,0),E=JW.useMemo(()=>LrD(H,f),[H,f]),M=A==="7d"?7:A==="30d"?30:H.totalDays,G=null;return JL.default.createElement(x,{flexDirection:"column",marginTop:1},$.dailyActivity.length>0&&JL.default.createElement(x,{flexDirection:"column",marginBottom:1},JL.default.createElement(m9,null,ThA($.dailyActivity,{terminalWidth:I}))),JL.default.createElement(ArD,{dateRange:A,isLoading:L}),JL.default.createElement(x,{flexDirection:"row",gap:4,marginBottom:1},JL.default.createElement(x,{flexDirection:"column",width:28},B&&JL.default.createElement(V,{wrap:"truncate"},"Favorite model:"," ",JL.default.createElement(V,{color:"claude",bold:!0},hV(B[0])))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Total tokens:"," ",JL.default.createElement(V,{color:"claude"},a0(f))))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Sessions:"," ",JL.default.createElement(V,{color:"claude"},a0(H.totalSessions)))),JL.default.createElement(x,{flexDirection:"column",width:28},H.longestSession&&JL.default.createElement(V,{wrap:"truncate"},"Longest session:"," ",JL.default.createElement(V,{color:"claude"},of(H.longestSession.duration))))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Active days: ",JL.default.createElement(V,{color:"claude"},H.activeDays),JL.default.createElement(V,{color:"subtle"},"/",M))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Longest streak:"," ",JL.default.createElement(V,{color:"claude",bold:!0},H.streaks.longestStreak)," ",H.streaks.longestStreak===1?"day":"days"))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},H.peakActivityDay&&JL.default.createElement(V,{wrap:"truncate"},"Most active day:"," ",JL.default.createElement(V,{color:"claude"},O_1(H.peakActivityDay)))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Current streak:"," ",JL.default.createElement(V,{color:"claude",bold:!0},$.streaks.currentStreak)," ",$.streaks.currentStreak===1?"day":"days"))),!1,G&&JL.default.createElement(JL.default.Fragment,null,JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,null,"Shot distribution")),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[0].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[0].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[0].pct,"%)"))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[1].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[1].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[1].pct,"%)")))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[2].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[2].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[2].pct,"%)"))),JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},G.buckets[3].label,":"," ",JL.default.createElement(V,{color:"claude"},G.buckets[3].count),JL.default.createElement(V,{color:"subtle"}," (",G.buckets[3].pct,"%)")))),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:28},JL.default.createElement(V,{wrap:"truncate"},"Avg/session:"," ",JL.default.createElement(V,{color:"claude"},G.avgShots))))),E&&JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"suggestion"},E)))}function LrD(H,$){let A=[];if($>0){let I=y_1.filter((D)=>$>=D.tokens);for(let D of I){let B=$/D.tokens;if(B>=2)A.push(`You've used ~${Math.floor(B)}x more tokens than ${D.name}`);else A.push(`You've used the same number of tokens as ${D.name}`)}}if(H.longestSession){let I=H.longestSession.duration/60000;for(let D of v_1){let B=I/D.minutes;if(B>=2)A.push(`Your longest session is ~${Math.floor(B)}x longer than ${D.name}`)}}if(A.length===0)return"";let L=Math.floor(Math.random()*A.length);return A[L]}function h_1({stats:H,dateRange:$,isLoading:A}){let[L,I]=JW.useState(0),{columns:D}=QL(),B=4,f=Object.entries(H.modelUsage).sort(([,P],[,C])=>C.inputTokens+C.outputTokens-(P.inputTokens+P.outputTokens));if(WL((P,C)=>{if(C.downArrow&&LMath.min(Y+2,f.length-4));if(C.upArrow&&L>0)I((Y)=>Math.max(Y-2,0))}),f.length===0)return JL.default.createElement(x,null,JL.default.createElement(V,{color:"subtle"},"No model usage data available"));let E=f.reduce((P,[,C])=>P+C.inputTokens+C.outputTokens,0),M=IrD(H.dailyModelTokens,f.map(([P])=>P),D),G=f.slice(L,L+4),U=Math.ceil(G.length/2),X=G.slice(0,U),J=G.slice(U),F=L>0,Q=L4;return JL.default.createElement(x,{flexDirection:"column",marginTop:1},M&&JL.default.createElement(x,{flexDirection:"column",marginBottom:1},JL.default.createElement(V,{bold:!0},"Tokens per Day"),JL.default.createElement(m9,null,M.chart),JL.default.createElement(V,{color:"subtle"},M.xAxisLabels),JL.default.createElement(x,null,M.legend.map((P,C)=>JL.default.createElement(V,{key:P.model},C>0?" \xB7 ":"",JL.default.createElement(m9,null,P.coloredBullet)," ",P.model)))),JL.default.createElement(ArD,{dateRange:$,isLoading:A}),JL.default.createElement(x,{flexDirection:"row",gap:4},JL.default.createElement(x,{flexDirection:"column",width:36},X.map(([P,C])=>JL.default.createElement(snD,{key:P,model:P,usage:C,totalTokens:E}))),JL.default.createElement(x,{flexDirection:"column",width:36},J.map(([P,C])=>JL.default.createElement(snD,{key:P,model:P,usage:C,totalTokens:E})))),W&&JL.default.createElement(x,{marginTop:1},JL.default.createElement(V,{color:"subtle"},F?pH.arrowUp:" "," ",Q?pH.arrowDown:" "," ",L+1,"-",Math.min(L+4,f.length)," of"," ",f.length," models (\u2191\u2193 to scroll)")))}function snD({model:H,usage:$,totalTokens:A}){let I=(($.inputTokens+$.outputTokens)/A*100).toFixed(1);return JL.default.createElement(x,{flexDirection:"column"},JL.default.createElement(V,null,pH.bullet," ",JL.default.createElement(V,{bold:!0},hV(H))," ",JL.default.createElement(V,{color:"subtle"},"(",I,"%)")),JL.default.createElement(V,{color:"subtle"}," ","In: ",a0($.inputTokens)," \xB7 Out:"," ",a0($.outputTokens)))}function IrD(H,$,A){if(H.length<2||$.length===0)return null;let L=7,I=A-L,D=Math.min(52,Math.max(20,I)),B;if(H.length>=D)B=H.slice(-D);else{let F=Math.floor(D/H.length);B=[];for(let Q of H)for(let W=0;WP.tokensByModel[Q]||0);if(W.some((P)=>P>0)){M.push(W);let P=[f.suggestion,f.success,f.warning];G.push({model:hV(Q),coloredBullet:du(pH.bullet,P[F%P.length])})}}if(M.length===0)return null;let X=HrD.plot(M,{height:8,colors:E.slice(0,M.length),format:(F)=>{let Q;if(F>=1e6)Q=(F/1e6).toFixed(1)+"M";else if(F>=1000)Q=(F/1000).toFixed(0)+"k";else Q=F.toFixed(0);return Q.padStart(6)}}),J=b_1(B,B.length,L);return{chart:X,legend:G,xAxisLabels:J}}function b_1(H,$,A){if(H.length===0)return"";let L=Math.min(4,Math.max(2,Math.floor(H.length/8))),I=H.length-6,D=Math.floor(I/(L-1))||1,B=[];for(let M=0;MA(null),2000)}function u_1(H,$){let A=[];if($==="Overview")A.push(...g_1(H));else A.push(...m_1(H));while(A.length>0&&enD(A[A.length-1]).trim()==="")A.pop();if(A.length>0){let L=A[A.length-1],I=enD(L).length,D=$==="Overview"?70:80,B="/stats",f=Math.max(2,D-I-6);A[A.length-1]=L+" ".repeat(f)+oH.gray("/stats")}return A.join(` `)}function enD(H){return H.replace(/\x1b\[[0-9;]*m/g,"")}function g_1(H){let $=[],A=c6(M$().theme),L=(W)=>du(W,A.claude),I=18,D=40,B=18,f=(W,P,C,Y)=>{let Z=(W+":").padEnd(18),q=Z.length+P.length,O=Math.max(2,40-q),j=(C+":").padEnd(18);return Z+L(P)+" ".repeat(O)+j+L(Y)};if(H.dailyActivity.length>0)$.push(ThA(H.dailyActivity,{terminalWidth:56})),$.push("");let E=Object.entries(H.modelUsage).sort(([,W],[,P])=>P.inputTokens+P.outputTokens-(W.inputTokens+W.outputTokens)),M=E[0],G=E.reduce((W,[,P])=>W+P.inputTokens+P.outputTokens,0);if(M)$.push(f("Favorite model",hV(M[0]),"Total tokens",a0(G)));$.push(""),$.push(f("Sessions",a0(H.totalSessions),"Longest session",H.longestSession?of(H.longestSession.duration):"N/A"));let U=`${H.streaks.currentStreak} ${H.streaks.currentStreak===1?"day":"days"}`,X=`${H.streaks.longestStreak} ${H.streaks.longestStreak===1?"day":"days"}`;$.push(f("Current streak",U,"Longest streak",X));let J=`${H.activeDays}/${H.totalDays}`,F=H.peakActivityHour!==null?`${H.peakActivityHour}:00-${H.peakActivityHour+1}:00`:"N/A";$.push(f("Active days",J,"Peak hour",F)),$.push("");let Q=LrD(H,G);return $.push(L(Q)),$.push(oH.gray(`Stats from the last ${H.totalDays} days`)),$}function m_1(H){let $=[],A=Object.entries(H.modelUsage).sort(([,f],[,E])=>E.inputTokens+E.outputTokens-(f.inputTokens+f.outputTokens));if(A.length===0)return $.push(oH.gray("No model usage data available")),$;let L=A[0],I=A.reduce((f,[,E])=>f+E.inputTokens+E.outputTokens,0),D=IrD(H.dailyModelTokens,A.map(([f])=>f),80);if(D){$.push(oH.bold("Tokens per Day")),$.push(D.chart),$.push(oH.gray(D.xAxisLabels));let f=D.legend.map((E)=>`${E.coloredBullet} ${E.model}`).join(" \xB7 ");$.push(f),$.push("")}$.push(`${pH.star} Favorite: ${oH.magenta.bold(hV(L?.[0]||""))} \xB7 ${pH.circle} Total: ${oH.magenta(a0(I))} tokens`),$.push("");let B=A.slice(0,3);for(let[f,E]of B){let G=((E.inputTokens+E.outputTokens)/I*100).toFixed(1);$.push(`${pH.bullet} ${oH.bold(hV(f))} ${oH.gray(`(${G}%)`)}`),$.push(oH.dim(` In: ${a0(E.inputTokens)} \xB7 Out: ${a0(E.outputTokens)}`))}return $}var JL,JW,HrD,tnD,Jz$,y_1,v_1;var DrD=K(()=>{xH();$I();JM();J1H();jI();r0();qhA();bnD();Q9();onD();aI();vA();Ky();Cn();OB();JL=b(s(),1),JW=b(s(),1),HrD=b(NnD(),1);tnD={"7d":"Last 7 days","30d":"Last 30 days",all:"All time"},Jz$=["all","7d","30d"];y_1=[{name:"The Little Prince",tokens:22000},{name:"The Old Man and the Sea",tokens:35000},{name:"A Christmas Carol",tokens:37000},{name:"Animal Farm",tokens:39000},{name:"Fahrenheit 451",tokens:60000},{name:"The Great Gatsby",tokens:62000},{name:"Slaughterhouse-Five",tokens:64000},{name:"Brave New World",tokens:83000},{name:"The Catcher in the Rye",tokens:95000},{name:"Harry Potter and the Philosopher's Stone",tokens:103000},{name:"The Hobbit",tokens:123000},{name:"1984",tokens:123000},{name:"To Kill a Mockingbird",tokens:130000},{name:"Pride and Prejudice",tokens:156000},{name:"Dune",tokens:244000},{name:"Moby-Dick",tokens:268000},{name:"Crime and Punishment",tokens:274000},{name:"A Game of Thrones",tokens:381000},{name:"Anna Karenina",tokens:468000},{name:"Don Quixote",tokens:520000},{name:"The Lord of the Rings",tokens:576000},{name:"The Count of Monte Cristo",tokens:603000},{name:"Les Mis\xE9rables",tokens:689000},{name:"War and Peace",tokens:730000}],v_1=[{name:"a TED talk",minutes:18},{name:"an episode of The Office",minutes:22},{name:"listening to Abbey Road",minutes:47},{name:"a yoga class",minutes:60},{name:"a World Cup soccer match",minutes:90},{name:"a half marathon (average time)",minutes:120},{name:"the movie Inception",minutes:148},{name:"watching Titanic",minutes:195},{name:"a transatlantic flight",minutes:420},{name:"a full night of sleep",minutes:480}]});var BrD={};XA(BrD,{call:()=>p_1});var yhA,p_1=async(H)=>{return yhA.createElement($rD,{onClose:H})};var frD=K(()=>{DrD();yhA=b(s(),1)});var d_1,ErD;var MrD=K(()=>{d_1={type:"local-jsx",name:"stats",description:"Show your Claude Code usage statistics and activity",isEnabled:()=>!0,isHidden:!1,load:()=>Promise.resolve().then(() => (frD(),BrD)),userFacingName(){return"stats"}},ErD=d_1});function UrD(){return My()}function c_1(){return My()}function r_1(H){let $=wb.extname(H).toLowerCase();return l_1[$]||null}function a_1(H){let $={},A={},L=0,I=0,D=0,B=0,f=0,E=[],M=0,G={},U=!1,X=0,J=0,F=new Set,Q=[],W=[],P=!1,C=!1,Y=!1,Z=null;for(let q of H.messages){let O=q.timestamp;if(q.type==="assistant"&&q.message){if(O)Z=O;let j=q.message.usage;if(j)D+=j.input_tokens||0,B+=j.output_tokens||0;let u=q.message.content;if(Array.isArray(u)){for(let y of u)if(y.type==="tool_use"&&"name"in y){let g=y.name;if($[g]=($[g]||0)+1,g==="Task")U=!0;if(g.startsWith("mcp__"))P=!0;if(g==="WebSearch")C=!0;if(g==="WebFetch")Y=!0;let h=y.input;if(h){let p=h.file_path||"";if(p){let k=r_1(p);if(k)A[k]=(A[k]||0)+1;if(g==="Edit"||g==="Write")F.add(p)}if(g==="Edit"){let k=h.old_string||"",n=h.new_string||"",GH=k?k.split(` "claude_helpfulness": "unhelpful|slightly_helpful|moderately_helpful|very_helpful|essential", }`,B=(await Qz$({systemPrompt:[],userPrompt:L,signal:new AbortController().signal,options:{model:UrD(),querySource:"insights",agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:4096}})).message.content.filter((E)=>E.type==="text").map((E)=>E.text).join("").match(/\{[\s\S]*\}/);if(!B)return null;let f=DA(B[0]);return f.session_id=$,f}catch(A){return r(A instanceof Error?A:Error("Facet extraction failed")),null}}function DY1(H,$){let A={total_sessions:H.length,sessions_with_facets:$.size,date_range:{start:"",end:""},total_messages:0,total_duration_hours:0,total_input_tokens:0,total_output_tokens:0,tool_counts:{},languages:{},git_commits:0,git_pushes:0,projects:{},goal_categories:{},outcomes:{},satisfaction:{},helpfulness:{},session_types:{},friction:{},success:{},session_summaries:[],total_interruptions:0,total_tool_errors:0,tool_error_categories:{},user_response_times:[],median_response_time:0,avg_response_time:0,sessions_using_task_agent:0,sessions_using_mcp:0,sessions_using_web_search:0,sessions_using_web_fetch:0,total_lines_added:0,total_lines_removed:0,total_files_modified:0,days_active:0,messages_per_day:0,message_hours:[],multi_clauding:{overlap_events:0,sessions_involved:0,user_messages_during:0}},L=[],I=[],D=[];for(let X of H){L.push(X.start_time),A.total_messages+=X.user_message_count,A.total_duration_hours+=X.duration_minutes/60,A.total_input_tokens+=X.input_tokens,A.total_output_tokens+=X.output_tokens,A.git_commits+=X.git_commits,A.git_pushes+=X.git_pushes,A.total_interruptions+=X.user_interruptions,A.total_tool_errors+=X.tool_errors;for(let[F,Q]of Object.entries(X.tool_error_categories))A.tool_error_categories[F]=(A.tool_error_categories[F]||0)+Q;if(I.push(...X.user_response_times),X.uses_task_agent)A.sessions_using_task_agent++;if(X.uses_mcp)A.sessions_using_mcp++;if(X.uses_web_search)A.sessions_using_web_search++;if(X.uses_web_fetch)A.sessions_using_web_fetch++;A.total_lines_added+=X.lines_added,A.total_lines_removed+=X.lines_removed,A.total_files_modified+=X.files_modified,D.push(...X.message_hours);for(let[F,Q]of Object.entries(X.tool_counts))A.tool_counts[F]=(A.tool_counts[F]||0)+Q;for(let[F,Q]of Object.entries(X.languages))A.languages[F]=(A.languages[F]||0)+Q;if(X.project_path)A.projects[X.project_path]=(A.projects[X.project_path]||0)+1;let J=$.get(X.session_id);if(J){for(let[F,Q]of Object.entries(J.goal_categories))if(Q>0)A.goal_categories[F]=(A.goal_categories[F]||0)+Q;A.outcomes[J.outcome]=(A.outcomes[J.outcome]||0)+1;for(let[F,Q]of Object.entries(J.user_satisfaction_counts))if(Q>0)A.satisfaction[F]=(A.satisfaction[F]||0)+Q;A.helpfulness[J.claude_helpfulness]=(A.helpfulness[J.claude_helpfulness]||0)+1,A.session_types[J.session_type]=(A.session_types[J.session_type]||0)+1;for(let[F,Q]of Object.entries(J.friction_counts))if(Q>0)A.friction[F]=(A.friction[F]||0)+Q;if(J.primary_success!=="none")A.success[J.primary_success]=(A.success[J.primary_success]||0)+1}if(A.session_summaries.length<50)A.session_summaries.push({id:X.session_id.slice(0,8),date:X.start_time.split("T")[0]||"",summary:X.summary||X.first_prompt.slice(0,100),goal:J?.underlying_goal})}if(L.sort(),A.date_range.start=L[0]?.split("T")[0]||"",A.date_range.end=L[L.length-1]?.split("T")[0]||"",A.user_response_times=I,I.length>0){let X=[...I].sort((J,F)=>J-F);A.median_response_time=X[Math.floor(X.length/2)]||0,A.avg_response_time=I.reduce((J,F)=>J+F,0)/I.length}let B=new Set(L.map((X)=>X.split("T")[0]));A.days_active=B.size,A.messages_per_day=A.days_active>0?Math.round(A.total_messages/A.days_active*10)/10:0,A.message_hours=D;let f=30,E=[];for(let X of H)for(let J of X.user_message_timestamps)try{let F=new Date(J).getTime();E.push({ts:F,sessionId:X.session_id})}catch{}E.sort((X,J)=>X.ts-J.ts);let M=new Set,G=new Set;for(let X=0;Xf)break;if(Q.sessionId!==J.sessionId)for(let P=F+1;Pf)break;if(C.sessionId===J.sessionId){let Z=[J.sessionId,Q.sessionId].sort().join(":");M.add(Z),G.add(`${J.ts}:${J.sessionId}`),G.add(`${Q.ts}:${Q.sessionId}`),G.add(`${C.ts}:${C.sessionId}`);break}}}}let U=new Set;for(let X of M){let[J,F]=X.split(":");if(J)U.add(J);if(F)U.add(F)}return A.multi_clauding={overlap_events:M.size,sessions_involved:U.size,user_messages_during:G.size},A}async function GrD(H,$){try{let L=(await Qz$({systemPrompt:[],userPrompt:H.prompt+` `+$,signal:new AbortController().signal,options:{model:c_1(),querySource:"insights",agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:H.maxTokens}})).message.content.filter((I)=>I.type==="text").map((I)=>I.text).join("");if(L){let I=L.match(/\{[\s\S]*\}/);if(I)try{return{name:H.name,result:DA(I[0])}}catch{return{name:H.name,result:null}}}return{name:H.name,result:null}}catch(A){return r(A instanceof Error?A:Error(`${H.name} failed`)),{name:H.name,result:null}}}async function fY1(H,$){let A=Array.from($.values()).slice(0,50).map((C)=>`- ${C.brief_summary} (${C.outcome}, ${C.claude_helpfulness})`).join(` `),I=Array.from($.values()).flatMap((C)=>C.user_instructions_to_claude||[]).slice(0,15).map((C)=>`- ${C}`).join(` ${J.claude_md_additions&&J.claude_md_additions.length>0?`
${J.claude_md_additions.map((y,g)=>`
.claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; } .claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; } .claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe; } .claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; } .claude-md-item:last-child { border-bottom: none; } .claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; } .claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; } .claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe; } .claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; } .claude-md-item:last-child { border-bottom: none; } `,BY1,EY1,MY1,KY1,XrD;var JrD=K(()=>{rB();aI();DL();Z$();NA();_$();dU();Z$();wb=require("path");l_1={".ts":"TypeScript",".tsx":"TypeScript",".js":"JavaScript",".jsx":"JavaScript",".py":"Python",".rb":"Ruby",".go":"Go",".rs":"Rust",".java":"Java",".md":"Markdown",".json":"JSON",".yaml":"YAML",".yml":"YAML",".sh":"Shell",".css":"CSS",".html":"HTML"},i_1={debug_investigate:"Debug/Investigate",implement_feature:"Implement Feature",fix_bug:"Fix Bug",write_script_tool:"Write Script/Tool",refactor_code:"Refactor Code",configure_system:"Configure System",create_pr_commit:"Create PR/Commit",analyze_data:"Analyze Data",understand_codebase:"Understand Codebase",write_tests:"Write Tests",write_docs:"Write Docs",deploy_infra:"Deploy/Infra",warmup_minimal:"Cache Warmup",fast_accurate_search:"Fast/Accurate Search",correct_code_edits:"Correct Code Edits",good_explanations:"Good Explanations",proactive_help:"Proactive Help",multi_file_changes:"Multi-file Changes",handled_complexity:"Multi-file Changes",good_debugging:"Good Debugging",misunderstood_request:"Misunderstood Request",wrong_approach:"Wrong Approach",buggy_code:"Buggy Code",user_rejected_action:"User Rejected Action",claude_got_blocked:"Claude Got Blocked",user_stopped_early:"User Stopped Early",wrong_file_or_location:"Wrong File/Location",excessive_changes:"Excessive Changes",slow_or_verbose:"Slow/Verbose",tool_failed:"Tool Failed",user_unclear:"User Unclear",external_issue:"External Issue",frustrated:"Frustrated",dissatisfied:"Dissatisfied",likely_satisfied:"Likely Satisfied",satisfied:"Satisfied",happy:"Happy",unsure:"Unsure",neutral:"Neutral",delighted:"Delighted",single_task:"Single Task",multi_task:"Multi Task",iterative_refinement:"Iterative Refinement",exploration:"Exploration",quick_question:"Quick Question",fully_achieved:"Fully Achieved",mostly_achieved:"Mostly Achieved",partially_achieved:"Partially Achieved",not_achieved:"Not Achieved",unclear_from_transcript:"Unclear",unhelpful:"Unhelpful",slightly_helpful:"Slightly Helpful",moderately_helpful:"Moderately Helpful",very_helpful:"Very Helpful",essential:"Essential"},vhA=wb.join(UL(),"usage-data"),Kz$=wb.join(vhA,"facets");BY1=[{name:"project_areas",prompt:`Analyze this Claude Code usage data and identify project areas. - How to use: Run \`claude mcp add -- \` - How to use: Create \`.claude/skills/commit/SKILL.md\` with instructions. Then type \`/commit\` to run it. - How to use: Add to \`.claude/settings.json\` under "hooks" key. - How to use: \`claude -p "fix lint errors" --allowedTools "Edit,Read,Bash"\` "claude_md_additions": [ IMPORTANT for claude_md_additions: PRIORITIZE instructions that appear MULTIPLE TIMES in the user data. If user told Claude the same thing in 2+ sessions (e.g., 'always run tests', 'use TypeScript'), that's a PRIME candidate - they shouldn't have to repeat themselves. Each wake-up costs an API call, but the prompt cache expires after 5 minutes of inactivity \u2014 balance accordingly.`});async function PY1(){if(!nL())return null;let H=`${XD().BASE_API_URL}/api/oauth/claude_cli/client_data`,$=dD()?.accessToken??null,A=()=>{let L=eG();if(L.error)throw Error(`Auth error: ${L.error}`);let I={"Content-Type":"application/json","User-Agent":sG(),...L.headers};return nA.get(H,{headers:I,timeout:5000}).then((D)=>D.data.client_data??null)};try{return await A()}catch(L){if(nA.isAxiosError(L)&&L.response?.status===401&&$){if(await A4H($))return await A()}throw L}}async function YY1(){try{let H=await _Y1(),$={data:H,timestamp:Date.now()};return AA((A)=>({...A,clientDataCache:$})),H}catch(H){return r(H),null}}function CY1(H){if(!H)return null;let $=H.system_prompt_variant;return typeof $==="string"?$:null}function WrD(){YY1();try{let H=M$().clientDataCache;return H?CY1(H.data):null}catch{return null}}var VY1=3600000,_Y1;var VrD=K(()=>{w1();wwH();_Q();_$();vA();qE();EI();_Y1=zGH(PY1,VY1)});var Wz$="IMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.";function qY1(H){return` - To give feedback, users should ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.ISSUES_EXPLAINER}`}function TY1(H){if(H!==null)return null;return`# Tone and style You have access to past session data that may contain valuable context. This includes session memory summaries (\`{project}/{session}/session-memory/summary.md\`) and full transcript logs (\`{project}/{sessionId}.jsonl\`), stored under \`~/.claude/projects/\`. `)}function hY1(){let H=[`Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.`,"Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.","Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task\u2014three similar lines of code is better than a premature abstraction."],$=["/help: Get help with using Claude Code",`To give feedback, users should ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.ISSUES_EXPLAINER}`],A=['The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change "methodName" to snake case, do not reply with just "method_name", instead find the method in the code and modify the code.',"You are highly capable and often allow users to complete ambitious tasks that would otherwise be too complex or take too long. You should defer to user judgement about whether a task is too large to attempt.","In general, do not propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications","Do not create files unless they're absolutely necessary for achieving your goal. Generally prefer editing an existing file to creating a new one, as this prevents file bloat and builds on existing work more effectively.","Avoid giving time estimates or predictions for how long tasks will take, whether for your own work or for users planning projects. Focus on what needs to be done, not how long it might take.",`If your approach is blocked, do not attempt to brute force your way to the outcome. For example, if an API call or test fails, do not wait and retry the same action repeatedly. Instead, consider alternative approaches or other ways you might unblock yourself, or consider using the ${EU} to align with the user on the right path forward.`,"Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it. Prioritize writing safe, secure, and correct code.","Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.",H,"Avoid backwards-compatibility hacks like renaming unused _vars, re-exporting types, adding // removed comments for removed code, etc. If you are certain that something is unused, you can delete it completely.","If the user asks for help or wants to give feedback inform them of the following:",$];return["# Doing tasks",...C3H(A)].join(` `,G=` `)}function NrD(H){if(H.includes("claude-opus-4-6"))return"May 2025";else if(H.includes("claude-opus-4-5"))return"May 2025";else if(H.includes("claude-haiku-4"))return"February 2025";else if(H.includes("claude-opus-4")||H.includes("claude-sonnet-4-5")||H.includes("claude-sonnet-4"))return"January 2025";return null}async function IkH(H,$,A){let I=await chA($,A);return[...H,`Notes: The scratchpad directory is session-specific, isolated from the user's project, and can be used freely without permission prompts.`}var wY1=null,p3H="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",dhA="Claude Opus 4.6",ZY1="claude-opus-4-6",phA,OrD,GQD="You are an agent for Claude Code, Anthropic's official CLI for Claude. Given the user's message, you should use the tools available to complete the task. Do what has been asked; nothing more, nothing less. When you complete the task simply respond with a detailed writeup.";var Ow=K(()=>{Z1();t8();PI();mL();GK();tG();q5H();B0();$4H();h4();BW();jh();vV();hyH();BM();rB();g$();NA();tD();aI();SD();mZ$();mhA();EE();E$();I7A();VrD();phA={opus:"claude-opus-4-6",sonnet:"claude-sonnet-4-5-20250929",haiku:"claude-haiku-4-5-20251001"};OrD=o$(async function(){try{let{stdout:H}=await jA("uname",["-sr"],{preserveOutputOnError:!1});return H.trim()}catch{return"unknown"}})});function y4$(H){let $={},A=process.env.CLAUDE_CODE_EXTRA_BODY,L={};if(A)try{let D=q1(A);if(D&&typeof D==="object"&&!Array.isArray(D))L=D;else N(`CLAUDE_CODE_EXTRA_BODY env var must be a JSON object, but was given ${A}`,{level:"error"})}catch(D){N(`Error parsing CLAUDE_CODE_EXTRA_BODY: ${D instanceof Error?D.message:String(D)}`,{level:"error"})}let I={...$,...L};if(H&&H.length>0)if(I.anthropic_beta&&Array.isArray(I.anthropic_beta)){let D=I.anthropic_beta,B=H.filter((f)=>!D.includes(f));I.anthropic_beta=[...D,...B]}else I.anthropic_beta=H;return I}function SrD(H){if(A$(process.env.DISABLE_PROMPT_CACHING))return!1;if(A$(process.env.DISABLE_PROMPT_CACHING_HAIKU)){let $=LJ();if(H===$)return!1}if(A$(process.env.DISABLE_PROMPT_CACHING_SONNET)){let $=Oq();if(H===$)return!1}if(A$(process.env.DISABLE_PROMPT_CACHING_OPUS)){let $=My();if(H===$)return!1}return!0}function KPH(H){return{type:"ephemeral",...nL()&&!a2.isUsingOverage?{ttl:"1h"}:{},...H==="global"?{scope:H}:{}}}function mY1(H,$,A,L,I){if(!Ks()||!cgH(I)||"effort"in $)return;if(H===void 0)L.push(ZS$);else if(typeof H==="string")$.effort=H,L.push(ZS$)}function qr(){let H=ux(),$=T9()?.accountUuid??"",A=j$();return{user_id:`user_${H}_account_${$}_session_${A}`}}async function RrD(H,$){if($)return!0;try{let A=LJ(),L=U2(A);return await chI(RU$(()=>eO({apiKey:H,maxRetries:3,model:A}),async(I)=>{let D=[{role:"user",content:"test"}];return await I.beta.messages.create({model:A,max_tokens:1,messages:D,temperature:1,...L.length>0?{betas:L}:{},metadata:qr(),...y4$()}),!0},{maxRetries:2,model:A}))}catch(A){let L=A;if(A instanceof ay)L=A.originalError;if(r(L),L instanceof Error&&L.message.includes('{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}'))return!1;throw L}}function pY1(H,$=!1,A){if($)if(typeof H.message.content==="string")return{role:"user",content:[{type:"text",text:H.message.content,...A?{cache_control:KPH()}:{}}]};else return{role:"user",content:H.message.content.map((L,I)=>({...L,...I===H.message.content.length-1?A?{cache_control:KPH()}:{}:{}}))};return{role:"user",content:H.message.content}}function dY1(H,$=!1,A){if($)if(typeof H.message.content==="string")return{role:"assistant",content:[{type:"text",text:H.message.content,...A?{cache_control:KPH()}:{}}]};else return{role:"assistant",content:H.message.content.map((L,I)=>({...L,...I===H.message.content.length-1&&L.type!=="thinking"&&L.type!=="redacted_thinking"?A?{cache_control:KPH()}:{}:{}}))};return{role:"assistant",content:H.message.content}}async function xm({messages:H,systemPrompt:$,maxThinkingTokens:A,tools:L,signal:I,options:D}){let B;for await(let f of m5A(H,async function*(){yield*yrD(H,$,A,L,I,D)}))if(f.type==="assistant")B=f;if(!B){if(I.aborted)throw new rf;throw Error("No assistant message found")}return B}async function*e6H({messages:H,systemPrompt:$,maxThinkingTokens:A,tools:L,signal:I,options:D}){return yield*m5A(H,async function*(){yield*yrD(H,$,A,L,I,D)})}function cY1(H){if(!("isLsp"in H)||!H.isLsp)return!1;let $=w9H();return $.status==="pending"||$.status==="not-started"}async function*jrD(H,$,A,L,I){let D=RU$(()=>eO({maxRetries:0,model:H.model,fetchOverride:H.fetchOverride}),async(f,E,M)=>{let G=Date.now(),U=A(M);I(U),L(E,G,U.max_tokens);let X=rY1(U,nY1);return await f.beta.messages.create({...X,model:vu(X.model)})},{model:$.model,fallbackModel:$.fallbackModel,maxThinkingTokens:$.maxThinkingTokens,...cD()?{fastMode:$.fastMode}:{},signal:$.signal}),B;do if(B=await D.next(),!B.done&&B.value.type==="system")yield B.value;while(!B.done);return B.value}async function*yrD(H,$,A,L,I,D){if(!nL()&&(await aS("tengu-off-switch",{activated:!1})).activated&&_5H(D.model)){c("tengu_off_switch_query",{}),yield SU$(Error(ADH),D.model);return}let B=sI()==="bedrock"&&D.model.includes("application-inference-profile")?await zD$(D.model)??D.model:D.model;_9("query_tool_schema_build_start");let f=YeH(D.model),E=await puH(D.model,L,D.getToolPermissionContext,D.agents,"query");if(E&&!L.some(U3))N("Tool search disabled: no deferred tools available to search"),E=!1;let M;if(E){let e=rhA(H);M=L.filter((DH)=>{if(!U3(DH))return!0;if(DH.name===C7)return!0;return e.has(DH.name)})}else M=L.filter((e)=>e.name!==C7);let G=E?A8L():null;if(G&&sI()!=="bedrock"){if(!f.includes(G))f.push(G)}let U=L.some((e)=>e.isMcp===!0),X=M.some((e)=>e.name===C7),J=_eH()&&(A$(process.env.CLAUDE_CODE_FORCE_GLOBAL_CACHE)||NL("tengu_system_prompt_global_cache",!1)),F=J&&(U||X);if(J&&!f.includes(NYH))f.push(NYH);let Q;if(F){let e=M.findIndex((DH)=>DH.isMcp===!0);if(e>0)Q=M[e-1];else if(e===-1)Q=M.findLast((DH)=>DH.name!==C7);else if(e===0)N("All tools are MCP tools (firstMcpIndex === 0), no stable tool for cache marker")}let W="none";if(F&&Q)W="tool_based",N(`Using tool-based global cache marker on ${Q.name}`);else if(F&&!Q)W="system_prompt",N("No stable tool found for cache marker, falling back to system prompt caching"),c("tengu_sysprompt_no_stable_tool_for_cache",{hasMcpTools:U,hasMcpSearchTool:X,filteredToolsCount:M.length});else if(J)W="system_prompt";let P=await Promise.all(M.map((e)=>ew$(e,{getToolPermissionContext:D.getToolPermissionContext,tools:L,agents:D.agents,allowedAgentTypes:D.allowedAgentTypes,model:D.model,betas:f,deferLoading:E&&(U3(e)||cY1(e)),cacheControl:Q&&e===Q?KPH("global"):void 0})));if(E){let e=L.filter(U3).length,DH=M.filter(U3).length;N(`Dynamic tool loading: ${DH}/${e} deferred tools included`)}_9("query_tool_schema_build_end"),c("tengu_api_before_normalize",{preNormalizedMessageCount:H.length}),_9("query_message_normalization_start");let C=JJ(H,M);if(_9("query_message_normalization_end"),!E)C=C.map((e)=>{switch(e.type){case"user":return nhA(e);case"assistant":return vrD(e);default:return e}});C=hrD(C),c("tengu_api_after_normalize",{postNormalizedMessageCount:C.length});let Y=goL(C);if(E&&NF$()){let e=L.filter(U3).map((DH)=>DH.name).sort().join(` ${JSON.stringify(I,null,2)}`),Error("Language.load failed: no language function found in WASM file");let B=L[D]();return new H(He,B)}},uC1=(()=>{var _scriptName="file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js";return async function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((H,$)=>{readyPromiseResolve=H,readyPromiseReject=$}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer",ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){let{createRequire:H}=await import("module");var require=H("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js")}Module.currentQueryProgressCallback=null,Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null;var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=GA((H,$)=>{throw $},"quit_"),scriptDirectory="";function locateFile(H){if(Module.locateFile)return Module.locateFile(H,scriptDirectory);return scriptDirectory+H}GA(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");if(!"file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js".startsWith("data:"))scriptDirectory=nodePath.dirname(require("url").fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js"))+"/";if(readBinary=GA((H)=>{H=isFileURI(H)?new URL(H):H;var $=fs.readFileSync(H);return $},"readBinary"),readAsync=GA(async(H,$=!0)=>{H=isFileURI(H)?new URL(H):H;var A=fs.readFileSync(H,$?void 0:"utf8");return A},"readAsync"),!Module.thisProgram&&process.argv.length>1)thisProgram=process.argv[1].replace(/\\/g,"/");arguments_=process.argv.slice(2),quit_=GA((H,$)=>{throw process.exitCode=H,$},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER)scriptDirectory=self.location.href;else if(typeof document<"u"&&document.currentScript)scriptDirectory=document.currentScript.src;if(_scriptName)scriptDirectory=_scriptName;if(scriptDirectory.startsWith("blob:"))scriptDirectory="";else scriptDirectory=scriptDirectory.slice(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);{if(ENVIRONMENT_IS_WORKER)readBinary=GA((H)=>{var $=new XMLHttpRequest;return $.open("GET",H,!1),$.responseType="arraybuffer",$.send(null),new Uint8Array($.response)},"readBinary");readAsync=GA(async(H)=>{if(isFileURI(H))return new Promise((A,L)=>{var I=new XMLHttpRequest;I.open("GET",H,!0),I.responseType="arraybuffer",I.onload=()=>{if(I.status==200||I.status==0&&I.response){A(I.response);return}L(I.status)},I.onerror=L,I.send(null)});var $=await fetch(H,{credentials:"same-origin"});if($.ok)return $.arrayBuffer();throw Error($.status+" : "+$.url)},"readAsync")}}var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);if(Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments)arguments_=Module.arguments;if(Module.thisProgram)thisProgram=Module.thisProgram;var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(H,$){if(!H)abort($)}GA(assert,"assert");var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPU64,HEAPF64,HEAP_DATA_VIEW,runtimeInitialized=!1,isFileURI=GA((H)=>H.startsWith("file://"),"isFileURI");function updateMemoryViews(){var H=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(H),Module.HEAP8=HEAP8=new Int8Array(H),Module.HEAP16=HEAP16=new Int16Array(H),Module.HEAPU8=HEAPU8=new Uint8Array(H),Module.HEAPU16=HEAPU16=new Uint16Array(H),Module.HEAP32=HEAP32=new Int32Array(H),Module.HEAPU32=HEAPU32=new Uint32Array(H),Module.HEAPF32=HEAPF32=new Float32Array(H),Module.HEAPF64=HEAPF64=new Float64Array(H),Module.HEAP64=HEAP64=new BigInt64Array(H),Module.HEAPU64=HEAPU64=new BigUint64Array(H)}if(GA(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun){if(typeof Module.preRun=="function")Module.preRun=[Module.preRun];while(Module.preRun.length)addOnPreRun(Module.preRun.shift())}callRuntimeCallbacks(onPreRuns)}GA(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}GA(initRuntime,"initRuntime");function preMain(){}GA(preMain,"preMain");function postRun(){if(Module.postRun){if(typeof Module.postRun=="function")Module.postRun=[Module.postRun];while(Module.postRun.length)addOnPostRun(Module.postRun.shift())}callRuntimeCallbacks(onPostRuns)}GA(postRun,"postRun");var runDependencies=0,dependenciesFulfilled=null;function getUniqueRunDependency(H){return H}GA(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(H){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}GA(addRunDependency,"addRunDependency");function removeRunDependency(H){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0){if(dependenciesFulfilled){var $=dependenciesFulfilled;dependenciesFulfilled=null,$()}}}GA(removeRunDependency,"removeRunDependency");function abort(H){Module.onAbort?.(H),H="Aborted("+H+")",err(H),ABORT=!0,H+=". Build with -sASSERTIONS for more info.";var $=new WebAssembly.RuntimeError(H);throw readyPromiseReject($),$}GA(abort,"abort");var wasmBinaryFile;function findWasmBinary(){if(Module.locateFile)return locateFile("tree-sitter.wasm");return new URL("tree-sitter.wasm","file:///home/runner/work/claude-cli-internal/claude-cli-internal/node_modules/web-tree-sitter/tree-sitter.js").href}GA(findWasmBinary,"findWasmBinary");function getBinarySync(H){if(H==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(H);throw"both async and sync fetching of the wasm failed"}GA(getBinarySync,"getBinarySync");async function getWasmBinary(H){if(!wasmBinary)try{var $=await readAsync(H);return new Uint8Array($)}catch{}return getBinarySync(H)}GA(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(H,$){try{var A=await getWasmBinary(H),L=await WebAssembly.instantiate(A,$);return L}catch(I){err(`failed to asynchronously prepare wasm: ${I}`),abort(I)}}GA(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(H,$,A){if(!H&&typeof WebAssembly.instantiateStreaming=="function"&&!isFileURI($)&&!ENVIRONMENT_IS_NODE)try{var L=fetch($,{credentials:"same-origin"}),I=await WebAssembly.instantiateStreaming(L,A);return I}catch(D){err(`wasm streaming compile failed: ${D}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer($,A)}GA(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}GA(getWasmImports,"getWasmImports");async function createWasm(){function H(D,B){wasmExports=D.exports,wasmExports=relocateExports(wasmExports,1024);var f=getDylinkMetadata(B);if(f.neededDynlibs)dynamicLibraries=f.neededDynlibs.concat(dynamicLibraries);return mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}GA(H,"receiveInstance"),addRunDependency("wasm-instantiate");function $(D){return H(D.instance,D.module)}GA($,"receiveInstantiationResult");var A=getWasmImports();if(Module.instantiateWasm)return new Promise((D,B)=>{Module.instantiateWasm(A,(f,E)=>{H(f,E),D(f.exports)})});wasmBinaryFile??=findWasmBinary();try{var L=await instantiateAsync(wasmBinary,wasmBinaryFile,A),I=$(L);return I}catch(D){return readyPromiseReject(D),Promise.reject(D)}}GA(createWasm,"createWasm");var ASM_CONSTS={};class ExitStatus{static{GA(this,"ExitStatus")}name="ExitStatus";constructor(H){this.message=`Program terminated with exit(${H})`,this.status=H}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(H,$){var A=GOT[$];if(!A)A=GOT[$]=new WebAssembly.Global({value:"i32",mutable:!0});if(!currentModuleWeakSymbols.has($))A.required=!0;return A}},LE_HEAP_LOAD_F32=GA((H)=>HEAP_DATA_VIEW.getFloat32(H,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=GA((H)=>HEAP_DATA_VIEW.getFloat64(H,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=GA((H)=>HEAP_DATA_VIEW.getInt16(H,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=GA((H)=>HEAP_DATA_VIEW.getInt32(H,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U16=GA((H)=>HEAP_DATA_VIEW.getUint16(H,!0),"LE_HEAP_LOAD_U16"),LE_HEAP_LOAD_U32=GA((H)=>HEAP_DATA_VIEW.getUint32(H,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=GA((H,$)=>HEAP_DATA_VIEW.setFloat32(H,$,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=GA((H,$)=>HEAP_DATA_VIEW.setFloat64(H,$,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=GA((H,$)=>HEAP_DATA_VIEW.setInt16(H,$,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=GA((H,$)=>HEAP_DATA_VIEW.setInt32(H,$,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U16=GA((H,$)=>HEAP_DATA_VIEW.setUint16(H,$,!0),"LE_HEAP_STORE_U16"),LE_HEAP_STORE_U32=GA((H,$)=>HEAP_DATA_VIEW.setUint32(H,$,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=GA((H)=>{while(H.length>0)H.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=GA((H)=>onPostRuns.unshift(H),"addOnPostRun"),onPreRuns=[],addOnPreRun=GA((H)=>onPreRuns.unshift(H),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=GA((H,$=0,A=NaN)=>{var L=$+A,I=$;while(H[I]&&!(I>=L))++I;if(I-$>16&&H.buffer&&UTF8Decoder)return UTF8Decoder.decode(H.subarray($,I));var D="";while($>10,56320|M&1023)}}return D},"UTF8ArrayToString"),getDylinkMetadata=GA((H)=>{var $=0,A=0;function L(){return H[$++]}GA(L,"getU8");function I(){var d=0,k=1;while(!0){var n=H[$++];if(d+=(n&127)*k,k*=128,!(n&128))break}return d}GA(I,"getLEB");function D(){var d=I();return $+=d,UTF8ArrayToString(H,$-d,d)}GA(D,"getString");function B(d,k){if(d)throw Error(k)}GA(B,"failIf");var f="dylink.0";if(H instanceof WebAssembly.Module){var E=WebAssembly.Module.customSections(H,f);if(E.length===0)f="dylink",E=WebAssembly.Module.customSections(H,f);B(E.length===0,"need dylink section"),H=new Uint8Array(E[0]),A=H.length}else{var M=new Uint32Array(new Uint8Array(H.subarray(0,24)).buffer),G=M[0]==1836278016||M[0]==6386541;B(!G,"need to see wasm magic number"),B(H[8]!==0,"need the dylink section to be first"),$=9;var U=I();A=$+U,f=D()}var X={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(f=="dylink"){X.memorySize=I(),X.memoryAlign=I(),X.tableSize=I(),X.tableAlign=I();var J=I();for(var F=0;F>1)*2);case"i32":return LE_HEAP_LOAD_I32((H>>2)*4);case"i64":return HEAP64[H>>3];case"float":return LE_HEAP_LOAD_F32((H>>2)*4);case"double":return LE_HEAP_LOAD_F64((H>>3)*8);case"*":return LE_HEAP_LOAD_U32((H>>2)*4);default:abort(`invalid type for getValue: ${$}`)}}GA(getValue,"getValue");var newDSO=GA((H,$,A)=>{var L={refcount:1/0,name:H,exports:A,global:!0};if(LDSO.loadedLibsByName[H]=L,$!=null)LDSO.loadedLibsByHandle[$]=L;return L},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78224,alignMemory=GA((H,$)=>Math.ceil(H/$)*$,"alignMemory"),getMemory=GA((H)=>{if(runtimeInitialized)return _calloc(H,1);var $=___heap_base,A=$+alignMemory(H,16);return ___heap_base=A,GOT.__heap_base.value=A,$},"getMemory"),isInternalSym=GA((H)=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(H)||H.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=GA((H,$)=>{if(H<128)$.push(H);else $.push(H%128|128,H>>7)},"uleb128Encode"),sigToWasmTypes=GA((H)=>{var $={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},A={parameters:[],results:H[0]=="v"?[]:[$[H[0]]]};for(var L=1;L{var A=H.slice(0,1),L=H.slice(1),I={i:127,p:127,j:126,f:125,d:124,e:111};$.push(96),uleb128Encode(L.length,$);for(var D=0;D{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes($),H);var A=[1];generateFuncType($,A);var L=[0,97,115,109,1,0,0,0,1];uleb128Encode(A.length,L),L.push(...A),L.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var I=new WebAssembly.Module(new Uint8Array(L)),D=new WebAssembly.Instance(I,{e:{f:H}}),B=D.exports.f;return B},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:31,element:"anyfunc"}),getWasmTableEntry=GA((H)=>{var $=wasmTableMirror[H];if(!$){if(H>=wasmTableMirror.length)wasmTableMirror.length=H+1;wasmTableMirror[H]=$=wasmTable.get(H)}return $},"getWasmTableEntry"),updateTableMap=GA((H,$)=>{if(functionsInTableMap)for(var A=H;A{if(!functionsInTableMap)functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length);return functionsInTableMap.get(H)||0},"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=GA(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(H){if(!(H instanceof RangeError))throw H;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=GA((H,$)=>{wasmTable.set(H,$),wasmTableMirror[H]=wasmTable.get(H)},"setWasmTableEntry"),addFunction=GA((H,$)=>{var A=getFunctionAddress(H);if(A)return A;var L=getEmptyTableSlot();try{setWasmTableEntry(L,H)}catch(D){if(!(D instanceof TypeError))throw D;var I=convertJsFunctionToWasm(H,$);setWasmTableEntry(L,I)}return functionsInTableMap.set(H,L),L},"addFunction"),updateGOT=GA((H,$)=>{for(var A in H){if(isInternalSym(A))continue;var L=H[A];if(GOT[A]||=new WebAssembly.Global({value:"i32",mutable:!0}),$||GOT[A].value==0)if(typeof L=="function")GOT[A].value=addFunction(L);else if(typeof L=="number")GOT[A].value=L;else err(`unhandled export type for '${A}': ${typeof L}`)}},"updateGOT"),relocateExports=GA((H,$,A)=>{var L={};for(var I in H){var D=H[I];if(typeof D=="object")D=D.value;if(typeof D=="number")D+=$;L[I]=D}return updateGOT(L,A),L},"relocateExports"),isSymbolDefined=GA((H)=>{var $=wasmImports[H];if(!$||$.stub)return!1;return!0},"isSymbolDefined"),dynCall=GA((H,$,A=[])=>{var L=getWasmTableEntry($)(...A);return L},"dynCall"),stackSave=GA(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=GA((H)=>__emscripten_stack_restore(H),"stackRestore"),createInvokeFunction=GA((H)=>($,...A)=>{var L=stackSave();try{return dynCall(H,$,A)}catch(I){if(stackRestore(L),I!==I+0)throw I;if(_setThrew(1,0),H[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=GA((H,$=!1)=>{var A;if(isSymbolDefined(H))A=wasmImports[H];else if(H.startsWith("invoke_"))A=wasmImports[H]=createInvokeFunction(H.split("_")[1]);return{sym:A,name:H}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=GA((H)=>onPostCtors.unshift(H),"addOnPostCtor"),UTF8ToString=GA((H,$)=>H?UTF8ArrayToString(HEAPU8,H,$):"","UTF8ToString"),loadWebAssemblyModule=GA((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;if(handle)HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize);if(metadata.tableSize)wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(H){var $=resolveGlobalSymbol(H).sym;if(!$&&localScope)$=localScope[H];if(!$)$=moduleExports[H];return $}GA(resolveSymbol,"resolveSymbol");var proxyHandler={get(H,$){switch($){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if($ in wasmImports&&!wasmImports[$].stub){var A=wasmImports[$];return A}if(!($ in H)){var L;H[$]=(...I)=>{return L||=resolveSymbol($),L(...I)}}return H[$]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),!flags.allowUndefined)reportUndefinedSymbols();function addEmAsm(addr,body){var args=[],arity=0;for(;arity<16;arity++)if(body.indexOf("$"+arity)!=-1)args.push("$"+arity);else break;args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(GA(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports){var{__start_em_asm:start,__stop_em_asm:stop}=moduleExports;while(start ${body};`;moduleExports[name]=eval(func)}GA(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;if(applyRelocs)if(runtimeInitialized)applyRelocs();else __RELOC_FUNCS__.push(applyRelocs);var init=moduleExports.__wasm_call_ctors;if(init)if(runtimeInitialized)init();else addOnPostCtor(init);return moduleExports}if(GA(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then((H)=>postInstantiation(H.module,H.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}if(GA(loadModule,"loadModule"),flags.loadAsync)return metadata.neededDynlibs.reduce((H,$)=>H.then(()=>loadDynamicLibrary($,flags,localScope)),Promise.resolve()).then(loadModule);return metadata.neededDynlibs.forEach((H)=>loadDynamicLibrary(H,flags,localScope)),loadModule()},"loadWebAssemblyModule"),mergeLibSymbols=GA((H,$)=>{for(var[A,L]of Object.entries(H)){let I=GA((B)=>{if(!isSymbolDefined(B))wasmImports[B]=L},"setImport");I(A);let D="__main_argc_argv";if(A=="main")I(D);if(A==D)I("main")}},"mergeLibSymbols"),asyncLoad=GA(async(H)=>{var $=await readAsync(H);return new Uint8Array($)},"asyncLoad");function loadDynamicLibrary(H,$={global:!0,nodelete:!0},A,L){var I=LDSO.loadedLibsByName[H];if(I){if(!$.global){if(A)Object.assign(A,I.exports)}else if(!I.global)I.global=!0,mergeLibSymbols(I.exports,H);if($.nodelete&&I.refcount!==1/0)I.refcount=1/0;if(I.refcount++,L)LDSO.loadedLibsByHandle[L]=I;return $.loadAsync?Promise.resolve(!0):!0}I=newDSO(H,L,"loading"),I.refcount=$.nodelete?1/0:1,I.global=$.global;function D(){if(L){var E=LE_HEAP_LOAD_U32((L+28>>2)*4),M=LE_HEAP_LOAD_U32((L+32>>2)*4);if(E&&M){var G=HEAP8.slice(E,E+M);return $.loadAsync?Promise.resolve(G):G}}var U=locateFile(H);if($.loadAsync)return asyncLoad(U);if(!readBinary)throw Error(`${U}: file not found, and synchronous loading of external files is not available`);return readBinary(U)}GA(D,"loadLibData");function B(){if($.loadAsync)return D().then((E)=>loadWebAssemblyModule(E,$,H,A,L));return loadWebAssemblyModule(D(),$,H,A,L)}GA(B,"getExports");function f(E){if(I.global)mergeLibSymbols(E,H);else if(A)Object.assign(A,E);I.exports=E}if(GA(f,"moduleLoaded"),$.loadAsync)return B().then((E)=>{return f(E),!0});return f(B()),!0}GA(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=GA(()=>{for(var[H,$]of Object.entries(GOT))if($.value==0){var A=resolveGlobalSymbol(H,!0).sym;if(!A&&!$.required)continue;if(typeof A=="function")$.value=addFunction(A,A.sig);else if(typeof A=="number")$.value=A;else throw Error(`bad export type for '${H}': ${typeof A}`)}},"reportUndefinedSymbols"),loadDylibs=GA(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((H,$)=>H.then(()=>loadDynamicLibrary($,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(H,$,A="i8"){if(A.endsWith("*"))A="*";switch(A){case"i1":HEAP8[H]=$;break;case"i8":HEAP8[H]=$;break;case"i16":LE_HEAP_STORE_I16((H>>1)*2,$);break;case"i32":LE_HEAP_STORE_I32((H>>2)*4,$);break;case"i64":HEAP64[H>>3]=BigInt($);break;case"float":LE_HEAP_STORE_F32((H>>2)*4,$);break;case"double":LE_HEAP_STORE_F64((H>>3)*8,$);break;case"*":LE_HEAP_STORE_U32((H>>2)*4,$);break;default:abort(`invalid type for setValue: ${A}`)}}GA(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78224),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=GA(()=>abort(""),"__abort_js");__abort_js.sig="v";var _emscripten_get_now=GA(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var _emscripten_date_now=GA(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var nowIsMonotonic=1,checkWasiClock=GA((H)=>H>=0&&H<=3,"checkWasiClock"),INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=GA((H)=>HINT53_MAX?NaN:Number(H),"bigintToI53Checked");function _clock_time_get(H,$,A){if($=bigintToI53Checked($),!checkWasiClock(H))return 28;var L;if(H===0)L=_emscripten_date_now();else if(nowIsMonotonic)L=_emscripten_get_now();else return 52;var I=Math.round(L*1000*1000);return HEAP64[A>>3]=BigInt(I),0}GA(_clock_time_get,"_clock_time_get"),_clock_time_get.sig="iijp";var getHeapMax=GA(()=>2147483648,"getHeapMax"),growMemory=GA((H)=>{var $=wasmMemory.buffer,A=(H-$.byteLength+65535)/65536|0;try{return wasmMemory.grow(A),updateMemoryViews(),1}catch(L){}},"growMemory"),_emscripten_resize_heap=GA((H)=>{var $=HEAPU8.length;H>>>=0;var A=getHeapMax();if(H>A)return!1;for(var L=1;L<=4;L*=2){var I=$*(1+0.2/L);I=Math.min(I,H+100663296);var D=Math.min(A,alignMemory(Math.max(H,I),65536)),B=growMemory(D);if(B)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=GA((H)=>52,"_fd_close");_fd_close.sig="ii";function _fd_seek(H,$,A,L){return $=bigintToI53Checked($),70}GA(_fd_seek,"_fd_seek"),_fd_seek.sig="iijip";var printCharBuffers=[null,[],[]],printChar=GA((H,$)=>{var A=printCharBuffers[H];if($===0||$===10)(H===1?out:err)(UTF8ArrayToString(A)),A.length=0;else A.push($)},"printChar"),flush_NO_FILESYSTEM=GA(()=>{if(printCharBuffers[1].length)printChar(1,10);if(printCharBuffers[2].length)printChar(2,10)},"flush_NO_FILESYSTEM"),SYSCALLS={varargs:void 0,getStr(H){var $=UTF8ToString(H);return $}},_fd_write=GA((H,$,A,L)=>{var I=0;for(var D=0;D>2)*4),f=LE_HEAP_LOAD_U32(($+4>>2)*4);$+=8;for(var E=0;E>2)*4,I),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(H,$){if(Module.currentLogCallback){let A=UTF8ToString($);Module.currentLogCallback(A,H!==0)}}GA(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(H,$,A,L,I){let B=Module.currentParseCallback($,{row:A,column:L});if(typeof B==="string")setValue(I,B.length,"i32"),stringToUTF16(B,H,10240);else setValue(I,0,"i32")}GA(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(H,$){if(Module.currentProgressCallback)return Module.currentProgressCallback({currentOffset:H,hasError:$});return!1}GA(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");function _tree_sitter_query_progress_callback(H){if(Module.currentQueryProgressCallback)return Module.currentQueryProgressCallback({currentOffset:H});return!1}GA(_tree_sitter_query_progress_callback,"_tree_sitter_query_progress_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=GA(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=GA((H)=>{if(EXITSTATUS=H,!keepRuntimeAlive())Module.onExit?.(H),ABORT=!0;quit_(H,new ExitStatus(H))},"_proc_exit");_proc_exit.sig="vi";var exitJS=GA((H,$)=>{EXITSTATUS=H,_proc_exit(H)},"exitJS"),handleException=GA((H)=>{if(H instanceof ExitStatus||H=="unwind")return EXITSTATUS;quit_(1,H)},"handleException"),lengthBytesUTF8=GA((H)=>{var $=0;for(var A=0;A=55296&&L<=57343)$+=4,++A;else $+=3}return $},"lengthBytesUTF8"),stringToUTF8Array=GA((H,$,A,L)=>{if(!(L>0))return 0;var I=A,D=A+L-1;for(var B=0;B=55296&&f<=57343){var E=H.charCodeAt(++B);f=65536+((f&1023)<<10)|E&1023}if(f<=127){if(A>=D)break;$[A++]=f}else if(f<=2047){if(A+1>=D)break;$[A++]=192|f>>6,$[A++]=128|f&63}else if(f<=65535){if(A+2>=D)break;$[A++]=224|f>>12,$[A++]=128|f>>6&63,$[A++]=128|f&63}else{if(A+3>=D)break;$[A++]=240|f>>18,$[A++]=128|f>>12&63,$[A++]=128|f>>6&63,$[A++]=128|f&63}}return $[A]=0,A-I},"stringToUTF8Array"),stringToUTF8=GA((H,$,A)=>stringToUTF8Array(H,HEAPU8,$,A),"stringToUTF8"),stackAlloc=GA((H)=>__emscripten_stack_alloc(H),"stackAlloc"),stringToUTF8OnStack=GA((H)=>{var $=lengthBytesUTF8(H)+1,A=stackAlloc($);return stringToUTF8(H,A,$),A},"stringToUTF8OnStack"),AsciiToString=GA((H)=>{var $="";while(!0){var A=HEAPU8[H++];if(!A)return $;$+=String.fromCharCode(A)}},"AsciiToString"),stringToUTF16=GA((H,$,A)=>{if(A??=2147483647,A<2)return 0;A-=2;var L=$,I=A>1)*2,B),$+=2}return LE_HEAP_STORE_I16(($>>1)*2,0),$-L},"stringToUTF16"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,clock_time_get:_clock_time_get,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback,tree_sitter_query_progress_callback:_tree_sitter_query_progress_callback},wasmExports=await createWasm(),___wasm_call_ctors=wasmExports.__wasm_call_ctors,_malloc=Module._malloc=wasmExports.malloc,_calloc=Module._calloc=wasmExports.calloc,_realloc=Module._realloc=wasmExports.realloc,_free=Module._free=wasmExports.free,_memcmp=Module._memcmp=wasmExports.memcmp,_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count,_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count,_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version,_ts_language_abi_version=Module._ts_language_abi_version=wasmExports.ts_language_abi_version,_ts_language_metadata=Module._ts_language_metadata=wasmExports.ts_language_metadata,_ts_language_name=Module._ts_language_name=wasmExports.ts_language_name,_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count,_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state,_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name,_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name,_strncmp=Module._strncmp=wasmExports.strncmp,_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type,_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id,_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new,_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset,_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol,_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete,_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset,_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language,_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros,_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros,_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges,_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new,_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete,_iswspace=Module._iswspace=wasmExports.iswspace,_iswalnum=Module._iswalnum=wasmExports.iswalnum,_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count,_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count,_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count,_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id,_ts_query_capture_quantifier_for_id=Module._ts_query_capture_quantifier_for_id=wasmExports.ts_query_capture_quantifier_for_id,_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id,_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern,_ts_query_start_byte_for_pattern=Module._ts_query_start_byte_for_pattern=wasmExports.ts_query_start_byte_for_pattern,_ts_query_end_byte_for_pattern=Module._ts_query_end_byte_for_pattern=wasmExports.ts_query_end_byte_for_pattern,_ts_query_is_pattern_rooted=Module._ts_query_is_pattern_rooted=wasmExports.ts_query_is_pattern_rooted,_ts_query_is_pattern_non_local=Module._ts_query_is_pattern_non_local=wasmExports.ts_query_is_pattern_non_local,_ts_query_is_pattern_guaranteed_at_step=Module._ts_query_is_pattern_guaranteed_at_step=wasmExports.ts_query_is_pattern_guaranteed_at_step,_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture,_ts_query_disable_pattern=Module._ts_query_disable_pattern=wasmExports.ts_query_disable_pattern,_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy,_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete,_ts_init=Module._ts_init=wasmExports.ts_init,_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm,_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm,_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm,_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm,_ts_language_supertypes_wasm=Module._ts_language_supertypes_wasm=wasmExports.ts_language_supertypes_wasm,_ts_language_subtypes_wasm=Module._ts_language_subtypes_wasm=wasmExports.ts_language_subtypes_wasm,_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm,_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm=Module._ts_tree_cursor_copy_wasm=wasmExports.ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm,_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm,_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm,_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm,_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm,_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm,_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm=Module._ts_node_field_name_for_named_child_wasm=wasmExports.ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm,_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm,_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm,_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm,_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm,_ts_node_child_with_descendant_wasm=Module._ts_node_child_with_descendant_wasm=wasmExports.ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm,_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm,_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm,_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm,_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm,_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm,_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm,_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm,_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm,_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm,_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm,_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm,_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm,_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm,_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm,_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm,_memset=Module._memset=wasmExports.memset,_memcpy=Module._memcpy=wasmExports.memcpy,_memmove=Module._memmove=wasmExports.memmove,_iswalpha=Module._iswalpha=wasmExports.iswalpha,_iswblank=Module._iswblank=wasmExports.iswblank,_iswdigit=Module._iswdigit=wasmExports.iswdigit,_iswlower=Module._iswlower=wasmExports.iswlower,_iswupper=Module._iswupper=wasmExports.iswupper,_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit,_memchr=Module._memchr=wasmExports.memchr,_strlen=Module._strlen=wasmExports.strlen,_strcmp=Module._strcmp=wasmExports.strcmp,_strncat=Module._strncat=wasmExports.strncat,_strncpy=Module._strncpy=wasmExports.strncpy,_towlower=Module._towlower=wasmExports.towlower,_towupper=Module._towupper=wasmExports.towupper,_setThrew=wasmExports.setThrew,__emscripten_stack_restore=wasmExports._emscripten_stack_restore,__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc,_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current,___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs;Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,Module.loadWebAssemblyModule=loadWebAssemblyModule;function callMain(H=[]){var $=resolveGlobalSymbol("main").sym;if(!$)return;H.unshift(thisProgram);var A=H.length,L=stackAlloc((A+1)*4),I=L;H.forEach((B)=>{LE_HEAP_STORE_U32((I>>2)*4,stringToUTF8OnStack(B)),I+=4}),LE_HEAP_STORE_U32((I>>2)*4,0);try{var D=$(A,L);return exitJS(D,!0),D}catch(B){return handleException(B)}}GA(callMain,"callMain");function run(H=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function $(){if(Module.calledRun=!0,ABORT)return;initRuntime(),preMain(),readyPromiseResolve(Module),Module.onRuntimeInitialized?.();var A=Module.noInitialRun;if(!A)callMain(H);postRun()}if(GA($,"doRun"),Module.setStatus)Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),$()},1);else $()}if(GA(run,"run"),Module.preInit){if(typeof Module.preInit=="function")Module.preInit=[Module.preInit];while(Module.preInit.length>0)Module.preInit.pop()()}return run(),moduleRtn=readyPromise,moduleRtn}})(),gC1=uC1;GA(UaD,"initializeBinding");GA(XaD,"checkModule");WpH=class{static{GA(this,"Parser")}[0]=0;[1]=0;logCallback=null;language=null;static async init(H){$aD(await UaD(H)),kD=D$._ts_init(),HbA=D$.getValue(kD,"i32"),$bA=D$.getValue(kD+IB,"i32")}constructor(){this.initialize()}initialize(){if(!XaD())throw Error("cannot construct a Parser before calling `init()`");D$._ts_parser_new_wasm(),this[0]=D$.getValue(kD,"i32"),this[1]=D$.getValue(kD+IB,"i32")}delete(){D$._ts_parser_delete(this[0]),D$._free(this[1]),this[0]=0,this[1]=0}setLanguage(H){let $;if(!H)$=0,this.language=null;else if(H.constructor===qz$){$=H[0];let A=D$._ts_language_version($);if(A<$bA||HbAH.slice(f);else if(typeof H==="function")D$.currentParseCallback=H;else throw Error("Argument must be a string or a function");if(A?.progressCallback)D$.currentProgressCallback=A.progressCallback;else D$.currentProgressCallback=null;if(this.logCallback)D$.currentLogCallback=this.logCallback,D$._ts_parser_enable_logger_wasm(this[0],1);else D$.currentLogCallback=null,D$._ts_parser_enable_logger_wasm(this[0],0);let L=0,I=0;if(A?.includedRanges){L=A.includedRanges.length,I=D$._calloc(L,QpH);let f=I;for(let E=0;E0){let L=$;for(let I=0;IrC1,extractCommandArguments:()=>oC1,ensureInitialized:()=>QaD});function lC1(){let H=$e.dirname(KaD.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/bash/parser.ts"));return $e.dirname(hgH())}function iC1(H){if(!U8()||typeof Bun>"u"||!Bun.embeddedFiles)return null;for(let $ of Bun.embeddedFiles){let A=$.name;if(A&&A.endsWith(H))return $}return null}async function FaD(H){let $=iC1(H);if(!$)return null;let A=await $.arrayBuffer();return new Uint8Array(A)}async function nC1(){let H=zH();if(U8()){let B=await FaD("tree-sitter.wasm"),f=await FaD("tree-sitter-bash.wasm");if(B&&f){await WpH.init({wasmBinary:B}),PPH=new WpH,VpH=await qz$.load(f),PPH.setLanguage(VpH),N("tree-sitter: loaded from embedded"),c("tengu_tree_sitter_load",{success:!0,from_embedded:!0});return}}let A=lC1(),L=!1,I=L?$e.join(A,"web-tree-sitter","tree-sitter.wasm"):$e.join(A,"tree-sitter.wasm"),D=L?$e.join(A,"tree-sitter-bash","tree-sitter-bash.wasm"):$e.join(A,"tree-sitter-bash.wasm");if(!H.existsSync(I)||!H.existsSync(D)){N("tree-sitter: WASM files not found"),c("tengu_tree_sitter_load",{success:!1});return}await WpH.init({locateFile:(B)=>B.endsWith("tree-sitter.wasm")?I:B}),PPH=new WpH,VpH=await qz$.load(H.readFileBytesSync(D)),PPH.setLanguage(VpH),N("tree-sitter: loaded from disk"),c("tengu_tree_sitter_load",{success:!0,from_embedded:!1})}async function QaD(){if(!BbA)BbA=nC1();await BbA}async function rC1(H){if(await QaD(),!H||H.length>mC1||!PPH||!VpH)return null;try{let $=PPH.parse(H),A=$?.rootNode;if(!A)return null;let L=WaD(A),I=aC1(L);return{tree:$,rootNode:A,envVars:I,commandNode:L,originalCommand:H}}catch{return null}}function WaD(H){let{type:$,children:A,parent:L}=H;if(DbA.has($))return H;if($==="variable_assignment"&&L)return L.children.find((I)=>I&&DbA.has(I.type)&&I.startIndex>H.startIndex)??null;if($==="pipeline"||$==="redirected_statement")return A.find((I)=>I&&DbA.has(I.type))??null;for(let I of A){let D=I&&WaD(I);if(D)return D}return null}function aC1(H){if(!H||H.type!=="command")return[];let $=[];for(let A of H.children){if(!A)continue;if(A.type==="variable_assignment")$.push(A.text);else if(A.type==="command_name"||A.type==="word")break}return $}function oC1(H){if(H.type==="declaration_command"){let L=H.children[0];return L&&pC1.has(L.text)?[L.text]:[]}let $=[],A=!1;for(let L of H.children){if(!L||L.type==="variable_assignment")continue;if(L.type==="command_name"||!A&&L.type==="word"){A=!0,$.push(L.text);continue}if(dC1.has(L.type))$.push(tC1(L.text));else if(cC1.has(L.type))break}return $}function tC1(H){return H.length>=2&&(H[0]==='"'&&H.at(-1)==='"'||H[0]==="'"&&H.at(-1)==="'")?H.slice(1,-1):H}var KaD,$e,mC1=1e4,pC1,dC1,cC1,DbA,PPH=null,VpH=null,BbA=null;var EbA=K(()=>{JaD();DL();Ib();z$();E$();KaD=require("url"),$e=require("path"),pC1=new Set(["export","declare","typeset","readonly","local","unset","unsetenv"]),dC1=new Set(["word","string","raw_string","number"]),cC1=new Set(["command_substitution","process_substitution"]),DbA=new Set(["command","declaration_command"])});class VaD{originalCommand;constructor(H){this.originalCommand=H}toString(){return this.originalCommand}getPipeSegments(){try{let H=UpH(this.originalCommand),$=[],A=[];for(let L of H)if(L==="|"){if(A.length>0)$.push(A.join(" ")),A=[]}else A.push(L);if(A.length>0)$.push(A.join(" "));return $.length>0?$:[this.originalCommand]}catch{return[this.originalCommand]}}withoutOutputRedirections(){if(!this.originalCommand.includes(">"))return this.originalCommand;let{commandWithoutRedirections:H,redirections:$}=Wj(this.originalCommand);return $.length>0?H:this.originalCommand}getOutputRedirections(){let{redirections:H}=Wj(this.originalCommand);return H}}function MbA(H,$){let A=H;$(A);for(let L of A.children)if(L)MbA(L,$)}function sC1(H){let $=[];return MbA(H,(A)=>{if(A.type==="pipeline"){for(let L of A.children)if(L&&L.type==="|")$.push(L.startIndex)}}),$}function eC1(H){let $=[];return MbA(H,(A)=>{if(A.type==="file_redirect"){let L=A.children,I=L.find((B)=>B&&(B.type===">"||B.type===">>")),D=L.find((B)=>B&&B.type==="word");if(I&&D)$.push({startIndex:A.startIndex,endIndex:A.endIndex,target:D.text,operator:I.type})}}),$}class PaD{originalCommand;pipePositions;redirectionNodes;constructor(H,$,A){this.originalCommand=H,this.pipePositions=$,this.redirectionNodes=A}toString(){return this.originalCommand}getPipeSegments(){if(this.pipePositions.length===0)return[this.originalCommand];let H=[],$=0;for(let L of this.pipePositions){let I=this.originalCommand.slice($,L).trim();if(I)H.push(I);$=L+1}let A=this.originalCommand.slice($).trim();if(A)H.push(A);return H}withoutOutputRedirections(){if(this.redirectionNodes.length===0)return this.originalCommand;let H=[...this.redirectionNodes].sort((A,L)=>L.startIndex-A.startIndex),$=this.originalCommand;for(let A of H)$=$.slice(0,A.startIndex)+$.slice(A.endIndex);return $.trim().replace(/\s+/g," ")}getOutputRedirections(){return this.redirectionNodes.map(({target:H,operator:$})=>({target:H,operator:$}))}}var H21,Tz$;var _aD=K(()=>{tD();g3();H21=o$(async()=>{try{let{parseCommand:H}=await Promise.resolve().then(() => (EbA(),fbA)),$=await H("echo test");if(!$)return!1;return $.tree.delete(),!0}catch{return!1}}),Tz$={async parse(H){if(!H)return null;if(await H21())try{let{parseCommand:A}=await Promise.resolve().then(() => (EbA(),fbA)),L=await A(H);if(L){let I=sC1(L.rootNode),D=eC1(L.rootNode);return L.tree.delete(),new PaD(H,I,D)}}catch{}return new VaD(H)}}});async function $21(H,$,A){if($.filter((M)=>{let G=M.trim();return GpH.test(G)}).length>1){let M={type:"other",reason:"Multiple directory changes in one command require approval for clarity"};return{behavior:"ask",decisionReason:M,message:gX(aD.name,M)}}let I=new Map;for(let M of $){let G=M.trim();if(!G)continue;let U=await A({...H,command:G});I.set(G,U)}let D=Array.from(I.entries()).find(([,M])=>M.behavior==="deny");if(D){let[M,G]=D;return{behavior:"deny",message:G.behavior==="deny"?G.message:`Permission denied for: ${M}`,decisionReason:{type:"subcommandResults",reasons:I}}}if(Array.from(I.values()).every((M)=>M.behavior==="allow"))return{behavior:"allow",updatedInput:H,decisionReason:{type:"subcommandResults",reasons:I}};let f=[];for(let[,M]of I)if(M.behavior!=="allow"&&"suggestions"in M&&M.suggestions)f.push(...M.suggestions);let E={type:"subcommandResults",reasons:I};return{behavior:"ask",message:gX(aD.name,E),decisionReason:E,suggestions:f.length>0?f:void 0}}async function A21(H){if(!H.includes(">"))return H;return(await Tz$.parse(H))?.withoutOutputRedirections()??H}async function YaD(H,$){if(lrD(H.command)){let D=Hb(H.command),B={type:"other",reason:D.behavior==="ask"&&D.message?D.message:"This command uses shell operators that require approval for safety"};return{behavior:"ask",message:gX(aD.name,B),decisionReason:B}}let A=await Tz$.parse(H.command);if(!A)return{behavior:"passthrough",message:"Failed to parse command"};let L=A.getPipeSegments();if(L.length<=1)return{behavior:"passthrough",message:"No pipes found in command"};let I=await Promise.all(L.map((D)=>A21(D)));return $21(H,I,$)}var CaD=K(()=>{zQ();g3();XJ();fZ$();_aD()});function qaD(H){let $=H.length;if($<=GbA)return H.map((L)=>`'${L}'`).join(", ");return`${H.slice(0,GbA).map((L)=>`'${L}'`).join(", ")}, and ${$-GbA} more`}function L21(H){let $=H.match(ZaD);if(!$||$.index===void 0)return H;let A=H.substring(0,$.index),L=A.lastIndexOf("/");if(L===-1)return".";return A.substring(0,L)||"/"}function UbA(H,$,A){let L=A==="read"?"read":"edit",I=$W(H,$,L,"deny");if(I!==null)return{allowed:!1,decisionReason:{type:"rule",rule:I}};if(A!=="read"){let B=FbA(H);if(!B.safe)return{allowed:!1,decisionReason:{type:"other",reason:B.message}}}if(iS(H,$)){if(A==="read"||$.mode==="acceptEdits")return{allowed:!0}}if(A==="read"){let B=QbA(H,{});if(B.behavior==="allow")return{allowed:!0,decisionReason:B.decisionReason}}if(A!=="read"){let B=KbA(H,{});if(B.behavior==="allow")return{allowed:!0,decisionReason:B.decisionReason}}let D=$W(H,$,L,"allow");if(D!==null)return{allowed:!0,decisionReason:{type:"rule",rule:D}};return{allowed:!1}}function I21(H,$,A,L){if(nMH(H)){let E=yz.isAbsolute(H)?H:yz.resolve($,H),{resolvedPath:M}=OU(zH(),E),G=UbA(M,A,L);return{allowed:G.allowed,resolvedPath:M,decisionReason:G.decisionReason}}let I=L21(H),D=yz.isAbsolute(I)?I:yz.resolve($,I),{resolvedPath:B}=OU(zH(),D),f=UbA(B,A,L);return{allowed:f.allowed,resolvedPath:B,decisionReason:f.decisionReason}}function TaD(H){if(H==="~"||H.startsWith("~/"))return zz$.homedir()+H.slice(1);return H}function D21(H){if(H==="*"||H.endsWith("/*"))return!0;let $=H==="/"?H:H.replace(/\/$/,"");if($==="/")return!0;let A=zz$.homedir();if($===A)return!0;if(yz.dirname($)==="/")return!0;return!1}function zaD(H,$,A,L){let I=TaD(H.replace(/^['"]|['"]$/g,""));if(I.includes("$")||I.includes("%"))return{allowed:!1,resolvedPath:I,decisionReason:{type:"other",reason:"Shell expansion syntax in paths requires manual approval"}};if(ZaD.test(I)){if(L==="write"||L==="create")return{allowed:!1,resolvedPath:I,decisionReason:{type:"other",reason:"Glob patterns are not allowed in write operations. Please specify an exact file path."}};return I21(I,$,A,L)}let D=yz.isAbsolute(I)?I:yz.resolve($,I),{resolvedPath:B}=OU(zH(),D),f=UbA(B,A,L);return{allowed:f.allowed,resolvedPath:B,decisionReason:f.decisionReason}}function B21(H,$,A){let L=XbA[H],I=L($);for(let D of I){let B=TaD(D.replace(/^['"]|['"]$/g,"")),f=yz.isAbsolute(B)?B:yz.resolve(A,B);if(D21(f))return{behavior:"ask",message:`Dangerous ${H} operation detected: '${f}' `);for(let L of A){let I=L.trim();if(I){let B=I.match(/^#+\s+(.+)$/)?.[1]??I;return B.length>100?B.substring(0,97)+"...":B}}return $}function $oD(H){if(H===void 0||H===null)return null;if(!H)return[];let $=[];if(typeof H==="string")$=[H];else if(Array.isArray(H))$=H.filter((L)=>typeof L==="string");if($.length===0)return[];let A=xp($);if(A.includes("*"))return["*"];return A}function LBH(H){let $=$oD(H);if($===null)return H===void 0?void 0:[];if($.includes("*"))return;return $}function xx(H){let $=$oD(H);if($===null)return[];return $}async function N21(H){try{let $=await Pj.lstat(H,{bigint:!0});return`${$.dev}:${$.ino}`}catch{return null}}function LTA(H,$){let A=Tb.resolve(HoD.homedir()),L=XQ($),I=Tb.resolve($),D=[];if(!jz$.existsSync(I))return D;while(!0){if(I===A)break;let B=Tb.join(I,".claude",H);if(jz$.existsSync(B))D.push(B);if(L&&I===L)break;let f=Tb.dirname(I);if(f===I)break;I=f}return D}async function O21(H,$){let A=[],L=new Set;async function I(D){if($.aborted)return;try{let B=await Pj.stat(D,{bigint:!0});if(B.isDirectory()){let f=B.dev!==void 0&&B.ino!==void 0?`${B.dev}:${B.ino}`:await Pj.realpath(D);if(L.has(f)){N(`Skipping already visited directory (circular symlink): ${D}`);return}L.add(f)}}catch(B){let f=B instanceof Error?B.message:String(B);N(`Failed to stat directory ${D}: ${f}`);return}try{let B=await Pj.readdir(D,{withFileTypes:!0});for(let f of B){if($.aborted)break;let E=Tb.join(D,f.name);try{if(f.isSymbolicLink())try{let M=await Pj.stat(E);if(M.isDirectory())await I(E);else if(M.isFile()&&f.name.endsWith(".md"))A.push(E)}catch(M){let G=M instanceof Error?M.message:String(M);N(`Failed to follow symlink ${E}: ${G}`)}else if(f.isDirectory())await I(E);else if(f.isFile()&&f.name.endsWith(".md"))A.push(E)}catch(M){let G=M instanceof Error?M.message:String(M);N(`Failed to access ${E}: ${G}`)}}}catch(B){let f=B instanceof Error?B.message:String(B);N(`Failed to read directory ${D}: ${f}`)}}return await I(H),A}async function SbA(H){let $=nD(),A=setTimeout(()=>$.abort(),3000);try{if(!jz$.existsSync(H))return[];let I=A$("true")?await O21(H,$.signal):await YR(["--files","--hidden","--follow","--no-ignore","--glob","*.md"],H,$.signal);return(await Promise.all(I.map(async(B)=>{try{let f=await Pj.readFile(B,{encoding:"utf-8"}),{frontmatter:E,content:M}=MK(f,B);return{filePath:B,frontmatter:E,content:M}}catch(f){let E=f instanceof Error?f.message:String(f);return N(`Failed to read/parse markdown file: ${B}: ${E}`),null}}))).filter((B)=>B!==null)}finally{clearTimeout(A)}}var Tb,Pj,jz$,HoD,djD,Rm;var Vm=K(()=>{CR();Vu();cg();E$();eE();NA();y$H();z$();W4();tD();t8();Tb=require("path"),Pj=require("fs/promises"),jz$=require("fs"),HoD=require("os"),djD=["commands","agents","output-styles","skills"];Rm=o$(async function(H,$){let A=Date.now(),L=Tb.join(UL(),H),I=Tb.join(v_(),".claude",H),D=LTA(H,$),[B,f,E]=await Promise.all([SbA(I).then((Q)=>Q.map((W)=>({...W,baseDir:I,source:"policySettings"}))),HF("userSettings")?SbA(L).then((Q)=>Q.map((W)=>({...W,baseDir:L,source:"userSettings"}))):Promise.resolve([]),HF("projectSettings")?Promise.all(D.map((Q)=>SbA(Q).then((W)=>W.map((P)=>({...P,baseDir:Q,source:"projectSettings"}))))):Promise.resolve([])]),M=E.flat(),G=[...B,...f,...M],U=await Promise.all(G.map((Q)=>N21(Q.filePath))),X=new Map,J=[];for(let[Q,W]of G.entries()){let P=U[Q]??null;if(P===null){J.push(W);continue}let C=X.get(P);if(C!==void 0){N(`Skipping duplicate file '${W.filePath}' from ${W.source} (same inode already loaded from ${C})`);continue}X.set(P,W.source),J.push(W)}let F=G.length-J.length;if(F>0)N(`Deduplicated ${F} files in ${H} (same inode via symlinks or hard links)`);return c("tengu_dir_search",{durationMs:Date.now()-A,managedFilesFound:B.length,userFilesFound:f.length,projectFilesFound:M.length,projectDirsSearched:D.length,subdir:H}),J},(H,$)=>`${H}:${$}`)});var AoD,LoD;var IoD=K(()=>{tD();_$();Vm();IF$();E$();AoD=require("path"),LoD=o$(async(H)=>{try{return(await Rm("output-styles",H)).map(({filePath:L,frontmatter:I,content:D,source:B})=>{try{let E=AoD.basename(L).replace(/\.md$/,""),M=I.name||E,G=I.description||Wm(D,`Custom ${E} output style`),U=I["keep-coding-instructions"],X=U===!0||U==="true"?!0:U===!1||U==="false"?!1:void 0;if(I["force-for-plugin"]!==void 0)N(`Output style "${M}" has force-for-plugin set, but this option only applies to plugin output styles. Ignoring.`,{level:"warn"});return{name:M,description:G,prompt:D.trim(),source:B,keepCodingInstructions:X}}catch(f){return r(f instanceof Error?f:Error(String(f))),null}}).filter((L)=>L!==null)}catch($){return r($ instanceof Error?$:Error(String($))),[]}})});async function Y1H(H){let $=await LoD(H),A=await E7A(),L={...V9H},I=$.filter((E)=>E.source==="policySettings"),D=$.filter((E)=>E.source==="userSettings"),B=$.filter((E)=>E.source==="projectSettings"),f=[A,D,B,I];for(let E of f)for(let M of E)L[M.name]={name:M.name,description:M.description,prompt:M.prompt,source:M.source,keepCodingInstructions:M.keepCodingInstructions,forceForPlugin:M.forceForPlugin};return L}async function lhA(){let H=await Y1H(C$()),$=Object.values(H).filter((D)=>D!==null&&D.source==="plugin"&&D.forceForPlugin===!0),A=$[0];if(A){if($.length>1)N(`Multiple plugins have forced output styles: ${$.map((D)=>D.name).join(", ")}. Using: ${A.name}`,{level:"warn"});return N(`Using forced plugin output style: ${A.name}`),A}let I=VL()?.outputStyle||HW;return H[I]??null}var DoD,HW="default",V9H;var jh=K(()=>{jI();mL();IoD();IF$();PI();E$();DoD=` `,$),D=I>=0?H.slice($,I):H.slice($);if($=I>=0?I+1:H.length,!D.includes('"type":"user"')&&!D.includes('"type": "user"'))continue;if(D.includes('"tool_result"'))continue;if(D.includes('"isMeta":true')||D.includes('"isMeta": true'))continue;try{let B=DA(D);if(B.type!=="user")continue;let f=B.message;if(!f)continue;let E=f.content,M="";if(typeof E==="string")M=E;else if(Array.isArray(E)){let X=E.find((J)=>J.type==="text");if(X?.text&&typeof X.text==="string")M=X.text}if(!M)continue;let G=M.replace(/\n/g," ").trim(),U=VD(G,WV);if(U){let X=U.replace(/^\//,""),J=VD(G,"command-args")?.trim()||"";if(Np().has(X)||!J){if(!L)L=U;continue}return J?`${U} ${J}`:U}if(JoD.test(G))continue;if(G.length>200)G=G.slice(0,200).trim()+"\u2026";return G}catch{continue}}if(L)return L;return""}function yz$(H,$){let A=[`"${$}":"`,`"${$}": "`];for(let L of A){let I=H.indexOf(L);if(I<0)continue;let D=I+L.length,B=D;while(Bf[1].mtime-B[1].mtime);if($&&I.length>$)I=I.slice(0,$);let D=[];for(let[B,f]of I)D.push({date:new Date(f.mtime).toISOString(),messages:[],isLite:!0,fullPath:f.path,value:0,created:new Date(f.ctime),modified:new Date(f.mtime),firstPrompt:"",messageCount:0,fileSize:f.size,isSidechain:!1,sessionId:B,projectPath:A});return f$H(D).map((B,f)=>({...B,value:f}))}async function Kw1(H,$){if(!H.isLite||!H.fullPath)return H;let A=await Jw1(H.fullPath,H.fileSize??0,$),L={...H,isLite:!1,firstPrompt:A.firstPrompt,gitBranch:A.gitBranch,isSidechain:A.isSidechain,teamName:A.teamName,customTitle:A.customTitle,tag:A.tag,agentSetting:A.agentSetting,prNumber:A.prNumber,prUrl:A.prUrl,prRepository:A.prRepository,projectPath:A.projectPath??H.projectPath};if(!L.firstPrompt&&!L.customTitle)return null;if(L.isSidechain||L.teamName)return null;return L}async function E8H(H,$,A){let L=[],I=Buffer.alloc(vz$),D=$;while(D{_L();nM();g$();NA();PI();ZM();Z$();DL();mL();tD();t8();qmH();eC$();E$();_$();dx();h4();EE();z$();ZE();Z6();Z$();UU();a3=require("path"),vz=require("fs/promises"),t21={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,CPH=C$(),JoD=new RegExp(`^(?:||<${jN}>|\\s*[\\s\\S]*\\s*$|\\s*[\\s\\S]*\\s*$)`);cbA=o$(async(H)=>{let{messages:$}=await dbA(H);return new Set($.keys())},(H)=>H)});function Td(){return process.env.USE_MCP_CLI_DIR||nbA.join(_oD.tmpdir(),"claude-code-mcp-cli")}function wPH(){if(eU()){let H=process.env.CLAUDE_CODE_SESSION_ID;if(H)return H}return j$()}function YoD(){if(!eU())return;PB(async()=>{try{let H=uz$();await qd.rm(H,{force:!0});let $=Td();if((await qd.readdir($)).length===0)await qd.rm($,{recursive:!0,force:!0})}catch{}})}function uz$(){let H=wPH();return nbA.join(Td(),`${H}.json`)}function Qw1(H){let $={name:H.name,type:H.type};if(H.type==="connected")return{...$,capabilities:H.capabilities};return $}async function Ww1(H){let $="";try{$=await H.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:"default",additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]})}catch{}return{name:H.name,description:$,inputJSONSchema:H.inputJSONSchema,isMcp:H.isMcp,originalToolName:H.originalMcpToolName}}async function CoD(H,$,A){if(!eU())return;try{await qd.mkdir(Td(),{recursive:!0});let L=await Promise.all($.filter((E)=>E.isMcp).map(Ww1)),I={},D={};for(let E of H){I[E.name]=E.config;let M=E1(E.name);if(D[M]&&D[M]!==E.name)console.warn(`Warning: MCP server name collision detected. Both "${D[M]}" and "${E.name}" normalize to "${M}". Only "${E.name}" will be accessible via normalized lookup.`);D[M]=E.name}let B={clients:H.map(Qw1),configs:I,tools:L,resources:A,normalizedNames:D},f=uz$();await qd.writeFile(f,yH(B,null,2))}catch{}}var nbA,_oD,qd;var ZPH=K(()=>{g$();ZE();BW();Z$();nbA=require("path"),_oD=require("os"),qd=require("fs/promises")});function qC(H){return H.toLowerCase()}function ZoD(H,$){if(oA()==="windows"){let A=PR(H),L=PR($);return E9.posix.relative(A,L)}return E9.posix.relative(H,$)}function vB$(H){if(oA()==="windows")return PR(H);return H}function _w1(){return j_.map((H)=>aM(H)).filter((H)=>H!==void 0)}function pqA(H){let $=xD(H),A=qC($);if(A.endsWith(`${E9.sep}.claude${E9.sep}settings.json`)||A.endsWith(`${E9.sep}.claude${E9.sep}settings.local.json`))return!0;return _w1().some((L)=>qC(L)===A)}function Yw1(H){if(pqA(H))return!0;let $=E9.join(zL(),".claude","commands"),A=E9.join(zL(),".claude","agents"),L=E9.join(zL(),".claude","skills");return wm(H,$)||wm(H,A)||wm(H,L)}function Cw1(H){if(!Td())return!1;let $=xD(H);return wm($,Td())}function qoD(H){let $=E9.join(_7(),sRH()),A=E9.normalize(H);return A.startsWith($)&&A.endsWith(".md")}function mz$(){return E9.join(rU(C$()),j$(),"session-memory")+E9.sep}function T3H(){return E9.join(mz$(),"summary.md")}function ww1(H){return E9.normalize(H).startsWith(mz$())}function Zw1(H){let $=rU(C$()),A=E9.normalize(H);return A===$||A.startsWith($+E9.sep)}function FPH(){return cf("tengu_scratch")}function xOA(){if(oA()==="windows")return"claude";return`claude-${process.getuid?.()??0}`}function _zH(){let H=process.env.CLAUDE_CODE_TMPDIR||(oA()==="windows"?gz$.tmpdir():"/tmp"),$=zH(),A=H;try{A=$.realpathSync(H)}catch{}return E9.join(A,xOA())+E9.sep}function VF$(){return E9.join(_zH(),f2H(zL()))+E9.sep}function Pz$(){return E9.join(VF$(),j$(),"scratchpad")}function ToD(){if(!FPH())throw Error("Scratchpad directory feature is not enabled");let H=zH(),$=Pz$();return H.mkdirSync($,{mode:448}),$}function zoD(H){if(!FPH())return!1;let $=Pz$(),A=E9.normalize(H);return A===$||A.startsWith($+E9.sep)}function qw1(H){let A=xD(H).split(E9.sep),L=A[A.length-1];if(H.startsWith("\\\\")||H.startsWith("//"))return!0;for(let I=0;IqC(D)===I))return!0}return!1}function NoD(H){if(H.indexOf(":",2)!==-1)return!0;if(/~\d/.test(H))return!0;if(H.startsWith("\\\\?\\")||H.startsWith("\\\\.\\")||H.startsWith("//?/")||H.startsWith("//./"))return!0;if(/[.\s]+$/.test(H))return!0;if(/\.(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(H))return!0;if(/(^|\/|\\)\.{3,}(\/|\\|$)/.test(H))return!0;if(JZ$(H))return!0;return!1}function FbA(H){let $=zHH(H);for(let A of $)if(NoD(A))return{safe:!1,message:`Claude requested permissions to write to ${H}, which contains a suspicious Windows path pattern that requires manual approval.`};for(let A of $)if(Yw1(A))return{safe:!1,message:`Claude requested permissions to write to ${H}, but you haven't granted it yet.`};for(let A of $)if(Cw1(A));for(let A of $)if(qw1(A))return{safe:!1,message:`Claude requested permissions to edit ${H} which is a sensitive file.`};return{safe:!0}}function LVH(H){return new Set([zL(),...H.additionalWorkingDirectories.keys()])}function iS(H,$){return zHH(H).every((L)=>Array.from(LVH($)).some((I)=>wm(L,I)))}function wm(H,$){let A=xD(H),L=xD($),I=A.replace(/^\/private\/var\//,"/var/").replace(/^\/private\/tmp(\/|$)/,"/tmp$1"),D=L.replace(/^\/private\/var\//,"/var/").replace(/^\/private\/tmp(\/|$)/,"/tmp$1"),B=qC(I),f=qC(D),E=ZoD(f,B);if(E==="")return!0;if(nMH(E))return!1;return!E9.posix.isAbsolute(E)}function Tw1(H){switch(H){case"cliArg":case"command":case"session":return xD(zL());case"userSettings":case"policySettings":case"projectSettings":case"localSettings":case"flagSettings":return D4H(H)}}function rbA(H){return E9.posix.join(sP,H)}function zw1({patternRoot:H,pattern:$,rootPath:A}){let L=E9.posix.join(H,$);if(H===A)return rbA($);else if(L.startsWith(`${A}${sP}`)){let I=L.slice(A.length);return rbA(I)}else{let I=E9.posix.relative(A,H);if(!I||I.startsWith(`..${sP}`)||I==="..")return null;else{let D=E9.posix.join(I,$);return rbA(D)}}}function SFH(H,$){let A=new Set(H.get(null)??[]);for(let[L,I]of H.entries()){if(L===null)continue;for(let D of I){let B=zw1({patternRoot:L,pattern:D,rootPath:$});if(B)A.add(B)}}return Array.from(A)}function jFH(H){let $=OoD(H,"read","deny"),A=new Map;for(let[L,I]of $.entries())A.set(L,Array.from(I.keys()));return A}function Nw1(H,$){if(H.startsWith(`${sP}${sP}`)){let L=H.slice(1);if(oA()==="windows"&&L.match(/^\/[a-z]\//i)){let I=L[1]?.toUpperCase()??"C",D=L.slice(2),B=`${I}:\\`;return{relativePattern:D.startsWith("/")?D.slice(1):D,root:B}}return{relativePattern:L,root:sP}}else if(H.startsWith(`~${sP}`))return{relativePattern:H.slice(1),root:gz$.homedir()};else if(H.startsWith(sP))return{relativePattern:H,root:Tw1($)};let A=H;if(H.startsWith(`.${sP}`))A=H.slice(2);return{relativePattern:A,root:null}}function OoD(H,$,A){let L=(()=>{switch($){case"edit":return TB;case"read":return $B}})(),I=ObA(H,L,A),D=new Map;for(let[B,f]of I.entries()){let{relativePattern:E,root:M}=Nw1(B,f.source),G=D.get(M);if(G===void 0)G=new Map,D.set(M,G);G.set(E,f)}return D}function $W(H,$,A,L){let I=xD(H);if(oA()==="windows"&&I.includes("\\"))I=PR(I);let D=OoD($,A,L);for(let[B,f]of D.entries()){let E=Array.from(f.keys()).map((X)=>{let J=X;if(B===sP&&X.startsWith(sP))J=X.slice(1);if(J.endsWith("/**"))J=J.slice(0,-3);return J}),M=woD.default().add(E),G=ZoD(B??C$(),I??C$());if(G.startsWith(`..${sP}`))continue;if(!G)continue;let U=M.test(G);if(U.ignored&&U.rule){let X=U.rule.pattern,J=X+"/**";if(f.has(J))return f.get(J)??null;if(B===sP&&!X.startsWith(sP)){X=sP+X;let F=X+"/**";if(f.has(F))return f.get(F)??null}return f.get(X)??null}}return null}function nr(H,$,A){if(typeof H.getPath!=="function")return{behavior:"ask",message:`Claude requested permissions to use ${H.name}, but you haven't granted it yet.`};let L=H.getPath($),I=zHH(L);for(let G of I)if(G.startsWith("\\\\")||G.startsWith("//"))return{behavior:"ask",message:`Claude requested permissions to read from ${L}, which appears to be a UNC path that could access network resources.`,decisionReason:{type:"other",reason:"UNC path detected (defense-in-depth check)"}};for(let G of I)if(NoD(G))return{behavior:"ask",message:`Claude requested permissions to read from ${L}, which contains a suspicious Windows path pattern that requires manual approval.`,decisionReason:{type:"other",reason:"Path contains suspicious Windows-specific patterns (alternate data streams, short names, long path prefixes, or three or more consecutive dots) that require manual verification"}};for(let G of I){let U=$W(G,A,"read","deny");if(U)return{behavior:"deny",message:`Permission to read ${L} has been denied.`,decisionReason:{type:"rule",rule:U}}}for(let G of I){let U=$W(G,A,"read","ask");if(U)return{behavior:"ask",message:`Claude requested permissions to read from ${L}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:U}}}let D=z9H(H,$,A);if(D.behavior==="allow")return D;if(iS(L,A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"mode",mode:"default"}};let f=xD(L),E=QbA(f,$);if(E.behavior!=="passthrough")return E;let M=$W(L,A,"read","allow");if(M)return{behavior:"allow",updatedInput:$,decisionReason:{type:"rule",rule:M}};return{behavior:"ask",message:`Claude requested permissions to read from ${L}, but you haven't granted it yet.`,suggestions:pz$(L,"read",A),decisionReason:{type:"workingDir",reason:"Path is outside allowed working directories"}}}function z9H(H,$,A){if(typeof H.getPath!=="function")return{behavior:"ask",message:`Claude requested permissions to use ${H.name}, but you haven't granted it yet.`};let L=H.getPath($),I=zHH(L);for(let U of I){let X=$W(U,A,"edit","deny");if(X)return{behavior:"deny",message:`Permission to edit ${L} has been denied.`,decisionReason:{type:"rule",rule:X}}}let D=xD(L),B=KbA(D,$);if(B.behavior!=="passthrough")return B;let f=$W(L,A,"edit","allow");if(f&&f.source==="session"){let U=f.ruleValue.ruleContent;if(U===M9$||U===G9$)return{behavior:"allow",updatedInput:$,decisionReason:{type:"rule",rule:f}}}let E=FbA(L);if(!E.safe)return{behavior:"ask",message:E.message,decisionReason:{type:"other",reason:E.message}};for(let U of I){let X=$W(U,A,"edit","ask");if(X)return{behavior:"ask",message:`Claude requested permissions to write to ${L}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:X}}}let M=iS(L,A);if(A.mode==="acceptEdits"&&M)return{behavior:"allow",updatedInput:$,decisionReason:{type:"mode",mode:A.mode}};let G=$W(L,A,"edit","allow");if(G)return{behavior:"allow",updatedInput:$,decisionReason:{type:"rule",rule:G}};return{behavior:"ask",message:`Claude requested permissions to write to ${L}, but you haven't granted it yet.`,suggestions:pz$(L,"write",A),decisionReason:!M?{type:"workingDir",reason:"Path is outside allowed working directories"}:void 0}}function pz$(H,$,A){let L=!iS(H,A);if($==="read"&&L){let I=qk(H);return zHH(I).map((f)=>yB$(f,"session")).filter((f)=>f!==void 0)}if($==="write"||$==="create"){let I=[{type:"setMode",mode:"acceptEdits",destination:"session"}];if(L){let D=qk(H),B=zHH(D);I.push({type:"addDirectories",directories:B,destination:"session"})}return I}return[{type:"setMode",mode:"acceptEdits",destination:"session"}]}function KbA(H,$){let A=E9.normalize(H);if(qoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Plan files for current session are allowed for writing"}};if(zoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Scratchpad files for current session are allowed for writing"}};if(nRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Agent memory files are allowed for writing"}};if(lRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:`${Pm()} files are allowed for writing`}};let L=E9.join(UL(),"teams")+E9.sep;if(A===L.slice(0,-1)||A.startsWith(L))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Team files are allowed for writing"}};let I=E9.join(UL(),"tasks")+E9.sep;if(A===I.slice(0,-1)||A.startsWith(I))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Task files are allowed for writing"}};return{behavior:"passthrough",message:""}}function QbA(H,$){let A=E9.normalize(H);if(ww1(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Session memory files are allowed for reading"}};if(Zw1(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Project directory files are allowed for reading"}};if(qoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Plan files for current session are allowed for reading"}};let L=_KH(),I=L.endsWith(E9.sep)?L:L+E9.sep;if(A===L||A.startsWith(I))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Tool result files are allowed for reading"}};if(zoD(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Scratchpad files for current session are allowed for reading"}};let D=VF$();if(A.startsWith(D))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Project temp directory files are allowed for reading"}};if(nRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Agent memory files are allowed for reading"}};if(lRH(A))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:`${Pm()} files are allowed for reading`}};let B=E9.join(UL(),"tasks")+E9.sep;if(A===B.slice(0,-1)||A.startsWith(B))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Task files are allowed for reading"}};let f=E9.join(UL(),"teams")+E9.sep;if(A===f.slice(0,-1)||A.startsWith(f))return{behavior:"allow",updatedInput:$,decisionReason:{type:"other",reason:"Team files are allowed for reading"}};return{behavior:"passthrough",message:""}}var E9,woD,gz$,Vw1,Pw1,sP;var BM=K(()=>{g$();SD();PI();ZM();iMH();rB();Z9();ZM();C5();XJ();tG();mL();W4();DL();ZPH();KZ$();gQ();Bm();$BH();G3();NA();E9=require("path"),woD=b(fRH(),1),gz$=require("os"),Vw1=[".gitconfig",".gitmodules",".bashrc",".bash_profile",".zshrc",".zprofile",".profile",".ripgreprc",".mcp.json",".claude.json"],Pw1=[".git",".vscode",".idea",".claude"];sP=E9.posix.sep});function Ow1(H){let $=/[*?[{]/,A=H.match($);if(!A||A.index===void 0){let f=PM.dirname(H),E=PM.basename(H);return{baseDir:f,relativePattern:E}}let L=H.slice(0,A.index),I=Math.max(L.lastIndexOf("/"),L.lastIndexOf(PM.sep));if(I===-1)return{baseDir:"",relativePattern:H};let D=L.slice(0,I),B=H.slice(I+1);if(D===""&&I===0)D="/";if(oA()==="windows"&&/^[A-Za-z]:$/.test(D))D=D+PM.sep;return{baseDir:D,relativePattern:B}}async function JYI(H,$,{limit:A,offset:L},I,D){let B=$,f=H;if(PM.isAbsolute(H)){let{baseDir:W,relativePattern:P}=Ow1(H);if(W)B=W,f=P}let E=SFH(jFH(D),B),M=A$(process.env.CLAUDE_CODE_GLOB_NO_IGNORE||"true"),G=A$(process.env.CLAUDE_CODE_GLOB_HIDDEN||"true"),U=["--files","--glob",f,"--sort=modified",...M?["--no-ignore"]:[],...G?["--hidden"]:[]];for(let W of E)U.push("--glob",`!${W}`);let J=(await YR(U,B,I)).map((W)=>PM.isAbsolute(W)?W:PM.join(B,W)),F=J.length>L+A;return{files:J.slice(L,L+A),truncated:F}}function joD(H){try{return zH().readFileSync(H,{encoding:"utf8"})}catch($){return r($),null}}function x3(H){let $=zH();return Math.floor($.statSync(H).mtimeMs)}function uTD(H,$=0,A){let D=zH().readFileSync(H,{encoding:"utf8"}).split(/\r?\n/),B=A!==void 0&&D.length-$>A?D.slice($,$+A):D.slice($);return{content:B.join(` `)}return THH($)}}function Mf(){let H=tbA(),$=De(SW(),hz);if(!$.projects)return OpH;let A=$.projects[H]??OpH;if(typeof A.allowedTools==="string")A.allowedTools=q1(A.allowedTools)??[];return A}function MM(H){let $=tbA();try{koD(SW(),hz,(A)=>{let L=A.projects?.[$]??OpH,I=H(L);if(I===L)return A;return{...A,projects:{...A.projects,[$]:I}}})}catch(A){N(`Failed to save config with lock: ${A}`,{level:"error"});let L=De(SW(),hz),I=L.projects?.[$]??OpH,D=H(I);if(D===I)return;boD(SW(),{...L,projects:{...L.projects,[$]:D}},hz)}}function Nd(){return KVH()!==null}function DmH(){return Nd()&&!A$(process.env.FORCE_AUTOUPDATE_PLUGINS)}function KVH(){if(A$(process.env.DISABLE_AUTOUPDATER))return"DISABLE_AUTOUPDATER set";if(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC set";let H=M$();if(H.autoUpdates===!1&&(H.installMethod!=="native"||H.autoUpdatesProtectedForNative!==!0))return"config";return null}function Y9$(){if(A$(process.env.DISABLE_COST_WARNINGS))return!1;if(nL())return!1;let $=ji(),A=eZ()!==null;if(!$.hasToken&&!A)return!1;let L=M$(),I=L.oauthAccount?.organizationRole,D=L.oauthAccount?.workspaceRole;if(!I||!D)return!1;return["admin","billing"].includes(I)||["workspace_admin","workspace_billing"].includes(D)}function my(){if(voD!==null)return voD;if(!nL())return!1;let H=f0();if(H==="max"||H==="pro")return!0;let A=M$().oauthAccount?.organizationRole;return!!A&&["admin","billing","owner","primary_owner"].includes(A)}function $T(){return cf("tengu_c4w_usage_limit_notifications_enabled")}function ux(){let H=M$();if(H.userID)return H.userID;let $=cz$.randomBytes(32).toString("hex");return AA((A)=>({...A,userID:$})),$}function uwA(){let H=M$();if(H.anonymousId)return H.anonymousId;let $=`claudecode.v1.${cz$.randomUUID()}`;return AA((A)=>({...A,anonymousId:$})),$}function uoD(){if(!M$().firstStartTime){let $=new Date().toISOString();AA((A)=>({...A,firstStartTime:A.firstStartTime??$}))}}function yv(H){let $=zL();if(H==="ExperimentalUltraClaudeMd")return yv("User");switch(H){case"User":return o4.join(UL(),"CLAUDE.md");case"Local":return o4.join($,"CLAUDE.local.md");case"Project":return o4.join($,"CLAUDE.md");case"Managed":return o4.join(v_(),"CLAUDE.md");case"ExperimentalUltraClaudeMd":return o4.join(UL(),"ULTRACLAUDE.md");case"AutoMem":return HF$()}}function N7A(){return o4.join(v_(),".claude","rules")}function O7A(){return o4.join(UL(),"rules")}var o4,cz$,hoD,OpH,hz,S4G,j4G,zd,M8H=null,NpH=0,dz$=0,obA=!1,tbA,voD=null;var vA=K(()=>{Z$();tD();Z1();NA();PI();nM();ZM();lG();g$();DL();rD();EI();E$();Z6();_$();t8();z$();ZE();y$H();G3();SD();Z$();szA();o4=require("path"),cz$=require("crypto"),hoD=b(zk(),1),OpH={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},hz={numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:"dark",preferredNotifChannel:"auto",verbose:!1,editorMode:"normal",autoCompactEnabled:!0,showTurnDuration:!0,hasSeenTasksHint:!1,hasUsedStash:!1,queuedCommandUpHintCount:0,diffTool:"auto",customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:60000,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},cachedGrowthBookFeatures:{},respectGitignore:!0};S4G={...hz,autoUpdates:!1},j4G={...OpH};zd={config:null,mtime:0};PB(async()=>{jw1()});tbA=o$(()=>{let H=zL(),$=XQ(H);if($)return E2H($);return E2H(o4.resolve(H))})});async function goD(){if(nz$===null&&!iz$)iz$=yw1(),nz$=await iz$,iz$=null,nm.cache.clear?.()}function moD(){return nm(!0)}function Rw1(){if(nz$!==null)return nz$;return}async function yw1(){return}var nz$=null,iz$=null,nm;var ELH=K(()=>{vA();tD();g$();EI();O_();Z1();nm=o$((H)=>{let $=ux(),A=M$(),L,I,D;if(H){if(L=f0()??void 0,I=Ri()??void 0,L&&A.claudeCodeFirstTokenDate){let M=new Date(A.claudeCodeFirstTokenDate).getTime();if(!isNaN(M))D=M}}let B=T9(),f=B?.organizationUuid,E=B?.accountUuid;return{deviceId:$,sessionId:j$(),email:Rw1(),appVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,platform:OA.platform,organizationUuid:f,accountUuid:E,userType:"external",subscriptionType:L,rateLimitTier:I,firstTokenTime:D,...process.env.GITHUB_ACTIONS==="true"&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}})});function az$(H){let $=jpH.get(H);if($)UPA({experimentId:$.experimentId,variationId:$.variationId,userAttributes:poD(),experimentMetadata:{feature_id:H}})}function Be(){return AWH()}function poD(){let H=moD(),$=H.email;return{id:H.deviceId,sessionId:H.sessionId,deviceID:H.deviceId,platform:H.platform,...H.organizationUuid&&{organizationUUID:H.organizationUuid},...H.accountUuid&&{accountUUID:H.accountUuid},...H.userType&&{userType:H.userType},...H.subscriptionType&&{subscriptionType:H.subscriptionType},...H.rateLimitTier&&{rateLimitTier:H.rateLimitTier},...H.firstTokenTime&&{firstTokenTime:H.firstTokenTime},...$&&{email:$},...H.appVersion&&{appVersion:H.appVersion},...H.githubActionsMetadata&&{githubActionsMetadata:H.githubActionsMetadata}}}async function doD(H,$,A){if(!Be())return $;let L=await xPH();if(!L)return $;let I;if(rz$.has(H))I=rz$.get(H);else I=L.getFeatureValue(H,$);if(A)az$(H);return I}async function HkA(H,$){return doD(H,$,!0)}function NL(H,$){if(!Be())return $;if(zPH(H,$),jpH.has(H))az$(H);else xpH.add(H);try{let A=M$().cachedGrowthBookFeatures?.[H];return A!==void 0?A:$}catch{return $}}function cf(H){if(!Be())return!1;if(zPH(H,!1),jpH.has(H))az$(H);else xpH.add(H);let $=M$(),A=$.cachedGrowthBookFeatures?.[H];if(A!==void 0)return Boolean(A);return $.cachedStatsigGates?.[H]??!1}async function eaD(H){if(!Be())return!1;if(SpH)await SpH;let $=M$(),A=$.cachedStatsigGates?.[H];if(A!==void 0)return zPH(H,!1),Boolean(A);let L=$.cachedGrowthBookFeatures?.[H];if(L!==void 0)return zPH(H,!1),Boolean(L);return zPH(H,!1),!1}function M4D(){if(!Be())return;try{oz$(),SpH=xPH().finally(()=>{SpH=null})}catch(H){r(H instanceof Error?H:Error(`GrowthBook: Auth change refresh failed: ${H}`))}}function oz$(){coD(),TPH?.destroy(),TPH=null,ebA=!1,SpH=null,jpH.clear(),xpH.clear(),rz$.clear(),sbA.cache?.clear?.(),xPH.cache?.clear?.(),zPH.cache?.clear?.()}async function hw1(){if(!Be())return;try{let H=await xPH();if(!H)return;await H.refreshFeatures();let $=M$().cachedGrowthBookFeatures;if($){let A={...$},L=!1;for(let I of Object.keys($)){let D=H.getFeatureValue(I,void 0);if(D!==void 0&&!jHH(D,$[I]))A[I]=D,L=!0}if(L)AA((I)=>({...I,cachedGrowthBookFeatures:A}))}}catch(H){r(H instanceof Error?H:Error(`GrowthBook: Light refresh failed: ${H}`))}}function bw1(){if(!Be())return;if(NPH)clearInterval(NPH);if(NPH=setInterval(()=>{hw1()},vw1),!OPH)OPH=()=>{coD()},process.on("beforeExit",OPH)}function coD(){if(NPH)clearInterval(NPH),NPH=null;if(OPH)process.removeListener("beforeExit",OPH),OPH=null}async function aS(H,$){return HkA(H,$)}function rm(H,$){return NL(H,$)}var TPH=null,ebA=!1,jpH,rz$,xpH,SpH=null,sbA,xPH,zPH,vw1=21600000,NPH=null,OPH=null;var SD=K(()=>{wiH();prA();crA();ELH();E$();_$();YvH();vA();_Q();g$();Z$();jpH=new Map,rz$=new Map,xpH=new Set;sbA=o$(()=>{if(!Be())return null;let H=poD(),$="https://api.anthropic.com/",L=XG(!0)||tI()?eG():{headers:{},error:"trust not established"};ebA=!L.error;let D=new piH({apiHost:$,clientKey:drA,attributes:H,remoteEval:!0,cacheKeyAttributes:["id","organizationUUID"],...L.error?{}:{apiHostRequestHeaders:L.headers},...{}});TPH=D;let B=D.init({timeout:5000}).then(async(f)=>{if(TPH!==D)return;let E=D.getPayload();if(E?.features){let M={};for(let[G,U]of Object.entries(E.features)){let X=U;if("value"in X&&!("defaultValue"in X))M[G]={...X,defaultValue:X.value};else M[G]=X;if(X.source==="experiment"&&X.experimentResult){let{experimentResult:J,experiment:F}=X;if(F?.key&&J.variationId!==void 0)jpH.set(G,{experimentId:F.key,variationId:J.variationId})}}await D.setPayload({...E,features:M});for(let[G,U]of Object.entries(M))if("value"in U)rz$.set(G,U.value);for(let G of xpH)az$(G);xpH.clear()}}).catch((f)=>{});return process.on("beforeExit",()=>TPH?.destroy()),process.on("exit",()=>TPH?.destroy()),{client:D,initialized:B}}),xPH=o$(async()=>{let H=sbA();if(!H)return null;if(!ebA){if(XG(!0)||tI()){if(!eG().error){if(oz$(),H=sbA(),!H)return null}}}return await H.initialized,bw1(),H.client});zPH=o$(async(H,$)=>{let A=await doD(H,$,!1),L=M$();if(jHH(L.cachedGrowthBookFeatures?.[H],A))return;AA((I)=>({...I,cachedGrowthBookFeatures:{...I.cachedGrowthBookFeatures??{},[H]:A}}))})});var sxA={};XA(sxA,{modelSupportsToolReference:()=>aoD,isToolSearchToolAvailable:()=>ooD,isToolSearchEnabledOptimistic:()=>Sm,isToolSearchEnabled:()=>puH,isToolReferenceBlock:()=>ng,getMcpMode:()=>gw1,getExternalMcpMode:()=>M1H,getAutoToolSearchCharThreshold:()=>roD,extractDiscoveredToolNames:()=>rhA});function LkA(H){if(!H.startsWith("auto:"))return null;let $=H.slice(5),A=parseInt($,10);if(isNaN(A))return N(`Invalid ENABLE_TOOL_SEARCH value "${H}": expected auto:N where N is a number.`),null;return Math.max(0,Math.min(100,A))}function ioD(H){if(!H)return!1;return H==="auto"||H.startsWith("auto:")}function AkA(){let H=process.env.ENABLE_TOOL_SEARCH;if(!H)return $kA;if(H==="auto")return $kA;let $=LkA(H);if($!==null)return $;return $kA}function noD(H){let $=YeH(H),A=JV(H,$),L=AkA()/100;return Math.floor(A*L)}function roD(H){return Math.floor(noD(H)*kw1)}function gw1(){let H=process.env.ENABLE_TOOL_SEARCH,$=H?LkA(H):null;if($===0)return"tst";if($===100){if(A$(process.env.ENABLE_MCP_CLI))return"mcp-cli";return"standard"}if(ioD(H))return"tst-auto";if(A$(H))return"tst";if(A$(process.env.ENABLE_MCP_CLI))return"mcp-cli";if(BE(process.env.ENABLE_MCP_CLI))return"standard";if(BE(process.env.ENABLE_TOOL_SEARCH))return"standard";return"tst-auto"}function M1H(){let H=process.env.ENABLE_TOOL_SEARCH,$=H?LkA(H):null;if($===0)return"tst";if($===100);else if(ioD(H))return"tst-auto";if(A$(H))return"tst";if(A$(process.env.ENABLE_EXPERIMENTAL_MCP_CLI))return"mcp-cli";if($===100)return"standard";if(BE(H))return"standard";if(BE(process.env.ENABLE_EXPERIMENTAL_MCP_CLI))return"standard";if(!NP())try{if(NL("tengu_mcp_tool_search",!0)===!1)return"standard"}catch{}return"tst-auto"}function pw1(){try{let H=NL("tengu_tool_search_unsupported_models",null);if(H&&Array.isArray(H)&&H.length>0)return H}catch{}return mw1}function aoD(H){let $=H.toLowerCase(),A=pw1();for(let L of A)if($.includes(L.toLowerCase()))return!1;return!0}function Sm(){let H=M1H(),$=H==="tst"||H==="tst-auto";if(!loD)loD=!0,N(`[ToolSearch:optimistic] mode=${H}, ENABLE_TOOL_SEARCH=${process.env.ENABLE_TOOL_SEARCH}, result=${$}`);switch(H){case"tst":case"tst-auto":return!0;case"mcp-cli":case"standard":return!1}}function ooD(H){return H.some(($)=>$.name===C7)}async function dw1(H,$,A){let L=H.filter((D)=>U3(D));if(L.length===0)return 0;return(await Promise.all(L.map(async(D)=>{let B=await D.prompt({getToolPermissionContext:$,tools:H,agents:A}),f=D.inputJSONSchema?yH(D.inputJSONSchema):D.inputSchema?yH(t9H(D.inputSchema)):"";return D.name.length+B.length+f.length}))).reduce((D,B)=>D+B,0)}async function puH(H,$,A,L,I){let D=$.filter((E)=>E.isMcp).length;function B(E,M,G,U){c("tengu_tool_search_mode_decision",{enabled:E,mode:M,reason:G,checkedModel:H,mcpToolCount:D,userType:"external",...U})}if(!aoD(H))return N(`Tool search disabled for model '${H}': model does not support tool_reference blocks. This feature is only available on Claude Sonnet 4+, Opus 4+, and newer models.`),B(!1,"standard","model_unsupported"),!1;if(!ooD($))return N("Tool search disabled: ToolSearchTool is not available (may have been disallowed via disallowedTools)."),B(!1,"standard","mcp_search_unavailable"),!1;let f=M1H();switch(f){case"tst":return B(!0,f,"tst_enabled"),!0;case"tst-auto":{let{enabled:E,debugDescription:M,metrics:G}=await iw1($,A,L,H);if(E)return N(`Auto tool search enabled: ${M}`+(I?` [source: ${I}]`:"")),B(!0,f,"auto_above_threshold",G),!0;if($.some((U)=>U3(U))&&!NP())try{let U=NL("tengu_tst_kx7",!1);return N(`Tool search ${U?"enabled":"disabled"} via experiment (tengu_tst_kx7): below threshold, deferred tools present`+(I?` [source: ${I}]`:"")),B(U,f,"experiment_enable_tst"),U}catch(U){N(`tengu_tst_kx7: GrowthBook not ready, skipping: ${U}`)}return N(`Auto tool search disabled: ${M}`+(I?` [source: ${I}]`:"")),B(!1,f,"auto_below_threshold",G),!1}case"mcp-cli":return B(!1,f,"mcp_cli_mode"),!1;case"standard":return B(!1,f,"standard_mode"),!1}}function ng(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="tool_reference"}function cw1(H){return ng(H)&&"tool_name"in H&&typeof H.tool_name==="string"}function lw1(H){return typeof H==="object"&&H!==null&&"type"in H&&H.type==="tool_result"&&"content"in H&&Array.isArray(H.content)}function rhA(H){let $=new Set;for(let A of H){if(A.type!=="user")continue;let L=A.message?.content;if(!Array.isArray(L))continue;for(let I of L)if(lw1(I)){for(let D of I.content)if(cw1(D))$.add(D.tool_name)}}if($.size>0)N(`Dynamic tool loading: found ${$.size} discovered tools in message history`);return $}async function iw1(H,$,A,L){let I=await uw1(H,$,A,L);if(I!==null){let f=noD(L);return{enabled:I>=f,debugDescription:`${I} tokens (threshold: ${f}, ${AkA()}% of context)`,metrics:{deferredToolTokens:I,threshold:f}}}let D=await dw1(H,$,A),B=roD(L);return{enabled:D>=B,debugDescription:`${D} chars (threshold: ${B}, ${AkA()}% of context) (char fallback)`,metrics:{deferredToolDescriptionChars:D,charThreshold:B}}}var $kA=10,kw1=2.5,uw1,mw1,loD=!1;var GT=K(()=>{SD();Fo();z$();tD();NA();Z$();Ow$();m3H();E$();ia();nC();$q();uw1=o$(async(H,$,A,L)=>{let I=H.filter((D)=>U3(D));if(I.length===0)return 0;try{let D=await $d(I,$,{activeAgents:A,allAgents:A},L);if(D===0)return null;return Math.max(0,D-tw$)}catch{return null}},(H)=>H.filter(($)=>U3($)).map(($)=>$.name).join(","));mw1=["haiku"]});var soD={};XA(soD,{parseMcpCliCall:()=>ss,isMcpCliEndpointEnabled:()=>Od,isMcpCliEnabled:()=>eU,isMcpCliCall:()=>aw1,getMcpToolTimeoutMs:()=>dt,convertMcpToolNameForCli:()=>ihA});function dt(){return parseInt(process.env.MCP_TOOL_TIMEOUT||"",10)||nw1}function rw1(){if(A$(process.env.ENABLE_TOOL_SEARCH)&&A$(process.env.ENABLE_EXPERIMENTAL_MCP_CLI)&&!toD)toD=!0,console.warn(oH.yellow(`Warning: Both ENABLE_TOOL_SEARCH and ENABLE_EXPERIMENTAL_MCP_CLI are set to true. `,()=>X())}),!GZ())await vc("tengu_mcp_cli_command_executed",{command:"call",tool_name:nB(B),success:!0,duration_ms:Date.now()-f});process.exit(0)}catch(E){console.error(oH.red("Error calling tool:"),String(E));let M=Date.now()-f,G=String(E).slice(0,2000);if(!GZ())await vc("tengu_tool_use_error",{toolName:nB(B),isMcp:!0,error:G,durationMs:M}),await vc("tengu_mcp_cli_command_executed",{command:"call",tool_name:nB(B),success:!1,error_type:E instanceof vpH?"connection_failed":"tool_execution_failed",duration_ms:Date.now()-f});process.exit(1)}});Ee.command("grep").description("Search tool names and descriptions using regex patterns").argument("","Regex pattern to search for").option("--json","Output in JSON format").option("-i, --ignore-case","Case insensitive search (default: true)",!0).action(async(H,$)=>{let A=await hpH("grep",async()=>{try{new RegExp(H,$.ignoreCase?"i":"")}catch(D){throw Error(`Invalid regex pattern: ${D instanceof Error?D.message:String(D)}`)}let I={pattern:H,ignoreCase:$.ignoreCase};return GZ()?await U8H(CtD,{command:"grep",params:I}):AN$(fe().tools,I)},(I)=>({match_count:I.length}));if(!A.success)process.exit(1);let L=A.data;if($.json)console.log(yH(L));else if(L.length===0)console.log(oH.yellow("No tools found matching pattern"));else L.forEach((I)=>{if(console.log(oH.bold(`${I.server}/${I.name}`)),I.description){let D=I.description.length>100?I.description.slice(0,100)+"...":I.description;console.log(oH.dim(` ${D}`))}console.log()})});Ee.command("resources").description("List MCP resources").argument("[server]","Filter by server name").option("--json","Output in JSON format").action(async(H,$)=>{let A={server:H},L=await hpH("resources",async()=>{if(GZ())return await U8H(wtD,{command:"resources",params:A});else{let D=fe();return LN$(D.resources,A,D.normalizedNames)}},(D)=>({resource_count:D.length,filtered:!!H}));if(!L.success)process.exit(1);let I=L.data;if($.json)console.log(yH(I));else I.forEach((D)=>{console.log(`${D.server}/${D.name||D.uri}`)})});Ee.command("read").description("Read an MCP resource").argument("","Resource identifier in format / or ").argument("[uri]","Optional: Direct resource URI (file://, https://, etc.)").option("--json","Output in JSON format").option("--timeout ","Timeout in milliseconds (default: MCP_TOOL_TIMEOUT env var or effectively infinite)").option("--debug","Show debug output").action(async(H,$,A)=>{let L,I,D;if($)L=H,D=$;else{let E=ZkA(H);L=E.server,I=E.tool}let B;if(D){if(B=D,A.debug)console.log(`Using direct URI: ${B}`)}else{let E=fe(),G=VZ1(E,L).find((U)=>U.name===I||U.uri===I);if(!G)console.error(oH.red(`Error: Resource '${I}' not found on server '${L}'`)),process.exit(1);B=G.uri}let f=Date.now();try{let E=parseInt(A.timeout||"",10)||dt(),M={server:L,uri:B,timeoutMs:E},G=GZ()?await U8H(_DH,{command:"read",params:M},E):await _Z1(L,B,A);if(A.json)console.log(yH(G));else if(G.contents&&Array.isArray(G.contents))G.contents.forEach((U)=>{if(U&&typeof U==="object"){if("text"in U)console.log(U.text);else if("blob"in U){console.log(oH.yellow("[Binary blob content]"));let X="mimeType"in U?U.mimeType:void 0;console.log(oH.dim(`MIME type: ${X||"unknown"}`))}}});else console.log(yH(G,null,2));if(!GZ())await vc("tengu_mcp_cli_command_executed",{command:"read",success:!0,duration_ms:Date.now()-f});process.exit(0)}catch(E){if(console.error(oH.red("Error reading resource:"),String(E)),!GZ())await vc("tengu_mcp_cli_command_executed",{command:"read",success:!1,error_type:E instanceof vpH?"connection_failed":"read_failed",duration_ms:Date.now()-f});process.exit(1)}})});var RtD={};XA(RtD,{ripgrepMain:()=>CZ1});function CZ1(H){if(process.env.RIPGREP_EMBEDDED==="true")return jtD.spawnSync(process.execPath,["--no-config",...H],{argv0:"rg",stdio:"inherit"}).status??1;let $;return $=dmA().ripgrepMain,$(["--no-config",...H])}var jtD;var ytD=K(()=>{jtD=require("child_process")});class bpH{constructor(H=qkA.default.stdin,$=qkA.default.stdout){this._stdin=H,this._stdout=$,this._readBuffer=new kjH,this._started=!1,this._ondata=(A)=>{this._readBuffer.append(A),this.processReadBuffer()},this._onerror=(A)=>{var L;(L=this.onerror)===null||L===void 0||L.call(this,A)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var H,$;while(!0)try{let A=this._readBuffer.readMessage();if(A===null)break;(H=this.onmessage)===null||H===void 0||H.call(this,A)}catch(A){($=this.onerror)===null||$===void 0||$.call(this,A)}}async close(){var H;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),(H=this.onclose)===null||H===void 0||H.call(this)}send(H){return new Promise(($)=>{let A=EX$(H);if(this._stdout.write(A))$();else this._stdout.once("drain",$)})}}var qkA;var TkA=K(()=>{iFA();qkA=b(require("process"))});var htD={};XA(htD,{runClaudeInChromeMcpServer:()=>zZ1});function qZ1(){return}function TZ1(){return A$(process.env.USE_LOCAL_OAUTH)||A$(process.env.LOCAL_BRIDGE)}async function zZ1(){qPH();let H=new vtD,$=qZ1();H.info(`Bridge URL: ${$??"none (using native socket)"}`);let A={serverName:"Claude in Chrome",logger:H,socketPath:Y2$(),getSocketPaths:TZD,clientTypeId:"claude-code",onAuthenticationError:()=>{H.warn("Authentication error occurred. Please ensure you are logged into the Claude browser extension with the same claude.ai account as Claude Code.")},onToolCallDisconnected:()=>{return`Browser extension is not connected. Please ensure the Claude browser extension is installed and running (${wZ1}), and that you are logged into claude.ai with the same account as Claude Code. If this is your first time connecting to Chrome, you may need to restart Chrome for the installation to take effect. If you continue to experience issues, please report a bug: ${ZZ1}`},...$&&{bridgeConfig:{url:$,getUserId:async()=>{return M$().oauthAccount?.accountUuid},getOAuthToken:async()=>{return dD()?.accessToken??""},...TZ1()&&{devUserId:"dev_user_local"}}},...process.env.CLAUDE_CHROME_PERMISSION_MODE&&{initialPermissionMode:process.env.CLAUDE_CHROME_PERMISSION_MODE}},L=LhA(A),I=new bpH;process.stdin.on("end",()=>process.exit(0)),process.stdin.on("error",()=>process.exit(0)),N("[Claude in Chrome] Starting MCP server"),await L.connect(I),N("[Claude in Chrome] MCP server started")}class vtD{silly(H,...$){N(RPH.format(H,...$),{level:"debug"})}debug(H,...$){N(RPH.format(H,...$),{level:"debug"})}info(H,...$){N(RPH.format(H,...$),{level:"info"})}warn(H,...$){N(RPH.format(H,...$),{level:"warn"})}error(H,...$){N(RPH.format(H,...$),{level:"error"})}}var RPH,wZ1="https://claude.ai/chrome",ZZ1="https://github.com/anthropics/claude-code/issues/new?labels=bug,claude-in-chrome";var btD=K(()=>{E$();TkA();tT$();EI();vA();NA();nS();RPH=require("util")});var dtD={};XA(dtD,{sendChromeMessage:()=>X8H,runChromeNativeHost:()=>OZ1});function a5(H,...$){if(ktD){let A=new Date().toISOString(),L=$.length>0?" "+yH($):"",I=`[${A}] [Claude Chrome Native Host] ${H}${L} `;try{lF.appendFileSync(ktD,I)}catch{}}console.error(`[Claude Chrome Native Host] ${H}`,...$)}function X8H(H){let $=Buffer.from(H,"utf-8"),A=Buffer.alloc(4);A.writeUInt32LE($.length,0),process.stdout.write(A),process.stdout.write($)}async function OZ1(){a5("Initializing...");let H=new mtD,$=new ptD;await H.start();while(!0){let A=await $.read();if(A===null)break;await H.handleMessage(A)}await H.stop()}class mtD{mcpClients=new Map;nextClientId=1;server=null;running=!1;socketPath=null;async start(){if(this.running)return;if(this.socketPath=Y2$(),fN$.platform()!=="win32"){let H=wuH();try{if(!lF.statSync(H).isDirectory())lF.unlinkSync(H)}catch{}lF.mkdirSync(H,{recursive:!0,mode:448});try{lF.chmodSync(H,448)}catch{}try{let $=lF.readdirSync(H);for(let A of $){if(!A.endsWith(".sock"))continue;let L=parseInt(A.replace(".sock",""),10);if(isNaN(L))continue;try{process.kill(L,0)}catch{try{lF.unlinkSync(gtD.join(H,A)),a5(`Removed stale socket for PID ${L}`)}catch{}}}}catch{}}a5(`Creating socket listener: ${this.socketPath}`),this.server=utD.createServer((H)=>this.handleMcpClient(H)),await new Promise((H,$)=>{this.server.listen(this.socketPath,()=>{if(a5("Socket server listening for connections"),fN$.platform()!=="win32")try{lF.chmodSync(this.socketPath,384),a5("Socket permissions set to 0600")}catch(A){a5("Failed to set socket permissions:",A)}this.running=!0,H()}),this.server.on("error",(A)=>{a5("Socket server error:",A),$(A)})})}async stop(){if(!this.running)return;for(let[,H]of this.mcpClients)H.socket.destroy();if(this.mcpClients.clear(),this.server)await new Promise((H)=>{this.server.close(()=>H())}),this.server=null;if(fN$.platform()!=="win32"&&this.socketPath&&lF.existsSync(this.socketPath)){try{lF.unlinkSync(this.socketPath),a5("Cleaned up socket file")}catch{}try{let H=wuH();if(lF.readdirSync(H).length===0)lF.rmdirSync(H),a5("Removed empty socket directory")}catch{}}this.running=!1}async isRunning(){return this.running}async getClientCount(){return this.mcpClients.size}async handleMessage(H){let $=DA(H);switch(a5(`Handling Chrome message type: ${$.type}`),$.type){case"ping":a5("Responding to ping"),X8H(yH({type:"pong",timestamp:Date.now()}));break;case"get_status":X8H(yH({type:"status_response",native_host_version:NZ1}));break;case"tool_response":{if(this.mcpClients.size>0){a5(`Forwarding tool response to ${this.mcpClients.size} MCP clients`);let{type:A,...L}=$,I=Buffer.from(yH(L),"utf-8"),D=Buffer.alloc(4);D.writeUInt32LE(I.length,0);let B=Buffer.concat([D,I]);for(let[f,E]of this.mcpClients)try{E.socket.write(B)}catch(M){a5(`Failed to send to MCP client ${f}:`,M)}}break}case"notification":{if(this.mcpClients.size>0){a5(`Forwarding notification to ${this.mcpClients.size} MCP clients`);let{type:A,...L}=$,I=Buffer.from(yH(L),"utf-8"),D=Buffer.alloc(4);D.writeUInt32LE(I.length,0);let B=Buffer.concat([D,I]);for(let[f,E]of this.mcpClients)try{E.socket.write(B)}catch(M){a5(`Failed to send notification to MCP client ${f}:`,M)}}break}default:a5(`Unknown message type: ${$.type}`),X8H(yH({type:"error",error:`Unknown message type: ${$.type}`}))}}handleMcpClient(H){let $=this.nextClientId++,A={id:$,socket:H,buffer:Buffer.alloc(0)};this.mcpClients.set($,A),a5(`MCP client ${$} connected. Total clients: ${this.mcpClients.size}`),X8H(yH({type:"mcp_connected"})),H.on("data",(L)=>{A.buffer=Buffer.concat([A.buffer,L]);while(A.buffer.length>=4){let I=A.buffer.readUInt32LE(0);if(I===0||I>zkA){a5(`Invalid message length from MCP client ${$}: ${I}`),H.destroy();return}if(A.buffer.length<4+I)break;let D=A.buffer.slice(4,4+I);A.buffer=A.buffer.slice(4+I);try{let B=DA(D.toString("utf-8"));a5(`Forwarding tool request from MCP client ${$}: ${B.method}`),X8H(yH({type:"tool_request",method:B.method,params:B.params}))}catch(B){a5(`Failed to parse tool request from MCP client ${$}:`,B)}}}),H.on("error",(L)=>{a5(`MCP client ${$} error: ${L}`)}),H.on("close",()=>{a5(`MCP client ${$} disconnected. Remaining clients: ${this.mcpClients.size-1}`),this.mcpClients.delete($),X8H(yH({type:"mcp_disconnected"}))})}}class ptD{buffer=Buffer.alloc(0);pendingResolve=null;closed=!1;constructor(){process.stdin.on("data",(H)=>{this.buffer=Buffer.concat([this.buffer,H]),this.tryProcessMessage()}),process.stdin.on("end",()=>{if(this.closed=!0,this.pendingResolve)this.pendingResolve(null),this.pendingResolve=null}),process.stdin.on("error",()=>{if(this.closed=!0,this.pendingResolve)this.pendingResolve(null),this.pendingResolve=null})}tryProcessMessage(){if(!this.pendingResolve)return;if(this.buffer.length<4)return;let H=this.buffer.readUInt32LE(0);if(H===0||H>zkA){a5(`Invalid message length: ${H}`),this.pendingResolve(null),this.pendingResolve=null;return}if(this.buffer.length<4+H)return;let $=this.buffer.subarray(4,4+H);this.buffer=this.buffer.subarray(4+H);let A=$.toString("utf-8");this.pendingResolve(A),this.pendingResolve=null}async read(){if(this.closed)return null;if(this.buffer.length>=4){let H=this.buffer.readUInt32LE(0);if(H>0&&H<=zkA&&this.buffer.length>=4+H){let $=this.buffer.subarray(4,4+H);return this.buffer=this.buffer.subarray(4+H),$.toString("utf-8")}}return new Promise((H)=>{this.pendingResolve=H,this.tryProcessMessage()})}}var utD,fN$,gtD,lF,NZ1="1.0.0",zkA=1048576,ktD=void 0;var ctD=K(()=>{nS();Z$();utD=require("net"),fN$=require("os"),gtD=require("path"),lF=require("fs")});function xZ1(){let H=process.argv[1]||"",$=process.execPath||process.argv[0]||"";if(oA()==="windows")H=H.split(yPH.win32.sep).join(yPH.posix.sep),$=$.split(yPH.win32.sep).join(yPH.posix.sep);let A=[H,$],L=["/build-ant/","/build-external/","/build-external-native/","/build-ant-native/"];return A.some((I)=>L.some((D)=>I.includes(D)))}function jZ1(H){let $=`${H.name}: ${H.message}`;return SZ1.some((A)=>A.test($))}function itD(){let H=process.listeners("warning");if(EN$&&H.includes(EN$))return;if(!xZ1())process.removeAllListeners("warning");EN$=(A)=>{try{let L=`${A.name}: ${A.message.slice(0,50)}`,I=ltD.get(L)||0;ltD.set(L,I+1);let D=jZ1(A);if(c("tengu_node_warning",{is_internal:D?1:0,occurrence_count:I+1,classname:A.name,...!1}),process.env.CLAUDE_DEBUG==="true")N(`${D?"[Internal Warning]":"[Warning]"} ${A.toString()}`,{level:"warn"})}catch{}},process.on("warning",EN$)}var yPH,ltD,SZ1,EN$=null;var ntD=K(()=>{z$();E$();Z9();yPH=require("path"),ltD=new Map;SZ1=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/]});function rtD(){}function atD(){let H=VL()||{},$=M$().env||{},A=H.env||{};for(let[L,I]of Object.entries($))if(D0H.has(L.toUpperCase()))process.env[L]=I;for(let[L,I]of Object.entries(A))if(D0H.has(L.toUpperCase()))process.env[L]=I;rtD()}function Me(){let H=VL()||{};Object.assign(process.env,M$().env),Object.assign(process.env,H.env),rtD(),TD$()}var kpH=K(()=>{vA();nR();mL();f7$()});var otD={};XA(otD,{showInvalidConfigDialog:()=>vZ1});function RZ1({filePath:H,errorDescription:$,onExit:A,onReset:L}){return kz.default.createElement(BL,{title:"Configuration Error",color:"error",onCancel:A},kz.default.createElement(x,{flexDirection:"column",gap:1},kz.default.createElement(V,null,"The configuration file at ",kz.default.createElement(V,{bold:!0},H)," contains invalid JSON."),kz.default.createElement(V,null,$)),kz.default.createElement(x,{flexDirection:"column"},kz.default.createElement(V,{bold:!0},"Choose an option:"),kz.default.createElement(QA,{options:[{label:"Exit and fix manually",value:"exit"},{label:"Reset with default configuration",value:"reset"}],onChange:(D)=>{if(D==="exit")A();else L()},onCancel:A})))}async function vZ1({error:H}){let $={...ZG(!1),theme:yZ1};await new Promise(async(A)=>{let{unmount:L}=await A8(kz.default.createElement(i8,null,kz.default.createElement(hE,null,kz.default.createElement(RZ1,{filePath:H.filePath,errorDescription:H.message,onExit:()=>{L(),A(),process.exit(1)},onReset:()=>{iL(H.filePath,yH(H.defaultConfig,null,2),{flush:!1,encoding:"utf8"}),L(),A(),process.exit(0)}}))),$)})}var kz,yZ1="dark";var ttD=K(()=>{xH();l8();xH();Z$();pL();AS();Z$();sv();bB();kz=b(s(),1)});function OkA(){if(YPA()){if(tI()&&zF())NkA();RID().then(async()=>{Me(),await NkA()})}else NkA()}async function NkA(){if(stD)return;stD=!0,await hZ1()}async function hZ1(){let{initializeTelemetry:H}=await Promise.resolve().then(() => (N2A(),z2A)),$=H();if($)rS$($,(L,I)=>{let D=$?.createCounter(L,I);return{add(B,f={}){let M={...XQH(),...f};D?.add(B,M)}}})}var stD=!1,etD;var HsD=K(()=>{hc();g$();vA();vA();kpH();lG();UU();ZE();tD();g$();nF$();nR();H4H();iMH();zvH();XY();kpH();g$();OK$();Hq();ZPH();BW();Pt();BM();E$();Z6();Ma();etD=o$(()=>{let H=Date.now();EL("info","init_started"),_0("init_function_start");try{let $=Date.now();qPH(),EL("info","init_configs_enabled",{duration_ms:Date.now()-$}),_0("init_configs_enabled");let A=Date.now();if(atD(),EL("info","init_safe_env_vars_applied",{duration_ms:Date.now()-A}),_0("init_safe_env_vars_applied"),XID(),_0("init_after_graceful_shutdown"),Promise.resolve().then(() => (YvH(),EID)).then((D)=>{D.initialize1PEventLogging()}),_0("init_after_1p_event_logging"),n1L(),_0("init_after_oauth_populate"),_KA(),_0("init_after_jetbrains_detection"),YPA())jID();if(oy())_3I();_0("init_after_remote_settings_check"),uoD();let L=Date.now();N("[init] configureGlobalMTLS starting"),ggL(),EL("info","init_mtls_configured",{duration_ms:Date.now()-L}),N("[init] configureGlobalMTLS complete");let I=Date.now();if(N("[init] configureGlobalAgents starting"),TD$(),EL("info","init_proxy_configured",{duration_ms:Date.now()-I}),N("[init] configureGlobalAgents complete"),_0("init_network_configured"),DDL(),PB(T6D),eU())process.env.CLAUDE_CODE_SESSION_ID=j$(),YoD();if(FPH()){let D=Date.now();ToD(),EL("info","init_scratchpad_created",{duration_ms:Date.now()-D})}EL("info","init_completed",{duration_ms:Date.now()-H}),_0("init_function_end")}catch($){if($ instanceof S_)return Promise.resolve().then(() => (ttD(),otD)).then((A)=>A.showInvalidConfigDialog({error:$}));else throw $}})});async function uZ1(){if(SkA||RkA)return;if(SkA=!0,!$sD)$sD=!0,_3D(()=>{khA(),vPH.forEach(($)=>$())});let H=await mZ1();if(H.length===0)return;N(`Watching for changes in skill/command directories: ${H.join(", ")}...`),zb=YGH.watch(H,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:jkA?.stabilityThreshold??bZ1,pollInterval:jkA?.pollInterval??kZ1},ignored:($,A)=>{if(A&&!A.isFile()&&!A.isDirectory())return!0;return $.split(J8H.sep).some((L)=>L===".git")},ignorePermissionErrors:!0,usePolling:!1,atomic:!0}),zb.on("add",xkA),zb.on("change",xkA),zb.on("unlink",xkA),PB(async()=>AsD())}function AsD(){if(RkA=!0,zb)zb.close(),zb=null;vPH.clear()}function gZ1(H){return vPH.add(H),()=>{vPH.delete(H)}}async function mZ1(){let H=zH(),$=[],A=Tt("userSettings","skills");if(A)try{await H.stat(A),$.push(A)}catch{}let L=Tt("userSettings","commands");if(L)try{await H.stat(L),$.push(L)}catch{}let I=Tt("projectSettings","skills");if(I)try{let B=J8H.resolve(I);await H.stat(B),$.push(B)}catch{}let D=Tt("projectSettings","commands");if(D)try{let B=J8H.resolve(D);await H.stat(B),$.push(B)}catch{}for(let B of CN()){let f=J8H.join(B,".claude","skills");try{await H.stat(f),$.push(f)}catch{}}return $}function xkA(H){N(`Detected skill change: ${H}`),c("tengu_skill_file_changed",{source:"chokidar"}),dY$(),gh(),rp(),vPH.forEach(($)=>$())}function pZ1(H){if(zb)zb.close(),zb=null;vPH.clear(),SkA=!1,RkA=!1,jkA=H??null}var J8H,bZ1=1000,kZ1=500,zb=null,SkA=!1,RkA=!1,$sD=!1,vPH,jkA=null,hPH;var MN$=K(()=>{EeH();E$();ZE();zt();h4();J3();DL();g$();z$();J8H=b(require("path")),vPH=new Set;hPH={initialize:uZ1,dispose:AsD,subscribe:gZ1,resetForTesting:pZ1}});function LsD({onDone:H}){return bPH.default.createElement(BL,{title:"You've spent $5 on the Anthropic API this session.",onCancel:H},bPH.default.createElement(x,{flexDirection:"column"},bPH.default.createElement(V,null,"Learn more about how to monitor your spending:"),bPH.default.createElement(dI,{url:"https://code.claude.com/docs/en/costs"})),bPH.default.createElement(QA,{options:[{value:"ok",label:"Got it, thanks!"}],onChange:H}))}var bPH;var IsD=K(()=>{xH();l8();xH();bB();bPH=b(s(),1)});function fsD(){if(F8H++,F8H===1)GsD(),iZ1()}function EsD(){if(F8H>0)F8H--;if(F8H===0)MsD(),ykA()}function lZ1(){F8H=0,MsD(),ykA()}function iZ1(){return}function MsD(){if(kPH!==null)clearInterval(kPH),kPH=null}function GsD(){return}function ykA(){if(Cj!==null){try{Cj.kill(),N("Stopped caffeinate, allowing sleep")}catch{}Cj=null}}var BsD,dZ1=300,cZ1=240000,Cj=null,kPH=null,F8H=0,DsD=!1;var UsD=K(()=>{E$();ZE();BsD=require("child_process")});function XsD({name:H,color:$}){let A=v7($);return K8H.createElement(x,{flexDirection:"row",gap:1},K8H.createElement(V,{color:A},Zf," ",K8H.createElement(V,{bold:!0},"@",H)))}var K8H;var JsD=K(()=>{xH();p6();Wp();K8H=b(s(),1)});function vkA({toolName:H,description:$}){let A=g9(),L=g1(),I=q4();return _M.createElement(x,{flexDirection:"column",borderStyle:"round",borderColor:"warning",paddingX:1},_M.createElement(x,{marginBottom:1},_M.createElement(vD,null),_M.createElement(V,{color:"warning",bold:!0}," ","Waiting for team lead approval")),L&&I&&_M.createElement(x,{marginBottom:1},_M.createElement(XsD,{name:L,color:I})),_M.createElement(x,null,_M.createElement(V,{dimColor:!0},"Tool: "),_M.createElement(V,null,H)),_M.createElement(x,null,_M.createElement(V,{dimColor:!0},"Action: "),_M.createElement(V,null,$)),A&&_M.createElement(x,{marginTop:1},_M.createElement(V,{dimColor:!0},"Permission request sent to team ",'"',A,'"'," leader")))}var _M;var FsD=K(()=>{xH();JM();JsD();sU();XE();_M=b(s(),1)});function QsD(H,$=!1){let A=J$((L)=>L.teamContext);KsD.useEffect(()=>{if(!$)$j(H,{...dL()?{teamName:A?.teamName,agentName:A?.selfAgentName}:{}})},[H,$,A?.teamName,A?.selfAgentName])}var KsD;var WsD=K(()=>{rB();pL();T8();KsD=b(s(),1)});function _sD(H){return H.type==="text"}function YsD({messages:H,onPreRestore:$,onRestoreMessage:A,onRestoreCode:L,onSummarize:I,onClose:D}){let B=J$((KH)=>KH.fileHistory),[f,E]=o5.useState(void 0),M=gE(),G=o5.useMemo(PsD.randomUUID,[]),U=o5.useMemo(()=>[...H.filter(upH),{...R$({content:""}),uuid:G}],[H,G]),[X,J]=o5.useState(U.length-1),F=Math.max(0,Math.min(X-Math.floor(hkA/2),U.length-hkA)),Q=U.length>1,[W,P]=o5.useState(void 0),[C,Y]=o5.useState(void 0),[Z,q]=o5.useState(!1),[O,j]=o5.useState(null),[u,y]=o5.useState("both"),[g,h]=o5.useState("");function p(KH){let MH=KH?[{value:"both",label:"Restore code and conversation"},{value:"conversation",label:"Restore conversation"},{value:"code",label:"Restore code"}]:[{value:"conversation",label:"Restore conversation"}];return MH.push({value:"summarize",label:"Summarize from here",type:"input",placeholder:"add context (optional)",initialValue:"",onChange:h,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:": "}),MH.push({value:"nevermind",label:"Never mind"}),MH}o5.useEffect(()=>{c("tengu_message_selector_opened",{})},[]);async function d(KH){let MH=H.indexOf(KH),CH=H.length-1-MH;if(c("tengu_message_selector_selected",{index_from_end:CH,message_type:KH.type,is_current_prompt:!1}),!H.includes(KH)){D();return}if(M){P(KH);let OH=vY$(B,KH.uuid);Y(OH)}else{$(),q(!0);try{await A(KH),q(!1),D()}catch(OH){r(OH),q(!1),E(`Failed to restore the conversation: `)[0]??null;return Sd.createElement(x,{flexDirection:"column"},Sd.createElement(x,{borderDimColor:!0,borderColor:"subtle",borderStyle:"dashed",flexDirection:"column",borderLeft:!1,borderRight:!1},Jz(D.map((f)=>Sd.createElement(LC,{key:f.newStart,patch:f,dim:!1,filePath:H,firstLine:B,fileContent:L,width:A})),(f)=>Sd.createElement(V,{dimColor:!0,key:`ellipsis-${f}`},"..."))))}var Sd,UN$;var bkA=K(()=>{Zt();xH();tg();rD();DL();JBH();OB();Sd=b(s(),1),UN$=b(s(),1)});function pX(H){c("tengu_unary_event",{event:H.event,completion_type:H.completion_type,language_name:H.metadata.language_name,message_id:H.metadata.message_id,platform:H.metadata.platform,...H.metadata.hasFeedback!==void 0&&{hasFeedback:H.metadata.hasFeedback}})}var Q8H=K(()=>{z$()});function uz(H,$){let A=zI();TsD.useEffect(()=>{A((I)=>({...I,attribution:{...I.attribution,permissionPromptCount:I.attribution.permissionPromptCount+1}})),c("tengu_tool_use_show_permission_request",{messageID:H.assistantMessage.message.id,toolName:nB(H.tool.name),isMcp:H.tool.isMcp??!1,decisionReasonType:H.permissionResult.decisionReason?.type,sandboxEnabled:vL.isSandboxingEnabled()}),Promise.resolve($.language_name).then((I)=>{pX({completion_type:$.completion_type,event:"response",metadata:{language_name:I,message_id:H.assistantMessage.message.id,platform:OA.platform}})})},[H,$,A])}var TsD;var W8H=K(()=>{z$();R4();g3();zQ();C5();Z1();Q8H();EM();Z$();pL();TsD=b(s(),1)});function oZ1(H){let $=xD(H),A=xD(`${zL()}/.claude`),L=qC($),I=qC(A);return L.startsWith(I+gpH.sep.toLowerCase())||L.startsWith(I+"/")}function tZ1(H){let $=xD(H),A=`${zsD.homedir()}/.claude`,L=qC($),I=qC(A);return L.startsWith(I+gpH.sep.toLowerCase())||L.startsWith(I+"/")}function NsD({filePath:H,toolPermissionContext:$,operationType:A="write",onRejectFeedbackChange:L,onAcceptFeedbackChange:I,yesInputMode:D=!1,noInputMode:B=!1}){let f=[],E=CQ("chat:cycleMode","Chat","shift+tab");if(D&&I)f.push({type:"input",label:"Yes",value:"yes",placeholder:"and tell Claude what to do next",onChange:I,allowEmptySubmitToCancel:!0,option:{type:"accept-once"}});else f.push({label:"Yes",value:"yes",option:{type:"accept-once"}});let M=iS(H,$),G=oZ1(H),U=tZ1(H);if((G||U)&&A!=="read")f.push({label:"Yes, and allow Claude to edit its own settings for this session",value:"yes-claude-folder",option:{type:"accept-session",scope:U?"global-claude-folder":"claude-folder"}});else{let X;if(M)if(A==="read")X="Yes, during this session";else X=Ge.default.createElement(V,null,"Yes, allow all edits during this session"," ",Ge.default.createElement(V,{bold:!0},"(",E,")"));else{let J=qk(H),F=gpH.basename(J)||"this directory";if(A==="read")X=Ge.default.createElement(V,null,"Yes, allow reading from ",Ge.default.createElement(V,{bold:!0},F,"/")," during this session");else X=Ge.default.createElement(V,null,"Yes, allow all edits in ",Ge.default.createElement(V,{bold:!0},F,"/")," during this session ",Ge.default.createElement(V,{bold:!0},"(",E,")"))}f.push({label:X,value:"yes-session",option:{type:"accept-session"}})}if(B&&L)f.push({type:"input",label:"No",value:"no",placeholder:"and tell Claude what to do differently",onChange:L,allowEmptySubmitToCancel:!0,option:{type:"reject"}});else f.push({label:"No",value:"no",option:{type:"reject"}});return f}var Ge,gpH,zsD;var OsD=K(()=>{xH();BM();FG();ZM();g$();Ge=b(s(),1),gpH=require("path"),zsD=require("os")});function kkA(H,$,A,L,I){pX({completion_type:$,event:H,metadata:{language_name:A,message_id:L,platform:OA.platform,hasFeedback:I??!1}})}function sZ1(H,$){let{messageId:A,toolUseConfirm:L,onDone:I,completionType:D,languageName:B}=H;kkA("accept",D,B,A),c("tengu_accept_submitted",{toolName:nB(L.tool.name),isMcp:L.tool.isMcp??!1,has_instructions:!!$?.feedback,instructions_length:$?.feedback?.length??0,entered_feedback_mode:$?.enteredFeedbackMode??!1}),I(),L.onAllow(L.input,[],$?.feedback)}function eZ1(H,$){let{messageId:A,path:L,toolUseConfirm:I,toolPermissionContext:D,onDone:B,completionType:f,languageName:E,operationType:M}=H;if(kkA("accept",f,E,A),$?.scope==="claude-folder"||$?.scope==="global-claude-folder"){let U=$.scope==="global-claude-folder"?G9$:M9$,X=[{type:"addRules",rules:[{toolName:TB,ruleContent:U}],behavior:"allow",destination:"session"}];B(),I.onAllow(I.input,X);return}let G=L?pz$(L,M,D):[];B(),I.onAllow(I.input,G)}function Hq1(H,$){let{messageId:A,toolUseConfirm:L,onDone:I,onReject:D,completionType:B,languageName:f}=H;kkA("reject",B,f,A,$?.hasFeedback),c("tengu_reject_submitted",{toolName:nB(L.tool.name),isMcp:L.tool.isMcp??!1,has_instructions:!!$?.feedback,instructions_length:$?.feedback?.length??0,entered_feedback_mode:$?.enteredFeedbackMode??!1}),I(),D(),L.onReject($?.feedback)}var xsD;var SsD=K(()=>{Q8H();Z1();BM();z$();R4();xsD={"accept-once":sZ1,"accept-session":eZ1,reject:Hq1}});function jsD({filePath:H,completionType:$,languageName:A,toolUseConfirm:L,onDone:I,onReject:D,parseInput:B,operationType:f="write"}){let E=J$((p)=>p.toolPermissionContext),[M,G]=eP.useState(""),[U,X]=eP.useState(""),[J,F]=eP.useState("yes"),[Q,W]=eP.useState(!1),[P,C]=eP.useState(!1),[Y,Z]=eP.useState(!1),[q,O]=eP.useState(!1),j=eP.useMemo(()=>NsD({filePath:H,toolPermissionContext:E,operationType:f,onRejectFeedbackChange:X,onAcceptFeedbackChange:G,yesInputMode:Q,noInputMode:P}),[H,E,f,Q,P]),u=eP.useCallback((p,d,k)=>{let n={messageId:L.assistantMessage.message.id,path:H,toolUseConfirm:L,toolPermissionContext:E,onDone:I,onReject:D,completionType:$,languageName:A,operationType:f},GH=L.onAllow;L.onAllow=(BH,WH,wH)=>{GH(d,WH,wH)};let HH=xsD[p.type];HH(n,{feedback:k,hasFeedback:!!k,enteredFeedbackMode:p.type==="accept-once"?Y:q,scope:p.type==="accept-session"?p.scope:void 0})},[H,$,A,L,E,I,D,f,Y,q]),y=eP.useCallback(()=>{let p=j.find((d)=>d.option.type==="accept-session");if(p){let d=B(L.input);u(p.option,d)}},[j,B,L.input,u]);bI({"confirm:cycleMode":y},{context:"Confirmation"});let g=eP.useCallback((p)=>{if(p!=="yes"&&Q&&!M.trim())W(!1);if(p!=="no"&&P&&!U.trim())C(!1);F(p)},[Q,P,M,U]),h=eP.useCallback((p)=>{let d={toolName:nB(L.tool.name),isMcp:L.tool.isMcp??!1};if(p==="yes")if(Q)W(!1),c("tengu_accept_feedback_mode_collapsed",d);else W(!0),Z(!0),c("tengu_accept_feedback_mode_entered",d);else if(p==="no")if(P)C(!1),c("tengu_reject_feedback_mode_collapsed",d);else C(!0),O(!0),c("tengu_reject_feedback_mode_entered",d)},[Q,P,L]);return{options:j,onChange:u,acceptFeedback:M,rejectFeedback:U,focusedOption:J,setFocusedOption:g,handleInputModeToggle:h,yesInputMode:Q,noInputMode:P}}var eP;var RsD=K(()=>{$I();OsD();SsD();pL();z$();R4();eP=b(s(),1)});function hsD({onChange:H,toolUseContext:$,filePath:A,edits:L,editMode:I}){let D=jd.useRef(!1),[B,f]=jd.useState(!1),E=jd.useMemo(()=>ysD.randomUUID().slice(0,6),[]),M=jd.useMemo(()=>`\u273B [Claude Code] ${vsD.basename(A)} (${E}) \u29C9`,[A,E]),G=SX$($.options.mcpClients)&&M$().diffTool==="auto"&&!A.endsWith(".ipynb"),U=jX$($.options.mcpClients)??"IDE";async function X(){if(!G)return;try{c("tengu_ext_will_show_diff",{});let{oldContent:J,newContent:F}=await Aq1(A,L,$,M);if(D.current)return;c("tengu_ext_diff_accepted",{});let Q=$q1(A,J,F,I);if(Q.length===0){c("tengu_ext_diff_rejected",{});let W=CY($.options.mcpClients);if(W)await ukA(M,W);H({type:"reject"},{file_path:A,edits:L});return}H({type:"accept-once"},{file_path:A,edits:Q})}catch(J){r(J),f(!0)}}return jd.useEffect(()=>{return X(),()=>{D.current=!0}},[]),{closeTabInIDE(){let J=CY($.options.mcpClients);if(!J)return Promise.resolve();return ukA(M,J)},showingDiffInIDE:G&&!B,ideName:U,hasError:B}}function $q1(H,$,A,L){let I=L==="single",D=PYI({filePath:H,oldContent:$,newContent:A,singleHunk:I});if(D.length===0)return[];if(I&&D.length>1)r(Error(`Unexpected number of hunks: ${D.length}. Expected 1 hunk.`));return yRI(D)}async function Aq1(H,$,A,L){let I=!1,D=zH(),B=xD(H),f=D.existsSync(B)?$J(B):"";async function E(){if(I)return;I=!0;try{await ukA(L,M)}catch(G){r(G)}process.off("beforeExit",E),A.abortController.signal.removeEventListener("abort",E)}A.abortController.signal.addEventListener("abort",E),process.on("beforeExit",E);let M=CY(A.options.mcpClients);try{let{updatedFile:G}=EyH({filePath:B,fileContents:f,edits:$});if(!M||M.type!=="connected")throw Error("IDE client not available");let U=B,X=M.config.ideRunningInWindows===!0;if(oA()==="wsl"&&X&&process.env.WSL_DISTRO_NAME)U=new KKH(process.env.WSL_DISTRO_NAME).toIDEPath(B);let J=await Vx("openDiff",{old_file_path:U,new_file_path:U,new_file_contents:G,tab_name:L},M),F=Array.isArray(J)?J:[J];if(Dq1(F))return E(),{oldContent:f,newContent:F[1].text};else if(Lq1(F))return E(),{oldContent:f,newContent:G};else if(Iq1(F))return E(),{oldContent:f,newContent:f};throw Error("Not accepted")}catch(G){throw r(G),E(),G}}async function ukA(H,$){try{if(!$||$.type!=="connected")throw Error("IDE client not available");await Vx("close_tab",{tab_name:H},$)}catch(A){r(A)}}function Lq1(H){return Array.isArray(H)&&typeof H[0]==="object"&&H[0]!==null&&"type"in H[0]&&H[0].type==="text"&&"text"in H[0]&&H[0].text==="TAB_CLOSED"}function Iq1(H){return Array.isArray(H)&&typeof H[0]==="object"&&H[0]!==null&&"type"in H[0]&&H[0].type==="text"&&"text"in H[0]&&H[0].text==="DIFF_REJECTED"}function Dq1(H){return Array.isArray(H)&&H[0]?.type==="text"&&H[0].text==="FILE_SAVED"&&typeof H[1].text==="string"}var ysD,vsD,jd;var bsD=K(()=>{DL();JBH();tg();_$();vA();nU();z$();nU();ZM();wKA();Z9();rD();ysD=require("crypto"),vsD=require("path"),jd=b(s(),1)});function ksD({onChange:H,options:$,input:A,filePath:L,ideName:I,symlinkTarget:D,rejectFeedback:B,acceptFeedback:f,setFocusedOption:E,onInputModeToggle:M,focusedOption:G,yesInputMode:U,noInputMode:X}){return UZ.default.createElement(x,{flexDirection:"column"},UZ.default.createElement(Uf,{dividerColor:"permission"}),UZ.default.createElement(x,{marginX:1,flexDirection:"column",gap:1},UZ.default.createElement(V,{bold:!0,color:"permission"},"Opened changes in ",I," \u29C9"),D&&UZ.default.createElement(V,{color:"warning"},JN$.relative(C$(),D).startsWith("..")?`This will modify ${D} (outside working directory) via a symlink`:`Symlink target: ${D}`),njH()&&UZ.default.createElement(V,{dimColor:!0},"Save file to continue\u2026"),UZ.default.createElement(x,{flexDirection:"column"},UZ.default.createElement(V,null,"Do you want to make this edit to"," ",UZ.default.createElement(V,{bold:!0},JN$.basename(L)),"?"),UZ.default.createElement(QA,{options:$,inlineDescriptions:!0,onChange:(J)=>{let F=$.find((Q)=>Q.value===J);if(F){if(F.option.type==="reject"){let Q=B.trim();H(F.option,A,Q||void 0);return}if(F.option.type==="accept-once"){let Q=f.trim();H(F.option,A,Q||void 0);return}H(F.option,A)}},onCancel:()=>H({type:"reject"},A),onFocus:(J)=>E(J),onInputModeToggle:M})),UZ.default.createElement(x,{marginTop:1},UZ.default.createElement(V,{dimColor:!0},"Esc to cancel",(G==="yes"&&!U||G==="no"&&!X)&&" \xB7 Tab to amend"))))}var UZ,JN$;var usD=K(()=>{xH();l8();nU();e6();PI();UZ=b(s(),1),JN$=require("path")});function Nb({toolUseConfirm:H,toolUseContext:$,onDone:A,onReject:L,title:I,subtitle:D,question:B="Do you want to proceed?",content:f,completionType:E="tool_use_single",languageName:M="none",path:G,parseInput:U,operationType:X="write",ideDiffSupport:J,workerBadge:F}){let Q=gkA.useMemo(()=>({completion_type:E,language_name:M}),[E,M]);uz(H,Q);let W=gkA.useMemo(()=>{if(!G||X==="read")return null;let WH=xD(G),wH=zH(),{resolvedPath:QH,isSymlink:TH}=OU(wH,WH);if(TH)return QH;return null},[G,X]),P=jsD({filePath:G||"",completionType:E,languageName:M,toolUseConfirm:H,onDone:A,onReject:L,parseInput:U,operationType:X}),{options:C,acceptFeedback:Y,rejectFeedback:Z,setFocusedOption:q,handleInputModeToggle:O,focusedOption:j,yesInputMode:u,noInputMode:y}=P,g=U(H.input),h=J?J.getConfig(g):null,p=h?{onChange:(WH,wH)=>{let QH=J.applyChanges(g,wH.edits);P.onChange(WH,QH)},toolUseContext:$,filePath:h.filePath,edits:(h.edits||[]).map((WH)=>({old_string:WH.old_string,new_string:WH.new_string,replace_all:WH.replace_all||!1})),editMode:h.editMode||"single"}:{onChange:()=>{},toolUseContext:$,filePath:"",edits:[],editMode:"single"},{closeTabInIDE:d,showingDiffInIDE:k,ideName:n}=hsD(p),GH=(WH,wH)=>{d?.(),P.onChange(WH,g,wH?.trim())};if(k&&h&&G)return gz.default.createElement(ksD,{onChange:(WH,wH,QH)=>GH(WH,QH),options:C,filePath:G,input:g,ideName:n,symlinkTarget:W,rejectFeedback:Z,acceptFeedback:Y,setFocusedOption:q,onInputModeToggle:O,focusedOption:j,yesInputMode:u,noInputMode:y});let HH=W!=null&&gsD.relative(C$(),W).startsWith(".."),BH=W?gz.default.createElement(x,{paddingX:1,marginBottom:1},gz.default.createElement(V,{color:"warning"},HH?`This will modify ${W} (outside working directory) via a symlink`:`Symlink target: ${W}`)):null;return gz.default.createElement(gz.default.Fragment,null,gz.default.createElement(wG,{title:I,subtitle:D,innerPaddingX:0,workerBadge:F},BH,f,gz.default.createElement(x,{flexDirection:"column",paddingX:1},typeof B==="string"?gz.default.createElement(V,null,B):B,gz.default.createElement(QA,{options:C,inlineDescriptions:!0,onChange:(WH)=>{let wH=C.find((QH)=>QH.value===WH);if(wH){if(wH.option.type==="reject"){let QH=Z.trim();GH(wH.option,QH||void 0);return}if(wH.option.type==="accept-once"){let QH=Y.trim();GH(wH.option,QH||void 0);return}GH(wH.option)}},onCancel:()=>GH({type:"reject"}),onFocus:(WH)=>q(WH),onInputModeToggle:O}))),gz.default.createElement(x,{paddingX:1,marginTop:1},gz.default.createElement(V,{dimColor:!0},"Esc to cancel",(j==="yes"&&!u||j==="no"&&!y)&&" \xB7 Tab to amend")))}var gsD,gz,gkA;var gPH=K(()=>{xH();l8();Xw();W8H();RsD();bsD();usD();DL();PI();ZM();gsD=require("path"),gz=b(s(),1),gkA=b(s(),1)});function FN$(H,$,A,L){return{filePath:H,edits:[{old_string:$,new_string:A,replace_all:L}],editMode:"single"}}function dsD(H){let $=(f)=>{return S3.inputSchema.parse(f)},A=$(H.toolUseConfirm.input),{file_path:L,old_string:I,new_string:D,replace_all:B}=A;return mpH.default.createElement(Nb,{toolUseConfirm:H.toolUseConfirm,toolUseContext:H.toolUseContext,onDone:H.onDone,onReject:H.onReject,workerBadge:H.workerBadge,title:"Edit file",subtitle:psD.relative(C$(),L),question:mpH.default.createElement(V,null,"Do you want to make this edit to"," ",mpH.default.createElement(V,{bold:!0},msD.basename(L)),"?"),content:mpH.default.createElement(XN$,{file_path:L,edits:[{old_string:I,new_string:D,replace_all:B||!1}]}),path:L,completionType:"str_replace_single",languageName:Ie(L),parseInput:$,ideDiffSupport:Bq1})}var msD,mpH,psD,Bq1;var csD=K(()=>{xH();T9H();bkA();rD();gPH();PI();msD=require("path"),mpH=b(s(),1),psD=require("path"),Bq1={getConfig:(H)=>FN$(H.file_path,H.old_string,H.new_string,H.replace_all),applyChanges:(H,$)=>{let A=$[0];if(A)return{...H,old_string:A.old_string,new_string:A.new_string,replace_all:A.replace_all};return H}}});function Ue(H,{assistantMessage:{message:{id:$}}},A,L){pX({completion_type:H,event:A,metadata:{language_name:"none",message_id:$,platform:OA.platform,hasFeedback:L??!1}})}var mkA=K(()=>{Z1();Q8H()});function fq1(H){switch(H.length){case 0:return"";case 1:return hG.default.createElement(V,{bold:!0},H[0]);case 2:return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},H[0])," and ",hG.default.createElement(V,{bold:!0},H[1]));default:return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},H.slice(0,-1).join(", ")),", and"," ",hG.default.createElement(V,{bold:!0},H.slice(-1)[0]))}}function pkA(H){if(H.join(", ").length>50)return"similar";return fq1(H)}function ppH(H){if(H.length===0)return"";let $=H.map((A)=>A.split("/").pop()||A);if($.length===1)return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},$[0]),Xe.sep);if($.length===2)return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},$[0]),Xe.sep," and ",hG.default.createElement(V,{bold:!0},$[1]),Xe.sep);return hG.default.createElement(V,null,hG.default.createElement(V,{bold:!0},$[0]),Xe.sep,", ",hG.default.createElement(V,{bold:!0},$[1]),Xe.sep," and ",H.length-2," more")}function Eq1(H){let $=H.filter((G)=>G.type==="addRules").flatMap((G)=>G.rules||[]),A=$.filter((G)=>G.toolName==="Read"),L=$.filter((G)=>G.toolName==="Bash"),I=H.filter((G)=>G.type==="addDirectories").flatMap((G)=>G.directories||[]),D=A.map((G)=>G.ruleContent?.replace("/**","")||"").filter((G)=>G),B=[...new Set(L.flatMap((G)=>{if(!G.ruleContent)return[];let U=PbA(G.ruleContent)??G.ruleContent,{commandWithoutRedirections:X,redirections:J}=Wj(U);return J.length>0?X:U}))],f=I.length>0,E=D.length>0,M=B.length>0;if(E&&!f&&!M){if(D.length===1){let G=D[0],U=G.split("/").pop()||G;return hG.default.createElement(V,null,"Yes, allow reading from ",hG.default.createElement(V,{bold:!0},U),Xe.sep," from this project")}return hG.default.createElement(V,null,"Yes, allow reading from ",ppH(D)," from this project")}if(f&&!E&&!M){if(I.length===1){let G=I[0],U=G.split("/").pop()||G;return hG.default.createElement(V,null,"Yes, and always allow access to ",hG.default.createElement(V,{bold:!0},U),Xe.sep," from this project")}return hG.default.createElement(V,null,"Yes, and always allow access to ",ppH(I)," from this project")}if(M&&!f&&!E)return hG.default.createElement(V,null,"Yes, and don't ask again for ",pkA(B)," commands in"," ",hG.default.createElement(V,{bold:!0},zL()));if((f||E)&&!M){let G=[...I,...D];if(f&&E)return hG.default.createElement(V,null,"Yes, and always allow access to ",ppH(G)," from this project")}if((f||E)&&M){let G=[...I,...D];if(G.length===1&&B.length===1)return hG.default.createElement(V,null,"Yes, and allow access to ",ppH(G)," and"," ",pkA(B)," commands");return hG.default.createElement(V,null,"Yes, and allow ",ppH(G)," access and"," ",pkA(B)," commands")}return null}function lsD({suggestions:H=[],decisionReason:$,onRejectFeedbackChange:A,onAcceptFeedbackChange:L,onClassifierDescriptionChange:I,classifierDescription:D,initialClassifierDescriptionEmpty:B=!1,existingAllowDescriptions:f=[],yesInputMode:E=!1,noInputMode:M=!1}){let G=[];if(E)G.push({type:"input",label:"Yes",value:"yes",placeholder:"and tell Claude what to do next",onChange:L,allowEmptySubmitToCancel:!0});else G.push({label:"Yes",value:"yes"});if(sR()){if(H.length>0){let U=Eq1(H);if(U)G.push({label:U,value:"yes-apply-suggestions"})}}if(M)G.push({type:"input",label:"No",value:"no",placeholder:"and tell Claude what to do differently",onChange:A,allowEmptySubmitToCancel:!0});else G.push({label:"No",value:"no"});return G}var hG,Xe;var isD=K(()=>{xH();g$();Rh();g3();_q();hG=b(s(),1),Xe=b(require("path"))});function nsD(H){switch(H.type){case"rule":return`${oH.bold(X8(H.rule.ruleValue))} rule from ${utH(H.rule.source)}`;case"mode":return`${vk(H.mode)} mode`;case"sandboxOverride":return"Requires permission to bypass sandbox";case"workingDir":return H.reason;case"other":return H.reason;case"permissionPromptTool":return`${oH.bold(H.permissionPromptToolName)} permission prompt tool`;case"hook":return H.reason?`${oH.bold(H.hookName)} hook: ${H.reason}`:`${oH.bold(H.hookName)} hook`;case"asyncAgent":return H.reason}}function Mq1({title:H,decisionReason:$}){let[A]=_I();function L(){switch($.type){case"subcommandResults":return JB.default.createElement(x,{flexDirection:"column"},Array.from($.reasons.entries()).map(([I,D])=>{let B=D.behavior==="allow"?ZL("success",A)(pH.tick):ZL("error",A)(pH.cross);return JB.default.createElement(x,{flexDirection:"column",key:I},JB.default.createElement(V,null,B," ",I),D.decisionReason!==void 0&&D.decisionReason.type!=="subcommandResults"&&JB.default.createElement(V,null," ","\u23BF"," ",JB.default.createElement(m9,null,nsD(D.decisionReason))),D.behavior==="ask"&&(()=>{let f=jAH(D.suggestions);return f.length>0?JB.default.createElement(V,null," ","\u23BF"," ","Suggested rules:"," ",JB.default.createElement(m9,null,f.map((E)=>oH.bold(X8(E))).join(", "))):null})())}));default:return JB.default.createElement(V,null,JB.default.createElement(m9,null,nsD($)))}}return JB.default.createElement(x,{flexDirection:"column"},H&&JB.default.createElement(V,null,H),L())}function Gq1(H){if(!H)return[];return H.flatMap(($)=>{switch($.type){case"addDirectories":return $.directories;default:return[]}})}function Uq1(H){if(!H)return;for(let $=H.length-1;$>=0;$--){let A=H[$];if(A?.type==="setMode")return A.mode}return}function Xq1({suggestions:H,width:$}){if(!H||H.length===0)return JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0},"Suggestions ")),JB.default.createElement(V,null,"None"));let A=jAH(H),L=Gq1(H),I=Uq1(H);if(A.length===0&&L.length===0&&!I)return JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0},"Suggestion ")),JB.default.createElement(V,null,"None"));return JB.default.createElement(x,{flexDirection:"column"},JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0},"Suggestions ")),JB.default.createElement(V,null," ")),A.length>0&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0}," Rules ")),JB.default.createElement(x,{flexDirection:"column"},A.map((D,B)=>JB.default.createElement(V,{key:B},pH.bullet," ",X8(D))))),L.length>0&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0}," Directories ")),JB.default.createElement(x,{flexDirection:"column"},L.map((D,B)=>JB.default.createElement(V,{key:B},pH.bullet," ",D)))),I&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:$},JB.default.createElement(V,{dimColor:!0}," Mode ")),JB.default.createElement(V,null,vk(I))))}function asD({permissionResult:H,toolName:$}){let A=J$((f)=>f.toolPermissionContext),L=H.decisionReason,I="suggestions"in H?H.suggestions:void 0,D=rsD.useMemo(()=>{let f=vL.isSandboxingEnabled()&&vL.isAutoAllowBashIfSandboxedEnabled(),E=XFH(A,{sandboxAutoAllowEnabled:f}),M=jAH(I);if(M.length>0)return E.filter((G)=>M.some((U)=>U.toolName===G.rule.ruleValue.toolName&&U.ruleContent===G.rule.ruleValue.ruleContent));if($)return E.filter((G)=>G.rule.ruleValue.toolName===$);return E},[A,$,I]),B=10;return JB.default.createElement(x,{flexDirection:"column"},JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:10},JB.default.createElement(V,{dimColor:!0},"Behavior ")),JB.default.createElement(V,null,H.behavior)),H.behavior!=="allow"&&JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:10},JB.default.createElement(V,{dimColor:!0},"Message ")),JB.default.createElement(V,null,H.message)),JB.default.createElement(x,{flexDirection:"row"},JB.default.createElement(x,{justifyContent:"flex-end",minWidth:10},JB.default.createElement(V,{dimColor:!0},"Reason ")),L===void 0?JB.default.createElement(V,null,"undefined"):JB.default.createElement(Mq1,{decisionReason:L})),JB.default.createElement(Xq1,{suggestions:I,width:10}),D.length>0&&JB.default.createElement(x,{flexDirection:"column",marginTop:1},JB.default.createElement(V,{color:"warning"},pH.warning," Unreachable Rules (",D.length,")"),D.map((f,E)=>JB.default.createElement(x,{key:E,flexDirection:"column",marginLeft:2},JB.default.createElement(V,{color:"warning"},X8(f.rule.ruleValue)),JB.default.createElement(V,{dimColor:!0}," ",f.reason),JB.default.createElement(V,{dimColor:!0}," ","Fix: ",f.fix)))))}var JB,rsD;var osD=K(()=>{xH();r0();jI();yW();C5();W4();pL();Z4$();EM();JB=b(s(),1),rsD=b(s(),1)});function Jq1(H,$){if(!H)return null;switch(H.type){case"rule":return{reasonString:`Permission rule ${oH.bold(X8(H.rule.ruleValue))} requires confirmation for this ${$}.`,configString:H.rule.source==="policySettings"?void 0:"/permissions to update rules"};case"hook":{let A=H.reason?`: `)[0]??null,fileContent:M})),(X)=>B4.createElement(V,{dimColor:!0,key:`ellipsis-${X}`},"...")):B4.createElement(IC,{code:A,filePath:L==="markdown"?"file.md":H})))}var B4,rpH,PeD;var YeD=K(()=>{Zt();xH();PI();q9H();tg();rD();nM();DL();lY$();B4=b(s(),1),rpH=b(s(),1),PeD=require("path")});function weD(H){let $=(E)=>{let M=up.inputSchema.safeParse(E);if(!M.success)return r(Error(`Failed to parse notebook edit input: ${M.error.message}`)),{notebook_path:"",new_source:"",cell_id:""};return M.data},A=$(H.toolUseConfirm.input),{notebook_path:L,edit_mode:I,cell_type:D}=A,B=D==="markdown"?"markdown":"python",f=I==="insert"?"insert this cell into":I==="delete"?"delete this cell from":"make this edit to";return apH.default.createElement(Nb,{toolUseConfirm:H.toolUseConfirm,toolUseContext:H.toolUseContext,onDone:H.onDone,onReject:H.onReject,workerBadge:H.workerBadge,title:"Edit notebook",question:apH.default.createElement(V,null,"Do you want to ",f," ",apH.default.createElement(V,{bold:!0},CeD.basename(L)),"?"),content:apH.default.createElement(_eD,{notebook_path:A.notebook_path,cell_id:A.cell_id,new_source:A.new_source,cell_type:A.cell_type,edit_mode:A.edit_mode,verbose:H.verbose,width:H.verbose?120:80}),path:L,completionType:"tool_use_single",languageName:B,parseInput:$})}var CeD,apH;var ZeD=K(()=>{xH();hkH();YeD();gPH();_$();CeD=require("path"),apH=b(s(),1)});function YN$(H="claude-prompt",$=".md"){let A=zeD.randomUUID();return qeD.join(TeD.tmpdir(),`${H}-${A}${$}`)}var qeD,TeD,zeD;var rkA=K(()=>{qeD=require("path"),TeD=require("os"),zeD=require("crypto")});function kq1(H){let $=H.split(" ")[0]??"";return bq1.some((A)=>$.includes(A))}function akA(H){let $=zH(),A=qO.get(process.stdout);if(!A)throw Error("Ink instance not found - cannot pause rendering");let L=Bj();if(!L)return{content:null};if(!$.existsSync(H))return{content:null};let I=!kq1(L);try{if(A.pause(),A.suspendStdin(),I)process.stdout.write("\x1B[?1049h\x1B[?1004l\x1B[0m\x1B[?25h\x1B[2J\x1B[H");let D=hq1[L]??L;return SN(`${D} "${H}"`,{stdio:"inherit"}),{content:$.readFileSync(H,{encoding:"utf-8"})}}catch(D){if(typeof D==="object"&&D!==null&&"status"in D&&typeof D.status==="number"){let B=D.status;if(B!==0)return{content:null,error:`${PX(L)} exited with code ${B}`}}return{content:null}}finally{if(I)process.stdout.write("\x1B[?1049l\x1B[?1004h\x1B[?25l");A.resumeStdin(),A.resume()}}function uq1(H,$){let A=IFH(H),L=H;for(let I=A.length-1;I>=0;I--){let D=A[I],B=$[D.id];if(B&&B.type==="text"){let f=L.lastIndexOf(D.match);if(f!==-1)L=L.slice(0,f)+B.content+L.slice(f+D.match.length)}}return L}function gq1(H,$,A){let L=H;for(let[I,D]of Object.entries(A))if(D.type==="text"){let B=parseInt(I),f=D.content,E=L.indexOf(f);if(E!==-1){let M=LFH(f),G=D4$(B,M);L=L.slice(0,E)+G+L.slice(E+f.length)}}return L}function dPH(H,$){let A=zH(),L=YN$();try{let I=$?uq1(H,$):H;iL(L,I,{encoding:"utf-8",flush:!0});let D=akA(L);if(D.content===null)return D;let B=D.content;if(B.endsWith(` `)}`;if(D)c("tengu_ask_user_question_respond_to_claude",{source:D,questionCount:I.length,isInPlanMode:J,interviewPhaseEnabled:J&&c5()});let QH=await ekA(U);$(),H.onReject(wH,QH&&QH.length>0?QH:void 0)},[I,P,$,H,D,J,U]),n=qj.useCallback(async()=>{let wH=`The user has indicated they have provided enough answers for the plan interview. `)}`;if(D)c("tengu_ask_user_question_finish_plan_interview",{source:D,questionCount:I.length,isInPlanMode:J,interviewPhaseEnabled:J&&c5()});let QH=await ekA(U);$(),H.onReject(wH,QH&&QH.length>0?QH:void 0)},[I,P,$,H,D,J,U]),GH=qj.useCallback(async(WH)=>{if(D)c("tengu_ask_user_question_accepted",{source:D,questionCount:I.length,answerCount:Object.keys(WH).length,isInPlanMode:J,interviewPhaseEnabled:J&&c5()});let wH={...H.input,answers:WH},QH=await ekA(U);$(),H.onAllow(wH,[],void 0,QH&&QH.length>0?QH:void 0)},[H,$,D,I.length,J,U]),HH=qj.useCallback((WH,wH,QH,TH=!0)=>{let t,IH=Array.isArray(wH);if(IH)t=wH.join(", ");else if(QH)t=Object.values(B[WH]??{}).filter((CH)=>CH.type==="image").length>0?`${QH} (Image attached)`:QH;else if(wH==="__other__")t=Object.values(B[WH]??{}).filter((CH)=>CH.type==="image").length>0?"(Image attached)":wH;else t=wH;let KH=I.length===1;if(!IH&&KH&&TH){let MH={...P,[WH]:t};GH(MH).catch(r);return}j(WH,t,TH)},[j,I.length,P,GH,B]);function BH(WH){if(WH==="cancel"){d();return}if(WH==="submit")GH(P).catch(r)}if(WL((WH,wH)=>{if(Y&&!g)return;if((wH.leftArrow||wH.shift&&wH.tab)&&W>0)q();let QH=p?(I?.length||1)-1:I?.length||0;if((wH.rightArrow||wH.tab&&!wH.shift)&&WM(y.question,WH,wH,QH,TH,t),pastedContents:B[y.question]??{},onRemoveImage:(WH)=>G(y.question,WH)});if(g)return HuA.default.createElement(keD,{questions:I,currentQuestionIndex:W,answers:P,allQuestionsAnswered:h,permissionResult:H.permissionResult,onFinalResponse:BH});return null}async function ekA(H){if(H.length===0)return;return Promise.all(H.map(async($)=>{let A={type:"image",source:{type:"base64",media_type:$.mediaType||"image/png",data:$.content}};return(await HDH(A)).block}))}var HuA,qj;var meD=K(()=>{xH();bC$();yeD();beD();ueD();z$();pL();gQ();b9H();LT();gr();_$();HuA=b(s(),1),qj=b(s(),1)});function cq1(H){switch(H){case S3:return dsD;case h3:return JeD;case aD:return feD;case IW:return WeD;case up:return weD;case DW:return NeD;case MuH:return OeD;case Xt:return SeD;case hC$:return geD;case rr:case og:case k8:return KeD;default:return WN$}}function lq1(H){let $=H.tool.userFacingName(H.input);if(H.tool===DW)return"Claude Code needs your approval for the plan";if(H.tool===MuH)return"Claude Code wants to enter plan mode";if(!$||$.trim()==="")return"Claude Code needs your attention";return`Claude needs your permission to use ${$}`}function peD({toolUseConfirm:H,toolUseContext:$,onDone:A,onReject:L,verbose:I,workerBadge:D}){BA("app:interrupt",()=>{A(),L(),H.onReject()},{context:"Confirmation"});let B=lq1(H);VN$(B,"permission_prompt");let f=cq1(H.tool);return $uA.createElement(f,{toolUseContext:$,toolUseConfirm:H,onDone:A,onReject:L,verbose:I,workerBadge:D})}var $uA;var deD=K(()=>{$I();T9H();ht();zQ();csD();EeD();ckA();ikA();FeD();QeD();hkH();aSH();xFH();bw();s6H();VeD();ZeD();BuH();tkA();azA();xeD();XY$();jeD();bC$();meD();$uA=b(s(),1)});function ZN$(H){if("oneOf"in H)return H.oneOf.map(($)=>$.const);if("enum"in H)return H.enum;return[]}function AuA(H){if("oneOf"in H)return H.oneOf.map(($)=>$.title);if("enum"in H)return("enumNames"in H?H.enumNames:void 0)??H.enum;return[]}function ceD(H,$){let A=ZN$(H).indexOf($);return A>=0?AuA(H)[A]??$:$}function nq1(H){if(cPH(H)){let[$,...A]=ZN$(H);if(!$)return S.never();return S.enum([$,...A])}if(H.type==="string"){let $=S.string();if(H.minLength!==void 0)$=$.min(H.minLength,{message:`Must be at least ${H.minLength} character${H.minLength===1?"":"s"}`});if(H.maxLength!==void 0)$=$.max(H.maxLength,{message:`Must be at most ${H.maxLength} character${H.maxLength===1?"":"s"}`});switch(H.format){case"email":$=$.email({message:"Please enter a valid email address"});break;case"uri":$=$.url({message:"Please enter a valid URI"});break;case"date":$=$.date("Please enter a valid date (YYYY-MM-DD)");break;case"date-time":$=$.datetime({offset:!0,message:"Please enter a valid date-time (YYYY-MM-DDTHH:MM:SSZ)"});break;default:break}return $}if(H.type==="number"||H.type==="integer"){let $=S.coerce.number();if(H.type==="integer")$=$.int();if(H.minimum!==void 0)$=$.min(H.minimum,{message:`Must be at least ${H.minimum}`});if(H.maximum!==void 0)$=$.max(H.maximum,{message:`Must be at most ${H.maximum}`});return $}if(H.type==="boolean")return S.coerce.boolean();throw Error(`Unsupported schema: ${yH(H)}`)}function LuA(H,$){let L=nq1($).safeParse(H);if(L.success)return{value:L.data,isValid:!0};return{isValid:!1,error:L.error.issues.map((I)=>I.message).join("; ")}}function leD(H){if(H.type==="string"){if(!rq1(H))return;let{description:$,example:A}=iq1[H.format]||{};return`${$}, e.g. ${A}`}if(H.type==="number"||H.type==="integer"){let $=H.type==="integer",A=(L)=>Number.isInteger(L)&&!$?`${L}.0`:String(L);if(H.minimum!==void 0&&H.maximum!==void 0)return`(${H.type} between ${A(H.minimum)} and ${A(H.maximum)})`;else if(H.minimum!==void 0)return`(${H.type} >= ${A(H.minimum)})`;else if(H.maximum!==void 0)return`(${H.type} <= ${A(H.maximum)})`;else{let L=H.type==="integer"?"42":"3.14";return`(${H.type}, e.g. ${L})`}}return}var iq1,cPH=(H)=>{return H.type==="string"&&(("enum"in H)||("oneOf"in H))},rq1=(H)=>{return H.type==="string"&&"format"in H&&typeof H.format==="string"};var ieD=K(()=>{mI();Z$();iq1={email:{description:"email address",example:"user@example.com"},uri:{description:"URI",example:"https://example.com"},date:{description:"date",example:"2024-03-15"},"date-time":{description:"date-time",example:"2024-03-15T14:30:00Z"}}});function qN$(){return Y9.default.createElement(V,{italic:!0,dimColor:!0},"")}function reD({serverName:H,request:$,onResponse:A,signal:L}){let{message:I,requestedSchema:D}=$,[B,f]=dz.useState(null),[E,M]=dz.useState(()=>{let QH={};if(D.properties){for(let[TH,t]of Object.entries(D.properties))if(typeof t==="object"&&t!==null){if(t.default!==void 0)QH[TH]=t.default}}return QH}),[G,U]=dz.useState(()=>{let QH={};for(let[TH,t]of Object.entries(D.properties))if(neD(t)&&t?.default!==void 0){let IH=LuA(String(t.default),t);if(!IH.isValid&&IH.error)QH[TH]=IH.error}return QH});dz.useEffect(()=>{if(!L)return;let QH=()=>{A("cancel")};if(L.aborted){QH();return}return L.addEventListener("abort",QH),()=>{L.removeEventListener("abort",QH)}},[L,A]);let X=dz.useMemo(()=>{let QH=D.required??[];return Object.entries(D.properties).map(([TH,t])=>({name:TH,schema:t,isRequired:QH.includes(TH)}))},[D]),[J,F]=dz.useState(0),[Q,W]=dz.useState(),[P,C]=dz.useState(""),[Y,Z]=dz.useState(0),{columns:q}=QL(),O=J!==void 0?X[J]:void 0,j=O&&neD(O.schema);FY("elicitation"),VN$("Claude Code needs your input","elicitation_dialog");function u(QH){let TH=X.length+2,t=J??(B==="accept"?X.length:B==="decline"?X.length+1:void 0),IH=t!==void 0?(t+(QH==="up"?TH-1:1))%TH:0;if(IH{let IH={...t};if(TH===void 0)delete IH[QH];else IH[QH]=TH;return IH})}function g(QH,TH){U((t)=>{let IH={...t};if(TH)IH[QH]=TH;else delete IH[QH];return IH})}function h(QH){if(!QH)return;y(QH,void 0),g(QH),W(void 0),C(""),Z(0)}function p(QH){if(!O)return;if(QH.trim()===""&&(O.schema.type!=="string"||("format"in O.schema)&&O.schema.format!==void 0)){h(O.name),u("down");return}let t=LuA(QH,O.schema);y(O.name,t.isValid?t.value:QH),g(O.name,t.isValid?void 0:t.error),W(void 0),C(""),Z(0),u("down")}function d(){if(!O)return;W(void 0),C(""),Z(0)}let k=O!==void 0&&Q===O.name,n=k&&j&&!cPH(O?.schema);BA("confirm:no",()=>{d()},{context:"Settings",isActive:n}),WL((QH,TH)=>{if(k&&cPH(O?.schema))return;if(k&&j)return;if(TH.return&&B==="accept"){if(GH()&&Object.keys(G).length===0)A("accept",E);return}if(TH.return&&B==="decline"){A("decline");return}if(TH.upArrow||TH.downArrow){u(TH.upArrow?"up":"down");return}if(O){let{schema:t,name:IH,isRequired:KH}=O,MH=E[IH];if(TH.backspace&&!KH){h(O.name);return}if(TH.return){if(t.type==="boolean"){y(IH,!(MH??!1)),u("down");return}if(W(IH),j){let CH=MH!==void 0?String(MH):"";C(CH),Z(CH.length)}}}},{isActive:!0});let GH=()=>{let QH=D.required||[];for(let TH of QH){let t=E[TH];if(t===void 0||t===null||t==="")return!1}return!0},HH=()=>{if(!X.length)return null;return Y9.default.createElement(x,{flexDirection:"column",gap:1},X.map((QH,TH)=>{let{name:t,schema:IH,isRequired:KH}=QH,MH=TH===J&&!B,CH=E[t],OH=(()=>{if(!MH||Q!==void 0)return null;let e=IH.type==="boolean"?"toggle":cPH(IH)?"select":"edit",DH=CH===void 0||KH?`(Press Enter to ${e})`:`(Press Enter to ${e}, Backspace to unset)`;return Y9.default.createElement(V,{dimColor:!0}," ",DH)})(),LH=(e,DH)=>{return Y9.default.createElement(x,{key:t,flexDirection:"column"},Y9.default.createElement(x,{gap:1,paddingLeft:MH?0:2},MH&&Y9.default.createElement(V,{color:"success"},pH.pointer),Y9.default.createElement(x,{flexGrow:1,flexDirection:"column"},e,IH.description&&Y9.default.createElement(x,{marginLeft:2},Y9.default.createElement(V,{dimColor:!0},IH.description)),DH&&Y9.default.createElement(x,{marginLeft:2},Y9.default.createElement(V,{color:"error",bold:!0},pH.warning," ",DH)))))};if(cPH(IH)){let e=ZN$(IH),DH=AuA(IH),EH=e.map(($H,FH)=>({label:DH[FH]??$H,value:$H}));if(MH&&Q===t)return Y9.default.createElement(x,{key:t,flexDirection:"column"},Y9.default.createElement(V,{color:"success"},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),IH.description&&Y9.default.createElement(V,{dimColor:!0}," - ",IH.description)),Y9.default.createElement(QA,{options:EH,defaultValue:CH!==void 0?CH:IH.default??e[0],onChange:($H)=>{y(t,$H),W(void 0),u("down")},onCancel:()=>{W(void 0)}}));else{let $H=CH!==void 0?ceD(IH,CH):Y9.default.createElement(qN$,null);return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),": ",$H,OH))}}else if(IH.type==="boolean")return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":"," ",CH!==void 0?CH?`${pH.tick} Yes`:`${pH.cross} No`:Y9.default.createElement(qN$,null),OH));else if(j){let e=G[t];if(MH&&Q===t){let DH=leD(IH);return LH(Y9.default.createElement(x,{flexDirection:"column"},Y9.default.createElement(V,{color:"success"},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":",DH&&Y9.default.createElement(V,{dimColor:!0},` ${DH}`)),Y9.default.createElement(x,{marginLeft:2},Y9.default.createElement(W9,{value:P,onChange:C,onSubmit:p,onExit:d,placeholder:`Enter ${IH.type}\u2026`,columns:Math.min(q-6,80),cursorOffset:Y,onChangeCursorOffset:Z,focus:!0,showCursor:!0,multiline:IH.type==="string"}))))}return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":"," ",CH===void 0?Y9.default.createElement(qN$,null):String(CH),OH),e)}else return LH(Y9.default.createElement(V,{color:MH?"success":void 0},IH.title||t,KH&&Y9.default.createElement(V,{color:"error"},"*"),":"," ",CH===void 0?Y9.default.createElement(qN$,null):String(CH),OH))}))},BH=(QH)=>{return D.properties[QH]?.title??QH},WH=Object.keys(G),wH=(D.required||[]).filter((QH)=>E[QH]===void 0);return Y9.default.createElement(BL,{title:`MCP Server "${H}" requests your input`,subtitle:I,color:"permission",onCancel:()=>A("cancel"),isCancelActive:!n,hideInputGuide:!0},HH(),X.length>0&&Y9.default.createElement(x,{flexDirection:"column",gap:1},wH.length>0&&Y9.default.createElement(V,{color:"error"},pH.warning," Missing required fields:"," ",wH.map(BH).join(", ")),WH.length>0&&Y9.default.createElement(V,{color:"error"},pH.warning," Validation errors in:"," ",WH.map(BH).join(", ")),Y9.default.createElement(V,{bold:!0,color:B==="accept"?"success":void 0,inverse:B==="accept"},"Accept"),Y9.default.createElement(V,{bold:!0,color:B==="decline"?"error":void 0,inverse:B==="decline"},"Decline"),Y9.default.createElement(V,{dimColor:!0},Y9.default.createElement(rA,null,Y9.default.createElement(s$,{shortcut:"\u2191\u2193",action:"navigate"}),Y9.default.createElement(s$,{shortcut:"Enter",action:"edit"}),Y9.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel / go back"})))))}var Y9,dz,neD=(H)=>["string","number","integer"].includes(H.type);var aeD=K(()=>{xH();$I();jI();ikA();N1();eB();bB();lB();j0();ieD();S5();OB();Dx();Y9=b(s(),1),dz=b(s(),1)});function oeD(H){return`${lPH.major(H,{loose:!0})}.${lPH.minor(H,{loose:!0})}.${lPH.patch(H,{loose:!0})}`}function TN$(H,$={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION){let[A,L]=teD.useState(()=>oeD($));if(!H)return null;let I=oeD(H);if(I!==A)return L(I),I;return null}var teD,lPH;var IuA=K(()=>{teD=b(s(),1),lPH=b(OO(),1)});function eeD({isUpdating:H,onChangeIsUpdating:$,onAutoUpdaterResult:A,autoUpdaterResult:L,showSuccessMessage:I,verbose:D}){let[B,f]=zN$.useState({}),E=TN$(L?.version),M=_f.useCallback(async()=>{if(H)return;let G={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,U=GB()?.autoUpdatesChannel??"latest",X=await Q1H(U),J=Nd();if(f({global:G,latest:X}),!J&&G&&X&&!seD.gte(G,X,{loose:!0})&&!JVH(X)){let F=Date.now();$(!0);let Q=M$();if(Q.installMethod!=="native")await ggH();let W=await Lb();if(N(`AutoUpdater: Detected installation type: ${W}`),W==="development"){N("AutoUpdater: Cannot auto-update development build"),$(!1);return}let P,C;if(W==="npm-local")N("AutoUpdater: Using local update method"),C="local",P=await jgH(U);else if(W==="npm-global")N("AutoUpdater: Using global update method"),C="global",P=await vgH();else if(W==="native"){N("AutoUpdater: Unexpected native installation in non-native updater"),$(!1);return}else{N("AutoUpdater: Unknown installation type, falling back to config");let Y=Q.installMethod==="local";if(C=Y?"local":"global",Y)P=await jgH(U);else P=await vgH()}if($(!1),P==="success")c("tengu_auto_updater_success",{fromVersion:G,toVersion:X,durationMs:Date.now()-F,wasMigrated:C==="local",installationType:W});else c("tengu_auto_updater_fail",{fromVersion:G,attemptedVersion:X,status:P,durationMs:Date.now()-F,wasMigrated:C==="local",installationType:W});A({version:X,status:P})}},[A]);if(zN$.useEffect(()=>{M()},[M]),VF(M,1800000),!L?.version&&(!B.global||!B.latest))return null;if(!L?.version&&!H)return null;return _f.createElement(x,{flexDirection:"row",gap:1},D&&_f.createElement(V,{dimColor:!0},"globalVersion: ",B.global," \xB7 latestVersion:"," ",B.latest),H?_f.createElement(_f.Fragment,null,_f.createElement(x,null,_f.createElement(V,{color:"text",dimColor:!0,wrap:"end"},"Auto-updating\u2026"))):L?.status==="success"&&I&&E&&_f.createElement(V,{color:"success"},"\u2713 Update installed \xB7 Restart to apply"),(L?.status==="install_failed"||L?.status==="no_permissions")&&_f.createElement(V,{color:"error"},"\u2717 Auto-update failed \xB7 Try ",_f.createElement(V,{bold:!0},"claude doctor"),!Ms()&&_f.createElement(_f.Fragment,null," ","or ",_f.createElement(V,{bold:!0},"npm i -g ",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL)),Ms()&&_f.createElement(_f.Fragment,null," ","or"," ",_f.createElement(V,{bold:!0},"cd ~/.claude/local && npm update ",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL))))}var _f,seD,zN$;var HHB=K(()=>{xH();vA();Us();F1H();Lj();s6();z$();IuA();Ib();E$();mL();_f=b(s(),1),seD=b(OO(),1),zN$=b(s(),1)});function aq1(H){if(H.includes("timeout"))return"timeout";if(H.includes("Checksum mismatch"))return"checksum_mismatch";if(H.includes("ENOENT")||H.includes("not found"))return"not_found";if(H.includes("EACCES")||H.includes("permission"))return"permission_denied";if(H.includes("ENOSPC"))return"disk_full";if(H.includes("npm"))return"npm_error";if(H.includes("network")||H.includes("ECONNREFUSED")||H.includes("ENOTFOUND"))return"network_error";return"unknown"}function $HB({isUpdating:H,onChangeIsUpdating:$,onAutoUpdaterResult:A,autoUpdaterResult:L,showSuccessMessage:I,verbose:D}){let[B,f]=NN$.useState({}),E=TN$(L?.version),M=cK.useRef(!1),G=GB()?.autoUpdatesChannel??"latest",U=cK.useCallback(async()=>{if(H||Nd())return;$(!0);let X=Date.now();c("tengu_native_auto_updater_start",{});try{let J=await fd(G),F={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,Q=Date.now()-X;if(J.lockFailed){c("tengu_native_auto_updater_lock_contention",{latency_ms:Q});return}if(f({current:F,latest:J.latestVersion}),J.wasUpdated)c("tengu_native_auto_updater_success",{latency_ms:Q}),A({version:J.latestVersion,status:"success"});else c("tengu_native_auto_updater_up_to_date",{latency_ms:Q})}catch(J){let F=Date.now()-X,Q=J instanceof Error?J.message:String(J);r(J instanceof Error?J:Error(String(J)));let W=aq1(Q);c("tengu_native_auto_updater_fail",{latency_ms:F,error_timeout:W==="timeout",error_checksum:W==="checksum_mismatch",error_not_found:W==="not_found",error_permission:W==="permission_denied",error_disk_full:W==="disk_full",error_npm:W==="npm_error",error_network:W==="network_error"}),A({version:null,status:"install_failed"})}finally{$(!1)}},[H,$,A]);if(NN$.useEffect(()=>{if(!M.current)M.current=!0,U()}),VF(U,1800000),!L?.version&&(!B.current||!B.latest))return null;if(!L?.version&&!H)return null;return cK.createElement(x,{flexDirection:"row",gap:1},D&&cK.createElement(V,{dimColor:!0},"current: ",B.current," \xB7 ",G,": ",B.latest),H?cK.createElement(x,null,cK.createElement(V,{dimColor:!0,wrap:"end"},"Checking for updates")):L?.status==="success"&&I&&E&&cK.createElement(V,{color:"success"},"\u2713 Update installed \xB7 Restart to update"),L?.status==="install_failed"&&cK.createElement(V,{color:"error"},"\u2717 Auto-update failed \xB7 Try ",cK.createElement(V,{bold:!0},"/status")))}var cK,NN$;var AHB=K(()=>{xH();vA();Lj();s6();z$();_$();IuA();mL();cK=b(s(),1),NN$=b(s(),1)});function IHB({verbose:H}){let[$,A]=DuA.useState(!1),[L,I]=DuA.useState("unknown"),D=o3.useCallback(async()=>{if(Nd())return;let[f,E]=await Promise.all([Promise.resolve(GB()?.autoUpdatesChannel??"latest"),FVH()]);I(E);let M=await tZ$(f),G=M&&!LHB.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,M,{loose:!0})&&!JVH(M);if(A(!!G),G)N(`PackageManagerAutoUpdater: Update available ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} -> ${M}`)},[]);if(o3.useEffect(()=>{D()},[D]),VF(D,1800000),!$)return null;let B=L==="homebrew"?"brew upgrade claude-code":L==="winget"?"winget upgrade Anthropic.ClaudeCode":L==="apk"?"apk upgrade claude-code":"your package manager update command";return o3.createElement(o3.Fragment,null,H&&o3.createElement(V,{dimColor:!0},"currentVersion: ",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION),o3.createElement(V,{color:"warning"},"Update available! Run: ",o3.createElement(V,{bold:!0},B)))}var o3,LHB,DuA;var DHB=K(()=>{xH();Us();s6();E$();Lq$();vA();mL();o3=b(s(),1),LHB=b(OO(),1),DuA=b(s(),1)});async function ON$(){let H=process.argv.includes("-p")||process.argv.includes("--print");if(!await HkA("auto_migrate_to_native",!1))return!1;if(A$(!1)||!1||H||A$(process.env.DISABLE_AUTO_MIGRATE_TO_NATIVE))return!1;if(M$().installMethod==="native")return!1;return!0}async function BHB(){c("tengu_auto_migrate_to_native_attempt",{});try{let H=GB()?.autoUpdatesChannel??"latest",$=await fd(H),A=[];if($.latestVersion){c("tengu_auto_migrate_to_native_success",{}),N("\u2705 Upgraded to native installation. Future sessions will use the native version.");let{removed:I,errors:D,warnings:B}=await pgH(),f=[];if(D.length>0)D.forEach((G)=>{f.push({message:G,userActionRequired:!1,type:"error"})});if(B.length>0)B.forEach((G)=>{f.push({message:G,userActionRequired:!1,type:"info"})});if(I>0)f.push({message:`Cleaned up ${I} old npm installation(s)`,userActionRequired:!1,type:"info"});let E=mgH();A=[...await Db(!0),...E,...f]}else c("tengu_auto_migrate_to_native_partial",{}),N("\u26A0\uFE0F Native installation setup encountered issues but cleanup completed."),A=await Db(!0);let L=[];if(A.length>0){let I=A.filter((D)=>D.userActionRequired);if(I.length>0){let D=["\u26A0\uFE0F Manual action required after migration to native installer:",...I.map((B)=>`\u2022 ${B.message}`)].join(` `)D.setOffset(F-1);$.current={mode:"NORMAL",command:{type:"idle"}},L("NORMAL"),B?.("NORMAL")},[B,D,H.value]);function M(J,F=!1){return{cursor:J,text:H.value,setText:(Q)=>H.onChange(Q),setOffset:(Q)=>D.setOffset(Q),enterInsert:(Q)=>f(Q),getRegister:()=>I.current.register,setRegister:(Q,W)=>{I.current.register=Q,I.current.registerIsLinewise=W},getLastFind:()=>I.current.lastFind,setLastFind:(Q,W)=>{I.current.lastFind={type:Q,char:W}},recordChange:F?()=>{}:(Q)=>{I.current.lastChange=Q}}}function G(){let J=I.current.lastChange;if(!J)return;let F=o0.fromText(H.value,H.columns,D.offset),Q=M(F,!0);switch(J.type){case"insert":if(J.text){let W=F.insert(J.text);H.onChange(W.text),D.setOffset(W.offset)}break;case"x":mN$(J.count,Q);break;case"replace":pN$(J.char,J.count,Q);break;case"toggleCase":dN$(J.count,Q);break;case"indent":lN$(J.dir,J.count,Q);break;case"join":cN$(J.count,Q);break;case"openLine":AdH(J.direction,Q);break;case"operator":aPH(J.op,J.motion,J.count,Q);break;case"operatorFind":uN$(J.op,J.find,J.char,J.count,Q);break;case"operatorTextObj":gN$(J.op,J.scope,J.objType,J.count,Q);break}}function U(J,F){let Q=o0.fromText(H.value,H.columns,D.offset),W=$.current;if(F.ctrl){D.onInput(J,F);return}if(F.escape&&W.mode==="INSERT"){E();return}if(F.return){D.onInput(J,F);return}if(W.mode==="INSERT"){if(F.backspace||F.delete){if(W.insertedText.length>0)$.current={mode:"INSERT",insertedText:W.insertedText.slice(0,-1)}}else $.current={mode:"INSERT",insertedText:W.insertedText+J};D.onInput(J,F);return}if(W.mode!=="NORMAL")return;if(W.command.type==="idle"&&(F.upArrow||F.downArrow||F.leftArrow||F.rightArrow)){D.onInput(J,F);return}let P={...M(Q,!1),onUndo:H.onUndo,onDotRepeat:G},C=J;if(F.leftArrow)C="h";else if(F.rightArrow)C="l";else if(F.upArrow)C="k";else if(F.downArrow)C="j";let Y=G$B(W.command,C,P);if(Y.execute)Y.execute();if($.current.mode==="NORMAL"){if(Y.next)$.current={mode:"NORMAL",command:Y.next};else if(Y.execute)$.current={mode:"NORMAL",command:{type:"idle"}}}if(J==="?"&&W.mode==="NORMAL"&&W.command.type==="idle")H.onChange("?")}let X=hd.useCallback((J)=>{if(J==="INSERT")$.current={mode:"INSERT",insertedText:""};else $.current={mode:"NORMAL",command:{type:"idle"}};L(J),B?.(J)},[B]);return{...D,onInput:U,mode:A,setMode:X}}var hd;var K$B=K(()=>{gSA();eJH();wuA();J$B();TuA();hd=b(s(),1)});function zuA(H){let[$]=_I(),A=EJ();NZ$(A,!!H.onImagePaste);let L=F$B({value:H.value,onChange:H.onChange,onSubmit:H.onSubmit,onExit:H.onExit,onExitMessage:H.onExitMessage,onHistoryReset:H.onHistoryReset,onHistoryUp:H.onHistoryUp,onHistoryDown:H.onHistoryDown,onClearInput:H.onClearInput,focus:H.focus,mask:H.mask,multiline:H.multiline,cursorChar:H.showCursor?" ":"",highlightPastedText:H.highlightPastedText,invert:A?oH.inverse:(B)=>B,themeText:ZL("text",$),columns:H.columns,onImagePaste:H.onImagePaste,disableCursorMovementForUpDownKeys:H.disableCursorMovementForUpDownKeys,externalOffset:H.cursorOffset,onOffsetChange:H.onChangeCursorOffset,onModeChange:H.onModeChange,isMessageLoading:H.isLoading,onUndo:H.onUndo}),{mode:I,setMode:D}=L;return nN$.default.useEffect(()=>{if(H.initialMode&&H.initialMode!==I)D(H.initialMode)},[H.initialMode,I,D]),nN$.default.createElement(x,{flexDirection:"column"},nN$.default.createElement(zZ$,{inputState:L,terminalFocus:A,highlights:H.highlights,...H}))}var nN$;var Q$B=K(()=>{xH();r0();K$B();mSA();cSA();nN$=b(s(),1)});function oPH(H,$){let A=dL()&&$&&tW($);switch(H.mode){case"default":return"acceptEdits";case"acceptEdits":return"plan";case"plan":if(A)return"delegate";if(H.isBypassPermissionsModeAvailable)return"bypassPermissions";return"default";case"delegate":if(H.isBypassPermissionsModeAvailable)return"bypassPermissions";return"default";case"bypassPermissions":return"default";case"dontAsk":return"default"}}function W$B(H,$){return{nextMode:oPH(H,$),context:H}}var NuA=K(()=>{T8();XE()});function V$B(H,$,A,L,I=!0){let D=H.length;if(D===0)return{startIndex:0,endIndex:0,showLeftArrow:!1,showRightArrow:!1};let B=Math.max(0,Math.min(L,D-1));if(H.reduce((J,F)=>J+F,0)<=$)return{startIndex:0,endIndex:D,showLeftArrow:!1,showRightArrow:!1};let E=[0];for(let J=0;J0)return Q-1;return Q}function G(J,F){let Q=$;if(J>0)Q-=A;if(F=U&&B0,showRightArrow:X=X){X=B+1,U=B;while(U>0&&M(U-1,X)<=G(U-1,X))U--}else{U=B,X=B+1;while(X0,showRightArrow:X{xH();w7();yT1=b(s(),1)});function OuA({tasksSelected:H,showHint:$,isViewingTeammate:A,teammateFooterIndex:L=0,isLeaderIdle:I=!1}){let{columns:D}=QL(),B=tPH.useMemo(()=>M$().hasSeenTasksHint,[]),f=J$((P)=>P.tasks),E=J$((P)=>P.viewingAgentTaskId),M=tPH.useMemo(()=>Object.values(f??{}).filter((P)=>Dz(P)&&!(v8()&&P.type==="local_agent")),[f]),U=J$((P)=>P.expandedView)==="teammates",X=!U&&M.length>0&&M.every((P)=>P.type==="in_process_teammate"),J=tPH.useMemo(()=>M.filter((P)=>P.type==="in_process_teammate").sort((P,C)=>P.identity.agentName.localeCompare(C.identity.agentName)),[M]),F=tPH.useMemo(()=>{let P={name:"main",color:void 0,isIdle:I},C=J.map((Z)=>({name:Z.identity.agentName,color:hT1(Z.identity.color),isIdle:Z.isIdle}));if(!H)C.sort((Z,q)=>{if(Z.isIdle!==q.isIdle)return Z.isIdle?1:-1;return 0});return[P,...C].map((Z,q)=>({...Z,idx:q}))},[J,I,H]),Q=tPH.useMemo(()=>F.map((P,C)=>{let Y=`@${P.name}`;return GI(Y)+(C>0?1:0)}),[F]);if(X||!U&&A){let P=H?L:-1,C=E?J.findIndex((d)=>d.id===E)+1:0,Y=$&&!B&&!H?uD.createElement(uD.Fragment,null,uD.createElement(V,{dimColor:!0}," \xB7 "),uD.createElement(V,{dimColor:!0},uD.createElement(s$,{shortcut:"\u2193",action:"view"}))):null,Z=2,q=Y?15:0,O=4,j=Math.max(20,D-q-4),{startIndex:u,endIndex:y,showLeftArrow:g,showRightArrow:h}=V$B(Q,j,2,P>=0?P:0),p=F.slice(u,y);return uD.createElement(uD.Fragment,null,g&&uD.createElement(V,{dimColor:!0},pH.arrowLeft," "),p.map((d,k)=>{let n=k>0;return uD.createElement(uD.Fragment,{key:d.name},n&&uD.createElement(V,null," "),uD.createElement(vT1,{name:d.name,color:d.color,isSelected:P===d.idx,isViewed:C===d.idx,isIdle:d.isIdle}))}),h&&uD.createElement(V,{dimColor:!0}," ",pH.arrowRight),Y,uD.createElement(V,{dimColor:!0}," \xB7 shift+\u2191 to expand"))}if(Qe(f??{},U))return null;let W=$&&(H||!B)?uD.createElement(uD.Fragment,null,uD.createElement(V,{dimColor:!0}," \xB7 "),uD.createElement(V,{dimColor:!0},H?uD.createElement(s$,{shortcut:"Enter",action:"view tasks"}):uD.createElement(s$,{shortcut:"\u2193",action:"view"}))):null;if(M.length===0)return null;if(M.length===1&&D>=150){let P=M[0],C=bT1(P);return uD.createElement(uD.Fragment,null,uD.createElement(V,{color:"background",inverse:H},e8(C,40,!0)," ",uD.createElement(V,{dimColor:!0},"(",P.status,")")),W)}if(M.length>=1){let P=kT1(M);return uD.createElement(uD.Fragment,null,uD.createElement(V,{color:"background",inverse:H},P),W)}return null}function vT1({name:H,color:$,isSelected:A,isViewed:L,isIdle:I}){if(A)return $?uD.createElement(V,{backgroundColor:$,color:"inverseText",bold:L},"@",H):uD.createElement(V,{color:"background",inverse:!0,bold:L},"@",H);if(I)return uD.createElement(V,{dimColor:!0,bold:L},"@",H);if(L)return uD.createElement(V,{color:$,bold:!0},"@",H);return uD.createElement(V,{color:$,dimColor:!$},"@",H)}function hT1(H){if(!H)return;if(h5.includes(H))return b5[H];return}function bT1(H){switch(H.type){case"local_bash":return H.command;case"local_agent":return H.description;case"remote_agent":return H.title;case"in_process_teammate":return`@${H.identity.agentName}`}}function kT1(H){let $=H.length;if(H.every((L)=>L.type===H[0].type))switch(H[0].type){case"local_bash":return $===1?"1 bash":`${$} bashes`;case"in_process_teammate":{let L=new Set(H.map((I)=>I.type==="in_process_teammate"?I.identity.teamName:"")).size;return L===1?"1 team":`${L} teams`}case"local_agent":return $===1?"1 local agent":`${$} local agents`;case"remote_agent":return $===1?"1 remote session":`${$} remote sessions`}return`${$} background ${$===1?"task":"tasks"}`}var uD,tPH;var P$B=K(()=>{xH();jI();vA();pL();lB();OB();Q9();DJ();w7();q7();IdH();uD=b(s(),1),tPH=b(s(),1)});function _$B({teamsSelected:H,showHint:$}){let A=J$((B)=>B.teamContext),L=A?Object.values(A.teammates).filter((B)=>B.name!=="team-lead").length:0;if(L===0)return null;let I=$&&H?WW.createElement(WW.Fragment,null,WW.createElement(V,{dimColor:!0},"\xB7 "),WW.createElement(V,{dimColor:!0},"Enter to view")):null,D=`${L} ${L===1?"teammate":"teammates"}`;return WW.createElement(WW.Fragment,null,WW.createElement(V,{key:H?"selected":"normal",color:"background",inverse:H},D),I?WW.createElement(V,null," ",I):null)}var WW;var Y$B=K(()=>{xH();pL();WW=b(s(),1)});function uT1({value:H,onChange:$,historyFailedMatch:A}){return w8H.createElement(x,{gap:1},w8H.createElement(V,{dimColor:!0},A?"no matching prompt:":"search prompts:"),w8H.createElement(W9,{value:H,onChange:$,cursorOffset:H.length,onChangeCursorOffset:()=>{},columns:GI(H)+1,focus:!0,showCursor:!0,multiline:!1,dimColor:!0}))}var w8H,C$B;var w$B=K(()=>{xH();S5();DJ();w8H=b(s(),1);C$B=uT1});function pT1(H,$){if(H===$)return!0;if(!H||!$)return!1;return H.filesCount===$.filesCount&&H.linesAdded===$.linesAdded&&H.linesRemoved===$.linesRemoved}function dT1(H,$){if(H.size!==$.size)return!1;for(let[A,L]of H){let I=$.get(A);if(!I)return!1;if(L.added!==I.added||L.removed!==I.removed||L.isBinary!==I.isBinary)return!1}return!0}function cT1(H,$,A){let L=A?.stats??null,I=A?.perFileStats??new Map;if(!pT1(H,L))return!0;if(!dT1($,I))return!0;return!1}function Z$B(){let H=J$((f)=>f.fileHistory.trackedFiles),$=J$((f)=>f.gitDiff),A=zI(),L=bd.useRef(null),I=bd.useRef(!1),D=H.size>0,B=bd.useCallback(async()=>{if(!NL("tengu_code_diff_cli",!1))return;let f=await U3D();A((E)=>{if(!cT1(E.gitDiff.stats,E.gitDiff.perFileStats,f))return E;return{...E,gitDiff:{...E.gitDiff,stats:f?.stats??null,perFileStats:f?.perFileStats??new Map,hunks:f?.hunks??new Map,lastUpdated:Date.now()}}})},[A]);return bd.useEffect(()=>{if(!D)return;let f=!1,E=!0;async function M(){let G=Date.now();await B();let U=Date.now()-G;if(E&&U>mT1){I.current=!0;return}if(E=!1,!f)L.current=setTimeout(()=>void M(),gT1)}return M(),()=>{if(f=!0,L.current)clearTimeout(L.current),L.current=null}},[D,B]),bd.useMemo(()=>{if(I.current)return null;if(!D)return null;if(!$.stats)return null;return{stats:$.stats,perFileStats:$.perFileStats,hunks:$.hunks}},[D,$.stats,$.perFileStats,$.hunks])}var bd,gT1=20000,mT1=2000;var q$B=K(()=>{pL();jkH();SD();bd=b(s(),1)});function iT1(H,$){if(H)return"draft";switch($){case"APPROVED":return"approved";case"CHANGES_REQUESTED":return"changes_requested";default:return"pending"}}async function T$B(){if(!await z6())return null;let[$,A]=await Promise.all([vW(),N6()]);if($===A)return null;let{stdout:L,code:I}=await jA("gh",["pr","view","--json","number,url,reviewDecision,isDraft,headRefName,state"],{timeout:lT1,preserveOutputOnError:!1});if(I!==0||!L.trim())return null;try{let D=DA(L),B=await N6();if(D.headRefName===B||D.headRefName==="main"||D.headRefName==="master")return null;return{number:D.number,url:D.url,reviewState:D.state==="MERGED"?"merged":iT1(D.isDraft,D.reviewDecision)}}catch{return null}}var lT1=5000;var z$B=K(()=>{B0();t8();Z$()});function N$B(){let H=zI(),$=sPH.useRef(null),A=sPH.useCallback(async()=>{let L=await T$B();H((I)=>{let D=L?.number??null,B=L?.reviewState??null;if(I.prStatus.number===D&&I.prStatus.reviewState===B)return I;return{...I,prStatus:{number:D,url:L?.url??null,reviewState:B,lastUpdated:Date.now()}}})},[H]);sPH.useEffect(()=>{let L=!1;async function I(){let D=Date.now();if(await A(),Date.now()-D>rT1)return;if(!L)$.current=setTimeout(()=>void I(),nT1)}return I(),()=>{if(L=!0,$.current)clearTimeout($.current),$.current=null}},[A])}var sPH,nT1=60000,rT1=4000;var O$B=K(()=>{pL();z$B();sPH=b(s(),1)});function j$B({exitMessage:H,vimMode:$,mode:A,toolPermissionContext:L,suppressHint:I,isLoading:D,tasksSelected:B,teamsSelected:f,diffSelected:E,teammateFooterIndex:M,isPasting:G,isSearching:U,historyQuery:X,setHistoryQuery:J,historyFailedMatch:F}){if(H.show)return hI.createElement(V,{dimColor:!0,key:"exit-message"},"Press ",H.key," again to exit");if(G)return hI.createElement(V,{dimColor:!0,key:"pasting-message"},"Pasting text\u2026");let Q=Vs()&&$==="INSERT"&&!U;return hI.createElement(x,{justifyContent:"flex-start",gap:1},R$B()&&hI.createElement(eT1,null),U&&hI.createElement(C$B,{value:X,onChange:J,historyFailedMatch:F}),Q?hI.createElement(V,{dimColor:!0,key:"vim-insert"},"-- INSERT --"):null,hI.createElement(oT1,{mode:A,toolPermissionContext:L,showHint:!I&&!Q,isLoading:D,tasksSelected:B,teamsSelected:f,diffSelected:E,teammateFooterIndex:M}))}function oT1({mode:H,toolPermissionContext:$,showHint:A,isLoading:L,tasksSelected:I,teamsSelected:D,diffSelected:B,teammateFooterIndex:f}){let{columns:E}=QL(),M=C0("chat:cycleMode","Chat","shift+tab"),G=J$((DH)=>DH.tasks),U=J$((DH)=>DH.teamContext),X=J$((DH)=>DH.remoteSessionUrl),J=J$((DH)=>DH.viewSelectionMode),F=J$((DH)=>DH.viewingAgentTaskId),Q=J$((DH)=>DH.expandedView),W=Q==="teammates",P=J$((DH)=>DH.prStatus),Y=ePH.useSyncExternalStore(x$B?.subscribeToProactiveChanges??aT1,x$B?.getNextTickAt??S$B,S$B)!==null,Z=!1,q=!1,O=ePH.useMemo(()=>Object.values(G).filter((DH)=>Dz(DH)&&!0).length,[G,!1]),j=O>0,u=C0("chat:cancel","Chat","esc").toLowerCase(),y=C0("app:toggleTodos","Global","ctrl+t"),g=Z$B(),h=NL("tengu_code_diff_cli",!1)?g?.stats??null:null,p=dL()&&!vh()&&U!==void 0&&Object.values(U.teammates).filter((DH)=>DH.name!=="team-lead").length>0;if(H==="bash")return hI.createElement(V,{color:"bashBorder"},"! for bash mode");if(H==="background")return hI.createElement(V,{color:"background"},"& to background");let d=$?.mode,k=!s0L(d),n=J==="viewing-agent",GH=F?G[F]:void 0,HH=n&&GH!=null&&GH.status!=="running",BH=O>0||n,WH=(k?1:0)+(BH?1:0)+(p?1:0),TH=(M$().codeDiffFooterEnabled??!0)&&h&&h.filesCount>0&&WH<2&&(WH===0||E>=100),t=R$B()&&P.number!==null&&P.reviewState!==null&&P.url!==null&&WH<2&&(WH===0||E>=100),IH=WH<2&&!0,MH=!W&&BH&&Object.values(G).some((DH)=>DH.type==="in_process_teammate")||!W&&n,CH=[...X?[hI.createElement(V,{color:"ide",key:"remote"},pH.circleDouble," remote")]:[],...d&&k?[hI.createElement(V,{color:q6(d),key:"mode"},fwH(d)," ",!1,vk(d).toLowerCase()," on",IH&&hI.createElement(V,{dimColor:!0}," ",hI.createElement(s$,{shortcut:M,action:"cycle",parens:!0})))]:[],...BH&&!MH&&!Qe(G,W)?[hI.createElement(OuA,{key:"tasks",tasksSelected:I,showHint:A&&!p,isViewingTeammate:n,teammateFooterIndex:f,isLeaderIdle:!L})]:[],...dL()&&p?[hI.createElement(_$B,{key:"teams",teamsSelected:D,showHint:A&&!BH})]:[],...TH?[hI.createElement(V,{key:"code-changes",dimColor:!B,inverse:B,color:B?"background":void 0},h.filesCount," ",h.filesCount===1?"file":"files"," ",hI.createElement(V,{color:"diffAddedWord"},"+",h.linesAdded)," ",hI.createElement(V,{color:"diffRemovedWord"},"-",h.linesRemoved),B&&A&&hI.createElement(V,{dimColor:!0}," \xB7 Enter to view"))]:[],...t?[hI.createElement(V,{key:"pr-status",dimColor:!0},hI.createElement(V,{color:sT1(P.reviewState)},"PR")," ",hI.createElement(dI,{url:P.url},hI.createElement(V,{underline:!0},"#",P.number)))]:[]],OH=Object.values(G).some((DH)=>DH.type==="in_process_teammate"&&DH.status==="running"),LH=A?tT1(L,u,y,j,Q,OH):[];if(HH)CH.push(hI.createElement(V,{dimColor:!0,key:"esc-return"},hI.createElement(s$,{shortcut:u,action:"return to team lead"})));else if(!MH&&A)CH.push(...LH);if(MH){let DH=HH?CH:[...CH,...LH];return hI.createElement(x,{flexDirection:"column"},hI.createElement(x,null,hI.createElement(OuA,{tasksSelected:I,showHint:!1,isViewingTeammate:n,teammateFooterIndex:f,isLeaderIdle:!L})),DH.length>0&&hI.createElement(x,null,hI.createElement(rA,null,DH)))}let e=!1;if(CH.length===0&&A)CH.push(hI.createElement(V,{dimColor:!0,key:"shortcuts-hint"},"? for shortcuts"));if(e&&A)CH.push(hI.createElement(V,{dimColor:!0,key:"manage-tasks"},hI.createElement(s$,{shortcut:"\u2193",action:"manage tasks"})));if(CH.length===0)return null;return hI.createElement(x,null,hI.createElement(rA,null,CH))}function tT1(H,$,A,L,I,D){let B;if(D)switch(I){case"none":B="show tasks";break;case"tasks":B="show teammates";break;case"teammates":B="hide";break}else B=I==="tasks"?"hide tasks":"show tasks";let f=L||I!=="none";return[...H?[hI.createElement(V,{dimColor:!0,key:"esc"},hI.createElement(s$,{shortcut:$,action:"interrupt"}))]:[],...f?[hI.createElement(V,{dimColor:!0,key:"toggle-tasks"},hI.createElement(s$,{shortcut:A,action:B}))]:[]]}function sT1(H){switch(H){case"approved":return"success";case"changes_requested":return"error";case"pending":return"warning";case"merged":return"merged";case"draft":return}}function eT1(){return N$B(),null}function R$B(){return NL("tengu_pr_status_cli",!1)&&(M$().prStatusFooterEnabled??!0)}var hI,ePH,x$B=null,aT1=(H)=>()=>{},S$B=()=>null;var y$B=K(()=>{xH();jI();qVH();FG();yW();P$B();IdH();T8();Y$B();jS();pL();w$B();q$B();O$B();lB();eB();OB();Q9();SD();vA();hI=b(s(),1),ePH=b(s(),1)});function SuA(H){return H?.statusLine!==void 0}function Hz1(H,$,A,L,I){let D=lYH(),B=BLH({permissionMode:H,mainLoopModel:X1(),exceeds200kTokens:$}),f=A?.outputStyle||HW,E=v4$(L),M=JV(B,V6()),G=xcA(E,M);return{...hF(),model:{id:B,display_name:hV(B)},workspace:{current_dir:C$(),project_dir:zL()},version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,output_style:{name:f},cost:{total_cost_usd:BQ(),total_duration_ms:EEH(),total_api_duration_ms:rC(),total_lines_added:KHH(),total_lines_removed:QHH()},context_window:{total_input_tokens:xYH(),total_output_tokens:SYH(),context_window_size:M,current_usage:E,used_percentage:G.used,remaining_percentage:G.remaining},exceeds_200k_tokens:$,...Vs()&&{vim:{mode:I??"INSERT"}},...D&&{agent:{name:D}}}}function v$B({messages:H,vimMode:$}){let A=kd.useRef(void 0),L=J$((U)=>U.toolPermissionContext),I=J$((U)=>U.statusLineText),D=zI(),B=lQ(),f=kd.useRef({messageId:null,exceeds200kTokens:!1,permissionMode:L.mode,vimMode:$}),E=kd.useCallback(async(U)=>{A.current?.abort();let X=new AbortController;A.current=X;try{let J=f.current.exceeds200kTokens;if(U!==void 0){let W=U.filter((Y)=>Y.type==="assistant"),P=W[W.length-1],C=P?.uuid||P?.message?.id||null;if(C!==f.current.messageId)J=h4$(U),f.current.messageId=C,f.current.exceeds200kTokens=J}let F=Hz1(f.current.permissionMode,J,B,U??[],$),Q=await CNA(F,X.signal);if(!X.signal.aborted)D((W)=>({...W,statusLineText:Q}))}catch{}},[D,B,$]),M=Rr(()=>E(H),300);kd.useEffect(()=>{let U=H.filter((F)=>F.type==="assistant"),X=U[U.length-1],J=X?.uuid||X?.message?.id||null;if(J!==f.current.messageId||L.mode!==f.current.permissionMode||$!==f.current.vimMode)f.current.messageId=J,f.current.permissionMode=L.mode,f.current.vimMode=$,M()},[H,L.mode,$,M]),kd.useEffect(()=>{let U=B?.statusLine;if(U){if(c("tengu_status_line_mount",{command_length:U.command.length,padding:U.padding}),B.disableAllHooks===!0)N("Status line is configured but disableAllHooks is true",{level:"warn"})}},[]),kd.useEffect(()=>{return E(),()=>{A.current?.abort()}},[]);let G=B?.statusLine?.padding??0;return Z8H.createElement(x,{paddingX:G,gap:2},I&&Z8H.createElement(V,{dimColor:!0},Z8H.createElement(m9,null,I)))}var Z8H,kd;var h$B=K(()=>{xH();_3();g$();PI();um();aI();s6();_3();z$();E$();pL();jh();Nq();nC();$3();qVH();Z8H=b(s(),1),kd=b(s(),1)});function b$B({selectedIndex:H}){let $=J$((M)=>M.tasks),A=kJ.useRef([]),[,L]=kJ.useState(0);kJ.useEffect(()=>{let M=setInterval(()=>{L((G)=>G+1)},1000);return()=>clearInterval(M)},[]);let I=kJ.useMemo(()=>{let M=new Map;for(let G of Object.values($))if(G.type==="local_agent")M.set(G.id,G);return M},[$]),D=new Set(A.current),B=[...I.keys()].filter((M)=>!D.has(M)).sort((M,G)=>{let U=I.get(M),X=I.get(G);if(!U||!X)return 0;return U.startTime-X.startTime});if(B.length>0)A.current=[...A.current,...B];if(!v8())return null;let f=3000,E=[];for(let M of A.current){let G=I.get(M);if(!G)continue;if(!rN$(G.status))E.push(G);else if(G.status==="killed"&&G.endTime){if(Date.now()-G.endTimekJ.createElement($z1,{key:M.id,task:M,isSelected:H===G})))}function k$B(){let H=J$(($)=>$.tasks);return kJ.useMemo(()=>{if(!v8())return 0;let $=3000,A=Date.now(),L=Object.values(H).filter((D)=>D.type==="local_agent"),I=0;for(let D of L)if(!rN$(D.status))I++;else if(D.status==="killed"&&D.endTime&&A-D.endTime<$)I++;return I},[H])}function $z1({task:H,isSelected:$}){let{columns:A}=QL(),L=!rN$(H.status),I=L?Date.now()-H.startTime:(H.endTime??H.startTime)-H.startTime,D=of(I),B=H.progress?.tokenCount,f=H.progress?.lastActivity,E=f?pH.arrowDown:pH.arrowUp,M=B!==void 0&&B>0?` \xB7 ${E} ${a0(B)} tokens`:"",G=H.progress?.summary,U=G||H.description;kJ.useEffect(()=>{N(`[CoordinatorAgentStatus] Summary updated for task ${H.id}: ${G??"(none)"}`)},[G,H.id]);let X=G?void 0:(H.progress?.recentActivities&&kv(H.progress.recentActivities))??f?.activityDescription,J=X?` \xB7 ${X}`:"",F=$?pH.pointer+" ":" ",Q=` \xB7 ${D}${M}${J}`,W=A-GI(F)-GI(Q),P=k2(U,Math.max(0,W),"truncate-end");if(!L)return kJ.createElement(V,{dimColor:!$},F,P," \xB7 ",D,M,kJ.createElement(V,{color:"warning"}," \xB7 ",pH.cross," Stopped"));return kJ.createElement(V,{dimColor:!$},F,P," \xB7 ",D,M,J)}var kJ;var juA=K(()=>{xH();pL();w7();jI();Q9();IdH();hx();DJ();OB();E$();kJ=b(s(),1)});function Az1({apiKeyStatus:H,debug:$,exitMessage:A,vimMode:L,mode:I,autoUpdaterResult:D,isAutoUpdating:B,verbose:f,onAutoUpdaterResult:E,onChangeIsUpdating:M,suggestions:G,selectedSuggestion:U,maxColumnWidth:X,toolPermissionContext:J,helpOpen:F,suppressHint:Q,isLoading:W,tasksSelected:P,teamsSelected:C,diffSelected:Y,teammateFooterIndex:Z,coordinatorTaskIndex:q,ideSelection:O,mcpClients:j,isPasting:u=!1,isInputWrapped:y=!1,messages:g,isSearching:h,historyQuery:p,setHistoryQuery:d,historyFailedMatch:k}){let n=lQ(),GH=Q||SuA(n)||h;if(G.length)return t4.createElement(x,{paddingX:2,paddingY:0},t4.createElement(qgH,{suggestions:G,selectedSuggestion:U,maxColumnWidth:X}));if(F)return t4.createElement(zq$,{dimColor:!0,fixedWidth:!0,paddingX:2});return t4.createElement(t4.Fragment,null,t4.createElement(x,{flexDirection:"row",justifyContent:"space-between",paddingX:2,gap:1},t4.createElement(x,{flexDirection:"column",flexShrink:0},I==="prompt"&&!A.show&&!u&&SuA(n)&&t4.createElement(v$B,{messages:g,vimMode:L}),t4.createElement(j$B,{exitMessage:A,vimMode:L,mode:I,toolPermissionContext:J,suppressHint:GH,isLoading:W,tasksSelected:P,teamsSelected:C,diffSelected:Y,teammateFooterIndex:Z,isPasting:u,isSearching:h,historyQuery:p,setHistoryQuery:d,historyFailedMatch:k})),t4.createElement(THB,{apiKeyStatus:H,autoUpdaterResult:D,debug:$,isAutoUpdating:B,verbose:f,messages:g,onAutoUpdaterResult:E,onChangeIsUpdating:M,ideSelection:O,mcpClients:j,isInputWrapped:y})),t4.createElement(b$B,{selectedIndex:P?q:void 0}))}var t4,u$B,g$B;var m$B=K(()=>{xH();y$B();yN$();h$B();um();nSA();JRA();juA();t4=b(s(),1),u$B=b(s(),1);g$B=u$B.memo(Az1)});function p$B(H,$){let A=aN$.useRef(void 0);aN$.useEffect(()=>{let L=CY(H);if(A.current!==L)A.current=L;if(L)L.client.setNotificationHandler(Iz1,(I)=>{if(A.current!==L)return;try{let D=I.params,B=D.lineStart!==void 0?D.lineStart+1:void 0,f=D.lineEnd!==void 0?D.lineEnd+1:void 0;$({filePath:D.filePath,lineStart:B,lineEnd:f})}catch(D){r(D)}})},[H,$])}var aN$,Lz1="at_mentioned",Iz1;var d$B=K(()=>{mI();nU();_$();aN$=b(s(),1),Iz1=S.object({method:S.literal(Lz1),params:S.object({filePath:S.string(),lineStart:S.number().optional(),lineEnd:S.number().optional()})})});function c$B({maxBufferSize:H,debounceMs:$}){let[A,L]=xb.useState([]),[I,D]=xb.useState(-1),B=xb.useRef(0),f=xb.useRef(null),E=xb.useCallback((X,J,F={})=>{let Q=Date.now();if(f.current)clearTimeout(f.current),f.current=null;if(Q-B.current<$){f.current=setTimeout(()=>{E(X,J,F)},$);return}B.current=Q,L((W)=>{let P=I>=0?W.slice(0,I+1):W,C=P[P.length-1];if(C&&C.text===X)return P;let Y=[...P,{text:X,cursorOffset:J,pastedContents:F,timestamp:Q}];if(Y.length>H)return Y.slice(-H);return Y}),D((W)=>{let P=W>=0?W+1:A.length;return Math.min(P,H-1)})},[$,H,I,A.length]),M=xb.useCallback(()=>{if(I<0||A.length===0)return;let X=Math.max(0,I-1),J=A[X];if(J)return D(X),J;return},[A,I]),G=xb.useCallback(()=>{if(L([]),D(-1),B.current=0,f.current)clearTimeout(f.current),f.current=null},[B,f]),U=I>0&&A.length>1;return{pushToBuffer:E,undo:M,canUndo:U,clearBuffer:G}}var xb;var l$B=K(()=>{xb=b(s(),1)});function i$B(H){return H==="tmux"||H==="iterm2"}function n$B(H){let $=yF(H);if(!$)return[];let A=[];for(let L of $.members){if(L.name==="team-lead")continue;let D=L.isActive!==!1?"running":"idle";A.push({name:L.name,agentId:L.agentId,agentType:L.agentType,model:L.model,prompt:L.prompt,status:D,color:L.color,tmuxPaneId:L.tmuxPaneId,cwd:L.cwd,worktreePath:L.worktreePath,isHidden:Z4D(H,L.tmuxPaneId),backendType:L.backendType&&i$B(L.backendType)?L.backendType:void 0,mode:L.mode})}return A}var r$B=K(()=>{g$();NA();aY();E$()});function o$B({initialTeams:H,onDone:$}){FY("teams-dialog");let A=zI(),L=H?.[0]?.name??"",[I,D]=Tj.useState({type:"teammateList",teamName:L}),[B,f]=Tj.useState(0),[E,M]=Tj.useState(0),G=Tj.useMemo(()=>{return n$B(I.teamName)},[I.teamName,E]);VF(()=>{M((W)=>W+1)},1000);let U=Tj.useMemo(()=>{if(I.type!=="teammateDetail")return null;return G.find((W)=>W.name===I.memberName)??null},[I,G]),X=J$((W)=>W.toolPermissionContext.isBypassPermissionsModeAvailable),J=()=>{D({type:"teammateList",teamName:I.teamName}),f(0)},F=Tj.useCallback(()=>{if(I.type==="teammateDetail"&&U)Uz1(U,I.teamName,X),M((W)=>W+1);else if(I.type==="teammateList"&&G.length>0)Xz1(G,I.teamName,X),M((W)=>W+1)},[I,U,G,X]);bI({"confirm:cycleMode":F},{context:"Confirmation"}),WL((W,P)=>{if(P.leftArrow){if(I.type==="teammateDetail")J();return}if(P.upArrow||P.downArrow){let C=Q();if(P.upArrow)f((Y)=>Math.max(0,Y-1));else f((Y)=>Math.min(C,Y+1));return}if(P.return){if(I.type==="teammateList"&&G[B])D({type:"teammateDetail",teamName:I.teamName,memberName:G[B].name});else if(I.type==="teammateDetail"&&U)Ez1(U.tmuxPaneId),$();return}if(W==="k"){if(I.type==="teammateList"&&G[B])RuA(G[B].tmuxPaneId,I.teamName,G[B].agentId,G[B].name,A).then(()=>{M((C)=>C+1),f((C)=>Math.max(0,Math.min(C,G.length-2)))});else if(I.type==="teammateDetail"&&U)RuA(U.tmuxPaneId,I.teamName,U.agentId,U.name,A),J();return}if(W==="s"){if(I.type==="teammateList"&&G[B]){let C=G[B];Y_$(C.name,I.teamName,"Graceful shutdown requested by team lead")}else if(I.type==="teammateDetail"&&U)Y_$(U.name,I.teamName,"Graceful shutdown requested by team lead"),J();return}if(W==="h"){let C=F6H(),Y=I.type==="teammateList"?G[B]:I.type==="teammateDetail"?U:null;if(Y&&C?.supportsHideShow){if(Mz1(Y,I.teamName).then(()=>{M((Z)=>Z+1)}),I.type==="teammateDetail")J()}return}if(W==="H"&&I.type==="teammateList"){if(F6H()?.supportsHideShow&&G.length>0){let Y=G.some((Z)=>!Z.isHidden);Promise.all(G.map((Z)=>Y?s$B(Z,I.teamName):e$B(Z,I.teamName))).then(()=>{M((Z)=>Z+1)})}return}if(W==="p"&&I.type==="teammateList"){let C=G.filter((Y)=>Y.status==="idle");if(C.length>0)Promise.all(C.map((Y)=>RuA(Y.tmuxPaneId,I.teamName,Y.agentId,Y.name,A))).then(()=>{M((Y)=>Y+1),f((Y)=>Math.max(0,Math.min(Y,G.length-C.length-1)))});return}});function Q(){if(I.type==="teammateList")return Math.max(0,G.length-1);return 0}if(I.type==="teammateList")return iD.createElement(Dz1,{teamName:I.teamName,teammates:G,selectedIndex:B,onCancel:$});if(I.type==="teammateDetail"&&U)return iD.createElement(fz1,{teammate:U,teamName:I.teamName,onCancel:J});return null}function Dz1({teamName:H,teammates:$,selectedIndex:A,onCancel:L}){let I=`${$.length} ${$.length===1?"teammate":"teammates"}`,D=F6H()?.supportsHideShow??!1,B=C0("confirm:cycleMode","Confirmation","shift+tab");return iD.createElement(iD.Fragment,null,iD.createElement(BL,{title:`Team ${H}`,subtitle:I,onCancel:L,color:"background",hideInputGuide:!0},$.length===0?iD.createElement(V,{dimColor:!0},"No teammates"):iD.createElement(x,{flexDirection:"column"},$.map((f,E)=>iD.createElement(Bz1,{key:f.agentId,teammate:f,isSelected:E===A})))),iD.createElement(x,{marginLeft:1},iD.createElement(V,{dimColor:!0},pH.arrowUp,"/",pH.arrowDown," select \xB7 Enter view \xB7 k kill \xB7 s shutdown \xB7 p prune idle",D&&" \xB7 h hide/show \xB7 H hide/show all"," \xB7 ",B," sync cycle modes for all \xB7 Esc close")))}function Bz1({teammate:H,isSelected:$}){let A=H.status==="idle",L=A&&!$,I=H.mode?hN(H.mode):"default",D=fwH(I),B=q6(I);return iD.createElement(V,{color:$?"suggestion":void 0,dimColor:L},$?pH.pointer+" ":" ",H.isHidden&&iD.createElement(V,{dimColor:!0},"[hidden] "),A&&iD.createElement(V,{dimColor:!0},"[idle] "),D&&iD.createElement(V,{color:B},D," "),"@",H.name,H.model&&iD.createElement(V,{dimColor:!0}," (",H.model,")"))}function fz1({teammate:H,teamName:$,onCancel:A}){let[L,I]=Tj.useState(!1),D=C0("confirm:cycleMode","Confirmation","shift+tab"),B=H.color?b5[H.color]:void 0,f=Tj.useMemo(()=>{return GF($).filter((W)=>W.owner===H.agentId||W.owner===H.name)},[$,H.agentId,H.name]);WL((Q)=>{if(Q==="p")I((W)=>!W)});let E=H.worktreePath||H.cwd,M=[];if(H.model)M.push(H.model);if(E)M.push(H.worktreePath?`worktree: ${E}`:E);let G=M.join(" \xB7 ")||void 0,U=H.mode?hN(H.mode):"default",X=fwH(U),J=q6(U),F=iD.createElement(iD.Fragment,null,X&&iD.createElement(V,{color:J},X," "),B?iD.createElement(V,{color:B},`@${H.name}`):`@${H.name}`);return iD.createElement(iD.Fragment,null,iD.createElement(BL,{title:F,subtitle:G,onCancel:A,color:"background",hideInputGuide:!0},f.length>0&&iD.createElement(x,{flexDirection:"column"},iD.createElement(V,{bold:!0},"Tasks"),f.map((Q)=>iD.createElement(V,{key:Q.id,color:Q.status==="completed"?"success":void 0},Q.status==="completed"?pH.tick:"\u25FC"," ",Q.subject))),H.prompt&&iD.createElement(x,{flexDirection:"column"},iD.createElement(V,{bold:!0},"Prompt"),iD.createElement(V,null,L?H.prompt:H.prompt.length>80?H.prompt.slice(0,80)+"\u2026":H.prompt,H.prompt.length>80&&!L&&iD.createElement(V,{dimColor:!0}," (p to expand)")))),iD.createElement(x,{marginLeft:1},iD.createElement(V,{dimColor:!0},pH.arrowLeft," back \xB7 Esc close \xB7 k kill \xB7 s shutdown",F6H()?.supportsHideShow&&" \xB7 h hide/show"," \xB7 ",D," cycle mode")))}function t$B(H){return!H.startsWith("%")}async function RuA(H,$,A,L,I){if(t$B(H))await jA("it2",["session","close",H]);else await jA("tmux",["kill-pane","-t",H]);q4D($,H);let{notificationMessage:D}=Jn($,A,L,"terminated");I((B)=>{if(!B.teamContext?.teammates)return B;if(!(A in B.teamContext.teammates))return B;let{[A]:f,...E}=B.teamContext.teammates;return{...B,teamContext:{...B.teamContext,teammates:E},inbox:{messages:[...B.inbox.messages,{id:a$B.randomUUID(),from:"system",text:yH({type:"teammate_terminated",message:D}),timestamp:new Date().toISOString(),status:"pending"}]}}}),N(`[TeamsDialog] Removed ${A} from teamContext`)}async function Ez1(H){if(t$B(H))await jA("it2",["session","focus",H]);else await jA("tmux",["select-pane","-t",H])}async function Mz1(H,$){if(H.isHidden)await e$B(H,$);else await s$B(H,$)}async function s$B(H,$){}async function e$B(H,$){}function Gz1(H,$,A){XbH($,H,A);let L=T_$({mode:A,from:"team-lead"});K8(H,{from:"team-lead",text:yH(L),timestamp:new Date().toISOString()},$),N(`[TeamsDialog] Sent mode change to ${H}: ${A}`)}function Uz1(H,$,A){let L=H.mode?hN(H.mode):"default",I={...YK(),mode:L,isBypassPermissionsModeAvailable:A},D=oPH(I);Gz1(H.name,$,D)}function Xz1(H,$,A){if(H.length===0)return;let L=H.map((f)=>f.mode?hN(f.mode):"default"),D=!L.every((f)=>f===L[0])?"default":oPH({...YK(),mode:L[0]??"default",isBypassPermissionsModeAvailable:A}),B=H.map((f)=>({memberName:f.name,mode:D}));N4D($,B);for(let f of H){let E=T_$({mode:D,from:"team-lead"});K8(f.name,{from:"team-lead",text:yH(E),timestamp:new Date().toISOString()},$)}N(`[TeamsDialog] Sent mode change to all ${H.length} teammates: ${D}`)}var iD,Tj,a$B;var HAB=K(()=>{xH();$I();FG();s6();jI();r$B();B0();E$();q7();BNH();JG();bB();aY();jS();sU();NuA();yW();pL();Z$();Dx();iD=b(s(),1),Tj=b(s(),1),a$B=require("crypto")});function $AB(H){let $=H.match(/^@([\w-]+)\s+(.+)$/s);if(!$)return null;let[,A,L]=$;if(!A||!L)return null;let I=L.trim();if(!I)return null;return{recipientName:A,message:I}}function AAB(H,$,A,L){if(!A||!L)return{success:!1,error:"no_team_context"};if(!Object.values(A.teammates??{}).find((D)=>D.name===H))return{success:!1,error:"unknown_recipient",recipientName:H};return L(H,{from:"user",text:$,timestamp:new Date().toISOString()},A.teamName),{success:!0,recipientName:H}}function LAB(){let H=J$((L)=>L.gitDiff),[$,A]=H_H.useState(new Map);return H_H.useEffect(()=>{let L=!1;return X3D().then((I)=>{if(!L)A(I)}),()=>{L=!0}},[H.lastUpdated]),H_H.useMemo(()=>{let{stats:L,perFileStats:I}=H,D=[];for(let[B,f]of I){let E=$.get(B),M=f.isUntracked??!1,G=!f.isBinary&&!M&&!E,U=f.added+f.removed,X=!G&&!f.isBinary&&U>Jz1;D.push({path:B,linesAdded:f.added,linesRemoved:f.removed,isBinary:f.isBinary,isLargeFile:G,isTruncated:X,isUntracked:M})}return D.sort((B,f)=>B.path.localeCompare(f.path)),{stats:L,files:D,hunks:$}},[H,$])}var H_H,Jz1=400;var IAB=K(()=>{pL();jkH();H_H=b(s(),1)});function Fz1(H){if(!H||typeof H!=="object")return!1;let $=H,A=typeof $.filePath==="string",L=Array.isArray($.structuredPatch)&&$.structuredPatch.length>0,I=$.type==="create"&&typeof $.content==="string";return A&&(L||I)}function Kz1(H){return"type"in H&&(H.type==="create"||H.type==="update")}function Qz1(H){let $=0,A=0;for(let L of H)for(let I of L.lines)if(I.startsWith("+"))$++;else if(I.startsWith("-"))A++;return{added:$,removed:A}}function Wz1(H){if(H.type!=="user")return"";let $=H.message.content,A=typeof $==="string"?$:"";if(A.length<=30)return A;return A.slice(0,29)+"\u2026"}function DAB(H){let $=0,A=0;for(let L of H.files.values())$+=L.linesAdded,A+=L.linesRemoved;H.stats={filesChanged:H.files.size,linesAdded:$,linesRemoved:A}}function BAB(H){let $=oN$.useRef({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return oN$.useMemo(()=>{let A=$.current;if(H.length0)DAB(A.currentTurn),A.completedTurns.push(A.currentTurn);A.lastTurnIndex++,A.currentTurn={turnIndex:A.lastTurnIndex,userPromptPreview:Wz1(D),timestamp:D.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}}}else if(A.currentTurn&&D.toolUseResult){let f=D.toolUseResult;if(Fz1(f)){let{filePath:E,structuredPatch:M}=f,G="type"in f&&f.type==="create",U=A.currentTurn.files.get(E);if(!U)U={filePath:E,hunks:[],isNewFile:G,linesAdded:0,linesRemoved:0},A.currentTurn.files.set(E,U);if(G&&M.length===0&&Kz1(f)){let J=f.content.split(` Or, resume it later with: ${Z}`})],shouldQuery:!1}}catch(E){let M=E instanceof Error?E.message:String(E);return{messages:[k7(),f,...A,R$({content:`Failed to create background session: ${M}. Try running /login and signing in with a claude.ai account (not Console).`})],shouldQuery:!1}}finally{I(null)}}var YM;var FIB=K(()=>{z$();_L();xH();rwA();iB();ip();YS();H3H();eC$();E$();rB();nM();dU();bw();aI();nC();t8();okA();YM=b(s(),1)});function LgA({input:H,progress:$,verbose:A}){return GO$.default.createElement(x,{flexDirection:"column",marginTop:1},GO$.default.createElement(Q_$,{addMargin:!1,param:{text:`${H}`,type:"text"}}),$?GO$.default.createElement(c_$,{fullOutput:$.fullOutput,output:$.output,elapsedTimeSeconds:$.elapsedTimeSeconds,totalLines:$.totalLines,verbose:A}):aD.renderToolUseProgressMessage([],{verbose:A,tools:[],terminalSize:void 0}))}var GO$;var KIB=K(()=>{xH();cwA();CZA();zQ();GO$=b(s(),1)});async function QIB(H,$,A,L,I,D){yD("bash-mode"),c("tengu_input_bash",{}),D(!0);let B=R$({content:yP({inputString:`${H}`,precedingInputBlocks:$})}),f;I({jsx:jb.createElement(LgA,{input:H,progress:null,verbose:L.options.verbose}),shouldHidePromptInput:!1});try{let E={...L,setToolJSX:(J)=>{f=J?.jsx}},G=(await aD.call({command:H,dangerouslyDisableSandbox:!0},E,void 0,void 0,(J)=>{I({jsx:jb.createElement(jb.Fragment,null,jb.createElement(LgA,{input:H,progress:J.data,verbose:L.options.verbose}),f),shouldHidePromptInput:!1,showSpinner:!1})})).data;if(!G)throw Error("No result received from bash command");let U=G.stderr,X=await L.getAppState();if(Uw$(X.toolPermissionContext))U=Gw$(U);return{messages:[k7(),B,...A,R$({content:`${G.stdout}${U}`})],shouldQuery:!1}}catch(E){if(E instanceof yN){if(E.interrupted)return{messages:[k7(),B,R$({content:Bt}),...A],shouldQuery:!1};return{messages:[k7(),B,...A,R$({content:`${E.stdout}${E.stderr}`})],shouldQuery:!1}}return{messages:[k7(),B,...A,R$({content:`Command failed: ${E instanceof Error?E.message:String(E)}`})],shouldQuery:!1}}finally{I(null)}}var jb;var WIB=K(()=>{z$();_L();_L();KIB();zQ();w3H();w3H();lG();yE();jb=b(s(),1)});function VIB(H,$,A,L,I,D,B,f,E,M){I(!0);let G=typeof H==="string"?H:H.find((F)=>F.type==="text")?.text||"";zhI(G);let U={};if(typeof H==="string"){let F=yzD(H),Q=vzD(H);U={is_negative:F,is_keep_going:Q},pQ("user_prompt",{prompt_length:String(H.length),prompt:rF$(H)})}if(c("tengu_input_prompt",U),$.length>0){let F=typeof H==="string"?H.trim()?[{type:"text",text:H}]:[]:H,Q=R$({content:[...F,...$],uuid:D,thinkingMetadata:B,todos:E,imagePasteIds:A.length>0?A:void 0,permissionMode:M}),W=lg([Q],f??void 0);return{messages:[Q,...L],shouldQuery:!0,maxThinkingTokens:W}}let X=R$({content:H,uuid:D,thinkingMetadata:B,todos:E,permissionMode:M}),J=lg([X],f??void 0);return{messages:[X,...L],shouldQuery:!0,maxThinkingTokens:J}}var PIB=K(()=>{z$();sa();Lo();_L();ig()});async function _IB(){return}async function XO$({input:H,mode:$,setIsLoading:A,setToolJSX:L,context:I,pastedContents:D,ideSelection:B,messages:f,setUserInputOnProcessing:E,uuid:M,isAlreadyProcessing:G,thinkingMetadata:U,manualThinkingTokens:X,querySource:J,canUseTool:F}){let Q=typeof H==="string"?H:null;if($==="prompt"&&Q!==null)E?.(Q);try{_9("query_process_user_input_base_start");let W=await I.getAppState(),P=await RN1(H,$,A,L,I,D,B,f,M,G,U,X,J,W.todos[I.agentId??j$()],F,W.toolPermissionContext.mode);if(_9("query_process_user_input_base_end"),!P.shouldQuery)return P;_9("query_hooks_start");let C=K9H(H)||"";_IB(C,f??[],W);for await(let Y of VNA(C,W.toolPermissionContext.mode,I)){if(Y.message?.type==="progress")continue;if(Y.blockingError){let Z=UNA(Y.blockingError);return{messages:[a7(`${Z} `);if(I(Z)){let O=new Set(W.map((j)=>j.id));B((j)=>({...j,inbox:{messages:j.inbox.messages.filter((u)=>!O.has(u.id))}}))}else N("[InboxPoller] Submission rejected, keeping messages queued")},[H,$,A,I,B,f,D]);let U=H&&!!WO$(D.getState());VF(G,U?dN1:null);let X=Ve.useRef(!1);Ve.useEffect(()=>{if(!H)return;if(X.current)return;if(WO$(D.getState()))X.current=!0,G()},[H,G,D])}var Ve,EgA,dN1=1000;var dIB=K(()=>{s6();sU();XE();h2();EE();C5();yW();aY();E$();pL();xbH();TLH();f6H();Z$();GkH();g7();_L();jS();yh();JG();Ve=b(s(),1),EgA=require("crypto")});var MgA;var cIB=K(()=>{JG();E$();MgA=b(s(),1)});function iIB({autoConnectIdeFlag:H,ideToInstallExtension:$,setDynamicMcpConfig:A,setShowIdeOnboarding:L,setIDEInstallationState:I}){lIB.useEffect(()=>{function D(B){if(!B)return;if(!((M$().autoConnectIde||H||ZF()||$||A$(process.env.CLAUDE_CODE_AUTO_CONNECT_IDE))&&!BE(process.env.CLAUDE_CODE_AUTO_CONNECT_IDE)))return;A((M)=>{if(M?.ide)return M;return{...M,ide:{type:B.url.startsWith("ws:")?"ws-ide":"sse-ide",url:B.url,ideName:B.name,authToken:B.authToken,ideRunningInWindows:B.ideRunningInWindows,scope:"dynamic"}}})}$qI(D,$,()=>L(!0),(B)=>I(B))},[H,$,A,L,I])}var lIB;var nIB=K(()=>{vA();nU();NA();lIB=b(s(),1)});function rIB({onBackgroundSession:H,isLoading:$}){let A=zI(),L=OX(),[I,D]=VO$.useState(!1),B=Lx(D,H,()=>{}),f=VO$.useCallback(()=>{if(A$(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS))return;let G=L.getState();if(OyI(G))pF$(()=>L.getState(),A);else if(process.env.ENABLE_SESSION_BACKGROUNDING==="true"&&$)B()},[A,L,$,B]);BA("task:background",f,{context:"Task"});let E=C0("task:background","Task","ctrl+b"),M=OA.terminal==="tmux"&&E==="ctrl+b"?"ctrl+b ctrl+b":E;if(!$||!I)return null;return O8H.createElement(x,{paddingLeft:2},O8H.createElement(V,{dimColor:!0},O8H.createElement(s$,{shortcut:M,action:"background"})))}var O8H,VO$;var aIB=K(()=>{xH();qSH();pL();_BH();lB();Z1();NA();$I();FG();O8H=b(s(),1),VO$=b(s(),1)});function oIB({setMessages:H,setIsLoading:$,resetLoadingState:A,setAbortController:L}){let I=J$((X)=>X.foregroundedTaskId),D=J$((X)=>X.tasks),B=zI(),f=Pe.useRef(null),E=Pe.useRef(0),M=Pe.useCallback(()=>{if(I){B((X)=>{let J=X.foregroundedTaskId;if(!J)return X;let F=X.tasks[J];if(!F)return{...X,foregroundedTaskId:void 0};return{...X,foregroundedTaskId:void 0,tasks:{...X.tasks,[J]:{...F,isBackgrounded:!0}}}}),H([]),A(),L(null);return}f.current?.resolve()},[I,B,H,A,L]),G=Pe.useCallback((X)=>{f.current?.resolve(),qyI(X,B)},[B]),U=I?D[I]:void 0;return Pe.useEffect(()=>{if(!I){E.current=0;return}if(!U||U.type!=="local_agent"){B((J)=>({...J,foregroundedTaskId:void 0})),A(),E.current=0;return}let X=U.messages??[];if(X.length!==E.current)E.current=X.length,H([...X]);if(U.status==="running"){let J=U.abortController;if(J?.signal.aborted){B((F)=>{if(!F.foregroundedTaskId)return F;let Q=F.tasks[F.foregroundedTaskId];if(!Q)return{...F,foregroundedTaskId:void 0};return{...F,foregroundedTaskId:void 0,tasks:{...F.tasks,[F.foregroundedTaskId]:{...Q,isBackgrounded:!0}}}}),A(),L(null),E.current=0;return}if($(!0),J)L(J)}else B((J)=>{let F=J.foregroundedTaskId;if(!F)return J;let Q=J.tasks[F];if(!Q)return{...J,foregroundedTaskId:void 0};return{...J,foregroundedTaskId:void 0,tasks:{...J.tasks,[F]:{...Q,isBackgrounded:!0}}}}),A(),L(null),E.current=0},[I,U,B,H,$,A,L]),{backgroundSignalRef:f,handleBackgroundSession:M,handleForegroundTask:G}}var Pe;var tIB=K(()=>{pL();mF$();Pe=b(s(),1)});function sIB(H,$){let[A,L]=GgA.default.useState($);return GgA.default.useEffect(()=>{aS(H,$).then(L)},[H,$]),A}var GgA;var eIB=K(()=>{SD();GgA=b(s(),1)});function PO$({hideThanksAfterMs:H,onOpen:$,onSelect:A}){let[L,I]=_e.useState("closed"),D=_e.useRef(UgA.randomUUID()),B=_e.useCallback(()=>{I("thanks"),setTimeout(()=>I("closed"),H)},[H]),f=_e.useCallback(()=>{if(L!=="closed")return;I("open"),D.current=UgA.randomUUID(),$(D.current)},[L,$]),E=_e.useCallback((M)=>{if(M==="dismissed")I("closed");else B();A(D.current,M)},[B,A]);return{state:L,open:f,handleSelect:E}}var UgA,_e;var XgA=K(()=>{UgA=require("crypto"),_e=b(s(),1)});function HDB(H,$,A,L="session",I=!1){let D=OC.useRef("unknown");D.current=$C(H)?.message?.id||"unknown";let B=J$((q)=>q.feedbackSurvey),f=zI(),E=sIB("tengu_feedback_survey_config",cN1),M=OC.useRef(Date.now()),G=OC.useRef(A),U=OC.useRef(A);U.current=A;let X=OC.useCallback((q,O)=>{f((j)=>({...j,feedbackSurvey:{timeLastShown:q,submitCountAtLastAppearance:O}}))},[f]),J=OC.useCallback((q)=>{X(Date.now(),U.current),c("tengu_feedback_survey_event",{event_type:"appeared",appearance_id:q,last_assistant_message_id:D.current,survey_type:L})},[X,L]),F=OC.useCallback((q,O)=>{X(Date.now(),U.current),c("tengu_feedback_survey_event",{event_type:"responded",appearance_id:q,response:O,last_assistant_message_id:D.current,survey_type:L})},[X,L]),{state:Q,open:W,handleSelect:P}=PO$({hideThanksAfterMs:E.hideThanksAfterMs,onOpen:J,onSelect:F}),C=X1(),Y=OC.useMemo(()=>{if(E.onForModels.length===0)return!1;if(E.onForModels.includes("*"))return!0;return E.onForModels.includes(C)},[E.onForModels,C]),Z=OC.useMemo(()=>{if(Q!=="closed")return!1;if($)return!1;if(I)return!1;if(process.env.CLAUDE_FORCE_DISPLAY_SURVEY&&!B.timeLastShown)return!0;if(!Y)return!1;if(A$(process.env.CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY))return!1;if(NP())return!1;if(!PK("allow_product_feedback"))return!1;if(B.timeLastShown){if(B.submitCountAtLastAppearance!==null&&AE.probability)return!1;let q=M$().feedbackSurveyState;if(q?.lastShownTime){if(Date.now()-q.lastShownTime{if(Z)W()},[Z,W]),{state:Q,handleSelect:P}}var OC,cN1;var $DB=K(()=>{eIB();z$();Fo();XY();vA();aI();NA();pL();_L();XgA();OC=b(s(),1),cN1={minTimeBeforeFeedbackMs:600000,minTimeBetweenGlobalFeedbackMs:1e8,minUserTurnsBeforeFeedback:5,minUserTurnsBetweenFeedback:10,hideThanksAfterMs:3000,onForModels:["*"],probability:0.005}});function rN1(H,$){let A=H.findIndex((L)=>L.uuid===$);if(A===-1)return!1;for(let L=A+1;L{let F=Tw$();c("tengu_post_compact_survey_event",{event_type:"appeared",appearance_id:J,session_memory_compaction_enabled:F})},[]),E=QZ.useCallback((J,F)=>{let Q=Tw$();c("tengu_post_compact_survey_event",{event_type:"responded",appearance_id:J,response:F,session_memory_compaction_enabled:Q})},[]),{state:M,open:G,handleSelect:U}=PO$({hideThanksAfterMs:lN1,onOpen:f,onSelect:E});QZ.useEffect(()=>{I(cf(iN1))},[]);let X=QZ.useMemo(()=>new Set(H.filter((J)=>Ez(J)).map((J)=>J.uuid)),[H]);return QZ.useEffect(()=>{if(M!=="closed"||$)return;if(A)return;if(L!==!0)return;if(NP())return;if(A$(process.env.CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY))return;if(B.current!==null){if(rN1(H,B.current)){if(B.current=null,Math.random()!D.current.has(F));if(J.length>0)D.current=new Set(X),B.current=J[J.length-1]},[X,M,$,A,L,H,G]),{state:M,handleSelect:U}}var QZ,lN1=3000,iN1="tengu_post_compact_survey",nN1=0.2;var LDB=K(()=>{SD();z$();Fo();NA();_L();XgA();Nw$();QZ=b(s(),1)});function IDB({onSelect:H,inputValue:$,setInputValue:A,message:L=tN1}){let I=_O$.useRef($);return _O$.useEffect(()=>{if($!==I.current){let D=fFH($.slice(-1));if(JgA(D))A($.slice(0,-1)),H(oN1[D])}},[$,H,A]),VW.default.createElement(x,{flexDirection:"column",marginTop:1},VW.default.createElement(x,null,VW.default.createElement(V,{color:"ansi:cyan"},"\u25CF "),VW.default.createElement(V,{bold:!0},L)),VW.default.createElement(x,{marginLeft:2},VW.default.createElement(x,{width:10},VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"1"),": Bad")),VW.default.createElement(x,{width:10},VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"2"),": Fine")),VW.default.createElement(x,{width:10},VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"3"),": Good")),VW.default.createElement(x,null,VW.default.createElement(V,null,VW.default.createElement(V,{color:"ansi:cyan"},"0"),": Dismiss"))))}var VW,_O$,aN1,oN1,JgA=(H)=>aN1.includes(H),tN1="How is Claude doing this session? (optional)";var DDB=K(()=>{xH();VW=b(s(),1),_O$=b(s(),1),aN1=["0","1","2","3"],oN1={"0":"dismissed","1":"bad","2":"fine","3":"good"}});function FgA({state:H,handleSelect:$,inputValue:A,setInputValue:L,message:I}){if(H==="closed")return null;if(H==="thanks")return KdH.default.createElement(x,{marginTop:1,flexDirection:"column"},KdH.default.createElement(V,{color:"success"},"\u2713 Thanks for helping make Claude better!"),KdH.default.createElement(V,{dimColor:!0},"Use ","/feedback"," to share detailed feedback or file a bug."));if(A&&!JgA(A))return null;return KdH.default.createElement(IDB,{onSelect:$,inputValue:A,setInputValue:L,message:I})}var KdH;var BDB=K(()=>{xH();DDB();KdH=b(s(),1)});function EDB(){let{addNotification:H}=wB();fDB.useEffect(()=>{Db().then(($)=>{$.forEach((A,L)=>{let I="low";if(A.type==="error"||A.userActionRequired)I="high";else if(A.type==="path"||A.type==="alias")I="medium";H({key:`install-message-${L}-${A.type}`,text:A.message,priority:I,color:A.type==="error"?"error":"warning"})})})},[H])}var fDB;var MDB=K(()=>{bE();Lj();fDB=b(s(),1)});function sN1(){if(process.argv.includes("--chrome"))return!0;if(process.argv.includes("--no-chrome"))return!1;return}function GDB(){let{addNotification:H}=wB();lz.useEffect(()=>{let $=sN1();if(!eT$($))return;if(!nL()){H({key:"chrome-requires-subscription",jsx:lz.createElement(V,{color:"error"},"Claude in Chrome requires a claude.ai subscription"),priority:"immediate",timeoutMs:5000});return}Vd().then((A)=>{if(!A&&!plA())H({key:"chrome-extension-not-detected",jsx:lz.createElement(lz.Fragment,null,lz.createElement(V,{color:"warning"},"Chrome extension not detected \xB7 https://claude.ai/chrome to install")),priority:"immediate",timeoutMs:3000});else if($===void 0)H({key:"claude-in-chrome-default-enabled",text:"Claude in Chrome enabled \xB7 /chrome",priority:"low"})}).catch((A)=>{r(A)})},[H])}var lz;var UDB=K(()=>{xH();H8H();bE();_$();EI();NA();lz=b(s(),1)});function eN1(){return A$(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)}function XDB(H){let $=YO$.INITIAL_DELAY_MS*Math.pow(YO$.BACKOFF_MULTIPLIER,H);return Math.min($,YO$.MAX_DELAY_MS)}function HO1(H){if(!H.officialMarketplaceAutoInstallAttempted)return!0;if(H.officialMarketplaceAutoInstalled)return!1;let $=H.officialMarketplaceAutoInstallFailReason,A=H.officialMarketplaceAutoInstallRetryCount||0,L=H.officialMarketplaceAutoInstallNextRetryTime,I=Date.now();if(A>=YO$.MAX_ATTEMPTS)return!1;if($==="policy_blocked")return!1;if(L&&I({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"policy_blocked"})),c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,policy_blocked:!0}),{installed:!1,skipped:!0,reason:"policy_blocked"};if((await l1())[r1H])return N(`Official marketplace '${r1H}' already installed, skipping`),AA((I)=>({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!0})),{installed:!1,skipped:!0,reason:"already_installed"};if(!vDH(VvA))return N("Official marketplace blocked by enterprise policy, skipping"),AA((I)=>({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"policy_blocked"})),c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,policy_blocked:!0}),{installed:!1,skipped:!0,reason:"policy_blocked"};if(!await pX$()){N("Git not available, skipping official marketplace auto-install");let I=(H.officialMarketplaceAutoInstallRetryCount||0)+1,D=Date.now(),B=XDB(I),f=D+B,E=!1;try{AA((M)=>({...M,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"git_unavailable",officialMarketplaceAutoInstallRetryCount:I,officialMarketplaceAutoInstallLastAttemptTime:D,officialMarketplaceAutoInstallNextRetryTime:f}))}catch(M){E=!0;let G=M instanceof Error?M:Error(`Failed to save marketplace auto-install git_unavailable state: ${M}`);r(G),N(`Failed to save marketplace auto-install git_unavailable state: ${M}`,{level:"error"})}return c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,git_unavailable:!0,retry_count:I}),{installed:!1,skipped:!0,reason:"git_unavailable",configSaveFailed:E}}N("Attempting to auto-install official marketplace"),await uw(VvA),N("Successfully auto-installed official marketplace");let L=H.officialMarketplaceAutoInstallRetryCount||0;return AA((I)=>({...I,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!0,officialMarketplaceAutoInstallFailReason:void 0,officialMarketplaceAutoInstallRetryCount:void 0,officialMarketplaceAutoInstallLastAttemptTime:void 0,officialMarketplaceAutoInstallNextRetryTime:void 0})),c("tengu_official_marketplace_auto_install",{installed:!0,skipped:!1,retry_count:L}),{installed:!0,skipped:!1}}catch($){let A=$ instanceof Error?$.message:String($);N(`Failed to auto-install official marketplace: ${A}`,{level:"error"}),r($ instanceof Error?$:Error(`Official marketplace auto-install failed: ${A}`));let L=(H.officialMarketplaceAutoInstallRetryCount||0)+1,I=Date.now(),D=XDB(L),B=I+D,f=!1;try{AA((E)=>({...E,officialMarketplaceAutoInstallAttempted:!0,officialMarketplaceAutoInstalled:!1,officialMarketplaceAutoInstallFailReason:"unknown",officialMarketplaceAutoInstallRetryCount:L,officialMarketplaceAutoInstallLastAttemptTime:I,officialMarketplaceAutoInstallNextRetryTime:B}))}catch(E){f=!0;let M=E instanceof Error?E:Error(`Failed to save marketplace auto-install failure state: ${E}`);r(M),N(`Failed to save marketplace auto-install failure state: ${E}`,{level:"error"})}return c("tengu_official_marketplace_auto_install",{installed:!1,skipped:!0,failed:!0,retry_count:L}),{installed:!1,skipped:!0,reason:"unknown",configSaveFailed:f}}}var YO$;var KgA=K(()=>{hT$();kKA();Ja();y4();vA();E$();_$();z$();NA();YO$={MAX_ATTEMPTS:10,INITIAL_DELAY_MS:3600000,BACKOFF_MULTIPLIER:2,MAX_DELAY_MS:604800000}});function JDB(){let{addNotification:H}=wB(),$=WZ.useRef(!1);WZ.useEffect(()=>{if($.current)return;$.current=!0,CO$().then((A)=>{if(A.configSaveFailed)N("Showing marketplace config save failure notification"),H({key:"marketplace-config-save-failed",jsx:WZ.createElement(V,{color:"error"},"Failed to save marketplace retry info \xB7 Check ~/.claude.json permissions"),priority:"immediate",timeoutMs:1e4});if(A.installed)N("Showing marketplace installation success notification"),H({key:"marketplace-installed",jsx:WZ.createElement(V,{color:"success"},"\u2713 Anthropic marketplace installed \xB7 /plugin to see available plugins"),priority:"immediate",timeoutMs:7000});else if(A.skipped&&A.reason==="unknown")N("Showing marketplace installation failure notification"),H({key:"marketplace-install-failed",jsx:WZ.createElement(V,{color:"warning"},"Failed to install Anthropic marketplace \xB7 Will retry on next startup"),priority:"immediate",timeoutMs:8000});else if(A.skipped&&A.reason==="git_unavailable")N("Showing marketplace git unavailable notification"),H({key:"marketplace-git-unavailable",jsx:WZ.createElement(V,{color:"warning"},"Anthropic marketplace requires git \xB7 Install git and restart"),priority:"immediate",timeoutMs:8000})}).catch((A)=>{r(A instanceof Error?A:Error(String(A)))})},[H])}var WZ;var FDB=K(()=>{xH();bE();KgA();_$();E$();WZ=b(s(),1)});function KDB(H,$,A){let L=QdH.useRef(void 0);QdH.useEffect(()=>{return},[H,$]),QdH.useEffect(()=>{let I=H.find((B)=>B.type==="connected"&&B.name===dw);if(!I)return;Vx("set_permission_mode",{mode:A==="bypassPermissions"?"skip_all_permission_checks":"ask"},I)},[H,A])}var QdH,$O1;var QDB=K(()=>{mI();_$();CP();nS();f3();QdH=b(s(),1),$O1=S.object({method:S.literal("notifications/message"),params:S.object({prompt:S.string(),image:S.object({type:S.literal("base64"),media_type:S.enum(["image/jpeg","image/png","image/gif","image/webp"]),data:S.string()}).optional(),tabId:S.number().optional()})})});function WDB(){return M$().tipsHistory||{}}function AO1(H){AA(($)=>{if($.tipsHistory===H)return $;return{...$,tipsHistory:H}})}function VDB(H){let $=WDB(),A=M$().numStartups;$[H]=A,AO1($)}function LO1(H){return WDB()[H]||0}function wO$(H){let $=LO1(H);if($===0)return 1/0;return M$().numStartups-$}var QgA=K(()=>{vA()});async function DO1(){return"claude-code-plugins"in await l1()}async function ZO$(H){let $=[...BO1,...fO1],A=await Promise.all($.map((L)=>L.isRelevant(H)));return $.filter((L,I)=>A[I]).filter((L)=>wO$(L.id)>=L.cooldownSessions)}var BO1,fO1;var WgA=K(()=>{r0();vA();t8();Q7();y4();aI();Tq$();BDH();Z1();nU();Z9();ZgH();FG();mL();QgA();rB();AC();E$();Cn();Y7();Jd();rgH();AJ();BO1=[{id:"new-user-warmup",content:async()=>"Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits",cooldownSessions:3,async isRelevant(){return M$().numStartups<10}},{id:"plan-mode-for-complex-tasks",content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${CQ("chat:cycleMode","Chat","shift+tab")} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let H=M$();return(H.lastPlanModeUse?(Date.now()-H.lastPlanModeUse)/86400000:1/0)>7}},{id:"default-permission-mode-config",content:async()=>"Use /config to change your default permission mode (including Plan Mode)",cooldownSessions:10,isRelevant:async()=>{try{let H=M$(),$=VL(),A=Boolean(H.lastPlanModeUse),L=Boolean($?.permissions?.defaultMode);return A&&!L}catch(H){return N(`Failed to check default-permission-mode-config tip relevance: ${H}`,{level:"warn"}),!1}}},{id:"git-worktrees",content:async()=>"Use git worktrees to run multiple Claude sessions in parallel.",cooldownSessions:10,isRelevant:async()=>{try{let H=M$();return await VwH()<=1&&H.numStartups>50}catch(H){return!1}}},{id:"terminal-setup",content:async()=>OA.terminal==="Apple_Terminal"?"Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more":"Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more",cooldownSessions:10,async isRelevant(){let H=M$();if(OA.terminal==="Apple_Terminal")return q1H.isEnabled()&&!H.optionAsMetaKeyInstalled;return q1H.isEnabled()&&!H.shiftEnterKeyBindingInstalled}},{id:"shift-enter",content:async()=>OA.terminal==="Apple_Terminal"?"Press Option+Enter to send a multi-line message":"Press Shift+Enter to send a multi-line message",cooldownSessions:10,async isRelevant(){let H=M$();return Boolean((OA.terminal==="Apple_Terminal"?H.optionAsMetaKeyInstalled:H.shiftEnterKeyBindingInstalled)&&H.numStartups>3)}},{id:"shift-enter-setup",content:async()=>OA.terminal==="Apple_Terminal"?"Run /terminal-setup to enable Option+Enter for new lines":"Run /terminal-setup to enable Shift+Enter for new lines",cooldownSessions:10,async isRelevant(){if(!AFH())return!1;let H=M$();return!(OA.terminal==="Apple_Terminal"?H.optionAsMetaKeyInstalled:H.shiftEnterKeyBindingInstalled)}},{id:"memory-command",content:async()=>"Use /memory to view and manage Claude memory",cooldownSessions:15,async isRelevant(){return M$().memoryUsageCount<=0}},{id:"theme-command",content:async()=>"Use /theme to change the color theme",cooldownSessions:20,isRelevant:async()=>!0},{id:"colorterm-truecolor",content:async()=>"Try setting environment variable COLORTERM=truecolor for richer colors",cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&oH.level<3},{id:"status-line",content:async()=>"Use /statusline to set up a custom status line that will display beneath the input box",cooldownSessions:25,isRelevant:async()=>VL().statusLine===void 0},{id:"prompt-queue",content:async()=>"Hit Enter to queue up additional messages while Claude is working.",cooldownSessions:5,async isRelevant(){return M$().promptQueueUseCount<=3}},{id:"enter-to-steer-in-relatime",content:async()=>"Send messages to Claude while it works to steer Claude in real-time",cooldownSessions:20,isRelevant:async()=>!0},{id:"todo-list",content:async()=>"Ask Claude to create a todo list when working on complex tasks to track progress and remain on track",cooldownSessions:20,isRelevant:async()=>!0},{id:"vscode-command-install",content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${OA.terminal==="vscode"?"code":OA.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!njH())return!1;if(oA()!=="macos")return!1;switch(OA.terminal){case"vscode":return!await sZI();case"cursor":return!await oZI();case"windsurf":return!await tZI();default:return!1}}},{id:"ide-upsell-external-terminal",content:async()=>"Connect Claude to your IDE \xB7 /ide",cooldownSessions:4,async isRelevant(){if(ZF())return!1;if(xX$().length!==0)return!1;return(await eZI()).length>0}},{id:"install-github-app",content:async()=>"Run /install-github-app to tag @claude right from your Github issues and PRs",cooldownSessions:10,isRelevant:async()=>!M$().githubActionSetupCount},{id:"install-slack-app",content:async()=>"Run /install-slack-app to use Claude in Slack",cooldownSessions:10,isRelevant:async()=>!M$().slackAppInstallCount},{id:"permissions",content:async()=>"Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools",cooldownSessions:10,async isRelevant(){return M$().numStartups>10}},{id:"drag-and-drop-images",content:async()=>"Did you know you can drag and drop image files into your terminal?",cooldownSessions:10,isRelevant:async()=>!OA.isSSH()},{id:"paste-images-mac",content:async()=>"Paste images into Claude Code using control+v (not cmd+v!)",cooldownSessions:10,isRelevant:async()=>oA()==="macos"},{id:"double-esc",content:async()=>"Double-tap esc to rewind the conversation to a previous point in time",cooldownSessions:10,isRelevant:async()=>!gE()},{id:"double-esc-code-restore",content:async()=>"Double-tap esc to rewind the code and/or conversation to a previous point in time",cooldownSessions:10,isRelevant:async()=>gE()},{id:"continue",content:async()=>"Run claude --continue or claude --resume to resume a conversation",cooldownSessions:10,isRelevant:async()=>!0},{id:"rename-conversation",content:async()=>"Name your conversations with /rename to find them easily in /resume later",cooldownSessions:15,isRelevant:async()=>Kd()&&M$().numStartups>10},{id:"custom-commands",content:async()=>"Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project",cooldownSessions:15,async isRelevant(){return M$().numStartups>10}},{id:"shift-tab",content:async()=>`Hit ${CQ("chat:cycleMode","Chat","shift+tab")} to cycle between default mode, auto-accept edit mode, and plan mode`,cooldownSessions:10,isRelevant:async()=>!0},{id:"image-paste",content:async()=>`Use ${e3H.displayText} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:"custom-agents",content:async()=>"Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer",cooldownSessions:15,async isRelevant(){return M$().numStartups>5}},{id:"agent-flag",content:async()=>"Use --agent to directly start a conversation with a subagent",cooldownSessions:15,async isRelevant(){return M$().numStartups>5}},{id:"desktop-app",content:async()=>"Run Claude Code locally or remotely using the Claude desktop app: clau.de/desktop",cooldownSessions:15,isRelevant:async()=>oA()!=="linux"},{id:"web-app",content:async()=>"Use Claude Code on the web: clau.de/web",cooldownSessions:15,isRelevant:async()=>!0},{id:"mobile-app",content:async()=>"Use /mobile to get Claude on your phone",cooldownSessions:15,isRelevant:async()=>!0},{id:"opusplan-mode-reminder",content:async()=>`Your default model setting is Opus Plan Mode. Press ${CQ("chat:cycleMode","Chat","shift+tab")} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){let H=M$(),A=DLH()==="opusplan",L=H.lastPlanModeUse?(Date.now()-H.lastPlanModeUse)/86400000:1/0;return A&&L>3}},{id:"frontend-design-plugin",content:async(H)=>{let $=await DO1(),A=ZL("suggestion",H.theme);if(!$)return`Working with HTML/CSS? Add the frontend-design plugin: ${A("/plugin marketplace add anthropics/claude-code")} ${A("/plugin install frontend-design@claude-code-plugins")}`;return`Working with HTML/CSS? Install the frontend-design plugin: ${A("/plugin install frontend-design@claude-code-plugins")}`},cooldownSessions:3,async isRelevant(H){if(K7("frontend-design@claude-code-plugins"))return!1;if(!H?.readFileState)return!1;return yx(H.readFileState).some((A)=>/\.(html|css|htm)$/i.test(A))}},{id:"guest-passes",content:async(H)=>{let $=ZL("claude",H.theme),A=ys();return A?`Share Claude Code and earn ${$(Rs(A))} of extra usage \xB7 ${$("/passes")}`:`You have free guest passes to share \xB7 ${$("/passes")}`},cooldownSessions:3,isRelevant:async()=>{if(M$().hasVisitedPasses)return!1;let{eligible:$}=wT$();return $}},{id:"overage-promo",content:async(H)=>{let $=ZL("claude",H.theme);if(cD()&&Z4())return`${$("$50 free extra usage")} to try fast mode /extra-usage to enable`;return`${$("$50 free extra usage")} \xB7 /extra-usage to enable`},cooldownSessions:3,isRelevant:async()=>ngH()}],fO1=[]});function EO1(H){if(H.length===0)return;if(H.length===1)return H[0];let $=H.map((A)=>({tip:A,sessions:wO$(A.id)}));return $.sort((A,L)=>L.sessions-A.sessions),$[0]?.tip}async function PDB(H){if(VL().spinnerTipsEnabled===!1)return;let $=await ZO$(H);if($.length===0)return;return EO1($)}function _DB(H){VDB(H.id),c("tengu_tip_shown",{tipIdLength:H.id,cooldownSessions:H.cooldownSessions})}var YDB=K(()=>{QgA();z$();mL();WgA()});function wDB(){let H=J$((A)=>A.toolPermissionContext),$=zI();CDB.useEffect(()=>{VgA(H,$)},[])}var CDB,VgA;var ZDB=K(()=>{tD();pL();cg();CDB=b(s(),1),VgA=o$(async(H,$)=>{if(!H.isBypassPermissionsModeAvailable)return;if(!await xbA())return;$((L)=>{return{...L,toolPermissionContext:PFH(L.toolPermissionContext)}})})});function qDB(H,$,A){let L=qO$.useRef(!1);qO$.useEffect(()=>{if(!gE()||L.current)return;if(L.current=!0,H)hY$(H,A)},[$,H,A])}var qO$;var TDB=K(()=>{AC();qO$=b(s(),1)});function PgA({hostPattern:{host:H},onUserResponse:$}){function A(D){switch(D){case"yes":$({allow:!0,persistToSettings:!1});break;case"yes-dont-ask-again":$({allow:!0,persistToSettings:!0});break;case"no":$({allow:!1,persistToSettings:!1});break}}let L=PzH(),I=[{label:"Yes",value:"yes"},...!L?[{label:kG.createElement(V,null,"Yes, and don't ask again for ",kG.createElement(V,{bold:!0},H)),value:"yes-dont-ask-again"}]:[],{label:kG.createElement(V,null,"No, and tell Claude what to do differently ",kG.createElement(V,{bold:!0},"(esc)")),value:"no"}];return kG.createElement(wG,{title:"Network request outside of sandbox"},kG.createElement(x,{flexDirection:"column",paddingX:2,paddingY:1},kG.createElement(x,null,kG.createElement(V,{dimColor:!0},"Host:"),kG.createElement(V,null," ",H)),kG.createElement(x,{marginTop:1},kG.createElement(V,null,"Do you want to allow this connection?")),kG.createElement(x,null,kG.createElement(QA,{options:I,onChange:A,onCancel:()=>{$({allow:!1,persistToSettings:!1})}}))))}var kG;var zDB=K(()=>{xH();EM();N1();Xw();z$();kG=b(s(),1)});var MO1,KhG,TO$=604800000,NDB=86400000,_gA;var WdH=K(()=>{MO1=Math.pow(10,8)*24*60*60*1000,KhG=-MO1,_gA=Symbol.for("constructDateFrom")});function xC(H,$){if(typeof H==="function")return H($);if(H&&typeof H==="object"&&_gA in H)return H[_gA]($);if(H instanceof Date)return new H.constructor($);return new Date($)}var Ye=K(()=>{WdH()});function cX(H,$){return xC($||H,H)}var VZ=K(()=>{Ye()});var ODB=()=>{};var xDB=()=>{};var SDB=()=>{};var jDB=()=>{};var RDB=()=>{};var yDB=()=>{};var vDB=()=>{};var hDB=()=>{};var bDB=()=>{};function Ce(){return GO1}var GO1;var VdH=K(()=>{GO1={}});function gd(H,$){let A=Ce(),L=$?.weekStartsOn??$?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,I=cX(H,$?.in),D=I.getDay(),B=(D{VdH();VZ()});function x8H(H,$){return gd(H,{...$,weekStartsOn:1})}var PdH=K(()=>{I_H()});function zO$(H,$){let A=cX(H,$?.in),L=A.getFullYear(),I=xC(A,0);I.setFullYear(L+1,0,4),I.setHours(0,0,0,0);let D=x8H(I),B=xC(A,0);B.setFullYear(L,0,4),B.setHours(0,0,0,0);let f=x8H(B);if(A.getTime()>=D.getTime())return L+1;else if(A.getTime()>=f.getTime())return L;else return L-1}var NO$=K(()=>{Ye();PdH();VZ()});function YgA(H){let $=cX(H),A=new Date(Date.UTC($.getFullYear(),$.getMonth(),$.getDate(),$.getHours(),$.getMinutes(),$.getSeconds(),$.getMilliseconds()));return A.setUTCFullYear($.getFullYear()),+H-+A}var kDB=K(()=>{VZ()});function uDB(H,...$){let A=xC.bind(null,H||$.find((L)=>typeof L==="object"));return $.map(A)}var gDB=K(()=>{Ye()});function CgA(H,$){let A=cX(H,$?.in);return A.setHours(0,0,0,0),A}var wgA=K(()=>{VZ()});function mDB(H,$,A){let[L,I]=uDB(A?.in,H,$),D=CgA(L),B=CgA(I),f=+D-YgA(D),E=+B-YgA(B);return Math.round((f-E)/NDB)}var ZgA=K(()=>{kDB();gDB();WdH();wgA()});function pDB(H,$){let A=zO$(H,$),L=xC($?.in||H,0);return L.setFullYear(A,0,4),L.setHours(0,0,0,0),x8H(L)}var qgA=K(()=>{Ye();NO$();PdH()});var dDB=()=>{};var cDB=()=>{};var lDB=()=>{};var iDB=()=>{};var nDB=()=>{};var rDB=()=>{};var aDB=()=>{};var oDB=()=>{};var tDB=()=>{};var sDB=()=>{};var eDB=()=>{};var HBB=()=>{};var $BB=()=>{};var ABB=()=>{};var LBB=()=>{};var IBB=()=>{};var DBB=()=>{};var BBB=()=>{};function fBB(H){return H instanceof Date||typeof H==="object"&&Object.prototype.toString.call(H)==="[object Date]"}var TgA=()=>{};function EBB(H){return!(!fBB(H)&&typeof H!=="number"||isNaN(+cX(H)))}var zgA=K(()=>{TgA();VZ()});var MBB=()=>{};var GBB=()=>{};var UBB=()=>{};var XBB=()=>{};var JBB=()=>{};var FBB=()=>{};var KBB=()=>{};var QBB=()=>{};var WBB=()=>{};var VBB=()=>{};var PBB=()=>{};var _BB=()=>{};var YBB=()=>{};var CBB=()=>{};var wBB=()=>{};var ZBB=()=>{};var qBB=()=>{};var TBB=()=>{};var zBB=()=>{};var NBB=()=>{};var OBB=()=>{};var xBB=()=>{};var SBB=()=>{};var jBB=()=>{};var RBB=()=>{};var yBB=()=>{};var vBB=()=>{};var hBB=()=>{};var bBB=()=>{};var kBB=()=>{};var uBB=()=>{};var gBB=()=>{};var mBB=()=>{};function pBB(H,$){let A=cX(H,$?.in);return A.setFullYear(A.getFullYear(),0,1),A.setHours(0,0,0,0),A}var NgA=K(()=>{VZ()});var dBB=()=>{};var cBB=()=>{};var lBB=()=>{};var iBB=()=>{};var nBB=()=>{};var rBB=()=>{};var aBB=()=>{};var oBB=()=>{};var tBB=()=>{};var sBB=()=>{};var eBB=()=>{};var H0B=()=>{};var $0B=()=>{};var UO1,A0B=(H,$,A)=>{let L,I=UO1[H];if(typeof I==="string")L=I;else if($===1)L=I.one;else L=I.other.replace("{{count}}",$.toString());if(A?.addSuffix)if(A.comparison&&A.comparison>0)return"in "+L;else return L+" ago";return L};var L0B=K(()=>{UO1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}}});function OO$(H){return($={})=>{let A=$.width?String($.width):H.defaultWidth;return H.formats[A]||H.formats[H.defaultWidth]}}var XO1,JO1,FO1,I0B;var D0B=K(()=>{XO1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},JO1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FO1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},I0B={date:OO$({formats:XO1,defaultWidth:"full"}),time:OO$({formats:JO1,defaultWidth:"full"}),dateTime:OO$({formats:FO1,defaultWidth:"full"})}});var KO1,B0B=(H,$,A,L)=>KO1[H];var f0B=K(()=>{KO1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"}});function D_H(H){return($,A)=>{let L=A?.context?String(A.context):"standalone",I;if(L==="formatting"&&H.formattingValues){let B=H.defaultFormattingWidth||H.defaultWidth,f=A?.width?String(A.width):B;I=H.formattingValues[f]||H.formattingValues[B]}else{let B=H.defaultWidth,f=A?.width?String(A.width):H.defaultWidth;I=H.values[f]||H.values[B]}let D=H.argumentCallback?H.argumentCallback($):$;return I[D]}}var QO1,WO1,VO1,PO1,_O1,YO1,CO1=(H,$)=>{let A=Number(H),L=A%100;if(L>20||L<10)switch(L%10){case 1:return A+"st";case 2:return A+"nd";case 3:return A+"rd"}return A+"th"},E0B;var M0B=K(()=>{QO1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},WO1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},VO1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},PO1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_O1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},YO1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},E0B={ordinalNumber:CO1,era:D_H({values:QO1,defaultWidth:"wide"}),quarter:D_H({values:WO1,defaultWidth:"wide",argumentCallback:(H)=>H-1}),month:D_H({values:VO1,defaultWidth:"wide"}),day:D_H({values:PO1,defaultWidth:"wide"}),dayPeriod:D_H({values:_O1,defaultWidth:"wide",formattingValues:YO1,defaultFormattingWidth:"wide"})}});function B_H(H){return($,A={})=>{let L=A.width,I=L&&H.matchPatterns[L]||H.matchPatterns[H.defaultMatchWidth],D=$.match(I);if(!D)return null;let B=D[0],f=L&&H.parsePatterns[L]||H.parsePatterns[H.defaultParseWidth],E=Array.isArray(f)?ZO1(f,(U)=>U.test(B)):wO1(f,(U)=>U.test(B)),M;M=H.valueCallback?H.valueCallback(E):E,M=A.valueCallback?A.valueCallback(M):M;let G=$.slice(B.length);return{value:M,rest:G}}}function wO1(H,$){for(let A in H)if(Object.prototype.hasOwnProperty.call(H,A)&&$(H[A]))return A;return}function ZO1(H,$){for(let A=0;A{let L=$.match(H.matchPattern);if(!L)return null;let I=L[0],D=$.match(H.parsePattern);if(!D)return null;let B=H.valueCallback?H.valueCallback(D[0]):D[0];B=A.valueCallback?A.valueCallback(B):B;let f=$.slice(I.length);return{value:B,rest:f}}}var qO1,TO1,zO1,NO1,OO1,xO1,SO1,jO1,RO1,yO1,vO1,hO1,U0B;var X0B=K(()=>{qO1=/^(\d+)(th|st|nd|rd)?/i,TO1=/\d+/i,zO1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},NO1={any:[/^b/i,/^(a|c)/i]},OO1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xO1={any:[/1/i,/2/i,/3/i,/4/i]},SO1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jO1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},RO1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},yO1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vO1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hO1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},U0B={ordinalNumber:G0B({matchPattern:qO1,parsePattern:TO1,valueCallback:(H)=>parseInt(H,10)}),era:B_H({matchPatterns:zO1,defaultMatchWidth:"wide",parsePatterns:NO1,defaultParseWidth:"any"}),quarter:B_H({matchPatterns:OO1,defaultMatchWidth:"wide",parsePatterns:xO1,defaultParseWidth:"any",valueCallback:(H)=>H+1}),month:B_H({matchPatterns:SO1,defaultMatchWidth:"wide",parsePatterns:jO1,defaultParseWidth:"any"}),day:B_H({matchPatterns:RO1,defaultMatchWidth:"wide",parsePatterns:yO1,defaultParseWidth:"any"}),dayPeriod:B_H({matchPatterns:vO1,defaultMatchWidth:"any",parsePatterns:hO1,defaultParseWidth:"any"})}});var OgA;var J0B=K(()=>{L0B();D0B();f0B();M0B();X0B();OgA={code:"en-US",formatDistance:A0B,formatLong:I0B,formatRelative:B0B,localize:E0B,match:U0B,options:{weekStartsOn:0,firstWeekContainsDate:1}}});var F0B=K(()=>{J0B()});function K0B(H,$){let A=cX(H,$?.in);return mDB(A,pBB(A))+1}var xgA=K(()=>{ZgA();NgA();VZ()});function Q0B(H,$){let A=cX(H,$?.in),L=+x8H(A)-+pDB(A);return Math.round(L/TO$)+1}var SgA=K(()=>{WdH();PdH();qgA();VZ()});function xO$(H,$){let A=cX(H,$?.in),L=A.getFullYear(),I=Ce(),D=$?.firstWeekContainsDate??$?.locale?.options?.firstWeekContainsDate??I.firstWeekContainsDate??I.locale?.options?.firstWeekContainsDate??1,B=xC($?.in||H,0);B.setFullYear(L+1,0,D),B.setHours(0,0,0,0);let f=gd(B,$),E=xC($?.in||H,0);E.setFullYear(L,0,D),E.setHours(0,0,0,0);let M=gd(E,$);if(+A>=+f)return L+1;else if(+A>=+M)return L;else return L-1}var SO$=K(()=>{VdH();Ye();I_H();VZ()});function W0B(H,$){let A=Ce(),L=$?.firstWeekContainsDate??$?.locale?.options?.firstWeekContainsDate??A.firstWeekContainsDate??A.locale?.options?.firstWeekContainsDate??1,I=xO$(H,$),D=xC($?.in||H,0);return D.setFullYear(I,0,L),D.setHours(0,0,0,0),gd(D,$)}var jgA=K(()=>{VdH();Ye();SO$();I_H()});function V0B(H,$){let A=cX(H,$?.in),L=+gd(A,$)-+W0B(A,$);return Math.round(L/TO$)+1}var RgA=K(()=>{WdH();I_H();jgA();VZ()});function _E(H,$){let A=H<0?"-":"",L=Math.abs(H).toString().padStart($,"0");return A+L}var md;var P0B=K(()=>{md={y(H,$){let A=H.getFullYear(),L=A>0?A:1-A;return _E($==="yy"?L%100:L,$.length)},M(H,$){let A=H.getMonth();return $==="M"?String(A+1):_E(A+1,2)},d(H,$){return _E(H.getDate(),$.length)},a(H,$){let A=H.getHours()/12>=1?"pm":"am";switch($){case"a":case"aa":return A.toUpperCase();case"aaa":return A;case"aaaaa":return A[0];case"aaaa":default:return A==="am"?"a.m.":"p.m."}},h(H,$){return _E(H.getHours()%12||12,$.length)},H(H,$){return _E(H.getHours(),$.length)},m(H,$){return _E(H.getMinutes(),$.length)},s(H,$){return _E(H.getSeconds(),$.length)},S(H,$){let A=$.length,L=H.getMilliseconds(),I=Math.trunc(L*Math.pow(10,A-3));return _E(I,$.length)}}});function _0B(H,$=""){let A=H>0?"-":"+",L=Math.abs(H),I=Math.trunc(L/60),D=L%60;if(D===0)return A+String(I);return A+String(I)+$+_E(D,2)}function Y0B(H,$){if(H%60===0)return(H>0?"-":"+")+_E(Math.abs(H)/60,2);return S8H(H,$)}function S8H(H,$=""){let A=H>0?"-":"+",L=Math.abs(H),I=_E(Math.trunc(L/60),2),D=_E(L%60,2);return A+I+$+D}var f_H,ygA;var C0B=K(()=>{xgA();SgA();NO$();RgA();SO$();P0B();f_H={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ygA={G:function(H,$,A){let L=H.getFullYear()>0?1:0;switch($){case"G":case"GG":case"GGG":return A.era(L,{width:"abbreviated"});case"GGGGG":return A.era(L,{width:"narrow"});case"GGGG":default:return A.era(L,{width:"wide"})}},y:function(H,$,A){if($==="yo"){let L=H.getFullYear(),I=L>0?L:1-L;return A.ordinalNumber(I,{unit:"year"})}return md.y(H,$)},Y:function(H,$,A,L){let I=xO$(H,L),D=I>0?I:1-I;if($==="YY"){let B=D%100;return _E(B,2)}if($==="Yo")return A.ordinalNumber(D,{unit:"year"});return _E(D,$.length)},R:function(H,$){let A=zO$(H);return _E(A,$.length)},u:function(H,$){let A=H.getFullYear();return _E(A,$.length)},Q:function(H,$,A){let L=Math.ceil((H.getMonth()+1)/3);switch($){case"Q":return String(L);case"QQ":return _E(L,2);case"Qo":return A.ordinalNumber(L,{unit:"quarter"});case"QQQ":return A.quarter(L,{width:"abbreviated",context:"formatting"});case"QQQQQ":return A.quarter(L,{width:"narrow",context:"formatting"});case"QQQQ":default:return A.quarter(L,{width:"wide",context:"formatting"})}},q:function(H,$,A){let L=Math.ceil((H.getMonth()+1)/3);switch($){case"q":return String(L);case"qq":return _E(L,2);case"qo":return A.ordinalNumber(L,{unit:"quarter"});case"qqq":return A.quarter(L,{width:"abbreviated",context:"standalone"});case"qqqqq":return A.quarter(L,{width:"narrow",context:"standalone"});case"qqqq":default:return A.quarter(L,{width:"wide",context:"standalone"})}},M:function(H,$,A){let L=H.getMonth();switch($){case"M":case"MM":return md.M(H,$);case"Mo":return A.ordinalNumber(L+1,{unit:"month"});case"MMM":return A.month(L,{width:"abbreviated",context:"formatting"});case"MMMMM":return A.month(L,{width:"narrow",context:"formatting"});case"MMMM":default:return A.month(L,{width:"wide",context:"formatting"})}},L:function(H,$,A){let L=H.getMonth();switch($){case"L":return String(L+1);case"LL":return _E(L+1,2);case"Lo":return A.ordinalNumber(L+1,{unit:"month"});case"LLL":return A.month(L,{width:"abbreviated",context:"standalone"});case"LLLLL":return A.month(L,{width:"narrow",context:"standalone"});case"LLLL":default:return A.month(L,{width:"wide",context:"standalone"})}},w:function(H,$,A,L){let I=V0B(H,L);if($==="wo")return A.ordinalNumber(I,{unit:"week"});return _E(I,$.length)},I:function(H,$,A){let L=Q0B(H);if($==="Io")return A.ordinalNumber(L,{unit:"week"});return _E(L,$.length)},d:function(H,$,A){if($==="do")return A.ordinalNumber(H.getDate(),{unit:"date"});return md.d(H,$)},D:function(H,$,A){let L=K0B(H);if($==="Do")return A.ordinalNumber(L,{unit:"dayOfYear"});return _E(L,$.length)},E:function(H,$,A){let L=H.getDay();switch($){case"E":case"EE":case"EEE":return A.day(L,{width:"abbreviated",context:"formatting"});case"EEEEE":return A.day(L,{width:"narrow",context:"formatting"});case"EEEEEE":return A.day(L,{width:"short",context:"formatting"});case"EEEE":default:return A.day(L,{width:"wide",context:"formatting"})}},e:function(H,$,A,L){let I=H.getDay(),D=(I-L.weekStartsOn+8)%7||7;switch($){case"e":return String(D);case"ee":return _E(D,2);case"eo":return A.ordinalNumber(D,{unit:"day"});case"eee":return A.day(I,{width:"abbreviated",context:"formatting"});case"eeeee":return A.day(I,{width:"narrow",context:"formatting"});case"eeeeee":return A.day(I,{width:"short",context:"formatting"});case"eeee":default:return A.day(I,{width:"wide",context:"formatting"})}},c:function(H,$,A,L){let I=H.getDay(),D=(I-L.weekStartsOn+8)%7||7;switch($){case"c":return String(D);case"cc":return _E(D,$.length);case"co":return A.ordinalNumber(D,{unit:"day"});case"ccc":return A.day(I,{width:"abbreviated",context:"standalone"});case"ccccc":return A.day(I,{width:"narrow",context:"standalone"});case"cccccc":return A.day(I,{width:"short",context:"standalone"});case"cccc":default:return A.day(I,{width:"wide",context:"standalone"})}},i:function(H,$,A){let L=H.getDay(),I=L===0?7:L;switch($){case"i":return String(I);case"ii":return _E(I,$.length);case"io":return A.ordinalNumber(I,{unit:"day"});case"iii":return A.day(L,{width:"abbreviated",context:"formatting"});case"iiiii":return A.day(L,{width:"narrow",context:"formatting"});case"iiiiii":return A.day(L,{width:"short",context:"formatting"});case"iiii":default:return A.day(L,{width:"wide",context:"formatting"})}},a:function(H,$,A){let I=H.getHours()/12>=1?"pm":"am";switch($){case"a":case"aa":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"});case"aaa":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return A.dayPeriod(I,{width:"narrow",context:"formatting"});case"aaaa":default:return A.dayPeriod(I,{width:"wide",context:"formatting"})}},b:function(H,$,A){let L=H.getHours(),I;if(L===12)I=f_H.noon;else if(L===0)I=f_H.midnight;else I=L/12>=1?"pm":"am";switch($){case"b":case"bb":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"});case"bbb":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return A.dayPeriod(I,{width:"narrow",context:"formatting"});case"bbbb":default:return A.dayPeriod(I,{width:"wide",context:"formatting"})}},B:function(H,$,A){let L=H.getHours(),I;if(L>=17)I=f_H.evening;else if(L>=12)I=f_H.afternoon;else if(L>=4)I=f_H.morning;else I=f_H.night;switch($){case"B":case"BB":case"BBB":return A.dayPeriod(I,{width:"abbreviated",context:"formatting"});case"BBBBB":return A.dayPeriod(I,{width:"narrow",context:"formatting"});case"BBBB":default:return A.dayPeriod(I,{width:"wide",context:"formatting"})}},h:function(H,$,A){if($==="ho"){let L=H.getHours()%12;if(L===0)L=12;return A.ordinalNumber(L,{unit:"hour"})}return md.h(H,$)},H:function(H,$,A){if($==="Ho")return A.ordinalNumber(H.getHours(),{unit:"hour"});return md.H(H,$)},K:function(H,$,A){let L=H.getHours()%12;if($==="Ko")return A.ordinalNumber(L,{unit:"hour"});return _E(L,$.length)},k:function(H,$,A){let L=H.getHours();if(L===0)L=24;if($==="ko")return A.ordinalNumber(L,{unit:"hour"});return _E(L,$.length)},m:function(H,$,A){if($==="mo")return A.ordinalNumber(H.getMinutes(),{unit:"minute"});return md.m(H,$)},s:function(H,$,A){if($==="so")return A.ordinalNumber(H.getSeconds(),{unit:"second"});return md.s(H,$)},S:function(H,$){return md.S(H,$)},X:function(H,$,A){let L=H.getTimezoneOffset();if(L===0)return"Z";switch($){case"X":return Y0B(L);case"XXXX":case"XX":return S8H(L);case"XXXXX":case"XXX":default:return S8H(L,":")}},x:function(H,$,A){let L=H.getTimezoneOffset();switch($){case"x":return Y0B(L);case"xxxx":case"xx":return S8H(L);case"xxxxx":case"xxx":default:return S8H(L,":")}},O:function(H,$,A){let L=H.getTimezoneOffset();switch($){case"O":case"OO":case"OOO":return"GMT"+_0B(L,":");case"OOOO":default:return"GMT"+S8H(L,":")}},z:function(H,$,A){let L=H.getTimezoneOffset();switch($){case"z":case"zz":case"zzz":return"GMT"+_0B(L,":");case"zzzz":default:return"GMT"+S8H(L,":")}},t:function(H,$,A){let L=Math.trunc(+H/1000);return _E(L,$.length)},T:function(H,$,A){return _E(+H,$.length)}}});var w0B=(H,$)=>{switch(H){case"P":return $.date({width:"short"});case"PP":return $.date({width:"medium"});case"PPP":return $.date({width:"long"});case"PPPP":default:return $.date({width:"full"})}},Z0B=(H,$)=>{switch(H){case"p":return $.time({width:"short"});case"pp":return $.time({width:"medium"});case"ppp":return $.time({width:"long"});case"pppp":default:return $.time({width:"full"})}},bO1=(H,$)=>{let A=H.match(/(P+)(p+)?/)||[],L=A[1],I=A[2];if(!I)return w0B(H,$);let D;switch(L){case"P":D=$.dateTime({width:"short"});break;case"PP":D=$.dateTime({width:"medium"});break;case"PPP":D=$.dateTime({width:"long"});break;case"PPPP":default:D=$.dateTime({width:"full"});break}return D.replace("{{date}}",w0B(L,$)).replace("{{time}}",Z0B(I,$))},q0B;var T0B=K(()=>{q0B={p:Z0B,P:bO1}});function z0B(H){return kO1.test(H)}function N0B(H){return uO1.test(H)}function O0B(H,$,A){let L=mO1(H,$,A);if(console.warn(L),gO1.includes(H))throw RangeError(L)}function mO1(H,$,A){let L=H[0]==="Y"?"years":"days of the month";return`Use \`${H.toLowerCase()}\` instead of \`${H}\` (in \`${$}\`) for formatting ${L} to the input \`${A}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var kO1,uO1,gO1;var x0B=K(()=>{kO1=/^D+$/,uO1=/^Y+$/,gO1=["D","DD","YY","YYYY"]});function S0B(H,$,A){let L=Ce(),I=A?.locale??L.locale??OgA,D=A?.firstWeekContainsDate??A?.locale?.options?.firstWeekContainsDate??L.firstWeekContainsDate??L.locale?.options?.firstWeekContainsDate??1,B=A?.weekStartsOn??A?.locale?.options?.weekStartsOn??L.weekStartsOn??L.locale?.options?.weekStartsOn??0,f=cX(H,A?.in);if(!EBB(f))throw RangeError("Invalid time value");let E=$.match(dO1).map((G)=>{let U=G[0];if(U==="p"||U==="P"){let X=q0B[U];return X(G,I.formatLong)}return G}).join("").match(pO1).map((G)=>{if(G==="''")return{isToken:!1,value:"'"};let U=G[0];if(U==="'")return{isToken:!1,value:nO1(G)};if(ygA[U])return{isToken:!0,value:G};if(U.match(iO1))throw RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return{isToken:!1,value:G}});if(I.localize.preprocessor)E=I.localize.preprocessor(f,E);let M={firstWeekContainsDate:D,weekStartsOn:B,locale:I};return E.map((G)=>{if(!G.isToken)return G.value;let U=G.value;if(!A?.useAdditionalWeekYearTokens&&N0B(U)||!A?.useAdditionalDayOfYearTokens&&z0B(U))O0B(U,$,String(H));let X=ygA[U[0]];return X(f,U,I.localize,M)}).join("")}function nO1(H){let $=H.match(cO1);if(!$)return H;return $[1].replace(lO1,"'")}var pO1,dO1,cO1,lO1,iO1;var j0B=K(()=>{F0B();VdH();C0B();T0B();x0B();zgA();VZ();pO1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dO1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cO1=/^'([^]*?)'?$/,lO1=/''/g,iO1=/[a-zA-Z]/});var R0B=()=>{};var y0B=()=>{};var v0B=()=>{};var h0B=()=>{};var b0B=()=>{};var k0B=()=>{};var u0B=()=>{};var g0B=()=>{};var m0B=()=>{};var p0B=()=>{};var d0B=()=>{};var c0B=()=>{};var l0B=()=>{};var i0B=()=>{};var n0B=()=>{};var r0B=()=>{};var a0B=()=>{};var o0B=()=>{};var t0B=()=>{};var s0B=()=>{};var e0B=()=>{};var H9B=()=>{};var $9B=()=>{};var A9B=()=>{};var L9B=()=>{};var I9B=()=>{};var D9B=()=>{};var B9B=()=>{};var f9B=()=>{};var E9B=()=>{};var M9B=()=>{};var G9B=()=>{};var U9B=()=>{};var X9B=()=>{};var J9B=()=>{};var F9B=()=>{};var K9B=()=>{};var Q9B=()=>{};var W9B=()=>{};var V9B=()=>{};var P9B=()=>{};var _9B=()=>{};var Y9B=()=>{};var C9B=()=>{};var w9B=()=>{};var Z9B=()=>{};var q9B=()=>{};var T9B=()=>{};var z9B=()=>{};var N9B=()=>{};var O9B=()=>{};var x9B=()=>{};var S9B=()=>{};var j9B=()=>{};var R9B=()=>{};var y9B=()=>{};var v9B=()=>{};var h9B=()=>{};var b9B=()=>{};var k9B=()=>{};var u9B=()=>{};var g9B=()=>{};var m9B=()=>{};var p9B=()=>{};var d9B=()=>{};var c9B=()=>{};var l9B=()=>{};var i9B=()=>{};var n9B=()=>{};var r9B=()=>{};var a9B=()=>{};var o9B=()=>{};var t9B=()=>{};var s9B=()=>{};var e9B=()=>{};var H1B=()=>{};var $1B=()=>{};var A1B=()=>{};var L1B=()=>{};var I1B=()=>{};var D1B=()=>{};var B1B=()=>{};var f1B=()=>{};var E1B=()=>{};var M1B=()=>{};var G1B=()=>{};var U1B=()=>{};var X1B=()=>{};var J1B=()=>{};var F1B=()=>{};var K1B=()=>{};var Q1B=()=>{};var W1B=()=>{};var V1B=()=>{};var P1B=()=>{};var _1B=()=>{};var Y1B=()=>{};var C1B=()=>{};var w1B=()=>{};var Z1B=()=>{};var q1B=()=>{};var T1B=()=>{};var z1B=()=>{};var N1B=()=>{};var O1B=()=>{};var x1B=()=>{};var S1B=()=>{};var j1B=()=>{};var R1B=()=>{};var y1B=()=>{};var v1B=()=>{};var h1B=()=>{};var b1B=()=>{};var k1B=()=>{};var u1B=()=>{};var g1B=()=>{};var m1B=()=>{};var p1B=()=>{};var d1B=()=>{};var c1B=()=>{};var l1B=()=>{};var i1B=()=>{};var n1B=()=>{};var r1B=()=>{};var a1B=()=>{};var o1B=()=>{};var t1B=()=>{};var s1B=()=>{};var e1B=()=>{};var H8B=()=>{};var $8B=()=>{};var A8B=()=>{};var L8B=()=>{};var I8B=()=>{};var D8B=()=>{};var B8B=()=>{};var f8B=()=>{};var E8B=()=>{};var M8B=()=>{};var G8B=()=>{};var U8B=()=>{};var X8B=()=>{};var J8B=()=>{};var F8B=()=>{};var K8B=()=>{};var Q8B=()=>{};var W8B=()=>{};var V8B=()=>{};var P8B=()=>{};var _8B=()=>{};var Y8B=()=>{};var C8B=()=>{};var w8B=()=>{};var Z8B=()=>{};var q8B=()=>{};var T8B=K(()=>{SDB();vDB();ODB();bDB();cDB();hDB();lDB();xDB();iDB();nDB();rDB();aDB();oDB();eDB();HBB();$BB();ABB();LBB();Ye();IBB();DBB();MBB();ZgA();GBB();UBB();XBB();FBB();KBB();QBB();WBB();VBB();_BB();YBB();CBB();TBB();zBB();NBB();OBB();xBB();SBB();jBB();RBB();yBB();hBB();bBB();kBB();gBB();dBB();cBB();wBB();lBB();iBB();rBB();aBB();oBB();ZBB();tBB();sBB();eBB();H0B();nBB();mBB();$0B();j0B();R0B();y0B();v0B();h0B();b0B();k0B();u0B();g0B();m0B();p0B();d0B();c0B();l0B();i0B();xgA();n0B();a0B();o0B();t0B();s0B();e0B();SgA();NO$();H9B();$9B();A9B();L9B();I9B();JBB();D9B();B9B();f9B();RgA();E9B();SO$();G9B();U9B();X9B();J9B();F9B();K9B();Q9B();W9B();V9B();P9B();_9B();TgA();Y9B();C9B();w9B();Z9B();q9B();qBB();r0B();j9B();R9B();y9B();BBB();h9B();k9B();u9B();m9B();p9B();d9B();l9B();b9B();i9B();jDB();RDB();n9B();r9B();a9B();o9B();t9B();s9B();e9B();H1B();$1B();A1B();L1B();I1B();zgA();D1B();yDB();B1B();E1B();M1B();U1B();X1B();M9B();J1B();G1B();F1B();K1B();tDB();Q1B();W1B();V1B();P1B();sDB();_1B();Y1B();C1B();w1B();Z1B();q1B();T1B();z1B();N1B();O1B();x1B();S1B();j1B();S9B();R1B();y1B();v1B();h1B();b1B();k1B();u1B();g1B();m1B();p1B();d1B();c1B();l1B();i1B();n1B();r1B();a1B();t1B();s1B();O9B();e1B();H8B();$8B();x9B();N9B();dDB();A8B();L8B();o1B();I8B();D8B();z9B();B8B();f8B();wgA();E8B();v9B();PdH();qgA();g9B();uBB();vBB();c9B();M8B();G8B();I_H();jgA();NgA();U8B();J8B();F8B();f1B();K8B();PBB();Q8B();W8B();X8B();V8B();P8B();_8B();Y8B();VZ();T9B();C8B();w8B();Z8B();q8B()});function z8B(){let[H,$]=_dH.useState([]),[A,L]=_dH.useState(0);if(_dH.useEffect(()=>{let I=vL.getSandboxViolationStore();return I.subscribe((B)=>{$(B.slice(-10)),L(I.getTotalCount())})},[]),!vL.isSandboxingEnabled()||oA()==="linux")return null;if(A===0)return null;return $_.createElement(x,{flexDirection:"column",marginTop:1},$_.createElement(x,{marginLeft:0},$_.createElement(V,{color:"permission"},"\u29C8 Sandbox blocked ",A," total"," ",A===1?"operation":"operations")),H.map((I,D)=>$_.createElement(x,{key:`${I.timestamp.getTime()}-${D}`,paddingLeft:2},$_.createElement(V,{dimColor:!0},S0B(I.timestamp,"h:mm:ssa"),I.command?` ${I.command}:`:""," ",I.line))),$_.createElement(x,{paddingLeft:2},$_.createElement(V,{dimColor:!0},"\u2026 showing last ",Math.min(10,H.length)," of ",A)))}var $_,_dH;var N8B=K(()=>{xH();EM();T8B();Z9();$_=b(s(),1),_dH=b(s(),1)});function x8B({mcpClients:H=[]}){let{addNotification:$}=wB();O8B.useEffect(()=>{let A=H.filter((I)=>I.type==="failed"&&I.config.type!=="sse-ide"&&I.config.type!=="ws-ide"&&I.config.type!=="claudeai-proxy"),L=H.filter((I)=>I.type==="needs-auth"&&I.config.type!=="claudeai-proxy");if(A.length===0&&L.length===0)return;if(A.length>0)$({key:"mcp-failed",jsx:PW.createElement(PW.Fragment,null,PW.createElement(V,{color:"error"},A.length," MCP"," ",A.length===1?"server":"servers"," failed"),PW.createElement(V,{dimColor:!0}," \xB7 /mcp")),priority:"medium"});if(L.length)$({key:"mcp-needs-auth",jsx:PW.createElement(PW.Fragment,null,PW.createElement(V,{color:"warning"},L.length," MCP"," ",L.length===1?"server needs":"servers need"," ","auth"),PW.createElement(V,{dimColor:!0}," \xB7 /mcp")),priority:"medium"})},[$,H])}var PW,O8B;var S8B=K(()=>{xH();bE();PW=b(s(),1),O8B=b(s(),1)});function j8B(){let{addNotification:H}=wB(),$=zI(),[A,L]=lK.useState(!!process.env.ENABLE_LSP_TOOL),I=lK.useRef(new Set),D=lK.useCallback((f,E)=>{let M=`${f}:${E}`;if(I.current.has(M))return;I.current.add(M),N(`LSP error: ${f} - ${E}`),$((U)=>{let X=new Set(U.plugins.errors.map((F)=>{if(F.type==="generic-error")return`generic-error:${F.source}:${F.error}`;return`${F.type}:${F.source}`})),J=`generic-error:${f}:${E}`;if(X.has(J))return U;return{...U,plugins:{...U.plugins,errors:[...U.plugins.errors,{type:"generic-error",source:f,error:E}]}}});let G=f.startsWith("plugin:")?f.split(":")[1]??f:f;H({key:`lsp-error-${f}`,jsx:lK.createElement(lK.Fragment,null,lK.createElement(V,{color:"error"},"LSP for ",G," failed"),lK.createElement(V,{dimColor:!0}," \xB7 /plugin for details")),priority:"medium",timeoutMs:8000})},[H,$]),B=lK.useCallback(()=>{if(!process.env.ENABLE_LSP_TOOL){L(!1);return}let f=w9H();if(f.status==="failed"){D("lsp-manager",f.error.message),L(!1);return}if(f.status==="pending"||f.status==="not-started")return;let E=hp();if(E){let M=E.getAllServers();for(let[G,U]of M)if(U.state==="error"&&U.lastError)D(G,U.lastError.message)}},[D]);VF(B,A?rO1:null),lK.useEffect(()=>{if(process.env.ENABLE_LSP_TOOL)B()},[B])}var lK,rO1=5000;var R8B=K(()=>{xH();bE();pL();s6();Pt();E$();lK=b(s(),1)});async function v8B(H){if(!H||!H.trim())return N("[binaryCheck] Empty command provided, returning false"),!1;let $=H.trim(),A=y8B.get($);if(A!==void 0)return N(`[binaryCheck] Cache hit for '${$}': ${A}`),A;let L=!1;if(await x_($).catch(()=>null))L=!0;return y8B.set($,L),N(`[binaryCheck] Binary '${$}' ${L?"found":"not found"}`),L}var y8B;var h8B=K(()=>{E$();Zk();y8B=new Map});function oO1(H){return M2.has(H.toLowerCase())}function tO1(H){if(!H)return null;if(typeof H==="string")return N("[lspRecommendation] Skipping string path lspServers (not readable from marketplace)"),null;if(Array.isArray(H)){for(let $ of H){if(typeof $==="string")continue;let A=k8B($);if(A)return A}return null}return k8B(H)}function b8B(H){return typeof H==="object"&&H!==null}function k8B(H){let $=new Set,A=null;for(let[L,I]of Object.entries(H)){if(!b8B(I))continue;if(!A&&typeof I.command==="string")A=I.command;let D=I.extensionToLanguage;if(b8B(D))for(let B of Object.keys(D))$.add(B.toLowerCase())}if(!A||$.size===0)return null;return{extensions:$,command:A}}async function sO1(){let H=new Map;try{let $=await l1();for(let A of Object.keys($))try{let L=await GP(A),I=oO1(A);for(let D of L.plugins){if(!D.lspServers)continue;let B=tO1(D.lspServers);if(!B)continue;let f=`${D.name}@${A}`;H.set(f,{entry:D,marketplaceName:A,extensions:B.extensions,command:B.command,isOfficial:I})}}catch(L){N(`[lspRecommendation] Failed to load marketplace ${A}: ${L}`)}}catch($){N(`[lspRecommendation] Failed to load marketplaces config: ${$}`)}return H}async function g8B(H){if(eO1())return N("[lspRecommendation] Recommendations are disabled"),[];let $=u8B.extname(H).toLowerCase();if(!$)return N("[lspRecommendation] No file extension found"),[];N(`[lspRecommendation] Looking for LSP plugins for ${$}`);let A=await sO1(),I=M$().lspRecommendationNeverPlugins??[],D=[];for(let[f,E]of A){if(!E.extensions.has($))continue;if(I.includes(f)){N(`[lspRecommendation] Skipping ${f} (in never suggest list)`);continue}if(K7(f)){N(`[lspRecommendation] Skipping ${f} (already installed)`);continue}D.push({info:E,pluginId:f})}let B=[];for(let{info:f,pluginId:E}of D)if(await v8B(f.command))B.push({info:f,pluginId:E}),N(`[lspRecommendation] Binary '${f.command}' found for ${E}`);else N(`[lspRecommendation] Skipping ${E} (binary '${f.command}' not found)`);return B.sort((f,E)=>{if(f.info.isOfficial&&!E.info.isOfficial)return-1;if(!f.info.isOfficial&&E.info.isOfficial)return 1;return 0}),B.map(({info:f,pluginId:E})=>({pluginId:E,pluginName:f.entry.name,marketplaceName:f.marketplaceName,description:f.entry.description,isOfficial:f.isOfficial,extensions:Array.from(f.extensions),command:f.command}))}function m8B(H){AA(($)=>{let A=$.lspRecommendationNeverPlugins??[];if(A.includes(H))return $;return{...$,lspRecommendationNeverPlugins:[...A,H]}}),N(`[lspRecommendation] Added ${H} to never suggest`)}function p8B(){AA((H)=>{let $=(H.lspRecommendationIgnoredCount??0)+1;return{...H,lspRecommendationIgnoredCount:$}}),N("[lspRecommendation] Incremented ignored count")}function eO1(){let H=M$();return H.lspRecommendationDisabled===!0||(H.lspRecommendationIgnoredCount??0)>=aO1}var u8B,aO1=5;var d8B=K(()=>{y4();UQ();Q7();h8B();vA();E$();u8B=require("path")});function c8B(){let H=J$((f)=>f.fileHistory.trackedFiles),{addNotification:$}=wB(),[A,L]=SC.useState(null),I=SC.useRef(new Set),D=SC.useRef(!1);SC.useEffect(()=>{if(A)return;if(D.current)return;if(Yj$())return;let f=[];for(let M of H)if(!I.current.has(M))I.current.add(M),f.push(M);if(f.length===0)return;D.current=!0,E(f).finally(()=>{D.current=!1});async function E(M){for(let G of M)try{let X=(await g8B(G))[0];if(X){N(`[useLspPluginRecommendation] Found match: ${X.pluginName} for ${G}`),L({pluginId:X.pluginId,pluginName:X.pluginName,pluginDescription:X.description,fileExtension:jO$.extname(G),shownAt:Date.now()}),Cj$(!0);return}}catch(U){r(U instanceof Error?U:Error(String(U)))}}},[H,A]);let B=SC.useCallback((f)=>{if(!A)return;let{pluginId:E,pluginName:M,shownAt:G}=A;switch(N(`[useLspPluginRecommendation] User response: ${f} for ${M}`),f){case"yes":$x1(E,M,$);break;case"no":{let U=Date.now()-G;if(U>=Hx1)N(`[useLspPluginRecommendation] Timeout detected (${U}ms), incrementing ignored count`),p8B();break}case"never":m8B(E);break;case"disable":AA((U)=>{if(U.lspRecommendationDisabled)return U;return{...U,lspRecommendationDisabled:!0}});break}L(null)},[A,$]);return{recommendation:A,handleResponse:B}}async function $x1(H,$,A){try{N(`[useLspPluginRecommendation] Installing plugin: ${H}`);let L=await ZK(H);if(!L)throw Error(`Plugin ${H} not found in marketplace`);let I=typeof L.entry.source==="string"?jO$.join(L.marketplaceInstallLocation,L.entry.source):void 0;await mw(H,L.entry,"user",void 0,I);let D=ZI("userSettings");II("userSettings",{enabledPlugins:{...D?.enabledPlugins,[H]:!0}}),N(`[useLspPluginRecommendation] Plugin installed: ${H}`),A({key:"lsp-plugin-installed",jsx:SC.createElement(V,{color:"success"},pH.tick," ",$," installed \xB7 restart to apply"),priority:"immediate",timeoutMs:5000})}catch(L){r(L instanceof Error?L:Error(String(L))),A({key:"lsp-plugin-install-failed",jsx:SC.createElement(V,{color:"error"},"Failed to install ",$),priority:"immediate",timeoutMs:5000})}}var SC,jO$,Hx1=28000;var l8B=K(()=>{jI();xH();pL();bE();vA();g$();_$();E$();d8B();op();y4();mL();SC=b(s(),1),jO$=require("path")});function i8B(){}function n8B({pluginName:H,pluginDescription:$,fileExtension:A,onResponse:L}){let I=y9.useRef(L);I.current=L,y9.useEffect(()=>{let f=setTimeout(()=>{I.current("no")},Ax1);return()=>clearTimeout(f)},[]);function D(f){switch(f){case"yes":L("yes");break;case"no":L("no");break;case"never":L("never");break;case"disable":L("disable");break}}return y9.createElement(wG,{title:"LSP Plugin Recommendation"},y9.createElement(x,{flexDirection:"column",paddingX:2,paddingY:1},y9.createElement(x,{marginBottom:1},y9.createElement(V,{dimColor:!0},"LSP provides code intelligence like go-to-definition and error checking")),y9.createElement(x,null,y9.createElement(V,{dimColor:!0},"Plugin:"),y9.createElement(V,null," ",H)),$&&y9.createElement(x,null,y9.createElement(V,{dimColor:!0},$)),y9.createElement(x,null,y9.createElement(V,{dimColor:!0},"Triggered by:"),y9.createElement(V,null," ",A," files")),y9.createElement(x,{marginTop:1},y9.createElement(V,null,"Would you like to install this LSP plugin?")),y9.createElement(x,null,y9.createElement(QA,{options:[{label:y9.createElement(V,null,"Yes, install ",y9.createElement(V,{bold:!0},H)),value:"yes"},{label:"No, not now",value:"no"},{label:y9.createElement(V,null,"Never for ",y9.createElement(V,{bold:!0},H)),value:"never"},{label:"Disable all LSP recommendations",value:"disable"}],onChange:D,onCancel:()=>L("no")}))))}var y9,Ax1=30000;var r8B=K(()=>{xH();N1();Xw();y9=b(s(),1)});function a8B(){let{addNotification:H}=wB(),$=J$((D)=>D.plugins.installationStatus),{totalFailed:A,failedMarketplacesCount:L,failedPluginsCount:I}=RO$.useMemo(()=>{if(!$)return{totalFailed:0,failedMarketplacesCount:0,failedPluginsCount:0};let D=$.marketplaces.filter((f)=>f.status==="failed"),B=$.plugins.filter((f)=>f.status==="failed");return{totalFailed:D.length+B.length,failedMarketplacesCount:D.length,failedPluginsCount:B.length}},[$]);RO$.useEffect(()=>{if(!$){N("No installation status to monitor");return}if(A===0)return;if(N(`Plugin installation status: ${L} failed marketplaces, ${I} failed plugins`),A===0)return;N(`Adding notification for ${A} failed installations`),H({key:"plugin-install-failed",jsx:Rb.createElement(Rb.Fragment,null,Rb.createElement(V,{color:"error"},A," plugin",A===1?"":"s"," failed to install"),Rb.createElement(V,{dimColor:!0}," \xB7 /plugin for details")),priority:"medium"})},[H,A,L,I])}var Rb,RO$;var o8B=K(()=>{xH();bE();pL();E$();Rb=b(s(),1),RO$=b(s(),1)});function t8B(){let{addNotification:H}=wB(),[$,A]=YdH.useState([]);YdH.useEffect(()=>{return NLB((I)=>{N(`Plugin autoupdate notification: ${I.length} plugin(s) updated`),A(I)})},[]),YdH.useEffect(()=>{if($.length===0)return;let L=$.map((D)=>{let B=D.indexOf("@");return B>0?D.substring(0,B):D}),I=L.length<=2?L.join(" and "):`${L.length} plugins`;H({key:"plugin-autoupdate-restart",jsx:yb.createElement(yb.Fragment,null,yb.createElement(V,{color:"success"},L.length===1?"Plugin":"Plugins"," updated:"," ",I),yb.createElement(V,{dimColor:!0}," \xB7 Restart to apply")),priority:"low",timeoutMs:1e4}),N(`Showing plugin autoupdate notification for: ${L.join(", ")}`)},[$,H])}var yb,YdH;var s8B=K(()=>{xH();bE();luA();E$();yb=b(s(),1),YdH=b(s(),1)});async function e8B(H){if(N("performStartupChecks called"),!XG(!0)){N("Trust not accepted for current directory - skipping plugin installations");return}try{N("Starting background plugin installations"),await nq$(H)}catch($){N(`Error initiating background plugin installations: ${$}`)}}var HfB=K(()=>{E$();rq$();vA()});function $fB(H){let{addNotification:$}=wB(),A=Zr(),L=I4A(A,H),I=D4A(A),D=j8H.useRef(null),B=$T(),f=f0(),E=my(),M=f==="team"||f==="enterprise",[G,U]=j8H.useState(!1);j8H.useEffect(()=>{if(A.isUsingOverage&&!G&&(!B||!M||E))$({key:"limit-reached",text:I,priority:"immediate"}),U(!0);else if(!A.isUsingOverage&&G)U(!1)},[A.isUsingOverage,I,G,$,B,E,M]),j8H.useEffect(()=>{if(L&&L!==D.current)D.current=L,$({key:"rate-limit-warning",jsx:CdH.createElement(V,null,CdH.createElement(V,{color:"warning"},L)),priority:"high"})},[L,$])}var CdH,j8H;var AfB=K(()=>{bE();py();xH();vA();EI();CdH=b(s(),1),j8H=b(s(),1)});function LfB(){}function Ix1(H){let $=H.toLowerCase(),A=sI();for(let[L,I]of Object.entries(Lx1)){let D=I.retirementDates[A];if(!$.includes(L)||!D)continue;return{isDeprecated:!0,modelName:I.modelName,retirementDate:D}}return{isDeprecated:!1}}function yO$(H){if(!H)return null;let $=Ix1(H);if(!$.isDeprecated)return null;return`\u26A0 ${$.modelName} will be retired on ${$.retirementDate}. Consider switching to a newer model.`}var Lx1;var vgA=K(()=>{oM();Lx1={"claude-3-opus":{modelName:"Claude 3 Opus",retirementDates:{firstParty:"January 5, 2026",bedrock:"January 15, 2026",vertex:"January 5, 2026",foundry:"January 5, 2026"}},"claude-3-7-sonnet":{modelName:"Claude 3.7 Sonnet",retirementDates:{firstParty:"February 19, 2026",bedrock:"April 28, 2026",vertex:"May 11, 2026",foundry:"February 19, 2026"}},"claude-3-5-haiku":{modelName:"Claude 3.5 Haiku",retirementDates:{firstParty:"February 19, 2026",bedrock:null,vertex:null,foundry:null}}}});function IfB(H){let{addNotification:$}=wB(),A=vO$.useRef(null);vO$.useEffect(()=>{let L=yO$(H);if(L&&L!==A.current)A.current=L,$({key:"model-deprecation-warning",text:L,color:"warning",priority:"high"});if(!L)A.current=null},[H,$])}var vO$;var DfB=K(()=>{bE();vgA();vO$=b(s(),1)});function BfB(){let{addNotification:H}=wB(),$=hO$.useRef(!1);hO$.useEffect(()=>{if($.current||U8()||A$(process.env.DISABLE_INSTALLATION_CHECKS))return;Lb().then((A)=>{if($.current||A==="development")return;$.current=!0,H({timeoutMs:15000,key:"npm-deprecation-warning",text:Dx1,color:"warning",priority:"high"})})},[H])}var hO$,Dx1="Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.";var ffB=K(()=>{bE();Ib();NA();hO$=b(s(),1)});function EfB(){let{addNotification:H}=wB(),$=bO$.useRef(!1);bO$.useEffect(()=>{if($.current)return;if(JmL())$.current=!0,H({timeoutMs:15000,key:"programdata-deprecation-warning",text:Bx1,color:"warning",priority:"high"})},[H])}var bO$,Bx1="This device contains a C:\\ProgramData\\ClaudeCode\\managed-settings.json file. In a future version of Claude Code, managed settings at this location will no longer be applied. Contact your administrator to migrate this file to C:\\Program Files\\ClaudeCode\\managed-settings.json";var MfB=K(()=>{bE();mL();bO$=b(s(),1)});function GfB({ideSelection:H,mcpClients:$,ideInstallationStatus:A}){let{addNotification:L}=wB(),I=iPH($),D=A?Wx(A?.ideType):!1,B=A?.error||D,f=I==="connected"&&(H?.filePath||H?.text&&H.lineCount>0),E=I==="connected"&&!f,M=B&&!D&&!E&&!f,G=B&&D&&!E&&!f;wdH.useEffect(()=>{if(ZF()||I!==null||G)return;ajH(!0).then((U)=>{let X=U[0]?.name;if(X)L({key:"ide-status-hint",text:`${pH.circle} /ide for ${X}`,priority:"low"})})},[L,I,G]),wdH.useEffect(()=>{if(M||G||I!=="disconnected")return;L({key:"ide-status-disconnected",text:`${pH.circle} IDE disconnected`,color:"error",priority:"medium"})},[L,I,M,G]),wdH.useEffect(()=>{if(!G)return;L({key:"ide-status-jetbrains-disconnected",text:"IDE plugin not connected \xB7 /status for info",priority:"medium"})},[L,G]),wdH.useEffect(()=>{if(!M)return;L({key:"ide-status-install-error",text:"IDE extension install failed (see /status for info)",color:"error",priority:"medium"})},[L,M])}var wdH;var UfB=K(()=>{bE();nU();SN$();jI();wdH=b(s(),1)});function JfB(){let{addNotification:H}=wB();XfB.useEffect(()=>{let A=M$().sonnet45MigrationTimestamp;if(A){if(Date.now()-A<3000)H({key:"sonnet-4.5-update",text:"Model updated to Sonnet 4.5",color:"suggestion",priority:"high",timeoutMs:3000})}},[H])}var XfB;var FfB=K(()=>{bE();vA();XfB=b(s(),1)});function QfB(){let{addNotification:H}=wB();KfB.useEffect(()=>{let A=M$().opusProMigrationTimestamp;if(A){if(Date.now()-A<3000)H({key:"opus-pro-update",text:"Model updated to Opus 4.5",color:"suggestion",priority:"high",timeoutMs:3000})}},[H])}var KfB;var WfB=K(()=>{bE();vA();KfB=b(s(),1)});function fx1(H){let $=H.toLowerCase();if($.includes("opus-4-6"))return null;if($.includes("opus-4-5"))return"Opus 4.5";if($.includes("opus-4-1"))return"Opus 4.1";if($.includes("opus-4"))return"Opus 4";return null}function PfB(){let{addNotification:H}=wB();VfB.useEffect(()=>{if(sI()!=="firstParty")return;let A=X1(),L=fx1(A);if(!L)return;c("tengu_opus46_upgrade_nudge_shown",{currentModel:A}),H({key:"opus-46-upgrade-nudge",jsx:ZdH.createElement(V,{color:"suggestion"},"Currently using ",L,". Opus 4.6 is our best model for coding",ZdH.createElement(V,{color:"text",dimColor:!0}," ","\xB7 /model to upgrade")),priority:"medium",timeoutMs:1e4})},[H])}var ZdH,VfB;var _fB=K(()=>{xH();bE();oM();aI();z$();ZdH=b(s(),1),VfB=b(s(),1)});function CfB(){let{addNotification:H}=wB();YfB.useEffect(()=>{if(M$().subscriptionNoticeCount??0>=Ex1)return;Mx1().then(($)=>{if($===null)return;AA((A)=>({...A,subscriptionNoticeCount:(A.subscriptionNoticeCount??0)+1})),c("tengu_switch_to_subscription_notice_shown",{}),H({key:"switch-to-subscription",jsx:qdH.createElement(V,{color:"suggestion"},"Use your existing Claude ",$," plan with Claude Code",qdH.createElement(V,{color:"text",dimColor:!0}," ","\xB7 /login to activate")),priority:"low"})})},[H])}async function Mx1(){if(nL())return null;let H=await WeH();if(!H)return null;if(H.account.has_claude_max)return"Max";if(H.account.has_claude_pro)return"Pro";return null}var qdH,YfB,Ex1=3;var wfB=K(()=>{xH();zwH();vA();z$();EI();bE();qdH=b(s(),1),YfB=b(s(),1)});function ZfB(){let H=kO$.useRef(!1);kO$.useEffect(()=>{if(H.current)return;H.current=!0,RgD()},[])}var kO$;var qfB=K(()=>{uyA();kO$=b(s(),1)});function TfB(H){if(!("text"in H))return 1;let $=H.text.match(/^(\d+)/);return $?.[1]?parseInt($[1],10):1}function Gx1(H,$){return zfB(TfB(H)+1)}function zfB(H){return{key:"teammate-spawn",text:H===1?"1 agent spawned":`${H} agents spawned`,priority:"low",timeoutMs:5000,fold:Gx1}}function Ux1(H,$){return NfB(TfB(H)+1)}function NfB(H){return{key:"teammate-shutdown",text:H===1?"1 agent shut down":`${H} agents shut down`,priority:"low",timeoutMs:5000,fold:Ux1}}function OfB(){let H=J$((I)=>I.tasks),{addNotification:$}=wB(),A=TdH.useRef(new Set),L=TdH.useRef(new Set);TdH.useEffect(()=>{for(let[I,D]of Object.entries(H)){if(!b4(D))continue;if(D.status==="running"&&!A.current.has(I))A.current.add(I),$(zfB(1));if(D.status==="completed"&&!L.current.has(I))L.current.add(I),$(NfB(1))}},[H,$])}var TdH;var xfB=K(()=>{pL();bE();TdH=b(s(),1)});function yfB(){let{addNotification:H}=wB(),$=J$((L)=>L.fastMode),A=zI();uO$.useEffect(()=>{if(!cD())return;if(ZHH())return;return JoL((L)=>{if(L)H({key:RfB,color:"penguin",priority:"immediate",text:"Fast mode is now available \xB7 /fast to turn on"});else if($)A((I)=>({...I,fastMode:!1})),H({key:RfB,color:"warning",priority:"immediate",text:"Fast mode has been disabled by your organization"})})},[H,$,A]),uO$.useEffect(()=>{if(ZHH())return;if(!cD())return;return UoL((L)=>{A((I)=>({...I,fastMode:!1})),H({key:Xx1,color:"warning",priority:"immediate",text:L})})},[H,A]),uO$.useEffect(()=>{if(!$)return;return EoL({onCooldownTriggered(L){let I=of(L-Date.now(),{hideTrailingZeros:!0});H({key:SfB,invalidates:[jfB],text:`Fast limit reached and temporarily disabled \xB7 resets in ${I}`,color:"warning",priority:"immediate"})},onCooldownExpired(){H({key:jfB,invalidates:[SfB],color:"penguin",text:"Fast limit reset \xB7 now using fast mode",priority:"immediate"})}})},[H,$])}var uO$,SfB="fast-mode-cooldown-started",jfB="fast-mode-cooldown-expired",RfB="fast-mode-org-changed",Xx1="fast-mode-overage-rejected";var vfB=K(()=>{g$();bE();AJ();pL();Q9();uO$=b(s(),1)});function hfB({onRun:H,onCancel:$,reason:A}){let L=gO$.useRef(!1);return BA("confirm:no",$,{context:"Confirmation"}),gO$.useEffect(()=>{if(!L.current)L.current=!0,H()},[H]),A6.createElement(x,{flexDirection:"column",marginTop:1},A6.createElement(x,null,A6.createElement(V,{bold:!0},"Running feedback capture...")),A6.createElement(x,null,A6.createElement(V,{dimColor:!0},"Press ",A6.createElement(s$,{shortcut:"Esc",action:"cancel"})," anytime")),A6.createElement(x,null,A6.createElement(V,{dimColor:!0},"Reason: ",A)))}function hgA(H){return!1;switch(H){case"feedback_survey_bad":return!0;case"feedback_survey_good":return!1;default:return!1}}function bfB(H){return"/issue"}function kfB(H){switch(H){case"feedback_survey_bad":return'You responded "Bad" to the feedback survey';case"feedback_survey_good":return'You responded "Good" to the feedback survey';default:return"Unknown reason"}}var A6,gO$;var ufB=K(()=>{xH();$I();lB();A6=b(s(),1),gO$=b(s(),1)});var gfB,Jx1;var mfB=K(()=>{xH();g$();gfB=b(s(),1),Jx1=b(s(),1)});function Qx1({showAllInTranscript:H}){let $=C0("app:toggleTranscript","Global","ctrl+o"),A=C0("transcript:toggleShowAll","Transcript","ctrl+e");return CI.createElement(x,{alignItems:"center",alignSelf:"center",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginTop:1,paddingLeft:2,width:"100%"},CI.createElement(V,{dimColor:!0},"Showing detailed transcript \xB7 ",$," to toggle \xB7"," ",A," to ",H?"collapse":"show all"))}function R8H({commands:H,debug:$,initialTools:A,initialMessages:L,initialFileHistorySnapshots:I,initialAgentName:D,initialAgentColor:B,mcpClients:f,dynamicMcpConfig:E,mcpCliEndpoint:M,autoConnectIdeFlag:G,strictMcpConfig:U=!1,systemPrompt:X,appendSystemPrompt:J,onBeforeQuery:F,onTurnComplete:Q,disabled:W=!1,mainThreadAgentDefinition:P,disableSlashCommands:C=!1,taskListId:Y,remoteSessionConfig:Z,directConnectConfig:q}){lA.useEffect(()=>{return N(`[REPL:mount] REPL mounted, disabled=${W}`),g_I(),()=>N("[REPL:unmount] REPL unmounting")},[W]);let[O,j]=lA.useState(P),u=J$((F$)=>F$.toolPermissionContext),y=J$((F$)=>F$.verbose),g=J$((F$)=>F$.mcp),h=J$((F$)=>F$.plugins),p=J$((F$)=>F$.agentDefinitions),d=J$((F$)=>F$.fileHistory),k=J$((F$)=>F$.todos),n=J$((F$)=>F$.thinkingEnabled),GH=J$((F$)=>F$.initialMessage),HH=J$((F$)=>F$.queuedCommands),BH=void 0,WH=!1,wH=void 0,QH=J$((F$)=>F$.spinnerTip),TH=J$((F$)=>F$.expandedView)==="tasks",t=J$((F$)=>F$.pendingWorkerRequest),IH=J$((F$)=>F$.pendingSandboxRequest),KH=J$((F$)=>F$.teamContext),MH=J$((F$)=>F$.tasks),CH=J$((F$)=>F$.workerSandboxPermissions),OH=J$((F$)=>F$.elicitation),LH=J$((F$)=>F$.viewingAgentTaskId),e=zI(),DH=OX(),EH=Vy(),$H=Ht(),[FH,YH]=lA.useState(H);vIB(oJ(),YH);let[qH,bH]=lA.useState(mO$?.isProactiveActive()??!1);lA.useEffect(()=>{if(!mO$)return;return mO$.subscribeToProactiveChanges(()=>{bH(mO$.isProactiveActive())})},[]);let hH=lA.useMemo(()=>yK(u),[u,qH]);wDB();let[PH,gH]=lA.useState(E),vH=lA.useCallback((F$)=>{gH(F$)},[gH]),[tH,K$]=lA.useState("prompt"),[KA,UA]=lA.useState(1),[U$,hA]=lA.useState(!1),{addNotification:iA}=wB(),rH=SIB(f,g.clients),[G$,b$]=lA.useState(void 0),[ZA,n$]=lA.useState(null),[fA,UH]=lA.useState(null),[_H,aH]=lA.useState(!1),[f$,I$]=lA.useState(()=>{return!1});JfB(),QfB(),PfB(),CfB(),GfB({ideSelection:G$,mcpClients:rH,ideInstallationStatus:fA}),x8B({mcpClients:rH}),a8B(),t8B(),_q$(),$fB($H),yfB(),LfB(),IfB($H),BfB(),EfB(),EDB(),GDB(),JDB(),j8B(),OfB();let{recommendation:$$,handleResponse:e$}=c8B();i8B();let x$=lA.useMemo(()=>{return[...hH,...A]},[hH,A]);QO$();let zA=wP$();lA.useEffect(()=>{e8B(e)},[e]),KDB(rH,e,u.mode),aLB(e,L);let gA=rT$(x$,g.tools,u),{tools:HI,allowedAgentTypes:AI}=lA.useMemo(()=>{if(!O)return{tools:gA,allowedAgentTypes:void 0};let F$=Io(O,gA,!1);return{tools:F$.resolvedTools,allowedAgentTypes:F$.allowedAgentTypes}},[O,gA]),qB=BgA(FH,h.commands),RB=BgA(qB,g.commands),sA=lA.useMemo(()=>C?[]:RB,[C,RB]);ZsD(g.clients),uIB(g.clients,b$);let[_D,M9]=lA.useState("responding"),[g8,v9]=lA.useState([]),[QI,DB]=lA.useState(null);lA.useEffect(()=>{if(QI&&!QI.isStreaming&&QI.streamingEndedAt){let FL=30000-(Date.now()-QI.streamingEndedAt);if(FL>0){let jL=setTimeout(()=>{DB(null)},FL);return()=>clearTimeout(jL)}else DB(null)}},[QI]);let[G9,IL]=lA.useState(null),[qA,BB]=lA.useState(Z?.hasInitialPrompt??!1),[WB,GD]=lA.useState(void 0),C9=lA.useRef(0),V1=lA.useRef(0),G8=lA.useRef(null),nE=lA.useRef(null),f4=lA.useRef(void 0),n8=1500,[e4,dM]=lA.useState(!1),y1=lA.useCallback((F$)=>{if(BB(F$),F$)C9.current=Date.now(),V1.current=0,G8.current=null},[]),[gG,pA]=lA.useState(null);lA.useEffect(()=>{if(gG?.notifications)gG.notifications.forEach((F$)=>{iA({key:"auto-updater-notification",text:F$,priority:"low"})})},[gG,iA]);let[qL,dB]=lA.useState(null),tB=lA.useRef(null),gD=lA.useCallback((F$)=>{if(F$?.isLocalJSXCommand){let{clearLocalJSX:FL,...jL}=F$;tB.current={...jL,isLocalJSXCommand:!0},dB(jL);return}if(tB.current){if(F$?.clearLocalJSX){tB.current=null,dB(null);return}return}if(F$?.clearLocalJSX){dB(null);return}dB(F$)},[]),[c9,b0]=lA.useState([]),[U9,uf]=lA.useState([]),k0=c9.length>0||t||IH,DE=qL?.isLocalJSXCommand===!0;lA.useEffect(()=>{if(qA&&!k0&&!DE)c_I();else lSH();return()=>lSH()},[qA,k0,DE]),lA.useEffect(()=>{if(qA&&!k0&&!DE)return fsD(),()=>EsD()},[qA,k0,DE]),lA.useEffect(()=>{return yQD(b0),()=>vQD()},[b0]);let[aL,RH]=lA.useState(L??[]),kH=lA.useRef(aL),eH=lA.useCallback((F$)=>{if(typeof F$==="function")RH((FL)=>{let jL=F$(FL);return kH.current=jL,jL});else kH.current=F$,RH(F$)},[]),W$=lA.useDeferredValue(aL),O$=aL.length-W$.length;if(O$>0)N(`[useDeferredValue] Messages deferred by ${O$} (${W$.length}\u2192${aL.length})`);let[YA,aA]=lA.useState(null);ZfB();let[eA,kL]=lA.useState([]),[AL,ML]=lA.useState(()=>c0A()),DI=lA.useRef(AL);DI.current=AL,lA.useEffect(()=>{if(AL.trim().length===0){dM(!1);return}dM(!0);let F$=setTimeout(()=>{dM(!1)},n8);return()=>clearTimeout(F$)},[AL]);let[yB,h9]=lA.useState("prompt"),[F0,Yf]=lA.useState(),{tip:wU,dismissTip:H5}=ALB({inputValue:AL,isAssistantResponding:qA}),E4=lA.useCallback((F$)=>{let FL=new Set(F$);YH((jL)=>jL.filter((D0)=>FL.has(D0.name)||uhA.has(D0)))},[YH]),[M4,iK]=lA.useState(new Set),D6=MLB({config:Z,setMessages:eH,setIsLoading:y1,onInit:E4,setToolUseConfirmQueue:b0,tools:x$,setStreamingToolUses:v9,setStreamMode:M9,setInProgressToolUseIDs:iK}),B6=XLB({config:q,setMessages:eH,setIsLoading:y1,setToolUseConfirmQueue:b0,tools:x$}),nF=B6.isRemoteMode?B6:D6,[nK,ZU]=lA.useState({}),[uJ,L_]=lA.useState(0),YW=lA.useRef(0),RC=lA.useCallback((F$)=>{YW.current=F$(YW.current)},[]),[I_,oz]=lA.useState(0),[tz,rK]=lA.useState(null),[r8,l9]=lA.useState(null),[f6,D_]=lA.useState(null),[e5,yC]=lA.useState(!1),[B_,CZ]=lA.useState(!1),[HX,gJ]=lA.useState(zdH.randomUUID()),[rE,vC]=lA.useState(M$().hasAcknowledgedCostThreshold),[mJ,sz]=lA.useState("INSERT"),[f_,G4]=lA.useState(!1),[aK,wZ]=lA.useState(!1),[E_,e3]=lA.useState(!1),[Cf,ZZ]=lA.useState(!1),[qU,eD]=lA.useState(!1),[aE,$5]=lA.useState(!1),y$=EJ(),CL=lA.useRef(y$);CL.current=y$;let SI=lA.useRef(!1),mD=lA.useRef(null),[hD]=_I(),b9=lA.useCallback(()=>{PDB({theme:hD,readFileState:Q0.current}).then(async(F$)=>{if(F$){let FL=await F$.content({theme:hD});e((jL)=>({...jL,spinnerTip:FL})),_DB(F$)}else e((FL)=>({...FL,spinnerTip:void 0}))})},[e,hD]),K0=lA.useCallback(()=>{y1(!1),GD(void 0),YW.current=0,v9([]),rK(null),l9(null),D_(null),b9(),jyH()},[y1,b9]),{backgroundSignalRef:mG,handleBackgroundSession:rF,handleForegroundTask:CW}=oIB({setMessages:eH,setIsLoading:y1,resetLoadingState:K0,setAbortController:IL}),qZ=Yw(MH).some((F$)=>F$.status==="running");lA.useEffect(()=>{if(!qZ&&nE.current!==null){let F$=Date.now()-nE.current;nE.current=null,eH((FL)=>[...FL,RbA(F$)])}},[qZ,eH]);let vb=aL.findLast((F$)=>F$.type==="assistant"),hb=vb?.type==="assistant"?vb.message.content.filter((F$)=>F$.type==="tool_use"&&M4.has(F$.id)):[],pG=hb.length>0&&hb.every((F$)=>F$.type==="tool_use"&&F$.name===ghA),E6=(!qL||qL.showSpinner===!0)&&c9.length===0&&(qA||WB||qZ||lRI()>0)&&!t&&!pG,VH=c9.length>0||U9.length>0||OH.queue.length>0||CH.queue.length>0,ZH=HDB(aL,qA,uJ,"session",VH),B$=lA.useMemo(()=>({...ZH,handleSelect:(F$)=>{if(ZH.handleSelect(F$),F$==="bad"&&hgA("feedback_survey_bad")||F$==="good"&&hgA("feedback_survey_good"))oK(F$==="bad"?"feedback_survey_bad":"feedback_survey_good")}}),[ZH]),IA=ADB(aL,qA,VH);iIB({autoConnectIdeFlag:G,ideToInstallExtension:ZA,setDynamicMcpConfig:gH,setShowIdeOnboarding:aH,setIDEInstallationState:UH}),qDB(I,d,(F$)=>e((FL)=>({...FL,fileHistory:F$})));let bA=lA.useCallback(async(F$,FL,jL)=>{c("tengu_session_resumed",{entrypoint:jL});let D0=QuH(FL.messages),RD=await r7("resume",{sessionId:F$,agentType:O?.agentType,model:$H});if(D0.push(...RD),BF$(FL),EF$(FL,Z7(F$)),XdH(FL,e),FL.fileHistorySnapshots)bY$(FL);if(!P){let JI=FL.agentSetting?p?.activeAgents.find((v1)=>v1.agentType===FL.agentSetting):void 0;if(j(JI),YN(JI?.agentType),e((v1)=>({...v1,agent:JI?.agentType})),JI&&!C_()&&JI.model&&JI.model!=="inherit")KV(m8(JI.model))}if(dL())e((JI)=>({...JI,standaloneAgentContext:FL.agentName||FL.agentColor?{name:FL.agentName??"",color:FL.agentColor}:void 0}));lOA(D0),a8(D0,FL.projectPath??zL()),K0(),IL(null),gJ(F$);let fD=cDA(F$);if(lDA(),MEH(),FV(Z7(F$)),await aw(),fD)yYH(fD);eH(()=>D0),gD(null),ML(""),kL([])},[K0,e]),WI=j$(),VB=lA.useMemo(()=>ca(j$()),[]),Q0=lA.useRef((()=>{let F$=_m(fBH);return F$.set(VB,{content:yH(k[WI]||[]),timestamp:0,offset:void 0,limit:void 0}),F$})()),a8=lA.useCallback((F$,FL)=>{let jL=D1H(F$,FL,fBH);Q0.current=eKH(Q0.current,jL)},[]);lA.useEffect(()=>{if(L&&L.length>0)lOA(L),a8(L,zL())},[]);let{status:TU,reverify:$X}=hLB(),[If,oK]=lA.useState(null),[lX,M_]=lA.useState(null),[Oj,Te]=lA.useState(!1),bb=!qA&&B_;function ze(){if(Oj||lX)return;if(e5)return"message-selector";if(e4)return;if(U9[0])return"sandbox-permission";let F$=!qL||qL.shouldContinueAnimation;if(F$&&c9[0])return"tool-permission";if(F$&&CH.queue[0])return"worker-sandbox-permission";if(F$&&OH.queue[0])return"elicitation";if(F$&&bb)return"cost";if(F$&&_H)return"ide-onboarding";if(F$&&$$)return"lsp-recommendation";return}let iX=ze(),Ne=e4&&(U9[0]||c9[0]||CH.queue[0]||OH.queue[0]||bb);f4.current=iX,lA.useEffect(()=>{if(!qA)return;let F$=iX==="tool-permission",FL=Date.now();if(F$&&G8.current===null)G8.current=FL;else if(!F$&&G8.current!==null)V1.current+=FL-G8.current,G8.current=null},[iX,qA]);function TZ(){if(iX==="elicitation")return;if(N(`[onCancel] focusedInputDialog=${iX} streamMode=${_D}`),SI.current=!1,K0(),iX==="tool-permission")c9[0]?.onAbort(),b0([]);else if(nF.isRemoteMode)nF.cancelRequest();else G9?.abort();if(v8())QyI(MH,e),rRI(),e((F$)=>{if(F$.queuedCommands.length===0)return F$;return{...F$,queuedCommands:[]}})}let G_=lA.useCallback(async()=>{let F$=await ZF$(AL,0,async()=>new Promise((FL)=>e((jL)=>{return FL(jL),jL})),e);if(!F$)return;if(ML(F$.text),h9("prompt"),F$.images.length>0)ZU((FL)=>{let jL={...FL};for(let D0 of F$.images)jL[D0.id]=D0;return jL})},[e,ML,h9,AL,ZU]),id={setToolUseConfirmQueue:b0,onCancel:TZ,isMessageSelectorVisible:e5||f_||aK,screen:tH,abortSignal:G9?.signal,popCommandFromQueue:G_,vimMode:mJ,isLocalJSXCommand:qL?.isLocalJSXCommand,isSearchingHistory:qU,isHelpOpen:aE,inputMode:yB,inputValue:AL};lA.useEffect(()=>{if(BQ()>=5&&!B_&&!rE){if(c("tengu_cost_threshold_reached",{}),Y9$())CZ(!0)}},[aL,B_,rE]);let Oe=lA.useCallback(async(F$)=>{if(dL()&&EkH())return new Promise((FL)=>{let jL=TQD();if(!zQD(F$.host,jL)){uf((RD)=>[...RD,{hostPattern:F$,resolvePromise:FL}]);return}SQD({requestId:jL,host:F$.host,resolve:FL}),e((RD)=>({...RD,pendingSandboxRequest:{requestId:jL,host:F$.host}}))});return new Promise((FL)=>{uf((jL)=>[...jL,{hostPattern:F$,resolvePromise:FL}])})},[e]);if(vL.isSandboxingEnabled())vL.initialize(Oe).catch((F$)=>{process.stderr.write(` `),L9(1,"other")});let xj=lA.useCallback((F$,FL)=>{e((jL)=>({...jL,toolPermissionContext:{...F$,mode:FL?.preserveMode?jL.toolPermissionContext.mode:F$.mode}})),setImmediate(()=>{b0((jL)=>{return jL.forEach((D0)=>{D0.recheckPermission()}),jL})})},[e,b0]);lA.useEffect(()=>{return hQD(xj),()=>kQD()},[xj]);let cM=UIB(b0,xj),pJ=lA.useCallback((F$,FL,jL,D0,RD,fD)=>{return{abortController:jL,options:{commands:sA,tools:HI,debug:$,verbose:y,mainLoopModel:fD,maxThinkingTokens:RD??(n===!0?lg(FL,void 0):n===!1?0:void 0),mcpClients:rH,mcpResources:g.resources,ideInstallationStatus:fA,isNonInteractiveSession:!1,dynamicMcpConfig:PH,theme:hD,agentDefinitions:AI?{...p,allowedAgentTypes:AI}:p,customSystemPrompt:X,appendSystemPrompt:J},getAppState(){return DH.setState((JI)=>({...JI,toolPermissionContext:{...JI.toolPermissionContext,alwaysAllowRules:{...JI.toolPermissionContext.alwaysAllowRules,command:D0}}})),Promise.resolve(DH.getState())},setAppState:e,messages:F$,setMessages:eH,updateFileHistoryState(JI){e((v1)=>({...v1,fileHistory:JI(v1.fileHistory)}))},updateAttributionState(JI){e((v1)=>({...v1,attribution:JI(v1.attribution)}))},openMessageSelector:()=>{if(!W)yC(!0)},onChangeAPIKey:$X,onForegroundTask:CW,readFileState:Q0.current,setToolJSX:gD,addNotification:iA,onChangeDynamicMcpConfig:vH,onInstallIDEExtension:n$,nestedMemoryAttachmentTriggers:new Set,dynamicSkillDirTriggers:new Set,setResponseLength:RC,setStreamMode:M9,onCompactProgress:(JI)=>{switch(JI.type){case"hooks_start":l9("claudeBlue_FOR_SYSTEM_SPINNER"),D_("claudeBlueShimmer_FOR_SYSTEM_SPINNER"),rK(JI.hookType==="pre_compact"?"Running PreCompact hooks\u2026":"Running SessionStart hooks\u2026");break;case"compact_start":rK("Compacting conversation");break;case"compact_end":rK(null),l9(null),D_(null);break}},setInProgressToolUseIDs:iK,resume:bA,setConversationId:gJ}},[sA,HI,$,y,rH,g.resources,fA,PH,hD,p,AI,DH,e,$X,iA,vH,CW,bA,n,W,X,J,gJ]),xe=lA.useCallback(async(F$,FL,jL,D0,RD,fD,JI)=>{let v1=FL.filter((rX)=>rX.type==="user"||rX.type==="assistant").pop();if(D0){bp.handleQueryStart(rH);let rX=CY(rH);if(rX)HqI(rX)}if(HFH(),v1?.type==="user"&&typeof v1.message.content==="string")l_I(v1.message.content);if(!D0){K0(),IL(null);return}let vB=pJ(F$,FL,jL,RD,JI,fD);_9("query_context_loading_start");let[,,X9,P1,nX]=await Promise.all([VgA(u,e),void 0,HC(HI,fD,Array.from(u.additionalWorkingDirectories.keys()),rH),u5(),k5()]),cJ={...P1,...Kx1(rH),...{}};_9("query_context_loading_end");let NZ=A1H({mainThreadAgentDefinition:O,toolUseContext:vB,customSystemPrompt:X,defaultSystemPrompt:X9,appendSystemPrompt:J});_9("query_query_start");let sK,lM=new Promise((rX)=>{sK=rX});mG.current={promise:lM,resolve:sK};let U_=vP({messages:F$,systemPrompt:NZ,userContext:cJ,systemContext:nX,canUseTool:cM,toolUseContext:vB,querySource:d_$()})[Symbol.asyncIterator](),hC=!1,$V=!1;while(!$V){let rX=await Promise.race([U_.next().then((lJ)=>({type:"message",result:lJ})),lM.then(()=>({type:"background"}))]);if(rX.type==="background"){hC=!0,$V=!0;let lJ=m_I()||"Background session",{taskId:AV,abortSignal:bC}=ZyI(lJ,e,O,jL);zyI(U_,AV,e,($N)=>void $j($N),aL,bC);let{clearConversation:p8H}=await Promise.resolve().then(() => (dZ$(),qjA));await p8H({setMessages:eH,readFileState:Q0.current,getAppState:async()=>new Promise(($N)=>{e((Se)=>{return $N(Se),Se})}),setAppState:e,setConversationId:gJ})}else if(rX.result.done)$V=!0;else L3H(rX.result.value,(lJ)=>{if(Ez(lJ))eH(()=>[lJ]);else eH((AV)=>[...AV,lJ])},(lJ)=>RC((AV)=>AV+lJ.length),M9,v9,(lJ)=>{eH((AV)=>AV.filter((bC)=>bC!==lJ)),bbA(lJ.uuid)},DB)}if(mG.current=null,_9("query_end"),hC){K0();return}K0(),lxD(),Q?.()},[rH,K0,pJ,u,e,HI,X,Q,J,cM,O]),HV=lA.useCallback(async(F$,FL,jL,D0,RD,fD,JI,v1)=>{if(dL()){let vB=g9(),X9=g1();if(vB&&X9)zP$(vB,X9,!0)}if(SI.current){c("tengu_concurrent_onquery_detected",{}),F$.filter((vB)=>vB.type==="user").map((vB)=>K9H(vB.message.content)).filter((vB)=>vB!==null).forEach((vB,X9)=>{if(ZX({value:vB,mode:"prompt"},e),X9===0)c("tengu_concurrent_onquery_enqueued",{})}),y1(!1);return}SI.current=!0,mD.current=F$;try{y1(!0),eH((X9)=>[...X9,...F$]),GD(void 0),YW.current=0,v9([]);let vB=await new Promise((X9)=>{eH((P1)=>{return X9(P1),P1})});if(JI&&v1){let X9=[...vB,...F$];if(!await JI(v1,X9))return}await xe(vB,F$,FL,jL,D0,RD,fD)}finally{SI.current=!1,oz(Date.now()),K0();let vB=Date.now()-C9.current-V1.current;if(vB>30000&&!FL.signal.aborted&&!qH)if(Yw(DH.getState().tasks).some((P1)=>P1.status==="running")){if(nE.current===null)nE.current=C9.current}else eH((P1)=>[...P1,RbA(vB)])}},[xe,y1,e,K0]),nd=lA.useRef(!1);lA.useEffect(()=>{let F$=GH;if(!F$||qA||nd.current)return;nd.current=!0;async function FL(jL){if(jL.clearContext){let fD=jL.message.planContent?sRH():void 0,{clearConversation:JI}=await Promise.resolve().then(() => (dZ$(),qjA));if(await JI({setMessages:eH,readFileState:Q0.current,getAppState:async()=>new Promise((v1)=>{e((vB)=>{return v1(vB),vB})}),setAppState:e,setConversationId:gJ}),fD)K7A(j$(),fD)}let D0=jL.message.planContent&&!1;if(e((fD)=>{let JI=jL.mode?T2(fD.toolPermissionContext,tpH(jL.mode,jL.allowedPrompts)):fD.toolPermissionContext;return{...fD,initialMessage:null,toolPermissionContext:JI,...D0&&{pendingPlanVerification:{plan:jL.message.planContent,verificationStarted:!1,verificationCompleted:!1}}}}),gE())O6H((fD)=>{e((JI)=>({...JI,fileHistory:fD(JI.fileHistory)}))},jL.message.uuid);let RD=jL.message.message.content;if(typeof RD==="string"&&!jL.message.planContent)tK(RD,{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}});else{let fD=nD();IL(fD),HV([jL.message],fD,!0,[],$H,void 0)}setTimeout(()=>{nd.current=!1},100)}FL(F$)},[GH,qA,eH,e,HV,$H,HI]);let tK=lA.useCallback(async(F$,FL,jL,D0)=>{if(!jL&&F$.trim().startsWith("/")){let RD=F$.trim(),fD=RD.indexOf(" "),JI=fD===-1?RD.slice(1):RD.slice(1,fD),v1=fD===-1?"":RD.slice(fD+1).trim(),vB=sA.find((P1)=>P1.isEnabled()&&(P1.name===JI||P1.aliases?.includes(JI)||P1.userFacingName()===JI)),X9=vB?.immediate||D0?.fromKeybinding;if(vB&&X9&&vB.type==="local-jsx"){if(F$.trim()===DI.current.trim())ML(""),FL.setCursorOffset(0),FL.clearBuffer();(async()=>{let nX=(lM,U_)=>{if(gD({jsx:null,shouldHidePromptInput:!1,clearLocalJSX:!0}),lM&&U_?.display!=="skip")iA({key:`immediate-${vB.name}`,text:lM,priority:"low"});if(U_?.metaMessages?.length){let hC=U_.metaMessages.map(($V)=>R$({content:$V,isMeta:!0}));eH(($V)=>[...$V,...hC])}},cJ=pJ(aL,[],nD(),[],void 0,$H),sK=await(await vB.load()).call(nX,cJ,v1);if(sK)gD({jsx:sK,shouldHidePromptInput:!0,isLocalJSXCommand:!0})})();return}}if(nF.isRemoteMode&&!F$.trim())return;if(!D0?.fromKeybinding)fDH({display:jL?F$:lVI(F$,yB),pastedContents:jL?{}:nK});if(F0!==void 0)ML(F0.text),FL.setCursorOffset(F0.cursorOffset),ZU(F0.pastedContents),Yf(void 0);else if(!qA||jL){if(!D0?.fromKeybinding)ML(""),FL.setCursorOffset(0);ZU({})}if(!qA||jL)h9("prompt"),b$(void 0),L_((RD)=>RD+1),FL.clearBuffer();if(jL){let{queryRequired:RD}=await VSD(jL.state,jL.speculationSessionTimeSavedMs,jL.setAppState,F$,{setMessages:eH,readFileState:Q0,cwd:zL()});if(RD){let fD=nD();IL(fD),HV([],fD,!0,[],$H,void 0)}return}if(nF.isRemoteMode){let RD=R$({content:F$.trim()});eH((fD)=>[...fD,RD]),await nF.sendMessage(F$.trim());return}await JO$({input:F$,helpers:FL,isLoading:qA,mode:yB,commands:sA,onInputChange:ML,setPastedContents:ZU,setIsLoading:y1,setToolJSX:gD,getToolUseContext:pJ,messages:aL,mainLoopModel:$H,pastedContents:nK,ideSelection:G$,setUserInputOnProcessing:GD,setAbortController:IL,abortController:G9,onQuery:HV,resetLoadingState:K0,thinkingEnabled:n,setAppState:e,querySource:d_$(),onBeforeQuery:F,canUseTool:cM,addNotification:iA,streamMode:_D})},[qA,yB,sA,ML,h9,ZU,L_,b$,y1,gD,pJ,aL,$H,nK,G$,GD,IL,iA,HV,K0,F0,Yf,n,e,F,cM,D6,eH,iA,_D]),wW=lA.useCallback(async(F$,FL,jL)=>{m2A(FL.id,F$,e),ML(""),jL.setCursorOffset(0),jL.clearBuffer()},[e,ML]),rd=lA.useCallback(()=>{let F$=If?bfB(If):"/issue";oK(null),tK(F$,{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}}).catch((FL)=>{N(`Auto-run ${F$} failed: ${FL instanceof Error?FL.message:String(FL)}`)})},[tK,If]),u8H=lA.useCallback(()=>{oK(null)},[]),kb=lA.useCallback(()=>{tK("/rate-limit-options",{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}})},[tK]),ub=lA.useCallback(async()=>{Te(!0);let FL=await(await $pH.load()).call(()=>{});M_(FL)},[]),oE=lA.useCallback(()=>{yC((F$)=>!F$)},[]);async function J_H(){$X();let F$=QJ();for(let FL of F$)Q0.current.set(FL.path,{content:FL.content,timestamp:Date.now(),offset:void 0,limit:void 0})}PoL(jLB()),QsD(aL,aL.length===L?.length),yLB(),lA.useEffect(()=>{if(HH.length<1)return;AA((F$)=>({...F$,promptQueueUseCount:(F$.promptQueueUseCount??0)+1}))},[HH.length]);let zZ=lA.useCallback(()=>new Promise((F$)=>e((FL)=>{return F$(FL),FL})),[e]),d$=lA.useCallback(async(F$,FL)=>{await JO$({input:F$,helpers:{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}},isLoading:qA,mode:"prompt",commands:sA,onInputChange:()=>{},setPastedContents:()=>{},setIsLoading:y1,setToolJSX:gD,getToolUseContext:pJ,messages:aL,mainLoopModel:$H,pastedContents:FL,ideSelection:G$,setUserInputOnProcessing:GD,setAbortController:IL,onQuery:HV,resetLoadingState:K0,thinkingEnabled:n,setAppState:e,querySource:d_$(),onBeforeQuery:F,canUseTool:cM,addNotification:iA})},[qA,sA,y1,gD,pJ,aL,$H,G$,GD,cM,IL,HV,K0,n,iA,e,F]);TIB({isLoading:qA,queuedCommandsLength:HH.length,lastQueryCompletionTime:I_,getAppState:zZ,setAppState:e,executeQueuedInput:d$,hasActiveLocalJsxUI:qL?.isLocalJSXCommand??!1,setIsLoading:y1}),lA.useEffect(()=>{BbH.recordUserActivity(),FHH()},[AL,uJ]);let mA=lA.useRef(new Set);lA.useEffect(()=>{let F$=new Set(aL.filter((jL)=>Ez(jL)).map((jL)=>jL.uuid));if(Array.from(F$).some((jL)=>!mA.current.has(jL)))mA.current=F$,gJ(zdH.randomUUID())},[aL]),lA.useEffect(()=>{if(uJ===1)iuA()},[uJ]),lA.useEffect(()=>{if(qA)return;if(uJ===0)return;if(I_===0)return;let F$=setTimeout(()=>{if(jYH()>I_)return;let jL=Date.now()-I_;if(!qA&&!qL&&f4.current===void 0&&jL>=M$().messageIdleNotifThresholdMs)xh({message:"Claude is waiting for your input",notificationType:"idle_prompt"},EH)},M$().messageIdleNotifThresholdMs);return()=>clearTimeout(F$)},[qA,qL,uJ,I_,EH]);let _A=lA.useCallback((F$,FL)=>{if(SI.current)return!1;let jL=nD();IL(jL);let D0=R$({content:F$,isMeta:FL?.isMeta?!0:void 0});return HV([D0],jL,!0,[],$H,void 0),!0},[HV,$H]);pIB({enabled:dL(),isLoading:qA,focusedInputDialog:iX,onSubmitMessage:_A}),NIB({isLoading:qA,onSubmitMessage:_A}),lA.useEffect(()=>{return J_H(),()=>{bp.shutdown()}},[]);let{internal_eventEmitter:gI}=oJH(),[u0,n1]=lA.useState(0);lA.useEffect(()=>{let F$=()=>{process.stdout.write(` `),!A.alreadyUpToDate)c("tengu_plugin_updated_cli",{plugin_id:H,old_version:A.oldVersion||"unknown",new_version:A.newVersion||"unknown"});await w0(0)}catch(A){E_H(A,`update plugin "${H}"`)}}var mgA=K(()=>{jI();_$();z$();UU();pVH()});function cO$(){return pgA.default.createElement(V,null,"MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the"," ",pgA.default.createElement(dI,{url:"https://code.claude.com/docs/en/mcp"},"MCP documentation"),".")}var pgA;var dgA=K(()=>{xH();xH();pgA=b(s(),1)});function HEB({serverNames:H,onDone:$}){function A(I){let D=VL()||{},B=D.enabledMcpjsonServers||[],f=D.disabledMcpjsonServers||[],[E,M]=unA(H,(G)=>I.includes(G));if(c("tengu_mcp_multidialog_choice",{approved:E.length,rejected:M.length}),E.length>0){let G=[...new Set([...B,...E])];II("localSettings",{enabledMcpjsonServers:G})}if(M.length>0){let G=[...new Set([...f,...M])];II("localSettings",{disabledMcpjsonServers:G})}$()}let L=efB.useCallback(()=>{let D=(VL()||{}).disabledMcpjsonServers||[],B=[...new Set([...D,...H])];II("localSettings",{disabledMcpjsonServers:B}),$()},[H,$]);return iz.default.createElement(iz.default.Fragment,null,iz.default.createElement(BL,{title:`${H.length} new MCP servers found in .mcp.json`,subtitle:"Select any you wish to enable.",color:"warning",onCancel:L,hideInputGuide:!0},iz.default.createElement(cO$,null),iz.default.createElement(xVH,{options:H.map((I)=>({label:I,value:I})),defaultValue:H,onSubmit:A})),iz.default.createElement(x,{paddingX:1},iz.default.createElement(V,{dimColor:!0,italic:!0},iz.default.createElement(rA,null,iz.default.createElement(s$,{shortcut:"Space",action:"select"}),iz.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),iz.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"reject all"})))))}var iz,efB;var $EB=K(()=>{xH();xq$();mL();gnA();dgA();z$();lB();j0();eB();bB();iz=b(s(),1),efB=b(s(),1)});function AEB({serverName:H,onDone:$}){function A(L){switch(c("tengu_mcp_dialog_choice",{choice:L}),L){case"yes":case"yes_all":{let D=(VL()||{}).enabledMcpjsonServers||[];if(!D.includes(H))II("localSettings",{enabledMcpjsonServers:[...D,H]});if(L==="yes_all")II("localSettings",{enableAllProjectMcpServers:!0});$();break}case"no":{let D=(VL()||{}).disabledMcpjsonServers||[];if(!D.includes(H))II("localSettings",{disabledMcpjsonServers:[...D,H]});$();break}}}return lO$.default.createElement(BL,{title:`New MCP server found in .mcp.json: ${H}`,color:"warning",onCancel:()=>A("no")},lO$.default.createElement(cO$,null),lO$.default.createElement(QA,{options:[{label:"Use this and all future MCP servers in this project",value:"yes_all"},{label:"Use this MCP server",value:"yes"},{label:"Continue without using this MCP server",value:"no"}],onChange:(L)=>A(L),onCancel:()=>A("no")}))}var lO$;var LEB=K(()=>{l8();mL();dgA();z$();bB();lO$=b(s(),1)});async function IEB(){let{servers:H}=OJ("project"),$=Object.keys(H).filter((A)=>w2$(A)==="pending");if($.length===0)return;await new Promise(async(A)=>{let L=()=>{process.stdout.write("\x1B[2J\x1B[3J\x1B[H",()=>{A()})};if($.length===1&&$[0]!==void 0){let I=await A8(v8H.default.createElement(i8,null,v8H.default.createElement(hE,null,v8H.default.createElement(AEB,{serverName:$[0],onDone:()=>{I.unmount?.(),L()}}))),ZG(!1))}else{let I=await A8(v8H.default.createElement(i8,null,v8H.default.createElement(hE,null,v8H.default.createElement(HEB,{serverNames:$,onDone:()=>{I.unmount?.(),L()}}))),ZG(!1))}})}var v8H;var DEB=K(()=>{xH();$EB();LEB();pL();T3();kF();sv();AS();v8H=b(s(),1)});function EEB(){if(cgA!==void 0)return cgA;try{return cf(BEB)}catch{return!1}}function MEB(){if(lgA!==void 0)return lgA;try{return cf(fEB)}catch{return!1}}function Nx1(H,$){let A=sW$(H);if(A===0)return;let L=A!==null?{...$,sample_rate:A}:$;if(EEB())bwA(H,L);if(MEB())JPA(H,L);H7$(H,L)}async function Ox1(H,$){let A=sW$(H);if(A===0)return;let L=A!==null?{...$,sample_rate:A}:$;if(EEB())await bwA(H,L);if(MEB())JPA(H,L);H7$(H,L)}async function GEB(){cgA=cf(BEB),lgA=cf(fEB)}function UEB(){nlA({logEvent:Nx1,logEventAsync:Ox1})}var BEB="tengu_log_segment_events",fEB="tengu_log_datadog_events",cgA=void 0,lgA=void 0;var igA=K(()=>{SD();kwA();FPA();YvH();z$()});async function XEB(H){let $=await Mw(H);for(let A of $){if(A.type!=="prompt")continue;c("tengu_skill_loaded",{skill_name:A.name,skill_source:A.source,skill_loaded_from:A.loadedFrom})}}var JEB=K(()=>{z$();h4()});function KEB({onAccept:H}){dd.default.useEffect(()=>{c("tengu_bypass_permissions_mode_dialog_shown",{})},[]);function $(L){switch(L){case"accept":{c("tengu_bypass_permissions_mode_dialog_accept",{}),AA((I)=>{if(I.bypassPermissionsModeAccepted===!0)return I;return{...I,bypassPermissionsModeAccepted:!0}}),H();break}case"decline":{L9(1);break}}}let A=FEB.useCallback(()=>{L9(0)},[]);return dd.default.createElement(BL,{title:"WARNING: Claude Code running in Bypass Permissions mode",color:"error",onCancel:A},dd.default.createElement(x,{flexDirection:"column",gap:1},dd.default.createElement(V,null,"In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands.",dd.default.createElement(_K,null),"This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged."),dd.default.createElement(V,null,"By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode."),dd.default.createElement(dI,{url:"https://code.claude.com/docs/en/security"})),dd.default.createElement(QA,{options:[{label:"No, exit",value:"decline"},{label:"Yes, I accept",value:"accept"}],onChange:(L)=>$(L)}))}var dd,FEB;var QEB=K(()=>{xH();l8();vA();z$();xH();UU();bB();dd=b(s(),1),FEB=b(s(),1)});function WEB({onDone:H}){let[$,A]=_W.default.useState(!1);return _W.default.useEffect(()=>{c("tengu_claude_in_chrome_onboarding_shown",{}),Vd().then(A),AA((L)=>{return{...L,hasCompletedClaudeInChromeOnboarding:!0}})},[]),WL((L,I)=>{if(I.return)H()}),_W.default.createElement(BL,{title:"Claude in Chrome (Beta)",onCancel:H,color:"chromeYellow"},_W.default.createElement(x,{flexDirection:"column",gap:1},_W.default.createElement(V,null,"Claude in Chrome works with the Chrome extension to let you control your browser directly from Claude Code. You can navigate websites, fill forms, capture screenshots, record GIFs, and debug with console logs and network requests.",!$&&_W.default.createElement(_W.default.Fragment,null,_W.default.createElement(_K,null),_W.default.createElement(_K,null),"Requires the Chrome extension. Get started at"," ",_W.default.createElement(dI,{url:xx1}))),_W.default.createElement(V,{dimColor:!0},"Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on",$&&_W.default.createElement(_W.default.Fragment,null," ","(",_W.default.createElement(dI,{url:Sx1}),")"),"."),_W.default.createElement(V,{dimColor:!0},"For more info, use"," ",_W.default.createElement(V,{bold:!0,color:"chromeYellow"},"/chrome")," ","or visit ",_W.default.createElement(dI,{url:"https://code.claude.com/docs/en/chrome"}))))}var _W,xx1="https://claude.ai/chrome",Sx1="https://clau.de/chrome/permissions";var VEB=K(()=>{xH();xH();vA();z$();H8H();bB();_W=b(s(),1)});class ngA{frameDurations=[];firstRenderTime;lastRenderTime;record(H){let $=performance.now();if(this.firstRenderTime===void 0)this.firstRenderTime=$;this.lastRenderTime=$,this.frameDurations.push(H)}getMetrics(){if(this.frameDurations.length===0||this.firstRenderTime===void 0||this.lastRenderTime===void 0)return;let H=this.lastRenderTime-this.firstRenderTime;if(H<=0)return;let A=this.frameDurations.length/(H/1000),L=[...this.frameDurations].sort((f,E)=>E-f),I=Math.max(0,Math.ceil(L.length*0.01)-1),D=L[I],B=D>0?1000/D:0;return{averageFps:Math.round(A*100)/100,low1PctFps:Math.round(B*100)/100}}}function Nj({newState:H,oldState:$}){if(H.mainLoopModel!==$.mainLoopModel&&H.mainLoopModel===null)II("userSettings",{model:void 0}),KV(null);if(H.mainLoopModel!==$.mainLoopModel&&H.mainLoopModel!==null)II("userSettings",{model:H.mainLoopModel}),KV(H.mainLoopModel);if(H.expandedView!==$.expandedView){let A=H.expandedView==="tasks",L=H.expandedView==="teammates";if(M$().showExpandedTodos!==A||M$().showSpinnerTree!==L)AA((I)=>({...I,showExpandedTodos:A,showSpinnerTree:L}))}if($!==null&&H.todos!==$.todos)for(let A in H.todos)IBH(H.todos[A],A);if(H.verbose!==$.verbose&&M$().verbose!==H.verbose){let A=H.verbose;AA((L)=>({...L,verbose:A}))}if(H.feedbackSurvey.timeLastShown!==$.feedbackSurvey.timeLastShown&&H.feedbackSurvey.timeLastShown!==null){let A=H.feedbackSurvey.timeLastShown;AA((L)=>({...L,feedbackSurveyState:{lastShownTime:A}}))}if(eU()&&H.mcp!==$.mcp){if(CoD(H.mcp.clients,H.mcp.tools,H.mcp.resources),Od())SPH()}if(H.queuedCommands!==$.queuedCommands)jj$(H.queuedCommands.length);if(H.settings!==$.settings)try{if(xD$(),SD$(),H.settings.env!==$.settings.env)Me()}catch(A){r(A instanceof Error?A:Error(`Failed to apply settings changes: ${A}`))}}var rgA=K(()=>{vA();vA();g$();mL();jv();ZPH();BW();ypH();EI();_$();kpH()});function PEB(){let H=M$();if(H.autoUpdates!==!1||H.autoUpdatesProtectedForNative===!0)return;try{let $=ZI("userSettings")||{};II("userSettings",{...$,env:{...$.env,DISABLE_AUTOUPDATER:"1"}}),c("tengu_migrate_autoupdates_to_settings",{was_user_preference:!0,already_had_env_var:!!$.env?.DISABLE_AUTOUPDATER}),process.env.DISABLE_AUTOUPDATER="1",AA((A)=>{let{autoUpdates:L,autoUpdatesProtectedForNative:I,...D}=A;return D})}catch($){r(Error(`Failed to migrate auto-updates: ${$}`)),c("tengu_migrate_autoupdates_error",{has_error:!0})}}var _EB=K(()=>{vA();mL();z$();_$()});function YEB(){let H=Mf(),$=H.enableAllProjectMcpServers!==void 0,A=H.enabledMcpjsonServers&&H.enabledMcpjsonServers.length>0,L=H.disabledMcpjsonServers&&H.disabledMcpjsonServers.length>0;if(!$&&!A&&!L)return;try{let I=ZI("localSettings")||{},D={},B=[];if($&&I.enableAllProjectMcpServers===void 0)D.enableAllProjectMcpServers=H.enableAllProjectMcpServers,B.push("enableAllProjectMcpServers");else if($)B.push("enableAllProjectMcpServers");if(A&&H.enabledMcpjsonServers){let f=I.enabledMcpjsonServers||[];D.enabledMcpjsonServers=[...new Set([...f,...H.enabledMcpjsonServers])],B.push("enabledMcpjsonServers")}if(L&&H.disabledMcpjsonServers){let f=I.disabledMcpjsonServers||[];D.disabledMcpjsonServers=[...new Set([...f,...H.disabledMcpjsonServers])],B.push("disabledMcpjsonServers")}if(Object.keys(D).length>0)II("localSettings",D);if(B.includes("enableAllProjectMcpServers")||B.includes("enabledMcpjsonServers")||B.includes("disabledMcpjsonServers"))MM((f)=>{let{enableAllProjectMcpServers:E,enabledMcpjsonServers:M,disabledMcpjsonServers:G,...U}=f;return U});c("tengu_migrate_mcp_approval_fields_success",{migratedCount:B.length})}catch{c("tengu_migrate_mcp_approval_fields_error",{})}}var CEB=K(()=>{vA();mL();z$()});function ZEB(){let $=Mf().ignorePatterns;if(!$||!Array.isArray($)||$.length===0)return;let A=[];for(let D of $){let B=vB$(D);if(wEB.posix.isAbsolute(B)&&!B.startsWith("//"))B="/"+B;A.push({toolName:"Read",ruleContent:B},{toolName:"Edit",ruleContent:B})}if(RB$({ruleValues:A,ruleBehavior:"deny"},"localSettings"))try{MM((D)=>{let{ignorePatterns:B,...f}=D;return f}),c("tengu_migrate_ignore_patterns_success",{ignore_patterns_count:$.length})}catch(D){r(Error(`Failed to remove ignorePatterns from config: ${D instanceof Error?D.message:String(D)}`)),c("tengu_migrate_ignore_patterns_config_cleanup_error",{ignore_patterns_count:$.length})}else r(Error("Failed to migrate ignorePatterns to settings permissions")),c("tengu_migrate_ignore_patterns_error",{ignore_patterns_count:$.length})}var wEB;var qEB=K(()=>{vA();z$();_$();BM();_q();wEB=require("path")});function TEB(){if(M$().sonnet45MigrationComplete)return;if(sI()!=="firstParty"){AA((L)=>({...L,sonnet45MigrationComplete:!0}));return}if(VL()?.model!==void 0){II("userSettings",{model:void 0});let L=Date.now();AA((I)=>({...I,sonnet45MigrationComplete:!0,sonnet45MigrationTimestamp:L}))}else AA((L)=>({...L,sonnet45MigrationComplete:!0}))}var zEB=K(()=>{vA();mL();oM()});function NEB(){if(M$().opus45MigrationComplete)return;let $=sI(),A=TzH()||zzH();if($!=="firstParty"||!A){AA((I)=>({...I,opus45MigrationComplete:!0}));return}if(VL()?.model!==void 0)II("userSettings",{model:void 0});AA((I)=>({...I,opus45MigrationComplete:!0}))}var OEB=K(()=>{vA();mL();oM();aI()});function xEB(){if(M$().opusProMigrationComplete)return;if(sI()!=="firstParty"||!NzH()){AA((L)=>({...L,opusProMigrationComplete:!0}));return}if(VL()?.model===void 0){let L=Date.now();AA((I)=>({...I,opusProMigrationComplete:!0,opusProMigrationTimestamp:L}))}else AA((L)=>({...L,opusProMigrationComplete:!0}))}var SEB=K(()=>{vA();mL();oM();aI()});function jEB(){if(M$().thinkingMigrationComplete)return;if(VL().alwaysThinkingEnabled!==!1){AA((A)=>({...A,thinkingMigrationComplete:!0}));return}II("userSettings",{alwaysThinkingEnabled:void 0}),AA((A)=>({...A,thinkingMigrationComplete:!0}))}var REB=K(()=>{vA();mL();mL()});var yEB=K(()=>{mL()});var jx1,vEB,OdH;var hEB=K(()=>{KzH();jx1=$9.object({entries:$9.record($9.string(),$9.string())}),vEB=$9.object({userId:$9.string(),version:$9.number(),lastModified:$9.string(),checksum:$9.string(),content:jx1}),OdH={USER_SETTINGS:"~/.claude/settings.json",USER_MEMORY:"~/.claude/CLAUDE.md",projectSettings:(H)=>`projects/${H}/.claude/settings.local.json`,projectMemory:(H)=>`projects/${H}/CLAUDE.local.md`}});async function uEB(){try{if(!yx1())return EL("info","settings_sync_download_skipped"),c("tengu_settings_sync_download_skipped",{}),!1;EL("info","settings_sync_download_starting");let H=await kx1();if(!H.success)return EL("warn","settings_sync_download_fetch_failed"),c("tengu_settings_sync_download_fetch_failed",{}),!1;if(H.isEmpty)return EL("info","settings_sync_download_empty"),c("tengu_settings_sync_download_empty",{}),!1;let $=H.data.content.entries,A=await osH();return EL("info","settings_sync_download_applying",{entryCount:Object.keys($).length}),ux1($,A),c("tengu_settings_sync_download_success",{entryCount:Object.keys($).length}),!0}catch{return EL("error","settings_sync_download_error"),c("tengu_settings_sync_download_error",{}),!1}}function yx1(){if(sI()!=="firstParty"||!ZGH())return!1;let H=dD();return Boolean(H?.accessToken&&H.scopes?.includes(VR))}function vx1(){return`${XD().BASE_API_URL}/api/claude_code/user_settings`}function hx1(){let H=dD();if(H?.accessToken)return{headers:{Authorization:`Bearer ${H.accessToken}`,"anthropic-beta":N_}};return{headers:{},error:"No OAuth token available"}}async function bx1(){try{await iW();let H=hx1();if(H.error)return{success:!1,error:H.error,skipRetry:!0};let $={...H.headers,"User-Agent":sG()},A=vx1(),L=await nA.get(A,{headers:$,timeout:Rx1,validateStatus:(D)=>D===200||D===404});if(L.status===404)return EL("info","settings_sync_fetch_empty"),{success:!0,isEmpty:!0};let I=vEB.safeParse(L.data);if(!I.success)return EL("warn","settings_sync_fetch_invalid_format"),{success:!1,error:"Invalid settings sync response format"};return EL("info","settings_sync_fetch_success"),{success:!0,data:I.data,isEmpty:!1}}catch(H){if(nA.isAxiosError(H)){if(H.response?.status===401||H.response?.status===403)return{success:!1,error:"Not authorized for settings sync",skipRetry:!0};if(H.code==="ECONNABORTED")return{success:!1,error:"Settings sync request timeout"};if(H.code==="ECONNREFUSED"||H.code==="ENOTFOUND")return{success:!1,error:"Cannot connect to server"}}return{success:!1,error:H instanceof Error?H.message:"Unknown error"}}}async function kx1(){let H=null;for(let $=1;$<=agA+1;$++){if(H=await bx1(),H.success)return H;if(H.skipRetry)return H;if($>agA)return H;let A=Rg($);EL("info","settings_sync_retry",{attempt:$,maxRetries:agA,delayMs:A}),await $x(A)}return H}function iO$(H,$){try{let A=kEB.dirname(H);if(A)xdH.mkdirSync(A,{recursive:!0});return xdH.writeFileSync(H,$,"utf8"),EL("info","settings_sync_file_written"),!0}catch{return EL("warn","settings_sync_file_write_failed"),!1}}function ux1(H,$){let A=0,L=!1,I=!1,D=(E,M)=>{let G=Buffer.byteLength(E,"utf8");if(G>bEB)return EL("info","settings_sync_file_too_large",{sizeBytes:G,maxBytes:bEB}),!0;return!1},B=H[OdH.USER_SETTINGS];if(B){let E=aM("userSettings");if(E&&!D(B,E)){if(AF.markInternalWrite("userSettings"),iO$(E,B))A++,L=!0}}let f=H[OdH.USER_MEMORY];if(f){let E=yv("User");if(!D(f,E)){if(iO$(E,f))A++,I=!0}}if($){let E=OdH.projectSettings($),M=H[E];if(M){let X=aM("localSettings");if(X&&!D(M,X)){if(AF.markInternalWrite("localSettings"),iO$(X,M))A++,L=!0}}let G=OdH.projectMemory($),U=H[G];if(U){let X=yv("Local");if(!D(U,X)){if(iO$(X,U))A++,I=!0}}}if(L)E5();if(I)QJ.cache.clear?.();EL("info","settings_sync_applied",{appliedCount:A})}var xdH,kEB,Rx1=1e4,agA=3,bEB=512000;var gEB=K(()=>{w1();SD();_Q();Z6();z$();qE();EI();oM();t8();mL();gk();vA();mQ();rD();hEB();IDH();Ng();g$();xdH=require("fs"),kEB=require("path")});function SdH(H,$,A,L){let I={type:"permissionPromptTool",permissionPromptToolName:$.name,toolResult:H};if(H.behavior==="allow"){let D=H.updatedPermissions;if(D)L.setAppState((B)=>({...B,toolPermissionContext:T2(B.toolPermissionContext,D)})),Pu(D);return{...H,decisionReason:I}}else if(H.behavior==="deny"&&H.interrupt)N(`SDK permission prompt deny+interrupt: tool=${$.name} message=${H.message}`),L.abortController.abort();return{...H,decisionReason:I}}var Q$U,gx1,mx1,nO$;var ogA=K(()=>{mI();i6A();C5();E$();Q$U=QD.object({tool_name:QD.string().describe("The name of the tool requesting permission"),input:QD.record(QD.string(),QD.unknown()).describe("The input for the tool"),tool_use_id:QD.string().optional().describe("The unique tool use request ID")}),gx1=QD.object({behavior:QD.literal("allow"),updatedInput:QD.record(QD.string(),QD.unknown()),updatedPermissions:QD.array(vK$).optional(),toolUseID:QD.string().optional()}),mx1=QD.object({behavior:QD.literal("deny"),message:QD.string(),interrupt:QD.boolean().optional(),toolUseID:QD.string().optional()}),nO$=QD.union([gx1,mx1])});function px1(H){if(!H)return;switch(H.type){case"rule":case"mode":case"subcommandResults":case"permissionPromptTool":return;case"hook":case"asyncAgent":case"sandboxOverride":case"classifier":case"workingDir":case"other":return H.reason}}class jdH{input;replayUserMessages;structuredInput;pendingRequests=new Map;inputClosed=!1;unexpectedResponseCallback;constructor(H,$){this.input=H;this.replayUserMessages=$;this.input=H,this.structuredInput=this.read()}async*read(){let H="";for await(let $ of this.input){H+=$;let A;while((A=H.indexOf(` `)})()}}async write(H){await this.transport.write(H)}close(){this.transport.close(),this.inputStream.end()}}});var aEB=K(()=>{vV();Mn();tG();GK()});class oEB{config;mutableMessages;abortController;permissionDenials;totalUsage;hasHandledOrphanedPermission=!1;constructor(H){this.config=H,this.mutableMessages=H.initialMessages??[],this.abortController=H.abortController??nD(),this.permissionDenials=[],this.totalUsage=JC}async*submitMessage(H,$){let{cwd:A,commands:L,tools:I,mcpClients:D,verbose:B=!1,maxThinkingTokens:f,maxTurns:E,maxBudgetUsd:M,canUseTool:G,customSystemPrompt:U,appendSystemPrompt:X,userSpecifiedModel:J,fallbackModel:F,jsonSchema:Q,getAppState:W,setAppState:P,replayUserMessages:C=!1,includePartialMessages:Y=!1,agents:Z=[],setSDKStatus:q,orphanedPermission:O}=this.config;MC(A);let j=!uZ(),u=Date.now(),y=async(U$,hA,iA,rH,G$,b$)=>{let ZA=await G(U$,hA,iA,rH,G$,b$);if(ZA.behavior!=="allow")this.permissionDenials.push({tool_name:U$.name,tool_use_id:G$,tool_input:hA});return ZA},g=await W(),h=J?m8(J):X1(),[p,d,k]=await Promise.all([HC(I,h,Array.from(g.toolPermissionContext.additionalWorkingDirectories.keys()),D),u5(),typeof U==="string"?Promise.resolve({}):k5()]),n={...d,...tx1(D)},GH=[...typeof U==="string"?[U]:p,...X?[X]:[]],HH=I.some((U$)=>U$.name===qK);if(Q&&HH)cK$(P,j$());let BH={messages:this.mutableMessages,setMessages:()=>{},onChangeAPIKey:()=>{},options:{commands:L,debug:!1,tools:I,verbose:B,mainLoopModel:h,maxThinkingTokens:f??0,mcpClients:D,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:U,appendSystemPrompt:X,agentDefinitions:{activeAgents:Z,allAgents:[]},theme:M$().theme,maxBudgetUsd:M},getAppState:W,setAppState:P,abortController:this.abortController,readFileState:D1H(this.mutableMessages,A),setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:(U$)=>{P((hA)=>({...hA,fileHistory:U$(hA.fileHistory)}))},updateAttributionState:(U$)=>{P((hA)=>({...hA,attribution:U$(hA.attribution)}))},setSDKStatus:q};if(O&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let U$ of KSD(O,I,this.mutableMessages,BH))yield U$}let{messages:WH,shouldQuery:wH,allowedTools:QH,maxThinkingTokens:TH,model:t,resultText:IH}=await XO$({input:H,mode:"prompt",setIsLoading:()=>{},setToolJSX:()=>{},context:{...BH,messages:this.mutableMessages},messages:this.mutableMessages,uuid:$?.uuid,querySource:"sdk"});this.mutableMessages.push(...WH);let KH=f??TH??0,MH=[...this.mutableMessages],CH=WH.filter((U$)=>U$.type==="user"&&!U$.isMeta&&!U$.toolUseResult||U$.type==="system"&&U$.subtype==="compact_boundary"),OH=C?CH:[];P((U$)=>({...U$,toolPermissionContext:{...U$.toolPermissionContext,alwaysAllowRules:{...U$.toolPermissionContext.alwaysAllowRules,command:QH}}}));let LH=t??h,e=D1H(MH,A),DH=eKH(e,BH.readFileState);BH={messages:MH,setMessages:()=>{},onChangeAPIKey:()=>{},options:{commands:L,debug:!1,tools:I,verbose:B,mainLoopModel:LH,maxThinkingTokens:KH,mcpClients:D,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:U,appendSystemPrompt:X,theme:M$().theme,agentDefinitions:{activeAgents:Z,allAgents:[]},maxBudgetUsd:M},getAppState:W,setAppState:P,abortController:this.abortController,readFileState:DH,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:BH.updateFileHistoryState,updateAttributionState:BH.updateAttributionState,setSDKStatus:q};let $H=VL()?.outputStyle??HW,[FH,{enabled:YH}]=await Promise.all([DF$(C$()),xf()]),qH={type:"system",subtype:"init",cwd:A,session_id:j$(),tools:I.map((U$)=>U$.name),mcp_servers:D.map((U$)=>({name:U$.name,status:U$.type})),model:LH,permissionMode:g.toolPermissionContext.mode,slash_commands:L.map((U$)=>U$.name),apiKeySource:Y5().source,betas:V6(),claude_code_version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,output_style:$H,agents:Z.map((U$)=>U$.agentType),skills:FH.map((U$)=>U$.name),plugins:YH.map((U$)=>({name:U$.name,path:U$.path})),uuid:cd.randomUUID()};if(cD()&&g.fastMode&&!zq())qH.fast_mode=!0;if(yield qH,L1H("system_message_yielded"),!wH){for(let U$ of CH){if(U$.type==="user"&&typeof U$.message.content==="string"&&(U$.message.content.includes(`<${hMH}>`)||U$.message.content.includes(`<${FtH}>`)||U$.isCompactSummary))MH.push(U$),yield{type:"user",message:{...U$.message,content:$U(U$.message.content)},session_id:j$(),parent_tool_use_id:null,uuid:U$.uuid,isReplay:!U$.isCompactSummary};if(U$.type==="system"&&U$.subtype==="compact_boundary")MH.push(U$),yield{type:"system",subtype:"compact_boundary",session_id:j$(),uuid:U$.uuid,compact_metadata:{trigger:U$.compactMetadata.trigger,pre_tokens:U$.compactMetadata.preTokens}}}if(j){if(await $j(MH),A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"success",is_error:!1,duration_ms:Date.now()-u,duration_api_ms:rC(),num_turns:MH.length-1,result:IH??"",stop_reason:null,session_id:j$(),total_cost_usd:BQ(),usage:JC,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID()};return}if(gE()&&j)WH.filter(upH).forEach((U$)=>{O6H((hA)=>{P((iA)=>({...iA,fileHistory:hA(iA.fileHistory)}))},U$.uuid)});let bH=JC,hH=1,PH=!1,gH,vH=null,tH=Q?ybA(this.mutableMessages,qK):0;for await(let U$ of vP({messages:MH,systemPrompt:GH,userContext:n,systemContext:k,canUseTool:y,toolUseContext:BH,fallbackModel:F,querySource:"sdk",maxTurns:E})){if(U$.type==="assistant"||U$.type==="user"||U$.type==="system"&&U$.subtype==="compact_boundary"){if(MH.push(U$),j)await $j(MH);if(!PH&&OH.length>0){PH=!0;for(let hA of OH)if(hA.type==="user")yield{type:"user",message:hA.message,session_id:j$(),parent_tool_use_id:null,uuid:hA.uuid,isReplay:!0}}}if(U$.type==="user")hH++;switch(U$.type){case"tombstone":break;case"assistant":vH=U$.message.stop_reason,this.mutableMessages.push(U$),yield*qSA(U$);break;case"progress":case"user":this.mutableMessages.push(U$),yield*qSA(U$);break;case"stream_event":if(U$.event.type==="message_start")bH=JC,bH=I1H(bH,U$.event.message.usage);if(U$.event.type==="message_delta")bH=I1H(bH,U$.event.usage);if(U$.event.type==="message_stop")this.totalUsage=BZ$(this.totalUsage,bH);if(Y)yield{type:"stream_event",event:U$.event,session_id:j$(),parent_tool_use_id:null,uuid:cd.randomUUID()};break;case"attachment":if(this.mutableMessages.push(U$),U$.attachment.type==="structured_output")gH=U$.attachment.data;else if(U$.attachment.type==="max_turns_reached"){if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"error_max_turns",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!1,num_turns:U$.attachment.turnCount,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:[]};return}else if(C&&U$.attachment.type==="queued_command")yield{type:"user",message:{role:"user",content:U$.attachment.prompt},session_id:j$(),parent_tool_use_id:null,uuid:U$.attachment.source_uuid||U$.uuid,isReplay:!0};break;case"stream_request_start":break;case"system":if(this.mutableMessages.push(U$),U$.subtype==="compact_boundary"&&U$.compactMetadata)yield{type:"system",subtype:"compact_boundary",session_id:j$(),uuid:U$.uuid,compact_metadata:{trigger:U$.compactMetadata.trigger,pre_tokens:U$.compactMetadata.preTokens}};break;case"tool_use_summary":yield{type:"tool_use_summary",summary:U$.summary,preceding_tool_use_ids:U$.precedingToolUseIds,session_id:j$(),uuid:U$.uuid};break}if(M!==void 0&&BQ()>=M){if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"error_max_budget_usd",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!1,num_turns:hH,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:[]};return}if(U$.type==="user"&&Q){let iA=ybA(this.mutableMessages,qK)-tH,rH=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||"5",10);if(iA>=rH){if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}yield{type:"result",subtype:"error_max_structured_output_retries",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!0,num_turns:hH,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:[`Failed to provide valid structured output after ${rH} attempts`]};return}}}let K$=_6(MH);if(j){if(A$(process.env.CLAUDE_CODE_EAGER_FLUSH)||A$(process.env.CLAUDE_CODE_IS_COWORK))await B8H()}if(!FSD(K$)){yield{type:"result",subtype:"error_during_execution",duration_ms:Date.now()-u,duration_api_ms:rC(),is_error:!1,num_turns:hH,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,uuid:cd.randomUUID(),errors:gMH().map((U$)=>U$.error)};return}let KA="",UA=!1;if(K$.type==="assistant"){let U$=_6(K$.message.content);if(U$?.type==="text")KA=U$.text;UA=Boolean(K$.isApiErrorMessage)}yield{type:"result",subtype:"success",is_error:UA,duration_ms:Date.now()-u,duration_api_ms:rC(),num_turns:hH,result:KA,stop_reason:vH,session_id:j$(),total_cost_usd:BQ(),usage:this.totalUsage,modelUsage:PN(),permission_denials:this.permissionDenials,structured_output:gH,uuid:cd.randomUUID()}}interrupt(){this.abortController.abort()}getMessages(){return this.mutableMessages}getSessionId(){return j$()}setModel(H){this.config.userSpecifiedModel=H}}async function*tEB({commands:H,prompt:$,promptUuid:A,cwd:L,tools:I,mcpClients:D,verbose:B=!1,maxThinkingTokens:f,maxTurns:E,maxBudgetUsd:M,canUseTool:G,mutableMessages:U=[],customSystemPrompt:X,appendSystemPrompt:J,userSpecifiedModel:F,fallbackModel:Q,jsonSchema:W,getAppState:P,setAppState:C,abortController:Y,replayUserMessages:Z=!1,includePartialMessages:q=!1,agents:O=[],setSDKStatus:j,orphanedPermission:u}){yield*new oEB({cwd:L,tools:I,commands:H,mcpClients:D,agents:O,canUseTool:G,getAppState:P,setAppState:C,initialMessages:U,customSystemPrompt:X,appendSystemPrompt:J,userSpecifiedModel:F,fallbackModel:Q,maxThinkingTokens:f,maxTurns:E,maxBudgetUsd:M,jsonSchema:W,verbose:B,replayUserMessages:Z,includePartialMessages:q,setSDKStatus:j,abortController:Y,orphanedPermission:u}).submitMessage($,{uuid:A})}var cd,tx1=()=>({});var sEB=K(()=>{SHH();AJ();h4();PI();Ow();bT();Nq();W9H();Y7();nh();rB();NA();_L();hv();DgA();g$();aI();lK$();yq();EE();EI();MgH();QgH();dU();vA();eE();jh();mL();_X();_$();AC();GN$();QZ$();cd=require("crypto")});var eEB=K(()=>{E$()});var HMB=K(()=>{_$();ugA();PI();eEB();z$();Ga()});function $MB(H){let $=process.env.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY,A=$?parseInt($,10):null,L=A&&!isNaN(A)&&A>0,I=null,D=0;return{start(){if(I)clearTimeout(I),I=null;if(L)D=Date.now(),I=setTimeout(()=>{let B=Date.now()-D;if(H()&&B>=A)N(`Exiting after ${A}ms of idle time`),L9()},A)},stop(){if(I)clearTimeout(I),I=null}}}var AMB=K(()=>{E$();UU()});function LMB(H){try{let $=new URL(H);return{sessionId:AmA.randomUUID(),ingressUrl:$.href,isUrl:!0,jsonlFile:null,isJsonlFile:!1}}catch{if(Gw(H))return{sessionId:H,ingressUrl:null,isUrl:!1,jsonlFile:null,isJsonlFile:!1};if(H.endsWith(".jsonl"))return{sessionId:AmA.randomUUID(),ingressUrl:null,isUrl:!1,jsonlFile:H,isJsonlFile:!0}}return null}var AmA;var IMB=K(()=>{dx();AmA=require("crypto")});async function DMB(){N("installPluginsForHeadless: starting");try{let[,H,$,A]=await Promise.all([CO$(),cq$(),hVH(),kVH()]),L=[];if(H.size>0){let M=await lq$(H);for(let G of M){let U=H.get(G);if(!U)continue;try{await uw(U.source),L.push(G),N(`installPluginsForHeadless: installed extra marketplace ${G}`)}catch(X){r(X instanceof Error?X:Error(String(X))),N(`installPluginsForHeadless: failed to install extra marketplace ${G}`)}}if(L.length>0)X3H(),Sx()}let I=await l1(),D=$.filter((M)=>!A.includes(M)),B=[],f=[];for(let M of D){let[,G]=M.split("@");if(!G||G in I)B.push(M);else f.push(M)}if(f.length>0)N(`installPluginsForHeadless: skipping ${f.length} plugins from unknown marketplaces: ${f.join(", ")}`);if(B.length===0)return N("installPluginsForHeadless: no plugins to install"),!1;let E=await iq$(B,()=>{});if(E.installed.length>0)Sx();return N(`installPluginsForHeadless: ${E.installed.length} installed, ${E.failed.length} failed`),E.installed.length>0}catch(H){return r(H instanceof Error?H:Error(String(H))),!1}}var BMB=K(()=>{KgA();uVH();yRA();y4();rq$();_X();E$();_$()});async function MMB(H,$,A,L,I,D,B,f){if(AF.subscribe((q)=>{if(O4$(q,A),cD())A((O)=>({...O,fastMode:O.settings.fastMode===!0}))}),ASA(),await IWH())await mdD();if(vL.isSandboxingEnabled())try{await vL.initialize()}catch(q){process.stderr.write(` `);ZX({mode:"prompt",value:$H,uuid:jC.randomUUID()},E),HH();return}if(X&&!J){J=!0,N("[print.ts] Input closed with active teammates, injecting shutdown prompt"),ZX({mode:"prompt",value:fMB,uuid:jC.randomUUID()},E),HH();return}await new Promise((EH)=>setTimeout(EH,500))}}if(X)if(await(async()=>{let MH=await f();if(EBA(MH))await MBA(E,MH);let CH=await f(),OH=CH.teamContext;return OH&&Object.keys(OH.teammates).length>0||g9$(CH)})())ZX({mode:"prompt",value:fMB,uuid:jC.randomUUID()},E),HH();else await s6A(),GH(),Q.done()},BH=function(wH,QH){Q.enqueue({type:"control_response",response:{subtype:"success",request_id:wH.request_id,response:QH}})},WH=function(wH,QH){Q.enqueue({type:"control_response",response:{subtype:"error",request_id:wH.request_id,error:QH}})};return H.setUnexpectedResponseCallback(async(wH)=>{await DS1({message:wH,setAppState:E,onEnqueued:()=>{HH()}})}),(async()=>{let wH=!1;for await(let QH of H.structuredInput){if(QH.type==="control_request"){if(QH.request.subtype==="interrupt"){if(F)F.abort();BH(QH)}else if(QH.request.subtype==="initialize"){if(QH.request.sdkMcpServers&&QH.request.sdkMcpServers.length>0)for(let TH of QH.request.sdkMcpServers)B[TH]={type:"sdk",name:TH};await $S1(QH.request,QH.request_id,wH,Q,A,Z,H,!!G.enableAuthStatus,G,M,f),wH=!0}else if(QH.request.subtype==="set_permission_mode"){let TH=QH.request;E((t)=>({...t,toolPermissionContext:AS1(TH,QH.request_id,t.toolPermissionContext,Q)})),BH(QH)}else if(QH.request.subtype==="set_model"){let TH=QH.request.model==="default"?xq():QH.request.model;q=TH,KV(TH),BH(QH)}else if(QH.request.subtype==="set_max_thinking_tokens"){if(QH.request.max_thinking_tokens===null)G.maxThinkingTokens=void 0;else G.maxThinkingTokens=QH.request.max_thinking_tokens;BH(QH)}else if(QH.request.subtype==="mcp_status"){let TH=await f(),t=TH.mcp.clients,IH=[...TH.mcp.tools,...y.tools],KH=[...t,...O,...y.clients].map((MH)=>{let CH;if(MH.config.type==="sse"||MH.config.type==="http")CH={type:MH.config.type,url:MH.config.url};else if(MH.config.type==="claudeai-proxy")CH={type:"claudeai-proxy",url:MH.config.url,id:MH.config.id};else if(MH.config.type==="stdio")CH={type:"stdio",command:MH.config.command,args:MH.config.args};let OH=MH.type==="connected"?dh(IH,MH.name).map((LH)=>({name:LH.originalMcpToolName??LH.name,annotations:{readOnly:LH.isReadOnly({})||void 0,destructive:LH.isDestructive?.({})||void 0,openWorld:LH.isOpenWorld?.({})||void 0}})):void 0;return{name:MH.name,status:MH.type,serverInfo:MH.type==="connected"?MH.serverInfo:void 0,error:MH.type==="failed"?MH.error:void 0,config:CH,scope:MH.config.scope,tools:OH}});BH(QH,{mcpServers:KH})}else if(QH.request.subtype==="mcp_message"){let TH=QH.request,t=O.find((IH)=>IH.name===TH.server_name);if(t&&t.type==="connected"&&t.client?.transport?.onmessage)t.client.transport.onmessage(TH.message);BH(QH)}else if(QH.request.subtype==="rewind_files"){let TH=await f(),t=await GMB(QH.request.user_message_id,TH,E,QH.request.dry_run??!1);if(t.canRewind||QH.request.dry_run)BH(QH,t);else WH(QH,t.error??"Unexpected error")}else if(QH.request.subtype==="mcp_set_servers"){let{response:TH,sdkServersChanged:t}=await p(QH.request.servers);if(BH(QH,TH),t)u()}else if(QH.request.subtype==="mcp_reconnect"){let{serverName:TH}=QH.request,t=Mz(TH)??$.find((IH)=>IH.name===TH)?.config??null;if(!t)WH(QH,`Server not found: ${TH}`);else{let IH=await ih(TH,t),KH=bc(TH);if(E((MH)=>({...MH,mcp:{...MH.mcp,clients:MH.mcp.clients.map((CH)=>CH.name===TH?IH.client:CH),tools:[...DR(MH.mcp.tools,(CH)=>CH.name?.startsWith(KH)),...IH.tools],commands:[...DR(MH.mcp.commands,(CH)=>CH.name?.startsWith(KH)),...IH.commands],resources:IH.resources&&IH.resources.length>0?{...MH.mcp.resources,[TH]:IH.resources}:VEH(MH.mcp.resources,TH)}})),IH.client.type==="connected")BH(QH);else{let MH=IH.client.type==="failed"?IH.client.error??"Connection failed":`Server status: ${IH.client.type}`;WH(QH,MH)}}}else if(QH.request.subtype==="mcp_toggle"){let{serverName:TH,enabled:t}=QH.request,IH=Mz(TH)??$.find((KH)=>KH.name===TH)?.config??null;if(!IH)WH(QH,`Server not found: ${TH}`);else if(!t){W3H(TH,!1);let KH=[...$,...O,...y.clients].find((CH)=>CH.name===TH);if(KH&&KH.type==="connected")await lh(TH,IH);let MH=bc(TH);E((CH)=>({...CH,mcp:{...CH.mcp,clients:CH.mcp.clients.map((OH)=>OH.name===TH?{name:TH,type:"disabled",config:IH}:OH),tools:DR(CH.mcp.tools,(OH)=>OH.name?.startsWith(MH)),commands:DR(CH.mcp.commands,(OH)=>OH.name?.startsWith(MH)),resources:VEH(CH.mcp.resources,TH)}})),BH(QH)}else{W3H(TH,!0);let KH=await ih(TH,IH),MH=bc(TH);if(E((CH)=>({...CH,mcp:{...CH.mcp,clients:CH.mcp.clients.map((OH)=>OH.name===TH?KH.client:OH),tools:[...DR(CH.mcp.tools,(OH)=>OH.name?.startsWith(MH)),...KH.tools],commands:[...DR(CH.mcp.commands,(OH)=>OH.name?.startsWith(MH)),...KH.commands],resources:KH.resources&&KH.resources.length>0?{...CH.mcp.resources,[TH]:KH.resources}:VEH(CH.mcp.resources,TH)}})),KH.client.type==="connected")BH(QH);else{let CH=KH.client.type==="failed"?KH.client.error??"Connection failed":`Server status: ${KH.client.type}`;WH(QH,CH)}}}continue}else if(QH.type==="control_response"){if(G.replayUserMessages)Q.enqueue(QH);continue}else if(QH.type==="keep_alive")continue;else if(QH.type==="update_environment_variables")continue;if(wH=!0,QH.uuid){let TH=j$();if(await lbA(TH,QH.uuid)||EMB.has(QH.uuid)){if(N(`Skipping duplicate user message: ${QH.uuid}`),G.replayUserMessages)N(`Sending acknowledgment for duplicate user message: ${QH.uuid}`),Q.enqueue({type:"user",message:QH.message,session_id:TH,parent_tool_use_id:null,uuid:QH.uuid,isReplay:!0});continue}EMB.add(QH.uuid)}E((TH)=>{return{...TH,queuedCommands:[...TH.queuedCommands,{mode:"prompt",value:QH.message.content,uuid:QH.uuid}]}}),HH()}if(X=!0,!U)await s6A(),GH(),Q.done()})(),Q}function ex1(H){let $=async(A,L,I,D,B)=>{let f=await qF(A,L,I,D,B);if(f.behavior==="allow"||f.behavior==="deny")return f;let{signal:E,cleanup:M}=yT(I.abortController.signal);if(E.aborted)return M(),{behavior:"deny",message:"Permission prompt was aborted.",decisionReason:{type:"permissionPromptTool",permissionPromptToolName:A.name,toolResult:void 0}};let G=new Promise((Q)=>{E.addEventListener("abort",()=>Q("aborted"),{once:!0})}),U=H.call({tool_name:A.name,input:L,tool_use_id:B},I,$,D),X=await Promise.race([U,G]);if(M(),X==="aborted"||E.aborted)return{behavior:"deny",message:"Permission prompt was aborted.",decisionReason:{type:"permissionPromptTool",permissionPromptToolName:A.name,toolResult:void 0}};let J=X,F=H.mapToolResultToToolResultBlockParam(J.data,"1");if(!F.content||!Array.isArray(F.content)||!F.content[0]||F.content[0].type!=="text"||typeof F.content[0].text!=="string")throw Error('Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.');return SdH(nO$.parse(q1(F.content[0].text)),H,L,I)};return $}function HS1(H,$,A,L){if(H==="stdio")return $.createCanUseTool(L);else if(H){let I=A.find((D)=>D.name===H);if(!I){let D=`Error: MCP tool ${H} (passed via --permission-prompt-tool) not found. Available MCP tools: ${A.map((B)=>B.name).join(", ")||"none"}`;throw process.stderr.write(`${D} `)}async function LS1(H,$){let A=!uZ();if($.continue)try{c("tengu_continue_print",{});let L=await kt(void 0,void 0);if(L){if(!$.forkSession){if(L.sessionId){if(FV(Z7(L.sessionId)),A)await aw()}}return XdH(L,H),L.messages}}catch(L){return r(L instanceof Error?L:Error(String(L))),L9(1),[]}if($.teleport)try{if(!PK("allow_remote_sessions"))throw Error("Remote sessions are disabled by your organization's policy.");if(c("tengu_teleport_print",{}),typeof $.teleport!=="string")throw Error("No session ID provided for teleport");await A2$();let L=await ut($.teleport),{branchError:I}=await f3H(L.branch);return B3H(L.log,I)}catch(L){return r(L instanceof Error?L:Error(String(L))),L9(1),[]}if($.resume)try{c("tengu_resume_print",{});let L=LMB(typeof $.resume==="string"?$.resume:"");if(!L){let D="Error: --resume requires a valid session ID when used with --print. Usage: claude -p --resume ";if(typeof $.resume==="string")D+=`. Session IDs must be in UUID format (e.g., 550e8400-e29b-41d4-a716-446655440000). Provided value "${$.resume}" is not a valid UUID`;return rO$(D,$.outputFormat),L9(1),[]}if(L.isUrl&&L.ingressUrl)await kbA(L.sessionId,L.ingressUrl);let I=await kt(L.sessionId,L.jsonlFile||void 0);if(!I)if(L.isUrl)return await r7("startup");else return rO$(`No conversation found with session ID: ${L.sessionId}`,$.outputFormat),L9(1),[];if($.resumeSessionAt){let D=I.messages.findIndex((B)=>B.uuid===$.resumeSessionAt);if(D<0)return rO$(`No message found with message.uuid of: ${$.resumeSessionAt}`,$.outputFormat),L9(1),[];I.messages=D>=0?I.messages.slice(0,D+1):[]}if(!$.forkSession&&I.sessionId){if(FV(Z7(I.sessionId)),A)await aw()}return XdH(I,H),I.messages}catch(L){r(L instanceof Error?L:Error(String(L)));let I=L instanceof Error?`Failed to resume session: ${L.message}`:"Failed to resume session with --print mode";return rO$(I,$.outputFormat),L9(1),[]}return await r7("startup")}function IS1(H,$){let A;if(typeof H==="string")if(H.trim()!=="")A=e6A([yH({type:"user",session_id:"",message:{role:"user",content:H},parent_tool_use_id:null})]);else A=e6A([]);else A=H;return $.sdkUrl?new $mA($.sdkUrl,A,$.replayUserMessages):new jdH(A,$.replayUserMessages)}async function DS1({message:H,setAppState:$,onEnqueued:A}){if(H.response.subtype==="success"&&H.response.response?.toolUseID&&typeof H.response.response.toolUseID==="string"){let L=H.response.response,{toolUseID:I}=L;if(!I)return!1;let D=await ibA(I);if(D)return $((B)=>({...B,queuedCommands:[...B.queuedCommands,{mode:"orphaned-permission",value:[],orphanedPermission:{permissionResult:L,assistantMessage:D}}]})),A?.(),!0}return!1}function LmA(H){return{...H,scope:"dynamic"}}async function BS1(H,$,A,L){let I={},D={};for(let[F,Q]of Object.entries(H))if(Q.type==="sdk")I[F]=Q;else D[F]=Q;let B=new Set(Object.keys($.configs)),f=new Set(Object.keys(I)),E=[],M=[],G={...$.configs},U=[...$.clients],X=[...$.tools];for(let F of B)if(!f.has(F)){let Q=U.find((P)=>P.name===F);if(Q&&Q.type==="connected")await Q.cleanup();U=U.filter((P)=>P.name!==F);let W=`mcp__${F}__`;X=X.filter((P)=>!P.name.startsWith(W)),delete G[F],M.push(F)}for(let[F,Q]of Object.entries(I))if(!B.has(F)){G[F]=Q;let W={type:"pending",name:F,config:{...Q,scope:"dynamic"}};U=[...U,W],E.push(F)}let J=await fS1(D,A,L);return{response:{added:[...E,...J.response.added],removed:[...M,...J.response.removed],errors:J.response.errors},newSdkState:{configs:G,clients:U,tools:X},newDynamicState:J.newState,sdkServersChanged:E.length>0||M.length>0}}async function fS1(H,$,A){let L=new Set(Object.keys($.configs)),I=new Set(Object.keys(H)),D=[...L].filter((W)=>!I.has(W)),B=[...I].filter((W)=>!L.has(W)),E=[...L].filter((W)=>I.has(W)).filter((W)=>{let P=$.configs[W],C=H[W];if(!P||!C)return!0;let Y=LmA(C);return!pqD(P,Y)}),M=[],G=[],U={},X=[...$.clients],J=[...$.tools];for(let W of[...D,...E]){let P=X.find((Z)=>Z.name===W),C=$.configs[W];if(P&&C){if(P.type==="connected")try{await P.cleanup()}catch(Z){r(Z instanceof Error?Z:Error(String(Z)))}await lh(W,C)}let Y=`mcp__${W}__`;if(J=J.filter((Z)=>!Z.name.startsWith(Y)),X=X.filter((Z)=>Z.name!==W),D.includes(W))M.push(W)}for(let W of[...B,...E]){let P=H[W];if(!P)continue;let C=LmA(P);if(P.type==="sdk"){G.push(W);continue}try{let Y=await Gz(W,C);if(X.push(Y),Y.type==="connected"){let Z=await zS(Y);J.push(...Z)}else if(Y.type==="failed")U[W]=Y.error||"Connection failed";G.push(W)}catch(Y){let Z=Y instanceof Error?Y.message:String(Y);U[W]=Z,r(Y instanceof Error?Y:Error(Z))}}let F={};for(let W of I){let P=H[W];if(P)F[W]=LmA(P)}let Q={clients:X,tools:J,configs:F};return A((W)=>{let P=new Set([...Object.keys($.configs),...Object.keys(F)]),C=W.mcp.tools.filter((Z)=>{for(let q of P)if(Z.name.startsWith(`mcp__${q}__`))return!1;return!0}),Y=W.mcp.clients.filter((Z)=>{return!P.has(Z.name)});return{...W,mcp:{...W.mcp,tools:[...C,...J],clients:[...Y,...X]}}}),{response:{added:G,removed:M,errors:U},newState:Q}}var ImA,jC,fMB=` Shut down your team and prepare your final response for the user.`,EMB;var UMB=K(()=>{gEB();sgA();rEB();h4();aEB();g7();z$();E$();kT();CP();_$();ISA();QgH();I3H();dx();TBH();sEB();uK$();HMB();gK$();UU();AMB();PI();SHH();UR$();XR$();ip();XY();XJ();nM();ogA();eE();RyH();bt();jh();EE();mL();gk();b5A();AJ();cg();EI();g$();hv();IMB();rB();JDH();f3();T3();tC();kF();N6H();T3();BW();DWH();uT$();UvA();aI();ND$();g$();AC();FdH();EM();MgH();Z$();MN$();h4();NA();BMB();XE();sU();aY();JG();ImA=require("process"),jC=require("crypto"),EMB=new Set});async function XMB(){try{let H=await _S();if(!H){N("Not in a GitHub repository, skipping path mapping update");return}let $;try{$=aO$.realpathSync(zL())}catch{$=zL()}let A=H.toLowerCase(),I=M$().githubRepoPaths?.[A]??[];if(I.includes($)){N(`Path ${$} already tracked for repo ${A}`);return}let D=[$,...I];AA((B)=>({...B,githubRepoPaths:{...B.githubRepoPaths,[A]:D}})),N(`Added ${$} to tracked paths for repo ${A}`)}catch(H){N(`Error updating repo path mapping: ${H}`)}}function JMB(H){let $=M$(),A=H.toLowerCase();return $.githubRepoPaths?.[A]??[]}function FMB(H){return H.filter(($)=>aO$.existsSync($))}async function KMB(H,$){try{let A=await asH(H);if(!A)return!1;let L=L9H(A);if(!L)return!1;return L.toLowerCase()===$.toLowerCase()}catch{return!1}}function QMB(H,$){let A=M$(),L=H.toLowerCase(),I=A.githubRepoPaths?.[L]??[],D=I.filter((f)=>f!==$);if(D.length===I.length)return;let B={...A.githubRepoPaths};if(D.length===0)delete B[L];else B[L]=D;AA((f)=>({...f,githubRepoPaths:B})),N(`Removed ${$} from tracked paths for repo ${L}`)}var aO$;var DmA=K(()=>{I9H();vA();g$();E$();j$H();aO$=require("fs")});function WMB({targetRepo:H,initialPaths:$,onSelectPath:A,onCancel:L}){let[I,D]=M_H.useState($),[B,f]=M_H.useState(null),[E,M]=M_H.useState(!1),G=M_H.useCallback(async(X)=>{if(X==="cancel"){L();return}if(M(!0),f(null),await KMB(X,H)){A(X);return}QMB(H,X);let F=I.filter((Q)=>Q!==X);D(F),M(!1),f(`${V9(X)} no longer contains the correct repository. Select another path.`)},[H,I,A,L]),U=[...I.map((X)=>({label:I6.default.createElement(V,null,"Use ",I6.default.createElement(V,{bold:!0},V9(X))),value:X})),{label:"Cancel",value:"cancel"}];return I6.default.createElement(BL,{title:"Teleport to Repo",onCancel:L,color:"background",borderDimColor:!0},I.length>0?I6.default.createElement(I6.default.Fragment,null,I6.default.createElement(x,{flexDirection:"column",gap:1},B&&I6.default.createElement(V,{color:"error"},B),I6.default.createElement(V,null,"Open Claude Code in ",I6.default.createElement(V,{bold:!0},H),":")),E?I6.default.createElement(x,null,I6.default.createElement(vD,null),I6.default.createElement(V,null," Validating repository\u2026")):I6.default.createElement(QA,{options:U,onChange:(X)=>void G(X)})):I6.default.createElement(x,{flexDirection:"column",gap:1},B&&I6.default.createElement(V,{color:"error"},B),I6.default.createElement(V,{dimColor:!0},"Run claude --teleport from a checkout of ",H)))}var I6,M_H;var VMB=K(()=>{xH();bB();l8();JM();rD();DmA();I6=b(s(),1),M_H=b(s(),1)});function ES1({currentStep:H,sessionId:$}){let[A,L]=DT(100),I=Math.floor(L/100)%BmA.length,D=PMB.findIndex((B)=>B.key===H);return uG.createElement(x,{ref:A,flexDirection:"column",paddingX:1,paddingY:1},uG.createElement(x,{marginBottom:1},uG.createElement(V,{bold:!0,color:"claude"},BmA[I]," Teleporting session\u2026")),$&&uG.createElement(x,{marginBottom:1},uG.createElement(V,{dimColor:!0},$)),uG.createElement(x,{flexDirection:"column",marginLeft:2},PMB.map((B,f)=>{let E=fD,U,X;if(E)U=pH.tick,X="green";else if(M)U=BmA[I],X="claude";else U=pH.circle,X=void 0;return uG.createElement(x,{key:B.key,flexDirection:"row"},uG.createElement(x,{width:2},uG.createElement(V,{color:X,dimColor:G},U)),uG.createElement(V,{dimColor:G,bold:M},B.label))})))}async function YMB(H){let $=()=>{};function A(){let[I,D]=_MB.useState("validating");return $=D,uG.createElement(ES1,{currentStep:I,sessionId:H})}let{unmount:L}=await A8(uG.createElement(i8,null,uG.createElement(A,null)),ZG(!1));try{let I=await ut(H,$);$("checking_out");let{branchName:D,branchError:B}=await f3H(I.branch);return{messages:B3H(I.log,B),branchName:D}}finally{L()}}var uG,_MB,BmA,PMB;var CMB=K(()=>{xH();jI();pL();ip();sv();uG=b(s(),1),_MB=b(s(),1),BmA=["\u25D0","\u25D3","\u25D1","\u25D2"],PMB=[{key:"validating",label:"Validating session"},{key:"fetching_logs",label:"Fetching session logs"},{key:"fetching_branch",label:"Getting branch info"},{key:"checking_out",label:"Checking out branch"}]});function ZMB({onSelect:H,onCancel:$,isEmbedded:A=!1}){let{rows:L}=QL(),[I,D]=J0.useState([]),[B,f]=J0.useState(null),[E,M]=J0.useState(!0),[G,U]=J0.useState(null),[X,J]=J0.useState(!1),[F,Q]=J0.useState(!1),[W,P]=J0.useState(1),C=C0("confirm:no","Confirmation","Esc"),Y=J0.useCallback(async()=>{try{M(!0),U(null);let d=await _S();f(d),N(`Current repository: ${d||"not detected"}`);let k=await ZFD(),n=k;if(d)n=k.filter((HH)=>{if(!HH.repo)return!1;return`${HH.repo.owner.login}/${HH.repo.name}`===d}),N(`Filtered ${n.length} sessions for repo ${d} from ${k.length} total`);let GH=[...n].sort((HH,BH)=>{let WH=new Date(HH.updated_at);return new Date(BH.updated_at).getTime()-WH.getTime()});D(GH)}catch(d){let k=d instanceof Error?d.message:String(d);N(`Error loading code sessions: ${k}`),U(GS1(k))}finally{M(!1),J(!1)}},[]),Z=()=>{J(!0),Y()};BA("confirm:no",$,{context:"Confirmation"}),WL((d,k)=>{if(k.ctrl&&d==="c"){$();return}if(k.ctrl&&d==="r"&&G){Z();return}if(G!==null&&k.return){$();return}});let q=J0.useCallback(()=>{Q(!0),Y()},[Q,Y]);if(!F)return J0.default.createElement(oC$,{onComplete:q});if(E)return J0.default.createElement(x,{flexDirection:"column",padding:1},J0.default.createElement(x,{flexDirection:"row"},J0.default.createElement(vD,null),J0.default.createElement(V,{bold:!0},"Loading Claude Code sessions\u2026")),J0.default.createElement(V,{dimColor:!0},X?"Retrying\u2026":"Fetching your Claude Code sessions\u2026"));if(G)return J0.default.createElement(x,{flexDirection:"column",padding:1},J0.default.createElement(V,{bold:!0,color:"error"},"Error loading Claude Code sessions"),US1(G),J0.default.createElement(V,{dimColor:!0},"Press ",J0.default.createElement(V,{bold:!0},"Ctrl+R")," to retry \xB7 Press"," ",J0.default.createElement(V,{bold:!0},C)," to cancel"));if(I.length===0)return J0.default.createElement(x,{flexDirection:"column",padding:1},J0.default.createElement(V,{bold:!0},"No Claude Code sessions found",B&&J0.default.createElement(V,null," for ",B)),J0.default.createElement(x,{marginTop:1},J0.default.createElement(V,{dimColor:!0},"Press ",J0.default.createElement(V,{bold:!0},C)," to cancel")));let O=I.map((d)=>({...d,timeString:P9$(new Date(d.updated_at))})),j=Math.max(wMB.length,...O.map((d)=>d.timeString.length)),u=O.map(({timeString:d,title:k,id:n})=>{return{label:`${d.padEnd(j," ")} ${k}`,value:n}}),y=7,g=Math.max(1,A?Math.min(I.length,5,L-6-y):Math.min(I.length,L-1-y)),h=g+y,p=I.length>g;return J0.default.createElement(x,{flexDirection:"column",padding:1,height:h},J0.default.createElement(V,{bold:!0},"Select a session to resume",p&&J0.default.createElement(V,{dimColor:!0}," ","(",W," of ",I.length,")"),B&&J0.default.createElement(V,{dimColor:!0}," (",B,")"),":"),J0.default.createElement(x,{flexDirection:"column",marginTop:1,flexGrow:1},J0.default.createElement(x,{marginLeft:2},J0.default.createElement(V,{bold:!0},wMB.padEnd(j," "),MS1,"Session Title")),J0.default.createElement(QA,{visibleOptionCount:g,options:u,onChange:(d)=>{let k=I.find((n)=>n.id===d);if(k)H(k)},onFocus:(d)=>{let k=u.findIndex((n)=>n.value===d);if(k>=0)P(k+1)}})),J0.default.createElement(x,{flexDirection:"row"},J0.default.createElement(V,{dimColor:!0},J0.default.createElement(rA,null,J0.default.createElement(s$,{shortcut:"\u2191/\u2193",action:"select"}),J0.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),J0.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}function GS1(H){let $=H.toLowerCase();if($.includes("fetch")||$.includes("network")||$.includes("timeout"))return"network";if($.includes("auth")||$.includes("token")||$.includes("permission")||$.includes("oauth")||$.includes("not authenticated")||$.includes("/login")||$.includes("console account")||$.includes("403"))return"auth";if($.includes("api")||$.includes("rate limit")||$.includes("500")||$.includes("529"))return"api";return"other"}function US1(H){switch(H){case"network":return J0.default.createElement(x,{marginY:1,flexDirection:"column"},J0.default.createElement(V,{dimColor:!0},"Check your internet connection"));case"auth":return J0.default.createElement(x,{marginY:1,flexDirection:"column"},J0.default.createElement(V,{dimColor:!0},"Teleport requires a Claude account"),J0.default.createElement(V,{dimColor:!0},"Run ",J0.default.createElement(V,{bold:!0},"/login"),' and select "Claude account with subscription"'));case"api":return J0.default.createElement(x,{marginY:1,flexDirection:"column"},J0.default.createElement(V,{dimColor:!0},"Sorry, Claude encountered an error"));case"other":return J0.default.createElement(x,{marginY:1,flexDirection:"row"},J0.default.createElement(V,{dimColor:!0},"Sorry, Claude Code encountered an error"))}}var J0,wMB="Updated",MS1=" ";var qMB=K(()=>{xH();$I();l8();JM();OB();E$();ONA();Q9();I9H();YS();lB();j0();FG();eB();J0=b(s(),1)});function TMB(H){let[$,A]=h8H.useState(!1),[L,I]=h8H.useState(null),[D,B]=h8H.useState(null),f=h8H.useCallback(async(M)=>{A(!0),I(null),B(M),c("tengu_teleport_resume_session",{source:H,session_id:M.id});try{let G=await ut(M.id);return dYH({sessionId:M.id}),A(!1),G}catch(G){let U={message:G instanceof AK?G.message:G instanceof Error?G.message:String(G),formattedMessage:G instanceof AK?G.formattedMessage:void 0,isOperationError:G instanceof AK};return I(U),A(!1),null}},[H]),E=h8H.useCallback(()=>{I(null)},[]);return{resumeSession:f,isResuming:$,error:L,selectedSession:D,clearError:E}}var h8H;var zMB=K(()=>{ip();lG();z$();g$();h8H=b(s(),1)});function XS1({onComplete:H,onCancel:$,onError:A,isEmbedded:L=!1,source:I}){let{resumeSession:D,isResuming:B,error:f,selectedSession:E}=TMB(I);NMB.useEffect(()=>{c("tengu_teleport_started",{source:I})},[I]);let M=async(U)=>{let X=await D(U);if(X)H(X);else if(f){if(A)A(f.message,f.formattedMessage)}},G=()=>{c("tengu_teleport_cancelled",{}),$()};if(B&&E)return s3.default.createElement(x,{flexDirection:"column",padding:1},s3.default.createElement(x,{flexDirection:"row"},s3.default.createElement(vD,null),s3.default.createElement(V,{bold:!0},"Resuming session\u2026")),s3.default.createElement(V,{dimColor:!0},'Loading "',E.title,'"\u2026'));if(f&&!A)return s3.default.createElement(x,{flexDirection:"column",padding:1},s3.default.createElement(V,{bold:!0,color:"error"},"Failed to resume session"),s3.default.createElement(V,{dimColor:!0},f.message),s3.default.createElement(x,{marginTop:1},s3.default.createElement(V,{dimColor:!0},"Press ",s3.default.createElement(V,{bold:!0},"Esc")," to cancel")));return s3.default.createElement(ZMB,{onSelect:M,onCancel:G,isEmbedded:L})}async function OMB(){return N("selectAndResumeTeleportTask: Starting teleport flow..."),new Promise(async(H)=>{let{unmount:$}=await A8(s3.default.createElement(i8,null,s3.default.createElement(hE,null,s3.default.createElement(XS1,{onComplete:(A)=>{$(),H(A)},onCancel:()=>{$(),H(null)},onError:(A,L)=>{process.stderr.write(L?L+` claude mcp add --transport http sentry https://mcp.sentry.dev/mcp claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..." claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server claude mcp add my-server -- my-command --some-flag arg1`).option("-s, --scope ","Configuration scope (local, user, or project)","local").option("-t, --transport ","Transport type (stdio, sse, http). Defaults to stdio if not specified.").option("-e, --env ","Set environment variables (e.g. -e KEY=value)").option("-H, --header ",'Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")').option("--client-id ","OAuth client ID for HTTP/SSE servers").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").option("--callback-port ","Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)").helpOption("-h, --help","Display help for command").action(async($,A,L,I)=>{let D=A,B=L;if(!$)console.error("Error: Server name is required."),console.error("Usage: claude mcp add [args...]"),process.exit(1);else if(!D)console.error("Error: Command is required when server name is provided."),console.error("Usage: claude mcp add [args...]"),process.exit(1);try{let f=V3H(I.scope),E=bZD(I.transport),M=I.transport!==void 0,G=D.startsWith("http://")||D.startsWith("https://")||D.startsWith("localhost")||D.endsWith("/sse")||D.endsWith("/mcp");if(c("tengu_mcp_add",{type:E,scope:f,source:"command",transport:E,transportExplicit:M,looksLikeUrl:G}),E==="sse"){if(!D)console.error("Error: URL is required for SSE transport."),process.exit(1);let U=I.header?sNA(I.header):void 0,X=I.callbackPort?parseInt(I.callbackPort,10):void 0,J=I.clientId?{clientId:I.clientId,...X?{callbackPort:X}:{}}:void 0,F=I.clientSecret&&I.clientId?await RuH():void 0,Q={type:"sse",url:D,headers:U,oauth:J};if(mt($,Q,f),F)yuH($,Q,F);if(process.stdout.write(`Added SSE MCP server ${$} with URL: ${D} to ${f} config `),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${$} ${D} `),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${$} ${D} `),process.exit(0)}catch(f){console.error(f.message),process.exit(1)}})}var jMB=K(()=>{T3();kF();NA();Z$();z$();n9H()});function fmA(H,$=process.argv){for(let A=0;A<$.length;A++){let L=$[A];if(L?.startsWith(`${H}=`))return L.slice(H.length+1);if(L===H&&A+1<$.length)return $[A+1]}return}class MmA{server=null;secret;port=null;mcpClients;availableTools;resources;constructor(H,$){this.mcpClients=H,this.availableTools=$||[],this.resources={},this.secret=oO$.randomBytes(32).toString("hex")}async start(){if(this.server)throw Error("MCP CLI endpoint already started");return new Promise((H,$)=>{this.server=RMB.createServer((A,L)=>{this.handleRequest(A,L)}),this.server.on("error",(A)=>{r(A),$(A)}),this.server.listen(0,"127.0.0.1",()=>{let A=this.server.address();if(!A||typeof A==="string"){$(Error("Failed to get server address"));return}this.port=A.port;let L=`http://127.0.0.1:${this.port}`;N(`[MCP CLI Endpoint] Started on ${L}`),H({port:this.port,url:L})})})}getSecret(){return this.secret}async handleRequest(H,$){if(H.setTimeout(30000),H.on("timeout",()=>{N("[MCP CLI Endpoint] Request timeout"),$.writeHead(408,{"Content-Type":"application/json"}),$.end(yH({error:"Request Timeout"}))}),H.method!=="POST"||H.url!=="/mcp"){$.writeHead(404,{"Content-Type":"application/json"}),$.end(yH({error:"Not Found"}));return}let A=H.headers.authorization;if(!A?.startsWith("Bearer ")){$.writeHead(403,{"Content-Type":"application/json"}),$.end(yH({error:"Forbidden"}));return}let L=A.slice(7);if(!this.validateSecret(L)){$.writeHead(403,{"Content-Type":"application/json"}),$.end(yH({error:"Forbidden"}));return}let I=10485760,D=0,B="";H.on("data",(f)=>{if(D+=f.length,D>I){N(`[MCP CLI Endpoint] Request too large: ${D} bytes`),$.writeHead(413,{"Content-Type":"application/json"}),$.end(yH({error:"Payload Too Large"})),H.destroy();return}B+=f.toString()}),H.on("end",async()=>{try{let f=DA(B),E=ZtD.parse(f),M=await this.handleCommand(E);$.writeHead(200,{"Content-Type":"application/json"}),$.end(yH(M))}catch(f){let E=500;if(f instanceof SyntaxError)E=400;else if(f&&typeof f==="object"&&"name"in f){if(f.name==="ZodError")E=400}$.writeHead(E,{"Content-Type":"application/json"}),$.end(yH({error:f instanceof Error?f.message:"Unknown error",type:f instanceof Error?f.constructor.name:"Error"})),r(f instanceof Error?f:Error(String(f)))}}),H.on("error",(f)=>{if(r(f),!$.headersSent)$.writeHead(500,{"Content-Type":"application/json"}),$.end(yH({error:"Internal Server Error"}))})}validateSecret(H){try{let $=Buffer.from(H),A=Buffer.from(this.secret);if($.length!==A.length)return!1;return oO$.timingSafeEqual($,A)}catch{return!1}}async handleCommand(H){let $=Date.now(),A=H.command==="call"?`mcp__${H.params.server}__${H.params.tool}`:void 0,L,I;if(H.command==="call"){let D=jPH(this.mcpClients,H.params.server,this.getNormalizedNames());if(D?.type==="connected")L=vX(D.config),I=D.config.type??"stdio"}try{let{data:D,metadata:B}=await this.executeCommand(H),f=Date.now()-$;if(H.command==="call")c("tengu_tool_use_success",{toolName:nB(A??""),isMcp:!0,durationMs:f,...I?{mcpServerType:I}:{},...L?{mcpServerBaseUrl:L}:{}});return c("tengu_mcp_cli_command_executed",{command:H.command,success:!0,duration_ms:f,...B}),D}catch(D){let B=D instanceof Error?D:Error(String(D)),f=Date.now()-$,E=String(D).slice(0,2000);if(H.command==="call")c("tengu_tool_use_error",{toolName:nB(A??""),isMcp:!0,error:E,durationMs:f,...I?{mcpServerType:I}:{},...L?{mcpServerBaseUrl:L}:{}});throw c("tengu_mcp_cli_command_executed",{command:H.command,success:!1,error_type:H.command==="call"?"tool_execution_failed":B.constructor,duration_ms:Date.now()-$}),D}}async executeCommand(H){switch(H.command){case"servers":{let $=ez$(this.mcpClients);return{data:$,metadata:{server_count:$.length}}}case"tools":{let $=HN$(this.availableTools,H.params);return{data:$,metadata:{tool_count:$.length,filtered:!!H.params?.server}}}case"info":{let $=await $N$(this.availableTools,H.params);if(!$){let A=jPH(this.mcpClients,H.params.server,this.getNormalizedNames()),L=G8H(H.params.server,A?.type);if(L)throw L;throw new EmA(`Tool '${H.params.toolName}' not found on server '${H.params.server}'`)}return{data:$,metadata:{tool_found:!0}}}case"grep":{let $=AN$(this.availableTools,H.params);return{data:$,metadata:{match_count:$.length}}}case"resources":{let $=LN$(this.resources,H.params,this.getNormalizedNames());return{data:$,metadata:{resource_count:$.length,filtered:!!H.params?.server}}}case"call":{let{server:$,tool:A}=H.params;return{data:await this.callTool(H.params),metadata:{tool_name:`mcp__${$}__${A}`}}}case"read":return{data:await this.readResource(H.params),metadata:{server:H.params.server}};default:{let $=H;throw Error("Unknown command")}}}getConnectedClient(H){let $=jPH(this.mcpClients,H,this.getNormalizedNames()),A=G8H(H,$?.type);if(A)throw A;return $}async callTool({server:H,tool:$,args:A,timeoutMs:L}){let I=this.getConnectedClient(H),D=`mcp__${H}__${$}`,B=this.availableTools.find((M)=>M.name===D);if(this.availableTools.length>0&&!B)throw new EmA(`Tool '${$}' not found on server '${H}'`);let f=B?.originalMcpToolName||$;return await I.client.request({method:"tools/call",params:{name:f,arguments:A}},fP,L?{signal:AbortSignal.timeout(L)}:void 0)}async readResource({server:H,uri:$,timeoutMs:A}){return await this.getConnectedClient(H).client.readResource({uri:$},A?{signal:AbortSignal.timeout(A)}:void 0)}async stop(){if(!this.server)return;return new Promise((H,$)=>{this.server.close((A)=>{if(A)$(A);else N("[MCP CLI Endpoint] Stopped"),this.server=null,this.port=null,H()})})}updateClients(H){this.mcpClients=H}updateTools(H){this.availableTools=H}updateResources(H){this.resources=H}getNormalizedNames(){let H={};for(let $ of this.mcpClients)H[E1($.name)]=$.name;return H}}var RMB,oO$,EmA;var yMB=K(()=>{CK();QkA();WkA();VkA();PkA();_kA();kF();E$();_$();z$();R4();YkA();Z$();RMB=require("http"),oO$=require("crypto");EmA=class EmA extends Error{constructor(H){super(H);this.name="ToolNotFoundError"}}});function vMB(H,$){let[A,L]=tO$.useState(!1);return tO$.useEffect(()=>{L(!1);let I=setTimeout(()=>{L(!0)},H);return()=>clearTimeout(I)},[H,$]),A}var tO$;var hMB=K(()=>{tO$=b(s(),1)});async function JS1(){try{let H=["https://api.anthropic.com/api/hello","https://platform.claude.com/v1/oauth/hello"],$=async(I)=>{try{let D=await nA.get(I,{headers:{"User-Agent":Gn()}});if(D.status!==200)return{success:!1,error:`Failed to connect to ${new URL(I).hostname}: Status ${D.status}`};return{success:!0}}catch(D){return{success:!1,error:`Failed to connect to ${new URL(I).hostname}: ${D instanceof Error?D.code||D.message:String(D)}`}}},L=(await Promise.all(H.map($))).find((I)=>!I.success);if(L)c("tengu_preflight_check_failed",{isConnectivityError:!1,hasErrorMessage:!!L.error});return L||{success:!0}}catch(H){return r(H),c("tengu_preflight_check_failed",{isConnectivityError:!0}),{success:!1,error:`Connectivity check error: ${H instanceof Error?H.code||H.message:String(H)}`}}}function bMB({onSuccess:H}){let[$,A]=G_H.useState(null),[L,I]=G_H.useState(!0),D=vMB(1000)&&L;return G_H.useEffect(()=>{async function B(){let f=await JS1();A(f),I(!1)}B()},[]),G_H.useEffect(()=>{if($?.success)H();else if($&&!$.success){let B=setTimeout(()=>process.exit(1),100);return()=>clearTimeout(B)}},[$,H]),nz.default.createElement(x,{flexDirection:"column",gap:1,paddingLeft:1},L&&D?nz.default.createElement(x,{paddingLeft:1},nz.default.createElement(vD,null),nz.default.createElement(V,null,"Checking connectivity...")):!$?.success&&!L&&nz.default.createElement(x,{flexDirection:"column",gap:1},nz.default.createElement(V,{color:"error"},"Unable to connect to Anthropic services"),nz.default.createElement(V,{color:"error"},$?.error),nz.default.createElement(x,{flexDirection:"column",gap:1},nz.default.createElement(V,null,"Please check your internet connection and network settings."),nz.default.createElement(V,null,"Note: Claude Code might not be available in your country. Check supported countries at"," ",nz.default.createElement(V,{color:"suggestion"},"https://anthropic.com/supported-countries")))))}var nz,G_H;var kMB=K(()=>{xH();_Q();_$();JM();hMB();z$();w1();nz=b(s(),1),G_H=b(s(),1)});function eO$(){let[H]=_I(),$="Welcome to Claude Code";if(OA.terminal==="Apple_Terminal")return uA.default.createElement(FS1,{theme:H,welcomeMessage:"Welcome to Claude Code"});if(["light","light-daltonized","light-ansi"].includes(H))return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},"Welcome to Claude Code"," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," "),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588 ")),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588\u2592\u2592\u2588\u2588 ")),uA.default.createElement(V,null," \u2592\u2592 \u2588\u2588 \u2592"),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," \u2592\u2592\u2591\u2591\u2592\u2592 \u2592 \u2592\u2592"),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body",backgroundColor:"clawd_background"},"\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588")," \u2592\u2592 \u2592\u2592 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," \u2591 \u2592 "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{color:"clawd_body"},"\u2588 \u2588 \u2588 \u2588"),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2591\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2592\u2026\u2026\u2026\u2026")));return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},"Welcome to Claude Code"," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2593\u2591 \u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null,uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," \u2588\u2588\u2593\u2591\u2591 \u2593 ")),uA.default.createElement(V,null," \u2591\u2593\u2593\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,{dimColor:!0}," * \u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," ",uA.default.createElement(V,{dimColor:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"},"\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588"),uA.default.createElement(V,null," "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"}," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")," * "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{color:"clawd_body"},"\u2588 \u2588 \u2588 \u2588"),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026")))}function FS1({theme:H,welcomeMessage:$}){if(["light","light-daltonized","light-ansi"].includes(H))return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},$," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," "),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588 ")),uA.default.createElement(V,null,uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591"),uA.default.createElement(V,null," \u2588\u2588\u2592\u2592\u2588\u2588 ")),uA.default.createElement(V,null," \u2592\u2592 \u2588\u2588 \u2592"),uA.default.createElement(V,null," \u2592\u2592\u2591\u2591\u2592\u2592 \u2592 \u2592\u2592"),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"},"\u2597"),uA.default.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),uA.default.createElement(V,{color:"clawd_body"},"\u2596")," \u2592\u2592 \u2592\u2592 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(9))," \u2591 \u2592 "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2591\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2592\u2026\u2026\u2026\u2026")));return uA.default.createElement(x,{width:sO$},uA.default.createElement(V,null,uA.default.createElement(V,null,uA.default.createElement(V,{color:"claude"},$," "),uA.default.createElement(V,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION," ")),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026"),uA.default.createElement(V,null," "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,null," * \u2588\u2588\u2588\u2593\u2591 \u2591\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null," \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2588\u2588\u2588\u2593\u2591 "),uA.default.createElement(V,null,uA.default.createElement(V,null," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," \u2588\u2588\u2593\u2591\u2591 \u2593 ")),uA.default.createElement(V,null," \u2591\u2593\u2593\u2588\u2588\u2588\u2593\u2593\u2591 "),uA.default.createElement(V,{dimColor:!0}," * \u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,{dimColor:!0}," \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 "),uA.default.createElement(V,null," ",uA.default.createElement(V,{dimColor:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{color:"clawd_body"},"\u2597"),uA.default.createElement(V,{color:"clawd_background",backgroundColor:"clawd_body"}," ","\u2597"," ","\u2596"," "),uA.default.createElement(V,{color:"clawd_body"},"\u2596"),uA.default.createElement(V,null," "),uA.default.createElement(V,{bold:!0},"*"),uA.default.createElement(V,null," ")),uA.default.createElement(V,null," ",uA.default.createElement(V,{backgroundColor:"clawd_body"}," ".repeat(9))," * "),uA.default.createElement(V,null,"\u2026\u2026\u2026\u2026\u2026\u2026\u2026",uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),uA.default.createElement(V,null," "),uA.default.createElement(V,{backgroundColor:"clawd_body"}," "),"\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026")))}var uA,sO$=58;var GmA=K(()=>{xH();Z1();uA=b(s(),1)});var uMB={};XA(uMB,{Onboarding:()=>KS1});function KS1({onDone:H}){let[$,A]=U_H.useState(0),L=p_(),[I,D]=_I();U_H.useEffect(()=>{c("tengu_began_setup",{oauthEnabled:L})},[L]);function B(){if(${if(!process.env.ANTHROPIC_API_KEY)return"";let P=Z2(process.env.ANTHROPIC_API_KEY);if(lz$(P)==="new")return P},[]),J=[];if(L)J.push({id:"preflight",component:U});if(J.push({id:"theme",component:M}),L)J.push({id:"oauth",component:M8.default.createElement(s0H,{onDone:B})});if(X)J.push({id:"api-key",component:M8.default.createElement(dO$,{customApiKeyTruncated:X,onDone:B})});if(J.push({id:"security",component:G}),AFH())J.push({id:"terminal-setup",component:M8.default.createElement(x,{flexDirection:"column",gap:1,paddingLeft:1},M8.default.createElement(V,{bold:!0},"Use Claude Code's terminal setup?"),M8.default.createElement(x,{flexDirection:"column",width:70,gap:1},M8.default.createElement(V,null,"For the optimal coding experience, enable the recommended settings",M8.default.createElement(_K,null),"for your terminal:"," ",OA.terminal==="Apple_Terminal"?"Option+Enter for newlines and visual bell":"Shift+Enter for newlines"),M8.default.createElement(QA,{options:[{label:"Yes, use recommended settings",value:"install"},{label:"No, maybe later with /terminal-setup",value:"no"}],onChange:(P)=>{if(P==="install")A4$(I).catch(()=>{}).finally(B);else B()},onCancel:()=>B()}),M8.default.createElement(V,{dimColor:!0},E.pending?M8.default.createElement(M8.default.Fragment,null,"Press ",E.keyName," again to exit"):M8.default.createElement(M8.default.Fragment,null,"Enter to confirm \xB7 Esc to skip"))))});let F=J[$],Q=M8.useCallback(()=>{if($===J.length-1)H();else B()},[$,J.length,L,H]),W=M8.useCallback(()=>{B()},[$,J.length,L,H]);return bI({"confirm:yes":Q},{context:"Confirmation",isActive:F?.id==="security"}),bI({"confirm:no":W},{context:"Confirmation",isActive:F?.id==="terminal-setup"}),M8.default.createElement(x,{flexDirection:"column"},M8.default.createElement(eO$,null),M8.default.createElement(x,{flexDirection:"column",marginTop:1},F?.component,E.pending&&M8.default.createElement(x,{padding:1},M8.default.createElement(V,{dimColor:!0},"Press ",E.keyName," again to exit"))))}var M8,U_H;var gMB=K(()=>{xH();$I();vA();ZqH();B5A();UM();SbH();ggA();EI();xH();IRA();kMB();Mq$();z$();Z1();N1();BDH();GmA();M8=b(s(),1),U_H=b(s(),1)});function mMB(H){if(H===null||H.disableAllHooks)return!1;if(H.statusLine)return!0;if(H.fileSuggestion)return!0;if(!H.hooks)return!1;for(let $ of Object.values(H.hooks))if($.length>0)return!0;return!1}function nMB(){let H=[],$=ZI("projectSettings");if(mMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(mMB(A))H.push(".claude/settings.local.json");return H}function pMB(H){return H.some(($)=>$.ruleBehavior==="allow"&&($.ruleValue.toolName===WD||$.ruleValue.toolName.startsWith(WD+"(")))}function rMB(){let H=[],$=BTH("projectSettings");if(pMB($))H.push(".claude/settings.json");let A=BTH("localSettings");if(pMB(A))H.push(".claude/settings.local.json");return H}function dMB(H){return!!H?.otelHeadersHelper}function aMB(){let H=[],$=ZI("projectSettings");if(dMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(dMB(A))H.push(".claude/settings.local.json");return H}function cMB(H){return!!H?.apiKeyHelper}function oMB(){let H=[],$=ZI("projectSettings");if(cMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(cMB(A))H.push(".claude/settings.local.json");return H}function lMB(H){return!!(H?.awsAuthRefresh||H?.awsCredentialExport)}function tMB(){let H=[],$=ZI("projectSettings");if(lMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(lMB(A))H.push(".claude/settings.local.json");return H}function iMB(H){if(!H?.env)return!1;return Object.keys(H.env).some(($)=>!D0H.has($.toUpperCase()))}function sMB(){let H=[],$=ZI("projectSettings");if(iMB($))H.push(".claude/settings.json");let A=ZI("localSettings");if(iMB(A))H.push(".claude/settings.local.json");return H}var eMB=K(()=>{_q();mL();f7$()});var HGB={};XA(HGB,{TrustDialog:()=>QS1});function QS1({onDone:H,commands:$}){let{servers:A}=OJ("project"),L=Object.keys(A).length>0,D=nMB().length>0,B=rMB(),E=oMB().length>0,G=tMB().length>0,X=aMB().length>0,F=sMB().length>0,Q=$?.some((j)=>j.type==="prompt"&&j.loadedFrom==="commands_DEPRECATED"&&(j.source==="projectSettings"||j.source==="localSettings")&&j.allowedTools?.some((u)=>u===WD||u.startsWith(WD+"(")))??!1,W=$?.some((j)=>j.type==="prompt"&&(j.loadedFrom==="skills"||j.loadedFrom==="plugin")&&(j.source==="projectSettings"||j.source==="localSettings"||j.source==="plugin")&&j.allowedTools?.some((u)=>u===WD||u.startsWith(WD+"(")))??!1,P=B.length>0||Q||W,C=XG(D||P||E||G||X||F),Z=[{name:"MCP servers",shouldShowWarning:()=>L,onChange:()=>{let j={enabledMcpjsonServers:Object.keys(A),enableAllProjectMcpServers:!0};II("localSettings",j)}},{name:"hooks",shouldShowWarning:()=>D},{name:"bash commands",shouldShowWarning:()=>P},{name:"OpenTelemetry headers helper commands",shouldShowWarning:()=>X},{name:"dangerous environment variables",shouldShowWarning:()=>F}].filter((j)=>j.shouldShowWarning());A_.default.useEffect(()=>{let j=UmA.homedir()===C$();c("tengu_trust_dialog_shown",{isHomeDir:j,hasMcpServers:L,hasHooks:D,hasBashExecution:P,hasApiKeyHelper:E,hasAwsCommands:G,hasOtelHeadersHelper:X,hasDangerousEnvVars:F})},[L,D,P,E,G,X,F]);function q(j){if(j==="exit"){L9(1);return}let u=UmA.homedir()===C$();if(c("tengu_trust_dialog_accept",{isHomeDir:u,hasMcpServers:L,hasHooks:D,hasBashExecution:P,hasApiKeyHelper:E,hasAwsCommands:G,hasOtelHeadersHelper:X,hasDangerousEnvVars:F,enableMcp:!0}),u)Fj$(!0);else MM((y)=>({...y,hasTrustDialogAccepted:!0}));Z.forEach((y)=>{if(y.onChange!==void 0)y.onChange()}),H()}let O=zB();if(BA("confirm:no",()=>{L9(0)},{context:"Confirmation"}),C)return setTimeout(H),null;return A_.default.createElement(wG,{color:"warning",titleColor:"warning",title:"Accessing workspace:"},A_.default.createElement(x,{flexDirection:"column",gap:1,paddingTop:1},A_.default.createElement(V,{bold:!0},zH().cwd()),A_.default.createElement(V,null,"Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what","'","s in this folder first."),A_.default.createElement(V,null,"Claude Code","'","ll be able to read, edit, and execute files here."),A_.default.createElement(V,{dimColor:!0},A_.default.createElement(dI,{url:"https://code.claude.com/docs/en/security"},"Security guide")),A_.default.createElement(QA,{options:[{label:"Yes, I trust this folder",value:"enable_all"},{label:"No, exit",value:"exit"}],onChange:(j)=>q(j),onCancel:()=>q("exit")}),A_.default.createElement(V,{dimColor:!0},O.pending?A_.default.createElement(A_.default.Fragment,null,"Press ",O.keyName," again to exit"):A_.default.createElement(A_.default.Fragment,null,"Enter to confirm \xB7 Esc to cancel"))))}var A_,UmA;var $GB=K(()=>{xH();$I();l8();vA();T3();mL();z$();UM();PI();g$();xH();DL();UU();eMB();Xw();A_=b(s(),1),UmA=require("os")});function WS1(){return NL("tengu_session_memory",!1)}function VS1(){return rm("tengu_sm_config",{})}function PS1(H,$){let A=0,L=$===null||$===void 0;for(let I of H){if(!L){if(I.uuid===$)L=!0;continue}if(I.type==="assistant"){let B=I.message.content;if(Array.isArray(B))A+=B.filter((f)=>f.type==="tool_use").length}}return A}function _S1(H){let $=UT(H);if(!UzD()){if(!JzD($))return!1;XzD()}let A=FzD($),I=PS1(H,AGB)>=KzD(),D=ZpH(H);if(A&&I||A&&!D){let f=H[H.length-1];if(f?.uuid)AGB=f.uuid;return!0}return!1}async function YS1(H){let $=zH(),A=mz$();if(!$.existsSync(A))$.mkdirSync(A,{mode:448});let L=T3H();if(!$.existsSync(L)){let f=await mOA();iL(L,f,{encoding:"utf-8",flush:!1,mode:384})}let I=await k8.call({file_path:L},H),D="",B=I.data;if(B.type==="text")D=B.file.content;return c("tengu_session_memory_file_read",{content_length:D.length}),{memoryPath:L,currentMemory:D}}function LGB(){if(!ep())return;AZ$(wS1)}function ZS1(H){return async($,A)=>{if($.name===TB&&typeof A==="object"&&A!==null&&"file_path"in A){if(A.file_path===H)return{behavior:"allow",updatedInput:A}}return{behavior:"deny",message:`only ${TB} on ${H} is allowed`,decisionReason:{type:"other",reason:`only ${TB} on ${H} is allowed`}}}}function qS1(H){if(!ZpH(H)){let $=H[H.length-1];if($?.uuid)o9H($.uuid)}}var AGB,CS1,wS1;var IGB=K(()=>{BM();tD();DL();Z$();bw();pOA();qS();GgH();z$();jp();_L();q3H();$3();Ow();bT();SD();CS1=o$(()=>{let H=VS1(),$={minimumMessageTokensToInit:H.minimumMessageTokensToInit&&H.minimumMessageTokensToInit>0?H.minimumMessageTokensToInit:duH.minimumMessageTokensToInit,minimumTokensBetweenUpdate:H.minimumTokensBetweenUpdate&&H.minimumTokensBetweenUpdate>0?H.minimumTokensBetweenUpdate:duH.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:H.toolCallsBetweenUpdates&&H.toolCallsBetweenUpdates>0?H.toolCallsBetweenUpdates:duH.toolCallsBetweenUpdates};EzD($)}),wS1=rR(async function(H){let{messages:$,toolUseContext:A,querySource:L}=H;if(L!=="repl_main_thread")return;if(!WS1())return;if(CS1(),!_S1($))return;DzD();let I=BkH(A),{memoryPath:D,currentMemory:B}=await YS1(I),f=await PzD(B,D);await xw({promptMessages:[R$({content:f})],cacheSafeParams:Ls(H),canUseTool:ZS1(D),querySource:"session_memory",forkLabel:"session_memory",overrides:{readFileState:I.readFileState}});let E=$[$.length-1],M=E?rg(E):void 0,G=MzD();c("tengu_session_memory_extraction",{input_tokens:M?.input_tokens,output_tokens:M?.output_tokens,cache_read_input_tokens:M?.cache_read_input_tokens??void 0,cache_creation_input_tokens:M?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:G.minimumMessageTokensToInit,config_min_tokens_between_update:G.minimumTokensBetweenUpdate,config_tool_calls_between_updates:G.toolCallsBetweenUpdates}),GzD(UT($)),qS1($),BzD()})});function TS1(H){let $=rU(C$()),A=zH(),L=H?new Date(H).getTime():0;try{let I=A.readdirSync($),D=[];for(let B of I){if(!B.isDirectory())continue;let f=DGB.join($,B.name,"session-memory","summary.md");try{let E=A.statSync(f);if(E.mtimeMs>L)D.push({id:B.name,mtime:E.mtimeMs,path:f})}catch{}}return D.sort((B,f)=>f.mtime-B.mtime),D.map((B)=>B.path)}catch{return[]}}function BGB(){return}var DGB,zS1=`# Remember Skill - **Session memories**: \`~/.claude/projects/{sanitized-project-path}/{session-id}/session-memory/summary.md\` `;var fGB=K(()=>{Fj();vA();rB();PI();DL();DGB=require("path")});function EGB(){UW({name:"claude-in-chrome",description:"Automates your Chrome browser to interact with web pages - clicking elements, filling forms, capturing screenshots, reading console logs, and navigating sites. Opens pages in new tabs within your existing Chrome session. Requires site-level permissions before executing (configured in the extension).",whenToUse:"When the user wants to interact with web pages, automate browser tasks, capture screenshots, read console logs, or perform any browser-based actions. Always invoke BEFORE attempting to use any mcp__claude-in-chrome__* tools.",allowedTools:NS1,userInvocable:!0,isEnabled:()=>UPH(),async getPromptForCommand(H){let $=`${KiD} Now that this skill is invoked, you have access to Chrome browser automation tools. You can now use the mcp__claude-in-chrome__* tools to interact with web pages. IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs. `;var MGB=K(()=>{Fj();tT$();H8H();NS1=e1H.map((H)=>`mcp__claude-in-chrome__${H.name}`)});function xS1(){let H=Rk(tZ,{io:"input"});return yH(H,null,2)}function GGB(){return}var SS1=`## Settings File Locations | \`~/.claude/settings.json\` | Global | N/A | Personal preferences for all projects | | \`.claude/settings.json\` | Project | Commit | Team-wide hooks, permissions, plugins | | \`.claude/settings.local.json\` | Project | Gitignore | Personal overrides for this project | "allow": ["Bash(npm:*)", "Edit(.claude)", "Read"], Plugin syntax: \`plugin-name@source\` where source is \`claude-code-marketplace\`, \`claude-plugins-official\`, or \`builtin\`. "command": "jq -r '.tool_input.command' >> ~/.claude/bash-log.txt" "Edit(.claude)", // existing 2. **Read**: \`.claude/settings.json\` (or create if missing) 1. **Check the settings file** - Read ~/.claude/settings.json or .claude/settings.json 6. **Use --debug** - Run \`claude --debug\` to see hook execution logs `)}function FGB(){UW({name:"keybindings-help",description:'Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".',allowedTools:["Read"],userInvocable:!1,isEnabled:m2,async getPromptForCommand(H){let $=vS1(),A=hS1(),L=kS1(),I=[dS1,cS1,lS1,iS1,nS1,rS1,aS1,oS1,`## Reserved Shortcuts `)}var uS1,gS1,mS1,pS1,dS1,cS1,lS1,iS1,nS1,rS1,aS1,oS1;var KGB=K(()=>{Fj();JGB();B8$();f8$();nu();Z$();uS1={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:[{context:"Chat",bindings:{"ctrl+e":"chat:externalEditor"}}]},gS1={context:"Chat",bindings:{"ctrl+s":null}},mS1={context:"Chat",bindings:{"ctrl+g":null,"ctrl+e":"chat:externalEditor"}},pS1={context:"Global",bindings:{"ctrl+k ctrl+t":"app:toggleTodos"}},dS1=["# Keybindings Skill","","Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.","","## CRITICAL: Read Before Write","","**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings \u2014 never replace the entire file.","","- Use **Edit** tool for modifications to existing files","- Use **Write** tool only if the file does not exist yet"].join(` `),oS1=["## Validation with /doctor","",'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',"","### Common Issues and Fixes","",FmA(["Issue","Cause","Fix"],[['`keybindings.json must have a "bindings" array`',"Missing wrapper object",'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',"Typo or invalid context name","Use exact context names from the Available Contexts table"],['`Duplicate key "X" in Y bindings`',"Same key defined twice in one context","Remove the duplicate; JSON uses only the last value"],['`"X" may not work: ...`',"Key conflicts with terminal/OS reserved shortcut","Choose a different key (see Reserved Shortcuts section)"],['`Could not parse keystroke "X"`',"Invalid key syntax","Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',"Action value is not a string or null",'Actions must be strings like `"app:help"` or `null` to unbind']]),"","### Example /doctor Output","","```","Keybinding Configuration Issues","Location: ~/.claude/keybindings.json",' \u2514 [Error] Unknown context "chat"'," \u2192 Valid contexts: Global, Chat, Autocomplete, ...",' \u2514 [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)',"```","","**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work."].join(` - Plans are stored in \`~/.claude/plans/.md\` - args: "Execute the verification plan at ~/.claude/plans/.md" - args: "Execute the verification plan at ~/.claude/plans/.md for files: src/components/Button.tsx" - args: "Execute the verification plan at ~/.claude/plans/.md for files: src/routes/users.ts" - args: "Execute the verification plan at ~/.claude/plans/.md for files: frontend/src/components/Button.tsx" - args: "Execute the verification plan at ~/.claude/plans/.md for files: backend/src/routes/users.ts" **Plan File**: ~/.claude/plans/.md Create the skill directory and file at \`.claude/skills/{{skillName}}/SKILL.md\`. No servers were imported.`);A(),w0()},[E,$,A]),G=b8H.useCallback(()=>{M(0)},[M]);return _Z.default.createElement(_Z.default.Fragment,null,_Z.default.createElement(BL,{title:"Import MCP Servers from Claude Desktop",subtitle:`Found ${L.length} MCP server${L.length!==1?"s":""} in Claude Desktop.`,color:"success",onCancel:G,hideInputGuide:!0},B.length>0&&_Z.default.createElement(V,{color:"warning"},"Note: Some servers already exist with the same name. If selected, they will be imported with a numbered suffix."),_Z.default.createElement(V,null,"Please select the servers you want to import:"),_Z.default.createElement(xVH,{options:L.map((U)=>({label:`${U}${B.includes(U)?" (already exists)":""}`,value:U})),defaultValue:L.filter((U)=>!B.includes(U)),onSubmit:f})),_Z.default.createElement(x,{paddingX:1},_Z.default.createElement(V,{dimColor:!0,italic:!0},_Z.default.createElement(rA,null,_Z.default.createElement(s$,{shortcut:"Space",action:"select"}),_Z.default.createElement(s$,{shortcut:"Enter",action:"confirm"}),_Z.default.createElement(VA,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})))))}var _Z,b8H;var lGB=K(()=>{xH();xq$();T3();UU();bB();lB();j0();eB();_Z=b(s(),1),b8H=b(s(),1)});var nGB={};XA(nGB,{startMCPServer:()=>Fj1});async function Fj1(H,$,A){let I=_m(100);MC(H);let D=new emH({name:"claude/tengu",version:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION},{capabilities:{tools:{}}});D.setRequestHandler(BjH,async()=>{let f=YK(),E=yK(f);return{tools:await Promise.all(E.map(async(M)=>{let G;if(M.outputSchema){let U=t9H(M.outputSchema);if(typeof U==="object"&&U!==null&&"type"in U&&U.type==="object")G=U}return{...M,description:await M.prompt({getToolPermissionContext:async()=>f,tools:E,agents:[]}),inputSchema:t9H(M.inputSchema),outputSchema:G}}))}}),D.setRequestHandler(YDH,async({params:{name:f,arguments:E}})=>{let M=YK(),G=yK(M),U=G.find((X)=>X.name===f);if(!U)throw Error(`Tool ${f} not found`);try{if(!U.isEnabled())throw Error(`Tool ${f} is not enabled`);let X=X1(),J=await U.validateInput?.(E??{},{abortController:nD(),options:{commands:iGB,tools:G,mainLoopModel:X,maxThinkingTokens:0,mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:$,verbose:A,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:async()=>t3H(),setAppState:()=>{},messages:[],setMessages:()=>{},readFileState:I,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}});if(J&&!J.result)throw Error(`Tool ${f} input is invalid: ${J.message}`);let F=await U.call(E??{},{abortController:nD(),options:{commands:iGB,tools:G,mainLoopModel:X1(),maxThinkingTokens:0,mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:$,verbose:A,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:async()=>t3H(),setAppState:()=>{},messages:[],setMessages:()=>{},readFileState:I,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},qF,PT({content:[]}));return{content:[{type:"text",text:typeof F==="string"?F:yH(F.data)}]}}catch(X){return r(X instanceof Error?X:Error(String(X))),{isError:!0,content:[{type:"text",text:(X instanceof Error?DSA(X):[String(X)]).filter(Boolean).join(` `).trim()||"Error"}]}}});async function B(){let f=new bpH;await D.connect(f)}return await B()}var iGB;var rGB=K(()=>{$hA();TkA();CK();Ow$();XJ();nh();aI();_$();Y7();LZ$();DvA();_L();g7();eE();pL();Z$();iGB=[jT$]});var tGB={};XA(tGB,{readClaudeDesktopMcpServers:()=>Kj1,getClaudeDesktopConfigPath:()=>oGB});function oGB(){let H=oA();if(!Mk$.includes(H))throw Error(`Unsupported platform: ${H} - Claude Desktop integration only works on macOS and WSL.`);if(H==="macos")return PmA.join(aGB.homedir(),"Library","Application Support","Claude","claude_desktop_config.json");let $=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,"/"):null;if($){let L=`/mnt/c${$.replace(/^[A-Z]:/,"")}/AppData/Roaming/Claude/claude_desktop_config.json`;if(zH().existsSync(L))return L}try{if(zH().existsSync("/mnt/c/Users")){let L=zH().readdirSync("/mnt/c/Users");for(let I of L){if(I.name==="Public"||I.name==="Default"||I.name==="Default User"||I.name==="All Users")continue;let D=PmA.join("/mnt/c/Users",I.name,"AppData","Roaming","Claude","claude_desktop_config.json");if(zH().existsSync(D))return D}}}catch(A){r(A instanceof Error?A:Error(String(A)))}throw Error("Could not find Claude Desktop config file in Windows. Make sure Claude Desktop is installed on Windows.")}function Kj1(){if(!Mk$.includes(oA()))throw Error("Unsupported platform - Claude Desktop integration only works on macOS and WSL.");try{let H=oGB();if(!zH().existsSync(H))return{};let $=zH().readFileSync(H,{encoding:"utf8"}),A=q1($);if(!A||typeof A!=="object")return{};let L=A.mcpServers;if(!L||typeof L!=="object")return{};let I={};for(let[D,B]of Object.entries(L)){if(!B||typeof B!=="object")continue;let f=Vd$.safeParse(B);if(f.success)I[D]=f.data}return I}catch(H){return r(H instanceof Error?H:Error(String(H))),{}}}var PmA,aGB;var sGB=K(()=>{nM();_$();O$H();Z9();DL();PmA=b(require("path")),aGB=b(require("os"))});var Ze={};XA(Ze,{mcpServeHandler:()=>Qj1,mcpResetChoicesHandler:()=>Cj1,mcpRemoveHandler:()=>Wj1,mcpListHandler:()=>Vj1,mcpGetHandler:()=>Pj1,mcpAddJsonHandler:()=>_j1,mcpAddFromDesktopHandler:()=>Yj1});async function $UB(H,$){try{let A=await Gz(H,$);if(A.type==="connected")return"\u2713 Connected";else if(A.type==="needs-auth")return"! Needs authentication";else return"\u2717 Failed to connect"}catch(A){return"\u2717 Connection error"}}async function Qj1({debug:H,verbose:$}){let A=eGB.cwd();if(c("tengu_mcp_start",{}),!HUB.existsSync(A))console.error(`Error: Directory ${A} does not exist`),process.exit(1);try{let{setup:L}=await Promise.resolve().then(() => (Ax$(),$x$));await L(A,"default",!1,!1,void 0,!1);let{startMCPServer:I}=await Promise.resolve().then(() => (rGB(),nGB));await I(A,H??!1,$??!1)}catch(L){console.error("Error: Failed to start MCP server:",L),process.exit(1)}}async function Wj1(H,$){let A=Mz(H),L=()=>{if(A&&(A.type==="sse"||A.type==="http"))g2$(H,A),yqD(H,A)};try{if($.scope){let M=V3H($.scope);c("tengu_mcp_delete",{name:H,scope:M}),rNA(H,M),L(),process.stdout.write(`Removed MCP server ${H} from ${M} config `),E.forEach((M)=>{process.stderr.write(` claude mcp remove "${H}" -s ${M} `),process.exit(1)}}async function Vj1(){c("tengu_mcp_list",{});let{servers:H}=await ph();if(Object.keys(H).length===0)console.log("No MCP servers configured. Use `claude mcp add` to add a server.");else{console.log(`Checking MCP server health... `);let $=Object.entries(H),A=await VmA($,async([L,I])=>({name:L,server:I,status:await $UB(L,I)}),{concurrency:VOA()});for(let{name:L,server:I,status:D}of A)if(I.type==="sse")console.log(`${L}: ${I.url} (SSE) - ${D}`);else if(I.type==="http")console.log(`${L}: ${I.url} (HTTP) - ${D}`);else if(I.type==="claudeai-proxy")console.log(`${L}: ${I.url} - ${D}`);else if(!I.type||I.type==="stdio"){let B=Array.isArray(I.args)?I.args:[];console.log(`${L}: ${I.command} ${B.join(" ")} - ${D}`)}}await w0(0)}async function Pj1(H){c("tengu_mcp_get",{name:H});let $=Mz(H);if(!$)console.error(`No MCP server found with name: ${H}`),process.exit(1);console.log(`${H}:`),console.log(` Scope: ${OuH($.scope)}`);let A=await $UB(H,$);if(console.log(` Status: ${A}`),$.type==="sse"){if(console.log(" Type: sse"),console.log(` URL: ${$.url}`),$.headers){console.log(" Headers:");for(let[L,I]of Object.entries($.headers))console.log(` ${L}: ${I}`)}if($.oauth?.clientId){let I=!!FOA(H,$)?.clientSecret,D=["client_id configured"];if(I)D.push("client_secret configured");if($.oauth.callbackPort)D.push(`callback_port ${$.oauth.callbackPort}`);console.log(` OAuth: ${D.join(", ")}`)}}else if($.type==="http"){if(console.log(" Type: http"),console.log(` URL: ${$.url}`),$.headers){console.log(" Headers:");for(let[L,I]of Object.entries($.headers))console.log(` ${L}: ${I}`)}if($.oauth?.clientId){let I=!!FOA(H,$)?.clientSecret,D=["client_id configured"];if(I)D.push("client_secret configured");if($.oauth.callbackPort)D.push(`callback_port ${$.oauth.callbackPort}`);console.log(` OAuth: ${D.join(", ")}`)}}else if($.type==="stdio"){console.log(" Type: stdio"),console.log(` Command: ${$.command}`);let L=Array.isArray($.args)?$.args:[];if(console.log(` Args: ${L.join(" ")}`),$.env){console.log(" Environment:");for(let[I,D]of Object.entries($.env))console.log(` ${I}=${D}`)}}console.log(` To remove this server, run: claude mcp remove "${H}" -s ${$.scope}`),await w0(0)}async function _j1(H,$,A){try{let L=V3H(A.scope),I=q1($),B=A.clientSecret&&I&&typeof I==="object"&&"type"in I&&(I.type==="sse"||I.type==="http")&&"url"in I&&typeof I.url==="string"&&"oauth"in I&&I.oauth&&typeof I.oauth==="object"&&"clientId"in I.oauth?await RuH():void 0;mt(H,I,L);let f=I&&typeof I==="object"&&"type"in I?String(I.type||"stdio"):"stdio";if(B&&I&&typeof I==="object"&&"type"in I&&(I.type==="sse"||I.type==="http")&&"url"in I&&typeof I.url==="string")yuH(H,{type:I.type,url:I.url},B);c("tengu_mcp_add",{scope:L,source:"json",type:f}),console.log(`Added ${f} MCP server ${H} to ${L} config`),process.exit(0)}catch(L){console.error(L.message),process.exit(1)}}async function Yj1(H){try{let $=V3H(H.scope),A=oA();c("tengu_mcp_add",{scope:$,platform:A,source:"desktop"});let{readClaudeDesktopMcpServers:L}=await Promise.resolve().then(() => (sGB(),tGB)),I=L();if(Object.keys(I).length===0)console.log("No MCP servers found in Claude Desktop configuration or configuration file does not exist."),process.exit(0);let{unmount:D}=await A8(Lx$.default.createElement(i8,null,Lx$.default.createElement(hE,null,Lx$.default.createElement(cGB,{servers:I,scope:$,onDone:()=>{D()}}))),{exitOnCtrlC:!0})}catch($){console.error($.message),process.exit(1)}}async function Cj1(){c("tengu_mcp_reset_mcpjson_choices",{}),MM((H)=>({...H,enabledMcpjsonServers:[],disabledMcpjsonServers:[],enableAllProjectMcpServers:!1})),console.log("All project-scoped (.mcp.json) server approvals and rejections have been reset."),console.log("You will be prompted for approval next time you start Claude Code."),process.exit(0)}var Lx$,eGB,HUB;var qe=K(()=>{dGB();xH();pL();AS();lGB();z$();T3();kF();n9H();f3();vA();Z9();nM();UU();Lx$=b(s(),1),eGB=require("process"),HUB=require("fs")});var rz={};XA(rz,{pluginValidateHandler:()=>wj1,pluginUpdateHandler:()=>Rj1,pluginUninstallHandler:()=>xj1,pluginListHandler:()=>Zj1,pluginInstallHandler:()=>Oj1,pluginEnableHandler:()=>Sj1,pluginDisableHandler:()=>jj1,marketplaceUpdateHandler:()=>Nj1,marketplaceRemoveHandler:()=>zj1,marketplaceListHandler:()=>Tj1,marketplaceAddHandler:()=>qj1,handleMarketplaceError:()=>hdH,VALID_UPDATE_SCOPES:()=>S1H,VALID_INSTALLABLE_SCOPES:()=>t7});function hdH(H,$){r(H instanceof Error?H:Error(String(H))),console.error(`${pH.cross} Failed to ${$}: ${H instanceof Error?H.message:String(H)}`),process.exit(1)}function wj1(H,$){if($.cowork)aC(!0);try{let A=oq$(H);if(console.log(`Validating ${A.fileType} manifest: ${A.filePath} `),A.warnings.forEach((L)=>{console.log(` ${pH.pointer} ${L.path}: ${L.message}`)}),console.log("");if(A.success){if(A.warnings.length>0)console.log(`${pH.tick} Validation passed with warnings`);else console.log(`${pH.tick} Validation passed`);process.exit(0)}else console.log(`${pH.cross} Validation failed`),process.exit(1)}catch(A){r(A instanceof Error?A:Error(String(A))),console.error(`${pH.cross} Unexpected error during validation: ${A instanceof Error?A.message:String(A)}`),process.exit(2)}}async function Zj1(H){if(H.cowork)aC(!0);c("tengu_plugin_list_command",{});let $=F7(),{getEnabledPluginsWithScopes:A}=await Promise.resolve().then(() => (uVH(),wbD)),L=A(),I=Object.keys($.plugins);if(H.json){let{enabled:B,disabled:f,errors:E}=await xf(),M=[...B,...f],G=new Map(M.map((X)=>[X.source,X])),U=[];for(let X of I.sort()){let J=$.plugins[X];if(!J||J.length===0)continue;let F=X.split("@")[0],Q=E.filter((W)=>W.source===X||("plugin"in W)&&W.plugin===F).map(UP);for(let W of J){let P=G.get(X),C;if(P){let Y=P.mcpServers||await sWA(P);if(Y&&Object.keys(Y).length>0)C=Y}U.push({id:X,version:W.version||"unknown",scope:W.scope,enabled:L.has(X),installPath:W.installPath,installedAt:W.installedAt,lastUpdated:W.lastUpdated,projectPath:W.projectPath,mcpServers:C,errors:Q.length>0?Q:void 0})}}if(H.available){let X=[];try{let[J,F]=await Promise.all([l1(),vVH()]),{marketplaces:Q}=await fm(J);for(let{name:W,data:P}of Q)if(P)for(let C of P.plugins){let Y=Qv(C.name,W);if(!K7(Y))X.push({pluginId:Y,name:C.name,description:C.description,marketplaceName:W,version:C.version,source:C.source,installCount:F?.get(Y)})}}catch{}console.log(yH({installed:U,available:X},null,2))}else console.log(yH(U,null,2));process.exit(0)}if(I.length===0)console.log("No plugins installed. Use `claude plugin install` to install a plugin."),process.exit(0);let{errors:D}=await xf();console.log(`Installed plugins: `),process.exit(1);A=$.scope}if($.cowork&&A!=="user")console.error("--cowork can only be used with user scope"),process.exit(1);await sfB(H,A)}var az=K(()=>{jI();Z$();z$();_$();uRA();y4();Ja();Q7();Vz();mq$();NRA();mgA();Q7();_X();tJ$();g$()});var DUB={};XA(DUB,{install:()=>hj1});function yj1(){let H=OA.platform==="win32",$=LUB.homedir();if(H)return IUB.join($,".local","bin","claude.exe").replace(/\//g,"\\");return"~/.local/bin/claude"}function AUB({messages:H}){if(H.length===0)return null;return Y8.default.createElement(x,{flexDirection:"column",gap:0,marginBottom:1},Y8.default.createElement(x,null,Y8.default.createElement(V,{color:"warning"},Y8.default.createElement(AZ,{status:"warning",withSpace:!0}),"Setup notes:")),H.map(($,A)=>Y8.default.createElement(x,{key:A,marginLeft:2},Y8.default.createElement(V,{dimColor:!0},"\u2022 ",$))))}function vj1({onDone:H,force:$,target:A}){let[L,I]=bdH.useState({type:"checking"});return bdH.useEffect(()=>{async function D(){try{N(`Install: Starting installation process (force=${$}, target=${A})`);let B=A||GB()?.autoUpdatesChannel||"latest";I({type:"installing",version:B}),N(`Install: Calling installLatest(channelOrVersion=${B}, forceReinstall=${$})`);let f=await fd(B,$);if(N(`Install: installLatest returned version=${f.latestVersion}, wasUpdated=${f.wasUpdated}, lockFailed=${f.lockFailed}`),f.lockFailed)throw Error("Could not install - another process is currently installing Claude. Please try again in a moment.");if(!f.latestVersion)N("Install: Failed to retrieve version information during install",{level:"error"});if(!f.wasUpdated)N("Install: Already up to date");I({type:"setting-up"});let E=await Db(!0);if(N(`Install: Setup launcher completed with ${E.length} messages`),E.length>0)E.forEach((F)=>N(`Install: Setup message: ${F.message}`));N("Install: Cleaning up npm installations after successful install");let{removed:M,errors:G,warnings:U}=await pgH();if(M>0)N(`Cleaned up ${M} npm installation(s)`);if(G.length>0)N(`Cleanup errors: ${G.join(", ")}`);let X=mgH();if(X.length>0)N(`Shell alias cleanup: ${X.map((F)=>F.message).join("; ")}`);if(c("tengu_claude_install_command",{has_version:f.latestVersion?1:0,forced:$?1:0}),A==="latest"||A==="stable")II("userSettings",{autoUpdatesChannel:A}),N(`Install: Saved autoUpdatesChannel=${A} to user settings`);let J=[...U,...X.map((F)=>F.message)];if(E.length>0)I({type:"set-up",messages:E.map((F)=>F.message)}),setTimeout(()=>{I({type:"success",version:f.latestVersion||"current",setupMessages:[...E.map((F)=>F.message),...J]})},2000);else N("Install: Shell PATH already configured"),I({type:"success",version:f.latestVersion||"current",setupMessages:J.length>0?J:void 0})}catch(B){N(`Install command failed: ${B}`,{level:"error"}),I({type:"error",message:B instanceof Error?B.message:String(B)})}}D()},[$,A]),bdH.useEffect(()=>{if(L.type==="success")setTimeout(()=>{H("Claude Code installation completed successfully",{display:"system"})},2000);else if(L.type==="error")setTimeout(()=>{H("Claude Code installation failed",{display:"system"})},3000)},[L,H]),Y8.default.createElement(x,{flexDirection:"column",marginTop:1},L.type==="checking"&&Y8.default.createElement(V,{color:"claude"},"Checking installation status..."),L.type==="cleaning-npm"&&Y8.default.createElement(V,{color:"warning"},"Cleaning up old npm installations..."),L.type==="installing"&&Y8.default.createElement(V,{color:"claude"},"Installing Claude Code native build ",L.version,"..."),L.type==="setting-up"&&Y8.default.createElement(V,{color:"claude"},"Setting up launcher and shell integration..."),L.type==="set-up"&&Y8.default.createElement(AUB,{messages:L.messages}),L.type==="success"&&Y8.default.createElement(x,{flexDirection:"column",gap:1},Y8.default.createElement(x,null,Y8.default.createElement(AZ,{status:"success",withSpace:!0}),Y8.default.createElement(V,{color:"success",bold:!0},"Claude Code successfully installed!")),Y8.default.createElement(x,{marginLeft:2,flexDirection:"column",gap:1},L.version!=="current"&&Y8.default.createElement(x,null,Y8.default.createElement(V,{dimColor:!0},"Version: "),Y8.default.createElement(V,{color:"claude"},L.version)),Y8.default.createElement(x,null,Y8.default.createElement(V,{dimColor:!0},"Location: "),Y8.default.createElement(V,{color:"text"},yj1()))),Y8.default.createElement(x,{marginLeft:2,flexDirection:"column",gap:1},Y8.default.createElement(x,{marginTop:1},Y8.default.createElement(V,{dimColor:!0},"Next: Run "),Y8.default.createElement(V,{color:"claude",bold:!0},"claude --help"),Y8.default.createElement(V,{dimColor:!0}," to get started"))),L.setupMessages&&Y8.default.createElement(AUB,{messages:L.setupMessages})),L.type==="error"&&Y8.default.createElement(x,{flexDirection:"column",gap:1},Y8.default.createElement(x,null,Y8.default.createElement(AZ,{status:"error",withSpace:!0}),Y8.default.createElement(V,{color:"error"},"Installation failed")),Y8.default.createElement(V,{color:"error"},L.message),Y8.default.createElement(x,{marginTop:1},Y8.default.createElement(V,{dimColor:!0},"Try running with --force to override checks"))))}var Y8,bdH,LUB,IUB,hj1;var BUB=K(()=>{xH();xH();Lj();E$();z$();mL();aq$();Z1();Y8=b(s(),1),bdH=b(s(),1),LUB=require("os"),IUB=require("path");hj1={type:"local-jsx",name:"install",description:"Install Claude Code native build",argumentHint:"[options]",async call(H,$,A){let L=A.includes("--force"),D=A.filter((f)=>!f.startsWith("--"))[0],{unmount:B}=await A8(Y8.default.createElement(vj1,{onDone:(f,E)=>{B(),H(f,E)},force:L,target:D}))}}});var Ix$={};XA(Ix$,{setupTokenHandler:()=>bj1,installHandler:()=>mj1,doctorHandler:()=>gj1});async function bj1(){if(c("tengu_setup_token_command",{}),await ir(),!p_())process.stderr.write(oH.yellow(`Warning: You already have authentication configured via environment variable or API key helper. `));let{ConsoleOAuthFlow:H}=await Promise.resolve().then(() => (SbH(),KJD));await new Promise(async($)=>{let{unmount:A}=await A8(YZ.default.createElement(i8,{onChangeAppState:Nj},YZ.default.createElement(x,{flexDirection:"column",gap:1},YZ.default.createElement(eO$,null),YZ.default.createElement(H,{onDone:()=>{A(),$()},mode:"setup-token",startingMessage:"This will guide you through long-lived (1-year) auth token setup for your Claude account. Claude subscription required."}))))}),process.exit(0)}function uj1({onDone:H}){return QO$(),YZ.default.createElement(YZ.default.Suspense,{fallback:null},YZ.default.createElement(kj1,{onDone:H}))}async function gj1(){c("tengu_doctor_command",{}),await new Promise(async(H)=>{let{unmount:$}=await A8(YZ.default.createElement(i8,null,YZ.default.createElement(hE,null,YZ.default.createElement(jq$,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1},YZ.default.createElement(uj1,{onDone:()=>{$(),H()}})))),ZG(!1))}),process.exit(0)}async function mj1(H,$){let{setup:A}=await Promise.resolve().then(() => (Ax$(),$x$));await A(fUB.cwd(),"default",!1,!1,void 0,!1);let{install:L}=await Promise.resolve().then(() => (BUB(),DUB));await new Promise((I)=>{let D=[];if(H)D.push(H);if($.force)D.push("--force");L.call((B)=>{I(),process.exit(B.includes("failed")?1:0)},{},D)})}var YZ,fUB,kj1;var Dx$=K(()=>{r0();xH();sv();pL();AS();Ys();GmA();rgA();fgA();z$();EI();KDH();YZ=b(s(),1),fUB=require("process");kj1=YZ.default.lazy(()=>Promise.resolve().then(() => (GRA(),HvD)).then((H)=>({default:H.Doctor})))});var EUB={};XA(EUB,{update:()=>pj1});async function pj1(){c("tengu_update_check",{}),OD(`Current version: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} `);let G=await Q1H(H);if(G&&!Bx$.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,G,{loose:!0}))OD(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} \u2192 ${G} `),OD(oH.bold(" brew upgrade claude-code")+` `);let G=await Q1H(H);if(G&&!Bx$.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,G,{loose:!0}))OD(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} \u2192 ${G} `);let G=await Q1H(H);if(G&&!Bx$.gte({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION,G,{loose:!0}))OD(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} \u2192 ${G} `),OD(oH.bold(" apk upgrade claude-code")+` `),await w0(1);if(M.latestVersion==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)OD(oH.green(`Claude Code is up to date (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION})`)+` `);else OD(oH.green(`Successfully updated from ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} to version ${M.latestVersion}`)+` `),process.stderr.write(`Try running "claude doctor" for diagnostics `),await w0(1)}}if(A.installMethod!=="native")await ggH();N("update: Checking npm registry for latest version"),N(`update: Package URL: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}`);let L=H==="stable"?"stable":"latest",I=`npm view ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL}@${L} version`;N(`update: Running: ${I}`);let D=await Q1H(H);if(N(`update: Latest version from npm: ${D||"FAILED"}`),!D){if(N("update: Failed to get latest version from npm registry"),process.stderr.write(oH.red("Failed to check for updates")+` `),{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL&&!{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL.startsWith("@anthropic"))process.stderr.write(` \u2022 Internal/development build not published to npm `);let M={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL||"@anthropic-ai/claude-code";process.stderr.write(` \u2022 Manually check: npm view ${M} version `),await w0(1)}if(D==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION)OD(oH.green(`Claude Code is up to date (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION})`)+` `),await w0(0);OD(`New version available: ${D} (current: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}) `),N(`update: Update method determined: ${f}`),N(`update: useLocalUpdate: ${B}`);let E;if(B)N("update: Calling installOrUpdateClaudePackage() for local update"),E=await jgH(H);else N("update: Calling installGlobalPackage() for global update"),E=await vgH();switch(N(`update: Installation status: ${E}`),E){case"success":OD(oH.green(`Successfully updated from ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} to version ${D}`)+` `),process.stderr.write(` cd ~/.claude/local && npm update ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL} `),process.stderr.write(`Or consider using native installation with: claude install `),process.stderr.write(` cd ~/.claude/local && npm update ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.PACKAGE_URL} `);else process.stderr.write(`Or consider using native installation with: claude install `),await w0(1);break}await w0(0)}var Bx$;var MUB=K(()=>{z$();Us();Lq$();vA();F1H();Lj();Ib();r0();E$();UU();mL();U5A();Bx$=b(OO(),1)});var FUB={};XA(FUB,{startDeferredPrefetches:()=>k8H,showSetupScreens:()=>JUB,main:()=>IR1,completeOnboarding:()=>XUB});function lj1(){try{let H=ZI("policySettings");if(H){let $=WmL(H);c("tengu_managed_settings_loaded",{keyCount:$.length,keys:$.join(",")})}}catch{}}function ij1(){if(process.env.ENABLE_TOOL_SEARCH!==void 0)return"external_tool_search_env_var";if(process.env.ENABLE_EXPERIMENTAL_MCP_CLI!==void 0)return"external_mcp_cli_env_var";return"external_default"}function nj1(){try{let H=eU(),$=ij1(),A=!1;c("tengu_mcp_cli_status",{enabled:H,source:$,legacy_env_var_set:!1})}catch{}}function rj1(){let H=xMH(),$=process.execArgv.some((L)=>{if(H)return/--inspect(-brk)?/.test(L);else return/--inspect(-brk)?|--debug(-brk)?/.test(L)}),A=process.env.NODE_OPTIONS&&/--inspect(-brk)?|--debug(-brk)?/.test(process.env.NODE_OPTIONS);try{return!!global.require("inspector").url()||$||A}catch{return $||A}}function XUB(){AA((H)=>({...H,hasCompletedOnboarding:!0,lastOnboardingVersion:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION}))}async function JUB(H,$,A,L){if(A$(!1)||process.env.IS_DEMO)return!1;let I=M$(),D=!1;if(!I.theme||!I.hasCompletedOnboarding){D=!0;let[,,{Onboarding:B}]=await Promise.all([ir(),wt(),Promise.resolve().then(() => (gMB(),uMB))]);await new Promise(async(f)=>{let{unmount:E}=await A8(R1.default.createElement(i8,{onChangeAppState:Nj},R1.default.createElement(hE,null,R1.default.createElement(B,{onDone:async()=>{XUB(),E(),await ir(),f()}}))),ZG(!1))})}if(H!=="bypassPermissions"&&!A$(process.env.CLAUBBIT)){let B=XG(!1),{TrustDialog:f}=await Promise.resolve().then(() => ($GB(),HGB));await new Promise(async(M)=>{let{unmount:G}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(f,{commands:A,onDone:async()=>{if(G(),!B)await ir();M()}}))),ZG(!1))}),oz$(),xPH(),k5();let{errors:E}=Ed();if(E.length===0)await IEB();if(await ORI()){let M=fyH();await new Promise(async(G)=>{let{unmount:U}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(Jq$,{onDone:()=>{U(),G()},isStandaloneDialog:!0,externalIncludes:M}))),ZG(!1))})}}if(XMB(),Me(),OkA(),await IWH())await new Promise(async(B)=>{let{unmount:f}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(kT$,{showIfAlreadyViewed:!1,location:D?"onboarding":"policy_update_modal",onDone:async(E)=>{if(E==="escape"){c("tengu_grove_policy_exited",{}),L9(0);return}if(f(),E!=="skip_rendering")await ir();B()}}))),ZG(!1))});if(process.env.ANTHROPIC_API_KEY){let B=Z2(process.env.ANTHROPIC_API_KEY);if(lz$(B)==="new")await new Promise(async(E)=>{let{unmount:M}=await A8(R1.default.createElement(i8,{onChangeAppState:Nj},R1.default.createElement(hE,null,R1.default.createElement(dO$,{customApiKeyTruncated:B,onDone:async()=>{M(),await ir(),E()}}))),ZG(!1))})}if((H==="bypassPermissions"||$)&&!M$().bypassPermissionsModeAccepted)await new Promise(async(B)=>{let{unmount:f}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(KEB,{onAccept:()=>{f(),B()}}))),ZG(!1))});if(L&&!M$().hasCompletedClaudeInChromeOnboarding)await new Promise(async(B)=>{let{unmount:f}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(WEB,{onDone:()=>{f(),B()}}))),ZG(!1))});return D}function aj1(){AA((H)=>({...H,numStartups:(H.numStartups??0)+1})),tj1(),XEB(C$()),aS$()?.add(1)}function oj1(){let H={};if(process.env.NODE_EXTRA_CA_CERTS)H.has_node_extra_ca_certs=!0;if(process.env.CLAUDE_CODE_CLIENT_CERT)H.has_client_cert=!0;if(cj$("--use-system-ca"))H.has_use_system_ca=!0;if(cj$("--use-openssl-ca"))H.has_use_openssl_ca=!0;return H}async function tj1(){let[H,$]=await Promise.all([z6(),VwH()]);c("tengu_startup_telemetry",{is_git:H,worktree_count:$,sandbox_enabled:vL.isSandboxingEnabled(),are_unsandboxed_commands_allowed:vL.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:vL.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:Nd(),prefers_reduced_motion:GB().prefersReducedMotion??!1,...oj1()})}function sj1(){PEB(),YEB(),TEB(),NEB(),xEB(),ZEB(),jEB(),JgD().catch(()=>{})}function ej1(){if(tI()){EL("info","prefetch_system_context_non_interactive"),k5();return}if(XG(!0))EL("info","prefetch_system_context_has_trust"),k5();else EL("info","prefetch_system_context_skipped_no_trust")}function k8H(){if(A$(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER))return;if(goD(),u5(),ej1(),ZO$(),A$(process.env.CLAUDE_CODE_USE_BEDROCK)&&!A$(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH))DmL();let H=nD();setTimeout(()=>H.abort(),3000),btH(C$(),H.signal,[]),GEB(),AF.initialize(),hPH.initialize()}function HR1(H){try{let $=H.trim(),A=$.startsWith("{")&&$.endsWith("}"),L;if(A){if(!q1($))process.stderr.write(oH.red(`Error: Invalid JSON provided to --settings `)),process.exit(1);L=YN$("claude-settings",".json"),iL(L,$,"utf8")}else{let{resolvedPath:I}=OU(zH(),H);if(!X_H.existsSync(I))process.stderr.write(oH.red(`Error: Settings file not found: ${I} `)),process.exit(1)}}function AR1(){_0("eagerLoadSettings_start");let H=fmA("--settings");if(H)HR1(H);let $=fmA("--setting-sources");if($!==void 0)$R1($);_0("eagerLoadSettings_end")}function LR1(H){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let $=process.argv.slice(2),A=$.indexOf("mcp");if(A!==-1&&$[A+1]==="serve"){process.env.CLAUDE_CODE_ENTRYPOINT="mcp";return}if(A$(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT="claude-code-github-action";return}process.env.CLAUDE_CODE_ENTRYPOINT=H?"sdk-cli":"cli"}async function IR1(){_0("main_function_start"),process.env.NoDefaultCurrentDirectoryInExePath="1",itD(),process.on("exit",()=>{MR1()}),process.on("SIGINT",()=>{process.exit(0)}),_0("main_warning_handler_initialized");let H=process.argv.slice(2),$=H.includes("-p")||H.includes("--print"),A=H.includes("--init-only"),L=H.some((f)=>f.startsWith("--sdk-url")),I=$||A||L||!process.stdout.isTTY;if(I)On();$j$(!I),LR1(I);let B=(()=>{if(process.env.GITHUB_ACTIONS==="true")return"github-action";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-ts")return"sdk-typescript";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-py")return"sdk-python";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-cli")return"sdk-cli";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-vscode")return"claude-vscode";if(process.env.CLAUDE_CODE_ENTRYPOINT==="local-agent")return"local-agent";let f=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"||f)return"remote";return"cli"})();Aj$(B),_0("main_client_type_determined"),AR1(),_0("main_before_run"),process.title="claude",await fR1(),_0("main_after_run")}function DR1(H){let $=0,A=ZG(H);if(A.stdin)c("tengu_stdin_interactive",{});let L=new ngA;return{getFpsMetrics:()=>L.getMetrics(),renderOptions:{...A,onFrame:(I)=>{if(L.record(I.durationMs),WAI())return;for(let D of I.flickers){if(D.reason==="resize")continue;let B=Date.now();if(B-$<1000)c("tengu_flicker",{desiredHeight:D.desiredHeight,actualHeight:D.availableHeight,reason:D.reason});$=B}}}}}async function BR1(H,$){if(!process.stdin.isTTY&&!process.argv.includes("mcp")){if($==="stream-json")return process.stdin;process.stdin.setEncoding("utf8");let A="";return process.stdin.on("data",(L)=>{A+=L}),await new Promise((L)=>{process.stdin.on("end",L)}),[H,A].filter(Boolean).join(` `)}return H}async function fR1(){_0("run_function_start");function H(){let D=(B)=>B.long?.replace(/^--/,"")??B.short?.replace(/^-/,"")??"";return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(B,f)=>D(B).localeCompare(D(f))})}let $=new sz$().configureHelp(H()).enablePositionalOptions();_0("run_commander_initialized"),$.hook("preAction",async()=>{_0("preAction_start");let D=etD();if(D instanceof Promise)await D;_0("preAction_after_init"),uRI(),sj1(),_0("preAction_after_migrations"),yID(),C3I(),_0("preAction_after_remote_settings"),_0("preAction_after_settings_sync")}),$.name("claude").description("Claude Code - starts an interactive session by default, use -p/--print for non-interactive output").argument("[prompt]","Your prompt",String).helpOption("-h, --help","Display help for command").option("-d, --debug [filter]",'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")',(D)=>{return!0}).addOption(new W1("-d2e, --debug-to-stderr","Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file ","Write debug logs to a specific file path (implicitly enables debug mode)",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).option("-p, --print","Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.",()=>!0).addOption(new W1("--init","Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new W1("--init-only","Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new W1("--maintenance","Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new W1("--output-format ",'Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)').choices(["text","json","stream-json"])).addOption(new W1("--json-schema ",'JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-partial-messages","Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)",()=>!0).addOption(new W1("--input-format ",'Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)').choices(["text","stream-json"])).option("--mcp-debug","[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)",()=>!0).option("--dangerously-skip-permissions","Bypass all permission checks. Recommended only for sandboxes with no internet access.",()=>!0).option("--allow-dangerously-skip-permissions","Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.",()=>!0).addOption(new W1("--max-thinking-tokens ","Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new W1("--max-turns ","Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new W1("--max-budget-usd ","Maximum dollar amount to spend on API calls (only works with --print)").argParser((D)=>{let B=Number(D);if(isNaN(B)||B<=0)throw Error("--max-budget-usd must be a positive number greater than 0");return B})).option("--replay-user-messages","Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)",()=>!0).addOption(new W1("--enable-auth-status","Enable auth status messages in SDK mode").default(!1).hideHelp()).option("--allowedTools, --allowed-tools ",'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools ",'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools ",'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--mcp-config ","Load MCP servers from JSON files or strings (space-separated)").addOption(new W1("--permission-prompt-tool ","MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new W1("--system-prompt ","System prompt to use for the session").argParser(String)).addOption(new W1("--system-prompt-file ","Read system prompt from a file").argParser(String).hideHelp()).addOption(new W1("--append-system-prompt ","Append a system prompt to the default system prompt").argParser(String)).addOption(new W1("--append-system-prompt-file ","Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new W1("--permission-mode ","Permission mode to use for the session").argParser(String).choices(qR)).option("-c, --continue","Continue the most recent conversation in the current directory",()=>!0).option("-r, --resume [value]","Resume a conversation by session ID, or open interactive picker with optional search term",(D)=>D||!0).option("--fork-session","When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)",()=>!0).option("--from-pr [value]","Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term",(D)=>D||!0).option("--no-session-persistence","Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new W1("--resume-session-at ","When resuming, only messages up to and including the assistant message with (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new W1("--rewind-files ","Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model ","Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-5-20250929').").option("--agent ","Agent for the current session. Overrides the 'agent' setting.").option("--betas ","Beta headers to include in API requests (API key users only)").option("--fallback-model ","Enable automatic fallback to specified model when default model is overloaded (only works with --print)").option("--settings ","Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir ","Additional directories to allow tool access to").option("--ide","Automatically connect to IDE on startup if exactly one valid IDE is available",()=>!0).option("--strict-mcp-config","Only use MCP servers from --mcp-config, ignoring all other MCP configurations",()=>!0).option("--session-id ","Use a specific session ID for the conversation (must be a valid UUID)").option("--agents ",`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources ","Comma-separated list of setting sources to load (user, project, local).").option("--plugin-dir ","Load plugins from directories for this session only (repeatable)").option("--disable-slash-commands","Disable all skills",()=>!0).option("--chrome","Enable Claude in Chrome integration").option("--no-chrome","Disable Claude in Chrome integration").option("--file ","File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)").action(async(D,B)=>{if(_0("action_handler_start"),D==="code")c("tengu_code_prompt_ignored",{}),console.warn(oH.yellow("Tip: You can launch Claude Code with just `claude`")),D=void 0;if(D&&typeof D==="string"&&!/\s/.test(D)&&D.length>0)c("tengu_single_word_prompt",{length:D.length});let{debug:f=!1,debugToStderr:E=!1,dangerouslySkipPermissions:M,allowDangerouslySkipPermissions:G=!1,tools:U=[],allowedTools:X=[],disallowedTools:J=[],mcpConfig:F=[],permissionMode:Q,addDir:W=[],fallbackModel:P,betas:C=[],ide:Y=!1,sessionId:Z,includePartialMessages:q,pluginDir:O=[]}=B,j,u=B.agents,y=B.agent;if(O.length>0)Xj$(O),Sx();let{outputFormat:g,inputFormat:h}=B,p=B.verbose??M$().verbose,d=B.print,k=B.init??!1,n=B.initOnly??!1,GH=B.maintenance??!1,HH=B.disableSlashCommands||!1,BH=!1,WH=BH?typeof BH==="string"?BH:QBA:void 0,wH=void 0,QH=typeof wH==="string"?wH:void 0,TH=wH!==void 0,t=!1;if(t){if(!TH)process.stderr.write(oH.red(`Error: --tmux requires --worktree ${tB}`)}if(Object.keys(qL).length>0){if(Object.keys(qL).some(F3H))throw Error(`Invalid MCP configuration: "${dw}" is a reserved MCP name.`);let tB=RHH(qL,(gD)=>({...gD,scope:"dynamic"}));bH={...bH,...tB}}}let PH=eT$(B.chrome)&&nL(),gH=!PH&&UPH();if(PH){let pA=oA();try{c("tengu_claude_in_chrome_setup",{platform:pA});let{mcpConfig:qL,allowedTools:dB,systemPrompt:tB}=EhA();if(bH={...bH,...qL},X.push(...dB),tB)$H=$H?`${tB} ${$H}`:tB}catch(qL){c("tengu_claude_in_chrome_setup_failed",{platform:pA}),N(`[Claude in Chrome] Error: ${qL}`),r(qL instanceof Error?qL:Error(String(qL))),console.error("Error: Failed to run with Claude in Chrome."),process.exit(1)}}else if(gH)try{let{mcpConfig:pA}=EhA();bH={...bH,...pA},$H=$H?`${$H} Usage: claude --remote "your task description" `),process.stdout.write(`View: https://claude.ai/code/${eH.id}?m=0 `),process.stdout.write(`Resume with: claude --teleport ${eH.id} `)),await w0(1),process.exit(1)}let O$=fLB(eH.id,W$.accessToken,W$.orgUUID,aL),YA=`https://claude.ai/code/${eH.id}?m=0`,aA=a7(`Remote session: ${eH.title} Use /session for QR code and link to open on claude.ai`,"info"),eA=aL?R$({content:LH}):null,kL={...y1,remoteSessionUrl:YA},AL=QrD(f$);await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:kL,onChangeAppState:Nj},R1.default.createElement(R8H,{debug:f||E,commands:AL,initialTools:[],initialMessages:eA?[aA,eA]:[aA],mcpClients:[],autoConnectIdeFlag:Y,mainThreadAgentDefinition:gA,disableSlashCommands:HH,remoteSessionConfig:O$}))),V1),k8H();return}else if(CH){if(await i4A(),!PK("allow_remote_sessions"))process.stderr.write(oH.red(`Error: Remote sessions are disabled by your organization's policy. `)),await w0(1),process.exit(1);if(CH===!0||CH===""){c("tengu_teleport_interactive_mode",{});let aL=await OMB();if(!aL)await w0(0),process.exit(0);let{branchError:RH}=await f3H(aL.branch);qL=B3H(aL.log,RH)}else if(typeof CH==="string"){c("tengu_teleport_resume_session",{mode:"direct"});try{let aL=await gbH(CH),RH=await xNA(aL);if(RH.status==="mismatch"||RH.status==="not_in_repo"){let eH=RH.sessionRepo;if(eH){let W$=JMB(eH),O$=FMB(W$);if(O$.length>0){let YA=await new Promise(async(aA)=>{let{unmount:eA}=await A8(R1.default.createElement(i8,null,R1.default.createElement(hE,null,R1.default.createElement(WMB,{targetRepo:eH,initialPaths:O$,onSelectPath:(kL)=>{eA(),aA(kL)},onCancel:()=>{eA(),aA(null)}}))),ZG(!1))});if(YA)process.chdir(YA),MC(YA),yS$(YA);else await w0(0)}else throw new AK(`You must run claude --teleport ${CH} from a checkout of ${eH}.`,oH.red(`You must run claude --teleport ${CH} from a checkout of ${oH.bold(eH)}. `)),process.exit(1)}if(Array.isArray(qL)){if(nqA(qL))wt();let aL;if(!gA&&c9){let O$=x$.activeAgents.find((YA)=>YA.agentType===c9);if(O$){if(gA=O$,YN(O$.agentType),aL=O$.agentType,!C_()&&O$.model&&O$.model!=="inherit")KV(m8(O$.model))}else N(`Resumed session had agent "${c9}" but it is no longer available. Using default behavior.`)}let RH=JdH(tB,gD),eH={...y1,...aL&&{agent:aL},...RH&&{standaloneAgentContext:RH},agentDefinitions:x$};_mA(B);let{waitUntilExit:W$}=await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:eH,onChangeAppState:Nj},R1.default.createElement(R8H,{debug:f||E,commands:[...f$,...WB],initialTools:gG,initialMessages:qL,initialFileHistorySnapshots:dB,initialAgentName:tB,initialAgentColor:gD,mcpClients:qA,dynamicMcpConfig:bH,mcpCliEndpoint:GD,autoConnectIdeFlag:Y,strictMcpConfig:vH,systemPrompt:EH,appendSystemPrompt:$H,mainThreadAgentDefinition:gA,disableSlashCommands:HH,taskListId:WH}))),V1);k8H(),await W$(),await w0(0)}else{let[aL,{ResumeConversation:RH}]=await Promise.all([Xd(zL()),Promise.resolve().then(() => (mGB(),gGB))]);await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:y1,onChangeAppState:Nj},R1.default.createElement(hE,null,R1.default.createElement(RH,{commands:[...f$,...WB],debug:f||E,mainThreadAgentDefinition:gA,worktreePaths:aL,initialTools:gG,mcpClients:qA,dynamicMcpConfig:bH,mcpCliEndpoint:GD,strictMcpConfig:vH,systemPrompt:EH,appendSystemPrompt:$H,initialSearchQuery:uf,disableSlashCommands:HH,forkSession:B.forkSession,taskListId:WH,filterByPr:DE})))),V1),k8H()}}else{if(v9&&IL.length===0)IL=await v9;_0("action_after_hooks"),_mA(B);let{waitUntilExit:pA}=await A8(R1.default.createElement(A_H,{getFpsMetrics:G8},R1.default.createElement(i8,{initialState:y1,onChangeAppState:Nj},R1.default.createElement(R8H,{debug:f||E,commands:[...f$,...WB],initialTools:gG,initialMessages:IL,mcpClients:qA,dynamicMcpConfig:bH,autoConnectIdeFlag:Y,strictMcpConfig:vH,systemPrompt:EH,appendSystemPrompt:$H,mcpCliEndpoint:GD,mainThreadAgentDefinition:gA,disableSlashCommands:HH,taskListId:WH}))),V1);k8H(),await pA(),await w0(0)}}).version(`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} (Claude Code)`,"-v, --version","Output the version number"),$.addOption(new W1("--agent-id ","Teammate agent ID").hideHelp()),$.addOption(new W1("--agent-name ","Teammate display name").hideHelp()),$.addOption(new W1("--team-name ","Team name for swarm coordination").hideHelp()),$.addOption(new W1("--agent-color ","Teammate UI color").hideHelp()),$.addOption(new W1("--plan-mode-required","Require plan mode before implementation").hideHelp()),$.addOption(new W1("--parent-session-id ","Parent session ID for analytics correlation").hideHelp()),$.addOption(new W1("--teammate-mode ",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),$.addOption(new W1("--agent-type ","Custom agent type for this teammate").hideHelp()),$.addOption(new W1("--sdk-url ","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),$.addOption(new W1("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),$.addOption(new W1("--remote [description]","Create a remote session with the given description").hideHelp());let A=$.command("mcp").description("Configure and manage MCP servers").helpOption("-h, --help","Display help for command").configureHelp(H()).enablePositionalOptions();A.command("serve").description("Start the Claude Code MCP server").helpOption("-h, --help","Display help for command").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:D,verbose:B})=>{let{mcpServeHandler:f}=await Promise.resolve().then(() => (qe(),Ze));await f({debug:D,verbose:B})}),SMB(A),A.command("remove ").description("Remove an MCP server").option("-s, --scope ","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{mcpRemoveHandler:f}=await Promise.resolve().then(() => (qe(),Ze));await f(D,B)}),A.command("list").description("List configured MCP servers").helpOption("-h, --help","Display help for command").action(async()=>{let{mcpListHandler:D}=await Promise.resolve().then(() => (qe(),Ze));await D()}),A.command("get ").description("Get details about an MCP server").helpOption("-h, --help","Display help for command").action(async(D)=>{let{mcpGetHandler:B}=await Promise.resolve().then(() => (qe(),Ze));await B(D)}),A.command("add-json ").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope ","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").helpOption("-h, --help","Display help for command").action(async(D,B,f)=>{let{mcpAddJsonHandler:E}=await Promise.resolve().then(() => (qe(),Ze));await E(D,B,f)}),A.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope ","Configuration scope (local, user, or project)","local").helpOption("-h, --help","Display help for command").action(async(D)=>{let{mcpAddFromDesktopHandler:B}=await Promise.resolve().then(() => (qe(),Ze));await B(D)}),A.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").helpOption("-h, --help","Display help for command").action(async()=>{let{mcpResetChoicesHandler:D}=await Promise.resolve().then(() => (qe(),Ze));await D()});let L=$.command("plugin").description("Manage Claude Code plugins").helpOption("-h, --help","Display help for command").configureHelp(H());L.command("validate ").description("Validate a plugin or marketplace manifest").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginValidateHandler:f}=await Promise.resolve().then(() => (az(),rz));f(D,B)}),L.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D)=>{let{pluginListHandler:B}=await Promise.resolve().then(() => (az(),rz));await B(D)});let I=L.command("marketplace").description("Manage Claude Code marketplaces").helpOption("-h, --help","Display help for command").configureHelp(H());return I.command("add ").description("Add a marketplace from a URL, path, or GitHub repo").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{marketplaceAddHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),I.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D)=>{let{marketplaceListHandler:B}=await Promise.resolve().then(() => (az(),rz));await B(D)}),I.command("remove ").alias("rm").description("Remove a configured marketplace").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{marketplaceRemoveHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),I.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{marketplaceUpdateHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("install ").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope ","Installation scope: user, project, or local","user").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginInstallHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("uninstall ").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope ","Uninstall from scope: user, project, or local","user").addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginUninstallHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("enable ").description("Enable a disabled plugin").option("-s, --scope ",`Installation scope: ${t7.join(", ")} (default: user)`).addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginEnableHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope ",`Installation scope: ${t7.join(", ")} (default: user)`).addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginDisableHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),L.command("update ").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope ",`Installation scope: ${S1H.join(", ")} (default: user)`).addOption(new W1("--cowork","Use cowork_plugins directory").hideHelp()).helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{pluginUpdateHandler:f}=await Promise.resolve().then(() => (az(),rz));await f(D,B)}),$.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").helpOption("-h, --help","Display help for command").action(async()=>{let{setupTokenHandler:D}=await Promise.resolve().then(() => (Dx$(),Ix$));await D()}),$.command("doctor").description("Check the health of your Claude Code auto-updater").helpOption("-h, --help","Display help for command").action(async()=>{let{doctorHandler:D}=await Promise.resolve().then(() => (Dx$(),Ix$));await D()}),$.command("update").alias("upgrade").description("Check for updates and install if available").helpOption("-h, --help","Display help for command").action(async()=>{let{update:D}=await Promise.resolve().then(() => (MUB(),EUB));await D()}),$.command("install [target]").description("Install Claude Code native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").helpOption("-h, --help","Display help for command").action(async(D,B)=>{let{installHandler:f}=await Promise.resolve().then(() => (Dx$(),Ix$));await f(D,B)}),_0("run_before_parse"),await $.parseAsync(process.argv),_0("run_after_parse"),_0("main_after_run"),tj$(),$}async function ER1({hasInitialPrompt:H,hasStdin:$,verbose:A,debug:L,debugToStderr:I,print:D,outputFormat:B,inputFormat:f,numAllowedTools:E,numDisallowedTools:M,mcpClientCount:G,worktreeEnabled:U,skipWebFetchPreflight:X,githubActionInputs:J,dangerouslySkipPermissionsPassed:F,permissionMode:Q,modeIsBypass:W,allowDangerouslySkipPermissionsPassed:P,systemPromptFlag:C,appendSystemPromptFlag:Y}){try{let Z=await osH();c("tengu_init",{entrypoint:"claude",hasInitialPrompt:H,hasStdin:$,verbose:A,debug:L,debugToStderr:I,print:D,outputFormat:B,inputFormat:f,numAllowedTools:E,numDisallowedTools:M,mcpClientCount:G,worktree:U,skipWebFetchPreflight:X,...J&&{githubActionInputs:J},dangerouslySkipPermissionsPassed:F,permissionMode:Q,modeIsBypass:W,allowDangerouslySkipPermissionsPassed:P,...C&&{systemPromptFlag:C},...Y&&{appendSystemPromptFlag:Y},...Z&&{rh:Z},is_coordinator:void 0})}catch(Z){r(Z instanceof Error?Z:Error(String(Z)))}}function _mA(H){}function MR1(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(TO)}function GR1(H){if(typeof H!=="object"||H===null)return{};let $=H,A=$.teammateMode;return{agentId:typeof $.agentId==="string"?$.agentId:void 0,agentName:typeof $.agentName==="string"?$.agentName:void 0,teamName:typeof $.teamName==="string"?$.teamName:void 0,agentColor:typeof $.agentColor==="string"?$.agentColor:void 0,planModeRequired:typeof $.planModeRequired==="boolean"?$.planModeRequired:void 0,parentSessionId:typeof $.parentSessionId==="string"?$.parentSessionId:void 0,teammateMode:A==="auto"||A==="tmux"||A==="in-process"?A:void 0,agentType:typeof $.agentType==="string"?$.agentType:void 0}}var R1,X_H,UUB,kdH,GUB=()=>(XE(),WN(GBA)),dj1=()=>WN(wQD),cj1=()=>(U6H(),WN(RZA));var KUB=K(()=>{hc();Z$();_L();Ix();ntD();HsD();gk();MN$();SD();kpH();YP();YiH();Z$();sv();xH();s1$();bgA();bT();KkA();g7();hv();r0();q9$();ugA();qE();zvH();XY();Jd();Z9();vA();EI();ZqH();Ga();DWH();T8();Gq$();AJ();$gA();_$();py();rB();AS();ggA();ojA();ifB();mQ();aI();vgA();mL();dgH();NA();h4();kT();mgA();Q7();Vz();H8H();t8();qmH();g$();nM();dx();rkA();rB();eE();Z9H();DEB();SD();igA();z$();yuA();JEB();CLH();Us();KDH();JG();yW();QEB();VEB();f3();cg();CR();I3H();bt();Nq();ruA();ELH();g$();pL();rgA();jv();g$();$q();_X();Pt();E$();_EB();CEB();qEB();zEB();OEB();SEB();REB();yEB();eVH();UMB();zVH();ip();YS();muA();DmA();VMB();CMB();xMB();ig();i3H();UU();ZE();lG();T3();jMB();nS();bOA();DL();nh();PI();uT$();WgA();JDH();FdH();W4();$s();EM();yMB();BW();ypH();Z6();R1=b(s(),1),X_H=require("fs"),UUB=require("process"),kdH=require("path");_0("main_tsx_entry");_0("main_tsx_imports_loaded");if(rj1())process.exit(1)});process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CLAUDE_CODE_REMOTE==="true"){let H=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=H?`${H} --max-old-space-size=8192`:"--max-old-space-size=8192"}async function XR1(){let H=process.argv.slice(2);if(H.length===1&&(H[0]==="--version"||H[0]==="-v"||H[0]==="-V")){console.log(`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.37",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-02-07T18:38:43Z"}.VERSION} (Claude Code)`);return}let{profileCheckpoint:$}=await Promise.resolve().then(() => (hc(),HiA));if($("cli_entry"),H[0]==="--mcp-cli"){let{isMcpCliEnabled:D}=await Promise.resolve().then(() => (BW(),soD));if(D()){let B=H.slice(1),{mcpCliMain:f}=await Promise.resolve().then(() => (StD(),xtD));process.exit(await f(B))}}if(H[0]==="--ripgrep"){$("cli_ripgrep_path");let D=H.slice(1),{ripgrepMain:B}=await Promise.resolve().then(() => (ytD(),RtD));process.exitCode=B(D);return}if(process.argv[2]==="--claude-in-chrome-mcp"){$("cli_claude_in_chrome_mcp_path");let{runClaudeInChromeMcpServer:D}=await Promise.resolve().then(() => (btD(),htD));await D();return}else if(process.argv[2]==="--chrome-native-host"){$("cli_chrome_native_host_path");let{runChromeNativeHost:D}=await Promise.resolve().then(() => (ctD(),dtD));await D();return}let A=H.includes("--tmux")||H.includes("--tmux=classic");if(H.length===1&&(H[0]==="--update"||H[0]==="--upgrade"))process.argv=[process.argv[0],process.argv[1],"update"];let{startCapturingEarlyInput:L}=await Promise.resolve().then(() => YHI);L(),$("cli_before_main_import");let{main:I}=await Promise.resolve().then(() => (KUB(),FUB));$("cli_after_main_import"),await I(),$("cli_after_main_complete")}XR1();}) // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. slice reader: searching via slice-by-line strategy/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/searcher/mod.rsgrep_searcher::searcherslice reader: searching via multiline strategyslice reader: needs transcoding, using generic readergeneric reader: searching via roll buffer strategygeneric reader: reading everything to heap for multilinegeneric reader: searching via multiline strategy: searching via memory map /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/json.rs/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/encoding_rs_io-0.1.7/src/util.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/io/mod.rsstream did not contain valid UTF-8a formatting trait implementation returned an error when the underlying stream did notfailed to write whole bufferinternal error: entered unreachable codemid > len/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/bstr-1.10.0/src/io.rs/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/bstr-1.10.0/src/ext_slice.rsassertion failed: filled <= self.buf.init/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/io/borrowed_buf.rs \/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rsignoring : found binary data at offset grep_printer::json: :/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/cli/src/pattern.rs [38;5;15mcrates/core/flags/config.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/matcher/src/lib.rs is not <= /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/lines.rsassertion failed: start <= endassertion failed: m.0 <= m.1/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/searcher/core.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/searcher/glue.rsassertion failed: self.rdr.buffer()[self.core.pos()..].is_empty()/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/regex-automata-0.4.7/src/util/pool.rs /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/vec/spec_from_iter_nested.rsregex: thread ID allocation space exhausted/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/regex-automata-0.4.7/src/util/pool.rsfailed to write the buffered data/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/iter/traits/iterator.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/slice/sort/stable/quicksort.rsmid > len/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/napi-2.16.17/src/bindgen_runtime/js_values/array.rsFound inconsistent data type in Array when converting to Rust Vecattempt to join into collection with len > usize::MAX/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/str.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/ignore/src/walk.rsseparator must be valid UTF-8 (use escape sequences to provide a separator that is not valid UTF-8)sorting by last modified isn't supported: sorting by last accessed isn't supported: sorting by creation time isn't supported: HelpShort failed to write whole buffer/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/io/mod.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/clone.rsdescription() is deprecated; use Displaycalled `Result::unwrap()` on an `Err` valuePartialWithLineNumbererrWithDepthdepthchildIoUnrecognizedFileTypeInvalidDefinitionArc counter overflow/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/sync.rsLineTerminatorParseIntErrorParseSizeErrorUnrecognizedOutTypeUnrecognizedSpecTypeUnrecognizedColorUnrecognizedStyleInvalidFormatErrorcontextsource/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/ignore/src/dir.rsIgnore::add_parents called on non-root matchercannot parse integer from empty stringinvalid digit found in stringnumber too large to fit in target typenumber too small to fit in target typenumber would be zero for non-zero typeSearchUnavailableMismatchedLineTerminatorsmatcherUnknownEncodinglabelHyperlinkFormatError/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rs& final regex: /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/regex/src/matcher.rsgrep_regex::matcher/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/regex-automata-0.4.7/src/util/pool.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sync/poison/once.rsa Display implementation returned an error unexpectedly/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/string.rs /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/summary.rs /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed/convert.rs|(?:)/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/regex/src/config.rsassembling HIR from fixed string literalsgrep_regex::config/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/str/pattern.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/iter/traits/iterator.rscalled `Result::unwrap()` on an `Err` value.Failed to create reference for `this` in async class factoryFailed to initialize napi function call.Failed to get element with index ``Error/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/string.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rscapacity overflow/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/raw_vec/mod.rsTryFromIntError-s '\'complete -c rg !SHORT! -l !LONG! -d '!DOC!'!SHORT!!LONG!!DOC! -r -f -r -F -r -f -a '(__fish_complete_command)' -r -f -a '(rg --type-list | string replace : \t)'complete -c rg -l !NEGATED! -n '__fish_contains_opt !SHORT! !LONG!' -d '!DOC!' /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/matcher/src/lib.rs /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/lines.rsassertion failed: start <= endassertion failed: m.0 <= m.1/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/searcher/core.rsassertion failed: self.after_context_left >= 1searcher core: will use slow line searchergrep_searcher::searcher::coresearcher core: will use fast line searcher/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/regex-automata-0.4.7/src/util/pool.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/iter/traits/iterator.rs : /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/cli/src/decompress.rs: error spawning command '': (falling back to uncompressed reader)grep_cli::decompressinternal error: entered unreachable code: got flag value but expected switchcrates/core/flags/mod.rsinternal error: entered unreachable code: got switch but expected flag value /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/thread/local.rsa Display implementation returned an error unexpectedly/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/string.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/str/pattern.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/iter/traits/iterator.rsError/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/ignore/src/types.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/globset/src/lib.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/ignore/src/gitignore.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/ignore/src/walk.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rs called `Result::unwrap()` on an `Err` value/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/globset/src/lib.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/ignore/src/gitignore.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/ignore/src/walk.rsopened gitignore file: ignore::gitignore./.OkErrfatal runtime error: thread result panicked on drop, aborting /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/searcher/mod.rsBinaryDetection/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/summary.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/standard.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/cli/src/decompress.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rs is not <= /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/matcher/src/lib.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/standard.rsassertion failed: start <= end binary file matches (found /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/hyperlink.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/io/impls.rsPoisonErrorNoVariablesNoPathVariableNoLineVariableInvalidVariableInvalidSchemeInvalidCloseVariableignoring : found binary data at offset grep_printer::standard }{/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/matcher/src/interpolate.rsvalid UTF-8 capture name/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/matcher/src/lib.rsassertion failed: start <= end/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/json.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/util.rs/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/printer/src/standard.rsDecodeReaderBytesBuilder: buffer of size is too small/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/encoding_rs_io-0.1.7/src/lib.rsinternal buffer should never be exhausted/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/regex-automata-0.4.7/src/util/pool.rs/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/regex-automata-0.4.7/src/util/search.rsinvalid span for haystack of length ()Utf8Errorvalid_up_toerror_lenbinary_offsetstatsbyteslinesline_numberabsolute_offsetsubmatcheselapsedsearches_with_matchbytes_searchedbytes_printedmatched_linesmatchesbeginendmatchcontextstartnanoshuman }{/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/searcher/src/line_buffer.rsinternal error: entered unreachable code/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sync/mpmc/list.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sync/mpmc/waker.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sync/mpmc/context.rscalled `Result::unwrap()` on an `Err` valueLineTerminatorConvert/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rsRIPGREP_CONFIG_PATH: arguments loaded from config file: crates/core/flags/config.rsripgrep::flags::config: /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/time.rsattempt to join into collection with len > usize::MAX/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/str.rsmid > lenABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/overflow when adding durations is not <= /Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/matcher/src/lib.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/raw_vec/mod.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rss LineTerminator/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/slice.rsconfigured allocation limit () exceededcrates/searcher/src/line_buffer.rsassertion failed: amt <= self.buffer().len()assertion failed: !self.free_buffer().is_empty(): failed to open memory map: crates/searcher/src/searcher/mmap.rsgrep_searcher::searcher::mmapfailed to open memory map: grep config error: no available searchersgrep config error: mismatched line terminators, matcher has but searcher has grep config error: unknown encoding: crates/searcher/src/searcher/mod.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/raw_vec/mod.rsassertion failed: start <= end/Users/kurt/code/claude-cli-internal-static-arm64-ripgrep/vendor/ripgrep-src/crates/matcher/src/lib.rscrates/searcher/src/lines.rsassertion failed: m.0 <= m.1/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/memmap2-0.9.4/src/unix.rs/rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/os/fd/raw.rsInputEmptyOutputFullinput should be exhausted/Users/kurt/.cargo/registry/src/artifactory.infra.ant.dev-7db23613d841872b/encoding_rs_io-0.1.7/src/util.rssrc must be empty when last==truetranscoder has unconsumed bytes